@opentrust/dashboard 7.3.22 → 7.3.25

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.
@@ -1,4 +1,4 @@
1
- function Xw(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 Bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fp={exports:{}},Ya={},hp={exports:{}},se={};/**
1
+ function Y1(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 Bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fp={exports:{}},Ya={},hp={exports:{}},oe={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ function Xw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Vo=Symbol.for("react.element"),Qw=Symbol.for("react.portal"),qw=Symbol.for("react.fragment"),Zw=Symbol.for("react.strict_mode"),Jw=Symbol.for("react.profiler"),e1=Symbol.for("react.provider"),t1=Symbol.for("react.context"),n1=Symbol.for("react.forward_ref"),r1=Symbol.for("react.suspense"),s1=Symbol.for("react.memo"),o1=Symbol.for("react.lazy"),Lf=Symbol.iterator;function i1(e){return e===null||typeof e!="object"?null:(e=Lf&&e[Lf]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pp=Object.assign,gp={};function Ns(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}Ns.prototype.isReactComponent={};Ns.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")};Ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xp(){}xp.prototype=Ns.prototype;function Uc(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}var Wc=Uc.prototype=new xp;Wc.constructor=Uc;pp(Wc,Ns.prototype);Wc.isPureReactComponent=!0;var Af=Array.isArray,yp=Object.prototype.hasOwnProperty,Kc={current:null},vp={key:!0,ref:!0,__self:!0,__source:!0};function wp(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)yp.call(t,r)&&!vp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Vo,type:e,key:o,ref:i,props:s,_owner:Kc.current}}function a1(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yc(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 zf=/\/+/g;function Ll(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 Qw:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ll(i,0):r,Af(s)?(n="",e!=null&&(n=e.replace(zf,"$&/")+"/"),$i(s,t,n,"",function(c){return c})):s!=null&&(Yc(s)&&(s=a1(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(zf,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Af(e))for(var a=0;a<e.length;a++){o=e[a];var u=r+Ll(o,a);i+=$i(o,t,n,u,s)}else if(u=i1(e),typeof u=="function")for(e=u.call(e),a=0;!(o=e.next()).done;)o=o.value,u=r+Ll(o,a++),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 u1(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 Ze={current:null},Oi={transition:null},c1={ReactCurrentDispatcher:Ze,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(!Yc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=Ns;se.Fragment=qw;se.Profiler=Jw;se.PureComponent=Uc;se.StrictMode=Zw;se.Suspense=r1;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=c1;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=pp({},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 a=e.type.defaultProps;for(u in t)yp.call(t,u)&&!vp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Vo,type:e.type,key:s,ref:o,props:r,_owner:i}};se.createContext=function(e){return e={$$typeof:t1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:e1,_context:e},e.Consumer=e};se.createElement=wp;se.createFactory=function(e){var t=wp.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:n1,render:e}};se.isValidElement=Yc;se.lazy=function(e){return{$$typeof:o1,_payload:{_status:-1,_result:e},_init:u1}};se.memo=function(e,t){return{$$typeof:s1,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 Ze.current.useCallback(e,t)};se.useContext=function(e){return Ze.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};se.useEffect=function(e,t){return Ze.current.useEffect(e,t)};se.useId=function(){return Ze.current.useId()};se.useImperativeHandle=function(e,t,n){return Ze.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Ze.current.useMemo(e,t)};se.useReducer=function(e,t,n){return Ze.current.useReducer(e,t,n)};se.useRef=function(e){return Ze.current.useRef(e)};se.useState=function(e){return Ze.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return Ze.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return Ze.current.useTransition()};se.version="18.3.0";hp.exports=se;var p=hp.exports;const Ut=Bc(p),d1=Xw({__proto__:null,default:Ut},[p]);/**
9
+ */var Vo=Symbol.for("react.element"),G1=Symbol.for("react.portal"),X1=Symbol.for("react.fragment"),Q1=Symbol.for("react.strict_mode"),q1=Symbol.for("react.profiler"),Z1=Symbol.for("react.provider"),J1=Symbol.for("react.context"),ew=Symbol.for("react.forward_ref"),tw=Symbol.for("react.suspense"),nw=Symbol.for("react.memo"),rw=Symbol.for("react.lazy"),Lf=Symbol.iterator;function sw(e){return e===null||typeof e!="object"?null:(e=Lf&&e[Lf]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pp=Object.assign,gp={};function Ns(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}Ns.prototype.isReactComponent={};Ns.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")};Ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xp(){}xp.prototype=Ns.prototype;function Uc(e,t,n){this.props=e,this.context=t,this.refs=gp,this.updater=n||mp}var Wc=Uc.prototype=new xp;Wc.constructor=Uc;pp(Wc,Ns.prototype);Wc.isPureReactComponent=!0;var Af=Array.isArray,yp=Object.prototype.hasOwnProperty,Kc={current:null},vp={key:!0,ref:!0,__self:!0,__source:!0};function wp(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)yp.call(t,r)&&!vp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Vo,type:e,key:o,ref:i,props:s,_owner:Kc.current}}function ow(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function iw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zf=/\/+/g;function Ll(e,t){return typeof e=="object"&&e!==null&&e.key!=null?iw(""+e.key):t.toString(36)}function Oi(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 G1:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ll(i,0):r,Af(s)?(n="",e!=null&&(n=e.replace(zf,"$&/")+"/"),Oi(s,t,n,"",function(c){return c})):s!=null&&(Yc(s)&&(s=ow(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(zf,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Af(e))for(var a=0;a<e.length;a++){o=e[a];var u=r+Ll(o,a);i+=Oi(o,t,n,u,s)}else if(u=sw(e),typeof u=="function")for(e=u.call(e),a=0;!(o=e.next()).done;)o=o.value,u=r+Ll(o,a++),i+=Oi(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 oi(e,t,n){if(e==null)return e;var r=[],s=0;return Oi(e,r,"","",function(o){return t.call(n,o,s++)}),r}function aw(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 Ze={current:null},Fi={transition:null},lw={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:Fi,ReactCurrentOwner:Kc};oe.Children={map:oi,forEach:function(e,t,n){oi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oi(e,function(){t++}),t},toArray:function(e){return oi(e,function(t){return t})||[]},only:function(e){if(!Yc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Ns;oe.Fragment=X1;oe.Profiler=q1;oe.PureComponent=Uc;oe.StrictMode=Q1;oe.Suspense=tw;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lw;oe.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=pp({},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 a=e.type.defaultProps;for(u in t)yp.call(t,u)&&!vp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Vo,type:e.type,key:s,ref:o,props:r,_owner:i}};oe.createContext=function(e){return e={$$typeof:J1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Z1,_context:e},e.Consumer=e};oe.createElement=wp;oe.createFactory=function(e){var t=wp.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:ew,render:e}};oe.isValidElement=Yc;oe.lazy=function(e){return{$$typeof:rw,_payload:{_status:-1,_result:e},_init:aw}};oe.memo=function(e,t){return{$$typeof:nw,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Fi.transition;Fi.transition={};try{e()}finally{Fi.transition=t}};oe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};oe.useCallback=function(e,t){return Ze.current.useCallback(e,t)};oe.useContext=function(e){return Ze.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Ze.current.useEffect(e,t)};oe.useId=function(){return Ze.current.useId()};oe.useImperativeHandle=function(e,t,n){return Ze.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Ze.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Ze.current.useReducer(e,t,n)};oe.useRef=function(e){return Ze.current.useRef(e)};oe.useState=function(e){return Ze.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Ze.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Ze.current.useTransition()};oe.version="18.3.0";hp.exports=oe;var p=hp.exports;const Bt=Bc(p),uw=Y1({__proto__:null,default:Bt},[p]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ function Xw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var f1=p,h1=Symbol.for("react.element"),m1=Symbol.for("react.fragment"),p1=Object.prototype.hasOwnProperty,g1=f1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x1={key:!0,ref:!0,__self:!0,__source:!0};function Np(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)p1.call(t,r)&&!x1.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:h1,type:e,key:o,ref:i,props:s,_owner:g1.current}}Ya.Fragment=m1;Ya.jsx=Np;Ya.jsxs=Np;fp.exports=Ya;var l=fp.exports,Eu={},Sp={exports:{}},mt={},bp={exports:{}},kp={};/**
17
+ */var cw=p,dw=Symbol.for("react.element"),fw=Symbol.for("react.fragment"),hw=Object.prototype.hasOwnProperty,mw=cw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pw={key:!0,ref:!0,__self:!0,__source:!0};function Np(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)hw.call(t,r)&&!pw.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:dw,type:e,key:o,ref:i,props:s,_owner:mw.current}}Ya.Fragment=fw;Ya.jsx=Np;Ya.jsxs=Np;fp.exports=Ya;var l=fp.exports,Eu={},Sp={exports:{}},gt={},bp={exports:{}},kp={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ function Xw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(E,P){var z=E.length;E.push(P);e:for(;0<z;){var F=z-1>>>1,O=E[F];if(0<s(O,P))E[F]=P,E[z]=O,z=F;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var P=E[0],z=E.pop();if(z!==P){E[0]=z;e:for(var F=0,O=E.length,U=O>>>1;F<U;){var B=2*(F+1)-1,K=E[B],Y=B+1,G=E[Y];if(0>s(K,z))Y<O&&0>s(G,K)?(E[F]=G,E[Y]=z,F=Y):(E[F]=K,E[B]=z,F=B);else if(Y<O&&0>s(G,z))E[F]=G,E[Y]=z,F=Y;else break e}}return P}function s(E,P){var z=E.sortIndex-P.sortIndex;return z!==0?z:E.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,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],c=[],h=1,d=null,f=3,x=!1,y=!1,w=!1,N=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(E){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=E)r(c),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(c)}}function S(E){if(w=!1,g(E),!y)if(n(u)!==null)y=!0,M(b);else{var P=n(c);P!==null&&D(S,P.startTime-E)}}function b(E,P){y=!1,w&&(w=!1,m(_),_=-1),x=!0;var z=f;try{for(g(P),d=n(u);d!==null&&(!(d.expirationTime>P)||E&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=P);P=e.unstable_now(),typeof O=="function"?d.callback=O: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&&D(S,B.startTime-P),U=!1}return U}finally{d=null,f=z,x=!1}}var j=!1,k=null,_=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(k!==null){var E=e.unstable_now();$=E;var P=!0;try{P=k(!0,E)}finally{P?A():(j=!1,k=null)}}else j=!1}var A;if(typeof v=="function")A=function(){v(T)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,L=C.port2;C.port1.onmessage=T,A=function(){L.postMessage(null)}}else A=function(){N(T,0)};function M(E){k=E,j||(j=!0,A())}function D(E,P){_=N(function(){E(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(E){E.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(b))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(E){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var z=f;f=P;try{return E()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,P){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=f;f=E;try{return P()}finally{f=z}},e.unstable_scheduleCallback=function(E,P,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,E){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,E={id:h++,callback:P,priorityLevel:E,startTime:z,expirationTime:O,sortIndex:-1},z>F?(E.sortIndex=z,t(c,E),n(u)===null&&E===n(c)&&(w?(m(_),_=-1):w=!0,D(S,z-F))):(E.sortIndex=O,t(u,E),y||x||(y=!0,M(b))),E},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(E){var P=f;return function(){var z=f;f=P;try{return E.apply(this,arguments)}finally{f=z}}}})(kp);bp.exports=kp;var y1=bp.exports;/**
25
+ */(function(e){function t(E,P){var z=E.length;E.push(P);e:for(;0<z;){var F=z-1>>>1,O=E[F];if(0<s(O,P))E[F]=P,E[z]=O,z=F;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var P=E[0],z=E.pop();if(z!==P){E[0]=z;e:for(var F=0,O=E.length,U=O>>>1;F<U;){var B=2*(F+1)-1,K=E[B],Y=B+1,G=E[Y];if(0>s(K,z))Y<O&&0>s(G,K)?(E[F]=G,E[Y]=z,F=Y):(E[F]=K,E[B]=z,F=B);else if(Y<O&&0>s(G,z))E[F]=G,E[Y]=z,F=Y;else break e}}return P}function s(E,P){var z=E.sortIndex-P.sortIndex;return z!==0?z:E.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,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],c=[],h=1,d=null,f=3,x=!1,y=!1,w=!1,N=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(E){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=E)r(c),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(c)}}function S(E){if(w=!1,g(E),!y)if(n(u)!==null)y=!0,M(b);else{var P=n(c);P!==null&&D(S,P.startTime-E)}}function b(E,P){y=!1,w&&(w=!1,m(_),_=-1),x=!0;var z=f;try{for(g(P),d=n(u);d!==null&&(!(d.expirationTime>P)||E&&!R());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var O=F(d.expirationTime<=P);P=e.unstable_now(),typeof O=="function"?d.callback=O: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&&D(S,B.startTime-P),U=!1}return U}finally{d=null,f=z,x=!1}}var j=!1,k=null,_=-1,I=5,$=-1;function R(){return!(e.unstable_now()-$<I)}function T(){if(k!==null){var E=e.unstable_now();$=E;var P=!0;try{P=k(!0,E)}finally{P?A():(j=!1,k=null)}}else j=!1}var A;if(typeof v=="function")A=function(){v(T)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,L=C.port2;C.port1.onmessage=T,A=function(){L.postMessage(null)}}else A=function(){N(T,0)};function M(E){k=E,j||(j=!0,A())}function D(E,P){_=N(function(){E(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(E){E.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(b))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(E){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var z=f;f=P;try{return E()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,P){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=f;f=E;try{return P()}finally{f=z}},e.unstable_scheduleCallback=function(E,P,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,E){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,E={id:h++,callback:P,priorityLevel:E,startTime:z,expirationTime:O,sortIndex:-1},z>F?(E.sortIndex=z,t(c,E),n(u)===null&&E===n(c)&&(w?(m(_),_=-1):w=!0,D(S,z-F))):(E.sortIndex=O,t(u,E),y||x||(y=!0,M(b))),E},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(E){var P=f;return function(){var z=f;f=P;try{return E.apply(this,arguments)}finally{f=z}}}})(kp);bp.exports=kp;var gw=bp.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ function Xw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var v1=p,ft=y1;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 jp=new Set,po={};function br(e,t){rs(e,t),rs(e+"Capture",t)}function rs(e,t){for(po[e]=t,e=0;e<t.length;e++)jp.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,w1=/^[: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]*$/,Df={},$f={};function N1(e){return _u.call($f,e)?!0:_u.call(Df,e)?!1:w1.test(e)?$f[e]=!0:(Df[e]=!0,!1)}function S1(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 b1(e,t,n,r){if(t===null||typeof t>"u"||S1(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 Je(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 Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ve[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new Je(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){Ve[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function Xc(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(Gc,Xc);Ve[t]=new Je(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(Gc,Xc);Ve[t]=new Je(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(Gc,Xc);Ve[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qc(e,t,n,r){var s=Ve.hasOwnProperty(t)?Ve[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(b1(t,n,s,r)&&(n=null),r||s===null?N1(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 xn=v1.__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"),qc=Symbol.for("react.strict_mode"),Pu=Symbol.for("react.profiler"),Cp=Symbol.for("react.provider"),Ep=Symbol.for("react.context"),Zc=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),Jc=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),_p=Symbol.for("react.offscreen"),Of=Symbol.iterator;function zs(e){return e===null||typeof e!="object"?null:(e=Of&&e[Of]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Al;function Qs(e){if(Al===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Al=t&&t[1]||""}return`
33
+ */var xw=p,mt=gw;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 jp=new Set,po={};function br(e,t){rs(e,t),rs(e+"Capture",t)}function rs(e,t){for(po[e]=t,e=0;e<t.length;e++)jp.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,yw=/^[: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]*$/,Df={},$f={};function vw(e){return _u.call($f,e)?!0:_u.call(Df,e)?!1:yw.test(e)?$f[e]=!0:(Df[e]=!0,!1)}function ww(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 Nw(e,t,n,r){if(t===null||typeof t>"u"||ww(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 Je(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 Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ve[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[e]=new Je(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){Ve[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function Xc(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(Gc,Xc);Ve[t]=new Je(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(Gc,Xc);Ve[t]=new Je(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(Gc,Xc);Ve[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qc(e,t,n,r){var s=Ve.hasOwnProperty(t)?Ve[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Nw(t,n,s,r)&&(n=null),r||s===null?vw(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 xn=xw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ii=Symbol.for("react.element"),Lr=Symbol.for("react.portal"),Ar=Symbol.for("react.fragment"),qc=Symbol.for("react.strict_mode"),Pu=Symbol.for("react.profiler"),Cp=Symbol.for("react.provider"),Ep=Symbol.for("react.context"),Zc=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),Jc=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),_p=Symbol.for("react.offscreen"),Of=Symbol.iterator;function zs(e){return e===null||typeof e!="object"?null:(e=Of&&e[Of]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Al;function Qs(e){if(Al===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Al=t&&t[1]||""}return`
34
34
  `+Al+e}var zl=!1;function Dl(e,t){if(!e||zl)return"";zl=!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
35
  `),o=r.stack.split(`
36
36
  `),i=s.length-1,a=o.length-1;1<=i&&0<=a&&s[i]!==o[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==o[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==o[a]){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<=a);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qs(e):""}function k1(e){switch(e.tag){case 5:return Qs(e.type);case 16:return Qs("Lazy");case 13:return Qs("Suspense");case 19:return Qs("SuspenseList");case 0:case 2:case 15:return e=Dl(e.type,!1),e;case 11:return e=Dl(e.type.render,!1),e;case 1:return e=Dl(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 qc:return"StrictMode";case Mu:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ep:return(e.displayName||"Context")+".Consumer";case Cp:return(e._context.displayName||"Context")+".Provider";case Zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc: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 j1(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===qc?"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 Pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function C1(e){var t=Pp(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=C1(e))}function Mp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ia(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 je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(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 Ip(e,t){t=t.checked,t!=null&&Qc(e,"checked",t,!1)}function Lu(e,t){Ip(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 Hf(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"||ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qs=Array.isArray;function Gr(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 je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vf(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 Rp(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 Bf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tp(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"?Tp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ai,Lp=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(ai=ai||document.createElement("div"),ai.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ai.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var no={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},E1=["Webkit","ms","Moz","O"];Object.keys(no).forEach(function(e){E1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),no[t]=no[e]})});function Ap(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||no.hasOwnProperty(e)&&no[e]?(""+t).trim():t+"px"}function zp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Ap(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var _1=je({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(_1[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 ed(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 Uf(e){if(e=Wo(e)){if(typeof Hu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Za(t),Hu(e.stateNode,e.type,t))}}function Dp(e){Xr?Qr?Qr.push(e):Qr=[e]:Xr=e}function $p(){if(Xr){var e=Xr,t=Qr;if(Qr=Xr=null,Uf(e),t)for(e=0;e<t.length;e++)Uf(t[e])}}function Op(e,t){return e(t)}function Fp(){}var $l=!1;function Hp(e,t,n){if($l)return e(t,n);$l=!0;try{return Op(e,t,n)}finally{$l=!1,(Xr!==null||Qr!==null)&&(Fp(),$p())}}function xo(e,t){var n=e.stateNode;if(n===null)return null;var r=Za(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(fn)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Vu=!1}function P1(e,t,n,r,s,o,i,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var ro=!1,aa=null,la=!1,Bu=null,M1={onError:function(e){ro=!0,aa=e}};function I1(e,t,n,r,s,o,i,a,u){ro=!1,aa=null,P1.apply(M1,arguments)}function R1(e,t,n,r,s,o,i,a,u){if(I1.apply(this,arguments),ro){if(ro){var c=aa;ro=!1,aa=null}else throw Error(H(198));la||(la=!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 Vp(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 Wf(e){if(kr(e)!==e)throw Error(H(188))}function T1(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 Wf(s),e;if(o===r)return Wf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i){for(a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.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 Bp(e){return e=T1(e),e!==null?Up(e):null}function Up(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Up(e);if(t!==null)return t;e=e.sibling}return null}var Wp=ft.unstable_scheduleCallback,Kf=ft.unstable_cancelCallback,L1=ft.unstable_shouldYield,A1=ft.unstable_requestPaint,Ee=ft.unstable_now,z1=ft.unstable_getCurrentPriorityLevel,td=ft.unstable_ImmediatePriority,Kp=ft.unstable_UserBlockingPriority,ua=ft.unstable_NormalPriority,D1=ft.unstable_LowPriority,Yp=ft.unstable_IdlePriority,Ga=null,Gt=null;function $1(e){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(Ga,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:H1,O1=Math.log,F1=Math.LN2;function H1(e){return e>>>=0,e===0?32:31-(O1(e)/F1|0)|0}var li=64,ui=4194304;function Zs(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 ca(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 a=i&~s;a!==0?r=Zs(a):(o&=i,o!==0&&(r=Zs(o)))}else i=n&~s,i!==0?r=Zs(i):o!==0&&(r=Zs(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 V1(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 B1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Tt(o),a=1<<i,u=s[i];u===-1?(!(a&n)||a&r)&&(s[i]=V1(a,t)):u<=t&&(e.expiredLanes|=a),o&=~a}}function Uu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gp(){var e=li;return li<<=1,!(li&4194240)&&(li=64),e}function Ol(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 U1(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 nd(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 de=0;function Xp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qp,rd,qp,Zp,Jp,Wu=!1,ci=[],Ln=null,An=null,zn=null,yo=new Map,vo=new Map,Pn=[],W1="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":yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(t.pointerId)}}function $s(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&&rd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function K1(e,t,n,r,s){switch(t){case"focusin":return Ln=$s(Ln,e,t,n,r,s),!0;case"dragenter":return An=$s(An,e,t,n,r,s),!0;case"mouseover":return zn=$s(zn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return yo.set(o,$s(yo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,vo.set(o,$s(vo.get(o)||null,e,t,n,r,s)),!0}return!1}function eg(e){var t=nr(e.target);if(t!==null){var n=kr(t);if(n!==null){if(t=n.tag,t===13){if(t=Vp(n),t!==null){e.blockedOn=t,Jp(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=Ku(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&&rd(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),yo.forEach(Gf),vo.forEach(Gf)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,Wu||(Wu=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,Y1)))}function wo(e){function t(s){return Os(s,e)}if(0<ci.length){Os(ci[0],e);for(var n=1;n<ci.length;n++){var r=ci[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ln!==null&&Os(Ln,e),An!==null&&Os(An,e),zn!==null&&Os(zn,e),yo.forEach(t),vo.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);)eg(n),n.blockedOn===null&&Pn.shift()}var qr=xn.ReactCurrentBatchConfig,da=!0;function G1(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=1,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function X1(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=4,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function sd(e,t,n,r){if(da){var s=Ku(e,t,n,r);if(s===null)Xl(e,t,r,fa,n),Yf(e,r);else if(K1(s,e,t,n,r))r.stopPropagation();else if(Yf(e,r),t&4&&-1<W1.indexOf(e)){for(;s!==null;){var o=Wo(s);if(o!==null&&Qp(o),o=Ku(e,t,n,r),o===null&&Xl(e,t,r,fa,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var fa=null;function Ku(e,t,n,r){if(fa=null,e=ed(r),e=nr(e),e!==null)if(t=kr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vp(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 fa=e,null}function tg(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(z1()){case td:return 1;case Kp:return 4;case ua:case D1:return 16;case Yp:return 536870912;default:return 16}default:return 16}}var Rn=null,od=null,Hi=null;function ng(){if(Hi)return Hi;var e,t=od,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 Xf(){return!1}function pt(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 a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?di:Xf,this.isPropagationStopped=Xf,this}return je(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 Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},id=pt(Ss),Uo=je({},Ss,{view:0,detail:0}),Q1=pt(Uo),Fl,Hl,Fs,Xa=je({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ad,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!==Fs&&(Fs&&e.type==="mousemove"?(Fl=e.screenX-Fs.screenX,Hl=e.screenY-Fs.screenY):Hl=Fl=0,Fs=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:Hl}}),Qf=pt(Xa),q1=je({},Xa,{dataTransfer:0}),Z1=pt(q1),J1=je({},Uo,{relatedTarget:0}),Vl=pt(J1),eN=je({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),tN=pt(eN),nN=je({},Ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rN=pt(nN),sN=je({},Ss,{data:0}),qf=pt(sN),oN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iN={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"},aN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=aN[e])?!!t[e]:!1}function ad(){return lN}var uN=je({},Uo,{key:function(e){if(e.key){var t=oN[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"?iN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ad,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}}),cN=pt(uN),dN=je({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=pt(dN),fN=je({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ad}),hN=pt(fN),mN=je({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),pN=pt(mN),gN=je({},Xa,{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}),xN=pt(gN),yN=[9,13,27,32],ld=fn&&"CompositionEvent"in window,so=null;fn&&"documentMode"in document&&(so=document.documentMode);var vN=fn&&"TextEvent"in window&&!so,rg=fn&&(!ld||so&&8<so&&11>=so),Jf=" ",eh=!1;function sg(e,t){switch(e){case"keyup":return yN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function wN(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(eh=!0,Jf);case"textInput":return e=t.data,e===Jf&&eh?null:e;default:return null}}function NN(e,t){if(zr)return e==="compositionend"||!ld&&sg(e,t)?(e=ng(),Hi=od=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 rg&&t.locale!=="ko"?null:t.data;default:return null}}var SN={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 th(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!SN[e.type]:t==="textarea"}function ig(e,t,n,r){Dp(r),t=ha(t,"onChange"),0<t.length&&(n=new id("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oo=null,No=null;function bN(e){xg(e,0)}function Qa(e){var t=Or(e);if(Mp(t))return e}function kN(e,t){if(e==="change")return t}var ag=!1;if(fn){var Bl;if(fn){var Ul="oninput"in document;if(!Ul){var nh=document.createElement("div");nh.setAttribute("oninput","return;"),Ul=typeof nh.oninput=="function"}Bl=Ul}else Bl=!1;ag=Bl&&(!document.documentMode||9<document.documentMode)}function rh(){oo&&(oo.detachEvent("onpropertychange",lg),No=oo=null)}function lg(e){if(e.propertyName==="value"&&Qa(No)){var t=[];ig(t,No,e,ed(e)),Hp(bN,t)}}function jN(e,t,n){e==="focusin"?(rh(),oo=t,No=n,oo.attachEvent("onpropertychange",lg)):e==="focusout"&&rh()}function CN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qa(No)}function EN(e,t){if(e==="click")return Qa(t)}function _N(e,t){if(e==="input"||e==="change")return Qa(t)}function PN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:PN;function So(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 sh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function oh(e,t){var n=sh(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=sh(n)}}function ug(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ug(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(){for(var e=window,t=ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ia(e.document)}return t}function ud(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 MN(e){var t=cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(r!==null&&ud(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=oh(n,o);var i=oh(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 IN=fn&&"documentMode"in document&&11>=document.documentMode,Dr=null,Yu=null,io=null,Gu=!1;function ih(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gu||Dr==null||Dr!==ia(r)||(r=Dr,"selectionStart"in r&&ud(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}),io&&So(io,r)||(io=r,r=ha(Yu,"onSelect"),0<r.length&&(t=new id("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")},Wl={},dg={};fn&&(dg=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 qa(e){if(Wl[e])return Wl[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dg)return Wl[e]=t[n];return e}var fg=qa("animationend"),hg=qa("animationiteration"),mg=qa("animationstart"),pg=qa("transitionend"),gg=new Map,ah="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){gg.set(e,t),br(t,[e])}for(var Kl=0;Kl<ah.length;Kl++){var Yl=ah[Kl],RN=Yl.toLowerCase(),TN=Yl[0].toUpperCase()+Yl.slice(1);Xn(RN,"on"+TN)}Xn(fg,"onAnimationEnd");Xn(hg,"onAnimationIteration");Xn(mg,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(pg,"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 Js="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(" "),LN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Js));function lh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,R1(r,t,void 0,e),e.currentTarget=null}function xg(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 a=r[i],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}else for(i=0;i<r.length;i++){if(a=r[i],u=a.instance,c=a.currentTarget,a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}}}if(la)throw e=Bu,la=!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)||(yg(t,e,2,!1),n.add(r))}function Gl(e,t,n){var r=0;t&&(r|=4),yg(n,e,r,t)}var hi="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[hi]){e[hi]=!0,jp.forEach(function(n){n!=="selectionchange"&&(LN.has(n)||Gl(n,!1,e),Gl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,Gl("selectionchange",!1,t))}}function yg(e,t,n,r){switch(tg(t)){case 1:var s=G1;break;case 4:s=X1;break;default:s=sd}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 Xl(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 a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.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(;a!==null;){if(i=nr(a),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}a=a.parentNode}}r=r.return}Hp(function(){var c=o,h=ed(n),d=[];e:{var f=gg.get(e);if(f!==void 0){var x=id,y=e;switch(e){case"keypress":if(Vi(n)===0)break e;case"keydown":case"keyup":x=cN;break;case"focusin":y="focus",x=Vl;break;case"focusout":y="blur",x=Vl;break;case"beforeblur":case"afterblur":x=Vl;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=Qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Z1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=hN;break;case fg:case hg:case mg:x=tN;break;case pg:x=pN;break;case"scroll":x=Q1;break;case"wheel":x=xN;break;case"copy":case"cut":case"paste":x=rN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Zf}var w=(t&4)!==0,N=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,m!==null&&(S=xo(v,m),S!=null&&w.push(ko(v,S,g)))),N)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[hn]))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&&(N=kr(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=Qf,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Zf,S="onPointerLeave",m="onPointerEnter",v="pointer"),N=x==null?f:Or(x),g=y==null?f:Or(y),f=new w(S,v+"leave",x,n,h),f.target=N,f.relatedTarget=g,S=null,nr(h)===c&&(w=new w(m,v+"enter",y,n,h),w.target=g,w.relatedTarget=N,S=w),N=S,x&&y)t:{for(w=x,m=y,v=0,g=w;g;g=Pr(g))v++;for(g=0,S=m;S;S=Pr(S))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&&uh(d,f,x,w,!1),y!==null&&N!==null&&uh(d,N,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=kN;else if(th(f))if(ag)b=_N;else{b=CN;var j=jN}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=EN);if(b&&(b=b(e,c))){ig(d,b,n,h);break e}j&&j(e,f,c),e==="focusout"&&(j=f._wrapperState)&&j.controlled&&f.type==="number"&&Au(f,"number",f.value)}switch(j=c?Or(c):window,e){case"focusin":(th(j)||j.contentEditable==="true")&&(Dr=j,Yu=c,io=null);break;case"focusout":io=Yu=Dr=null;break;case"mousedown":Gu=!0;break;case"contextmenu":case"mouseup":case"dragend":Gu=!1,ih(d,n,h);break;case"selectionchange":if(IN)break;case"keydown":case"keyup":ih(d,n,h)}var k;if(ld)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zr?sg(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(rg&&n.locale!=="ko"&&(zr||_!=="onCompositionStart"?_==="onCompositionEnd"&&zr&&(k=ng()):(Rn=h,od="value"in Rn?Rn.value:Rn.textContent,zr=!0)),j=ha(c,_),0<j.length&&(_=new qf(_,e,null,n,h),d.push({event:_,listeners:j}),k?_.data=k:(k=og(n),k!==null&&(_.data=k)))),(k=vN?wN(e,n):NN(e,n))&&(c=ha(c,"onBeforeInput"),0<c.length&&(h=new qf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=k))}xg(d,t)})}function ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ha(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=xo(e,n),o!=null&&r.unshift(ko(e,o,s)),o=xo(e,t),o!=null&&r.push(ko(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 uh(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,s?(u=xo(n,o),u!=null&&i.unshift(ko(n,u,a))):s||(u=xo(n,o),u!=null&&i.push(ko(n,u,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var AN=/\r\n?/g,zN=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(AN,`
38
- `).replace(zN,"")}function mi(e,t,n){if(t=ch(t),ch(e)!==t&&n)throw Error(H(425))}function ma(){}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,DN=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,$N=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(ON)}:Zu;function ON(e){setTimeout(function(){throw e})}function Ql(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),wo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);wo(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 fh(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 bs=Math.random().toString(36).slice(2),Kt="__reactFiber$"+bs,jo="__reactProps$"+bs,hn="__reactContainer$"+bs,Ju="__reactEvents$"+bs,FN="__reactListeners$"+bs,HN="__reactHandles$"+bs;function nr(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fh(e);e!==null;){if(n=e[Kt])return n;e=fh(e)}return t}e=n,n=e.parentNode}return null}function Wo(e){return e=e[Kt]||e[hn],!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 Za(e){return e[jo]||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),st=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 ot(e){return e=e.childContextTypes,e!=null}function pa(){ge(st),ge(Ge)}function hh(e,t,n){if(Ge.current!==Un)throw Error(H(168));fe(Ge,t),fe(st,n)}function vg(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,j1(e)||"Unknown",s));return je({},n,r)}function ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,fr=Ge.current,fe(Ge,e),fe(st,st.current),!0}function mh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=vg(e,t,fr),r.__reactInternalMemoizedMergedChildContext=e,ge(st),ge(Ge),fe(Ge,e)):ge(st),fe(st,n)}var on=null,Ja=!1,ql=!1;function wg(e){on===null?on=[e]:on.push(e)}function VN(e){Ja=!0,wg(e)}function qn(){if(!ql&&on!==null){ql=!0;var e=0,t=de;try{var n=on;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}on=null,Ja=!1}catch(s){throw on!==null&&(on=on.slice(e+1)),Wp(td,qn),s}finally{de=t,ql=!1}}return null}var Hr=[],Vr=0,xa=null,ya=0,gt=[],xt=0,hr=null,an=1,ln="";function Jn(e,t){Hr[Vr++]=ya,Hr[Vr++]=xa,xa=e,ya=t}function Ng(e,t,n){gt[xt++]=an,gt[xt++]=ln,gt[xt++]=hr,hr=e;var r=an;e=ln;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,ln=o+e}else an=1<<o|n<<s|r,ln=e}function cd(e){e.return!==null&&(Jn(e,1),Ng(e,1,0))}function dd(e){for(;e===xa;)xa=Hr[--Vr],Hr[Vr]=null,ya=Hr[--Vr],Hr[Vr]=null;for(;e===hr;)hr=gt[--xt],gt[xt]=null,ln=gt[--xt],gt[xt]=null,an=gt[--xt],gt[xt]=null}var ct=null,ut=null,xe=!1,Pt=null;function Sg(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ph(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,ct=e,ut=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hr!==null?{id:an,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=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=ut;if(t){var n=t;if(!ph(e,t)){if(tc(e))throw Error(H(418));t=Dn(n.nextSibling);var r=ct;t&&ph(e,t)?Sg(r,n):(e.flags=e.flags&-4097|2,xe=!1,ct=e)}}else{if(tc(e))throw Error(H(418));e.flags=e.flags&-4097|2,xe=!1,ct=e}}}function gh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function pi(e){if(e!==ct)return!1;if(!xe)return gh(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=ut)){if(tc(e))throw bg(),Error(H(418));for(;t;)Sg(e,t),t=Dn(t.nextSibling)}if(gh(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){ut=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Dn(e.stateNode.nextSibling):null;return!0}function bg(){for(var e=ut;e;)e=Dn(e.nextSibling)}function os(){ut=ct=null,xe=!1}function fd(e){Pt===null?Pt=[e]:Pt.push(e)}var BN=xn.ReactCurrentBatchConfig;function Hs(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 a=s.refs;i===null?delete a[o]:a[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 xh(e){var t=e._init;return t(e._payload)}function kg(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 a(m,v,g,S){return v===null||v.tag!==6?(v=su(g,m.mode,S),v.return=m,v):(v=s(v,g),v.return=m,v)}function u(m,v,g,S){var b=g.type;return b===Ar?h(m,v,g.props.children,S,g.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===v.type)?(S=s(v,g.props),S.ref=Hs(m,v,g),S.return=m,S):(S=Xi(g.type,g.key,g.props,null,m.mode,S),S.ref=Hs(m,v,g),S.return=m,S)}function c(m,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ou(g,m.mode,S),v.return=m,v):(v=s(v,g.children||[]),v.return=m,v)}function h(m,v,g,S,b){return v===null||v.tag!==7?(v=lr(g,m.mode,S,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=Hs(m,null,v),g.return=m,g;case Lr:return v=ou(v,m.mode,g),v.return=m,v;case En:var S=v._init;return d(m,S(v._payload),g)}if(qs(v)||zs(v))return v=lr(v,m.mode,g,null),v.return=m,v;gi(m,v)}return null}function f(m,v,g,S){var b=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:a(m,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case oi:return g.key===b?u(m,v,g,S):null;case Lr:return g.key===b?c(m,v,g,S):null;case En:return b=g._init,f(m,v,b(g._payload),S)}if(qs(g)||zs(g))return b!==null?null:h(m,v,g,S,null);gi(m,g)}return null}function x(m,v,g,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(g)||null,a(v,m,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case oi:return m=m.get(S.key===null?g:S.key)||null,u(v,m,S,b);case Lr:return m=m.get(S.key===null?g:S.key)||null,c(v,m,S,b);case En:var j=S._init;return x(m,v,g,j(S._payload),b)}if(qs(S)||zs(S))return m=m.get(g)||null,h(v,m,S,b,null);gi(v,S)}return null}function y(m,v,g,S){for(var b=null,j=null,k=v,_=v=0,I=null;k!==null&&_<g.length;_++){k.index>_?(I=k,k=null):I=k.sibling;var $=f(m,k,g[_],S);if($===null){k===null&&(k=I);break}e&&k&&$.alternate===null&&t(m,k),v=o($,v,_),j===null?b=$:j.sibling=$,j=$,k=I}if(_===g.length)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;_<g.length;_++)k=d(m,g[_],S),k!==null&&(v=o(k,v,_),j===null?b=k:j.sibling=k,j=k);return xe&&Jn(m,_),b}for(k=r(m,k);_<g.length;_++)I=x(k,m,_,g[_],S),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?_:I.key),v=o(I,v,_),j===null?b=I:j.sibling=I,j=I);return e&&k.forEach(function(R){return t(m,R)}),xe&&Jn(m,_),b}function w(m,v,g,S){var b=zs(g);if(typeof b!="function")throw Error(H(150));if(g=b.call(g),g==null)throw Error(H(151));for(var j=b=null,k=v,_=v=0,I=null,$=g.next();k!==null&&!$.done;_++,$=g.next()){k.index>_?(I=k,k=null):I=k.sibling;var R=f(m,k,$.value,S);if(R===null){k===null&&(k=I);break}e&&k&&R.alternate===null&&t(m,k),v=o(R,v,_),j===null?b=R:j.sibling=R,j=R,k=I}if($.done)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;!$.done;_++,$=g.next())$=d(m,$.value,S),$!==null&&(v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return xe&&Jn(m,_),b}for(k=r(m,k);!$.done;_++,$=g.next())$=x(k,m,_,$.value,S),$!==null&&(e&&$.alternate!==null&&k.delete($.key===null?_:$.key),v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return e&&k.forEach(function(T){return t(m,T)}),xe&&Jn(m,_),b}function N(m,v,g,S){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,j=v;j!==null;){if(j.key===b){if(b=g.type,b===Ar){if(j.tag===7){n(m,j.sibling),v=s(j,g.props.children),v.return=m,m=v;break e}}else if(j.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===j.type){n(m,j.sibling),v=s(j,g.props),v.ref=Hs(m,j,g),v.return=m,m=v;break e}n(m,j);break}else t(m,j);j=j.sibling}g.type===Ar?(v=lr(g.props.children,m.mode,S,g.key),v.return=m,m=v):(S=Xi(g.type,g.key,g.props,null,m.mode,S),S.ref=Hs(m,v,g),S.return=m,m=S)}return i(m);case Lr:e:{for(j=g.key;v!==null;){if(v.key===j)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,S),v.return=m,m=v}return i(m);case En:return j=g._init,N(m,v,j(g._payload),S)}if(qs(g))return y(m,v,g,S);if(zs(g))return w(m,v,g,S);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,S),v.return=m,m=v),i(m)):n(m,v)}return N}var is=kg(!0),jg=kg(!1),va=Qn(null),wa=null,Br=null,hd=null;function md(){hd=Br=wa=null}function pd(e){var t=va.current;ge(va),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){wa=e,hd=Br=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(hd!==e)if(e={context:e,memoizedValue:t,next:null},Br===null){if(wa===null)throw Error(H(308));Br=e,wa.dependencies={lanes:0,firstContext:e}}else Br=Br.next=e;return t}var rr=null;function gd(e){rr===null?rr=[e]:rr.push(e)}function Cg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gd(t)):(n.next=s.next,s.next=n),t.interleaved=n,mn(e,r)}function mn(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 xd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eg(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 cn(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,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,mn(e,n)}return s=r.interleaved,s===null?(t.next=t,gd(r)):(t.next=s.next,s.next=t),r.interleaved=t,mn(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,nd(e,n)}}function yh(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 Na(e,t,n,r){var s=e.updateQueue;_n=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==i&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,a=o;do{var f=a.lane,x=a.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;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=je({},d,f);break e;case 2:_n=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else x={eventTime:x,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=x,u=d):h=h.next=x,i|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=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 vh(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 Ko={},Xt=Qn(Ko),Co=Qn(Ko),Eo=Qn(Ko);function sr(e){if(e===Ko)throw Error(H(174));return e}function yd(e,t){switch(fe(Eo,t),fe(Co,e),fe(Xt,Ko),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 as(){ge(Xt),ge(Co),ge(Eo)}function _g(e){sr(Eo.current);var t=sr(Xt.current),n=Du(t,e.type);t!==n&&(fe(Co,e),fe(Xt,n))}function vd(e){Co.current===e&&(ge(Xt),ge(Co))}var Ne=Qn(0);function Sa(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 Zl=[];function wd(){for(var e=0;e<Zl.length;e++)Zl[e]._workInProgressVersionPrimary=null;Zl.length=0}var Ui=xn.ReactCurrentDispatcher,Jl=xn.ReactCurrentBatchConfig,mr=0,be=null,Re=null,ze=null,ba=!1,ao=!1,_o=0,UN=0;function Ue(){throw Error(H(321))}function Nd(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 Sd(e,t,n,r,s,o){if(mr=o,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ui.current=e===null||e.memoizedState===null?GN:XN,e=n(r,s),ao){o=0;do{if(ao=!1,_o=0,25<=o)throw Error(H(301));o+=1,ze=Re=null,t.updateQueue=null,Ui.current=QN,e=n(r,s)}while(ao)}if(Ui.current=ka,t=Re!==null&&Re.next!==null,mr=0,ze=Re=be=null,ba=!1,t)throw Error(H(300));return e}function bd(){var e=_o!==0;return _o=0,e}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?be.memoizedState=ze=e:ze=ze.next=e,ze}function bt(){if(Re===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=ze===null?be.memoizedState:ze.next;if(t!==null)ze=t,Re=e;else{if(e===null)throw Error(H(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},ze===null?be.memoizedState=ze=e:ze=ze.next=e}return ze}function Po(e,t){return typeof t=="function"?t(e):t}function eu(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Re,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 a=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?(a=u=d,i=r):u=u.next=d,be.lanes|=h,pr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=a,At(r,t.memoizedState)||(nt=!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,be.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=bt(),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)||(nt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Pg(){}function Mg(e,t){var n=be,r=bt(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,nt=!0),r=r.queue,kd(Tg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,Mo(9,Rg.bind(null,n,r,s,t),void 0,null),De===null)throw Error(H(349));mr&30||Ig(n,t,s)}return s}function Ig(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rg(e,t,n,r){t.value=n,t.getSnapshot=r,Lg(t)&&Ag(e)}function Tg(e,t,n){return n(function(){Lg(t)&&Ag(e)})}function Lg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function Ag(e){var t=mn(e,1);t!==null&&Lt(t,e,1,-1)}function wh(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:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=YN.bind(null,be,e),[t.memoizedState,e]}function Mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.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 zg(){return bt().memoizedState}function Wi(e,t,n,r){var s=Bt();be.flags|=e,s.memoizedState=Mo(1|t,n,void 0,r===void 0?null:r)}function el(e,t,n,r){var s=bt();r=r===void 0?null:r;var o=void 0;if(Re!==null){var i=Re.memoizedState;if(o=i.destroy,r!==null&&Nd(r,i.deps)){s.memoizedState=Mo(t,n,o,r);return}}be.flags|=e,s.memoizedState=Mo(1|t,n,o,r)}function Nh(e,t){return Wi(8390656,8,e,t)}function kd(e,t){return el(2048,8,e,t)}function Dg(e,t){return el(4,2,e,t)}function $g(e,t){return el(4,4,e,t)}function Og(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 Fg(e,t,n){return n=n!=null?n.concat([e]):null,el(4,4,Og.bind(null,t,e),n)}function jd(){}function Hg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Bg(e,t,n){return mr&21?(At(n,t)||(n=Gp(),be.lanes|=n,pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function WN(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Jl.transition;Jl.transition={};try{e(!1),t()}finally{de=n,Jl.transition=r}}function Ug(){return bt().memoizedState}function KN(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Kg(t,n);else if(n=Cg(e,t,n,r),n!==null){var s=Qe();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(Wg(e))Kg(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,a=o(i,n);if(s.hasEagerState=!0,s.eagerState=a,At(a,i)){var u=t.interleaved;u===null?(s.next=s,gd(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Cg(e,t,s,r),n!==null&&(s=Qe(),Lt(n,e,r,s),Yg(n,t,r))}}function Wg(e){var t=e.alternate;return e===be||t!==null&&t===be}function Kg(e,t){ao=ba=!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,nd(e,n)}}var ka={readContext:St,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},GN={readContext:St,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Nh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wi(4194308,4,Og.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=KN.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:wh,useDebugValue:jd,useDeferredValue:function(e){return Bt().memoizedState=e},useTransition:function(){var e=wh(!1),t=e[0];return e=WN.bind(null,e[1]),Bt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,s=Bt();if(xe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),De===null)throw Error(H(349));mr&30||Ig(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Nh(Tg.bind(null,r,o,e),[e]),r.flags|=2048,Mo(9,Rg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Bt(),t=De.identifierPrefix;if(xe){var n=ln,r=an;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=UN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},XN={readContext:St,useCallback:Hg,useContext:St,useEffect:kd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:eu,useRef:zg,useState:function(){return eu(Po)},useDebugValue:jd,useDeferredValue:function(e){var t=bt();return Bg(t,Re.memoizedState,e)},useTransition:function(){var e=eu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1},QN={readContext:St,useCallback:Hg,useContext:St,useEffect:kd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:tu,useRef:zg,useState:function(){return tu(Po)},useDebugValue:jd,useDeferredValue:function(e){var t=bt();return Re===null?t.memoizedState=e:Bg(t,Re.memoizedState,e)},useTransition:function(){var e=tu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1};function Ct(e,t){if(e&&e.defaultProps){t=je({},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:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qe(),s=Fn(e),o=cn(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=Qe(),s=Fn(e),o=cn(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=Qe(),r=Fn(e),s=cn(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 Sh(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?!So(n,r)||!So(s,o):!0}function Gg(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=St(o):(s=ot(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=tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function bh(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&&tl.enqueueReplaceState(t,t.state,null)}function oc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},xd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=St(o):(o=ot(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&&tl.enqueueReplaceState(s,s.state,null),Na(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ls(e,t){try{var n="",r=t;do n+=k1(r),r=r.return;while(r);var s=n}catch(o){s=`
37
+ `+s[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=a);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qs(e):""}function Sw(e){switch(e.tag){case 5:return Qs(e.type);case 16:return Qs("Lazy");case 13:return Qs("Suspense");case 19:return Qs("SuspenseList");case 0:case 2:case 15:return e=Dl(e.type,!1),e;case 11:return e=Dl(e.type.render,!1),e;case 1:return e=Dl(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 qc:return"StrictMode";case Mu:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ep:return(e.displayName||"Context")+".Consumer";case Cp:return(e._context.displayName||"Context")+".Provider";case Zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc: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 bw(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===qc?"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 Pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kw(e){var t=Pp(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 ai(e){e._valueTracker||(e._valueTracker=kw(e))}function Mp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ia(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 je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(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 Ip(e,t){t=t.checked,t!=null&&Qc(e,"checked",t,!1)}function Lu(e,t){Ip(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 Hf(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"||ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qs=Array.isArray;function Gr(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 je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vf(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 Rp(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 Bf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tp(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"?Tp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var li,Lp=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 go(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var no={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},jw=["Webkit","ms","Moz","O"];Object.keys(no).forEach(function(e){jw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),no[t]=no[e]})});function Ap(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||no.hasOwnProperty(e)&&no[e]?(""+t).trim():t+"px"}function zp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Ap(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Cw=je({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(Cw[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 ed(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 Uf(e){if(e=Wo(e)){if(typeof Hu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Za(t),Hu(e.stateNode,e.type,t))}}function Dp(e){Xr?Qr?Qr.push(e):Qr=[e]:Xr=e}function $p(){if(Xr){var e=Xr,t=Qr;if(Qr=Xr=null,Uf(e),t)for(e=0;e<t.length;e++)Uf(t[e])}}function Op(e,t){return e(t)}function Fp(){}var $l=!1;function Hp(e,t,n){if($l)return e(t,n);$l=!0;try{return Op(e,t,n)}finally{$l=!1,(Xr!==null||Qr!==null)&&(Fp(),$p())}}function xo(e,t){var n=e.stateNode;if(n===null)return null;var r=Za(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(fn)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Vu=!1}function Ew(e,t,n,r,s,o,i,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var ro=!1,aa=null,la=!1,Bu=null,_w={onError:function(e){ro=!0,aa=e}};function Pw(e,t,n,r,s,o,i,a,u){ro=!1,aa=null,Ew.apply(_w,arguments)}function Mw(e,t,n,r,s,o,i,a,u){if(Pw.apply(this,arguments),ro){if(ro){var c=aa;ro=!1,aa=null}else throw Error(H(198));la||(la=!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 Vp(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 Wf(e){if(kr(e)!==e)throw Error(H(188))}function Iw(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 Wf(s),e;if(o===r)return Wf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i){for(a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.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 Bp(e){return e=Iw(e),e!==null?Up(e):null}function Up(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Up(e);if(t!==null)return t;e=e.sibling}return null}var Wp=mt.unstable_scheduleCallback,Kf=mt.unstable_cancelCallback,Rw=mt.unstable_shouldYield,Tw=mt.unstable_requestPaint,Ee=mt.unstable_now,Lw=mt.unstable_getCurrentPriorityLevel,td=mt.unstable_ImmediatePriority,Kp=mt.unstable_UserBlockingPriority,ua=mt.unstable_NormalPriority,Aw=mt.unstable_LowPriority,Yp=mt.unstable_IdlePriority,Ga=null,Yt=null;function zw(e){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Ga,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:Ow,Dw=Math.log,$w=Math.LN2;function Ow(e){return e>>>=0,e===0?32:31-(Dw(e)/$w|0)|0}var ui=64,ci=4194304;function Zs(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 ca(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 a=i&~s;a!==0?r=Zs(a):(o&=i,o!==0&&(r=Zs(o)))}else i=n&~s,i!==0?r=Zs(i):o!==0&&(r=Zs(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 Fw(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 Hw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Tt(o),a=1<<i,u=s[i];u===-1?(!(a&n)||a&r)&&(s[i]=Fw(a,t)):u<=t&&(e.expiredLanes|=a),o&=~a}}function Uu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gp(){var e=ui;return ui<<=1,!(ui&4194240)&&(ui=64),e}function Ol(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 Vw(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 nd(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 de=0;function Xp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qp,rd,qp,Zp,Jp,Wu=!1,di=[],Ln=null,An=null,zn=null,yo=new Map,vo=new Map,Pn=[],Bw="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":yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(t.pointerId)}}function $s(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&&rd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Uw(e,t,n,r,s){switch(t){case"focusin":return Ln=$s(Ln,e,t,n,r,s),!0;case"dragenter":return An=$s(An,e,t,n,r,s),!0;case"mouseover":return zn=$s(zn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return yo.set(o,$s(yo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,vo.set(o,$s(vo.get(o)||null,e,t,n,r,s)),!0}return!1}function eg(e){var t=nr(e.target);if(t!==null){var n=kr(t);if(n!==null){if(t=n.tag,t===13){if(t=Vp(n),t!==null){e.blockedOn=t,Jp(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 Hi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ku(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&&rd(t),e.blockedOn=n,!1;t.shift()}return!0}function Gf(e,t,n){Hi(e)&&n.delete(t)}function Ww(){Wu=!1,Ln!==null&&Hi(Ln)&&(Ln=null),An!==null&&Hi(An)&&(An=null),zn!==null&&Hi(zn)&&(zn=null),yo.forEach(Gf),vo.forEach(Gf)}function Os(e,t){e.blockedOn===t&&(e.blockedOn=null,Wu||(Wu=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,Ww)))}function wo(e){function t(s){return Os(s,e)}if(0<di.length){Os(di[0],e);for(var n=1;n<di.length;n++){var r=di[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ln!==null&&Os(Ln,e),An!==null&&Os(An,e),zn!==null&&Os(zn,e),yo.forEach(t),vo.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);)eg(n),n.blockedOn===null&&Pn.shift()}var qr=xn.ReactCurrentBatchConfig,da=!0;function Kw(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=1,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function Yw(e,t,n,r){var s=de,o=qr.transition;qr.transition=null;try{de=4,sd(e,t,n,r)}finally{de=s,qr.transition=o}}function sd(e,t,n,r){if(da){var s=Ku(e,t,n,r);if(s===null)Xl(e,t,r,fa,n),Yf(e,r);else if(Uw(s,e,t,n,r))r.stopPropagation();else if(Yf(e,r),t&4&&-1<Bw.indexOf(e)){for(;s!==null;){var o=Wo(s);if(o!==null&&Qp(o),o=Ku(e,t,n,r),o===null&&Xl(e,t,r,fa,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var fa=null;function Ku(e,t,n,r){if(fa=null,e=ed(r),e=nr(e),e!==null)if(t=kr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vp(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 fa=e,null}function tg(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(Lw()){case td:return 1;case Kp:return 4;case ua:case Aw:return 16;case Yp:return 536870912;default:return 16}default:return 16}}var Rn=null,od=null,Vi=null;function ng(){if(Vi)return Vi;var e,t=od,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 Vi=s.slice(e,1<r?1-r:void 0)}function Bi(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 fi(){return!0}function Xf(){return!1}function xt(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 a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?fi:Xf,this.isPropagationStopped=Xf,this}return je(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=fi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fi)},persist:function(){},isPersistent:fi}),t}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},id=xt(Ss),Uo=je({},Ss,{view:0,detail:0}),Gw=xt(Uo),Fl,Hl,Fs,Xa=je({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ad,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!==Fs&&(Fs&&e.type==="mousemove"?(Fl=e.screenX-Fs.screenX,Hl=e.screenY-Fs.screenY):Hl=Fl=0,Fs=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:Hl}}),Qf=xt(Xa),Xw=je({},Xa,{dataTransfer:0}),Qw=xt(Xw),qw=je({},Uo,{relatedTarget:0}),Vl=xt(qw),Zw=je({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),Jw=xt(Zw),eN=je({},Ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tN=xt(eN),nN=je({},Ss,{data:0}),qf=xt(nN),rN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sN={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"},oN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=oN[e])?!!t[e]:!1}function ad(){return iN}var aN=je({},Uo,{key:function(e){if(e.key){var t=rN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ad,charCode:function(e){return e.type==="keypress"?Bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lN=xt(aN),uN=je({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=xt(uN),cN=je({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ad}),dN=xt(cN),fN=je({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),hN=xt(fN),mN=je({},Xa,{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}),pN=xt(mN),gN=[9,13,27,32],ld=fn&&"CompositionEvent"in window,so=null;fn&&"documentMode"in document&&(so=document.documentMode);var xN=fn&&"TextEvent"in window&&!so,rg=fn&&(!ld||so&&8<so&&11>=so),Jf=" ",eh=!1;function sg(e,t){switch(e){case"keyup":return gN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function yN(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(eh=!0,Jf);case"textInput":return e=t.data,e===Jf&&eh?null:e;default:return null}}function vN(e,t){if(zr)return e==="compositionend"||!ld&&sg(e,t)?(e=ng(),Vi=od=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 rg&&t.locale!=="ko"?null:t.data;default:return null}}var wN={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 th(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wN[e.type]:t==="textarea"}function ig(e,t,n,r){Dp(r),t=ha(t,"onChange"),0<t.length&&(n=new id("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oo=null,No=null;function NN(e){xg(e,0)}function Qa(e){var t=Or(e);if(Mp(t))return e}function SN(e,t){if(e==="change")return t}var ag=!1;if(fn){var Bl;if(fn){var Ul="oninput"in document;if(!Ul){var nh=document.createElement("div");nh.setAttribute("oninput","return;"),Ul=typeof nh.oninput=="function"}Bl=Ul}else Bl=!1;ag=Bl&&(!document.documentMode||9<document.documentMode)}function rh(){oo&&(oo.detachEvent("onpropertychange",lg),No=oo=null)}function lg(e){if(e.propertyName==="value"&&Qa(No)){var t=[];ig(t,No,e,ed(e)),Hp(NN,t)}}function bN(e,t,n){e==="focusin"?(rh(),oo=t,No=n,oo.attachEvent("onpropertychange",lg)):e==="focusout"&&rh()}function kN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qa(No)}function jN(e,t){if(e==="click")return Qa(t)}function CN(e,t){if(e==="input"||e==="change")return Qa(t)}function EN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:EN;function So(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 sh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function oh(e,t){var n=sh(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=sh(n)}}function ug(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ug(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(){for(var e=window,t=ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ia(e.document)}return t}function ud(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 _N(e){var t=cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(r!==null&&ud(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=oh(n,o);var i=oh(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 PN=fn&&"documentMode"in document&&11>=document.documentMode,Dr=null,Yu=null,io=null,Gu=!1;function ih(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gu||Dr==null||Dr!==ia(r)||(r=Dr,"selectionStart"in r&&ud(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}),io&&So(io,r)||(io=r,r=ha(Yu,"onSelect"),0<r.length&&(t=new id("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function hi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $r={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionend:hi("Transition","TransitionEnd")},Wl={},dg={};fn&&(dg=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 qa(e){if(Wl[e])return Wl[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dg)return Wl[e]=t[n];return e}var fg=qa("animationend"),hg=qa("animationiteration"),mg=qa("animationstart"),pg=qa("transitionend"),gg=new Map,ah="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){gg.set(e,t),br(t,[e])}for(var Kl=0;Kl<ah.length;Kl++){var Yl=ah[Kl],MN=Yl.toLowerCase(),IN=Yl[0].toUpperCase()+Yl.slice(1);Xn(MN,"on"+IN)}Xn(fg,"onAnimationEnd");Xn(hg,"onAnimationIteration");Xn(mg,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(pg,"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 Js="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(" "),RN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Js));function lh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Mw(r,t,void 0,e),e.currentTarget=null}function xg(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 a=r[i],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}else for(i=0;i<r.length;i++){if(a=r[i],u=a.instance,c=a.currentTarget,a=a.listener,u!==o&&s.isPropagationStopped())break e;lh(s,a,c),o=u}}}if(la)throw e=Bu,la=!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)||(yg(t,e,2,!1),n.add(r))}function Gl(e,t,n){var r=0;t&&(r|=4),yg(n,e,r,t)}var mi="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[mi]){e[mi]=!0,jp.forEach(function(n){n!=="selectionchange"&&(RN.has(n)||Gl(n,!1,e),Gl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mi]||(t[mi]=!0,Gl("selectionchange",!1,t))}}function yg(e,t,n,r){switch(tg(t)){case 1:var s=Kw;break;case 4:s=Yw;break;default:s=sd}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 Xl(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 a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.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(;a!==null;){if(i=nr(a),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}a=a.parentNode}}r=r.return}Hp(function(){var c=o,h=ed(n),d=[];e:{var f=gg.get(e);if(f!==void 0){var x=id,y=e;switch(e){case"keypress":if(Bi(n)===0)break e;case"keydown":case"keyup":x=lN;break;case"focusin":y="focus",x=Vl;break;case"focusout":y="blur",x=Vl;break;case"beforeblur":case"afterblur":x=Vl;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=Qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=dN;break;case fg:case hg:case mg:x=Jw;break;case pg:x=hN;break;case"scroll":x=Gw;break;case"wheel":x=pN;break;case"copy":case"cut":case"paste":x=tN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Zf}var w=(t&4)!==0,N=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,m!==null&&(S=xo(v,m),S!=null&&w.push(ko(v,S,g)))),N)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[hn]))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&&(N=kr(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=Qf,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Zf,S="onPointerLeave",m="onPointerEnter",v="pointer"),N=x==null?f:Or(x),g=y==null?f:Or(y),f=new w(S,v+"leave",x,n,h),f.target=N,f.relatedTarget=g,S=null,nr(h)===c&&(w=new w(m,v+"enter",y,n,h),w.target=g,w.relatedTarget=N,S=w),N=S,x&&y)t:{for(w=x,m=y,v=0,g=w;g;g=Pr(g))v++;for(g=0,S=m;S;S=Pr(S))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&&uh(d,f,x,w,!1),y!==null&&N!==null&&uh(d,N,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=SN;else if(th(f))if(ag)b=CN;else{b=kN;var j=bN}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=jN);if(b&&(b=b(e,c))){ig(d,b,n,h);break e}j&&j(e,f,c),e==="focusout"&&(j=f._wrapperState)&&j.controlled&&f.type==="number"&&Au(f,"number",f.value)}switch(j=c?Or(c):window,e){case"focusin":(th(j)||j.contentEditable==="true")&&(Dr=j,Yu=c,io=null);break;case"focusout":io=Yu=Dr=null;break;case"mousedown":Gu=!0;break;case"contextmenu":case"mouseup":case"dragend":Gu=!1,ih(d,n,h);break;case"selectionchange":if(PN)break;case"keydown":case"keyup":ih(d,n,h)}var k;if(ld)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zr?sg(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(rg&&n.locale!=="ko"&&(zr||_!=="onCompositionStart"?_==="onCompositionEnd"&&zr&&(k=ng()):(Rn=h,od="value"in Rn?Rn.value:Rn.textContent,zr=!0)),j=ha(c,_),0<j.length&&(_=new qf(_,e,null,n,h),d.push({event:_,listeners:j}),k?_.data=k:(k=og(n),k!==null&&(_.data=k)))),(k=xN?yN(e,n):vN(e,n))&&(c=ha(c,"onBeforeInput"),0<c.length&&(h=new qf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=k))}xg(d,t)})}function ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ha(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=xo(e,n),o!=null&&r.unshift(ko(e,o,s)),o=xo(e,t),o!=null&&r.push(ko(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 uh(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,s?(u=xo(n,o),u!=null&&i.unshift(ko(n,u,a))):s||(u=xo(n,o),u!=null&&i.push(ko(n,u,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var TN=/\r\n?/g,LN=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(TN,`
38
+ `).replace(LN,"")}function pi(e,t,n){if(t=ch(t),ch(e)!==t&&n)throw Error(H(425))}function ma(){}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,AN=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,zN=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(DN)}:Zu;function DN(e){setTimeout(function(){throw e})}function Ql(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),wo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);wo(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 fh(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 bs=Math.random().toString(36).slice(2),Wt="__reactFiber$"+bs,jo="__reactProps$"+bs,hn="__reactContainer$"+bs,Ju="__reactEvents$"+bs,$N="__reactListeners$"+bs,ON="__reactHandles$"+bs;function nr(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fh(e);e!==null;){if(n=e[Wt])return n;e=fh(e)}return t}e=n,n=e.parentNode}return null}function Wo(e){return e=e[Wt]||e[hn],!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 Za(e){return e[jo]||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),st=Qn(!1),dr=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 ot(e){return e=e.childContextTypes,e!=null}function pa(){ge(st),ge(Ge)}function hh(e,t,n){if(Ge.current!==Un)throw Error(H(168));fe(Ge,t),fe(st,n)}function vg(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,bw(e)||"Unknown",s));return je({},n,r)}function ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,dr=Ge.current,fe(Ge,e),fe(st,st.current),!0}function mh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=vg(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,ge(st),ge(Ge),fe(Ge,e)):ge(st),fe(st,n)}var on=null,Ja=!1,ql=!1;function wg(e){on===null?on=[e]:on.push(e)}function FN(e){Ja=!0,wg(e)}function qn(){if(!ql&&on!==null){ql=!0;var e=0,t=de;try{var n=on;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}on=null,Ja=!1}catch(s){throw on!==null&&(on=on.slice(e+1)),Wp(td,qn),s}finally{de=t,ql=!1}}return null}var Hr=[],Vr=0,xa=null,ya=0,yt=[],vt=0,fr=null,an=1,ln="";function Jn(e,t){Hr[Vr++]=ya,Hr[Vr++]=xa,xa=e,ya=t}function Ng(e,t,n){yt[vt++]=an,yt[vt++]=ln,yt[vt++]=fr,fr=e;var r=an;e=ln;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,ln=o+e}else an=1<<o|n<<s|r,ln=e}function cd(e){e.return!==null&&(Jn(e,1),Ng(e,1,0))}function dd(e){for(;e===xa;)xa=Hr[--Vr],Hr[Vr]=null,ya=Hr[--Vr],Hr[Vr]=null;for(;e===fr;)fr=yt[--vt],yt[vt]=null,ln=yt[--vt],yt[vt]=null,an=yt[--vt],yt[vt]=null}var ht=null,ft=null,xe=!1,Pt=null;function Sg(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ph(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,ht=e,ft=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fr!==null?{id:an,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,ft=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=ft;if(t){var n=t;if(!ph(e,t)){if(tc(e))throw Error(H(418));t=Dn(n.nextSibling);var r=ht;t&&ph(e,t)?Sg(r,n):(e.flags=e.flags&-4097|2,xe=!1,ht=e)}}else{if(tc(e))throw Error(H(418));e.flags=e.flags&-4097|2,xe=!1,ht=e}}}function gh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function gi(e){if(e!==ht)return!1;if(!xe)return gh(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=ft)){if(tc(e))throw bg(),Error(H(418));for(;t;)Sg(e,t),t=Dn(t.nextSibling)}if(gh(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){ft=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=ht?Dn(e.stateNode.nextSibling):null;return!0}function bg(){for(var e=ft;e;)e=Dn(e.nextSibling)}function os(){ft=ht=null,xe=!1}function fd(e){Pt===null?Pt=[e]:Pt.push(e)}var HN=xn.ReactCurrentBatchConfig;function Hs(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 a=s.refs;i===null?delete a[o]:a[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 xi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xh(e){var t=e._init;return t(e._payload)}function kg(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 a(m,v,g,S){return v===null||v.tag!==6?(v=su(g,m.mode,S),v.return=m,v):(v=s(v,g),v.return=m,v)}function u(m,v,g,S){var b=g.type;return b===Ar?h(m,v,g.props.children,S,g.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===v.type)?(S=s(v,g.props),S.ref=Hs(m,v,g),S.return=m,S):(S=Qi(g.type,g.key,g.props,null,m.mode,S),S.ref=Hs(m,v,g),S.return=m,S)}function c(m,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ou(g,m.mode,S),v.return=m,v):(v=s(v,g.children||[]),v.return=m,v)}function h(m,v,g,S,b){return v===null||v.tag!==7?(v=lr(g,m.mode,S,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 ii:return g=Qi(v.type,v.key,v.props,null,m.mode,g),g.ref=Hs(m,null,v),g.return=m,g;case Lr:return v=ou(v,m.mode,g),v.return=m,v;case En:var S=v._init;return d(m,S(v._payload),g)}if(qs(v)||zs(v))return v=lr(v,m.mode,g,null),v.return=m,v;xi(m,v)}return null}function f(m,v,g,S){var b=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:a(m,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ii:return g.key===b?u(m,v,g,S):null;case Lr:return g.key===b?c(m,v,g,S):null;case En:return b=g._init,f(m,v,b(g._payload),S)}if(qs(g)||zs(g))return b!==null?null:h(m,v,g,S,null);xi(m,g)}return null}function x(m,v,g,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(g)||null,a(v,m,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ii:return m=m.get(S.key===null?g:S.key)||null,u(v,m,S,b);case Lr:return m=m.get(S.key===null?g:S.key)||null,c(v,m,S,b);case En:var j=S._init;return x(m,v,g,j(S._payload),b)}if(qs(S)||zs(S))return m=m.get(g)||null,h(v,m,S,b,null);xi(v,S)}return null}function y(m,v,g,S){for(var b=null,j=null,k=v,_=v=0,I=null;k!==null&&_<g.length;_++){k.index>_?(I=k,k=null):I=k.sibling;var $=f(m,k,g[_],S);if($===null){k===null&&(k=I);break}e&&k&&$.alternate===null&&t(m,k),v=o($,v,_),j===null?b=$:j.sibling=$,j=$,k=I}if(_===g.length)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;_<g.length;_++)k=d(m,g[_],S),k!==null&&(v=o(k,v,_),j===null?b=k:j.sibling=k,j=k);return xe&&Jn(m,_),b}for(k=r(m,k);_<g.length;_++)I=x(k,m,_,g[_],S),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?_:I.key),v=o(I,v,_),j===null?b=I:j.sibling=I,j=I);return e&&k.forEach(function(R){return t(m,R)}),xe&&Jn(m,_),b}function w(m,v,g,S){var b=zs(g);if(typeof b!="function")throw Error(H(150));if(g=b.call(g),g==null)throw Error(H(151));for(var j=b=null,k=v,_=v=0,I=null,$=g.next();k!==null&&!$.done;_++,$=g.next()){k.index>_?(I=k,k=null):I=k.sibling;var R=f(m,k,$.value,S);if(R===null){k===null&&(k=I);break}e&&k&&R.alternate===null&&t(m,k),v=o(R,v,_),j===null?b=R:j.sibling=R,j=R,k=I}if($.done)return n(m,k),xe&&Jn(m,_),b;if(k===null){for(;!$.done;_++,$=g.next())$=d(m,$.value,S),$!==null&&(v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return xe&&Jn(m,_),b}for(k=r(m,k);!$.done;_++,$=g.next())$=x(k,m,_,$.value,S),$!==null&&(e&&$.alternate!==null&&k.delete($.key===null?_:$.key),v=o($,v,_),j===null?b=$:j.sibling=$,j=$);return e&&k.forEach(function(T){return t(m,T)}),xe&&Jn(m,_),b}function N(m,v,g,S){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 ii:e:{for(var b=g.key,j=v;j!==null;){if(j.key===b){if(b=g.type,b===Ar){if(j.tag===7){n(m,j.sibling),v=s(j,g.props.children),v.return=m,m=v;break e}}else if(j.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&xh(b)===j.type){n(m,j.sibling),v=s(j,g.props),v.ref=Hs(m,j,g),v.return=m,m=v;break e}n(m,j);break}else t(m,j);j=j.sibling}g.type===Ar?(v=lr(g.props.children,m.mode,S,g.key),v.return=m,m=v):(S=Qi(g.type,g.key,g.props,null,m.mode,S),S.ref=Hs(m,v,g),S.return=m,m=S)}return i(m);case Lr:e:{for(j=g.key;v!==null;){if(v.key===j)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,S),v.return=m,m=v}return i(m);case En:return j=g._init,N(m,v,j(g._payload),S)}if(qs(g))return y(m,v,g,S);if(zs(g))return w(m,v,g,S);xi(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,S),v.return=m,m=v),i(m)):n(m,v)}return N}var is=kg(!0),jg=kg(!1),va=Qn(null),wa=null,Br=null,hd=null;function md(){hd=Br=wa=null}function pd(e){var t=va.current;ge(va),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){wa=e,hd=Br=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(hd!==e)if(e={context:e,memoizedValue:t,next:null},Br===null){if(wa===null)throw Error(H(308));Br=e,wa.dependencies={lanes:0,firstContext:e}}else Br=Br.next=e;return t}var rr=null;function gd(e){rr===null?rr=[e]:rr.push(e)}function Cg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gd(t)):(n.next=s.next,s.next=n),t.interleaved=n,mn(e,r)}function mn(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 xd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eg(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 cn(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,ae&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,mn(e,n)}return s=r.interleaved,s===null?(t.next=t,gd(r)):(t.next=s.next,s.next=t),r.interleaved=t,mn(e,n)}function Ui(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,nd(e,n)}}function yh(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 Na(e,t,n,r){var s=e.updateQueue;_n=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==i&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,a=o;do{var f=a.lane,x=a.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;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=je({},d,f);break e;case 2:_n=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else x={eventTime:x,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=x,u=d):h=h.next=x,i|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=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);mr|=i,e.lanes=i,e.memoizedState=d}}function vh(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 Ko={},Gt=Qn(Ko),Co=Qn(Ko),Eo=Qn(Ko);function sr(e){if(e===Ko)throw Error(H(174));return e}function yd(e,t){switch(fe(Eo,t),fe(Co,e),fe(Gt,Ko),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(Gt),fe(Gt,t)}function as(){ge(Gt),ge(Co),ge(Eo)}function _g(e){sr(Eo.current);var t=sr(Gt.current),n=Du(t,e.type);t!==n&&(fe(Co,e),fe(Gt,n))}function vd(e){Co.current===e&&(ge(Gt),ge(Co))}var Ne=Qn(0);function Sa(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 Zl=[];function wd(){for(var e=0;e<Zl.length;e++)Zl[e]._workInProgressVersionPrimary=null;Zl.length=0}var Wi=xn.ReactCurrentDispatcher,Jl=xn.ReactCurrentBatchConfig,hr=0,be=null,Re=null,ze=null,ba=!1,ao=!1,_o=0,VN=0;function Ue(){throw Error(H(321))}function Nd(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 Sd(e,t,n,r,s,o){if(hr=o,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wi.current=e===null||e.memoizedState===null?KN:YN,e=n(r,s),ao){o=0;do{if(ao=!1,_o=0,25<=o)throw Error(H(301));o+=1,ze=Re=null,t.updateQueue=null,Wi.current=GN,e=n(r,s)}while(ao)}if(Wi.current=ka,t=Re!==null&&Re.next!==null,hr=0,ze=Re=be=null,ba=!1,t)throw Error(H(300));return e}function bd(){var e=_o!==0;return _o=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?be.memoizedState=ze=e:ze=ze.next=e,ze}function bt(){if(Re===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=ze===null?be.memoizedState:ze.next;if(t!==null)ze=t,Re=e;else{if(e===null)throw Error(H(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},ze===null?be.memoizedState=ze=e:ze=ze.next=e}return ze}function Po(e,t){return typeof t=="function"?t(e):t}function eu(e){var t=bt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Re,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 a=i=null,u=null,c=o;do{var h=c.lane;if((hr&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?(a=u=d,i=r):u=u.next=d,be.lanes|=h,mr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=a,At(r,t.memoizedState)||(nt=!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,be.lanes|=o,mr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tu(e){var t=bt(),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)||(nt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Pg(){}function Mg(e,t){var n=be,r=bt(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,nt=!0),r=r.queue,kd(Tg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,Mo(9,Rg.bind(null,n,r,s,t),void 0,null),De===null)throw Error(H(349));hr&30||Ig(n,t,s)}return s}function Ig(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rg(e,t,n,r){t.value=n,t.getSnapshot=r,Lg(t)&&Ag(e)}function Tg(e,t,n){return n(function(){Lg(t)&&Ag(e)})}function Lg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function Ag(e){var t=mn(e,1);t!==null&&Lt(t,e,1,-1)}function wh(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=WN.bind(null,be,e),[t.memoizedState,e]}function Mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.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 zg(){return bt().memoizedState}function Ki(e,t,n,r){var s=Vt();be.flags|=e,s.memoizedState=Mo(1|t,n,void 0,r===void 0?null:r)}function el(e,t,n,r){var s=bt();r=r===void 0?null:r;var o=void 0;if(Re!==null){var i=Re.memoizedState;if(o=i.destroy,r!==null&&Nd(r,i.deps)){s.memoizedState=Mo(t,n,o,r);return}}be.flags|=e,s.memoizedState=Mo(1|t,n,o,r)}function Nh(e,t){return Ki(8390656,8,e,t)}function kd(e,t){return el(2048,8,e,t)}function Dg(e,t){return el(4,2,e,t)}function $g(e,t){return el(4,4,e,t)}function Og(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 Fg(e,t,n){return n=n!=null?n.concat([e]):null,el(4,4,Og.bind(null,t,e),n)}function jd(){}function Hg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vg(e,t){var n=bt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Nd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Bg(e,t,n){return hr&21?(At(n,t)||(n=Gp(),be.lanes|=n,mr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function BN(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Jl.transition;Jl.transition={};try{e(!1),t()}finally{de=n,Jl.transition=r}}function Ug(){return bt().memoizedState}function UN(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Kg(t,n);else if(n=Cg(e,t,n,r),n!==null){var s=Qe();Lt(n,e,r,s),Yg(n,t,r)}}function WN(e,t,n){var r=Fn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wg(e))Kg(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,a=o(i,n);if(s.hasEagerState=!0,s.eagerState=a,At(a,i)){var u=t.interleaved;u===null?(s.next=s,gd(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Cg(e,t,s,r),n!==null&&(s=Qe(),Lt(n,e,r,s),Yg(n,t,r))}}function Wg(e){var t=e.alternate;return e===be||t!==null&&t===be}function Kg(e,t){ao=ba=!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,nd(e,n)}}var ka={readContext:St,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},KN={readContext:St,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Nh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ki(4194308,4,Og.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ki(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();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=UN.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:wh,useDebugValue:jd,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=wh(!1),t=e[0];return e=BN.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,s=Vt();if(xe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),De===null)throw Error(H(349));hr&30||Ig(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Nh(Tg.bind(null,r,o,e),[e]),r.flags|=2048,Mo(9,Rg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Vt(),t=De.identifierPrefix;if(xe){var n=ln,r=an;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=VN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YN={readContext:St,useCallback:Hg,useContext:St,useEffect:kd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:eu,useRef:zg,useState:function(){return eu(Po)},useDebugValue:jd,useDeferredValue:function(e){var t=bt();return Bg(t,Re.memoizedState,e)},useTransition:function(){var e=eu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1},GN={readContext:St,useCallback:Hg,useContext:St,useEffect:kd,useImperativeHandle:Fg,useInsertionEffect:Dg,useLayoutEffect:$g,useMemo:Vg,useReducer:tu,useRef:zg,useState:function(){return tu(Po)},useDebugValue:jd,useDeferredValue:function(e){var t=bt();return Re===null?t.memoizedState=e:Bg(t,Re.memoizedState,e)},useTransition:function(){var e=tu(Po)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Pg,useSyncExternalStore:Mg,useId:Ug,unstable_isNewReconciler:!1};function Ct(e,t){if(e&&e.defaultProps){t=je({},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:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qe(),s=Fn(e),o=cn(r,s);o.payload=t,n!=null&&(o.callback=n),t=$n(e,o,s),t!==null&&(Lt(t,e,s,r),Ui(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qe(),s=Fn(e),o=cn(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),Ui(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qe(),r=Fn(e),s=cn(n,r);s.tag=2,t!=null&&(s.callback=t),t=$n(e,s,r),t!==null&&(Lt(t,e,r,n),Ui(t,e,r))}};function Sh(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?!So(n,r)||!So(s,o):!0}function Gg(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=St(o):(s=ot(t)?dr: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=tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function bh(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&&tl.enqueueReplaceState(t,t.state,null)}function oc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},xd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=St(o):(o=ot(t)?dr: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&&tl.enqueueReplaceState(s,s.state,null),Na(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ls(e,t){try{var n="",r=t;do n+=Sw(r),r=r.return;while(r);var s=n}catch(o){s=`
39
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 Xg(e,t,n){n=cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ca||(Ca=!0,gc=r),ic(e,t)},n}function Qg(e,t,n){n=cn(-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 kh(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=d2.bind(null,e,t,n),t.then(e,e))}function jh(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 Ch(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=cn(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var ZN=xn.ReactCurrentOwner,nt=!1;function Xe(e,t,n,r){t.child=e===null?jg(t,null,n,r):is(t,e.child,n,r)}function Eh(e,t,n,r,s){n=n.render;var o=t.ref;return Zr(t,s),r=Sd(e,t,n,r,o,s),n=bd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&n&&cd(t),t.flags|=1,Xe(e,t,r,s),t.child)}function _h(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Td(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:So,n(i,r)&&e.ref===t.ref)return pn(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(So(o,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(nt=!0);else return t.lanes=e.lanes,pn(e,t,s)}return ac(e,t,n,r,s)}function Zg(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,at),at|=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,at),at|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Wr,at),at|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Wr,at),at|=r;return Xe(e,t,s,n),t.child}function Jg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ac(e,t,n,r,s){var o=ot(n)?fr:Ge.current;return o=ss(t,o),Zr(t,s),n=Sd(e,t,n,r,o,s),r=bd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&r&&cd(t),t.flags|=1,Xe(e,t,n,s),t.child)}function Ph(e,t,n,r,s){if(ot(n)){var o=!0;ga(t)}else o=!1;if(Zr(t,s),t.stateNode===null)Ki(e,t),Gg(t,n,r),oc(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=St(c):(c=ot(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"||(a!==r||u!==c)&&bh(t,i,r,c),_n=!1;var f=t.memoizedState;i.state=f,Na(t,r,i,s),u=t.memoizedState,a!==r||f!==u||st.current||_n?(typeof h=="function"&&(sc(t,n,h,r),u=t.memoizedState),(a=_n||Sh(t,n,a,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=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Eg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ct(t.type,a),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=St(u):(u=ot(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"||(a!==d||f!==u)&&bh(t,i,r,u),_n=!1,f=t.memoizedState,i.state=f,Na(t,r,i,s);var y=t.memoizedState;a!==d||f!==y||st.current||_n?(typeof x=="function"&&(sc(t,n,x,r),y=t.memoizedState),(c=_n||Sh(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"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===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"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return lc(e,t,n,r,o,s)}function lc(e,t,n,r,s,o){Jg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&mh(t,n,!1),pn(e,t,o);r=t.stateNode,ZN.current=t;var a=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,a,o)):Xe(e,t,a,o),t.memoizedState=r.state,s&&mh(t,n,!0),t.child}function ex(e){var t=e.stateNode;t.pendingContext?hh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hh(e,t.context,!1),yd(e,t.containerInfo)}function Mh(e,t,n,r,s){return os(),fd(s),t.flags|=256,Xe(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 tx(e,t,n){var r=t.pendingProps,s=Ne.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(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=sl(i,r,0,null),e=lr(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):Cd(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return JN(e,t,i,r,a,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,a=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),a!==null?o=Hn(a,o):(o=lr(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 Cd(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xi(e,t,n,r){return r!==null&&fd(r),is(t,e.child,null,n),e=Cd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function JN(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=sl({mode:"visible",children:r.children},s,0,null),o=lr(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 a=r.dgst;return r=a,o=Error(H(419)),r=nu(o,r,void 0),xi(e,t,i,r)}if(a=(i&e.childLanes)!==0,nt||a){if(r=De,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,mn(e,s),Lt(r,e,s,-1))}return Rd(),r=nu(Error(H(421))),xi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=f2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ut=Dn(s.nextSibling),ct=t,xe=!0,Pt=null,e!==null&&(gt[xt++]=an,gt[xt++]=ln,gt[xt++]=hr,an=e.id,ln=e.overflow,hr=t),t=Cd(t,r.children),t.flags|=4096,t)}function Ih(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 nx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Xe(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&&Ih(e,n,t);else if(e.tag===19)Ih(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&&Sa(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&&Sa(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 Ki(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pn(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 e2(e,t,n){switch(t.tag){case 3:ex(t),os();break;case 5:_g(t);break;case 1:ot(t.type)&&ga(t);break;case 4:yd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(va,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?tx(e,t,n):(fe(Ne,Ne.current&1),e=pn(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 nx(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,Zg(e,t,n)}return pn(e,t,n)}var rx,dc,sx,ox;rx=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(){};sx=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=je({},s,{value:void 0}),r=je({},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=ma)}$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 a=s[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(po.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&a[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,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(po.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||a===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};ox=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vs(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 We(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 t2(e,t,n){var r=t.pendingProps;switch(dd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ot(t.type)&&pa(),We(t),null;case 3:return r=t.stateNode,as(),ge(st),ge(Ge),wd(),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),We(t),null;case 5:vd(t);var s=sr(Eo.current);if(n=t.type,e!==null&&t.stateNode!=null)sx(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 We(t),null}if(e=sr(Xt.current),pi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Kt]=t,r[jo]=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<Js.length;s++)pe(Js[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":Ff(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":Vf(r,o),pe("invalid",r)}$u(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];i==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&mi(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&mi(r.textContent,a,e),s=["children",""+a]):po.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":ii(r),Hf(r,o,!0);break;case"textarea":ii(r),Bf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ma)}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=Tp(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[Kt]=t,e[jo]=r,rx(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<Js.length;s++)pe(Js[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":Ff(e,r),s=Tu(e,r),pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=je({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Vf(e,r),s=zu(e,r),pe("invalid",e);break;default:s=r}$u(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var u=a[o];o==="style"?zp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Lp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&go(e,u):typeof u=="number"&&go(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(po.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Qc(e,o,u,i))}switch(n){case"input":ii(e),Hf(e,r,!1);break;case"textarea":ii(e),Bf(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?Gr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Gr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ma)}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 We(t),null;case 6:if(e&&t.stateNode!=null)ox(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=sr(Eo.current),sr(Xt.current),pi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(o=r.nodeValue!==n)&&(e=ct,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[Kt]=t,t.stateNode=r}return We(t),null;case 13:if(ge(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&ut!==null&&t.mode&1&&!(t.flags&128))bg(),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[Kt]=t}else os(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(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?Te===0&&(Te=3):Rd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return as(),dc(e,t),e===null&&bo(t.stateNode.containerInfo),We(t),null;case 10:return pd(t.type._context),We(t),null;case 17:return ot(t.type)&&pa(),We(t),null;case 19:if(ge(Ne),o=t.memoizedState,o===null)return We(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Vs(o,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Sa(e),i!==null){for(t.flags|=128,Vs(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&&Ee()>us&&(t.flags|=128,r=!0,Vs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Sa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!xe)return We(t),null}else 2*Ee()-o.renderingStartTime>us&&n!==1073741824&&(t.flags|=128,r=!0,Vs(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=Ee(),t.sibling=null,n=Ne.current,fe(Ne,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Id(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?at&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function n2(e,t){switch(dd(t),t.tag){case 1:return ot(t.type)&&pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return as(),ge(st),ge(Ge),wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vd(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 as(),null;case 10:return pd(t.type._context),null;case 22:case 23:return Id(),null;case 24:return null;default:return null}}var yi=!1,Ye=!1,r2=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){Ce(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Rh=!1;function s2(e,t){if(Xu=da,e=cg(),ud(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,a=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(a=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&&(a=i),f===o&&++h===r&&(u=i),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},da=!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,N=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ct(t.type,w),N);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(S){Ce(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Rh,Rh=!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 nl(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 ix(e){var t=e.alternate;t!==null&&(e.alternate=null,ix(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[jo],delete t[Ju],delete t[FN],delete t[HN])),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 ax(e){return e.tag===5||e.tag===3||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ax(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=ma));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 Oe=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(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(Ga,n)}catch{}switch(n.tag){case 5:Ye||Ur(n,t);case 6:var r=Oe,s=Et;Oe=null,Nn(e,t,n),Oe=r,Et=s,Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?Ql(e.parentNode,n):e.nodeType===1&&Ql(e,n),wo(e)):Ql(Oe,n.stateNode));break;case 4:r=Oe,s=Et,Oe=n.stateNode.containerInfo,Et=!0,Nn(e,t,n),Oe=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(a){Ce(n,t,a)}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 Lh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new r2),t.forEach(function(r){var s=h2.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,a=i;e:for(;a!==null;){switch(a.tag){case 5:Oe=a.stateNode,Et=!1;break e;case 3:Oe=a.stateNode.containerInfo,Et=!0;break e;case 4:Oe=a.stateNode.containerInfo,Et=!0;break e}a=a.return}if(Oe===null)throw Error(H(160));lx(o,i,s),Oe=null,Et=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){Ce(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ux(t,e),t=t.sibling}function ux(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),nl(3,e)}catch(w){Ce(e,e.return,w)}try{lo(5,e,e.return)}catch(w){Ce(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{go(s,"")}catch(w){Ce(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Ip(s,o),Ou(a,i);var c=Ou(a,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?zp(s,d):h==="dangerouslySetInnerHTML"?Lp(s,d):h==="children"?go(s,d):Qc(s,h,d,c)}switch(a){case"input":Lu(s,o);break;case"textarea":Rp(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Gr(s,!!o.multiple,x,!1):f!==!!o.multiple&&(o.defaultValue!=null?Gr(s,!!o.multiple,o.defaultValue,!0):Gr(s,!!o.multiple,o.multiple?[]:"",!1))}s[jo]=o}catch(w){Ce(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){Ce(e,e.return,w)}}break;case 3:if(jt(t,e),Vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wo(t.containerInfo)}catch(w){Ce(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||(Pd=Ee())),r&4&&Lh(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){Ce(r,n,w)}}break;case 5:Ur(f,f.return);break;case 22:if(f.memoizedState!==null){zh(d);continue}}x!==null?(x.return=f,W=x):zh(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"):(a=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Ap("display",i))}catch(w){Ce(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){Ce(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&&Lh(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(ax(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&&(go(s,""),r.flags&=-33);var o=Th(e);pc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,a=Th(e);mc(e,a,i);break;default:throw Error(H(161))}}catch(u){Ce(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function o2(e,t,n){W=e,cx(e)}function cx(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 a=s.alternate,u=a!==null&&a.memoizedState!==null||Ye;a=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?Dh(s):u!==null?(u.return=i,W=u):Dh(s);for(;o!==null;)W=o,cx(o),o=o.sibling;W=s,yi=a,Ye=c}Ah(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Ah(e)}}function Ah(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||nl(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&&vh(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}vh(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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&&wo(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){Ce(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 zh(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 Dh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(u){Ce(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){Ce(t,s,u)}}var o=t.return;try{hc(t)}catch(u){Ce(t,o,u)}break;case 5:var i=t.return;try{hc(t)}catch(u){Ce(t,i,u)}}}catch(u){Ce(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var i2=Math.ceil,ja=xn.ReactCurrentDispatcher,Ed=xn.ReactCurrentOwner,Nt=xn.ReactCurrentBatchConfig,ae=0,De=null,Me=null,Fe=0,at=0,Wr=Qn(0),Te=0,Io=null,pr=0,rl=0,_d=0,uo=null,tt=null,Pd=0,us=1/0,sn=null,Ca=!1,gc=null,On=null,vi=!1,Tn=null,Ea=0,co=0,xc=null,Yi=-1,Gi=0;function Qe(){return ae&6?Ee():Yi!==-1?Yi:Yi=Ee()}function Fn(e){return e.mode&1?ae&2&&Fe!==0?Fe&-Fe:BN.transition!==null?(Gi===0&&(Gi=Gp()),Gi):(e=de,e!==0||(e=window.event,e=e===void 0?16:tg(e.type)),e):1}function Lt(e,t,n,r){if(50<co)throw co=0,xc=null,Error(H(185));Bo(e,n,r),(!(ae&2)||e!==De)&&(e===De&&(!(ae&2)&&(rl|=n),Te===4&&Mn(e,Fe)),it(e,r),n===1&&ae===0&&!(t.mode&1)&&(us=Ee()+500,Ja&&qn()))}function it(e,t){var n=e.callbackNode;B1(e,t);var r=ca(e,e===De?Fe:0);if(r===0)n!==null&&Kf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kf(n),t===1)e.tag===0?VN($h.bind(null,e)):wg($h.bind(null,e)),$N(function(){!(ae&6)&&qn()}),n=null;else{switch(Xp(r)){case 1:n=td;break;case 4:n=Kp;break;case 16:n=ua;break;case 536870912:n=Yp;break;default:n=ua}n=yx(n,dx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function dx(e,t){if(Yi=-1,Gi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=ca(e,e===De?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_a(e,r);else{t=r;var s=ae;ae|=2;var o=hx();(De!==e||Fe!==t)&&(sn=null,us=Ee()+500,ar(e,t));do try{u2();break}catch(a){fx(e,a)}while(!0);md(),ja.current=o,ae=s,Me!==null?t=0:(De=null,Fe=0,t=Te)}if(t!==0){if(t===2&&(s=Uu(e),s!==0&&(r=s,t=yc(e,s))),t===1)throw n=Io,ar(e,0),Mn(e,r),it(e,Ee()),n;if(t===6)Mn(e,r);else{if(s=e.current.alternate,!(r&30)&&!a2(s)&&(t=_a(e,r),t===2&&(o=Uu(e),o!==0&&(r=o,t=yc(e,o))),t===1))throw n=Io,ar(e,0),Mn(e,r),it(e,Ee()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:er(e,tt,sn);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Pd+500-Ee(),10<t)){if(ca(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Zu(er.bind(null,e,tt,sn),t);break}er(e,tt,sn);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=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*i2(r/1960))-r,10<r){e.timeoutHandle=Zu(er.bind(null,e,tt,sn),r);break}er(e,tt,sn);break;case 5:er(e,tt,sn);break;default:throw Error(H(329))}}}return it(e,Ee()),e.callbackNode===n?dx.bind(null,e):null}function yc(e,t){var n=uo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=_a(e,t),e!==2&&(t=tt,tt=n,t!==null&&vc(t)),e}function vc(e){tt===null?tt=e:tt.push.apply(tt,e)}function a2(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&=~_d,t&=~rl,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 $h(e){if(ae&6)throw Error(H(327));Jr();var t=ca(e,0);if(!(t&1))return it(e,Ee()),null;var n=_a(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=Io,ar(e,0),Mn(e,t),it(e,Ee()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,tt,sn),it(e,Ee()),null}function Md(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(us=Ee()+500,Ja&&qn())}}function gr(e){Tn!==null&&Tn.tag===0&&!(ae&6)&&Jr();var t=ae;ae|=1;var n=Nt.transition,r=de;try{if(Nt.transition=null,de=1,e)return e()}finally{de=r,Nt.transition=n,ae=t,!(ae&6)&&qn()}}function Id(){at=Wr.current,ge(Wr)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,DN(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(dd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pa();break;case 3:as(),ge(st),ge(Ge),wd();break;case 5:vd(r);break;case 4:as();break;case 13:ge(Ne);break;case 19:ge(Ne);break;case 10:pd(r.type._context);break;case 22:case 23:Id()}n=n.return}if(De=e,Me=e=Hn(e.current,null),Fe=at=t,Te=0,Io=null,_d=rl=pr=0,tt=uo=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 fx(e,t){do{var n=Me;try{if(md(),Ui.current=ka,ba){for(var r=be.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ba=!1}if(mr=0,ze=Re=be=null,ao=!1,_o=0,Ed.current=null,n===null||n.return===null){Te=1,Io=t,Me=null;break}e:{var o=e,i=n.return,a=n,u=t;if(t=Fe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=a,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=jh(i);if(x!==null){x.flags&=-257,Ch(x,i,a,o,t),x.mode&1&&kh(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)){kh(o,c,t),Rd();break e}u=Error(H(426))}}else if(xe&&a.mode&1){var N=jh(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Ch(N,i,a,o,t),fd(ls(u,a));break e}}o=u=ls(u,a),Te!==4&&(Te=2),uo===null?uo=[o]:uo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=Xg(o,u,t);yh(o,m);break e;case 1:a=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 S=Qg(o,a,t);yh(o,S);break e}}o=o.return}while(o!==null)}px(n)}catch(b){t=b,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function hx(){var e=ja.current;return ja.current=ka,e===null?ka:e}function Rd(){(Te===0||Te===3||Te===2)&&(Te=4),De===null||!(pr&268435455)&&!(rl&268435455)||Mn(De,Fe)}function _a(e,t){var n=ae;ae|=2;var r=hx();(De!==e||Fe!==t)&&(sn=null,ar(e,t));do try{l2();break}catch(s){fx(e,s)}while(!0);if(md(),ae=n,ja.current=r,Me!==null)throw Error(H(261));return De=null,Fe=0,Te}function l2(){for(;Me!==null;)mx(Me)}function u2(){for(;Me!==null&&!L1();)mx(Me)}function mx(e){var t=xx(e.alternate,e,at);e.memoizedProps=e.pendingProps,t===null?px(e):Me=t,Ed.current=null}function px(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=n2(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Me=null;return}}else if(n=t2(n,t,at),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Te===0&&(Te=5)}function er(e,t,n){var r=de,s=Nt.transition;try{Nt.transition=null,de=1,c2(e,t,n,r)}finally{Nt.transition=s,de=r}return null}function c2(e,t,n,r){do Jr();while(Tn!==null);if(ae&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(U1(e,o),e===De&&(Me=De=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vi||(vi=!0,yx(ua,function(){return Jr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Nt.transition,Nt.transition=null;var i=de;de=1;var a=ae;ae|=4,Ed.current=null,s2(e,n),ux(n,e),MN(Qu),da=!!Xu,Qu=Xu=null,e.current=n,o2(n),A1(),ae=a,de=i,Nt.transition=o}else e.current=n;if(vi&&(vi=!1,Tn=e,Ea=s),o=e.pendingLanes,o===0&&(On=null),$1(n.stateNode),it(e,Ee()),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(Ca)throw Ca=!1,e=gc,gc=null,e;return Ea&1&&e.tag!==0&&Jr(),o=e.pendingLanes,o&1?e===xc?co++:(co=0,xc=e):co=0,qn(),null}function Jr(){if(Tn!==null){var e=Xp(Ea),t=Nt.transition,n=de;try{if(Nt.transition=null,de=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Ea=0,ae&6)throw Error(H(331));var s=ae;for(ae|=4,W=e.current;W!==null;){var o=W,i=o.child;if(W.flags&16){var a=o.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[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(ix(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 N=w.sibling;w.sibling=null,w=N}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(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:nl(9,a)}}catch(b){Ce(a,a.return,b)}if(a===i){W=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,W=S;break e}W=a.return}}if(ae=s,qn(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Ga,e)}catch{}r=!0}return r}finally{de=n,Nt.transition=t}}return!1}function Oh(e,t,n){t=ls(n,t),t=Xg(e,t,1),e=$n(e,t,1),t=Qe(),e!==null&&(Bo(e,1,t),it(e,t))}function Ce(e,t,n){if(e.tag===3)Oh(e,e,n);else for(;t!==null;){if(t.tag===3){Oh(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=ls(n,e),e=Qg(t,e,1),t=$n(t,e,1),e=Qe(),t!==null&&(Bo(t,1,e),it(t,e));break}}t=t.return}}function d2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(Fe&n)===n&&(Te===4||Te===3&&(Fe&130023424)===Fe&&500>Ee()-Pd?ar(e,0):_d|=n),it(e,t)}function gx(e,t){t===0&&(e.mode&1?(t=ui,ui<<=1,!(ui&130023424)&&(ui=4194304)):t=1);var n=Qe();e=mn(e,t),e!==null&&(Bo(e,t,n),it(e,n))}function f2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gx(e,n)}function h2(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),gx(e,n)}var xx;xx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,e2(e,t,n);nt=!!(e.flags&131072)}else nt=!1,xe&&t.flags&1048576&&Ng(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ki(e,t),e=t.pendingProps;var s=ss(t,Ge.current);Zr(t,n),s=Sd(null,t,r,e,s,n);var o=bd();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,ot(r)?(o=!0,ga(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,xd(t),s.updater=tl,t.stateNode=s,s._reactInternals=t,oc(t,r,e,n),t=lc(null,t,r,!0,o,n)):(t.tag=0,xe&&o&&cd(t),Xe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ki(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=p2(r),e=Ct(r,e),s){case 0:t=ac(null,t,r,e,n);break e;case 1:t=Ph(null,t,r,e,n);break e;case 11:t=Eh(null,t,r,e,n);break e;case 14:t=_h(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),ac(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Ph(e,t,r,s,n);case 3:e:{if(ex(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Eg(e,t),Na(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=ls(Error(H(423)),t),t=Mh(e,t,r,n,s);break e}else if(r!==s){s=ls(Error(H(424)),t),t=Mh(e,t,r,n,s);break e}else for(ut=Dn(t.stateNode.containerInfo.firstChild),ct=t,xe=!0,Pt=null,n=jg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(os(),r===s){t=pn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return _g(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),Jg(e,t),Xe(e,t,i,n),t.child;case 6:return e===null&&nc(t),null;case 13:return tx(e,t,n);case 4:return yd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Eh(e,t,r,s,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(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(va,r._currentValue),r._currentValue=i,o!==null)if(At(o.value,i)){if(o.children===s.children&&!st.current){t=pn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=cn(-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),a.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,a=i.alternate,a!==null&&(a.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}Xe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Zr(t,n),s=St(s),r=r(s),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),_h(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),Ki(e,t),t.tag=1,ot(r)?(e=!0,ga(t)):e=!1,Zr(t,n),Gg(t,r,s),oc(t,r,s,n),lc(null,t,r,!0,e,n);case 19:return nx(e,t,n);case 22:return Zg(e,t,n)}throw Error(H(156,t.tag))};function yx(e,t){return Wp(e,t)}function m2(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 wt(e,t,n,r){return new m2(e,t,n,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function p2(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zc)return 11;if(e===Jc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Td(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ar:return lr(n.children,s,o,t);case qc:i=8,s|=8;break;case Pu:return e=wt(12,n,t,s|2),e.elementType=Pu,e.lanes=o,e;case Mu:return e=wt(13,n,t,s),e.elementType=Mu,e.lanes=o,e;case Iu:return e=wt(19,n,t,s),e.elementType=Iu,e.lanes=o,e;case _p:return sl(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cp:i=10;break e;case Ep:i=9;break e;case Zc:i=11;break e;case Jc:i=14;break e;case En:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=wt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=_p,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function g2(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=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ld(e,t,n,r,s,o,i,a,u){return e=new g2(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xd(o),e}function x2(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 vx(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(ot(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(ot(n))return vg(e,n,t)}return t}function wx(e,t,n,r,s,o,i,a,u){return e=Ld(n,r,!0,e,s,o,i,a,u),e.context=vx(null),n=e.current,r=Qe(),s=Fn(n),o=cn(r,s),o.callback=t??null,$n(n,o,s),e.current.lanes=s,Bo(e,s,r),it(e,r),e}function ol(e,t,n,r){var s=t.current,o=Qe(),i=Fn(s);return n=vx(n),t.context===null?t.context=n:t.pendingContext=n,t=cn(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 Pa(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 Fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ad(e,t){Fh(e,t),(e=e.alternate)&&Fh(e,t)}function y2(){return null}var Nx=typeof reportError=="function"?reportError:function(e){console.error(e)};function zd(e){this._internalRoot=e}il.prototype.render=zd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));ol(e,t,null,null)};il.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){ol(null,e,null,null)}),t[hn]=null}};function il(e){this._internalRoot=e}il.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zp();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&&eg(e)}};function Dd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hh(){}function v2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Pa(i);o.call(c)}}var i=wx(t,r,e,0,null,!1,!1,"",Hh);return e._reactRootContainer=i,e[hn]=i.current,bo(e.nodeType===8?e.parentNode:e),gr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Pa(u);a.call(c)}}var u=Ld(e,0,!1,null,null,!1,!1,"",Hh);return e._reactRootContainer=u,e[hn]=u.current,bo(e.nodeType===8?e.parentNode:e),gr(function(){ol(t,u,n,r)}),u}function ll(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var a=s;s=function(){var u=Pa(i);a.call(u)}}ol(t,i,e,s)}else i=v2(n,t,e,s,r);return Pa(i)}Qp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zs(t.pendingLanes);n!==0&&(nd(t,n|1),it(t,Ee()),!(ae&6)&&(us=Ee()+500,qn()))}break;case 13:gr(function(){var r=mn(e,1);if(r!==null){var s=Qe();Lt(r,e,1,s)}}),Ad(e,1)}};rd=function(e){if(e.tag===13){var t=mn(e,134217728);if(t!==null){var n=Qe();Lt(t,e,134217728,n)}Ad(e,134217728)}};qp=function(e){if(e.tag===13){var t=Fn(e),n=mn(e,t);if(n!==null){var r=Qe();Lt(n,e,t,r)}Ad(e,t)}};Zp=function(){return de};Jp=function(e,t){var n=de;try{return de=e,t()}finally{de=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=Za(r);if(!s)throw Error(H(90));Mp(r),Lu(r,s)}}}break;case"textarea":Rp(e,n);break;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}};Op=Md;Fp=gr;var w2={usingClientEntryPoint:!1,Events:[Wo,Or,Za,Dp,$p,Md]},Bs={findFiberByHostInstance:nr,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},N2={bundleType:Bs.bundleType,version:Bs.version,rendererPackageName:Bs.rendererPackageName,rendererConfig:Bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Bp(e),e===null?null:e.stateNode},findFiberByHostInstance:Bs.findFiberByHostInstance||y2,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{Ga=wi.inject(N2),Gt=wi}catch{}}mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w2;mt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dd(t))throw Error(H(200));return x2(e,t,null,n)};mt.createRoot=function(e,t){if(!Dd(e))throw Error(H(299));var n=!1,r="",s=Nx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Ld(e,1,!1,null,null,n,!1,r,s),e[hn]=t.current,bo(e.nodeType===8?e.parentNode:e),new zd(t)};mt.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=Bp(t),e=e===null?null:e.stateNode,e};mt.flushSync=function(e){return gr(e)};mt.hydrate=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!0,n)};mt.hydrateRoot=function(e,t,n){if(!Dd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Nx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=wx(t,null,e,1,n??null,s,!1,o,i),e[hn]=t.current,bo(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 il(t)};mt.render=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!1,n)};mt.unmountComponentAtNode=function(e){if(!al(e))throw Error(H(40));return e._reactRootContainer?(gr(function(){ll(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1};mt.unstable_batchedUpdates=Md;mt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!al(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return ll(e,t,n,!1,r)};mt.version="18.3.0-next-8a015b68cc-20240425";function Sx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sx)}catch(e){console.error(e)}}Sx(),Sp.exports=mt;var ul=Sp.exports;const S2=Bc(ul);var Vh=ul;Eu.createRoot=Vh.createRoot,Eu.hydrateRoot=Vh.hydrateRoot;/**
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 XN=typeof WeakMap=="function"?WeakMap:Map;function Xg(e,t,n){n=cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ca||(Ca=!0,gc=r),ic(e,t)},n}function Qg(e,t,n){n=cn(-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 kh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new XN;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=u2.bind(null,e,t,n),t.then(e,e))}function jh(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 Ch(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=cn(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var QN=xn.ReactCurrentOwner,nt=!1;function Xe(e,t,n,r){t.child=e===null?jg(t,null,n,r):is(t,e.child,n,r)}function Eh(e,t,n,r,s){n=n.render;var o=t.ref;return Zr(t,s),r=Sd(e,t,n,r,o,s),n=bd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&n&&cd(t),t.flags|=1,Xe(e,t,r,s),t.child)}function _h(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Td(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=Qi(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:So,n(i,r)&&e.ref===t.ref)return pn(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(So(o,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(nt=!0);else return t.lanes=e.lanes,pn(e,t,s)}return ac(e,t,n,r,s)}function Zg(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,lt),lt|=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,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Wr,lt),lt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Wr,lt),lt|=r;return Xe(e,t,s,n),t.child}function Jg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ac(e,t,n,r,s){var o=ot(n)?dr:Ge.current;return o=ss(t,o),Zr(t,s),n=Sd(e,t,n,r,o,s),r=bd(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(xe&&r&&cd(t),t.flags|=1,Xe(e,t,n,s),t.child)}function Ph(e,t,n,r,s){if(ot(n)){var o=!0;ga(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,a=t.memoizedProps;i.props=a;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=St(c):(c=ot(n)?dr: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"||(a!==r||u!==c)&&bh(t,i,r,c),_n=!1;var f=t.memoizedState;i.state=f,Na(t,r,i,s),u=t.memoizedState,a!==r||f!==u||st.current||_n?(typeof h=="function"&&(sc(t,n,h,r),u=t.memoizedState),(a=_n||Sh(t,n,a,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=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Eg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ct(t.type,a),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=St(u):(u=ot(n)?dr: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"||(a!==d||f!==u)&&bh(t,i,r,u),_n=!1,f=t.memoizedState,i.state=f,Na(t,r,i,s);var y=t.memoizedState;a!==d||f!==y||st.current||_n?(typeof x=="function"&&(sc(t,n,x,r),y=t.memoizedState),(c=_n||Sh(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"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===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"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return lc(e,t,n,r,o,s)}function lc(e,t,n,r,s,o){Jg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&mh(t,n,!1),pn(e,t,o);r=t.stateNode,QN.current=t;var a=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,a,o)):Xe(e,t,a,o),t.memoizedState=r.state,s&&mh(t,n,!0),t.child}function ex(e){var t=e.stateNode;t.pendingContext?hh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hh(e,t.context,!1),yd(e,t.containerInfo)}function Mh(e,t,n,r,s){return os(),fd(s),t.flags|=256,Xe(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 tx(e,t,n){var r=t.pendingProps,s=Ne.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(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=sl(i,r,0,null),e=lr(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):Cd(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return qN(e,t,i,r,a,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,a=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),a!==null?o=Hn(a,o):(o=lr(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 Cd(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yi(e,t,n,r){return r!==null&&fd(r),is(t,e.child,null,n),e=Cd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qN(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=nu(Error(H(422))),yi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=sl({mode:"visible",children:r.children},s,0,null),o=lr(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 yi(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(H(419)),r=nu(o,r,void 0),yi(e,t,i,r)}if(a=(i&e.childLanes)!==0,nt||a){if(r=De,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,mn(e,s),Lt(r,e,s,-1))}return Rd(),r=nu(Error(H(421))),yi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=c2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ft=Dn(s.nextSibling),ht=t,xe=!0,Pt=null,e!==null&&(yt[vt++]=an,yt[vt++]=ln,yt[vt++]=fr,an=e.id,ln=e.overflow,fr=t),t=Cd(t,r.children),t.flags|=4096,t)}function Ih(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 nx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Xe(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&&Ih(e,n,t);else if(e.tag===19)Ih(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&&Sa(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&&Sa(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 pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=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 ZN(e,t,n){switch(t.tag){case 3:ex(t),os();break;case 5:_g(t);break;case 1:ot(t.type)&&ga(t);break;case 4:yd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(va,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?tx(e,t,n):(fe(Ne,Ne.current&1),e=pn(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 nx(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,Zg(e,t,n)}return pn(e,t,n)}var rx,dc,sx,ox;rx=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(){};sx=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,sr(Gt.current);var o=null;switch(n){case"input":s=Tu(e,s),r=Tu(e,r),o=[];break;case"select":s=je({},s,{value:void 0}),r=je({},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=ma)}$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 a=s[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(po.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&a[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,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(po.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||a===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};ox=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vs(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 We(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 JN(e,t,n){var r=t.pendingProps;switch(dd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ot(t.type)&&pa(),We(t),null;case 3:return r=t.stateNode,as(),ge(st),ge(Ge),wd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(vc(Pt),Pt=null))),dc(e,t),We(t),null;case 5:vd(t);var s=sr(Eo.current);if(n=t.type,e!==null&&t.stateNode!=null)sx(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 We(t),null}if(e=sr(Gt.current),gi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Wt]=t,r[jo]=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<Js.length;s++)pe(Js[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":Ff(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":Vf(r,o),pe("invalid",r)}$u(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];i==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&pi(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&pi(r.textContent,a,e),s=["children",""+a]):po.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":ai(r),Hf(r,o,!0);break;case"textarea":ai(r),Bf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ma)}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=Tp(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[Wt]=t,e[jo]=r,rx(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<Js.length;s++)pe(Js[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":Ff(e,r),s=Tu(e,r),pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=je({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Vf(e,r),s=zu(e,r),pe("invalid",e);break;default:s=r}$u(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var u=a[o];o==="style"?zp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Lp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&go(e,u):typeof u=="number"&&go(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(po.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Qc(e,o,u,i))}switch(n){case"input":ai(e),Hf(e,r,!1);break;case"textarea":ai(e),Bf(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?Gr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Gr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ma)}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 We(t),null;case 6:if(e&&t.stateNode!=null)ox(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=sr(Eo.current),sr(Gt.current),gi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(o=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:pi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return We(t),null;case 13:if(ge(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&ft!==null&&t.mode&1&&!(t.flags&128))bg(),os(),t.flags|=98560,o=!1;else if(o=gi(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[Wt]=t}else os(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(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?Te===0&&(Te=3):Rd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return as(),dc(e,t),e===null&&bo(t.stateNode.containerInfo),We(t),null;case 10:return pd(t.type._context),We(t),null;case 17:return ot(t.type)&&pa(),We(t),null;case 19:if(ge(Ne),o=t.memoizedState,o===null)return We(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Vs(o,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Sa(e),i!==null){for(t.flags|=128,Vs(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&&Ee()>us&&(t.flags|=128,r=!0,Vs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Sa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!xe)return We(t),null}else 2*Ee()-o.renderingStartTime>us&&n!==1073741824&&(t.flags|=128,r=!0,Vs(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=Ee(),t.sibling=null,n=Ne.current,fe(Ne,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Id(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function e2(e,t){switch(dd(t),t.tag){case 1:return ot(t.type)&&pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return as(),ge(st),ge(Ge),wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vd(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 as(),null;case 10:return pd(t.type._context),null;case 22:case 23:return Id(),null;case 24:return null;default:return null}}var vi=!1,Ye=!1,t2=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){Ce(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Rh=!1;function n2(e,t){if(Xu=da,e=cg(),ud(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,a=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(a=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&&(a=i),f===o&&++h===r&&(u=i),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},da=!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,N=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ct(t.type,w),N);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(S){Ce(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Rh,Rh=!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 nl(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 ix(e){var t=e.alternate;t!==null&&(e.alternate=null,ix(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[jo],delete t[Ju],delete t[$N],delete t[ON])),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 ax(e){return e.tag===5||e.tag===3||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ax(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=ma));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 Oe=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(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Ga,n)}catch{}switch(n.tag){case 5:Ye||Ur(n,t);case 6:var r=Oe,s=Et;Oe=null,Nn(e,t,n),Oe=r,Et=s,Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Et?(e=Oe,n=n.stateNode,e.nodeType===8?Ql(e.parentNode,n):e.nodeType===1&&Ql(e,n),wo(e)):Ql(Oe,n.stateNode));break;case 4:r=Oe,s=Et,Oe=n.stateNode.containerInfo,Et=!0,Nn(e,t,n),Oe=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(a){Ce(n,t,a)}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 Lh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new t2),t.forEach(function(r){var s=d2.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,a=i;e:for(;a!==null;){switch(a.tag){case 5:Oe=a.stateNode,Et=!1;break e;case 3:Oe=a.stateNode.containerInfo,Et=!0;break e;case 4:Oe=a.stateNode.containerInfo,Et=!0;break e}a=a.return}if(Oe===null)throw Error(H(160));lx(o,i,s),Oe=null,Et=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){Ce(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ux(t,e),t=t.sibling}function ux(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),Ht(e),r&4){try{lo(3,e,e.return),nl(3,e)}catch(w){Ce(e,e.return,w)}try{lo(5,e,e.return)}catch(w){Ce(e,e.return,w)}}break;case 1:jt(t,e),Ht(e),r&512&&n!==null&&Ur(n,n.return);break;case 5:if(jt(t,e),Ht(e),r&512&&n!==null&&Ur(n,n.return),e.flags&32){var s=e.stateNode;try{go(s,"")}catch(w){Ce(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Ip(s,o),Ou(a,i);var c=Ou(a,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?zp(s,d):h==="dangerouslySetInnerHTML"?Lp(s,d):h==="children"?go(s,d):Qc(s,h,d,c)}switch(a){case"input":Lu(s,o);break;case"textarea":Rp(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Gr(s,!!o.multiple,x,!1):f!==!!o.multiple&&(o.defaultValue!=null?Gr(s,!!o.multiple,o.defaultValue,!0):Gr(s,!!o.multiple,o.multiple?[]:"",!1))}s[jo]=o}catch(w){Ce(e,e.return,w)}}break;case 6:if(jt(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){Ce(e,e.return,w)}}break;case 3:if(jt(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wo(t.containerInfo)}catch(w){Ce(e,e.return,w)}break;case 4:jt(t,e),Ht(e);break;case 13:jt(t,e),Ht(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Pd=Ee())),r&4&&Lh(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),Ht(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){Ce(r,n,w)}}break;case 5:Ur(f,f.return);break;case 22:if(f.memoizedState!==null){zh(d);continue}}x!==null?(x.return=f,W=x):zh(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"):(a=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Ap("display",i))}catch(w){Ce(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){Ce(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),Ht(e),r&4&&Lh(e);break;case 21:break;default:jt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ax(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&&(go(s,""),r.flags&=-33);var o=Th(e);pc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,a=Th(e);mc(e,a,i);break;default:throw Error(H(161))}}catch(u){Ce(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function r2(e,t,n){W=e,cx(e)}function cx(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||vi;if(!i){var a=s.alternate,u=a!==null&&a.memoizedState!==null||Ye;a=vi;var c=Ye;if(vi=i,(Ye=u)&&!c)for(W=s;W!==null;)i=W,u=i.child,i.tag===22&&i.memoizedState!==null?Dh(s):u!==null?(u.return=i,W=u):Dh(s);for(;o!==null;)W=o,cx(o),o=o.sibling;W=s,vi=a,Ye=c}Ah(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Ah(e)}}function Ah(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||nl(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&&vh(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}vh(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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&&wo(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){Ce(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 zh(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 Dh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(u){Ce(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){Ce(t,s,u)}}var o=t.return;try{hc(t)}catch(u){Ce(t,o,u)}break;case 5:var i=t.return;try{hc(t)}catch(u){Ce(t,i,u)}}}catch(u){Ce(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var s2=Math.ceil,ja=xn.ReactCurrentDispatcher,Ed=xn.ReactCurrentOwner,Nt=xn.ReactCurrentBatchConfig,ae=0,De=null,Me=null,Fe=0,lt=0,Wr=Qn(0),Te=0,Io=null,mr=0,rl=0,_d=0,uo=null,tt=null,Pd=0,us=1/0,sn=null,Ca=!1,gc=null,On=null,wi=!1,Tn=null,Ea=0,co=0,xc=null,Gi=-1,Xi=0;function Qe(){return ae&6?Ee():Gi!==-1?Gi:Gi=Ee()}function Fn(e){return e.mode&1?ae&2&&Fe!==0?Fe&-Fe:HN.transition!==null?(Xi===0&&(Xi=Gp()),Xi):(e=de,e!==0||(e=window.event,e=e===void 0?16:tg(e.type)),e):1}function Lt(e,t,n,r){if(50<co)throw co=0,xc=null,Error(H(185));Bo(e,n,r),(!(ae&2)||e!==De)&&(e===De&&(!(ae&2)&&(rl|=n),Te===4&&Mn(e,Fe)),it(e,r),n===1&&ae===0&&!(t.mode&1)&&(us=Ee()+500,Ja&&qn()))}function it(e,t){var n=e.callbackNode;Hw(e,t);var r=ca(e,e===De?Fe:0);if(r===0)n!==null&&Kf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kf(n),t===1)e.tag===0?FN($h.bind(null,e)):wg($h.bind(null,e)),zN(function(){!(ae&6)&&qn()}),n=null;else{switch(Xp(r)){case 1:n=td;break;case 4:n=Kp;break;case 16:n=ua;break;case 536870912:n=Yp;break;default:n=ua}n=yx(n,dx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function dx(e,t){if(Gi=-1,Xi=0,ae&6)throw Error(H(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=ca(e,e===De?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_a(e,r);else{t=r;var s=ae;ae|=2;var o=hx();(De!==e||Fe!==t)&&(sn=null,us=Ee()+500,ar(e,t));do try{a2();break}catch(a){fx(e,a)}while(!0);md(),ja.current=o,ae=s,Me!==null?t=0:(De=null,Fe=0,t=Te)}if(t!==0){if(t===2&&(s=Uu(e),s!==0&&(r=s,t=yc(e,s))),t===1)throw n=Io,ar(e,0),Mn(e,r),it(e,Ee()),n;if(t===6)Mn(e,r);else{if(s=e.current.alternate,!(r&30)&&!o2(s)&&(t=_a(e,r),t===2&&(o=Uu(e),o!==0&&(r=o,t=yc(e,o))),t===1))throw n=Io,ar(e,0),Mn(e,r),it(e,Ee()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:er(e,tt,sn);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Pd+500-Ee(),10<t)){if(ca(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Zu(er.bind(null,e,tt,sn),t);break}er(e,tt,sn);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=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s2(r/1960))-r,10<r){e.timeoutHandle=Zu(er.bind(null,e,tt,sn),r);break}er(e,tt,sn);break;case 5:er(e,tt,sn);break;default:throw Error(H(329))}}}return it(e,Ee()),e.callbackNode===n?dx.bind(null,e):null}function yc(e,t){var n=uo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=_a(e,t),e!==2&&(t=tt,tt=n,t!==null&&vc(t)),e}function vc(e){tt===null?tt=e:tt.push.apply(tt,e)}function o2(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&=~_d,t&=~rl,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 $h(e){if(ae&6)throw Error(H(327));Jr();var t=ca(e,0);if(!(t&1))return it(e,Ee()),null;var n=_a(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=Io,ar(e,0),Mn(e,t),it(e,Ee()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,tt,sn),it(e,Ee()),null}function Md(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(us=Ee()+500,Ja&&qn())}}function pr(e){Tn!==null&&Tn.tag===0&&!(ae&6)&&Jr();var t=ae;ae|=1;var n=Nt.transition,r=de;try{if(Nt.transition=null,de=1,e)return e()}finally{de=r,Nt.transition=n,ae=t,!(ae&6)&&qn()}}function Id(){lt=Wr.current,ge(Wr)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,AN(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(dd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pa();break;case 3:as(),ge(st),ge(Ge),wd();break;case 5:vd(r);break;case 4:as();break;case 13:ge(Ne);break;case 19:ge(Ne);break;case 10:pd(r.type._context);break;case 22:case 23:Id()}n=n.return}if(De=e,Me=e=Hn(e.current,null),Fe=lt=t,Te=0,Io=null,_d=rl=mr=0,tt=uo=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 fx(e,t){do{var n=Me;try{if(md(),Wi.current=ka,ba){for(var r=be.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ba=!1}if(hr=0,ze=Re=be=null,ao=!1,_o=0,Ed.current=null,n===null||n.return===null){Te=1,Io=t,Me=null;break}e:{var o=e,i=n.return,a=n,u=t;if(t=Fe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=a,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=jh(i);if(x!==null){x.flags&=-257,Ch(x,i,a,o,t),x.mode&1&&kh(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)){kh(o,c,t),Rd();break e}u=Error(H(426))}}else if(xe&&a.mode&1){var N=jh(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Ch(N,i,a,o,t),fd(ls(u,a));break e}}o=u=ls(u,a),Te!==4&&(Te=2),uo===null?uo=[o]:uo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=Xg(o,u,t);yh(o,m);break e;case 1:a=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 S=Qg(o,a,t);yh(o,S);break e}}o=o.return}while(o!==null)}px(n)}catch(b){t=b,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function hx(){var e=ja.current;return ja.current=ka,e===null?ka:e}function Rd(){(Te===0||Te===3||Te===2)&&(Te=4),De===null||!(mr&268435455)&&!(rl&268435455)||Mn(De,Fe)}function _a(e,t){var n=ae;ae|=2;var r=hx();(De!==e||Fe!==t)&&(sn=null,ar(e,t));do try{i2();break}catch(s){fx(e,s)}while(!0);if(md(),ae=n,ja.current=r,Me!==null)throw Error(H(261));return De=null,Fe=0,Te}function i2(){for(;Me!==null;)mx(Me)}function a2(){for(;Me!==null&&!Rw();)mx(Me)}function mx(e){var t=xx(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?px(e):Me=t,Ed.current=null}function px(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=e2(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Me=null;return}}else if(n=JN(n,t,lt),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Te===0&&(Te=5)}function er(e,t,n){var r=de,s=Nt.transition;try{Nt.transition=null,de=1,l2(e,t,n,r)}finally{Nt.transition=s,de=r}return null}function l2(e,t,n,r){do Jr();while(Tn!==null);if(ae&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(Vw(e,o),e===De&&(Me=De=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wi||(wi=!0,yx(ua,function(){return Jr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Nt.transition,Nt.transition=null;var i=de;de=1;var a=ae;ae|=4,Ed.current=null,n2(e,n),ux(n,e),_N(Qu),da=!!Xu,Qu=Xu=null,e.current=n,r2(n),Tw(),ae=a,de=i,Nt.transition=o}else e.current=n;if(wi&&(wi=!1,Tn=e,Ea=s),o=e.pendingLanes,o===0&&(On=null),zw(n.stateNode),it(e,Ee()),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(Ca)throw Ca=!1,e=gc,gc=null,e;return Ea&1&&e.tag!==0&&Jr(),o=e.pendingLanes,o&1?e===xc?co++:(co=0,xc=e):co=0,qn(),null}function Jr(){if(Tn!==null){var e=Xp(Ea),t=Nt.transition,n=de;try{if(Nt.transition=null,de=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Ea=0,ae&6)throw Error(H(331));var s=ae;for(ae|=4,W=e.current;W!==null;){var o=W,i=o.child;if(W.flags&16){var a=o.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[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(ix(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 N=w.sibling;w.sibling=null,w=N}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(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:nl(9,a)}}catch(b){Ce(a,a.return,b)}if(a===i){W=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,W=S;break e}W=a.return}}if(ae=s,qn(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Ga,e)}catch{}r=!0}return r}finally{de=n,Nt.transition=t}}return!1}function Oh(e,t,n){t=ls(n,t),t=Xg(e,t,1),e=$n(e,t,1),t=Qe(),e!==null&&(Bo(e,1,t),it(e,t))}function Ce(e,t,n){if(e.tag===3)Oh(e,e,n);else for(;t!==null;){if(t.tag===3){Oh(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=ls(n,e),e=Qg(t,e,1),t=$n(t,e,1),e=Qe(),t!==null&&(Bo(t,1,e),it(t,e));break}}t=t.return}}function u2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(Fe&n)===n&&(Te===4||Te===3&&(Fe&130023424)===Fe&&500>Ee()-Pd?ar(e,0):_d|=n),it(e,t)}function gx(e,t){t===0&&(e.mode&1?(t=ci,ci<<=1,!(ci&130023424)&&(ci=4194304)):t=1);var n=Qe();e=mn(e,t),e!==null&&(Bo(e,t,n),it(e,n))}function c2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gx(e,n)}function d2(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),gx(e,n)}var xx;xx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,ZN(e,t,n);nt=!!(e.flags&131072)}else nt=!1,xe&&t.flags&1048576&&Ng(t,ya,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=Sd(null,t,r,e,s,n);var o=bd();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,ot(r)?(o=!0,ga(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,xd(t),s.updater=tl,t.stateNode=s,s._reactInternals=t,oc(t,r,e,n),t=lc(null,t,r,!0,o,n)):(t.tag=0,xe&&o&&cd(t),Xe(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=h2(r),e=Ct(r,e),s){case 0:t=ac(null,t,r,e,n);break e;case 1:t=Ph(null,t,r,e,n);break e;case 11:t=Eh(null,t,r,e,n);break e;case 14:t=_h(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),ac(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Ph(e,t,r,s,n);case 3:e:{if(ex(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Eg(e,t),Na(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=ls(Error(H(423)),t),t=Mh(e,t,r,n,s);break e}else if(r!==s){s=ls(Error(H(424)),t),t=Mh(e,t,r,n,s);break e}else for(ft=Dn(t.stateNode.containerInfo.firstChild),ht=t,xe=!0,Pt=null,n=jg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(os(),r===s){t=pn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return _g(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),Jg(e,t),Xe(e,t,i,n),t.child;case 6:return e===null&&nc(t),null;case 13:return tx(e,t,n);case 4:return yd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Eh(e,t,r,s,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(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(va,r._currentValue),r._currentValue=i,o!==null)if(At(o.value,i)){if(o.children===s.children&&!st.current){t=pn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=cn(-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),a.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,a=i.alternate,a!==null&&(a.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}Xe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Zr(t,n),s=St(s),r=r(s),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),_h(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,ot(r)?(e=!0,ga(t)):e=!1,Zr(t,n),Gg(t,r,s),oc(t,r,s,n),lc(null,t,r,!0,e,n);case 19:return nx(e,t,n);case 22:return Zg(e,t,n)}throw Error(H(156,t.tag))};function yx(e,t){return Wp(e,t)}function f2(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 wt(e,t,n,r){return new f2(e,t,n,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function h2(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zc)return 11;if(e===Jc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Td(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ar:return lr(n.children,s,o,t);case qc:i=8,s|=8;break;case Pu:return e=wt(12,n,t,s|2),e.elementType=Pu,e.lanes=o,e;case Mu:return e=wt(13,n,t,s),e.elementType=Mu,e.lanes=o,e;case Iu:return e=wt(19,n,t,s),e.elementType=Iu,e.lanes=o,e;case _p:return sl(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cp:i=10;break e;case Ep:i=9;break e;case Zc:i=11;break e;case Jc:i=14;break e;case En:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=wt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function lr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=_p,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m2(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=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ld(e,t,n,r,s,o,i,a,u){return e=new m2(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xd(o),e}function p2(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 vx(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(ot(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(ot(n))return vg(e,n,t)}return t}function wx(e,t,n,r,s,o,i,a,u){return e=Ld(n,r,!0,e,s,o,i,a,u),e.context=vx(null),n=e.current,r=Qe(),s=Fn(n),o=cn(r,s),o.callback=t??null,$n(n,o,s),e.current.lanes=s,Bo(e,s,r),it(e,r),e}function ol(e,t,n,r){var s=t.current,o=Qe(),i=Fn(s);return n=vx(n),t.context===null?t.context=n:t.pendingContext=n,t=cn(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),Ui(e,s,i)),i}function Pa(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 Fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ad(e,t){Fh(e,t),(e=e.alternate)&&Fh(e,t)}function g2(){return null}var Nx=typeof reportError=="function"?reportError:function(e){console.error(e)};function zd(e){this._internalRoot=e}il.prototype.render=zd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));ol(e,t,null,null)};il.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){ol(null,e,null,null)}),t[hn]=null}};function il(e){this._internalRoot=e}il.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zp();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&&eg(e)}};function Dd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hh(){}function x2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Pa(i);o.call(c)}}var i=wx(t,r,e,0,null,!1,!1,"",Hh);return e._reactRootContainer=i,e[hn]=i.current,bo(e.nodeType===8?e.parentNode:e),pr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Pa(u);a.call(c)}}var u=Ld(e,0,!1,null,null,!1,!1,"",Hh);return e._reactRootContainer=u,e[hn]=u.current,bo(e.nodeType===8?e.parentNode:e),pr(function(){ol(t,u,n,r)}),u}function ll(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var a=s;s=function(){var u=Pa(i);a.call(u)}}ol(t,i,e,s)}else i=x2(n,t,e,s,r);return Pa(i)}Qp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zs(t.pendingLanes);n!==0&&(nd(t,n|1),it(t,Ee()),!(ae&6)&&(us=Ee()+500,qn()))}break;case 13:pr(function(){var r=mn(e,1);if(r!==null){var s=Qe();Lt(r,e,1,s)}}),Ad(e,1)}};rd=function(e){if(e.tag===13){var t=mn(e,134217728);if(t!==null){var n=Qe();Lt(t,e,134217728,n)}Ad(e,134217728)}};qp=function(e){if(e.tag===13){var t=Fn(e),n=mn(e,t);if(n!==null){var r=Qe();Lt(n,e,t,r)}Ad(e,t)}};Zp=function(){return de};Jp=function(e,t){var n=de;try{return de=e,t()}finally{de=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=Za(r);if(!s)throw Error(H(90));Mp(r),Lu(r,s)}}}break;case"textarea":Rp(e,n);break;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}};Op=Md;Fp=pr;var y2={usingClientEntryPoint:!1,Events:[Wo,Or,Za,Dp,$p,Md]},Bs={findFiberByHostInstance:nr,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},v2={bundleType:Bs.bundleType,version:Bs.version,rendererPackageName:Bs.rendererPackageName,rendererConfig:Bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Bp(e),e===null?null:e.stateNode},findFiberByHostInstance:Bs.findFiberByHostInstance||g2,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 Ni=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ni.isDisabled&&Ni.supportsFiber)try{Ga=Ni.inject(v2),Yt=Ni}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=y2;gt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dd(t))throw Error(H(200));return p2(e,t,null,n)};gt.createRoot=function(e,t){if(!Dd(e))throw Error(H(299));var n=!1,r="",s=Nx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Ld(e,1,!1,null,null,n,!1,r,s),e[hn]=t.current,bo(e.nodeType===8?e.parentNode:e),new zd(t)};gt.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=Bp(t),e=e===null?null:e.stateNode,e};gt.flushSync=function(e){return pr(e)};gt.hydrate=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!0,n)};gt.hydrateRoot=function(e,t,n){if(!Dd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=Nx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=wx(t,null,e,1,n??null,s,!1,o,i),e[hn]=t.current,bo(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 il(t)};gt.render=function(e,t,n){if(!al(t))throw Error(H(200));return ll(null,e,t,!1,n)};gt.unmountComponentAtNode=function(e){if(!al(e))throw Error(H(40));return e._reactRootContainer?(pr(function(){ll(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1};gt.unstable_batchedUpdates=Md;gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!al(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return ll(e,t,n,!1,r)};gt.version="18.3.0-next-8a015b68cc-20240425";function Sx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sx)}catch(e){console.error(e)}}Sx(),Sp.exports=gt;var ul=Sp.exports;const w2=Bc(ul);var Vh=ul;Eu.createRoot=Vh.createRoot,Eu.hydrateRoot=Vh.hydrateRoot;/**
41
41
  * react-router v7.1.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,49 +46,49 @@ Error generating stack: `+o.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */var Bh="popstate";function b2(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return wc("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ro(s)}return j2(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function k2(){return Math.random().toString(36).substring(2,10)}function Uh(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"?ks(t):t,state:n,key:t&&t.key||r||k2()}}function Ro({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 ks(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 j2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="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(){a="POP";let N=h(),m=N==null?null:N-c;c=N,u&&u({action:a,location:w.location,delta:m})}function f(N,m){a="PUSH";let v=wc(w.location,N,m);c=h()+1;let g=Uh(v,c),S=w.createHref(v);try{i.pushState(g,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(S)}o&&u&&u({action:a,location:w.location,delta:1})}function x(N,m){a="REPLACE";let v=wc(w.location,N,m);c=h();let g=Uh(v,c),S=w.createHref(v);i.replaceState(g,"",S),o&&u&&u({action:a,location:w.location,delta:0})}function y(N){let m=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:Ro(N);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 a},get location(){return e(s,i)},listen(N){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Bh,d),u=N,()=>{s.removeEventListener(Bh,d),u=null}},createHref(N){return t(s,N)},createURL:y,encodeLocation(N){let m=y(N);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:x,go(N){return i.go(N)}};return w}function bx(e,t,n="/"){return C2(e,t,n,!1)}function C2(e,t,n,r){let s=typeof t=="string"?ks(t):t,o=Wn(s.pathname||"/",n);if(o==null)return null;let i=kx(e);E2(i);let a=null;for(let u=0;a==null&&u<i.length;++u){let c=$2(o);a=z2(i[u],c,r)}return a}function kx(e,t=[],n=[],r=""){let s=(o,i,a)=>{let u={relativePath:a===void 0?o.path||"":a,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=dn([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}".`),kx(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:L2(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let u of jx(o.path))s(o,i,u)}),t}function jx(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=jx(r.join("/")),a=[];return a.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&a.push(...i),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function E2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:A2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _2=/^:[\w-]+$/,P2=3,M2=2,I2=1,R2=10,T2=-2,Wh=e=>e==="*";function L2(e,t){let n=e.split("/"),r=n.length;return n.some(Wh)&&(r+=T2),t&&(r+=M2),n.filter(s=>!Wh(s)).reduce((s,o)=>s+(_2.test(o)?P2:o===""?I2:R2),r)}function A2(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 z2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:dn([o,d.pathname]),pathnameBase:V2(dn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=dn([o,d.pathnameBase]))}return i}function Ma(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=D2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let y=a[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=a[f];return d&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function D2(e,t=!1,n=!0){zt(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,a,u)=>(r.push({paramName:a,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 $2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zt(!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 O2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ks(e):e;return{pathname:n?n.startsWith("/")?n:F2(n,t):t,search:B2(r),hash:U2(s)}}function F2(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 H2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $d(e){let t=H2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Od(e,t,n,r=!1){let s;typeof e=="string"?s=ks(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,a;if(i==null)a=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("/")}a=d>=0?t[d]:"/"}let u=O2(s,a),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var dn=e=>e.join("/").replace(/\/\/+/g,"/"),V2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,U2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function W2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Cx=["POST","PUT","PATCH","DELETE"];new Set(Cx);var K2=["GET",...Cx];new Set(K2);var js=p.createContext(null);js.displayName="DataRouter";var cl=p.createContext(null);cl.displayName="DataRouterState";var Ex=p.createContext({isTransitioning:!1});Ex.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 Yo=p.createContext(null);Yo.displayName="Location";var kt=p.createContext({outlet:null,matches:[],isDataRoute:!1});kt.displayName="Route";var Fd=p.createContext(null);Fd.displayName="RouteError";function X2(e,{relative:t}={}){ye(Cs(),"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}=Go(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:dn([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Cs(){return p.useContext(Yo)!=null}function yn(){return ye(Cs(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Yo).location}var _x="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Px(e){p.useContext(Ot).static||p.useLayoutEffect(e)}function Hd(){let{isDataRoute:e}=p.useContext(kt);return e?dS():Q2()}function Q2(){ye(Cs(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(js),{basename:t,navigator:n}=p.useContext(Ot),{matches:r}=p.useContext(kt),{pathname:s}=yn(),o=JSON.stringify($d(r)),i=p.useRef(!1);return Px(()=>{i.current=!0}),p.useCallback((u,c={})=>{if(zt(i.current,_x),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Od(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:dn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var q2=p.createContext(null);function Z2(e){let t=p.useContext(kt).outlet;return t&&p.createElement(q2.Provider,{value:e},t)}function J2(){let{matches:e}=p.useContext(kt),t=e[e.length-1];return t?t.params:{}}function Go(e,{relative:t}={}){let{matches:n}=p.useContext(kt),{pathname:r}=yn(),s=JSON.stringify($d(n));return p.useMemo(()=>Od(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function eS(e,t){return Mx(e,t)}function Mx(e,t,n,r){var m;ye(Cs(),"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],a=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Ix(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.
49
+ */var Bh="popstate";function N2(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return wc("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ro(s)}return b2(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function S2(){return Math.random().toString(36).substring(2,10)}function Uh(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"?ks(t):t,state:n,key:t&&t.key||r||S2()}}function Ro({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 ks(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 b2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="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(){a="POP";let N=h(),m=N==null?null:N-c;c=N,u&&u({action:a,location:w.location,delta:m})}function f(N,m){a="PUSH";let v=wc(w.location,N,m);c=h()+1;let g=Uh(v,c),S=w.createHref(v);try{i.pushState(g,"",S)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(S)}o&&u&&u({action:a,location:w.location,delta:1})}function x(N,m){a="REPLACE";let v=wc(w.location,N,m);c=h();let g=Uh(v,c),S=w.createHref(v);i.replaceState(g,"",S),o&&u&&u({action:a,location:w.location,delta:0})}function y(N){let m=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:Ro(N);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 a},get location(){return e(s,i)},listen(N){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Bh,d),u=N,()=>{s.removeEventListener(Bh,d),u=null}},createHref(N){return t(s,N)},createURL:y,encodeLocation(N){let m=y(N);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:x,go(N){return i.go(N)}};return w}function bx(e,t,n="/"){return k2(e,t,n,!1)}function k2(e,t,n,r){let s=typeof t=="string"?ks(t):t,o=Wn(s.pathname||"/",n);if(o==null)return null;let i=kx(e);j2(i);let a=null;for(let u=0;a==null&&u<i.length;++u){let c=z2(o);a=L2(i[u],c,r)}return a}function kx(e,t=[],n=[],r=""){let s=(o,i,a)=>{let u={relativePath:a===void 0?o.path||"":a,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=dn([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}".`),kx(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:R2(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let u of jx(o.path))s(o,i,u)}),t}function jx(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=jx(r.join("/")),a=[];return a.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&a.push(...i),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function j2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:T2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var C2=/^:[\w-]+$/,E2=3,_2=2,P2=1,M2=10,I2=-2,Wh=e=>e==="*";function R2(e,t){let n=e.split("/"),r=n.length;return n.some(Wh)&&(r+=I2),t&&(r+=_2),n.filter(s=>!Wh(s)).reduce((s,o)=>s+(C2.test(o)?E2:o===""?P2:M2),r)}function T2(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 L2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ma({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:dn([o,d.pathname]),pathnameBase:F2(dn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=dn([o,d.pathnameBase]))}return i}function Ma(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=A2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let y=a[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=a[f];return d&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function A2(e,t=!1,n=!0){zt(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,a,u)=>(r.push({paramName:a,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 z2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zt(!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 D2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ks(e):e;return{pathname:n?n.startsWith("/")?n:$2(n,t):t,search:H2(r),hash:V2(s)}}function $2(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 O2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $d(e){let t=O2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Od(e,t,n,r=!1){let s;typeof e=="string"?s=ks(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,a;if(i==null)a=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("/")}a=d>=0?t[d]:"/"}let u=D2(s,a),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var dn=e=>e.join("/").replace(/\/\/+/g,"/"),F2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,V2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function B2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Cx=["POST","PUT","PATCH","DELETE"];new Set(Cx);var U2=["GET",...Cx];new Set(U2);var js=p.createContext(null);js.displayName="DataRouter";var cl=p.createContext(null);cl.displayName="DataRouterState";var Ex=p.createContext({isTransitioning:!1});Ex.displayName="ViewTransition";var W2=p.createContext(new Map);W2.displayName="Fetchers";var K2=p.createContext(null);K2.displayName="Await";var $t=p.createContext(null);$t.displayName="Navigation";var Yo=p.createContext(null);Yo.displayName="Location";var kt=p.createContext({outlet:null,matches:[],isDataRoute:!1});kt.displayName="Route";var Fd=p.createContext(null);Fd.displayName="RouteError";function Y2(e,{relative:t}={}){ye(Cs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext($t),{hash:s,pathname:o,search:i}=Go(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:dn([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Cs(){return p.useContext(Yo)!=null}function yn(){return ye(Cs(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Yo).location}var _x="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Px(e){p.useContext($t).static||p.useLayoutEffect(e)}function Hd(){let{isDataRoute:e}=p.useContext(kt);return e?uS():G2()}function G2(){ye(Cs(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(js),{basename:t,navigator:n}=p.useContext($t),{matches:r}=p.useContext(kt),{pathname:s}=yn(),o=JSON.stringify($d(r)),i=p.useRef(!1);return Px(()=>{i.current=!0}),p.useCallback((u,c={})=>{if(zt(i.current,_x),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Od(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:dn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var X2=p.createContext(null);function Q2(e){let t=p.useContext(kt).outlet;return t&&p.createElement(X2.Provider,{value:e},t)}function q2(){let{matches:e}=p.useContext(kt),t=e[e.length-1];return t?t.params:{}}function Go(e,{relative:t}={}){let{matches:n}=p.useContext(kt),{pathname:r}=yn(),s=JSON.stringify($d(n));return p.useMemo(()=>Od(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function Z2(e,t){return Mx(e,t)}function Mx(e,t,n,r){var m;ye(Cs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext($t),{matches:o}=p.useContext(kt),i=o[o.length-1],a=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Ix(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
50
 
51
- Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=yn(),f;if(t){let v=typeof t=="string"?ks(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=bx(e,{pathname:y});zt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),zt(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 N=oS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:dn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:dn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?p.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function tS(){let e=cS(),t=W2(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 nS=p.createElement(tS,null),rS=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(Fd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function sS({routeContext:e,match:t,children:n}){let r=p.useContext(js);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 oS(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,a=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=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,a>=0?s=s.slice(0,a+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||nS,i&&(a<0&&h===0?(Ix("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,y=null):a===h&&(f=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{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(sS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:m})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?p.createElement(rS,{location:n.location,revalidation:n.revalidation,component:x,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Vd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iS(e){let t=p.useContext(js);return ye(t,Vd(e)),t}function aS(e){let t=p.useContext(cl);return ye(t,Vd(e)),t}function lS(e){let t=p.useContext(kt);return ye(t,Vd(e)),t}function Bd(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 uS(){return Bd("useRouteId")}function cS(){var r;let e=p.useContext(Fd),t=aS("useRouteError"),n=Bd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function dS(){let{router:e}=iS("useNavigate"),t=Bd("useNavigate"),n=p.useRef(!1);return Px(()=>{n.current=!0}),p.useCallback(async(s,o={})=>{zt(n.current,_x),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Kh={};function Ix(e,t,n){!t&&!Kh[e]&&(Kh[e]=!0,zt(!1,n))}p.memo(fS);function fS({routes:e,future:t,state:n}){return Mx(e,void 0,n,t)}function Nc({to:e,replace:t,state:n,relative:r}){ye(Cs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(Ot);zt(!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}=yn(),a=Hd(),u=Od(e,$d(o),i,r==="path"),c=JSON.stringify(u);return p.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function hS(e){return Z2(e.context)}function Ke(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 mS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){ye(!Cs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=p.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=ks(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 zt(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:a},p.createElement(Yo.Provider,{children:t,value:x}))}function pS({children:e,location:t}){return eS(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===Ke,`[${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 dl(e){return e!=null&&typeof e.tagName=="string"}function gS(e){return dl(e)&&e.tagName.toLowerCase()==="button"}function xS(e){return dl(e)&&e.tagName.toLowerCase()==="form"}function yS(e){return dl(e)&&e.tagName.toLowerCase()==="input"}function vS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wS(e,t){return e.button===0&&(!t||t==="_self")&&!vS(e)}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 au(e){return e!=null&&!SS.has(e)?(zt(!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(xS(e)){let a=e.getAttribute("action");r=a?Wn(a,t):null,n=e.getAttribute("method")||Qi,s=au(e.getAttribute("enctype"))||qi,o=new FormData(e)}else if(gS(e)||yS(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||a.getAttribute("action");if(r=u?Wn(u,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Qi,s=au(e.getAttribute("formenctype"))||au(a.getAttribute("enctype"))||qi,o=new FormData(a,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(dl(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 Ud(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,a=(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)||a(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)||a(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(js);return Ud(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function TS(){let e=p.useContext(cl);return Ud(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wd=p.createContext(void 0);Wd.displayName="FrameworkContext";function Rx(){let e=p.useContext(Wd);return Ud(e,"You must render this element inside a <HydratedRouter> element"),e}function LS(e,t){let n=p.useContext(Wd),[r,s]=p.useState(!1),[o,i]=p.useState(!1),{onFocus:a,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)})},N=new IntersectionObserver(w,{threshold:.5});return f.current&&N.observe(f.current),()=>{N.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:Us(a,x),onBlur:Us(u,y),onMouseEnter:Us(c,x),onMouseLeave:Us(h,y),onTouchStart:Us(d,x)}]:[!1,f,{}]}function Us(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function AS({page:e,...t}){let{router:n}=RS(),r=p.useMemo(()=>bx(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}=Rx(),[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=yn(),{manifest:s,routeModules:o}=Rx(),{loaderData:i,matches:a}=TS(),u=p.useMemo(()=>Yh(e,t,a,s,r,"data"),[e,t,a,s,r]),c=p.useMemo(()=>Yh(e,t,a,s,r,"assets"),[e,t,a,s,r]),h=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(N=>{var v;let m=s.routes[N.route.id];!m||!m.hasLoader||(!u.some(g=>g.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||m.hasClientLoader?y=!0:x.add(N.route.id))}),x.size===0)return[];let w=IS(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(N=>x.has(N.route.id)).map(N=>N.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 Tx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Tx&&(window.__reactRouterVersion="7.1.0")}catch{}function OS({basename:e,children:t,window:n}){let r=p.useRef();r.current==null&&(r.current=b2({window:n,v5Compat:!0}));let s=r.current,[o,i]=p.useState({action:s.action,location:s.location}),a=p.useCallback(u=>{p.startTransition(()=>i(u))},[i]);return p.useLayoutEffect(()=>s.listen(a),[s,a]),p.createElement(mS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Lx=/^(?:[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:a,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},x){let{basename:y}=p.useContext(Ot),w=typeof c=="string"&&Lx.test(c),N,m=!1;if(typeof c=="string"&&w&&(N=c,Tx))try{let I=new URL(window.location.href),$=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Wn($.pathname,y);$.origin===I.origin&&R!=null?c=R+$.search+$.hash:m=!0}catch{zt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=X2(c,{relative:s}),[g,S,b]=LS(r,f),j=VS(c,{replace:i,state:a,target:u,preventScrollReset:h,relative:s,viewTransition:d});function k(I){t&&t(I),I.defaultPrevented||j(I)}let _=p.createElement("a",{...f,...b,href:N||v,onClick:m||o?t:k,ref:$S(x,S),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 Ax=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:a,children:u,...c},h){let d=Go(i,{relative:c.relative}),f=yn(),x=p.useContext(cl),{navigator:y,basename:w}=p.useContext(Ot),N=x!=null&&YS(d)&&a===!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 S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let b=v===m||!s&&v.startsWith(m)&&v.charAt(S)==="/",j=g!=null&&(g===m||!s&&g.startsWith(m)&&g.charAt(m.length)==="/"),k={isActive:b,isPending:j,isTransitioning:N},_=b?t:void 0,I;typeof r=="function"?I=r(k):I=[r,b?"active":null,j?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(k):o;return p.createElement(cs,{...c,"aria-current":_,className:I,ref:h,style:$,to:i,viewTransition:a},typeof u=="function"?u(k):u)});Ax.displayName="NavLink";var FS=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Qi,action:a,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},x)=>{let y=WS(),w=KS(a,{relative:c}),N=i.toLowerCase()==="get"?"get":"post",m=typeof a=="string"&&Lx.test(a),v=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let S=g.nativeEvent.submitter,b=(S==null?void 0:S.getAttribute("formmethod"))||i;y(S||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:N,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 zx(e){let t=p.useContext(js);return ye(t,HS(e)),t}function VS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let a=Hd(),u=yn(),c=Go(e,{relative:o});return p.useCallback(h=>{if(wS(h,t)){h.preventDefault();let d=n!==void 0?n:Ro(u)===Ro(c);a(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,a,c,n,r,t,e,s,o,i])}var BS=0,US=()=>`__${String(++BS)}__`;function WS(){let{router:e}=zx("useSubmit"),{basename:t}=p.useContext(Ot),n=uS();return p.useCallback(async(r,s={})=>{let{action:o,method:i,encType:a,formData:u,body:c}=bS(r,t);if(s.navigate===!1){let h=s.fetcherKey||US();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function KS(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={...Go(e||".",{relative:t})},i=yn();if(e==null){o.search=i.search;let a=new URLSearchParams(o.search),u=a.getAll("index");if(u.some(h=>h==="")){a.delete("index"),u.filter(d=>d).forEach(d=>a.append("index",d));let h=a.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:dn([n,o.pathname])),Ro(o)}function YS(e,t={}){let n=p.useContext(Ex);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zx("useViewTransitionState"),s=Go(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 Ma(s.pathname,i)!=null||Ma(s.pathname,o)!=null}new TextEncoder;const Dx=p.createContext(null);function GS({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]),l.jsx(Dx.Provider,{value:{theme:t,setTheme:r},children:e})}function XS(){const e=p.useContext(Dx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const $x=p.createContext(null);function QS({children:e}){const[t,n]=p.useState(()=>{const a=localStorage.getItem("opentrust_user");return a?JSON.parse(a):null}),[r,s]=p.useState(!!localStorage.getItem("opentrust_user"));p.useEffect(()=>{if(!t){s(!1);return}let a=!1;return(async()=>{try{(await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t.apiKey}`}})).ok||a||(n(null),localStorage.removeItem("opentrust_user"))}catch{}finally{a||s(!1)}})(),()=>{a=!0}},[]);const o=p.useCallback(async(a,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})}),h=await c.json();if(!c.ok||!h.success)throw new Error(h.error??"Login failed");const d={email:h.email,apiKey:h.apiKey,name:h.name};n(d),localStorage.setItem("opentrust_user",JSON.stringify(d))},[]),i=p.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return l.jsx($x.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Kd(){const e=p.useContext($x);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Ox(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=Ox(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ox(e))&&(r&&(r+=" "),r+=t);return r}const Yd="-";function ZS(e){const t=eb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const a=i.split(Yd);return a[0]===""&&a.length!==1&&a.shift(),Fx(a,t)||JS(i)}function o(i,a){const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Fx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Fx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Yd);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId}const Gh=/^\[(.+)\]$/;function JS(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 eb(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nb(Object.entries(e.classGroups),n).forEach(([o,i])=>{bc(i,r,o,t)}),r}function bc(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Xh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(tb(s)){bc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{bc(i,Xh(t,o),n,r)})})}function Xh(e,t){let n=e;return t.split(Yd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function tb(e){return e.isThemeGetter}function nb(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,a])=>[t+i,a])):o);return[n,s]}):e}function rb(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 Hx="!";function sb(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const a=[];let u=0,c=0,h;for(let w=0;w<i.length;w++){let N=i[w];if(u===0){if(N===r&&(n||i.slice(w,w+s)===t)){a.push(i.slice(c,w)),c=w+s;continue}if(N==="/"){h=w;continue}}N==="["?u++:N==="]"&&u--}const d=a.length===0?i:i.substring(c),f=d.startsWith(Hx),x=f?d.substring(1):d,y=h&&h>c?h-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:y}}}function ob(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 ib(e){return{cache:rb(e.cacheSize),splitModifiers:sb(e),...ZS(e)}}const ab=/\s+/;function lb(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(ab).map(i=>{const{modifiers:a,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=ob(a).join(":");return{isTailwindClass:!0,modifierId:u?x+Hx:x,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:u,hasPostfixModifier:c}=i,h=a+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function ub(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vx(t))&&(r&&(r+=" "),r+=n);return r}function Vx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vx(e[r]))&&(n&&(n+=" "),n+=t);return n}function cb(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=ib(c),r=n.cache.get,s=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const h=lb(u,n);return s(u,h),h}return function(){return o(ub.apply(null,arguments))}}function me(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Bx=/^\[(?:([a-z-]+):)?(.+)\]$/i,db=/^\d+\/\d+$/,fb=new Set(["px","full","screen"]),hb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mb=/\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$/,pb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function nn(e){return or(e)||fb.has(e)||db.test(e)}function Sn(e){return Es(e,"length",jb)}function or(e){return!!e&&!Number.isNaN(Number(e))}function Si(e){return Es(e,"number",or)}function Ws(e){return!!e&&Number.isInteger(Number(e))}function yb(e){return e.endsWith("%")&&or(e.slice(0,-1))}function ne(e){return Bx.test(e)}function bn(e){return hb.test(e)}const vb=new Set(["length","size","percentage"]);function wb(e){return Es(e,vb,Ux)}function Nb(e){return Es(e,"position",Ux)}const Sb=new Set(["image","url"]);function bb(e){return Es(e,Sb,Eb)}function kb(e){return Es(e,"",Cb)}function Ks(){return!0}function Es(e,t,n){const r=Bx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function jb(e){return mb.test(e)&&!pb.test(e)}function Ux(){return!1}function Cb(e){return gb.test(e)}function Eb(e){return xb.test(e)}function _b(){const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),a=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"),N=me("margin"),m=me("opacity"),v=me("padding"),g=me("saturate"),S=me("scale"),b=me("sepia"),j=me("skew"),k=me("space"),_=me("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],T=()=>[ne,t],A=()=>["",nn,Sn],C=()=>["auto",or,ne],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[or,Si],O=()=>[or,ne];return{cacheSize:500,separator:":",theme:{colors:[Ks],spacing:[nn,Sn],blur:["none","",bn,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",bn,ne],borderSpacing:T(),borderWidth:A(),contrast:F(),grayscale:P(),hueRotate:O(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[yb,Sn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:P(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[bn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...L(),ne]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],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",Ws,ne]}],basis:[{basis:R()}],"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",Ws,ne]}],"grid-cols":[{"grid-cols":[Ks]}],"col-start-end":[{col:["auto",{span:["full",Ws,ne]},ne]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Ks]}],"row-start-end":[{row:["auto",{span:[Ws,ne]},ne]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"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",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"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:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"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:[Ks]}],"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",nn,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",nn,Sn]}],"underline-offset":[{"underline-offset":["auto",nn,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:T()}],"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:[...L(),Nb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bb]}],"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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"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":[nn,ne]}],"outline-w":[{outline:[nn,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[nn,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bn,kb]}],"shadow-color":[{shadow:[Ks]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],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:O()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ws,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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:[nn,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 Pb=cb(_b);function Pe(...e){return Pb(qS(e))}/**
51
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=yn(),f;if(t){let v=typeof t=="string"?ks(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=bx(e,{pathname:y});zt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),zt(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 N=rS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:dn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:dn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&N?p.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},N):N}function J2(){let e=lS(),t=B2(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 eS=p.createElement(J2,null),tS=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(Fd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function nS({routeContext:e,match:t,children:n}){let r=p.useContext(js);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 rS(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,a=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=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,a>=0?s=s.slice(0,a+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||eS,i&&(a<0&&h===0?(Ix("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,y=null):a===h&&(f=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),N=()=>{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(nS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:m})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?p.createElement(tS,{location:n.location,revalidation:n.revalidation,component:x,error:d,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):N()},null)}function Vd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sS(e){let t=p.useContext(js);return ye(t,Vd(e)),t}function oS(e){let t=p.useContext(cl);return ye(t,Vd(e)),t}function iS(e){let t=p.useContext(kt);return ye(t,Vd(e)),t}function Bd(e){let t=iS(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 Bd("useRouteId")}function lS(){var r;let e=p.useContext(Fd),t=oS("useRouteError"),n=Bd("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function uS(){let{router:e}=sS("useNavigate"),t=Bd("useNavigate"),n=p.useRef(!1);return Px(()=>{n.current=!0}),p.useCallback(async(s,o={})=>{zt(n.current,_x),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Kh={};function Ix(e,t,n){!t&&!Kh[e]&&(Kh[e]=!0,zt(!1,n))}p.memo(cS);function cS({routes:e,future:t,state:n}){return Mx(e,void 0,n,t)}function Nc({to:e,replace:t,state:n,relative:r}){ye(Cs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext($t);zt(!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}=yn(),a=Hd(),u=Od(e,$d(o),i,r==="path"),c=JSON.stringify(u);return p.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function dS(e){return Q2(e.context)}function Ke(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 fS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){ye(!Cs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=p.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=ks(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 zt(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($t.Provider,{value:a},p.createElement(Yo.Provider,{children:t,value:x}))}function hS({children:e,location:t}){return Z2(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===Ke,`[${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",Zi="application/x-www-form-urlencoded";function dl(e){return e!=null&&typeof e.tagName=="string"}function mS(e){return dl(e)&&e.tagName.toLowerCase()==="button"}function pS(e){return dl(e)&&e.tagName.toLowerCase()==="form"}function gS(e){return dl(e)&&e.tagName.toLowerCase()==="input"}function xS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yS(e,t){return e.button===0&&(!t||t==="_self")&&!xS(e)}var Si=null;function vS(){if(Si===null)try{new FormData(document.createElement("form"),0),Si=!1}catch{Si=!0}return Si}var wS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function au(e){return e!=null&&!wS.has(e)?(zt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zi}"`),null):e}function NS(e,t){let n,r,s,o,i;if(pS(e)){let a=e.getAttribute("action");r=a?Wn(a,t):null,n=e.getAttribute("method")||qi,s=au(e.getAttribute("enctype"))||Zi,o=new FormData(e)}else if(mS(e)||gS(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||a.getAttribute("action");if(r=u?Wn(u,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||qi,s=au(e.getAttribute("formenctype"))||au(a.getAttribute("enctype"))||Zi,o=new FormData(a,e),!vS()){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(dl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=qi,r=null,s=Zi,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Ud(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function SS(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 bS(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 kS(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await SS(o,n);return i.links?i.links():[]}return[]}));return _S(r.flat(1).filter(bS).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,a=(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)||a(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)||a(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 jS(e,t){return CS(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 CS(e){return[...new Set(e)]}function ES(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _S(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(ES(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function PS(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 MS(){let e=p.useContext(js);return Ud(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function IS(){let e=p.useContext(cl);return Ud(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wd=p.createContext(void 0);Wd.displayName="FrameworkContext";function Rx(){let e=p.useContext(Wd);return Ud(e,"You must render this element inside a <HydratedRouter> element"),e}function RS(e,t){let n=p.useContext(Wd),[r,s]=p.useState(!1),[o,i]=p.useState(!1),{onFocus:a,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)})},N=new IntersectionObserver(w,{threshold:.5});return f.current&&N.observe(f.current),()=>{N.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:Us(a,x),onBlur:Us(u,y),onMouseEnter:Us(c,x),onMouseLeave:Us(h,y),onTouchStart:Us(d,x)}]:[!1,f,{}]}function Us(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function TS({page:e,...t}){let{router:n}=MS(),r=p.useMemo(()=>bx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(AS,{page:e,matches:r,...t}):null}function LS(e){let{manifest:t,routeModules:n}=Rx(),[r,s]=p.useState([]);return p.useEffect(()=>{let o=!1;return kS(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function AS({page:e,matches:t,...n}){let r=yn(),{manifest:s,routeModules:o}=Rx(),{loaderData:i,matches:a}=IS(),u=p.useMemo(()=>Yh(e,t,a,s,r,"data"),[e,t,a,s,r]),c=p.useMemo(()=>Yh(e,t,a,s,r,"assets"),[e,t,a,s,r]),h=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(N=>{var v;let m=s.routes[N.route.id];!m||!m.hasLoader||(!u.some(g=>g.route.id===N.route.id)&&N.route.id in i&&((v=o[N.route.id])!=null&&v.shouldRevalidate)||m.hasClientLoader?y=!0:x.add(N.route.id))}),x.size===0)return[];let w=PS(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(N=>x.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[i,r,s,u,t,e,o]),d=p.useMemo(()=>jS(c,s),[c,s]),f=LS(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 zS(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Tx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Tx&&(window.__reactRouterVersion="7.1.0")}catch{}function DS({basename:e,children:t,window:n}){let r=p.useRef();r.current==null&&(r.current=N2({window:n,v5Compat:!0}));let s=r.current,[o,i]=p.useState({action:s.action,location:s.location}),a=p.useCallback(u=>{p.startTransition(()=>i(u))},[i]);return p.useLayoutEffect(()=>s.listen(a),[s,a]),p.createElement(fS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Lx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gr=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:a,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},x){let{basename:y}=p.useContext($t),w=typeof c=="string"&&Lx.test(c),N,m=!1;if(typeof c=="string"&&w&&(N=c,Tx))try{let I=new URL(window.location.href),$=c.startsWith("//")?new URL(I.protocol+c):new URL(c),R=Wn($.pathname,y);$.origin===I.origin&&R!=null?c=R+$.search+$.hash:m=!0}catch{zt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=Y2(c,{relative:s}),[g,S,b]=RS(r,f),j=FS(c,{replace:i,state:a,target:u,preventScrollReset:h,relative:s,viewTransition:d});function k(I){t&&t(I),I.defaultPrevented||j(I)}let _=p.createElement("a",{...f,...b,href:N||v,onClick:m||o?t:k,ref:zS(x,S),target:u,"data-discover":!w&&n==="render"?"true":void 0});return g&&!w?p.createElement(p.Fragment,null,_,p.createElement(TS,{page:v})):_});gr.displayName="Link";var Ax=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:a,children:u,...c},h){let d=Go(i,{relative:c.relative}),f=yn(),x=p.useContext(cl),{navigator:y,basename:w}=p.useContext($t),N=x!=null&&WS(d)&&a===!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 S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let b=v===m||!s&&v.startsWith(m)&&v.charAt(S)==="/",j=g!=null&&(g===m||!s&&g.startsWith(m)&&g.charAt(m.length)==="/"),k={isActive:b,isPending:j,isTransitioning:N},_=b?t:void 0,I;typeof r=="function"?I=r(k):I=[r,b?"active":null,j?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(k):o;return p.createElement(gr,{...c,"aria-current":_,className:I,ref:h,style:$,to:i,viewTransition:a},typeof u=="function"?u(k):u)});Ax.displayName="NavLink";var $S=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=qi,action:a,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},x)=>{let y=BS(),w=US(a,{relative:c}),N=i.toLowerCase()==="get"?"get":"post",m=typeof a=="string"&&Lx.test(a),v=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let S=g.nativeEvent.submitter,b=(S==null?void 0:S.getAttribute("formmethod"))||i;y(S||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:N,action:w,onSubmit:r?u:v,...f,"data-discover":!m&&e==="render"?"true":void 0})});$S.displayName="Form";function OS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zx(e){let t=p.useContext(js);return ye(t,OS(e)),t}function FS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let a=Hd(),u=yn(),c=Go(e,{relative:o});return p.useCallback(h=>{if(yS(h,t)){h.preventDefault();let d=n!==void 0?n:Ro(u)===Ro(c);a(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,a,c,n,r,t,e,s,o,i])}var HS=0,VS=()=>`__${String(++HS)}__`;function BS(){let{router:e}=zx("useSubmit"),{basename:t}=p.useContext($t),n=aS();return p.useCallback(async(r,s={})=>{let{action:o,method:i,encType:a,formData:u,body:c}=NS(r,t);if(s.navigate===!1){let h=s.fetcherKey||VS();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function US(e,{relative:t}={}){let{basename:n}=p.useContext($t),r=p.useContext(kt);ye(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Go(e||".",{relative:t})},i=yn();if(e==null){o.search=i.search;let a=new URLSearchParams(o.search),u=a.getAll("index");if(u.some(h=>h==="")){a.delete("index"),u.filter(d=>d).forEach(d=>a.append("index",d));let h=a.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:dn([n,o.pathname])),Ro(o)}function WS(e,t={}){let n=p.useContext(Ex);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zx("useViewTransitionState"),s=Go(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 Ma(s.pathname,i)!=null||Ma(s.pathname,o)!=null}new TextEncoder;const Dx=p.createContext(null);function KS({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]),l.jsx(Dx.Provider,{value:{theme:t,setTheme:r},children:e})}function YS(){const e=p.useContext(Dx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const $x=p.createContext(null);function GS({children:e}){const[t,n]=p.useState(()=>{const a=localStorage.getItem("opentrust_user");return a?JSON.parse(a):null}),[r,s]=p.useState(!!localStorage.getItem("opentrust_user"));p.useEffect(()=>{if(!t){s(!1);return}let a=!1;return(async()=>{try{(await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t.apiKey}`}})).ok||a||(n(null),localStorage.removeItem("opentrust_user"))}catch{}finally{a||s(!1)}})(),()=>{a=!0}},[]);const o=p.useCallback(async(a,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})}),h=await c.json();if(!c.ok||!h.success)throw new Error(h.error??"Login failed");const d={email:h.email,apiKey:h.apiKey,name:h.name};n(d),localStorage.setItem("opentrust_user",JSON.stringify(d))},[]),i=p.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return l.jsx($x.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Kd(){const e=p.useContext($x);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function Ox(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=Ox(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ox(e))&&(r&&(r+=" "),r+=t);return r}const Yd="-";function QS(e){const t=ZS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const a=i.split(Yd);return a[0]===""&&a.length!==1&&a.shift(),Fx(a,t)||qS(i)}function o(i,a){const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Fx(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Fx(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Yd);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId}const Gh=/^\[(.+)\]$/;function qS(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 ZS(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return eb(Object.entries(e.classGroups),n).forEach(([o,i])=>{bc(i,r,o,t)}),r}function bc(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Xh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(JS(s)){bc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{bc(i,Xh(t,o),n,r)})})}function Xh(e,t){let n=e;return t.split(Yd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function JS(e){return e.isThemeGetter}function eb(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,a])=>[t+i,a])):o);return[n,s]}):e}function tb(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 Hx="!";function nb(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const a=[];let u=0,c=0,h;for(let w=0;w<i.length;w++){let N=i[w];if(u===0){if(N===r&&(n||i.slice(w,w+s)===t)){a.push(i.slice(c,w)),c=w+s;continue}if(N==="/"){h=w;continue}}N==="["?u++:N==="]"&&u--}const d=a.length===0?i:i.substring(c),f=d.startsWith(Hx),x=f?d.substring(1):d,y=h&&h>c?h-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:y}}}function rb(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 sb(e){return{cache:tb(e.cacheSize),splitModifiers:nb(e),...QS(e)}}const ob=/\s+/;function ib(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(ob).map(i=>{const{modifiers:a,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=rb(a).join(":");return{isTailwindClass:!0,modifierId:u?x+Hx:x,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:u,hasPostfixModifier:c}=i,h=a+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function ab(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vx(t))&&(r&&(r+=" "),r+=n);return r}function Vx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vx(e[r]))&&(n&&(n+=" "),n+=t);return n}function lb(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=sb(c),r=n.cache.get,s=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const h=ib(u,n);return s(u,h),h}return function(){return o(ab.apply(null,arguments))}}function me(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Bx=/^\[(?:([a-z-]+):)?(.+)\]$/i,ub=/^\d+\/\d+$/,cb=new Set(["px","full","screen"]),db=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fb=/\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$/,hb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function nn(e){return or(e)||cb.has(e)||ub.test(e)}function Sn(e){return Es(e,"length",bb)}function or(e){return!!e&&!Number.isNaN(Number(e))}function bi(e){return Es(e,"number",or)}function Ws(e){return!!e&&Number.isInteger(Number(e))}function gb(e){return e.endsWith("%")&&or(e.slice(0,-1))}function ne(e){return Bx.test(e)}function bn(e){return db.test(e)}const xb=new Set(["length","size","percentage"]);function yb(e){return Es(e,xb,Ux)}function vb(e){return Es(e,"position",Ux)}const wb=new Set(["image","url"]);function Nb(e){return Es(e,wb,jb)}function Sb(e){return Es(e,"",kb)}function Ks(){return!0}function Es(e,t,n){const r=Bx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function bb(e){return fb.test(e)&&!hb.test(e)}function Ux(){return!1}function kb(e){return mb.test(e)}function jb(e){return pb.test(e)}function Cb(){const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),a=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"),N=me("margin"),m=me("opacity"),v=me("padding"),g=me("saturate"),S=me("scale"),b=me("sepia"),j=me("skew"),k=me("space"),_=me("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ne,t],T=()=>[ne,t],A=()=>["",nn,Sn],C=()=>["auto",or,ne],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[or,bi],O=()=>[or,ne];return{cacheSize:500,separator:":",theme:{colors:[Ks],spacing:[nn,Sn],blur:["none","",bn,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",bn,ne],borderSpacing:T(),borderWidth:A(),contrast:F(),grayscale:P(),hueRotate:O(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[gb,Sn],inset:R(),margin:R(),opacity:F(),padding:T(),saturate:F(),scale:F(),sepia:P(),skew:O(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[bn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...L(),ne]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],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",Ws,ne]}],basis:[{basis:R()}],"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",Ws,ne]}],"grid-cols":[{"grid-cols":[Ks]}],"col-start-end":[{col:["auto",{span:["full",Ws,ne]},ne]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Ks]}],"row-start-end":[{row:["auto",{span:[Ws,ne]},ne]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"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",...E()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...E(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...E(),"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:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"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",bi]}],"font-family":[{font:[Ks]}],"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,bi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nn,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",nn,Sn]}],"underline-offset":[{"underline-offset":["auto",nn,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:T()}],"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:[...L(),vb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Nb]}],"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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"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":[nn,ne]}],"outline-w":[{outline:[nn,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[nn,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bn,Sb]}],"shadow-color":[{shadow:[Ks]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],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:O()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ws,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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:[nn,Sn,bi]}],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 Eb=lb(Cb);function Pe(...e){return Eb(XS(e))}/**
52
52
  * @license lucide-react v0.400.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const Mb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wx=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
56
+ */const _b=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wx=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
57
57
  * @license lucide-react v0.400.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */var Ib={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"};/**
61
+ */var Pb={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
62
  * @license lucide-react v0.400.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const Rb=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},u)=>p.createElement("svg",{ref:u,...Ib,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wx("lucide",s),...a},[...i.map(([c,h])=>p.createElement(c,h)),...Array.isArray(o)?o:[o]]));/**
66
+ */const Mb=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},u)=>p.createElement("svg",{ref:u,...Pb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wx("lucide",s),...a},[...i.map(([c,h])=>p.createElement(c,h)),...Array.isArray(o)?o:[o]]));/**
67
67
  * @license lucide-react v0.400.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const J=(e,t)=>{const n=p.forwardRef(({className:r,...s},o)=>p.createElement(Rb,{ref:o,iconNode:t,className:Wx(`lucide-${Mb(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
71
+ */const J=(e,t)=>{const n=p.forwardRef(({className:r,...s},o)=>p.createElement(Mb,{ref:o,iconNode:t,className:Wx(`lucide-${_b(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
72
72
  * @license lucide-react v0.400.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const Tb=J("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"}]]);/**
76
+ */const Ib=J("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
77
  * @license lucide-react v0.400.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const Lb=J("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
81
+ */const Rb=J("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
82
82
  * @license lucide-react v0.400.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const Ab=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
86
+ */const Tb=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
87
87
  * @license lucide-react v0.400.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const zb=J("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"}]]);/**
91
+ */const Lb=J("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
92
  * @license lucide-react v0.400.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
@@ -108,7 +108,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const Db=J("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
111
+ */const Ab=J("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
112
112
  * @license lucide-react v0.400.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
@@ -133,22 +133,22 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const $b=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
136
+ */const zb=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
137
137
  * @license lucide-react v0.400.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */const Ob=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
141
+ */const Db=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
142
142
  * @license lucide-react v0.400.0 - ISC
143
143
  *
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
- */const Fb=J("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
146
+ */const $b=J("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
147
147
  * @license lucide-react v0.400.0 - ISC
148
148
  *
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
- */const Hb=J("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"}]]);/**
151
+ */const Ob=J("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"}]]);/**
152
152
  * @license lucide-react v0.400.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
@@ -158,17 +158,17 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const Vb=J("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"}]]);/**
161
+ */const Fb=J("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"}]]);/**
162
162
  * @license lucide-react v0.400.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
- */const Bb=J("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
166
+ */const Hb=J("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
167
167
  * @license lucide-react v0.400.0 - ISC
168
168
  *
169
169
  * This source code is licensed under the ISC license.
170
170
  * See the LICENSE file in the root directory of this source tree.
171
- */const Ub=J("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
171
+ */const Vb=J("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
172
172
  * @license lucide-react v0.400.0 - ISC
173
173
  *
174
174
  * This source code is licensed under the ISC license.
@@ -188,52 +188,52 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */const Wb=J("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"}]]);/**
191
+ */const Bb=J("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"}]]);/**
192
192
  * @license lucide-react v0.400.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const Kb=J("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"}]]);/**
196
+ */const Ub=J("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"}]]);/**
197
197
  * @license lucide-react v0.400.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const dt=J("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
201
+ */const at=J("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
202
202
  * @license lucide-react v0.400.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const Yb=J("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
206
+ */const Wb=J("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
207
207
  * @license lucide-react v0.400.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const Gb=J("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"}]]);/**
211
+ */const Kb=J("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"}]]);/**
212
212
  * @license lucide-react v0.400.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const Qx=J("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"}]]);/**
216
+ */const Xo=J("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"}]]);/**
217
217
  * @license lucide-react v0.400.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const Xb=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
221
+ */const Yb=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
222
222
  * @license lucide-react v0.400.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const Qb=J("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"}]]);/**
226
+ */const Gb=J("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"}]]);/**
227
227
  * @license lucide-react v0.400.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
- */const ur=J("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"}]]);/**
231
+ */const cs=J("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"}]]);/**
232
232
  * @license lucide-react v0.400.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const qb=J("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"}]]);/**
236
+ */const Xb=J("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"}]]);/**
237
237
  * @license lucide-react v0.400.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
@@ -243,7 +243,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const Zi=J("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"}]]);/**
246
+ */const Qb=J("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"}]]);/**
247
247
  * @license lucide-react v0.400.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
@@ -258,17 +258,17 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const qx=J("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"}]]);/**
261
+ */const Qx=J("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"}]]);/**
262
262
  * @license lucide-react v0.400.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const Zb=J("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"}]]);/**
266
+ */const qb=J("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"}]]);/**
267
267
  * @license lucide-react v0.400.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
- */const Zx=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
271
+ */const qx=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
272
272
  * @license lucide-react v0.400.0 - ISC
273
273
  *
274
274
  * This source code is licensed under the ISC license.
@@ -278,12 +278,12 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const qt=J("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"}]]);/**
281
+ */const Qt=J("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"}]]);/**
282
282
  * @license lucide-react v0.400.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
285
285
  * See the LICENSE file in the root directory of this source tree.
286
- */const Jb=J("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"}]]);/**
286
+ */const Zb=J("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"}]]);/**
287
287
  * @license lucide-react v0.400.0 - ISC
288
288
  *
289
289
  * This source code is licensed under the ISC license.
@@ -293,7 +293,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
293
293
  *
294
294
  * This source code is licensed under the ISC license.
295
295
  * See the LICENSE file in the root directory of this source tree.
296
- */const ek=J("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"}]]);/**
296
+ */const Jb=J("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"}]]);/**
297
297
  * @license lucide-react v0.400.0 - ISC
298
298
  *
299
299
  * This source code is licensed under the ISC license.
@@ -303,7 +303,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const $t=J("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"}]]);/**
306
+ */const qt=J("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"}]]);/**
307
307
  * @license lucide-react v0.400.0 - ISC
308
308
  *
309
309
  * This source code is licensed under the ISC license.
@@ -313,12 +313,12 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
313
313
  *
314
314
  * This source code is licensed under the ISC license.
315
315
  * See the LICENSE file in the root directory of this source tree.
316
- */const Jx=J("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"}]]);/**
316
+ */const Zx=J("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"}]]);/**
317
317
  * @license lucide-react v0.400.0 - ISC
318
318
  *
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
- */const tk=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nk=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:fl},{to:"/inventory/identities",label:"Identities",icon:Gx},{to:"/inventory/permissions",label:"Permissions",icon:Wb},{to:"/inventory/hosts",label:"Hosts",icon:Qx}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:Qd},{to:"/secure/graph",label:"Graph",icon:Qb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Jx},{to:"/ops/plugins",label:"Plugins",icon:Zi}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:Zb},{to:"/system/settings",label:"Settings",icon:qt}]}];function rk(){const e=yn(),[t,n]=p.useState("");return p.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),l.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[l.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),l.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),l.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:nk.map(r=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),l.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>l.jsxs(Ax,{to:s.to,className:Pe("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:[l.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),l.jsx("div",{className:"border-t border-border px-4 py-3",children:l.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function sk(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ey(...e){return t=>e.forEach(n=>sk(n,t))}function Zt(...e){return p.useCallback(ey(...e),e)}var fs=p.forwardRef((e,t)=>{const{children:n,...r}=e,s=p.Children.toArray(n),o=s.find(ik);if(o){const i=o.props.children,a=s.map(u=>u===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return l.jsx(jc,{...r,ref:t,children:p.isValidElement(i)?p.cloneElement(i,void 0,a):null})}return l.jsx(jc,{...r,ref:t,children:n})});fs.displayName="Slot";var jc=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const s=lk(n);return p.cloneElement(n,{...ak(r,n.props),ref:t?ey(t,s):s})}return p.Children.count(n)>1?p.Children.only(null):null});jc.displayName="SlotClone";var ok=({children:e})=>l.jsx(l.Fragment,{children:e});function ik(e){return p.isValidElement(e)&&e.type===ok}function ak(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]=(...a)=>{o(...a),s(...a)}: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 ty(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=ty(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function uk(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ty(e))&&(r&&(r+=" "),r+=t);return r}const Qh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qh=uk,ck=(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=Qh(h)||Qh(d);return s[c][f]}),a=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,N]=y;return Array.isArray(N)?N.includes({...o,...a}[w]):{...o,...a}[w]===N})?[...c,d,f]:c},[]);return qh(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},dk=ck("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"}}),Q=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?fs:"button";return l.jsx(i,{className:Pe(dk({variant:t,size:n,className:e})),ref:o,...s})});Q.displayName="Button";function fk(){const{user:e,logout:t}=Kd(),{theme:n,setTheme:r}=XS();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&l.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),l.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?l.jsx(ek,{className:"h-4 w-4"}):l.jsx(Xb,{className:"h-4 w-4"})}),l.jsx(Q,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:l.jsx(Gb,{className:"h-4 w-4"})})]})]})}function hk(){return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsx(rk,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(fk,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(hS,{})})]})]})}const $e=p.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Pe("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}));$e.displayName="Input";function mk(){const[e,t]=p.useState(""),[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),[u,c]=p.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Kd(),x=Hd();if(p.useEffect(()=>{d&&x("/inventory/agents",{replace:!0})},[d,x]),p.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>c(w.defaultPassword===!0)).catch(()=>{})},[]),f)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const y=async w=>{w.preventDefault(),o(""),a(!0);try{await h(e,n),x("/inventory/agents",{replace:!0})}catch(N){o(N instanceof Error?N.message:"Login failed")}finally{a(!1)}};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),u&&l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-50 px-3 py-2.5 text-sm text-amber-800 dark:bg-amber-950 dark:text-amber-200",children:[l.jsx(Qd,{className:"mt-0.5 h-4 w-4 shrink-0"}),l.jsxs("span",{children:["Default credentials: ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"})," / ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"}),". Please change after login."]})]}),l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Username"}),l.jsx($e,{type:"text",placeholder:"admin",value:e,onChange:w=>t(w.target.value),autoComplete:"username",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Password"}),l.jsx($e,{type:"password",placeholder:"Password",value:n,onChange:w=>r(w.target.value),autoComplete:"current-password",required:!0})]}),s&&l.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),l.jsx(Q,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})]}),l.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Change the password in Settings after first login."})]})})}const pk="/api";async function ce(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${pk}${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 oe={agents:{list:()=>ce("/agents"),get:e=>ce(`/agents/${e}`),create:e=>ce("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>ce(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>ce(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>ce("/discovery/agents"),profile:e=>ce(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>ce(`/observations?limit=${e}`),permissions:()=>ce("/observations/permissions"),anomalies:()=>ce("/observations/anomalies"),summary:()=>ce("/observations/summary"),agentPermissions:e=>ce(`/observations/agents/${e}/permissions`)},commands:{list:e=>ce(`/commands?agentId=${e}`),create:e=>ce("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>ce("/system/services"),logs:(e,t=200)=>ce(`/system/logs/${e}?lines=${t}`),clearLog:e=>ce(`/system/logs/${e}`,{method:"DELETE"})},hosts:{list:()=>ce("/hosts"),get:e=>ce(`/hosts/${e}`),remove:e=>ce(`/hosts/${e}`,{method:"DELETE"}),sendCommand:e=>ce("/hosts/commands",{method:"POST",body:JSON.stringify(e)}),commands:(e,t=50)=>ce(`/hosts/commands?hostId=${e}&limit=${t}`)},detect:e=>ce("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>ce(`/usage/summary?days=${e}`),daily:(e=30)=>ce(`/usage/daily?days=${e}`)},settings:{get:()=>ce("/settings"),update:e=>ce("/settings",{method:"PUT",body:JSON.stringify(e)}),getApiKey:(e=!1)=>ce(`/settings/api-key${e?"?reveal=true":""}`),generateKey:()=>ce("/settings/generate-key",{method:"POST"})}};function ke({className:e,variant:t="default",...n}){return l.jsx("div",{className:Pe("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 gk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),i=async()=>{o(!0);try{const c=await oe.discovery.agents();t(c.data??[])}catch{}o(!1)};p.useEffect(()=>{i()},[]);const a=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 l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),l.jsxs(Q,{variant:"outline",size:"sm",onClick:i,children:[l.jsx(Yn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(Zx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx($e,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(fl,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):l.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(c=>{var h;return l.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:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("span",{className:"text-xl",children:c.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),l.jsx(ke,{variant:u(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&l.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(d=>l.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&&l.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 Se=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));Se.displayName="Card";const Le=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";const Ae=p.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Pe("font-semibold leading-none tracking-tight",e),...t}));Ae.displayName="CardTitle";const qd=p.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));qd.displayName="CardDescription";const _e=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));_e.displayName="CardContent";const xk=["Profile","Tasks","Identities","Permissions"];function yk(){const{id:e}=J2(),[t,n]=p.useState(null),[r,s]=p.useState([]),[o,i]=p.useState("Profile"),[a,u]=p.useState(!0);return p.useEffect(()=>{e&&(u(!0),(async()=>{const c=await oe.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 oe.observations.agentPermissions(d).catch(()=>({data:[]}));s((f==null?void 0:f.data)??[]),u(!1)})())},[e]),a?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(cs,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:l.jsx(Ab,{className:"h-4 w-4"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:""]})]})]})]}),l.jsx("div",{className:"flex gap-1 border-b border-border",children:xk.map(c=>l.jsx("button",{onClick:()=>i(c),className:Pe("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"&&l.jsx(vk,{profile:t}),o==="Tasks"&&l.jsx(wk,{profile:t}),o==="Identities"&&l.jsx(Nk,{profile:t}),o==="Permissions"&&l.jsx(Sk,{permissions:r})]}):l.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 l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Info"})}),l.jsxs(_e,{className:"space-y-2 text-sm",children:[l.jsx(Ys,{label:"Owner",value:e.ownerName||"—"}),l.jsx(Ys,{label:"Creature",value:e.creature||"—"}),l.jsx(Ys,{label:"Vibe",value:e.vibe||"—"}),l.jsx(Ys,{label:"Sessions",value:String(e.sessionCount??0)}),l.jsx(Ys,{label:"Last Active",value:e.lastActive??"never"})]})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Jx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),l.jsx(cs,{to:"/ops/skills",children:l.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",l.jsx(Vb,{className:"ml-1 h-3 w-3"})]})})]})}),l.jsx(_e,{children:t.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[l.jsx(ur,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),l.jsx(cs,{to:"/ops/skills",children:l.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>l.jsxs(ke,{variant:"secondary",className:"text-xs font-normal",children:[l.jsx(ur,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Plugins"})}),l.jsx(_e,{children:(e.plugins??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):l.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{children:n.name}),l.jsx(ke,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Connected Systems"})}),l.jsx(_e,{children:(e.connectedSystems??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>l.jsx(ke,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function wk({profile:e}){const t=e.cronJobs??[];return l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Ob,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),l.jsx(_e,{children:t.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):l.jsx("div",{className:"space-y-2",children:t.map((n,r)=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),l.jsx("span",{className:"ml-2",children:n.task??n.id})]}),l.jsx(ke,{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 l.jsx("div",{className:"space-y-4",children:n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(_s,{className:"h-4 w-4"})," ",r.label]})}),l.jsx(_e,{children:l.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?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{className:"border-b border-border last:border-0",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),l.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 l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.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(()=>{oe.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"}))}],a=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),h})};return n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),l.jsx("div",{className:"space-y-3",children:i.map(u=>l.jsxs(Se,{children:[l.jsxs("button",{onClick:()=>a(u.category),className:"flex w-full items-center justify-between p-4 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Gx,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:u.category}),l.jsx(ke,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?l.jsx(hl,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(Gd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&l.jsx(_e,{className:"border-t border-border pt-3",children:u.items.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>l.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&l.jsx("span",{className:"text-base",children:c.emoji}),l.jsx("span",{children:c.name})]}),c.status&&l.jsx(ke,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&l.jsx(ke,{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,a]=p.useState(!1),[u,c]=p.useState(!0);p.useEffect(()=>{oe.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,N;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((N=y.category)==null?void 0:N.toLowerCase().includes(x))})}return[...f].sort((x,y)=>{const w=x[s]??0,N=y[s]??0;return typeof w=="string"?i?w.localeCompare(N):N.localeCompare(w):i?w-N:N-w})},[e,n,s,i]),d=f=>{s===f?a(!i):(o(f),a(!1))};return u?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(Zx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx($e,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx(lu,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx(lu,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),l.jsx(lu,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),l.jsx("tbody",{children:h.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function lu({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return l.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:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&l.jsx(zb,{className:"h-3 w-3"})]})})}function jk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0);p.useEffect(()=>{oe.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?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(Qd,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),l.jsx("tbody",{children:e.map(i=>{var u;const a=s(i);return l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:o(a),className:"text-[10px]",children:a})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),l.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 Ie(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=Ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ck={value:()=>{}};function ml(){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=ml.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]=Zh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Zh(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 Zh(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 Cc="http://www.w3.org/1999/xhtml";const Jh={svg:"http://www.w3.org/2000/svg",xhtml:Cc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Jh.hasOwnProperty(t)?{space:Jh[t],local:e}:e}function Pk(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cc&&t.documentElement.namespaceURI===Cc?t.createElement(e):t.createElementNS(n,e)}}function Mk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ny(e){var t=pl(e);return(t.local?Mk:Pk)(t)}function Ik(){}function Zd(e){return e==null?Ik:function(){return this.querySelector(e)}}function Rk(e){typeof e!="function"&&(e=Zd(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,a=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__),a[h]=c);return new ht(r,this._parents)}function Tk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lk(){return[]}function ry(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=ry(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new ht(r,s)}function sy(e){return function(){return this.matches(e)}}function oy(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:oy(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:oy(e)))}function Wk(e){typeof e!="function"&&(e=sy(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new ht(r,this._parents)}function iy(e){return new Array(e.length)}function Kk(){return new ht(this._enter||this._groups.map(iy),this._parents)}function Ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ta.prototype={constructor:Ta,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 Yk(e){return function(){return e}}function Gk(e,t,n,r,s,o){for(var i=0,a,u=t.length,c=o.length;i<c;++i)(a=t[i])?(a.__data__=o[i],r[i]=a):n[i]=new Ta(e,o[i]);for(;i<u;++i)(a=t[i])&&(s[i]=a)}function Xk(e,t,n,r,s,o,i){var a,u,c=new Map,h=t.length,d=o.length,f=new Array(h),x;for(a=0;a<h;++a)(u=t[a])&&(f[a]=x=i.call(u,u.__data__,a,t)+"",c.has(x)?s[a]=u:c.set(x,u));for(a=0;a<d;++a)x=i.call(e,o[a],a,o)+"",(u=c.get(x))?(r[a]=u,u.__data__=o[a],c.delete(x)):n[a]=new Ta(e,o[a]);for(a=0;a<h;++a)(u=t[a])&&c.get(f[a])===u&&(s[a]=u)}function Qk(e){return e.__data__}function qk(e,t){if(!arguments.length)return Array.from(this,Qk);var n=t?Xk:Gk,r=this._parents,s=this._groups;typeof e!="function"&&(e=Yk(e));for(var o=s.length,i=new Array(o),a=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=a[c]=new Array(y),N=i[c]=new Array(y),m=u[c]=new Array(f);n(h,d,w,N,m,x,t);for(var v=0,g=0,S,b;v<y;++v)if(S=w[v]){for(v>=g&&(g=v+1);!(b=N[g])&&++g<y;);S._next=b||null}}return i=new ht(i,r),i._enter=a,i._exit=u,i}function Zk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jk(){return new ht(this._exit||this._groups.map(iy),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),a=new Array(s),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=a[u]=new Array(d),x,y=0;y<d;++y)(x=c[y]||h[y])&&(f[y]=x);for(;u<s;++u)a[u]=n[u];return new ht(a,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],a=i.length,u=s[o]=new Array(a),c,h=0;h<a;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new ht(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 aj(){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 lj(){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,a;o<i;++o)(a=s[o])&&e.call(a,a.__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=pl(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 ay(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??"")):hs(this.node(),e)}function hs(e,t){return e.style.getPropertyValue(t)||ay(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 Jd(e){return e.classList||new uy(e)}function uy(e){this._node=e,this._names=ly(e.getAttribute("class")||"")}uy.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 cy(e,t){for(var n=Jd(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function dy(e,t){for(var n=Jd(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Cj(e){return function(){cy(this,e)}}function Ej(e){return function(){dy(this,e)}}function _j(e,t){return function(){(t.apply(this,arguments)?cy:dy)(this,e)}}function Pj(e,t){var n=ly(e+"");if(arguments.length<2){for(var r=Jd(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:ny(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:ny(e),r=t==null?Bj:typeof t=="function"?t:Zd(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 Kj(){return this.each(Wj)}function Yj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xj(e){return this.select(e?Gj:Yj)}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,a=r.length;i<a;++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 a=this.node().__on;if(a){for(var u=0,c=a.length,h;u<c;++u)for(s=0,h=a[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(a=t?eC:Jj,s=0;s<o;++s)this.each(a(r[s],t,n));return this}function fy(e,t,n){var r=ay(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 fy(this,e,t)}}function rC(e,t){return function(){return fy(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 hy=[null];function ht(e,t){this._groups=e,this._parents=t}function Xo(){return new ht([[document.documentElement]],hy)}function iC(){return this}ht.prototype=Xo.prototype={constructor:ht,select:Rk,selectAll:zk,selectChild:Fk,selectChildren:Uk,filter:Wk,data:qk,enter:Kk,exit:Jk,join:ej,merge:tj,selection:iC,order:nj,sort:rj,call:oj,nodes:ij,node:aj,size:lj,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:Kj,clone:Xj,datum:Qj,on:tC,dispatch:sC,[Symbol.iterator]:oC};function lt(e){return typeof e=="string"?new ht([[document.querySelector(e)]],[document.documentElement]):new ht([[e]],hy)}function aC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=aC(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 lC={passive:!1},To={capture:!0,passive:!1};function uu(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function my(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 py(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 Ec(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:a,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:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Ec.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 gy(){var e=uC,t=cC,n=dC,r=fC,s={},o=ml("start","drag","end"),i=0,a,u,c,h,d=0;function f(S){S.on("mousedown.drag",x).filter(r).on("touchstart.drag",N).on("touchmove.drag",m,lC).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(S,b){if(!(h||!e.call(this,S,b))){var j=g(this,t.call(this,S,b),S,b,"mouse");j&&(lt(S.view).on("mousemove.drag",y,To).on("mouseup.drag",w,To),my(S.view),uu(S),c=!1,a=S.clientX,u=S.clientY,j("start",S))}}function y(S){if(es(S),!c){var b=S.clientX-a,j=S.clientY-u;c=b*b+j*j>d}s.mouse("drag",S)}function w(S){lt(S.view).on("mousemove.drag mouseup.drag",null),py(S.view,c),es(S),s.mouse("end",S)}function N(S,b){if(e.call(this,S,b)){var j=S.changedTouches,k=t.call(this,S,b),_=j.length,I,$;for(I=0;I<_;++I)($=g(this,k,S,b,j[I].identifier,j[I]))&&(uu(S),$("start",S,j[I]))}}function m(S){var b=S.changedTouches,j=b.length,k,_;for(k=0;k<j;++k)(_=s[b[k].identifier])&&(es(S),_("drag",S,b[k]))}function v(S){var b=S.changedTouches,j=b.length,k,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<j;++k)(_=s[b[k].identifier])&&(uu(S),_("end",S,b[k]))}function g(S,b,j,k,_,I){var $=o.copy(),R=_t(I||j,b),T,A,C;if((C=n.call(S,new Ec("beforestart",{sourceEvent:j,target:f,identifier:_,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),k))!=null)return T=C.x-R[0]||0,A=C.y-R[1]||0,function L(M,D,E){var P=R,z;switch(M){case"start":s[_]=L,z=i++;break;case"end":delete s[_],--i;case"drag":R=_t(E||D,b),z=i;break}$.call(M,S,new Ec(M,{sourceEvent:D,subject:C,target:f,identifier:_,active:z,x:R[0]+T,y:R[1]+A,dx:R[0]-P[0],dy:R[1]-P[1],dispatch:$}),k)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:bi(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:bi(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:bi(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:bi(!!S),f):r},f.on=function(){var S=o.on.apply(o,arguments);return S===o?f:S},f.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,f):Math.sqrt(d)},f}function ef(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qo(){}var Lo=.7,La=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}\\)$`),em={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};ef(Qo,yr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tm,formatHex:tm,formatHex8:wC,formatHsl:NC,formatRgb:nm,toString:nm});function tm(){return this.rgb().formatHex()}function wC(){return this.rgb().formatHex8()}function NC(){return yy(this).formatHsl()}function nm(){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?rm(t):n===3?new rt(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 rt(t[1],t[2],t[3],1):(t=pC.exec(e))?new rt(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))?im(t[1],t[2]/100,t[3]/100,1):(t=vC.exec(e))?im(t[1],t[2]/100,t[3]/100,t[4]):em.hasOwnProperty(e)?rm(em[e]):e==="transparent"?new rt(NaN,NaN,NaN,0):null}function rm(e){return new rt(e>>16&255,e>>8&255,e&255,1)}function ki(e,t,n,r){return r<=0&&(e=t=n=NaN),new rt(e,t,n,r)}function SC(e){return e instanceof Qo||(e=yr(e)),e?(e=e.rgb(),new rt(e.r,e.g,e.b,e.opacity)):new rt}function _c(e,t,n,r){return arguments.length===1?SC(e):new rt(e,t,n,r??1)}function rt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ef(rt,_c,xy(Qo,{brighter(e){return e=e==null?La:Math.pow(La,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rt(cr(this.r),cr(this.g),cr(this.b),Aa(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:sm,formatHex:sm,formatHex8:bC,formatRgb:om,toString:om}));function sm(){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 om(){const e=Aa(this.opacity);return`${e===1?"rgb(":"rgba("}${cr(this.r)}, ${cr(this.g)}, ${cr(this.b)}${e===1?")":`, ${e})`}`}function Aa(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 im(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 yy(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,a=o-s,u=(o+s)/2;return a?(t===o?i=(n-r)/a+(n<r)*6:n===o?i=(r-t)/a+2:i=(t-n)/a+4,a/=u<.5?o+s:2-o-s,i*=60):a=u>0&&u<1?0:i,new Mt(i,a,u,e.opacity)}function kC(e,t,n,r){return arguments.length===1?yy(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}ef(Mt,kC,xy(Qo,{brighter(e){return e=e==null?La:Math.pow(La,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 rt(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(am(this.h),ji(this.s),ji(this.l),Aa(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=Aa(this.opacity);return`${e===1?"hsl(":"hsla("}${am(this.h)}, ${ji(this.s)*100}%, ${ji(this.l)*100}%${e===1?")":`, ${e})`}`}}));function am(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 tf=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?vy:function(t,n){return n-t?CC(t,n,e):tf(isNaN(t)?n:t)}}function vy(e,t){var n=t-e;return n?jC(e,n):tf(isNaN(e)?t:e)}const za=function e(t){var n=EC(t);function r(s,o){var i=n((s=_c(s)).r,(o=_c(o)).r),a=n(s.g,o.g),u=n(s.b,o.b),c=vy(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=a(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]=fo(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(a){for(i=0;i<r;++i)o[i]=s[i](a);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]=fo(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Pc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,du=new RegExp(Pc.source,"g");function TC(e){return function(){return e}}function LC(e){return function(t){return e(t)+""}}function wy(e,t){var n=Pc.lastIndex=du.lastIndex=0,r,s,o,i=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Pc.exec(e))&&(s=du.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),a[i]?a[i]+=o:a[++i]=o),(r=r[0])===(s=s[0])?a[i]?a[i]+=s:a[++i]=s:(a[++i]=null,u.push({i,x:Wt(r,s)})),n=du.lastIndex;return n<t.length&&(o=t.slice(n),a[i]?a[i]+=o:a[++i]=o),a.length<2?u[0]?LC(u[0].x):TC(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)a[(d=u[h]).i]=d.x(c);return a.join("")})}function fo(e,t){var n=typeof t,r;return t==null||n==="boolean"?tf(t):(n==="number"?Wt:n==="string"?(r=yr(t))?(t=r,za):wy:t instanceof yr?za: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,Mc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ny(e,t,n,r,s,o){var i,a,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),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:a}}var Ci;function AC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Mc:Ny(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()))?Mc:(e=e.matrix,Ny(e.a,e.b,e.c,e.d,e.e,e.f))}function Sy(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 a(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),a(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,N;++y<w;)d[(N=f[y]).i]=N.x(x);return d.join("")}}}var DC=Sy(AC,"px, ","px)","deg)"),$C=Sy(zC,", ",")",")"),OC=1e-12;function um(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 ea=function e(t,n,r){function s(o,i){var a=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],x=h-a,y=d-u,w=x*x+y*y,N,m;if(w<OC)m=Math.log(f/c)/t,N=function(k){return[a+k*x,u+k*y,c*Math.exp(t*k*m)]};else{var v=Math.sqrt(w),g=(f*f-c*c+r*w)/(2*c*n*v),S=(f*f-c*c-r*w)/(2*f*n*v),b=Math.log(Math.sqrt(g*g+1)-g),j=Math.log(Math.sqrt(S*S+1)-S);m=(j-b)/t,N=function(k){var _=k*m,I=um(b),$=c/(n*v)*(I*HC(t*_+b)-FC(b));return[a+$*x,u+$*y,c*I/um(t*_+b)]}}return N.duration=m*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),a=i*i,u=a*a;return e(i,a,u)},s}(Math.SQRT2,2,4);var ms=0,eo=0,Gs=0,by=1e3,Da,to,$a=0,vr=0,gl=0,zo=typeof performance=="object"&&performance.now?performance:Date,ky=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nf(){return vr||(ky(VC),vr=zo.now()+gl)}function VC(){vr=0}function Oa(){this._call=this._time=this._next=null}Oa.prototype=jy.prototype={constructor:Oa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nf():+n)+(t==null?0:+t),!this._next&&to!==this&&(to?to._next=this:Da=this,to=this),this._call=e,this._time=n,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function jy(e,t,n){var r=new Oa;return r.restart(e,t,n),r}function BC(){nf(),++ms;for(var e=Da,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ms}function cm(){vr=($a=zo.now())+gl,ms=eo=0;try{BC()}finally{ms=0,WC(),vr=0}}function UC(){var e=zo.now(),t=e-$a;t>by&&(gl-=t,$a=e)}function WC(){for(var e,t=Da,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:Da=n);to=e,Ic(r)}function Ic(e){if(!ms){eo&&(eo=clearTimeout(eo));var t=e-vr;t>24?(e<1/0&&(eo=setTimeout(cm,e-zo.now()-gl)),Gs&&(Gs=clearInterval(Gs))):(Gs||($a=zo.now(),Gs=setInterval(UC,by)),ms=1,ky(cm))}}function dm(e,t,n){var r=new Oa;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var KC=ml("start","end","cancel","interrupt"),YC=[],Cy=0,fm=1,Rc=2,ta=3,hm=4,Tc=5,na=6;function xl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;GC(e,n,{name:t,index:r,group:s,on:KC,tween:YC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cy})}function rf(e,t){var n=Ft(e,t);if(n.state>Cy)throw new Error("too late; already scheduled");return n}function en(e,t){var n=Ft(e,t);if(n.state>ta)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 GC(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=jy(o,0,n.time);function o(c){n.state=fm,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!==fm)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===ta)return dm(i);x.state===hm?(x.state=na,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=na,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(dm(function(){n.state===ta&&(n.state=hm,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Rc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rc){for(n.state=ta,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 a(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Tc,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Tc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=na,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ra(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>Rc&&r.state<Tc,r.state=na,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(){ra(this,e)})}function QC(e,t){var n,r;return function(){var s=en(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,a=r.length;i<a;++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=en(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var a={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=a;break}u===c&&s.push(a)}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 sf(e,t,n){var r=e._id;return e.each(function(){var s=en(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ft(s,r).value[t]}}function Ey(e,t){var n;return(typeof t=="number"?Wt:t instanceof yr?za:(n=yr(t))?(t=n,za):wy)(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,a=n(this),u;return a==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function sE(e,t,n){var r,s,o;return function(){var i,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function oE(e,t){var n=pl(e),r=n==="transform"?$C:Ey;return this.attrTween(e,typeof t=="function"?(n.local?sE:rE)(n,r,sf(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 aE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&aE(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=pl(e);return this.tween(n,(r.local?lE:uE)(r,t))}function dE(e,t){return function(){rf(this,e).delay=+t.apply(this,arguments)}}function fE(e,t){return t=+t,function(){rf(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(){en(this,e).duration=+t.apply(this,arguments)}}function pE(e,t){return t=+t,function(){en(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(){en(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;en(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=sy(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new gn(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),a=0;a<o;++a)for(var u=t[a],c=n[a],h=u.length,d=i[a]=new Array(h),f,x=0;x<h;++x)(f=u[x]||c[x])&&(d[x]=f);for(;a<r;++a)i[a]=t[a];return new gn(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)?rf:en;return function(){var i=o(this,e),a=i.on;a!==r&&(s=(r=a).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=Zd(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var a=r[i],u=a.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=a[f])&&(d=e.call(h,h.__data__,f,a))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,xl(c[f],t,n,f,c,Ft(h,n)));return new gn(o,this._parents,t,n)}function PE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ry(e));for(var r=this._groups,s=r.length,o=[],i=[],a=0;a<s;++a)for(var u=r[a],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,N=f.length;w<N;++w)(x=f[w])&&xl(x,t,n,w,f,y);o.push(f),i.push(h)}return new gn(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=hs(this,e),i=(this.style.removeProperty(e),hs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function _y(e){return function(){this.style.removeProperty(e)}}function TE(e,t,n){var r,s=n+"",o;return function(){var i=hs(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=hs(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),hs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a))}}function AE(e,t){var n,r,s,o="style."+t,i="end."+o,a;return function(){var u=en(this,e),c=u.on,h=u.value[o]==null?a||(a=_y(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:Ey;return t==null?this.styleTween(e,RE(e,r)).on("end.style."+e,_y(e)):typeof t=="function"?this.styleTween(e,LE(e,r,sf(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(sf(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 KE(){for(var e=this._name,t=this._id,n=Py(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],a=i.length,u,c=0;c<a;++c)if(u=i[c]){var h=Ft(u,t);xl(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gn(r,this._parents,e,n)}function YE(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var a={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=en(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),s===0&&o()})}var GE=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Py(){return++GE}var rn=Xo.prototype;gn.prototype={constructor:gn,select:_E,selectAll:PE,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:NE,merge:SE,selection:IE,transition:KE,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.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:YE,[Symbol.iterator]:rn[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 gn?(t=e._id,e=e._name):(t=Py(),(n=QE).time=nf(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&xl(u,e,t,c,i,n||qE(u,t));return new gn(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 un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(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 yl=new un(1,0,0);My.prototype=un.prototype;function My(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yl;return e.__zoom}function fu(e){e.stopImmediatePropagation()}function Xs(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 mm(){return this.__zoom||yl}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 Iy(){var e=e_,t=t_,n=s_,r=n_,s=r_,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],a=250,u=ea,c=ml("start","zoom","end"),h,d,f,x=500,y=150,w=0,N=10;function m(C){C.property("__zoom",mm).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(C,L,M,D){var E=C.selection?C.selection():C;E.property("__zoom",mm),C!==E?b(C,L,M,D):E.interrupt().each(function(){j(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},m.scaleBy=function(C,L,M,D){m.scaleTo(C,function(){var E=this.__zoom.k,P=typeof L=="function"?L.apply(this,arguments):L;return E*P},M,D)},m.scaleTo=function(C,L,M,D){m.transform(C,function(){var E=t.apply(this,arguments),P=this.__zoom,z=M==null?S(E):typeof M=="function"?M.apply(this,arguments):M,F=P.invert(z),O=typeof L=="function"?L.apply(this,arguments):L;return n(g(v(P,O),z,F),E,i)},M,D)},m.translateBy=function(C,L,M,D){m.transform(C,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,D)},m.translateTo=function(C,L,M,D,E){m.transform(C,function(){var P=t.apply(this,arguments),z=this.__zoom,F=D==null?S(P):typeof D=="function"?D.apply(this,arguments):D;return n(yl.translate(F[0],F[1]).scale(z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},D,E)};function v(C,L){return L=Math.max(o[0],Math.min(o[1],L)),L===C.k?C:new un(L,C.x,C.y)}function g(C,L,M){var D=L[0]-M[0]*C.k,E=L[1]-M[1]*C.k;return D===C.x&&E===C.y?C:new un(C.k,D,E)}function S(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,L,M,D){C.on("start.zoom",function(){j(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event(D).end()}).tween("zoom",function(){var E=this,P=arguments,z=j(E,P).event(D),F=t.apply(E,P),O=M==null?S(F):typeof M=="function"?M.apply(E,P):M,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),B=E.__zoom,K=typeof L=="function"?L.apply(E,P):L,Y=u(B.invert(O).concat(U/B.k),K.invert(O).concat(U/K.k));return function(G){if(G===1)G=K;else{var V=Y(G),q=U/V[2];G=new un(q,O[0]-V[0]*q,O[1]-V[1]*q)}z.zoom(null,G)}})}function j(C,L,M){return!M&&C.__zooming||new k(C,L)}function k(C,L){this.that=C,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,L),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,L){return this.mouse&&C!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var L=lt(this.that).datum();c.call(C,this.that,new JE(C,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),L)}};function _(C,...L){if(!e.apply(this,arguments))return;var M=j(this,L).event(C),D=this.__zoom,E=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),P=_t(C);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=D.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(D.k===E)return;M.mouse=[P,D.invert(P)],ra(this),M.start()}Xs(C),M.wheel=setTimeout(z,y),M.zoom("mouse",n(g(v(D,E),M.mouse[0],M.mouse[1]),M.extent,i));function z(){M.wheel=null,M.end()}}function I(C,...L){if(f||!e.apply(this,arguments))return;var M=C.currentTarget,D=j(this,L,!0).event(C),E=lt(C.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),P=_t(C,M),z=C.clientX,F=C.clientY;my(C.view),fu(C),D.mouse=[P,this.__zoom.invert(P)],ra(this),D.start();function O(B){if(Xs(B),!D.moved){var K=B.clientX-z,Y=B.clientY-F;D.moved=K*K+Y*Y>w}D.event(B).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=_t(B,M),D.mouse[1]),D.extent,i))}function U(B){E.on("mousemove.zoom mouseup.zoom",null),py(B.view,D.moved),Xs(B),D.event(B).end()}}function $(C,...L){if(e.apply(this,arguments)){var M=this.__zoom,D=_t(C.changedTouches?C.changedTouches[0]:C,this),E=M.invert(D),P=M.k*(C.shiftKey?.5:2),z=n(g(v(M,P),D,E),t.apply(this,L),i);Xs(C),a>0?lt(this).transition().duration(a).call(b,z,D,C):lt(this).call(m.transform,z,D,C)}}function R(C,...L){if(e.apply(this,arguments)){var M=C.touches,D=M.length,E=j(this,L,C.changedTouches.length===D).event(C),P,z,F,O;for(fu(C),z=0;z<D;++z)F=M[z],O=_t(F,this),O=[O,this.__zoom.invert(O),F.identifier],E.touch0?!E.touch1&&E.touch0[2]!==O[2]&&(E.touch1=O,E.taps=0):(E.touch0=O,P=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(E.taps<2&&(d=O[0],h=setTimeout(function(){h=null},x)),ra(this),E.start())}}function T(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z,F,O;for(Xs(C),P=0;P<E;++P)z=D[P],F=_t(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=F:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=F);if(z=M.that.__zoom,M.touch1){var U=M.touch0[0],B=M.touch0[1],K=M.touch1[0],Y=M.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,V=(V=Y[0]-B[0])*V+(V=Y[1]-B[1])*V;z=v(z,Math.sqrt(G/V)),F=[(U[0]+K[0])/2,(U[1]+K[1])/2],O=[(B[0]+Y[0])/2,(B[1]+Y[1])/2]}else if(M.touch0)F=M.touch0[0],O=M.touch0[1];else return;M.zoom("touch",n(g(z,F,O),M.extent,i))}}function A(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z;for(fu(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),P=0;P<E;++P)z=D[P],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.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&&(z=_t(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<N)){var F=lt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:Ei(+C),m):r},m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Ei(!!C),m):e},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Ei(!!C),m):s},m.extent=function(C){return arguments.length?(t=typeof C=="function"?C:Ei([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),m):t},m.scaleExtent=function(C){return arguments.length?(o[0]=+C[0],o[1]=+C[1],m):[o[0],o[1]]},m.translateExtent=function(C){return arguments.length?(i[0][0]=+C[0][0],i[1][0]=+C[1][0],i[0][1]=+C[0][1],i[1][1]=+C[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(C){return arguments.length?(n=C,m):n},m.duration=function(C){return arguments.length?(a=+C,m):a},m.interpolate=function(C){return arguments.length?(u=C,m):u},m.on=function(){var C=c.on.apply(c,arguments);return C===c?m:C},m.clickDistance=function(C){return arguments.length?(w=(C=+C)*C,m):Math.sqrt(w)},m.tapDistance=function(C){return arguments.length?(N=+C,m):N},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]],Ry=["Enter"," ","Escape"],Ty={"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 ps;(function(e){e.Strict="strict",e.Loose="loose"})(ps||(ps={}));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 Ly={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 Fa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fa||(Fa={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const pm={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ay(e){return e===null?null:e?"valid":"invalid"}const zy=e=>"id"in e&&"source"in e&&"target"in e,o_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),of=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):of(s)?s:t.nodeLookup.get(s.id));const a=i?Ha(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wl(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=vl(n,Ha(s)),r=!0)}),r?wl(n):{x:0,y:0,width:0,height:0}},af=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const a={...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(a,xs(c)),N=(x??0)*(y??0),m=o&&w>0;(!c.internals.handleBounds||m||w>=N||c.dragging)&&u.push(c)}return u},a_=(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 l_(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 a=l_(e,i),u=Zo(a),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 Dy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),a=i.parentId?n.get(i.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!a)o==null||o("005",Jt.error005());else{const x=a.measured.width,y=a.measured.height;x&&y&&(d=[[u,c],[u+x,c+y]])}else a&&ys(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=ys(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 a=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=a_(i,u);for(const f of u)a.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 gs=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),wr=(e={x:0,y:0},t,n)=>({x:gs(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gs(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function $y(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 gm=(e,t,n)=>e<t?gs(Math.abs(e-t),1,t)/t:e>n?-gs(Math.abs(e-n),1,t)/t:0,Oy=(e,t,n=15,r=40)=>{const s=gm(e.x,r,t.width-r)*n,o=gm(e.y,r,t.height-r)*n;return[s,o]},vl=(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)}),Lc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),wl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xs=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(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}},Ha=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(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)}},Fy=(e,t)=>wl(vl(Lc(e),Lc(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)},xm=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 a={x:(e-n)/s,y:(t-r)/s};return o?Jo(a,i):a},Va=({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:a}=Va(e,[t,n,r]),{x:u,y:c}=Va({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(a),right:Math.floor(h),bottom:Math.floor(d)}}const lf=(e,t,n,r,s,o)=>{const i=f_(o,t,n),a=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(a,u),h=gs(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),N={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-N.left+N.right,y:y-N.top+N.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 ys(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 Hy(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 Vy(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const a=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function ym(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{...Ty,...e||{}}}function ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rt(e),a=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(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const uf=e=>({width:e.offsetWidth,height:e.offsetHeight}),By=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 Uy(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 Wy=e=>"clientX"in e,Rt=(e,t)=>{var o,i;const n=Wy(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)}},vm=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const a=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...uf(i)}})};function Ky({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:a}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+a*.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 wm({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[a,u]=wm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=wm({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,x,y]=Ky({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${a},${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,a=r<t?r+i:r-i;return[o,a,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,a=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+a}function y_({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=vl(Ha(e),Ha(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,wl(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 zy(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 Xy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,a]=Gy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,a]}const Nm={[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},Sm=(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 a=Nm[t],u=Nm[r],c={x:e.x+a.x*o,y:e.y+a.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,N;const m={x:0,y:0},v={x:0,y:0},[,,g,S]=Gy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*u[f]===-1){f==="x"?(w=s.x??c.x+(h.x-c.x)*i,N=s.y??(c.y+h.y)/2):(w=s.x??(c.x+h.x)/2,N=s.y??c.y+(h.y-c.y)*i);const j=[{x:w,y:c.y},{x:w,y:h.y}],k=[{x:c.x,y:N},{x:h.x,y:N}];a[f]===x?y=f==="x"?j:k:y=f==="x"?k:j}else{const j=[{x:c.x,y:h.y}],k=[{x:h.x,y:c.y}];if(f==="x"?y=a.x===x?k:j:y=a.y===x?j:k,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const A=Math.min(o-1,o-T);a[f]===x?m[f]=(c[f]>e[f]?-1:1)*A:v[f]=(h[f]>n[f]?-1:1)*A}}if(t!==r){const T=f==="x"?"y":"x",A=a[f]===u[T],C=c[T]>h[T],L=c[T]<h[T];(a[f]===1&&(!A&&C||A&&L)||a[f]!==1&&(!A&&L||A&&C))&&(y=f==="x"?j:k)}const _={x:c.x+m.x,y:c.y+m.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(_.x-y[0].x),Math.abs(I.x-y[0].x)),R=Math.max(Math.abs(_.y-y[0].y),Math.abs(I.y-y[0].y));$>=R?(w=(_.x+I.x)/2,N=y[0].y):(w=y[0].x,N=(_.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,N,g,S]}function k_(e,t,n,r){const s=Math.min(Sm(e,t)/2,Sm(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 a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*a},${i}`}function Ac({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,borderRadius:i=5,centerX:a,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:a,y:u},offset:c,stepPosition:h});return[d.reduce((m,v,g)=>{let S="";return g>0&&g<d.length-1?S=k_(d[g-1],v,d[g+1],i):S=`${g===0?"M":"L"}${v.x} ${v.y}`,m+=S,m},""),f,x,y,w]}function bm(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(!bm(t)||!bm(n))return null;const r=t.internals.handleBounds||km(t.handles),s=n.internals.handleBounds||km(n.handles),o=jm((r==null?void 0:r.source)??[],e.sourceHandle),i=jm(e.connectionMode===ps.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 a=(o==null?void 0:o.position)||X.Bottom,u=(i==null?void 0:i.position)||X.Top,c=Nr(t,o,a),h=Nr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:a,targetPosition:u}}function km(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:a}=t??vn(e);if(r)return{x:s+i/2,y:o+a/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+a/2};case X.Bottom:return{x:s+i/2,y:o+a};case X.Left:return{x:s,y:o+a/2}}}function jm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function zc(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,a)=>([a.markerStart||r,a.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const c=zc(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,a)=>i.id.localeCompare(a.id))}const Qy=1e3,E_=10,cf={nodeOrigin:[0,0],nodeExtent:Do,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},__={...cf,checkEquality:!0};function df(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=df(cf,n);for(const s of e.values())if(s.parentId)hf(s,e,t,r);else{const o=qo(s,r.nodeOrigin),i=ys(s.extent)?s.extent:r.nodeExtent,a=wr(o,i,vn(s));s.internals.positionAbsolute=a}}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 ff(e){return e==="manual"}function Dc(e,t,n,r={}){var c,h;const s=df(__,r),o={i:0},i=new Map(t),a=s!=null&&s.elevateNodesOnSelect&&!ff(s.zIndexMode)?Qy: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=ys(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,a,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&&hf(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 hf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:a,zIndexMode:u}=df(cf,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&&!ff(u)?Qy:0,{x:f,y:x,z:y}=R_(e,h,i,a,d,u),{positionAbsolute:w}=e.internals,N=f!==w.x||x!==w.y;(N||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:x}:w,z:y}})}function qy(e,t,n){const r=It(e.zIndex)?e.zIndex:0;return ff(n)?r:r+(e.selected?t:0)}function R_(e,t,n,r,s,o){const{x:i,y:a}=t.internals.positionAbsolute,u=vn(e),c=qo(e,n),h=ys(e.extent)?wr(c,e.extent,u):c;let d=wr({x:i+h.x,y:a+h.y},r,u);e.extent==="parent"&&(d=$y(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 mf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const a of e){const u=t.get(a.parentId);if(!u)continue;const c=((i=o.get(a.parentId))==null?void 0:i.expandedRect)??xs(u),h=Fy(c,a.rect);o.set(a.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:a,parent:u},c)=>{var g;const h=u.internals.positionAbsolute,d=vn(u),f=u.origin??r,x=a.x<h.x?Math.round(Math.abs(h.x-a.x)):0,y=a.y<h.y?Math.round(Math.abs(h.y-a.y)):0,w=Math.max(d.width,Math.round(a.width)),N=Math.max(d.height,Math.round(a.height)),m=(w-d.width)*f[0],v=(N-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(S=>{e.some(b=>b.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+x,y:S.position.y+y}})})),(d.width<a.width||d.height<a.height||x||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?f[0]*x-m:0),height:N+(y?f[1]*y-v:0)}})}),s}function T_(e,t,n,r,s,o,i){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!a)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(a),{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=uf(x.nodeElement),N=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=ys(y.extent)?y.extent:o;let{positionAbsolute:S}=y.internals;y.parentId&&y.extent==="parent"?S=$y(S,w,t.get(y.parentId)):g&&(S=wr(S,g,w));const b={...y,measured:w,internals:{...y.internals,positionAbsolute:S,handleBounds:{source:vm("source",x.nodeElement,v,d,y.id),target:vm("target",x.nodeElement,v,d,y.id)}}};t.set(y.id,b),y.parentId&&hf(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,N&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:xs(b,s)}))}}if(f.length>0){const x=mf(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),a=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(a)}function Cm(e,t,n,r,s,o){let i=s;const a=r.get(i)||new Map;r.set(i,a.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 Zy(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:a=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:a},c=`${s}-${i}--${o}-${a}`,h=`${o}-${a}--${s}-${i}`;Cm("source",u,h,e,s,i),Cm("target",u,c,e,o,a),t.set(r.id,r)}}function Jy(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Jy(n,t):!1}function Em(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||!Jy(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const a=e.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function hu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,a,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=(a=n.get(e))==null?void 0:a.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,a=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,w=null;function N({noDragClassName:v,handleSelector:g,domNode:S,isSelectable:b,nodeId:j,nodeClickDistance:k=0}){f=lt(S);function _({x:T,y:A}){const{nodeLookup:C,nodeExtent:L,snapGrid:M,snapToGrid:D,nodeOrigin:E,onNodeDrag:P,onSelectionDrag:z,onError:F,updateNodePositions:O}=t();o={x:T,y:A};let U=!1;const B=a.size>1,K=B&&L?Lc(Zo(a)):null,Y=B&&D?z_({dragItems:a,snapGrid:M,x:T,y:A}):null;for(const[G,V]of a){if(!C.has(G))continue;let q={x:T-V.distance.x,y:A-V.distance.y};D&&(q=Y?{x:Math.round(q.x+Y.x),y:Math.round(q.y+Y.y)}:Jo(q,M));let re=null;if(B&&L&&!V.extent&&K){const{positionAbsolute:Z}=V.internals,ue=Z.x-K.x+L[0][0],he=Z.x+V.measured.width-K.x2+L[1][0],le=Z.y-K.y+L[0][1],Be=Z.y+V.measured.height-K.y2+L[1][1];re=[[ue,le],[he,Be]]}const{position:te,positionAbsolute:ee}=Dy({nodeId:G,nextPosition:q,nodeLookup:C,nodeExtent:re||L,nodeOrigin:E,onError:F});U=U||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=ee}if(y=y||U,!!U&&(O(a,!0),w&&(r||P||!j&&z))){const[G,V]=hu({nodeId:j,dragItems:a,nodeLookup:C});r==null||r(w,a,G,V),P==null||P(w,G,V),j||z==null||z(w,V)}}async function I(){if(!h)return;const{transform:T,panBy:A,autoPanSpeed:C,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(i);return}const[M,D]=Oy(c,h,C);(M!==0||D!==0)&&(o.x=(o.x??0)-M/T[2],o.y=(o.y??0)-D/T[2],await A({x:M,y:D})&&_(o)),i=requestAnimationFrame(I)}function $(T){var B;const{nodeLookup:A,multiSelectionActive:C,nodesDraggable:L,transform:M,snapGrid:D,snapToGrid:E,selectNodesOnDrag:P,onNodeDragStart:z,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!P||!b)&&!C&&j&&((B=A.get(j))!=null&&B.selected||O()),b&&P&&j&&(e==null||e(j));const U=ho(T.sourceEvent,{transform:M,snapGrid:D,snapToGrid:E,containerBounds:h});if(o=U,a=A_(A,L,U,j),a.size>0&&(n||z||!j&&F)){const[K,Y]=hu({nodeId:j,dragItems:a,nodeLookup:A});n==null||n(T.sourceEvent,a,K,Y),z==null||z(T.sourceEvent,K,Y),j||F==null||F(T.sourceEvent,Y)}}const R=gy().clickDistance(k).on("start",T=>{const{domNode:A,nodeDragThreshold:C,transform:L,snapGrid:M,snapToGrid:D}=t();h=(A==null?void 0:A.getBoundingClientRect())||null,x=!1,y=!1,w=T.sourceEvent,C===0&&$(T),o=ho(T.sourceEvent,{transform:L,snapGrid:M,snapToGrid:D,containerBounds:h}),c=Rt(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:A,transform:C,snapGrid:L,snapToGrid:M,nodeDragThreshold:D,nodeLookup:E}=t(),P=ho(T.sourceEvent,{transform:C,snapGrid:L,snapToGrid:M,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||j&&!E.has(j))&&(x=!0),!x){if(!u&&A&&d&&(u=!0,I()),!d){const z=Rt(T.sourceEvent,h),F=z.x-c.x,O=z.y-c.y;Math.sqrt(F*F+O*O)>D&&$(T)}(o.x!==P.xSnapped||o.y!==P.ySnapped)&&a&&d&&(c=Rt(T.sourceEvent,h),_(P))}}).on("end",T=>{if(!(!d||x)&&(u=!1,d=!1,cancelAnimationFrame(i),a.size>0)){const{nodeLookup:A,updateNodePositions:C,onNodeDragStop:L,onSelectionDragStop:M}=t();if(y&&(C(a,!1),y=!1),s||L||!j&&M){const[D,E]=hu({nodeId:j,dragItems:a,nodeLookup:A,dragging:!1});s==null||s(T.sourceEvent,a,D,E),L==null||L(T.sourceEvent,D,E),j||M==null||M(T.sourceEvent,E)}}}).filter(T=>{const A=T.target;return!T.button&&(!v||!Em(A,`.${v}`,S))&&(!g||Em(A,g,S))});f.call(R)}function m(){f==null||f.on(".drag",null)}return{update:N,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,xs(o))>0&&r.push(o);return r}const O_=250;function F_(e,t,n,r){var a,u;let s=[],o=1/0;const i=$_(e,n,t+O_);for(const c of i){const h=[...((a=c.internals.handleBounds)==null?void 0:a.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 e0(e,t,n,r,s,o=!1){var c,h,d;const i=r.get(e);if(!i)return null;const a=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?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return u&&o?{...u,...Nr(i,u,u.position,!0)}:u}function t0(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 n0=()=>!0;function V_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:N,isValidConnection:m=n0,onReconnectEnd:v,updateConnection:g,getTransform:S,getFromHandle:b,autoPanSpeed:j,dragThreshold:k=1,handleDomNode:_}){const I=By(e.target);let $=0,R;const{x:T,y:A}=Rt(e),C=t0(o,_),L=a==null?void 0:a.getBoundingClientRect();let M=!1;if(!L||!C)return;const D=e0(s,C,r,u,t);if(!D)return;let E=Rt(e,L),P=!1,z=null,F=!1,O=null;function U(){if(!h||!L)return;const[te,ee]=Oy(E,L,j);f({x:te,y:ee}),$=requestAnimationFrame(U)}const B={...D,nodeId:s,type:C,position:D.position},K=u.get(s);let G={inProgress:!0,isValid:null,from:Nr(K,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:K,to:E,toHandle:null,toPosition:pm[B.position],toNode:null,pointer:E};function V(){M=!0,g(G),y==null||y(e,{nodeId:s,handleId:r,handleType:C})}k===0&&V();function q(te){if(!M){const{x:Be,y:wn}=Rt(te),tn=Be-T,Zn=wn-A;if(!(tn*tn+Zn*Zn>k*k))return;V()}if(!b()||!B){re(te);return}const ee=S();E=Rt(te,L),R=F_(ei(E,ee,!1,[1,1]),n,u,B),P||(U(),P=!0);const Z=r0(te,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:m,doc:I,lib:c,flowId:d,nodeLookup:u});O=Z.handleDomNode,z=Z.connection,F=H_(!!R,Z.isValid);const ue=u.get(s),he=ue?Nr(ue,B,X.Left,!0):G.from,le={...G,from:he,isValid:F,to:Z.toHandle&&F?Va({x:Z.toHandle.x,y:Z.toHandle.y},ee):E,toHandle:Z.toHandle,toPosition:F&&Z.toHandle?Z.toHandle.position:pm[B.position],toNode:Z.toHandle?u.get(Z.toHandle.nodeId):null,pointer:E};g(le),G=le}function re(te){if(!("touches"in te&&te.touches.length>0)){if(M){(R||O)&&z&&F&&(w==null||w(z));const{inProgress:ee,...Z}=G,ue={...Z,toPosition:G.toHandle?G.toPosition:null};N==null||N(te,ue),o&&(v==null||v(te,ue))}x(),cancelAnimationFrame($),P=!1,F=!1,z=null,O=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 r0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:a,flowId:u,isValidConnection:c=n0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${a}-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),N=w!=null&&w.classList.contains(`${a}-flow__handle`)?w:f,m={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=t0(void 0,N),g=N.getAttribute("data-nodeid"),S=N.getAttribute("data-handleid"),b=N.classList.contains("connectable"),j=N.classList.contains("connectableend");if(!g||!v)return m;const k={source:d?g:r,sourceHandle:d?S:s,target:d?r:g,targetHandle:d?s:S};m.connection=k;const I=b&&j&&(n===ps.Strict?d&&v==="source"||!d&&v==="target":g!==r||S!==s);m.isValid=I&&c(k),m.toHandle=e0(g,v,S,h,n,!0)}return m}const $c={onPointerDown:V_,isValid:r0};function B_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=lt(e);function o({translateExtent:a,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 S=n(),b=g.sourceEvent.ctrlKey&&Fo()?10:1,j=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,k=S[2]*Math.pow(2,j*b);t.scaleTo(k)};let w=[0,0];const N=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 S=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],j=[b[0]-w[0],b[1]-w[1]];w=b;const k=r()*Math.max(S[2],Math.log(S[2]))*(x?-1:1),_={x:S[0]-j[0]*k,y:S[1]-j[1]*k},I=[[0,0],[u,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:S[2]},I,a)},v=Iy().on("start",N).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 Nl=e=>({x:e.x,y:e.y,zoom:e.k}),mu=({x:e,y:t,zoom:n})=>yl.translate(e,t).scale(n),Kr=(e,t)=>e.target.closest(`.${t}`),s0=(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},o0=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:a,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Kr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&i){const N=_t(h),m=o0(h),v=d*Math.pow(2,m);r.scaleTo(n,v,N,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=Nl(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,a==null||a(h,w))}}function K_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,a=Kr(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),i||a)return null;r.preventDefault(),n.call(this,r,s)}}function Y_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,a;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Nl(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function G_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,a;e.usedRightMouseButton=!!(n&&s0(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,Nl(o.transform)))}}function X_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var a;if(!((a=i.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&s0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Nl(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:a,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var N;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Kr(d,`${c}-flow__node`)||Kr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!y||Kr(d,a)&&y||Kr(d,u)&&(!y||s&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.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:a,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=Iy().scaleExtent([t,n]).translateExtent(r),f=lt(e).call(d);v({x:s.x,y:s.y,zoom:gs(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const x=f.on("wheel.zoom"),y=f.on("dblclick.zoom");d.wheelDelta(o0);function w(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).transform(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:A,userSelectionActive:C,panOnScroll:L,panOnDrag:M,panOnScrollMode:D,panOnScrollSpeed:E,preventScrolling:P,zoomOnPinch:z,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:B,onTransformChange:K,connectionInProgress:Y,paneClickDistance:G,selectionOnDrag:V}){C&&!c.isZoomingOrPanning&&m();const q=L&&!U&&!C;d.clickDistance(V?1/0:!It(G)||G<0?0:G);const re=q?W_({zoomPanValues:c,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:D,panOnScrollSpeed:E,zoomOnPinch:z,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:a}):K_({noWheelClassName:R,preventScrolling:P,d3ZoomHandler:x});if(f.on("wheel.zoom",re,{passive:!1}),!C){const ee=Y_({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",ee);const Z=G_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!A,onPanZoom:o,onTransformChange:K});d.on("zoom",Z);const ue=X_({zoomPanValues:c,panOnDrag:M,panOnScroll:L,onPaneContextMenu:A,onPanZoomEnd:a,onDraggingChange:u});d.on("end",ue)}const te=Q_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:z,userSelectionActive:C,noPanClassName:T,noWheelClassName:R,lib:B,connectionInProgress:Y});d.filter(te),O?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function v(R,T,A){const C=mu(R),L=d==null?void 0:d.constrain()(C,T,A);return L&&await w(L),new Promise(M=>M(L))}async function g(R,T){const A=mu(R);return await w(A,T),new Promise(C=>C(A))}function S(R){if(f){const T=mu(R),A=f.property("__zoom");(A.k!==R.zoom||A.x!==R.x||A.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function b(){const R=f?My(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function j(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleTo(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function k(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleBy(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function _(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!It(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:m,setViewport:g,setViewportConstrained:v,getViewport:b,scaleTo:j,scaleBy:k,setScaleExtent:_,setTranslateExtent:I,syncViewport:S,setClickDistance:$}}var vs;(function(e){e.Line="line",e.Handle="handle"})(vs||(vs={}));function Z_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,a=n-r,u=[i>0?1:i<0?-1:0,a>0?1:a<0?-1:0];return i&&s&&(u[0]=u[0]*-1),a&&o&&(u[1]=u[1]*-1),u}function _m(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 Pm(e,t){return e?!t:t}function J_(e,t,n,r,s,o,i,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:N,minHeight:m,maxHeight:v}=r,{x:g,y:S,width:b,height:j,aspectRatio:k}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const $=b+(u?-_:_),R=j+(c?-I:I),T=-o[0]*b,A=-o[1]*j;let C=Pi($,w,N),L=Pi(R,m,v);if(i){let E=0,P=0;u&&_<0?E=kn(g+_+T,i[0][0]):!u&&_>0&&(E=jn(g+$+T,i[1][0])),c&&I<0?P=kn(S+I+A,i[0][1]):!c&&I>0&&(P=jn(S+R+A,i[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(a){let E=0,P=0;u&&_>0?E=jn(g+_,a[0][0]):!u&&_<0&&(E=kn(g+$,a[1][0])),c&&I>0?P=jn(S+I,a[0][1]):!c&&I<0&&(P=kn(S+R,a[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(s){if(h){const E=Pi($/k,m,v)*k;if(C=Math.max(C,E),i){let P=0;!u&&!c||u&&!c&&f?P=jn(S+A+$/k,i[1][1])*k:P=kn(S+A+(u?_:-_)/k,i[0][1])*k,C=Math.max(C,P)}if(a){let P=0;!u&&!c||u&&!c&&f?P=kn(S+$/k,a[1][1])*k:P=jn(S+(u?_:-_)/k,a[0][1])*k,C=Math.max(C,P)}}if(d){const E=Pi(R*k,w,N)/k;if(L=Math.max(L,E),i){let P=0;!u&&!c||c&&!u&&f?P=jn(g+R*k+T,i[1][0])/k:P=kn(g+(c?I:-I)*k+T,i[0][0])/k,L=Math.max(L,P)}if(a){let P=0;!u&&!c||c&&!u&&f?P=kn(g+R*k,a[1][0])/k:P=jn(g+(c?I:-I)*k,a[0][0])/k,L=Math.max(L,P)}}}I=I+(I<0?L:-L),_=_+(_<0?C:-C),s&&(f?$>R*k?I=(Pm(u,c)?-_:_)/k:_=(Pm(u,c)?-I:I)*k:h?(I=_/k,c=u):(_=I*k,u=c));const M=u?g+_:g,D=c?S+I:S;return{width:b+(u?-_:_),height:j+(c?-I:I),x:o[0]*_*(u?-1:1)+M,y:o[1]*I*(c?-1:1)+D}}const i0={width:0,height:0,x:0,y:0},e3={...i0,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,a=n[0]*o,u=n[1]*i;return[[r-a,s-u],[r+o-a,s+i-u]]}function r3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=lt(e);let i={controlDirection:_m("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:N}){let m={...i0},v={...e3};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:_m(c)};let g,S=null,b=[],j,k,_,I=!1;const $=gy().on("start",R=>{const{nodeLookup:T,transform:A,snapGrid:C,snapToGrid:L,nodeOrigin:M,paneDomNode:D}=n();if(g=T.get(t),!g)return;S=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:P}=ho(R.sourceEvent,{transform:A,snapGrid:C,snapToGrid:L,containerBounds:S});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:E,pointerY:P,aspectRatio:m.width/m.height},j=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(j=T.get(g.parentId),k=j&&g.extent==="parent"?t3(j):void 0),b=[],_=void 0;for(const[z,F]of T)if(F.parentId===t&&(b.push({id:z,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=n3(F,g,F.origin??M);_?_=[[Math.min(O[0][0],_[0][0]),Math.min(O[0][1],_[0][1])],[Math.max(O[1][0],_[1][0]),Math.max(O[1][1],_[1][1])]]:_=O}x==null||x(R,{...m})}).on("drag",R=>{const{transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L}=n(),M=ho(R.sourceEvent,{transform:T,snapGrid:A,snapToGrid:C,containerBounds:S}),D=[];if(!g)return;const{x:E,y:P,width:z,height:F}=m,O={},U=g.origin??L,{width:B,height:K,x:Y,y:G}=J_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,k,_),V=B!==z,q=K!==F,re=Y!==E&&V,te=G!==P&&q;if(!re&&!te&&!V&&!q)return;if((re||te||U[0]===1||U[1]===1)&&(O.x=re?Y:m.x,O.y=te?G:m.y,m.x=O.x,m.y=O.y,b.length>0)){const he=Y-E,le=G-P;for(const Be of b)Be.position={x:Be.position.x-he+U[0]*(B-z),y:Be.position.y-le+U[1]*(K-F)},D.push(Be)}if((V||q)&&(O.width=V&&(!i.resizeDirection||i.resizeDirection==="horizontal")?B:m.width,O.height=q&&(!i.resizeDirection||i.resizeDirection==="vertical")?K:m.height,m.width=O.width,m.height=O.height),j&&g.expandParent){const he=U[0]*(O.width??0);O.x&&O.x<he&&(m.x=he,v.x=v.x-(O.x-he));const le=U[1]*(O.height??0);O.y&&O.y<le&&(m.y=le,v.y=v.y-(O.y-le))}const ee=Z_({width:m.width,prevWidth:z,height:m.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),Z={...m,direction:ee};(N==null?void 0:N(R,Z))!==!1&&(I=!0,y==null||y(R,Z),r(O,D))}).on("end",R=>{I&&(w==null||w(R,{...m}),s==null||s({...m}),I=!1)});o.call($)}function u(){o.on(".drag",null)}return{update:a,destroy:u}}var a0={exports:{}},l0={},u0={exports:{}},c0={};/**
321
+ */const ek=J("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:fl},{to:"/inventory/identities",label:"Identities",icon:Gx},{to:"/inventory/permissions",label:"Permissions",icon:Bb},{to:"/inventory/hosts",label:"Hosts",icon:Xo}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:Qd},{to:"/secure/graph",label:"Graph",icon:Gb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Zx},{to:"/ops/plugins",label:"Plugins",icon:Qb}]},{label:"System",items:[{to:"/system/logs",label:"Logs",icon:qb},{to:"/system/settings",label:"Settings",icon:Qt}]}];function nk(){const e=yn(),[t,n]=p.useState("");return p.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),l.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[l.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),l.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),l.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:tk.map(r=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),l.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>l.jsxs(Ax,{to:s.to,className:Pe("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:[l.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),l.jsx("div",{className:"border-t border-border px-4 py-3",children:l.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 fs=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,a=s.map(u=>u===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return l.jsx(jc,{...r,ref:t,children:p.isValidElement(i)?p.cloneElement(i,void 0,a):null})}return l.jsx(jc,{...r,ref:t,children:n})});fs.displayName="Slot";var jc=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const s=ak(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});jc.displayName="SlotClone";var sk=({children:e})=>l.jsx(l.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]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function ak(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 lk(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ey(e))&&(r&&(r+=" "),r+=t);return r}const Qh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qh=lk,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=Qh(h)||Qh(d);return s[c][f]}),a=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,N]=y;return Array.isArray(N)?N.includes({...o,...a}[w]):{...o,...a}[w]===N})?[...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"}}),Z=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?fs:"button";return l.jsx(i,{className:Pe(ck({variant:t,size:n,className:e})),ref:o,...s})});Z.displayName="Button";function dk(){const{user:e,logout:t}=Kd(),{theme:n,setTheme:r}=YS();return l.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&l.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),l.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?l.jsx(Jb,{className:"h-4 w-4"}):l.jsx(Yb,{className:"h-4 w-4"})}),l.jsx(Z,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:l.jsx(Kb,{className:"h-4 w-4"})})]})]})}function fk(){return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsx(nk,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(dk,{}),l.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(dS,{})})]})]})}const $e=p.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Pe("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}));$e.displayName="Input";function hk(){const[e,t]=p.useState(""),[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),[u,c]=p.useState(!1),{login:h,isAuthenticated:d,isLoading:f}=Kd(),x=Hd();if(p.useEffect(()=>{d&&x("/inventory/agents",{replace:!0})},[d,x]),p.useEffect(()=>{fetch("/api/auth/config").then(w=>w.json()).then(w=>c(w.defaultPassword===!0)).catch(()=>{})},[]),f)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const y=async w=>{w.preventDefault(),o(""),a(!0);try{await h(e,n),x("/inventory/agents",{replace:!0})}catch(N){o(N instanceof Error?N.message:"Login failed")}finally{a(!1)}};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[l.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),u&&l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-50 px-3 py-2.5 text-sm text-amber-800 dark:bg-amber-950 dark:text-amber-200",children:[l.jsx(Qd,{className:"mt-0.5 h-4 w-4 shrink-0"}),l.jsxs("span",{children:["Default credentials: ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"})," / ",l.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 text-xs dark:bg-amber-900",children:"admin"}),". Please change after login."]})]}),l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Username"}),l.jsx($e,{type:"text",placeholder:"admin",value:e,onChange:w=>t(w.target.value),autoComplete:"username",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-sm font-medium text-foreground",children:"Password"}),l.jsx($e,{type:"password",placeholder:"Password",value:n,onChange:w=>r(w.target.value),autoComplete:"current-password",required:!0})]}),s&&l.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s}),l.jsx(Z,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})]}),l.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Change the password in Settings after first login."})]})})}const mk="/api";async function ce(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 re={agents:{list:()=>ce("/agents"),get:e=>ce(`/agents/${e}`),create:e=>ce("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>ce(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>ce(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>ce("/discovery/agents"),profile:e=>ce(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>ce(`/observations?limit=${e}`),permissions:()=>ce("/observations/permissions"),anomalies:()=>ce("/observations/anomalies"),summary:()=>ce("/observations/summary"),agentPermissions:e=>ce(`/observations/agents/${e}/permissions`)},commands:{list:e=>ce(`/commands?agentId=${e}`),create:e=>ce("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>ce("/system/services"),logs:(e,t=200)=>ce(`/system/logs/${e}?lines=${t}`),clearLog:e=>ce(`/system/logs/${e}`,{method:"DELETE"})},hosts:{list:()=>ce("/hosts"),get:e=>ce(`/hosts/${e}`),remove:e=>ce(`/hosts/${e}`,{method:"DELETE"}),agents:e=>ce(`/hosts/${e}/agents`),sendCommand:(e,t,n)=>ce("/hosts/commands",{method:"POST",body:JSON.stringify({hostId:e,type:t,payload:n})}),commands:(e,t=50)=>ce(`/hosts/commands?hostId=${e}&limit=${t}`)},detect:e=>ce("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>ce(`/usage/summary?days=${e}`),daily:(e=30)=>ce(`/usage/daily?days=${e}`)},settings:{get:()=>ce("/settings"),update:e=>ce("/settings",{method:"PUT",body:JSON.stringify(e)}),getApiKey:(e=!1)=>ce(`/settings/api-key${e?"?reveal=true":""}`),generateKey:()=>ce("/settings/generate-key",{method:"POST"})}};function ke({className:e,variant:t="default",...n}){return l.jsx("div",{className:Pe("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 re.discovery.agents();t(c.data??[])}catch{}o(!1)};p.useEffect(()=>{i()},[]);const a=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 l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),l.jsxs(Z,{variant:"outline",size:"sm",onClick:i,children:[l.jsx(Yn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx($e,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(fl,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):l.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(c=>{var h;return l.jsxs(gr,{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:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("span",{className:"text-xl",children:c.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),l.jsx(ke,{variant:u(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&l.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(d=>l.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&&l.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 Se=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));Se.displayName="Card";const Le=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";const Ae=p.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Pe("font-semibold leading-none tracking-tight",e),...t}));Ae.displayName="CardTitle";const qd=p.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));qd.displayName="CardDescription";const _e=p.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));_e.displayName="CardContent";const gk=["Profile","Tasks","Identities","Permissions"];function xk(){const{id:e}=q2(),[t,n]=p.useState(null),[r,s]=p.useState([]),[o,i]=p.useState("Profile"),[a,u]=p.useState(!0),[c,h]=p.useState(null);return p.useEffect(()=>{e&&(u(!0),(async()=>{const d=await re.discovery.profile(e).catch(()=>null),f=(d==null?void 0:d.data)??null;n(f),f!=null&&f.hostId&&re.hosts.get(f.hostId).then(w=>h(w.data??null)).catch(()=>{});const x=(f==null?void 0:f.registeredAgentId)??e,y=await re.observations.agentPermissions(x).catch(()=>({data:[]}));s((y==null?void 0:y.data)??[]),u(!1)})())},[e]),a?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(gr,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:l.jsx(Tb,{className:"h-4 w-4"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:"",c&&l.jsxs(gr,{to:"/inventory/hosts",className:"ml-2 inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[l.jsx(Xo,{className:"h-3 w-3"})," ",c.hostname]})]})]})]})]}),l.jsx("div",{className:"flex gap-1 border-b border-border",children:gk.map(d=>l.jsx("button",{onClick:()=>i(d),className:Pe("border-b-2 px-4 py-2 text-sm font-medium transition-colors",o===d?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:d},d))}),o==="Profile"&&l.jsx(yk,{profile:t}),o==="Tasks"&&l.jsx(vk,{profile:t}),o==="Identities"&&l.jsx(wk,{profile:t}),o==="Permissions"&&l.jsx(Nk,{permissions:r})]}):l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function yk({profile:e}){const t=e.skills??[];return l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Info"})}),l.jsxs(_e,{className:"space-y-2 text-sm",children:[l.jsx(Ys,{label:"Owner",value:e.ownerName||"—"}),l.jsx(Ys,{label:"Creature",value:e.creature||"—"}),l.jsx(Ys,{label:"Vibe",value:e.vibe||"—"}),l.jsx(Ys,{label:"Sessions",value:String(e.sessionCount??0)}),l.jsx(Ys,{label:"Last Active",value:e.lastActive??"never"})]})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Zx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),l.jsx(gr,{to:"/ops/skills",children:l.jsxs(Z,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",l.jsx(Fb,{className:"ml-1 h-3 w-3"})]})})]})}),l.jsx(_e,{children:t.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[l.jsx(cs,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),l.jsx(gr,{to:"/ops/skills",children:l.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>l.jsxs(ke,{variant:"secondary",className:"text-xs font-normal",children:[l.jsx(cs,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Plugins"})}),l.jsx(_e,{children:(e.plugins??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):l.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{children:n.name}),l.jsx(ke,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Connected Systems"})}),l.jsx(_e,{children:(e.connectedSystems??[]).length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>l.jsx(ke,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function vk({profile:e}){const t=e.cronJobs??[];return l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Db,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),l.jsx(_e,{children:t.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):l.jsx("div",{className:"space-y-2",children:t.map((n,r)=>l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),l.jsx("span",{className:"ml-2",children:n.task??n.id})]}),l.jsx(ke,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function wk({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 l.jsx("div",{className:"space-y-4",children:n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(_s,{className:"h-4 w-4"})," ",r.label]})}),l.jsx(_e,{children:l.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 Nk({permissions:e}){return e.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{className:"border-b border-border last:border-0",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),l.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 l.jsxs("div",{className:"flex justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("span",{className:"font-medium",children:t})]})}function Sk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(new Set);p.useEffect(()=>{re.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"}))}],a=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),h})};return n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),l.jsx("div",{className:"space-y-3",children:i.map(u=>l.jsxs(Se,{children:[l.jsxs("button",{onClick:()=>a(u.category),className:"flex w-full items-center justify-between p-4 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Gx,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:u.category}),l.jsx(ke,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?l.jsx(hl,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(Gd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&l.jsx(_e,{className:"border-t border-border pt-3",children:u.items.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):l.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>l.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&l.jsx("span",{className:"text-base",children:c.emoji}),l.jsx("span",{children:c.name})]}),c.status&&l.jsx(ke,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&l.jsx(ke,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},u.category))})]})}function bk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState("callCount"),[i,a]=p.useState(!1),[u,c]=p.useState(!0);p.useEffect(()=>{re.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,N;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((N=y.category)==null?void 0:N.toLowerCase().includes(x))})}return[...f].sort((x,y)=>{const w=x[s]??0,N=y[s]??0;return typeof w=="string"?i?w.localeCompare(N):N.localeCompare(w):i?w-N:N-w})},[e,n,s,i]),d=f=>{s===f?a(!i):(o(f),a(!1))};return u?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx($e,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx(lu,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),l.jsx(lu,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),l.jsx(lu,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),l.jsx("tbody",{children:h.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),l.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function lu({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return l.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:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&l.jsx(Lb,{className:"h-3 w-3"})]})})}function kk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0);p.useEffect(()=>{re.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?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[l.jsx(Qd,{className:"h-8 w-8 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),l.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),l.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),l.jsx("tbody",{children:e.map(i=>{var u;const a=s(i);return l.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[l.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:o(a),className:"text-[10px]",children:a})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx(ke,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),l.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 Ie(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=Ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var jk={value:()=>{}};function ml(){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 Ck(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=ml.prototype={constructor:Ji,on:function(e,t){var n=this._,r=Ck(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=Ek(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]=Zh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Zh(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 Ek(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function Zh(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=jk,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Cc="http://www.w3.org/1999/xhtml";const Jh={svg:"http://www.w3.org/2000/svg",xhtml:Cc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Jh.hasOwnProperty(t)?{space:Jh[t],local:e}:e}function _k(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cc&&t.documentElement.namespaceURI===Cc?t.createElement(e):t.createElementNS(n,e)}}function Pk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ty(e){var t=pl(e);return(t.local?Pk:_k)(t)}function Mk(){}function Zd(e){return e==null?Mk:function(){return this.querySelector(e)}}function Ik(e){typeof e!="function"&&(e=Zd(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,a=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__),a[h]=c);return new pt(r,this._parents)}function Rk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Tk(){return[]}function ny(e){return e==null?Tk:function(){return this.querySelectorAll(e)}}function Lk(e){return function(){return Rk(e.apply(this,arguments))}}function Ak(e){typeof e=="function"?e=Lk(e):e=ny(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new pt(r,s)}function ry(e){return function(){return this.matches(e)}}function sy(e){return function(t){return t.matches(e)}}var zk=Array.prototype.find;function Dk(e){return function(){return zk.call(this.children,e)}}function $k(){return this.firstElementChild}function Ok(e){return this.select(e==null?$k:Dk(typeof e=="function"?e:sy(e)))}var Fk=Array.prototype.filter;function Hk(){return Array.from(this.children)}function Vk(e){return function(){return Fk.call(this.children,e)}}function Bk(e){return this.selectAll(e==null?Hk:Vk(typeof e=="function"?e:sy(e)))}function Uk(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new pt(r,this._parents)}function oy(e){return new Array(e.length)}function Wk(){return new pt(this._enter||this._groups.map(oy),this._parents)}function Ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ta.prototype={constructor:Ta,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 Kk(e){return function(){return e}}function Yk(e,t,n,r,s,o){for(var i=0,a,u=t.length,c=o.length;i<c;++i)(a=t[i])?(a.__data__=o[i],r[i]=a):n[i]=new Ta(e,o[i]);for(;i<u;++i)(a=t[i])&&(s[i]=a)}function Gk(e,t,n,r,s,o,i){var a,u,c=new Map,h=t.length,d=o.length,f=new Array(h),x;for(a=0;a<h;++a)(u=t[a])&&(f[a]=x=i.call(u,u.__data__,a,t)+"",c.has(x)?s[a]=u:c.set(x,u));for(a=0;a<d;++a)x=i.call(e,o[a],a,o)+"",(u=c.get(x))?(r[a]=u,u.__data__=o[a],c.delete(x)):n[a]=new Ta(e,o[a]);for(a=0;a<h;++a)(u=t[a])&&c.get(f[a])===u&&(s[a]=u)}function Xk(e){return e.__data__}function Qk(e,t){if(!arguments.length)return Array.from(this,Xk);var n=t?Gk:Yk,r=this._parents,s=this._groups;typeof e!="function"&&(e=Kk(e));for(var o=s.length,i=new Array(o),a=new Array(o),u=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],f=d.length,x=qk(e.call(h,h&&h.__data__,c,r)),y=x.length,w=a[c]=new Array(y),N=i[c]=new Array(y),m=u[c]=new Array(f);n(h,d,w,N,m,x,t);for(var v=0,g=0,S,b;v<y;++v)if(S=w[v]){for(v>=g&&(g=v+1);!(b=N[g])&&++g<y;);S._next=b||null}}return i=new pt(i,r),i._enter=a,i._exit=u,i}function qk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zk(){return new pt(this._exit||this._groups.map(oy),this._parents)}function Jk(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 ej(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),a=new Array(s),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=a[u]=new Array(d),x,y=0;y<d;++y)(x=c[y]||h[y])&&(f[y]=x);for(;u<s;++u)a[u]=n[u];return new pt(a,this._parents)}function tj(){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 nj(e){e||(e=rj);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],a=i.length,u=s[o]=new Array(a),c,h=0;h<a;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new pt(s,this._parents).order()}function rj(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oj(){return Array.from(this)}function ij(){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 lj(){return!this.node()}function uj(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,a;o<i;++o)(a=s[o])&&e.call(a,a.__data__,o,s);return this}function cj(e){return function(){this.removeAttribute(e)}}function dj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fj(e,t){return function(){this.setAttribute(e,t)}}function hj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pj(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 gj(e,t){var n=pl(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?dj:cj:typeof t=="function"?n.local?pj:mj:n.local?hj:fj)(n,t))}function iy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xj(e){return function(){this.style.removeProperty(e)}}function yj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vj(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function wj(e,t,n){return arguments.length>1?this.each((t==null?xj:typeof t=="function"?vj:yj)(e,t,n??"")):hs(this.node(),e)}function hs(e,t){return e.style.getPropertyValue(t)||iy(e).getComputedStyle(e,null).getPropertyValue(t)}function Nj(e){return function(){delete this[e]}}function Sj(e,t){return function(){this[e]=t}}function bj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kj(e,t){return arguments.length>1?this.each((t==null?Nj:typeof t=="function"?bj:Sj)(e,t)):this.node()[e]}function ay(e){return e.trim().split(/^|\s+/)}function Jd(e){return e.classList||new ly(e)}function ly(e){this._node=e,this._names=ay(e.getAttribute("class")||"")}ly.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=Jd(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function cy(e,t){for(var n=Jd(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function jj(e){return function(){uy(this,e)}}function Cj(e){return function(){cy(this,e)}}function Ej(e,t){return function(){(t.apply(this,arguments)?uy:cy)(this,e)}}function _j(e,t){var n=ay(e+"");if(arguments.length<2){for(var r=Jd(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?Ej:t?jj:Cj)(n,t))}function Pj(){this.textContent=""}function Mj(e){return function(){this.textContent=e}}function Ij(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Rj(e){return arguments.length?this.each(e==null?Pj:(typeof e=="function"?Ij:Mj)(e)):this.node().textContent}function Tj(){this.innerHTML=""}function Lj(e){return function(){this.innerHTML=e}}function Aj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zj(e){return arguments.length?this.each(e==null?Tj:(typeof e=="function"?Aj:Lj)(e)):this.node().innerHTML}function Dj(){this.nextSibling&&this.parentNode.appendChild(this)}function $j(){return this.each(Dj)}function Oj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fj(){return this.each(Oj)}function Hj(e){var t=typeof e=="function"?e:ty(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vj(){return null}function Bj(e,t){var n=typeof e=="function"?e:ty(e),r=t==null?Vj:typeof t=="function"?t:Zd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Uj(){var e=this.parentNode;e&&e.removeChild(this)}function Wj(){return this.each(Uj)}function Kj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Yj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gj(e){return this.select(e?Yj:Kj)}function Xj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qj(e){return function(t){e.call(this,t,this.__data__)}}function qj(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 Zj(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 Jj(e,t,n){return function(){var r=this.__on,s,o=Qj(t);if(r){for(var i=0,a=r.length;i<a;++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 eC(e,t,n){var r=qj(e+""),s,o=r.length,i;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,h;u<c;++u)for(s=0,h=a[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(a=t?Jj:Zj,s=0;s<o;++s)this.each(a(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 tC(e,t){return function(){return dy(this,e,t)}}function nC(e,t){return function(){return dy(this,e,t.apply(this,arguments))}}function rC(e,t){return this.each((typeof t=="function"?nC:tC)(e,t))}function*sC(){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 pt(e,t){this._groups=e,this._parents=t}function Qo(){return new pt([[document.documentElement]],fy)}function oC(){return this}pt.prototype=Qo.prototype={constructor:pt,select:Ik,selectAll:Ak,selectChild:Ok,selectChildren:Bk,filter:Uk,data:Qk,enter:Wk,exit:Zk,join:Jk,merge:ej,selection:oC,order:tj,sort:nj,call:sj,nodes:oj,node:ij,size:aj,empty:lj,each:uj,attr:gj,style:wj,property:kj,classed:_j,text:Rj,html:zj,raise:$j,lower:Fj,append:Hj,insert:Bj,remove:Wj,clone:Gj,datum:Xj,on:eC,dispatch:rC,[Symbol.iterator]:sC};function dt(e){return typeof e=="string"?new pt([[document.querySelector(e)]],[document.documentElement]):new pt([[e]],fy)}function iC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=iC(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=dt(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=dt(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 ki=e=>()=>e;function Ec(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:a,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:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Ec.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lC(e){return!e.ctrlKey&&!e.button}function uC(){return this.parentNode}function cC(e,t){return t??{x:e.x,y:e.y}}function dC(){return navigator.maxTouchPoints||"ontouchstart"in this}function py(){var e=lC,t=uC,n=cC,r=dC,s={},o=ml("start","drag","end"),i=0,a,u,c,h,d=0;function f(S){S.on("mousedown.drag",x).filter(r).on("touchstart.drag",N).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(S,b){if(!(h||!e.call(this,S,b))){var j=g(this,t.call(this,S,b),S,b,"mouse");j&&(dt(S.view).on("mousemove.drag",y,To).on("mouseup.drag",w,To),hy(S.view),uu(S),c=!1,a=S.clientX,u=S.clientY,j("start",S))}}function y(S){if(es(S),!c){var b=S.clientX-a,j=S.clientY-u;c=b*b+j*j>d}s.mouse("drag",S)}function w(S){dt(S.view).on("mousemove.drag mouseup.drag",null),my(S.view,c),es(S),s.mouse("end",S)}function N(S,b){if(e.call(this,S,b)){var j=S.changedTouches,k=t.call(this,S,b),_=j.length,I,$;for(I=0;I<_;++I)($=g(this,k,S,b,j[I].identifier,j[I]))&&(uu(S),$("start",S,j[I]))}}function m(S){var b=S.changedTouches,j=b.length,k,_;for(k=0;k<j;++k)(_=s[b[k].identifier])&&(es(S),_("drag",S,b[k]))}function v(S){var b=S.changedTouches,j=b.length,k,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<j;++k)(_=s[b[k].identifier])&&(uu(S),_("end",S,b[k]))}function g(S,b,j,k,_,I){var $=o.copy(),R=_t(I||j,b),T,A,C;if((C=n.call(S,new Ec("beforestart",{sourceEvent:j,target:f,identifier:_,active:i,x:R[0],y:R[1],dx:0,dy:0,dispatch:$}),k))!=null)return T=C.x-R[0]||0,A=C.y-R[1]||0,function L(M,D,E){var P=R,z;switch(M){case"start":s[_]=L,z=i++;break;case"end":delete s[_],--i;case"drag":R=_t(E||D,b),z=i;break}$.call(M,S,new Ec(M,{sourceEvent:D,subject:C,target:f,identifier:_,active:z,x:R[0]+T,y:R[1]+A,dx:R[0]-P[0],dy:R[1]-P[1],dispatch:$}),k)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:ki(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:ki(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:ki(S),f):n},f.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:ki(!!S),f):r},f.on=function(){var S=o.on.apply(o,arguments);return S===o?f:S},f.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,f):Math.sqrt(d)},f}function ef(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,La=1/Lo,ts="\\s*([+-]?\\d+)\\s*",Ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fC=/^#([0-9a-f]{3,8})$/,hC=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),mC=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),pC=new RegExp(`^rgba\\(${ts},${ts},${ts},${Ao}\\)$`),gC=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Ao}\\)$`),xC=new RegExp(`^hsl\\(${Ao},${Xt},${Xt}\\)$`),yC=new RegExp(`^hsla\\(${Ao},${Xt},${Xt},${Ao}\\)$`),em={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};ef(qo,yr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tm,formatHex:tm,formatHex8:vC,formatHsl:wC,formatRgb:nm,toString:nm});function tm(){return this.rgb().formatHex()}function vC(){return this.rgb().formatHex8()}function wC(){return xy(this).formatHsl()}function nm(){return this.rgb().formatRgb()}function yr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rm(t):n===3?new rt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ji(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=hC.exec(e))?new rt(t[1],t[2],t[3],1):(t=mC.exec(e))?new rt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pC.exec(e))?ji(t[1],t[2],t[3],t[4]):(t=gC.exec(e))?ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xC.exec(e))?im(t[1],t[2]/100,t[3]/100,1):(t=yC.exec(e))?im(t[1],t[2]/100,t[3]/100,t[4]):em.hasOwnProperty(e)?rm(em[e]):e==="transparent"?new rt(NaN,NaN,NaN,0):null}function rm(e){return new rt(e>>16&255,e>>8&255,e&255,1)}function ji(e,t,n,r){return r<=0&&(e=t=n=NaN),new rt(e,t,n,r)}function NC(e){return e instanceof qo||(e=yr(e)),e?(e=e.rgb(),new rt(e.r,e.g,e.b,e.opacity)):new rt}function _c(e,t,n,r){return arguments.length===1?NC(e):new rt(e,t,n,r??1)}function rt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ef(rt,_c,gy(qo,{brighter(e){return e=e==null?La:Math.pow(La,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rt(ur(this.r),ur(this.g),ur(this.b),Aa(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:sm,formatHex:sm,formatHex8:SC,formatRgb:om,toString:om}));function sm(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function SC(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function om(){const e=Aa(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function Aa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function im(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,a=o-s,u=(o+s)/2;return a?(t===o?i=(n-r)/a+(n<r)*6:n===o?i=(r-t)/a+2:i=(t-n)/a+4,a/=u<.5?o+s:2-o-s,i*=60):a=u>0&&u<1?0:i,new Mt(i,a,u,e.opacity)}function bC(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}ef(Mt,bC,gy(qo,{brighter(e){return e=e==null?La:Math.pow(La,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 rt(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(am(this.h),Ci(this.s),Ci(this.l),Aa(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=Aa(this.opacity);return`${e===1?"hsl(":"hsla("}${am(this.h)}, ${Ci(this.s)*100}%, ${Ci(this.l)*100}%${e===1?")":`, ${e})`}`}}));function am(e){return e=(e||0)%360,e<0?e+360:e}function Ci(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 tf=e=>()=>e;function kC(e,t){return function(n){return e+n*t}}function jC(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 CC(e){return(e=+e)==1?yy:function(t,n){return n-t?jC(t,n,e):tf(isNaN(t)?n:t)}}function yy(e,t){var n=t-e;return n?kC(e,n):tf(isNaN(e)?t:e)}const za=function e(t){var n=CC(t);function r(s,o){var i=n((s=_c(s)).r,(o=_c(o)).r),a=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=a(h),s.b=u(h),s.opacity=c(h),s+""}}return r.gamma=e,r}(1);function EC(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 _C(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PC(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]=fo(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(a){for(i=0;i<r;++i)o[i]=s[i](a);return o}}function MC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ut(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function IC(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]=fo(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Pc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,du=new RegExp(Pc.source,"g");function RC(e){return function(){return e}}function TC(e){return function(t){return e(t)+""}}function vy(e,t){var n=Pc.lastIndex=du.lastIndex=0,r,s,o,i=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Pc.exec(e))&&(s=du.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),a[i]?a[i]+=o:a[++i]=o),(r=r[0])===(s=s[0])?a[i]?a[i]+=s:a[++i]=s:(a[++i]=null,u.push({i,x:Ut(r,s)})),n=du.lastIndex;return n<t.length&&(o=t.slice(n),a[i]?a[i]+=o:a[++i]=o),a.length<2?u[0]?TC(u[0].x):RC(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)a[(d=u[h]).i]=d.x(c);return a.join("")})}function fo(e,t){var n=typeof t,r;return t==null||n==="boolean"?tf(t):(n==="number"?Ut:n==="string"?(r=yr(t))?(t=r,za):vy:t instanceof yr?za:t instanceof Date?MC:_C(t)?EC:Array.isArray(t)?PC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?IC:Ut)(e,t)}var lm=180/Math.PI,Mc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wy(e,t,n,r,s,o){var i,a,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),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:a}}var Ei;function LC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Mc:wy(t.a,t.b,t.c,t.d,t.e,t.f)}function AC(e){return e==null||(Ei||(Ei=document.createElementNS("http://www.w3.org/2000/svg","g")),Ei.setAttribute("transform",e),!(e=Ei.transform.baseVal.consolidate()))?Mc:(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:Ut(c,d)},{i:w-2,x:Ut(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:Ut(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function a(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Ut(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:Ut(c,d)},{i:w-2,x:Ut(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),a(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,N;++y<w;)d[(N=f[y]).i]=N.x(x);return d.join("")}}}var zC=Ny(LC,"px, ","px)","deg)"),DC=Ny(AC,", ",")",")"),$C=1e-12;function um(e){return((e=Math.exp(e))+1/e)/2}function OC(e){return((e=Math.exp(e))-1/e)/2}function FC(e){return((e=Math.exp(2*e))-1)/(e+1)}const ea=function e(t,n,r){function s(o,i){var a=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],x=h-a,y=d-u,w=x*x+y*y,N,m;if(w<$C)m=Math.log(f/c)/t,N=function(k){return[a+k*x,u+k*y,c*Math.exp(t*k*m)]};else{var v=Math.sqrt(w),g=(f*f-c*c+r*w)/(2*c*n*v),S=(f*f-c*c-r*w)/(2*f*n*v),b=Math.log(Math.sqrt(g*g+1)-g),j=Math.log(Math.sqrt(S*S+1)-S);m=(j-b)/t,N=function(k){var _=k*m,I=um(b),$=c/(n*v)*(I*FC(t*_+b)-OC(b));return[a+$*x,u+$*y,c*I/um(t*_+b)]}}return N.duration=m*1e3*t/Math.SQRT2,N}return s.rho=function(o){var i=Math.max(.001,+o),a=i*i,u=a*a;return e(i,a,u)},s}(Math.SQRT2,2,4);var ms=0,eo=0,Gs=0,Sy=1e3,Da,to,$a=0,vr=0,gl=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 nf(){return vr||(by(HC),vr=zo.now()+gl)}function HC(){vr=0}function Oa(){this._call=this._time=this._next=null}Oa.prototype=ky.prototype={constructor:Oa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nf():+n)+(t==null?0:+t),!this._next&&to!==this&&(to?to._next=this:Da=this,to=this),this._call=e,this._time=n,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function ky(e,t,n){var r=new Oa;return r.restart(e,t,n),r}function VC(){nf(),++ms;for(var e=Da,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ms}function cm(){vr=($a=zo.now())+gl,ms=eo=0;try{VC()}finally{ms=0,UC(),vr=0}}function BC(){var e=zo.now(),t=e-$a;t>Sy&&(gl-=t,$a=e)}function UC(){for(var e,t=Da,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:Da=n);to=e,Ic(r)}function Ic(e){if(!ms){eo&&(eo=clearTimeout(eo));var t=e-vr;t>24?(e<1/0&&(eo=setTimeout(cm,e-zo.now()-gl)),Gs&&(Gs=clearInterval(Gs))):(Gs||($a=zo.now(),Gs=setInterval(BC,Sy)),ms=1,by(cm))}}function dm(e,t,n){var r=new Oa;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var WC=ml("start","end","cancel","interrupt"),KC=[],jy=0,fm=1,Rc=2,ta=3,hm=4,Tc=5,na=6;function xl(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;YC(e,n,{name:t,index:r,group:s,on:WC,tween:KC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jy})}function rf(e,t){var n=Ot(e,t);if(n.state>jy)throw new Error("too late; already scheduled");return n}function en(e,t){var n=Ot(e,t);if(n.state>ta)throw new Error("too late; already running");return n}function Ot(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YC(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=ky(o,0,n.time);function o(c){n.state=fm,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!==fm)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===ta)return dm(i);x.state===hm?(x.state=na,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=na,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(dm(function(){n.state===ta&&(n.state=hm,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Rc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rc){for(n.state=ta,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 a(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Tc,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Tc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=na,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ra(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>Rc&&r.state<Tc,r.state=na,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function GC(e){return this.each(function(){ra(this,e)})}function XC(e,t){var n,r;return function(){var s=en(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,a=r.length;i<a;++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=en(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var a={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=a;break}u===c&&s.push(a)}o.tween=s}}function qC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ot(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?XC:QC)(n,e,t))}function sf(e,t,n){var r=e._id;return e.each(function(){var s=en(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ot(s,r).value[t]}}function Cy(e,t){var n;return(typeof t=="number"?Ut:t instanceof yr?za:(n=yr(t))?(t=n,za):vy)(e,t)}function ZC(e){return function(){this.removeAttribute(e)}}function JC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eE(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 tE(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 nE(e,t,n){var r,s,o;return function(){var i,a=n(this),u;return a==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function rE(e,t,n){var r,s,o;return function(){var i,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=a+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a)))}}function sE(e,t){var n=pl(e),r=n==="transform"?DC:Cy;return this.attrTween(e,typeof t=="function"?(n.local?rE:nE)(n,r,sf(this,"attr."+e,t)):t==null?(n.local?JC:ZC)(n):(n.local?tE:eE)(n,r,t))}function oE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function iE(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)&&iE(e,o)),n}return s._value=t,s}function lE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&oE(e,o)),n}return s._value=t,s}function uE(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=pl(e);return this.tween(n,(r.local?aE:lE)(r,t))}function cE(e,t){return function(){rf(this,e).delay=+t.apply(this,arguments)}}function dE(e,t){return t=+t,function(){rf(this,e).delay=t}}function fE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cE:dE)(t,e)):Ot(this.node(),t).delay}function hE(e,t){return function(){en(this,e).duration=+t.apply(this,arguments)}}function mE(e,t){return t=+t,function(){en(this,e).duration=t}}function pE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hE:mE)(t,e)):Ot(this.node(),t).duration}function gE(e,t){if(typeof t!="function")throw new Error;return function(){en(this,e).ease=t}}function xE(e){var t=this._id;return arguments.length?this.each(gE(t,e)):Ot(this.node(),t).ease}function yE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;en(this,e).ease=n}}function vE(e){if(typeof e!="function")throw new Error;return this.each(yE(this._id,e))}function wE(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,a=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new gn(r,this._parents,this._name,this._id)}function NE(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),a=0;a<o;++a)for(var u=t[a],c=n[a],h=u.length,d=i[a]=new Array(h),f,x=0;x<h;++x)(f=u[x]||c[x])&&(d[x]=f);for(;a<r;++a)i[a]=t[a];return new gn(i,this._parents,this._name,this._id)}function SE(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 bE(e,t,n){var r,s,o=SE(t)?rf:en;return function(){var i=o(this,e),a=i.on;a!==r&&(s=(r=a).copy()).on(t,n),i.on=s}}function kE(e,t){var n=this._id;return arguments.length<2?Ot(this.node(),n).on.on(e):this.each(bE(n,e,t))}function jE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CE(){return this.on("end.remove",jE(this._id))}function EE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Zd(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var a=r[i],u=a.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=a[f])&&(d=e.call(h,h.__data__,f,a))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,xl(c[f],t,n,f,c,Ot(h,n)));return new gn(o,this._parents,t,n)}function _E(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ny(e));for(var r=this._groups,s=r.length,o=[],i=[],a=0;a<s;++a)for(var u=r[a],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=Ot(h,n),w=0,N=f.length;w<N;++w)(x=f[w])&&xl(x,t,n,w,f,y);o.push(f),i.push(h)}return new gn(o,i,t,n)}var PE=Qo.prototype.constructor;function ME(){return new PE(this._groups,this._parents)}function IE(e,t){var n,r,s;return function(){var o=hs(this,e),i=(this.style.removeProperty(e),hs(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 RE(e,t,n){var r,s=n+"",o;return function(){var i=hs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function TE(e,t,n){var r,s,o;return function(){var i=hs(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),hs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,a))}}function LE(e,t){var n,r,s,o="style."+t,i="end."+o,a;return function(){var u=en(this,e),c=u.on,h=u.value[o]==null?a||(a=Ey(t)):void 0;(c!==n||s!==h)&&(r=(n=c).copy()).on(i,s=h),u.on=r}}function AE(e,t,n){var r=(e+="")=="transform"?zC:Cy;return t==null?this.styleTween(e,IE(e,r)).on("end.style."+e,Ey(e)):typeof t=="function"?this.styleTween(e,TE(e,r,sf(this,"style."+e,t))).each(LE(this._id,e)):this.styleTween(e,RE(e,r,t),n).on("end.style."+e,null)}function zE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DE(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&zE(e,i,n)),r}return o._value=t,o}function $E(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,DE(e,t,n??""))}function OE(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e(this);this.textContent=t??""}}function HE(e){return this.tween("text",typeof e=="function"?FE(sf(this,"text",e)):OE(e==null?"":e+""))}function VE(e){return function(t){this.textContent=e.call(this,t)}}function BE(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&VE(s)),t}return r._value=e,r}function UE(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,BE(e))}function WE(){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],a=i.length,u,c=0;c<a;++c)if(u=i[c]){var h=Ot(u,t);xl(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gn(r,this._parents,e,n)}function KE(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var a={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=en(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),s===0&&o()})}var YE=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _y(){return++YE}var rn=Qo.prototype;gn.prototype={constructor:gn,select:EE,selectAll:_E,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:wE,merge:NE,selection:ME,transition:WE,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.each,on:kE,attr:sE,attrTween:uE,style:AE,styleTween:$E,text:HE,textTween:UE,remove:CE,tween:qC,delay:fE,duration:pE,ease:xE,easeVarying:vE,end:KE,[Symbol.iterator]:rn[Symbol.iterator]};function GE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var XE={time:null,delay:0,duration:250,ease:GE};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 qE(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=_y(),(n=XE).time=nf(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],a=i.length,u,c=0;c<a;++c)(u=i[c])&&xl(u,e,t,c,i,n||QE(u,t));return new gn(r,this._parents,e,t)}Qo.prototype.interrupt=GC;Qo.prototype.transition=qE;const _i=e=>()=>e;function ZE(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 un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(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 yl=new un(1,0,0);Py.prototype=un.prototype;function Py(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yl;return e.__zoom}function fu(e){e.stopImmediatePropagation()}function Xs(e){e.preventDefault(),e.stopImmediatePropagation()}function JE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function e_(){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 mm(){return this.__zoom||yl}function t_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function n_(){return navigator.maxTouchPoints||"ontouchstart"in this}function r_(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=JE,t=e_,n=r_,r=t_,s=n_,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],a=250,u=ea,c=ml("start","zoom","end"),h,d,f,x=500,y=150,w=0,N=10;function m(C){C.property("__zoom",mm).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(C,L,M,D){var E=C.selection?C.selection():C;E.property("__zoom",mm),C!==E?b(C,L,M,D):E.interrupt().each(function(){j(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},m.scaleBy=function(C,L,M,D){m.scaleTo(C,function(){var E=this.__zoom.k,P=typeof L=="function"?L.apply(this,arguments):L;return E*P},M,D)},m.scaleTo=function(C,L,M,D){m.transform(C,function(){var E=t.apply(this,arguments),P=this.__zoom,z=M==null?S(E):typeof M=="function"?M.apply(this,arguments):M,F=P.invert(z),O=typeof L=="function"?L.apply(this,arguments):L;return n(g(v(P,O),z,F),E,i)},M,D)},m.translateBy=function(C,L,M,D){m.transform(C,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,D)},m.translateTo=function(C,L,M,D,E){m.transform(C,function(){var P=t.apply(this,arguments),z=this.__zoom,F=D==null?S(P):typeof D=="function"?D.apply(this,arguments):D;return n(yl.translate(F[0],F[1]).scale(z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},D,E)};function v(C,L){return L=Math.max(o[0],Math.min(o[1],L)),L===C.k?C:new un(L,C.x,C.y)}function g(C,L,M){var D=L[0]-M[0]*C.k,E=L[1]-M[1]*C.k;return D===C.x&&E===C.y?C:new un(C.k,D,E)}function S(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,L,M,D){C.on("start.zoom",function(){j(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event(D).end()}).tween("zoom",function(){var E=this,P=arguments,z=j(E,P).event(D),F=t.apply(E,P),O=M==null?S(F):typeof M=="function"?M.apply(E,P):M,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),B=E.__zoom,K=typeof L=="function"?L.apply(E,P):L,Y=u(B.invert(O).concat(U/B.k),K.invert(O).concat(U/K.k));return function(G){if(G===1)G=K;else{var V=Y(G),Q=U/V[2];G=new un(Q,O[0]-V[0]*Q,O[1]-V[1]*Q)}z.zoom(null,G)}})}function j(C,L,M){return!M&&C.__zooming||new k(C,L)}function k(C,L){this.that=C,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,L),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,L){return this.mouse&&C!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var L=dt(this.that).datum();c.call(C,this.that,new ZE(C,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),L)}};function _(C,...L){if(!e.apply(this,arguments))return;var M=j(this,L).event(C),D=this.__zoom,E=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),P=_t(C);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=D.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(D.k===E)return;M.mouse=[P,D.invert(P)],ra(this),M.start()}Xs(C),M.wheel=setTimeout(z,y),M.zoom("mouse",n(g(v(D,E),M.mouse[0],M.mouse[1]),M.extent,i));function z(){M.wheel=null,M.end()}}function I(C,...L){if(f||!e.apply(this,arguments))return;var M=C.currentTarget,D=j(this,L,!0).event(C),E=dt(C.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",U,!0),P=_t(C,M),z=C.clientX,F=C.clientY;hy(C.view),fu(C),D.mouse=[P,this.__zoom.invert(P)],ra(this),D.start();function O(B){if(Xs(B),!D.moved){var K=B.clientX-z,Y=B.clientY-F;D.moved=K*K+Y*Y>w}D.event(B).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=_t(B,M),D.mouse[1]),D.extent,i))}function U(B){E.on("mousemove.zoom mouseup.zoom",null),my(B.view,D.moved),Xs(B),D.event(B).end()}}function $(C,...L){if(e.apply(this,arguments)){var M=this.__zoom,D=_t(C.changedTouches?C.changedTouches[0]:C,this),E=M.invert(D),P=M.k*(C.shiftKey?.5:2),z=n(g(v(M,P),D,E),t.apply(this,L),i);Xs(C),a>0?dt(this).transition().duration(a).call(b,z,D,C):dt(this).call(m.transform,z,D,C)}}function R(C,...L){if(e.apply(this,arguments)){var M=C.touches,D=M.length,E=j(this,L,C.changedTouches.length===D).event(C),P,z,F,O;for(fu(C),z=0;z<D;++z)F=M[z],O=_t(F,this),O=[O,this.__zoom.invert(O),F.identifier],E.touch0?!E.touch1&&E.touch0[2]!==O[2]&&(E.touch1=O,E.taps=0):(E.touch0=O,P=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(E.taps<2&&(d=O[0],h=setTimeout(function(){h=null},x)),ra(this),E.start())}}function T(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z,F,O;for(Xs(C),P=0;P<E;++P)z=D[P],F=_t(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=F:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=F);if(z=M.that.__zoom,M.touch1){var U=M.touch0[0],B=M.touch0[1],K=M.touch1[0],Y=M.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,V=(V=Y[0]-B[0])*V+(V=Y[1]-B[1])*V;z=v(z,Math.sqrt(G/V)),F=[(U[0]+K[0])/2,(U[1]+K[1])/2],O=[(B[0]+Y[0])/2,(B[1]+Y[1])/2]}else if(M.touch0)F=M.touch0[0],O=M.touch0[1];else return;M.zoom("touch",n(g(z,F,O),M.extent,i))}}function A(C,...L){if(this.__zooming){var M=j(this,L).event(C),D=C.changedTouches,E=D.length,P,z;for(fu(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),P=0;P<E;++P)z=D[P],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.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&&(z=_t(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<N)){var F=dt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:_i(+C),m):r},m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:_i(!!C),m):e},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:_i(!!C),m):s},m.extent=function(C){return arguments.length?(t=typeof C=="function"?C:_i([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),m):t},m.scaleExtent=function(C){return arguments.length?(o[0]=+C[0],o[1]=+C[1],m):[o[0],o[1]]},m.translateExtent=function(C){return arguments.length?(i[0][0]=+C[0][0],i[1][0]=+C[1][0],i[0][1]=+C[0][1],i[1][1]=+C[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(C){return arguments.length?(n=C,m):n},m.duration=function(C){return arguments.length?(a=+C,m):a},m.interpolate=function(C){return arguments.length?(u=C,m):u},m.on=function(){var C=c.on.apply(c,arguments);return C===c?m:C},m.clickDistance=function(C){return arguments.length?(w=(C=+C)*C,m):Math.sqrt(w)},m.tapDistance=function(C){return arguments.length?(N=+C,m):N},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 ps;(function(e){e.Strict="strict",e.Loose="loose"})(ps||(ps={}));var cr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(cr||(cr={}));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 Fa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fa||(Fa={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const pm={[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,s_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),of=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zo=(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}},o_=(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):of(s)?s:t.nodeLookup.get(s.id));const a=i?Ha(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wl(n)},Jo=(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=vl(n,Ha(s)),r=!0)}),r?wl(n):{x:0,y:0,width:0,height:0}},af=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const a={...ti(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(a,xs(c)),N=(x??0)*(y??0),m=o&&w>0;(!c.internals.handleBounds||m||w>=N||c.dragging)&&u.push(c)}return u},i_=(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 l_({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const a=a_(e,i),u=Jo(a),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),a=i.parentId?n.get(i.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!a)o==null||o("005",Jt.error005());else{const x=a.measured.width,y=a.measured.height;x&&y&&(d=[[u,c],[u+x,c+y]])}else a&&ys(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=ys(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 u_({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 a=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=i_(i,u);for(const f of u)a.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 gs=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),wr=(e={x:0,y:0},t,n)=>({x:gs(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gs(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 gm=(e,t,n)=>e<t?gs(Math.abs(e-t),1,t)/t:e>n?-gs(Math.abs(e-n),1,t)/t:0,$y=(e,t,n=15,r=40)=>{const s=gm(e.x,r,t.width-r)*n,o=gm(e.y,r,t.height-r)*n;return[s,o]},vl=(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)}),Lc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),wl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xs=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(e)?e.internals.positionAbsolute:Zo(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}},Ha=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=of(e)?e.internals.positionAbsolute:Zo(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)=>wl(vl(Lc(e),Lc(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)},xm=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),c_=(e,t)=>{},ei=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ti=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const a={x:(e-n)/s,y:(t-r)/s};return o?ei(a,i):a},Va=({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 d_(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 f_(e,t,n,r,s,o){const{x:i,y:a}=Va(e,[t,n,r]),{x:u,y:c}=Va({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(a),right:Math.floor(h),bottom:Math.floor(d)}}const lf=(e,t,n,r,s,o)=>{const i=d_(o,t,n),a=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(a,u),h=gs(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=f_(e,x,y,h,t,n),N={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-N.left+N.right,y:y-N.top+N.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 ys(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 a=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function ym(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function h_(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function m_(e){return{...Ry,...e||{}}}function ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rt(e),a=ti({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:u,y:c}=n?ei(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const uf=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)},p_=["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:p_.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)}},vm=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const a=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...uf(i)}})};function Wy({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:a}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function Pi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function wm({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case X.Left:return[t-Pi(t-r,o),n];case X.Right:return[t+Pi(r-t,o),n];case X.Top:return[t,n-Pi(n-s,o)];case X.Bottom:return[t,n+Pi(s-n,o)]}}function Ky({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,curvature:i=.25}){const[a,u]=wm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=wm({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:a,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${a},${u} ${c},${h} ${r},${s}`,d,f,x,y]}function Yy({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,a=r<t?r+i:r-i;return[o,a,s,i]}function g_({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,a=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+a}function x_({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=vl(Ha(e),Ha(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,wl(o))>0}const y_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,v_=(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)),w_=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||y_;let s;return Ay(e)?s={...e}:s={...e,id:r(e)},v_(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Gy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,a]=Yy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,a]}const Nm={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},N_=({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},Sm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function S_({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:s,offset:o,stepPosition:i}){const a=Nm[t],u=Nm[r],c={x:e.x+a.x*o,y:e.y+a.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},d=N_({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let y=[],w,N;const m={x:0,y:0},v={x:0,y:0},[,,g,S]=Yy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*u[f]===-1){f==="x"?(w=s.x??c.x+(h.x-c.x)*i,N=s.y??(c.y+h.y)/2):(w=s.x??(c.x+h.x)/2,N=s.y??c.y+(h.y-c.y)*i);const j=[{x:w,y:c.y},{x:w,y:h.y}],k=[{x:c.x,y:N},{x:h.x,y:N}];a[f]===x?y=f==="x"?j:k:y=f==="x"?k:j}else{const j=[{x:c.x,y:h.y}],k=[{x:h.x,y:c.y}];if(f==="x"?y=a.x===x?k:j:y=a.y===x?j:k,t===r){const T=Math.abs(e[f]-n[f]);if(T<=o){const A=Math.min(o-1,o-T);a[f]===x?m[f]=(c[f]>e[f]?-1:1)*A:v[f]=(h[f]>n[f]?-1:1)*A}}if(t!==r){const T=f==="x"?"y":"x",A=a[f]===u[T],C=c[T]>h[T],L=c[T]<h[T];(a[f]===1&&(!A&&C||A&&L)||a[f]!==1&&(!A&&L||A&&C))&&(y=f==="x"?j:k)}const _={x:c.x+m.x,y:c.y+m.y},I={x:h.x+v.x,y:h.y+v.y},$=Math.max(Math.abs(_.x-y[0].x),Math.abs(I.x-y[0].x)),R=Math.max(Math.abs(_.y-y[0].y),Math.abs(I.y-y[0].y));$>=R?(w=(_.x+I.x)/2,N=y[0].y):(w=y[0].x,N=(_.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,N,g,S]}function b_(e,t,n,r){const s=Math.min(Sm(e,t)/2,Sm(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 a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*a},${i}`}function Ac({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,borderRadius:i=5,centerX:a,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,x,y,w]=S_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:a,y:u},offset:c,stepPosition:h});return[d.reduce((m,v,g)=>{let S="";return g>0&&g<d.length-1?S=b_(d[g-1],v,d[g+1],i):S=`${g===0?"M":"L"}${v.x} ${v.y}`,m+=S,m},""),f,x,y,w]}function bm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function k_(e){var d;const{sourceNode:t,targetNode:n}=e;if(!bm(t)||!bm(n))return null;const r=t.internals.handleBounds||km(t.handles),s=n.internals.handleBounds||km(n.handles),o=jm((r==null?void 0:r.source)??[],e.sourceHandle),i=jm(e.connectionMode===ps.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 a=(o==null?void 0:o.position)||X.Bottom,u=(i==null?void 0:i.position)||X.Top,c=Nr(t,o,a),h=Nr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:a,targetPosition:u}}function km(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:a}=t??vn(e);if(r)return{x:s+i/2,y:o+a/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+a/2};case X.Bottom:return{x:s+i/2,y:o+a};case X.Left:return{x:s,y:o+a/2}}}function jm(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function zc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function j_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,a)=>([a.markerStart||r,a.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const c=zc(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,a)=>i.id.localeCompare(a.id))}const Xy=1e3,C_=10,cf={nodeOrigin:[0,0],nodeExtent:Do,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},E_={...cf,checkEquality:!0};function df(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function __(e,t,n){const r=df(cf,n);for(const s of e.values())if(s.parentId)hf(s,e,t,r);else{const o=Zo(s,r.nodeOrigin),i=ys(s.extent)?s.extent:r.nodeExtent,a=wr(o,i,vn(s));s.internals.positionAbsolute=a}}function P_(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 ff(e){return e==="manual"}function Dc(e,t,n,r={}){var c,h;const s=df(E_,r),o={i:0},i=new Map(t),a=s!=null&&s.elevateNodesOnSelect&&!ff(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=Zo(d,s.nodeOrigin),y=ys(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:P_(d,f),z:Qy(d,a,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&&hf(f,t,n,r,o)}return u}function M_(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 hf(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:a,zIndexMode:u}=df(cf,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}M_(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*C_),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!ff(u)?Xy:0,{x:f,y:x,z:y}=I_(e,h,i,a,d,u),{positionAbsolute:w}=e.internals,N=f!==w.x||x!==w.y;(N||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:f,y:x}:w,z:y}})}function Qy(e,t,n){const r=It(e.zIndex)?e.zIndex:0;return ff(n)?r:r+(e.selected?t:0)}function I_(e,t,n,r,s,o){const{x:i,y:a}=t.internals.positionAbsolute,u=vn(e),c=Zo(e,n),h=ys(e.extent)?wr(c,e.extent,u):c;let d=wr({x:i+h.x,y:a+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 mf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const a of e){const u=t.get(a.parentId);if(!u)continue;const c=((i=o.get(a.parentId))==null?void 0:i.expandedRect)??xs(u),h=Oy(c,a.rect);o.set(a.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:a,parent:u},c)=>{var g;const h=u.internals.positionAbsolute,d=vn(u),f=u.origin??r,x=a.x<h.x?Math.round(Math.abs(h.x-a.x)):0,y=a.y<h.y?Math.round(Math.abs(h.y-a.y)):0,w=Math.max(d.width,Math.round(a.width)),N=Math.max(d.height,Math.round(a.height)),m=(w-d.width)*f[0],v=(N-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(S=>{e.some(b=>b.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+x,y:S.position.y+y}})})),(d.width<a.width||d.height<a.height||x||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?f[0]*x-m:0),height:N+(y?f[1]*y-v:0)}})}),s}function R_(e,t,n,r,s,o,i){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!a)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(a),{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=uf(x.nodeElement),N=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(N||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=ys(y.extent)?y.extent:o;let{positionAbsolute:S}=y.internals;y.parentId&&y.extent==="parent"?S=Dy(S,w,t.get(y.parentId)):g&&(S=wr(S,g,w));const b={...y,measured:w,internals:{...y.internals,positionAbsolute:S,handleBounds:{source:vm("source",x.nodeElement,v,d,y.id),target:vm("target",x.nodeElement,v,d,y.id)}}};t.set(y.id,b),y.parentId&&hf(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,N&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:xs(b,s)}))}}if(f.length>0){const x=mf(f,t,n,s);c.push(...x)}return{changes:c,updatedInternals:u}}async function T_({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),a=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(a)}function Cm(e,t,n,r,s,o){let i=s;const a=r.get(i)||new Map;r.set(i,a.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:a=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:a},c=`${s}-${i}--${o}-${a}`,h=`${o}-${a}--${s}-${i}`;Cm("source",u,h,e,s,i),Cm("target",u,c,e,o,a),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 Em(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 L_(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 a=e.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function hu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,a,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=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function A_({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=ei(o,t);return{x:i.x-o.x,y:i.y-o.y}}function z_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,a=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,w=null;function N({noDragClassName:v,handleSelector:g,domNode:S,isSelectable:b,nodeId:j,nodeClickDistance:k=0}){f=dt(S);function _({x:T,y:A}){const{nodeLookup:C,nodeExtent:L,snapGrid:M,snapToGrid:D,nodeOrigin:E,onNodeDrag:P,onSelectionDrag:z,onError:F,updateNodePositions:O}=t();o={x:T,y:A};let U=!1;const B=a.size>1,K=B&&L?Lc(Jo(a)):null,Y=B&&D?A_({dragItems:a,snapGrid:M,x:T,y:A}):null;for(const[G,V]of a){if(!C.has(G))continue;let Q={x:T-V.distance.x,y:A-V.distance.y};D&&(Q=Y?{x:Math.round(Q.x+Y.x),y:Math.round(Q.y+Y.y)}:ei(Q,M));let se=null;if(B&&L&&!V.extent&&K){const{positionAbsolute:q}=V.internals,ue=q.x-K.x+L[0][0],he=q.x+V.measured.width-K.x2+L[1][0],le=q.y-K.y+L[0][1],Be=q.y+V.measured.height-K.y2+L[1][1];se=[[ue,le],[he,Be]]}const{position:te,positionAbsolute:ee}=zy({nodeId:G,nextPosition:Q,nodeLookup:C,nodeExtent:se||L,nodeOrigin:E,onError:F});U=U||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=ee}if(y=y||U,!!U&&(O(a,!0),w&&(r||P||!j&&z))){const[G,V]=hu({nodeId:j,dragItems:a,nodeLookup:C});r==null||r(w,a,G,V),P==null||P(w,G,V),j||z==null||z(w,V)}}async function I(){if(!h)return;const{transform:T,panBy:A,autoPanSpeed:C,autoPanOnNodeDrag:L}=t();if(!L){u=!1,cancelAnimationFrame(i);return}const[M,D]=$y(c,h,C);(M!==0||D!==0)&&(o.x=(o.x??0)-M/T[2],o.y=(o.y??0)-D/T[2],await A({x:M,y:D})&&_(o)),i=requestAnimationFrame(I)}function $(T){var B;const{nodeLookup:A,multiSelectionActive:C,nodesDraggable:L,transform:M,snapGrid:D,snapToGrid:E,selectNodesOnDrag:P,onNodeDragStart:z,onSelectionDragStart:F,unselectNodesAndEdges:O}=t();d=!0,(!P||!b)&&!C&&j&&((B=A.get(j))!=null&&B.selected||O()),b&&P&&j&&(e==null||e(j));const U=ho(T.sourceEvent,{transform:M,snapGrid:D,snapToGrid:E,containerBounds:h});if(o=U,a=L_(A,L,U,j),a.size>0&&(n||z||!j&&F)){const[K,Y]=hu({nodeId:j,dragItems:a,nodeLookup:A});n==null||n(T.sourceEvent,a,K,Y),z==null||z(T.sourceEvent,K,Y),j||F==null||F(T.sourceEvent,Y)}}const R=py().clickDistance(k).on("start",T=>{const{domNode:A,nodeDragThreshold:C,transform:L,snapGrid:M,snapToGrid:D}=t();h=(A==null?void 0:A.getBoundingClientRect())||null,x=!1,y=!1,w=T.sourceEvent,C===0&&$(T),o=ho(T.sourceEvent,{transform:L,snapGrid:M,snapToGrid:D,containerBounds:h}),c=Rt(T.sourceEvent,h)}).on("drag",T=>{const{autoPanOnNodeDrag:A,transform:C,snapGrid:L,snapToGrid:M,nodeDragThreshold:D,nodeLookup:E}=t(),P=ho(T.sourceEvent,{transform:C,snapGrid:L,snapToGrid:M,containerBounds:h});if(w=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||j&&!E.has(j))&&(x=!0),!x){if(!u&&A&&d&&(u=!0,I()),!d){const z=Rt(T.sourceEvent,h),F=z.x-c.x,O=z.y-c.y;Math.sqrt(F*F+O*O)>D&&$(T)}(o.x!==P.xSnapped||o.y!==P.ySnapped)&&a&&d&&(c=Rt(T.sourceEvent,h),_(P))}}).on("end",T=>{if(!(!d||x)&&(u=!1,d=!1,cancelAnimationFrame(i),a.size>0)){const{nodeLookup:A,updateNodePositions:C,onNodeDragStop:L,onSelectionDragStop:M}=t();if(y&&(C(a,!1),y=!1),s||L||!j&&M){const[D,E]=hu({nodeId:j,dragItems:a,nodeLookup:A,dragging:!1});s==null||s(T.sourceEvent,a,D,E),L==null||L(T.sourceEvent,D,E),j||M==null||M(T.sourceEvent,E)}}}).filter(T=>{const A=T.target;return!T.button&&(!v||!Em(A,`.${v}`,S))&&(!g||Em(A,g,S))});f.call(R)}function m(){f==null||f.on(".drag",null)}return{update:N,destroy:m}}function D_(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,xs(o))>0&&r.push(o);return r}const $_=250;function O_(e,t,n,r){var a,u;let s=[],o=1/0;const i=D_(e,n,t+$_);for(const c of i){const h=[...((a=c.internals.handleBounds)==null?void 0:a.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 a=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?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[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 F_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const t0=()=>!0;function H_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:N,isValidConnection:m=t0,onReconnectEnd:v,updateConnection:g,getTransform:S,getFromHandle:b,autoPanSpeed:j,dragThreshold:k=1,handleDomNode:_}){const I=Vy(e.target);let $=0,R;const{x:T,y:A}=Rt(e),C=e0(o,_),L=a==null?void 0:a.getBoundingClientRect();let M=!1;if(!L||!C)return;const D=Jy(s,C,r,u,t);if(!D)return;let E=Rt(e,L),P=!1,z=null,F=!1,O=null;function U(){if(!h||!L)return;const[te,ee]=$y(E,L,j);f({x:te,y:ee}),$=requestAnimationFrame(U)}const B={...D,nodeId:s,type:C,position:D.position},K=u.get(s);let G={inProgress:!0,isValid:null,from:Nr(K,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:K,to:E,toHandle:null,toPosition:pm[B.position],toNode:null,pointer:E};function V(){M=!0,g(G),y==null||y(e,{nodeId:s,handleId:r,handleType:C})}k===0&&V();function Q(te){if(!M){const{x:Be,y:wn}=Rt(te),tn=Be-T,Zn=wn-A;if(!(tn*tn+Zn*Zn>k*k))return;V()}if(!b()||!B){se(te);return}const ee=S();E=Rt(te,L),R=O_(ti(E,ee,!1,[1,1]),n,u,B),P||(U(),P=!0);const q=n0(te,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:m,doc:I,lib:c,flowId:d,nodeLookup:u});O=q.handleDomNode,z=q.connection,F=F_(!!R,q.isValid);const ue=u.get(s),he=ue?Nr(ue,B,X.Left,!0):G.from,le={...G,from:he,isValid:F,to:q.toHandle&&F?Va({x:q.toHandle.x,y:q.toHandle.y},ee):E,toHandle:q.toHandle,toPosition:F&&q.toHandle?q.toHandle.position:pm[B.position],toNode:q.toHandle?u.get(q.toHandle.nodeId):null,pointer:E};g(le),G=le}function se(te){if(!("touches"in te&&te.touches.length>0)){if(M){(R||O)&&z&&F&&(w==null||w(z));const{inProgress:ee,...q}=G,ue={...q,toPosition:G.toHandle?G.toPosition:null};N==null||N(te,ue),o&&(v==null||v(te,ue))}x(),cancelAnimationFrame($),P=!1,F=!1,z=null,O=null,I.removeEventListener("mousemove",Q),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",Q),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",Q),I.addEventListener("mouseup",se),I.addEventListener("touchmove",Q),I.addEventListener("touchend",se)}function n0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:a,flowId:u,isValidConnection:c=t0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${a}-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),N=w!=null&&w.classList.contains(`${a}-flow__handle`)?w:f,m={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const v=e0(void 0,N),g=N.getAttribute("data-nodeid"),S=N.getAttribute("data-handleid"),b=N.classList.contains("connectable"),j=N.classList.contains("connectableend");if(!g||!v)return m;const k={source:d?g:r,sourceHandle:d?S:s,target:d?r:g,targetHandle:d?s:S};m.connection=k;const I=b&&j&&(n===ps.Strict?d&&v==="source"||!d&&v==="target":g!==r||S!==s);m.isValid=I&&c(k),m.toHandle=Jy(g,v,S,h,n,!0)}return m}const $c={onPointerDown:H_,isValid:n0};function V_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=dt(e);function o({translateExtent:a,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 S=n(),b=g.sourceEvent.ctrlKey&&Fo()?10:1,j=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,k=S[2]*Math.pow(2,j*b);t.scaleTo(k)};let w=[0,0];const N=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 S=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],j=[b[0]-w[0],b[1]-w[1]];w=b;const k=r()*Math.max(S[2],Math.log(S[2]))*(x?-1:1),_={x:S[0]-j[0]*k,y:S[1]-j[1]*k},I=[[0,0],[u,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:S[2]},I,a)},v=My().on("start",N).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 Nl=e=>({x:e.x,y:e.y,zoom:e.k}),mu=({x:e,y:t,zoom:n})=>yl.translate(e,t).scale(n),Kr=(e,t)=>e.target.closest(`.${t}`),r0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),B_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,pu=(e,t=0,n=B_,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 U_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Kr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&i){const N=_t(h),m=s0(h),v=d*Math.pow(2,m);r.scaleTo(n,v,N,h);return}const f=h.deltaMode===1?20:1;let x=s===cr.Vertical?0:h.deltaX*f,y=s===cr.Horizontal?0:h.deltaY*f;!Fo()&&h.shiftKey&&s!==cr.Vertical&&(x=h.deltaY*f,y=0),r.translateBy(n,-(x/d)*o,-(y/d)*o,{internal:!0});const w=Nl(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,a==null||a(h,w))}}function W_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,a=Kr(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),i||a)return null;r.preventDefault(),n.call(this,r,s)}}function K_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,a;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Nl(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Y_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,a;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&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,Nl(o.transform)))}}function G_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var a;if(!((a=i.sourceEvent)!=null&&a.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=Nl(i.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,u)},n?150:0)}}}function X_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var N;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Kr(d,`${c}-flow__node`)||Kr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!y||Kr(d,a)&&y||Kr(d,u)&&(!y||s&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((N=d.touches)==null?void 0:N.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:a,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=dt(e).call(d);v({x:s.x,y:s.y,zoom:gs(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(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).transform(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function N({noWheelClassName:R,noPanClassName:T,onPaneContextMenu:A,userSelectionActive:C,panOnScroll:L,panOnDrag:M,panOnScrollMode:D,panOnScrollSpeed:E,preventScrolling:P,zoomOnPinch:z,zoomOnScroll:F,zoomOnDoubleClick:O,zoomActivationKeyPressed:U,lib:B,onTransformChange:K,connectionInProgress:Y,paneClickDistance:G,selectionOnDrag:V}){C&&!c.isZoomingOrPanning&&m();const Q=L&&!U&&!C;d.clickDistance(V?1/0:!It(G)||G<0?0:G);const se=Q?U_({zoomPanValues:c,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:D,panOnScrollSpeed:E,zoomOnPinch:z,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:a}):W_({noWheelClassName:R,preventScrolling:P,d3ZoomHandler:x});if(f.on("wheel.zoom",se,{passive:!1}),!C){const ee=K_({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",ee);const q=Y_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!A,onPanZoom:o,onTransformChange:K});d.on("zoom",q);const ue=G_({zoomPanValues:c,panOnDrag:M,panOnScroll:L,onPaneContextMenu:A,onPanZoomEnd:a,onDraggingChange:u});d.on("end",ue)}const te=X_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:O,zoomOnPinch:z,userSelectionActive:C,noPanClassName:T,noWheelClassName:R,lib:B,connectionInProgress:Y});d.filter(te),O?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function v(R,T,A){const C=mu(R),L=d==null?void 0:d.constrain()(C,T,A);return L&&await w(L),new Promise(M=>M(L))}async function g(R,T){const A=mu(R);return await w(A,T),new Promise(C=>C(A))}function S(R){if(f){const T=mu(R),A=f.property("__zoom");(A.k!==R.zoom||A.x!==R.x||A.y!==R.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function b(){const R=f?Py(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function j(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleTo(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function k(R,T){return f?new Promise(A=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?fo:ea).scaleBy(pu(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>A(!0)),R)}):Promise.resolve(!1)}function _(R){d==null||d.scaleExtent(R)}function I(R){d==null||d.translateExtent(R)}function $(R){const T=!It(R)||R<0?0:R;d==null||d.clickDistance(T)}return{update:N,destroy:m,setViewport:g,setViewportConstrained:v,getViewport:b,scaleTo:j,scaleBy:k,setScaleExtent:_,setTranslateExtent:I,syncViewport:S,setClickDistance:$}}var vs;(function(e){e.Line="line",e.Handle="handle"})(vs||(vs={}));function q_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,a=n-r,u=[i>0?1:i<0?-1:0,a>0?1:a<0?-1:0];return i&&s&&(u[0]=u[0]*-1),a&&o&&(u[1]=u[1]*-1),u}function _m(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 Mi(e,t,n){return Math.max(0,t-e,e-n)}function Pm(e,t){return e?!t:t}function Z_(e,t,n,r,s,o,i,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:N,minHeight:m,maxHeight:v}=r,{x:g,y:S,width:b,height:j,aspectRatio:k}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const $=b+(u?-_:_),R=j+(c?-I:I),T=-o[0]*b,A=-o[1]*j;let C=Mi($,w,N),L=Mi(R,m,v);if(i){let E=0,P=0;u&&_<0?E=kn(g+_+T,i[0][0]):!u&&_>0&&(E=jn(g+$+T,i[1][0])),c&&I<0?P=kn(S+I+A,i[0][1]):!c&&I>0&&(P=jn(S+R+A,i[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(a){let E=0,P=0;u&&_>0?E=jn(g+_,a[0][0]):!u&&_<0&&(E=kn(g+$,a[1][0])),c&&I>0?P=jn(S+I,a[0][1]):!c&&I<0&&(P=kn(S+R,a[1][1])),C=Math.max(C,E),L=Math.max(L,P)}if(s){if(h){const E=Mi($/k,m,v)*k;if(C=Math.max(C,E),i){let P=0;!u&&!c||u&&!c&&f?P=jn(S+A+$/k,i[1][1])*k:P=kn(S+A+(u?_:-_)/k,i[0][1])*k,C=Math.max(C,P)}if(a){let P=0;!u&&!c||u&&!c&&f?P=kn(S+$/k,a[1][1])*k:P=jn(S+(u?_:-_)/k,a[0][1])*k,C=Math.max(C,P)}}if(d){const E=Mi(R*k,w,N)/k;if(L=Math.max(L,E),i){let P=0;!u&&!c||c&&!u&&f?P=jn(g+R*k+T,i[1][0])/k:P=kn(g+(c?I:-I)*k+T,i[0][0])/k,L=Math.max(L,P)}if(a){let P=0;!u&&!c||c&&!u&&f?P=kn(g+R*k,a[1][0])/k:P=jn(g+(c?I:-I)*k,a[0][0])/k,L=Math.max(L,P)}}}I=I+(I<0?L:-L),_=_+(_<0?C:-C),s&&(f?$>R*k?I=(Pm(u,c)?-_:_)/k:_=(Pm(u,c)?-I:I)*k:h?(I=_/k,c=u):(_=I*k,u=c));const M=u?g+_:g,D=c?S+I:S;return{width:b+(u?-_:_),height:j+(c?-I:I),x:o[0]*_*(u?-1:1)+M,y:o[1]*I*(c?-1:1)+D}}const o0={width:0,height:0,x:0,y:0},J_={...o0,pointerX:0,pointerY:0,aspectRatio:1};function e3(e){return[[0,0],[e.measured.width,e.measured.height]]}function t3(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,a=n[0]*o,u=n[1]*i;return[[r-a,s-u],[r+o-a,s+i-u]]}function n3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=dt(e);let i={controlDirection:_m("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:N}){let m={...o0},v={...J_};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:_m(c)};let g,S=null,b=[],j,k,_,I=!1;const $=py().on("start",R=>{const{nodeLookup:T,transform:A,snapGrid:C,snapToGrid:L,nodeOrigin:M,paneDomNode:D}=n();if(g=T.get(t),!g)return;S=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:P}=ho(R.sourceEvent,{transform:A,snapGrid:C,snapToGrid:L,containerBounds:S});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:E,pointerY:P,aspectRatio:m.width/m.height},j=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(j=T.get(g.parentId),k=j&&g.extent==="parent"?e3(j):void 0),b=[],_=void 0;for(const[z,F]of T)if(F.parentId===t&&(b.push({id:z,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const O=t3(F,g,F.origin??M);_?_=[[Math.min(O[0][0],_[0][0]),Math.min(O[0][1],_[0][1])],[Math.max(O[1][0],_[1][0]),Math.max(O[1][1],_[1][1])]]:_=O}x==null||x(R,{...m})}).on("drag",R=>{const{transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L}=n(),M=ho(R.sourceEvent,{transform:T,snapGrid:A,snapToGrid:C,containerBounds:S}),D=[];if(!g)return;const{x:E,y:P,width:z,height:F}=m,O={},U=g.origin??L,{width:B,height:K,x:Y,y:G}=Z_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,k,_),V=B!==z,Q=K!==F,se=Y!==E&&V,te=G!==P&&Q;if(!se&&!te&&!V&&!Q)return;if((se||te||U[0]===1||U[1]===1)&&(O.x=se?Y:m.x,O.y=te?G:m.y,m.x=O.x,m.y=O.y,b.length>0)){const he=Y-E,le=G-P;for(const Be of b)Be.position={x:Be.position.x-he+U[0]*(B-z),y:Be.position.y-le+U[1]*(K-F)},D.push(Be)}if((V||Q)&&(O.width=V&&(!i.resizeDirection||i.resizeDirection==="horizontal")?B:m.width,O.height=Q&&(!i.resizeDirection||i.resizeDirection==="vertical")?K:m.height,m.width=O.width,m.height=O.height),j&&g.expandParent){const he=U[0]*(O.width??0);O.x&&O.x<he&&(m.x=he,v.x=v.x-(O.x-he));const le=U[1]*(O.height??0);O.y&&O.y<le&&(m.y=le,v.y=v.y-(O.y-le))}const ee=q_({width:m.width,prevWidth:z,height:m.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),q={...m,direction:ee};(N==null?void 0:N(R,q))!==!1&&(I=!0,y==null||y(R,q),r(O,D))}).on("end",R=>{I&&(w==null||w(R,{...m}),s==null||s({...m}),I=!1)});o.call($)}function u(){o.on(".drag",null)}return{update:a,destroy:u}}var i0={exports:{}},a0={},l0={exports:{}},u0={};/**
322
322
  * @license React
323
323
  * use-sync-external-store-shim.production.js
324
324
  *
@@ -326,7 +326,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
326
326
  *
327
327
  * This source code is licensed under the MIT license found in the
328
328
  * LICENSE file in the root directory of this source tree.
329
- */var ws=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=ws.useState,a3=ws.useEffect,l3=ws.useLayoutEffect,u3=ws.useDebugValue;function c3(e,t){var n=t(),r=i3({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return l3(function(){s.value=n,s.getSnapshot=t,gu(s)&&o({inst:s})},[e,n,t]),a3(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;c0.useSyncExternalStore=ws.useSyncExternalStore!==void 0?ws.useSyncExternalStore:f3;u0.exports=c0;var h3=u0.exports;/**
329
+ */var ws=p;function r3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s3=typeof Object.is=="function"?Object.is:r3,o3=ws.useState,i3=ws.useEffect,a3=ws.useLayoutEffect,l3=ws.useDebugValue;function u3(e,t){var n=t(),r=o3({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]),i3(function(){return gu(s)&&o({inst:s}),e(function(){gu(s)&&o({inst:s})})},[e]),l3(n),n}function gu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!s3(e,n)}catch{return!0}}function c3(e,t){return t()}var d3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c3:u3;u0.useSyncExternalStore=ws.useSyncExternalStore!==void 0?ws.useSyncExternalStore:d3;l0.exports=u0;var f3=l0.exports;/**
330
330
  * @license React
331
331
  * use-sync-external-store-shim/with-selector.production.js
332
332
  *
@@ -334,14 +334,14 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
334
334
  *
335
335
  * This source code is licensed under the MIT license found in the
336
336
  * LICENSE file in the root directory of this source tree.
337
- */var Sl=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=Sl.useRef,v3=Sl.useEffect,w3=Sl.useMemo,N3=Sl.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 a=x3(e,o[0],o[1]);return v3(function(){i.hasValue=!0,i.value=a},[a]),N3(a),a};a0.exports=l0;var S3=a0.exports;const b3=Bc(S3),k3={},Mm=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?Mm(e):Mm,{useDebugValue:C3}=Ut,{useSyncExternalStoreWithSelector:E3}=b3,_3=e=>e;function d0(e,t=_3,n){const r=E3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return C3(r),r}const Im=(e,t)=>{const n=j3(e),r=(s,o=t)=>d0(n,s,o);return Object.assign(r,n),r},P3=(e,t)=>e?Im(e,t):Im;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 bl=p.createContext(null),M3=bl.Provider,f0=Jt.error001();function ie(e,t){const n=p.useContext(bl);if(n===null)throw new Error(f0);return d0(n,e,t)}function we(){const e=p.useContext(bl);if(e===null)throw new Error(f0);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Rm={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%)"},h0="react-flow__node-desc",m0="react-flow__edge-desc",R3="react-flow__aria-live",T3=e=>e.ariaLiveMessage,L3=e=>e.ariaLabelConfig;function A3({rfId:e}){const t=ie(T3);return l.jsx("div",{id:`${R3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:I3,children:t})}function z3({rfId:e,disableKeyboardA11y:t}){const n=ie(L3);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${h0}-${e}`,style:Rm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${m0}-${e}`,style:Rm,children:n["edge.a11yDescription.default"]}),!t&&l.jsx(A3,{rfId:e})]})}const kl=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return l.jsx("div",{className:Ie(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});kl.displayName="Panel";function D3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(kl,{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:l.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}=ie($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=ie(H3);return e||t?l.jsx(F3,{onSelectionChange:e}):null}const p0=[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"],Tm=[...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}),Lm={translateExtent:Do,nodeOrigin:p0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function K3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:a,setDefaultNodesAndEdges:u}=ie(W3,ve),c=we();p.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=Lm,a()}),[]);const h=p.useRef(Lm);return p.useEffect(()=>{for(const d of Tm){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},Tm.map(d=>e[d])),null}function Am(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Y3(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=Am(),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=Am())!=null&&r.matches?"dark":"light"}const zm=typeof document<"u"?document:null;function Ho(e=null,t={target:zm,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),o=p.useRef(new Set([])),[i,a]=p.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
337
+ */var Sl=p,h3=f3;function m3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var p3=typeof Object.is=="function"?Object.is:m3,g3=h3.useSyncExternalStore,x3=Sl.useRef,y3=Sl.useEffect,v3=Sl.useMemo,w3=Sl.useDebugValue;a0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=x3(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=v3(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,p3(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 a=g3(e,o[0],o[1]);return y3(function(){i.hasValue=!0,i.value=a},[a]),w3(a),a};i0.exports=a0;var N3=i0.exports;const S3=Bc(N3),b3={},Mm=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:()=>{(b3?"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},k3=e=>e?Mm(e):Mm,{useDebugValue:j3}=Bt,{useSyncExternalStoreWithSelector:C3}=S3,E3=e=>e;function c0(e,t=E3,n){const r=C3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return j3(r),r}const Im=(e,t)=>{const n=k3(e),r=(s,o=t)=>c0(n,s,o);return Object.assign(r,n),r},_3=(e,t)=>e?Im(e,t):Im;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 bl=p.createContext(null),P3=bl.Provider,d0=Jt.error001();function ie(e,t){const n=p.useContext(bl);if(n===null)throw new Error(d0);return c0(n,e,t)}function we(){const e=p.useContext(bl);if(e===null)throw new Error(d0);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Rm={display:"none"},M3={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",I3="react-flow__aria-live",R3=e=>e.ariaLiveMessage,T3=e=>e.ariaLabelConfig;function L3({rfId:e}){const t=ie(R3);return l.jsx("div",{id:`${I3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:M3,children:t})}function A3({rfId:e,disableKeyboardA11y:t}){const n=ie(T3);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${f0}-${e}`,style:Rm,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${h0}-${e}`,style:Rm,children:n["edge.a11yDescription.default"]}),!t&&l.jsx(L3,{rfId:e})]})}const kl=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return l.jsx("div",{className:Ie(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});kl.displayName="Panel";function z3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(kl,{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:l.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const D3=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}},Ii=e=>e.id;function $3(e,t){return ve(e.selectedNodes.map(Ii),t.selectedNodes.map(Ii))&&ve(e.selectedEdges.map(Ii),t.selectedEdges.map(Ii))}function O3({onSelectionChange:e}){const t=we(),{selectedNodes:n,selectedEdges:r}=ie(D3,$3);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 F3=e=>!!e.onSelectionChangeHandlers;function H3({onSelectionChange:e}){const t=ie(F3);return e||t?l.jsx(O3,{onSelectionChange:e}):null}const m0=[0,0],V3={x:0,y:0,zoom:1},B3=["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"],Tm=[...B3,"rfId"],U3=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}),Lm={translateExtent:Do,nodeOrigin:m0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function W3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:a,setDefaultNodesAndEdges:u}=ie(U3,ve),c=we();p.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=Lm,a()}),[]);const h=p.useRef(Lm);return p.useEffect(()=>{for(const d of Tm){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:m_(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}h.current=e},Tm.map(d=>e[d])),null}function Am(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K3(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=Am(),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=Am())!=null&&r.matches?"dark":"light"}const zm=typeof document<"u"?document:null;function Ho(e=null,t={target:zm,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),o=p.useRef(new Set([])),[i,a]=p.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
338
338
  `).replace(`
339
339
 
340
340
  `,`
341
341
  +`).split(`
342
- `)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return p.useEffect(()=>{const u=(t==null?void 0:t.target)??zm,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var N,m;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!c)&&Uy(x))return!1;const w=$m(x.code,a);if(o.current.add(x[w]),Dm(i,o.current,!1)){const v=((m=(N=x.composedPath)==null?void 0:N.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=$m(x.code,a);Dm(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 Dm(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function $m(e,t){return t.includes(e)?"code":"key"}const G3=()=>{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:a}=e.getState(),u=lf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return a?(await a.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:a,y:u}=i.getBoundingClientRect(),c={x:t.x-a,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=Va(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function g0(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 a={...o};for(const u of i)X3(u,a);n.push(a)}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 g0(e,t)}function q3(e,t){return g0(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function Yr(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 Om({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 a=t.get(i.id),u=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;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 Fm(e){return{id:e.id,type:"remove"}}const Hm=e=>o_(e),Z3=e=>zy(e);function x0(e){return p.forwardRef(e)}const J3=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Vm(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 y0=p.createContext(null);function t4({children:e}){const t=we(),n=p.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const m of a)w=typeof m=="function"?m(w):m;let N=Om({items:w,lookup:f});for(const m of y.values())N=m(N);h&&c(w),N.length>0?d==null||d(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Vm(n),s=p.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=u;for(const y of a)x=typeof y=="function"?y(x):y;h?c(x):d&&d(Om({items:x,lookup:f}))},[]),o=Vm(s),i=p.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return l.jsx(y0.Provider,{value:i,children:e})}function n4(){const e=p.useContext(y0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const r4=e=>!!e.panZoom;function pf(){const e=G3(),t=we(),n=n4(),r=ie(r4),s=p.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},u=d=>{var m,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=Hm(d)?d:f.get(d.id),w=y.parentId?Vy(y.position,y.measured,y.parentId,f,x):y.position,N={...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 xs(N)},c=(d,f,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&Hm(N)?N:{...w,...N}}return w}))},h=(d,f,x={replace:!1})=>{a(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&Z3(N)?N:{...w,...N}}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:a,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,N]=x;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:y,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:S}=t.getState(),{nodes:b,edges:j}=await c_({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:S}),k=j.length>0,_=b.length>0;if(k){const I=j.map(Fm);N==null||N(j),v(I)}if(_){const I=b.map(Fm);w==null||w(b),m(I)}return(_||k)&&(g==null||g({nodes:b,edges:j})),{deletedNodes:b,deletedEdges:j}},getIntersectingNodes:(d,f=!0,x)=>{const y=xm(d),w=y?d:u(d),N=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=xs(N?m:v),S=Oo(g,w);return f&&S>0||S>=g.width*g.height||S>=w.width*w.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const w=xm(d)?d:u(d);if(!w)return!1;const N=Oo(w,f);return x&&N>0||N>=f.width*f.height||N>=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 Bm=e=>e.selected,s4=typeof window<"u"?window:void 0;function o4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:r}=pf(),s=Ho(e,{actInsideInputWithModifier:!1}),o=Ho(t,{target:s4});p.useEffect(()=>{if(s){const{edges:i,nodes:a}=n.getState();r({nodes:a.filter(Bm),edges:i.filter(Bm)}),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,a;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=uf(e.current);(r.height===0||r.width===0)&&((a=(i=t.getState()).onError)==null||a.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 jl={position:"absolute",width:"100%",height:"100%",top:0,left:0},a4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function l4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=dr.Free,zoomOnDoubleClick:i=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:N,onViewportChange:m,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:S}){const b=we(),j=p.useRef(null),{userSelectionActive:k,lib:_,connectionInProgress:I}=ie(a4,ve),$=Ho(f),R=p.useRef();i4(j);const T=p.useCallback(A=>{m==null||m({x:A[0],y:A[1],zoom:A[2]}),v||b.setState({transform:A})},[m,v]);return p.useEffect(()=>{if(j.current){R.current=q_({domNode:j.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:M=>b.setState({paneDragging:M}),onPanZoomStart:(M,D)=>{const{onViewportChangeStart:E,onMoveStart:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoom:(M,D)=>{const{onViewportChange:E,onMove:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoomEnd:(M,D)=>{const{onViewportChangeEnd:E,onMoveEnd:P}=b.getState();P==null||P(M,D),E==null||E(D)}});const{x:A,y:C,zoom:L}=R.current.getViewport();return b.setState({panZoom:R.current,transform:[A,C,L],domNode:j.current.closest(".react-flow")}),()=>{var M;(M=R.current)==null||M.destroy()}}},[]),p.useEffect(()=>{var A;(A=R.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:a,zoomActivationKeyPressed:$,preventScrolling:x,noPanClassName:N,userSelectionActive:k,noWheelClassName:w,lib:_,onTransformChange:T,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:g})},[e,t,n,r,s,o,i,a,$,x,N,k,w,_,T,I,S,g]),l.jsx("div",{className:"react-flow__renderer",ref:j,style:jl,children:y})}const u4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function c4(){const{userSelectionActive:e,userSelectionRect:t}=ie(u4,ve);return e&&t?l.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:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const w=we(),{userSelectionActive:N,elementsSelectable:m,dragging:v,connectionInProgress:g}=ie(d4,ve),S=m&&(e||N),b=p.useRef(null),j=p.useRef(),k=p.useRef(new Set),_=p.useRef(new Set),I=p.useRef(!1),$=E=>{if(I.current||g){I.current=!1;return}u==null||u(E),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},T=h?E=>h(E):void 0,A=E=>{I.current&&(E.stopPropagation(),I.current=!1)},C=E=>{var K,Y;const{domNode:P}=w.getState();if(j.current=P==null?void 0:P.getBoundingClientRect(),!j.current)return;const z=E.target===b.current;if(!z&&!!E.target.closest(".nokey")||!e||!(o&&z||t)||E.button!==0||!E.isPrimary)return;(Y=(K=E.target)==null?void 0:K.setPointerCapture)==null||Y.call(K,E.pointerId),I.current=!1;const{x:U,y:B}=Rt(E.nativeEvent,j.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:B,x:U,y:B}}),z||(E.stopPropagation(),E.preventDefault())},L=E=>{const{userSelectionRect:P,transform:z,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:B,triggerEdgeChanges:K,defaultEdgeOptions:Y,resetSelectedElements:G}=w.getState();if(!j.current||!P)return;const{x:V,y:q}=Rt(E.nativeEvent,j.current),{startX:re,startY:te}=P;if(!I.current){const le=t?0:s;if(Math.hypot(V-re,q-te)<=le)return;G(),i==null||i(E)}I.current=!0;const ee={startX:re,startY:te,x:V<re?V:re,y:q<te?q:te,width:Math.abs(V-re),height:Math.abs(q-te)},Z=k.current,ue=_.current;k.current=new Set(af(F,ee,z,n===$o.Partial,!0).map(le=>le.id)),_.current=new Set;const he=(Y==null?void 0:Y.selectable)??!0;for(const le of k.current){const Be=U.get(le);if(Be)for(const{edgeId:wn}of Be.values()){const tn=O.get(wn);tn&&(tn.selectable??he)&&_.current.add(wn)}}if(!ym(Z,k.current)){const le=Yr(F,k.current,!0);B(le)}if(!ym(ue,_.current)){const le=Yr(O,_.current);K(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var P,z;E.button===0&&((z=(P=E.target)==null?void 0:P.releasePointerCapture)==null||z.call(P,E.pointerId),!N&&E.target===b.current&&w.getState().userSelectionRect&&($==null||$(E)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(E),w.setState({nodesSelectionActive:k.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:Ie(["react-flow__pane",{draggable:D,dragging:v,selection:e}]),onClick:S?void 0:xu($,b),onContextMenu:xu(R,b),onWheel:xu(T,b),onPointerEnter:S?void 0:d,onPointerMove:S?L:f,onPointerUp:S?M:void 0,onPointerDownCapture:S?C:void 0,onClickCapture:S?A:void 0,onPointerLeave:x,ref:b,style:jl,children:[y,l.jsx(c4,{})]})}function Oc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:a,onError:u}=t.getState(),c=a.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 v0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const a=we(),[u,c]=p.useState(!1),h=p.useRef();return p.useEffect(()=>{h.current=D_({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{Oc({id:d,store:a,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 w0(){const e=we();return p.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:a,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,N=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+N};s&&(v=Jo(v,o));const{position:g,positionAbsolute:S}=Dy({nodeId:m.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:a});m.position=g,m.internals.positionAbsolute=S,d.set(m.id,m)}u(d)},[])}const gf=p.createContext(null),m4=gf.Provider;gf.Consumer;const N0=()=>p.useContext(gf),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:a,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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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===ps.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,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:a,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},x){var L,M;const y=i||null,w=e==="target",N=we(),m=N0(),{connectOnClick:v,noPanClassName:g,rfId:S}=ie(p4,ve),{connectingFrom:b,connectingTo:j,clickConnecting:k,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(g4(m,y,e),ve);m||(M=(L=N.getState()).onError)==null||M.call(L,"010",Jt.error010());const T=D=>{const{defaultEdgeOptions:E,onConnect:P,hasDefaultEdges:z}=N.getState(),F={...E,...D};if(z){const{edges:O,setEdges:U}=N.getState();U(N_(F,O))}P==null||P(F),a==null||a(F)},A=D=>{if(!m)return;const E=Wy(D.nativeEvent);if(s&&(E&&D.button===0||!E)){const P=N.getState();$c.onPointerDown(D.nativeEvent,{handleDomNode:D.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:T,isValidConnection:n||P.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}E?h==null||h(D):d==null||d(D)},C=D=>{const{onClickConnectStart:E,onClickConnectEnd:P,connectionClickStartHandle:z,connectionMode:F,isValidConnection:O,lib:U,rfId:B,nodeLookup:K,connection:Y}=N.getState();if(!m||!z&&!s)return;if(!z){E==null||E(D.nativeEvent,{nodeId:m,handleId:y,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const G=By(D.target),V=n||O,{connection:q,isValid:re}=$c.isValid(D.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:F,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:V,flowId:B,doc:G,lib:U,nodeLookup:K});re&&q&&T(q);const te=structuredClone(Y);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,P==null||P(D,te),N.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${S}-${m}-${y}-${e}`,className:Ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:b,connectingto:j,valid:R,connectionindicator:r&&(!I||_)&&(I||$?o:s)}]),onMouseDown:A,onTouchStart:A,onClick:v?C:void 0,ref:x,...f,children:u})}const Ba=p.memo(x0(x4));function y4({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(Ba,{type:"source",position:n,isConnectable:t})]})}function v4({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(Ba,{type:"source",position:r,isConnectable:t})]})}function w4(){return null}function N4({data:e,isConnectable:t,targetPosition:n=X.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ua={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Um={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:a}=ie(b4,ve),u=w0(),c=p.useRef(null);if(p.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),v0({nodeRef:c}),a||!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(Ua,f.key)&&(f.preventDefault(),u({direction:Ua[f.key],factor:f.shiftKey?4:1}))};return l.jsx("div",{className:Ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:l.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 Wm=typeof window<"u"?window:void 0,j4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function S0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:_,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:A,onSelectionContextMenu:C,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:E,isControlledViewport:P}){const{nodesSelectionActive:z,userSelectionActive:F}=ie(j4,ve),O=Ho(c,{target:Wm}),U=Ho(w,{target:Wm}),B=U||_,K=U||S,Y=h&&B!==!0,G=O||F||Y;return o4({deleteKeyCode:u,multiSelectionKeyCode:y}),l.jsx(l4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:K,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:!O&&B,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:A,noWheelClassName:L,noPanClassName:M,onViewportChange:E,isControlledViewport:P,paneClickDistance:a,selectionOnDrag:Y,children:l.jsxs(f4,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:B,isSelecting:!!G,selectionMode:d,selectionKeyPressed:O,paneClickDistance:a,selectionOnDrag:Y,children:[e,z&&l.jsx(k4,{onSelectionContextMenu:C,noPanClassName:M,disableKeyboardA11y:D})]})})}S0.displayName="FlowRenderer";const C4=p.memo(S0),E4=e=>t=>e?af(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 ie(p.useCallback(E4(e),[e]),ve)}const P4=e=>e.updateNodeInternals;function M4(){const e=ie(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),a=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=a.current!==e.sourcePosition,x=u.current!==e.targetPosition;(d||f||x)&&(c.current=t,a.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:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:N,nodeClickDistance:m,onError:v}){const{node:g,internals:S,isParent:b}=ie(V=>{const q=V.nodeLookup.get(e),re=V.parentLookup.has(e);return{node:q,internals:q.internals,isParent:re}},ve);let j=g.type||"default",k=(N==null?void 0:N[j])||Um[j];k===void 0&&(v==null||v("003",Jt.error003(j)),j="default",k=(N==null?void 0:N.default)||Um.default);const _=!!(g.draggable||a&&typeof g.draggable>"u"),I=!!(g.selectable||u&&typeof g.selectable>"u"),$=!!(g.connectable||c&&typeof g.connectable>"u"),R=!!(g.focusable||h&&typeof g.focusable>"u"),T=we(),A=Hy(g),C=I4({node:g,nodeType:j,hasDimensions:A,resizeObserver:d}),L=v0({nodeRef:C,disabled:g.hidden||!_,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),M=w0();if(g.hidden)return null;const D=vn(g),E=S4(g),P=I||_||t||n||r||s,z=n?V=>n(V,{...S.userNode}):void 0,F=r?V=>r(V,{...S.userNode}):void 0,O=s?V=>s(V,{...S.userNode}):void 0,U=o?V=>o(V,{...S.userNode}):void 0,B=i?V=>i(V,{...S.userNode}):void 0,K=V=>{const{selectNodesOnDrag:q,nodeDragThreshold:re}=T.getState();I&&(!q||!_||re>0)&&Oc({id:e,store:T,nodeRef:C}),t&&t(V,{...S.userNode})},Y=V=>{if(!(Uy(V.nativeEvent)||y)){if(Ry.includes(V.key)&&I){const q=V.key==="Escape";Oc({id:e,store:T,unselect:q,nodeRef:C})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Ua,V.key)){V.preventDefault();const{ariaLabelConfig:q}=T.getState();T.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),M({direction:Ua[V.key],factor:V.shiftKey?4:1})}}},G=()=>{var ue;if(y||!((ue=C.current)!=null&&ue.matches(":focus-visible")))return;const{transform:V,width:q,height:re,autoPanOnNodeFocus:te,setCenter:ee}=T.getState();if(!te)return;af(new Map([[e,g]]),{x:0,y:0,width:q,height:re},V,!0).length>0||ee(g.position.x+D.width/2,g.position.y+D.height/2,{zoom:V[2]})};return l.jsx("div",{className:Ie(["react-flow__node",`react-flow__node-${j}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:b,draggable:_,dragging:L}]),ref:C,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:A?"visible":"hidden",...g.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:K,onDoubleClick:B,onKeyDown:R?Y:void 0,tabIndex:R?0:void 0,onFocus:R?G:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${h0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:l.jsx(m4,{value:e,children:l.jsx(k,{id:e,data:g.data,type:j,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:$,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:L,dragHandle:g.dragHandle,zIndex:S.z,parentId:g.parentId,...D})})})}var T4=p.memo(R4);const L4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function b0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=ie(L4,ve),i=_4(e.onlyRenderVisibleElements),a=M4();return l.jsx("div",{className:"react-flow__nodes",style:jl,children:i.map(u=>l.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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}b0.displayName="NodeRenderer";const A4=p.memo(b0);function z4(e){return ie(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 l.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 l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Km={[Fa.Arrow]:D4,[Fa.ArrowClosed]:$4};function O4(e){const t=we();return p.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Km,e)?Km[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:a="auto-start-reverse"})=>{const u=O4(t);return u?l.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:l.jsx(u,{color:n,strokeWidth:i})}):null},k0=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(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?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:s.map(o=>l.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};k0.displayName="MarkerDefinitions";var H4=p.memo(k0);function j0({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...h}){const[d,f]=p.useState({x:1,y:0,width:0,height:0}),x=Ie(["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?l.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[s&&l.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:a,ry:a}),l.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]}):null}j0.displayName="EdgeText";const V4=p.memo(j0);function Cl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...h,d:e,fill:"none",className:Ie(["react-flow__edge-path",h.className])}),c?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&It(t)&&It(n)?l.jsx(V4,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,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 C0({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top}){const[i,a]=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]=Ky({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${a} ${u},${c} ${r},${s}`,h,d,f,x]}function E0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:a,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})=>{const[v,g,S]=C0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a}),b=e.isInternal?void 0:t;return l.jsx(Cl,{id:b,path:v,labelX:g,labelY:S,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})})}const B4=E0({isInternal:!1}),_0=E0({isInternal:!0});B4.displayName="SimpleBezierEdge";_0.displayName="SimpleBezierEdgeInternal";function P0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=X.Bottom,targetPosition:y=X.Top,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Ac({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}),j=e.isInternal?void 0:t;return l.jsx(Cl,{id:j,path:g,labelX:S,labelY:b,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,interactionWidth:v})})}const M0=P0({isInternal:!1}),I0=P0({isInternal:!0});M0.displayName="SmoothStepEdge";I0.displayName="SmoothStepEdgeInternal";function R0(e){return p.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return l.jsx(M0,{...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=R0({isInternal:!1}),T0=R0({isInternal:!0});U4.displayName="StepEdge";T0.displayName="StepEdgeInternal";function L0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[N,m,v]=Xy({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return l.jsx(Cl,{id:g,path:N,labelX:m,labelY:v,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})})}const W4=L0({isInternal:!1}),A0=L0({isInternal:!0});W4.displayName="StraightEdge";A0.displayName="StraightEdgeInternal";function z0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=X.Bottom,targetPosition:a=X.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Yy({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),j=e.isInternal?void 0:t;return l.jsx(Cl,{id:j,path:g,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:v})})}const K4=z0({isInternal:!1}),D0=z0({isInternal:!0});K4.displayName="BezierEdge";D0.displayName="BezierEdgeInternal";const Gm={default:D0,straight:A0,step:T0,smoothstep:I0,simplebezier:_0},Xm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Y4=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,G4=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Qm="react-flow__edgeupdater";function qm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:a}){return l.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Ie([Qm,`${Qm}-${a}`]),cx:Y4(t,r,e),cy:G4(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:a,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=we(),w=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:j,domNode:k,isValidConnection:_,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:A,cancelConnection:C,nodeLookup:L,rfId:M,panBy:D,updateConnection:E}=y.getState(),P=b.type==="target",z=(U,B)=>{f(!1),d==null||d(U,n,b.type,B)},F=U=>c==null?void 0:c(n,U),O=(U,B)=>{f(!0),h==null||h(S,n,b.type),T==null||T(U,B)};$c.onPointerDown(S.nativeEvent,{autoPanOnConnect:j,connectionMode:I,connectionRadius:$,domNode:k,handleId:b.id,nodeId:b.nodeId,nodeLookup:L,isTarget:P,edgeUpdaterType:b.type,lib:R,flowId:M,cancelConnection:C,panBy:D,isValidConnection:_,onConnect:F,onConnectStart:O,onConnectEnd:A,onReconnectEnd:z,updateConnection:E,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},N=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(qm,{position:a,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&l.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:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:N,onError:m,disableKeyboardA11y:v}){let g=ie(ee=>ee.edgeLookup.get(e));const S=ie(ee=>ee.defaultEdgeOptions);g=S?{...S,...g}:g;let b=g.type||"default",j=(w==null?void 0:w[b])||Gm[b];j===void 0&&(m==null||m("011",Jt.error011(b)),b="default",j=(w==null?void 0:w.default)||Gm.default);const k=!!(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"),$=p.useRef(null),[R,T]=p.useState(!1),[A,C]=p.useState(!1),L=we(),{zIndex:M,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O}=ie(p.useCallback(ee=>{const Z=ee.nodeLookup.get(g.source),ue=ee.nodeLookup.get(g.target);if(!Z||!ue)return{zIndex:g.zIndex,...Xm};const he=j_({id:e,sourceNode:Z,targetNode:ue,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:ee.connectionMode,onError:m});return{zIndex:x_({selected:g.selected,zIndex:g.zIndex,sourceNode:Z,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...he||Xm}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ve),U=p.useMemo(()=>g.markerStart?`url('#${zc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),B=p.useMemo(()=>g.markerEnd?`url('#${zc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||D===null||E===null||P===null||z===null)return null;const K=ee=>{var le;const{addSelectedEdges:Z,unselectNodesAndEdges:ue,multiSelectionActive:he}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),g.selected&&he?(ue({nodes:[],edges:[g]}),(le=$.current)==null||le.blur()):Z([e])),s&&s(ee,g)},Y=o?ee=>{o(ee,{...g})}:void 0,G=i?ee=>{i(ee,{...g})}:void 0,V=a?ee=>{a(ee,{...g})}:void 0,q=u?ee=>{u(ee,{...g})}:void 0,re=c?ee=>{c(ee,{...g})}:void 0,te=ee=>{var Z;if(!v&&Ry.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:he}=L.getState();ee.key==="Escape"?((Z=$.current)==null||Z.blur(),ue({edges:[g]})):he([e])}};return l.jsx("svg",{style:{zIndex:M},children:l.jsxs("g",{className:Ie(["react-flow__edge",`react-flow__edge-${b}`,g.className,N,{selected:g.selected,animated:g.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:K,onDoubleClick:Y,onContextMenu:G,onMouseEnter:V,onMouseMove:q,onMouseLeave:re,onKeyDown:k?te:void 0,tabIndex:k?0:void 0,role:g.ariaRole??(k?"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":k?`${m0}-${y}`:void 0,ref:$,...g.domAttributes,children:[!A&&l.jsx(j,{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:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,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}),_&&l.jsx(X4,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:C})]})})}var q4=p.memo(Q4);const Z4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,onError:g}=ie(Z4,ve),S=z4(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(H4,{defaultColor:e,rfId:n}),S.map(b=>l.jsx(q4,{id:b,edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},b))]})}$0.displayName="EdgeRenderer";const J4=p.memo($0),eP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function tP({children:e}){const t=ie(eP);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function nP(e){const t=pf(),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=ie(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 aP(e){const t=iP();return ie(t,ve)}const lP=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:a,inProgress:u}=ie(lP,ve);return!(o&&s&&u)?null:l.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:Ie(["react-flow__connection",Ay(a)]),children:l.jsx(O0,{style:t,type:n,CustomComponent:r,isValid:a})})})}const O0=({style:e,type:t=In.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:a,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:x}=aP();if(!s)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:f,connectionStatus:Ay(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]=C0(w);break;case In.Step:[y]=Ac({...w,borderRadius:0});break;case In.SmoothStep:[y]=Ac(w);break;default:[y]=Xy(w)}return l.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};O0.displayName="ConnectionLine";const cP={};function Zm(e=cP){p.useRef(e),we(),p.useEffect(()=>{},[e])}function dP(){we(),p.useRef(!1),p.useEffect(()=>{},[])}function F0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:q,paneClickDistance:re,nodeClickDistance:te,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:tn,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ni,viewport:_r,onViewportChange:As}){return Zm(e),Zm(t),dP(),nP(n),sP(_r),l.jsx(C4,{onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneContextMenu:q,onPaneScroll:V,paneClickDistance:re,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,elementsSelectable:$,zoomOnScroll:D,zoomOnPinch:E,zoomOnDoubleClick:O,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,onViewportChange:As,isControlledViewport:!!_r,children:l.jsxs(tP,{children:[l.jsx(J4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:tn,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Ts,disableKeyboardA11y:Ls,rfId:ni}),l.jsx(uP,{style:w,type:y,component:N,containerStyle:m}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(A4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Ts,noDragClassName:Zn,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ni}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}F0.displayName="GraphView";const fP=p.memo(F0),Jm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const x=new Map,y=new Map,w=new Map,N=new Map,m=r??t??[],v=n??e??[],g=h??[0,0],S=d??Do;Zy(w,N,m);const b=Dc(v,x,y,{nodeOrigin:g,nodeExtent:S,zIndexMode:f});let j=[0,0,1];if(i&&s&&o){const k=Zo(x,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:_,y:I,zoom:$}=lf(k,s,o,u,c,(a==null?void 0:a.padding)??.1);j=[_,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:j,nodes:v,nodesInitialized:b,nodeLookup:x,parentLookup:y,edges:m,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Do,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ps.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:a,fitViewResolver:null,connection:{...Ly},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:Ty,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},hP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>P3((x,y)=>{async function w(){const{nodeLookup:N,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:S,height:b,minZoom:j,maxZoom:k}=y();m&&(await u_({nodes:N,width:S,height:b,panZoom:m,minZoom:j,maxZoom:k},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...Jm({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:S,fitViewQueued:b,zIndexMode:j}=y(),k=Dc(N,m,v,{nodeOrigin:g,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:j});b&&k?(w(),x({nodes:N,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:N,nodesInitialized:k})},setEdges:N=>{const{connectionLookup:m,edgeLookup:v}=y();Zy(m,v,N),x({edges:N})},setDefaultNodesAndEdges:(N,m)=>{if(N){const{setNodes:v}=y();v(N),x({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:S,nodeOrigin:b,nodeExtent:j,debug:k,fitViewQueued:_,zIndexMode:I}=y(),{changes:$,updatedInternals:R}=T_(N,v,g,S,b,j,I);R&&(P_(v,g,{nodeOrigin:b,nodeExtent:j,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),($==null?void 0:$.length)>0&&(k&&console.log("React Flow: trigger node changes",$),m==null||m($)))},updateNodePositions:(N,m=!1)=>{const v=[];let g=[];const{nodeLookup:S,triggerNodeChanges:b,connection:j,updateConnection:k,onNodesChangeMiddlewareMap:_}=y();for(const[I,$]of N){const R=S.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),A={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:m};if(R&&j.inProgress&&j.fromNode.id===R.id){const C=Nr(R,j.fromHandle,X.Left,!0);k({...j,from:C})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),g.push(A)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=y(),R=mf(v,S,I,$);g.push(...R)}for(const I of _.values())g=I(g);b(g)},triggerNodeChanges:N=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=Q3(N,g);v(j)}b&&console.log("React Flow: trigger node changes",N),m==null||m(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=q3(N,g);v(j)}b&&console.log("React Flow: trigger edge changes",N),m==null||m(N)}},addSelectedNodes:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));S(j);return}S(Yr(g,new Set([...N]),!0)),b(Yr(v))},addSelectedEdges:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));b(j);return}b(Yr(v,new Set([...N]))),S(Yr(g,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:S,triggerNodeChanges:b,triggerEdgeChanges:j}=y(),k=N||g,_=m||v,I=k.map(R=>{const T=S.get(R.id);return T&&(T.selected=!1),tr(R.id,!1)}),$=_.map(R=>tr(R.id,!1));b(I),j($)},setMinZoom:N=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([N,v]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,N]),x({maxZoom:N})},setTranslateExtent:N=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:S}=y();if(!S)return;const b=m.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]),j=N.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]);v(b),g(j)},setNodeExtent:N=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:S,elevateNodesOnSelect:b,nodeExtent:j,zIndexMode:k}=y();N[0][0]===j[0][0]&&N[0][1]===j[0][1]&&N[1][0]===j[1][0]&&N[1][1]===j[1][1]||(Dc(m,v,g,{nodeOrigin:S,nodeExtent:N,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:k}),x({nodeExtent:N}))},panBy:N=>{const{transform:m,width:v,height:g,panZoom:S,translateExtent:b}=y();return L_({delta:N,panZoom:S,transform:m,translateExtent:b,width:v,height:g})},setCenter:async(N,m,v)=>{const{width:g,height:S,maxZoom:b,panZoom:j}=y();if(!j)return Promise.resolve(!1);const k=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await j.setViewport({x:g/2-N*k,y:S/2-m*k,zoom:k},{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:{...Ly}})},updateConnection:N=>{x({connection:N})},reset:()=>x({...Jm()})}},Object.is);function mP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:a,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:a,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return l.jsx(M3,{value:y,children:l.jsx(t4,{children:x})})}function pP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:a,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x}){return p.useContext(bl)?l.jsx(l.Fragment,{children:e}):l.jsx(mP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:a,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:a,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:A,onSelectionDragStart:C,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onBeforeDelete:z,connectionMode:F,connectionLineType:O=In.Bezier,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,deleteKeyCode:Y="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:q=$o.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:te=Fo()?"Meta":"Control",zoomActivationKeyCode:ee=Fo()?"Meta":"Control",snapToGrid:Z,snapGrid:ue,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:le,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:tn,nodesFocusable:Zn,nodeOrigin:Rs=p0,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il=!0,defaultViewport:ni=B3,minZoom:_r=.5,maxZoom:As=2,translateExtent:Cf=Do,preventScrolling:Kv=!0,nodeExtent:Rl,defaultMarkerColor:Yv="#b1b1b7",zoomOnScroll:Gv=!0,zoomOnPinch:Xv=!0,panOnScroll:Qv=!1,panOnScrollSpeed:qv=.5,panOnScrollMode:Zv=dr.Free,zoomOnDoubleClick:Jv=!0,panOnDrag:ew=!0,onPaneClick:tw,onPaneMouseEnter:nw,onPaneMouseMove:rw,onPaneMouseLeave:sw,onPaneScroll:ow,onPaneContextMenu:iw,paneClickDistance:aw=1,nodeClickDistance:lw=0,children:uw,onReconnect:cw,onReconnectStart:dw,onReconnectEnd:fw,onEdgeContextMenu:hw,onEdgeDoubleClick:mw,onEdgeMouseEnter:pw,onEdgeMouseMove:gw,onEdgeMouseLeave:xw,reconnectRadius:yw=10,onNodesChange:vw,onEdgesChange:ww,noDragClassName:Nw="nodrag",noWheelClassName:Sw="nowheel",noPanClassName:Ef="nopan",fitView:_f,fitViewOptions:Pf,connectOnClick:bw,attributionPosition:kw,proOptions:jw,defaultEdgeOptions:Cw,elevateNodesOnSelect:Ew=!0,elevateEdgesOnSelect:_w=!1,disableKeyboardA11y:Mf=!1,autoPanOnConnect:Pw,autoPanOnNodeDrag:Mw,autoPanSpeed:Iw,connectionRadius:Rw,isValidConnection:Tw,onError:Lw,style:Aw,id:If,nodeDragThreshold:zw,connectionDragThreshold:Dw,viewport:$w,onViewportChange:Ow,width:Fw,height:Hw,colorMode:Vw="light",debug:Bw,onScroll:ri,ariaLabelConfig:Uw,zIndexMode:Rf="basic",...Ww},Kw){const Tl=If||"1",Yw=Y3(Vw),Gw=p.useCallback(Tf=>{Tf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ri==null||ri(Tf)},[ri]);return l.jsx("div",{"data-testid":"rf__wrapper",...Ww,onScroll:Gw,style:{...Aw,...gP},ref:Kw,className:Ie(["react-flow",s,Yw]),id:If,role:"application",children:l.jsxs(pP,{nodes:e,edges:t,width:Fw,height:Hw,fitView:_f,fitViewOptions:Pf,minZoom:_r,maxZoom:As,nodeOrigin:Rs,nodeExtent:Rl,zIndexMode:Rf,children:[l.jsx(fP,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,selectionKeyCode:G,selectionOnDrag:V,selectionMode:q,deleteKeyCode:Y,multiSelectionKeyCode:te,panActivationKeyCode:re,zoomActivationKeyCode:ee,onlyRenderVisibleElements:he,defaultViewport:ni,translateExtent:Cf,minZoom:_r,maxZoom:As,preventScrolling:Kv,zoomOnScroll:Gv,zoomOnPinch:Xv,zoomOnDoubleClick:Jv,panOnScroll:Qv,panOnScrollSpeed:qv,panOnScrollMode:Zv,panOnDrag:ew,onPaneClick:tw,onPaneMouseEnter:nw,onPaneMouseMove:rw,onPaneMouseLeave:sw,onPaneScroll:ow,onPaneContextMenu:iw,paneClickDistance:aw,nodeClickDistance:lw,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onReconnect:cw,onReconnectStart:dw,onReconnectEnd:fw,onEdgeContextMenu:hw,onEdgeDoubleClick:mw,onEdgeMouseEnter:pw,onEdgeMouseMove:gw,onEdgeMouseLeave:xw,reconnectRadius:yw,defaultMarkerColor:Yv,noDragClassName:Nw,noWheelClassName:Sw,noPanClassName:Ef,rfId:Tl,disableKeyboardA11y:Mf,nodeExtent:Rl,viewport:$w,onViewportChange:Ow}),l.jsx(K3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:tn,nodesFocusable:Zn,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il,elevateNodesOnSelect:Ew,elevateEdgesOnSelect:_w,minZoom:_r,maxZoom:As,nodeExtent:Rl,onNodesChange:vw,onEdgesChange:ww,snapToGrid:Z,snapGrid:ue,connectionMode:F,translateExtent:Cf,connectOnClick:bw,defaultEdgeOptions:Cw,fitView:_f,fitViewOptions:Pf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Ef,nodeOrigin:Rs,rfId:Tl,autoPanOnConnect:Pw,autoPanOnNodeDrag:Mw,autoPanSpeed:Iw,onError:Lw,connectionRadius:Rw,isValidConnection:Tw,selectNodesOnDrag:le,nodeDragThreshold:zw,connectionDragThreshold:Dw,onBeforeDelete:z,debug:Bw,ariaLabelConfig:Uw,zIndexMode:Rf}),l.jsx(V3,{onSelectionChange:A}),uw,l.jsx(D3,{proOptions:jw,position:kw}),l.jsx(z3,{rfId:Tl,disableKeyboardA11y:Mf})]})})}var yP=x0(xP);function vP({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ie(["react-flow__background-pattern",n,r])})}function wP({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:Ie(["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 H0({id:e,variant:t=Vn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:a,style:u,className:c,patternClassName:h}){const d=p.useRef(null),{transform:f,patternId:x}=ie(SP,ve),y=r||NP[t],w=t===Vn.Dots,N=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],S=Array.isArray(o)?o:[o,o],b=N?[g,g]:v,j=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],k=`${x}${e||""}`;return l.jsxs("svg",{className:Ie(["react-flow__background",c]),style:{...u,...jl,"--xy-background-color-props":a,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[l.jsx("pattern",{id:k,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:w?l.jsx(wP,{radius:g/2,className:h}):l.jsx(vP,{dimensions:b,lineWidth:s,variant:t,className:h})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}H0.displayName="Background";const bP=p.memo(H0);function kP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function jP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function CP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 l.jsx("button",{type:"button",className:Ie(["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 V0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:a,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=we(),{isInteractive:w,minZoomReached:N,maxZoomReached:m,ariaLabelConfig:v}=ie(PP,ve),{zoomIn:g,zoomOut:S,fitView:b}=pf(),j=()=>{g(),o==null||o()},k=()=>{S(),i==null||i()},_=()=>{b(s),a==null||a()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},$=f==="horizontal"?"horizontal":"vertical";return l.jsxs(kl,{className:Ie(["react-flow__controls",$,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(Ii,{onClick:j,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:l.jsx(kP,{})}),l.jsx(Ii,{onClick:k,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:l.jsx(jP,{})})]}),n&&l.jsx(Ii,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:l.jsx(CP,{})}),r&&l.jsx(Ii,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?l.jsx(_P,{}):l.jsx(EP,{})}),h]})}V0.displayName="Controls";const MP=p.memo(V0);function IP({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:a,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:w}=o||{},N=i||y||w;return l.jsx("rect",{className:Ie(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:a,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 a=ie(TP,ve),u=yu(t),c=yu(e),h=yu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:a.map(f=>l.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:a,onClick:u}){const{node:c,x:h,y:d,width:f,height:x}=ie(y=>{const{internals:w}=y.nodeLookup.get(e),N=w.userNode,{x:m,y:v}=w.positionAbsolute,{width:g,height:S}=vn(N);return{node:N,x:m,y:v,width:g,height:S}},ve);return!c||c.hidden||!Hy(c)?null:l.jsx(a,{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?Fy(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 B0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:N=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:S=5}){const b=we(),j=p.useRef(null),{boundingRect:k,viewBB:_,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:A,ariaLabelConfig:C}=ie(HP,ve),L=(e==null?void 0:e.width)??$P,M=(e==null?void 0:e.height)??OP,D=k.width/L,E=k.height/M,P=Math.max(D,E),z=P*L,F=P*M,O=S*P,U=k.x-(z-k.width)/2-O,B=k.y-(F-k.height)/2-O,K=z+O*2,Y=F+O*2,G=`${VP}-${I}`,V=p.useRef(0),q=p.useRef();V.current=P,p.useEffect(()=>{if(j.current&&$)return q.current=B_({domNode:j.current,panZoom:$,getTransform:()=>b.getState().transform,getViewScale:()=>V.current}),()=>{var Z;(Z=q.current)==null||Z.destroy()}},[$]),p.useEffect(()=>{var Z;(Z=q.current)==null||Z.update({translateExtent:R,width:T,height:A,inversePan:v,pannable:w,zoomStep:g,zoomable:N})},[w,N,v,g,R,T,A]);const re=x?Z=>{var le;const[ue,he]=((le=q.current)==null?void 0:le.pointer(Z))||[0,0];x(Z,{x:ue,y:he})}:void 0,te=y?p.useCallback((Z,ue)=>{const he=b.getState().nodeLookup.get(ue).internals.userNode;y(Z,he)},[]):void 0,ee=m??C["minimap.ariaLabel"];return l.jsx(kl,{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:Ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:L,height:M,viewBox:`${U} ${B} ${K} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:j,onClick:re,children:[ee&&l.jsx("title",{id:G,children:ee}),l.jsx(DP,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:a}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${B-O}h${K+O*2}v${Y+O*2}h${-K-O*2}z
343
- M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}B0.displayName="MiniMap";p.memo(B0);const BP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,UP={[vs.Line]:"right",[vs.Handle]:"bottom-right"};function WP({nodeId:e,position:t,variant:n=vs.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:a=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:N,onResizeEnd:m}){const v=N0(),g=typeof e=="string"?e:v,S=we(),b=p.useRef(null),j=n===vs.Handle,k=ie(p.useCallback(BP(j&&x),[j,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:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,domNode:M}=S.getState();return{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,paneDomNode:M}},onChange:(R,T)=>{const{triggerNodeChanges:A,nodeLookup:C,parentLookup:L,nodeOrigin:M}=S.getState(),D=[],E={x:R.x,y:R.y},P=C.get(g);if(P&&P.expandParent&&P.parentId){const z=P.origin??M,F=R.width??P.measured.width??0,O=R.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:F,height:O,...Vy({x:R.x??P.position.x,y:R.y??P.position.y},{width:F,height:O},P.parentId,C,z)}},B=mf([U],C,L,M);D.push(...B),E.x=R.x?Math.max(z[0]*F,R.x):void 0,E.y=R.y?Math.max(z[1]*O,R.y):void 0}if(E.x!==void 0&&E.y!==void 0){const z={id:g,type:"position",position:{...E}};D.push(z)}if(R.width!==void 0&&R.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};D.push(F)}for(const z of T){const F={...z,type:"position"};D.push(F)}A(D)},onEnd:({width:R,height:T})=>{const A={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};S.getState().triggerNodeChanges([A])}})),_.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:m,shouldResize:y}),()=>{var R;(R=_.current)==null||R.destroy()}},[I,a,u,c,h,d,w,N,m,y]);const $=I.split("-");return l.jsx("div",{className:Ie(["react-flow__resize-control","nodrag",...$,n,r]),ref:b,style:{...s,scale:k,...i&&{[j?"backgroundColor":"borderColor"]:i}},children:o})}p.memo(WP);function KP(){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 YP(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[s,o]=p.useState(!0),i=KP();p.useEffect(()=>{Promise.all([oe.discovery.agents(),oe.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:a,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",N=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:N}},[e,n,i]);return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),l.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:l.jsxs(yP,{nodes:a,edges:u,fitView:!0,proOptions:{hideAttribution:!0},children:[l.jsx(bP,{color:i?"#27272a":"#e4e4e7",gap:20}),l.jsx(MP,{})]})})]})}const xf=p.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Pe("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}));xf.displayName="Textarea";const qe=p.forwardRef(({className:e,...t},n)=>l.jsx("label",{ref:n,className:Pe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));qe.displayName="Label";function He(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 GP(e,t){const n=p.createContext(t);function r(o){const{children:i,...a}=o,u=p.useMemo(()=>a,Object.values(a));return l.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 El(e,t=[]){let n=[];function r(o,i){const a=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])||a,N=p.useMemo(()=>y,Object.values(y));return l.jsx(w.Provider,{value:N,children:x})}function h(d,f){const x=(f==null?void 0:f[e][u])||a,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(a){const u=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,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((a,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function QP(e){const t=e+"CollectionProvider",[n,r]=El(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,N=Ut.useRef(null),m=Ut.useRef(new Map).current;return l.jsx(s,{scope:y,itemMap:m,collectionRef:N,children:w})};i.displayName=t;const a=e+"CollectionSlot",u=Ut.forwardRef((x,y)=>{const{scope:w,children:N}=x,m=o(a,w),v=Zt(y,m.collectionRef);return l.jsx(fs,{ref:v,children:N})});u.displayName=a;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Ut.forwardRef((x,y)=>{const{scope:w,children:N,...m}=x,v=Ut.useRef(null),g=Zt(y,v),S=o(c,w);return Ut.useEffect(()=>(S.itemMap.set(v,{ref:v,...m}),()=>void S.itemMap.delete(v))),l.jsx(fs,{[h]:"",ref:g,children:N})});d.displayName=c;function f(x){const y=o(e+"CollectionConsumer",x);return Ut.useCallback(()=>{const N=y.collectionRef.current;if(!N)return[];const m=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,b)=>m.indexOf(S.ref.current)-m.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var Wa=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},qP=d1.useId||(()=>{}),ZP=0;function mo(e){const[t,n]=p.useState(qP());return Wa(()=>{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"],et=JP.reduce((e,t)=>{const n=p.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?fs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function e5(e,t){e&&ul.flushSync(()=>e.dispatchEvent(t))}function Gn(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 yf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=t5({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,a=Gn(n),u=p.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else s(c)},[o,e,s,a]);return[i,u]}function t5({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,s=p.useRef(r),o=Gn(t);return p.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var n5=p.createContext(void 0);function U0(e){const t=p.useContext(n5);return e||t||"ltr"}var vu="rovingFocusGroup.onEntryFocus",r5={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Fc,W0,s5]=QP(_l),[o5,K0]=El(_l,[s5]),[i5,a5]=o5(_l),Y0=p.forwardRef((e,t)=>l.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(l5,{...e,ref:t})})}));Y0.displayName=_l;var l5=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),x=Zt(t,f),y=U0(o),[w=null,N]=yf({prop:i,defaultProp:a,onChange:u}),[m,v]=p.useState(!1),g=Gn(c),S=W0(n),b=p.useRef(!1),[j,k]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(vu,g),()=>_.removeEventListener(vu,g)},[g]),l.jsx(i5,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:p.useCallback(_=>N(_),[N]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>k(_=>_-1),[]),children:l.jsx(et.div,{tabIndex:m||j===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,_=>{const I=!b.current;if(_.target===_.currentTarget&&I&&!m){const $=new CustomEvent(vu,r5);if(_.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=S().filter(M=>M.focusable),T=R.find(M=>M.active),A=R.find(M=>M.id===w),L=[T,A,...R].filter(Boolean).map(M=>M.ref.current);Q0(L,h)}}b.current=!1}),onBlur:He(e.onBlur,()=>v(!1))})})}),G0="RovingFocusGroupItem",X0=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,a=mo(),u=o||a,c=a5(G0,n),h=c.currentTabStopId===u,d=W0(n),{onFocusableItemAdd:f,onFocusableItemRemove:x}=c;return p.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),l.jsx(Fc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(et.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:He(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:He(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:He(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(()=>Q0(m))}})})})});X0.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 Q0(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=X0;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",[a,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=a==="mounted"?c:"none"},[a]),Wa(()=>{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]),Wa(()=>{if(t){const c=d=>{const x=Ri(r.current).includes(d.animationName);d.target===t&&x&&ul.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(a),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 vf="Tabs",[y5]=El(vf,[K0]),q0=K0(),[v5,wf]=y5(vf),Z0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,h=U0(a),[d,f]=yf({prop:r,onChange:s,defaultProp:o});return l.jsx(v5,{scope:n,baseId:mo(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:l.jsx(et.div,{dir:h,"data-orientation":i,...c,ref:t})})});Z0.displayName=vf;var J0="TabsList",ev=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=wf(J0,n),i=q0(n);return l.jsx(h5,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(et.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});ev.displayName=J0;var tv="TabsTrigger",nv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=wf(tv,n),a=q0(n),u=ov(i.baseId,r),c=iv(i.baseId,r),h=r===i.value;return l.jsx(m5,{asChild:!0,...a,focusable:!s,active:h,children:l.jsx(et.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:He(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:He(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});nv.displayName=tv;var rv="TabsContent",sv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,a=wf(rv,n),u=ov(a.baseId,r),c=iv(a.baseId,r),h=r===a.value,d=p.useRef(h);return p.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(ti,{present:s||h,children:({present:f})=>l.jsx(et.div,{"data-state":h?"active":"inactive","data-orientation":a.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})})});sv.displayName=rv;function ov(e,t){return`${e}-trigger-${t}`}function iv(e,t){return`${e}-content-${t}`}var w5=Z0,av=ev,lv=nv,uv=sv;const Nf=w5,Pl=p.forwardRef(({className:e,...t},n)=>l.jsx(av,{ref:n,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Pl.displayName=av.displayName;const yt=p.forwardRef(({className:e,...t},n)=>l.jsx(lv,{ref:n,className:Pe("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}));yt.displayName=lv.displayName;const vt=p.forwardRef(({className:e,...t},n)=>l.jsx(uv,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vt.displayName=uv.displayName;function N5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(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",Hc="dismissableLayer.update",b5="dismissableLayer.pointerDownOutside",k5="dismissableLayer.focusOutside",ep,cv=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dv=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...u}=e,c=p.useContext(cv),[h,d]=p.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=p.useState({}),y=Zt(t,k=>d(k)),w=Array.from(c.layers),[N]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(N),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=m,b=E5(k=>{const _=k.target,I=[...c.branches].some($=>$.contains(_));!S||I||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},f),j=_5(k=>{const _=k.target;[...c.branches].some($=>$.contains(_))||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},f);return N5(k=>{v===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),p.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ep=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),tp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ep)}},[h,f,n,c]),p.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),tp())},[h,c]),p.useEffect(()=>{const k=()=>x({});return document.addEventListener(Hc,k),()=>document.removeEventListener(Hc,k)},[]),l.jsx(et.div,{...u,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,j.onFocusCapture),onBlurCapture:He(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,b.onPointerDownCapture)})});dv.displayName=S5;var j5="DismissableLayerBranch",C5=p.forwardRef((e,t)=>{const n=p.useContext(cv),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]),l.jsx(et.div,{...e,ref:s})});C5.displayName=j5;function E5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){fv(b5,n,c,{discrete:!0})};const c={originalEvent:a};a.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=Gn(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&fv(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 tp(){const e=new CustomEvent(Hc);document.dispatchEvent(e)}function fv(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",np={bubbles:!1,cancelable:!0},P5="FocusScope",hv=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,u]=p.useState(null),c=Gn(s),h=Gn(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||!a)return;const S=g.target;a.contains(S)?d.current=S:Cn(d.current,{select:!0})},N=function(g){if(x.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||Cn(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const b of g)b.removedNodes.length>0&&Cn(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const v=new MutationObserver(m);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),v.disconnect()}}},[r,a,x.paused]),p.useEffect(()=>{if(a){sp.add(x);const w=document.activeElement;if(!a.contains(w)){const m=new CustomEvent(wu,np);a.addEventListener(wu,c),a.dispatchEvent(m),m.defaultPrevented||(M5(A5(mv(a)),{select:!0}),document.activeElement===w&&Cn(a))}return()=>{a.removeEventListener(wu,c),setTimeout(()=>{const m=new CustomEvent(Nu,np);a.addEventListener(Nu,h),a.dispatchEvent(m),m.defaultPrevented||Cn(w??document.body,{select:!0}),a.removeEventListener(Nu,h),sp.remove(x)},0)}}},[a,c,h,x]);const y=p.useCallback(w=>{if(!n&&!r||x.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,m=document.activeElement;if(N&&m){const v=w.currentTarget,[g,S]=I5(v);g&&S?!w.shiftKey&&m===S?(w.preventDefault(),n&&Cn(g,{select:!0})):w.shiftKey&&m===g&&(w.preventDefault(),n&&Cn(S,{select:!0})):m===v&&w.preventDefault()}},[n,r,x.paused]);return l.jsx(et.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});hv.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=mv(e),n=rp(t,e),r=rp(t.reverse(),e);return[n,r]}function mv(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 rp(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 sp=L5();function L5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=op(e,t),e.unshift(t)},remove(t){var n;e=op(e,t),(n=e[0])==null||n.resume()}}}function op(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",pv=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=p.useState(!1);Wa(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?S2.createPortal(l.jsx(et.div,{...r,ref:t}),i):null});pv.displayName=z5;var Su=0;function D5(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ip()),document.body.insertAdjacentElement("beforeend",e[1]??ip()),Su++,()=>{Su===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Su--}},[])}function ip(){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 Yt=function(){return Yt=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},Yt.apply(this,arguments)};function gv(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 sa="right-scroll-bar-position",oa="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,ap=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=ap.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||bu(a,null)}),o.forEach(function(a){s.has(a)||bu(a,i)})}ap.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(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.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 K5(e){e===void 0&&(e={});var t=W5(null);return t.options=Yt({async:!0,ssr:!1},e),t}var xv=function(e){var t=e.sideCar,n=gv(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,Yt({},n))};xv.isSideCarExport=!0;function Y5(e,t){return e.useMedium(t),xv}var yv=K5(),ku=function(){},Ml=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,a=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,N=e.as,m=N===void 0?"div":N,v=e.gapMode,g=gv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,b=B5([n,t]),j=Yt(Yt({},g),s);return p.createElement(p.Fragment,null,h&&p.createElement(S,{sideCar:yv,removeScrollBar:c,shards:d,noIsolation:x,inert:y,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?p.cloneElement(p.Children.only(a),Yt(Yt({},j),{ref:b})):p.createElement(m,Yt({},j,{className:u,ref:b}),a))});Ml.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ml.classNames={fullWidth:oa,zeroRight:sa};var G5=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=G5();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])}},vv=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=vv(),ns="data-scroll-locked",sM=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
344
- .`.concat(O5,` {
342
+ `)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return p.useEffect(()=>{const u=(t==null?void 0:t.target)??zm,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var N,m;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!c)&&By(x))return!1;const w=$m(x.code,a);if(o.current.add(x[w]),Dm(i,o.current,!1)){const v=((m=(N=x.composedPath)==null?void 0:N.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=$m(x.code,a);Dm(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 Dm(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function $m(e,t){return t.includes(e)?"code":"key"}const Y3=()=>{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:a}=e.getState(),u=lf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return a?(await a.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:a,y:u}=i.getBoundingClientRect(),c={x:t.x-a,y:t.y-u},h=n.snapGrid??s,d=n.snapToGrid??o;return ti(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=Va(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 a={...o};for(const u of i)G3(u,a);n.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function G3(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 X3(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 Yr(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 Om({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 a=t.get(i.id),u=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;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 Fm(e){return{id:e.id,type:"remove"}}const Hm=e=>s_(e),q3=e=>Ay(e);function g0(e){return p.forwardRef(e)}const Z3=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Vm(e){const[t,n]=p.useState(BigInt(0)),[r]=p.useState(()=>J3(()=>n(s=>s+BigInt(1))));return Z3(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function J3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const x0=p.createContext(null);function e4({children:e}){const t=we(),n=p.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const m of a)w=typeof m=="function"?m(w):m;let N=Om({items:w,lookup:f});for(const m of y.values())N=m(N);h&&c(w),N.length>0?d==null||d(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Vm(n),s=p.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=u;for(const y of a)x=typeof y=="function"?y(x):y;h?c(x):d&&d(Om({items:x,lookup:f}))},[]),o=Vm(s),i=p.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return l.jsx(x0.Provider,{value:i,children:e})}function t4(){const e=p.useContext(x0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n4=e=>!!e.panZoom;function pf(){const e=Y3(),t=we(),n=t4(),r=ie(n4),s=p.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},u=d=>{var m,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=Hm(d)?d:f.get(d.id),w=y.parentId?Hy(y.position,y.measured,y.parentId,f,x):y.position,N={...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 xs(N)},c=(d,f,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&Hm(N)?N:{...w,...N}}return w}))},h=(d,f,x={replace:!1})=>{a(y=>y.map(w=>{if(w.id===d){const N=typeof f=="function"?f(w):f;return x.replace&&q3(N)?N:{...w,...N}}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:a,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,N]=x;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:y,y:w,zoom:N}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:N,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:S}=t.getState(),{nodes:b,edges:j}=await u_({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:S}),k=j.length>0,_=b.length>0;if(k){const I=j.map(Fm);N==null||N(j),v(I)}if(_){const I=b.map(Fm);w==null||w(b),m(I)}return(_||k)&&(g==null||g({nodes:b,edges:j})),{deletedNodes:b,deletedEdges:j}},getIntersectingNodes:(d,f=!0,x)=>{const y=xm(d),w=y?d:u(d),N=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=xs(N?m:v),S=Oo(g,w);return f&&S>0||S>=g.width*g.height||S>=w.width*w.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const w=xm(d)?d:u(d);if(!w)return!1;const N=Oo(w,f);return x&&N>0||N>=f.width*f.height||N>=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 o_(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??h_();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 Bm=e=>e.selected,r4=typeof window<"u"?window:void 0;function s4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:r}=pf(),s=Ho(e,{actInsideInputWithModifier:!1}),o=Ho(t,{target:r4});p.useEffect(()=>{if(s){const{edges:i,nodes:a}=n.getState();r({nodes:a.filter(Bm),edges:i.filter(Bm)}),n.setState({nodesSelectionActive:!1})}},[s]),p.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function o4(e){const t=we();p.useEffect(()=>{const n=()=>{var s,o,i,a;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=uf(e.current);(r.height===0||r.width===0)&&((a=(i=t.getState()).onError)==null||a.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 jl={position:"absolute",width:"100%",height:"100%",top:0,left:0},i4=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=cr.Free,zoomOnDoubleClick:i=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:N,onViewportChange:m,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:S}){const b=we(),j=p.useRef(null),{userSelectionActive:k,lib:_,connectionInProgress:I}=ie(i4,ve),$=Ho(f),R=p.useRef();o4(j);const T=p.useCallback(A=>{m==null||m({x:A[0],y:A[1],zoom:A[2]}),v||b.setState({transform:A})},[m,v]);return p.useEffect(()=>{if(j.current){R.current=Q_({domNode:j.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:M=>b.setState({paneDragging:M}),onPanZoomStart:(M,D)=>{const{onViewportChangeStart:E,onMoveStart:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoom:(M,D)=>{const{onViewportChange:E,onMove:P}=b.getState();P==null||P(M,D),E==null||E(D)},onPanZoomEnd:(M,D)=>{const{onViewportChangeEnd:E,onMoveEnd:P}=b.getState();P==null||P(M,D),E==null||E(D)}});const{x:A,y:C,zoom:L}=R.current.getViewport();return b.setState({panZoom:R.current,transform:[A,C,L],domNode:j.current.closest(".react-flow")}),()=>{var M;(M=R.current)==null||M.destroy()}}},[]),p.useEffect(()=>{var A;(A=R.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:a,zoomActivationKeyPressed:$,preventScrolling:x,noPanClassName:N,userSelectionActive:k,noWheelClassName:w,lib:_,onTransformChange:T,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:g})},[e,t,n,r,s,o,i,a,$,x,N,k,w,_,T,I,S,g]),l.jsx("div",{className:"react-flow__renderer",ref:j,style:jl,children:y})}const l4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function u4(){const{userSelectionActive:e,userSelectionRect:t}=ie(l4,ve);return e&&t?l.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))},c4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=$o.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const w=we(),{userSelectionActive:N,elementsSelectable:m,dragging:v,connectionInProgress:g}=ie(c4,ve),S=m&&(e||N),b=p.useRef(null),j=p.useRef(),k=p.useRef(new Set),_=p.useRef(new Set),I=p.useRef(!1),$=E=>{if(I.current||g){I.current=!1;return}u==null||u(E),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},R=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},T=h?E=>h(E):void 0,A=E=>{I.current&&(E.stopPropagation(),I.current=!1)},C=E=>{var K,Y;const{domNode:P}=w.getState();if(j.current=P==null?void 0:P.getBoundingClientRect(),!j.current)return;const z=E.target===b.current;if(!z&&!!E.target.closest(".nokey")||!e||!(o&&z||t)||E.button!==0||!E.isPrimary)return;(Y=(K=E.target)==null?void 0:K.setPointerCapture)==null||Y.call(K,E.pointerId),I.current=!1;const{x:U,y:B}=Rt(E.nativeEvent,j.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:B,x:U,y:B}}),z||(E.stopPropagation(),E.preventDefault())},L=E=>{const{userSelectionRect:P,transform:z,nodeLookup:F,edgeLookup:O,connectionLookup:U,triggerNodeChanges:B,triggerEdgeChanges:K,defaultEdgeOptions:Y,resetSelectedElements:G}=w.getState();if(!j.current||!P)return;const{x:V,y:Q}=Rt(E.nativeEvent,j.current),{startX:se,startY:te}=P;if(!I.current){const le=t?0:s;if(Math.hypot(V-se,Q-te)<=le)return;G(),i==null||i(E)}I.current=!0;const ee={startX:se,startY:te,x:V<se?V:se,y:Q<te?Q:te,width:Math.abs(V-se),height:Math.abs(Q-te)},q=k.current,ue=_.current;k.current=new Set(af(F,ee,z,n===$o.Partial,!0).map(le=>le.id)),_.current=new Set;const he=(Y==null?void 0:Y.selectable)??!0;for(const le of k.current){const Be=U.get(le);if(Be)for(const{edgeId:wn}of Be.values()){const tn=O.get(wn);tn&&(tn.selectable??he)&&_.current.add(wn)}}if(!ym(q,k.current)){const le=Yr(F,k.current,!0);B(le)}if(!ym(ue,_.current)){const le=Yr(O,_.current);K(le)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},M=E=>{var P,z;E.button===0&&((z=(P=E.target)==null?void 0:P.releasePointerCapture)==null||z.call(P,E.pointerId),!N&&E.target===b.current&&w.getState().userSelectionRect&&($==null||$(E)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(E),w.setState({nodesSelectionActive:k.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:Ie(["react-flow__pane",{draggable:D,dragging:v,selection:e}]),onClick:S?void 0:xu($,b),onContextMenu:xu(R,b),onWheel:xu(T,b),onPointerEnter:S?void 0:d,onPointerMove:S?L:f,onPointerUp:S?M:void 0,onPointerDownCapture:S?C:void 0,onClickCapture:S?A:void 0,onPointerLeave:x,ref:b,style:jl,children:[y,l.jsx(u4,{})]})}function Oc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:a,onError:u}=t.getState(),c=a.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 a=we(),[u,c]=p.useState(!1),h=p.useRef();return p.useEffect(()=>{h.current=z_({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{Oc({id:d,store:a,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 f4=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:a,updateNodePositions:u,nodeLookup:c,nodeOrigin:h}=e.getState(),d=new Map,f=f4(i),x=s?o[0]:5,y=s?o[1]:5,w=n.direction.x*x*n.factor,N=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+N};s&&(v=ei(v,o));const{position:g,positionAbsolute:S}=zy({nodeId:m.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:a});m.position=g,m.internals.positionAbsolute=S,d.set(m.id,m)}u(d)},[])}const gf=p.createContext(null),h4=gf.Provider;gf.Consumer;const w0=()=>p.useContext(gf),m4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),p4=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:a,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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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===ps.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:h&&c}};function g4({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:a,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},x){var L,M;const y=i||null,w=e==="target",N=we(),m=w0(),{connectOnClick:v,noPanClassName:g,rfId:S}=ie(m4,ve),{connectingFrom:b,connectingTo:j,clickConnecting:k,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:$,valid:R}=ie(p4(m,y,e),ve);m||(M=(L=N.getState()).onError)==null||M.call(L,"010",Jt.error010());const T=D=>{const{defaultEdgeOptions:E,onConnect:P,hasDefaultEdges:z}=N.getState(),F={...E,...D};if(z){const{edges:O,setEdges:U}=N.getState();U(w_(F,O))}P==null||P(F),a==null||a(F)},A=D=>{if(!m)return;const E=Uy(D.nativeEvent);if(s&&(E&&D.button===0||!E)){const P=N.getState();$c.onPointerDown(D.nativeEvent,{handleDomNode:D.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:T,isValidConnection:n||P.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}E?h==null||h(D):d==null||d(D)},C=D=>{const{onClickConnectStart:E,onClickConnectEnd:P,connectionClickStartHandle:z,connectionMode:F,isValidConnection:O,lib:U,rfId:B,nodeLookup:K,connection:Y}=N.getState();if(!m||!z&&!s)return;if(!z){E==null||E(D.nativeEvent,{nodeId:m,handleId:y,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const G=Vy(D.target),V=n||O,{connection:Q,isValid:se}=$c.isValid(D.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:F,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:V,flowId:B,doc:G,lib:U,nodeLookup:K});se&&Q&&T(Q);const te=structuredClone(Y);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,P==null||P(D,te),N.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${S}-${m}-${y}-${e}`,className:Ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:k,connectingfrom:b,connectingto:j,valid:R,connectionindicator:r&&(!I||_)&&(I||$?o:s)}]),onMouseDown:A,onTouchStart:A,onClick:v?C:void 0,ref:x,...f,children:u})}const Ba=p.memo(g0(g4));function x4({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(Ba,{type:"source",position:n,isConnectable:t})]})}function y4({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(Ba,{type:"source",position:r,isConnectable:t})]})}function v4(){return null}function w4({data:e,isConnectable:t,targetPosition:n=X.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(Ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ua={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Um={input:x4,default:y4,output:w4,group:v4};function N4(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 S4=e=>{const{width:t,height:n,x:r,y:s}=Jo(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 b4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=we(),{width:s,height:o,transformString:i,userSelectionActive:a}=ie(S4,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}),a||!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(Ua,f.key)&&(f.preventDefault(),u({direction:Ua[f.key],factor:f.shiftKey?4:1}))};return l.jsx("div",{className:Ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:l.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 Wm=typeof window<"u"?window:void 0,k4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function N0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:N,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:_,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,preventScrolling:A,onSelectionContextMenu:C,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:E,isControlledViewport:P}){const{nodesSelectionActive:z,userSelectionActive:F}=ie(k4,ve),O=Ho(c,{target:Wm}),U=Ho(w,{target:Wm}),B=U||_,K=U||S,Y=h&&B!==!0,G=O||F||Y;return s4({deleteKeyCode:u,multiSelectionKeyCode:y}),l.jsx(a4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:K,panOnScrollSpeed:b,panOnScrollMode:j,zoomOnDoubleClick:k,panOnDrag:!O&&B,defaultViewport:I,translateExtent:$,minZoom:R,maxZoom:T,zoomActivationKeyCode:N,preventScrolling:A,noWheelClassName:L,noPanClassName:M,onViewportChange:E,isControlledViewport:P,paneClickDistance:a,selectionOnDrag:Y,children:l.jsxs(d4,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:B,isSelecting:!!G,selectionMode:d,selectionKeyPressed:O,paneClickDistance:a,selectionOnDrag:Y,children:[e,z&&l.jsx(b4,{onSelectionContextMenu:C,noPanClassName:M,disableKeyboardA11y:D})]})})}N0.displayName="FlowRenderer";const j4=p.memo(N0),C4=e=>t=>e?af(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 E4(e){return ie(p.useCallback(C4(e),[e]),ve)}const _4=e=>e.updateNodeInternals;function P4(){const e=ie(_4),[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 M4({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=we(),o=p.useRef(null),i=p.useRef(null),a=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=a.current!==e.sourcePosition,x=u.current!==e.targetPosition;(d||f||x)&&(c.current=t,a.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 I4({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:N,nodeClickDistance:m,onError:v}){const{node:g,internals:S,isParent:b}=ie(V=>{const Q=V.nodeLookup.get(e),se=V.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:se}},ve);let j=g.type||"default",k=(N==null?void 0:N[j])||Um[j];k===void 0&&(v==null||v("003",Jt.error003(j)),j="default",k=(N==null?void 0:N.default)||Um.default);const _=!!(g.draggable||a&&typeof g.draggable>"u"),I=!!(g.selectable||u&&typeof g.selectable>"u"),$=!!(g.connectable||c&&typeof g.connectable>"u"),R=!!(g.focusable||h&&typeof g.focusable>"u"),T=we(),A=Fy(g),C=M4({node:g,nodeType:j,hasDimensions:A,resizeObserver:d}),L=y0({nodeRef:C,disabled:g.hidden||!_,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),M=v0();if(g.hidden)return null;const D=vn(g),E=N4(g),P=I||_||t||n||r||s,z=n?V=>n(V,{...S.userNode}):void 0,F=r?V=>r(V,{...S.userNode}):void 0,O=s?V=>s(V,{...S.userNode}):void 0,U=o?V=>o(V,{...S.userNode}):void 0,B=i?V=>i(V,{...S.userNode}):void 0,K=V=>{const{selectNodesOnDrag:Q,nodeDragThreshold:se}=T.getState();I&&(!Q||!_||se>0)&&Oc({id:e,store:T,nodeRef:C}),t&&t(V,{...S.userNode})},Y=V=>{if(!(By(V.nativeEvent)||y)){if(Iy.includes(V.key)&&I){const Q=V.key==="Escape";Oc({id:e,store:T,unselect:Q,nodeRef:C})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Ua,V.key)){V.preventDefault();const{ariaLabelConfig:Q}=T.getState();T.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),M({direction:Ua[V.key],factor:V.shiftKey?4:1})}}},G=()=>{var ue;if(y||!((ue=C.current)!=null&&ue.matches(":focus-visible")))return;const{transform:V,width:Q,height:se,autoPanOnNodeFocus:te,setCenter:ee}=T.getState();if(!te)return;af(new Map([[e,g]]),{x:0,y:0,width:Q,height:se},V,!0).length>0||ee(g.position.x+D.width/2,g.position.y+D.height/2,{zoom:V[2]})};return l.jsx("div",{className:Ie(["react-flow__node",`react-flow__node-${j}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:b,draggable:_,dragging:L}]),ref:C,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:A?"visible":"hidden",...g.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:F,onMouseLeave:O,onContextMenu:U,onClick:K,onDoubleClick:B,onKeyDown:R?Y:void 0,tabIndex:R?0:void 0,onFocus:R?G:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${f0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:l.jsx(h4,{value:e,children:l.jsx(k,{id:e,data:g.data,type:j,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:$,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:L,dragHandle:g.dragHandle,zIndex:S.z,parentId:g.parentId,...D})})})}var R4=p.memo(I4);const T4=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}=ie(T4,ve),i=E4(e.onlyRenderVisibleElements),a=P4();return l.jsx("div",{className:"react-flow__nodes",style:jl,children:i.map(u=>l.jsx(R4,{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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}S0.displayName="NodeRenderer";const L4=p.memo(S0);function A4(e){return ie(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&&x_({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),ve)}const z4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return l.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},D4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Km={[Fa.Arrow]:z4,[Fa.ArrowClosed]:D4};function $4(e){const t=we();return p.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Km,e)?Km[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Jt.error009(e)),null)},[e])}const O4=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const u=$4(t);return u?l.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:l.jsx(u,{color:n,strokeWidth:i})}):null},b0=({defaultColor:e,rfId:t})=>{const n=ie(o=>o.edges),r=ie(o=>o.defaultEdgeOptions),s=p.useMemo(()=>j_(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?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:s.map(o=>l.jsx(O4,{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 F4=p.memo(b0);function k0({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...h}){const[d,f]=p.useState({x:1,y:0,width:0,height:0}),x=Ie(["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?l.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[s&&l.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:a,ry:a}),l.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 H4=p.memo(k0);function Cl({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...h,d:e,fill:"none",className:Ie(["react-flow__edge-path",h.className])}),c?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&It(t)&&It(n)?l.jsx(H4,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:a,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,a]=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:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${a} ${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:a,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})=>{const[v,g,S]=j0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a}),b=e.isInternal?void 0:t;return l.jsx(Cl,{id:b,path:v,labelX:g,labelY:S,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:m})})}const V4=C0({isInternal:!1}),E0=C0({isInternal:!0});V4.displayName="SimpleBezierEdge";E0.displayName="SimpleBezierEdgeInternal";function _0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=X.Bottom,targetPosition:y=X.Top,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Ac({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}),j=e.isInternal?void 0:t;return l.jsx(Cl,{id:j,path:g,labelX:S,labelY:b,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:N,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 l.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 B4=I0({isInternal:!1}),R0=I0({isInternal:!0});B4.displayName="StepEdge";R0.displayName="StepEdgeInternal";function T0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[N,m,v]=Gy({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return l.jsx(Cl,{id:g,path:N,labelX:m,labelY:v,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})})}const U4=T0({isInternal:!1}),L0=T0({isInternal:!0});U4.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:a=X.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,pathOptions:m,interactionWidth:v})=>{const[g,S,b]=Ky({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:a,curvature:m==null?void 0:m.curvature}),j=e.isInternal?void 0:t;return l.jsx(Cl,{id:j,path:g,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:N,interactionWidth:v})})}const W4=A0({isInternal:!1}),z0=A0({isInternal:!0});W4.displayName="BezierEdge";z0.displayName="BezierEdgeInternal";const Gm={default:z0,straight:L0,step:R0,smoothstep:M0,simplebezier:E0},Xm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},K4=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,Y4=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Qm="react-flow__edgeupdater";function qm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:a}){return l.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Ie([Qm,`${Qm}-${a}`]),cx:K4(t,r,e),cy:Y4(n,r,e),r,stroke:"transparent",fill:"transparent"})}function G4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:a,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=we(),w=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:j,domNode:k,isValidConnection:_,connectionMode:I,connectionRadius:$,lib:R,onConnectStart:T,onConnectEnd:A,cancelConnection:C,nodeLookup:L,rfId:M,panBy:D,updateConnection:E}=y.getState(),P=b.type==="target",z=(U,B)=>{f(!1),d==null||d(U,n,b.type,B)},F=U=>c==null?void 0:c(n,U),O=(U,B)=>{f(!0),h==null||h(S,n,b.type),T==null||T(U,B)};$c.onPointerDown(S.nativeEvent,{autoPanOnConnect:j,connectionMode:I,connectionRadius:$,domNode:k,handleId:b.id,nodeId:b.nodeId,nodeLookup:L,isTarget:P,edgeUpdaterType:b.type,lib:R,flowId:M,cancelConnection:C,panBy:D,isValidConnection:_,onConnect:F,onConnectStart:O,onConnectEnd:A,onReconnectEnd:z,updateConnection:E,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},N=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(qm,{position:a,centerX:r,centerY:s,radius:t,onMouseDown:N,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&l.jsx(qm,{position:u,centerX:o,centerY:i,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function X4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:N,onError:m,disableKeyboardA11y:v}){let g=ie(ee=>ee.edgeLookup.get(e));const S=ie(ee=>ee.defaultEdgeOptions);g=S?{...S,...g}:g;let b=g.type||"default",j=(w==null?void 0:w[b])||Gm[b];j===void 0&&(m==null||m("011",Jt.error011(b)),b="default",j=(w==null?void 0:w.default)||Gm.default);const k=!!(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"),$=p.useRef(null),[R,T]=p.useState(!1),[A,C]=p.useState(!1),L=we(),{zIndex:M,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O}=ie(p.useCallback(ee=>{const q=ee.nodeLookup.get(g.source),ue=ee.nodeLookup.get(g.target);if(!q||!ue)return{zIndex:g.zIndex,...Xm};const he=k_({id:e,sourceNode:q,targetNode:ue,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:ee.connectionMode,onError:m});return{zIndex:g_({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:ue,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...he||Xm}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ve),U=p.useMemo(()=>g.markerStart?`url('#${zc(g.markerStart,y)}')`:void 0,[g.markerStart,y]),B=p.useMemo(()=>g.markerEnd?`url('#${zc(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||D===null||E===null||P===null||z===null)return null;const K=ee=>{var le;const{addSelectedEdges:q,unselectNodesAndEdges:ue,multiSelectionActive:he}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),g.selected&&he?(ue({nodes:[],edges:[g]}),(le=$.current)==null||le.blur()):q([e])),s&&s(ee,g)},Y=o?ee=>{o(ee,{...g})}:void 0,G=i?ee=>{i(ee,{...g})}:void 0,V=a?ee=>{a(ee,{...g})}:void 0,Q=u?ee=>{u(ee,{...g})}:void 0,se=c?ee=>{c(ee,{...g})}:void 0,te=ee=>{var q;if(!v&&Iy.includes(ee.key)&&I){const{unselectNodesAndEdges:ue,addSelectedEdges:he}=L.getState();ee.key==="Escape"?((q=$.current)==null||q.blur(),ue({edges:[g]})):he([e])}};return l.jsx("svg",{style:{zIndex:M},children:l.jsxs("g",{className:Ie(["react-flow__edge",`react-flow__edge-${b}`,g.className,N,{selected:g.selected,animated:g.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:K,onDoubleClick:Y,onContextMenu:G,onMouseEnter:V,onMouseMove:Q,onMouseLeave:se,onKeyDown:k?te:void 0,tabIndex:k?0:void 0,role:g.ariaRole??(k?"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":k?`${h0}-${y}`:void 0,ref:$,...g.domAttributes,children:[!A&&l.jsx(j,{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:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,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}),_&&l.jsx(G4,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:D,sourceY:E,targetX:P,targetY:z,sourcePosition:F,targetPosition:O,setUpdateHover:T,setReconnecting:C})]})})}var Q4=p.memo(X4);const q4=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:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,onError:g}=ie(q4,ve),S=A4(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(F4,{defaultColor:e,rfId:n}),S.map(b=>l.jsx(Q4,{id:b,edgesFocusable:N,edgesReconnectable:m,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:a,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 Z4=p.memo(D0),J4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function eP({children:e}){const t=ie(J4);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function tP(e){const t=pf(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const nP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rP(e){const t=ie(nP),n=we();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function sP(e){return e.connection.inProgress?{...e.connection,to:ti(e.connection.to,e.transform)}:{...e.connection}}function oP(e){return sP}function iP(e){const t=oP();return ie(t,ve)}const aP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:a,inProgress:u}=ie(aP,ve);return!(o&&s&&u)?null:l.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:Ie(["react-flow__connection",Ly(a)]),children:l.jsx($0,{style:t,type:n,CustomComponent:r,isValid:a})})})}const $0=({style:e,type:t=In.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:a,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:x}=iP();if(!s)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:a,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]=Ky(w);break;case In.SimpleBezier:[y]=j0(w);break;case In.Step:[y]=Ac({...w,borderRadius:0});break;case In.SmoothStep:[y]=Ac(w);break;default:[y]=Gy(w)}return l.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};$0.displayName="ConnectionLine";const uP={};function Zm(e=uP){p.useRef(e),we(),p.useEffect(()=>{},[e])}function cP(){we(),p.useRef(!1),p.useEffect(()=>{},[])}function O0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:$,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,zoomOnDoubleClick:O,panOnDrag:U,onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:Q,paneClickDistance:se,nodeClickDistance:te,onEdgeContextMenu:ee,onEdgeMouseEnter:q,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:tn,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ri,viewport:_r,onViewportChange:As}){return Zm(e),Zm(t),cP(),tP(n),rP(_r),l.jsx(j4,{onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:Y,onPaneMouseLeave:G,onPaneContextMenu:Q,onPaneScroll:V,paneClickDistance:se,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:S,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:j,zoomActivationKeyCode:k,elementsSelectable:$,zoomOnScroll:D,zoomOnPinch:E,zoomOnDoubleClick:O,panOnScroll:P,panOnScrollSpeed:z,panOnScrollMode:F,panOnDrag:U,defaultViewport:R,translateExtent:T,minZoom:A,maxZoom:C,onSelectionContextMenu:d,preventScrolling:L,noDragClassName:Zn,noWheelClassName:Rs,noPanClassName:Ts,disableKeyboardA11y:Ls,onViewportChange:As,isControlledViewport:!!_r,children:l.jsxs(eP,{children:[l.jsx(Z4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Be,onReconnectStart:wn,onReconnectEnd:tn,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:q,onEdgeMouseMove:ue,onEdgeMouseLeave:he,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Ts,disableKeyboardA11y:Ls,rfId:ri}),l.jsx(lP,{style:w,type:y,component:N,containerStyle:m}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(L4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Ts,noDragClassName:Zn,disableKeyboardA11y:Ls,nodeExtent:Il,rfId:ri}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}O0.displayName="GraphView";const dP=p.memo(O0),Jm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const x=new Map,y=new Map,w=new Map,N=new Map,m=r??t??[],v=n??e??[],g=h??[0,0],S=d??Do;qy(w,N,m);const b=Dc(v,x,y,{nodeOrigin:g,nodeExtent:S,zIndexMode:f});let j=[0,0,1];if(i&&s&&o){const k=Jo(x,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:_,y:I,zoom:$}=lf(k,s,o,u,c,(a==null?void 0:a.padding)??.1);j=[_,I,$]}return{rfId:"1",width:s??0,height:o??0,transform:j,nodes:v,nodesInitialized:b,nodeLookup:x,parentLookup:y,edges:m,edgeLookup:N,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Do,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ps.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:a,fitViewResolver:null,connection:{...Ty},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:c_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ry,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>_3((x,y)=>{async function w(){const{nodeLookup:N,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:S,height:b,minZoom:j,maxZoom:k}=y();m&&(await l_({nodes:N,width:S,height:b,panZoom:m,minZoom:j,maxZoom:k},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...Jm({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:N=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:S,fitViewQueued:b,zIndexMode:j}=y(),k=Dc(N,m,v,{nodeOrigin:g,nodeExtent:d,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:j});b&&k?(w(),x({nodes:N,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:N,nodesInitialized:k})},setEdges:N=>{const{connectionLookup:m,edgeLookup:v}=y();qy(m,v,N),x({edges:N})},setDefaultNodesAndEdges:(N,m)=>{if(N){const{setNodes:v}=y();v(N),x({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:S,nodeOrigin:b,nodeExtent:j,debug:k,fitViewQueued:_,zIndexMode:I}=y(),{changes:$,updatedInternals:R}=R_(N,v,g,S,b,j,I);R&&(__(v,g,{nodeOrigin:b,nodeExtent:j,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),($==null?void 0:$.length)>0&&(k&&console.log("React Flow: trigger node changes",$),m==null||m($)))},updateNodePositions:(N,m=!1)=>{const v=[];let g=[];const{nodeLookup:S,triggerNodeChanges:b,connection:j,updateConnection:k,onNodesChangeMiddlewareMap:_}=y();for(const[I,$]of N){const R=S.get(I),T=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&($!=null&&$.position)),A={id:I,type:"position",position:T?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:m};if(R&&j.inProgress&&j.fromNode.id===R.id){const C=Nr(R,j.fromHandle,X.Left,!0);k({...j,from:C})}T&&R.parentId&&v.push({id:I,parentId:R.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),g.push(A)}if(v.length>0){const{parentLookup:I,nodeOrigin:$}=y(),R=mf(v,S,I,$);g.push(...R)}for(const I of _.values())g=I(g);b(g)},triggerNodeChanges:N=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=X3(N,g);v(j)}b&&console.log("React Flow: trigger node changes",N),m==null||m(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:S,debug:b}=y();if(N!=null&&N.length){if(S){const j=Q3(N,g);v(j)}b&&console.log("React Flow: trigger edge changes",N),m==null||m(N)}},addSelectedNodes:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));S(j);return}S(Yr(g,new Set([...N]),!0)),b(Yr(v))},addSelectedEdges:N=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:S,triggerEdgeChanges:b}=y();if(m){const j=N.map(k=>tr(k,!0));b(j);return}b(Yr(v,new Set([...N]))),S(Yr(g,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:S,triggerNodeChanges:b,triggerEdgeChanges:j}=y(),k=N||g,_=m||v,I=k.map(R=>{const T=S.get(R.id);return T&&(T.selected=!1),tr(R.id,!1)}),$=_.map(R=>tr(R.id,!1));b(I),j($)},setMinZoom:N=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([N,v]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,N]),x({maxZoom:N})},setTranslateExtent:N=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:S}=y();if(!S)return;const b=m.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]),j=N.reduce((k,_)=>_.selected?[...k,tr(_.id,!1)]:k,[]);v(b),g(j)},setNodeExtent:N=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:S,elevateNodesOnSelect:b,nodeExtent:j,zIndexMode:k}=y();N[0][0]===j[0][0]&&N[0][1]===j[0][1]&&N[1][0]===j[1][0]&&N[1][1]===j[1][1]||(Dc(m,v,g,{nodeOrigin:S,nodeExtent:N,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:k}),x({nodeExtent:N}))},panBy:N=>{const{transform:m,width:v,height:g,panZoom:S,translateExtent:b}=y();return T_({delta:N,panZoom:S,transform:m,translateExtent:b,width:v,height:g})},setCenter:async(N,m,v)=>{const{width:g,height:S,maxZoom:b,panZoom:j}=y();if(!j)return Promise.resolve(!1);const k=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await j.setViewport({x:g/2-N*k,y:S/2-m*k,zoom:k},{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:N=>{x({connection:N})},reset:()=>x({...Jm()})}},Object.is);function hP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:a,initialFitViewOptions:u,fitView:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:x}){const[y]=p.useState(()=>fP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:a,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return l.jsx(P3,{value:y,children:l.jsx(e4,{children:x})})}function mP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:a,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x}){return p.useContext(bl)?l.jsx(l.Fragment,{children:e}):l.jsx(hP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:a,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x,children:e})}const pP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function gP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onSelectionChange:A,onSelectionDragStart:C,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onBeforeDelete:z,connectionMode:F,connectionLineType:O=In.Bezier,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,deleteKeyCode:Y="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:Q=$o.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:te=Fo()?"Meta":"Control",zoomActivationKeyCode:ee=Fo()?"Meta":"Control",snapToGrid:q,snapGrid:ue,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:le,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:tn,nodesFocusable:Zn,nodeOrigin:Rs=m0,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il=!0,defaultViewport:ri=V3,minZoom:_r=.5,maxZoom:As=2,translateExtent:Cf=Do,preventScrolling:Uv=!0,nodeExtent:Rl,defaultMarkerColor:Wv="#b1b1b7",zoomOnScroll:Kv=!0,zoomOnPinch:Yv=!0,panOnScroll:Gv=!1,panOnScrollSpeed:Xv=.5,panOnScrollMode:Qv=cr.Free,zoomOnDoubleClick:qv=!0,panOnDrag:Zv=!0,onPaneClick:Jv,onPaneMouseEnter:e1,onPaneMouseMove:t1,onPaneMouseLeave:n1,onPaneScroll:r1,onPaneContextMenu:s1,paneClickDistance:o1=1,nodeClickDistance:i1=0,children:a1,onReconnect:l1,onReconnectStart:u1,onReconnectEnd:c1,onEdgeContextMenu:d1,onEdgeDoubleClick:f1,onEdgeMouseEnter:h1,onEdgeMouseMove:m1,onEdgeMouseLeave:p1,reconnectRadius:g1=10,onNodesChange:x1,onEdgesChange:y1,noDragClassName:v1="nodrag",noWheelClassName:w1="nowheel",noPanClassName:Ef="nopan",fitView:_f,fitViewOptions:Pf,connectOnClick:N1,attributionPosition:S1,proOptions:b1,defaultEdgeOptions:k1,elevateNodesOnSelect:j1=!0,elevateEdgesOnSelect:C1=!1,disableKeyboardA11y:Mf=!1,autoPanOnConnect:E1,autoPanOnNodeDrag:_1,autoPanSpeed:P1,connectionRadius:M1,isValidConnection:I1,onError:R1,style:T1,id:If,nodeDragThreshold:L1,connectionDragThreshold:A1,viewport:z1,onViewportChange:D1,width:$1,height:O1,colorMode:F1="light",debug:H1,onScroll:si,ariaLabelConfig:V1,zIndexMode:Rf="basic",...B1},U1){const Tl=If||"1",W1=K3(F1),K1=p.useCallback(Tf=>{Tf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),si==null||si(Tf)},[si]);return l.jsx("div",{"data-testid":"rf__wrapper",...B1,onScroll:K1,style:{...T1,...pP},ref:U1,className:Ie(["react-flow",s,W1]),id:If,role:"application",children:l.jsxs(mP,{nodes:e,edges:t,width:$1,height:O1,fitView:_f,fitViewOptions:Pf,minZoom:_r,maxZoom:As,nodeOrigin:Rs,nodeExtent:Rl,zIndexMode:Rf,children:[l.jsx(dP,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:j,nodeTypes:o,edgeTypes:i,connectionLineType:O,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:K,selectionKeyCode:G,selectionOnDrag:V,selectionMode:Q,deleteKeyCode:Y,multiSelectionKeyCode:te,panActivationKeyCode:se,zoomActivationKeyCode:ee,onlyRenderVisibleElements:he,defaultViewport:ri,translateExtent:Cf,minZoom:_r,maxZoom:As,preventScrolling:Uv,zoomOnScroll:Kv,zoomOnPinch:Yv,zoomOnDoubleClick:qv,panOnScroll:Gv,panOnScrollSpeed:Xv,panOnScrollMode:Qv,panOnDrag:Zv,onPaneClick:Jv,onPaneMouseEnter:e1,onPaneMouseMove:t1,onPaneMouseLeave:n1,onPaneScroll:r1,onPaneContextMenu:s1,paneClickDistance:o1,nodeClickDistance:i1,onSelectionContextMenu:D,onSelectionStart:E,onSelectionEnd:P,onReconnect:l1,onReconnectStart:u1,onReconnectEnd:c1,onEdgeContextMenu:d1,onEdgeDoubleClick:f1,onEdgeMouseEnter:h1,onEdgeMouseMove:m1,onEdgeMouseLeave:p1,reconnectRadius:g1,defaultMarkerColor:Wv,noDragClassName:v1,noWheelClassName:w1,noPanClassName:Ef,rfId:Tl,disableKeyboardA11y:Mf,nodeExtent:Rl,viewport:z1,onViewportChange:D1}),l.jsx(W3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:N,onClickConnectEnd:m,nodesDraggable:Be,autoPanOnNodeFocus:wn,nodesConnectable:tn,nodesFocusable:Zn,edgesFocusable:Ts,edgesReconnectable:Ls,elementsSelectable:Il,elevateNodesOnSelect:j1,elevateEdgesOnSelect:C1,minZoom:_r,maxZoom:As,nodeExtent:Rl,onNodesChange:x1,onEdgesChange:y1,snapToGrid:q,snapGrid:ue,connectionMode:F,translateExtent:Cf,connectOnClick:N1,defaultEdgeOptions:k1,fitView:_f,fitViewOptions:Pf,onNodesDelete:$,onEdgesDelete:R,onDelete:T,onNodeDragStart:k,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:C,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Ef,nodeOrigin:Rs,rfId:Tl,autoPanOnConnect:E1,autoPanOnNodeDrag:_1,autoPanSpeed:P1,onError:R1,connectionRadius:M1,isValidConnection:I1,selectNodesOnDrag:le,nodeDragThreshold:L1,connectionDragThreshold:A1,onBeforeDelete:z,debug:H1,ariaLabelConfig:V1,zIndexMode:Rf}),l.jsx(H3,{onSelectionChange:A}),a1,l.jsx(z3,{proOptions:b1,position:S1}),l.jsx(A3,{rfId:Tl,disableKeyboardA11y:Mf})]})})}var xP=g0(gP);function yP({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ie(["react-flow__background-pattern",n,r])})}function vP({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:Ie(["react-flow__background-pattern","dots",t])})}var Vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vn||(Vn={}));const wP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},NP=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:a,style:u,className:c,patternClassName:h}){const d=p.useRef(null),{transform:f,patternId:x}=ie(NP,ve),y=r||wP[t],w=t===Vn.Dots,N=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],S=Array.isArray(o)?o:[o,o],b=N?[g,g]:v,j=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],k=`${x}${e||""}`;return l.jsxs("svg",{className:Ie(["react-flow__background",c]),style:{...u,...jl,"--xy-background-color-props":a,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[l.jsx("pattern",{id:k,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:w?l.jsx(vP,{radius:g/2,className:h}):l.jsx(yP,{dimensions:b,lineWidth:s,variant:t,className:h})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}F0.displayName="Background";const SP=p.memo(F0);function bP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function jP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 CP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 EP(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 Ri({children:e,className:t,...n}){return l.jsx("button",{type:"button",className:Ie(["react-flow__controls-button",t]),...n,children:e})}const _P=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:a,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=we(),{isInteractive:w,minZoomReached:N,maxZoomReached:m,ariaLabelConfig:v}=ie(_P,ve),{zoomIn:g,zoomOut:S,fitView:b}=pf(),j=()=>{g(),o==null||o()},k=()=>{S(),i==null||i()},_=()=>{b(s),a==null||a()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},$=f==="horizontal"?"horizontal":"vertical";return l.jsxs(kl,{className:Ie(["react-flow__controls",$,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(Ri,{onClick:j,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:l.jsx(bP,{})}),l.jsx(Ri,{onClick:k,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:N,children:l.jsx(kP,{})})]}),n&&l.jsx(Ri,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:l.jsx(jP,{})}),r&&l.jsx(Ri,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?l.jsx(EP,{}):l.jsx(CP,{})}),h]})}H0.displayName="Controls";const PP=p.memo(H0);function MP({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:a,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:w}=o||{},N=i||y||w;return l.jsx("rect",{className:Ie(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:N,stroke:a,strokeWidth:u},shapeRendering:d,onClick:x?m=>x(m,e):void 0})}const IP=p.memo(MP),RP=e=>e.nodes.map(t=>t.id),yu=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=IP,onClick:i}){const a=ie(RP,ve),u=yu(t),c=yu(e),h=yu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:a.map(f=>l.jsx(AP,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function LP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:a,onClick:u}){const{node:c,x:h,y:d,width:f,height:x}=ie(y=>{const{internals:w}=y.nodeLookup.get(e),N=w.userNode,{x:m,y:v}=w.positionAbsolute,{width:g,height:S}=vn(N);return{node:N,x:m,y:v,width:g,height:S}},ve);return!c||c.hidden||!Fy(c)?null:l.jsx(a,{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 AP=p.memo(LP);var zP=p.memo(TP);const DP=200,$P=150,OP=e=>!e.hidden,FP=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(Jo(e.nodeLookup,{filter:OP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},HP="react-flow__minimap-desc";function V0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:N=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:S=5}){const b=we(),j=p.useRef(null),{boundingRect:k,viewBB:_,rfId:I,panZoom:$,translateExtent:R,flowWidth:T,flowHeight:A,ariaLabelConfig:C}=ie(FP,ve),L=(e==null?void 0:e.width)??DP,M=(e==null?void 0:e.height)??$P,D=k.width/L,E=k.height/M,P=Math.max(D,E),z=P*L,F=P*M,O=S*P,U=k.x-(z-k.width)/2-O,B=k.y-(F-k.height)/2-O,K=z+O*2,Y=F+O*2,G=`${HP}-${I}`,V=p.useRef(0),Q=p.useRef();V.current=P,p.useEffect(()=>{if(j.current&&$)return Q.current=V_({domNode:j.current,panZoom:$,getTransform:()=>b.getState().transform,getViewScale:()=>V.current}),()=>{var q;(q=Q.current)==null||q.destroy()}},[$]),p.useEffect(()=>{var q;(q=Q.current)==null||q.update({translateExtent:R,width:T,height:A,inversePan:v,pannable:w,zoomStep:g,zoomable:N})},[w,N,v,g,R,T,A]);const se=x?q=>{var le;const[ue,he]=((le=Q.current)==null?void 0:le.pointer(q))||[0,0];x(q,{x:ue,y:he})}:void 0,te=y?p.useCallback((q,ue)=>{const he=b.getState().nodeLookup.get(ue).internals.userNode;y(q,he)},[]):void 0,ee=m??C["minimap.ariaLabel"];return l.jsx(kl,{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:Ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:L,height:M,viewBox:`${U} ${B} ${K} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:j,onClick:se,children:[ee&&l.jsx("title",{id:G,children:ee}),l.jsx(zP,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:a}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-O},${B-O}h${K+O*2}v${Y+O*2}h${-K-O*2}z
343
+ M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}V0.displayName="MiniMap";p.memo(V0);const VP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[vs.Line]:"right",[vs.Handle]:"bottom-right"};function UP({nodeId:e,position:t,variant:n=vs.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:a=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:N,onResizeEnd:m}){const v=w0(),g=typeof e=="string"?e:v,S=we(),b=p.useRef(null),j=n===vs.Handle,k=ie(p.useCallback(VP(j&&x),[j,x]),ve),_=p.useRef(null),I=t??BP[n];p.useEffect(()=>{if(!(!b.current||!g))return _.current||(_.current=n3({domNode:b.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,domNode:M}=S.getState();return{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:C,nodeOrigin:L,paneDomNode:M}},onChange:(R,T)=>{const{triggerNodeChanges:A,nodeLookup:C,parentLookup:L,nodeOrigin:M}=S.getState(),D=[],E={x:R.x,y:R.y},P=C.get(g);if(P&&P.expandParent&&P.parentId){const z=P.origin??M,F=R.width??P.measured.width??0,O=R.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:F,height:O,...Hy({x:R.x??P.position.x,y:R.y??P.position.y},{width:F,height:O},P.parentId,C,z)}},B=mf([U],C,L,M);D.push(...B),E.x=R.x?Math.max(z[0]*F,R.x):void 0,E.y=R.y?Math.max(z[1]*O,R.y):void 0}if(E.x!==void 0&&E.y!==void 0){const z={id:g,type:"position",position:{...E}};D.push(z)}if(R.width!==void 0&&R.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};D.push(F)}for(const z of T){const F={...z,type:"position"};D.push(F)}A(D)},onEnd:({width:R,height:T})=>{const A={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:T}};S.getState().triggerNodeChanges([A])}})),_.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:N,onResizeEnd:m,shouldResize:y}),()=>{var R;(R=_.current)==null||R.destroy()}},[I,a,u,c,h,d,w,N,m,y]);const $=I.split("-");return l.jsx("div",{className:Ie(["react-flow__resize-control","nodrag",...$,n,r]),ref:b,style:{...s,scale:k,...i&&{[j?"backgroundColor":"borderColor"]:i}},children:o})}p.memo(UP);function WP(){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 KP(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[s,o]=p.useState(!0),i=WP();p.useEffect(()=>{Promise.all([re.discovery.agents(),re.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:a,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",N=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:N}},[e,n,i]);return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),l.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:l.jsxs(xP,{nodes:a,edges:u,fitView:!0,proOptions:{hideAttribution:!0},children:[l.jsx(SP,{color:i?"#27272a":"#e4e4e7",gap:20}),l.jsx(PP,{})]})})]})}const xf=p.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Pe("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}));xf.displayName="Textarea";const qe=p.forwardRef(({className:e,...t},n)=>l.jsx("label",{ref:n,className:Pe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));qe.displayName="Label";function He(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 YP(e,t){const n=p.createContext(t);function r(o){const{children:i,...a}=o,u=p.useMemo(()=>a,Object.values(a));return l.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 El(e,t=[]){let n=[];function r(o,i){const a=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])||a,N=p.useMemo(()=>y,Object.values(y));return l.jsx(w.Provider,{value:N,children:x})}function h(d,f){const x=(f==null?void 0:f[e][u])||a,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(a){const u=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return s.scopeName=e,[r,GP(s,...t)]}function GP(...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((a,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function XP(e){const t=e+"CollectionProvider",[n,r]=El(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,N=Bt.useRef(null),m=Bt.useRef(new Map).current;return l.jsx(s,{scope:y,itemMap:m,collectionRef:N,children:w})};i.displayName=t;const a=e+"CollectionSlot",u=Bt.forwardRef((x,y)=>{const{scope:w,children:N}=x,m=o(a,w),v=Zt(y,m.collectionRef);return l.jsx(fs,{ref:v,children:N})});u.displayName=a;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Bt.forwardRef((x,y)=>{const{scope:w,children:N,...m}=x,v=Bt.useRef(null),g=Zt(y,v),S=o(c,w);return Bt.useEffect(()=>(S.itemMap.set(v,{ref:v,...m}),()=>void S.itemMap.delete(v))),l.jsx(fs,{[h]:"",ref:g,children:N})});d.displayName=c;function f(x){const y=o(e+"CollectionConsumer",x);return Bt.useCallback(()=>{const N=y.collectionRef.current;if(!N)return[];const m=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,b)=>m.indexOf(S.ref.current)-m.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var Wa=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},QP=uw.useId||(()=>{}),qP=0;function mo(e){const[t,n]=p.useState(QP());return Wa(()=>{n(r=>r??String(qP++))},[e]),t?`radix-${t}`:""}var ZP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],et=ZP.reduce((e,t)=>{const n=p.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?fs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function JP(e,t){e&&ul.flushSync(()=>e.dispatchEvent(t))}function Gn(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 yf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=e5({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,a=Gn(n),u=p.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else s(c)},[o,e,s,a]);return[i,u]}function e5({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,s=p.useRef(r),o=Gn(t);return p.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var t5=p.createContext(void 0);function B0(e){const t=p.useContext(t5);return e||t||"ltr"}var vu="rovingFocusGroup.onEntryFocus",n5={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Fc,U0,r5]=XP(_l),[s5,W0]=El(_l,[r5]),[o5,i5]=s5(_l),K0=p.forwardRef((e,t)=>l.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(a5,{...e,ref:t})})}));K0.displayName=_l;var a5=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),x=Zt(t,f),y=B0(o),[w=null,N]=yf({prop:i,defaultProp:a,onChange:u}),[m,v]=p.useState(!1),g=Gn(c),S=U0(n),b=p.useRef(!1),[j,k]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(vu,g),()=>_.removeEventListener(vu,g)},[g]),l.jsx(o5,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:p.useCallback(_=>N(_),[N]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>k(_=>_-1),[]),children:l.jsx(et.div,{tabIndex:m||j===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,_=>{const I=!b.current;if(_.target===_.currentTarget&&I&&!m){const $=new CustomEvent(vu,n5);if(_.currentTarget.dispatchEvent($),!$.defaultPrevented){const R=S().filter(M=>M.focusable),T=R.find(M=>M.active),A=R.find(M=>M.id===w),L=[T,A,...R].filter(Boolean).map(M=>M.ref.current);X0(L,h)}}b.current=!1}),onBlur:He(e.onBlur,()=>v(!1))})})}),Y0="RovingFocusGroupItem",G0=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,a=mo(),u=o||a,c=i5(Y0,n),h=c.currentTabStopId===u,d=U0(n),{onFocusableItemAdd:f,onFocusableItemRemove:x}=c;return p.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),l.jsx(Fc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(et.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:He(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:He(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:He(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=c5(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?d5(m,v+1):m.slice(v+1)}setTimeout(()=>X0(m))}})})})});G0.displayName=Y0;var l5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c5(e,t,n){const r=u5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return l5[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 d5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var f5=K0,h5=G0;function m5(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var ni=e=>{const{present:t,children:n}=e,r=p5(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Zt(r.ref,g5(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};ni.displayName="Presence";function p5(e){const[t,n]=p.useState(),r=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[a,u]=m5(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Ti(r.current);o.current=a==="mounted"?c:"none"},[a]),Wa(()=>{const c=r.current,h=s.current;if(h!==e){const f=o.current,x=Ti(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]),Wa(()=>{if(t){const c=d=>{const x=Ti(r.current).includes(d.animationName);d.target===t&&x&&ul.flushSync(()=>u("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=Ti(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(a),ref:p.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ti(e){return(e==null?void 0:e.animationName)||"none"}function g5(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 vf="Tabs",[x5]=El(vf,[W0]),Q0=W0(),[y5,wf]=x5(vf),q0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,h=B0(a),[d,f]=yf({prop:r,onChange:s,defaultProp:o});return l.jsx(y5,{scope:n,baseId:mo(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:l.jsx(et.div,{dir:h,"data-orientation":i,...c,ref:t})})});q0.displayName=vf;var Z0="TabsList",J0=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=wf(Z0,n),i=Q0(n);return l.jsx(f5,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(et.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=wf(ev,n),a=Q0(n),u=sv(i.baseId,r),c=ov(i.baseId,r),h=r===i.value;return l.jsx(h5,{asChild:!0,...a,focusable:!s,active:h,children:l.jsx(et.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:He(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:He(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,a=wf(nv,n),u=sv(a.baseId,r),c=ov(a.baseId,r),h=r===a.value,d=p.useRef(h);return p.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(ni,{present:s||h,children:({present:f})=>l.jsx(et.div,{"data-state":h?"active":"inactive","data-orientation":a.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 v5=q0,iv=J0,av=tv,lv=rv;const Nf=v5,Pl=p.forwardRef(({className:e,...t},n)=>l.jsx(iv,{ref:n,className:Pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Pl.displayName=iv.displayName;const ut=p.forwardRef(({className:e,...t},n)=>l.jsx(av,{ref:n,className:Pe("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}));ut.displayName=av.displayName;const ct=p.forwardRef(({className:e,...t},n)=>l.jsx(lv,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ct.displayName=lv.displayName;function w5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(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 N5="DismissableLayer",Hc="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",b5="dismissableLayer.focusOutside",ep,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:a,...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,k=>d(k)),w=Array.from(c.layers),[N]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(N),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=m,b=C5(k=>{const _=k.target,I=[...c.branches].some($=>$.contains(_));!S||I||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},f),j=E5(k=>{const _=k.target;[...c.branches].some($=>$.contains(_))||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},f);return w5(k=>{v===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),p.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ep=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),tp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ep)}},[h,f,n,c]),p.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),tp())},[h,c]),p.useEffect(()=>{const k=()=>x({});return document.addEventListener(Hc,k),()=>document.removeEventListener(Hc,k)},[]),l.jsx(et.div,{...u,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,j.onFocusCapture),onBlurCapture:He(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,b.onPointerDownCapture)})});cv.displayName=N5;var k5="DismissableLayerBranch",j5=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]),l.jsx(et.div,{...e,ref:s})});j5.displayName=k5;function C5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){dv(S5,n,c,{discrete:!0})};const c={originalEvent:a};a.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 E5(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&dv(b5,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 tp(){const e=new CustomEvent(Hc);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?JP(s,o):s.dispatchEvent(o)}var wu="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",np={bubbles:!1,cancelable:!0},_5="FocusScope",fv=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,u]=p.useState(null),c=Gn(s),h=Gn(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||!a)return;const S=g.target;a.contains(S)?d.current=S:Cn(d.current,{select:!0})},N=function(g){if(x.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||Cn(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const b of g)b.removedNodes.length>0&&Cn(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const v=new MutationObserver(m);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),v.disconnect()}}},[r,a,x.paused]),p.useEffect(()=>{if(a){sp.add(x);const w=document.activeElement;if(!a.contains(w)){const m=new CustomEvent(wu,np);a.addEventListener(wu,c),a.dispatchEvent(m),m.defaultPrevented||(P5(L5(hv(a)),{select:!0}),document.activeElement===w&&Cn(a))}return()=>{a.removeEventListener(wu,c),setTimeout(()=>{const m=new CustomEvent(Nu,np);a.addEventListener(Nu,h),a.dispatchEvent(m),m.defaultPrevented||Cn(w??document.body,{select:!0}),a.removeEventListener(Nu,h),sp.remove(x)},0)}}},[a,c,h,x]);const y=p.useCallback(w=>{if(!n&&!r||x.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,m=document.activeElement;if(N&&m){const v=w.currentTarget,[g,S]=M5(v);g&&S?!w.shiftKey&&m===S?(w.preventDefault(),n&&Cn(g,{select:!0})):w.shiftKey&&m===g&&(w.preventDefault(),n&&Cn(S,{select:!0})):m===v&&w.preventDefault()}},[n,r,x.paused]);return l.jsx(et.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});fv.displayName=_5;function P5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cn(r,{select:t}),document.activeElement!==n)return}function M5(e){const t=hv(e),n=rp(t,e),r=rp(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 rp(e,t){for(const n of e)if(!I5(n,{upTo:t}))return n}function I5(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 R5(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&&R5(e)&&t&&e.select()}}var sp=T5();function T5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=op(e,t),e.unshift(t)},remove(t){var n;e=op(e,t),(n=e[0])==null||n.resume()}}}function op(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function L5(e){return e.filter(t=>t.tagName!=="A")}var A5="Portal",mv=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=p.useState(!1);Wa(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?w2.createPortal(l.jsx(et.div,{...r,ref:t}),i):null});mv.displayName=A5;var Su=0;function z5(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ip()),document.body.insertAdjacentElement("beforeend",e[1]??ip()),Su++,()=>{Su===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Su--}},[])}function ip(){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 Kt=function(){return Kt=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},Kt.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 D5(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 sa="right-scroll-bar-position",oa="width-before-scroll-bar",$5="with-scroll-bars-hidden",O5="--removed-body-scroll-bar-size";function bu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function F5(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 H5=typeof window<"u"?p.useLayoutEffect:p.useEffect,ap=new WeakMap;function V5(e,t){var n=F5(null,function(r){return e.forEach(function(s){return bu(s,r)})});return H5(function(){var r=ap.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||bu(a,null)}),o.forEach(function(a){s.has(a)||bu(a,i)})}ap.set(n,e)},[e]),n}function B5(e){return e}function U5(e,t){t===void 0&&(t=B5);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(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.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 W5(e){e===void 0&&(e={});var t=U5(null);return t.options=Kt({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,Kt({},n))};gv.isSideCarExport=!0;function K5(e,t){return e.useMedium(t),gv}var xv=W5(),ku=function(){},Ml=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,a=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,N=e.as,m=N===void 0?"div":N,v=e.gapMode,g=pv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,b=V5([n,t]),j=Kt(Kt({},g),s);return p.createElement(p.Fragment,null,h&&p.createElement(S,{sideCar:xv,removeScrollBar:c,shards:d,noIsolation:x,inert:y,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?p.cloneElement(p.Children.only(a),Kt(Kt({},j),{ref:b})):p.createElement(m,Kt({},j,{className:u,ref:b}),a))});Ml.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ml.classNames={fullWidth:oa,zeroRight:sa};var Y5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function G5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Y5();return t&&e.setAttribute("nonce",t),e}function X5(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 q5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=G5())&&(X5(t,n),Q5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Z5=function(){var e=q5();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yv=function(){var e=Z5(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},J5={left:0,top:0,right:0,gap:0},ju=function(e){return parseInt(e||"",10)||0},eM=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)]},tM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return J5;var t=eM(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])}},nM=yv(),ns="data-scroll-locked",rM=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
344
+ .`.concat($5,` {
345
345
  overflow: hidden `).concat(r,`;
346
346
  padding-right: `).concat(a,"px ").concat(r,`;
347
347
  }
@@ -375,24 +375,24 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
375
375
  }
376
376
 
377
377
  body[`).concat(ns,`] {
378
- `).concat(F5,": ").concat(a,`px;
378
+ `).concat(O5,": ").concat(a,`px;
379
379
  }
380
- `)},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")})},Vc=!1;if(typeof window<"u")try{var Ti=Object.defineProperty({},"passive",{get:function(){return Vc=!0,!0}});window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{Vc=!1}var Ir=Vc?{passive:!1}:!1,aM=function(e){return e.tagName==="TEXTAREA"},wv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aM(e)&&n[t]==="visible")},lM=function(e){return wv(e,"overflowY")},uM=function(e){return wv(e,"overflowX")},up=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Nv(e,r);if(s){var o=Sv(e,r),i=o[1],a=o[2];if(i>a)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]},Nv=function(e,t){return e==="v"?lM(t):uM(t)},Sv=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,a=n.target,u=t.contains(a),c=!1,h=i>0,d=0,f=0;do{var x=Sv(e,a),y=x[0],w=x[1],N=x[2],m=w-N-o*y;(y||m)&&Nv(e,a)&&(d+=m,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));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]},cp=function(e){return[e.deltaX,e.deltaY]},dp=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`
380
+ `)},lp=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},sM=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())}},[])},oM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;sM();var o=p.useMemo(function(){return tM(s)},[s]);return p.createElement(nM,{styles:rM(o,!t,s,n?"":"!important")})},Vc=!1;if(typeof window<"u")try{var Li=Object.defineProperty({},"passive",{get:function(){return Vc=!0,!0}});window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Vc=!1}var Ir=Vc?{passive:!1}:!1,iM=function(e){return e.tagName==="TEXTAREA"},vv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iM(e)&&n[t]==="visible")},aM=function(e){return vv(e,"overflowY")},lM=function(e){return vv(e,"overflowX")},up=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],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cM=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):lM(t)},Nv=function(e,t){return e==="v"?uM(t):cM(t)},dM=function(e,t){return e==="h"&&t==="rtl"?-1:1},fM=function(e,t,n,r,s){var o=dM(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,u=t.contains(a),c=!1,h=i>0,d=0,f=0;do{var x=Nv(e,a),y=x[0],w=x[1],N=x[2],m=w-N-o*y;(y||m)&&wv(e,a)&&(d+=m,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Ai=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cp=function(e){return[e.deltaX,e.deltaY]},dp=function(e){return e&&"current"in e?e.current:e},hM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mM=function(e){return`
381
381
  .block-interactivity-`.concat(e,` {pointer-events: none;}
382
382
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
383
- `)},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(vv)[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(dp),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(w,N){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],S="deltaY"in w?w.deltaY:v[1]-m[1],b,j=w.target,k=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in w&&k==="h"&&j.type==="range")return!1;var _=up(k,j);if(!_)return!0;if(_?b=k:(b=k==="v"?"h":"v",_=up(k,j)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||S)&&(r.current=b),!b)return!0;var I=r.current||b;return hM(I,N,w,I==="h"?g:S)},[]),u=p.useCallback(function(w){var N=w;if(!(!Rr.length||Rr[Rr.length-1]!==o)){var m="deltaY"in N?cp(N):Li(N),v=t.current.filter(function(b){return b.name===N.type&&(b.target===N.target||N.target===b.shadowParent)&&mM(b.delta,m)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(dp).filter(Boolean).filter(function(b){return b.contains(N.target)}),S=g.length>0?a(N,g[0]):!i.current.noIsolation;S&&N.cancelable&&N.preventDefault()}}},[]),c=p.useCallback(function(w,N,m,v){var g={name:w,delta:N,target:m,should:v,shadowParent:yM(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),h=p.useCallback(function(w){n.current=Li(w),r.current=void 0},[]),d=p.useCallback(function(w){c(w.type,cp(w),w.target,a(w,e.lockRef.current))},[]),f=p.useCallback(function(w){c(w.type,Li(w),w.target,a(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=Y5(yv,xM);var bv=p.forwardRef(function(e,t){return p.createElement(Ml,Yt({},e,{ref:t,sideCar:vM}))});bv.classNames=Ml.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,kv=function(e){return e&&(e.host||kv(e.parentNode))},NM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kv(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=[],a=new Set,u=new Set(s),c=function(d){!d||a.has(d)||(a.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(a.has(f))h(f);else try{var x=f.getAttribute(r),y=x!==null&&x!=="false",w=(Tr.get(f)||0)+1,N=(o.get(f)||0)+1;Tr.set(f,w),o.set(f,N),i.push(f),w===1&&y&&Ai.set(f,!0),N===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),a.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}},Sf="Dialog",[jv]=El(Sf),[kM,Ht]=jv(Sf),Cv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=p.useRef(null),u=p.useRef(null),[c=!1,h]=yf({prop:r,defaultProp:s,onChange:o});return l.jsx(kM,{scope:t,triggerRef:a,contentRef:u,contentId:mo(),titleId:mo(),descriptionId:mo(),open:c,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};Cv.displayName=Sf;var Ev="DialogTrigger",jM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Ev,n),o=Zt(t,s.triggerRef);return l.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":jf(s.open),...r,ref:o,onClick:He(e.onClick,s.onOpenToggle)})});jM.displayName=Ev;var bf="DialogPortal",[CM,_v]=jv(bf,{forceMount:void 0}),Pv=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ht(bf,t);return l.jsx(CM,{scope:t,forceMount:n,children:p.Children.map(r,i=>l.jsx(ti,{present:n||o.open,children:l.jsx(pv,{asChild:!0,container:s,children:i})}))})};Pv.displayName=bf;var Ka="DialogOverlay",Mv=p.forwardRef((e,t)=>{const n=_v(Ka,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(Ka,e.__scopeDialog);return o.modal?l.jsx(ti,{present:r||o.open,children:l.jsx(EM,{...s,ref:t})}):null});Mv.displayName=Ka;var EM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Ka,n);return l.jsx(bv,{as:fs,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(et.div,{"data-state":jf(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Iv=p.forwardRef((e,t)=>{const n=_v(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(Sr,e.__scopeDialog);return l.jsx(ti,{present:r||o.open,children:o.modal?l.jsx(_M,{...s,ref:t}):l.jsx(PM,{...s,ref:t})})});Iv.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)},[]),l.jsx(Rv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:He(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 l.jsx(Rv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.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()}})}),Rv=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Ht(Sr,n),u=p.useRef(null),c=Zt(t,u);return D5(),l.jsxs(l.Fragment,{children:[l.jsx(hv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(dv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":jf(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(MM,{titleId:a.titleId}),l.jsx(RM,{contentRef:u,descriptionId:a.descriptionId})]})]})}),kf="DialogTitle",Tv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(kf,n);return l.jsx(et.h2,{id:s.titleId,...r,ref:t})});Tv.displayName=kf;var Lv="DialogDescription",Av=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Lv,n);return l.jsx(et.p,{id:s.descriptionId,...r,ref:t})});Av.displayName=Lv;var zv="DialogClose",Dv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(zv,n);return l.jsx(et.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>s.onOpenChange(!1))})});Dv.displayName=zv;function jf(e){return e?"open":"closed"}var $v="DialogTitleWarning",[yI,Ov]=GP($v,{contentName:Sr,titleName:kf,docsSlug:"dialog"}),MM=({titleId:e})=>{const t=Ov($v),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
383
+ `)},pM=0,Rr=[];function gM(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(pM++)[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=D5([e.lockRef.current],(e.shards||[]).map(dp),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(w,N){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var m=Ai(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-m[0],S="deltaY"in w?w.deltaY:v[1]-m[1],b,j=w.target,k=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in w&&k==="h"&&j.type==="range")return!1;var _=up(k,j);if(!_)return!0;if(_?b=k:(b=k==="v"?"h":"v",_=up(k,j)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||S)&&(r.current=b),!b)return!0;var I=r.current||b;return fM(I,N,w,I==="h"?g:S)},[]),u=p.useCallback(function(w){var N=w;if(!(!Rr.length||Rr[Rr.length-1]!==o)){var m="deltaY"in N?cp(N):Ai(N),v=t.current.filter(function(b){return b.name===N.type&&(b.target===N.target||N.target===b.shadowParent)&&hM(b.delta,m)})[0];if(v&&v.should){N.cancelable&&N.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(dp).filter(Boolean).filter(function(b){return b.contains(N.target)}),S=g.length>0?a(N,g[0]):!i.current.noIsolation;S&&N.cancelable&&N.preventDefault()}}},[]),c=p.useCallback(function(w,N,m,v){var g={name:w,delta:N,target:m,should:v,shadowParent:xM(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),h=p.useCallback(function(w){n.current=Ai(w),r.current=void 0},[]),d=p.useCallback(function(w){c(w.type,cp(w),w.target,a(w,e.lockRef.current))},[]),f=p.useCallback(function(w){c(w.type,Ai(w),w.target,a(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:mM(s)}):null,x?p.createElement(oM,{gapMode:e.gapMode}):null)}function xM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yM=K5(xv,gM);var Sv=p.forwardRef(function(e,t){return p.createElement(Ml,Kt({},e,{ref:t,sideCar:yM}))});Sv.classNames=Ml.classNames;var vM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tr=new WeakMap,zi=new WeakMap,Di={},Cu=0,bv=function(e){return e&&(e.host||bv(e.parentNode))},wM=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})},NM=function(e,t,n,r){var s=wM(t,Array.isArray(e)?e:[e]);Di[n]||(Di[n]=new WeakMap);var o=Di[n],i=[],a=new Set,u=new Set(s),c=function(d){!d||a.has(d)||(a.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(a.has(f))h(f);else try{var x=f.getAttribute(r),y=x!==null&&x!=="false",w=(Tr.get(f)||0)+1,N=(o.get(f)||0)+1;Tr.set(f,w),o.set(f,N),i.push(f),w===1&&y&&zi.set(f,!0),N===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),a.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||(zi.has(d)||d.removeAttribute(r),zi.delete(d)),x||d.removeAttribute(n)}),Cu--,Cu||(Tr=new WeakMap,Tr=new WeakMap,zi=new WeakMap,Di={})}},SM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=vM(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),NM(r,s,n,"aria-hidden")):function(){return null}},Sf="Dialog",[kv]=El(Sf),[bM,Ft]=kv(Sf),jv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=p.useRef(null),u=p.useRef(null),[c=!1,h]=yf({prop:r,defaultProp:s,onChange:o});return l.jsx(bM,{scope:t,triggerRef:a,contentRef:u,contentId:mo(),titleId:mo(),descriptionId:mo(),open:c,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};jv.displayName=Sf;var Cv="DialogTrigger",kM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Cv,n),o=Zt(t,s.triggerRef);return l.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":jf(s.open),...r,ref:o,onClick:He(e.onClick,s.onOpenToggle)})});kM.displayName=Cv;var bf="DialogPortal",[jM,Ev]=kv(bf,{forceMount:void 0}),_v=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ft(bf,t);return l.jsx(jM,{scope:t,forceMount:n,children:p.Children.map(r,i=>l.jsx(ni,{present:n||o.open,children:l.jsx(mv,{asChild:!0,container:s,children:i})}))})};_v.displayName=bf;var Ka="DialogOverlay",Pv=p.forwardRef((e,t)=>{const n=Ev(Ka,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ft(Ka,e.__scopeDialog);return o.modal?l.jsx(ni,{present:r||o.open,children:l.jsx(CM,{...s,ref:t})}):null});Pv.displayName=Ka;var CM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Ka,n);return l.jsx(Sv,{as:fs,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(et.div,{"data-state":jf(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=Ft(Sr,e.__scopeDialog);return l.jsx(ni,{present:r||o.open,children:o.modal?l.jsx(EM,{...s,ref:t}):l.jsx(_M,{...s,ref:t})})});Mv.displayName=Sr;var EM=p.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=p.useRef(null),s=Zt(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return SM(o)},[]),l.jsx(Iv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault())})}),_M=p.forwardRef((e,t)=>{const n=Ft(Sr,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return l.jsx(Iv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.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,a=Ft(Sr,n),u=p.useRef(null),c=Zt(t,u);return z5(),l.jsxs(l.Fragment,{children:[l.jsx(fv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(cv,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":jf(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(PM,{titleId:a.titleId}),l.jsx(IM,{contentRef:u,descriptionId:a.descriptionId})]})]})}),kf="DialogTitle",Rv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(kf,n);return l.jsx(et.h2,{id:s.titleId,...r,ref:t})});Rv.displayName=kf;var Tv="DialogDescription",Lv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Tv,n);return l.jsx(et.p,{id:s.descriptionId,...r,ref:t})});Lv.displayName=Tv;var Av="DialogClose",zv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ft(Av,n);return l.jsx(et.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>s.onOpenChange(!1))})});zv.displayName=Av;function jf(e){return e?"open":"closed"}var Dv="DialogTitleWarning",[yI,$v]=YP(Dv,{contentName:Sr,titleName:kf,docsSlug:"dialog"}),PM=({titleId:e})=>{const t=$v(Dv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
384
384
 
385
385
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
386
386
 
387
- 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 {${Ov(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=Cv,LM=Pv,Fv=Mv,Hv=Iv,Vv=Tv,Bv=Av,AM=Dv;const Ps=TM,zM=LM,Uv=p.forwardRef(({className:e,...t},n)=>l.jsx(Fv,{ref:n,className:Pe("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}));Uv.displayName=Fv.displayName;const jr=p.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(zM,{children:[l.jsx(Uv,{}),l.jsxs(Hv,{ref:r,className:Pe("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,l.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:[l.jsx(tk,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jr.displayName=Hv.displayName;const Ms=({className:e,...t})=>l.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Is=({className:e,...t})=>l.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Cr=p.forwardRef(({className:e,...t},n)=>l.jsx(Vv,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Cr.displayName=Vv.displayName;const Er=p.forwardRef(({className:e,...t},n)=>l.jsx(Bv,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Er.displayName=Bv.displayName;function DM({message:e,type:t,onClose:n}){return p.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:e}),l.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,a]=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"),a("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(()=>{oe.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?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."}):e.length===0?l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(fl,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),l.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Connect an agent with the Guards plugin to get started"})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),l.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=>l.jsxs("option",{value:y.registeredAgentId??y.id,children:[y.emoji?`${y.emoji} `:"",y.name]},y.registeredAgentId??y.id))})]})]}),n&&l.jsxs(Nf,{value:i,onValueChange:a,className:"w-full",children:[l.jsxs(Pl,{children:[l.jsxs(yt,{value:"skills",children:[l.jsx(ur,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),l.jsxs(yt,{value:"commands",children:[l.jsx(ds,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),l.jsxs(yt,{value:"config",children:[l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),l.jsx(vt,{value:"skills",children:l.jsx(OM,{agentId:n,agents:e,onCommandSent:f,onCommandError:x})}),l.jsx(vt,{value:"commands",children:l.jsx(FM,{agentId:n,refreshRef:h})}),l.jsx(vt,{value:"config",children:l.jsx(HM,{agentId:n,onCommandSent:f,onCommandError:x})})]}),u&&l.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,a]=p.useState(!1),[u,c]=p.useState(null);return l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsx("div",{className:"flex gap-2",children:l.jsxs(Q,{size:"sm",onClick:()=>a(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(ur,{className:"h-4 w-4"})," Installed Skills (",o.length,")"]})}),l.jsx(_e,{children:o.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[l.jsx(ur,{className:"h-10 w-10 text-muted-foreground/20"}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground/70",children:["Install skills from ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," or provide custom skill content"]})]}),l.jsx(Q,{size:"sm",variant:"outline",onClick:()=>a(!0),children:"Install your first skill"})]}):l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:o.map(h=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:l.jsx(ur,{className:"h-4 w-4 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&l.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description})]})]}),l.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>c(h.name),children:l.jsx($t,{className:"h-3.5 w-3.5"})})]},h.name))})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"How Skills Work"})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsxs("p",{children:["Skills are ",l.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",l.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),l.jsx("p",{children:"Skills are loaded from three locations (highest to lowest precedence):"}),l.jsxs("ol",{className:"list-inside list-decimal space-y-0.5 pl-2",children:[l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"<workspace>/skills"})," — per-agent workspace skills"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills"})," — shared managed skills"]}),l.jsx("li",{children:"Bundled skills — shipped with the OpenClaw install"})]}),l.jsxs("p",{children:["Browse and discover skills at ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Registry installs use ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),l.jsx(VM,{open:i,onOpenChange:a,agentId:e,onSuccess:n,onError:r}),l.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,a]=p.useState(null),u=p.useCallback(()=>{oe.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"?l.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?l.jsx(dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{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:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:l.jsx(_s,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:l.jsx($t,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:l.jsx($t,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:l.jsx(qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:l.jsx(ds,{className:"h-3 w-3"}),label:f};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this agent"}),l.jsxs(Q,{size:"sm",variant:"ghost",onClick:u,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(ds,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):l.jsx("div",{className:"space-y-2",children:n.map(f=>{var N,m,v;const x=d(f.type),y=i===f.id,w=f.result||f.type==="install_custom_skill"&&((N=f.payload)==null?void 0:N.content);return l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&a(y?null:f.id),children:[c(f.status),l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",l.jsx("span",{children:x.label})]}),l.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(", ")]}),l.jsx("div",{className:"flex-1"}),l.jsx(ke,{variant:h(f.status),className:"text-[10px]",children:f.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:WM(f.createdAt)}),w&&(y?l.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Gd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&w&&l.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),l.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)&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),l.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 l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(qt,{className:"h-4 w-4"})," Guards Configuration"]}),l.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-3",children:[l.jsxs("p",{children:["Send configuration updates to the Guards plugin running on this agent. Changes are merged with the existing config in ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"}),"."]}),l.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),l.jsx("span",{children:"Block tool calls when risk is detected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),l.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),l.jsx("span",{children:"Request timeout in milliseconds"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),l.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),l.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"),[a,u]=p.useState(""),[c,h]=p.useState(""),[d,f]=p.useState(!1),[x,y]=p.useState(""),w=()=>{u(""),h(""),i("registry"),y("")},N=async()=>{if(!(o==="registry"&&!a.trim())&&!(o==="custom"&&(!a.trim()||!c.trim()))){f(!0),y("");try{o==="registry"?await oe.commands.create({agentId:n,type:"install_skill",payload:{skillName:a.trim()}}):await oe.commands.create({agentId:n,type:"install_custom_skill",payload:{skillName:a.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 l.jsx(Ps,{open:e,onOpenChange:m=>{m||w(),t(m)},children:l.jsxs(jr,{className:"sm:max-w-[560px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Skill"]}),l.jsxs(Er,{children:["Install from ",l.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."]})]}),l.jsxs(Nf,{value:o,onValueChange:m=>{i(m),y("")},children:[l.jsxs(Pl,{className:"w-full",children:[l.jsxs(yt,{value:"registry",className:"flex-1",children:[l.jsx(ur,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),l.jsxs(yt,{value:"custom",className:"flex-1",children:[l.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),l.jsx(vt,{value:"registry",className:"space-y-4 pt-2",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"reg-skill-name",children:"Skill Slug"}),l.jsx($e,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:a,onChange:m=>{u(m.target.value),y("")},onKeyDown:m=>m.key==="Enter"&&N()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the agent. Browse available skills at ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),l.jsxs(vt,{value:"custom",className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-name",children:"Skill Name"}),l.jsx($e,{id:"custom-skill-name",placeholder:"my-custom-skill",value:a,onChange:m=>{u(m.target.value),y("")}})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),l.jsx(xf,{id:"custom-skill-content",placeholder:`---
387
+ 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},MM="DialogDescriptionWarning",IM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$v(MM).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},RM=jv,TM=_v,Ov=Pv,Fv=Mv,Hv=Rv,Vv=Lv,LM=zv;const Ps=RM,AM=TM,Bv=p.forwardRef(({className:e,...t},n)=>l.jsx(Ov,{ref:n,className:Pe("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)=>l.jsxs(AM,{children:[l.jsx(Bv,{}),l.jsxs(Fv,{ref:r,className:Pe("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,l.jsxs(LM,{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:[l.jsx(ek,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jr.displayName=Fv.displayName;const Ms=({className:e,...t})=>l.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Is=({className:e,...t})=>l.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Cr=p.forwardRef(({className:e,...t},n)=>l.jsx(Hv,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Cr.displayName=Hv.displayName;const Er=p.forwardRef(({className:e,...t},n)=>l.jsx(Vv,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Er.displayName=Vv.displayName;function zM({message:e,type:t,onClose:n}){return p.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:e}),l.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function DM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,a]=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 host"),a("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(()=>{re.hosts.list().then(y=>{const w=(y.data??[]).filter(N=>N.status==="online");t(w),w.length>0&&!n&&r(w[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(fl,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),l.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",l.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),l.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=>l.jsxs("option",{value:y.id,children:[y.hostname," (",y.ip||"local",")"]},y.id))})]})]}),n&&l.jsxs(Nf,{value:i,onValueChange:a,className:"w-full",children:[l.jsxs(Pl,{children:[l.jsxs(ut,{value:"skills",children:[l.jsx(cs,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),l.jsxs(ut,{value:"commands",children:[l.jsx(ds,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),l.jsxs(ut,{value:"config",children:[l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),l.jsx(ct,{value:"skills",children:l.jsx($M,{hostId:n,onCommandSent:f,onCommandError:x})}),l.jsx(ct,{value:"commands",children:l.jsx(OM,{hostId:n,refreshRef:h})}),l.jsx(ct,{value:"config",children:l.jsx(FM,{hostId:n,onCommandSent:f,onCommandError:x})})]}),u&&l.jsx(zM,{message:u.message,type:u.type,onClose:()=>c(null)})]})}function $M({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=p.useState(!1),[o,i]=p.useState(null),[a,u]=p.useState([]);p.useEffect(()=>{re.hosts.agents(e).then(h=>u(h.data??[])).catch(()=>u([]))},[e]);const c=a.flatMap(h=>((h.metadata??{}).skills??[]).map(f=>({...f,agentName:h.name})));return l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsx("div",{className:"flex gap-2",children:l.jsxs(Z,{size:"sm",onClick:()=>s(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),c.length>0&&l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(cs,{className:"h-4 w-4"})," Installed Skills (",c.length,")"]})}),l.jsx(_e,{children:l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:c.map((h,d)=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:l.jsx(cs,{className:"h-4 w-4 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&l.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description}),a.length>1&&l.jsx("p",{className:"text-[10px] text-muted-foreground/60",children:h.agentName})]})]}),l.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>i(h.name),children:l.jsx(qt,{className:"h-3.5 w-3.5"})})]},`${h.name}-${d}`))})})]}),a.length>0&&l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(fl,{className:"h-4 w-4"})," Agents on this Host (",a.length,")"]})}),l.jsx(_e,{children:l.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:a.map(h=>{const d=h.metadata??{};return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border p-3",children:[l.jsx("span",{className:"text-lg",children:d.emoji||"🤖"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:h.name}),l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[(d.skills??[]).length," skills · ",h.status]})]})]},h.id)})})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"How Skills Work"})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsxs("p",{children:["Skills are ",l.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",l.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),l.jsxs("p",{children:["Browse and discover skills at ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Commands are executed by the CLI on the selected host via ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),l.jsx(HM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n}),l.jsx(VM,{open:o!==null,onOpenChange:h=>{h||i(null)},hostId:e,initialName:o??"",onSuccess:t,onError:n})]})}function OM({hostId:e,refreshRef:t}){const[n,r]=p.useState([]),[s,o]=p.useState(!0),[i,a]=p.useState(null),u=p.useCallback(()=>{re.hosts.commands(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"?l.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?l.jsx(at,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{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:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:l.jsx(_s,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:l.jsx(qt,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:l.jsx(Kn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:l.jsx(qt,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:l.jsx(Qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:l.jsx(ds,{className:"h-3 w-3"}),label:f};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this host"}),l.jsxs(Z,{size:"sm",variant:"ghost",onClick:u,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?l.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(ds,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):l.jsx("div",{className:"space-y-2",children:n.map(f=>{var N,m,v;const x=d(f.type),y=i===f.id,w=f.result||f.type==="install_custom_skill"&&((N=f.payload)==null?void 0:N.content);return l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&a(y?null:f.id),children:[c(f.status),l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",l.jsx("span",{children:x.label})]}),l.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(", ")]}),l.jsx("div",{className:"flex-1"}),l.jsx(ke,{variant:h(f.status),className:"text-[10px]",children:f.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:UM(f.createdAt)}),w&&(y?l.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Gd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&w&&l.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),l.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)&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),l.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 FM({hostId:e,onCommandSent:t,onCommandError:n}){const[r,s]=p.useState(!1);return l.jsxs("div",{className:"space-y-4 pt-4",children:[l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Qt,{className:"h-4 w-4"})," Guards Configuration"]}),l.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-3",children:[l.jsxs("p",{children:["Send configuration updates to the Guards plugin on the host. The CLI updates ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"})," on the target machine."]}),l.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),l.jsx("span",{children:"Block tool calls when risk is detected"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),l.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),l.jsx("span",{children:"Request timeout in milliseconds"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),l.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),l.jsx(BM,{open:r,onOpenChange:s,hostId:e,onSuccess:t,onError:n})]})}function HM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=p.useState("registry"),[a,u]=p.useState(""),[c,h]=p.useState(""),[d,f]=p.useState(!1),[x,y]=p.useState(""),w=()=>{u(""),h(""),i("registry"),y("")},N=async()=>{if(!(o==="registry"&&!a.trim())&&!(o==="custom"&&(!a.trim()||!c.trim()))){f(!0),y("");try{o==="registry"?await re.hosts.sendCommand(n,"install_skill",{skillName:a.trim()}):await re.hosts.sendCommand(n,"install_custom_skill",{skillName:a.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 l.jsx(Ps,{open:e,onOpenChange:m=>{m||w(),t(m)},children:l.jsxs(jr,{className:"sm:max-w-[560px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Skill"]}),l.jsxs(Er,{children:["Install from ",l.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."]})]}),l.jsxs(Nf,{value:o,onValueChange:m=>{i(m),y("")},children:[l.jsxs(Pl,{className:"w-full",children:[l.jsxs(ut,{value:"registry",className:"flex-1",children:[l.jsx(cs,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),l.jsxs(ut,{value:"custom",className:"flex-1",children:[l.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),l.jsx(ct,{value:"registry",className:"space-y-4 pt-2",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"reg-skill-name",children:"Skill Slug"}),l.jsx($e,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:a,onChange:m=>{u(m.target.value),y("")},onKeyDown:m=>m.key==="Enter"&&N()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the host via CLI. Browse available skills at ",l.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),l.jsxs(ct,{value:"custom",className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-name",children:"Skill Name"}),l.jsx($e,{id:"custom-skill-name",placeholder:"my-custom-skill",value:a,onChange:m=>{u(m.target.value),y("")}})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),l.jsx(xf,{id:"custom-skill-content",placeholder:`---
388
388
  name: my-custom-skill
389
389
  description: My custom skill
390
390
  ---
391
391
 
392
392
  Instructions for the agent...
393
393
 
394
- 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"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",l.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",l.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),x&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:x})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),l.jsxs(Q,{onClick:N,disabled:d||!a.trim()||o==="custom"&&!c.trim(),children:[d?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{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,a]=p.useState(r??""),[u,c]=p.useState(!1),[h,d]=p.useState("");p.useEffect(()=>{r&&a(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await oe.commands.create({agentId:n,type:"uninstall_skill",payload:{skillName:i.trim()}}),a(""),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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx($t,{className:"h-4 w-4"})," Uninstall Skill"]}),l.jsx(Er,{children:"This will send a command to remove the skill from the agent."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"uninstall-name",children:"Skill Name"}),l.jsx($e,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{a(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&f()})]}),h&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:h})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Q,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.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(`{
394
+ 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"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",l.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",l.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",l.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),x&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:x})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),l.jsxs(Z,{onClick:N,disabled:d||!a.trim()||o==="custom"&&!c.trim(),children:[d?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function VM({open:e,onOpenChange:t,hostId:n,initialName:r,onSuccess:s,onError:o}){const[i,a]=p.useState(r??""),[u,c]=p.useState(!1),[h,d]=p.useState("");p.useEffect(()=>{r&&a(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await re.hosts.sendCommand(n,"uninstall_skill",{skillName:i.trim()}),a(""),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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(qt,{className:"h-4 w-4"})," Uninstall Skill"]}),l.jsx(Er,{children:"This will send a command to the host CLI to remove the skill."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"uninstall-name",children:"Skill Name"}),l.jsx($e,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{a(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&f()})]}),h&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:h})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Z,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function BM({open:e,onOpenChange:t,hostId:n,onSuccess:r,onError:s}){const[o,i]=p.useState(`{
395
395
  "blockOnRisk": false
396
- }`),[a,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 oe.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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[460px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(qt,{className:"h-4 w-4"})," Update Guards Config"]}),l.jsx(Er,{children:"Values will be merged into the existing Guards plugin configuration."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"config-json",children:"Config JSON"}),l.jsx(xf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),a&&l.jsx("p",{className:"text-xs text-destructive",children:a})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Q,{onClick:d,disabled:c,children:[c?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.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 KM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,a]=p.useState(null),u=p.useCallback((d,f="success")=>{a({msg:d,type:f}),setTimeout(()=>a(null),4e3)},[]);if(p.useEffect(()=>{oe.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 l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."});if(e.length===0)return l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(fl,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),l.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 l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins on remote agents"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),l.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=>l.jsxs("option",{value:d.registeredAgentId??d.id,children:[d.emoji?`${d.emoji} `:"",d.name]},d.registeredAgentId??d.id))})]})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx(YM,{agentId:n,showToast:u}),l.jsx(GM,{plugins:h,agentId:n,showToast:u}),l.jsx(XM,{agentId:n}),l.jsx(QM,{})]}),i&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:i.msg}),l.jsx("button",{onClick:()=>a(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function YM({agentId:e,showToast:t}){const[n,r]=p.useState(!1),[s,o]=p.useState(!1);return l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(Q,{size:"sm",onClick:()=>r(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),l.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[l.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),l.jsx(qM,{open:n,onOpenChange:r,agentId:e,showToast:t}),l.jsx(Wv,{open:s,onOpenChange:o,agentId:e,showToast:t})]})}function GM({plugins:e,agentId:t,showToast:n}){const[r,s]=p.useState(null);return l.jsxs(l.Fragment,{children:[l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Zi,{className:"h-4 w-4"})," Installed Plugins (",e.length,")"]})}),l.jsx(_e,{children:e.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[l.jsx(Zi,{className:"h-10 w-10 text-muted-foreground/20"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins detected"}),l.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Plugin information is reported by the Guards agent"})]}):l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(o=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:l.jsx(Zi,{className:"h-4 w-4 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:o.name}),l.jsx(ke,{variant:o.enabled?"default":"secondary",className:"text-[10px]",children:o.enabled?"Enabled":"Disabled"})]})]}),l.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>s(o.name),children:l.jsx($t,{className:"h-3.5 w-3.5"})})]},o.name))})})]}),l.jsx(Wv,{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),a=p.useCallback(()=>{oe.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(()=>{a()},[a]),p.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(a,5e3);return()=>clearInterval(h)},[t,a]);const u=c=>c==="completed"?l.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?l.jsx(dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(ds,{className:"h-4 w-4"})," Plugin Command History"]}),l.jsxs(Q,{size:"sm",variant:"ghost",onClick:a,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),l.jsx(_e,{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 l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.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),l.jsx("span",{className:"text-xs font-medium",children:d}),f&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),l.jsx("div",{className:"flex-1"}),l.jsx(ke,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:ZM(c.createdAt)}),c.result&&(h?l.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Gd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&l.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:l.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 l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"How Plugins Work"})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),l.jsx("p",{children:"Common plugin specs:"}),l.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),l.jsxs("p",{children:["Commands are executed via ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"})," on the agent. See ",l.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,a]=p.useState(!1),[u,c]=p.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){a(!0),c("");try{await oe.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{a(!1)}}};return l.jsx(Ps,{open:e,onOpenChange:f=>{f||h(),t(f)},children:l.jsxs(jr,{className:"sm:max-w-[480px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Plugin"]}),l.jsx(Er,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-spec",children:"Plugin Spec"}),l.jsx($e,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the agent."]})]}),u&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:u})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),l.jsxs(Q,{onClick:d,disabled:i||!s.trim(),children:[i?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function Wv({open:e,onOpenChange:t,agentId:n,showToast:r,initialId:s}){const[o,i]=p.useState(s??""),[a,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 oe.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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx($t,{className:"h-4 w-4"})," Uninstall Plugin"]}),l.jsx(Er,{children:"Remove an OpenClaw plugin from the agent."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-id",children:"Plugin ID"}),l.jsx($e,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the agent."]})]}),c&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:c})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Q,{variant:"destructive",onClick:d,disabled:a||!o.trim(),children:[a?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.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(()=>{oe.system.services().then(a=>t(a.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return p.useEffect(()=>{i()},[i]),p.useEffect(()=>{const a=setInterval(i,1e4);return()=>clearInterval(a)},[i]),n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"System"}),l.jsxs(Q,{size:"sm",variant:"ghost",onClick:i,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(a=>l.jsx(Se,{className:`cursor-pointer transition-all ${s===a.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(a.key),children:l.jsxs(_e,{className:"flex items-center gap-3 p-4",children:[l.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${a.healthy?"bg-emerald-100 dark:bg-emerald-950":a.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:l.jsx(Xd,{className:`h-5 w-5 ${a.healthy?"text-emerald-600 dark:text-emerald-400":a.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-sm font-medium",children:a.name}),l.jsx($b,{className:`h-2 w-2 fill-current ${a.healthy?"text-emerald-500":a.running?"text-amber-500":"text-muted-foreground/40"}`})]}),l.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsxs("span",{children:[":",a.port]}),a.pid&&l.jsxs("span",{children:["PID ",a.pid]}),a.logSize>0&&l.jsx("span",{children:JM(a.logSize)})]})]}),l.jsx(ke,{variant:a.healthy?"default":a.running?"secondary":"outline",className:`text-[10px] ${a.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:a.healthy?"Healthy":a.running?"Running":"Stopped"})]})},a.key))}),s&&l.jsx(tI,{service:s})]})}function tI({service:e}){const[t,n]=p.useState([]),[r,s]=p.useState(0),[o,i]=p.useState(""),[a,u]=p.useState(!0),[c,h]=p.useState(!0),[d,f]=p.useState(!0),[x,y]=p.useState(200),w=p.useRef(null),N=p.useRef(null),m=p.useCallback(b=>{const j=b??x;oe.system.logs(e,j).then(k=>{n(k.data.lines),s(k.data.total),i(k.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?N.current=setInterval(()=>m(),3e3):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[d,m]);const v=async()=>{try{await oe.system.clearLog(e),n([]),s(0)}catch{}},g=()=>{y(b=>Math.min(b+500,2e3))},S=e.charAt(0).toUpperCase()+e.slice(1);return l.jsxs(Se,{children:[l.jsx(Le,{className:"pb-3",children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(_s,{className:"h-4 w-4"})," ",S," Logs",l.jsxs(ke,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&l.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[r>x&&l.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),l.jsxs(Q,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?l.jsx(qb,{className:"mr-1 h-3 w-3"}):l.jsx(Ia,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),l.jsxs(Q,{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:[l.jsx(Lb,{className:"mr-1 h-3 w-3"})," Bottom"]}),l.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>m(),children:[l.jsx(Yn,{className:"mr-1 h-3 w-3"})," Refresh"]}),l.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[l.jsx($t,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),l.jsx(_e,{className:"p-0",children:a?l.jsx("div",{className:"flex h-60 items-center justify-center",children:l.jsx(dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[l.jsx(Tb,{className:"h-8 w-8 text-muted-foreground/20"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):l.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:j,clientHeight:k}=w.current,_=j-b-k<40;h(_)},children:l.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,j)=>l.jsx(nI,{line:b,lineNum:r-t.length+j+1},j))})})})]})}function nI({line:e,lineNum:t}){const n=rI(e);return l.jsxs("div",{className:"group flex hover:bg-white/5",children:[l.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),l.jsx("span",{className:n,children:e}),`
397
- `]})}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:Xd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Xx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:Jb,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Hb,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,a]=p.useState(!1),[u,c]=p.useState(null),[h,d]=p.useState(null),[f,x]=p.useState(!1),[y,w]=p.useState(""),[N,m]=p.useState(""),[v,g]=p.useState(!1),[S,b]=p.useState(!1),j=p.useCallback(()=>{oe.settings.getApiKey(!1).then(A=>{w(A.data.key),m(""),g(!1)}).catch(()=>{})},[]),k=()=>{o(!0),oe.settings.get().then(A=>{const C=A.data??{};t(C),r(C)}).catch(()=>{}).finally(()=>o(!1))};p.useEffect(()=>{k(),j()},[j]);const _=()=>Object.keys(e).some(A=>e[A]!==n[A]),I=async()=>{a(!0);try{const A={};for(const[C,L]of Object.entries(e))L!==n[C]&&(A[C]=L);Object.keys(A).length>0&&(await oe.settings.update(A),r({...e}),R("Settings saved","success"))}catch(A){R(A instanceof Error?A.message:"Failed to save","error")}finally{a(!1)}},$=async()=>{x(!0),d(null);try{const C=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();C.success&&d(C.data)}catch{d({connected:!1,message:"Request failed"})}finally{x(!1)}},R=(A,C)=>{c({msg:A,type:C}),setTimeout(()=>c(null),3e3)},T=(A,C)=>{t(L=>({...L,[A]:C}))};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Q,{size:"sm",variant:"ghost",onClick:k,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),l.jsxs(Q,{size:"sm",onClick:I,disabled:i||!_(),children:[i?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),l.jsxs(Se,{children:[l.jsxs(Le,{children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Kb,{className:"h-4 w-4"})," System API Key"]}),l.jsx(qd,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),l.jsxs(_e,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($e,{readOnly:!0,value:v?N:y,className:"font-mono text-sm",placeholder:"Loading..."}),l.jsx(Q,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)g(!1);else try{const A=await oe.settings.getApiKey(!0);m(A.data.key),g(!0)}catch{R("Failed to reveal key","error")}},children:v?l.jsx(Bb,{className:"h-4 w-4"}):l.jsx(Ub,{className:"h-4 w-4"})}),l.jsx(Q,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const A=await oe.settings.getApiKey(!0);await navigator.clipboard.writeText(A.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:l.jsx(Fb,{className:"h-4 w-4"})}),l.jsx(Q,{size:"icon",variant:"outline",title:"Regenerate key",disabled:S,onClick:async()=>{if(window.confirm("Regenerating will invalidate the current key. All connected components must update their configuration. Continue?")){b(!0);try{const A=await oe.settings.generateKey();m(A.data.key),w(A.data.key.slice(0,12)+"..."+A.data.key.slice(-4)),g(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{b(!1)}}},children:S?l.jsx(dt,{className:"h-4 w-4 animate-spin"}):l.jsx(Ra,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:[l.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium",children:[l.jsx(ds,{className:"h-3.5 w-3.5"})," Connection Guide"]}),l.jsxs("div",{className:"space-y-1.5 text-[11px] font-mono text-muted-foreground",children:[l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"CLI:"})," opentrust connect --dashboard-url http://<host>:53667 --api-key <key>"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Guards:"})," Set ",l.jsx("code",{className:"rounded bg-muted px-1",children:"apiKey"})," in openclaw.json plugin config"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Gateway:"})," Set env ",l.jsx("code",{className:"rounded bg-muted px-1",children:"OT_API_KEY=<key>"})]})]})]})]})]}),l.jsx(iI,{showToast:R}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Xd,{className:"h-4 w-4"})," Service Connection"]}),l.jsxs(Q,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),l.jsx(_e,{children:h?l.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?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{children:h.message}),h.url&&l.jsx(ke,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):l.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(qt,{className:"h-4 w-4"})," Configuration"]})}),l.jsx(_e,{className:"space-y-5",children:sI.map(A=>{const C=A.icon,L=e[A.key]!==n[A.key];return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx(qe,{htmlFor:A.key,className:"text-sm font-medium",children:A.label}),L&&l.jsx(ke,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),l.jsx($e,{id:A.key,value:e[A.key]??"",onChange:M=>T(A.key,M.target.value),placeholder:A.placeholder,className:"font-mono text-sm"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:A.description})]},A.key)})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Environment"})}),l.jsx(_e,{children:l.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[l.jsx(Di,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),l.jsx(Di,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),l.jsx(Di,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),l.jsx(Di,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:u.msg})]})]})}function iI({showToast:e}){const[t,n]=p.useState(""),[r,s]=p.useState(""),[o,i]=p.useState(""),[a,u]=p.useState(!1),c=async h=>{if(h.preventDefault(),r!==o){e("Passwords do not match","error");return}if(r.length<4){e("Password must be at least 4 characters","error");return}u(!0);try{const d=localStorage.getItem("opentrust_user"),f=d?JSON.parse(d).apiKey:null,x=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),y=await x.json();if(!x.ok||!y.success)throw new Error(y.error||"Failed");e("Password changed successfully","success"),n(""),s(""),i("")}catch(d){e(d instanceof Error?d.message:"Failed to change password","error")}finally{u(!1)}};return l.jsxs(Se,{children:[l.jsxs(Le,{children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Yb,{className:"h-4 w-4"})," Change Password"]}),l.jsx(qd,{className:"text-xs",children:"Update the admin login password"})]}),l.jsx(_e,{children:l.jsxs("form",{onSubmit:c,className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Current Password"}),l.jsx($e,{type:"password",value:t,onChange:h=>n(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"New Password"}),l.jsx($e,{type:"password",value:r,onChange:h=>s(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Confirm New Password"}),l.jsx($e,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs(Q,{type:"submit",size:"sm",disabled:a,children:[a?l.jsx(dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}function Di({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function aI(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(null),[i,a]=p.useState(null),u=p.useCallback(async()=>{try{const d=await oe.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(()=>a(null),4e3);return()=>clearTimeout(d)},[i]);const c=(d,f)=>a({msg:d,type:f}),h=async d=>{try{await oe.hosts.remove(d),t(f=>f.filter(x=>x.id!==d)),c("Host removed","success")}catch{c("Failed to remove host","error")}};return n?l.jsx("div",{className:"flex items-center justify-center py-24",children:l.jsx(dt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):l.jsxs("div",{className:"space-y-6 p-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),l.jsxs(Q,{variant:"outline",size:"sm",onClick:u,children:[l.jsx(Yn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),e.length===0?l.jsxs(Se,{className:"p-8 text-center",children:[l.jsx(Qx,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),l.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:"}),l.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"})]}):l.jsx("div",{className:"space-y-3",children:e.map(d=>l.jsx("div",{children:l.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&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{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??{},a=Object.values(i).filter(c=>c.running).length,u=Object.keys(i).length;return e.metadata,l.jsxs(Se,{className:"overflow-hidden",children:[l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[l.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium truncate",children:e.hostname}),l.jsx(ke,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Xx,{className:"h-3 w-3"})," ",e.ip]}),l.jsxs("span",{children:[e.os," / ",e.arch]}),l.jsxs("span",{children:["CLI v",e.cliVersion]}),l.jsxs("span",{children:[a,"/",u," services"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([c,h])=>l.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?l.jsx(Db,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(hl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&l.jsx("div",{className:"border-t border-border",children:l.jsx(uI,{host:e,onRemove:r,showToast:s})})]})}function uI({host:e,onRemove:t,showToast:n}){const[r,s]=p.useState("services");return l.jsxs(Nf,{value:r,onValueChange:s,className:"w-full",children:[l.jsxs(Pl,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[l.jsx(yt,{value:"services",children:"Services"}),l.jsx(yt,{value:"logs",children:"Logs"}),l.jsx(yt,{value:"upgrade",children:"Upgrade"}),l.jsx(yt,{value:"config",children:"Config"}),l.jsx(yt,{value:"commands",children:"Commands"}),l.jsx(yt,{value:"info",children:"Info"})]}),l.jsxs("div",{className:"p-4",children:[l.jsx(vt,{value:"services",className:"mt-0",children:l.jsx(cI,{host:e,showToast:n})}),l.jsx(vt,{value:"logs",className:"mt-0",children:l.jsx(dI,{host:e,showToast:n})}),l.jsx(vt,{value:"upgrade",className:"mt-0",children:l.jsx(fI,{host:e,showToast:n})}),l.jsx(vt,{value:"config",className:"mt-0",children:l.jsx(hI,{host:e,showToast:n})}),l.jsx(vt,{value:"commands",className:"mt-0",children:l.jsx(mI,{hostId:e.id})}),l.jsx(vt,{value:"info",className:"mt-0",children:l.jsx(pI,{host:e,onRemove:t})})]})]})}function cI({host:e,showToast:t}){const n=e.services??{},[r,s]=p.useState(null),o=async(i,a)=>{s(`${i}-${a}`);try{await oe.hosts.sendCommand({hostId:e.id,type:i,payload:{service:a}}),t(`${i.replace("_"," ")} "${a}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return l.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,a])=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`h-2 w-2 rounded-full ${a.running?a.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-sm",children:a.name}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",a.port]}),a.pid&&l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",a.pid]})]})]}),l.jsx("div",{className:"flex items-center gap-1",children:a.running?l.jsxs(l.Fragment,{children:[l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[l.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart"]}),l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[l.jsx(kc,{className:"h-3 w-3 mr-1"})," Stop"]})]}):l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start All"]}),l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[l.jsx(kc,{className:"h-3 w-3 mr-1"})," Stop All"]}),l.jsxs(Q,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[l.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function dI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=p.useState(n[0]??"core"),[o,i]=p.useState(null),[a,u]=p.useState(!1),c=async()=>{u(!0);try{await oe.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 l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qe,{children:"Service:"}),l.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=>l.jsx("option",{value:h,children:h},h))}),l.jsxs(Q,{variant:"outline",size:"sm",onClick:c,disabled:a,children:[l.jsx(_s,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),l.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 fI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(!1),i=async()=>{o(!0);try{await oe.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 l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{children:["Current CLI version: ",l.jsxs("strong",{children:["v",e.cliVersion]})]}),l.jsxs("span",{children:["Project mode: ",l.jsx(ke,{variant:"secondary",children:e.projectMode})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($e,{placeholder:"Target version (empty = latest)",value:n,onChange:a=>r(a.target.value),className:"max-w-xs"}),l.jsxs(Q,{onClick:i,disabled:s,children:[l.jsx(Yx,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",l.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function hI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),u=async()=>{if(n){a(!0);try{await oe.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{a(!1)}}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",l.jsx("code",{children:".env"})," file."]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Key"}),l.jsx($e,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Value"}),l.jsx($e,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),l.jsxs(Q,{size:"sm",onClick:u,disabled:i||!n,children:[l.jsx(qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function mI({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),o=p.useCallback(async()=>{try{const u=await oe.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 l.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})},a=u=>({start_service:l.jsx(Ia,{className:"h-3 w-3"}),stop_service:l.jsx(kc,{className:"h-3 w-3"}),restart_service:l.jsx(Ra,{className:"h-3 w-3"}),upgrade:l.jsx(Yx,{className:"h-3 w-3"}),fetch_logs:l.jsx(_s,{className:"h-3 w-3"}),update_env:l.jsx(qt,{className:"h-3 w-3"})})[u]??l.jsx(ds,{className:"h-3 w-3"});return r?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(u=>l.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[a(u.type),l.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&l.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&&l.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 pI({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 l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>l.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[l.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),l.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),l.jsx("div",{className:"border-t border-border pt-4",children:l.jsxs(Q,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[l.jsx($t,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),l.jsx(Ps,{open:r,onOpenChange:s,children:l.jsxs(jr,{children:[l.jsxs(Ms,{children:[l.jsx(Cr,{children:"Remove Host"}),l.jsxs(Er,{children:["Remove ",l.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",l.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),l.jsxs(Is,{children:[l.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),l.jsx(Q,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function gI({children:e}){const{isAuthenticated:t,isLoading:n}=Kd();return n?l.jsx("div",{className:"flex min-h-screen items-center justify-center",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?l.jsx(l.Fragment,{children:e}):l.jsx(Nc,{to:"/login",replace:!0})}function xI(){return l.jsxs(pS,{children:[l.jsx(Ke,{path:"/login",element:l.jsx(mk,{})}),l.jsxs(Ke,{element:l.jsx(gI,{children:l.jsx(hk,{})}),children:[l.jsx(Ke,{index:!0,element:l.jsx(Nc,{to:"/inventory/agents",replace:!0})}),l.jsx(Ke,{path:"/inventory/agents",element:l.jsx(gk,{})}),l.jsx(Ke,{path:"/inventory/agents/:id",element:l.jsx(yk,{})}),l.jsx(Ke,{path:"/inventory/identities",element:l.jsx(bk,{})}),l.jsx(Ke,{path:"/inventory/permissions",element:l.jsx(kk,{})}),l.jsx(Ke,{path:"/secure/risk",element:l.jsx(jk,{})}),l.jsx(Ke,{path:"/secure/graph",element:l.jsx(YP,{})}),l.jsx(Ke,{path:"/ops/skills",element:l.jsx($M,{})}),l.jsx(Ke,{path:"/ops/plugins",element:l.jsx(KM,{})}),l.jsx(Ke,{path:"/inventory/hosts",element:l.jsx(aI,{})}),l.jsx(Ke,{path:"/system/logs",element:l.jsx(eI,{})}),l.jsx(Ke,{path:"/system/settings",element:l.jsx(oI,{})})]}),l.jsx(Ke,{path:"*",element:l.jsx(Nc,{to:"/inventory/agents",replace:!0})})]})}Eu.createRoot(document.getElementById("root")).render(l.jsx(Ut.StrictMode,{children:l.jsx(OS,{basename:"/dashboard",children:l.jsx(GS,{children:l.jsx(QS,{children:l.jsx(xI,{})})})})}));
398
- //# sourceMappingURL=index-05zO5oa1.js.map
396
+ }`),[a,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 re.hosts.sendCommand(n,"update_config",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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[460px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(Qt,{className:"h-4 w-4"})," Update Guards Config"]}),l.jsx(Er,{children:"Values will be merged into the existing Guards plugin configuration."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"config-json",children:"Config JSON"}),l.jsx(xf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),a&&l.jsx("p",{className:"text-xs text-destructive",children:a})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Z,{onClick:d,disabled:c,children:[c?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function UM(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 WM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,a]=p.useState(null),u=p.useCallback((c,h="success")=>{a({msg:c,type:h}),setTimeout(()=>a(null),4e3)},[]);return p.useEffect(()=>{re.hosts.list().then(c=>{const h=(c.data??[]).filter(d=>d.status==="online");t(h),h.length>0&&!n&&r(h[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading hosts..."}):e.length===0?l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[l.jsx(Xo,{className:"h-10 w-10 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No hosts connected"}),l.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Run ",l.jsx("code",{className:"rounded bg-muted px-1",children:"opentrust connect --dashboard-url ... --api-key ..."})," on a host"]})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins on remote hosts"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Host:"}),l.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:c=>r(c.target.value),children:e.map(c=>l.jsxs("option",{value:c.id,children:[c.hostname," (",c.ip||"local",")"]},c.id))})]})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx(KM,{hostId:n,showToast:u}),l.jsx(YM,{hostId:n}),l.jsx(GM,{})]}),i&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:i.msg}),l.jsx("button",{onClick:()=>a(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function KM({hostId:e,showToast:t}){const[n,r]=p.useState(!1),[s,o]=p.useState(!1);return l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(Z,{size:"sm",onClick:()=>r(!0),children:[l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),l.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),l.jsx(XM,{open:n,onOpenChange:r,hostId:e,showToast:t}),l.jsx(QM,{open:s,onOpenChange:o,hostId:e,showToast:t})]})}function YM({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),[o,i]=p.useState(null),a=p.useCallback(()=>{re.hosts.commands(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(()=>{a()},[a]),p.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(a,5e3);return()=>clearInterval(h)},[t,a]);const u=c=>c==="completed"?l.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?l.jsx(Dt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?l.jsx(at,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(Kx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(ds,{className:"h-4 w-4"})," Plugin Command History"]}),l.jsxs(Z,{size:"sm",variant:"ghost",onClick:a,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),l.jsx(_e,{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 l.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[l.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),l.jsx("span",{className:"text-xs font-medium",children:d}),f&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),l.jsx("div",{className:"flex-1"}),l.jsx(ke,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:qM(c.createdAt)}),c.result&&(h?l.jsx(hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(Gd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&l.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:l.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 GM(){return l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"How Plugins Work"})}),l.jsxs(_e,{className:"text-xs text-muted-foreground space-y-2",children:[l.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),l.jsx("p",{children:"Common plugin specs:"}),l.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),l.jsxs("li",{children:[l.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),l.jsxs("p",{children:["Commands are sent to the host CLI which executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"}),". See ",l.jsx("a",{href:"https://docs.openclaw.ai/cli/plugins",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"OpenClaw Plugins docs"}),"."]})]})]})}function XM({open:e,onOpenChange:t,hostId:n,showToast:r}){const[s,o]=p.useState(""),[i,a]=p.useState(!1),[u,c]=p.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){a(!0),c("");try{await re.hosts.sendCommand(n,"install_plugin",{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{a(!1)}}};return l.jsx(Ps,{open:e,onOpenChange:f=>{f||h(),t(f)},children:l.jsxs(jr,{className:"sm:max-w-[480px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"h-4 w-4"})," Install Plugin"]}),l.jsx(Er,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-spec",children:"Plugin Spec"}),l.jsx($e,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the host via CLI."]})]}),u&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:u})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),l.jsxs(Z,{onClick:d,disabled:i||!s.trim(),children:[i?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function QM({open:e,onOpenChange:t,hostId:n,showToast:r,initialId:s}){const[o,i]=p.useState(s??""),[a,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 re.hosts.sendCommand(n,"uninstall_plugin",{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 l.jsx(Ps,{open:e,onOpenChange:t,children:l.jsxs(jr,{className:"sm:max-w-[400px]",children:[l.jsxs(Ms,{children:[l.jsxs(Cr,{className:"flex items-center gap-2",children:[l.jsx(qt,{className:"h-4 w-4"})," Uninstall Plugin"]}),l.jsx(Er,{children:"Remove an OpenClaw plugin from the host."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qe,{htmlFor:"plugin-id",children:"Plugin ID"}),l.jsx($e,{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()}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",l.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the host via CLI."]})]}),c&&l.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:[l.jsx(Dt,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:c})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsxs(Z,{variant:"destructive",onClick:d,disabled:a||!o.trim(),children:[a?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function qM(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 ZM(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 JM(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState("dashboard"),i=p.useCallback(()=>{re.system.services().then(a=>t(a.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return p.useEffect(()=>{i()},[i]),p.useEffect(()=>{const a=setInterval(i,1e4);return()=>clearInterval(a)},[i]),n?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-lg font-semibold",children:"System"}),l.jsxs(Z,{size:"sm",variant:"ghost",onClick:i,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(a=>l.jsx(Se,{className:`cursor-pointer transition-all ${s===a.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(a.key),children:l.jsxs(_e,{className:"flex items-center gap-3 p-4",children:[l.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${a.healthy?"bg-emerald-100 dark:bg-emerald-950":a.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:l.jsx(Xd,{className:`h-5 w-5 ${a.healthy?"text-emerald-600 dark:text-emerald-400":a.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-sm font-medium",children:a.name}),l.jsx(zb,{className:`h-2 w-2 fill-current ${a.healthy?"text-emerald-500":a.running?"text-amber-500":"text-muted-foreground/40"}`})]}),l.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsxs("span",{children:[":",a.port]}),a.pid&&l.jsxs("span",{children:["PID ",a.pid]}),a.logSize>0&&l.jsx("span",{children:ZM(a.logSize)})]})]}),l.jsx(ke,{variant:a.healthy?"default":a.running?"secondary":"outline",className:`text-[10px] ${a.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:a.healthy?"Healthy":a.running?"Running":"Stopped"})]})},a.key))}),s&&l.jsx(eI,{service:s})]})}function eI({service:e}){const[t,n]=p.useState([]),[r,s]=p.useState(0),[o,i]=p.useState(""),[a,u]=p.useState(!0),[c,h]=p.useState(!0),[d,f]=p.useState(!0),[x,y]=p.useState(200),w=p.useRef(null),N=p.useRef(null),m=p.useCallback(b=>{const j=b??x;re.system.logs(e,j).then(k=>{n(k.data.lines),s(k.data.total),i(k.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?N.current=setInterval(()=>m(),3e3):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[d,m]);const v=async()=>{try{await re.system.clearLog(e),n([]),s(0)}catch{}},g=()=>{y(b=>Math.min(b+500,2e3))},S=e.charAt(0).toUpperCase()+e.slice(1);return l.jsxs(Se,{children:[l.jsx(Le,{className:"pb-3",children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(_s,{className:"h-4 w-4"})," ",S," Logs",l.jsxs(ke,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&l.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[r>x&&l.jsx(Z,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),l.jsxs(Z,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?l.jsx(Xb,{className:"mr-1 h-3 w-3"}):l.jsx(Ia,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),l.jsxs(Z,{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:[l.jsx(Rb,{className:"mr-1 h-3 w-3"})," Bottom"]}),l.jsxs(Z,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>m(),children:[l.jsx(Yn,{className:"mr-1 h-3 w-3"})," Refresh"]}),l.jsxs(Z,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[l.jsx(qt,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),l.jsx(_e,{className:"p-0",children:a?l.jsx("div",{className:"flex h-60 items-center justify-center",children:l.jsx(at,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?l.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[l.jsx(Ib,{className:"h-8 w-8 text-muted-foreground/20"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):l.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:j,clientHeight:k}=w.current,_=j-b-k<40;h(_)},children:l.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,j)=>l.jsx(tI,{line:b,lineNum:r-t.length+j+1},j))})})})]})}function tI({line:e,lineNum:t}){const n=nI(e);return l.jsxs("div",{className:"group flex hover:bg-white/5",children:[l.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),l.jsx("span",{className:n,children:e}),`
397
+ `]})}function nI(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 rI=[{key:"og_core_url",label:"Core API URL",icon:Xd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"gateway_url",label:"Gateway URL",icon:Xx,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:Ob,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function sI(){const[e,t]=p.useState({}),[n,r]=p.useState({}),[s,o]=p.useState(!0),[i,a]=p.useState(!1),[u,c]=p.useState(null),[h,d]=p.useState(null),[f,x]=p.useState(!1),[y,w]=p.useState(""),[N,m]=p.useState(""),[v,g]=p.useState(!1),[S,b]=p.useState(!1),j=p.useCallback(()=>{re.settings.getApiKey(!1).then(A=>{w(A.data.key),m(""),g(!1)}).catch(()=>{})},[]),k=()=>{o(!0),re.settings.get().then(A=>{const C=A.data??{};t(C),r(C)}).catch(()=>{}).finally(()=>o(!1))};p.useEffect(()=>{k(),j()},[j]);const _=()=>Object.keys(e).some(A=>e[A]!==n[A]),I=async()=>{a(!0);try{const A={};for(const[C,L]of Object.entries(e))L!==n[C]&&(A[C]=L);Object.keys(A).length>0&&(await re.settings.update(A),r({...e}),R("Settings saved","success"))}catch(A){R(A instanceof Error?A.message:"Failed to save","error")}finally{a(!1)}},$=async()=>{x(!0),d(null);try{const C=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();C.success&&d(C.data)}catch{d({connected:!1,message:"Request failed"})}finally{x(!1)}},R=(A,C)=>{c({msg:A,type:C}),setTimeout(()=>c(null),3e3)},T=(A,C)=>{t(L=>({...L,[A]:C}))};return s?l.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Z,{size:"sm",variant:"ghost",onClick:k,children:[l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),l.jsxs(Z,{size:"sm",onClick:I,disabled:i||!_(),children:[i?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),l.jsxs(Se,{children:[l.jsxs(Le,{children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Ub,{className:"h-4 w-4"})," System API Key"]}),l.jsx(qd,{className:"text-xs",children:"Unified key for CLI, Guards, Gateway, and Dashboard inter-component authentication"})]}),l.jsxs(_e,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($e,{readOnly:!0,value:v?N:y,className:"font-mono text-sm",placeholder:"Loading..."}),l.jsx(Z,{size:"icon",variant:"outline",title:v?"Hide":"Reveal",onClick:async()=>{if(v)g(!1);else try{const A=await re.settings.getApiKey(!0);m(A.data.key),g(!0)}catch{R("Failed to reveal key","error")}},children:v?l.jsx(Hb,{className:"h-4 w-4"}):l.jsx(Vb,{className:"h-4 w-4"})}),l.jsx(Z,{size:"icon",variant:"outline",title:"Copy to clipboard",onClick:async()=>{try{const A=await re.settings.getApiKey(!0);await navigator.clipboard.writeText(A.data.key),R("API key copied","success")}catch{R("Failed to copy","error")}},children:l.jsx($b,{className:"h-4 w-4"})}),l.jsx(Z,{size:"icon",variant:"outline",title:"Regenerate key",disabled:S,onClick:async()=>{if(window.confirm("Regenerating will invalidate the current key. All connected components must update their configuration. Continue?")){b(!0);try{const A=await re.settings.generateKey();m(A.data.key),w(A.data.key.slice(0,12)+"..."+A.data.key.slice(-4)),g(!0),R("New API key generated","success")}catch{R("Failed to generate key","error")}finally{b(!1)}}},children:S?l.jsx(at,{className:"h-4 w-4 animate-spin"}):l.jsx(Ra,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3",children:[l.jsxs("p",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium",children:[l.jsx(ds,{className:"h-3.5 w-3.5"})," Connection Guide"]}),l.jsxs("div",{className:"space-y-1.5 text-[11px] font-mono text-muted-foreground",children:[l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"CLI:"})," opentrust connect --dashboard-url http://<host>:53667 --api-key <key>"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Guards:"})," Set ",l.jsx("code",{className:"rounded bg-muted px-1",children:"apiKey"})," in openclaw.json plugin config"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-foreground font-semibold",children:"Gateway:"})," Set env ",l.jsx("code",{className:"rounded bg-muted px-1",children:"OT_API_KEY=<key>"})]})]})]})]})]}),l.jsx(oI,{showToast:R}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Xd,{className:"h-4 w-4"})," Service Connection"]}),l.jsxs(Z,{size:"sm",variant:"outline",onClick:$,disabled:f,children:[f?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),l.jsx(_e,{children:h?l.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?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{children:h.message}),h.url&&l.jsx(ke,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):l.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Qt,{className:"h-4 w-4"})," Configuration"]})}),l.jsx(_e,{className:"space-y-5",children:rI.map(A=>{const C=A.icon,L=e[A.key]!==n[A.key];return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx(qe,{htmlFor:A.key,className:"text-sm font-medium",children:A.label}),L&&l.jsx(ke,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),l.jsx($e,{id:A.key,value:e[A.key]??"",onChange:M=>T(A.key,M.target.value),placeholder:A.placeholder,className:"font-mono text-sm"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:A.description})]},A.key)})})]}),l.jsxs(Se,{children:[l.jsx(Le,{children:l.jsx(Ae,{className:"text-sm",children:"Environment"})}),l.jsx(_e,{children:l.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[l.jsx($i,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),l.jsx($i,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),l.jsx($i,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),l.jsx($i,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm",children:u.msg})]})]})}function oI({showToast:e}){const[t,n]=p.useState(""),[r,s]=p.useState(""),[o,i]=p.useState(""),[a,u]=p.useState(!1),c=async h=>{if(h.preventDefault(),r!==o){e("Passwords do not match","error");return}if(r.length<4){e("Password must be at least 4 characters","error");return}u(!0);try{const d=localStorage.getItem("opentrust_user"),f=d?JSON.parse(d).apiKey:null,x=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",...f&&{Authorization:`Bearer ${f}`}},body:JSON.stringify({currentPassword:t,newPassword:r})}),y=await x.json();if(!x.ok||!y.success)throw new Error(y.error||"Failed");e("Password changed successfully","success"),n(""),s(""),i("")}catch(d){e(d instanceof Error?d.message:"Failed to change password","error")}finally{u(!1)}};return l.jsxs(Se,{children:[l.jsxs(Le,{children:[l.jsxs(Ae,{className:"flex items-center gap-2 text-sm",children:[l.jsx(Wb,{className:"h-4 w-4"})," Change Password"]}),l.jsx(qd,{className:"text-xs",children:"Update the admin login password"})]}),l.jsx(_e,{children:l.jsxs("form",{onSubmit:c,className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Current Password"}),l.jsx($e,{type:"password",value:t,onChange:h=>n(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"New Password"}),l.jsx($e,{type:"password",value:r,onChange:h=>s(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(qe,{className:"text-xs",children:"Confirm New Password"}),l.jsx($e,{type:"password",value:o,onChange:h=>i(h.target.value),required:!0,className:"text-sm"})]}),l.jsxs(Z,{type:"submit",size:"sm",disabled:a,children:[a?l.jsx(at,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):l.jsx(Qx,{className:"mr-1.5 h-3.5 w-3.5"}),"Update Password"]})]})})]})}function $i({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.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,a]=p.useState(null),u=p.useCallback(async()=>{try{const d=await re.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(()=>a(null),4e3);return()=>clearTimeout(d)},[i]);const c=(d,f)=>a({msg:d,type:f}),h=async d=>{try{await re.hosts.remove(d),t(f=>f.filter(x=>x.id!==d)),c("Host removed","success")}catch{c("Failed to remove host","error")}};return n?l.jsx("div",{className:"flex items-center justify-center py-24",children:l.jsx(at,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):l.jsxs("div",{className:"space-y-6 p-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),l.jsxs(Z,{variant:"outline",size:"sm",onClick:u,children:[l.jsx(Yn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),e.length===0?l.jsxs(Se,{className:"p-8 text-center",children:[l.jsx(Xo,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),l.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:"}),l.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"})]}):l.jsx("div",{className:"space-y-3",children:e.map(d=>l.jsx("div",{children:l.jsx(aI,{host:d,expanded:s===d.id,onToggle:()=>o(s===d.id?null:d.id),onRemove:()=>h(d.id),showToast:c})},d.id))}),i&&l.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"?l.jsx(xr,{className:"h-4 w-4"}):l.jsx(Dt,{className:"h-4 w-4"}),i.msg]})]})}function aI({host:e,expanded:t,onToggle:n,onRemove:r,showToast:s}){const o=e.status==="online",i=e.services??{},a=Object.values(i).filter(d=>d.running).length,u=Object.keys(i).length;e.metadata;const[c,h]=p.useState(0);return p.useEffect(()=>{re.hosts.agents(e.id).then(d=>h((d.data??[]).length)).catch(()=>{})},[e.id]),l.jsxs(Se,{className:"overflow-hidden",children:[l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[l.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium truncate",children:e.hostname}),l.jsx(ke,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Xx,{className:"h-3 w-3"})," ",e.ip]}),l.jsxs("span",{children:[e.os," / ",e.arch]}),l.jsxs("span",{children:["CLI v",e.cliVersion]}),l.jsxs("span",{children:[a,"/",u," services"]}),c>0&&l.jsxs("span",{children:[c," agent",c>1?"s":""]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([d,f])=>l.jsx("span",{title:`${f.name}: ${f.running?f.healthy?"healthy":"running":"stopped"}`,className:`inline-block h-4 w-4 rounded text-[8px] font-bold flex items-center justify-center ${f.running?f.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:d[0].toUpperCase()},d))}),t?l.jsx(Ab,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(hl,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&l.jsx("div",{className:"border-t border-border",children:l.jsx(lI,{host:e,onRemove:r,showToast:s})})]})}function lI({host:e,onRemove:t,showToast:n}){const[r,s]=p.useState("agents");return l.jsxs(Nf,{value:r,onValueChange:s,className:"w-full",children:[l.jsxs(Pl,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[l.jsx(ut,{value:"agents",children:"Agents"}),l.jsx(ut,{value:"services",children:"Services"}),l.jsx(ut,{value:"logs",children:"Logs"}),l.jsx(ut,{value:"upgrade",children:"Upgrade"}),l.jsx(ut,{value:"config",children:"Config"}),l.jsx(ut,{value:"commands",children:"Commands"}),l.jsx(ut,{value:"info",children:"Info"})]}),l.jsxs("div",{className:"p-4",children:[l.jsx(ct,{value:"agents",className:"mt-0",children:l.jsx(uI,{hostId:e.id})}),l.jsx(ct,{value:"services",className:"mt-0",children:l.jsx(cI,{host:e,showToast:n})}),l.jsx(ct,{value:"logs",className:"mt-0",children:l.jsx(dI,{host:e,showToast:n})}),l.jsx(ct,{value:"upgrade",className:"mt-0",children:l.jsx(fI,{host:e,showToast:n})}),l.jsx(ct,{value:"config",className:"mt-0",children:l.jsx(hI,{host:e,showToast:n})}),l.jsx(ct,{value:"commands",className:"mt-0",children:l.jsx(mI,{hostId:e.id})}),l.jsx(ct,{value:"info",className:"mt-0",children:l.jsx(pI,{host:e,onRemove:t})})]})]})}function uI({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0);return p.useEffect(()=>{re.hosts.agents(e).then(o=>n(o.data??[])).catch(()=>{}).finally(()=>s(!1))},[e]),r?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(at,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(Xo,{className:"h-8 w-8 text-muted-foreground/30"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents associated with this host"}),l.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Agents are auto-linked when the Guards plugin reports the same hostname"})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:[t.length," agent",t.length>1?"s":""," running on this host"]}),t.map(o=>{const a=(o.metadata??{}).emoji||"🤖";return l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[l.jsx("span",{className:"text-lg",children:a}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium truncate",children:o.name}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.provider!=="custom"?o.provider:""," ",l.jsx(ke,{variant:o.status==="active"?"default":"secondary",className:"text-[10px] ml-1",children:o.status})]})]}),o.lastSeenAt&&l.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(o.lastSeenAt).toLocaleString()})]},o.id)})]})}function cI({host:e,showToast:t}){const n=e.services??{},[r,s]=p.useState(null),o=async(i,a)=>{s(`${i}-${a}`);try{await re.hosts.sendCommand(e.id,i,{service:a}),t(`${i.replace("_"," ")} "${a}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return l.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,a])=>l.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`h-2 w-2 rounded-full ${a.running?a.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-sm",children:a.name}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",a.port]}),a.pid&&l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",a.pid]})]})]}),l.jsx("div",{className:"flex items-center gap-1",children:a.running?l.jsxs(l.Fragment,{children:[l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[l.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart"]}),l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[l.jsx(kc,{className:"h-3 w-3 mr-1"})," Stop"]})]}):l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[l.jsx(Ia,{className:"h-3 w-3 mr-1"})," Start All"]}),l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[l.jsx(kc,{className:"h-3 w-3 mr-1"})," Stop All"]}),l.jsxs(Z,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[l.jsx(Ra,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function dI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=p.useState(n[0]??"core"),[o,i]=p.useState(null),[a,u]=p.useState(!1),c=async()=>{u(!0);try{await re.hosts.sendCommand(e.id,"fetch_logs",{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 l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qe,{children:"Service:"}),l.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=>l.jsx("option",{value:h,children:h},h))}),l.jsxs(Z,{variant:"outline",size:"sm",onClick:c,disabled:a,children:[l.jsx(_s,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),l.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 fI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(!1),i=async()=>{o(!0);try{await re.hosts.sendCommand(e.id,"upgrade",n?{version:n}:{}),t("Upgrade command sent","success")}catch{t("Failed to send upgrade command","error")}finally{o(!1)}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{children:["Current CLI version: ",l.jsxs("strong",{children:["v",e.cliVersion]})]}),l.jsxs("span",{children:["Project mode: ",l.jsx(ke,{variant:"secondary",children:e.projectMode})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($e,{placeholder:"Target version (empty = latest)",value:n,onChange:a=>r(a.target.value),className:"max-w-xs"}),l.jsxs(Z,{onClick:i,disabled:s,children:[l.jsx(Yx,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",l.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function hI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(""),[i,a]=p.useState(!1),u=async()=>{if(n){a(!0);try{await re.hosts.sendCommand(e.id,"update_env",{key:n,value:s}),t(`ENV update sent: ${n}`,"success"),r(""),o("")}catch{t("Failed to send config update","error")}finally{a(!1)}}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",l.jsx("code",{children:".env"})," file."]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Key"}),l.jsx($e,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),l.jsxs("div",{children:[l.jsx(qe,{className:"text-xs",children:"Value"}),l.jsx($e,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),l.jsxs(Z,{size:"sm",onClick:u,disabled:i||!n,children:[l.jsx(Qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function mI({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),o=p.useCallback(async()=>{try{const u=await re.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 l.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})},a=u=>({start_service:l.jsx(Ia,{className:"h-3 w-3"}),stop_service:l.jsx(kc,{className:"h-3 w-3"}),restart_service:l.jsx(Ra,{className:"h-3 w-3"}),upgrade:l.jsx(Yx,{className:"h-3 w-3"}),fetch_logs:l.jsx(_s,{className:"h-3 w-3"}),update_env:l.jsx(Qt,{className:"h-3 w-3"})})[u]??l.jsx(ds,{className:"h-3 w-3"});return r?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?l.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(u=>l.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[a(u.type),l.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&l.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&&l.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 pI({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 l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>l.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[l.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),l.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),l.jsx("div",{className:"border-t border-border pt-4",children:l.jsxs(Z,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[l.jsx(qt,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),l.jsx(Ps,{open:r,onOpenChange:s,children:l.jsxs(jr,{children:[l.jsxs(Ms,{children:[l.jsx(Cr,{children:"Remove Host"}),l.jsxs(Er,{children:["Remove ",l.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",l.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),l.jsxs(Is,{children:[l.jsx(Z,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),l.jsx(Z,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function gI({children:e}){const{isAuthenticated:t,isLoading:n}=Kd();return n?l.jsx("div",{className:"flex min-h-screen items-center justify-center",children:l.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?l.jsx(l.Fragment,{children:e}):l.jsx(Nc,{to:"/login",replace:!0})}function xI(){return l.jsxs(hS,{children:[l.jsx(Ke,{path:"/login",element:l.jsx(hk,{})}),l.jsxs(Ke,{element:l.jsx(gI,{children:l.jsx(fk,{})}),children:[l.jsx(Ke,{index:!0,element:l.jsx(Nc,{to:"/inventory/agents",replace:!0})}),l.jsx(Ke,{path:"/inventory/agents",element:l.jsx(pk,{})}),l.jsx(Ke,{path:"/inventory/agents/:id",element:l.jsx(xk,{})}),l.jsx(Ke,{path:"/inventory/identities",element:l.jsx(Sk,{})}),l.jsx(Ke,{path:"/inventory/permissions",element:l.jsx(bk,{})}),l.jsx(Ke,{path:"/secure/risk",element:l.jsx(kk,{})}),l.jsx(Ke,{path:"/secure/graph",element:l.jsx(KP,{})}),l.jsx(Ke,{path:"/ops/skills",element:l.jsx(DM,{})}),l.jsx(Ke,{path:"/ops/plugins",element:l.jsx(WM,{})}),l.jsx(Ke,{path:"/inventory/hosts",element:l.jsx(iI,{})}),l.jsx(Ke,{path:"/system/logs",element:l.jsx(JM,{})}),l.jsx(Ke,{path:"/system/settings",element:l.jsx(sI,{})})]}),l.jsx(Ke,{path:"*",element:l.jsx(Nc,{to:"/inventory/agents",replace:!0})})]})}Eu.createRoot(document.getElementById("root")).render(l.jsx(Bt.StrictMode,{children:l.jsx(DS,{basename:"/dashboard",children:l.jsx(KS,{children:l.jsx(GS,{children:l.jsx(xI,{})})})})}));
398
+ //# sourceMappingURL=index-DqesMGDt.js.map