jetic-cli 0.2.5 → 0.2.7
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.
- package/README.md +65 -153
- package/dist/dashboard/assets/index-DizUZ0Rd.js +430 -0
- package/dist/dashboard/assets/index-Dz50r4Cq.css +1 -0
- package/dist/dashboard/brand/JeticLogo.tsx +79 -0
- package/dist/dashboard/brand/jetic-animated.svg +33 -0
- package/dist/dashboard/brand/jetic-black.svg +5 -0
- package/dist/dashboard/brand/jetic-intro.svg +38 -0
- package/dist/dashboard/brand/jetic.svg +5 -0
- package/dist/dashboard/index.html +12 -3
- package/dist/index.js +1429 -320
- package/package.json +68 -67
- package/public/brand/JeticLogo.tsx +79 -0
- package/public/brand/jetic-animated.svg +33 -0
- package/public/brand/jetic-black.svg +5 -0
- package/public/brand/jetic-intro.svg +38 -0
- package/public/brand/jetic.svg +5 -0
- package/public/jetic_logo.png +0 -0
- package/dist/dashboard/assets/index-BxpFwhwt.css +0 -1
- package/dist/dashboard/assets/index-D8QbiQBG.js +0 -409
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();function E0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sd={exports:{}},br={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ex;function kb(){if(ex)return br;ex=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(o,u,f){var h=null;if(f!==void 0&&(h=""+f),u.key!==void 0&&(h=""+u.key),"key"in u){f={};for(var g in u)g!=="key"&&(f[g]=u[g])}else f=u;return u=f.ref,{$$typeof:n,type:o,key:h,ref:u!==void 0?u:null,props:f}}return br.Fragment=r,br.jsx=i,br.jsxs=i,br}var tx;function _b(){return tx||(tx=1,sd.exports=kb()),sd.exports}var s=_b(),ld={exports:{}},De={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nx;function Cb(){if(nx)return De;nx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.iterator;function v(E){return E===null||typeof E!="object"?null:(E=b&&E[b]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,_={};function M(E,$,Z){this.props=E,this.context=$,this.refs=_,this.updater=Z||N}M.prototype.isReactComponent={},M.prototype.setState=function(E,$){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,$,"setState")},M.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function A(){}A.prototype=M.prototype;function V(E,$,Z){this.props=E,this.context=$,this.refs=_,this.updater=Z||N}var L=V.prototype=new A;L.constructor=V,T(L,M.prototype),L.isPureReactComponent=!0;var C=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},W=Object.prototype.hasOwnProperty;function X(E,$,Z,ae,oe,he){return Z=he.ref,{$$typeof:n,type:E,key:$,ref:Z!==void 0?Z:null,props:he}}function ie(E,$){return X(E.type,$,void 0,void 0,void 0,E.props)}function I(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function K(E){var $={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Z){return $[Z]})}var ne=/\/+/g;function ee(E,$){return typeof E=="object"&&E!==null&&E.key!=null?K(""+E.key):$.toString(36)}function se(){}function S(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(se,se):(E.status="pending",E.then(function($){E.status==="pending"&&(E.status="fulfilled",E.value=$)},function($){E.status==="pending"&&(E.status="rejected",E.reason=$)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function U(E,$,Z,ae,oe){var he=typeof E;(he==="undefined"||he==="boolean")&&(E=null);var me=!1;if(E===null)me=!0;else switch(he){case"bigint":case"string":case"number":me=!0;break;case"object":switch(E.$$typeof){case n:case r:me=!0;break;case p:return me=E._init,U(me(E._payload),$,Z,ae,oe)}}if(me)return oe=oe(E),me=ae===""?"."+ee(E,0):ae,C(oe)?(Z="",me!=null&&(Z=me.replace(ne,"$&/")+"/"),U(oe,$,Z,"",function(Ae){return Ae})):oe!=null&&(I(oe)&&(oe=ie(oe,Z+(oe.key==null||E&&E.key===oe.key?"":(""+oe.key).replace(ne,"$&/")+"/")+me)),$.push(oe)),1;me=0;var Se=ae===""?".":ae+":";if(C(E))for(var ve=0;ve<E.length;ve++)ae=E[ve],he=Se+ee(ae,ve),me+=U(ae,$,Z,he,oe);else if(ve=v(E),typeof ve=="function")for(E=ve.call(E),ve=0;!(ae=E.next()).done;)ae=ae.value,he=Se+ee(ae,ve++),me+=U(ae,$,Z,he,oe);else if(he==="object"){if(typeof E.then=="function")return U(S(E),$,Z,ae,oe);throw $=String(E),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return me}function k(E,$,Z){if(E==null)return E;var ae=[],oe=0;return U(E,ae,"","",function(he){return $.call(Z,he,oe++)}),ae}function H(E){if(E._status===-1){var $=E._result;$=$(),$.then(function(Z){(E._status===0||E._status===-1)&&(E._status=1,E._result=Z)},function(Z){(E._status===0||E._status===-1)&&(E._status=2,E._result=Z)}),E._status===-1&&(E._status=0,E._result=$)}if(E._status===1)return E._result.default;throw E._result}var O=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function z(){}return De.Children={map:k,forEach:function(E,$,Z){k(E,function(){$.apply(this,arguments)},Z)},count:function(E){var $=0;return k(E,function(){$++}),$},toArray:function(E){return k(E,function($){return $})||[]},only:function(E){if(!I(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},De.Component=M,De.Fragment=i,De.Profiler=u,De.PureComponent=V,De.StrictMode=o,De.Suspense=x,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,De.__COMPILER_RUNTIME={__proto__:null,c:function(E){return D.H.useMemoCache(E)}},De.cache=function(E){return function(){return E.apply(null,arguments)}},De.cloneElement=function(E,$,Z){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ae=T({},E.props),oe=E.key,he=void 0;if($!=null)for(me in $.ref!==void 0&&(he=void 0),$.key!==void 0&&(oe=""+$.key),$)!W.call($,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&$.ref===void 0||(ae[me]=$[me]);var me=arguments.length-2;if(me===1)ae.children=Z;else if(1<me){for(var Se=Array(me),ve=0;ve<me;ve++)Se[ve]=arguments[ve+2];ae.children=Se}return X(E.type,oe,void 0,void 0,he,ae)},De.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},De.createElement=function(E,$,Z){var ae,oe={},he=null;if($!=null)for(ae in $.key!==void 0&&(he=""+$.key),$)W.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(oe[ae]=$[ae]);var me=arguments.length-2;if(me===1)oe.children=Z;else if(1<me){for(var Se=Array(me),ve=0;ve<me;ve++)Se[ve]=arguments[ve+2];oe.children=Se}if(E&&E.defaultProps)for(ae in me=E.defaultProps,me)oe[ae]===void 0&&(oe[ae]=me[ae]);return X(E,he,void 0,void 0,null,oe)},De.createRef=function(){return{current:null}},De.forwardRef=function(E){return{$$typeof:g,render:E}},De.isValidElement=I,De.lazy=function(E){return{$$typeof:p,_payload:{_status:-1,_result:E},_init:H}},De.memo=function(E,$){return{$$typeof:m,type:E,compare:$===void 0?null:$}},De.startTransition=function(E){var $=D.T,Z={};D.T=Z;try{var ae=E(),oe=D.S;oe!==null&&oe(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(z,O)}catch(he){O(he)}finally{D.T=$}},De.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},De.use=function(E){return D.H.use(E)},De.useActionState=function(E,$,Z){return D.H.useActionState(E,$,Z)},De.useCallback=function(E,$){return D.H.useCallback(E,$)},De.useContext=function(E){return D.H.useContext(E)},De.useDebugValue=function(){},De.useDeferredValue=function(E,$){return D.H.useDeferredValue(E,$)},De.useEffect=function(E,$,Z){var ae=D.H;if(typeof Z=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(E,$)},De.useId=function(){return D.H.useId()},De.useImperativeHandle=function(E,$,Z){return D.H.useImperativeHandle(E,$,Z)},De.useInsertionEffect=function(E,$){return D.H.useInsertionEffect(E,$)},De.useLayoutEffect=function(E,$){return D.H.useLayoutEffect(E,$)},De.useMemo=function(E,$){return D.H.useMemo(E,$)},De.useOptimistic=function(E,$){return D.H.useOptimistic(E,$)},De.useReducer=function(E,$,Z){return D.H.useReducer(E,$,Z)},De.useRef=function(E){return D.H.useRef(E)},De.useState=function(E){return D.H.useState(E)},De.useSyncExternalStore=function(E,$,Z){return D.H.useSyncExternalStore(E,$,Z)},De.useTransition=function(){return D.H.useTransition()},De.version="19.1.1",De}var ax;function Yr(){return ax||(ax=1,ld.exports=Cb()),ld.exports}var j=Yr();const le=E0(j);var rd={exports:{}},vr={},id={exports:{}},od={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var sx;function Tb(){return sx||(sx=1,(function(n){function r(k,H){var O=k.length;k.push(H);e:for(;0<O;){var z=O-1>>>1,E=k[z];if(0<u(E,H))k[z]=H,k[O]=E,O=z;else break e}}function i(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var H=k[0],O=k.pop();if(O!==H){k[0]=O;e:for(var z=0,E=k.length,$=E>>>1;z<$;){var Z=2*(z+1)-1,ae=k[Z],oe=Z+1,he=k[oe];if(0>u(ae,O))oe<E&&0>u(he,ae)?(k[z]=he,k[oe]=O,z=oe):(k[z]=ae,k[Z]=O,z=Z);else if(oe<E&&0>u(he,O))k[z]=he,k[oe]=O,z=oe;else break e}}return H}function u(k,H){var O=k.sortIndex-H.sortIndex;return O!==0?O:k.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,g=h.now();n.unstable_now=function(){return h.now()-g}}var x=[],m=[],p=1,b=null,v=3,N=!1,T=!1,_=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function C(k){for(var H=i(m);H!==null;){if(H.callback===null)o(m);else if(H.startTime<=k)o(m),H.sortIndex=H.expirationTime,r(x,H);else break;H=i(m)}}function D(k){if(_=!1,C(k),!T)if(i(x)!==null)T=!0,W||(W=!0,ee());else{var H=i(m);H!==null&&U(D,H.startTime-k)}}var W=!1,X=-1,ie=5,I=-1;function K(){return M?!0:!(n.unstable_now()-I<ie)}function ne(){if(M=!1,W){var k=n.unstable_now();I=k;var H=!0;try{e:{T=!1,_&&(_=!1,V(X),X=-1),N=!0;var O=v;try{t:{for(C(k),b=i(x);b!==null&&!(b.expirationTime>k&&K());){var z=b.callback;if(typeof z=="function"){b.callback=null,v=b.priorityLevel;var E=z(b.expirationTime<=k);if(k=n.unstable_now(),typeof E=="function"){b.callback=E,C(k),H=!0;break t}b===i(x)&&o(x),C(k)}else o(x);b=i(x)}if(b!==null)H=!0;else{var $=i(m);$!==null&&U(D,$.startTime-k),H=!1}}break e}finally{b=null,v=O,N=!1}H=void 0}}finally{H?ee():W=!1}}}var ee;if(typeof L=="function")ee=function(){L(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,S=se.port2;se.port1.onmessage=ne,ee=function(){S.postMessage(null)}}else ee=function(){A(ne,0)};function U(k,H){X=A(function(){k(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ie=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(k){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var O=v;v=H;try{return k()}finally{v=O}},n.unstable_requestPaint=function(){M=!0},n.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var O=v;v=k;try{return H()}finally{v=O}},n.unstable_scheduleCallback=function(k,H,O){var z=n.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?z+O:z):O=z,k){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=O+E,k={id:p++,callback:H,priorityLevel:k,startTime:O,expirationTime:E,sortIndex:-1},O>z?(k.sortIndex=O,r(m,k),i(x)===null&&k===i(m)&&(_?(V(X),X=-1):_=!0,U(D,O-z))):(k.sortIndex=E,r(x,k),T||N||(T=!0,W||(W=!0,ee()))),k},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(k){var H=v;return function(){var O=v;v=H;try{return k.apply(this,arguments)}finally{v=O}}}})(od)),od}var lx;function Mb(){return lx||(lx=1,id.exports=Tb()),id.exports}var cd={exports:{}},qt={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var rx;function Ab(){if(rx)return qt;rx=1;var n=Yr();function r(x){var m="https://react.dev/errors/"+x;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+x+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(x,m,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:x,containerInfo:m,implementation:p}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(x,m){if(x==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,qt.createPortal=function(x,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return f(x,m,null,p)},qt.flushSync=function(x){var m=h.T,p=o.p;try{if(h.T=null,o.p=2,x)return x()}finally{h.T=m,o.p=p,o.d.f()}},qt.preconnect=function(x,m){typeof x=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,o.d.C(x,m))},qt.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},qt.preinit=function(x,m){if(typeof x=="string"&&m&&typeof m.as=="string"){var p=m.as,b=g(p,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,N=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?o.d.S(x,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:N}):p==="script"&&o.d.X(x,{crossOrigin:b,integrity:v,fetchPriority:N,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},qt.preinitModule=function(x,m){if(typeof x=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=g(m.as,m.crossOrigin);o.d.M(x,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&o.d.M(x)},qt.preload=function(x,m){if(typeof x=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,b=g(p,m.crossOrigin);o.d.L(x,p,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},qt.preloadModule=function(x,m){if(typeof x=="string")if(m){var p=g(m.as,m.crossOrigin);o.d.m(x,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else o.d.m(x)},qt.requestFormReset=function(x){o.d.r(x)},qt.unstable_batchedUpdates=function(x,m){return x(m)},qt.useFormState=function(x,m,p){return h.H.useFormState(x,m,p)},qt.useFormStatus=function(){return h.H.useHostTransitionStatus()},qt.version="19.1.1",qt}var ix;function k0(){if(ix)return cd.exports;ix=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),cd.exports=Ab(),cd.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var ox;function Rb(){if(ox)return vr;ox=1;var n=Mb(),r=Yr(),i=k0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(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 g(e){if(f(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return g(c),e;if(d===l)return g(c),t;d=d.sibling}throw Error(o(188))}if(a.return!==l.return)a=c,l=d;else{for(var y=!1,w=c.child;w;){if(w===a){y=!0,a=c,l=d;break}if(w===l){y=!0,l=c,a=d;break}w=w.sibling}if(!y){for(w=d.child;w;){if(w===a){y=!0,a=d,l=c;break}if(w===l){y=!0,l=d,a=c;break}w=w.sibling}if(!y)throw Error(o(189))}}if(a.alternate!==l)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),V=Symbol.for("react.consumer"),L=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function S(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case M:return"Profiler";case _:return"StrictMode";case D:return"Suspense";case W:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case L:return(e.displayName||"Context")+".Provider";case V:return(e._context.displayName||"Context")+".Consumer";case C:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:S(e.type)||"Memo";case ie:t=e._payload,e=e._init;try{return S(e(t))}catch{}}return null}var U=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},z=[],E=-1;function $(e){return{current:e}}function Z(e){0>E||(e.current=z[E],z[E]=null,E--)}function ae(e,t){E++,z[E]=e.current,e.current=t}var oe=$(null),he=$(null),me=$(null),Se=$(null);function ve(e,t){switch(ae(me,t),ae(he,e),ae(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cp(t),e=Tp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(oe),ae(oe,e)}function Ae(){Z(oe),Z(he),Z(me)}function Re(e){e.memoizedState!==null&&ae(Se,e);var t=oe.current,a=Tp(t,e.type);t!==a&&(ae(he,e),ae(oe,a))}function We(e){he.current===e&&(Z(oe),Z(he)),Se.current===e&&(Z(Se),mr._currentValue=O)}var Te=Object.prototype.hasOwnProperty,be=n.unstable_scheduleCallback,q=n.unstable_cancelCallback,Y=n.unstable_shouldYield,ue=n.unstable_requestPaint,re=n.unstable_now,P=n.unstable_getCurrentPriorityLevel,Ee=n.unstable_ImmediatePriority,ge=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,Oe=n.unstable_LowPriority,ze=n.unstable_IdlePriority,Tt=n.log,Mt=n.unstable_setDisableYieldValue,ft=null,nt=null;function pt(e){if(typeof Tt=="function"&&Mt(e),nt&&typeof nt.setStrictMode=="function")try{nt.setStrictMode(ft,e)}catch{}}var at=Math.clz32?Math.clz32:je,pe=Math.log,Ve=Math.LN2;function je(e){return e>>>=0,e===0?32:31-(pe(e)/Ve|0)|0}var Le=256,Ge=4194304;function At(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vt(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~d,l!==0?c=At(l):(y&=w,y!==0?c=At(y):a||(a=w&~e,a!==0&&(c=At(a))))):(w=l&~d,w!==0?c=At(w):y!==0?c=At(y):a||(a=l&~e,a!==0&&(c=At(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Jt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ys(){var e=Le;return Le<<=1,(Le&4194048)===0&&(Le=256),e}function la(){var e=Ge;return Ge<<=1,(Ge&62914560)===0&&(Ge=4194304),e}function Ya(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ra(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Dn(e,t,a,l,c,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,R=e.expirationTimes,J=e.hiddenUpdates;for(a=y&~a;0<a;){var ce=31-at(a),fe=1<<ce;w[ce]=0,R[ce]=-1;var F=J[ce];if(F!==null)for(J[ce]=null,ce=0;ce<F.length;ce++){var te=F[ce];te!==null&&(te.lane&=-536870913)}a&=~fe}l!==0&&Qr(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function Qr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-at(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&4194090}function Kr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-at(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function Nl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Qp(e.type))}function Io(e,t){var a=H.p;try{return H.p=e,t()}finally{H.p=a}}var _n=Math.random().toString(36).slice(2),wt="__reactFiber$"+_n,Ut="__reactProps$"+_n,ia="__reactContainer$"+_n,Sl="__reactEvents$"+_n,Fo="__reactListeners$"+_n,Po="__reactHandles$"+_n,Ir="__reactResources$"+_n,Va="__reactMarker$"+_n;function El(e){delete e[wt],delete e[Ut],delete e[Sl],delete e[Fo],delete e[Po]}function Hn(e){var t=e[wt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ia]||a[wt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=zp(e);e!==null;){if(a=e[wt])return a;e=zp(e)}return t}e=a,a=e.parentNode}return null}function oa(e){if(e=e[wt]||e[ia]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ca(e){var t=e[Ir];return t||(t=e[Ir]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Va]=!0}var Fr=new Set,Pr={};function $n(e,t){ua(e,t),ua(e+"Capture",t)}function ua(e,t){for(Pr[e]=t,e=0;e<t.length;e++)Fr.add(t[e])}var ei=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ti={},ni={};function ec(e){return Te.call(ni,e)?!0:Te.call(ti,e)?!1:ei.test(e)?ni[e]=!0:(ti[e]=!0,!1)}function bs(e,t,a){if(ec(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function vs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function bn(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}var js,ai;function da(e){if(js===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);js=t&&t[1]||"",ai=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+js+e+ai}var kl=!1;function Xa(e,t){if(!e||kl)return"";kl=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(te){var F=te}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(te){F=te}e.call(fe.prototype)}}else{try{throw Error()}catch(te){F=te}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(te){if(te&&F&&typeof te.stack=="string")return[te.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),y=d[0],w=d[1];if(y&&w){var R=y.split(`
|
|
44
|
-
`),J=w.split(`
|
|
45
|
-
`);for(c=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;c<J.length&&!J[c].includes("DetermineComponentFrameRoot");)c++;if(l===R.length||c===J.length)for(l=R.length-1,c=J.length-1;1<=l&&0<=c&&R[l]!==J[c];)c--;for(;1<=l&&0<=c;l--,c--)if(R[l]!==J[c]){if(l!==1||c!==1)do if(l--,c--,0>c||R[l]!==J[c]){var ce=`
|
|
46
|
-
`+R[l].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=l&&0<=c);break}}}finally{kl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?da(a):""}function vy(e){switch(e.tag){case 26:case 27:case 5:return da(e.type);case 16:return da("Lazy");case 13:return da("Suspense");case 19:return da("SuspenseList");case 0:case 15:return Xa(e.type,!1);case 11:return Xa(e.type.render,!1);case 1:return Xa(e.type,!0);case 31:return da("Activity");default:return""}}function Nf(e){try{var t="";do t+=vy(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}function on(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jy(e){var t=wf(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,d=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){l=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function si(e){e._valueTracker||(e._valueTracker=jy(e))}function Sf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=wf(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function li(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ny=/[\n"\\]/g;function cn(e){return e.replace(Ny,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tc(e,t,a,l,c,d,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+on(t)):e.value!==""+on(t)&&(e.value=""+on(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?nc(e,y,on(t)):a!=null?nc(e,y,on(a)):l!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+on(w):e.removeAttribute("name")}function Ef(e,t,a,l,c,d,y,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null))return;a=a!=null?""+on(a):"",t=t!=null?""+on(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=w?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function nc(e,t,a){t==="number"&&li(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ns(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+on(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function kf(e,t,a){if(t!=null&&(t=""+on(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+on(a):""}function _f(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(o(92));if(U(l)){if(1<l.length)throw Error(o(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=on(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l)}function ws(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var wy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||wy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Tf(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&Cf(e,c,l)}else for(var d in t)t.hasOwnProperty(d)&&Cf(e,d,t[d])}function ac(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ey=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ri(e){return Ey.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var sc=null;function lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ss=null,Es=null;function Mf(e){var t=oa(e);if(t&&(e=t.stateNode)){var a=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(tc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=l[Ut]||null;if(!c)throw Error(o(90));tc(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Sf(l)}break e;case"textarea":kf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ns(e,!!a.multiple,t,!1)}}}var rc=!1;function Af(e,t,a){if(rc)return e(t,a);rc=!0;try{var l=e(t);return l}finally{if(rc=!1,(Ss!==null||Es!==null)&&(Xi(),Ss&&(t=Ss,e=Es,Es=Ss=null,Mf(t),e)))for(t=0;t<e.length;t++)Mf(e[t])}}function _l(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Ut]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ic=!1;if(Un)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){ic=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{ic=!1}var fa=null,oc=null,ii=null;function Rf(){if(ii)return ii;var e,t=oc,a=t.length,l,c="value"in fa?fa.value:fa.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var y=a-e;for(l=1;l<=y&&t[a-l]===c[d-l];l++);return ii=c.slice(e,1<l?1-l:void 0)}function oi(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 ci(){return!0}function zf(){return!1}function Xt(e){function t(a,l,c,d,y){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ci:zf,this.isPropagationStopped=zf,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ci)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ci)},persist:function(){},isPersistent:ci}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ui=Xt(Za),Tl=p({},Za,{view:0,detail:0}),ky=Xt(Tl),cc,uc,Ml,di=p({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,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!==Ml&&(Ml&&e.type==="mousemove"?(cc=e.screenX-Ml.screenX,uc=e.screenY-Ml.screenY):uc=cc=0,Ml=e),cc)},movementY:function(e){return"movementY"in e?e.movementY:uc}}),Of=Xt(di),_y=p({},di,{dataTransfer:0}),Cy=Xt(_y),Ty=p({},Tl,{relatedTarget:0}),dc=Xt(Ty),My=p({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Ay=Xt(My),Ry=p({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zy=Xt(Ry),Oy=p({},Za,{data:0}),Df=Xt(Oy),Dy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hy={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"},$y={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$y[e])?!!t[e]:!1}function fc(){return Uy}var By=p({},Tl,{key:function(e){if(e.key){var t=Dy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,charCode:function(e){return e.type==="keypress"?oi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=Xt(By),Ly=p({},di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hf=Xt(Ly),Yy=p({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),Vy=Xt(Yy),Gy=p({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xy=Xt(Gy),Zy=p({},di,{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}),Wy=Xt(Zy),Qy=p({},Za,{newState:0,oldState:0}),Ky=Xt(Qy),Jy=[9,13,27,32],hc=Un&&"CompositionEvent"in window,Al=null;Un&&"documentMode"in document&&(Al=document.documentMode);var Iy=Un&&"TextEvent"in window&&!Al,$f=Un&&(!hc||Al&&8<Al&&11>=Al),Uf=" ",Bf=!1;function qf(e,t){switch(e){case"keyup":return Jy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function Fy(e,t){switch(e){case"compositionend":return Lf(t);case"keypress":return t.which!==32?null:(Bf=!0,Uf);case"textInput":return e=t.data,e===Uf&&Bf?null:e;default:return null}}function Py(e,t){if(ks)return e==="compositionend"||!hc&&qf(e,t)?(e=Rf(),ii=oc=fa=null,ks=!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 $f&&t.locale!=="ko"?null:t.data;default:return null}}var e1={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 Yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!e1[e.type]:t==="textarea"}function Vf(e,t,a,l){Ss?Es?Es.push(l):Es=[l]:Ss=l,t=Ii(t,"onChange"),0<t.length&&(a=new ui("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Rl=null,zl=null;function t1(e){wp(e,0)}function fi(e){var t=Ga(e);if(Sf(t))return e}function Gf(e,t){if(e==="change")return t}var Xf=!1;if(Un){var mc;if(Un){var pc="oninput"in document;if(!pc){var Zf=document.createElement("div");Zf.setAttribute("oninput","return;"),pc=typeof Zf.oninput=="function"}mc=pc}else mc=!1;Xf=mc&&(!document.documentMode||9<document.documentMode)}function Wf(){Rl&&(Rl.detachEvent("onpropertychange",Qf),zl=Rl=null)}function Qf(e){if(e.propertyName==="value"&&fi(zl)){var t=[];Vf(t,zl,e,lc(e)),Af(t1,t)}}function n1(e,t,a){e==="focusin"?(Wf(),Rl=t,zl=a,Rl.attachEvent("onpropertychange",Qf)):e==="focusout"&&Wf()}function a1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fi(zl)}function s1(e,t){if(e==="click")return fi(t)}function l1(e,t){if(e==="input"||e==="change")return fi(t)}function r1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var It=typeof Object.is=="function"?Object.is:r1;function Ol(e,t){if(It(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Te.call(t,c)||!It(e[c],t[c]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jf(e,t){var a=Kf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Kf(a)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ff(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=li(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=li(e.document)}return t}function xc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var i1=Un&&"documentMode"in document&&11>=document.documentMode,_s=null,gc=null,Dl=null,yc=!1;function Pf(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;yc||_s==null||_s!==li(l)||(l=_s,"selectionStart"in l&&xc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Dl&&Ol(Dl,l)||(Dl=l,l=Ii(gc,"onSelect"),0<l.length&&(t=new ui("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=_s)))}function Wa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Cs={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},bc={},eh={};Un&&(eh=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Qa(e){if(bc[e])return bc[e];if(!Cs[e])return e;var t=Cs[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in eh)return bc[e]=t[a];return e}var th=Qa("animationend"),nh=Qa("animationiteration"),ah=Qa("animationstart"),o1=Qa("transitionrun"),c1=Qa("transitionstart"),u1=Qa("transitioncancel"),sh=Qa("transitionend"),lh=new Map,vc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");vc.push("scrollEnd");function vn(e,t){lh.set(e,t),$n(t,[e])}var rh=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var a=rh.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Nf(t)},rh.set(e,t),t)}return{value:e,source:t,stack:Nf(t)}}var dn=[],Ts=0,jc=0;function hi(){for(var e=Ts,t=jc=Ts=0;t<e;){var a=dn[t];dn[t++]=null;var l=dn[t];dn[t++]=null;var c=dn[t];dn[t++]=null;var d=dn[t];if(dn[t++]=null,l!==null&&c!==null){var y=l.pending;y===null?c.next=c:(c.next=y.next,y.next=c),l.pending=c}d!==0&&ih(a,c,d)}}function mi(e,t,a,l){dn[Ts++]=e,dn[Ts++]=t,dn[Ts++]=a,dn[Ts++]=l,jc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Nc(e,t,a,l){return mi(e,t,a,l),pi(e)}function Ms(e,t){return mi(e,null,null,t),pi(e)}function ih(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,l=d.alternate,l!==null&&(l.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-at(a),e=d.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),d):null}function pi(e){if(50<rr)throw rr=0,Cu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var As={};function d1(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,a,l){return new d1(e,t,a,l)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bn(e,t){var a=e.alternate;return a===null?(a=Ft(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function oh(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function xi(e,t,a,l,c,d){var y=0;if(l=e,typeof e=="function")wc(e)&&(y=1);else if(typeof e=="string")y=hb(e,a,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I:return e=Ft(31,a,t,c),e.elementType=I,e.lanes=d,e;case T:return Ka(a.children,c,d,t);case _:y=8,c|=24;break;case M:return e=Ft(12,a,t,c|2),e.elementType=M,e.lanes=d,e;case D:return e=Ft(13,a,t,c),e.elementType=D,e.lanes=d,e;case W:return e=Ft(19,a,t,c),e.elementType=W,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:case L:y=10;break e;case V:y=9;break e;case C:y=11;break e;case X:y=14;break e;case ie:y=16,l=null;break e}y=29,a=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=Ft(y,a,t,c),t.elementType=e,t.type=l,t.lanes=d,t}function Ka(e,t,a,l){return e=Ft(7,e,l,t),e.lanes=a,e}function Sc(e,t,a){return e=Ft(6,e,null,t),e.lanes=a,e}function Ec(e,t,a){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rs=[],zs=0,gi=null,yi=0,fn=[],hn=0,Ja=null,qn=1,Ln="";function Ia(e,t){Rs[zs++]=yi,Rs[zs++]=gi,gi=e,yi=t}function ch(e,t,a){fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ja,Ja=e;var l=qn;e=Ln;var c=32-at(l)-1;l&=~(1<<c),a+=1;var d=32-at(t)+c;if(30<d){var y=c-c%5;d=(l&(1<<y)-1).toString(32),l>>=y,c-=y,qn=1<<32-at(t)+c|a<<c|l,Ln=d+e}else qn=1<<d|a<<c|l,Ln=e}function kc(e){e.return!==null&&(Ia(e,1),ch(e,1,0))}function _c(e){for(;e===gi;)gi=Rs[--zs],Rs[zs]=null,yi=Rs[--zs],Rs[zs]=null;for(;e===Ja;)Ja=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null,qn=fn[--hn],fn[hn]=null}var Gt=null,it=null,Ze=!1,Fa=null,Cn=!1,Cc=Error(o(519));function Pa(e){var t=Error(o(418,""));throw Ul(un(t,e)),Cc}function uh(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[wt]=e,t[Ut]=l,a){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(a=0;a<or.length;a++)qe(or[a],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Ef(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),si(t);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),_f(t,l.value,l.defaultValue,l.children),si(t)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||_p(t.textContent,a)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Fi),t=!0):t=!1,t||Pa(e)}function dh(e){for(Gt=e.return;Gt;)switch(Gt.tag){case 5:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Gt=Gt.return}}function Hl(e){if(e!==Gt)return!1;if(!Ze)return dh(e),Ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Gu(e.type,e.memoizedProps)),a=!a),a&&it&&Pa(e),dh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){it=Nn(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}it=null}}else t===27?(t=it,Ca(e.type)?(e=Qu,Qu=null,it=e):it=t):it=Gt?Nn(e.stateNode.nextSibling):null;return!0}function $l(){it=Gt=null,Ze=!1}function fh(){var e=Fa;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Fa=null),e}function Ul(e){Fa===null?Fa=[e]:Fa.push(e)}var Tc=$(null),es=null,Yn=null;function ha(e,t,a){ae(Tc,t._currentValue),t._currentValue=a}function Vn(e){e._currentValue=Tc.current,Z(Tc)}function Mc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Ac(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var y=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var R=0;R<t.length;R++)if(w.context===t[R]){d.lanes|=a,w=d.alternate,w!==null&&(w.lanes|=a),Mc(d.return,a,e),l||(y=null);break e}d=w.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(o(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),Mc(y,a,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Bl(e,t,a,l){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(o(387));if(y=y.memoizedProps,y!==null){var w=c.type;It(c.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(c===Se.current){if(y=c.alternate,y===null)throw Error(o(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(mr):e=[mr])}c=c.return}e!==null&&Ac(t,e,a,l),t.flags|=262144}function bi(e){for(e=e.firstContext;e!==null;){if(!It(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ts(e){es=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return hh(es,e)}function vi(e,t){return es===null&&ts(e),hh(e,t)}function hh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Yn===null){if(e===null)throw Error(o(308));Yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yn=Yn.next=t;return a}var f1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},h1=n.unstable_scheduleCallback,m1=n.unstable_NormalPriority,bt={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new f1,data:new Map,refCount:0}}function ql(e){e.refCount--,e.refCount===0&&h1(m1,function(){e.controller.abort()})}var Ll=null,zc=0,Os=0,Ds=null;function p1(e,t){if(Ll===null){var a=Ll=[];zc=0,Os=Du(),Ds={status:"pending",value:void 0,then:function(l){a.push(l)}}}return zc++,t.then(mh,mh),t}function mh(){if(--zc===0&&Ll!==null){Ds!==null&&(Ds.status="fulfilled");var e=Ll;Ll=null,Os=0,Ds=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function x1(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var ph=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&p1(e,t),ph!==null&&ph(e,t)};var ns=$(null);function Oc(){var e=ns.current;return e!==null?e:et.pooledCache}function ji(e,t){t===null?ae(ns,ns.current):ae(ns,t.pool)}function xh(){var e=Oc();return e===null?null:{parent:bt._currentValue,pool:e}}var Yl=Error(o(460)),gh=Error(o(474)),Ni=Error(o(542)),Dc={then:function(){}};function yh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wi(){}function bh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(wi,wi),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jh(e),e;default:if(typeof t.status=="string")t.then(wi,wi);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jh(e),e}throw Vl=t,Yl}}var Vl=null;function vh(){if(Vl===null)throw Error(o(459));var e=Vl;return Vl=null,e}function jh(e){if(e===Yl||e===Ni)throw Error(o(483))}var ma=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=pi(e),ih(e,null,a),t}return mi(e,l,t,a),pi(e)}function Gl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Kr(e,a)}}function Uc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Bc=!1;function Xl(){if(Bc){var e=Ds;if(e!==null)throw e}}function Zl(e,t,a,l){Bc=!1;var c=e.updateQueue;ma=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var R=w,J=R.next;R.next=null,y===null?d=J:y.next=J,y=R;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,w=ce.lastBaseUpdate,w!==y&&(w===null?ce.firstBaseUpdate=J:w.next=J,ce.lastBaseUpdate=R))}if(d!==null){var fe=c.baseState;y=0,ce=J=R=null,w=d;do{var F=w.lane&-536870913,te=F!==w.lane;if(te?(Ye&F)===F:(l&F)===F){F!==0&&F===Os&&(Bc=!0),ce!==null&&(ce=ce.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Me=e,_e=w;F=t;var Fe=a;switch(_e.tag){case 1:if(Me=_e.payload,typeof Me=="function"){fe=Me.call(Fe,fe,F);break e}fe=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=_e.payload,F=typeof Me=="function"?Me.call(Fe,fe,F):Me,F==null)break e;fe=p({},fe,F);break e;case 2:ma=!0}}F=w.callback,F!==null&&(e.flags|=64,te&&(e.flags|=8192),te=c.callbacks,te===null?c.callbacks=[F]:te.push(F))}else te={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ce===null?(J=ce=te,R=fe):ce=ce.next=te,y|=F;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;te=w,w=te.next,te.next=null,c.lastBaseUpdate=te,c.shared.pending=null}}while(!0);ce===null&&(R=fe),c.baseState=R,c.firstBaseUpdate=J,c.lastBaseUpdate=ce,d===null&&(c.shared.lanes=0),Sa|=y,e.lanes=y,e.memoizedState=fe}}function Nh(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function wh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Nh(a[e],t)}var Hs=$(null),Si=$(0);function Sh(e,t){e=Jn,ae(Si,e),ae(Hs,t),Jn=e|t.baseLanes}function qc(){ae(Si,Jn),ae(Hs,Hs.current)}function Lc(){Jn=Si.current,Z(Hs),Z(Si)}var ga=0,He=null,Je=null,gt=null,Ei=!1,$s=!1,as=!1,ki=0,Wl=0,Us=null,g1=0;function ht(){throw Error(o(321))}function Yc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!It(e[a],t[a]))return!1;return!0}function Vc(e,t,a,l,c,d){return ga=d,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?im:om,as=!1,d=a(l,c),as=!1,$s&&(d=kh(t,a,l,c)),Eh(e),d}function Eh(e){k.H=Ri;var t=Je!==null&&Je.next!==null;if(ga=0,gt=Je=He=null,Ei=!1,Wl=0,Us=null,t)throw Error(o(300));e===null||St||(e=e.dependencies,e!==null&&bi(e)&&(St=!0))}function kh(e,t,a,l){He=e;var c=0;do{if($s&&(Us=null),Wl=0,$s=!1,25<=c)throw Error(o(301));if(c+=1,gt=Je=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}k.H=S1,d=t(a,l)}while($s);return d}function y1(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Ql(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(He.flags|=1024),t}function Gc(){var e=ki!==0;return ki=0,e}function Xc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Zc(e){if(Ei){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ei=!1}ga=0,gt=Je=He=null,$s=!1,Wl=ki=0,Us=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?He.memoizedState=gt=e:gt=gt.next=e,gt}function yt(){if(Je===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=gt===null?He.memoizedState:gt.next;if(t!==null)gt=t,Je=e;else{if(e===null)throw He.alternate===null?Error(o(467)):Error(o(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},gt===null?He.memoizedState=gt=e:gt=gt.next=e}return gt}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ql(e){var t=Wl;return Wl+=1,Us===null&&(Us=[]),e=bh(Us,e,t),t=He,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?im:om),e}function _i(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ql(e);if(e.$$typeof===L)return Bt(e)}throw Error(o(438,String(e)))}function Qc(e){var t=null,a=He.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=He.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Wc(),He.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=K;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function Ci(e){var t=yt();return Kc(t,Je,e)}function Kc(e,t,a){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=a;var c=e.baseQueue,d=l.pending;if(d!==null){if(c!==null){var y=c.next;c.next=d.next,d.next=y}t.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=y=null,R=null,J=t,ce=!1;do{var fe=J.lane&-536870913;if(fe!==J.lane?(Ye&fe)===fe:(ga&fe)===fe){var F=J.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),fe===Os&&(ce=!0);else if((ga&F)===F){J=J.next,F===Os&&(ce=!0);continue}else fe={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},R===null?(w=R=fe,y=d):R=R.next=fe,He.lanes|=F,Sa|=F;fe=J.action,as&&a(d,fe),d=J.hasEagerState?J.eagerState:a(d,fe)}else F={lane:fe,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},R===null?(w=R=F,y=d):R=R.next=F,He.lanes|=fe,Sa|=fe;J=J.next}while(J!==null&&J!==t);if(R===null?y=d:R.next=w,!It(d,e.memoizedState)&&(St=!0,ce&&(a=Ds,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=R,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Jc(e){var t=yt(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var y=c=c.next;do d=e(d,y.action),y=y.next;while(y!==c);It(d,t.memoizedState)||(St=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,l]}function _h(e,t,a){var l=He,c=yt(),d=Ze;if(d){if(a===void 0)throw Error(o(407));a=a()}else a=t();var y=!It((Je||c).memoizedState,a);y&&(c.memoizedState=a,St=!0),c=c.queue;var w=Mh.bind(null,l,c,e);if(Kl(2048,8,w,[e]),c.getSnapshot!==t||y||gt!==null&>.memoizedState.tag&1){if(l.flags|=2048,Bs(9,Ti(),Th.bind(null,l,c,a,t),null),et===null)throw Error(o(349));d||(ga&124)!==0||Ch(l,t,a)}return a}function Ch(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=He.updateQueue,t===null?(t=Wc(),He.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Th(e,t,a,l){t.value=a,t.getSnapshot=l,Ah(t)&&Rh(e)}function Mh(e,t,a){return a(function(){Ah(t)&&Rh(e)})}function Ah(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!It(e,a)}catch{return!0}}function Rh(e){var t=Ms(e,2);t!==null&&an(t,e,2)}function Ic(e){var t=Zt();if(typeof e=="function"){var a=e;if(e=a(),as){pt(!0);try{a()}finally{pt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function zh(e,t,a,l){return e.baseState=a,Kc(e,Je,typeof l=="function"?l:Gn)}function b1(e,t,a,l,c){if(Ai(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};k.T!==null?a(!0):d.isTransition=!1,l(d),a=t.pending,a===null?(d.next=t.pending=d,Oh(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Oh(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var d=k.T,y={};k.T=y;try{var w=a(c,l),R=k.S;R!==null&&R(y,w),Dh(e,t,w)}catch(J){Fc(e,t,J)}finally{k.T=d}}else try{d=a(c,l),Dh(e,t,d)}catch(J){Fc(e,t,J)}}function Dh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Hh(e,t,l)},function(l){return Fc(e,t,l)}):Hh(e,t,a)}function Hh(e,t,a){t.status="fulfilled",t.value=a,$h(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Oh(e,a)))}function Fc(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,$h(t),t=t.next;while(t!==l)}e.action=null}function $h(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uh(e,t){return t}function Bh(e,t){if(Ze){var a=et.formState;if(a!==null){e:{var l=He;if(Ze){if(it){t:{for(var c=it,d=Cn;c.nodeType!==8;){if(!d){c=null;break t}if(c=Nn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){it=Nn(c.nextSibling),l=c.data==="F!";break e}}Pa(l)}l=!1}l&&(t=a[0])}}return a=Zt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uh,lastRenderedState:t},a.queue=l,a=sm.bind(null,He,l),l.dispatch=a,l=Ic(!1),d=au.bind(null,He,!1,l.queue),l=Zt(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=b1.bind(null,He,c,d,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function qh(e){var t=yt();return Lh(t,Je,e)}function Lh(e,t,a){if(t=Kc(e,t,Uh)[0],e=Ci(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ql(t)}catch(y){throw y===Yl?Ni:y}else l=t;t=yt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(He.flags|=2048,Bs(9,Ti(),v1.bind(null,c,a),null)),[l,d,e]}function v1(e,t){e.action=t}function Yh(e){var t=yt(),a=Je;if(a!==null)return Lh(t,a,e);yt(),t=t.memoizedState,a=yt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Bs(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=He.updateQueue,t===null&&(t=Wc(),He.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function Ti(){return{destroy:void 0,resource:void 0}}function Vh(){return yt().memoizedState}function Mi(e,t,a,l){var c=Zt();l=l===void 0?null:l,He.flags|=e,c.memoizedState=Bs(1|t,Ti(),a,l)}function Kl(e,t,a,l){var c=yt();l=l===void 0?null:l;var d=c.memoizedState.inst;Je!==null&&l!==null&&Yc(l,Je.memoizedState.deps)?c.memoizedState=Bs(t,d,a,l):(He.flags|=e,c.memoizedState=Bs(1|t,d,a,l))}function Gh(e,t){Mi(8390656,8,e,t)}function Xh(e,t){Kl(2048,8,e,t)}function Zh(e,t){return Kl(4,2,e,t)}function Wh(e,t){return Kl(4,4,e,t)}function Qh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kh(e,t,a){a=a!=null?a.concat([e]):null,Kl(4,4,Qh.bind(null,t,e),a)}function Pc(){}function Jh(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Yc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Ih(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Yc(t,l[1]))return l[0];if(l=e(),as){pt(!0);try{e()}finally{pt(!1)}}return a.memoizedState=[l,t],l}function eu(e,t,a){return a===void 0||(ga&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=ep(),He.lanes|=e,Sa|=e,a)}function Fh(e,t,a,l){return It(a,t)?a:Hs.current!==null?(e=eu(e,a,l),It(e,t)||(St=!0),e):(ga&42)===0?(St=!0,e.memoizedState=a):(e=ep(),He.lanes|=e,Sa|=e,t)}function Ph(e,t,a,l,c){var d=H.p;H.p=d!==0&&8>d?d:8;var y=k.T,w={};k.T=w,au(e,!1,t,a);try{var R=c(),J=k.S;if(J!==null&&J(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ce=x1(R,l);Jl(e,t,ce,nn(e))}else Jl(e,t,l,nn(e))}catch(fe){Jl(e,t,{then:function(){},status:"rejected",reason:fe},nn())}finally{H.p=d,k.T=y}}function j1(){}function tu(e,t,a,l){if(e.tag!==5)throw Error(o(476));var c=em(e).queue;Ph(e,c,t,O,a===null?j1:function(){return tm(e),a(l)})}function em(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:O},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tm(e){var t=em(e).next.queue;Jl(e,t,{},nn())}function nu(){return Bt(mr)}function nm(){return yt().memoizedState}function am(){return yt().memoizedState}function N1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=nn();e=pa(a);var l=xa(t,e,a);l!==null&&(an(l,t,a),Gl(l,t,a)),t={cache:Rc()},e.payload=t;return}t=t.return}}function w1(e,t,a){var l=nn();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Ai(e)?lm(t,a):(a=Nc(e,t,a,l),a!==null&&(an(a,e,l),rm(a,t,l)))}function sm(e,t,a){var l=nn();Jl(e,t,a,l)}function Jl(e,t,a,l){var c={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ai(e))lm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,w=d(y,a);if(c.hasEagerState=!0,c.eagerState=w,It(w,y))return mi(e,t,c,0),et===null&&hi(),!1}catch{}finally{}if(a=Nc(e,t,c,l),a!==null)return an(a,e,l),rm(a,t,l),!0}return!1}function au(e,t,a,l){if(l={lane:2,revertLane:Du(),action:l,hasEagerState:!1,eagerState:null,next:null},Ai(e)){if(t)throw Error(o(479))}else t=Nc(e,a,l,2),t!==null&&an(t,e,2)}function Ai(e){var t=e.alternate;return e===He||t!==null&&t===He}function lm(e,t){$s=Ei=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function rm(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Kr(e,a)}}var Ri={readContext:Bt,use:_i,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht},im={readContext:Bt,use:_i,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Gh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Mi(4194308,4,Qh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Mi(4194308,4,e,t)},useInsertionEffect:function(e,t){Mi(4,2,e,t)},useMemo:function(e,t){var a=Zt();t=t===void 0?null:t;var l=e();if(as){pt(!0);try{e()}finally{pt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Zt();if(a!==void 0){var c=a(t);if(as){pt(!0);try{a(t)}finally{pt(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=w1.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ic(e);var t=e.queue,a=sm.bind(null,He,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Pc,useDeferredValue:function(e,t){var a=Zt();return eu(a,e,t)},useTransition:function(){var e=Ic(!1);return e=Ph.bind(null,He,e.queue,!0,!1),Zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=He,c=Zt();if(Ze){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),et===null)throw Error(o(349));(Ye&124)!==0||Ch(l,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Gh(Mh.bind(null,l,d,e),[e]),l.flags|=2048,Bs(9,Ti(),Th.bind(null,l,d,a,t),null),a},useId:function(){var e=Zt(),t=et.identifierPrefix;if(Ze){var a=Ln,l=qn;a=(l&~(1<<32-at(l)-1)).toString(32)+a,t="«"+t+"R"+a,a=ki++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=g1++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:nu,useFormState:Bh,useActionState:Bh,useOptimistic:function(e){var t=Zt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=au.bind(null,He,!0,a),a.dispatch=t,[e,t]},useMemoCache:Qc,useCacheRefresh:function(){return Zt().memoizedState=N1.bind(null,He)}},om={readContext:Bt,use:_i,useCallback:Jh,useContext:Bt,useEffect:Xh,useImperativeHandle:Kh,useInsertionEffect:Zh,useLayoutEffect:Wh,useMemo:Ih,useReducer:Ci,useRef:Vh,useState:function(){return Ci(Gn)},useDebugValue:Pc,useDeferredValue:function(e,t){var a=yt();return Fh(a,Je.memoizedState,e,t)},useTransition:function(){var e=Ci(Gn)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:_h,useId:nm,useHostTransitionStatus:nu,useFormState:qh,useActionState:qh,useOptimistic:function(e,t){var a=yt();return zh(a,Je,e,t)},useMemoCache:Qc,useCacheRefresh:am},S1={readContext:Bt,use:_i,useCallback:Jh,useContext:Bt,useEffect:Xh,useImperativeHandle:Kh,useInsertionEffect:Zh,useLayoutEffect:Wh,useMemo:Ih,useReducer:Jc,useRef:Vh,useState:function(){return Jc(Gn)},useDebugValue:Pc,useDeferredValue:function(e,t){var a=yt();return Je===null?eu(a,e,t):Fh(a,Je.memoizedState,e,t)},useTransition:function(){var e=Jc(Gn)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ql(e),t]},useSyncExternalStore:_h,useId:nm,useHostTransitionStatus:nu,useFormState:Yh,useActionState:Yh,useOptimistic:function(e,t){var a=yt();return Je!==null?zh(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Qc,useCacheRefresh:am},qs=null,Il=0;function zi(e){var t=Il;return Il+=1,qs===null&&(qs=[]),bh(qs,e,t)}function Fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Oi(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cm(e){var t=e._init;return t(e._payload)}function um(e){function t(G,B){if(e){var Q=G.deletions;Q===null?(G.deletions=[B],G.flags|=16):Q.push(B)}}function a(G,B){if(!e)return null;for(;B!==null;)t(G,B),B=B.sibling;return null}function l(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function c(G,B){return G=Bn(G,B),G.index=0,G.sibling=null,G}function d(G,B,Q){return G.index=Q,e?(Q=G.alternate,Q!==null?(Q=Q.index,Q<B?(G.flags|=67108866,B):Q):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function y(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function w(G,B,Q,de){return B===null||B.tag!==6?(B=Sc(Q,G.mode,de),B.return=G,B):(B=c(B,Q),B.return=G,B)}function R(G,B,Q,de){var ye=Q.type;return ye===T?ce(G,B,Q.props.children,de,Q.key):B!==null&&(B.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ie&&cm(ye)===B.type)?(B=c(B,Q.props),Fl(B,Q),B.return=G,B):(B=xi(Q.type,Q.key,Q.props,null,G.mode,de),Fl(B,Q),B.return=G,B)}function J(G,B,Q,de){return B===null||B.tag!==4||B.stateNode.containerInfo!==Q.containerInfo||B.stateNode.implementation!==Q.implementation?(B=Ec(Q,G.mode,de),B.return=G,B):(B=c(B,Q.children||[]),B.return=G,B)}function ce(G,B,Q,de,ye){return B===null||B.tag!==7?(B=Ka(Q,G.mode,de,ye),B.return=G,B):(B=c(B,Q),B.return=G,B)}function fe(G,B,Q){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Sc(""+B,G.mode,Q),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case v:return Q=xi(B.type,B.key,B.props,null,G.mode,Q),Fl(Q,B),Q.return=G,Q;case N:return B=Ec(B,G.mode,Q),B.return=G,B;case ie:var de=B._init;return B=de(B._payload),fe(G,B,Q)}if(U(B)||ee(B))return B=Ka(B,G.mode,Q,null),B.return=G,B;if(typeof B.then=="function")return fe(G,zi(B),Q);if(B.$$typeof===L)return fe(G,vi(G,B),Q);Oi(G,B)}return null}function F(G,B,Q,de){var ye=B!==null?B.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ye!==null?null:w(G,B,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===ye?R(G,B,Q,de):null;case N:return Q.key===ye?J(G,B,Q,de):null;case ie:return ye=Q._init,Q=ye(Q._payload),F(G,B,Q,de)}if(U(Q)||ee(Q))return ye!==null?null:ce(G,B,Q,de,null);if(typeof Q.then=="function")return F(G,B,zi(Q),de);if(Q.$$typeof===L)return F(G,B,vi(G,Q),de);Oi(G,Q)}return null}function te(G,B,Q,de,ye){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return G=G.get(Q)||null,w(B,G,""+de,ye);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return G=G.get(de.key===null?Q:de.key)||null,R(B,G,de,ye);case N:return G=G.get(de.key===null?Q:de.key)||null,J(B,G,de,ye);case ie:var $e=de._init;return de=$e(de._payload),te(G,B,Q,de,ye)}if(U(de)||ee(de))return G=G.get(Q)||null,ce(B,G,de,ye,null);if(typeof de.then=="function")return te(G,B,Q,zi(de),ye);if(de.$$typeof===L)return te(G,B,Q,vi(B,de),ye);Oi(B,de)}return null}function Me(G,B,Q,de){for(var ye=null,$e=null,we=B,Ce=B=0,kt=null;we!==null&&Ce<Q.length;Ce++){we.index>Ce?(kt=we,we=null):kt=we.sibling;var Xe=F(G,we,Q[Ce],de);if(Xe===null){we===null&&(we=kt);break}e&&we&&Xe.alternate===null&&t(G,we),B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe,we=kt}if(Ce===Q.length)return a(G,we),Ze&&Ia(G,Ce),ye;if(we===null){for(;Ce<Q.length;Ce++)we=fe(G,Q[Ce],de),we!==null&&(B=d(we,B,Ce),$e===null?ye=we:$e.sibling=we,$e=we);return Ze&&Ia(G,Ce),ye}for(we=l(we);Ce<Q.length;Ce++)kt=te(we,G,Ce,Q[Ce],de),kt!==null&&(e&&kt.alternate!==null&&we.delete(kt.key===null?Ce:kt.key),B=d(kt,B,Ce),$e===null?ye=kt:$e.sibling=kt,$e=kt);return e&&we.forEach(function(za){return t(G,za)}),Ze&&Ia(G,Ce),ye}function _e(G,B,Q,de){if(Q==null)throw Error(o(151));for(var ye=null,$e=null,we=B,Ce=B=0,kt=null,Xe=Q.next();we!==null&&!Xe.done;Ce++,Xe=Q.next()){we.index>Ce?(kt=we,we=null):kt=we.sibling;var za=F(G,we,Xe.value,de);if(za===null){we===null&&(we=kt);break}e&&we&&za.alternate===null&&t(G,we),B=d(za,B,Ce),$e===null?ye=za:$e.sibling=za,$e=za,we=kt}if(Xe.done)return a(G,we),Ze&&Ia(G,Ce),ye;if(we===null){for(;!Xe.done;Ce++,Xe=Q.next())Xe=fe(G,Xe.value,de),Xe!==null&&(B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe);return Ze&&Ia(G,Ce),ye}for(we=l(we);!Xe.done;Ce++,Xe=Q.next())Xe=te(we,G,Ce,Xe.value,de),Xe!==null&&(e&&Xe.alternate!==null&&we.delete(Xe.key===null?Ce:Xe.key),B=d(Xe,B,Ce),$e===null?ye=Xe:$e.sibling=Xe,$e=Xe);return e&&we.forEach(function(Eb){return t(G,Eb)}),Ze&&Ia(G,Ce),ye}function Fe(G,B,Q,de){if(typeof Q=="object"&&Q!==null&&Q.type===T&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var ye=Q.key;B!==null;){if(B.key===ye){if(ye=Q.type,ye===T){if(B.tag===7){a(G,B.sibling),de=c(B,Q.props.children),de.return=G,G=de;break e}}else if(B.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ie&&cm(ye)===B.type){a(G,B.sibling),de=c(B,Q.props),Fl(de,Q),de.return=G,G=de;break e}a(G,B);break}else t(G,B);B=B.sibling}Q.type===T?(de=Ka(Q.props.children,G.mode,de,Q.key),de.return=G,G=de):(de=xi(Q.type,Q.key,Q.props,null,G.mode,de),Fl(de,Q),de.return=G,G=de)}return y(G);case N:e:{for(ye=Q.key;B!==null;){if(B.key===ye)if(B.tag===4&&B.stateNode.containerInfo===Q.containerInfo&&B.stateNode.implementation===Q.implementation){a(G,B.sibling),de=c(B,Q.children||[]),de.return=G,G=de;break e}else{a(G,B);break}else t(G,B);B=B.sibling}de=Ec(Q,G.mode,de),de.return=G,G=de}return y(G);case ie:return ye=Q._init,Q=ye(Q._payload),Fe(G,B,Q,de)}if(U(Q))return Me(G,B,Q,de);if(ee(Q)){if(ye=ee(Q),typeof ye!="function")throw Error(o(150));return Q=ye.call(Q),_e(G,B,Q,de)}if(typeof Q.then=="function")return Fe(G,B,zi(Q),de);if(Q.$$typeof===L)return Fe(G,B,vi(G,Q),de);Oi(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,B!==null&&B.tag===6?(a(G,B.sibling),de=c(B,Q),de.return=G,G=de):(a(G,B),de=Sc(Q,G.mode,de),de.return=G,G=de),y(G)):a(G,B)}return function(G,B,Q,de){try{Il=0;var ye=Fe(G,B,Q,de);return qs=null,ye}catch(we){if(we===Yl||we===Ni)throw we;var $e=Ft(29,we,null,G.mode);return $e.lanes=de,$e.return=G,$e}finally{}}}var Ls=um(!0),dm=um(!1),mn=$(null),Tn=null;function ya(e){var t=e.alternate;ae(vt,vt.current&1),ae(mn,e),Tn===null&&(t===null||Hs.current!==null||t.memoizedState!==null)&&(Tn=e)}function fm(e){if(e.tag===22){if(ae(vt,vt.current),ae(mn,e),Tn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Tn=e)}}else ba()}function ba(){ae(vt,vt.current),ae(mn,mn.current)}function Xn(e){Z(mn),Tn===e&&(Tn=null),Z(vt)}var vt=$(0);function Di(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Wu(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function su(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:p({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var lu={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=nn(),c=pa(l);c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,l),t!==null&&(an(t,e,l),Gl(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=nn(),c=pa(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=xa(e,c,l),t!==null&&(an(t,e,l),Gl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=nn(),l=pa(a);l.tag=2,t!=null&&(l.callback=t),t=xa(e,l,a),t!==null&&(an(t,e,a),Gl(t,e,a))}};function hm(e,t,a,l,c,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,y):t.prototype&&t.prototype.isPureReactComponent?!Ol(a,l)||!Ol(c,d):!0}function mm(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&lu.enqueueReplaceState(t,t.state,null)}function ss(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=p({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function pm(e){Hi(e)}function xm(e){console.error(e)}function gm(e){Hi(e)}function $i(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ym(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function ru(e,t,a){return a=pa(a),a.tag=3,a.payload={element:null},a.callback=function(){$i(e,t)},a}function bm(e){return e=pa(e),e.tag=3,e}function vm(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=l.value;e.payload=function(){return c(d)},e.callback=function(){ym(t,a,l)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){ym(t,a,l),typeof c!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function E1(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Bl(t,a,c,!0),a=mn.current,a!==null){switch(a.tag){case 13:return Tn===null?Mu():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===Dc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Ru(e,l,c)),!1;case 22:return a.flags|=65536,l===Dc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Ru(e,l,c)),!1}throw Error(o(435,a.tag))}return Ru(e,l,c),Mu(),!1}if(Ze)return t=mn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Cc&&(e=Error(o(422),{cause:l}),Ul(un(e,a)))):(l!==Cc&&(t=Error(o(423),{cause:l}),Ul(un(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=un(l,a),c=ru(e.stateNode,l,c),Uc(e,c),ot!==4&&(ot=2)),!1;var d=Error(o(520),{cause:l});if(d=un(d,a),lr===null?lr=[d]:lr.push(d),ot!==4&&(ot=2),t===null)return!0;l=un(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=ru(a.stateNode,l,e),Uc(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ea===null||!Ea.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=bm(c),vm(c,e,a,l),Uc(a,c),!1}a=a.return}while(a!==null);return!1}var jm=Error(o(461)),St=!1;function Rt(e,t,a,l){t.child=e===null?dm(t,null,a,l):Ls(t,e.child,a,l)}function Nm(e,t,a,l,c){a=a.render;var d=t.ref;if("ref"in l){var y={};for(var w in l)w!=="ref"&&(y[w]=l[w])}else y=l;return ts(t),l=Vc(e,t,a,y,d,c),w=Gc(),e!==null&&!St?(Xc(e,t,c),Zn(e,t,c)):(Ze&&w&&kc(t),t.flags|=1,Rt(e,t,l,c),t.child)}function wm(e,t,a,l,c){if(e===null){var d=a.type;return typeof d=="function"&&!wc(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Sm(e,t,d,l,c)):(e=xi(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!mu(e,c)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:Ol,a(y,l)&&e.ref===t.ref)return Zn(e,t,c)}return t.flags|=1,e=Bn(d,l),e.ref=t.ref,e.return=t,t.child=e}function Sm(e,t,a,l,c){if(e!==null){var d=e.memoizedProps;if(Ol(d,l)&&e.ref===t.ref)if(St=!1,t.pendingProps=l=d,mu(e,c))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,Zn(e,t,c)}return iu(e,t,a,l,c)}function Em(e,t,a){var l=t.pendingProps,c=l.children,d=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=d!==null?d.baseLanes|a:a,e!==null){for(c=t.child=e.child,d=0;c!==null;)d=d|c.lanes|c.childLanes,c=c.sibling;t.childLanes=d&~l}else t.childLanes=0,t.child=null;return km(e,t,l,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ji(t,d!==null?d.cachePool:null),d!==null?Sh(t,d):qc(),fm(t);else return t.lanes=t.childLanes=536870912,km(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(ji(t,d.cachePool),Sh(t,d),ba(),t.memoizedState=null):(e!==null&&ji(t,null),qc(),ba());return Rt(e,t,c,a),t.child}function km(e,t,a,l){var c=Oc();return c=c===null?null:{parent:bt._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&ji(t,null),qc(),fm(t),e!==null&&Bl(e,t,l,!0),null}function Ui(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function iu(e,t,a,l,c){return ts(t),a=Vc(e,t,a,l,void 0,c),l=Gc(),e!==null&&!St?(Xc(e,t,c),Zn(e,t,c)):(Ze&&l&&kc(t),t.flags|=1,Rt(e,t,a,c),t.child)}function _m(e,t,a,l,c,d){return ts(t),t.updateQueue=null,a=kh(t,l,a,c),Eh(e),l=Gc(),e!==null&&!St?(Xc(e,t,d),Zn(e,t,d)):(Ze&&l&&kc(t),t.flags|=1,Rt(e,t,a,d),t.child)}function Cm(e,t,a,l,c){if(ts(t),t.stateNode===null){var d=As,y=a.contextType;typeof y=="object"&&y!==null&&(d=Bt(y)),d=new a(l,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=lu,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=l,d.state=t.memoizedState,d.refs={},Hc(t),y=a.contextType,d.context=typeof y=="object"&&y!==null?Bt(y):As,d.state=t.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(su(t,a,y,l),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&lu.enqueueReplaceState(d,d.state,null),Zl(t,l,d,c),Xl(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,R=ss(a,w);d.props=R;var J=d.context,ce=a.contextType;y=As,typeof ce=="object"&&ce!==null&&(y=Bt(ce));var fe=a.getDerivedStateFromProps;ce=typeof fe=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ce||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||J!==y)&&mm(t,d,l,y),ma=!1;var F=t.memoizedState;d.state=F,Zl(t,l,d,c),Xl(),J=t.memoizedState,w||F!==J||ma?(typeof fe=="function"&&(su(t,a,fe,l),J=t.memoizedState),(R=ma||hm(t,a,R,l,F,J,y))?(ce||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=J),d.props=l,d.state=J,d.context=y,l=R):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{d=t.stateNode,$c(e,t),y=t.memoizedProps,ce=ss(a,y),d.props=ce,fe=t.pendingProps,F=d.context,J=a.contextType,R=As,typeof J=="object"&&J!==null&&(R=Bt(J)),w=a.getDerivedStateFromProps,(J=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==fe||F!==R)&&mm(t,d,l,R),ma=!1,F=t.memoizedState,d.state=F,Zl(t,l,d,c),Xl();var te=t.memoizedState;y!==fe||F!==te||ma||e!==null&&e.dependencies!==null&&bi(e.dependencies)?(typeof w=="function"&&(su(t,a,w,l),te=t.memoizedState),(ce=ma||hm(t,a,ce,l,F,te,R)||e!==null&&e.dependencies!==null&&bi(e.dependencies))?(J||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,te,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,te,R)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),d.props=l,d.state=te,d.context=R,l=ce):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),l=!1)}return d=l,Ui(e,t),l=(t.flags&128)!==0,d||l?(d=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&l?(t.child=Ls(t,e.child,null,c),t.child=Ls(t,null,a,c)):Rt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=Zn(e,t,c),e}function Tm(e,t,a,l){return $l(),t.flags|=256,Rt(e,t,a,l),t.child}var ou={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cu(e){return{baseLanes:e,cachePool:xh()}}function uu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=pn),e}function Mm(e,t,a){var l=t.pendingProps,c=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(c?ya(t):ba(),Ze){var w=it,R;if(R=w){e:{for(R=w,w=Cn;R.nodeType!==8;){if(!w){w=null;break e}if(R=Nn(R.nextSibling),R===null){w=null;break e}}w=R}w!==null?(t.memoizedState={dehydrated:w,treeContext:Ja!==null?{id:qn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},R=Ft(18,null,null,0),R.stateNode=w,R.return=t,t.child=R,Gt=t,it=null,R=!0):R=!1}R||Pa(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return Wu(w)?t.lanes=32:t.lanes=536870912,null;Xn(t)}return w=l.children,l=l.fallback,c?(ba(),c=t.mode,w=Bi({mode:"hidden",children:w},c),l=Ka(l,c,a,null),w.return=t,l.return=t,w.sibling=l,t.child=w,c=t.child,c.memoizedState=cu(a),c.childLanes=uu(e,y,a),t.memoizedState=ou,l):(ya(t),du(t,w))}if(R=e.memoizedState,R!==null&&(w=R.dehydrated,w!==null)){if(d)t.flags&256?(ya(t),t.flags&=-257,t=fu(e,t,a)):t.memoizedState!==null?(ba(),t.child=e.child,t.flags|=128,t=null):(ba(),c=l.fallback,w=t.mode,l=Bi({mode:"visible",children:l.children},w),c=Ka(c,w,a,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,Ls(t,e.child,null,a),l=t.child,l.memoizedState=cu(a),l.childLanes=uu(e,y,a),t.memoizedState=ou,t=c);else if(ya(t),Wu(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var J=y.dgst;y=J,l=Error(o(419)),l.stack="",l.digest=y,Ul({value:l,source:null,stack:null}),t=fu(e,t,a)}else if(St||Bl(e,t,a,!1),y=(a&e.childLanes)!==0,St||y){if(y=et,y!==null&&(l=a&-a,l=(l&42)!==0?1:Nl(l),l=(l&(y.suspendedLanes|a))!==0?0:l,l!==0&&l!==R.retryLane))throw R.retryLane=l,Ms(e,l),an(y,e,l),jm;w.data==="$?"||Mu(),t=fu(e,t,a)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,it=Nn(w.nextSibling),Gt=t,Ze=!0,Fa=null,Cn=!1,e!==null&&(fn[hn++]=qn,fn[hn++]=Ln,fn[hn++]=Ja,qn=e.id,Ln=e.overflow,Ja=t),t=du(t,l.children),t.flags|=4096);return t}return c?(ba(),c=l.fallback,w=t.mode,R=e.child,J=R.sibling,l=Bn(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,J!==null?c=Bn(J,c):(c=Ka(c,w,a,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,w=e.child.memoizedState,w===null?w=cu(a):(R=w.cachePool,R!==null?(J=bt._currentValue,R=R.parent!==J?{parent:J,pool:J}:R):R=xh(),w={baseLanes:w.baseLanes|a,cachePool:R}),c.memoizedState=w,c.childLanes=uu(e,y,a),t.memoizedState=ou,l):(ya(t),a=e.child,e=a.sibling,a=Bn(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=a,t.memoizedState=null,a)}function du(e,t){return t=Bi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bi(e,t){return e=Ft(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function fu(e,t,a){return Ls(t,e.child,null,a),e=du(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Am(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Mc(e.return,t,a)}function hu(e,t,a,l,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=c)}function Rm(e,t,a){var l=t.pendingProps,c=l.revealOrder,d=l.tail;if(Rt(e,t,l.children,a),l=vt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Am(e,a,t);else if(e.tag===19)Am(e,a,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}l&=1}switch(ae(vt,l),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Di(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),hu(t,!1,c,a,d);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Di(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}hu(t,!0,a,null,d);break;case"together":hu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Sa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Bl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Bn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Bn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function mu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&bi(e)))}function k1(e,t,a){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ha(t,bt,e.memoizedState.cache),$l();break;case 27:case 5:Re(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ya(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Mm(e,t,a):(ya(t),e=Zn(e,t,a),e!==null?e.sibling:null);ya(t);break;case 19:var c=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Bl(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return Rm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ae(vt,vt.current),l)break;return null;case 22:case 23:return t.lanes=0,Em(e,t,a);case 24:ha(t,bt,e.memoizedState.cache)}return Zn(e,t,a)}function zm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!mu(e,a)&&(t.flags&128)===0)return St=!1,k1(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ze&&(t.flags&1048576)!==0&&ch(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,c=l._init;if(l=c(l._payload),t.type=l,typeof l=="function")wc(l)?(e=ss(l,e),t.tag=1,t=Cm(null,t,l,e,a)):(t.tag=0,t=iu(null,t,l,e,a));else{if(l!=null){if(c=l.$$typeof,c===C){t.tag=11,t=Nm(null,t,l,e,a);break e}else if(c===X){t.tag=14,t=wm(null,t,l,e,a);break e}}throw t=S(l)||l,Error(o(306,t,""))}}return t;case 0:return iu(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=ss(l,t.pendingProps),Cm(e,t,l,c,a);case 3:e:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var d=t.memoizedState;c=d.element,$c(e,t),Zl(t,l,null,a);var y=t.memoizedState;if(l=y.cache,ha(t,bt,l),l!==d.cache&&Ac(t,[bt],a,!0),Xl(),l=y.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Tm(e,t,l,a);break e}else if(l!==c){c=un(Error(o(424)),t),Ul(c),t=Tm(e,t,l,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=Nn(e.firstChild),Gt=t,Ze=!0,Fa=null,Cn=!0,a=dm(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($l(),l===c){t=Zn(e,t,a);break e}Rt(e,t,l,a)}t=t.child}return t;case 26:return Ui(e,t),e===null?(a=$p(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ze||(a=t.type,e=t.pendingProps,l=Pi(me.current).createElement(a),l[wt]=t,l[Ut]=e,Ot(l,a,e),xt(l),t.stateNode=l):t.memoizedState=$p(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Ze&&(l=t.stateNode=Op(t.type,t.pendingProps,me.current),Gt=t,Cn=!0,c=it,Ca(t.type)?(Qu=c,it=Nn(l.firstChild)):it=c),Rt(e,t,t.pendingProps.children,a),Ui(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((c=l=it)&&(l=eb(l,t.type,t.pendingProps,Cn),l!==null?(t.stateNode=l,Gt=t,it=Nn(l.firstChild),Cn=!1,c=!0):c=!1),c||Pa(t)),Re(t),c=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,l=d.children,Gu(c,d)?l=null:y!==null&&Gu(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Vc(e,t,y1,null,null,a),mr._currentValue=c),Ui(e,t),Rt(e,t,l,a),t.child;case 6:return e===null&&Ze&&((e=a=it)&&(a=tb(a,t.pendingProps,Cn),a!==null?(t.stateNode=a,Gt=t,it=null,e=!0):e=!1),e||Pa(t)),null;case 13:return Mm(e,t,a);case 4:return ve(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ls(t,null,l,a):Rt(e,t,l,a),t.child;case 11:return Nm(e,t,t.type,t.pendingProps,a);case 7:return Rt(e,t,t.pendingProps,a),t.child;case 8:return Rt(e,t,t.pendingProps.children,a),t.child;case 12:return Rt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,ha(t,t.type,l.value),Rt(e,t,l.children,a),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,ts(t),c=Bt(c),l=l(c),t.flags|=1,Rt(e,t,l,a),t.child;case 14:return wm(e,t,t.type,t.pendingProps,a);case 15:return Sm(e,t,t.type,t.pendingProps,a);case 19:return Rm(e,t,a);case 31:return l=t.pendingProps,a=t.mode,l={mode:l.mode,children:l.children},e===null?(a=Bi(l,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Bn(e.child,l),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Em(e,t,a);case 24:return ts(t),l=Bt(bt),e===null?(c=Oc(),c===null&&(c=et,d=Rc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:l,cache:c},Hc(t),ha(t,bt,c)):((e.lanes&a)!==0&&($c(e,t),Zl(t,null,null,a),Xl()),c=e.memoizedState,d=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ha(t,bt,l)):(l=d.cache,ha(t,bt,l),l!==c.cache&&Ac(t,[bt],a,!0))),Rt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Wn(e){e.flags|=4}function Om(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Yp(t)){if(t=mn.current,t!==null&&((Ye&4194048)===Ye?Tn!==null:(Ye&62914560)!==Ye&&(Ye&536870912)===0||t!==Tn))throw Vl=Dc,gh;e.flags|=8192}}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?la():536870912,e.lanes|=t,Xs|=t)}function Pl(e,t){if(!Ze)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function _1(e,t,a){var l=t.pendingProps;switch(_c(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return rt(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Vn(bt),Ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fh())),rt(t),null;case 26:return a=t.memoizedState,e===null?(Wn(t),a!==null?(rt(t),Om(t,a)):(rt(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Wn(t),rt(t),Om(t,a)):(rt(t),t.flags&=-16777217):(e.memoizedProps!==l&&Wn(t),rt(t),t.flags&=-16777217),null;case 27:We(t),a=me.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return rt(t),null}e=oe.current,Hl(t)?uh(t):(e=Op(c,l,a),t.stateNode=e,Wn(t))}return rt(t),null;case 5:if(We(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return rt(t),null}if(e=oe.current,Hl(t))uh(t);else{switch(c=Pi(me.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?c.createElement("select",{is:l.is}):c.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?c.createElement(a,{is:l.is}):c.createElement(a)}}e[wt]=t,e[Ut]=l;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(Ot(e,a,l),a){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Wn(t)}}return rt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Wn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Hl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Gt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[wt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||_p(e.nodeValue,a)),e||Pa(t)}else e=Pi(e).createTextNode(l),e[wt]=t,t.stateNode=e}return rt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[wt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),c=!1}else c=fh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Xn(t),t):(Xn(t),null)}if(Xn(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=l!==null,e=e!==null&&e.memoizedState!==null,a){l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool);var d=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==c&&(l.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),qi(t,t.updateQueue),rt(t),null;case 4:return Ae(),e===null&&Bu(t.stateNode.containerInfo),rt(t),null;case 10:return Vn(t.type),rt(t),null;case 19:if(Z(vt),c=t.memoizedState,c===null)return rt(t),null;if(l=(t.flags&128)!==0,d=c.rendering,d===null)if(l)Pl(c,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Di(e),d!==null){for(t.flags|=128,Pl(c,!1),e=d.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)oh(a,e),a=a.sibling;return ae(vt,vt.current&1|2),t.child}e=e.sibling}c.tail!==null&&re()>Vi&&(t.flags|=128,l=!0,Pl(c,!1),t.lanes=4194304)}else{if(!l)if(e=Di(d),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),Pl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!d.alternate&&!Ze)return rt(t),null}else 2*re()-c.renderingStartTime>Vi&&a!==536870912&&(t.flags|=128,l=!0,Pl(c,!1),t.lanes=4194304);c.isBackwards?(d.sibling=t.child,t.child=d):(e=c.last,e!==null?e.sibling=d:t.child=d,c.last=d)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=re(),t.sibling=null,e=vt.current,ae(vt,l?e&1|2:e&1),t):(rt(t),null);case 22:case 23:return Xn(t),Lc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),a=t.updateQueue,a!==null&&qi(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&Z(ns),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Vn(bt),rt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function C1(e,t){switch(_c(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(bt),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 13:if(Xn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(vt),null;case 4:return Ae(),null;case 10:return Vn(t.type),null;case 22:case 23:return Xn(t),Lc(),e!==null&&Z(ns),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vn(bt),null;case 25:return null;default:return null}}function Dm(e,t){switch(_c(t),t.tag){case 3:Vn(bt),Ae();break;case 26:case 27:case 5:We(t);break;case 4:Ae();break;case 13:Xn(t);break;case 19:Z(vt);break;case 10:Vn(t.type);break;case 22:case 23:Xn(t),Lc(),e!==null&&Z(ns);break;case 24:Vn(bt)}}function er(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var d=a.create,y=a.inst;l=d(),y.destroy=l}a=a.next}while(a!==c)}}catch(w){Pe(t,t.return,w)}}function va(e,t,a){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var d=c.next;l=d;do{if((l.tag&e)===e){var y=l.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=t;var R=a,J=w;try{J()}catch(ce){Pe(c,R,ce)}}}l=l.next}while(l!==d)}}catch(ce){Pe(t,t.return,ce)}}function Hm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{wh(t,a)}catch(l){Pe(e,e.return,l)}}}function $m(e,t,a){a.props=ss(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Pe(e,t,l)}}function tr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(c){Pe(e,t,c)}}function Mn(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){Pe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Pe(e,t,c)}else a.current=null}function Um(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){Pe(e,e.return,c)}}function pu(e,t,a){try{var l=e.stateNode;K1(l,e.type,a,t),l[Ut]=t}catch(c){Pe(e,e.return,c)}}function Bm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ca(e.type)||e.tag===4}function xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ca(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gu(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Fi));else if(l!==4&&(l===27&&Ca(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(gu(e,t,a),e=e.sibling;e!==null;)gu(e,t,a),e=e.sibling}function Li(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Ca(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Li(e,t,a),e=e.sibling;e!==null;)Li(e,t,a),e=e.sibling}function qm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Ot(t,l,a),t[wt]=e,t[Ut]=a}catch(d){Pe(e,e.return,d)}}var Qn=!1,mt=!1,yu=!1,Lm=typeof WeakSet=="function"?WeakSet:Set,Et=null;function T1(e,t){if(e=e.containerInfo,Yu=lo,e=Ff(e),xc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var y=0,w=-1,R=-1,J=0,ce=0,fe=e,F=null;t:for(;;){for(var te;fe!==a||c!==0&&fe.nodeType!==3||(w=y+c),fe!==d||l!==0&&fe.nodeType!==3||(R=y+l),fe.nodeType===3&&(y+=fe.nodeValue.length),(te=fe.firstChild)!==null;)F=fe,fe=te;for(;;){if(fe===e)break t;if(F===a&&++J===c&&(w=y),F===d&&++ce===l&&(R=y),(te=fe.nextSibling)!==null)break;fe=F,F=fe.parentNode}fe=te}a=w===-1||R===-1?null:{start:w,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vu={focusedElem:e,selectionRange:a},lo=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,d=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,l=a.stateNode;try{var Me=ss(a.type,c,a.elementType===a.type);e=l.getSnapshotBeforeUpdate(Me,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(_e){Pe(a,a.return,_e)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Zu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Ym(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ja(e,a),l&4&&er(5,a);break;case 1:if(ja(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(y){Pe(a,a.return,y)}else{var c=ss(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Pe(a,a.return,y)}}l&64&&Hm(a),l&512&&tr(a,a.return);break;case 3:if(ja(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{wh(e,t)}catch(y){Pe(a,a.return,y)}}break;case 27:t===null&&l&4&&qm(a);case 26:case 5:ja(e,a),t===null&&l&4&&Um(a),l&512&&tr(a,a.return);break;case 12:ja(e,a);break;case 13:ja(e,a),l&4&&Xm(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=U1.bind(null,a),nb(e,a))));break;case 22:if(l=a.memoizedState!==null||Qn,!l){t=t!==null&&t.memoizedState!==null||mt,c=Qn;var d=mt;Qn=l,(mt=t)&&!d?Na(e,a,(a.subtreeFlags&8772)!==0):ja(e,a),Qn=c,mt=d}break;case 30:break;default:ja(e,a)}}function Vm(e){var t=e.alternate;t!==null&&(e.alternate=null,Vm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&El(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,Wt=!1;function Kn(e,t,a){for(a=a.child;a!==null;)Gm(e,t,a),a=a.sibling}function Gm(e,t,a){if(nt&&typeof nt.onCommitFiberUnmount=="function")try{nt.onCommitFiberUnmount(ft,a)}catch{}switch(a.tag){case 26:mt||Mn(a,t),Kn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:mt||Mn(a,t);var l=st,c=Wt;Ca(a.type)&&(st=a.stateNode,Wt=!1),Kn(e,t,a),ur(a.stateNode),st=l,Wt=c;break;case 5:mt||Mn(a,t);case 6:if(l=st,c=Wt,st=null,Kn(e,t,a),st=l,Wt=c,st!==null)if(Wt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(d){Pe(a,t,d)}else try{st.removeChild(a.stateNode)}catch(d){Pe(a,t,d)}break;case 18:st!==null&&(Wt?(e=st,Rp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),yr(e)):Rp(st,a.stateNode));break;case 4:l=st,c=Wt,st=a.stateNode.containerInfo,Wt=!0,Kn(e,t,a),st=l,Wt=c;break;case 0:case 11:case 14:case 15:mt||va(2,a,t),mt||va(4,a,t),Kn(e,t,a);break;case 1:mt||(Mn(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&$m(a,t,l)),Kn(e,t,a);break;case 21:Kn(e,t,a);break;case 22:mt=(l=mt)||a.memoizedState!==null,Kn(e,t,a),mt=l;break;default:Kn(e,t,a)}}function Xm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yr(e)}catch(a){Pe(t,t.return,a)}}function M1(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Lm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Lm),t;default:throw Error(o(435,e.tag))}}function bu(e,t){var a=M1(e);t.forEach(function(l){var c=B1.bind(null,e,l);a.has(l)||(a.add(l),l.then(c,c))})}function Pt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l],d=e,y=t,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(Ca(w.type)){st=w.stateNode,Wt=!1;break e}break;case 5:st=w.stateNode,Wt=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,Wt=!0;break e}w=w.return}if(st===null)throw Error(o(160));Gm(d,y,c),st=null,Wt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Zm(t,e),t=t.sibling}var jn=null;function Zm(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(va(3,e,e.return),er(3,e),va(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(mt||a===null||Mn(a,a.return)),l&64&&Qn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var c=jn;if(Pt(t,e),en(e),l&512&&(mt||a===null||Mn(a,a.return)),l&4){var d=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Va]||d[wt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(l),c.head.insertBefore(d,c.querySelector("head > title"))),Ot(d,l,a),d[wt]=e,xt(d),l=d;break e;case"link":var y=qp("link","href",c).get(l+(a.href||""));if(y){for(var w=0;w<y.length;w++)if(d=y[w],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(w,1);break t}}d=c.createElement(l),Ot(d,l,a),c.head.appendChild(d);break;case"meta":if(y=qp("meta","content",c).get(l+(a.content||""))){for(w=0;w<y.length;w++)if(d=y[w],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(w,1);break t}}d=c.createElement(l),Ot(d,l,a),c.head.appendChild(d);break;default:throw Error(o(468,l))}d[wt]=e,xt(d),l=d}e.stateNode=l}else Lp(c,e.type,e.stateNode);else e.stateNode=Bp(c,l,e.memoizedProps);else d!==l?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,l===null?Lp(c,e.type,e.stateNode):Bp(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&pu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(mt||a===null||Mn(a,a.return)),a!==null&&l&4&&pu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(mt||a===null||Mn(a,a.return)),e.flags&32){c=e.stateNode;try{ws(c,"")}catch(te){Pe(e,e.return,te)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,pu(e,c,a!==null?a.memoizedProps:c)),l&1024&&(yu=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(te){Pe(e,e.return,te)}}break;case 3:if(no=null,c=jn,jn=eo(t.containerInfo),Pt(t,e),jn=c,en(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{yr(t.containerInfo)}catch(te){Pe(e,e.return,te)}yu&&(yu=!1,Wm(e));break;case 4:l=jn,jn=eo(e.stateNode.containerInfo),Pt(t,e),en(e),jn=l;break;case 12:Pt(t,e),en(e);break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Eu=re()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bu(e,l)));break;case 22:c=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,J=Qn,ce=mt;if(Qn=J||c,mt=ce||R,Pt(t,e),mt=ce,Qn=J,en(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||R||Qn||mt||ls(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){R=a=t;try{if(d=R.stateNode,c)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=R.stateNode;var fe=R.memoizedProps.style,F=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;w.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(te){Pe(R,R.return,te)}}}else if(t.tag===6){if(a===null){R=t;try{R.stateNode.nodeValue=c?"":R.memoizedProps}catch(te){Pe(R,R.return,te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,bu(e,a))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bu(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Bm(l)){a=l;break}l=l.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var c=a.stateNode,d=xu(e);Li(e,d,c);break;case 5:var y=a.stateNode;a.flags&32&&(ws(y,""),a.flags&=-33);var w=xu(e);Li(e,w,y);break;case 3:case 4:var R=a.stateNode.containerInfo,J=xu(e);gu(e,J,R);break;default:throw Error(o(161))}}catch(ce){Pe(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ym(e,t.alternate,t),t=t.sibling}function ls(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:va(4,t,t.return),ls(t);break;case 1:Mn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&$m(t,t.return,a),ls(t);break;case 27:ur(t.stateNode);case 26:case 5:Mn(t,t.return),ls(t);break;case 22:t.memoizedState===null&&ls(t);break;case 30:ls(t);break;default:ls(t)}e=e.sibling}}function Na(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:Na(c,d,a),er(4,d);break;case 1:if(Na(c,d,a),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(J){Pe(l,l.return,J)}if(l=d,c=l.updateQueue,c!==null){var w=l.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)Nh(R[c],w)}catch(J){Pe(l,l.return,J)}}a&&y&64&&Hm(d),tr(d,d.return);break;case 27:qm(d);case 26:case 5:Na(c,d,a),a&&l===null&&y&4&&Um(d),tr(d,d.return);break;case 12:Na(c,d,a);break;case 13:Na(c,d,a),a&&y&4&&Xm(c,d);break;case 22:d.memoizedState===null&&Na(c,d,a),tr(d,d.return);break;case 30:break;default:Na(c,d,a)}t=t.sibling}}function vu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ql(a))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ql(e))}function An(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qm(e,t,a,l),t=t.sibling}function Qm(e,t,a,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,a,l),c&2048&&er(9,t);break;case 1:An(e,t,a,l);break;case 3:An(e,t,a,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ql(e)));break;case 12:if(c&2048){An(e,t,a,l),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,w=d.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Pe(t,t.return,R)}}else An(e,t,a,l);break;case 13:An(e,t,a,l);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?An(e,t,a,l):nr(e,t):d._visibility&2?An(e,t,a,l):(d._visibility|=2,Ys(e,t,a,l,(t.subtreeFlags&10256)!==0)),c&2048&&vu(y,t);break;case 24:An(e,t,a,l),c&2048&&ju(t.alternate,t);break;default:An(e,t,a,l)}}function Ys(e,t,a,l,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var d=e,y=t,w=a,R=l,J=y.flags;switch(y.tag){case 0:case 11:case 15:Ys(d,y,w,R,c),er(8,y);break;case 23:break;case 22:var ce=y.stateNode;y.memoizedState!==null?ce._visibility&2?Ys(d,y,w,R,c):nr(d,y):(ce._visibility|=2,Ys(d,y,w,R,c)),c&&J&2048&&vu(y.alternate,y);break;case 24:Ys(d,y,w,R,c),c&&J&2048&&ju(y.alternate,y);break;default:Ys(d,y,w,R,c)}t=t.sibling}}function nr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:nr(a,l),c&2048&&vu(l.alternate,l);break;case 24:nr(a,l),c&2048&&ju(l.alternate,l);break;default:nr(a,l)}t=t.sibling}}var ar=8192;function Vs(e){if(e.subtreeFlags&ar)for(e=e.child;e!==null;)Km(e),e=e.sibling}function Km(e){switch(e.tag){case 26:Vs(e),e.flags&ar&&e.memoizedState!==null&&pb(jn,e.memoizedState,e.memoizedProps);break;case 5:Vs(e);break;case 3:case 4:var t=jn;jn=eo(e.stateNode.containerInfo),Vs(e),jn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ar,ar=16777216,Vs(e),ar=t):Vs(e));break;default:Vs(e)}}function Jm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Et=l,Fm(l,e)}Jm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Im(e),e=e.sibling}function Im(e){switch(e.tag){case 0:case 11:case 15:sr(e),e.flags&2048&&va(9,e,e.return);break;case 3:sr(e);break;case 12:sr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yi(e)):sr(e);break;default:sr(e)}}function Yi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Et=l,Fm(l,e)}Jm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:va(8,t,t.return),Yi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Yi(t));break;default:Yi(t)}e=e.sibling}}function Fm(e,t){for(;Et!==null;){var a=Et;switch(a.tag){case 0:case 11:case 15:va(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ql(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Et=l;else e:for(a=e;Et!==null;){l=Et;var c=l.sibling,d=l.return;if(Vm(l),l===a){Et=null;break e}if(c!==null){c.return=d,Et=c;break e}Et=d}}}var A1={getCacheForType:function(e){var t=Bt(bt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},R1=typeof WeakMap=="function"?WeakMap:Map,Qe=0,et=null,Be=null,Ye=0,Ke=0,tn=null,wa=!1,Gs=!1,Nu=!1,Jn=0,ot=0,Sa=0,rs=0,wu=0,pn=0,Xs=0,lr=null,Qt=null,Su=!1,Eu=0,Vi=1/0,Gi=null,Ea=null,zt=0,ka=null,Zs=null,Ws=0,ku=0,_u=null,Pm=null,rr=0,Cu=null;function nn(){if((Qe&2)!==0&&Ye!==0)return Ye&-Ye;if(k.T!==null){var e=Os;return e!==0?e:Du()}return Jr()}function ep(){pn===0&&(pn=(Ye&536870912)===0||Ze?ys():536870912);var e=mn.current;return e!==null&&(e.flags|=32),pn}function an(e,t,a){(e===et&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(Qs(e,0),_a(e,Ye,pn,!1)),ra(e,a),((Qe&2)===0||e!==et)&&(e===et&&((Qe&2)===0&&(rs|=a),ot===4&&_a(e,Ye,pn,!1)),Rn(e))}function tp(e,t,a){if((Qe&6)!==0)throw Error(o(327));var l=!a&&(t&124)===0&&(t&e.expiredLanes)===0||Jt(e,t),c=l?D1(e,t):Au(e,t,!0),d=l;do{if(c===0){Gs&&!l&&_a(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!z1(a)){c=Au(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;c=lr;var R=w.current.memoizedState.isDehydrated;if(R&&(Qs(w,y).flags|=256),y=Au(w,y,!1),y!==2){if(Nu&&!R){w.errorRecoveryDisabledLanes|=d,rs|=d,c=4;break e}d=Qt,Qt=c,d!==null&&(Qt===null?Qt=d:Qt.push.apply(Qt,d))}c=y}if(d=!1,c!==2)continue}}if(c===1){Qs(e,0),_a(e,t,0,!0);break}e:{switch(l=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:_a(l,t,pn,!wa);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Eu+300-re(),10<c)){if(_a(l,t,pn,!wa),Vt(l,0,!0)!==0)break e;l.timeoutHandle=Mp(np.bind(null,l,a,Qt,Gi,Su,t,pn,rs,Xs,wa,d,2,-0,0),c);break e}np(l,a,Qt,Gi,Su,t,pn,rs,Xs,wa,d,0,-0,0)}}break}while(!0);Rn(e)}function np(e,t,a,l,c,d,y,w,R,J,ce,fe,F,te){if(e.timeoutHandle=-1,fe=t.subtreeFlags,(fe&8192||(fe&16785408)===16785408)&&(hr={stylesheets:null,count:0,unsuspend:mb},Km(t),fe=xb(),fe!==null)){e.cancelPendingCommit=fe(cp.bind(null,e,t,d,a,l,c,y,w,R,ce,1,F,te)),_a(e,d,y,!J);return}cp(e,t,d,a,l,c,y,w,R)}function z1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var c=a[l],d=c.getSnapshot;c=c.value;try{if(!It(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 _a(e,t,a,l){t&=~wu,t&=~rs,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var d=31-at(c),y=1<<d;l[d]=-1,c&=~y}a!==0&&Qr(e,a,t)}function Xi(){return(Qe&6)===0?(ir(0),!1):!0}function Tu(){if(Be!==null){if(Ke===0)var e=Be.return;else e=Be,Yn=es=null,Zc(e),qs=null,Il=0,e=Be;for(;e!==null;)Dm(e.alternate,e),e=e.return;Be=null}}function Qs(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,I1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Tu(),et=e,Be=a=Bn(e.current,null),Ye=t,Ke=0,tn=null,wa=!1,Gs=Jt(e,t),Nu=!1,Xs=pn=wu=rs=Sa=ot=0,Qt=lr=null,Su=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-at(l),d=1<<c;t|=e[c],l&=~d}return Jn=t,hi(),a}function ap(e,t){He=null,k.H=Ri,t===Yl||t===Ni?(t=vh(),Ke=3):t===gh?(t=vh(),Ke=4):Ke=t===jm?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tn=t,Be===null&&(ot=1,$i(e,un(t,e.current)))}function sp(){var e=k.H;return k.H=Ri,e===null?Ri:e}function lp(){var e=k.A;return k.A=A1,e}function Mu(){ot=4,wa||(Ye&4194048)!==Ye&&mn.current!==null||(Gs=!0),(Sa&134217727)===0&&(rs&134217727)===0||et===null||_a(et,Ye,pn,!1)}function Au(e,t,a){var l=Qe;Qe|=2;var c=sp(),d=lp();(et!==e||Ye!==t)&&(Gi=null,Qs(e,t)),t=!1;var y=ot;e:do try{if(Ke!==0&&Be!==null){var w=Be,R=tn;switch(Ke){case 8:Tu(),y=6;break e;case 3:case 2:case 9:case 6:mn.current===null&&(t=!0);var J=Ke;if(Ke=0,tn=null,Ks(e,w,R,J),a&&Gs){y=0;break e}break;default:J=Ke,Ke=0,tn=null,Ks(e,w,R,J)}}O1(),y=ot;break}catch(ce){ap(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Yn=es=null,Qe=l,k.H=c,k.A=d,Be===null&&(et=null,Ye=0,hi()),y}function O1(){for(;Be!==null;)rp(Be)}function D1(e,t){var a=Qe;Qe|=2;var l=sp(),c=lp();et!==e||Ye!==t?(Gi=null,Vi=re()+500,Qs(e,t)):Gs=Jt(e,t);e:do try{if(Ke!==0&&Be!==null){t=Be;var d=tn;t:switch(Ke){case 1:Ke=0,tn=null,Ks(e,t,d,1);break;case 2:case 9:if(yh(d)){Ke=0,tn=null,ip(t);break}t=function(){Ke!==2&&Ke!==9||et!==e||(Ke=7),Rn(e)},d.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:yh(d)?(Ke=0,tn=null,ip(t)):(Ke=0,tn=null,Ks(e,t,d,7));break;case 5:var y=null;switch(Be.tag){case 26:y=Be.memoizedState;case 5:case 27:var w=Be;if(!y||Yp(y)){Ke=0,tn=null;var R=w.sibling;if(R!==null)Be=R;else{var J=w.return;J!==null?(Be=J,Zi(J)):Be=null}break t}}Ke=0,tn=null,Ks(e,t,d,5);break;case 6:Ke=0,tn=null,Ks(e,t,d,6);break;case 8:Tu(),ot=6;break e;default:throw Error(o(462))}}H1();break}catch(ce){ap(e,ce)}while(!0);return Yn=es=null,k.H=l,k.A=c,Qe=a,Be!==null?0:(et=null,Ye=0,hi(),ot)}function H1(){for(;Be!==null&&!Y();)rp(Be)}function rp(e){var t=zm(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?Zi(e):Be=t}function ip(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=_m(a,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=_m(a,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Zc(t);default:Dm(a,t),t=Be=oh(t,Jn),t=zm(a,t,Jn)}e.memoizedProps=e.pendingProps,t===null?Zi(e):Be=t}function Ks(e,t,a,l){Yn=es=null,Zc(t),qs=null,Il=0;var c=t.return;try{if(E1(e,c,t,a,Ye)){ot=1,$i(e,un(a,e.current)),Be=null;return}}catch(d){if(c!==null)throw Be=c,d;ot=1,$i(e,un(a,e.current)),Be=null;return}t.flags&32768?(Ze||l===1?e=!0:Gs||(Ye&536870912)!==0?e=!1:(wa=e=!0,(l===2||l===9||l===3||l===6)&&(l=mn.current,l!==null&&l.tag===13&&(l.flags|=16384))),op(t,e)):Zi(t)}function Zi(e){var t=e;do{if((t.flags&32768)!==0){op(t,wa);return}e=t.return;var a=_1(t.alternate,t,Jn);if(a!==null){Be=a;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);ot===0&&(ot=5)}function op(e,t){do{var a=C1(e.alternate,e);if(a!==null){a.flags&=32767,Be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=a}while(e!==null);ot=6,Be=null}function cp(e,t,a,l,c,d,y,w,R){e.cancelPendingCommit=null;do Wi();while(zt!==0);if((Qe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=jc,Dn(e,a,d,y,w,R),e===et&&(Be=et=null,Ye=0),Zs=t,ka=e,Ws=a,ku=d,_u=c,Pm=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,q1(ke,function(){return mp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null,c=H.p,H.p=2,y=Qe,Qe|=4;try{T1(e,t,a)}finally{Qe=y,H.p=c,k.T=l}}zt=1,up(),dp(),fp()}}function up(){if(zt===1){zt=0;var e=ka,t=Zs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var c=Qe;Qe|=4;try{Zm(t,e);var d=Vu,y=Ff(e.containerInfo),w=d.focusedElem,R=d.selectionRange;if(y!==w&&w&&w.ownerDocument&&If(w.ownerDocument.documentElement,w)){if(R!==null&&xc(w)){var J=R.start,ce=R.end;if(ce===void 0&&(ce=J),"selectionStart"in w)w.selectionStart=J,w.selectionEnd=Math.min(ce,w.value.length);else{var fe=w.ownerDocument||document,F=fe&&fe.defaultView||window;if(F.getSelection){var te=F.getSelection(),Me=w.textContent.length,_e=Math.min(R.start,Me),Fe=R.end===void 0?_e:Math.min(R.end,Me);!te.extend&&_e>Fe&&(y=Fe,Fe=_e,_e=y);var G=Jf(w,_e),B=Jf(w,Fe);if(G&&B&&(te.rangeCount!==1||te.anchorNode!==G.node||te.anchorOffset!==G.offset||te.focusNode!==B.node||te.focusOffset!==B.offset)){var Q=fe.createRange();Q.setStart(G.node,G.offset),te.removeAllRanges(),_e>Fe?(te.addRange(Q),te.extend(B.node,B.offset)):(Q.setEnd(B.node,B.offset),te.addRange(Q))}}}}for(fe=[],te=w;te=te.parentNode;)te.nodeType===1&&fe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<fe.length;w++){var de=fe[w];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}lo=!!Yu,Vu=Yu=null}finally{Qe=c,H.p=l,k.T=a}}e.current=t,zt=2}}function dp(){if(zt===2){zt=0;var e=ka,t=Zs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var c=Qe;Qe|=4;try{Ym(e,t.alternate,t)}finally{Qe=c,H.p=l,k.T=a}}zt=3}}function fp(){if(zt===4||zt===3){zt=0,ue();var e=ka,t=Zs,a=Ws,l=Pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?zt=5:(zt=0,Zs=ka=null,hp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Ea=null),wl(a),t=t.stateNode,nt&&typeof nt.onCommitFiberRoot=="function")try{nt.onCommitFiberRoot(ft,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=k.T,c=H.p,H.p=2,k.T=null;try{for(var d=e.onRecoverableError,y=0;y<l.length;y++){var w=l[y];d(w.value,{componentStack:w.stack})}}finally{k.T=t,H.p=c}}(Ws&3)!==0&&Wi(),Rn(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===Cu?rr++:(rr=0,Cu=e):rr=0,ir(0)}}function hp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ql(t)))}function Wi(e){return up(),dp(),fp(),mp()}function mp(){if(zt!==5)return!1;var e=ka,t=ku;ku=0;var a=wl(Ws),l=k.T,c=H.p;try{H.p=32>a?32:a,k.T=null,a=_u,_u=null;var d=ka,y=Ws;if(zt=0,Zs=ka=null,Ws=0,(Qe&6)!==0)throw Error(o(331));var w=Qe;if(Qe|=4,Im(d.current),Qm(d,d.current,y,a),Qe=w,ir(0,!1),nt&&typeof nt.onPostCommitFiberRoot=="function")try{nt.onPostCommitFiberRoot(ft,d)}catch{}return!0}finally{H.p=c,k.T=l,hp(e,t)}}function pp(e,t,a){t=un(a,t),t=ru(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(ra(e,2),Rn(e))}function Pe(e,t,a){if(e.tag===3)pp(e,e,a);else for(;t!==null;){if(t.tag===3){pp(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ea===null||!Ea.has(l))){e=un(a,e),a=bm(2),l=xa(t,a,2),l!==null&&(vm(a,l,t,e),ra(l,2),Rn(l));break}}t=t.return}}function Ru(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new R1;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(Nu=!0,c.add(a),e=$1.bind(null,e,t,a),t.then(e,e))}function $1(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,et===e&&(Ye&a)===a&&(ot===4||ot===3&&(Ye&62914560)===Ye&&300>re()-Eu?(Qe&2)===0&&Qs(e,0):wu|=a,Xs===Ye&&(Xs=0)),Rn(e)}function xp(e,t){t===0&&(t=la()),e=Ms(e,t),e!==null&&(ra(e,t),Rn(e))}function U1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),xp(e,a)}function B1(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),xp(e,a)}function q1(e,t){return be(e,t)}var Qi=null,Js=null,zu=!1,Ki=!1,Ou=!1,is=0;function Rn(e){e!==Js&&e.next===null&&(Js===null?Qi=Js=e:Js=Js.next=e),Ki=!0,zu||(zu=!0,Y1())}function ir(e,t){if(!Ou&&Ki){Ou=!0;do for(var a=!1,l=Qi;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var y=l.suspendedLanes,w=l.pingedLanes;d=(1<<31-at(42|e)+1)-1,d&=c&~(y&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,vp(l,d))}else d=Ye,d=Vt(l,l===et?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||Jt(l,d)||(a=!0,vp(l,d));l=l.next}while(a);Ou=!1}}function L1(){gp()}function gp(){Ki=zu=!1;var e=0;is!==0&&(J1()&&(e=is),is=0);for(var t=re(),a=null,l=Qi;l!==null;){var c=l.next,d=yp(l,t);d===0?(l.next=null,a===null?Qi=c:a.next=c,c===null&&(Js=a)):(a=l,(e!==0||(d&3)!==0)&&(Ki=!0)),l=c}ir(e)}function yp(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-at(d),w=1<<y,R=c[y];R===-1?((w&a)===0||(w&l)!==0)&&(c[y]=jl(w,t)):R<=t&&(e.expiredLanes|=w),d&=~w}if(t=et,a=Ye,a=Vt(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&q(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Jt(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&q(l),wl(a)){case 2:case 8:a=ge;break;case 32:a=ke;break;case 268435456:a=ze;break;default:a=ke}return l=bp.bind(null,e),a=be(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&q(l),e.callbackPriority=2,e.callbackNode=null,2}function bp(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Wi()&&e.callbackNode!==a)return null;var l=Ye;return l=Vt(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tp(e,l,t),yp(e,re()),e.callbackNode!=null&&e.callbackNode===a?bp.bind(null,e):null)}function vp(e,t){if(Wi())return null;tp(e,t,!0)}function Y1(){F1(function(){(Qe&6)!==0?be(Ee,L1):gp()})}function Du(){return is===0&&(is=ys()),is}function jp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ri(""+e)}function Np(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function V1(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var d=jp((c[Ut]||null).action),y=l.submitter;y&&(t=(t=y[Ut]||null)?jp(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var w=new ui("action","action",null,l,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(is!==0){var R=y?Np(c,y):new FormData(c);tu(a,{pending:!0,data:R,method:c.method,action:d},null,R)}}else typeof d=="function"&&(w.preventDefault(),R=y?Np(c,y):new FormData(c),tu(a,{pending:!0,data:R,method:c.method,action:d},d,R))},currentTarget:c}]})}}for(var Hu=0;Hu<vc.length;Hu++){var $u=vc[Hu],G1=$u.toLowerCase(),X1=$u[0].toUpperCase()+$u.slice(1);vn(G1,"on"+X1)}vn(th,"onAnimationEnd"),vn(nh,"onAnimationIteration"),vn(ah,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(o1,"onTransitionRun"),vn(c1,"onTransitionStart"),vn(u1,"onTransitionCancel"),vn(sh,"onTransitionEnd"),ua("onMouseEnter",["mouseout","mouseover"]),ua("onMouseLeave",["mouseout","mouseover"]),ua("onPointerEnter",["pointerout","pointerover"]),ua("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var or="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(" "),Z1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(or));function wp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var y=l.length-1;0<=y;y--){var w=l[y],R=w.instance,J=w.currentTarget;if(w=w.listener,R!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=J;try{d(c)}catch(ce){Hi(ce)}c.currentTarget=null,d=R}else for(y=0;y<l.length;y++){if(w=l[y],R=w.instance,J=w.currentTarget,w=w.listener,R!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=J;try{d(c)}catch(ce){Hi(ce)}c.currentTarget=null,d=R}}}}function qe(e,t){var a=t[Sl];a===void 0&&(a=t[Sl]=new Set);var l=e+"__bubble";a.has(l)||(Sp(t,e,2,!1),a.add(l))}function Uu(e,t,a){var l=0;t&&(l|=4),Sp(a,e,l,t)}var Ji="_reactListening"+Math.random().toString(36).slice(2);function Bu(e){if(!e[Ji]){e[Ji]=!0,Fr.forEach(function(a){a!=="selectionchange"&&(Z1.has(a)||Uu(a,!1,e),Uu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ji]||(t[Ji]=!0,Uu("selectionchange",!1,t))}}function Sp(e,t,a,l){switch(Qp(t)){case 2:var c=bb;break;case 8:c=vb;break;default:c=Pu}a=c.bind(null,t,a,e),c=void 0,!ic||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function qu(e,t,a,l,c){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var w=l.stateNode.containerInfo;if(w===c)break;if(y===4)for(y=l.return;y!==null;){var R=y.tag;if((R===3||R===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;w!==null;){if(y=Hn(w),y===null)return;if(R=y.tag,R===5||R===6||R===26||R===27){l=d=y;continue e}w=w.parentNode}}l=l.return}Af(function(){var J=d,ce=lc(a),fe=[];e:{var F=lh.get(e);if(F!==void 0){var te=ui,Me=e;switch(e){case"keypress":if(oi(a)===0)break e;case"keydown":case"keyup":te=qy;break;case"focusin":Me="focus",te=dc;break;case"focusout":Me="blur",te=dc;break;case"beforeblur":case"afterblur":te=dc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Of;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Vy;break;case th:case nh:case ah:te=Ay;break;case sh:te=Xy;break;case"scroll":case"scrollend":te=ky;break;case"wheel":te=Wy;break;case"copy":case"cut":case"paste":te=zy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Hf;break;case"toggle":case"beforetoggle":te=Ky}var _e=(t&4)!==0,Fe=!_e&&(e==="scroll"||e==="scrollend"),G=_e?F!==null?F+"Capture":null:F;_e=[];for(var B=J,Q;B!==null;){var de=B;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||G===null||(de=_l(B,G),de!=null&&_e.push(cr(B,de,Q))),Fe)break;B=B.return}0<_e.length&&(F=new te(F,Me,null,a,ce),fe.push({event:F,listeners:_e}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",F&&a!==sc&&(Me=a.relatedTarget||a.fromElement)&&(Hn(Me)||Me[ia]))break e;if((te||F)&&(F=ce.window===ce?ce:(F=ce.ownerDocument)?F.defaultView||F.parentWindow:window,te?(Me=a.relatedTarget||a.toElement,te=J,Me=Me?Hn(Me):null,Me!==null&&(Fe=f(Me),_e=Me.tag,Me!==Fe||_e!==5&&_e!==27&&_e!==6)&&(Me=null)):(te=null,Me=J),te!==Me)){if(_e=Of,de="onMouseLeave",G="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(_e=Hf,de="onPointerLeave",G="onPointerEnter",B="pointer"),Fe=te==null?F:Ga(te),Q=Me==null?F:Ga(Me),F=new _e(de,B+"leave",te,a,ce),F.target=Fe,F.relatedTarget=Q,de=null,Hn(ce)===J&&(_e=new _e(G,B+"enter",Me,a,ce),_e.target=Q,_e.relatedTarget=Fe,de=_e),Fe=de,te&&Me)t:{for(_e=te,G=Me,B=0,Q=_e;Q;Q=Is(Q))B++;for(Q=0,de=G;de;de=Is(de))Q++;for(;0<B-Q;)_e=Is(_e),B--;for(;0<Q-B;)G=Is(G),Q--;for(;B--;){if(_e===G||G!==null&&_e===G.alternate)break t;_e=Is(_e),G=Is(G)}_e=null}else _e=null;te!==null&&Ep(fe,F,te,_e,!1),Me!==null&&Fe!==null&&Ep(fe,Fe,Me,_e,!0)}}e:{if(F=J?Ga(J):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var ye=Gf;else if(Yf(F))if(Xf)ye=l1;else{ye=a1;var $e=n1}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?J&&ac(J.elementType)&&(ye=Gf):ye=s1;if(ye&&(ye=ye(e,J))){Vf(fe,ye,a,ce);break e}$e&&$e(e,F,J),e==="focusout"&&J&&F.type==="number"&&J.memoizedProps.value!=null&&nc(F,"number",F.value)}switch($e=J?Ga(J):window,e){case"focusin":(Yf($e)||$e.contentEditable==="true")&&(_s=$e,gc=J,Dl=null);break;case"focusout":Dl=gc=_s=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,Pf(fe,a,ce);break;case"selectionchange":if(i1)break;case"keydown":case"keyup":Pf(fe,a,ce)}var we;if(hc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else ks?qf(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&($f&&a.locale!=="ko"&&(ks||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ks&&(we=Rf()):(fa=ce,oc="value"in fa?fa.value:fa.textContent,ks=!0)),$e=Ii(J,Ce),0<$e.length&&(Ce=new Df(Ce,e,null,a,ce),fe.push({event:Ce,listeners:$e}),we?Ce.data=we:(we=Lf(a),we!==null&&(Ce.data=we)))),(we=Iy?Fy(e,a):Py(e,a))&&(Ce=Ii(J,"onBeforeInput"),0<Ce.length&&($e=new Df("onBeforeInput","beforeinput",null,a,ce),fe.push({event:$e,listeners:Ce}),$e.data=we)),V1(fe,e,J,a,ce)}wp(fe,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ii(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=_l(e,a),c!=null&&l.unshift(cr(e,c,d)),c=_l(e,t),c!=null&&l.push(cr(e,c,d))),e.tag===3)return l;e=e.return}return[]}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ep(e,t,a,l,c){for(var d=t._reactName,y=[];a!==null&&a!==l;){var w=a,R=w.alternate,J=w.stateNode;if(w=w.tag,R!==null&&R===l)break;w!==5&&w!==26&&w!==27||J===null||(R=J,c?(J=_l(a,d),J!=null&&y.unshift(cr(a,J,R))):c||(J=_l(a,d),J!=null&&y.push(cr(a,J,R)))),a=a.return}y.length!==0&&e.push({event:t,listeners:y})}var W1=/\r\n?/g,Q1=/\u0000|\uFFFD/g;function kp(e){return(typeof e=="string"?e:""+e).replace(W1,`
|
|
49
|
-
`).replace(Q1,"")}function _p(e,t){return t=kp(t),kp(e)===t}function Fi(){}function Ie(e,t,a,l,c,d){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ws(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ws(e,""+l);break;case"className":vs(e,"class",l);break;case"tabIndex":vs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(e,a,l);break;case"style":Tf(e,l,d);break;case"data":if(t!=="object"){vs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=ri(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Ie(e,t,"name",c.name,c,null),Ie(e,t,"formEncType",c.formEncType,c,null),Ie(e,t,"formMethod",c.formMethod,c,null),Ie(e,t,"formTarget",c.formTarget,c,null)):(Ie(e,t,"encType",c.encType,c,null),Ie(e,t,"method",c.method,c,null),Ie(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=ri(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Fi);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=ri(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),bs(e,"popover",l);break;case"xlinkActuate":bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":bn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":bn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":bn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":bn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Sy.get(a)||a,bs(e,a,l))}}function Lu(e,t,a,l,c,d){switch(a){case"style":Tf(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof l=="string"?ws(e,l):(typeof l=="number"||typeof l=="bigint")&&ws(e,""+l);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Fi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[Ut]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof l=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,c);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):bs(e,a,l)}}}function Ot(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ie(e,t,d,y,a,null)}}c&&Ie(e,t,"srcSet",a.srcSet,a,null),l&&Ie(e,t,"src",a.src,a,null);return;case"input":qe("invalid",e);var w=d=y=c=null,R=null,J=null;for(l in a)if(a.hasOwnProperty(l)){var ce=a[l];if(ce!=null)switch(l){case"name":c=ce;break;case"type":y=ce;break;case"checked":R=ce;break;case"defaultChecked":J=ce;break;case"value":d=ce;break;case"defaultValue":w=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:Ie(e,t,l,ce,a,null)}}Ef(e,d,w,R,J,y,c,!1),si(e);return;case"select":qe("invalid",e),l=y=d=null;for(c in a)if(a.hasOwnProperty(c)&&(w=a[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":y=w;break;case"multiple":l=w;default:Ie(e,t,c,w,a,null)}t=d,a=y,e.multiple=!!l,t!=null?Ns(e,!!l,t,!1):a!=null&&Ns(e,!!l,a,!0);return;case"textarea":qe("invalid",e),d=c=l=null;for(y in a)if(a.hasOwnProperty(y)&&(w=a[y],w!=null))switch(y){case"value":l=w;break;case"defaultValue":c=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:Ie(e,t,y,w,a,null)}_f(e,l,c,d),si(e);return;case"option":for(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ie(e,t,R,l,a,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<or.length;l++)qe(or[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in a)if(a.hasOwnProperty(J)&&(l=a[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ie(e,t,J,l,a,null)}return;default:if(ac(t)){for(ce in a)a.hasOwnProperty(ce)&&(l=a[ce],l!==void 0&&Lu(e,t,ce,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&&Ie(e,t,w,l,a,null))}function K1(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,y=null,w=null,R=null,J=null,ce=null;for(te in a){var fe=a[te];if(a.hasOwnProperty(te)&&fe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":R=fe;default:l.hasOwnProperty(te)||Ie(e,t,te,null,l,fe)}}for(var F in l){var te=l[F];if(fe=a[F],l.hasOwnProperty(F)&&(te!=null||fe!=null))switch(F){case"type":d=te;break;case"name":c=te;break;case"checked":J=te;break;case"defaultChecked":ce=te;break;case"value":y=te;break;case"defaultValue":w=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(o(137,t));break;default:te!==fe&&Ie(e,t,F,te,l,fe)}}tc(e,y,w,R,J,ce,d,c);return;case"select":te=y=w=F=null;for(d in a)if(R=a[d],a.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":te=R;default:l.hasOwnProperty(d)||Ie(e,t,d,null,l,R)}for(c in l)if(d=l[c],R=a[c],l.hasOwnProperty(c)&&(d!=null||R!=null))switch(c){case"value":F=d;break;case"defaultValue":w=d;break;case"multiple":y=d;default:d!==R&&Ie(e,t,c,d,l,R)}t=w,a=y,l=te,F!=null?Ns(e,!!a,F,!1):!!l!=!!a&&(t!=null?Ns(e,!!a,t,!0):Ns(e,!!a,a?[]:"",!1));return;case"textarea":te=F=null;for(w in a)if(c=a[w],a.hasOwnProperty(w)&&c!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ie(e,t,w,null,l,c)}for(y in l)if(c=l[y],d=a[y],l.hasOwnProperty(y)&&(c!=null||d!=null))switch(y){case"value":F=c;break;case"defaultValue":te=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Ie(e,t,y,c,l,d)}kf(e,F,te);return;case"option":for(var Me in a)if(F=a[Me],a.hasOwnProperty(Me)&&F!=null&&!l.hasOwnProperty(Me))switch(Me){case"selected":e.selected=!1;break;default:Ie(e,t,Me,null,l,F)}for(R in l)if(F=l[R],te=a[R],l.hasOwnProperty(R)&&F!==te&&(F!=null||te!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Ie(e,t,R,F,l,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in a)F=a[_e],a.hasOwnProperty(_e)&&F!=null&&!l.hasOwnProperty(_e)&&Ie(e,t,_e,null,l,F);for(J in l)if(F=l[J],te=a[J],l.hasOwnProperty(J)&&F!==te&&(F!=null||te!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:Ie(e,t,J,F,l,te)}return;default:if(ac(t)){for(var Fe in a)F=a[Fe],a.hasOwnProperty(Fe)&&F!==void 0&&!l.hasOwnProperty(Fe)&&Lu(e,t,Fe,void 0,l,F);for(ce in l)F=l[ce],te=a[ce],!l.hasOwnProperty(ce)||F===te||F===void 0&&te===void 0||Lu(e,t,ce,F,l,te);return}}for(var G in a)F=a[G],a.hasOwnProperty(G)&&F!=null&&!l.hasOwnProperty(G)&&Ie(e,t,G,null,l,F);for(fe in l)F=l[fe],te=a[fe],!l.hasOwnProperty(fe)||F===te||F==null&&te==null||Ie(e,t,fe,F,l,te)}var Yu=null,Vu=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function Cp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xu=null;function J1(){var e=window.event;return e&&e.type==="popstate"?e===Xu?!1:(Xu=e,!0):(Xu=null,!1)}var Mp=typeof setTimeout=="function"?setTimeout:void 0,I1=typeof clearTimeout=="function"?clearTimeout:void 0,Ap=typeof Promise=="function"?Promise:void 0,F1=typeof queueMicrotask=="function"?queueMicrotask:typeof Ap<"u"?function(e){return Ap.resolve(null).then(e).catch(P1)}:Mp;function P1(e){setTimeout(function(){throw e})}function Ca(e){return e==="head"}function Rp(e,t){var a=t,l=0,c=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(0<l&&8>l){a=l;var y=e.ownerDocument;if(a&1&&ur(y.documentElement),a&2&&ur(y.body),a&4)for(a=y.head,ur(a),y=a.firstChild;y;){var w=y.nextSibling,R=y.nodeName;y[Va]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=w}}if(c===0){e.removeChild(d),yr(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:l=a.charCodeAt(0)-48;else l=0;a=d}while(a);yr(t)}function Zu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Zu(a),El(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function eb(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function tb(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Nn(e.nextSibling),e===null))return null;return e}function Wu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function nb(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Qu=null;function zp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Op(e,t,a){switch(t=Pi(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function ur(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);El(e)}var xn=new Map,Dp=new Set;function eo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var In=H.d;H.d={f:ab,r:sb,D:lb,C:rb,L:ib,m:ob,X:ub,S:cb,M:db};function ab(){var e=In.f(),t=Xi();return e||t}function sb(e){var t=oa(e);t!==null&&t.tag===5&&t.type==="form"?tm(t):In.r(e)}var Fs=typeof document>"u"?null:document;function Hp(e,t,a){var l=Fs;if(l&&typeof t=="string"&&t){var c=cn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Dp.has(c)||(Dp.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Ot(t,"link",e),xt(t),l.head.appendChild(t)))}}function lb(e){In.D(e),Hp("dns-prefetch",e,null)}function rb(e,t){In.C(e,t),Hp("preconnect",e,t)}function ib(e,t,a){In.L(e,t,a);var l=Fs;if(l&&e&&t){var c='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+cn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+cn(a.imageSizes)+'"]')):c+='[href="'+cn(e)+'"]';var d=c;switch(t){case"style":d=Ps(e);break;case"script":d=el(e)}xn.has(d)||(e=p({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),xn.set(d,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(dr(d))||t==="script"&&l.querySelector(fr(d))||(t=l.createElement("link"),Ot(t,"link",e),xt(t),l.head.appendChild(t)))}}function ob(e,t){In.m(e,t);var a=Fs;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+cn(l)+'"][href="'+cn(e)+'"]',d=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=el(e)}if(!xn.has(d)&&(e=p({rel:"modulepreload",href:e},t),xn.set(d,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fr(d)))return}l=a.createElement("link"),Ot(l,"link",e),xt(l),a.head.appendChild(l)}}}function cb(e,t,a){In.S(e,t,a);var l=Fs;if(l&&e){var c=ca(l).hoistableStyles,d=Ps(e);t=t||"default";var y=c.get(d);if(!y){var w={loading:0,preload:null};if(y=l.querySelector(dr(d)))w.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},a),(a=xn.get(d))&&Ku(e,a);var R=y=l.createElement("link");xt(R),Ot(R,"link",e),R._p=new Promise(function(J,ce){R.onload=J,R.onerror=ce}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,to(y,t,l)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(d,y)}}}function ub(e,t){In.X(e,t);var a=Fs;if(a&&e){var l=ca(a).hoistableScripts,c=el(e),d=l.get(c);d||(d=a.querySelector(fr(c)),d||(e=p({src:e,async:!0},t),(t=xn.get(c))&&Ju(e,t),d=a.createElement("script"),xt(d),Ot(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function db(e,t){In.M(e,t);var a=Fs;if(a&&e){var l=ca(a).hoistableScripts,c=el(e),d=l.get(c);d||(d=a.querySelector(fr(c)),d||(e=p({src:e,async:!0,type:"module"},t),(t=xn.get(c))&&Ju(e,t),d=a.createElement("script"),xt(d),Ot(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function $p(e,t,a,l){var c=(c=me.current)?eo(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ps(a.href),a=ca(c).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ps(a.href);var d=ca(c).hoistableStyles,y=d.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=c.querySelector(dr(e)))&&!d._p&&(y.instance=d,y.state.loading=5),xn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},xn.set(e,a),d||fb(c,e,a,y.state))),t&&l===null)throw Error(o(528,""));return y}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=el(a),a=ca(c).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ps(e){return'href="'+cn(e)+'"'}function dr(e){return'link[rel="stylesheet"]['+e+"]"}function Up(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function fb(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ot(t,"link",a),xt(t),e.head.appendChild(t))}function el(e){return'[src="'+cn(e)+'"]'}function fr(e){return"script[async]"+e}function Bp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+cn(a.href)+'"]');if(l)return t.instance=l,xt(l),l;var c=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),xt(l),Ot(l,"style",c),to(l,a.precedence,e),t.instance=l;case"stylesheet":c=Ps(a.href);var d=e.querySelector(dr(c));if(d)return t.state.loading|=4,t.instance=d,xt(d),d;l=Up(a),(c=xn.get(c))&&Ku(l,c),d=(e.ownerDocument||e).createElement("link"),xt(d);var y=d;return y._p=new Promise(function(w,R){y.onload=w,y.onerror=R}),Ot(d,"link",l),t.state.loading|=4,to(d,a.precedence,e),t.instance=d;case"script":return d=el(a.src),(c=e.querySelector(fr(d)))?(t.instance=c,xt(c),c):(l=a,(c=xn.get(d))&&(l=p({},a),Ju(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),xt(c),Ot(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,to(l,a.precedence,e));return t.instance}function to(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,d=c,y=0;y<l.length;y++){var w=l[y];if(w.dataset.precedence===t)d=w;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var no=null;function qp(e,t,a){if(no===null){var l=new Map,c=no=new Map;c.set(a,l)}else c=no,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Va]||d[wt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var w=l.get(y);w?w.push(d):l.set(y,[d])}}return l}function Lp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function hb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Yp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var hr=null;function mb(){}function pb(e,t,a){if(hr===null)throw Error(o(475));var l=hr;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Ps(a.href),d=e.querySelector(dr(c));if(d){e=d._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=ao.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=d,xt(d);return}d=e.ownerDocument||e,a=Up(a),(c=xn.get(c))&&Ku(a,c),d=d.createElement("link"),xt(d);var y=d;y._p=new Promise(function(w,R){y.onload=w,y.onerror=R}),Ot(d,"link",a),t.instance=d}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=ao.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function xb(){if(hr===null)throw Error(o(475));var e=hr;return e.stylesheets&&e.count===0&&Iu(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Iu(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function ao(){if(this.count--,this.count===0){if(this.stylesheets)Iu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var so=null;function Iu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,so=new Map,t.forEach(gb,e),so=null,ao.call(e))}function gb(e,t){if(!(t.state.loading&4)){var a=so.get(e);if(a)var l=a.get(null);else{a=new Map,so.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var y=c[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),l=y)}l&&a.set(null,l)}c=t.instance,y=c.getAttribute("data-precedence"),d=a.get(y)||l,d===l&&a.set(null,c),a.set(y,c),this.count++,l=ao.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var mr={$$typeof:L,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function yb(e,t,a,l,c,d,y,w){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.hiddenUpdates=Ya(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Vp(e,t,a,l,c,d,y,w,R,J,ce,fe){return e=new yb(e,t,a,y,w,R,J,fe),t=1,d===!0&&(t|=24),d=Ft(3,null,null,t),e.current=d,d.stateNode=e,t=Rc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:l,isDehydrated:a,cache:t},Hc(d),e}function Gp(e){return e?(e=As,e):As}function Xp(e,t,a,l,c,d){c=Gp(c),l.context===null?l.context=c:l.pendingContext=c,l=pa(t),l.payload={element:a},d=d===void 0?null:d,d!==null&&(l.callback=d),a=xa(e,l,t),a!==null&&(an(a,e,t),Gl(a,e,t))}function Zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fu(e,t){Zp(e,t),(e=e.alternate)&&Zp(e,t)}function Wp(e){if(e.tag===13){var t=Ms(e,67108864);t!==null&&an(t,e,67108864),Fu(e,67108864)}}var lo=!0;function bb(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=2,Pu(e,t,a,l)}finally{H.p=d,k.T=c}}function vb(e,t,a,l){var c=k.T;k.T=null;var d=H.p;try{H.p=8,Pu(e,t,a,l)}finally{H.p=d,k.T=c}}function Pu(e,t,a,l){if(lo){var c=ed(l);if(c===null)qu(e,t,l,ro,a),Kp(e,l);else if(Nb(c,e,t,a,l))l.stopPropagation();else if(Kp(e,l),t&4&&-1<jb.indexOf(e)){for(;c!==null;){var d=oa(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=At(d.pendingLanes);if(y!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var R=1<<31-at(y);w.entanglements[1]|=R,y&=~R}Rn(d),(Qe&6)===0&&(Vi=re()+500,ir(0))}}break;case 13:w=Ms(d,2),w!==null&&an(w,d,2),Xi(),Fu(d,2)}if(d=ed(l),d===null&&qu(e,t,l,ro,a),d===c)break;c=d}c!==null&&l.stopPropagation()}else qu(e,t,l,null,a)}}function ed(e){return e=lc(e),td(e)}var ro=null;function td(e){if(ro=null,e=Hn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ro=e,null}function Qp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(P()){case Ee:return 2;case ge:return 8;case ke:case Oe:return 32;case ze:return 268435456;default:return 32}default:return 32}}var nd=!1,Ta=null,Ma=null,Aa=null,pr=new Map,xr=new Map,Ra=[],jb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Kp(e,t){switch(e){case"focusin":case"focusout":Ta=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xr.delete(t.pointerId)}}function gr(e,t,a,l,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:d,targetContainers:[c]},t!==null&&(t=oa(t),t!==null&&Wp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Nb(e,t,a,l,c){switch(t){case"focusin":return Ta=gr(Ta,e,t,a,l,c),!0;case"dragenter":return Ma=gr(Ma,e,t,a,l,c),!0;case"mouseover":return Aa=gr(Aa,e,t,a,l,c),!0;case"pointerover":var d=c.pointerId;return pr.set(d,gr(pr.get(d)||null,e,t,a,l,c)),!0;case"gotpointercapture":return d=c.pointerId,xr.set(d,gr(xr.get(d)||null,e,t,a,l,c)),!0}return!1}function Jp(e){var t=Hn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Io(e.priority,function(){if(a.tag===13){var l=nn();l=Nl(l);var c=Ms(a,l);c!==null&&an(c,a,l),Fu(a,l)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function io(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ed(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);sc=l,a.target.dispatchEvent(l),sc=null}else return t=oa(a),t!==null&&Wp(t),e.blockedOn=a,!1;t.shift()}return!0}function Ip(e,t,a){io(e)&&a.delete(t)}function wb(){nd=!1,Ta!==null&&io(Ta)&&(Ta=null),Ma!==null&&io(Ma)&&(Ma=null),Aa!==null&&io(Aa)&&(Aa=null),pr.forEach(Ip),xr.forEach(Ip)}function oo(e,t){e.blockedOn===t&&(e.blockedOn=null,nd||(nd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,wb)))}var co=null;function Fp(e){co!==e&&(co=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){co===e&&(co=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(td(l||a)===null)continue;break}var d=oa(a);d!==null&&(e.splice(t,3),t-=3,tu(d,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function yr(e){function t(R){return oo(R,e)}Ta!==null&&oo(Ta,e),Ma!==null&&oo(Ma,e),Aa!==null&&oo(Aa,e),pr.forEach(t),xr.forEach(t);for(var a=0;a<Ra.length;a++){var l=Ra[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ra.length&&(a=Ra[0],a.blockedOn===null);)Jp(a),a.blockedOn===null&&Ra.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],d=a[l+1],y=c[Ut]||null;if(typeof d=="function")y||Fp(a);else if(y){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,y=d[Ut]||null)w=y.formAction;else if(td(c)!==null)continue}else w=y.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),Fp(a)}}}function ad(e){this._internalRoot=e}uo.prototype.render=ad.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,l=nn();Xp(a,l,e,t,null,null)},uo.prototype.unmount=ad.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xp(e.current,2,null,e,null,null),Xi(),t[ia]=null}};function uo(e){this._internalRoot=e}uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ra.length&&t!==0&&t<Ra[a].priority;a++);Ra.splice(a,0,e),a===0&&Jp(e)}};var Pp=r.version;if(Pp!=="19.1.1")throw Error(o(527,Pp,"19.1.1"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var Sb={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fo.isDisabled&&fo.supportsFiber)try{ft=fo.inject(Sb),nt=fo}catch{}}return vr.createRoot=function(e,t){if(!u(e))throw Error(o(299));var a=!1,l="",c=pm,d=xm,y=gm,w=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(w=t.unstable_transitionCallbacks)),t=Vp(e,1,!1,null,null,a,l,c,d,y,w,null),e[ia]=t.current,Bu(e),new ad(t)},vr.hydrateRoot=function(e,t,a){if(!u(e))throw Error(o(299));var l=!1,c="",d=pm,y=xm,w=gm,R=null,J=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(R=a.unstable_transitionCallbacks),a.formState!==void 0&&(J=a.formState)),t=Vp(e,1,!0,t,a??null,l,c,d,y,w,R,J),t.context=Gp(null),a=t.current,l=nn(),l=Nl(l),c=pa(l),c.callback=null,xa(a,c,l),a=l,t.current.lanes=a,ra(t,a),Rn(t),e[ia]=t.current,Bu(e),new uo(t)},vr.version="19.1.1",vr}var cx;function zb(){if(cx)return rd.exports;cx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),rd.exports=Rb(),rd.exports}var Ob=zb();/**
|
|
50
|
-
* @license lucide-react v1.33.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const _0=(...n)=>n.filter((r,i,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===i).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v1.33.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const Db=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
-
* @license lucide-react v1.33.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Hb=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,i,o)=>o?o.toUpperCase():i.toLowerCase());/**
|
|
65
|
-
* @license lucide-react v1.33.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const ux=n=>{const r=Hb(n);return r.charAt(0).toUpperCase()+r.slice(1)};/**
|
|
70
|
-
* @license lucide-react v1.33.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/var ud={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"};/**
|
|
75
|
-
* @license lucide-react v1.33.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const $b=n=>{for(const r in n)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Ub=j.createContext({}),Bb=()=>j.useContext(Ub),qb=j.forwardRef(({color:n,size:r,strokeWidth:i,absoluteStrokeWidth:o,className:u="",children:f,iconNode:h,...g},x)=>{const{size:m=24,strokeWidth:p=2,absoluteStrokeWidth:b=!1,color:v="currentColor",className:N=""}=Bb()??{},T=o??b?Number(i??p)*24/Number(r??m):i??p;return j.createElement("svg",{ref:x,...ud,width:r??m??ud.width,height:r??m??ud.height,stroke:n??v,strokeWidth:T,className:_0("lucide",N,u),...!f&&!$b(g)&&{"aria-hidden":"true"},...g},[...h.map(([_,M])=>j.createElement(_,M)),...Array.isArray(f)?f:[f]])});/**
|
|
80
|
-
* @license lucide-react v1.33.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const Ne=(n,r)=>{const i=j.forwardRef(({className:o,...u},f)=>j.createElement(qb,{ref:f,iconNode:r,className:_0(`lucide-${Db(ux(n))}`,`lucide-${n}`,o),...u}));return i.displayName=ux(n),i};/**
|
|
85
|
-
* @license lucide-react v1.33.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const Lb=[["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"}]],Vr=Ne("activity",Lb);/**
|
|
90
|
-
* @license lucide-react v1.33.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const Yb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dx=Ne("arrow-left",Yb);/**
|
|
95
|
-
* @license lucide-react v1.33.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const Vb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],dl=Ne("arrow-right",Vb);/**
|
|
100
|
-
* @license lucide-react v1.33.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const Gb=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],C0=Ne("bell",Gb);/**
|
|
105
|
-
* @license lucide-react v1.33.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Xb=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],_o=Ne("brain",Xb);/**
|
|
110
|
-
* @license lucide-react v1.33.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const Zb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ut=Ne("check",Zb);/**
|
|
115
|
-
* @license lucide-react v1.33.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const Wb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qa=Ne("chevron-down",Wb);/**
|
|
120
|
-
* @license lucide-react v1.33.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Qb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bl=Ne("chevron-right",Qb);/**
|
|
125
|
-
* @license lucide-react v1.33.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const Kb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ht=Ne("circle-alert",Kb);/**
|
|
130
|
-
* @license lucide-react v1.33.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const Jb=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ib=Ne("circle-play",Jb);/**
|
|
135
|
-
* @license lucide-react v1.33.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const Fb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Pb=Ne("circle-plus",Fb);/**
|
|
140
|
-
* @license lucide-react v1.33.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const ev=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],tv=Ne("circle-question-mark",ev);/**
|
|
145
|
-
* @license lucide-react v1.33.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const nv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Gr=Ne("clock",nv);/**
|
|
150
|
-
* @license lucide-react v1.33.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const av=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Vo=Ne("code-xml",av);/**
|
|
155
|
-
* @license lucide-react v1.33.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const sv=[["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"}]],T0=Ne("copy",sv);/**
|
|
160
|
-
* @license lucide-react v1.33.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const lv=[["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"}]],Rr=Ne("database",lv);/**
|
|
165
|
-
* @license lucide-react v1.33.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const rv=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]],ea=Ne("diamond",rv);/**
|
|
170
|
-
* @license lucide-react v1.33.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const iv=[["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"}]],fx=Ne("external-link",iv);/**
|
|
175
|
-
* @license lucide-react v1.33.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const ov=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],cv=Ne("file-code",ov);/**
|
|
180
|
-
* @license lucide-react v1.33.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const uv=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Kd=Ne("file-code-corner",uv);/**
|
|
185
|
-
* @license lucide-react v1.33.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const dv=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],fv=Ne("file-pen",dv);/**
|
|
190
|
-
* @license lucide-react v1.33.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const hv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jd=Ne("file-text",hv);/**
|
|
195
|
-
* @license lucide-react v1.33.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const mv=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Id=Ne("git-branch",mv);/**
|
|
200
|
-
* @license lucide-react v1.33.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const pv=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],M0=Ne("git-commit-horizontal",pv);/**
|
|
205
|
-
* @license lucide-react v1.33.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const xv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vl=Ne("globe",xv);/**
|
|
210
|
-
* @license lucide-react v1.33.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const gv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],yv=Ne("info",gv);/**
|
|
215
|
-
* @license lucide-react v1.33.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const bv=[["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"}]],A0=Ne("key",bv);/**
|
|
220
|
-
* @license lucide-react v1.33.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const vv=[["path",{d:"M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z",key:"15q6uc"}],["path",{d:"m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845",key:"byia6g"}]],R0=Ne("layers-2",vv);/**
|
|
225
|
-
* @license lucide-react v1.33.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const jv=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],z0=Ne("layers",jv);/**
|
|
230
|
-
* @license lucide-react v1.33.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const Nv=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],wv=Ne("layout-grid",Nv);/**
|
|
235
|
-
* @license lucide-react v1.33.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const Sv=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],O0=Ne("list",Sv);/**
|
|
240
|
-
* @license lucide-react v1.33.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const Ev=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dt=Ne("loader-circle",Ev);/**
|
|
245
|
-
* @license lucide-react v1.33.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const kv=[["path",{d:"M3 5h1",key:"1mv5vm"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M3 19h1",key:"w6f3n9"}],["path",{d:"M8 5h1",key:"1nxr5w"}],["path",{d:"M8 12h1",key:"1con00"}],["path",{d:"M8 19h1",key:"k7p10e"}],["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}]],_v=Ne("logs",kv);/**
|
|
250
|
-
* @license lucide-react v1.33.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const Cv=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Tv=Ne("moon",Cv);/**
|
|
255
|
-
* @license lucide-react v1.33.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const Mv=[["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"}]],hx=Ne("network",Mv);/**
|
|
260
|
-
* @license lucide-react v1.33.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const Av=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],D0=Ne("palette",Av);/**
|
|
265
|
-
* @license lucide-react v1.33.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const Rv=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Fd=Ne("pen-line",Rv);/**
|
|
270
|
-
* @license lucide-react v1.33.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const zv=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ov=Ne("pen",zv);/**
|
|
275
|
-
* @license lucide-react v1.33.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const Dv=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_d=Ne("play",Dv);/**
|
|
280
|
-
* @license lucide-react v1.33.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const Hv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dt=Ne("plus",Hv);/**
|
|
285
|
-
* @license lucide-react v1.33.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const $v=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],na=Ne("refresh-cw",$v);/**
|
|
290
|
-
* @license lucide-react v1.33.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const Uv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Bv=Ne("rotate-ccw",Uv);/**
|
|
295
|
-
* @license lucide-react v1.33.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const qv=[["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"}]],Lv=Ne("save",qv);/**
|
|
300
|
-
* @license lucide-react v1.33.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const Yv=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Ro=Ne("scan-line",Yv);/**
|
|
305
|
-
* @license lucide-react v1.33.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const Vv=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zo=Ne("search",Vv);/**
|
|
310
|
-
* @license lucide-react v1.33.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const Gv=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Cd=Ne("send",Gv);/**
|
|
315
|
-
* @license lucide-react v1.33.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const Xv=[["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"}]],La=Ne("shield",Xv);/**
|
|
320
|
-
* @license lucide-react v1.33.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const Zv=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],H0=Ne("sparkles",Zv);/**
|
|
325
|
-
* @license lucide-react v1.33.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const Wv=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],Qv=Ne("square-mouse-pointer",Wv);/**
|
|
330
|
-
* @license lucide-react v1.33.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const Kv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Jv=Ne("square",Kv);/**
|
|
335
|
-
* @license lucide-react v1.33.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const Iv=[["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"}]],Fv=Ne("sun",Iv);/**
|
|
340
|
-
* @license lucide-react v1.33.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const Pv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Pd=Ne("terminal",Pv);/**
|
|
345
|
-
* @license lucide-react v1.33.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const e2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Yt=Ne("trash-2",e2);/**
|
|
350
|
-
* @license lucide-react v1.33.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const t2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n2=Ne("triangle-alert",t2);/**
|
|
355
|
-
* @license lucide-react v1.33.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const a2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zr=Ne("user",a2);/**
|
|
360
|
-
* @license lucide-react v1.33.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const s2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Td=Ne("workflow",s2);/**
|
|
365
|
-
* @license lucide-react v1.33.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const l2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_t=Ne("x",l2);/**
|
|
370
|
-
* @license lucide-react v1.33.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const r2=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],hs=Ne("zap",r2),$0=j.createContext({theme:"dark",toggleTheme:()=>{}});function i2({children:n}){const[r,i]=j.useState(()=>localStorage.getItem("jetic_theme")==="light"?"light":"dark");j.useEffect(()=>{const u=document.documentElement;r==="light"?(u.classList.add("light"),u.classList.remove("dark")):(u.classList.add("dark"),u.classList.remove("light")),localStorage.setItem("jetic_theme",r)},[r]);const o=()=>i(u=>u==="dark"?"light":"dark");return s.jsx($0.Provider,{value:{theme:r,toggleTheme:o},children:n})}function o2(){return j.useContext($0)}const c2=[{label:"WORKFLOW",items:[{id:"overview",label:"Overview",icon:wv},{id:"model",label:"Model",icon:R0},{id:"simulations",label:"Simulations",icon:ea},{id:"inspect",label:"Inspect",icon:Qv}]},{label:"AGENT",items:[{id:"memory",label:"Memory & Environment",icon:Rr}]},{label:"OBSERVABILITY",items:[{id:"traces",label:"Traces",icon:Vr},{id:"changes",label:"Files changes",icon:M0}]}],u2=[];function mx({icon:n,label:r,active:i=!1,onClick:o}){return s.jsxs("button",{type:"button",onClick:o,className:`relative hover:cursor-pointer flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors ${i?"theme-bg-overlay-md theme-text-primary font-medium":"theme-text-muted hover:theme-bg-overlay hover:theme-text"}`,children:[i&&s.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full theme-bg-brand"}),s.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:r})]})}function d2({currentPage:n,onNavigate:r,onToggleAssistant:i,isAssistantOpen:o}){const{theme:u,toggleTheme:f}=o2();return s.jsxs("div",{className:"flex w-60 shrink-0 flex-col select-none transition-colors duration-300 border-r theme-border theme-sidebar",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 pb-6 pt-5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/jetic_logo.png",alt:"jetic",className:"h-6 w-6"}),s.jsxs("span",{className:"text-[15px] tracking-wide theme-text-primary",children:["Jetic",s.jsx("span",{className:"ml-1 theme-text-brand animate-pulse",children:"Studio"})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium border theme-border theme-bg-overlay theme-text-muted",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full theme-bg-brand"}),"v0.2.5"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto px-3",children:s.jsx("div",{className:"flex flex-col gap-6",children:c2.map(h=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider theme-text-faint",children:h.label}),s.jsx("div",{className:"flex flex-col gap-0.5",children:h.items.map(g=>s.jsx(mx,{icon:g.icon,label:g.label,active:n===g.id,onClick:()=>r(g.id)},g.id))})]},h.label))})}),s.jsx("div",{className:"mx-3 my-3 hidden border-t theme-border"}),s.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:s.jsxs("button",{type:"button",onClick:i,className:`hidden relative flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[13.5px] font-medium transition-colors ${o?"theme-bg-overlay-md theme-text-primary":"theme-text hover:theme-bg-overlay"}`,children:[s.jsx(H0,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:"Jetic Assistant"})]})}),s.jsx("div",{className:"mx-3 my-3 hidden border-t theme-border"}),s.jsx("div",{className:"flex flex-col gap-0.5 px-3",children:u2.map(h=>s.jsx(mx,{icon:h.icon,label:h.label,active:n===h.id,onClick:()=>r(h.id)},h.id))}),s.jsx("div",{className:"px-3 pb-4 pt-3",children:s.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-1 border theme-border theme-bg-overlay",children:[s.jsxs("button",{type:"button",onClick:()=>u!=="dark"&&f(),title:"Dark mode",className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${u==="dark"?"theme-bg-surface theme-text-primary border theme-border shadow-sm":"theme-text-faint hover:theme-text-muted"}`,children:[s.jsx(Tv,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Dark"]}),s.jsxs("button",{type:"button",onClick:()=>u!=="light"&&f(),title:"Light mode",className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${u==="light"?"theme-bg-elevated theme-text-primary border theme-border shadow-sm":"theme-text-faint hover:theme-text-muted"}`,children:[s.jsx(Fv,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Light"]})]})})]})}function f2({isOpen:n,onClose:r}){return n?s.jsxs("div",{className:"absolute inset-y-0 right-0 w-[400px] border-l theme-border theme-bg-elevated shadow-2xl flex flex-col z-50",children:[s.jsxs("div",{className:"flex h-14 items-center justify-between border-b theme-border px-5",children:[s.jsx("div",{className:"flex items-center gap-2 text-emerald-400",children:s.jsx("span",{className:"text-[14px] font-medium",children:"Jetic AI"})}),s.jsx("button",{onClick:r,className:"theme-text-muted hover:theme-text hover:bg-white/5 p-2 rounded-full",children:s.jsx(_t,{className:"",size:13})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:s.jsxs("div",{className:"flex flex-col items-center pt-8 pb-4",children:[s.jsx("div",{className:"mb-4 flex h-10 w-10 items-center justify-center rounded-full theme-bg-overlay-md text-[13px] font-medium theme-text-primary",children:"J"}),s.jsx("h2",{className:"text-[17px] font-semibold theme-text-primary text-center",children:"How can I help you test your APIs?"}),s.jsx("p",{className:"theme-text-muted text-[13px] mt-2 text-center",children:"Ask me to generate simulations, debug traces, or explain API behavior."})]})}),s.jsx("div",{className:"p-4 border-t theme-border theme-bg-surface",children:s.jsxs("div",{className:"rounded border border-emerald-600/60 theme-bg-overlay focus-within:border-emerald-500 transition-colors",children:[s.jsx("textarea",{rows:2,placeholder:"E.g. Test password reset flow...",className:"w-full resize-none bg-transparent px-4 pb-2 pt-3.5 text-[13.5px] theme-text-primary placeholder:theme-text-muted focus:outline-none"}),s.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[s.jsx("div",{className:"flex gap-2",children:s.jsx("span",{className:"text-[11px] theme-text-muted font-mono theme-bg-overlay-md px-2 py-0.5 rounded",children:"gpt-4o"})}),s.jsx("button",{className:"text-[12px] font-medium text-emerald-400 hover:text-emerald-300",children:"Send"})]})]})})]}):null}const px="Check recent file changes (jetic_get_changes). Re-analyse ONLY those modified files to update .jetic/model.json instead of reading the entire codebase";function h2({onNavigateToChanges:n}){const[r,i]=j.useState(null),[o,u]=j.useState(!1),[f,h]=j.useState(!1),g=j.useCallback(async()=>{try{const p=await fetch("/api/changes");if(!p.ok)return;const b=await p.json();i(b)}catch{}},[]);j.useEffect(()=>{g();let p=null,b=null;try{p=new EventSource("/api/changes/stream"),p.onmessage=v=>{try{i(JSON.parse(v.data))}catch{}},p.onerror=()=>{b||(b=setInterval(g,3e3))}}catch{b=setInterval(g,3e3)}return()=>{p?.close(),b&&clearInterval(b)}},[g]);const x=r?.changes?.length??0;j.useEffect(()=>{x===0&&u(!1)},[x]);const m=p=>{p.stopPropagation(),navigator.clipboard.writeText(px),h(!0),setTimeout(()=>h(!1),2e3)};return x===0||o?null:s.jsxs("div",{className:"fixed bottom-6 right-6 z-[100] w-[420px] max-w-[calc(100vw-3rem)] rounded-xl border border-amber-500/35 p-4 shadow-2xl transition-all duration-300 animate-in slide-in-from-bottom-5 theme-sidebar theme-text-primary",style:{boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4), 0 0 15px rgba(245, 158, 11, 0.1)"},children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-amber-500/15 text-amber-400 border border-amber-500/25",children:s.jsx(n2,{className:"h-4 w-4",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-[13px] font-semibold tracking-tight theme-text-primary",children:"Model is not currently in sync with codebase"}),s.jsxs("p",{className:"text-[11px] theme-text-muted",children:["Detected ",s.jsxs("span",{className:"font-medium text-amber-400",children:[x," change",x>1?"s":""]})," in your codebase."]})]})]}),s.jsx("button",{type:"button",onClick:()=>u(!0),title:"Cancel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg transition-colors theme-text-muted hover:theme-bg-overlay-md hover:cursor-pointer",children:s.jsx(_t,{className:"h-3.5 w-3.5",strokeWidth:2})})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[r?.changes.slice(0,3).map(p=>{const b=p.filePath.split("/").pop()??p.filePath;return s.jsx("span",{onClick:()=>n?.(),className:"truncate max-w-[130px] rounded px-2 py-0.5 font-mono text-[10.5px] hover:border-amber-500/50 hover:cursor-pointer transition-colors theme-bg-overlay border theme-border theme-text-muted",title:p.filePath,children:b},p.filePath)}),x>3&&s.jsxs("span",{onClick:()=>n?.(),className:"rounded px-1.5 py-0.5 text-[10.5px] font-medium hover:cursor-pointer theme-bg-overlay-md theme-text-faint",children:["+",x-3," more"]})]}),s.jsxs("div",{className:"mt-3.5 pt-3 border-t theme-border",children:[s.jsx("p",{className:"text-[11px] mb-2 font-medium theme-text-muted",children:"Then you need to rescan the codebase:"}),s.jsxs("div",{className:"relative flex items-center justify-between rounded-lg p-2.5 font-mono text-[11px] leading-relaxed group theme-bg-base border theme-border theme-text",children:[s.jsx("span",{className:"pr-16 select-all font-mono text-[11px] leading-relaxed theme-text-primary",children:px}),s.jsx("button",{type:"button",onClick:m,title:"Copy prompt",className:`absolute right-2 top-2.5 flex items-center gap-1 rounded-md px-2 py-1 text-[10.5px] font-sans font-medium transition-all shadow-sm hover:cursor-pointer border theme-border ${f?"bg-blue-500/20 text-blue-400":"theme-bg-overlay-md theme-text-muted"}`,children:f?s.jsxs(s.Fragment,{children:[s.jsx(ut,{className:"h-3 w-3 text-blue-400",strokeWidth:2}),s.jsx("span",{children:"Copied"})]}):s.jsxs(s.Fragment,{children:[s.jsx(T0,{className:"h-3 w-3",strokeWidth:2}),s.jsx("span",{children:"Copy"})]})})]})]})]})}const m2={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"}};function Md(n){return m2[n.toUpperCase()]??{bg:"theme-bg-overlay-md",text:"theme-text-muted",dot:"var(--text-muted)"}}function ho({label:n,value:r,sub:i,icon:o,accent:u="blue"}){const f={blue:{glow:"bg-blue-500/10",text:"text-blue-400",border:"border-blue-500/20"},emerald:{glow:"bg-emerald-500/10",text:"text-emerald-400",border:"border-emerald-500/20"},amber:{glow:"bg-amber-500/10",text:"text-amber-400",border:"border-amber-500/20"},red:{glow:"bg-red-500/10",text:"text-red-400",border:"border-red-500/20"},zinc:{glow:"theme-bg-overlay-md",text:"theme-text-muted",border:"theme-border"}}[u];return s.jsxs("div",{className:"relative overflow-hidden rounded-lg border theme-border theme-bg-overlay p-4 hover:theme-bg-overlay-md transition-colors",children:[s.jsx("div",{className:`absolute top-0 right-0 h-20 w-20 rounded-full blur-2xl ${f.glow} opacity-50 -translate-y-4 translate-x-4`}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:`mb-3 flex h-8 w-8 items-center justify-center rounded-lg border theme-border ${f.glow}`,children:s.jsx(o,{className:`h-[15px] w-[15px] ${f.text}`,strokeWidth:2})}),s.jsx("p",{className:"text-2xl font-semibold theme-text-primary tabular-nums leading-none",children:r}),s.jsx("p",{className:"mt-1 text-[11px] font-semibold tracking-wider theme-text-muted uppercase",children:n}),i&&s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-faint",children:i})]})]})}function jr({title:n,icon:r,action:i,children:o,noPad:u=!1}){return s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b theme-border px-4 py-2.5 theme-bg-overlay-md",children:[r&&s.jsx(r,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider theme-text-faint uppercase",children:n}),i&&s.jsx("span",{className:"ml-auto",children:i})]}),s.jsx("div",{className:u?"":"p-4",children:o})]})}function p2({method:n}){const r=Md(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}function mo({msg:n}){return s.jsx("p",{className:"py-6 text-center text-[12px] theme-text-faint",children:n})}function x2({onClose:n,onSave:r}){const[i,o]=j.useState(""),[u,f]=j.useState("https://"),[h,g]=j.useState(!1),[x,m]=j.useState(""),p=j.useRef(null);j.useEffect(()=>{p.current?.focus()},[]);const b=async N=>{if(N.preventDefault(),!i.trim()){m("Name is required");return}if(!u.trim()||u==="https://"){m("Base URL is required");return}g(!0),m("");try{await r(i.trim(),u.trim()),n()}catch(T){m(T.message),g(!1)}},v="w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:theme-bg-overlay-md";return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:N=>{N.target===N.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-sm rounded-lg p-6 shadow-2xl shadow-black/60 border theme-border theme-sidebar",children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(vl,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium theme-text-primary",children:"Add Environment"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-muted",children:s.jsx(_t,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider theme-text-faint",children:"Name"}),s.jsx("input",{ref:p,value:i,onChange:N=>o(N.target.value),placeholder:"production",className:`${v} border theme-border theme-bg-overlay theme-text-primary`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider theme-text-faint",children:"Base URL"}),s.jsx("input",{value:u,onChange:N=>f(N.target.value),placeholder:"https://api.example.com",className:`${v} font-mono border theme-border theme-bg-overlay theme-text-primary`})]}),x&&s.jsx("p",{className:"text-[12px] text-red-400",children:x}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-muted",children:"Cancel"}),s.jsxs("button",{onClick:b,disabled:h,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400 disabled:opacity-50",children:[h&&s.jsx(dt,{className:"h-[14px] w-[14px] animate-spin",strokeWidth:2}),h?"Saving…":"Add Environment"]})]})]})]})})}function xx({onNavigate:n}){const[r,i]=j.useState(null),[o,u]=j.useState([]),[f,h]=j.useState([]),[g,x]=j.useState(!0),[m,p]=j.useState(!1),[b,v]=j.useState(null),[N,T]=j.useState(null),[_,M]=j.useState(!1),[A,V]=j.useState(null),[L,C]=j.useState(null),D=j.useCallback(async(S=!1)=>{S?p(!0):x(!0),v(null);try{const[U,k,H,O]=await Promise.allSettled([fetch("/api/model").then(z=>z.ok?z.json():null),fetch("/api/workflows").then(z=>z.ok?z.json():[]),fetch("/api/memory").then(z=>z.ok?z.json():[]),fetch("/api/model/environments").then(z=>z.ok?z.json():null)]);U.status==="fulfilled"&&i(U.value),k.status==="fulfilled"&&u(k.value??[]),H.status==="fulfilled"&&h(H.value??[]),O.status==="fulfilled"&&O.value&&T(O.value.defaultEnvironment??null)}catch(U){v(U.message)}finally{x(!1),p(!1)}},[]);j.useEffect(()=>{D()},[D]);const W=r?.endpoints?.length??0,X=o.length,ie=f.length,I=r?.endpoints?.filter(S=>(S.security?.length??0)>0).length??0,K=(r?.endpoints??[]).reduce((S,U)=>(S[U.method.toUpperCase()]=(S[U.method.toUpperCase()]??0)+1,S),{}),ne=(r?.endpoints??[]).slice(0,8),ee=o.slice(0,4),se=f.slice(0,6);return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b theme-border px-6 py-5",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium theme-text-primary leading-none",children:r?.project?.name??"Overview"}),s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:g?"Loading…":r?`${r.project.framework??r.project.language??""} · v${r.version} · ${new Date(r.generatedAt).toLocaleString()}`:"No model yet — run a scan"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("a",{href:"https://docs.jetic.online",target:"_blank",className:"relative hover:cursor-pointer flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors theme-text-muted hover:cursor-pointer hover:theme-text ",children:[s.jsx(tv,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:"Jetic Documentation"})]}),s.jsx("button",{type:"button",onClick:()=>D(!0),disabled:m||g,className:"flex h-8 w-8 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:theme-bg-overlay-md hover:theme-text disabled:opacity-40 transition-colors hover:cursor-pointer",children:s.jsx(na,{className:`h-[15px] w-[15px] ${m?"animate-spin":""}`,strokeWidth:2})}),!g&&!r&&s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-blue-400 transition-colors hover:cursor-pointer",children:[s.jsx(Ro,{className:"h-[15px] w-[15px]",strokeWidth:2})," Scan Project"]})]})]}),s.jsxs("div",{className:"flex-1 overflow-auto",children:[g&&s.jsx("div",{className:"space-y-3 p-6",children:[1,2,3,4,5].map(S=>s.jsx("div",{className:"h-14 animate-pulse rounded-lg border theme-border theme-bg-overlay",style:{opacity:1-S*.15}},S))}),!g&&b&&s.jsxs("div",{className:"m-6 flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.05] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsx("p",{className:"text-[13px] text-red-300",children:b}),s.jsx("button",{type:"button",onClick:()=>D(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[12px] text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!g&&!b&&s.jsxs("div",{className:"p-6 space-y-5",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[s.jsx(ho,{label:"Endpoints",value:W,icon:hx,accent:"blue"}),s.jsx(ho,{label:"Workflows",value:X,icon:Td,accent:"zinc"}),s.jsx(ho,{label:"Memory Keys",value:ie,icon:Rr,accent:"emerald"}),s.jsx(ho,{label:"Secured",value:I,icon:La,accent:"amber",sub:W>0?`${Math.round(I/W*100)}% of routes`:void 0})]}),r&&s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsx(jr,{title:"Project",icon:H0,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border theme-border theme-bg-overlay-md",children:s.jsx(Pd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium theme-text-primary",children:r.project.name}),s.jsx("p",{className:"text-[11px] theme-text-muted",children:r.project.framework??r.project.language??"Unknown framework"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Environments"}),s.jsxs("button",{type:"button",onClick:()=>M(!0),className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 transition-colors hover:bg-blue-500/10 hover:cursor-pointer border theme-border",children:[s.jsx(Dt,{className:"h-3 w-3",strokeWidth:2})," Add"]})]}),(r.environments?.length??0)===0?s.jsx("p",{className:"text-[12px] italic theme-text-faint",children:"No environments configured"}):s.jsx("div",{className:"space-y-1",children:r.environments.map(S=>{const U=N===S.name,k=A===S.name,H=L===S.name;return s.jsxs("div",{className:`group flex items-center gap-2.5 rounded-lg border px-3 py-2 transition-all ${U?"border-blue-500/30 bg-blue-500/[0.05]":"theme-border theme-bg-overlay-md"}`,children:[s.jsx("button",{type:"button",title:U?"Default environment":"Set as default",onClick:async()=>{if(!U){V(S.name);try{await fetch(`/api/model/environments/${encodeURIComponent(S.name)}/default`,{method:"PUT"}),T(S.name),i(O=>O&&{...O,defaultEnvironment:S.name})}finally{V(null)}}},className:`shrink-0 flex h-4 w-4 items-center justify-center rounded-full border-2 transition-colors hover:cursor-pointer ${U?"border-blue-400 bg-blue-500/20":"theme-border bg-transparent"}`,children:k?s.jsx(dt,{className:"h-2.5 w-2.5 text-blue-400 animate-spin",strokeWidth:3}):U&&s.jsx(ut,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),s.jsx(vl,{className:"h-[14px] w-[14px] theme-text-faint shrink-0",strokeWidth:2}),s.jsx("span",{className:`text-[11px] w-16 shrink-0 font-medium ${U?"text-blue-400":"theme-text-muted"}`,children:S.name}),s.jsx("span",{className:"font-mono text-[11px] theme-text truncate flex-1",children:S.baseUrl}),U&&s.jsx("span",{className:"shrink-0 rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[9px] font-semibold text-blue-400 border border-blue-500/20",children:"default"}),s.jsx("button",{type:"button",disabled:H,onClick:async()=>{C(S.name);try{await fetch(`/api/model/environments/${encodeURIComponent(S.name)}`,{method:"DELETE"}),i(O=>O&&{...O,environments:O.environments?.filter(z=>z.name!==S.name)}),N===S.name&&T(null)}finally{C(null)}},className:"ml-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-transparent theme-text-faint opacity-0 group-hover:opacity-100 transition-all hover:cursor-pointer hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-400",children:H?s.jsx(dt,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})})]},S.name)})})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1.5 rounded-lg border theme-border theme-bg-overlay-md px-3 py-1.5 text-[12px] theme-text hover:bg-blue-500 hover:text-white hover:border-blue-400 transition-colors hover:cursor-pointer",children:[s.jsx(z0,{className:"h-[15px] w-[15px]",strokeWidth:2})," View Model"]}),s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"flex items-center gap-1.5 rounded-lg border theme-border theme-bg-overlay-md px-3 py-1.5 text-[12px] theme-text hover:theme-bg-overlay-md hover:theme-text-primary transition-colors hover:cursor-pointer",children:[s.jsx(Ib,{className:"h-[15px] w-[15px]",strokeWidth:2})," Simulations"]})]})]})}),s.jsx(jr,{title:"Method Distribution",icon:Vr,children:Object.keys(K).length===0?s.jsx(mo,{msg:"No endpoints scanned yet"}):s.jsx("div",{className:"space-y-3",children:Object.entries(K).sort(([,S],[,U])=>U-S).map(([S,U])=>{const k=Md(S),H=Math.round(U/W*100);return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[s.jsx("span",{className:`text-[12px] font-medium ${k.text}`,children:S}),s.jsxs("span",{className:"text-[11px] theme-text-muted",children:[U," ",s.jsxs("span",{className:"theme-text-faint",children:["(",H,"%)"]})]})]}),s.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full theme-bg-overlay-md",children:s.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H}%`,background:k.dot}})})]},S)})})})]}),s.jsx(jr,{title:"Endpoints",icon:hx,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("model"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["View all ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:ne.length===0?s.jsx(mo,{msg:"No endpoints — scan your project first"}):s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[ne.map(S=>{const U=Md(S.method);return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:theme-bg-overlay-md transition-colors",children:[s.jsx("div",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:U.dot}}),s.jsx(p2,{method:S.method}),s.jsx("span",{className:"flex-1 truncate font-mono text-[12px] theme-text",children:S.path}),S.handlerName&&s.jsx("span",{className:"hidden sm:block truncate text-[11px] theme-text-faint max-w-[140px]",children:S.handlerName}),(S.security?.length??0)>0&&s.jsx(La,{className:"h-[15px] w-[15px] text-amber-500/60 shrink-0",strokeWidth:2})]},S.id)}),W>8&&s.jsxs("div",{className:"px-4 py-2.5 text-[11px] theme-text-faint",children:["+",W-8," more endpoints"]})]})}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsx(jr,{title:"Workflows",icon:Td,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["View all ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:ee.length===0?s.jsx(mo,{msg:"No workflows found"}):s.jsx("div",{className:"divide-y divide-[var(--border)]",children:ee.map((S,U)=>s.jsxs("button",{type:"button",onClick:()=>n?.("simulations"),className:"group flex w-full items-center gap-3 px-4 py-2.5 hover:theme-bg-overlay-md text-left transition-colors hover:cursor-pointer",children:[s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border theme-border theme-bg-overlay-md",children:s.jsx(hs,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-[13px] theme-text-primary",children:S.name}),s.jsxs("p",{className:"text-[11px] theme-text-faint",children:[S.steps.length," steps"]})]}),s.jsx(bl,{className:"h-[15px] w-[15px] shrink-0 theme-text-faint opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:2})]},U))})}),s.jsx(jr,{title:"Runtime Memory",icon:Rr,noPad:!0,action:s.jsxs("button",{type:"button",onClick:()=>n?.("memory"),className:"flex items-center gap-1 text-[11px] text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:["Inspect ",s.jsx(dl,{className:"h-3.5 w-3.5",strokeWidth:2})]}),children:se.length===0?s.jsx(mo,{msg:"No memory entries"}):s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[se.map((S,U)=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:theme-bg-overlay-md transition-colors",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/50 shrink-0"}),s.jsx("span",{className:"font-mono text-[11px] theme-text flex-1 truncate",children:S.key}),s.jsx("span",{className:"text-[11px] theme-text-faint truncate max-w-[100px]",children:typeof S.value=="object"?JSON.stringify(S.value):String(S.value)})]},U)),f.length>6&&s.jsxs("p",{className:"px-4 py-2.5 text-[11px] theme-text-faint",children:["+",f.length-6," more entries"]})]})})]}),s.jsxs("div",{className:"flex items-center gap-2 border-t theme-border pt-3 text-[11px] theme-text-faint",children:[s.jsx(Gr,{className:"h-[15px] w-[15px]",strokeWidth:2}),r?`Model generated ${new Date(r.generatedAt).toLocaleString()}`:"No model generated yet"]})]})]}),_&&s.jsx(x2,{onClose:()=>M(!1),onSave:async(S,U)=>{const k=await fetch("/api/model/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S,baseUrl:U})});if(!k.ok){const O=await k.json().catch(()=>({}));throw new Error(O.error??"Failed")}const H=await k.json();i(O=>O&&{...O,environments:H.environments}),H.defaultEnvironment&&T(H.defaultEnvironment)}})]})}async function g2(n){return await fetch("/api/traces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),n.id}async function gx(){try{const n=await fetch("/api/traces");if(n.ok){const r=await n.json();if(Array.isArray(r))return r}}catch{}return[]}async function y2(n){await fetch(`/api/traces/${encodeURIComponent(n)}`,{method:"DELETE"})}async function b2(){await fetch("/api/traces",{method:"DELETE"})}function $t(n){if(typeof n=="string"||typeof n=="number")return""+n;let r="";if(Array.isArray(n))for(let i=0,o;i<n.length;i++)(o=$t(n[i]))!==""&&(r+=(r&&" ")+o);else for(let i in n)n[i]&&(r+=(r&&" ")+i);return r}var dd={exports:{}},fd={},hd={exports:{}},md={};/**
|
|
375
|
-
* @license React
|
|
376
|
-
* use-sync-external-store-shim.production.js
|
|
377
|
-
*
|
|
378
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the MIT license found in the
|
|
381
|
-
* LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/var yx;function v2(){if(yx)return md;yx=1;var n=Yr();function r(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var i=typeof Object.is=="function"?Object.is:r,o=n.useState,u=n.useEffect,f=n.useLayoutEffect,h=n.useDebugValue;function g(b,v){var N=v(),T=o({inst:{value:N,getSnapshot:v}}),_=T[0].inst,M=T[1];return f(function(){_.value=N,_.getSnapshot=v,x(_)&&M({inst:_})},[b,N,v]),u(function(){return x(_)&&M({inst:_}),b(function(){x(_)&&M({inst:_})})},[b]),h(N),N}function x(b){var v=b.getSnapshot;b=b.value;try{var N=v();return!i(b,N)}catch{return!0}}function m(b,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:g;return md.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,md}var bx;function j2(){return bx||(bx=1,hd.exports=v2()),hd.exports}/**
|
|
383
|
-
* @license React
|
|
384
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
385
|
-
*
|
|
386
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the MIT license found in the
|
|
389
|
-
* LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/var vx;function N2(){if(vx)return fd;vx=1;var n=Yr(),r=j2();function i(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var o=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=n.useRef,h=n.useEffect,g=n.useMemo,x=n.useDebugValue;return fd.useSyncExternalStoreWithSelector=function(m,p,b,v,N){var T=f(null);if(T.current===null){var _={hasValue:!1,value:null};T.current=_}else _=T.current;T=g(function(){function A(W){if(!V){if(V=!0,L=W,W=v(W),N!==void 0&&_.hasValue){var X=_.value;if(N(X,W))return C=X}return C=W}if(X=C,o(L,W))return X;var ie=v(W);return N!==void 0&&N(X,ie)?(L=W,X):(L=W,C=ie)}var V=!1,L,C,D=b===void 0?null:b;return[function(){return A(p())},D===null?void 0:function(){return A(D())}]},[p,b,v,N]);var M=u(m,T[0],T[1]);return h(function(){_.hasValue=!0,_.value=M},[M]),x(M),M},fd}var jx;function w2(){return jx||(jx=1,dd.exports=N2()),dd.exports}var S2=w2();const E2=E0(S2),k2={},Nx=n=>{let r;const i=new Set,o=(p,b)=>{const v=typeof p=="function"?p(r):p;if(!Object.is(v,r)){const N=r;r=b??(typeof v!="object"||v===null)?v:Object.assign({},r,v),i.forEach(T=>T(r,N))}},u=()=>r,x={setState:o,getState:u,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p)),destroy:()=>{(k2?"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."),i.clear()}},m=r=n(o,u,x);return x},_2=n=>n?Nx(n):Nx,{useDebugValue:C2}=le,{useSyncExternalStoreWithSelector:T2}=E2,M2=n=>n;function U0(n,r=M2,i){const o=T2(n.subscribe,n.getState,n.getServerState||n.getInitialState,r,i);return C2(o),o}const wx=(n,r)=>{const i=_2(n),o=(u,f=r)=>U0(i,u,f);return Object.assign(o,i),o},A2=(n,r)=>n?wx(n,r):wx;function Ct(n,r){if(Object.is(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;if(n instanceof Map&&r instanceof Map){if(n.size!==r.size)return!1;for(const[o,u]of n)if(!Object.is(u,r.get(o)))return!1;return!0}if(n instanceof Set&&r instanceof Set){if(n.size!==r.size)return!1;for(const o of n)if(!r.has(o))return!1;return!0}const i=Object.keys(n);if(i.length!==Object.keys(r).length)return!1;for(const o of i)if(!Object.prototype.hasOwnProperty.call(r,o)||!Object.is(n[o],r[o]))return!1;return!0}var R2={value:()=>{}};function Go(){for(var n=0,r=arguments.length,i={},o;n<r;++n){if(!(o=arguments[n]+"")||o in i||/[\s.]/.test(o))throw new Error("illegal type: "+o);i[o]=[]}return new Co(i)}function Co(n){this._=n}function z2(n,r){return n.trim().split(/^|\s+/).map(function(i){var o="",u=i.indexOf(".");if(u>=0&&(o=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:o}})}Co.prototype=Go.prototype={constructor:Co,on:function(n,r){var i=this._,o=z2(n+"",i),u,f=-1,h=o.length;if(arguments.length<2){for(;++f<h;)if((u=(n=o[f]).type)&&(u=O2(i[u],n.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<h;)if(u=(n=o[f]).type)i[u]=Sx(i[u],n.name,r);else if(r==null)for(u in i)i[u]=Sx(i[u],n.name,null);return this},copy:function(){var n={},r=this._;for(var i in r)n[i]=r[i].slice();return new Co(n)},call:function(n,r){if((u=arguments.length-2)>0)for(var i=new Array(u),o=0,u,f;o<u;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],o=0,u=f.length;o<u;++o)f[o].value.apply(r,i)},apply:function(n,r,i){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var o=this._[n],u=0,f=o.length;u<f;++u)o[u].value.apply(r,i)}};function O2(n,r){for(var i=0,o=n.length,u;i<o;++i)if((u=n[i]).name===r)return u.value}function Sx(n,r,i){for(var o=0,u=n.length;o<u;++o)if(n[o].name===r){n[o]=R2,n=n.slice(0,o).concat(n.slice(o+1));break}return i!=null&&n.push({name:r,value:i}),n}var Ad="http://www.w3.org/1999/xhtml";const Ex={svg:"http://www.w3.org/2000/svg",xhtml:Ad,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xo(n){var r=n+="",i=r.indexOf(":");return i>=0&&(r=n.slice(0,i))!=="xmlns"&&(n=n.slice(i+1)),Ex.hasOwnProperty(r)?{space:Ex[r],local:n}:n}function D2(n){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===Ad&&r.documentElement.namespaceURI===Ad?r.createElement(n):r.createElementNS(i,n)}}function H2(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function B0(n){var r=Xo(n);return(r.local?H2:D2)(r)}function $2(){}function ef(n){return n==null?$2:function(){return this.querySelector(n)}}function U2(n){typeof n!="function"&&(n=ef(n));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var f=r[u],h=f.length,g=o[u]=new Array(h),x,m,p=0;p<h;++p)(x=f[p])&&(m=n.call(x,x.__data__,p,f))&&("__data__"in x&&(m.__data__=x.__data__),g[p]=m);return new rn(o,this._parents)}function B2(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function q2(){return[]}function q0(n){return n==null?q2:function(){return this.querySelectorAll(n)}}function L2(n){return function(){return B2(n.apply(this,arguments))}}function Y2(n){typeof n=="function"?n=L2(n):n=q0(n);for(var r=this._groups,i=r.length,o=[],u=[],f=0;f<i;++f)for(var h=r[f],g=h.length,x,m=0;m<g;++m)(x=h[m])&&(o.push(n.call(x,x.__data__,m,h)),u.push(x));return new rn(o,u)}function L0(n){return function(){return this.matches(n)}}function Y0(n){return function(r){return r.matches(n)}}var V2=Array.prototype.find;function G2(n){return function(){return V2.call(this.children,n)}}function X2(){return this.firstElementChild}function Z2(n){return this.select(n==null?X2:G2(typeof n=="function"?n:Y0(n)))}var W2=Array.prototype.filter;function Q2(){return Array.from(this.children)}function K2(n){return function(){return W2.call(this.children,n)}}function J2(n){return this.selectAll(n==null?Q2:K2(typeof n=="function"?n:Y0(n)))}function I2(n){typeof n!="function"&&(n=L0(n));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var f=r[u],h=f.length,g=o[u]=[],x,m=0;m<h;++m)(x=f[m])&&n.call(x,x.__data__,m,f)&&g.push(x);return new rn(o,this._parents)}function V0(n){return new Array(n.length)}function F2(){return new rn(this._enter||this._groups.map(V0),this._parents)}function Oo(n,r){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=r}Oo.prototype={constructor:Oo,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,r){return this._parent.insertBefore(n,r)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function P2(n){return function(){return n}}function ej(n,r,i,o,u,f){for(var h=0,g,x=r.length,m=f.length;h<m;++h)(g=r[h])?(g.__data__=f[h],o[h]=g):i[h]=new Oo(n,f[h]);for(;h<x;++h)(g=r[h])&&(u[h]=g)}function tj(n,r,i,o,u,f,h){var g,x,m=new Map,p=r.length,b=f.length,v=new Array(p),N;for(g=0;g<p;++g)(x=r[g])&&(v[g]=N=h.call(x,x.__data__,g,r)+"",m.has(N)?u[g]=x:m.set(N,x));for(g=0;g<b;++g)N=h.call(n,f[g],g,f)+"",(x=m.get(N))?(o[g]=x,x.__data__=f[g],m.delete(N)):i[g]=new Oo(n,f[g]);for(g=0;g<p;++g)(x=r[g])&&m.get(v[g])===x&&(u[g]=x)}function nj(n){return n.__data__}function aj(n,r){if(!arguments.length)return Array.from(this,nj);var i=r?tj:ej,o=this._parents,u=this._groups;typeof n!="function"&&(n=P2(n));for(var f=u.length,h=new Array(f),g=new Array(f),x=new Array(f),m=0;m<f;++m){var p=o[m],b=u[m],v=b.length,N=sj(n.call(p,p&&p.__data__,m,o)),T=N.length,_=g[m]=new Array(T),M=h[m]=new Array(T),A=x[m]=new Array(v);i(p,b,_,M,A,N,r);for(var V=0,L=0,C,D;V<T;++V)if(C=_[V]){for(V>=L&&(L=V+1);!(D=M[L])&&++L<T;);C._next=D||null}}return h=new rn(h,o),h._enter=g,h._exit=x,h}function sj(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function lj(){return new rn(this._exit||this._groups.map(V0),this._parents)}function rj(n,r,i){var o=this.enter(),u=this,f=this.exit();return typeof n=="function"?(o=n(o),o&&(o=o.selection())):o=o.append(n+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),o&&u?o.merge(u).order():u}function ij(n){for(var r=n.selection?n.selection():n,i=this._groups,o=r._groups,u=i.length,f=o.length,h=Math.min(u,f),g=new Array(u),x=0;x<h;++x)for(var m=i[x],p=o[x],b=m.length,v=g[x]=new Array(b),N,T=0;T<b;++T)(N=m[T]||p[T])&&(v[T]=N);for(;x<u;++x)g[x]=i[x];return new rn(g,this._parents)}function oj(){for(var n=this._groups,r=-1,i=n.length;++r<i;)for(var o=n[r],u=o.length-1,f=o[u],h;--u>=0;)(h=o[u])&&(f&&h.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(h,f),f=h);return this}function cj(n){n||(n=uj);function r(b,v){return b&&v?n(b.__data__,v.__data__):!b-!v}for(var i=this._groups,o=i.length,u=new Array(o),f=0;f<o;++f){for(var h=i[f],g=h.length,x=u[f]=new Array(g),m,p=0;p<g;++p)(m=h[p])&&(x[p]=m);x.sort(r)}return new rn(u,this._parents).order()}function uj(n,r){return n<r?-1:n>r?1:n>=r?0:NaN}function dj(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function fj(){return Array.from(this)}function hj(){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],u=0,f=o.length;u<f;++u){var h=o[u];if(h)return h}return null}function mj(){let n=0;for(const r of this)++n;return n}function pj(){return!this.node()}function xj(n){for(var r=this._groups,i=0,o=r.length;i<o;++i)for(var u=r[i],f=0,h=u.length,g;f<h;++f)(g=u[f])&&n.call(g,g.__data__,f,u);return this}function gj(n){return function(){this.removeAttribute(n)}}function yj(n){return function(){this.removeAttributeNS(n.space,n.local)}}function bj(n,r){return function(){this.setAttribute(n,r)}}function vj(n,r){return function(){this.setAttributeNS(n.space,n.local,r)}}function jj(n,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(n):this.setAttribute(n,i)}}function Nj(n,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,i)}}function wj(n,r){var i=Xo(n);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((r==null?i.local?yj:gj:typeof r=="function"?i.local?Nj:jj:i.local?vj:bj)(i,r))}function G0(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Sj(n){return function(){this.style.removeProperty(n)}}function Ej(n,r,i){return function(){this.style.setProperty(n,r,i)}}function kj(n,r,i){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(n):this.style.setProperty(n,o,i)}}function _j(n,r,i){return arguments.length>1?this.each((r==null?Sj:typeof r=="function"?kj:Ej)(n,r,i??"")):pl(this.node(),n)}function pl(n,r){return n.style.getPropertyValue(r)||G0(n).getComputedStyle(n,null).getPropertyValue(r)}function Cj(n){return function(){delete this[n]}}function Tj(n,r){return function(){this[n]=r}}function Mj(n,r){return function(){var i=r.apply(this,arguments);i==null?delete this[n]:this[n]=i}}function Aj(n,r){return arguments.length>1?this.each((r==null?Cj:typeof r=="function"?Mj:Tj)(n,r)):this.node()[n]}function X0(n){return n.trim().split(/^|\s+/)}function tf(n){return n.classList||new Z0(n)}function Z0(n){this._node=n,this._names=X0(n.getAttribute("class")||"")}Z0.prototype={add:function(n){var r=this._names.indexOf(n);r<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var r=this._names.indexOf(n);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function W0(n,r){for(var i=tf(n),o=-1,u=r.length;++o<u;)i.add(r[o])}function Q0(n,r){for(var i=tf(n),o=-1,u=r.length;++o<u;)i.remove(r[o])}function Rj(n){return function(){W0(this,n)}}function zj(n){return function(){Q0(this,n)}}function Oj(n,r){return function(){(r.apply(this,arguments)?W0:Q0)(this,n)}}function Dj(n,r){var i=X0(n+"");if(arguments.length<2){for(var o=tf(this.node()),u=-1,f=i.length;++u<f;)if(!o.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Oj:r?Rj:zj)(i,r))}function Hj(){this.textContent=""}function $j(n){return function(){this.textContent=n}}function Uj(n){return function(){var r=n.apply(this,arguments);this.textContent=r??""}}function Bj(n){return arguments.length?this.each(n==null?Hj:(typeof n=="function"?Uj:$j)(n)):this.node().textContent}function qj(){this.innerHTML=""}function Lj(n){return function(){this.innerHTML=n}}function Yj(n){return function(){var r=n.apply(this,arguments);this.innerHTML=r??""}}function Vj(n){return arguments.length?this.each(n==null?qj:(typeof n=="function"?Yj:Lj)(n)):this.node().innerHTML}function Gj(){this.nextSibling&&this.parentNode.appendChild(this)}function Xj(){return this.each(Gj)}function Zj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wj(){return this.each(Zj)}function Qj(n){var r=typeof n=="function"?n:B0(n);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Kj(){return null}function Jj(n,r){var i=typeof n=="function"?n:B0(n),o=r==null?Kj:typeof r=="function"?r:ef(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function Ij(){var n=this.parentNode;n&&n.removeChild(this)}function Fj(){return this.each(Ij)}function Pj(){var n=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function eN(){var n=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(n,this.nextSibling):n}function tN(n){return this.select(n?eN:Pj)}function nN(n){return arguments.length?this.property("__data__",n):this.node().__data__}function aN(n){return function(r){n.call(this,r,this.__data__)}}function sN(n){return n.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");return o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),{type:r,name:i}})}function lN(n){return function(){var r=this.__on;if(r){for(var i=0,o=-1,u=r.length,f;i<u;++i)f=r[i],(!n.type||f.type===n.type)&&f.name===n.name?this.removeEventListener(f.type,f.listener,f.options):r[++o]=f;++o?r.length=o:delete this.__on}}}function rN(n,r,i){return function(){var o=this.__on,u,f=aN(r);if(o){for(var h=0,g=o.length;h<g;++h)if((u=o[h]).type===n.type&&u.name===n.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(n.type,f,i),u={type:n.type,name:n.name,value:r,listener:f,options:i},o?o.push(u):this.__on=[u]}}function iN(n,r,i){var o=sN(n+""),u,f=o.length,h;if(arguments.length<2){var g=this.node().__on;if(g){for(var x=0,m=g.length,p;x<m;++x)for(u=0,p=g[x];u<f;++u)if((h=o[u]).type===p.type&&h.name===p.name)return p.value}return}for(g=r?rN:lN,u=0;u<f;++u)this.each(g(o[u],r,i));return this}function K0(n,r,i){var o=G0(n),u=o.CustomEvent;typeof u=="function"?u=new u(r,i):(u=o.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),n.dispatchEvent(u)}function oN(n,r){return function(){return K0(this,n,r)}}function cN(n,r){return function(){return K0(this,n,r.apply(this,arguments))}}function uN(n,r){return this.each((typeof r=="function"?cN:oN)(n,r))}function*dN(){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],u=0,f=o.length,h;u<f;++u)(h=o[u])&&(yield h)}var J0=[null];function rn(n,r){this._groups=n,this._parents=r}function Xr(){return new rn([[document.documentElement]],J0)}function fN(){return this}rn.prototype=Xr.prototype={constructor:rn,select:U2,selectAll:Y2,selectChild:Z2,selectChildren:J2,filter:I2,data:aj,enter:F2,exit:lj,join:rj,merge:ij,selection:fN,order:oj,sort:cj,call:dj,nodes:fj,node:hj,size:mj,empty:pj,each:xj,attr:wj,style:_j,property:Aj,classed:Dj,text:Bj,html:Vj,raise:Xj,lower:Wj,append:Qj,insert:Jj,remove:Fj,clone:tN,datum:nN,on:iN,dispatch:uN,[Symbol.iterator]:dN};function gn(n){return typeof n=="string"?new rn([[document.querySelector(n)]],[document.documentElement]):new rn([[n]],J0)}function hN(n){let r;for(;r=n.sourceEvent;)n=r;return n}function Sn(n,r){if(n=hN(n),r===void 0&&(r=n.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var o=i.createSVGPoint();return o.x=n.clientX,o.y=n.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[n.clientX-u.left-r.clientLeft,n.clientY-u.top-r.clientTop]}}return[n.pageX,n.pageY]}const mN={passive:!1},Or={capture:!0,passive:!1};function pd(n){n.stopImmediatePropagation()}function fl(n){n.preventDefault(),n.stopImmediatePropagation()}function I0(n){var r=n.document.documentElement,i=gn(n).on("dragstart.drag",fl,Or);"onselectstart"in r?i.on("selectstart.drag",fl,Or):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function F0(n,r){var i=n.document.documentElement,o=gn(n).on("dragstart.drag",null);r&&(o.on("click.drag",fl,Or),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in i?o.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const po=n=>()=>n;function Rd(n,{sourceEvent:r,subject:i,target:o,identifier:u,active:f,x:h,y:g,dx:x,dy:m,dispatch:p}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:h,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:x,enumerable:!0,configurable:!0},dy:{value:m,enumerable:!0,configurable:!0},_:{value:p}})}Rd.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function pN(n){return!n.ctrlKey&&!n.button}function xN(){return this.parentNode}function gN(n,r){return r??{x:n.x,y:n.y}}function yN(){return navigator.maxTouchPoints||"ontouchstart"in this}function bN(){var n=pN,r=xN,i=gN,o=yN,u={},f=Go("start","drag","end"),h=0,g,x,m,p,b=0;function v(C){C.on("mousedown.drag",N).filter(o).on("touchstart.drag",M).on("touchmove.drag",A,mN).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(C,D){if(!(p||!n.call(this,C,D))){var W=L(this,r.call(this,C,D),C,D,"mouse");W&&(gn(C.view).on("mousemove.drag",T,Or).on("mouseup.drag",_,Or),I0(C.view),pd(C),m=!1,g=C.clientX,x=C.clientY,W("start",C))}}function T(C){if(fl(C),!m){var D=C.clientX-g,W=C.clientY-x;m=D*D+W*W>b}u.mouse("drag",C)}function _(C){gn(C.view).on("mousemove.drag mouseup.drag",null),F0(C.view,m),fl(C),u.mouse("end",C)}function M(C,D){if(n.call(this,C,D)){var W=C.changedTouches,X=r.call(this,C,D),ie=W.length,I,K;for(I=0;I<ie;++I)(K=L(this,X,C,D,W[I].identifier,W[I]))&&(pd(C),K("start",C,W[I]))}}function A(C){var D=C.changedTouches,W=D.length,X,ie;for(X=0;X<W;++X)(ie=u[D[X].identifier])&&(fl(C),ie("drag",C,D[X]))}function V(C){var D=C.changedTouches,W=D.length,X,ie;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),X=0;X<W;++X)(ie=u[D[X].identifier])&&(pd(C),ie("end",C,D[X]))}function L(C,D,W,X,ie,I){var K=f.copy(),ne=Sn(I||W,D),ee,se,S;if((S=i.call(C,new Rd("beforestart",{sourceEvent:W,target:v,identifier:ie,active:h,x:ne[0],y:ne[1],dx:0,dy:0,dispatch:K}),X))!=null)return ee=S.x-ne[0]||0,se=S.y-ne[1]||0,function U(k,H,O){var z=ne,E;switch(k){case"start":u[ie]=U,E=h++;break;case"end":delete u[ie],--h;case"drag":ne=Sn(O||H,D),E=h;break}K.call(k,C,new Rd(k,{sourceEvent:H,subject:S,target:v,identifier:ie,active:E,x:ne[0]+ee,y:ne[1]+se,dx:ne[0]-z[0],dy:ne[1]-z[1],dispatch:K}),X)}}return v.filter=function(C){return arguments.length?(n=typeof C=="function"?C:po(!!C),v):n},v.container=function(C){return arguments.length?(r=typeof C=="function"?C:po(C),v):r},v.subject=function(C){return arguments.length?(i=typeof C=="function"?C:po(C),v):i},v.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:po(!!C),v):o},v.on=function(){var C=f.on.apply(f,arguments);return C===f?v:C},v.clickDistance=function(C){return arguments.length?(b=(C=+C)*C,v):Math.sqrt(b)},v}function nf(n,r,i){n.prototype=r.prototype=i,i.constructor=n}function P0(n,r){var i=Object.create(n.prototype);for(var o in r)i[o]=r[o];return i}function Zr(){}var Dr=.7,Do=1/Dr,hl="\\s*([+-]?\\d+)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vN=/^#([0-9a-f]{3,8})$/,jN=new RegExp(`^rgb\\(${hl},${hl},${hl}\\)$`),NN=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),wN=new RegExp(`^rgba\\(${hl},${hl},${hl},${Hr}\\)$`),SN=new RegExp(`^rgba\\(${zn},${zn},${zn},${Hr}\\)$`),EN=new RegExp(`^hsl\\(${Hr},${zn},${zn}\\)$`),kN=new RegExp(`^hsla\\(${Hr},${zn},${zn},${Hr}\\)$`),kx={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};nf(Zr,$r,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:_x,formatHex:_x,formatHex8:_N,formatHsl:CN,formatRgb:Cx,toString:Cx});function _x(){return this.rgb().formatHex()}function _N(){return this.rgb().formatHex8()}function CN(){return eg(this).formatHsl()}function Cx(){return this.rgb().formatRgb()}function $r(n){var r,i;return n=(n+"").trim().toLowerCase(),(r=vN.exec(n))?(i=r[1].length,r=parseInt(r[1],16),i===6?Tx(r):i===3?new Kt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?xo(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?xo(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=jN.exec(n))?new Kt(r[1],r[2],r[3],1):(r=NN.exec(n))?new Kt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=wN.exec(n))?xo(r[1],r[2],r[3],r[4]):(r=SN.exec(n))?xo(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=EN.exec(n))?Rx(r[1],r[2]/100,r[3]/100,1):(r=kN.exec(n))?Rx(r[1],r[2]/100,r[3]/100,r[4]):kx.hasOwnProperty(n)?Tx(kx[n]):n==="transparent"?new Kt(NaN,NaN,NaN,0):null}function Tx(n){return new Kt(n>>16&255,n>>8&255,n&255,1)}function xo(n,r,i,o){return o<=0&&(n=r=i=NaN),new Kt(n,r,i,o)}function TN(n){return n instanceof Zr||(n=$r(n)),n?(n=n.rgb(),new Kt(n.r,n.g,n.b,n.opacity)):new Kt}function zd(n,r,i,o){return arguments.length===1?TN(n):new Kt(n,r,i,o??1)}function Kt(n,r,i,o){this.r=+n,this.g=+r,this.b=+i,this.opacity=+o}nf(Kt,zd,P0(Zr,{brighter(n){return n=n==null?Do:Math.pow(Do,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Dr:Math.pow(Dr,n),new Kt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Kt(ds(this.r),ds(this.g),ds(this.b),Ho(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:Mx,formatHex:Mx,formatHex8:MN,formatRgb:Ax,toString:Ax}));function Mx(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}`}function MN(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}${cs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ax(){const n=Ho(this.opacity);return`${n===1?"rgb(":"rgba("}${ds(this.r)}, ${ds(this.g)}, ${ds(this.b)}${n===1?")":`, ${n})`}`}function Ho(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function ds(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function cs(n){return n=ds(n),(n<16?"0":"")+n.toString(16)}function Rx(n,r,i,o){return o<=0?n=r=i=NaN:i<=0||i>=1?n=r=NaN:r<=0&&(n=NaN),new En(n,r,i,o)}function eg(n){if(n instanceof En)return new En(n.h,n.s,n.l,n.opacity);if(n instanceof Zr||(n=$r(n)),!n)return new En;if(n instanceof En)return n;n=n.rgb();var r=n.r/255,i=n.g/255,o=n.b/255,u=Math.min(r,i,o),f=Math.max(r,i,o),h=NaN,g=f-u,x=(f+u)/2;return g?(r===f?h=(i-o)/g+(i<o)*6:i===f?h=(o-r)/g+2:h=(r-i)/g+4,g/=x<.5?f+u:2-f-u,h*=60):g=x>0&&x<1?0:h,new En(h,g,x,n.opacity)}function AN(n,r,i,o){return arguments.length===1?eg(n):new En(n,r,i,o??1)}function En(n,r,i,o){this.h=+n,this.s=+r,this.l=+i,this.opacity=+o}nf(En,AN,P0(Zr,{brighter(n){return n=n==null?Do:Math.pow(Do,n),new En(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Dr:Math.pow(Dr,n),new En(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,r=isNaN(n)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*r,u=2*i-o;return new Kt(xd(n>=240?n-240:n+120,u,o),xd(n,u,o),xd(n<120?n+240:n-120,u,o),this.opacity)},clamp(){return new En(zx(this.h),go(this.s),go(this.l),Ho(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 n=Ho(this.opacity);return`${n===1?"hsl(":"hsla("}${zx(this.h)}, ${go(this.s)*100}%, ${go(this.l)*100}%${n===1?")":`, ${n})`}`}}));function zx(n){return n=(n||0)%360,n<0?n+360:n}function go(n){return Math.max(0,Math.min(1,n||0))}function xd(n,r,i){return(n<60?r+(i-r)*n/60:n<180?i:n<240?r+(i-r)*(240-n)/60:r)*255}const tg=n=>()=>n;function RN(n,r){return function(i){return n+i*r}}function zN(n,r,i){return n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(o){return Math.pow(n+o*r,i)}}function ON(n){return(n=+n)==1?ng:function(r,i){return i-r?zN(r,i,n):tg(isNaN(r)?i:r)}}function ng(n,r){var i=r-n;return i?RN(n,i):tg(isNaN(n)?r:n)}const Ox=(function n(r){var i=ON(r);function o(u,f){var h=i((u=zd(u)).r,(f=zd(f)).r),g=i(u.g,f.g),x=i(u.b,f.b),m=ng(u.opacity,f.opacity);return function(p){return u.r=h(p),u.g=g(p),u.b=x(p),u.opacity=m(p),u+""}}return o.gamma=n,o})(1);function Da(n,r){return n=+n,r=+r,function(i){return n*(1-i)+r*i}}var Od=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gd=new RegExp(Od.source,"g");function DN(n){return function(){return n}}function HN(n){return function(r){return n(r)+""}}function $N(n,r){var i=Od.lastIndex=gd.lastIndex=0,o,u,f,h=-1,g=[],x=[];for(n=n+"",r=r+"";(o=Od.exec(n))&&(u=gd.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),g[h]?g[h]+=f:g[++h]=f),(o=o[0])===(u=u[0])?g[h]?g[h]+=u:g[++h]=u:(g[++h]=null,x.push({i:h,x:Da(o,u)})),i=gd.lastIndex;return i<r.length&&(f=r.slice(i),g[h]?g[h]+=f:g[++h]=f),g.length<2?x[0]?HN(x[0].x):DN(r):(r=x.length,function(m){for(var p=0,b;p<r;++p)g[(b=x[p]).i]=b.x(m);return g.join("")})}var Dx=180/Math.PI,Dd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ag(n,r,i,o,u,f){var h,g,x;return(h=Math.sqrt(n*n+r*r))&&(n/=h,r/=h),(x=n*i+r*o)&&(i-=n*x,o-=r*x),(g=Math.sqrt(i*i+o*o))&&(i/=g,o/=g,x/=g),n*o<r*i&&(n=-n,r=-r,x=-x,h=-h),{translateX:u,translateY:f,rotate:Math.atan2(r,n)*Dx,skewX:Math.atan(x)*Dx,scaleX:h,scaleY:g}}var yo;function UN(n){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return r.isIdentity?Dd:ag(r.a,r.b,r.c,r.d,r.e,r.f)}function BN(n){return n==null||(yo||(yo=document.createElementNS("http://www.w3.org/2000/svg","g")),yo.setAttribute("transform",n),!(n=yo.transform.baseVal.consolidate()))?Dd:(n=n.matrix,ag(n.a,n.b,n.c,n.d,n.e,n.f))}function sg(n,r,i,o){function u(m){return m.length?m.pop()+" ":""}function f(m,p,b,v,N,T){if(m!==b||p!==v){var _=N.push("translate(",null,r,null,i);T.push({i:_-4,x:Da(m,b)},{i:_-2,x:Da(p,v)})}else(b||v)&&N.push("translate("+b+r+v+i)}function h(m,p,b,v){m!==p?(m-p>180?p+=360:p-m>180&&(m+=360),v.push({i:b.push(u(b)+"rotate(",null,o)-2,x:Da(m,p)})):p&&b.push(u(b)+"rotate("+p+o)}function g(m,p,b,v){m!==p?v.push({i:b.push(u(b)+"skewX(",null,o)-2,x:Da(m,p)}):p&&b.push(u(b)+"skewX("+p+o)}function x(m,p,b,v,N,T){if(m!==b||p!==v){var _=N.push(u(N)+"scale(",null,",",null,")");T.push({i:_-4,x:Da(m,b)},{i:_-2,x:Da(p,v)})}else(b!==1||v!==1)&&N.push(u(N)+"scale("+b+","+v+")")}return function(m,p){var b=[],v=[];return m=n(m),p=n(p),f(m.translateX,m.translateY,p.translateX,p.translateY,b,v),h(m.rotate,p.rotate,b,v),g(m.skewX,p.skewX,b,v),x(m.scaleX,m.scaleY,p.scaleX,p.scaleY,b,v),m=p=null,function(N){for(var T=-1,_=v.length,M;++T<_;)b[(M=v[T]).i]=M.x(N);return b.join("")}}}var qN=sg(UN,"px, ","px)","deg)"),LN=sg(BN,", ",")",")"),YN=1e-12;function Hx(n){return((n=Math.exp(n))+1/n)/2}function VN(n){return((n=Math.exp(n))-1/n)/2}function GN(n){return((n=Math.exp(2*n))-1)/(n+1)}const XN=(function n(r,i,o){function u(f,h){var g=f[0],x=f[1],m=f[2],p=h[0],b=h[1],v=h[2],N=p-g,T=b-x,_=N*N+T*T,M,A;if(_<YN)A=Math.log(v/m)/r,M=function(X){return[g+X*N,x+X*T,m*Math.exp(r*X*A)]};else{var V=Math.sqrt(_),L=(v*v-m*m+o*_)/(2*m*i*V),C=(v*v-m*m-o*_)/(2*v*i*V),D=Math.log(Math.sqrt(L*L+1)-L),W=Math.log(Math.sqrt(C*C+1)-C);A=(W-D)/r,M=function(X){var ie=X*A,I=Hx(D),K=m/(i*V)*(I*GN(r*ie+D)-VN(D));return[g+K*N,x+K*T,m*I/Hx(r*ie+D)]}}return M.duration=A*1e3*r/Math.SQRT2,M}return u.rho=function(f){var h=Math.max(.001,+f),g=h*h,x=g*g;return n(h,g,x)},u})(Math.SQRT2,2,4);var xl=0,Cr=0,Nr=0,lg=1e3,$o,Tr,Uo=0,ms=0,Zo=0,Ur=typeof performance=="object"&&performance.now?performance:Date,rg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function af(){return ms||(rg(ZN),ms=Ur.now()+Zo)}function ZN(){ms=0}function Bo(){this._call=this._time=this._next=null}Bo.prototype=ig.prototype={constructor:Bo,restart:function(n,r,i){if(typeof n!="function")throw new TypeError("callback is not a function");i=(i==null?af():+i)+(r==null?0:+r),!this._next&&Tr!==this&&(Tr?Tr._next=this:$o=this,Tr=this),this._call=n,this._time=i,Hd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hd())}};function ig(n,r,i){var o=new Bo;return o.restart(n,r,i),o}function WN(){af(),++xl;for(var n=$o,r;n;)(r=ms-n._time)>=0&&n._call.call(void 0,r),n=n._next;--xl}function $x(){ms=(Uo=Ur.now())+Zo,xl=Cr=0;try{WN()}finally{xl=0,KN(),ms=0}}function QN(){var n=Ur.now(),r=n-Uo;r>lg&&(Zo-=r,Uo=n)}function KN(){for(var n,r=$o,i,o=1/0;r;)r._call?(o>r._time&&(o=r._time),n=r,r=r._next):(i=r._next,r._next=null,r=n?n._next=i:$o=i);Tr=n,Hd(o)}function Hd(n){if(!xl){Cr&&(Cr=clearTimeout(Cr));var r=n-ms;r>24?(n<1/0&&(Cr=setTimeout($x,n-Ur.now()-Zo)),Nr&&(Nr=clearInterval(Nr))):(Nr||(Uo=Ur.now(),Nr=setInterval(QN,lg)),xl=1,rg($x))}}function Ux(n,r,i){var o=new Bo;return r=r==null?0:+r,o.restart(u=>{o.stop(),n(u+r)},r,i),o}var JN=Go("start","end","cancel","interrupt"),IN=[],og=0,Bx=1,$d=2,To=3,qx=4,Ud=5,Mo=6;function Wo(n,r,i,o,u,f){var h=n.__transition;if(!h)n.__transition={};else if(i in h)return;FN(n,i,{name:r,index:o,group:u,on:JN,tween:IN,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:og})}function sf(n,r){var i=kn(n,r);if(i.state>og)throw new Error("too late; already scheduled");return i}function On(n,r){var i=kn(n,r);if(i.state>To)throw new Error("too late; already running");return i}function kn(n,r){var i=n.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function FN(n,r,i){var o=n.__transition,u;o[r]=i,i.timer=ig(f,0,i.time);function f(m){i.state=Bx,i.timer.restart(h,i.delay,i.time),i.delay<=m&&h(m-i.delay)}function h(m){var p,b,v,N;if(i.state!==Bx)return x();for(p in o)if(N=o[p],N.name===i.name){if(N.state===To)return Ux(h);N.state===qx?(N.state=Mo,N.timer.stop(),N.on.call("interrupt",n,n.__data__,N.index,N.group),delete o[p]):+p<r&&(N.state=Mo,N.timer.stop(),N.on.call("cancel",n,n.__data__,N.index,N.group),delete o[p])}if(Ux(function(){i.state===To&&(i.state=qx,i.timer.restart(g,i.delay,i.time),g(m))}),i.state=$d,i.on.call("start",n,n.__data__,i.index,i.group),i.state===$d){for(i.state=To,u=new Array(v=i.tween.length),p=0,b=-1;p<v;++p)(N=i.tween[p].value.call(n,n.__data__,i.index,i.group))&&(u[++b]=N);u.length=b+1}}function g(m){for(var p=m<i.duration?i.ease.call(null,m/i.duration):(i.timer.restart(x),i.state=Ud,1),b=-1,v=u.length;++b<v;)u[b].call(n,p);i.state===Ud&&(i.on.call("end",n,n.__data__,i.index,i.group),x())}function x(){i.state=Mo,i.timer.stop(),delete o[r];for(var m in o)return;delete n.__transition}}function Ao(n,r){var i=n.__transition,o,u,f=!0,h;if(i){r=r==null?null:r+"";for(h in i){if((o=i[h]).name!==r){f=!1;continue}u=o.state>$d&&o.state<Ud,o.state=Mo,o.timer.stop(),o.on.call(u?"interrupt":"cancel",n,n.__data__,o.index,o.group),delete i[h]}f&&delete n.__transition}}function PN(n){return this.each(function(){Ao(this,n)})}function e5(n,r){var i,o;return function(){var u=On(this,n),f=u.tween;if(f!==i){o=i=f;for(var h=0,g=o.length;h<g;++h)if(o[h].name===r){o=o.slice(),o.splice(h,1);break}}u.tween=o}}function t5(n,r,i){var o,u;if(typeof i!="function")throw new Error;return function(){var f=On(this,n),h=f.tween;if(h!==o){u=(o=h).slice();for(var g={name:r,value:i},x=0,m=u.length;x<m;++x)if(u[x].name===r){u[x]=g;break}x===m&&u.push(g)}f.tween=u}}function n5(n,r){var i=this._id;if(n+="",arguments.length<2){for(var o=kn(this.node(),i).tween,u=0,f=o.length,h;u<f;++u)if((h=o[u]).name===n)return h.value;return null}return this.each((r==null?e5:t5)(i,n,r))}function lf(n,r,i){var o=n._id;return n.each(function(){var u=On(this,o);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return kn(u,o).value[r]}}function cg(n,r){var i;return(typeof r=="number"?Da:r instanceof $r?Ox:(i=$r(r))?(r=i,Ox):$N)(n,r)}function a5(n){return function(){this.removeAttribute(n)}}function s5(n){return function(){this.removeAttributeNS(n.space,n.local)}}function l5(n,r,i){var o,u=i+"",f;return function(){var h=this.getAttribute(n);return h===u?null:h===o?f:f=r(o=h,i)}}function r5(n,r,i){var o,u=i+"",f;return function(){var h=this.getAttributeNS(n.space,n.local);return h===u?null:h===o?f:f=r(o=h,i)}}function i5(n,r,i){var o,u,f;return function(){var h,g=i(this),x;return g==null?void this.removeAttribute(n):(h=this.getAttribute(n),x=g+"",h===x?null:h===o&&x===u?f:(u=x,f=r(o=h,g)))}}function o5(n,r,i){var o,u,f;return function(){var h,g=i(this),x;return g==null?void this.removeAttributeNS(n.space,n.local):(h=this.getAttributeNS(n.space,n.local),x=g+"",h===x?null:h===o&&x===u?f:(u=x,f=r(o=h,g)))}}function c5(n,r){var i=Xo(n),o=i==="transform"?LN:cg;return this.attrTween(n,typeof r=="function"?(i.local?o5:i5)(i,o,lf(this,"attr."+n,r)):r==null?(i.local?s5:a5)(i):(i.local?r5:l5)(i,o,r))}function u5(n,r){return function(i){this.setAttribute(n,r.call(this,i))}}function d5(n,r){return function(i){this.setAttributeNS(n.space,n.local,r.call(this,i))}}function f5(n,r){var i,o;function u(){var f=r.apply(this,arguments);return f!==o&&(i=(o=f)&&d5(n,f)),i}return u._value=r,u}function h5(n,r){var i,o;function u(){var f=r.apply(this,arguments);return f!==o&&(i=(o=f)&&u5(n,f)),i}return u._value=r,u}function m5(n,r){var i="attr."+n;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var o=Xo(n);return this.tween(i,(o.local?f5:h5)(o,r))}function p5(n,r){return function(){sf(this,n).delay=+r.apply(this,arguments)}}function x5(n,r){return r=+r,function(){sf(this,n).delay=r}}function g5(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?p5:x5)(r,n)):kn(this.node(),r).delay}function y5(n,r){return function(){On(this,n).duration=+r.apply(this,arguments)}}function b5(n,r){return r=+r,function(){On(this,n).duration=r}}function v5(n){var r=this._id;return arguments.length?this.each((typeof n=="function"?y5:b5)(r,n)):kn(this.node(),r).duration}function j5(n,r){if(typeof r!="function")throw new Error;return function(){On(this,n).ease=r}}function N5(n){var r=this._id;return arguments.length?this.each(j5(r,n)):kn(this.node(),r).ease}function w5(n,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;On(this,n).ease=i}}function S5(n){if(typeof n!="function")throw new Error;return this.each(w5(this._id,n))}function E5(n){typeof n!="function"&&(n=L0(n));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var f=r[u],h=f.length,g=o[u]=[],x,m=0;m<h;++m)(x=f[m])&&n.call(x,x.__data__,m,f)&&g.push(x);return new aa(o,this._parents,this._name,this._id)}function k5(n){if(n._id!==this._id)throw new Error;for(var r=this._groups,i=n._groups,o=r.length,u=i.length,f=Math.min(o,u),h=new Array(o),g=0;g<f;++g)for(var x=r[g],m=i[g],p=x.length,b=h[g]=new Array(p),v,N=0;N<p;++N)(v=x[N]||m[N])&&(b[N]=v);for(;g<o;++g)h[g]=r[g];return new aa(h,this._parents,this._name,this._id)}function _5(n){return(n+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function C5(n,r,i){var o,u,f=_5(r)?sf:On;return function(){var h=f(this,n),g=h.on;g!==o&&(u=(o=g).copy()).on(r,i),h.on=u}}function T5(n,r){var i=this._id;return arguments.length<2?kn(this.node(),i).on.on(n):this.each(C5(i,n,r))}function M5(n){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==n)return;r&&r.removeChild(this)}}function A5(){return this.on("end.remove",M5(this._id))}function R5(n){var r=this._name,i=this._id;typeof n!="function"&&(n=ef(n));for(var o=this._groups,u=o.length,f=new Array(u),h=0;h<u;++h)for(var g=o[h],x=g.length,m=f[h]=new Array(x),p,b,v=0;v<x;++v)(p=g[v])&&(b=n.call(p,p.__data__,v,g))&&("__data__"in p&&(b.__data__=p.__data__),m[v]=b,Wo(m[v],r,i,v,m,kn(p,i)));return new aa(f,this._parents,r,i)}function z5(n){var r=this._name,i=this._id;typeof n!="function"&&(n=q0(n));for(var o=this._groups,u=o.length,f=[],h=[],g=0;g<u;++g)for(var x=o[g],m=x.length,p,b=0;b<m;++b)if(p=x[b]){for(var v=n.call(p,p.__data__,b,x),N,T=kn(p,i),_=0,M=v.length;_<M;++_)(N=v[_])&&Wo(N,r,i,_,v,T);f.push(v),h.push(p)}return new aa(f,h,r,i)}var O5=Xr.prototype.constructor;function D5(){return new O5(this._groups,this._parents)}function H5(n,r){var i,o,u;return function(){var f=pl(this,n),h=(this.style.removeProperty(n),pl(this,n));return f===h?null:f===i&&h===o?u:u=r(i=f,o=h)}}function ug(n){return function(){this.style.removeProperty(n)}}function $5(n,r,i){var o,u=i+"",f;return function(){var h=pl(this,n);return h===u?null:h===o?f:f=r(o=h,i)}}function U5(n,r,i){var o,u,f;return function(){var h=pl(this,n),g=i(this),x=g+"";return g==null&&(x=g=(this.style.removeProperty(n),pl(this,n))),h===x?null:h===o&&x===u?f:(u=x,f=r(o=h,g))}}function B5(n,r){var i,o,u,f="style."+r,h="end."+f,g;return function(){var x=On(this,n),m=x.on,p=x.value[f]==null?g||(g=ug(r)):void 0;(m!==i||u!==p)&&(o=(i=m).copy()).on(h,u=p),x.on=o}}function q5(n,r,i){var o=(n+="")=="transform"?qN:cg;return r==null?this.styleTween(n,H5(n,o)).on("end.style."+n,ug(n)):typeof r=="function"?this.styleTween(n,U5(n,o,lf(this,"style."+n,r))).each(B5(this._id,n)):this.styleTween(n,$5(n,o,r),i).on("end.style."+n,null)}function L5(n,r,i){return function(o){this.style.setProperty(n,r.call(this,o),i)}}function Y5(n,r,i){var o,u;function f(){var h=r.apply(this,arguments);return h!==u&&(o=(u=h)&&L5(n,h,i)),o}return f._value=r,f}function V5(n,r,i){var o="style."+(n+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,Y5(n,r,i??""))}function G5(n){return function(){this.textContent=n}}function X5(n){return function(){var r=n(this);this.textContent=r??""}}function Z5(n){return this.tween("text",typeof n=="function"?X5(lf(this,"text",n)):G5(n==null?"":n+""))}function W5(n){return function(r){this.textContent=n.call(this,r)}}function Q5(n){var r,i;function o(){var u=n.apply(this,arguments);return u!==i&&(r=(i=u)&&W5(u)),r}return o._value=n,o}function K5(n){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,Q5(n))}function J5(){for(var n=this._name,r=this._id,i=dg(),o=this._groups,u=o.length,f=0;f<u;++f)for(var h=o[f],g=h.length,x,m=0;m<g;++m)if(x=h[m]){var p=kn(x,r);Wo(x,n,i,m,h,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new aa(o,this._parents,n,i)}function I5(){var n,r,i=this,o=i._id,u=i.size();return new Promise(function(f,h){var g={value:h},x={value:function(){--u===0&&f()}};i.each(function(){var m=On(this,o),p=m.on;p!==n&&(r=(n=p).copy(),r._.cancel.push(g),r._.interrupt.push(g),r._.end.push(x)),m.on=r}),u===0&&f()})}var F5=0;function aa(n,r,i,o){this._groups=n,this._parents=r,this._name=i,this._id=o}function dg(){return++F5}var Fn=Xr.prototype;aa.prototype={constructor:aa,select:R5,selectAll:z5,selectChild:Fn.selectChild,selectChildren:Fn.selectChildren,filter:E5,merge:k5,selection:D5,transition:J5,call:Fn.call,nodes:Fn.nodes,node:Fn.node,size:Fn.size,empty:Fn.empty,each:Fn.each,on:T5,attr:c5,attrTween:m5,style:q5,styleTween:V5,text:Z5,textTween:K5,remove:A5,tween:n5,delay:g5,duration:v5,ease:N5,easeVarying:S5,end:I5,[Symbol.iterator]:Fn[Symbol.iterator]};function P5(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var ew={time:null,delay:0,duration:250,ease:P5};function tw(n,r){for(var i;!(i=n.__transition)||!(i=i[r]);)if(!(n=n.parentNode))throw new Error(`transition ${r} not found`);return i}function nw(n){var r,i;n instanceof aa?(r=n._id,n=n._name):(r=dg(),(i=ew).time=af(),n=n==null?null:n+"");for(var o=this._groups,u=o.length,f=0;f<u;++f)for(var h=o[f],g=h.length,x,m=0;m<g;++m)(x=h[m])&&Wo(x,n,r,m,h,i||tw(x,r));return new aa(o,this._parents,n,r)}Xr.prototype.interrupt=PN;Xr.prototype.transition=nw;const bo=n=>()=>n;function aw(n,{sourceEvent:r,target:i,transform:o,dispatch:u}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:u}})}function Pn(n,r,i){this.k=n,this.x=r,this.y=i}Pn.prototype={constructor:Pn,scale:function(n){return n===1?this:new Pn(this.k*n,this.x,this.y)},translate:function(n,r){return n===0&r===0?this:new Pn(this.k,this.x+this.k*n,this.y+this.k*r)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ta=new Pn(1,0,0);Pn.prototype;function yd(n){n.stopImmediatePropagation()}function wr(n){n.preventDefault(),n.stopImmediatePropagation()}function sw(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function lw(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Lx(){return this.__zoom||ta}function rw(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function iw(){return navigator.maxTouchPoints||"ontouchstart"in this}function ow(n,r,i){var o=n.invertX(r[0][0])-i[0][0],u=n.invertX(r[1][0])-i[1][0],f=n.invertY(r[0][1])-i[0][1],h=n.invertY(r[1][1])-i[1][1];return n.translate(u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u),h>f?(f+h)/2:Math.min(0,f)||Math.max(0,h))}function fg(){var n=sw,r=lw,i=ow,o=rw,u=iw,f=[0,1/0],h=[[-1/0,-1/0],[1/0,1/0]],g=250,x=XN,m=Go("start","zoom","end"),p,b,v,N=500,T=150,_=0,M=10;function A(S){S.property("__zoom",Lx).on("wheel.zoom",ie,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",K).filter(u).on("touchstart.zoom",ne).on("touchmove.zoom",ee).on("touchend.zoom touchcancel.zoom",se).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(S,U,k,H){var O=S.selection?S.selection():S;O.property("__zoom",Lx),S!==O?D(S,U,k,H):O.interrupt().each(function(){W(this,arguments).event(H).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},A.scaleBy=function(S,U,k,H){A.scaleTo(S,function(){var O=this.__zoom.k,z=typeof U=="function"?U.apply(this,arguments):U;return O*z},k,H)},A.scaleTo=function(S,U,k,H){A.transform(S,function(){var O=r.apply(this,arguments),z=this.__zoom,E=k==null?C(O):typeof k=="function"?k.apply(this,arguments):k,$=z.invert(E),Z=typeof U=="function"?U.apply(this,arguments):U;return i(L(V(z,Z),E,$),O,h)},k,H)},A.translateBy=function(S,U,k,H){A.transform(S,function(){return i(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof k=="function"?k.apply(this,arguments):k),r.apply(this,arguments),h)},null,H)},A.translateTo=function(S,U,k,H,O){A.transform(S,function(){var z=r.apply(this,arguments),E=this.__zoom,$=H==null?C(z):typeof H=="function"?H.apply(this,arguments):H;return i(ta.translate($[0],$[1]).scale(E.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof k=="function"?-k.apply(this,arguments):-k),z,h)},H,O)};function V(S,U){return U=Math.max(f[0],Math.min(f[1],U)),U===S.k?S:new Pn(U,S.x,S.y)}function L(S,U,k){var H=U[0]-k[0]*S.k,O=U[1]-k[1]*S.k;return H===S.x&&O===S.y?S:new Pn(S.k,H,O)}function C(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function D(S,U,k,H){S.on("start.zoom",function(){W(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){W(this,arguments).event(H).end()}).tween("zoom",function(){var O=this,z=arguments,E=W(O,z).event(H),$=r.apply(O,z),Z=k==null?C($):typeof k=="function"?k.apply(O,z):k,ae=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),oe=O.__zoom,he=typeof U=="function"?U.apply(O,z):U,me=x(oe.invert(Z).concat(ae/oe.k),he.invert(Z).concat(ae/he.k));return function(Se){if(Se===1)Se=he;else{var ve=me(Se),Ae=ae/ve[2];Se=new Pn(Ae,Z[0]-ve[0]*Ae,Z[1]-ve[1]*Ae)}E.zoom(null,Se)}})}function W(S,U,k){return!k&&S.__zooming||new X(S,U)}function X(S,U){this.that=S,this.args=U,this.active=0,this.sourceEvent=null,this.extent=r.apply(S,U),this.taps=0}X.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,U){return this.mouse&&S!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var U=gn(this.that).datum();m.call(S,this.that,new aw(S,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:m}),U)}};function ie(S,...U){if(!n.apply(this,arguments))return;var k=W(this,U).event(S),H=this.__zoom,O=Math.max(f[0],Math.min(f[1],H.k*Math.pow(2,o.apply(this,arguments)))),z=Sn(S);if(k.wheel)(k.mouse[0][0]!==z[0]||k.mouse[0][1]!==z[1])&&(k.mouse[1]=H.invert(k.mouse[0]=z)),clearTimeout(k.wheel);else{if(H.k===O)return;k.mouse=[z,H.invert(z)],Ao(this),k.start()}wr(S),k.wheel=setTimeout(E,T),k.zoom("mouse",i(L(V(H,O),k.mouse[0],k.mouse[1]),k.extent,h));function E(){k.wheel=null,k.end()}}function I(S,...U){if(v||!n.apply(this,arguments))return;var k=S.currentTarget,H=W(this,U,!0).event(S),O=gn(S.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",ae,!0),z=Sn(S,k),E=S.clientX,$=S.clientY;I0(S.view),yd(S),H.mouse=[z,this.__zoom.invert(z)],Ao(this),H.start();function Z(oe){if(wr(oe),!H.moved){var he=oe.clientX-E,me=oe.clientY-$;H.moved=he*he+me*me>_}H.event(oe).zoom("mouse",i(L(H.that.__zoom,H.mouse[0]=Sn(oe,k),H.mouse[1]),H.extent,h))}function ae(oe){O.on("mousemove.zoom mouseup.zoom",null),F0(oe.view,H.moved),wr(oe),H.event(oe).end()}}function K(S,...U){if(n.apply(this,arguments)){var k=this.__zoom,H=Sn(S.changedTouches?S.changedTouches[0]:S,this),O=k.invert(H),z=k.k*(S.shiftKey?.5:2),E=i(L(V(k,z),H,O),r.apply(this,U),h);wr(S),g>0?gn(this).transition().duration(g).call(D,E,H,S):gn(this).call(A.transform,E,H,S)}}function ne(S,...U){if(n.apply(this,arguments)){var k=S.touches,H=k.length,O=W(this,U,S.changedTouches.length===H).event(S),z,E,$,Z;for(yd(S),E=0;E<H;++E)$=k[E],Z=Sn($,this),Z=[Z,this.__zoom.invert(Z),$.identifier],O.touch0?!O.touch1&&O.touch0[2]!==Z[2]&&(O.touch1=Z,O.taps=0):(O.touch0=Z,z=!0,O.taps=1+!!p);p&&(p=clearTimeout(p)),z&&(O.taps<2&&(b=Z[0],p=setTimeout(function(){p=null},N)),Ao(this),O.start())}}function ee(S,...U){if(this.__zooming){var k=W(this,U).event(S),H=S.changedTouches,O=H.length,z,E,$,Z;for(wr(S),z=0;z<O;++z)E=H[z],$=Sn(E,this),k.touch0&&k.touch0[2]===E.identifier?k.touch0[0]=$:k.touch1&&k.touch1[2]===E.identifier&&(k.touch1[0]=$);if(E=k.that.__zoom,k.touch1){var ae=k.touch0[0],oe=k.touch0[1],he=k.touch1[0],me=k.touch1[1],Se=(Se=he[0]-ae[0])*Se+(Se=he[1]-ae[1])*Se,ve=(ve=me[0]-oe[0])*ve+(ve=me[1]-oe[1])*ve;E=V(E,Math.sqrt(Se/ve)),$=[(ae[0]+he[0])/2,(ae[1]+he[1])/2],Z=[(oe[0]+me[0])/2,(oe[1]+me[1])/2]}else if(k.touch0)$=k.touch0[0],Z=k.touch0[1];else return;k.zoom("touch",i(L(E,$,Z),k.extent,h))}}function se(S,...U){if(this.__zooming){var k=W(this,U).event(S),H=S.changedTouches,O=H.length,z,E;for(yd(S),v&&clearTimeout(v),v=setTimeout(function(){v=null},N),z=0;z<O;++z)E=H[z],k.touch0&&k.touch0[2]===E.identifier?delete k.touch0:k.touch1&&k.touch1[2]===E.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(E=Sn(E,this),Math.hypot(b[0]-E[0],b[1]-E[1])<M)){var $=gn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return A.wheelDelta=function(S){return arguments.length?(o=typeof S=="function"?S:bo(+S),A):o},A.filter=function(S){return arguments.length?(n=typeof S=="function"?S:bo(!!S),A):n},A.touchable=function(S){return arguments.length?(u=typeof S=="function"?S:bo(!!S),A):u},A.extent=function(S){return arguments.length?(r=typeof S=="function"?S:bo([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),A):r},A.scaleExtent=function(S){return arguments.length?(f[0]=+S[0],f[1]=+S[1],A):[f[0],f[1]]},A.translateExtent=function(S){return arguments.length?(h[0][0]=+S[0][0],h[1][0]=+S[1][0],h[0][1]=+S[0][1],h[1][1]=+S[1][1],A):[[h[0][0],h[0][1]],[h[1][0],h[1][1]]]},A.constrain=function(S){return arguments.length?(i=S,A):i},A.duration=function(S){return arguments.length?(g=+S,A):g},A.interpolate=function(S){return arguments.length?(x=S,A):x},A.on=function(){var S=m.on.apply(m,arguments);return S===m?A:S},A.clickDistance=function(S){return arguments.length?(_=(S=+S)*S,A):Math.sqrt(_)},A.tapDistance=function(S){return arguments.length?(M=+S,A):M},A}k0();const Qo=j.createContext(null),cw=Qo.Provider,sa={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:n=>`Node type "${n}" 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,r)=>`Couldn't create edge for ${n?"target":"source"} handle id: "${n?r.targetHandle:r.sourceHandle}", edge id: ${r.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},hg=sa.error001();function tt(n,r){const i=j.useContext(Qo);if(i===null)throw new Error(hg);return U0(i,n,r)}const Nt=()=>{const n=j.useContext(Qo);if(n===null)throw new Error(hg);return j.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe,destroy:n.destroy}),[n])},uw=n=>n.userSelectionActive?"none":"all";function rf({position:n,children:r,className:i,style:o,...u}){const f=tt(uw),h=`${n}`.split("-");return le.createElement("div",{className:$t(["react-flow__panel",i,...h]),style:{...o,pointerEvents:f},...u},r)}function dw({proOptions:n,position:r="bottom-right"}){return n?.hideAttribution?null:le.createElement(rf,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},le.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const fw=({x:n,y:r,label:i,labelStyle:o={},labelShowBg:u=!0,labelBgStyle:f={},labelBgPadding:h=[2,4],labelBgBorderRadius:g=2,children:x,className:m,...p})=>{const b=j.useRef(null),[v,N]=j.useState({x:0,y:0,width:0,height:0}),T=$t(["react-flow__edge-textwrapper",m]);return j.useEffect(()=>{if(b.current){const _=b.current.getBBox();N({x:_.x,y:_.y,width:_.width,height:_.height})}},[i]),typeof i>"u"||!i?null:le.createElement("g",{transform:`translate(${n-v.width/2} ${r-v.height/2})`,className:T,visibility:v.width?"visible":"hidden",...p},u&&le.createElement("rect",{width:v.width+2*h[0],x:-h[0],y:-h[1],height:v.height+2*h[1],className:"react-flow__edge-textbg",style:f,rx:g,ry:g}),le.createElement("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:b,style:o},i),x)};var hw=j.memo(fw);const of=n=>({width:n.offsetWidth,height:n.offsetHeight}),gl=(n,r=0,i=1)=>Math.min(Math.max(n,r),i),cf=(n={x:0,y:0},r)=>({x:gl(n.x,r[0][0],r[1][0]),y:gl(n.y,r[0][1],r[1][1])}),Yx=(n,r,i)=>n<r?gl(Math.abs(n-r),1,50)/50:n>i?-gl(Math.abs(n-i),1,50)/50:0,mg=(n,r)=>{const i=Yx(n.x,35,r.width-35)*20,o=Yx(n.y,35,r.height-35)*20;return[i,o]},pg=n=>n.getRootNode?.()||window?.document,xg=(n,r)=>({x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),x2:Math.max(n.x2,r.x2),y2:Math.max(n.y2,r.y2)}),Br=({x:n,y:r,width:i,height:o})=>({x:n,y:r,x2:n+i,y2:r+o}),gg=({x:n,y:r,x2:i,y2:o})=>({x:n,y:r,width:i-n,height:o-r}),Vx=n=>({...n.positionAbsolute||{x:0,y:0},width:n.width||0,height:n.height||0}),mw=(n,r)=>gg(xg(Br(n),Br(r))),Bd=(n,r)=>{const i=Math.max(0,Math.min(n.x+n.width,r.x+r.width)-Math.max(n.x,r.x)),o=Math.max(0,Math.min(n.y+n.height,r.y+r.height)-Math.max(n.y,r.y));return Math.ceil(i*o)},pw=n=>yn(n.width)&&yn(n.height)&&yn(n.x)&&yn(n.y),yn=n=>!isNaN(n)&&isFinite(n),ct=Symbol.for("internals"),yg=["Enter"," ","Escape"],xw=(n,r)=>{},gw=n=>"nativeEvent"in n;function qd(n){const i=(gw(n)?n.nativeEvent:n).composedPath?.()?.[0]||n.target;return["INPUT","SELECT","TEXTAREA"].includes(i?.nodeName)||i?.hasAttribute("contenteditable")||!!i?.closest(".nokey")}const bg=n=>"clientX"in n,Ua=(n,r)=>{const i=bg(n),o=i?n.clientX:n.touches?.[0].clientX,u=i?n.clientY:n.touches?.[0].clientY;return{x:o-(r?.left??0),y:u-(r?.top??0)}},qo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,Wr=({id:n,path:r,labelX:i,labelY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:N=20})=>le.createElement(le.Fragment,null,le.createElement("path",{id:n,style:p,d:r,fill:"none",className:"react-flow__edge-path",markerEnd:b,markerStart:v}),N&&le.createElement("path",{d:r,fill:"none",strokeOpacity:0,strokeWidth:N,className:"react-flow__edge-interaction"}),u&&yn(i)&&yn(o)?le.createElement(hw,{x:i,y:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m}):null);Wr.displayName="BaseEdge";function Sr(n,r,i){return i===void 0?i:o=>{const u=r().edges.find(f=>f.id===n);u&&i(o,{...u})}}function vg({sourceX:n,sourceY:r,targetX:i,targetY:o}){const u=Math.abs(i-n)/2,f=i<n?i+u:i-u,h=Math.abs(o-r)/2,g=o<r?o+h:o-h;return[f,g,u,h]}function jg({sourceX:n,sourceY:r,targetX:i,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:g}){const x=n*.125+u*.375+h*.375+i*.125,m=r*.125+f*.375+g*.375+o*.125,p=Math.abs(x-n),b=Math.abs(m-r);return[x,m,p,b]}var ps;(function(n){n.Strict="strict",n.Loose="loose"})(ps||(ps={}));var us;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(us||(us={}));var qr;(function(n){n.Partial="partial",n.Full="full"})(qr||(qr={}));var $a;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})($a||($a={}));var Ba;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Ba||(Ba={}));var xe;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(xe||(xe={}));function Gx({pos:n,x1:r,y1:i,x2:o,y2:u}){return n===xe.Left||n===xe.Right?[.5*(r+o),i]:[r,.5*(i+u)]}function Ng({sourceX:n,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:f=xe.Top}){const[h,g]=Gx({pos:i,x1:n,y1:r,x2:o,y2:u}),[x,m]=Gx({pos:f,x1:o,y1:u,x2:n,y2:r}),[p,b,v,N]=jg({sourceX:n,sourceY:r,targetX:o,targetY:u,sourceControlX:h,sourceControlY:g,targetControlX:x,targetControlY:m});return[`M${n},${r} C${h},${g} ${x},${m} ${o},${u}`,p,b,v,N]}const uf=j.memo(({sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:u=xe.Bottom,targetPosition:f=xe.Top,label:h,labelStyle:g,labelShowBg:x,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:T,interactionWidth:_})=>{const[M,A,V]=Ng({sourceX:n,sourceY:r,sourcePosition:u,targetX:i,targetY:o,targetPosition:f});return le.createElement(Wr,{path:M,labelX:A,labelY:V,label:h,labelStyle:g,labelShowBg:x,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:T,interactionWidth:_})});uf.displayName="SimpleBezierEdge";const Xx={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},yw=({source:n,sourcePosition:r=xe.Bottom,target:i})=>r===xe.Left||r===xe.Right?n.x<i.x?{x:1,y:0}:{x:-1,y:0}:n.y<i.y?{x:0,y:1}:{x:0,y:-1},Zx=(n,r)=>Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2));function bw({source:n,sourcePosition:r=xe.Bottom,target:i,targetPosition:o=xe.Top,center:u,offset:f}){const h=Xx[r],g=Xx[o],x={x:n.x+h.x*f,y:n.y+h.y*f},m={x:i.x+g.x*f,y:i.y+g.y*f},p=yw({source:x,sourcePosition:r,target:m}),b=p.x!==0?"x":"y",v=p[b];let N=[],T,_;const M={x:0,y:0},A={x:0,y:0},[V,L,C,D]=vg({sourceX:n.x,sourceY:n.y,targetX:i.x,targetY:i.y});if(h[b]*g[b]===-1){T=u.x??V,_=u.y??L;const X=[{x:T,y:x.y},{x:T,y:m.y}],ie=[{x:x.x,y:_},{x:m.x,y:_}];h[b]===v?N=b==="x"?X:ie:N=b==="x"?ie:X}else{const X=[{x:x.x,y:m.y}],ie=[{x:m.x,y:x.y}];if(b==="x"?N=h.x===v?ie:X:N=h.y===v?X:ie,r===o){const se=Math.abs(n[b]-i[b]);if(se<=f){const S=Math.min(f-1,f-se);h[b]===v?M[b]=(x[b]>n[b]?-1:1)*S:A[b]=(m[b]>i[b]?-1:1)*S}}if(r!==o){const se=b==="x"?"y":"x",S=h[b]===g[se],U=x[se]>m[se],k=x[se]<m[se];(h[b]===1&&(!S&&U||S&&k)||h[b]!==1&&(!S&&k||S&&U))&&(N=b==="x"?X:ie)}const I={x:x.x+M.x,y:x.y+M.y},K={x:m.x+A.x,y:m.y+A.y},ne=Math.max(Math.abs(I.x-N[0].x),Math.abs(K.x-N[0].x)),ee=Math.max(Math.abs(I.y-N[0].y),Math.abs(K.y-N[0].y));ne>=ee?(T=(I.x+K.x)/2,_=N[0].y):(T=N[0].x,_=(I.y+K.y)/2)}return[[n,{x:x.x+M.x,y:x.y+M.y},...N,{x:m.x+A.x,y:m.y+A.y},i],T,_,C,D]}function vw(n,r,i,o){const u=Math.min(Zx(n,r)/2,Zx(r,i)/2,o),{x:f,y:h}=r;if(n.x===f&&f===i.x||n.y===h&&h===i.y)return`L${f} ${h}`;if(n.y===h){const m=n.x<i.x?-1:1,p=n.y<i.y?1:-1;return`L ${f+u*m},${h}Q ${f},${h} ${f},${h+u*p}`}const g=n.x<i.x?1:-1,x=n.y<i.y?-1:1;return`L ${f},${h+u*x}Q ${f},${h} ${f+u*g},${h}`}function Ld({sourceX:n,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:f=xe.Top,borderRadius:h=5,centerX:g,centerY:x,offset:m=20}){const[p,b,v,N,T]=bw({source:{x:n,y:r},sourcePosition:i,target:{x:o,y:u},targetPosition:f,center:{x:g,y:x},offset:m});return[p.reduce((M,A,V)=>{let L="";return V>0&&V<p.length-1?L=vw(p[V-1],A,p[V+1],h):L=`${V===0?"M":"L"}${A.x} ${A.y}`,M+=L,M},""),b,v,N,T]}const Ko=j.memo(({sourceX:n,sourceY:r,targetX:i,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m,style:p,sourcePosition:b=xe.Bottom,targetPosition:v=xe.Top,markerEnd:N,markerStart:T,pathOptions:_,interactionWidth:M})=>{const[A,V,L]=Ld({sourceX:n,sourceY:r,sourcePosition:b,targetX:i,targetY:o,targetPosition:v,borderRadius:_?.borderRadius,offset:_?.offset});return le.createElement(Wr,{path:A,labelX:V,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m,style:p,markerEnd:N,markerStart:T,interactionWidth:M})});Ko.displayName="SmoothStepEdge";const df=j.memo(n=>le.createElement(Ko,{...n,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])}));df.displayName="StepEdge";function jw({sourceX:n,sourceY:r,targetX:i,targetY:o}){const[u,f,h,g]=vg({sourceX:n,sourceY:r,targetX:i,targetY:o});return[`M ${n},${r}L ${i},${o}`,u,f,h,g]}const ff=j.memo(({sourceX:n,sourceY:r,targetX:i,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:N})=>{const[T,_,M]=jw({sourceX:n,sourceY:r,targetX:i,targetY:o});return le.createElement(Wr,{path:T,labelX:_,labelY:M,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:N})});ff.displayName="StraightEdge";function vo(n,r){return n>=0?.5*n:r*25*Math.sqrt(-n)}function Wx({pos:n,x1:r,y1:i,x2:o,y2:u,c:f}){switch(n){case xe.Left:return[r-vo(r-o,f),i];case xe.Right:return[r+vo(o-r,f),i];case xe.Top:return[r,i-vo(i-u,f)];case xe.Bottom:return[r,i+vo(u-i,f)]}}function wg({sourceX:n,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:u,targetPosition:f=xe.Top,curvature:h=.25}){const[g,x]=Wx({pos:i,x1:n,y1:r,x2:o,y2:u,c:h}),[m,p]=Wx({pos:f,x1:o,y1:u,x2:n,y2:r,c:h}),[b,v,N,T]=jg({sourceX:n,sourceY:r,targetX:o,targetY:u,sourceControlX:g,sourceControlY:x,targetControlX:m,targetControlY:p});return[`M${n},${r} C${g},${x} ${m},${p} ${o},${u}`,b,v,N,T]}const Lo=j.memo(({sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:u=xe.Bottom,targetPosition:f=xe.Top,label:h,labelStyle:g,labelShowBg:x,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:T,pathOptions:_,interactionWidth:M})=>{const[A,V,L]=wg({sourceX:n,sourceY:r,sourcePosition:u,targetX:i,targetY:o,targetPosition:f,curvature:_?.curvature});return le.createElement(Wr,{path:A,labelX:V,labelY:L,label:h,labelStyle:g,labelShowBg:x,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:b,style:v,markerEnd:N,markerStart:T,interactionWidth:M})});Lo.displayName="BezierEdge";const hf=j.createContext(null),Nw=hf.Provider;hf.Consumer;const ww=()=>j.useContext(hf),Sw=n=>"id"in n&&"source"in n&&"target"in n,Ew=({source:n,sourceHandle:r,target:i,targetHandle:o})=>`reactflow__edge-${n}${r||""}-${i}${o||""}`,Yd=(n,r)=>typeof n>"u"?"":typeof n=="string"?n:`${r?`${r}__`:""}${Object.keys(n).sort().map(o=>`${o}=${n[o]}`).join("&")}`,kw=(n,r)=>r.some(i=>i.source===n.source&&i.target===n.target&&(i.sourceHandle===n.sourceHandle||!i.sourceHandle&&!n.sourceHandle)&&(i.targetHandle===n.targetHandle||!i.targetHandle&&!n.targetHandle)),_w=(n,r)=>{if(!n.source||!n.target)return r;let i;return Sw(n)?i={...n}:i={...n,id:Ew(n)},kw(i,r)?r:r.concat(i)},Vd=({x:n,y:r},[i,o,u],f,[h,g])=>{const x={x:(n-i)/u,y:(r-o)/u};return f?{x:h*Math.round(x.x/h),y:g*Math.round(x.y/g)}:x},Sg=({x:n,y:r},[i,o,u])=>({x:n*u+i,y:r*u+o}),fs=(n,r=[0,0])=>{if(!n)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const i=(n.width??0)*r[0],o=(n.height??0)*r[1],u={x:n.position.x-i,y:n.position.y-o};return{...u,positionAbsolute:n.positionAbsolute?{x:n.positionAbsolute.x-i,y:n.positionAbsolute.y-o}:u}},Jo=(n,r=[0,0])=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const i=n.reduce((o,u)=>{const{x:f,y:h}=fs(u,r).positionAbsolute;return xg(o,Br({x:f,y:h,width:u.width||0,height:u.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return gg(i)},Eg=(n,r,[i,o,u]=[0,0,1],f=!1,h=!1,g=[0,0])=>{const x={x:(r.x-i)/u,y:(r.y-o)/u,width:r.width/u,height:r.height/u},m=[];return n.forEach(p=>{const{width:b,height:v,selectable:N=!0,hidden:T=!1}=p;if(h&&!N||T)return!1;const{positionAbsolute:_}=fs(p,g),M={x:_.x,y:_.y,width:b||0,height:v||0},A=Bd(x,M),V=typeof b>"u"||typeof v>"u"||b===null||v===null,L=f&&A>0,C=(b||0)*(v||0);(V||L||A>=C||p.dragging)&&m.push(p)}),m},kg=(n,r)=>{const i=n.map(o=>o.id);return r.filter(o=>i.includes(o.source)||i.includes(o.target))},_g=(n,r,i,o,u,f=.1)=>{const h=r/(n.width*(1+f)),g=i/(n.height*(1+f)),x=Math.min(h,g),m=gl(x,o,u),p=n.x+n.width/2,b=n.y+n.height/2,v=r/2-p*m,N=i/2-b*m;return{x:v,y:N,zoom:m}},os=(n,r=0)=>n.transition().duration(r);function Qx(n,r,i,o){return(r[i]||[]).reduce((u,f)=>(`${n.id}-${f.id}-${i}`!==o&&u.push({id:f.id||null,type:i,nodeId:n.id,x:(n.positionAbsolute?.x??0)+f.x+f.width/2,y:(n.positionAbsolute?.y??0)+f.y+f.height/2}),u),[])}function Cw(n,r,i,o,u,f){const{x:h,y:g}=Ua(n),m=r.elementsFromPoint(h,g).find(T=>T.classList.contains("react-flow__handle"));if(m){const T=m.getAttribute("data-nodeid");if(T){const _=mf(void 0,m),M=m.getAttribute("data-handleid"),A=f({nodeId:T,id:M,type:_});if(A){const V=u.find(L=>L.nodeId===T&&L.type===_&&L.id===M);return{handle:{id:M,type:_,nodeId:T,x:V?.x||i.x,y:V?.y||i.y},validHandleResult:A}}}}let p=[],b=1/0;if(u.forEach(T=>{const _=Math.sqrt((T.x-i.x)**2+(T.y-i.y)**2);if(_<=o){const M=f(T);_<=b&&(_<b?p=[{handle:T,validHandleResult:M}]:_===b&&p.push({handle:T,validHandleResult:M}),b=_)}}),!p.length)return{handle:null,validHandleResult:Cg()};if(p.length===1)return p[0];const v=p.some(({validHandleResult:T})=>T.isValid),N=p.some(({handle:T})=>T.type==="target");return p.find(({handle:T,validHandleResult:_})=>N?T.type==="target":v?_.isValid:!0)||p[0]}const Tw={source:null,target:null,sourceHandle:null,targetHandle:null},Cg=()=>({handleDomNode:null,isValid:!1,connection:Tw,endHandle:null});function Tg(n,r,i,o,u,f,h){const g=u==="target",x=h.querySelector(`.react-flow__handle[data-id="${n?.nodeId}-${n?.id}-${n?.type}"]`),m={...Cg(),handleDomNode:x};if(x){const p=mf(void 0,x),b=x.getAttribute("data-nodeid"),v=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),T=x.classList.contains("connectableend"),_={source:g?b:i,sourceHandle:g?v:o,target:g?i:b,targetHandle:g?o:v};m.connection=_,N&&T&&(r===ps.Strict?g&&p==="source"||!g&&p==="target":b!==i||v!==o)&&(m.endHandle={nodeId:b,handleId:v,type:p},m.isValid=f(_))}return m}function Mw({nodes:n,nodeId:r,handleId:i,handleType:o}){return n.reduce((u,f)=>{if(f[ct]){const{handleBounds:h}=f[ct];let g=[],x=[];h&&(g=Qx(f,h,"source",`${r}-${i}-${o}`),x=Qx(f,h,"target",`${r}-${i}-${o}`)),u.push(...g,...x)}return u},[])}function mf(n,r){return n||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function bd(n){n?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Aw(n,r){let i=null;return r?i="valid":n&&!r&&(i="invalid"),i}function Mg({event:n,handleId:r,nodeId:i,onConnect:o,isTarget:u,getState:f,setState:h,isValidConnection:g,edgeUpdaterType:x,onReconnectEnd:m}){const p=pg(n.target),{connectionMode:b,domNode:v,autoPanOnConnect:N,connectionRadius:T,onConnectStart:_,panBy:M,getNodes:A,cancelConnection:V}=f();let L=0,C;const{x:D,y:W}=Ua(n),X=p?.elementFromPoint(D,W),ie=mf(x,X),I=v?.getBoundingClientRect();if(!I||!ie)return;let K,ne=Ua(n,I),ee=!1,se=null,S=!1,U=null;const k=Mw({nodes:A(),nodeId:i,handleId:r,handleType:ie}),H=()=>{if(!N)return;const[E,$]=mg(ne,I);M({x:E,y:$}),L=requestAnimationFrame(H)};h({connectionPosition:ne,connectionStatus:null,connectionNodeId:i,connectionHandleId:r,connectionHandleType:ie,connectionStartHandle:{nodeId:i,handleId:r,type:ie},connectionEndHandle:null}),_?.(n,{nodeId:i,handleId:r,handleType:ie});function O(E){const{transform:$}=f();ne=Ua(E,I);const{handle:Z,validHandleResult:ae}=Cw(E,p,Vd(ne,$,!1,[1,1]),T,k,oe=>Tg(oe,b,i,r,u?"target":"source",g,p));if(C=Z,ee||(H(),ee=!0),U=ae.handleDomNode,se=ae.connection,S=ae.isValid,h({connectionPosition:C&&S?Sg({x:C.x,y:C.y},$):ne,connectionStatus:Aw(!!C,S),connectionEndHandle:ae.endHandle}),!C&&!S&&!U)return bd(K);se.source!==se.target&&U&&(bd(K),K=U,U.classList.add("connecting","react-flow__handle-connecting"),U.classList.toggle("valid",S),U.classList.toggle("react-flow__handle-valid",S))}function z(E){(C||U)&&se&&S&&o?.(se),f().onConnectEnd?.(E),x&&m?.(E),bd(K),V(),cancelAnimationFrame(L),ee=!1,S=!1,se=null,U=null,p.removeEventListener("mousemove",O),p.removeEventListener("mouseup",z),p.removeEventListener("touchmove",O),p.removeEventListener("touchend",z)}p.addEventListener("mousemove",O),p.addEventListener("mouseup",z),p.addEventListener("touchmove",O),p.addEventListener("touchend",z)}const Kx=()=>!0,Rw=n=>({connectionStartHandle:n.connectionStartHandle,connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName}),zw=(n,r,i)=>o=>{const{connectionStartHandle:u,connectionEndHandle:f,connectionClickStartHandle:h}=o;return{connecting:u?.nodeId===n&&u?.handleId===r&&u?.type===i||f?.nodeId===n&&f?.handleId===r&&f?.type===i,clickConnecting:h?.nodeId===n&&h?.handleId===r&&h?.type===i}},Ag=j.forwardRef(({type:n="source",position:r=xe.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:h,onConnect:g,children:x,className:m,onMouseDown:p,onTouchStart:b,...v},N)=>{const T=h||null,_=n==="target",M=Nt(),A=ww(),{connectOnClick:V,noPanClassName:L}=tt(Rw,Ct),{connecting:C,clickConnecting:D}=tt(zw(A,T,n),Ct);A||M.getState().onError?.("010",sa.error010());const W=I=>{const{defaultEdgeOptions:K,onConnect:ne,hasDefaultEdges:ee}=M.getState(),se={...K,...I};if(ee){const{edges:S,setEdges:U}=M.getState();U(_w(se,S))}ne?.(se),g?.(se)},X=I=>{if(!A)return;const K=bg(I);u&&(K&&I.button===0||!K)&&Mg({event:I,handleId:T,nodeId:A,onConnect:W,isTarget:_,getState:M.getState,setState:M.setState,isValidConnection:i||M.getState().isValidConnection||Kx}),K?p?.(I):b?.(I)},ie=I=>{const{onClickConnectStart:K,onClickConnectEnd:ne,connectionClickStartHandle:ee,connectionMode:se,isValidConnection:S}=M.getState();if(!A||!ee&&!u)return;if(!ee){K?.(I,{nodeId:A,handleId:T,handleType:n}),M.setState({connectionClickStartHandle:{nodeId:A,type:n,handleId:T}});return}const U=pg(I.target),k=i||S||Kx,{connection:H,isValid:O}=Tg({nodeId:A,id:T,type:n},se,ee.nodeId,ee.handleId||null,ee.type,k,U);O&&W(H),ne?.(I),M.setState({connectionClickStartHandle:null})};return le.createElement("div",{"data-handleid":T,"data-nodeid":A,"data-handlepos":r,"data-id":`${A}-${T}-${n}`,className:$t(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",L,m,{source:!_,target:_,connectable:o,connectablestart:u,connectableend:f,connecting:D,connectionindicator:o&&(u&&!C||f&&C)}]),onMouseDown:X,onTouchStart:X,onClick:V?ie:void 0,ref:N,...v},x)});Ag.displayName="Handle";var jt=j.memo(Ag);const Rg=({data:n,isConnectable:r,targetPosition:i=xe.Top,sourcePosition:o=xe.Bottom})=>le.createElement(le.Fragment,null,le.createElement(jt,{type:"target",position:i,isConnectable:r}),n?.label,le.createElement(jt,{type:"source",position:o,isConnectable:r}));Rg.displayName="DefaultNode";var Gd=j.memo(Rg);const zg=({data:n,isConnectable:r,sourcePosition:i=xe.Bottom})=>le.createElement(le.Fragment,null,n?.label,le.createElement(jt,{type:"source",position:i,isConnectable:r}));zg.displayName="InputNode";var Og=j.memo(zg);const Dg=({data:n,isConnectable:r,targetPosition:i=xe.Top})=>le.createElement(le.Fragment,null,le.createElement(jt,{type:"target",position:i,isConnectable:r}),n?.label);Dg.displayName="OutputNode";var Hg=j.memo(Dg);const pf=()=>null;pf.displayName="GroupNode";const Ow=n=>({selectedNodes:n.getNodes().filter(r=>r.selected),selectedEdges:n.edges.filter(r=>r.selected).map(r=>({...r}))}),jo=n=>n.id;function Dw(n,r){return Ct(n.selectedNodes.map(jo),r.selectedNodes.map(jo))&&Ct(n.selectedEdges.map(jo),r.selectedEdges.map(jo))}const $g=j.memo(({onSelectionChange:n})=>{const r=Nt(),{selectedNodes:i,selectedEdges:o}=tt(Ow,Dw);return j.useEffect(()=>{const u={nodes:i,edges:o};n?.(u),r.getState().onSelectionChange.forEach(f=>f(u))},[i,o,n]),null});$g.displayName="SelectionListener";const Hw=n=>!!n.onSelectionChange;function $w({onSelectionChange:n}){const r=tt(Hw);return n||r?le.createElement($g,{onSelectionChange:n}):null}const Uw=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset});function tl(n,r){j.useEffect(()=>{typeof n<"u"&&r(n)},[n])}function Ue(n,r,i){j.useEffect(()=>{typeof r<"u"&&i({[n]:r})},[r])}const Bw=({nodes:n,edges:r,defaultNodes:i,defaultEdges:o,onConnect:u,onConnectStart:f,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:x,nodesDraggable:m,nodesConnectable:p,nodesFocusable:b,edgesFocusable:v,edgesUpdatable:N,elevateNodesOnSelect:T,minZoom:_,maxZoom:M,nodeExtent:A,onNodesChange:V,onEdgesChange:L,elementsSelectable:C,connectionMode:D,snapGrid:W,snapToGrid:X,translateExtent:ie,connectOnClick:I,defaultEdgeOptions:K,fitView:ne,fitViewOptions:ee,onNodesDelete:se,onEdgesDelete:S,onNodeDrag:U,onNodeDragStart:k,onNodeDragStop:H,onSelectionDrag:O,onSelectionDragStart:z,onSelectionDragStop:E,noPanClassName:$,nodeOrigin:Z,rfId:ae,autoPanOnConnect:oe,autoPanOnNodeDrag:he,onError:me,connectionRadius:Se,isValidConnection:ve,nodeDragThreshold:Ae})=>{const{setNodes:Re,setEdges:We,setDefaultNodesAndEdges:Te,setMinZoom:be,setMaxZoom:q,setTranslateExtent:Y,setNodeExtent:ue,reset:re}=tt(Uw,Ct),P=Nt();return j.useEffect(()=>{const Ee=o?.map(ge=>({...ge,...K}));return Te(i,Ee),()=>{re()}},[]),Ue("defaultEdgeOptions",K,P.setState),Ue("connectionMode",D,P.setState),Ue("onConnect",u,P.setState),Ue("onConnectStart",f,P.setState),Ue("onConnectEnd",h,P.setState),Ue("onClickConnectStart",g,P.setState),Ue("onClickConnectEnd",x,P.setState),Ue("nodesDraggable",m,P.setState),Ue("nodesConnectable",p,P.setState),Ue("nodesFocusable",b,P.setState),Ue("edgesFocusable",v,P.setState),Ue("edgesUpdatable",N,P.setState),Ue("elementsSelectable",C,P.setState),Ue("elevateNodesOnSelect",T,P.setState),Ue("snapToGrid",X,P.setState),Ue("snapGrid",W,P.setState),Ue("onNodesChange",V,P.setState),Ue("onEdgesChange",L,P.setState),Ue("connectOnClick",I,P.setState),Ue("fitViewOnInit",ne,P.setState),Ue("fitViewOnInitOptions",ee,P.setState),Ue("onNodesDelete",se,P.setState),Ue("onEdgesDelete",S,P.setState),Ue("onNodeDrag",U,P.setState),Ue("onNodeDragStart",k,P.setState),Ue("onNodeDragStop",H,P.setState),Ue("onSelectionDrag",O,P.setState),Ue("onSelectionDragStart",z,P.setState),Ue("onSelectionDragStop",E,P.setState),Ue("noPanClassName",$,P.setState),Ue("nodeOrigin",Z,P.setState),Ue("rfId",ae,P.setState),Ue("autoPanOnConnect",oe,P.setState),Ue("autoPanOnNodeDrag",he,P.setState),Ue("onError",me,P.setState),Ue("connectionRadius",Se,P.setState),Ue("isValidConnection",ve,P.setState),Ue("nodeDragThreshold",Ae,P.setState),tl(n,Re),tl(r,We),tl(_,be),tl(M,q),tl(ie,Y),tl(A,ue),null},Jx={display:"none"},qw={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ug="react-flow__node-desc",Bg="react-flow__edge-desc",Lw="react-flow__aria-live",Yw=n=>n.ariaLiveMessage;function Vw({rfId:n}){const r=tt(Yw);return le.createElement("div",{id:`${Lw}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:qw},r)}function Gw({rfId:n,disableKeyboardA11y:r}){return le.createElement(le.Fragment,null,le.createElement("div",{id:`${Ug}-${n}`,style:Jx},"Press enter or space to select a node.",!r&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),le.createElement("div",{id:`${Bg}-${n}`,style:Jx},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!r&&le.createElement(Vw,{rfId:n}))}var Lr=(n=null,r={actInsideInputWithModifier:!0})=>{const[i,o]=j.useState(!1),u=j.useRef(!1),f=j.useRef(new Set([])),[h,g]=j.useMemo(()=>{if(n!==null){const m=(Array.isArray(n)?n:[n]).filter(b=>typeof b=="string").map(b=>b.split("+")),p=m.reduce((b,v)=>b.concat(...v),[]);return[m,p]}return[[],[]]},[n]);return j.useEffect(()=>{const x=typeof document<"u"?document:null,m=r?.target||x;if(n!==null){const p=N=>{if(u.current=N.ctrlKey||N.metaKey||N.shiftKey,(!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(N))return!1;const _=Fx(N.code,g);f.current.add(N[_]),Ix(h,f.current,!1)&&(N.preventDefault(),o(!0))},b=N=>{if((!u.current||u.current&&!r.actInsideInputWithModifier)&&qd(N))return!1;const _=Fx(N.code,g);Ix(h,f.current,!0)?(o(!1),f.current.clear()):f.current.delete(N[_]),N.key==="Meta"&&f.current.clear(),u.current=!1},v=()=>{f.current.clear(),o(!1)};return m?.addEventListener("keydown",p),m?.addEventListener("keyup",b),window.addEventListener("blur",v),()=>{m?.removeEventListener("keydown",p),m?.removeEventListener("keyup",b),window.removeEventListener("blur",v)}}},[n,o]),i};function Ix(n,r,i){return n.filter(o=>i||o.length===r.size).some(o=>o.every(u=>r.has(u)))}function Fx(n,r){return r.includes(n)?"code":"key"}function qg(n,r,i,o){const u=n.parentNode||n.parentId;if(!u)return i;const f=r.get(u),h=fs(f,o);return qg(f,r,{x:(i.x??0)+h.x,y:(i.y??0)+h.y,z:(f[ct]?.z??0)>(i.z??0)?f[ct]?.z??0:i.z??0},o)}function Lg(n,r,i){n.forEach(o=>{const u=o.parentNode||o.parentId;if(u&&!n.has(u))throw new Error(`Parent node ${u} not found`);if(u||i?.[o.id]){const{x:f,y:h,z:g}=qg(o,n,{...o.position,z:o[ct]?.z??0},r);o.positionAbsolute={x:f,y:h},o[ct].z=g,i?.[o.id]&&(o[ct].isParent=!0)}})}function vd(n,r,i,o){const u=new Map,f={},h=o?1e3:0;return n.forEach(g=>{const x=(yn(g.zIndex)?g.zIndex:0)+(g.selected?h:0),m=r.get(g.id),p={...g,positionAbsolute:{x:g.position.x,y:g.position.y}},b=g.parentNode||g.parentId;b&&(f[b]=!0);const v=m?.type&&m?.type!==g.type;Object.defineProperty(p,ct,{enumerable:!1,value:{handleBounds:v?void 0:m?.[ct]?.handleBounds,z:x}}),u.set(g.id,p)}),Lg(u,i,f),u}function Yg(n,r={}){const{getNodes:i,width:o,height:u,minZoom:f,maxZoom:h,d3Zoom:g,d3Selection:x,fitViewOnInitDone:m,fitViewOnInit:p,nodeOrigin:b}=n(),v=r.initial&&!m&&p;if(g&&x&&(v||!r.initial)){const T=i().filter(M=>{const A=r.includeHiddenNodes?M.width&&M.height:!M.hidden;return r.nodes?.length?A&&r.nodes.some(V=>V.id===M.id):A}),_=T.every(M=>M.width&&M.height);if(T.length>0&&_){const M=Jo(T,b),{x:A,y:V,zoom:L}=_g(M,o,u,r.minZoom??f,r.maxZoom??h,r.padding??.1),C=ta.translate(A,V).scale(L);return typeof r.duration=="number"&&r.duration>0?g.transform(os(x,r.duration),C):g.transform(x,C),!0}}return!1}function Xw(n,r){return n.forEach(i=>{const o=r.get(i.id);o&&r.set(o.id,{...o,[ct]:o[ct],selected:i.selected})}),new Map(r)}function Zw(n,r){return r.map(i=>{const o=n.find(u=>u.id===i.id);return o&&(i.selected=o.selected),i})}function No({changedNodes:n,changedEdges:r,get:i,set:o}){const{nodeInternals:u,edges:f,onNodesChange:h,onEdgesChange:g,hasDefaultNodes:x,hasDefaultEdges:m}=i();n?.length&&(x&&o({nodeInternals:Xw(n,u)}),h?.(n)),r?.length&&(m&&o({edges:Zw(r,f)}),g?.(r))}const nl=()=>{},Ww={zoomIn:nl,zoomOut:nl,zoomTo:nl,getZoom:()=>1,setViewport:nl,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:nl,fitBounds:nl,project:n=>n,screenToFlowPosition:n=>n,flowToScreenPosition:n=>n,viewportInitialized:!1},Qw=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection}),Kw=()=>{const n=Nt(),{d3Zoom:r,d3Selection:i}=tt(Qw,Ct);return j.useMemo(()=>i&&r?{zoomIn:u=>r.scaleBy(os(i,u?.duration),1.2),zoomOut:u=>r.scaleBy(os(i,u?.duration),1/1.2),zoomTo:(u,f)=>r.scaleTo(os(i,f?.duration),u),getZoom:()=>n.getState().transform[2],setViewport:(u,f)=>{const[h,g,x]=n.getState().transform,m=ta.translate(u.x??h,u.y??g).scale(u.zoom??x);r.transform(os(i,f?.duration),m)},getViewport:()=>{const[u,f,h]=n.getState().transform;return{x:u,y:f,zoom:h}},fitView:u=>Yg(n.getState,u),setCenter:(u,f,h)=>{const{width:g,height:x,maxZoom:m}=n.getState(),p=typeof h?.zoom<"u"?h.zoom:m,b=g/2-u*p,v=x/2-f*p,N=ta.translate(b,v).scale(p);r.transform(os(i,h?.duration),N)},fitBounds:(u,f)=>{const{width:h,height:g,minZoom:x,maxZoom:m}=n.getState(),{x:p,y:b,zoom:v}=_g(u,h,g,x,m,f?.padding??.1),N=ta.translate(p,b).scale(v);r.transform(os(i,f?.duration),N)},project:u=>{const{transform:f,snapToGrid:h,snapGrid:g}=n.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Vd(u,f,h,g)},screenToFlowPosition:u=>{const{transform:f,snapToGrid:h,snapGrid:g,domNode:x}=n.getState();if(!x)return u;const{x:m,y:p}=x.getBoundingClientRect(),b={x:u.x-m,y:u.y-p};return Vd(b,f,h,g)},flowToScreenPosition:u=>{const{transform:f,domNode:h}=n.getState();if(!h)return u;const{x:g,y:x}=h.getBoundingClientRect(),m=Sg(u,f);return{x:m.x+g,y:m.y+x}},viewportInitialized:!0}:Ww,[r,i])};function xf(){const n=Kw(),r=Nt(),i=j.useCallback(()=>r.getState().getNodes().map(_=>({..._})),[]),o=j.useCallback(_=>r.getState().nodeInternals.get(_),[]),u=j.useCallback(()=>{const{edges:_=[]}=r.getState();return _.map(M=>({...M}))},[]),f=j.useCallback(_=>{const{edges:M=[]}=r.getState();return M.find(A=>A.id===_)},[]),h=j.useCallback(_=>{const{getNodes:M,setNodes:A,hasDefaultNodes:V,onNodesChange:L}=r.getState(),C=M(),D=typeof _=="function"?_(C):_;if(V)A(D);else if(L){const W=D.length===0?C.map(X=>({type:"remove",id:X.id})):D.map(X=>({item:X,type:"reset"}));L(W)}},[]),g=j.useCallback(_=>{const{edges:M=[],setEdges:A,hasDefaultEdges:V,onEdgesChange:L}=r.getState(),C=typeof _=="function"?_(M):_;if(V)A(C);else if(L){const D=C.length===0?M.map(W=>({type:"remove",id:W.id})):C.map(W=>({item:W,type:"reset"}));L(D)}},[]),x=j.useCallback(_=>{const M=Array.isArray(_)?_:[_],{getNodes:A,setNodes:V,hasDefaultNodes:L,onNodesChange:C}=r.getState();if(L){const W=[...A(),...M];V(W)}else if(C){const D=M.map(W=>({item:W,type:"add"}));C(D)}},[]),m=j.useCallback(_=>{const M=Array.isArray(_)?_:[_],{edges:A=[],setEdges:V,hasDefaultEdges:L,onEdgesChange:C}=r.getState();if(L)V([...A,...M]);else if(C){const D=M.map(W=>({item:W,type:"add"}));C(D)}},[]),p=j.useCallback(()=>{const{getNodes:_,edges:M=[],transform:A}=r.getState(),[V,L,C]=A;return{nodes:_().map(D=>({...D})),edges:M.map(D=>({...D})),viewport:{x:V,y:L,zoom:C}}},[]),b=j.useCallback(({nodes:_,edges:M})=>{const{nodeInternals:A,getNodes:V,edges:L,hasDefaultNodes:C,hasDefaultEdges:D,onNodesDelete:W,onEdgesDelete:X,onNodesChange:ie,onEdgesChange:I}=r.getState(),K=(_||[]).map(U=>U.id),ne=(M||[]).map(U=>U.id),ee=V().reduce((U,k)=>{const H=k.parentNode||k.parentId,O=!K.includes(k.id)&&H&&U.find(E=>E.id===H);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(K.includes(k.id)||O)&&U.push(k),U},[]),se=L.filter(U=>typeof U.deletable=="boolean"?U.deletable:!0),S=se.filter(U=>ne.includes(U.id));if(ee||S){const U=kg(ee,se),k=[...S,...U],H=k.reduce((O,z)=>(O.includes(z.id)||O.push(z.id),O),[]);if((D||C)&&(D&&r.setState({edges:L.filter(O=>!H.includes(O.id))}),C&&(ee.forEach(O=>{A.delete(O.id)}),r.setState({nodeInternals:new Map(A)}))),H.length>0&&(X?.(k),I&&I(H.map(O=>({id:O,type:"remove"})))),ee.length>0&&(W?.(ee),ie)){const O=ee.map(z=>({id:z.id,type:"remove"}));ie(O)}}},[]),v=j.useCallback(_=>{const M=pw(_),A=M?null:r.getState().nodeInternals.get(_.id);return!M&&!A?[null,null,M]:[M?_:Vx(A),A,M]},[]),N=j.useCallback((_,M=!0,A)=>{const[V,L,C]=v(_);return V?(A||r.getState().getNodes()).filter(D=>{if(!C&&(D.id===L.id||!D.positionAbsolute))return!1;const W=Vx(D),X=Bd(W,V);return M&&X>0||X>=V.width*V.height}):[]},[]),T=j.useCallback((_,M,A=!0)=>{const[V]=v(_);if(!V)return!1;const L=Bd(V,M);return A&&L>0||L>=V.width*V.height},[]);return j.useMemo(()=>({...n,getNodes:i,getNode:o,getEdges:u,getEdge:f,setNodes:h,setEdges:g,addNodes:x,addEdges:m,toObject:p,deleteElements:b,getIntersectingNodes:N,isNodeIntersecting:T}),[n,i,o,u,f,h,g,x,m,p,b,N,T])}const Jw={actInsideInputWithModifier:!1};var Iw=({deleteKeyCode:n,multiSelectionKeyCode:r})=>{const i=Nt(),{deleteElements:o}=xf(),u=Lr(n,Jw),f=Lr(r);j.useEffect(()=>{if(u){const{edges:h,getNodes:g}=i.getState(),x=g().filter(p=>p.selected),m=h.filter(p=>p.selected);o({nodes:x,edges:m}),i.setState({nodesSelectionActive:!1})}},[u]),j.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])};function Fw(n){const r=Nt();j.useEffect(()=>{let i;const o=()=>{if(!n.current)return;const u=of(n.current);(u.height===0||u.width===0)&&r.getState().onError?.("004",sa.error004()),r.setState({width:u.width||500,height:u.height||500})};return o(),window.addEventListener("resize",o),n.current&&(i=new ResizeObserver(()=>o()),i.observe(n.current)),()=>{window.removeEventListener("resize",o),i&&n.current&&i.unobserve(n.current)}},[])}const gf={position:"absolute",width:"100%",height:"100%",top:0,left:0},Pw=(n,r)=>n.x!==r.x||n.y!==r.y||n.zoom!==r.k,wo=n=>({x:n.x,y:n.y,zoom:n.k}),al=(n,r)=>n.target.closest(`.${r}`),Px=(n,r)=>r===2&&Array.isArray(n)&&n.includes(2),e0=n=>{const r=n.ctrlKey&&qo()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*r},eS=n=>({d3Zoom:n.d3Zoom,d3Selection:n.d3Selection,d3ZoomHandler:n.d3ZoomHandler,userSelectionActive:n.userSelectionActive}),tS=({onMove:n,onMoveStart:r,onMoveEnd:i,onPaneContextMenu:o,zoomOnScroll:u=!0,zoomOnPinch:f=!0,panOnScroll:h=!1,panOnScrollSpeed:g=.5,panOnScrollMode:x=us.Free,zoomOnDoubleClick:m=!0,elementsSelectable:p,panOnDrag:b=!0,defaultViewport:v,translateExtent:N,minZoom:T,maxZoom:_,zoomActivationKeyCode:M,preventScrolling:A=!0,children:V,noWheelClassName:L,noPanClassName:C})=>{const D=j.useRef(),W=Nt(),X=j.useRef(!1),ie=j.useRef(!1),I=j.useRef(null),K=j.useRef({x:0,y:0,zoom:0}),{d3Zoom:ne,d3Selection:ee,d3ZoomHandler:se,userSelectionActive:S}=tt(eS,Ct),U=Lr(M),k=j.useRef(0),H=j.useRef(!1),O=j.useRef();return Fw(I),j.useEffect(()=>{if(I.current){const z=I.current.getBoundingClientRect(),E=fg().scaleExtent([T,_]).translateExtent(N),$=gn(I.current).call(E),Z=ta.translate(v.x,v.y).scale(gl(v.zoom,T,_)),ae=[[0,0],[z.width,z.height]],oe=E.constrain()(Z,ae,N);E.transform($,oe),E.wheelDelta(e0),W.setState({d3Zoom:E,d3Selection:$,d3ZoomHandler:$.on("wheel.zoom"),transform:[oe.x,oe.y,oe.k],domNode:I.current.closest(".react-flow")})}},[]),j.useEffect(()=>{ee&&ne&&(h&&!U&&!S?ee.on("wheel.zoom",z=>{if(al(z,L))return!1;z.preventDefault(),z.stopImmediatePropagation();const E=ee.property("__zoom").k||1;if(z.ctrlKey&&f){const ve=Sn(z),Ae=e0(z),Re=E*Math.pow(2,Ae);ne.scaleTo(ee,Re,ve,z);return}const $=z.deltaMode===1?20:1;let Z=x===us.Vertical?0:z.deltaX*$,ae=x===us.Horizontal?0:z.deltaY*$;!qo()&&z.shiftKey&&x!==us.Vertical&&(Z=z.deltaY*$,ae=0),ne.translateBy(ee,-(Z/E)*g,-(ae/E)*g,{internal:!0});const oe=wo(ee.property("__zoom")),{onViewportChangeStart:he,onViewportChange:me,onViewportChangeEnd:Se}=W.getState();clearTimeout(O.current),H.current||(H.current=!0,r?.(z,oe),he?.(oe)),H.current&&(n?.(z,oe),me?.(oe),O.current=setTimeout(()=>{i?.(z,oe),Se?.(oe),H.current=!1},150))},{passive:!1}):typeof se<"u"&&ee.on("wheel.zoom",function(z,E){if(!A&&z.type==="wheel"&&!z.ctrlKey||al(z,L))return null;z.preventDefault(),se.call(this,z,E)},{passive:!1}))},[S,h,x,ee,ne,se,U,f,A,L,r,n,i]),j.useEffect(()=>{ne&&ne.on("start",z=>{if(!z.sourceEvent||z.sourceEvent.internal)return null;k.current=z.sourceEvent?.button;const{onViewportChangeStart:E}=W.getState(),$=wo(z.transform);X.current=!0,K.current=$,z.sourceEvent?.type==="mousedown"&&W.setState({paneDragging:!0}),E?.($),r?.(z.sourceEvent,$)})},[ne,r]),j.useEffect(()=>{ne&&(S&&!X.current?ne.on("zoom",null):S||ne.on("zoom",z=>{const{onViewportChange:E}=W.getState();if(W.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),ie.current=!!(o&&Px(b,k.current??0)),(n||E)&&!z.sourceEvent?.internal){const $=wo(z.transform);E?.($),n?.(z.sourceEvent,$)}}))},[S,ne,n,b,o]),j.useEffect(()=>{ne&&ne.on("end",z=>{if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:E}=W.getState();if(X.current=!1,W.setState({paneDragging:!1}),o&&Px(b,k.current??0)&&!ie.current&&o(z.sourceEvent),ie.current=!1,(i||E)&&Pw(K.current,z.transform)){const $=wo(z.transform);K.current=$,clearTimeout(D.current),D.current=setTimeout(()=>{E?.($),i?.(z.sourceEvent,$)},h?150:0)}})},[ne,h,b,i,o]),j.useEffect(()=>{ne&&ne.filter(z=>{const E=U||u,$=f&&z.ctrlKey;if((b===!0||Array.isArray(b)&&b.includes(1))&&z.button===1&&z.type==="mousedown"&&(al(z,"react-flow__node")||al(z,"react-flow__edge")))return!0;if(!b&&!E&&!h&&!m&&!f||S||!m&&z.type==="dblclick"||al(z,L)&&z.type==="wheel"||al(z,C)&&(z.type!=="wheel"||h&&z.type==="wheel"&&!U)||!f&&z.ctrlKey&&z.type==="wheel"||!E&&!h&&!$&&z.type==="wheel"||!b&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(b)&&!b.includes(z.button)&&z.type==="mousedown")return!1;const Z=Array.isArray(b)&&b.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&Z})},[S,ne,u,f,h,m,b,p,U]),le.createElement("div",{className:"react-flow__renderer",ref:I,style:gf},V)},nS=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function aS(){const{userSelectionActive:n,userSelectionRect:r}=tt(nS,Ct);return n&&r?le.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}function t0(n,r){const i=r.parentNode||r.parentId,o=n.find(u=>u.id===i);if(o){const u=r.position.x+r.width-o.width,f=r.position.y+r.height-o.height;if(u>0||f>0||r.position.x<0||r.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,u>0&&(o.style.width+=u),f>0&&(o.style.height+=f),r.position.x<0){const h=Math.abs(r.position.x);o.position.x=o.position.x-h,o.style.width+=h,r.position.x=0}if(r.position.y<0){const h=Math.abs(r.position.y);o.position.y=o.position.y-h,o.style.height+=h,r.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function Vg(n,r){if(n.some(o=>o.type==="reset"))return n.filter(o=>o.type==="reset").map(o=>o.item);const i=n.filter(o=>o.type==="add").map(o=>o.item);return r.reduce((o,u)=>{const f=n.filter(g=>g.id===u.id);if(f.length===0)return o.push(u),o;const h={...u};for(const g of f)if(g)switch(g.type){case"select":{h.selected=g.selected;break}case"position":{typeof g.position<"u"&&(h.position=g.position),typeof g.positionAbsolute<"u"&&(h.positionAbsolute=g.positionAbsolute),typeof g.dragging<"u"&&(h.dragging=g.dragging),h.expandParent&&t0(o,h);break}case"dimensions":{typeof g.dimensions<"u"&&(h.width=g.dimensions.width,h.height=g.dimensions.height),typeof g.updateStyle<"u"&&(h.style={...h.style||{},...g.dimensions}),typeof g.resizing=="boolean"&&(h.resizing=g.resizing),h.expandParent&&t0(o,h);break}case"remove":return o}return o.push(h),o},i)}function Gg(n,r){return Vg(n,r)}function sS(n,r){return Vg(n,r)}const Ha=(n,r)=>({id:n,type:"select",selected:r});function cl(n,r){return n.reduce((i,o)=>{const u=r.includes(o.id);return!o.selected&&u?(o.selected=!0,i.push(Ha(o.id,!0))):o.selected&&!u&&(o.selected=!1,i.push(Ha(o.id,!1))),i},[])}const jd=(n,r)=>i=>{i.target===r.current&&n?.(i)},lS=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}),Xg=j.memo(({isSelecting:n,selectionMode:r=qr.Full,panOnDrag:i,onSelectionStart:o,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:x,onPaneMouseMove:m,onPaneMouseLeave:p,children:b})=>{const v=j.useRef(null),N=Nt(),T=j.useRef(0),_=j.useRef(0),M=j.useRef(),{userSelectionActive:A,elementsSelectable:V,dragging:L}=tt(lS,Ct),C=()=>{N.setState({userSelectionActive:!1,userSelectionRect:null}),T.current=0,_.current=0},D=se=>{f?.(se),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},W=se=>{if(Array.isArray(i)&&i?.includes(2)){se.preventDefault();return}h?.(se)},X=g?se=>g(se):void 0,ie=se=>{const{resetSelectedElements:S,domNode:U}=N.getState();if(M.current=U?.getBoundingClientRect(),!V||!n||se.button!==0||se.target!==v.current||!M.current)return;const{x:k,y:H}=Ua(se,M.current);S(),N.setState({userSelectionRect:{width:0,height:0,startX:k,startY:H,x:k,y:H}}),o?.(se)},I=se=>{const{userSelectionRect:S,nodeInternals:U,edges:k,transform:H,onNodesChange:O,onEdgesChange:z,nodeOrigin:E,getNodes:$}=N.getState();if(!n||!M.current||!S)return;N.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Z=Ua(se,M.current),ae=S.startX??0,oe=S.startY??0,he={...S,x:Z.x<ae?Z.x:ae,y:Z.y<oe?Z.y:oe,width:Math.abs(Z.x-ae),height:Math.abs(Z.y-oe)},me=$(),Se=Eg(U,he,H,r===qr.Partial,!0,E),ve=kg(Se,k).map(Re=>Re.id),Ae=Se.map(Re=>Re.id);if(T.current!==Ae.length){T.current=Ae.length;const Re=cl(me,Ae);Re.length&&O?.(Re)}if(_.current!==ve.length){_.current=ve.length;const Re=cl(k,ve);Re.length&&z?.(Re)}N.setState({userSelectionRect:he})},K=se=>{if(se.button!==0)return;const{userSelectionRect:S}=N.getState();!A&&S&&se.target===v.current&&D?.(se),N.setState({nodesSelectionActive:T.current>0}),C(),u?.(se)},ne=se=>{A&&(N.setState({nodesSelectionActive:T.current>0}),u?.(se)),C()},ee=V&&(n||A);return le.createElement("div",{className:$t(["react-flow__pane",{dragging:L,selection:n}]),onClick:ee?void 0:jd(D,v),onContextMenu:jd(W,v),onWheel:jd(X,v),onMouseEnter:ee?void 0:x,onMouseDown:ee?ie:void 0,onMouseMove:ee?I:m,onMouseUp:ee?K:void 0,onMouseLeave:ee?ne:p,ref:v,style:gf},b,le.createElement(aS,null))});Xg.displayName="Pane";function Zg(n,r){const i=n.parentNode||n.parentId;if(!i)return!1;const o=r.get(i);return o?o.selected?!0:Zg(o,r):!1}function n0(n,r,i){let o=n;do{if(o?.matches(r))return!0;if(o===i.current)return!1;o=o.parentElement}while(o);return!1}function rS(n,r,i,o){return Array.from(n.values()).filter(u=>(u.selected||u.id===o)&&(!u.parentNode||u.parentId||!Zg(u,n))&&(u.draggable||r&&typeof u.draggable>"u")).map(u=>({id:u.id,position:u.position||{x:0,y:0},positionAbsolute:u.positionAbsolute||{x:0,y:0},distance:{x:i.x-(u.positionAbsolute?.x??0),y:i.y-(u.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:u.extent,parentNode:u.parentNode||u.parentId,parentId:u.parentNode||u.parentId,width:u.width,height:u.height,expandParent:u.expandParent}))}function iS(n,r){return!r||r==="parent"?r:[r[0],[r[1][0]-(n.width||0),r[1][1]-(n.height||0)]]}function Wg(n,r,i,o,u=[0,0],f){const h=iS(n,n.extent||o);let g=h;const x=n.parentNode||n.parentId;if(n.extent==="parent"&&!n.expandParent)if(x&&n.width&&n.height){const b=i.get(x),{x:v,y:N}=fs(b,u).positionAbsolute;g=b&&yn(v)&&yn(N)&&yn(b.width)&&yn(b.height)?[[v+n.width*u[0],N+n.height*u[1]],[v+b.width-n.width+n.width*u[0],N+b.height-n.height+n.height*u[1]]]:g}else f?.("005",sa.error005()),g=h;else if(n.extent&&x&&n.extent!=="parent"){const b=i.get(x),{x:v,y:N}=fs(b,u).positionAbsolute;g=[[n.extent[0][0]+v,n.extent[0][1]+N],[n.extent[1][0]+v,n.extent[1][1]+N]]}let m={x:0,y:0};if(x){const b=i.get(x);m=fs(b,u).positionAbsolute}const p=g&&g!=="parent"?cf(r,g):r;return{position:{x:p.x-m.x,y:p.y-m.y},positionAbsolute:p}}function Nd({nodeId:n,dragItems:r,nodeInternals:i}){const o=r.map(u=>({...i.get(u.id),position:u.position,positionAbsolute:u.positionAbsolute}));return[n?o.find(u=>u.id===n):o[0],o]}const a0=(n,r,i,o)=>{const u=r.querySelectorAll(n);if(!u||!u.length)return null;const f=Array.from(u),h=r.getBoundingClientRect(),g={x:h.width*o[0],y:h.height*o[1]};return f.map(x=>{const m=x.getBoundingClientRect();return{id:x.getAttribute("data-handleid"),position:x.getAttribute("data-handlepos"),x:(m.left-h.left-g.x)/i,y:(m.top-h.top-g.y)/i,...of(x)}})};function Er(n,r,i){return i===void 0?i:o=>{const u=r().nodeInternals.get(n);u&&i(o,{...u})}}function Xd({id:n,store:r,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:h,nodeInternals:g,onError:x}=r.getState(),m=g.get(n);if(!m){x?.("012",sa.error012(n));return}r.setState({nodesSelectionActive:!1}),m.selected?(i||m.selected&&h)&&(f({nodes:[m],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):u([n])}function oS(){const n=Nt();return j.useCallback(({sourceEvent:i})=>{const{transform:o,snapGrid:u,snapToGrid:f}=n.getState(),h=i.touches?i.touches[0].clientX:i.clientX,g=i.touches?i.touches[0].clientY:i.clientY,x={x:(h-o[0])/o[2],y:(g-o[1])/o[2]};return{xSnapped:f?u[0]*Math.round(x.x/u[0]):x.x,ySnapped:f?u[1]*Math.round(x.y/u[1]):x.y,...x}},[])}function wd(n){return(r,i,o)=>n?.(r,o)}function Qg({nodeRef:n,disabled:r=!1,noDragClassName:i,handleSelector:o,nodeId:u,isSelectable:f,selectNodesOnDrag:h}){const g=Nt(),[x,m]=j.useState(!1),p=j.useRef([]),b=j.useRef({x:null,y:null}),v=j.useRef(0),N=j.useRef(null),T=j.useRef({x:0,y:0}),_=j.useRef(null),M=j.useRef(!1),A=j.useRef(!1),V=j.useRef(!1),L=oS();return j.useEffect(()=>{if(n?.current){const C=gn(n.current),D=({x:ie,y:I})=>{const{nodeInternals:K,onNodeDrag:ne,onSelectionDrag:ee,updateNodePositions:se,nodeExtent:S,snapGrid:U,snapToGrid:k,nodeOrigin:H,onError:O}=g.getState();b.current={x:ie,y:I};let z=!1,E={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&S){const Z=Jo(p.current,H);E=Br(Z)}if(p.current=p.current.map(Z=>{const ae={x:ie-Z.distance.x,y:I-Z.distance.y};k&&(ae.x=U[0]*Math.round(ae.x/U[0]),ae.y=U[1]*Math.round(ae.y/U[1]));const oe=[[S[0][0],S[0][1]],[S[1][0],S[1][1]]];p.current.length>1&&S&&!Z.extent&&(oe[0][0]=Z.positionAbsolute.x-E.x+S[0][0],oe[1][0]=Z.positionAbsolute.x+(Z.width??0)-E.x2+S[1][0],oe[0][1]=Z.positionAbsolute.y-E.y+S[0][1],oe[1][1]=Z.positionAbsolute.y+(Z.height??0)-E.y2+S[1][1]);const he=Wg(Z,ae,K,oe,H,O);return z=z||Z.position.x!==he.position.x||Z.position.y!==he.position.y,Z.position=he.position,Z.positionAbsolute=he.positionAbsolute,Z}),!z)return;se(p.current,!0,!0),m(!0);const $=u?ne:wd(ee);if($&&_.current){const[Z,ae]=Nd({nodeId:u,dragItems:p.current,nodeInternals:K});$(_.current,Z,ae)}},W=()=>{if(!N.current)return;const[ie,I]=mg(T.current,N.current);if(ie!==0||I!==0){const{transform:K,panBy:ne}=g.getState();b.current.x=(b.current.x??0)-ie/K[2],b.current.y=(b.current.y??0)-I/K[2],ne({x:ie,y:I})&&D(b.current)}v.current=requestAnimationFrame(W)},X=ie=>{const{nodeInternals:I,multiSelectionActive:K,nodesDraggable:ne,unselectNodesAndEdges:ee,onNodeDragStart:se,onSelectionDragStart:S}=g.getState();A.current=!0;const U=u?se:wd(S);(!h||!f)&&!K&&u&&(I.get(u)?.selected||ee()),u&&f&&h&&Xd({id:u,store:g,nodeRef:n});const k=L(ie);if(b.current=k,p.current=rS(I,ne,k,u),U&&p.current){const[H,O]=Nd({nodeId:u,dragItems:p.current,nodeInternals:I});U(ie.sourceEvent,H,O)}};if(r)C.on(".drag",null);else{const ie=bN().on("start",I=>{const{domNode:K,nodeDragThreshold:ne}=g.getState();ne===0&&X(I),V.current=!1;const ee=L(I);b.current=ee,N.current=K?.getBoundingClientRect()||null,T.current=Ua(I.sourceEvent,N.current)}).on("drag",I=>{const K=L(I),{autoPanOnNodeDrag:ne,nodeDragThreshold:ee}=g.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(V.current=!0),!V.current){if(!M.current&&A.current&&ne&&(M.current=!0,W()),!A.current){const se=K.xSnapped-(b?.current?.x??0),S=K.ySnapped-(b?.current?.y??0);Math.sqrt(se*se+S*S)>ee&&X(I)}(b.current.x!==K.xSnapped||b.current.y!==K.ySnapped)&&p.current&&A.current&&(_.current=I.sourceEvent,T.current=Ua(I.sourceEvent,N.current),D(K))}}).on("end",I=>{if(!(!A.current||V.current)&&(m(!1),M.current=!1,A.current=!1,cancelAnimationFrame(v.current),p.current)){const{updateNodePositions:K,nodeInternals:ne,onNodeDragStop:ee,onSelectionDragStop:se}=g.getState(),S=u?ee:wd(se);if(K(p.current,!1,!1),S){const[U,k]=Nd({nodeId:u,dragItems:p.current,nodeInternals:ne});S(I.sourceEvent,U,k)}}}).filter(I=>{const K=I.target;return!I.button&&(!i||!n0(K,`.${i}`,n))&&(!o||n0(K,o,n))});return C.call(ie),()=>{C.on(".drag",null)}}}},[n,r,i,o,f,g,u,h,L]),x}function Kg(){const n=Nt();return j.useCallback(i=>{const{nodeInternals:o,nodeExtent:u,updateNodePositions:f,getNodes:h,snapToGrid:g,snapGrid:x,onError:m,nodesDraggable:p}=n.getState(),b=h().filter(V=>V.selected&&(V.draggable||p&&typeof V.draggable>"u")),v=g?x[0]:5,N=g?x[1]:5,T=i.isShiftPressed?4:1,_=i.x*v*T,M=i.y*N*T,A=b.map(V=>{if(V.positionAbsolute){const L={x:V.positionAbsolute.x+_,y:V.positionAbsolute.y+M};g&&(L.x=x[0]*Math.round(L.x/x[0]),L.y=x[1]*Math.round(L.y/x[1]));const{positionAbsolute:C,position:D}=Wg(V,L,o,u,void 0,m);V.position=D,V.positionAbsolute=C}return V});f(A,!0,!1)},[])}const ml={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var kr=n=>{const r=({id:i,type:o,data:u,xPos:f,yPos:h,xPosOrigin:g,yPosOrigin:x,selected:m,onClick:p,onMouseEnter:b,onMouseMove:v,onMouseLeave:N,onContextMenu:T,onDoubleClick:_,style:M,className:A,isDraggable:V,isSelectable:L,isConnectable:C,isFocusable:D,selectNodesOnDrag:W,sourcePosition:X,targetPosition:ie,hidden:I,resizeObserver:K,dragHandle:ne,zIndex:ee,isParent:se,noDragClassName:S,noPanClassName:U,initialized:k,disableKeyboardA11y:H,ariaLabel:O,rfId:z,hasHandleBounds:E})=>{const $=Nt(),Z=j.useRef(null),ae=j.useRef(null),oe=j.useRef(X),he=j.useRef(ie),me=j.useRef(o),Se=L||V||p||b||v||N,ve=Kg(),Ae=Er(i,$.getState,b),Re=Er(i,$.getState,v),We=Er(i,$.getState,N),Te=Er(i,$.getState,T),be=Er(i,$.getState,_),q=re=>{const{nodeDragThreshold:P}=$.getState();if(L&&(!W||!V||P>0)&&Xd({id:i,store:$,nodeRef:Z}),p){const Ee=$.getState().nodeInternals.get(i);Ee&&p(re,{...Ee})}},Y=re=>{if(!qd(re)&&!H)if(yg.includes(re.key)&&L){const P=re.key==="Escape";Xd({id:i,store:$,unselect:P,nodeRef:Z})}else V&&m&&Object.prototype.hasOwnProperty.call(ml,re.key)&&($.setState({ariaLiveMessage:`Moved selected node ${re.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~f}, y: ${~~h}`}),ve({x:ml[re.key].x,y:ml[re.key].y,isShiftPressed:re.shiftKey}))};j.useEffect(()=>()=>{ae.current&&(K?.unobserve(ae.current),ae.current=null)},[]),j.useEffect(()=>{if(Z.current&&!I){const re=Z.current;(!k||!E||ae.current!==re)&&(ae.current&&K?.unobserve(ae.current),K?.observe(re),ae.current=re)}},[I,k,E]),j.useEffect(()=>{const re=me.current!==o,P=oe.current!==X,Ee=he.current!==ie;Z.current&&(re||P||Ee)&&(re&&(me.current=o),P&&(oe.current=X),Ee&&(he.current=ie),$.getState().updateNodeDimensions([{id:i,nodeElement:Z.current,forceUpdate:!0}]))},[i,o,X,ie]);const ue=Qg({nodeRef:Z,disabled:I||!V,noDragClassName:S,handleSelector:ne,nodeId:i,isSelectable:L,selectNodesOnDrag:W});return I?null:le.createElement("div",{className:$t(["react-flow__node",`react-flow__node-${o}`,{[U]:V},A,{selected:m,selectable:L,parent:se,dragging:ue}]),ref:Z,style:{zIndex:ee,transform:`translate(${g}px,${x}px)`,pointerEvents:Se?"all":"none",visibility:k?"visible":"hidden",...M},"data-id":i,"data-testid":`rf__node-${i}`,onMouseEnter:Ae,onMouseMove:Re,onMouseLeave:We,onContextMenu:Te,onClick:q,onDoubleClick:be,onKeyDown:D?Y:void 0,tabIndex:D?0:void 0,role:D?"button":void 0,"aria-describedby":H?void 0:`${Ug}-${z}`,"aria-label":O},le.createElement(Nw,{value:i},le.createElement(n,{id:i,data:u,type:o,xPos:f,yPos:h,selected:m,isConnectable:C,sourcePosition:X,targetPosition:ie,dragging:ue,dragHandle:ne,zIndex:ee})))};return r.displayName="NodeWrapper",j.memo(r)};const cS=n=>{const r=n.getNodes().filter(i=>i.selected);return{...Jo(r,n.nodeOrigin),transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`,userSelectionActive:n.userSelectionActive}};function uS({onSelectionContextMenu:n,noPanClassName:r,disableKeyboardA11y:i}){const o=Nt(),{width:u,height:f,x:h,y:g,transformString:x,userSelectionActive:m}=tt(cS,Ct),p=Kg(),b=j.useRef(null);if(j.useEffect(()=>{i||b.current?.focus({preventScroll:!0})},[i]),Qg({nodeRef:b}),m||!u||!f)return null;const v=n?T=>{const _=o.getState().getNodes().filter(M=>M.selected);n(T,_)}:void 0,N=T=>{Object.prototype.hasOwnProperty.call(ml,T.key)&&p({x:ml[T.key].x,y:ml[T.key].y,isShiftPressed:T.shiftKey})};return le.createElement("div",{className:$t(["react-flow__nodesselection","react-flow__container",r]),style:{transform:x}},le.createElement("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:i?void 0:-1,onKeyDown:i?void 0:N,style:{width:u,height:f,top:g,left:h}}))}var dS=j.memo(uS);const fS=n=>n.nodesSelectionActive,Jg=({children:n,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,deleteKeyCode:g,onMove:x,onMoveStart:m,onMoveEnd:p,selectionKeyCode:b,selectionOnDrag:v,selectionMode:N,onSelectionStart:T,onSelectionEnd:_,multiSelectionKeyCode:M,panActivationKeyCode:A,zoomActivationKeyCode:V,elementsSelectable:L,zoomOnScroll:C,zoomOnPinch:D,panOnScroll:W,panOnScrollSpeed:X,panOnScrollMode:ie,zoomOnDoubleClick:I,panOnDrag:K,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,preventScrolling:U,onSelectionContextMenu:k,noWheelClassName:H,noPanClassName:O,disableKeyboardA11y:z})=>{const E=tt(fS),$=Lr(b),Z=Lr(A),ae=Z||K,oe=Z||W,he=$||v&&ae!==!0;return Iw({deleteKeyCode:g,multiSelectionKeyCode:M}),le.createElement(tS,{onMove:x,onMoveStart:m,onMoveEnd:p,onPaneContextMenu:f,elementsSelectable:L,zoomOnScroll:C,zoomOnPinch:D,panOnScroll:oe,panOnScrollSpeed:X,panOnScrollMode:ie,zoomOnDoubleClick:I,panOnDrag:!$&&ae,defaultViewport:ne,translateExtent:ee,minZoom:se,maxZoom:S,zoomActivationKeyCode:V,preventScrolling:U,noWheelClassName:H,noPanClassName:O},le.createElement(Xg,{onSelectionStart:T,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:h,panOnDrag:ae,isSelecting:!!he,selectionMode:N},n,E&&le.createElement(dS,{onSelectionContextMenu:k,noPanClassName:O,disableKeyboardA11y:z})))};Jg.displayName="FlowRenderer";var hS=j.memo(Jg);function mS(n){return tt(j.useCallback(i=>n?Eg(i.nodeInternals,{x:0,y:0,width:i.width,height:i.height},i.transform,!0):i.getNodes(),[n]))}function pS(n){const r={input:kr(n.input||Og),default:kr(n.default||Gd),output:kr(n.output||Hg),group:kr(n.group||pf)},i={},o=Object.keys(n).filter(u=>!["input","default","output","group"].includes(u)).reduce((u,f)=>(u[f]=kr(n[f]||Gd),u),i);return{...r,...o}}const xS=({x:n,y:r,width:i,height:o,origin:u})=>!i||!o?{x:n,y:r}:u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:n,y:r}:{x:n-i*u[0],y:r-o*u[1]},gS=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,updateNodeDimensions:n.updateNodeDimensions,onError:n.onError}),Ig=n=>{const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:u,updateNodeDimensions:f,onError:h}=tt(gS,Ct),g=mS(n.onlyRenderVisibleElements),x=j.useRef(),m=j.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(b=>{const v=b.map(N=>({id:N.target.getAttribute("data-id"),nodeElement:N.target,forceUpdate:!0}));f(v)});return x.current=p,p},[]);return j.useEffect(()=>()=>{x?.current?.disconnect()},[]),le.createElement("div",{className:"react-flow__nodes",style:gf},g.map(p=>{let b=p.type||"default";n.nodeTypes[b]||(h?.("003",sa.error003(b)),b="default");const v=n.nodeTypes[b]||n.nodeTypes.default,N=!!(p.draggable||r&&typeof p.draggable>"u"),T=!!(p.selectable||u&&typeof p.selectable>"u"),_=!!(p.connectable||i&&typeof p.connectable>"u"),M=!!(p.focusable||o&&typeof p.focusable>"u"),A=n.nodeExtent?cf(p.positionAbsolute,n.nodeExtent):p.positionAbsolute,V=A?.x??0,L=A?.y??0,C=xS({x:V,y:L,width:p.width??0,height:p.height??0,origin:n.nodeOrigin});return le.createElement(v,{key:p.id,id:p.id,className:p.className,style:p.style,type:b,data:p.data,sourcePosition:p.sourcePosition||xe.Bottom,targetPosition:p.targetPosition||xe.Top,hidden:p.hidden,xPos:V,yPos:L,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:n.selectNodesOnDrag,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,selected:!!p.selected,isDraggable:N,isSelectable:T,isConnectable:_,isFocusable:M,resizeObserver:m,dragHandle:p.dragHandle,zIndex:p[ct]?.z??0,isParent:!!p[ct]?.isParent,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,initialized:!!p.width&&!!p.height,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!p[ct]?.handleBounds})}))};Ig.displayName="NodeRenderer";var yS=j.memo(Ig);const bS=(n,r,i)=>i===xe.Left?n-r:i===xe.Right?n+r:n,vS=(n,r,i)=>i===xe.Top?n-r:i===xe.Bottom?n+r:n,s0="react-flow__edgeupdater",l0=({position:n,centerX:r,centerY:i,radius:o=10,onMouseDown:u,onMouseEnter:f,onMouseOut:h,type:g})=>le.createElement("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:h,className:$t([s0,`${s0}-${g}`]),cx:bS(r,o,n),cy:vS(i,o,n),r:o,stroke:"transparent",fill:"transparent"}),jS=()=>!0;var sl=n=>{const r=({id:i,className:o,type:u,data:f,onClick:h,onEdgeDoubleClick:g,selected:x,animated:m,label:p,labelStyle:b,labelShowBg:v,labelBgStyle:N,labelBgPadding:T,labelBgBorderRadius:_,style:M,source:A,target:V,sourceX:L,sourceY:C,targetX:D,targetY:W,sourcePosition:X,targetPosition:ie,elementsSelectable:I,hidden:K,sourceHandleId:ne,targetHandleId:ee,onContextMenu:se,onMouseEnter:S,onMouseMove:U,onMouseLeave:k,reconnectRadius:H,onReconnect:O,onReconnectStart:z,onReconnectEnd:E,markerEnd:$,markerStart:Z,rfId:ae,ariaLabel:oe,isFocusable:he,isReconnectable:me,pathOptions:Se,interactionWidth:ve,disableKeyboardA11y:Ae})=>{const Re=j.useRef(null),[We,Te]=j.useState(!1),[be,q]=j.useState(!1),Y=Nt(),ue=j.useMemo(()=>`url('#${Yd(Z,ae)}')`,[Z,ae]),re=j.useMemo(()=>`url('#${Yd($,ae)}')`,[$,ae]);if(K)return null;const P=Ve=>{const{edges:je,addSelectedEdges:Le,unselectNodesAndEdges:Ge,multiSelectionActive:At}=Y.getState(),Vt=je.find(Jt=>Jt.id===i);Vt&&(I&&(Y.setState({nodesSelectionActive:!1}),Vt.selected&&At?(Ge({nodes:[],edges:[Vt]}),Re.current?.blur()):Le([i])),h&&h(Ve,Vt))},Ee=Sr(i,Y.getState,g),ge=Sr(i,Y.getState,se),ke=Sr(i,Y.getState,S),Oe=Sr(i,Y.getState,U),ze=Sr(i,Y.getState,k),Tt=(Ve,je)=>{if(Ve.button!==0)return;const{edges:Le,isValidConnection:Ge}=Y.getState(),At=je?V:A,Vt=(je?ee:ne)||null,Jt=je?"target":"source",jl=Ge||jS,ys=je,la=Le.find(Dn=>Dn.id===i);q(!0),z?.(Ve,la,Jt);const Ya=Dn=>{q(!1),E?.(Dn,la,Jt)};Mg({event:Ve,handleId:Vt,nodeId:At,onConnect:Dn=>O?.(la,Dn),isTarget:ys,getState:Y.getState,setState:Y.setState,isValidConnection:jl,edgeUpdaterType:Jt,onReconnectEnd:Ya})},Mt=Ve=>Tt(Ve,!0),ft=Ve=>Tt(Ve,!1),nt=()=>Te(!0),pt=()=>Te(!1),at=!I&&!h,pe=Ve=>{if(!Ae&&yg.includes(Ve.key)&&I){const{unselectNodesAndEdges:je,addSelectedEdges:Le,edges:Ge}=Y.getState();Ve.key==="Escape"?(Re.current?.blur(),je({edges:[Ge.find(Vt=>Vt.id===i)]})):Le([i])}};return le.createElement("g",{className:$t(["react-flow__edge",`react-flow__edge-${u}`,o,{selected:x,animated:m,inactive:at,updating:We}]),onClick:P,onDoubleClick:Ee,onContextMenu:ge,onMouseEnter:ke,onMouseMove:Oe,onMouseLeave:ze,onKeyDown:he?pe:void 0,tabIndex:he?0:void 0,role:he?"button":"img","data-testid":`rf__edge-${i}`,"aria-label":oe===null?void 0:oe||`Edge from ${A} to ${V}`,"aria-describedby":he?`${Bg}-${ae}`:void 0,ref:Re},!be&&le.createElement(n,{id:i,source:A,target:V,selected:x,animated:m,label:p,labelStyle:b,labelShowBg:v,labelBgStyle:N,labelBgPadding:T,labelBgBorderRadius:_,data:f,style:M,sourceX:L,sourceY:C,targetX:D,targetY:W,sourcePosition:X,targetPosition:ie,sourceHandleId:ne,targetHandleId:ee,markerStart:ue,markerEnd:re,pathOptions:Se,interactionWidth:ve}),me&&le.createElement(le.Fragment,null,(me==="source"||me===!0)&&le.createElement(l0,{position:X,centerX:L,centerY:C,radius:H,onMouseDown:Mt,onMouseEnter:nt,onMouseOut:pt,type:"source"}),(me==="target"||me===!0)&&le.createElement(l0,{position:ie,centerX:D,centerY:W,radius:H,onMouseDown:ft,onMouseEnter:nt,onMouseOut:pt,type:"target"})))};return r.displayName="EdgeWrapper",j.memo(r)};function NS(n){const r={default:sl(n.default||Lo),straight:sl(n.bezier||ff),step:sl(n.step||df),smoothstep:sl(n.step||Ko),simplebezier:sl(n.simplebezier||uf)},i={},o=Object.keys(n).filter(u=>!["default","bezier"].includes(u)).reduce((u,f)=>(u[f]=sl(n[f]||Lo),u),i);return{...r,...o}}function r0(n,r,i=null){const o=(i?.x||0)+r.x,u=(i?.y||0)+r.y,f=i?.width||r.width,h=i?.height||r.height;switch(n){case xe.Top:return{x:o+f/2,y:u};case xe.Right:return{x:o+f,y:u+h/2};case xe.Bottom:return{x:o+f/2,y:u+h};case xe.Left:return{x:o,y:u+h/2}}}function i0(n,r){return n?n.length===1||!r?n[0]:r&&n.find(i=>i.id===r)||null:null}const wS=(n,r,i,o,u,f)=>{const h=r0(i,n,r),g=r0(f,o,u);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y}};function SS({sourcePos:n,targetPos:r,sourceWidth:i,sourceHeight:o,targetWidth:u,targetHeight:f,width:h,height:g,transform:x}){const m={x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),x2:Math.max(n.x+i,r.x+u),y2:Math.max(n.y+o,r.y+f)};m.x===m.x2&&(m.x2+=1),m.y===m.y2&&(m.y2+=1);const p=Br({x:(0-x[0])/x[2],y:(0-x[1])/x[2],width:h/x[2],height:g/x[2]}),b=Math.max(0,Math.min(p.x2,m.x2)-Math.max(p.x,m.x)),v=Math.max(0,Math.min(p.y2,m.y2)-Math.max(p.y,m.y));return Math.ceil(b*v)>0}function o0(n){const r=n?.[ct]?.handleBounds||null,i=r&&n?.width&&n?.height&&typeof n?.positionAbsolute?.x<"u"&&typeof n?.positionAbsolute?.y<"u";return[{x:n?.positionAbsolute?.x||0,y:n?.positionAbsolute?.y||0,width:n?.width||0,height:n?.height||0},r,!!i]}const ES=[{level:0,isMaxLevel:!0,edges:[]}];function kS(n,r,i=!1){let o=-1;const u=n.reduce((h,g)=>{const x=yn(g.zIndex);let m=x?g.zIndex:0;if(i){const p=r.get(g.target),b=r.get(g.source),v=g.selected||p?.selected||b?.selected,N=Math.max(b?.[ct]?.z||0,p?.[ct]?.z||0,1e3);m=(x?g.zIndex:0)+(v?N:0)}return h[m]?h[m].push(g):h[m]=[g],o=m>o?m:o,h},{}),f=Object.entries(u).map(([h,g])=>{const x=+h;return{edges:g,level:x,isMaxLevel:x===o}});return f.length===0?ES:f}function _S(n,r,i){const o=tt(j.useCallback(u=>n?u.edges.filter(f=>{const h=r.get(f.source),g=r.get(f.target);return h?.width&&h?.height&&g?.width&&g?.height&&SS({sourcePos:h.positionAbsolute||{x:0,y:0},targetPos:g.positionAbsolute||{x:0,y:0},sourceWidth:h.width,sourceHeight:h.height,targetWidth:g.width,targetHeight:g.height,width:u.width,height:u.height,transform:u.transform})}):u.edges,[n,r]));return kS(o,r,i)}const CS=({color:n="none",strokeWidth:r=1})=>le.createElement("polyline",{style:{stroke:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),TS=({color:n="none",strokeWidth:r=1})=>le.createElement("polyline",{style:{stroke:n,fill:n,strokeWidth:r},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),c0={[Ba.Arrow]:CS,[Ba.ArrowClosed]:TS};function MS(n){const r=Nt();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(c0,n)?c0[n]:(r.getState().onError?.("009",sa.error009(n)),null),[n])}const AS=({id:n,type:r,color:i,width:o=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:h,orient:g="auto-start-reverse"})=>{const x=MS(r);return x?le.createElement("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${o}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0"},le.createElement(x,{color:i,strokeWidth:h})):null},RS=({defaultColor:n,rfId:r})=>i=>{const o=[];return i.edges.reduce((u,f)=>([f.markerStart,f.markerEnd].forEach(h=>{if(h&&typeof h=="object"){const g=Yd(h,r);o.includes(g)||(u.push({id:g,color:h.color||n,...h}),o.push(g))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))},Fg=({defaultColor:n,rfId:r})=>{const i=tt(j.useCallback(RS({defaultColor:n,rfId:r}),[n,r]),(o,u)=>!(o.length!==u.length||o.some((f,h)=>f.id!==u[h].id)));return le.createElement("defs",null,i.map(o=>le.createElement(AS,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};Fg.displayName="MarkerDefinitions";var zS=j.memo(Fg);const OS=n=>({nodesConnectable:n.nodesConnectable,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,width:n.width,height:n.height,connectionMode:n.connectionMode,nodeInternals:n.nodeInternals,onError:n.onError}),Pg=({defaultMarkerColor:n,onlyRenderVisibleElements:r,elevateEdgesOnSelect:i,rfId:o,edgeTypes:u,noPanClassName:f,onEdgeContextMenu:h,onEdgeMouseEnter:g,onEdgeMouseMove:x,onEdgeMouseLeave:m,onEdgeClick:p,onEdgeDoubleClick:b,onReconnect:v,onReconnectStart:N,onReconnectEnd:T,reconnectRadius:_,children:M,disableKeyboardA11y:A})=>{const{edgesFocusable:V,edgesUpdatable:L,elementsSelectable:C,width:D,height:W,connectionMode:X,nodeInternals:ie,onError:I}=tt(OS,Ct),K=_S(r,ie,i);return D?le.createElement(le.Fragment,null,K.map(({level:ne,edges:ee,isMaxLevel:se})=>le.createElement("svg",{key:ne,style:{zIndex:ne},width:D,height:W,className:"react-flow__edges react-flow__container"},se&&le.createElement(zS,{defaultColor:n,rfId:o}),le.createElement("g",null,ee.map(S=>{const[U,k,H]=o0(ie.get(S.source)),[O,z,E]=o0(ie.get(S.target));if(!H||!E)return null;let $=S.type||"default";u[$]||(I?.("011",sa.error011($)),$="default");const Z=u[$]||u.default,ae=X===ps.Strict?z.target:(z.target??[]).concat(z.source??[]),oe=i0(k.source,S.sourceHandle),he=i0(ae,S.targetHandle),me=oe?.position||xe.Bottom,Se=he?.position||xe.Top,ve=!!(S.focusable||V&&typeof S.focusable>"u"),Ae=S.reconnectable||S.updatable,Re=typeof v<"u"&&(Ae||L&&typeof Ae>"u");if(!oe||!he)return I?.("008",sa.error008(oe,S)),null;const{sourceX:We,sourceY:Te,targetX:be,targetY:q}=wS(U,oe,me,O,he,Se);return le.createElement(Z,{key:S.id,id:S.id,className:$t([S.className,f]),type:$,data:S.data,selected:!!S.selected,animated:!!S.animated,hidden:!!S.hidden,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,style:S.style,source:S.source,target:S.target,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerEnd:S.markerEnd,markerStart:S.markerStart,sourceX:We,sourceY:Te,targetX:be,targetY:q,sourcePosition:me,targetPosition:Se,elementsSelectable:C,onContextMenu:h,onMouseEnter:g,onMouseMove:x,onMouseLeave:m,onClick:p,onEdgeDoubleClick:b,onReconnect:v,onReconnectStart:N,onReconnectEnd:T,reconnectRadius:_,rfId:o,ariaLabel:S.ariaLabel,isFocusable:ve,isReconnectable:Re,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth,disableKeyboardA11y:A})})))),M):null};Pg.displayName="EdgeRenderer";var DS=j.memo(Pg);const HS=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function $S({children:n}){const r=tt(HS);return le.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:r}},n)}function US(n){const r=xf(),i=j.useRef(!1);j.useEffect(()=>{!i.current&&r.viewportInitialized&&n&&(setTimeout(()=>n(r),1),i.current=!0)},[n,r.viewportInitialized])}const BS={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top},ey=({nodeId:n,handleType:r,style:i,type:o=$a.Bezier,CustomComponent:u,connectionStatus:f})=>{const{fromNode:h,handleId:g,toX:x,toY:m,connectionMode:p}=tt(j.useCallback(W=>({fromNode:W.nodeInternals.get(n),handleId:W.connectionHandleId,toX:(W.connectionPosition.x-W.transform[0])/W.transform[2],toY:(W.connectionPosition.y-W.transform[1])/W.transform[2],connectionMode:W.connectionMode}),[n]),Ct),b=h?.[ct]?.handleBounds;let v=b?.[r];if(p===ps.Loose&&(v=v||b?.[r==="source"?"target":"source"]),!h||!v)return null;const N=g?v.find(W=>W.id===g):v[0],T=N?N.x+N.width/2:(h.width??0)/2,_=N?N.y+N.height/2:h.height??0,M=(h.positionAbsolute?.x??0)+T,A=(h.positionAbsolute?.y??0)+_,V=N?.position,L=V?BS[V]:null;if(!V||!L)return null;if(u)return le.createElement(u,{connectionLineType:o,connectionLineStyle:i,fromNode:h,fromHandle:N,fromX:M,fromY:A,toX:x,toY:m,fromPosition:V,toPosition:L,connectionStatus:f});let C="";const D={sourceX:M,sourceY:A,sourcePosition:V,targetX:x,targetY:m,targetPosition:L};return o===$a.Bezier?[C]=wg(D):o===$a.Step?[C]=Ld({...D,borderRadius:0}):o===$a.SmoothStep?[C]=Ld(D):o===$a.SimpleBezier?[C]=Ng(D):C=`M${M},${A} ${x},${m}`,le.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:i})};ey.displayName="ConnectionLine";const qS=n=>({nodeId:n.connectionNodeId,handleType:n.connectionHandleType,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height});function LS({containerStyle:n,style:r,type:i,component:o}){const{nodeId:u,handleType:f,nodesConnectable:h,width:g,height:x,connectionStatus:m}=tt(qS,Ct);return!(u&&f&&g&&h)?null:le.createElement("svg",{style:n,width:g,height:x,className:"react-flow__edges react-flow__connectionline react-flow__container"},le.createElement("g",{className:$t(["react-flow__connection",m])},le.createElement(ey,{nodeId:u,handleType:f,style:r,type:i,CustomComponent:o,connectionStatus:m})))}function u0(n,r){return j.useRef(null),Nt(),j.useMemo(()=>r(n),[n])}const ty=({nodeTypes:n,edgeTypes:r,onMove:i,onMoveStart:o,onMoveEnd:u,onInit:f,onNodeClick:h,onEdgeClick:g,onNodeDoubleClick:x,onEdgeDoubleClick:m,onNodeMouseEnter:p,onNodeMouseMove:b,onNodeMouseLeave:v,onNodeContextMenu:N,onSelectionContextMenu:T,onSelectionStart:_,onSelectionEnd:M,connectionLineType:A,connectionLineStyle:V,connectionLineComponent:L,connectionLineContainerStyle:C,selectionKeyCode:D,selectionOnDrag:W,selectionMode:X,multiSelectionKeyCode:ie,panActivationKeyCode:I,zoomActivationKeyCode:K,deleteKeyCode:ne,onlyRenderVisibleElements:ee,elementsSelectable:se,selectNodesOnDrag:S,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:O,preventScrolling:z,defaultMarkerColor:E,zoomOnScroll:$,zoomOnPinch:Z,panOnScroll:ae,panOnScrollSpeed:oe,panOnScrollMode:he,zoomOnDoubleClick:me,panOnDrag:Se,onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneScroll:Te,onPaneContextMenu:be,onEdgeContextMenu:q,onEdgeMouseEnter:Y,onEdgeMouseMove:ue,onEdgeMouseLeave:re,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Tt,elevateEdgesOnSelect:Mt,disableKeyboardA11y:ft,nodeOrigin:nt,nodeExtent:pt,rfId:at})=>{const pe=u0(n,pS),Ve=u0(r,NS);return US(f),le.createElement(hS,{onPaneClick:ve,onPaneMouseEnter:Ae,onPaneMouseMove:Re,onPaneMouseLeave:We,onPaneContextMenu:be,onPaneScroll:Te,deleteKeyCode:ne,selectionKeyCode:D,selectionOnDrag:W,selectionMode:X,onSelectionStart:_,onSelectionEnd:M,multiSelectionKeyCode:ie,panActivationKeyCode:I,zoomActivationKeyCode:K,elementsSelectable:se,onMove:i,onMoveStart:o,onMoveEnd:u,zoomOnScroll:$,zoomOnPinch:Z,zoomOnDoubleClick:me,panOnScroll:ae,panOnScrollSpeed:oe,panOnScrollMode:he,panOnDrag:Se,defaultViewport:U,translateExtent:k,minZoom:H,maxZoom:O,onSelectionContextMenu:T,preventScrolling:z,noDragClassName:Oe,noWheelClassName:ze,noPanClassName:Tt,disableKeyboardA11y:ft},le.createElement($S,null,le.createElement(DS,{edgeTypes:Ve,onEdgeClick:g,onEdgeDoubleClick:m,onlyRenderVisibleElements:ee,onEdgeContextMenu:q,onEdgeMouseEnter:Y,onEdgeMouseMove:ue,onEdgeMouseLeave:re,onReconnect:P,onReconnectStart:Ee,onReconnectEnd:ge,reconnectRadius:ke,defaultMarkerColor:E,noPanClassName:Tt,elevateEdgesOnSelect:!!Mt,disableKeyboardA11y:ft,rfId:at},le.createElement(LS,{style:V,type:A,component:L,containerStyle:C})),le.createElement("div",{className:"react-flow__edgelabel-renderer"}),le.createElement(yS,{nodeTypes:pe,onNodeClick:h,onNodeDoubleClick:x,onNodeMouseEnter:p,onNodeMouseMove:b,onNodeMouseLeave:v,onNodeContextMenu:N,selectNodesOnDrag:S,onlyRenderVisibleElements:ee,noPanClassName:Tt,noDragClassName:Oe,disableKeyboardA11y:ft,nodeOrigin:nt,nodeExtent:pt,rfId:at})))};ty.displayName="GraphView";var YS=j.memo(ty);const Zd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Oa={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Zd,nodeExtent:Zd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ps.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:xw,isValidConnection:void 0},VS=()=>A2((n,r)=>({...Oa,setNodes:i=>{const{nodeInternals:o,nodeOrigin:u,elevateNodesOnSelect:f}=r();n({nodeInternals:vd(i,o,u,f)})},getNodes:()=>Array.from(r().nodeInternals.values()),setEdges:i=>{const{defaultEdgeOptions:o={}}=r();n({edges:i.map(u=>({...o,...u}))})},setDefaultNodesAndEdges:(i,o)=>{const u=typeof i<"u",f=typeof o<"u",h=u?vd(i,new Map,r().nodeOrigin,r().elevateNodesOnSelect):new Map;n({nodeInternals:h,edges:f?o:[],hasDefaultNodes:u,hasDefaultEdges:f})},updateNodeDimensions:i=>{const{onNodesChange:o,nodeInternals:u,fitViewOnInit:f,fitViewOnInitDone:h,fitViewOnInitOptions:g,domNode:x,nodeOrigin:m}=r(),p=x?.querySelector(".react-flow__viewport");if(!p)return;const b=window.getComputedStyle(p),{m22:v}=new window.DOMMatrixReadOnly(b.transform),N=i.reduce((_,M)=>{const A=u.get(M.id);if(A?.hidden)u.set(A.id,{...A,[ct]:{...A[ct],handleBounds:void 0}});else if(A){const V=of(M.nodeElement);!!(V.width&&V.height&&(A.width!==V.width||A.height!==V.height||M.forceUpdate))&&(u.set(A.id,{...A,[ct]:{...A[ct],handleBounds:{source:a0(".source",M.nodeElement,v,m),target:a0(".target",M.nodeElement,v,m)}},...V}),_.push({id:A.id,type:"dimensions",dimensions:V}))}return _},[]);Lg(u,m);const T=h||f&&!h&&Yg(r,{initial:!0,...g});n({nodeInternals:new Map(u),fitViewOnInitDone:T}),N?.length>0&&o?.(N)},updateNodePositions:(i,o=!0,u=!1)=>{const{triggerNodeChanges:f}=r(),h=i.map(g=>{const x={id:g.id,type:"position",dragging:u};return o&&(x.positionAbsolute=g.positionAbsolute,x.position=g.position),x});f(h)},triggerNodeChanges:i=>{const{onNodesChange:o,nodeInternals:u,hasDefaultNodes:f,nodeOrigin:h,getNodes:g,elevateNodesOnSelect:x}=r();if(i?.length){if(f){const m=Gg(i,g()),p=vd(m,u,h,x);n({nodeInternals:p})}o?.(i)}},addSelectedNodes:i=>{const{multiSelectionActive:o,edges:u,getNodes:f}=r();let h,g=null;o?h=i.map(x=>Ha(x,!0)):(h=cl(f(),i),g=cl(u,[])),No({changedNodes:h,changedEdges:g,get:r,set:n})},addSelectedEdges:i=>{const{multiSelectionActive:o,edges:u,getNodes:f}=r();let h,g=null;o?h=i.map(x=>Ha(x,!0)):(h=cl(u,i),g=cl(f(),[])),No({changedNodes:g,changedEdges:h,get:r,set:n})},unselectNodesAndEdges:({nodes:i,edges:o}={})=>{const{edges:u,getNodes:f}=r(),h=i||f(),g=o||u,x=h.map(p=>(p.selected=!1,Ha(p.id,!1))),m=g.map(p=>Ha(p.id,!1));No({changedNodes:x,changedEdges:m,get:r,set:n})},setMinZoom:i=>{const{d3Zoom:o,maxZoom:u}=r();o?.scaleExtent([i,u]),n({minZoom:i})},setMaxZoom:i=>{const{d3Zoom:o,minZoom:u}=r();o?.scaleExtent([u,i]),n({maxZoom:i})},setTranslateExtent:i=>{r().d3Zoom?.translateExtent(i),n({translateExtent:i})},resetSelectedElements:()=>{const{edges:i,getNodes:o}=r(),f=o().filter(g=>g.selected).map(g=>Ha(g.id,!1)),h=i.filter(g=>g.selected).map(g=>Ha(g.id,!1));No({changedNodes:f,changedEdges:h,get:r,set:n})},setNodeExtent:i=>{const{nodeInternals:o}=r();o.forEach(u=>{u.positionAbsolute=cf(u.position,i)}),n({nodeExtent:i,nodeInternals:new Map(o)})},panBy:i=>{const{transform:o,width:u,height:f,d3Zoom:h,d3Selection:g,translateExtent:x}=r();if(!h||!g||!i.x&&!i.y)return!1;const m=ta.translate(o[0]+i.x,o[1]+i.y).scale(o[2]),p=[[0,0],[u,f]],b=h?.constrain()(m,p,x);return h.transform(g,b),o[0]!==b.x||o[1]!==b.y||o[2]!==b.k},cancelConnection:()=>n({connectionNodeId:Oa.connectionNodeId,connectionHandleId:Oa.connectionHandleId,connectionHandleType:Oa.connectionHandleType,connectionStatus:Oa.connectionStatus,connectionStartHandle:Oa.connectionStartHandle,connectionEndHandle:Oa.connectionEndHandle}),reset:()=>n({...Oa})}),Object.is),ny=({children:n})=>{const r=j.useRef(null);return r.current||(r.current=VS()),le.createElement(cw,{value:r.current},n)};ny.displayName="ReactFlowProvider";const ay=({children:n})=>j.useContext(Qo)?le.createElement(le.Fragment,null,n):le.createElement(ny,null,n);ay.displayName="ReactFlowWrapper";const GS={input:Og,default:Gd,output:Hg,group:pf},XS={default:Lo,straight:ff,step:df,smoothstep:Ko,simplebezier:uf},ZS=[0,0],WS=[15,15],QS={x:0,y:0,zoom:1},KS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},yf=j.forwardRef(({nodes:n,edges:r,defaultNodes:i,defaultEdges:o,className:u,nodeTypes:f=GS,edgeTypes:h=XS,onNodeClick:g,onEdgeClick:x,onInit:m,onMove:p,onMoveStart:b,onMoveEnd:v,onConnect:N,onConnectStart:T,onConnectEnd:_,onClickConnectStart:M,onClickConnectEnd:A,onNodeMouseEnter:V,onNodeMouseMove:L,onNodeMouseLeave:C,onNodeContextMenu:D,onNodeDoubleClick:W,onNodeDragStart:X,onNodeDrag:ie,onNodeDragStop:I,onNodesDelete:K,onEdgesDelete:ne,onSelectionChange:ee,onSelectionDragStart:se,onSelectionDrag:S,onSelectionDragStop:U,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:O,connectionMode:z=ps.Strict,connectionLineType:E=$a.Bezier,connectionLineStyle:$,connectionLineComponent:Z,connectionLineContainerStyle:ae,deleteKeyCode:oe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:me=!1,selectionMode:Se=qr.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Ae=qo()?"Meta":"Control",zoomActivationKeyCode:Re=qo()?"Meta":"Control",snapToGrid:We=!1,snapGrid:Te=WS,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:q=!0,nodesDraggable:Y,nodesConnectable:ue,nodesFocusable:re,nodeOrigin:P=ZS,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,defaultViewport:Oe=QS,minZoom:ze=.5,maxZoom:Tt=2,translateExtent:Mt=Zd,preventScrolling:ft=!0,nodeExtent:nt,defaultMarkerColor:pt="#b1b1b7",zoomOnScroll:at=!0,zoomOnPinch:pe=!0,panOnScroll:Ve=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Le=us.Free,zoomOnDoubleClick:Ge=!0,panOnDrag:At=!0,onPaneClick:Vt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:ys,onPaneScroll:la,onPaneContextMenu:Ya,children:ra,onEdgeContextMenu:Dn,onEdgeDoubleClick:Qr,onEdgeMouseEnter:Kr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onEdgeUpdate:Jr,onEdgeUpdateStart:Io,onEdgeUpdateEnd:_n,onReconnect:wt,onReconnectStart:Ut,onReconnectEnd:ia,reconnectRadius:Sl=10,edgeUpdaterRadius:Fo=10,onNodesChange:Po,onEdgesChange:Ir,noDragClassName:Va="nodrag",noWheelClassName:El="nowheel",noPanClassName:Hn="nopan",fitView:oa=!1,fitViewOptions:Ga,connectOnClick:ca=!0,attributionPosition:xt,proOptions:Fr,defaultEdgeOptions:Pr,elevateNodesOnSelect:$n=!0,elevateEdgesOnSelect:ua=!1,disableKeyboardA11y:ei=!1,autoPanOnConnect:ti=!0,autoPanOnNodeDrag:ni=!0,connectionRadius:ec=20,isValidConnection:bs,onError:vs,style:bn,id:js,nodeDragThreshold:ai,...da},kl)=>{const Xa=js||"1";return le.createElement("div",{...da,style:{...bn,...KS},ref:kl,className:$t(["react-flow",u]),"data-testid":"rf__wrapper",id:js},le.createElement(ay,null,le.createElement(YS,{onInit:m,onMove:p,onMoveStart:b,onMoveEnd:v,onNodeClick:g,onEdgeClick:x,onNodeMouseEnter:V,onNodeMouseMove:L,onNodeMouseLeave:C,onNodeContextMenu:D,onNodeDoubleClick:W,nodeTypes:f,edgeTypes:h,connectionLineType:E,connectionLineStyle:$,connectionLineComponent:Z,connectionLineContainerStyle:ae,selectionKeyCode:he,selectionOnDrag:me,selectionMode:Se,deleteKeyCode:oe,multiSelectionKeyCode:Ae,panActivationKeyCode:ve,zoomActivationKeyCode:Re,onlyRenderVisibleElements:be,selectNodesOnDrag:q,defaultViewport:Oe,translateExtent:Mt,minZoom:ze,maxZoom:Tt,preventScrolling:ft,zoomOnScroll:at,zoomOnPinch:pe,zoomOnDoubleClick:Ge,panOnScroll:Ve,panOnScrollSpeed:je,panOnScrollMode:Le,panOnDrag:At,onPaneClick:Vt,onPaneMouseEnter:Jt,onPaneMouseMove:jl,onPaneMouseLeave:ys,onPaneScroll:la,onPaneContextMenu:Ya,onSelectionContextMenu:k,onSelectionStart:H,onSelectionEnd:O,onEdgeContextMenu:Dn,onEdgeDoubleClick:Qr,onEdgeMouseEnter:Kr,onEdgeMouseMove:Nl,onEdgeMouseLeave:wl,onReconnect:wt??Jr,onReconnectStart:Ut??Io,onReconnectEnd:ia??_n,reconnectRadius:Sl??Fo,defaultMarkerColor:pt,noDragClassName:Va,noWheelClassName:El,noPanClassName:Hn,elevateEdgesOnSelect:ua,rfId:Xa,disableKeyboardA11y:ei,nodeOrigin:P,nodeExtent:nt}),le.createElement(Bw,{nodes:n,edges:r,defaultNodes:i,defaultEdges:o,onConnect:N,onConnectStart:T,onConnectEnd:_,onClickConnectStart:M,onClickConnectEnd:A,nodesDraggable:Y,nodesConnectable:ue,nodesFocusable:re,edgesFocusable:Ee,edgesUpdatable:ge,elementsSelectable:ke,elevateNodesOnSelect:$n,minZoom:ze,maxZoom:Tt,nodeExtent:nt,onNodesChange:Po,onEdgesChange:Ir,snapToGrid:We,snapGrid:Te,connectionMode:z,translateExtent:Mt,connectOnClick:ca,defaultEdgeOptions:Pr,fitView:oa,fitViewOptions:Ga,onNodesDelete:K,onEdgesDelete:ne,onNodeDragStart:X,onNodeDrag:ie,onNodeDragStop:I,onSelectionDrag:S,onSelectionDragStart:se,onSelectionDragStop:U,noPanClassName:Hn,nodeOrigin:P,rfId:Xa,autoPanOnConnect:ti,autoPanOnNodeDrag:ni,onError:vs,connectionRadius:ec,isValidConnection:bs,nodeDragThreshold:ai}),le.createElement($w,{onSelectionChange:ee}),ra,le.createElement(dw,{proOptions:Fr,position:xt}),le.createElement(Gw,{rfId:Xa,disableKeyboardA11y:ei})))});yf.displayName="ReactFlow";function sy(n){return r=>{const[i,o]=j.useState(r),u=j.useCallback(f=>o(h=>n(f,h)),[]);return[i,o,u]}}const ly=sy(Gg),ry=sy(sS),iy=({id:n,x:r,y:i,width:o,height:u,style:f,color:h,strokeColor:g,strokeWidth:x,className:m,borderRadius:p,shapeRendering:b,onClick:v,selected:N})=>{const{background:T,backgroundColor:_}=f||{},M=h||T||_;return le.createElement("rect",{className:$t(["react-flow__minimap-node",{selected:N},m]),x:r,y:i,rx:p,ry:p,width:o,height:u,fill:M,stroke:g,strokeWidth:x,shapeRendering:b,onClick:v?A=>v(A,n):void 0})};iy.displayName="MiniMapNode";var JS=j.memo(iy);const IS=n=>n.nodeOrigin,FS=n=>n.getNodes().filter(r=>!r.hidden&&r.width&&r.height),Sd=n=>n instanceof Function?n:()=>n;function PS({nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:u=2,nodeComponent:f=JS,onClick:h}){const g=tt(FS,Ct),x=tt(IS),m=Sd(r),p=Sd(n),b=Sd(i),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return le.createElement(le.Fragment,null,g.map(N=>{const{x:T,y:_}=fs(N,x).positionAbsolute;return le.createElement(f,{key:N.id,x:T,y:_,width:N.width,height:N.height,style:N.style,selected:N.selected,className:b(N),color:m(N),borderRadius:o,strokeColor:p(N),strokeWidth:u,shapeRendering:v,onClick:h,id:N.id})}))}var e3=j.memo(PS);const t3=200,n3=150,a3=n=>{const r=n.getNodes(),i={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:i,boundingRect:r.length>0?mw(Jo(r,n.nodeOrigin),i):i,rfId:n.rfId}},s3="react-flow__minimap-desc";function oy({style:n,className:r,nodeStrokeColor:i="transparent",nodeColor:o="#e2e2e2",nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:h=2,nodeComponent:g,maskColor:x="rgb(240, 240, 240, 0.6)",maskStrokeColor:m="none",maskStrokeWidth:p=1,position:b="bottom-right",onClick:v,onNodeClick:N,pannable:T=!1,zoomable:_=!1,ariaLabel:M="React Flow mini map",inversePan:A=!1,zoomStep:V=10,offsetScale:L=5}){const C=Nt(),D=j.useRef(null),{boundingRect:W,viewBB:X,rfId:ie}=tt(a3,Ct),I=n?.width??t3,K=n?.height??n3,ne=W.width/I,ee=W.height/K,se=Math.max(ne,ee),S=se*I,U=se*K,k=L*se,H=W.x-(S-W.width)/2-k,O=W.y-(U-W.height)/2-k,z=S+k*2,E=U+k*2,$=`${s3}-${ie}`,Z=j.useRef(0);Z.current=se,j.useEffect(()=>{if(D.current){const he=gn(D.current),me=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te}=C.getState();if(Ae.sourceEvent.type!=="wheel"||!We||!Te)return;const be=-Ae.sourceEvent.deltaY*(Ae.sourceEvent.deltaMode===1?.05:Ae.sourceEvent.deltaMode?1:.002)*V,q=Re[2]*Math.pow(2,be);Te.scaleTo(We,q)},Se=Ae=>{const{transform:Re,d3Selection:We,d3Zoom:Te,translateExtent:be,width:q,height:Y}=C.getState();if(Ae.sourceEvent.type!=="mousemove"||!We||!Te)return;const ue=Z.current*Math.max(1,Re[2])*(A?-1:1),re={x:Re[0]-Ae.sourceEvent.movementX*ue,y:Re[1]-Ae.sourceEvent.movementY*ue},P=[[0,0],[q,Y]],Ee=ta.translate(re.x,re.y).scale(Re[2]),ge=Te.constrain()(Ee,P,be);Te.transform(We,ge)},ve=fg().on("zoom",T?Se:null).on("zoom.wheel",_?me:null);return he.call(ve),()=>{he.on("zoom",null)}}},[T,_,A,V]);const ae=v?he=>{const me=Sn(he);v(he,{x:me[0],y:me[1]})}:void 0,oe=N?(he,me)=>{const Se=C.getState().nodeInternals.get(me);N(he,Se)}:void 0;return le.createElement(rf,{position:b,style:n,className:$t(["react-flow__minimap",r]),"data-testid":"rf__minimap"},le.createElement("svg",{width:I,height:K,viewBox:`${H} ${O} ${z} ${E}`,role:"img","aria-labelledby":$,ref:D,onClick:ae},M&&le.createElement("title",{id:$},M),le.createElement(e3,{onClick:oe,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:h,nodeComponent:g}),le.createElement("path",{className:"react-flow__minimap-mask",d:`M${H-k},${O-k}h${z+k*2}v${E+k*2}h${-z-k*2}z
|
|
391
|
-
M${X.x},${X.y}h${X.width}v${X.height}h${-X.width}z`,fill:x,fillRule:"evenodd",stroke:m,strokeWidth:p,pointerEvents:"none"})))}oy.displayName="MiniMap";var l3=j.memo(oy);function r3(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},le.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function i3(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},le.createElement("path",{d:"M0 0h32v4.2H0z"}))}function o3(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},le.createElement("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 c3(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},le.createElement("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 u3(){return le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},le.createElement("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"}))}const Mr=({children:n,className:r,...i})=>le.createElement("button",{type:"button",className:$t(["react-flow__controls-button",r]),...i},n);Mr.displayName="ControlButton";const d3=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}),cy=({style:n,showZoom:r=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:h,onFitView:g,onInteractiveChange:x,className:m,children:p,position:b="bottom-left"})=>{const v=Nt(),[N,T]=j.useState(!1),{isInteractive:_,minZoomReached:M,maxZoomReached:A}=tt(d3,Ct),{zoomIn:V,zoomOut:L,fitView:C}=xf();if(j.useEffect(()=>{T(!0)},[]),!N)return null;const D=()=>{V(),f?.()},W=()=>{L(),h?.()},X=()=>{C(u),g?.()},ie=()=>{v.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),x?.(!_)};return le.createElement(rf,{className:$t(["react-flow__controls",m]),position:b,style:n,"data-testid":"rf__controls"},r&&le.createElement(le.Fragment,null,le.createElement(Mr,{onClick:D,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:A},le.createElement(r3,null)),le.createElement(Mr,{onClick:W,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:M},le.createElement(i3,null))),i&&le.createElement(Mr,{className:"react-flow__controls-fitview",onClick:X,title:"fit view","aria-label":"fit view"},le.createElement(o3,null)),o&&le.createElement(Mr,{className:"react-flow__controls-interactive",onClick:ie,title:"toggle interactivity","aria-label":"toggle interactivity"},_?le.createElement(u3,null):le.createElement(c3,null)),p)};cy.displayName="Controls";var uy=j.memo(cy),ln;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ln||(ln={}));function f3({color:n,dimensions:r,lineWidth:i}){return le.createElement("path",{stroke:n,strokeWidth:i,d:`M${r[0]/2} 0 V${r[1]} M0 ${r[1]/2} H${r[0]}`})}function h3({color:n,radius:r}){return le.createElement("circle",{cx:r,cy:r,r,fill:n})}const m3={[ln.Dots]:"#91919a",[ln.Lines]:"#eee",[ln.Cross]:"#e2e2e2"},p3={[ln.Dots]:1,[ln.Lines]:1,[ln.Cross]:6},x3=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function dy({id:n,variant:r=ln.Dots,gap:i=20,size:o,lineWidth:u=1,offset:f=2,color:h,style:g,className:x}){const m=j.useRef(null),{transform:p,patternId:b}=tt(x3,Ct),v=h||m3[r],N=o||p3[r],T=r===ln.Dots,_=r===ln.Cross,M=Array.isArray(i)?i:[i,i],A=[M[0]*p[2]||1,M[1]*p[2]||1],V=N*p[2],L=_?[V,V]:A,C=T?[V/f,V/f]:[L[0]/f,L[1]/f];return le.createElement("svg",{className:$t(["react-flow__background",x]),style:{...g,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:m,"data-testid":"rf__background"},le.createElement("pattern",{id:b+n,x:p[0]%A[0],y:p[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},T?le.createElement(h3,{color:v,radius:V/f}):le.createElement(f3,{dimensions:L,color:v,lineWidth:u})),le.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b+n})`}))}dy.displayName="Background";var fy=j.memo(dy);const d0={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"},HEAD:{bg:"theme-bg-overlay-md",text:"theme-text-muted",dot:"var(--text-muted)"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",dot:"#c084fc"}};function bf(n){return d0[n.toUpperCase()]??d0.GET}const f0=["exists","not_exists","is_empty","is_not_empty"];function h0(n,r){return n.replace(/\{\{([^}]+)\}\}/g,(i,o)=>{const u=o.trim();if(u.includes(":")){const f=u.indexOf(":"),h=u.slice(0,f),g=u.slice(f+1);return r[`${h}:${g}`]??r[g]??""}return r[u]??""})}function g3(n,r){const i=h0(n.left,r),o=n.right!==void 0?h0(n.right,r):void 0;switch(n.operator){case"equals":return i===o;case"not_equals":return i!==o;case"greater_than":return Number(i)>Number(o);case"greater_than_or_equal":return Number(i)>=Number(o);case"less_than":return Number(i)<Number(o);case"less_than_or_equal":return Number(i)<=Number(o);case"exists":return i!==""&&i!==void 0;case"not_exists":return i===""||i===void 0;case"is_empty":return i===""||i===null;case"is_not_empty":return i!==""&&i!==null;case"contains":return o!==void 0&&i.includes(o);case"not_contains":return o!==void 0&&!i.includes(o);case"starts_with":return o!==void 0&&i.startsWith(o);case"ends_with":return o!==void 0&&i.endsWith(o);default:return!1}}function y3(n,r){const{rules:i}=n,o=i.all??i.any??[],u=!!i.all;if(o.length===0)return{passed:!0,reason:"No rules"};const f=o.map(m=>({rule:m,ok:g3(m,r)})),h=u?f.every(m=>m.ok):f.some(m=>m.ok),g=f.filter(m=>!m.ok),x=h?`All conditions met (${u?"AND":"OR"})`:`Failed: ${g.map(m=>`${m.rule.left} ${m.rule.operator}${m.rule.right!==void 0?" "+m.rule.right:""}`).join(", ")}`;return{passed:h,reason:x}}async function b3(n,r){const i=n.replace(/^workflows\//,"").replace(/\.json$/,"");await fetch(`/api/workflows/${encodeURIComponent(i)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({steps:r})})}function v3({method:n}){const r=bf(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}async function j3(){const n=await fetch("/api/workflows");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function N3(n){const r=n.replace(/^workflows\//,"").replace(/\.json$/,""),i=await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"DELETE"});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`HTTP ${i.status}`)}}const m0=/\{\{\s*human:([^}]+?)\s*\}\}/g;function vf(n){const r=new Set;for(const i of[n.path,JSON.stringify(n.body??{}),JSON.stringify(n.inject??{}),JSON.stringify(n.condition??{})]){if(!i)continue;m0.lastIndex=0;let o;for(;(o=m0.exec(i))!==null;){const u=o[1].trim();u&&r.add(u)}}return[...r]}function w3(n){const r=new Set;return n.forEach(i=>vf(i).forEach(o=>r.add(o))),[...r]}function S3(n){return/pass|secret|token|pwd|private|credential/i.test(n)}function E3({title:n,subtitle:r,fields:i,values:o,onChange:u,onSubmit:f,onCancel:h,submitLabel:g,error:x,submitting:m}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:s.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-amber-500/25 theme-bg-overlay shadow-2xl",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b theme-border",children:[s.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-amber-500/15 text-amber-400",children:s.jsx(zr,{className:"h-3.5 w-3.5",strokeWidth:2})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[12px] font-medium theme-text-primary",children:n}),r&&s.jsx("p",{className:"text-[10px] theme-text-faint truncate",children:r})]})]}),s.jsxs("div",{className:"space-y-2.5 p-4",children:[s.jsx("p",{className:"text-[11px] theme-text-muted",children:"This workflow needs a value only you know. The run stays paused until you answer."}),i.map(p=>s.jsxs("div",{children:[s.jsx("label",{className:"mb-1 block font-mono text-[10px] text-amber-400/90",children:`{{human:${p.key}}}`}),s.jsx("input",{autoFocus:i.length===1,type:S3(p.key)?"password":"text",value:o[p.key]??"",onChange:b=>u(p.key,b.target.value),onKeyDown:b=>{b.key==="Enter"&&f()},placeholder:p.hint??`Enter ${p.key}…`,className:"h-8 w-full rounded-lg border border-amber-500/30 theme-bg-overlay-md px-2.5 text-[12px] theme-text-primary placeholder-[var(--text-faint)] outline-none focus:border-amber-500/70 transition-colors"})]},p.key)),x&&s.jsx("p",{className:"text-[10px] text-red-400 leading-tight",children:x}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:f,disabled:!!m,className:"flex h-8 flex-1 items-center justify-center gap-1.5 rounded-lg bg-amber-500/20 border border-amber-500/40 px-3 text-[11px] font-medium text-amber-300 hover:bg-amber-500/30 transition-colors disabled:opacity-40 hover:cursor-pointer",children:[m?s.jsx(dt,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(ut,{className:"h-3 w-3",strokeWidth:2}),g]}),h&&s.jsxs("button",{type:"button",onClick:h,className:"flex h-8 items-center gap-1 rounded-lg border theme-border px-3 text-[11px] theme-text-muted hover:theme-text transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," Cancel run"]})]})]})]})})}const hy=230,Wd=64;function k3({data:n}){const r=bf(n.method),i={idle:"theme-border",running:"border-blue-500/60",passed:"border-emerald-500/40",failed:"border-red-500/40",skipped:"theme-border"},o={idle:"",running:"shadow-[0_0_12px_rgba(96,165,250,0.28)]",passed:"shadow-[0_0_8px_rgba(52,211,153,0.15)]",failed:"shadow-[0_0_8px_rgba(248,113,113,0.15)]",skipped:""},u=n.status??"idle";return s.jsxs("div",{className:`rounded-lg border theme-bg-overlay flex items-center gap-2.5 px-3 overflow-hidden transition-all duration-300 ${i[u]} ${o[u]}`,style:{width:hy,height:Wd},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[3px] transition-colors duration-300",style:{background:u==="running"?"#60a5fa":u==="passed"?r.dot:u==="failed"?"#f87171":r.dot+"60"}}),s.jsxs("div",{className:"shrink-0 flex items-center justify-center",children:[u==="running"&&s.jsx(dt,{className:"h-3.5 w-3.5 text-blue-400 animate-spin",strokeWidth:2}),u==="passed"&&s.jsx(ut,{className:"h-3.5 w-3.5 text-emerald-400",strokeWidth:2}),u==="failed"&&s.jsx(Ht,{className:"h-3.5 w-3.5 text-red-400",strokeWidth:2}),u==="idle"&&s.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center rounded-full border theme-border text-[8px] font-medium theme-text-faint",children:n.index+1}),u==="skipped"&&s.jsx("span",{className:"h-3.5 w-3.5 rounded-full border theme-border theme-bg-overlay-md"})]}),s.jsxs("div",{className:"min-w-0 flex-1 pl-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[s.jsx("span",{className:`text-[9px] font-medium ${r.text}`,children:n.method}),s.jsx("span",{className:"font-mono text-[10px] theme-text truncate",children:n.path}),n.result&&s.jsxs("span",{className:`ml-auto shrink-0 font-mono text-[9px] ${n.result.passed?"text-emerald-400":"text-red-400"}`,children:[n.result.status>0?n.result.status:"ERR"," · ",n.result.durationMs,"ms"]})]}),s.jsx("p",{className:"text-[9px] theme-text-faint truncate",children:n.name})]}),s.jsx(jt,{type:"source",position:xe.Bottom,style:{background:"transparent",border:"none"}})]})}function _3({data:n}){const r=n.passed,i=r===void 0?"rgba(96,165,250,0.5)":r?"rgba(52,211,153,0.7)":"rgba(248,113,113,0.7)";return s.jsxs("div",{style:{width:40,height:40,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[s.jsx("polygon",{points:"20,2 38,20 20,38 2,20",fill:"none",stroke:i,strokeWidth:"1.5"}),s.jsx("polygon",{points:"20,8 32,20 20,32 8,20",fill:i,fillOpacity:.12,stroke:"none"})]}),s.jsx("span",{style:{position:"absolute",fontSize:8,fontFamily:"monospace",color:i,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),s.jsx(jt,{type:"source",position:xe.Bottom,style:{background:"transparent",border:"none"}})]})}const C3={step:k3,condition:_3};function T3({steps:n,runState:r}){const[i,o,u]=ly([]),[f,h,g]=ry([]);j.useEffect(()=>{const v=[],N=[];let T=40;for(let _=0;_<n.length;_++){const M=n[_],A=r.stepStatuses[_]??"idle",V=r.stepResults[_]??null;if(v.push({id:`step-${_}`,type:"step",position:{x:0,y:T},data:{index:_,name:M.name,method:M.method,path:M.path,status:A,result:V}}),T+=Wd+36,M.condition){const L=`cond-${_}`,C=V?.conditionResult;v.push({id:L,type:"condition",position:{x:hy/2-20,y:T},data:{passed:C?.passed}});const D=A==="passed"?"rgba(52,211,153,0.3)":A==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";if(N.push({id:`e-${_}-cond`,source:`step-${_}`,target:L,style:{stroke:D,strokeWidth:1.5},markerEnd:{type:Ba.ArrowClosed,color:D},animated:A==="running"}),T+=64,_<n.length-1){const W=C?.passed===!0?"rgba(52,211,153,0.5)":"rgba(96,165,250,0.18)",X=C?.passed===!1?"rgba(248,113,113,0.5)":"rgba(96,165,250,0.1)";N.push({id:`e-${_}-cond-pass`,source:L,target:`step-${_+1}`,label:"PASS",labelStyle:{fill:"rgba(52,211,153,0.8)",fontSize:8,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:W,strokeWidth:1.2},markerEnd:{type:Ba.ArrowClosed,color:W}}),N.push({id:`e-${_}-cond-fail`,source:L,target:`step-${_+1}`,label:`FAIL→${M.condition.onFail.toUpperCase()}`,labelStyle:{fill:"rgba(248,113,113,0.8)",fontSize:8,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:X,strokeWidth:1.2,strokeDasharray:"4 3"}})}}else if(_<n.length-1){const L=Object.keys(M.capture??{}),C=L.length>0?L.map(X=>X.split(":").pop()).join(", "):void 0,D=r.stepStatuses[_]??"idle",W=D==="passed"?"rgba(52,211,153,0.3)":D==="failed"?"rgba(248,113,113,0.3)":"rgba(96,165,250,0.18)";N.push({id:`e-${_}`,source:`step-${_}`,target:`step-${_+1}`,label:C,labelStyle:{fill:"rgba(96,165,250,0.7)",fontSize:9,fontFamily:"monospace"},labelBgStyle:{fill:"transparent"},style:{stroke:W,strokeWidth:1.5,strokeDasharray:D==="idle"||D==="running"?"5 5":void 0},markerEnd:{type:Ba.ArrowClosed,color:D==="passed"?"rgba(52,211,153,0.4)":"rgba(96,165,250,0.3)"},animated:D==="running"})}}o(v),h(N)},[n,r.stepStatuses,r.stepResults]);const x=n.reduce((m,p)=>m+Wd+36+(p.condition?64:0),40);return s.jsx("div",{style:{height:Math.max(400,x)},className:"w-full rounded-lg overflow-hidden",children:s.jsxs(yf,{nodes:i,edges:f,onNodesChange:u,onEdgesChange:g,nodeTypes:C3,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[s.jsx(fy,{variant:ln.Dots,gap:20,size:1,color:"var(--border)"}),s.jsx(uy,{showInteractive:!1,className:"theme-bg-overlay border theme-border"})]})})}function M3({runState:n,steps:r,waitingStepIndex:i}){const o=j.useRef(null);return j.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[n.stepResults,n.phase]),n.phase==="idle"?null:s.jsxs("div",{className:"mt-3 rounded-lg border theme-border theme-bg-overlay",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b theme-border theme-bg-overlay-md",children:[s.jsx("span",{className:"text-[10px] font-semibold theme-text-muted uppercase tracking-wider",children:"Run Log"}),n.baseUrl&&s.jsxs("span",{className:"font-mono text-[10px] theme-text-faint",children:["→ ",n.baseUrl]}),s.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px]",children:[n.passed>0&&s.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&s.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]}),n.phase==="running"&&s.jsx(dt,{className:"h-3 w-3 text-blue-400 animate-spin",strokeWidth:2}),n.phase==="done"&&s.jsx(ut,{className:"h-3 w-3 text-emerald-400",strokeWidth:2}),n.phase==="aborted"&&s.jsx(Ht,{className:"h-3 w-3 text-red-400",strokeWidth:2})]})]}),s.jsxs("div",{ref:o,className:"overflow-y-auto max-h-80 font-mono text-[11px] p-3 space-y-1",children:[s.jsx("p",{className:"theme-text-faint",children:"▶ Starting workflow execution…"}),n.humanUnsupported&&s.jsxs("p",{className:"text-red-400",children:["⚠ Connected server doesn't support ","{{human:*}}"," — restart `jetic dev` from the latest build. Human values will resolve empty and the dialog will never appear."]}),(n.humanKeys??[]).filter(u=>u.source==="prompt").map(u=>s.jsxs("p",{className:"text-amber-400",children:["◉ will ask for ",`{{human:${u.key}}}`," when reached"]},`need-${u.key}`)),(n.humanKeys??[]).filter(u=>u.source!=="prompt").map(u=>s.jsxs("p",{className:"theme-text-faint",children:["↳ human ",`{{human:${u.key}}}`," ← ",my[u.source]??u.source," (ready)"]},`have-${u.key}`)),(n.notes??[]).map((u,f)=>s.jsx("p",{className:"theme-text-faint",children:u},`note-${f}`)),n.stepResults.map((u,f)=>{if(!u&&n.stepStatuses[f]!=="running")return null;const h=r[f],g=bf(h.method);return n.stepStatuses[f]==="running"?s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 theme-text-muted",children:[s.jsx(dt,{className:"h-3 w-3 animate-spin text-blue-400",strokeWidth:2}),s.jsxs("span",{className:"theme-text-faint",children:["Step ",f+1,"/",r.length]}),s.jsx("span",{className:g.text,children:h.method}),s.jsx("span",{className:"theme-text",children:h.path}),s.jsx("span",{className:"theme-text-faint",children:"…"})]}),i===f&&s.jsx("p",{className:"pl-5 text-amber-400",children:"⏳ Waiting for your input — answer the dialog to resume the run."})]},f):u?s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:u.passed?"text-emerald-400":"text-red-400",children:u.passed?"✓":"✗"}),s.jsxs("span",{className:"theme-text-faint",children:["Step ",f+1,"/",r.length]}),s.jsx("span",{className:`${g.text}`,children:h.method.padEnd(6)}),s.jsx("span",{className:"theme-text",children:h.path}),s.jsx("span",{className:`${u.passed?"text-emerald-400":"text-red-400"}`,children:u.status>0?u.status:"NO RESPONSE"}),s.jsxs("span",{className:"theme-text-faint",children:[u.durationMs,"ms"]})]}),h.name&&s.jsx("p",{className:"pl-5 theme-text-faint italic",children:h.name}),Object.entries(u.injected??{}).filter(([m])=>m!=="Content-Type").map(([m,p])=>s.jsxs("p",{className:"pl-5 theme-text-faint",children:["↳ ",s.jsxs("span",{className:"text-amber-500/80",children:[m,":"]})," ",s.jsx("span",{className:"theme-text-faint",children:String(p).length>60?String(p).slice(0,57)+"…":p})]},m)),u.captured.map((m,p)=>s.jsxs("p",{className:"pl-5 text-emerald-400",children:["↳ captured ",m]},p)),u.conditionResult&&s.jsxs("p",{className:`pl-5 ${u.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:["◇ condition ",u.conditionResult.passed?"passed":"failed"," — ",u.conditionResult.reason,!u.conditionResult.passed&&h.condition&&s.jsxs("span",{className:"text-orange-300/70",children:[" → ",h.condition.onFail,h.condition.onFail==="switch"&&h.condition.switchToWorkflow?`: ${h.condition.switchToWorkflow}`:""]})]}),u.error&&s.jsxs("p",{className:"pl-5 text-red-400",children:["Error: ",u.error]}),!u.passed&&u.responseBody&&!u.error&&s.jsxs("p",{className:"pl-5 text-red-400/80 truncate",children:["Response: ",typeof u.responseBody=="string"?u.responseBody.slice(0,120):JSON.stringify(u.responseBody).slice(0,120)]})]},f):null}),n.phase==="done"&&s.jsxs("p",{className:`mt-1 ${n.failed===0?"text-emerald-400":"text-amber-400"}`,children:["✓ Done — ",n.passed,"/",n.passed+n.failed," steps passed"]}),n.phase==="aborted"&&s.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Aborted — ",n.error]}),n.phase==="error"&&s.jsxs("p",{className:"mt-1 text-red-400",children:["✗ Error — ",n.error]})]})]})}const A3=[{label:"Equality",ops:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"}]},{label:"Comparison",ops:[{value:"greater_than",label:"greater than"},{value:"greater_than_or_equal",label:"greater than or equal"},{value:"less_than",label:"less than"},{value:"less_than_or_equal",label:"less than or equal"}]},{label:"Existence",ops:[{value:"exists",label:"exists"},{value:"not_exists",label:"does not exist"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},{label:"Text / Collection",ops:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"}]}];function p0(){return{left:"",operator:"equals",right:""}}function R3({stepIndex:n,existingCondition:r,capturedKeys:i,onSave:o,onRemove:u,onCancel:f}){const[h,g]=j.useState(r?.rules.all?"all":r?.rules.any?"any":"all"),x=r?.rules.all??r?.rules.any??[],[m,p]=j.useState(x.length>0?x:[p0()]),[b,v]=j.useState(r?.onFail??"abort"),[N,T]=j.useState(r?.switchToWorkflow??""),[_,M]=j.useState(r?.returnOnComplete??!0),A=(X,ie)=>{p(I=>I.map((K,ne)=>ne===X?{...K,...ie}:K))},V=()=>p(X=>[...X,p0()]),L=X=>p(ie=>ie.filter((I,K)=>K!==X)),C=()=>{const X=m.filter(I=>I.left.trim()!=="");if(X.length===0)return;const ie={rules:h==="all"?{all:X}:{any:X},onFail:b,...b==="switch"&&N.trim()?{switchToWorkflow:N.trim(),returnOnComplete:_}:{}};o(ie)},D="h-7 rounded-lg border theme-border theme-bg-overlay-md px-2 text-[11px] theme-text-primary placeholder-[var(--text-faint)] outline-none focus:border-purple-500/60 transition-colors",W=`${D} cursor-pointer`;return s.jsxs("div",{className:"mt-2 rounded-lg border border-purple-500/20 bg-purple-500/[0.04] p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ea,{className:"h-3 w-3 text-purple-400",strokeWidth:2}),s.jsx("span",{className:"text-[10px] font-semibold text-purple-400 uppercase tracking-wider",children:"Step Condition"}),s.jsx("span",{className:"text-[10px] theme-text-faint ml-1",children:"— evaluated after this step runs"}),s.jsx("div",{className:"ml-auto flex items-center gap-1",children:["all","any"].map(X=>s.jsx("button",{type:"button",onClick:()=>g(X),className:`px-2 py-0.5 rounded text-[9px] font-semibold transition-colors hover:cursor-pointer ${h===X?"bg-purple-500/20 text-purple-400 border border-purple-500/40":"theme-bg-overlay-md theme-text-faint border theme-border hover:theme-text-muted"}`,children:X==="all"?"AND":"OR"},X))})]}),s.jsxs("div",{className:"space-y-2",children:[m.map((X,ie)=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{list:`cond-left-${n}-${ie}`,value:X.left,onChange:I=>A(ie,{left:I.target.value}),placeholder:"{{workflow:key}} or value",className:`flex-1 min-w-0 ${D}`}),s.jsx("datalist",{id:`cond-left-${n}-${ie}`,children:i.map(I=>s.jsx("option",{value:`{{${I}}}`},I))}),s.jsx("select",{value:X.operator,onChange:I=>A(ie,{operator:I.target.value,right:f0.includes(I.target.value)?void 0:X.right}),className:`w-44 shrink-0 ${W}`,children:A3.map(I=>s.jsx("optgroup",{label:I.label,children:I.ops.map(K=>s.jsx("option",{value:K.value,children:K.label},K.value))},I.label))}),f0.includes(X.operator)?s.jsx("div",{className:"flex-1"}):s.jsx("input",{value:X.right??"",onChange:I=>A(ie,{right:I.target.value}),placeholder:"value or {{workflow:key}}",className:`flex-1 min-w-0 ${D}`}),m.length>1&&s.jsx("button",{type:"button",onClick:()=>L(ie),className:"shrink-0 theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})})]},ie)),s.jsxs("button",{type:"button",onClick:V,className:"flex items-center gap-1 text-[10px] text-purple-400/70 hover:text-purple-400 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3",strokeWidth:2})," Add rule"]})]}),s.jsxs("div",{className:"flex flex-col gap-2 pt-1 border-t border-purple-500/10",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] theme-text-faint shrink-0",children:"If condition fails →"}),["abort","continue","switch"].map(X=>s.jsx("button",{type:"button",onClick:()=>v(X),className:`px-2 py-0.5 rounded text-[9px] font-medium capitalize transition-colors border hover:cursor-pointer ${b===X?X==="abort"?"bg-red-500/20 text-red-400 border-red-500/40":X==="continue"?"bg-emerald-500/20 text-emerald-400 border-emerald-500/40":"bg-blue-500/20 text-blue-400 border-blue-500/40":"theme-bg-overlay-md theme-text-faint theme-border hover:theme-text-muted"}`,children:X},X)),b==="switch"&&s.jsx("input",{value:N,onChange:X=>T(X.target.value),placeholder:"workflow-slug",className:`flex-1 ${D}`})]}),b==="switch"&&s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] theme-text-muted cursor-pointer select-none ml-1",children:[s.jsx("input",{type:"checkbox",checked:_,onChange:X=>M(X.target.checked),className:"rounded theme-border theme-bg-overlay-md text-purple-500 focus:ring-0"}),s.jsxs("span",{children:["Return to main workflow after completing ",s.jsx("code",{className:"text-purple-400",children:N||"sub-workflow"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsxs("button",{type:"button",onClick:C,disabled:m.every(X=>!X.left.trim()),className:"flex items-center gap-1 rounded-lg bg-purple-500/20 border border-purple-500/40 px-3 py-1 text-[10px] text-purple-400 hover:bg-purple-500/30 transition-colors disabled:opacity-40 hover:cursor-pointer",children:[s.jsx(ut,{className:"h-3 w-3",strokeWidth:2})," Save Condition"]}),r&&s.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-1 text-[10px] text-red-400/80 hover:bg-red-500/15 transition-colors hover:cursor-pointer",children:[s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})," Remove"]}),s.jsxs("button",{type:"button",onClick:f,className:"ml-auto flex items-center gap-1 rounded-lg border theme-border px-3 py-1 text-[10px] theme-text-muted hover:theme-text transition-colors hover:cursor-pointer",children:[s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})," Cancel"]})]})]})}function z3({step:n,index:r,total:i,status:o,result:u,allSteps:f,onConditionChange:h,waitingHuman:g}){const[x,m]=j.useState(!1),[p,b]=j.useState(!1),v=n.capture&&Object.keys(n.capture).length>0,N=n.inject&&Object.keys(n.inject).length>0,T=n.body&&Object.keys(n.body).length>0,_=!!n.condition,M=vf(n),A=[];for(let C=0;C<=r;C++){const D=f[C];Object.keys(D.capture??{}).forEach(W=>A.push(W)),Object.keys(D.captureInput??{}).forEach(W=>A.push(W))}const V=g?s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-amber-500/15 text-amber-400",title:"Waiting for your input — answer the dialog to resume",children:s.jsx(zr,{className:"h-3 w-3 animate-pulse",strokeWidth:2})}):{idle:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full border theme-border text-[9px] theme-text-faint",children:r+1}),running:s.jsx(dt,{className:"h-5 w-5 text-blue-400 animate-spin",strokeWidth:2}),passed:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-400",children:s.jsx(ut,{className:"h-3 w-3",strokeWidth:2})}),failed:s.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-red-500/10 text-red-400",children:s.jsx(Ht,{className:"h-3 w-3",strokeWidth:2})}),skipped:s.jsx("span",{className:"h-5 w-5 rounded-full border theme-border theme-bg-overlay-md"})}[o],L=_&&n.condition?(()=>{const C=n.condition.rules.all??n.condition.rules.any??[],D=n.condition.rules.all?"AND":"OR";return`${C.length} rule${C.length!==1?"s":""} ${D} → ${n.condition.onFail}`})():null;return s.jsxs("div",{className:"relative",children:[r<i-1&&s.jsx("div",{className:`absolute left-[19px] top-[38px] bottom-0 w-px z-0 transition-colors duration-500 ${o==="passed"?"bg-emerald-500/20":"bg-[var(--border)]"}`}),s.jsxs("div",{className:"relative z-10",children:[s.jsxs("button",{type:"button",onClick:()=>m(C=>!C),className:"flex w-full items-center gap-3 px-4 py-2.5 hover:theme-bg-overlay-md transition-colors text-left hover:cursor-pointer",children:[s.jsx("span",{className:"shrink-0",children:V}),s.jsx(v3,{method:n.method}),s.jsx("span",{className:"font-mono text-xs theme-text flex-1 truncate",children:n.path}),u&&s.jsxs("span",{className:`font-mono text-[10px] ${u.passed?"text-emerald-400":"text-red-400"}`,children:[u.status>0?u.status:"ERR"," · ",u.durationMs,"ms"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[N&&s.jsx("span",{className:"rounded bg-amber-500/10 px-1 py-0.5 text-[9px] text-amber-400",children:"auth"}),v&&s.jsx("span",{className:"rounded bg-blue-500/10 px-1 py-0.5 text-[9px] text-blue-400",children:"capture"}),M.length>0&&s.jsxs("span",{title:`Needs human input at runtime: ${M.map(C=>`{{human:${C}}}`).join(", ")}`,className:"rounded bg-orange-500/10 px-1 py-0.5 text-[9px] text-orange-400 flex items-center gap-0.5",children:[s.jsx(zr,{className:"h-2.5 w-2.5",strokeWidth:2})," human"]}),_&&s.jsxs("span",{className:"rounded bg-purple-500/10 px-1 py-0.5 text-[9px] text-purple-400 flex items-center gap-0.5",children:[s.jsx(ea,{className:"h-2.5 w-2.5",strokeWidth:2})," condition"]}),u?.conditionResult&&s.jsxs("span",{className:`rounded px-1 py-0.5 text-[9px] ${u.conditionResult.passed?"bg-purple-500/10 text-purple-400":"bg-orange-500/10 text-orange-400"}`,children:["◇ ",u.conditionResult.passed?"passed":"failed"]})]}),s.jsx("span",{className:"theme-text-faint shrink-0",children:x?s.jsx(qa,{className:"h-3.5 w-3.5"}):s.jsx(bl,{className:"h-3.5 w-3.5"})})]}),x&&s.jsxs("div",{className:"ml-12 mr-4 my-3 space-y-2.5 rounded-lg border-y theme-border theme-bg-overlay p-3",children:[n.description&&s.jsx("p",{className:"text-[11px] theme-text-muted",children:n.description}),u&&s.jsxs("div",{className:`rounded-lg border px-3 py-2 ${u.passed?"border-emerald-500/15 bg-emerald-500/[0.05]":"border-red-500/15 bg-red-500/[0.05]"}`,children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider",children:"Response"}),u.error?s.jsx("p",{className:"text-[11px] text-red-400",children:u.error}):s.jsx("pre",{className:"text-[10px] theme-text-muted overflow-auto max-h-24 whitespace-pre-wrap break-all",children:typeof u.responseBody=="string"?u.responseBody.slice(0,300):JSON.stringify(u.responseBody,null,2).slice(0,300)})]}),T&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider",children:"Request Body"}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.body).map(([C,D])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay-md px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] theme-text",children:C}),s.jsx("span",{className:"font-mono text-[10px] text-blue-400/80 truncate",children:String(D)})]},C))})]}),N&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider flex items-center gap-1",children:[s.jsx(A0,{className:"h-3 w-3",strokeWidth:2})," Inject"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.inject).map(([C,D])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-amber-500/[0.05] border border-amber-500/15 px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-amber-400/80",children:C}),s.jsx(dl,{className:"h-3 w-3 theme-text-faint shrink-0",strokeWidth:2}),s.jsx("span",{className:"font-mono text-[10px] theme-text-muted",children:D})]},C))})]}),v&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider flex items-center gap-1",children:[s.jsx(hs,{className:"h-3 w-3",strokeWidth:2})," Capture"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(n.capture).map(([C,D])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-blue-500/[0.05] border border-blue-500/15 px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-blue-400",children:C}),s.jsx(dl,{className:"h-3 w-3 theme-text-faint shrink-0",strokeWidth:2}),s.jsx("span",{className:"font-mono text-[10px] theme-text-muted",children:D})]},C))})]}),s.jsxs("div",{className:"pt-1",children:[_&&L&&!p&&s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-purple-500/20 bg-purple-500/[0.04] px-3 py-2 mb-2",children:[s.jsx(ea,{className:"h-3 w-3 text-purple-400 shrink-0",strokeWidth:2}),s.jsx("span",{className:"text-[10px] text-purple-400 flex-1",children:L}),u?.conditionResult&&s.jsx("span",{className:`text-[9px] font-medium ${u.conditionResult.passed?"text-purple-400":"text-orange-400"}`,children:u.conditionResult.passed?"✓ passed":"✗ failed"}),s.jsx("button",{type:"button",onClick:()=>b(!0),className:"shrink-0 theme-text-faint hover:text-purple-400 transition-colors hover:cursor-pointer",children:s.jsx(Ov,{className:"h-3 w-3",strokeWidth:2})})]}),p?s.jsx(R3,{stepIndex:r,existingCondition:n.condition,capturedKeys:A,onSave:C=>{h(r,C),b(!1)},onRemove:()=>{h(r,void 0),b(!1)},onCancel:()=>b(!1)}):!_&&s.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex items-center gap-1.5 text-[10px] theme-text-faint hover:text-purple-400 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3",strokeWidth:2}),s.jsx(ea,{className:"h-3 w-3",strokeWidth:2}),"Add Condition"]})]})]})]})]})}function Ed(n){return{phase:"idle",currentStep:-1,stepStatuses:Array(n).fill("idle"),stepResults:Array(n).fill(null),passed:0,failed:0,humanKeys:[],notes:[]}}const my={run:"pre-seeded for this run",env:"environment variable",memory:"saved human memory",prompt:"your answer"};function O3({workflow:n,onDelete:r,onViewTraces:i}){const[o,u]=j.useState(n),[f,h]=j.useState("list"),[g,x]=j.useState(!1),[m,p]=j.useState(!1),[b,v]=j.useState(!1),[N,T]=j.useState(()=>Ed(o.steps.length)),[_,M]=j.useState(void 0),[A,V]=j.useState([]),[L,C]=j.useState(null),[D,W]=j.useState(""),X=j.useRef(!1),ie=j.useRef(null),I=j.useRef(""),K=j.useRef("local-sim"),ne=j.useRef({}),ee=j.useRef(new Set),se=j.useRef(null),[S,U]=j.useState(null),[k,H]=j.useState(""),[O,z]=j.useState(null),[E,$]=j.useState(!1),Z=j.useRef(null),ae=async(q,Y)=>{const ue=o.steps.map((P,Ee)=>{if(Ee!==q)return P;if(Y===void 0){const{condition:ge,...ke}=P;return ke}return{...P,condition:Y}}),re={...o,steps:ue};u(re);try{await b3(o._file,ue)}catch{}};j.useEffect(()=>{fetch("/api/model/environments").then(q=>q.ok?q.json():null).then(q=>{if(!q)return;const Y=q.environments??[];V(Y);const ue=q.defaultEnvironment??Y.find(P=>P.default)?.name??Y[0]?.name??null;C(ue);const re=Y.find(P=>P.name===ue);re&&W(re.baseUrl)}).catch(()=>{})},[]);const oe=async()=>{if(confirm(`Delete workflow "${o.name}"? This cannot be undone.`)){v(!0);try{await N3(o._file),r()}catch(q){alert(`Failed to delete: ${q.message}`),v(!1)}}},he=()=>{if(X.current=!0,ie.current?.close(),ie.current=null,Z.current){const q=Z.current;Z.current=null,U(null),q(null)}else S&&ve();T(q=>({...q,phase:q.phase==="running"?"aborted":q.phase}))},me=async(q,Y)=>{if(!se.current)throw new Error("Run id lost — please re-run the workflow.");const ue=await fetch("/api/workflows/human-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:se.current,key:q,value:Y})}),re=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(re.error??`HTTP ${ue.status}`)},Se=async()=>{if(S){if(Z.current){const q=Z.current;Z.current=null,U(null),H(""),q(k);return}$(!0),z(null);try{await me(S.key,k),U(null),H("")}catch(q){z(q.message)}finally{$(!1)}}},ve=async()=>{if(S){if(Z.current){const q=Z.current;Z.current=null,U(null),H(""),z(null),q(null);return}try{await me(S.key,null)}catch{}U(null),H(""),z(null)}},Ae=()=>{he(),T(Ed(o.steps.length))},Re=async(q,Y,ue)=>{const re=new Date().toISOString(),P={id:crypto.randomUUID(),workflowName:o.name,workflowFile:o._file,startedAt:ue,finishedAt:re,durationMs:q.stepResults.reduce((ge,ke)=>ge+(ke?.durationMs??0),0),phase:q.phase==="done"?"done":q.phase==="aborted"?"aborted":"error",passed:q.passed,failed:q.failed,baseUrl:q.baseUrl,source:Y,steps:o.steps.map((ge,ke)=>{const Oe=q.stepResults[ke];return{index:ke,name:ge.name,method:ge.method,path:ge.path,description:ge.description,status:Oe?.status??0,passed:Oe?.passed??!1,durationMs:Oe?.durationMs??0,captured:Object.fromEntries((Oe?.captured??[]).map(ze=>[ze,"(captured)"])),injected:Oe?.injected??{},requestBody:ge.body,responseBody:Oe?.responseBody,error:Oe?.error??null,expectStatus:ge.expectStatus,captureSpec:ge.capture,injectSpec:ge.inject,conditionSpec:ge.condition,conditionResult:Oe?.conditionResult}})},Ee=await g2(P);M(Ee)},We=q=>{X.current=!1,se.current=null,ee.current=new Set,Z.current=null,U(null),H(""),z(null);const Y=o.steps.length;T({...Ed(Y),baseUrl:D||void 0}),M(void 0),I.current=new Date().toISOString(),K.current="local-sim",x(!0);const ue=(P,Ee,ge)=>new Promise(ke=>{H(""),z(null),U({key:P,stepIndex:Ee,stepName:ge}),Z.current=ke}),re=async()=>{T(Oe=>({...Oe,phase:"running",baseUrl:D||Oe.baseUrl})),ne.current={};let P=0,Ee=0,ge=!1,ke="";for(let Oe=0;Oe<Y&&!(X.current||ge);Oe++){const ze=o.steps[Oe],Tt=vf(ze);for(const pe of Tt){if(X.current)break;if(ne.current[`human:${pe}`]!==void 0)continue;T(je=>{const Le=[...je.stepStatuses];return Le[Oe]="running",{...je,stepStatuses:Le,currentStep:Oe}});const Ve=await ue(pe,Oe,ze.name);if(Ve===null||X.current){T(je=>({...je,phase:"aborted",error:"Run cancelled by user"}));return}ne.current[`human:${pe}`]=Ve,T(je=>({...je,notes:[...je.notes??[],`↳ human {{human:${pe}}} ← your answer`]}))}if(X.current)break;T(pe=>{const Ve=[...pe.stepStatuses];return Ve[Oe]="running",{...pe,stepStatuses:Ve,currentStep:Oe}});const Mt=600+Math.random()*800;if(await new Promise(pe=>{const Ve=setTimeout(pe,Mt),je=setInterval(()=>{X.current&&(clearTimeout(Ve),clearInterval(je),pe())},50);setTimeout(()=>clearInterval(je),Mt+100)}),X.current)break;Object.keys(ze.capture??{}).forEach(pe=>{ne.current[pe]="[simulated]"}),Object.keys(ze.captureInput??{}).forEach(pe=>{ne.current[pe]="[simulated]"});let ft;if(ze.condition&&(ft=y3(ze.condition,ne.current),!ft.passed)){const{onFail:pe,returnOnComplete:Ve}=ze.condition;pe==="abort"?(ge=!0,ke=`Condition failed at step ${Oe+1}: ${ft.reason}`):pe==="continue"?(ge=!0,ke="Condition failed → continuing without remaining steps"):pe==="switch"&&(Ve||(ge=!0,ke=`Condition failed → switched to: ${ze.condition.switchToWorkflow??"unknown"}`))}const nt=!0,pt=Math.round(Mt),at={index:Oe,step:{name:ze.name,method:ze.method,path:ze.path,description:ze.description},status:200,passed:nt,durationMs:pt,captured:Object.keys(ze.capture??{}).map(pe=>pe.split(":").pop()??pe),injected:{},responseBody:{simulated:!0},error:null,conditionResult:ft};if(P++,T(pe=>{const Ve=[...pe.stepStatuses],je=[...pe.stepResults];return Ve[Oe]="passed",je[Oe]=at,{...pe,stepStatuses:Ve,stepResults:je,passed:P,failed:Ee}}),ge)break}if(!X.current)if(ge){const Oe={phase:"aborted",stepStatuses:N.stepStatuses,stepResults:N.stepResults,passed:P,failed:Ee,baseUrl:D||void 0};T(ze=>({...ze,phase:"aborted",error:ke})),Re(Oe,"local-sim",I.current)}else{const Oe={phase:"done",stepStatuses:Array(Y).fill("passed"),stepResults:o.steps.map((ze,Tt)=>({index:Tt,step:{name:ze.name,method:ze.method,path:ze.path,description:ze.description},status:200,passed:!0,durationMs:Math.round(600+Math.random()*800),captured:Object.keys(ze.capture??{}).map(Mt=>Mt.split(":").pop()??Mt),injected:{},responseBody:{simulated:!0},error:null})),passed:P,failed:Ee};T(ze=>({...ze,phase:"done",passed:P,failed:Ee})),Re(Oe,"local-sim",I.current)}};fetch("/api/workflows/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:o._file,baseUrl:D||void 0,humanInputs:q})}).then(P=>{if(!P.ok||!P.body){re();return}K.current="api";const Ee=P.body.getReader(),ge=new TextDecoder;let ke="";T(ze=>({...ze,phase:"running"})),(async()=>{let ze=!1;for(;!X.current;){const{value:Tt,done:Mt}=await Ee.read();if(Mt)break;ze=!0,ke+=ge.decode(Tt,{stream:!0});const ft=ke.split(`
|
|
392
|
-
`);ke=ft.pop()??"";for(const nt of ft){const pt=nt.trim();if(!pt.startsWith("data:"))continue;const at=pt.slice(5).trim();if(!at)continue;let pe;try{pe=JSON.parse(at)}catch{continue}if(pe.type==="human_input_required"){H(""),z(null),U({key:String(pe.key??""),stepIndex:Number(pe.stepIndex??-1),stepName:String(pe.stepName??"")});continue}T(Ve=>{const je={...Ve};if(pe.type==="start")je.phase="running",je.baseUrl=pe.baseUrl,je.humanKeys=Array.isArray(pe.humanKeys)?pe.humanKeys:[],je.notes=[],je.humanUnsupported=!Array.isArray(pe.humanKeys)&&w3(o.steps).length>0,typeof pe.runId=="string"&&(se.current=pe.runId);else if(pe.type==="human_resolved"){const Le=`${pe.index}:${pe.key}`;if(!ee.current.has(Le)){ee.current.add(Le);const Ge=my[String(pe.source)]??String(pe.source??"run");je.notes=[...je.notes??[],`↳ human {{human:${pe.key}}} ← ${Ge}`]}}else if(pe.type==="step_start"){const Le=pe.index,Ge=[...je.stepStatuses];Ge[Le]="running",je.stepStatuses=Ge,je.currentStep=Le}else if(pe.type==="step_result"){const Le=pe.index,Ge=[...je.stepStatuses],At=[...je.stepResults];Ge[Le]=pe.passed?"passed":"failed",At[Le]={index:pe.index,step:pe.step??{name:"",method:"",path:""},status:pe.status,passed:pe.passed,durationMs:pe.durationMs,captured:pe.captured??[],injected:pe.injected??{},responseBody:pe.responseBody,error:pe.error??null},pe.passed?je.passed=(je.passed??0)+1:je.failed=(je.failed??0)+1,je.stepStatuses=Ge,je.stepResults=At}else if(pe.type==="condition_result"){const Le=pe.index,Ge=[...je.stepResults];Ge[Le]&&(Ge[Le]={...Ge[Le],conditionResult:{passed:pe.passed,reason:pe.reason}},je.stepResults=Ge)}else if(pe.type==="aborted"){const Le=[...je.stepStatuses];for(let Ge=0;Ge<Le.length;Ge++)Le[Ge]==="running"?Le[Ge]="failed":Le[Ge]==="idle"&&(Le[Ge]="skipped");je.stepStatuses=Le,je.phase="aborted",je.error=pe.reason,Re(je,"api",I.current)}else pe.type==="done"&&(je.phase="done",(pe.passed>0||pe.failed>0)&&(je.passed=pe.passed,je.failed=pe.failed),pe.conditionBranch==="continue"?je.error="Condition failed → remaining steps skipped":pe.conditionBranch==="switch"&&(je.error=`Condition failed → switched to: ${pe.switchToWorkflow??"unknown"}`),Re(je,"api",I.current));return je})}}!ze&&!X.current&&re()})().catch(()=>{X.current||re()})}).catch(()=>{X.current||re()})},Te=N.phase==="running",be=N.phase!=="idle";return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>We(),className:"absolute -top-2 -right-2 flex items-center gap-1 rounded-full theme-bg-brand px-2 py-0.5 text-[10px] font-medium text-[color:var(--brand-foreground)] shadow-sm z-10 hover:opacity-90 transition-colors hover:cursor-pointer",children:[s.jsx(_d,{size:10})," Run Workflow"]}),s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b theme-border",children:[s.jsx("button",{type:"button",onClick:()=>p(q=>!q),className:"text-[color:var(--brand)]/70 hover:text-[color:var(--brand)] transition-colors shrink-0 hover:cursor-pointer",children:m?s.jsx(bl,{className:"h-3.5 w-3.5"}):s.jsx(qa,{className:"h-3.5 w-3.5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"theme-text-primary truncate",children:o.name}),o.generatedAt&&s.jsxs("p",{className:"flex items-center gap-1 text-[10px] theme-text-faint mt-0.5",children:[s.jsx(Gr,{className:"h-2.5 w-2.5",strokeWidth:2}),new Date(o.generatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"rounded-full border theme-border theme-bg-overlay-md px-2 py-0.5 text-[10px] theme-text-muted shrink-0",children:[o.steps.length," steps"]}),be&&s.jsxs("span",{className:`flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] shrink-0 ${N.phase==="done"&&N.failed===0?"bg-emerald-500/10 text-emerald-400":N.phase==="running"?"bg-blue-500/10 text-blue-400":"bg-red-500/10 text-red-400"}`,children:[N.phase==="running"&&s.jsx(dt,{className:"h-2.5 w-2.5 animate-spin",strokeWidth:2}),N.phase==="done"&&N.failed===0&&s.jsx(ut,{className:"h-2.5 w-2.5",strokeWidth:2}),(N.phase==="done"||N.phase==="aborted")&&N.failed>0&&s.jsx(Ht,{className:"h-2.5 w-2.5",strokeWidth:2}),N.phase==="running"?"Running…":N.phase==="done"?`${N.passed}/${N.passed+N.failed}`:N.phase==="aborted"?"Aborted":"Error"]}),N.humanUnsupported&&s.jsxs("span",{title:"The connected jetic dev server predates human-input support. Restart it from the latest build — human values will otherwise resolve empty and no dialog appears.",className:"flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] shrink-0 bg-red-500/10 text-red-400",children:[s.jsx(Ht,{className:"h-2.5 w-2.5",strokeWidth:2}),"Old server — no human dialog"]}),!m&&s.jsx("div",{className:"flex items-center gap-0.5 rounded-lg border theme-border theme-bg-overlay-md p-0.5 shrink-0",children:["list","graph"].map(q=>s.jsxs("button",{type:"button",onClick:()=>h(q),className:`flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors hover:cursor-pointer ${f===q?"bg-[color:var(--brand)]/20 text-[color:var(--brand)]":"theme-text-faint hover:theme-text-muted"}`,children:[q==="list"?s.jsx(O0,{className:"h-3 w-3",strokeWidth:2}):s.jsx(Id,{className:"h-3 w-3",strokeWidth:2}),q.charAt(0).toUpperCase()+q.slice(1)]},q))}),be&&!m&&s.jsxs("button",{type:"button",onClick:()=>x(q=>!q),className:`flex items-center gap-1 rounded-lg px-2.5 py-1 text-[10px] transition-colors border theme-border hover:cursor-pointer ${g?"theme-bg-overlay-md theme-text":"theme-text-faint hover:theme-text theme-bg-overlay"}`,children:[s.jsx(_v,{className:"h-3 w-3",strokeWidth:2})," Log"]}),Te&&s.jsxs("button",{type:"button",onClick:he,className:"flex items-center gap-1 rounded-lg border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] text-red-400 hover:bg-red-500/20 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(Jv,{className:"h-3 w-3",strokeWidth:2})," Stop"]}),be&&!Te&&s.jsxs("button",{type:"button",onClick:Ae,className:"flex items-center gap-1 rounded-lg border theme-border theme-bg-overlay px-2.5 py-1 text-[10px] theme-text-muted hover:theme-text transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(Bv,{className:"h-3 w-3",strokeWidth:2})," Reset"]}),be&&!Te&&i&&s.jsxs("button",{type:"button",onClick:()=>i(o.name,_),className:"flex items-center gap-1 rounded-lg border border-[color:var(--brand)]/30 bg-[color:var(--brand)]/10 px-2.5 py-1 text-[10px] text-[color:var(--brand)] hover:bg-[color:var(--brand)]/20 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(Vr,{className:"h-3 w-3",strokeWidth:2}),_?"View Trace":"Traces"]}),!Te&&s.jsxs("button",{type:"button",onClick:()=>We(),className:"hidden items-center gap-1.5 rounded-lg theme-bg-brand px-3 py-1.5 text-[10px] font-medium text-[color:var(--brand-foreground)] hover:opacity-90 transition-colors shrink-0 hover:cursor-pointer",children:[s.jsx(_d,{className:"h-3 w-3",strokeWidth:2}),be?"Re-run":"Run"]}),!o._legacy&&!Te&&s.jsx("button",{type:"button",onClick:oe,disabled:b,title:"Delete workflow",className:"flex items-center gap-1 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-2 py-1 text-[10px] text-red-400/80 hover:bg-red-500/20 hover:text-red-400 transition-colors shrink-0 disabled:opacity-40 hover:cursor-pointer",children:b?s.jsx(dt,{className:"h-3 w-3 animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-3 w-3",strokeWidth:2})})]}),!m&&s.jsxs(s.Fragment,{children:[A.length>0&&s.jsxs("div",{className:"flex items-center gap-2 border-b theme-border px-4 py-2 theme-bg-overlay-md flex-wrap",children:[s.jsx(vl,{className:"h-3 w-3 theme-text-faint shrink-0",strokeWidth:2}),s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mr-1",children:"Env:"}),A.map(q=>{const Y=L===q.name;return s.jsxs("button",{type:"button",onClick:()=>{C(q.name),W(q.baseUrl)},className:`flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[10px] font-medium transition-all hover:cursor-pointer ${Y?"border-[color:var(--brand)]/40 bg-[color:var(--brand)]/10 text-[color:var(--brand)]":"theme-border theme-text-faint hover:border-[color:var(--brand)]/20 hover:theme-text-muted"}`,children:[s.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${Y?"bg-[color:var(--brand)]":"bg-[var(--text-faint)]"}`}),q.name]},q.name)}),L&&s.jsx("span",{className:"ml-auto font-mono text-[10px] theme-text-faint truncate max-w-[180px]",children:D})]}),g&&s.jsx("div",{className:"border-b theme-border",children:s.jsx(M3,{runState:N,steps:o.steps,waitingStepIndex:S?.stepIndex??null})}),f==="list"&&s.jsx("div",{className:"divide-y divide-[var(--border)]",children:o.steps.map((q,Y)=>s.jsx(z3,{step:q,index:Y,total:o.steps.length,status:N.stepStatuses[Y]??"idle",result:N.stepResults[Y]??null,allSteps:o.steps,onConditionChange:ae,waitingHuman:S?.stepIndex===Y},Y))}),f==="graph"&&s.jsx("div",{className:"p-4",children:s.jsx(T3,{steps:o.steps,runState:N})})]})]}),S&&s.jsx(E3,{title:"Human input required",subtitle:S.stepName?`Step ${S.stepIndex+1} · ${S.stepName}`:`Step ${S.stepIndex+1}`,fields:[{key:S.key}],values:{[S.key]:k},onChange:(q,Y)=>H(Y),onSubmit:Se,onCancel:ve,submitLabel:"Submit & resume run",error:O,submitting:E})]})}function D3(){return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-[color:var(--brand)]/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full border theme-border theme-bg-overlay text-[color:var(--brand)]",children:s.jsx(ea,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium theme-text-primary",children:"No workflows yet"}),s.jsx("p",{className:"mt-1 text-[11px] theme-text-muted"}),s.jsxs("p",{className:"mt-1 text-[11px] theme-text-faint",children:["Workflows are stored in ",s.jsx("code",{className:"theme-text-faint",children:".jetic/workflows/"})]})]})]})}function H3({onViewTraces:n}){const[r,i]=j.useState([]),[o,u]=j.useState(!0),[f,h]=j.useState(!1),[g,x]=j.useState(null),m=j.useCallback(async(b=!1)=>{b?h(!0):u(!0),x(null);try{i(await j3())}catch(v){x(v.message)}finally{u(!1),h(!1)}},[]);j.useEffect(()=>{m()},[m]);const p=b=>{i(v=>v.filter(N=>N._file!==b))};return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b theme-border px-6 py-5 sticky",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium theme-text-primary leading-none",children:"Simulations"}),s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:o?"Loading…":`${r.length} workflow${r.length!==1?"s":""} found`})]})}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("button",{type:"button",onClick:()=>m(!0),disabled:f||o,className:"flex h-6 w-6 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:theme-bg-overlay-md hover:theme-text disabled:opacity-40 transition-all hover:cursor-pointer",children:s.jsx(na,{className:`h-3.5 w-3.5 ${f?"animate-spin":""}`,strokeWidth:2})})})]}),s.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-6 overflow-y-auto max-h[(calc(100vh-60px))]",children:[o&&s.jsx("div",{className:"space-y-3",children:[1,2].map(b=>s.jsx("div",{className:"h-16 animate-pulse rounded-lg border theme-border theme-bg-overlay",style:{opacity:1-b*.3}},b))}),!o&&g&&s.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.06] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-300",children:"Could not load simulations"}),s.jsx("p",{className:"mt-1 text-[11px] text-red-400/80",children:g})]}),s.jsx("button",{type:"button",onClick:()=>m(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[11px] text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!o&&!g&&r.length===0&&s.jsx(D3,{}),!o&&!g&&r.length>0&&s.jsx("div",{className:"space-y-5",children:r.map((b,v)=>s.jsx(O3,{workflow:b,onDelete:()=>p(b._file),onViewTraces:n?(N,T)=>n({workflowName:N,traceId:T}):void 0},`${b._file}-${v}`))}),!o&&!g&&r.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 border-t theme-border pt-3 text-[10px] theme-text-faint",children:["Workflows from ",s.jsx("code",{className:"theme-text-faint",children:".jetic/workflows/"})]})]})]})}const $3={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"#34d399"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",dot:"#60a5fa"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",dot:"#fbbf24"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",dot:"#fb923c"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",dot:"#f87171"},HEAD:{bg:"theme-bg-overlay-md",text:"theme-text-muted",dot:"var(--text-muted)"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",dot:"#c084fc"}};function py(n){return $3[n.toUpperCase()]??{bg:"theme-bg-overlay-md",text:"theme-text-muted",dot:"var(--text-muted)"}}async function U3(){const n=await fetch("/api/model");if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}async function B3(){const n=await fetch("/api/model/scan",{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Scan failed (${n.status})`)}return(await n.json()).model}async function q3(n,r){const i=await fetch(`/api/model/endpoint/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw new Error(`Save failed (${i.status})`)}async function L3(n){const r=await fetch("/api/model/endpoint",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error??`Create failed (${r.status})`)}return r.json()}function Y3({method:n}){const r=py(n);return s.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] tracking-widest ${r.bg} ${r.text}`,children:n.toUpperCase()})}function x0({value:n,onSave:r,mono:i=!0}){const[o,u]=j.useState(!1),[f,h]=j.useState(n),[g,x]=j.useState(!1),m=j.useRef(null);j.useEffect(()=>{o&&m.current?.focus()},[o]);const p=async()=>{if(f===n){u(!1);return}x(!0);try{await r(f)}finally{x(!1),u(!1)}};return o?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx("input",{ref:m,value:f,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&p(),b.key==="Escape"&&(h(n),u(!1))},className:`rounded border border-blue-500/40 theme-bg-overlay-md px-1.5 py-0.5 text-xs theme-text-primary outline-none w-56 ${i?"font-mono":""}`}),s.jsx("button",{type:"button",onClick:p,disabled:g,className:"text-emerald-400 hover:text-emerald-300 hover:cursor-pointer",children:g?s.jsx(dt,{className:"h-3 w-3 animate-spin"}):s.jsx(ut,{className:"h-3 w-3"})}),s.jsx("button",{type:"button",onClick:()=>{h(n),u(!1)},className:"theme-text-faint hover:theme-text-muted hover:cursor-pointer",children:s.jsx(_t,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:()=>u(!0),className:`group/ie inline-flex items-center gap-1 rounded px-1 py-0.5 hover:theme-bg-overlay-md transition-colors hover:cursor-pointer ${i?"font-mono":""}`,children:[s.jsx("span",{className:"text-xs theme-text",children:n}),s.jsx(Fd,{className:"h-2.5 w-2.5 theme-text-faint opacity-0 group-hover/ie:opacity-100 transition-opacity"})]})}function V3({ep:n,onUpdate:r,onInspect:i,onViewTraces:o,onEdit:u}){const[f,h]=j.useState(!1),[g,x]=j.useState(""),m=async(v,N)=>{x("");try{await q3(v,N),r(v,N)}catch(T){x(T.message)}},p=n.requestBody?.fields??{},b=n.responses??{};return s.jsxs("div",{className:"border-b theme-border last:border-0",children:[s.jsxs("button",{type:"button",onClick:()=>h(v=>!v),className:"group flex w-full items-center gap-3 px-7 py-2.5 hover:theme-bg-overlay-md transition-colors text-left hover:cursor-pointer",children:[s.jsx("span",{className:"shrink-0 theme-text-faint",children:f?s.jsx(qa,{className:"h-3.5 w-3.5"}):s.jsx(bl,{className:"h-3.5 w-3.5"})}),s.jsx(Y3,{method:n.method}),s.jsx("span",{className:"font-mono text-xs theme-text flex-1 truncate",children:n.path}),n.security&&n.security.length>0&&s.jsx(La,{className:"h-3 w-3 text-amber-500/60 shrink-0"}),n.deprecated&&s.jsx("span",{className:"rounded text-[9px] font-medium text-amber-500/60 border border-amber-500/20 px-1 py-0.5",children:"deprecated"}),s.jsxs("span",{onClick:v=>{v.stopPropagation(),u(n)},className:"inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] border theme-border theme-text-faint hover:theme-bg-overlay-md hover:theme-text hover:cursor-pointer transition-colors",children:[s.jsx(Fd,{className:"h-2.5 w-2.5"})," EDIT"]}),s.jsx("span",{onClick:v=>{v.stopPropagation(),i(n)},className:"inline-flex items-center rounded px-1.5 py-0.5 text-[10px] border border-blue-500/40 text-blue-400 hover:bg-blue-500/10 hover:border-blue-400/60 hover:cursor-pointer transition-colors",children:"INSPECT"}),o&&s.jsxs("span",{onClick:v=>{v.stopPropagation(),o(n.path)},className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] border border-blue-500/30 text-blue-400 hover:bg-blue-500/10 hover:cursor-pointer transition-colors",children:[s.jsx(Vr,{className:"h-2.5 w-2.5"})," Traces"]}),s.jsx("span",{className:"hidden sm:block text-[10px] theme-text-faint truncate max-w-[180px]",children:n.handlerName})]}),f&&s.jsxs("div",{className:"px-10 pb-4 pt-1 space-y-3 theme-bg-overlay",children:[g&&s.jsx("p",{className:"text-xs text-red-400 rounded border border-red-500/20 bg-red-500/10 px-2 py-1",children:g}),s.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider",children:"Method"}),s.jsx("select",{value:n.method,onChange:v=>m(n.id,{method:v.target.value}),className:"rounded-lg border theme-border theme-bg-overlay-md px-2 py-1 text-xs theme-text outline-none hover:cursor-pointer",children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(v=>s.jsx("option",{children:v},v))})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider",children:"Path"}),s.jsx(x0,{value:n.path,onSave:v=>m(n.id,{path:v})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1 uppercase tracking-wider",children:"Handler"}),s.jsx(x0,{value:n.handlerName??"—",onSave:v=>m(n.id,{handlerName:v}),mono:!1})]})]}),n.source&&s.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] theme-text-faint",children:[s.jsx(Kd,{className:"h-3 w-3 shrink-0",strokeWidth:2}),n.source.file.split(/[/\\]/).slice(-2).join("/"),":",n.source.line]}),Object.keys(p).length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1.5 uppercase tracking-wider",children:"Request Body"}),s.jsx("div",{className:"space-y-1",children:Object.entries(p).map(([v,N])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay-md px-3 py-1.5",children:[s.jsx("span",{className:"font-mono text-[11px] theme-text",children:v}),s.jsx("span",{className:"text-[10px] theme-text-faint",children:N.type}),N.required&&s.jsx("span",{className:"text-[10px] text-rose-400",children:"required"})]},v))})]}),Object.keys(b).length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1.5 uppercase tracking-wider",children:"Responses"}),s.jsx("div",{className:"space-y-1",children:Object.entries(b).map(([v,N])=>s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border theme-border theme-bg-overlay-md px-3 py-1.5",children:[s.jsx("span",{className:`font-mono text-[11px] ${v.startsWith("2")?"text-emerald-400":"text-red-400"}`,children:v}),N.schema&&s.jsx("span",{className:"text-[10px] theme-text-muted",children:Object.keys(N.schema).join(", ")})]},v))})]}),n.middleware&&n.middleware.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] theme-text-faint mb-1.5 uppercase tracking-wider",children:"Middleware"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((v,N)=>s.jsx("span",{className:"rounded-lg border theme-border theme-bg-overlay-md px-2 py-0.5 text-[10px] theme-text-muted",children:v.name},N))})]})]})]})}function G3({prefix:n,endpoints:r,onUpdate:i,onInspect:o,onViewTraces:u,onEdit:f}){const[h,g]=j.useState(!1);return s.jsxs("div",{children:[s.jsxs("button",{type:"button",onClick:()=>g(x=>!x),className:"flex w-full items-center gap-3 px-4 py-2 hover:theme-bg-overlay-md transition-colors theme-bg-overlay hover:cursor-pointer",children:[s.jsx("span",{className:"text-blue-400",children:h?s.jsx(bl,{className:"h-3 w-3"}):s.jsx(qa,{className:"h-3 w-3"})}),s.jsx("span",{className:"font-mono text-xs font-medium text-blue-400",children:n}),s.jsx("span",{className:"ml-auto rounded-full border theme-border theme-bg-overlay-md px-2 py-0.5 text-[10px] theme-text-muted",children:r.length})]}),s.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[calc(100vh-280px)]",children:!h&&r.map(x=>s.jsx(V3,{ep:x,onUpdate:i,onInspect:o,onViewTraces:u,onEdit:f},x.id))})]})}const ll=210,_r=52,kd=100,g0=14,rl=36;function X3({endpoints:n}){const r=j.useRef(null),i=new Map;for(const x of n){const m="/"+(x.path.split("/")[1]??"");i.has(m)||i.set(m,[]),i.get(m).push(x)}const o=Array.from(i.entries()),u=Math.max(1,...o.map(([,x])=>x.length)),f=o.length*ll+(o.length-1)*kd+rl*2,h=u*_r+(u-1)*g0+rl*2+24,g=new Map;return o.forEach(([,x],m)=>{const p=rl+m*(ll+kd);x.forEach((b,v)=>{g.set(b.id,{x:p,y:rl+24+v*(_r+g0)})})}),j.useEffect(()=>{const x=r.current;if(!x)return;const m=x.getContext("2d");m&&(m.clearRect(0,0,x.width,x.height),o.forEach(([,p],b)=>{if(b>=o.length-1)return;const v=o[b+1][1];p.forEach(N=>{const T=g.get(N.id);v.forEach(_=>{const M=g.get(_.id),A=T.x+ll,V=T.y+_r/2,L=M.x,C=M.y+_r/2,D=(A+L)/2;m.beginPath(),m.strokeStyle="rgba(96,165,250,0.14)",m.lineWidth=1,m.moveTo(A,V),m.bezierCurveTo(D,V,D,C,L,C),m.stroke()})})}))}),s.jsxs("div",{className:"relative overflow-auto",style:{minWidth:f,minHeight:h},children:[s.jsx("canvas",{ref:r,width:f,height:h,className:"absolute inset-0 pointer-events-none"}),o.map(([x],m)=>s.jsx("div",{className:"absolute text-[9px] font-medium text-blue-400/70 uppercase tracking-widest text-center",style:{left:rl+m*(ll+kd),top:rl,width:ll},children:x},x)),n.map(x=>{const m=g.get(x.id);if(!m)return null;const p=py(x.method);return s.jsxs("div",{className:"absolute rounded-lg border theme-border theme-bg-overlay shadow-md flex items-center gap-2 px-3 overflow-hidden hover:border-blue-500/30 transition-colors",style:{left:m.x,top:m.y,width:ll,height:_r},children:[s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[3px]",style:{background:p.dot}}),s.jsx("span",{className:`shrink-0 text-[9px] font-medium ${p.text}`,children:x.method}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-mono text-[10px] theme-text truncate",children:x.path}),s.jsx("p",{className:"text-[9px] theme-text-faint truncate",children:x.handlerName})]})]},x.id)})]})}function Z3({onScan:n,scanning:r,error:i}){return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-5 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full border theme-border theme-bg-overlay text-blue-400",children:s.jsx(Ro,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium theme-text-primary",children:"No model found"}),s.jsxs("p",{className:"mt-1 text-xs theme-text-muted",children:["Scan your project to generate ",s.jsx("code",{className:"theme-text",children:".jetic/model.json"})]})]}),i&&s.jsx("p",{className:"text-xs text-red-400 max-w-xs",children:i}),s.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[r?s.jsx(dt,{className:"h-4 w-4 animate-spin",strokeWidth:2}):s.jsx(Ro,{className:"h-4 w-4",strokeWidth:2}),r?"Scanning project…":"Scan Project"]})]})}const Yo=["application/json","application/x-www-form-urlencoded","multipart/form-data","text/plain","application/xml","application/octet-stream"],xy=["string","integer","number","boolean","array","object"];function W3({open:n,onClose:r,onCreated:i}){const[o,u]=j.useState("basic"),[f,h]=j.useState(!1),[g,x]=j.useState(""),[m,p]=j.useState("GET"),[b,v]=j.useState(""),[N,T]=j.useState(""),[_,M]=j.useState(""),[A,V]=j.useState(""),[L,C]=j.useState([]),[D,W]=j.useState("application/json"),[X,ie]=j.useState(""),[I,K]=j.useState(""),[ne,ee]=j.useState(!1),[se,S]=j.useState([]),[U,k]=j.useState([]),[H,O]=j.useState(!1),z=H&&!b.trim(),E=j.useRef(null);j.useEffect(()=>{n&&(u("basic"),p("GET"),v(""),T(""),M(""),V(""),C([]),W("application/json"),ie(""),K(""),ee(!1),S([]),k([]),O(!1),x(""),h(!1))},[n]),j.useEffect(()=>{if(!n)return;const Y=ue=>{ue.key==="Escape"&&r()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[n,r]);const $=()=>C(Y=>[...Y,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),Z=(Y,ue)=>C(re=>re.map((P,Ee)=>Ee===Y?{...P,...ue}:P)),ae=Y=>C(ue=>ue.filter((re,P)=>P!==Y)),oe=()=>S(Y=>[...Y,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),he=(Y,ue)=>S(re=>re.map((P,Ee)=>Ee===Y?{...P,...ue}:P)),me=Y=>S(ue=>ue.filter((re,P)=>P!==Y)),Se=()=>k(Y=>[...Y,{name:""}]),ve=(Y,ue)=>k(re=>re.map((P,Ee)=>Ee===Y?{name:ue}:P)),Ae=Y=>k(ue=>ue.filter((re,P)=>P!==Y)),Re=(Y,ue)=>k(re=>{const P=[...re],Ee=Y+ue;return Ee<0||Ee>=P.length||([P[Y],P[Ee]]=[P[Ee],P[Y]]),P}),We=async()=>{if(O(!0),!b.trim()){u("basic");return}h(!0),x("");try{const Y={method:m.toUpperCase(),path:b.startsWith("/")?b:"/"+b};N.trim()&&(Y.name=N.trim()),_.trim()&&(Y.description=_.trim()),A.trim()&&(Y.tags=A.split(",").map(ge=>ge.trim()).filter(Boolean));const ue=U.filter(ge=>ge.name.trim());Y.middleware=ue.map(ge=>({name:ge.name.trim()}));const re=L.filter(ge=>ge.name.trim());if(re.length>0&&(Y.parameters=re.map(ge=>{const ke={name:ge.name,in:ge.in,schema:{type:ge.type},required:ge.required};return ge.description.trim()&&(ke.description=ge.description),ge.example.trim()&&(ke.example=ge.example),ke})),X.trim()||I.trim()){const ge={},ke={};if(X.trim())try{ke.schema=JSON.parse(X)}catch{ke.schema=X}if(I.trim())try{ke.example=JSON.parse(I)}catch{ke.example=I}ge[D]=ke,Y.requestBody={required:ne,content:ge}}const P=se.filter(ge=>ge.status.trim());if(P.length>0){const ge={};for(const ke of P){const Oe={};if(ke.description.trim()&&(Oe.description=ke.description),ke.schema.trim()||ke.example.trim()){const ze={};if(ke.schema.trim())try{ze.schema=JSON.parse(ke.schema)}catch{ze.schema=ke.schema}if(ke.example.trim())try{ze.example=JSON.parse(ke.example)}catch{ze.example=ke.example}Oe.content={[ke.contentType]:ze}}ge[ke.status]=Oe}Y.responses=ge}const Ee=await L3(Y);i(Ee.endpoint,Ee.model),r()}catch(Y){x(Y.message)}finally{h(!1)}};if(!n)return null;const Te=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${U.length>0?` (${U.length})`:""}`}],be="w-full rounded-lg border theme-border theme-bg-overlay px-3 py-2 text-xs theme-text placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md transition-all",q="block text-[10px] theme-text-faint mb-1.5 uppercase tracking-wider font-medium";return s.jsx("div",{ref:E,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:Y=>{Y.target===E.current&&r()},children:s.jsxs("div",{className:"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-2xl border border-[var(--border-md)] shadow-2xl overflow-hidden theme-bg-surface",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b theme-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-blue-500/10",children:s.jsx(Pb,{className:"h-4 w-4 text-blue-400"})}),s.jsx("h2",{className:"text-sm font-medium theme-text-primary",children:"Add Endpoint"})]}),s.jsx("button",{type:"button",onClick:r,className:"theme-text-faint hover:theme-text transition-colors hover:cursor-pointer",children:s.jsx(_t,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:Te.map(Y=>s.jsx("button",{type:"button",onClick:()=>u(Y.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${o===Y.key?"bg-blue-500/15 text-blue-400 shadow-sm":"theme-text-faint hover:theme-text-muted hover:theme-bg-overlay"}`,children:Y.label},Y.key))}),g&&s.jsxs("div",{className:"mx-6 mt-2 flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0"}),g]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[o==="basic"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Method *"}),s.jsx("select",{value:m,onChange:Y=>p(Y.target.value),className:`${be} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(Y=>s.jsx("option",{children:Y},Y))})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Path *"}),s.jsx("input",{value:b,onChange:Y=>v(Y.target.value),placeholder:"/api/users",className:`${be} font-mono ${z?"border-red-500/60 focus:border-red-500/80":""}`}),z&&s.jsx("p",{className:"text-[10px] text-red-400 mt-1",children:"Path is required"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Name"}),s.jsx("input",{value:N,onChange:Y=>T(Y.target.value),placeholder:"Create User",className:be})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("textarea",{value:_,onChange:Y=>M(Y.target.value),placeholder:"Creates a new user account",rows:2,className:`${be} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Tags"}),s.jsx("input",{value:A,onChange:Y=>V(Y.target.value),placeholder:"users, auth, public",className:be}),s.jsx("p",{className:"text-[10px] theme-text-faint mt-1",children:"Comma-separated"})]})]}),o==="request"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:q+" mb-0",children:"Parameters"}),s.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Parameter"]})]}),L.length===0&&s.jsx("p",{className:"text-[10px] theme-text-faint italic",children:"No parameters added yet"}),s.jsx("div",{className:"space-y-2",children:L.map((Y,ue)=>s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx("input",{value:Y.name,onChange:re=>Z(ue,{name:re.target.value}),placeholder:"Parameter name",className:`${be} font-mono`})}),s.jsx("select",{value:Y.in,onChange:re=>Z(ue,{in:re.target.value}),className:`${be} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(re=>s.jsx("option",{children:re},re))}),s.jsx("select",{value:Y.type,onChange:re=>Z(ue,{type:re.target.value}),className:`${be} w-28 hover:cursor-pointer`,children:xy.map(re=>s.jsx("option",{children:re},re))}),s.jsx("button",{type:"button",onClick:()=>ae(ue),className:"mt-1.5 theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] theme-text-muted hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:Y.required,onChange:re=>Z(ue,{required:re.target.checked}),className:"accent-blue-500"}),"Required"]}),s.jsx("input",{value:Y.description,onChange:re=>Z(ue,{description:re.target.value}),placeholder:"Description",className:`${be} flex-1 text-[10px]`}),s.jsx("input",{value:Y.example,onChange:re=>Z(ue,{example:re.target.value}),placeholder:"Example",className:`${be} w-32 text-[10px] font-mono`})]})]},ue))})]}),s.jsx("div",{className:"border-t theme-border"}),s.jsxs("div",{children:[s.jsx("p",{className:q,children:"Request Body"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:q,children:"Content Type"}),s.jsx("select",{value:D,onChange:Y=>W(Y.target.value),className:`${be} hover:cursor-pointer`,children:Yo.map(Y=>s.jsx("option",{children:Y},Y))})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] theme-text-muted mt-5 hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:ne,onChange:Y=>ee(Y.target.checked),className:"accent-blue-500"}),"Required"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Schema (JSON)"}),s.jsx("textarea",{value:X,onChange:Y=>ie(Y.target.value),placeholder:`{
|
|
393
|
-
"type": "object",
|
|
394
|
-
"properties": {
|
|
395
|
-
"email": { "type": "string", "format": "email" },
|
|
396
|
-
"password": { "type": "string" }
|
|
397
|
-
},
|
|
398
|
-
"required": ["email", "password"]
|
|
399
|
-
}`,rows:5,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Example"}),s.jsx("textarea",{value:I,onChange:Y=>K(Y.target.value),placeholder:`{
|
|
400
|
-
"email": "test@example.com",
|
|
401
|
-
"password": "password123"
|
|
402
|
-
}`,rows:3,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),o==="responses"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:q+" mb-0",children:"Responses"}),s.jsxs("button",{type:"button",onClick:oe,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Response"]})]}),se.length===0&&s.jsx("p",{className:"text-[10px] theme-text-faint italic",children:'No responses defined yet. Click "Add Response" above.'}),s.jsx("div",{className:"space-y-3",children:se.map((Y,ue)=>s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"w-24",children:[s.jsx("label",{className:q,children:"Status"}),s.jsx("input",{value:Y.status,onChange:re=>he(ue,{status:re.target.value}),placeholder:"200",className:`${be} font-mono`})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:q,children:"Description"}),s.jsx("input",{value:Y.description,onChange:re=>he(ue,{description:re.target.value}),placeholder:"Success",className:be})]}),s.jsxs("div",{className:"w-48",children:[s.jsx("label",{className:q,children:"Content Type"}),s.jsx("select",{value:Y.contentType,onChange:re=>he(ue,{contentType:re.target.value}),className:`${be} hover:cursor-pointer`,children:Yo.map(re=>s.jsx("option",{children:re},re))})]}),s.jsx("button",{type:"button",onClick:()=>me(ue),className:"mt-5 theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Body Schema (JSON)"}),s.jsx("textarea",{value:Y.schema,onChange:re=>he(ue,{schema:re.target.value}),placeholder:`{
|
|
403
|
-
"type": "object",
|
|
404
|
-
"properties": { ... }
|
|
405
|
-
}`,rows:3,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:q,children:"Example"}),s.jsx("textarea",{value:Y.example,onChange:re=>he(ue,{example:re.target.value}),placeholder:`{
|
|
406
|
-
"id": "abc123",
|
|
407
|
-
"email": "test@example.com"
|
|
408
|
-
}`,rows:2,className:`${be} resize-none font-mono text-[11px] leading-relaxed`})]})]},ue))})]}),o==="middleware"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:q+" mb-0",children:"Middleware Chain"}),s.jsx("p",{className:"text-[10px] theme-text-faint mt-0.5",children:"Executed in order, top → bottom"})]}),s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-blue-400 hover:bg-blue-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Middleware"]})]}),U.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed theme-border text-center",children:[s.jsx(La,{className:"h-6 w-6 theme-text-faint",strokeWidth:1.5}),s.jsxs("p",{className:"text-[10px] theme-text-faint italic",children:["No middleware added yet.",s.jsx("br",{}),'Click "Add Middleware" to get started.']})]}),s.jsx("div",{className:"space-y-2",children:U.map((Y,ue)=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay px-3 py-2",children:[s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("button",{type:"button",onClick:()=>Re(ue,-1),disabled:ue===0,className:"theme-text-faint hover:theme-text disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move up",children:s.jsx(qa,{className:"h-3 w-3 rotate-180"})}),s.jsx("button",{type:"button",onClick:()=>Re(ue,1),disabled:ue===U.length-1,className:"theme-text-faint hover:theme-text disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move down",children:s.jsx(qa,{className:"h-3 w-3"})})]}),s.jsx("span",{className:"text-[10px] theme-text-faint w-4 text-center shrink-0",children:ue+1}),s.jsx("input",{value:Y.name,onChange:re=>ve(ue,re.target.value),placeholder:"e.g. authenticateToken",className:`${be} flex-1 font-mono`}),s.jsx("button",{type:"button",onClick:()=>Ae(ue),className:"theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]},ue))})]})]}),s.jsxs("div",{className:"flex items-center justify-between border-t theme-border px-6 py-4",children:[s.jsxs("p",{className:"text-[10px] theme-text-faint",children:["Only ",s.jsx("span",{className:"theme-text-muted",children:"Method"})," and ",s.jsx("span",{className:"theme-text-muted",children:"Path"})," are required"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:r,className:"rounded-lg border theme-border px-4 py-2 text-xs font-medium theme-text-muted hover:theme-bg-overlay-md hover:theme-text transition-colors hover:cursor-pointer",children:"Cancel"}),s.jsxs("button",{type:"button",onClick:We,disabled:f,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-4 py-2 text-xs font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[f?s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}),f?"Adding…":"Add Endpoint"]})]})]})]})})}function Q3({endpoint:n,onClose:r,onSaved:i}){const[o,u]=j.useState("basic"),[f,h]=j.useState(!1),[g,x]=j.useState(""),[m,p]=j.useState(n.method),[b,v]=j.useState(n.path),[N,T]=j.useState(n.name??""),[_,M]=j.useState(n.description??""),[A,V]=j.useState((n.tags??[]).join(", ")),[L,C]=j.useState(n.deprecated??!1),[D,W]=j.useState(()=>(n.parameters??[]).filter(q=>q.in!=="body").map(q=>({name:q.name,in:q.in??"query",type:q.type,required:q.required??!1,description:q.description??"",example:q.example?String(q.example):""}))),[X,ie]=j.useState(n.requestBody?.contentType??"application/json"),[I,K]=j.useState(n.requestBody?.required??!1),[ne,ee]=j.useState(()=>{const q=n.requestBody?.fields;if(!q||Object.keys(q).length===0)return"";const Y={},ue=[];for(const[re,P]of Object.entries(q))Y[re]={type:P.type,...P.format?{format:P.format}:{},...P.description?{description:P.description}:{}},P.required&&ue.push(re);return JSON.stringify({type:"object",properties:Y,...ue.length>0?{required:ue}:{}},null,2)}),[se,S]=j.useState(""),[U,k]=j.useState(()=>Object.entries(n.responses??{}).map(([q,Y])=>({status:q,description:Y.description??"",contentType:Y.contentType??"application/json",schema:Y.schema?JSON.stringify(Y.schema,null,2):"",example:""}))),[H,O]=j.useState((n.middleware??[]).map(q=>({name:q.name}))),z=j.useRef(null);j.useEffect(()=>{if(!open)return;const q=Y=>{Y.key==="Escape"&&r()};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[r]);const E=()=>W(q=>[...q,{name:"",in:"query",type:"string",required:!1,description:"",example:""}]),$=(q,Y)=>W(ue=>ue.map((re,P)=>P===q?{...re,...Y}:re)),Z=q=>W(Y=>Y.filter((ue,re)=>re!==q)),ae=()=>k(q=>[...q,{status:"200",description:"",contentType:"application/json",schema:"",example:""}]),oe=(q,Y)=>k(ue=>ue.map((re,P)=>P===q?{...re,...Y}:re)),he=q=>k(Y=>Y.filter((ue,re)=>re!==q)),me=()=>O(q=>[...q,{name:""}]),Se=(q,Y)=>O(ue=>ue.map((re,P)=>P===q?{name:Y}:re)),ve=q=>O(Y=>Y.filter((ue,re)=>re!==q)),Ae=(q,Y)=>O(ue=>{const re=[...ue],P=q+Y;return P<0||P>=re.length||([re[q],re[P]]=[re[P],re[q]]),re}),Re=async()=>{if(!b.trim()){u("basic");return}h(!0),x("");try{const q={id:n.id,method:m.toUpperCase(),path:b.startsWith("/")?b:"/"+b};N.trim()&&(q.name=N.trim()),_.trim()&&(q.description=_.trim()),A.trim()&&(q.tags=A.split(",").map(P=>P.trim()).filter(Boolean)),L&&(q.deprecated=!0),n.handlerName&&(q.handlerName=n.handlerName),n.source&&(q.source=n.source),n.security&&(q.security=n.security),q.middleware=H.filter(P=>P.name.trim()).map(P=>({name:P.name.trim()}));const Y=D.filter(P=>P.name.trim());if(Y.length>0&&(q.parameters=Y.map(P=>({name:P.name,in:P.in,schema:{type:P.type},required:P.required,...P.description?{description:P.description}:{},...P.example?{example:P.example}:{}}))),ne.trim()){const P={};try{P.schema=JSON.parse(ne)}catch{P.schema=ne}if(se.trim())try{P.example=JSON.parse(se)}catch{P.example=se}q.requestBody={required:I,content:{[X]:P}}}const ue=U.filter(P=>P.status.trim());if(ue.length>0){const P={};for(const Ee of ue){const ge={};if(Ee.description.trim()&&(ge.description=Ee.description),Ee.schema.trim())try{ge.schema=JSON.parse(Ee.schema)}catch{ge.schema=Ee.schema}P[Ee.status]=ge}q.responses=P}const re=await fetch(`/api/model/endpoint/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!re.ok){const P=await re.json().catch(()=>({}));throw new Error(P.error??`Save failed (${re.status})`)}i({...n,...q})}catch(q){x(q.message)}finally{h(!1)}},We=[{key:"basic",label:"Basic"},{key:"request",label:"Request"},{key:"responses",label:"Responses"},{key:"middleware",label:`Middleware${H.length>0?` (${H.length})`:""}`}],Te="w-full rounded-lg border theme-border theme-bg-overlay px-3 py-2 text-xs theme-text placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md transition-all",be="block text-[10px] theme-text-faint mb-1.5 uppercase tracking-wider font-medium";return s.jsx("div",{ref:z,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:q=>{q.target===z.current&&r()},children:s.jsxs("div",{className:"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-2xl border border-[var(--border-md)] shadow-2xl overflow-hidden theme-bg-surface",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b theme-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-amber-500/10",children:s.jsx(Fd,{className:"h-4 w-4 text-amber-400"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-medium theme-text-primary",children:"Edit Endpoint"}),s.jsxs("p",{className:"text-[10px] theme-text-faint font-mono",children:[n.method," ",n.path]})]})]}),s.jsx("button",{type:"button",onClick:r,className:"theme-text-faint hover:theme-text transition-colors hover:cursor-pointer",children:s.jsx(_t,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pt-4 pb-2",children:We.map(q=>s.jsx("button",{type:"button",onClick:()=>u(q.key),className:`rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${o===q.key?"bg-amber-500/15 text-amber-400 shadow-sm":"theme-text-faint hover:theme-text-muted hover:theme-bg-overlay"}`,children:q.label},q.key))}),g&&s.jsxs("div",{className:"mx-6 mt-2 flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0"}),g]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[o==="basic"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Method *"}),s.jsx("select",{value:m,onChange:q=>p(q.target.value),className:`${Te} hover:cursor-pointer`,children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(q=>s.jsx("option",{children:q},q))})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Path *"}),s.jsx("input",{value:b,onChange:q=>v(q.target.value),placeholder:"/api/users",className:`${Te} font-mono`})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Name"}),s.jsx("input",{value:N,onChange:q=>T(q.target.value),placeholder:"Create User",className:Te})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Description"}),s.jsx("textarea",{value:_,onChange:q=>M(q.target.value),rows:2,className:`${Te} resize-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Tags"}),s.jsx("input",{value:A,onChange:q=>V(q.target.value),placeholder:"users, auth, public",className:Te}),s.jsx("p",{className:"text-[10px] theme-text-faint mt-1",children:"Comma-separated"})]}),s.jsxs("label",{className:"flex items-center gap-2 text-[11px] theme-text-muted hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:L,onChange:q=>C(q.target.checked),className:"accent-amber-500"}),"Mark as deprecated"]})]}),o==="request"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:be+" mb-0",children:"Parameters"}),s.jsxs("button",{type:"button",onClick:E,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Parameter"]})]}),D.length===0&&s.jsx("p",{className:"text-[10px] theme-text-faint italic",children:"No parameters"}),s.jsx("div",{className:"space-y-2",children:D.map((q,Y)=>s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx("input",{value:q.name,onChange:ue=>$(Y,{name:ue.target.value}),placeholder:"name",className:`${Te} font-mono`})}),s.jsx("select",{value:q.in,onChange:ue=>$(Y,{in:ue.target.value}),className:`${Te} w-28 hover:cursor-pointer`,children:["query","path","header","cookie"].map(ue=>s.jsx("option",{children:ue},ue))}),s.jsx("select",{value:q.type,onChange:ue=>$(Y,{type:ue.target.value}),className:`${Te} w-28 hover:cursor-pointer`,children:xy.map(ue=>s.jsx("option",{children:ue},ue))}),s.jsx("button",{type:"button",onClick:()=>Z(Y),className:"mt-1.5 theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] theme-text-muted hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:q.required,onChange:ue=>$(Y,{required:ue.target.checked}),className:"accent-amber-500"})," Required"]}),s.jsx("input",{value:q.description,onChange:ue=>$(Y,{description:ue.target.value}),placeholder:"Description",className:`${Te} flex-1 text-[10px]`})]})]},Y))})]}),s.jsx("div",{className:"border-t theme-border"}),s.jsxs("div",{children:[s.jsx("p",{className:be,children:"Request Body"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:be,children:"Content Type"}),s.jsx("select",{value:X,onChange:q=>ie(q.target.value),className:`${Te} hover:cursor-pointer`,children:Yo.map(q=>s.jsx("option",{children:q},q))})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] theme-text-muted mt-5 hover:cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:I,onChange:q=>K(q.target.checked),className:"accent-amber-500"})," Required"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Schema (JSON)"}),s.jsx("textarea",{value:ne,onChange:q=>ee(q.target.value),rows:5,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Example"}),s.jsx("textarea",{value:se,onChange:q=>S(q.target.value),rows:3,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]})]})]})]}),o==="responses"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:be+" mb-0",children:"Responses"}),s.jsxs("button",{type:"button",onClick:ae,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Response"]})]}),U.length===0&&s.jsx("p",{className:"text-[10px] theme-text-faint italic",children:"No responses defined."}),s.jsx("div",{className:"space-y-3",children:U.map((q,Y)=>s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"w-24",children:[s.jsx("label",{className:be,children:"Status"}),s.jsx("input",{value:q.status,onChange:ue=>oe(Y,{status:ue.target.value}),placeholder:"200",className:`${Te} font-mono`})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:be,children:"Description"}),s.jsx("input",{value:q.description,onChange:ue=>oe(Y,{description:ue.target.value}),placeholder:"Success",className:Te})]}),s.jsxs("div",{className:"w-48",children:[s.jsx("label",{className:be,children:"Content Type"}),s.jsx("select",{value:q.contentType,onChange:ue=>oe(Y,{contentType:ue.target.value}),className:`${Te} hover:cursor-pointer`,children:Yo.map(ue=>s.jsx("option",{children:ue},ue))})]}),s.jsx("button",{type:"button",onClick:()=>he(Y),className:"mt-5 theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:be,children:"Body Schema (JSON)"}),s.jsx("textarea",{value:q.schema,onChange:ue=>oe(Y,{schema:ue.target.value}),rows:3,className:`${Te} resize-none font-mono text-[11px] leading-relaxed`})]})]},Y))})]}),o==="middleware"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:be+" mb-0",children:"Middleware Chain"}),s.jsx("p",{className:"text-[10px] theme-text-faint mt-0.5",children:"Executed in order, top → bottom"})]}),s.jsxs("button",{type:"button",onClick:me,className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium text-amber-400 hover:bg-amber-500/10 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3 w-3"})," Add Middleware"]})]}),H.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 rounded-lg border border-dashed theme-border text-center",children:[s.jsx(La,{className:"h-6 w-6 theme-text-faint",strokeWidth:1.5}),s.jsx("p",{className:"text-[10px] theme-text-faint italic",children:'No middleware. Click "Add Middleware" to get started.'})]}),s.jsx("div",{className:"space-y-2",children:H.map((q,Y)=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay px-3 py-2",children:[s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("button",{type:"button",onClick:()=>Ae(Y,-1),disabled:Y===0,className:"theme-text-faint hover:theme-text disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move up",children:s.jsx(qa,{className:"h-3 w-3 rotate-180"})}),s.jsx("button",{type:"button",onClick:()=>Ae(Y,1),disabled:Y===H.length-1,className:"theme-text-faint hover:theme-text disabled:opacity-25 hover:cursor-pointer transition-colors leading-none",title:"Move down",children:s.jsx(qa,{className:"h-3 w-3"})})]}),s.jsx("span",{className:"text-[10px] theme-text-faint w-4 text-center shrink-0",children:Y+1}),s.jsx("input",{value:q.name,onChange:ue=>Se(Y,ue.target.value),placeholder:"e.g. authenticateToken",className:`${Te} flex-1 font-mono`}),s.jsx("button",{type:"button",onClick:()=>ve(Y),className:"theme-text-faint hover:text-red-400 transition-colors hover:cursor-pointer shrink-0",title:"Remove",children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]},Y))})]})]}),s.jsxs("div",{className:"flex items-center justify-between border-t theme-border px-6 py-4",children:[s.jsxs("p",{className:"text-[10px] theme-text-faint",children:["ID: ",s.jsx("span",{className:"font-mono",children:n.id})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:r,className:"rounded-lg border theme-border px-4 py-2 text-xs font-medium theme-text-muted hover:theme-bg-overlay-md hover:theme-text transition-colors hover:cursor-pointer",children:"Cancel"}),s.jsxs("button",{type:"button",onClick:Re,disabled:f,className:"flex items-center gap-1.5 rounded-lg bg-amber-500 px-4 py-2 text-xs font-medium text-white hover:bg-amber-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[f?s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(ut,{className:"h-3.5 w-3.5"}),f?"Saving…":"Save Changes"]})]})]})]})})}function K3({onInspect:n,onViewTraces:r}){const[i,o]=j.useState(null),[u,f]=j.useState(!0),[h,g]=j.useState(!1),[x,m]=j.useState(!1),[p,b]=j.useState(null),[v,N]=j.useState(""),[T,_]=j.useState("list"),[M,A]=j.useState(""),[V,L]=j.useState(!1),[C,D]=j.useState(null),W=j.useCallback(async(ee=!1)=>{ee?g(!0):f(!0),b(null);try{o(await U3())}catch(se){b(se.message)}finally{f(!1),g(!1)}},[]);j.useEffect(()=>{W()},[W]);const X=async()=>{m(!0),N("");try{o(await B3())}catch(ee){N(ee.message)}finally{m(!1)}},ie=(ee,se)=>{o(S=>S&&{...S,endpoints:S.endpoints.map(U=>U.id===ee?{...U,...se}:U)})},I=(ee,se)=>{o(se)},K=(i?.endpoints??[]).filter(ee=>!M||ee.path.toLowerCase().includes(M.toLowerCase())||ee.method.toLowerCase().includes(M.toLowerCase())||(ee.handlerName??"").toLowerCase().includes(M.toLowerCase())),ne=new Map;for(const ee of K){const se="/"+(ee.path.split("/")[1]??"");ne.has(se)||ne.set(se,[]),ne.get(se).push(ee)}return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between border-b theme-border px-6 py-5",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium theme-text-primary leading-none",children:i?.project?.name??"Model"}),s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:u?"Loading…":i?`v${i.version} · ${i.endpoints.length} endpoints · ${i.project.framework??i.project.language??""}`:"No model generated yet"})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx("div",{className:"flex items-center gap-1 rounded-xl border theme-border theme-bg-overlay p-1",children:["list","graph"].map(ee=>s.jsxs("button",{type:"button",onClick:()=>_(ee),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${T===ee?"bg-blue-500/15 text-blue-400 shadow-sm":"theme-text-faint hover:theme-text-muted"}`,children:[ee==="list"?s.jsx(O0,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Id,{className:"h-3.5 w-3.5",strokeWidth:2}),ee.charAt(0).toUpperCase()+ee.slice(1)]},ee))}),s.jsx("button",{type:"button",onClick:()=>W(!0),disabled:h||u,className:"flex h-8 w-8 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:theme-bg-overlay-md hover:theme-text disabled:opacity-40 transition-all hover:cursor-pointer",children:s.jsx(na,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`,strokeWidth:2})}),s.jsxs("button",{type:"button",onClick:X,disabled:x,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[x?s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):s.jsx(Ro,{className:"h-3.5 w-3.5",strokeWidth:2}),x?"Scanning…":"Re-scan"]}),s.jsxs("button",{type:"button",onClick:()=>L(!0),className:"flex items-center gap-1.5 rounded-lg bg-emerald-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-emerald-400 transition-colors hover:cursor-pointer",children:[s.jsx(Dt,{className:"h-3.5 w-3.5",strokeWidth:2}),"Add Endpoint"]})]})]}),v&&s.jsxs("div",{className:"flex items-center gap-2 border-b border-red-500/20 bg-red-500/[0.06] px-6 py-2 text-xs text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),v,s.jsx("button",{type:"button",onClick:()=>N(""),className:"ml-auto hover:cursor-pointer",children:s.jsx(_t,{className:"h-3.5 w-3.5",strokeWidth:2})})]}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[u&&s.jsx("div",{className:"space-y-2 p-6",children:[1,2,3,4].map(ee=>s.jsx("div",{className:"h-10 animate-pulse rounded-lg border theme-border theme-bg-overlay",style:{opacity:1-ee*.18}},ee))}),!u&&p&&s.jsxs("div",{className:"flex flex-col items-center gap-4 m-6 rounded-lg border border-red-500/20 bg-red-500/[0.06] p-10 text-center",children:[s.jsx(Ht,{className:"h-8 w-8 text-red-400",strokeWidth:2}),s.jsx("p",{className:"text-sm text-red-300",children:p}),s.jsx("button",{type:"button",onClick:()=>W(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-xs text-red-400 hover:bg-red-500/20 transition-colors hover:cursor-pointer",children:"Retry"})]}),!u&&!p&&!i&&s.jsx(Z3,{onScan:X,scanning:x,error:v}),!u&&!p&&i&&T==="graph"&&s.jsx("div",{className:"flex-1 overflow-auto p-6",children:s.jsx(X3,{endpoints:K})}),!u&&!p&&i&&T==="list"&&s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b theme-border px-6 py-3",children:[s.jsx("input",{value:M,onChange:ee=>A(ee.target.value),placeholder:"Filter by path, method or handler…",className:"w-full max-w-sm rounded-lg border theme-border theme-bg-overlay py-1.5 px-3 text-xs theme-text placeholder-[var(--text-faint)] outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md transition-all"}),M&&s.jsx("button",{type:"button",onClick:()=>A(""),className:"theme-text-faint hover:theme-text hover:cursor-pointer",children:s.jsx(_t,{className:"h-3.5 w-3.5",strokeWidth:2})}),s.jsxs("span",{className:"ml-auto text-[10px] theme-text-faint",children:[K.length," endpoint",K.length!==1?"s":""]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto max-h-[calc(100vh-170px)] divide-y divide-[var(--border)]",children:[Array.from(ne.entries()).map(([ee,se])=>s.jsx(G3,{prefix:ee,endpoints:se,onUpdate:ie,onInspect:S=>n?.(S),onViewTraces:r?S=>r({endpointPath:S}):void 0,onEdit:S=>D(S)},ee)),K.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[s.jsxs("p",{className:"text-sm theme-text-muted",children:['No endpoints match "',M,'"']}),s.jsx("button",{type:"button",onClick:()=>A(""),className:"text-xs text-blue-400 hover:text-blue-300 transition-colors hover:cursor-pointer",children:"Clear filter"})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 border-t theme-border px-6 py-2.5 text-[10px] theme-text-faint",children:["Generated ",new Date(i.generatedAt).toLocaleString(),s.jsx("span",{className:"ml-auto",children:s.jsx("button",{type:"button",onClick:()=>W(!0),className:"theme-text-faint hover:theme-text transition-colors hover:cursor-pointer",children:"Refresh"})})]})]})]}),s.jsx(W3,{open:V,onClose:()=>L(!1),onCreated:I}),C&&s.jsx(Q3,{endpoint:C,onClose:()=>D(null),onSaved:ee=>{o(se=>se&&{...se,endpoints:se.endpoints.map(S=>S.id===ee.id?ee:S)}),D(null)}})]})}const y0={GET:{bg:"bg-emerald-500/10",text:"text-emerald-400",border:"border-emerald-500/30"},POST:{bg:"bg-blue-500/10",text:"text-blue-400",border:"border-blue-500/30"},PUT:{bg:"bg-amber-500/10",text:"text-amber-400",border:"border-amber-500/30"},PATCH:{bg:"bg-orange-500/10",text:"text-orange-400",border:"border-orange-500/30"},DELETE:{bg:"bg-red-500/10",text:"text-red-400",border:"border-red-500/30"},HEAD:{bg:"theme-bg-overlay-md",text:"theme-text-muted",border:"theme-border"},OPTIONS:{bg:"bg-purple-500/10",text:"text-purple-400",border:"border-purple-500/30"}};function J3(n){return y0[n.toUpperCase()]??y0.GET}function Qd({method:n,size:r="md"}){const i=J3(n);return s.jsx("span",{className:`inline-flex items-center rounded font-medium tracking-widest border ${i.bg} ${i.text} ${i.border} ${r==="sm"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-[11px]"}`,children:n.toUpperCase()})}function b0(n,r,i){const o=n.toLowerCase();return o.includes("email")?"user@example.com":o.includes("name")?"Jane Doe":o.includes("username")?"jane_doe":o.includes("password")?"P@ssw0rd123!":o.includes("phone")?"+14155552671":o.includes("url")?"https://example.com":o.includes("id")?Math.random().toString(36).slice(2,10):o.includes("date")||i==="date"?new Date().toISOString().split("T")[0]:o.includes("time")||i==="date-time"?new Date().toISOString():r==="integer"||r==="number"?String(Math.floor(Math.random()*100)+1):r==="boolean"?"true":r==="array"?"[]":r==="object"?"{}":`fake_${o}`}function ul({children:n,className:r=""}){return s.jsx("div",{className:`rounded-lg border theme-border theme-bg-overlay overflow-hidden ${r}`,children:n})}function Ar({icon:n,label:r,count:i,action:o}){return s.jsxs("div",{className:"flex items-center gap-2.5 border-b theme-border px-4 py-2.5 theme-bg-overlay-md",children:[s.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider theme-text-faint uppercase",children:r}),i!==void 0&&s.jsx("span",{className:"rounded-full border theme-border theme-bg-overlay px-2 py-0.5 text-[10px] theme-text-muted",children:i}),o&&s.jsx("div",{className:"ml-auto",children:o})]})}function I3({endpoint:n}){const[r,i]=j.useState(null),[o,u]=j.useState(1),[f,h]=j.useState(!1),[g,x]=j.useState(""),m=j.useCallback(async()=>{if(n.source){h(!0),x(""),i(null);try{const N=await fetch(`/api/model/source?file=${encodeURIComponent(n.source.file)}&line=${n.source.line}`);if(!N.ok){if((N.headers.get("content-type")??"").includes("application/json")){const M=await N.json().catch(()=>({}));throw new Error(M.error??`HTTP ${N.status}`)}throw new Error(`HTTP ${N.status}`)}if((N.headers.get("content-type")??"").includes("application/json")){const _=await N.json();i(_.source??_.content??""),u(_.startLine??1)}else i(await N.text()),u(1)}catch(N){x(N.message)}finally{h(!1)}}},[n]);if(j.useEffect(()=>{m()},[m]),!n.source)return null;const p=n.source.file.split(/[/\\]/).slice(-3).join("/"),b=r?r.split(`
|
|
409
|
-
`):[],v=n.source.line-o;return s.jsxs(ul,{children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b theme-border px-4 py-2.5 theme-bg-overlay-md",children:[s.jsx(Kd,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider theme-text-faint uppercase",children:"Source"}),s.jsx("span",{className:"ml-2 font-mono text-[11px] theme-text-muted truncate",children:p}),s.jsxs("span",{className:"rounded border theme-border theme-bg-overlay px-1.5 py-0.5 font-mono text-[10px] theme-text",children:[":",n.source.line]}),s.jsx("button",{type:"button",onClick:m,disabled:f,className:"ml-auto flex h-6 w-6 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:theme-bg-overlay-md hover:theme-text transition-colors hover:cursor-pointer",children:s.jsx(na,{className:`h-3 w-3 ${f?"animate-spin":""}`,strokeWidth:2})})]}),s.jsxs("div",{className:"relative bg-[var(--sidebar-bg)]",children:[f&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-[11px] theme-text-muted",children:[s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Loading source…"]}),g&&s.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),s.jsxs("span",{children:["Source unavailable — ",g]})]}),r&&!f&&s.jsx("div",{className:"overflow-auto max-h-[340px]",children:s.jsx("table",{className:"w-full border-collapse",children:s.jsx("tbody",{children:b.map((N,T)=>{const _=o+T,M=T===v;return s.jsxs("tr",{className:M?"bg-blue-500/[0.08]":"hover:theme-bg-overlay-md",children:[s.jsx("td",{className:`select-none w-12 px-3 py-0 text-right font-mono text-[10px] border-r theme-border leading-5 ${M?"text-blue-400":"theme-text-faint"}`,children:_}),s.jsx("td",{className:`px-4 py-0 font-mono text-[11px] whitespace-pre leading-5 ${M?"theme-text-primary":"theme-text-muted"}`,children:N||" "})]},T)})})})})]})]})}function F3({endpoint:n}){const[r,i]=j.useState([]),[o,u]=j.useState(!0),[f,h]=j.useState("");j.useEffect(()=>{u(!0),h(""),i([]),fetch(`/api/model/related?id=${encodeURIComponent(n.id)}`).then(x=>{const m=x.headers.get("content-type")??"";if(!x.ok||!m.includes("application/json"))throw new Error(`HTTP ${x.status}`);return x.json()}).then(x=>i(x?.files??[])).catch(x=>h(x.message)).finally(()=>u(!1))},[n.id]);const g={ts:"text-blue-400",tsx:"text-cyan-400",js:"text-amber-400",jsx:"text-amber-300",json:"text-emerald-400"};return s.jsxs(ul,{children:[s.jsx(Ar,{icon:Jd,label:"Related Files",count:!o&&!f?r.length:void 0}),s.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[o&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-[11px] theme-text-muted",children:[s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2})," Resolving files…"]}),!o&&f&&s.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 text-[11px] text-red-400",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 mt-0.5 shrink-0",strokeWidth:2}),s.jsxs("span",{children:["Could not resolve — ",f]})]}),!o&&!f&&r.length===0&&s.jsx("p",{className:"px-4 py-4 text-[12px] theme-text-faint italic",children:"No related files resolved"}),r.map(x=>{const m=x.split(/[/\\]/),p=m.pop()??x,b=m.slice(-2).join("/"),v=p.split(".").pop()??"",N=g[v]??"theme-text-faint";return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:theme-bg-overlay-md transition-colors",children:[s.jsx(Vo,{className:`h-[15px] w-[15px] shrink-0 ${N}`,strokeWidth:2}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-[13px] theme-text truncate",children:p}),b&&s.jsx("p",{className:"text-[10px] theme-text-faint truncate font-mono",children:b})]}),s.jsxs("span",{className:`shrink-0 rounded border theme-border theme-bg-overlay-md px-1.5 py-0.5 text-[10px] font-mono ${N}`,children:[".",v]})]},x)})]})]})}function v0({endpoint:n}){const[r,i]=j.useState("fake"),[o,u]=j.useState(""),[f,h]=j.useState({}),[g,x]=j.useState(!1),[m,p]=j.useState(null),[b,v]=j.useState("http://localhost:3000"),[N,T]=j.useState([]),[_,M]=j.useState(null),[A,V]=j.useState(!1);j.useEffect(()=>{fetch("/api/model/environments").then(K=>K.ok?K.json():null).then(K=>{if(!K)return;T(K.environments??[]);const ne=K.defaultEnvironment??K.environments?.find(se=>se.default)?.name??K.environments?.[0]?.name??null;M(ne);const ee=(K.environments??[]).find(se=>se.name===ne);ee&&v(ee.baseUrl)}).catch(()=>{}).finally(()=>V(!0))},[]);const L=n.requestBody?.fields??{},C=(n.security?.length??0)>0,D=["POST","PUT","PATCH"].includes(n.method.toUpperCase());j.useEffect(()=>{p(null),h({})},[n.id]);const W=()=>{const K={};for(const[ne,ee]of Object.entries(L))K[ne]=b0(ne,ee.type,ee.format);return K},X=()=>{const K={};for(const[ne,ee]of Object.entries(L)){const se=f[ne]??"";se&&(ee.type==="integer"||ee.type==="number"?K[ne]=Number(se):ee.type==="boolean"?K[ne]=se.toLowerCase()==="true":K[ne]=se)}return K},ie=async()=>{x(!0),p(null);const K=Date.now();try{const ne=r==="fake"?W():X(),ee={};(D||r==="fake")&&(ee["Content-Type"]="application/json"),o&&(ee.Authorization=`Bearer ${o}`);const se=`${b}${n.path}`,S=await fetch(se,{method:n.method.toUpperCase(),headers:ee,body:D?JSON.stringify(ne):void 0}),U=Date.now()-K;let k;try{k=await S.json()}catch{k=await S.text().catch(()=>"(no body)")}p({status:S.status,body:k,durationMs:U})}catch(ne){p({status:0,body:null,durationMs:Date.now()-K,error:ne.message})}finally{x(!1)}},I=m&&m.status>=200&&m.status<300;return s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay px-3 py-2",children:[s.jsx(Qd,{method:n.method,size:"sm"}),s.jsx("code",{className:"font-mono text-[12px] theme-text truncate",children:n.path})]}),s.jsx("p",{className:"hidden",children:A}),s.jsxs("div",{className:"flex items-center gap-2 rounded-xl border theme-border theme-bg-overlay p-1",children:[s.jsxs("button",{type:"button",onClick:()=>i("fake"),className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${r==="fake"?"bg-blue-500/15 text-blue-400 shadow-sm":"theme-text-faint hover:theme-text-muted"}`,children:[s.jsx(hs,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Fake Data"]}),s.jsxs("button",{type:"button",onClick:()=>i("real"),className:`flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-[11px] font-medium transition-all duration-200 hover:cursor-pointer ${r==="real"?"bg-blue-500/15 text-blue-400 shadow-sm":"theme-text-faint hover:theme-text-muted"}`,children:[s.jsx(Cd,{className:"h-3 w-3 shrink-0",strokeWidth:2}),"Real Data"]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Base URL"}),N.length>0?s.jsx("div",{className:"rounded-lg border theme-border theme-bg-overlay overflow-hidden",children:N.map(K=>{const ne=_===K.name;return s.jsxs("button",{type:"button",onClick:()=>{M(K.name),v(K.baseUrl)},className:`group flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:cursor-pointer border-t theme-border ${ne?"bg-blue-500/10":"hover:theme-bg-overlay-md"}`,children:[s.jsx("div",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors ${ne?"border-blue-400 bg-blue-500/20":"theme-border bg-transparent"}`,children:ne&&s.jsx(ut,{className:"h-2.5 w-2.5 text-blue-400",strokeWidth:3})}),s.jsx(vl,{className:`h-3 w-3 shrink-0 ${ne?"text-blue-400":"theme-text-faint"}`,strokeWidth:2}),s.jsx("span",{className:`text-[11px] w-14 shrink-0 font-medium ${ne?"text-blue-400":"theme-text-muted"}`,children:K.name}),s.jsx("span",{className:"font-mono text-[11px] theme-text-faint truncate",children:K.baseUrl})]},K.name)})}):s.jsx("input",{value:b,onChange:K=>v(K.target.value),className:"w-full rounded-lg border theme-border theme-bg-overlay px-3 py-1.5 font-mono text-[12px] theme-text-primary outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md placeholder-[var(--text-faint)] transition-colors",placeholder:"http://localhost:3000"})]}),(C||r==="real")&&s.jsxs("label",{className:"flex flex-col gap-1.5",children:[s.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint flex items-center gap-1",children:[s.jsx(A0,{className:"h-3 w-3",strokeWidth:2})," Bearer Token"]}),s.jsx("input",{type:"password",value:o,onChange:K=>u(K.target.value),className:"w-full rounded-lg border border-amber-500/25 bg-amber-500/[0.04] px-3 py-1.5 font-mono text-[12px] theme-text-primary outline-none focus:border-amber-400/50 focus:bg-amber-500/[0.07] placeholder-[var(--text-faint)] transition-colors",placeholder:"Optional"})]}),r==="fake"&&Object.keys(L).length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider theme-text-faint flex items-center gap-1.5",children:[s.jsx(hs,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Auto-generated body"]}),s.jsx("div",{className:"space-y-1",children:Object.entries(L).map(([K,ne])=>s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border theme-border theme-bg-overlay px-3 py-2",children:[s.jsx("span",{className:"text-[11px] theme-text w-20 truncate shrink-0",children:K}),s.jsx("span",{className:"text-[11px] theme-text-faint shrink-0",children:ne.type}),s.jsx("span",{className:"ml-auto font-mono text-[11px] text-blue-400/80 truncate",children:b0(K,ne.type,ne.format)})]},K))})]}),r==="real"&&Object.keys(L).length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider theme-text-faint flex items-center gap-1.5",children:[s.jsx(Cd,{className:"h-3 w-3 text-blue-400",strokeWidth:2})," Request body"]}),s.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([K,ne])=>s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-[11px] theme-text",children:[K,ne.required&&s.jsx("span",{className:"ml-1 text-[10px] text-rose-400",children:"*"})]}),s.jsx("input",{value:f[K]??"",onChange:ee=>h(se=>({...se,[K]:ee.target.value})),placeholder:`${ne.type}${ne.format?` (${ne.format})`:""}`,className:"rounded-lg border theme-border theme-bg-overlay px-3 py-1.5 font-mono text-[12px] theme-text-primary outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md placeholder-[var(--text-faint)] transition-colors"})]},K))})]}),r==="real"&&Object.keys(L).length===0&&!D&&s.jsxs("p",{className:"text-[12px] theme-text-faint italic",children:["No body required for ",n.method.toUpperCase()," requests."]}),s.jsxs("button",{type:"button",onClick:ie,disabled:g,className:"flex w-full items-center justify-center gap-2 rounded-lg border theme-border bg-blue-500 py-2 text-[12px] font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors hover:cursor-pointer",children:[g?s.jsx(dt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):s.jsx(_d,{className:"h-[15px] w-[15px]",strokeWidth:2}),g?"Sending…":`Run ${r==="fake"?"with Fake Data":"with Real Data"}`]}),m&&s.jsxs("div",{className:`rounded-lg border overflow-hidden ${I?"border-emerald-500/25 bg-emerald-500/[0.05]":"border-red-500/25 bg-red-500/[0.05]"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b theme-border",children:[I?s.jsx(ut,{className:"h-[15px] w-[15px] text-emerald-400",strokeWidth:2}):s.jsx(Ht,{className:"h-[15px] w-[15px] text-red-400",strokeWidth:2}),s.jsx("span",{className:`text-[12px] font-medium ${I?"text-emerald-400":"text-red-400"}`,children:m.status>0?m.status:"Error"}),s.jsxs("span",{className:"text-[11px] theme-text-faint",children:[m.durationMs,"ms"]}),s.jsx("button",{type:"button",onClick:()=>p(null),className:"ml-auto flex h-6 w-6 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-faint hover:theme-text transition-colors hover:cursor-pointer",children:s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})})]}),m.error&&s.jsx("p",{className:"px-3 py-2.5 text-[12px] text-red-400",children:m.error}),!m.error&&m.body!=null&&s.jsx("pre",{className:"overflow-auto max-h-72 p-3 text-[11px] theme-text-muted whitespace-pre-wrap break-all leading-5",children:typeof m.body=="string"?m.body:JSON.stringify(m.body,null,2)})]})]})}const P3=({endpoint:n,onBack:r})=>{if(!n)return s.jsxs("div",{className:"flex min-h-full w-full flex-col items-center justify-center gap-5 text-center p-12",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-lg border theme-border theme-bg-overlay text-blue-400",children:s.jsx(Kd,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium theme-text-primary",children:"No endpoint selected"}),s.jsxs("p",{className:"mt-1 text-[12px] theme-text-muted",children:["Click ",s.jsx("span",{className:"text-blue-400 font-medium",children:"INSPECT"})," on any endpoint in the Model view."]})]}),s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg border theme-border theme-bg-overlay px-4 py-2 text-[12px] theme-text-muted hover:theme-bg-overlay-md hover:theme-text transition-colors hover:cursor-pointer",children:[s.jsx(dx,{className:"h-[15px] w-[15px]",strokeWidth:2})," Back to Model"]})]});const i=n.requestBody?.fields??{},o=n.responses??{},u=Object.keys(i).length>0,f=Object.keys(o).length>0,h=(n.security?.length??0)>0,g=(n.middleware?.length??0)>0,x=n.source?n.source.file.split(/[/\\]/).slice(-3).join("/")+":"+n.source.line:null;return s.jsxs("div",{className:"flex min-h-full w-full",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsxs("div",{className:"flex items-center gap-4 border-b theme-border px-6 py-5",children:[s.jsx("button",{type:"button",onClick:r,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:theme-bg-overlay-md hover:theme-text transition-colors hover:cursor-pointer",children:s.jsx(dx,{className:"h-[15px] w-[15px]",strokeWidth:2})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Qd,{method:n.method}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-[13.5px] font-medium theme-text-primary leading-none truncate",children:n.path}),n.handlerName&&s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted truncate",children:n.handlerName})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h&&s.jsxs("span",{className:"flex items-center gap-1.5 rounded-lg border border-amber-500/25 bg-amber-500/[0.07] px-2.5 py-1 text-[11px] text-amber-400",children:[s.jsx(La,{className:"h-[15px] w-[15px]",strokeWidth:2}),n.security[0].scheme]}),x&&s.jsx("span",{className:"hidden sm:block font-mono text-[11px] theme-text-faint truncate max-w-[200px]",children:x})]})]}),s.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-4",children:[s.jsxs(ul,{children:[s.jsx(Ar,{icon:Jd,label:"Details"}),s.jsxs("div",{className:"p-4 grid grid-cols-2 sm:grid-cols-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Method"}),s.jsx(Qd,{method:n.method})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Path"}),s.jsx("code",{className:"font-mono text-[12px] theme-text",children:n.path})]}),n.handlerName&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Handler"}),s.jsx("code",{className:"font-mono text-[12px] theme-text-muted",children:n.handlerName})]}),n.source&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Source"}),s.jsx("code",{className:"font-mono text-[11px] theme-text-faint",children:x})]}),n.requestBody?.contentType&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Content-Type"}),s.jsx("code",{className:"font-mono text-[11px] theme-text-faint",children:n.requestBody.contentType})]}),g&&s.jsxs("div",{className:"col-span-2 sm:col-span-3",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint mb-1.5",children:"Middleware"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.middleware.map((m,p)=>s.jsx("span",{className:"rounded-lg border theme-border theme-bg-overlay-md px-2.5 py-0.5 text-[11px] theme-text",children:m.name},p))})]})]})]}),u&&s.jsxs(ul,{children:[s.jsx(Ar,{icon:Cd,label:"Request Body",count:Object.keys(i).length}),s.jsxs("div",{className:"p-4 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-4 px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:[s.jsx("span",{className:"w-28",children:"Field"}),s.jsx("span",{className:"w-16",children:"Type"}),s.jsx("span",{children:"Format"}),s.jsx("span",{className:"ml-auto",children:"Required"})]}),Object.entries(i).map(([m,p])=>s.jsxs("div",{className:"flex items-center gap-4 rounded-lg border theme-border theme-bg-overlay px-3 py-2 hover:theme-bg-overlay-md transition-colors",children:[s.jsx("span",{className:"w-28 shrink-0 font-mono text-[12px] theme-text-primary truncate",children:m}),s.jsx("span",{className:"w-16 shrink-0 text-[11px] text-blue-400",children:p.type}),s.jsx("span",{className:"flex-1 text-[11px] theme-text-faint",children:p.format??"—"}),p.required?s.jsx("span",{className:"ml-auto shrink-0 rounded border border-rose-500/25 bg-rose-500/10 px-1.5 py-0.5 text-[10px] text-rose-400",children:"required"}):s.jsx("span",{className:"ml-auto shrink-0 text-[10px] theme-text-faint",children:"optional"})]},m))]})]}),f&&s.jsxs(ul,{children:[s.jsx(Ar,{icon:ut,label:"Responses",count:Object.keys(o).length}),s.jsx("div",{className:"p-4 space-y-1.5",children:Object.entries(o).map(([m,p])=>{const b=m.startsWith("2");return s.jsxs("div",{className:`flex items-start gap-3 rounded-lg border px-3 py-2 ${b?"border-emerald-500/20 bg-emerald-500/[0.05]":"border-red-500/20 bg-red-500/[0.05]"}`,children:[s.jsx("span",{className:`shrink-0 w-10 font-mono text-[12px] font-medium ${b?"text-emerald-400":"text-red-400"}`,children:m}),p.schema&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Object.keys(p.schema).map(v=>s.jsx("span",{className:"rounded border theme-border theme-bg-overlay-md px-1.5 py-0.5 font-mono text-[10px] theme-text-muted",children:v},v))})]},m)})})]}),s.jsx(I3,{endpoint:n}),s.jsx(F3,{endpoint:n}),s.jsxs(ul,{className:"lg:hidden",children:[s.jsx(Ar,{icon:hs,label:"Simulate Endpoint"}),s.jsx("div",{className:"p-4",children:s.jsx(v0,{endpoint:n})})]})]})]}),s.jsxs("aside",{className:"hidden lg:flex w-[400px] shrink-0 flex-col border-l theme-border bg-[var(--sidebar-bg)]",children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b theme-border px-5 py-[18px]",children:[s.jsx(hs,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[13.5px] font-medium theme-text-primary",children:"Simulate Endpoint"})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:s.jsx(v0,{endpoint:n})})]})]})};function e4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Agents"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is under developnment."})]})}function t4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Tools"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the Tools page."})]})}function n4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Context"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the Context page."})]})}const jf="/api/memory";async function j0(){const n=await fetch(jf);if(!n.ok)throw new Error(`Failed to fetch memory (${n.status})`);return n.json()}async function a4(){try{const n=await fetch("/api/model");return n.ok?(await n.json())?.environments??[]:[]}catch{return[]}}async function s4(n,r){const i=await fetch(jf,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:n,value:r})});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`Failed to add entry (${i.status})`)}}async function l4(n){const r=await fetch(jf,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:n})});if(!r.ok)throw new Error(`Failed to delete entry (${r.status})`)}function N0(n){return typeof n=="object"&&n!==null?JSON.stringify(n):String(n)}function r4(n){const r=n.indexOf(":");return r!==-1?n.slice(r+1):n}function So(n){return n.includes(":")?n.split(":")[0]:"global"}function i4({value:n}){const[r,i]=j.useState(!1),o=n.length>200?n.slice(0,200)+"…":n;return s.jsx("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"cursor-pointer max-w-[300px]",children:r?s.jsx("p",{className:"text-[12px] break-all transition-colors truncate theme-text",children:o}):s.jsx("p",{className:"text-[12px] font-mono tracking-widest select-none theme-text-faint",children:"••••••"})})}function o4({onClose:n,onSave:r,defaultScope:i}){const[o,u]=j.useState(i?`${i}:`:""),[f,h]=j.useState(""),[g,x]=j.useState(!1),[m,p]=j.useState(""),b=j.useRef(null);j.useEffect(()=>{b.current?.focus()},[]);const v=async N=>{if(N.preventDefault(),!o.trim()){p("Key is required");return}if(f.trim()===""){p("Value is required");return}x(!0),p("");try{await r(o.trim(),f.trim()),n()}catch(T){p(T.message??"An error occurred"),x(!1)}};return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:N=>{N.target===N.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-md rounded-lg p-6 shadow-2xl shadow-black/60 border theme-border theme-sidebar",children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(Dt,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium theme-text-primary",children:"Add Memory Entry"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:theme-bg-overlay-md hover:theme-text border theme-border theme-bg-overlay theme-text-muted",children:s.jsx(_t,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider theme-text-faint",children:"Key / Identifier"}),s.jsx("input",{ref:b,value:o,onChange:N=>u(N.target.value),placeholder:"global:myKey or myKey",className:"w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-primary"}),s.jsxs("p",{className:"mt-1.5 text-[10px] theme-text-faint",children:["Prefix with"," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px] border theme-border theme-bg-overlay-md theme-text-muted",children:"scope:"})," ","to organise by scope (e.g."," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px] border theme-border theme-bg-overlay-md theme-text-muted",children:"user:name"}),"). Defaults to"," ",s.jsx("code",{className:"rounded px-1 py-0.5 text-[10px] border theme-border theme-bg-overlay-md theme-text-muted",children:"global"}),"."]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider theme-text-faint",children:"Value"}),s.jsx("textarea",{value:f,onChange:N=>h(N.target.value),placeholder:"Enter a string value…",rows:4,className:"w-full resize-none rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-primary"})]}),m&&s.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2.5",children:s.jsx("p",{className:"text-[12px] text-red-400",children:m})}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:theme-bg-overlay-md hover:theme-text border theme-border theme-bg-overlay theme-text-muted",children:"Cancel"}),s.jsxs("button",{onClick:v,disabled:g,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400 disabled:cursor-not-allowed disabled:opacity-50",children:[g&&s.jsx(dt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}),g?"Saving…":"Save Entry"]})]})]})]})})}function c4({onClose:n,onSave:r}){const[i,o]=j.useState(""),[u,f]=j.useState(""),h=j.useRef(null);j.useEffect(()=>{h.current?.focus()},[]);const g=x=>{x.preventDefault();const m=i.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");if(!m){f("Enter a valid scope name");return}r(m),n()};return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:x=>{x.target===x.currentTarget&&n()},children:s.jsxs("div",{className:"relative w-full max-w-sm rounded-lg p-6 shadow-2xl shadow-black/60 border theme-border theme-sidebar",children:[s.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(Dt,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsx("h2",{className:"text-[13.5px] font-medium theme-text-primary",children:"Add Scope"})]}),s.jsx("button",{onClick:n,className:"flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-muted",children:s.jsx(_t,{className:"h-[15px] w-[15px]",strokeWidth:2})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-[11px] font-semibold uppercase tracking-wider theme-text-faint",children:"Scope Name"}),s.jsx("input",{ref:h,value:i,onChange:x=>{o(x.target.value),f("")},placeholder:"e.g. session, user, cart",className:"w-full rounded-lg px-3 py-2 text-[12px] outline-none transition-colors focus:border-blue-500/50 border theme-border theme-bg-overlay theme-text-primary"}),s.jsxs("p",{className:"mt-1.5 text-[10px] theme-text-faint",children:["Memory entries under this scope will be keyed as"," ",s.jsxs("code",{className:"rounded px-1 py-0.5 text-[10px] border theme-border theme-bg-overlay-md theme-text-muted",children:[i.trim()?i.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""):"scope",":key"]})]})]}),u&&s.jsx("p",{className:"text-[12px] text-red-400",children:u}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:n,className:"rounded-lg px-4 py-2 text-[12px] transition-colors hover:cursor-pointer hover:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text-muted",children:"Cancel"}),s.jsxs("button",{onClick:g,className:"flex items-center gap-2 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(ut,{className:"h-[14px] w-[14px]",strokeWidth:2})," Create Scope"]})]})]})]})})}const u4={workflow:Td,global:z0},d4={workflow:{border:"border-blue-500/20",bg:"bg-blue-500/5",dot:"bg-blue-500/40",text:"text-blue-400",activeBg:"bg-blue-500/15",activeBorder:"border-blue-500/40"},environment:{border:"border-emerald-500/20",bg:"bg-emerald-500/5",dot:"bg-emerald-500/40",text:"text-emerald-400",activeBg:"bg-emerald-500/15",activeBorder:"border-emerald-500/40"},global:{border:"theme-border",bg:"theme-bg-overlay",dot:"bg-[var(--text-faint)]",text:"theme-text-muted",activeBg:"theme-bg-overlay-md",activeBorder:"theme-border"}},f4={border:"border-purple-500/20",bg:"bg-purple-500/5",dot:"bg-purple-500/40",text:"text-purple-400",activeBg:"bg-purple-500/15",activeBorder:"border-purple-500/40"};function gy(n){return d4[n]??f4}function h4({scope:n,active:r,onClick:i}){const o=gy(n.id),u=u4[n.id]??_o;return s.jsxs("button",{type:"button",onClick:i,className:`group relative flex flex-col gap-2 rounded-lg border p-3.5 text-left transition-all duration-200 hover:cursor-pointer ${r?`${o.activeBg} ${o.activeBorder}`:`${o.border} ${o.bg} hover:${o.activeBg}`}`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg border ${o.border} theme-bg-overlay`,children:s.jsx(u,{className:`h-[14px] w-[14px] ${o.text}`,strokeWidth:2})}),r&&s.jsx("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${o.activeBg}`,children:s.jsx(ut,{className:`h-2.5 w-2.5 ${o.text}`,strokeWidth:3})})]}),s.jsxs("div",{children:[s.jsx("p",{className:`text-[12px] font-medium ${o.text}`,children:n.label}),s.jsxs("p",{className:"text-[10px] theme-text-faint",children:[n.count," ",n.count===1?"entry":"entries"]})]})]})}function m4(){const[n,r]=j.useState([]),[i,o]=j.useState([]),[u,f]=j.useState([]),[h,g]=j.useState(null),[x,m]=j.useState(!0),[p,b]=j.useState(!1),[v,N]=j.useState(null),[T,_]=j.useState(""),[M,A]=j.useState(!1),[V,L]=j.useState(!1),[C,D]=j.useState(null),W=j.useCallback(async(O=!1)=>{O?b(!0):m(!0),N(null);try{const[z,E]=await Promise.all([j0(),a4()]);r(z),o(E)}catch(z){N(z.message??"Could not load memory data. Is `jetic dev` running?")}finally{m(!1),b(!1)}},[]);j.useEffect(()=>{W()},[W]);const X=async O=>{D(O);try{await l4(O),r(z=>z.filter(E=>E.key!==O))}catch(z){N(z.message??"Failed to delete entry")}finally{D(null)}},ie=async(O,z)=>{await s4(O,z);const E=await j0();r(E)},I=Array.from(new Set(n.map(O=>So(O.key)))),K=O=>n.filter(z=>So(z.key)===O).length,ne=[{id:"workflow",label:"Workflow",count:K("workflow"),isBuiltIn:!0},...i.map(O=>({id:`environment.${O.name}`,label:O.name,count:K(`environment.${O.name}`),isBuiltIn:!0}))],ee=new Set(["workflow",...i.map(O=>`environment.${O.name}`)]),se=I.filter(O=>!ee.has(O)&&O!=="global"),S=Array.from(new Set([...u,...se])),U=[...ne,...S.map(O=>({id:O,label:O.charAt(0).toUpperCase()+O.slice(1),count:K(O),isCustom:!0})),{id:"global",label:"Global",count:K("global"),isBuiltIn:!0}],k=h?n.filter(O=>So(O.key)===h):n,H=k.filter(O=>!T||O.key.toLowerCase().includes(T.toLowerCase())||N0(O.value).toLowerCase().includes(T.toLowerCase()));return s.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b theme-border",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium leading-none theme-text-primary",children:"Memory"}),s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:x?"Loading…":h?`${H.length} entries in ${h}`:`${n.length} entr${n.length===1?"y":"ies"} stored`})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>W(!0),disabled:p||x,title:"Refresh",className:"flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:theme-bg-overlay-md hover:theme-text disabled:opacity-40 border theme-border theme-bg-overlay theme-text-muted",children:s.jsx(na,{className:`h-[15px] w-[15px] ${p?"animate-spin":""}`,strokeWidth:2})}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(Dt,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]})]}),s.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-6",children:[!x&&!v&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Scopes"}),s.jsxs("button",{onClick:()=>L(!0),className:"flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] font-medium transition-colors hover:cursor-pointer hover:theme-bg-overlay-md border theme-border theme-text-faint",children:[s.jsx(Dt,{className:"h-3 w-3",strokeWidth:2})," Add Scope"]})]}),s.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:U.map(O=>s.jsx(h4,{scope:O,active:h===O.id,onClick:()=>g(z=>z===O.id?null:O.id)},O.id))}),h&&s.jsx("button",{type:"button",onClick:()=>g(null),className:"mt-2 text-[11px] transition-colors hover:cursor-pointer hover:text-blue-300 theme-text-faint",children:"← Show all scopes"})]}),!x&&!v&&s.jsx("div",{className:"border-t theme-border"}),!x&&n.length>0&&s.jsxs("div",{className:"relative",children:[s.jsx(zo,{className:"absolute left-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2 theme-text-faint",strokeWidth:2}),s.jsx("input",{value:T,onChange:O=>_(O.target.value),placeholder:h?`Filter ${h} entries…`:"Filter by key or value…",className:"w-full rounded-lg py-2 pl-9 pr-9 text-[12px] outline-none transition-colors focus:border-blue-500/50 focus:theme-bg-overlay-md border theme-border theme-bg-overlay theme-text"}),T&&s.jsx("button",{onClick:()=>_(""),className:"absolute right-3 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:theme-text border theme-border theme-bg-overlay-md theme-text-faint",children:s.jsx(_t,{className:"h-3 w-3",strokeWidth:2})})]}),x&&s.jsx("div",{className:"space-y-3",children:[1,2,3].map(O=>s.jsx("div",{className:"h-14 animate-pulse rounded-lg border theme-border theme-bg-overlay",style:{opacity:1-O*.2}},O))}),!x&&v&&s.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-red-500/20 bg-red-500/[0.04] p-10 text-center",children:[s.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg border border-red-500/20 bg-red-500/10 text-red-400",children:s.jsx(_o,{className:"h-6 w-6",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium text-red-300",children:"Could not load memory"}),s.jsx("p",{className:"mt-1 text-[11px] text-red-500/70",children:v})]}),s.jsx("button",{onClick:()=>W(),className:"rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-1.5 text-[12px] text-red-400 transition-colors hover:cursor-pointer hover:bg-red-500/20",children:"Retry"})]}),!x&&!v&&n.length===0&&s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 py-20 text-center",children:[s.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 blur-xl"}),s.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-lg text-blue-400 border theme-border theme-bg-overlay",children:s.jsx(_o,{className:"h-7 w-7",strokeWidth:2})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium theme-text",children:"Memory is empty"}),s.jsxs("p",{className:"mt-1 text-[12px] theme-text-faint",children:["Add your first entry or run"," ",s.jsx("code",{className:"rounded px-1.5 py-0.5 text-[11px] border theme-border theme-bg-overlay-md theme-text-muted",children:"jetic memory add"})," ","in the CLI."]})]}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-4 py-2 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(Dt,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Add Entry"]})]}),!x&&!v&&n.length>0&&h&&H.length===0&&!T&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(_o,{className:"h-[15px] w-[15px] theme-text-faint",strokeWidth:2})}),s.jsxs("p",{className:"text-[13px] theme-text-muted",children:["No entries in ",s.jsx("code",{className:"text-blue-400",children:h})," scope"]}),s.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:cursor-pointer hover:bg-blue-400",children:[s.jsx(Dt,{className:"h-[14px] w-[14px]",strokeWidth:2})," Add to ",h]})]}),!x&&!v&&n.length>0&&T&&H.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(zo,{className:"h-[15px] w-[15px] theme-text-faint",strokeWidth:2})}),s.jsxs("p",{className:"text-[13px] theme-text-muted",children:['No entries match "',T,'"']}),s.jsx("button",{onClick:()=>_(""),className:"text-[12px] text-blue-400 transition-colors hover:cursor-pointer hover:text-blue-300",children:"Clear filter"})]}),!x&&!v&&H.length>0&&s.jsx("div",{className:"overflow-y-auto rounded-lg border theme-border theme-bg-overlay",children:s.jsxs("table",{className:"w-full text-left whitespace-nowrap",children:[s.jsx("thead",{className:"border-b theme-border theme-bg-overlay",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-32 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Scope"}),s.jsx("th",{className:"w-48 px-4 py-3 text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Key"}),s.jsx("th",{className:"px-4 py-3 text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Value"}),s.jsx("th",{className:"w-16 px-4 py-3 text-right text-[10px] font-semibold uppercase tracking-wider theme-text-faint",children:"Actions"})]})}),s.jsx("tbody",{children:H.map((O,z)=>{const E=So(O.key),$=r4(O.key),Z=N0(O.value),ae=C===O.key,oe=gy(E);return s.jsxs("tr",{className:`group transition-colors hover:theme-bg-overlay-md ${z!==0?"border-t theme-border":""}`,children:[s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider border theme-bg-overlay-md ${oe.border} ${oe.text}`,children:E})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:"inline-flex items-center rounded-lg px-2.5 py-0.5 font-mono text-[11px] border theme-border theme-bg-overlay-md theme-text",children:$})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(i4,{value:Z})}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsx("button",{onClick:()=>X(O.key),disabled:ae,title:"Delete entry",className:"inline-flex h-7 w-7 items-center justify-center rounded-lg transition-colors hover:cursor-pointer hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-400 disabled:cursor-not-allowed disabled:opacity-50 border theme-border theme-bg-overlay theme-text-faint",children:ae?s.jsx(dt,{className:"h-[15px] w-[15px] animate-spin",strokeWidth:2}):s.jsx(Yt,{className:"h-[15px] w-[15px]",strokeWidth:2})})})]},O.key)})})]})}),!x&&!v&&T&&H.length>0&&s.jsxs("p",{className:"text-center text-[11px] theme-text-faint",children:["Showing ",H.length," of ",k.length," entries"]})]}),!x&&!v&&n.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5 px-6 py-3 text-[11px] border-t theme-border theme-text-faint",children:[s.jsx(Gr,{className:"h-[15px] w-[15px]",strokeWidth:2}),"Data read from"," ",s.jsx("code",{className:"rounded px-1.5 py-0.5 text-[10px] border theme-border theme-bg-overlay-md theme-text-muted",children:".jetic/memory.json"}),s.jsx("span",{className:"ml-auto",children:s.jsx("button",{onClick:()=>W(!0),className:"text-[11px] transition-colors hover:cursor-pointer hover:text-blue-400 theme-text-faint",children:"Refresh"})})]}),M&&s.jsx(o4,{onClose:()=>A(!1),onSave:ie,defaultScope:h??void 0}),V&&s.jsx(c4,{onClose:()=>L(!1),onSave:O=>f(z=>z.includes(O)?z:[...z,O])})]})}function p4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"APIs"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the APIs page."})]})}function x4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Email"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the Email page."})]})}function g4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"OAuth"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the OAuth page."})]})}function y4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Webhooks"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the Webhooks page."})]})}const w0={GET:{bg:"#052e16",text:"#4ade80",border:"#166534",dot:"#34d399"},POST:{bg:"#172554",text:"#60a5fa",border:"#1e40af",dot:"#60a5fa"},PUT:{bg:"#422006",text:"#fbbf24",border:"#92400e",dot:"#fbbf24"},PATCH:{bg:"#431407",text:"#fb923c",border:"#9a3412",dot:"#fb923c"},DELETE:{bg:"#3f0000",text:"#f87171",border:"#991b1b",dot:"#f87171"},HEAD:{bg:"#18181b",text:"var(--text-muted)",border:"var(--text-faint)",dot:"var(--text-muted)"},OPTIONS:{bg:"#2e1065",text:"#c084fc",border:"#6b21a8",dot:"#c084fc"}};function yy(n){return w0[n.toUpperCase()]??w0.GET}function b4({data:n}){const r=yy(n.method),i=n.passed?"#34d399":"#f87171",o=n.selected?"#60a5fa":n.passed===!0?"#166534":n.passed===!1?"#991b1b":"var(--text-faint)";return s.jsxs("div",{onClick:n.onSelect,style:{width:260,border:`1.5px solid ${o}`,borderRadius:10,background:"var(--bg-surface)",cursor:"pointer",boxShadow:n.selected?"0 0 0 2px rgba(96,165,250,0.4)":"0 2px 12px rgba(0,0,0,0.4)",transition:"box-shadow 0.15s ease",overflow:"hidden"},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{background:r.bg,borderBottom:`1px solid ${r.border}`,padding:"8px 12px",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:r.text,background:`${r.dot}15`,border:`1px solid ${r.dot}40`,borderRadius:4,padding:"2px 6px"},children:n.method}),s.jsx("span",{style:{fontSize:11,color:"var(--text-primary)",fontFamily:"monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),n.status>0&&s.jsx("span",{style:{fontSize:10,color:i,fontFamily:"monospace",fontWeight:600,flexShrink:0},children:n.status})]}),s.jsxs("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:5},children:[n.name&&s.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontStyle:"italic"},children:n.name}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:600,letterSpacing:"0.08em",color:n.passed?"#4ade80":"#f87171",background:n.passed?"rgba(74,222,128,0.08)":"rgba(248,113,113,0.08)",border:`1px solid ${n.passed?"rgba(74,222,128,0.2)":"rgba(248,113,113,0.2)"}`,borderRadius:4,padding:"2px 6px"},children:n.passed?"✓ PASSED":"✗ FAILED"}),n.durationMs>0&&s.jsxs("span",{style:{fontSize:10,color:"var(--text-faint)"},children:[n.durationMs,"ms"]})]}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:2},children:Object.entries(n.injectSpec).map(([u,f])=>s.jsxs("span",{style:{fontSize:9,color:"#a78bfa",background:"rgba(167,139,250,0.08)",border:"1px solid rgba(167,139,250,0.2)",borderRadius:4,padding:"1px 5px"},children:["📥 ",u," ← ","{{",f,"}}"]},u))}),(n.conditionSpec||n.conditionResult)&&s.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:2},children:s.jsxs("span",{style:{fontSize:9,fontWeight:600,color:n.conditionResult?n.conditionResult.passed?"#c084fc":"#fb923c":"#c084fc",background:n.conditionResult?.passed===!1?"rgba(251,146,60,0.1)":"rgba(192,132,252,0.1)",border:`1px solid ${n.conditionResult?.passed===!1?"rgba(251,146,60,0.3)":"rgba(192,132,252,0.3)"}`,borderRadius:4,padding:"1px 5px",display:"flex",alignItems:"center",gap:3},children:[s.jsx(ea,{style:{width:9,height:9}}),n.conditionResult?n.conditionResult.passed?"cond passed":"cond FAILED":"has condition"]})}),n.error&&s.jsxs("span",{style:{fontSize:9,color:"#f87171",marginTop:2},children:["⚠ ",n.error]}),s.jsx("span",{style:{fontSize:9,color:"var(--text-faint)",marginTop:2},children:"Click for details"})]}),s.jsx(jt,{type:"source",position:xe.Bottom,style:{background:"transparent",border:"none"}})]})}function v4({data:n}){const r=Object.entries(n.captured??{});return s.jsxs("div",{style:{width:200,border:"1.5px solid rgba(167,139,250,0.35)",borderRadius:10,background:"rgba(139,92,246,0.07)",padding:"8px 12px",backdropFilter:"blur(4px)"},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[s.jsx(Rr,{style:{width:12,height:12,color:"#a78bfa"}}),s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#a78bfa",letterSpacing:"0.06em"},children:"MEMORY"})]}),r.length===0&&s.jsx("span",{style:{fontSize:9,color:"var(--text-faint)"},children:"No variables captured"}),r.map(([i,o])=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[s.jsx("span",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace"},children:i}),s.jsx(dl,{style:{width:10,height:10,color:"var(--text-faint)",flexShrink:0}}),s.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:String(o).length>20?String(o).slice(0,20)+"…":o})]},i)),s.jsx(jt,{type:"source",position:xe.Bottom,style:{background:"transparent",border:"none"}})]})}function j4({data:n}){return s.jsxs("div",{style:{width:120,border:"1.5px solid rgba(96,165,250,0.4)",borderRadius:20,background:"rgba(96,165,250,0.08)",padding:"7px 14px",textAlign:"center"},children:[s.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#60a5fa",letterSpacing:"0.05em"},children:n.label}),s.jsx(jt,{type:"source",position:xe.Bottom,style:{background:"transparent",border:"none"}})]})}function N4({data:n}){const r=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24";return s.jsxs("div",{style:{width:140,border:`1.5px solid ${r}40`,borderRadius:20,background:`${r}0d`,padding:"7px 14px",textAlign:"center"},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsx("span",{style:{fontSize:11,fontWeight:600,color:r,letterSpacing:"0.05em"},children:n.phase==="done"&&n.failed===0?"✓ PASSED":n.phase==="aborted"?"✗ ABORTED":`${n.passed}/${n.passed+n.failed} PASSED`})]})}function w4({data:n}){const r=n.conditionResult?.passed,i=r===void 0?"#c084fc":r?"#4ade80":"#fb923c";return s.jsxs("div",{style:{width:44,height:44,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx(jt,{type:"target",position:xe.Top,style:{background:"transparent",border:"none"}}),s.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",children:[s.jsx("polygon",{points:"22,2 42,22 22,42 2,22",fill:"none",stroke:i,strokeWidth:"1.5"}),s.jsx("polygon",{points:"22,8 36,22 22,36 8,22",fill:i,fillOpacity:.15,stroke:"none"})]}),s.jsx("span",{style:{position:"absolute",fontSize:9,fontFamily:"monospace",fontWeight:700,color:i,top:"50%",left:"50%",transform:"translate(-50%,-50%)",whiteSpace:"nowrap"},children:"◇"}),s.jsx(jt,{type:"source",position:xe.Bottom,id:"pass",style:{background:"transparent",border:"none"}}),s.jsx(jt,{type:"source",position:xe.Right,id:"fail",style:{background:"transparent",border:"none"}})]})}function S4({data:n}){return s.jsxs("div",{style:{width:210,border:"1.5px dashed rgba(251,146,60,0.45)",borderRadius:12,background:"rgba(251,146,60,0.06)",padding:"9px 13px",backdropFilter:"blur(4px)"},children:[s.jsx(jt,{type:"target",position:xe.Left,style:{background:"transparent",border:"none"}}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[s.jsx(Id,{style:{width:11,height:11,color:"#fb923c"}}),s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.08em",color:"#fb923c"},children:"SWITCHED WORKFLOW"})]}),s.jsx("span",{style:{fontSize:11,color:"#fdba74",fontFamily:"monospace"},children:n.workflowName||"unknown"}),n.returnsOnComplete&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:6},children:[s.jsx(na,{style:{width:9,height:9,color:"var(--text-muted)"}}),s.jsx("span",{style:{fontSize:9,color:"var(--text-muted)"},children:"resumes main flow after"})]}),s.jsx(jt,{type:"source",position:xe.Right,id:"return",style:{background:"transparent",border:"none"}})]})}const E4={step:b4,memory:v4,condition:w4,start:j4,end:N4,branch:S4},ol=260,k4=130,_4=200,C4=90,T4=ol+90,Eo=50;function il(n,r={}){return{type:"smoothstep",pathOptions:{borderRadius:14},animated:!!r.animated,style:{stroke:n,strokeWidth:r.width??1.5,strokeDasharray:r.dashed?"5 4":void 0},markerEnd:{type:Ba.ArrowClosed,color:n,width:16,height:16},labelStyle:{fill:n,fontSize:9,fontWeight:600,fontFamily:"monospace"},labelBgStyle:r.labelBg===!1?{fill:"transparent"}:{fill:"var(--bg-base, #0a0a0a)",fillOpacity:.9},labelBgPadding:[4,2],labelBgBorderRadius:4}}function M4(n,r,i){const o=[],u=[];let f=0;o.push({id:"start",type:"start",position:{x:(ol-120)/2,y:f},data:{label:`▶ START · ${new Date(n.startedAt).toLocaleTimeString()}`},draggable:!1}),f+=50+Eo;for(let m=0;m<n.steps.length;m++){const p=n.steps[m],b=p.captureSpec&&Object.keys(p.captureSpec).length>0,v=p.captured&&Object.keys(p.captured).length>0,N=!!(p.conditionSpec||p.conditionResult),T=!!p.conditionSpec?.switchToWorkflow,_=p.passed?"#4ade80":"#f87171";o.push({id:`step-${m}`,type:"step",position:{x:0,y:f},data:{index:m,name:p.name,method:p.method,path:p.path,status:p.status,passed:p.passed,durationMs:p.durationMs,error:p.error,injectSpec:p.injectSpec,captureSpec:p.captureSpec,conditionSpec:p.conditionSpec,conditionResult:p.conditionResult,selected:r===m,onSelect:()=>i(m)},draggable:!1});const M=m===0?"start":ko(n,m-1)?`cond-${m-1}`:S0(n,m-1)?`mem-${m-1}`:`step-${m-1}`,A=m>0&&ko(n,m-1)?"pass":void 0;u.push({id:`e-${m}`,source:M,sourceHandle:A,target:`step-${m}`,...il(_,{width:2}),label:m>0&&n.steps[m-1].injectSpec?Object.keys(n.steps[m-1].injectSpec??{}).map(L=>`{{${L}}}`).join(", "):void 0}),f+=k4+Eo;let V=`step-${m}`;if((b||v)&&(o.push({id:`mem-${m}`,type:"memory",position:{x:(ol-_4)/2,y:f},data:{captured:v?p.captured:Object.fromEntries(Object.keys(p.captureSpec??{}).map(L=>[L.split(":").pop()??L,"…"]))},draggable:!1}),u.push({id:`e-mem-${m}`,source:`step-${m}`,target:`mem-${m}`,...il("#a78bfa",{dashed:!0,width:1.2}),label:"capture"}),f+=C4+Eo,V=`mem-${m}`),N){const L=p.conditionResult?.passed===!1?"#fb923c":"#c084fc",C=f;if(o.push({id:`cond-${m}`,type:"condition",position:{x:(ol-44)/2,y:C},data:{conditionSpec:p.conditionSpec,conditionResult:p.conditionResult},draggable:!1}),u.push({id:`e-cond-${m}`,source:V,target:`cond-${m}`,...il(L,{width:1.4}),label:p.conditionResult?p.conditionResult.passed?"PASS":"FAIL":"eval"}),T&&(o.push({id:`branch-${m}`,type:"branch",position:{x:T4,y:C-10},data:{workflowName:p.conditionSpec?.switchToWorkflow,returnsOnComplete:p.conditionSpec?.returnOnComplete},draggable:!1}),u.push({id:`e-branch-${m}`,source:`cond-${m}`,sourceHandle:"fail",target:`branch-${m}`,...il("#fb923c",{dashed:!0,width:1.6,labelBg:!0}),label:"on FAIL → switch"}),p.conditionSpec?.returnOnComplete)){const D=m<n.steps.length-1?`step-${m+1}`:"end";u.push({id:`e-branch-return-${m}`,source:`branch-${m}`,sourceHandle:"return",target:D,...il("#60a5fa",{dashed:!0,width:1.2,labelBg:!0}),label:"resume"})}f+=44+Eo}}o.push({id:"end",type:"end",position:{x:(ol-140)/2,y:f},data:{phase:n.phase,passed:n.passed,failed:n.failed},draggable:!1});const h=n.steps.length-1,g=n.steps.length>0?ko(n,h)?`cond-${h}`:S0(n,h)?`mem-${h}`:`step-${h}`:"start",x=n.steps.length>0&&ko(n,h)?"pass":void 0;return u.push({id:"e-end",source:g,sourceHandle:x,target:"end",...il(n.phase==="done"&&n.failed===0?"#4ade80":"#f87171",{width:2})}),o.push({id:"spine-rail",type:"default",position:{x:ol/2-1,y:0},data:{label:""},draggable:!1,selectable:!1,focusable:!1,style:{width:2,height:f,background:"linear-gradient(to bottom, rgba(96,165,250,0.18), rgba(167,139,250,0.12), rgba(74,222,128,0.18))",border:"none",borderRadius:2,pointerEvents:"none"},zIndex:-1}),{nodes:o,edges:u}}function ko(n,r){const i=n.steps[r];return i?!!(i.conditionSpec||i.conditionResult):!1}function S0(n,r){const i=n.steps[r];return i?i.captureSpec&&Object.keys(i.captureSpec).length>0||i.captured&&Object.keys(i.captured).length>0:!1}function A4({trace:n,selectedStep:r,onSelectStep:i}){const[o,u,f]=ly([]),[h,g,x]=ry([]);return j.useEffect(()=>{const{nodes:m,edges:p}=M4(n,r,i);u(m),g(p)},[n,r]),s.jsxs(yf,{nodes:o,edges:h,onNodesChange:f,onEdgesChange:x,nodeTypes:E4,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},minZoom:.15,maxZoom:2,defaultEdgeOptions:{type:"smoothstep"},style:{background:"transparent"},children:[s.jsx(fy,{variant:ln.Dots,gap:24,size:1,color:"rgba(255,255,255,0.04)"}),s.jsx(uy,{className:"theme-bg-surface border theme-border rounded-lg",showInteractive:!1}),s.jsx(l3,{nodeColor:m=>m.type==="memory"?"rgba(167,139,250,0.5)":m.type==="branch"?"rgba(251,146,60,0.5)":m.type==="start"||m.type==="end"?"rgba(96,165,250,0.5)":m.id==="spine-rail"?"transparent":m.data?.passed?"rgba(74,222,128,0.5)":"rgba(248,113,113,0.5)",className:"theme-bg-elevated border theme-border rounded-lg",maskColor:"rgba(0,0,0,0.4)"})]})}function R4({step:n,onClose:r}){const i=yy(n.method),[o,u]=j.useState("overview");return s.jsxs("div",{className:"flex flex-col h-full",style:{width:360,borderLeft:"1px solid var(--border)",backgroundColor:"var(--bg-surface)",flexShrink:0},children:[s.jsxs("div",{style:{borderBottom:"1px solid var(--border)",padding:"12px 16px",display:"flex",alignItems:"center",gap:10,backgroundColor:"var(--bg-elevated)"},children:[s.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:i.text,background:i.bg,border:`1px solid ${i.border}`,borderRadius:4,padding:"2px 8px"},children:n.method}),s.jsx("span",{style:{fontFamily:"monospace",fontSize:12,color:"var(--text-primary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),s.jsx("button",{onClick:r,className:"theme-text-faint flex items-center",children:s.jsx(_t,{className:"h-4 w-4"})})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:"1px solid var(--border)",backgroundColor:n.passed?"rgba(74,222,128,0.04)":"rgba(248,113,113,0.04)"},children:[n.passed?s.jsx(ut,{className:"h-4 w-4 text-emerald-400 shrink-0"}):s.jsx(Ht,{className:"h-4 w-4 text-red-400 shrink-0"}),s.jsxs("span",{style:{fontSize:11,fontWeight:600,color:n.passed?"#4ade80":"#f87171"},children:["HTTP ",n.status>0?n.status:"ERROR"," · ",n.durationMs,"ms"]}),n.expectStatus&&s.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",marginLeft:"auto"},children:["expected ",n.expectStatus]})]}),s.jsx("div",{className:"flex border-b theme-border",children:["overview","request","response","vars","conditions"].map(f=>s.jsx("button",{onClick:()=>u(f),style:{flex:1,padding:"8px 4px",fontSize:10,fontWeight:600,letterSpacing:"0.05em",textTransform:"capitalize",color:o===f?"#60a5fa":"var(--text-muted)",borderBottom:o===f?"2px solid #60a5fa":"2px solid transparent",background:"transparent",cursor:"pointer",transition:"color 0.15s"},children:f},f))}),s.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"14px 16px"},children:[o==="overview"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(wn,{title:"Step",children:[s.jsx(Lt,{k:"Index",v:`#${n.index+1}`}),s.jsx(Lt,{k:"Name",v:n.name||"—"}),s.jsx(Lt,{k:"Method",v:n.method}),s.jsx(Lt,{k:"Path",v:n.path,mono:!0}),n.description&&s.jsx(Lt,{k:"Description",v:n.description})]}),s.jsxs(wn,{title:"Timing",children:[s.jsx(Lt,{k:"Duration",v:`${n.durationMs}ms`,accent:"#60a5fa"}),n.expectStatus&&s.jsx(Lt,{k:"Expected status",v:String(n.expectStatus)}),s.jsx(Lt,{k:"Actual status",v:n.status>0?String(n.status):"No response",accent:n.passed?"#4ade80":"#f87171"})]}),n.error&&s.jsx(wn,{title:"Error",children:s.jsx("div",{style:{background:"rgba(248,113,113,0.06)",border:"1px solid rgba(248,113,113,0.2)",borderRadius:6,padding:"8px 10px"},children:s.jsx("span",{style:{fontSize:11,color:"#f87171",fontFamily:"monospace"},children:n.error})})})]}),o==="request"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[Object.keys(n.injected??{}).length>0&&s.jsx(wn,{title:"Headers (injected)",children:Object.entries(n.injected??{}).map(([f,h])=>s.jsx(Lt,{k:f,v:String(h),mono:!0},f))}),n.injectSpec&&Object.keys(n.injectSpec).length>0&&s.jsx(wn,{title:"Variable injection spec",children:Object.entries(n.injectSpec).map(([f,h])=>s.jsx(Lt,{k:f,v:`← {{${h}}}`,mono:!0,accent:"#a78bfa"},f))}),n.requestBody?s.jsx(wn,{title:"Request body",children:s.jsx("pre",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"monospace",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:6,padding:10,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:JSON.stringify(n.requestBody,null,2)})}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No request body"})]}),o==="response"&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:n.responseBody!==void 0?s.jsx(wn,{title:`Response body · HTTP ${n.status}`,children:s.jsx("pre",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"monospace",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:6,padding:10,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:typeof n.responseBody=="string"?n.responseBody:JSON.stringify(n.responseBody,null,2)})}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No response body recorded"})}),o==="vars"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.captureSpec&&Object.keys(n.captureSpec).length>0&&s.jsx(wn,{title:"Capture spec (JSONPath)",children:Object.entries(n.captureSpec).map(([f,h])=>s.jsx(Lt,{k:f,v:h,mono:!0,accent:"#a78bfa"},f))}),n.captured&&Object.keys(n.captured).length>0?s.jsx(wn,{title:"Captured values",children:Object.entries(n.captured).map(([f,h])=>s.jsx(Lt,{k:f,v:String(h),mono:!0,accent:"#4ade80"},f))}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No variables captured in this step"})]}),o==="conditions"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[n.conditionResult&&s.jsx(wn,{title:"Condition Evaluation Result",children:s.jsxs("div",{style:{padding:"8px 10px",borderRadius:6,border:`1px solid ${n.conditionResult.passed?"rgba(74,222,128,0.2)":"rgba(251,146,60,0.2)"}`,background:n.conditionResult.passed?"rgba(74,222,128,0.06)":"rgba(251,146,60,0.06)"},children:[s.jsxs("span",{style:{fontSize:11,fontWeight:600,color:n.conditionResult.passed?"#4ade80":"#fb923c"},children:["◇ Condition ",n.conditionResult.passed?"PASSED":"FAILED"]}),s.jsx("p",{style:{fontSize:10,color:"var(--text-secondary)",marginTop:4,fontFamily:"monospace"},children:n.conditionResult.reason})]})}),n.conditionSpec?s.jsxs(wn,{title:"Condition Rules",children:[s.jsx(Lt,{k:"Logic mode",v:n.conditionSpec.rules.all?"AND (all rules must pass)":"OR (any rule can pass)"}),s.jsx(Lt,{k:"Failure action",v:n.conditionSpec.onFail,accent:"#fb923c"}),n.conditionSpec.switchToWorkflow&&s.jsx(Lt,{k:"Switch workflow",v:n.conditionSpec.switchToWorkflow,mono:!0,accent:"#60a5fa"}),n.conditionSpec.returnOnComplete!==void 0&&s.jsx(Lt,{k:"Return on complete",v:n.conditionSpec.returnOnComplete?"Yes (resumes main workflow)":"No (permanent switch)"}),s.jsxs("div",{style:{marginTop:6},children:[s.jsx("p",{style:{fontSize:9,color:"var(--text-faint)",textTransform:"uppercase",marginBottom:4},children:"Rules list"}),(n.conditionSpec.rules.all??n.conditionSpec.rules.any??[]).map((f,h)=>s.jsxs("div",{style:{fontSize:10,color:"#c4b5fd",fontFamily:"monospace",background:"var(--bg-overlay)",padding:"4px 8px",borderRadius:4,marginBottom:3},children:[f.left," ",s.jsx("span",{style:{color:"#a78bfa"},children:f.operator})," ",f.right!==void 0?f.right:""]},h))]})]}):s.jsx("span",{style:{fontSize:11,color:"var(--text-faint)"},children:"No condition configured for this step"})]})]})]})}function wn({title:n,children:r}){return s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:"var(--text-faint)",textTransform:"uppercase",marginBottom:8},children:n}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:r})]})}function Lt({k:n,v:r,mono:i=!1,accent:o}){return s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[s.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",minWidth:100,flexShrink:0},children:n}),s.jsx("span",{style:{fontSize:10,color:o??"var(--text-secondary)",fontFamily:i?"monospace":void 0,wordBreak:"break-all"},children:r})]})}function z4({trace:n}){const[r,i]=j.useState(null),o=n.steps.reduce((f,h)=>f+h.durationMs,0)||1,u=j.useCallback(f=>{i(h=>h===f?null:f)},[]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),s.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:6},children:[s.jsx(Gr,{className:"h-3 w-3 inline"}),new Date(n.startedAt).toLocaleString(),n.baseUrl&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("code",{className:"theme-text-faint",children:n.baseUrl})]}),"· ",s.jsx("span",{className:"theme-text-faint",children:n.source==="local-sim"?"Simulated locally":"Real API run"})]})]}),s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,flexShrink:0,fontSize:11,fontWeight:600,padding:"4px 12px",borderRadius:20,color:n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24",background:n.phase==="done"&&n.failed===0?"rgba(74,222,128,0.08)":"rgba(248,113,113,0.08)",border:`1px solid ${n.phase==="done"&&n.failed===0?"rgba(74,222,128,0.2)":"rgba(248,113,113,0.2)"}`},children:[n.phase==="done"&&n.failed===0?s.jsx(ut,{className:"h-3.5 w-3.5"}):s.jsx(Ht,{className:"h-3.5 w-3.5"}),n.passed,"/",n.passed+n.failed," passed · ",n.durationMs,"ms"]})]}),s.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[s.jsxs("p",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.1em",color:"var(--text-faint)",marginBottom:6,textTransform:"uppercase"},children:["Timeline · ",n.steps.length," steps · ",n.durationMs,"ms total"]}),s.jsx("div",{style:{display:"flex",gap:2,height:8,borderRadius:4,overflow:"hidden"},children:n.steps.map((f,h)=>s.jsx("div",{onClick:()=>u(h),title:`${f.method} ${f.path} — ${f.durationMs}ms`,style:{flex:f.durationMs/o,minWidth:4,background:f.passed?"#22c55e":"#ef4444",cursor:"pointer",opacity:r===h?1:.7,borderRadius:2,transition:"opacity 0.15s"}},h))}),s.jsx("div",{style:{display:"flex",gap:2,marginTop:4},children:n.steps.map((f,h)=>s.jsx("div",{style:{flex:f.durationMs/o,minWidth:4,fontSize:8,color:"var(--text-faint)",overflow:"hidden",cursor:"pointer"},onClick:()=>u(h),children:h+1},h))})]}),s.jsxs("div",{style:{flex:1,display:"flex",minHeight:0},children:[s.jsx("div",{style:{flex:1,minWidth:0,position:"relative"},children:s.jsx(A4,{trace:n,selectedStep:r,onSelectStep:u})}),r!==null&&n.steps[r]&&s.jsx(R4,{step:n.steps[r],onClose:()=>i(null)})]})]})}function O4({trace:n,selected:r,onClick:i,onDelete:o}){const u=n.phase==="done"&&n.failed===0?"#4ade80":n.phase==="aborted"?"#f87171":"#fbbf24",f=()=>{const h=Date.now()-new Date(n.startedAt).getTime();return h<6e4?`${Math.round(h/1e3)}s ago`:h<36e5?`${Math.round(h/6e4)}m ago`:`${Math.round(h/36e5)}h ago`};return s.jsx("div",{onClick:i,style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",cursor:"pointer",backgroundColor:r?"rgba(96,165,250,0.06)":"transparent",borderLeft:r?"3px solid #60a5fa":"3px solid transparent",transition:"background 0.1s",position:"relative"},className:"group",children:s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[s.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:u,flexShrink:0,marginTop:4}}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:11,fontWeight:500,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.workflowName}),s.jsxs("p",{style:{fontSize:9,color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[s.jsx(Gr,{className:"h-2.5 w-2.5 inline shrink-0"}),f()," · ",n.steps.length," steps · ",n.durationMs,"ms"]}),s.jsxs("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:[n.passed>0&&s.jsxs("span",{style:{fontSize:9,color:"#4ade80",background:"rgba(74,222,128,0.08)",border:"1px solid rgba(74,222,128,0.2)",borderRadius:4,padding:"1px 5px"},children:[n.passed," ✓"]}),n.failed>0&&s.jsxs("span",{style:{fontSize:9,color:"#f87171",background:"rgba(248,113,113,0.08)",border:"1px solid rgba(248,113,113,0.2)",borderRadius:4,padding:"1px 5px"},children:[n.failed," ✗"]}),s.jsx("span",{style:{fontSize:9,color:"var(--text-faint)",background:"var(--bg-overlay)",border:"1px solid var(--border)",borderRadius:4,padding:"1px 5px"},children:n.source==="local-sim"?"sim":"api"}),n.steps.some(h=>h.conditionSpec||h.conditionResult)&&s.jsxs("span",{style:{fontSize:9,color:"#c084fc",background:"rgba(192,132,252,0.08)",border:"1px solid rgba(192,132,252,0.2)",borderRadius:4,padding:"1px 5px",display:"flex",alignItems:"center",gap:2},children:[s.jsx(ea,{style:{width:8,height:8}})," cond"]})]})]}),s.jsx("button",{onClick:h=>{h.stopPropagation(),o()},style:{opacity:0,transition:"opacity 0.1s",color:"var(--text-faint)",display:"flex",alignItems:"center",padding:2,borderRadius:4},className:"group-hover:opacity-100",title:"Delete trace",children:s.jsx(Yt,{className:"h-3 w-3"})})]})})}function D4(){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,padding:"40px 20px",textAlign:"center"},children:[s.jsxs("div",{style:{position:"relative",width:52,height:52,display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(96,165,250,0.1)",filter:"blur(8px)"}}),s.jsx("div",{style:{position:"relative",width:52,height:52,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"#60a5fa"},children:s.jsx(Vr,{className:"h-6 w-6"})})]}),s.jsx("p",{style:{fontSize:12,fontWeight:500,color:"var(--text-secondary)"},children:"No traces yet"}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",maxWidth:200},children:"Run a simulation from the Simulations page to generate a trace."})]})}function H4(){return s.jsxs("div",{style:{display:"flex",flex:1,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:14,textAlign:"center",padding:32},children:[s.jsxs("div",{style:{position:"relative",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"rgba(167,139,250,0.1)",filter:"blur(12px)"}}),s.jsx("div",{style:{position:"relative",width:64,height:64,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",color:"#a78bfa"},children:s.jsx(Vo,{className:"h-8 w-8"})})]}),s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text-secondary)"},children:"Select a trace"}),s.jsx("p",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"Pick a run from the list to visualize its execution graph"})]}),s.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:10,padding:"12px 16px",backgroundColor:"var(--bg-overlay)",maxWidth:340,textAlign:"left"},children:[s.jsx("p",{style:{fontSize:10,fontWeight:600,color:"var(--text-faint)",marginBottom:8,textTransform:"uppercase",letterSpacing:"0.08em"},children:"What you'll see"}),[["HTTP step nodes","Every request in the workflow shown as a graph node with method, path, status, and timing"],["Memory nodes","Variables captured from responses (tokens, IDs, etc.) shown in between steps"],["Branch forks","Conditions that switch workflows peel off into a side branch, then merge back if they resume"],["Execution flow","Arrows colored green/red showing the success/failure path through your workflow"],["Step detail drawer","Click any node to see full request/response bodies, headers, and capture specs"]].map(([n,r])=>s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[s.jsx("span",{style:{color:"#60a5fa",flexShrink:0,marginTop:1},children:"→"}),s.jsxs("div",{children:[s.jsx("span",{style:{fontSize:11,fontWeight:500,color:"var(--text-secondary)"},children:n}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:1},children:r})]})]},n))]})]})}function $4({initialFilter:n,onNavigate:r}){const[i,o]=j.useState([]),[u,f]=j.useState(!0),[h,g]=j.useState(""),[x,m]=j.useState(null),p=j.useRef(!1),b=j.useCallback(async()=>{f(!0);try{const _=await gx();if(o(_),!p.current&&n?.traceId){const M=_.find(A=>A.id===n.traceId);M&&(m(M),p.current=!0)}else if(!p.current&&n?.workflowName&&_.length>0){const M=_.find(A=>A.workflowName===n.workflowName);M&&(m(M),p.current=!0)}}finally{f(!1)}},[n?.traceId,n?.workflowName]);j.useEffect(()=>{b()},[b]),j.useEffect(()=>{const _=setInterval(()=>{gx().then(M=>{(M.length!==i.length||M.some((A,V)=>A.id!==i[V]?.id))&&o(M)}).catch(()=>{})},5e3);return()=>clearInterval(_)},[i]),j.useEffect(()=>{if(n?.traceId&&i.length>0){const _=i.find(M=>M.id===n.traceId);_&&m(_)}},[n?.traceId,i]);const v=async _=>{await y2(_),x?.id===_&&m(null),o(M=>M.filter(A=>A.id!==_))},N=async()=>{confirm("Delete all traces? This cannot be undone.")&&(await b2(),o([]),m(null))},T=i.filter(_=>!h.trim()||_.workflowName.toLowerCase().includes(h.toLowerCase())||_.steps.some(M=>M.path.toLowerCase().includes(h.toLowerCase())));return s.jsxs("div",{style:{display:"flex",height:"100%"},className:"w-full",children:[s.jsxs("div",{style:{width:280,flexShrink:0,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border)",backgroundColor:"var(--bg-surface)"},children:[s.jsxs("div",{style:{padding:"14px 14px 10px",borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-elevated)",flexShrink:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",lineHeight:1},children:"Traces"}),s.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:3},children:u?"Loading…":`${i.length} run${i.length!==1?"s":""} stored`})]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[s.jsx("button",{onClick:b,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:7,border:"1px solid var(--border)",background:"var(--bg-overlay)",color:"var(--text-muted)",cursor:"pointer"},children:s.jsx(na,{className:"h-3.5 w-3.5"})}),i.length>0&&s.jsx("button",{onClick:N,title:"Clear all",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:7,border:"1px solid rgba(239,68,68,0.25)",background:"rgba(239,68,68,0.06)",color:"#f87171",cursor:"pointer"},children:s.jsx(Yt,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx(zo,{style:{position:"absolute",left:8,top:"50%",transform:"translateY(-50%)",width:13,height:13,color:"var(--text-faint)",pointerEvents:"none"}}),s.jsx("input",{value:h,onChange:_=>g(_.target.value),placeholder:"Search traces…",style:{width:"100%",paddingLeft:28,paddingRight:h?28:10,paddingTop:6,paddingBottom:6,fontSize:11,border:"1px solid var(--border)",borderRadius:8,backgroundColor:"var(--bg-overlay)",color:"var(--text-secondary)",outline:"none",boxSizing:"border-box"}}),h&&s.jsx("button",{onClick:()=>g(""),style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--text-faint)",display:"flex",background:"none",border:"none",cursor:"pointer",padding:0},children:s.jsx(_t,{className:"h-3 w-3"})})]})]}),s.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[u&&s.jsx("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[1,2,3].map(_=>s.jsx("div",{style:{height:64,borderRadius:8,border:"1px solid var(--border)",backgroundColor:"var(--bg-overlay)",opacity:1-_*.25,animation:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite"}},_))}),!u&&T.length===0&&s.jsx(D4,{}),!u&&T.map(_=>s.jsx(O4,{trace:_,selected:x?.id===_.id,onClick:()=>m(_),onDelete:()=>v(_.id)},_.id))]}),r&&s.jsxs("div",{style:{padding:"10px 14px",borderTop:"1px solid var(--border)",display:"flex",gap:10},children:[s.jsxs("button",{onClick:()=>r("simulations"),style:{display:"flex",alignItems:"center",gap:4,fontSize:10,color:"#60a5fa",background:"none",border:"none",cursor:"pointer",padding:0},children:[s.jsx(ea,{className:"h-3 w-3"})," Simulations ",s.jsx(fx,{className:"h-2.5 w-2.5"})]}),s.jsxs("button",{onClick:()=>r("model"),style:{display:"flex",alignItems:"center",gap:4,fontSize:10,color:"#60a5fa",background:"none",border:"none",cursor:"pointer",padding:0},children:[s.jsx(R0,{className:"h-3 w-3"})," Model ",s.jsx(fx,{className:"h-2.5 w-2.5"})]})]})]}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",backgroundColor:"var(--bg-base)"},children:x?s.jsx(z4,{trace:x,onNavigate:r}):s.jsx(H4,{})})]})}function U4(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Events"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This page is underdevelopnment."})]})}function B4(n){const r=n.split(".").pop()?.toLowerCase()??"";return["ts","tsx","js","jsx","mjs","py","go","rs"].includes(r)?{icon:cv,color:"text-blue-400"}:["json","yaml","yml","toml","env"].includes(r)?{icon:Jd,color:"text-amber-400"}:["sql","prisma","graphql","gql"].includes(r)?{icon:Rr,color:"text-emerald-400"}:{icon:fv,color:"theme-text-muted"}}function q4(n){try{const r=Math.floor((Date.now()-new Date(n).getTime())/1e3);return r<5?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function L4({onNavigate:n}={}){const[r,i]=j.useState(null),[o,u]=j.useState(!0),[f,h]=j.useState(null),[g,x]=j.useState(!1),[m,p]=j.useState(""),[b,v]=j.useState(null),[N,T]=j.useState(!1),_=j.useCallback(async(C=!1)=>{C||u(!0);try{const D=await fetch("/api/changes");if(!D.ok)throw new Error(`HTTP ${D.status}`);i(await D.json()),h(null)}catch(D){h(D.message??"Failed to fetch changes")}finally{C||u(!1)}},[]),M=async()=>{if(!N){T(!0);try{await fetch("/api/changes",{method:"DELETE"}),await _(!0)}catch(C){alert(`Clear failed: ${C.message}`)}finally{T(!1)}}},A=C=>{navigator.clipboard.writeText(C),v(C),setTimeout(()=>v(null),2e3)};j.useEffect(()=>{_();let C=null,D=null;try{C=new EventSource("/api/changes/stream"),C.onopen=()=>x(!0),C.onmessage=W=>{try{i(JSON.parse(W.data))}catch{}},C.onerror=()=>{x(!1),D||(D=setInterval(()=>_(!0),2e3))}}catch{D=setInterval(()=>_(!0),2e3)}return()=>{C?.close(),D&&clearInterval(D)}},[_]);const V=j.useMemo(()=>{if(!r?.changes)return[];if(!m)return r.changes;const C=m.toLowerCase();return r.changes.filter(D=>D.filePath.toLowerCase().includes(C))},[r,m]),L=r?.changes?.length??0;return s.jsxs("div",{className:"flex flex-1 flex-col min-h-0 theme-bg-base theme-text-primary",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b theme-border theme-sidebar",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(M0,{className:"h-[15px] w-[15px] shrink-0 theme-text-muted",strokeWidth:2}),s.jsx("span",{className:"text-[13.5px] font-medium tracking-tight theme-text-primary",children:"File Changes"}),L>0&&s.jsx("span",{className:"rounded-full px-2 py-0.5 text-[11px] font-medium border theme-border theme-bg-overlay-md theme-text-muted",children:L}),s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium border theme-border theme-bg-overlay theme-text-muted",children:[s.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${g?"bg-blue-500 animate-pulse":"bg-[var(--text-faint)]"}`}),g?"Live":"Polling"]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("button",{type:"button",onClick:()=>_(!1),disabled:o,className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium transition-colors border theme-border theme-bg-overlay theme-text-muted",children:[s.jsx(na,{className:`h-3 w-3 shrink-0 ${o?"animate-spin":""}`,strokeWidth:2}),"Refresh"]}),s.jsxs("button",{type:"button",onClick:M,disabled:N||L===0,className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-40 border theme-border theme-bg-overlay theme-text-muted",children:[s.jsx(Yt,{className:"h-3 w-3 shrink-0",strokeWidth:2}),N?"Clearing…":"Clear"]})]})]}),s.jsx("div",{className:"px-4 py-2.5 border-b theme-border",children:s.jsxs("div",{className:"relative",children:[s.jsx(zo,{className:"absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 shrink-0 theme-text-faint",strokeWidth:2}),s.jsx("input",{type:"text",placeholder:"Filter by filename or path…",value:m,onChange:C=>p(C.target.value),className:"w-full rounded-lg py-1.5 pl-8 pr-3 text-[12px] focus:outline-none focus:ring-1 focus:ring-blue-500/50 border theme-border theme-bg-overlay theme-text-primary"}),m&&s.jsx("button",{type:"button",onClick:()=>p(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] theme-text-muted",children:"Clear"})]})}),f&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[11px] border-b theme-border theme-text-muted",children:[s.jsx(Ht,{className:"h-3.5 w-3.5 shrink-0 text-red-400",strokeWidth:2}),f]}),s.jsx("div",{className:"flex flex-1 flex-col overflow-y-auto",children:o&&!r?s.jsxs("div",{className:"flex items-center justify-center gap-2 p-10 theme-text-muted",children:[s.jsx(na,{className:"h-4 w-4 animate-spin text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[12px]",children:"Connecting…"})]}):V.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 p-10 text-center",children:[s.jsx(ut,{className:"h-5 w-5 mb-1 text-blue-400",strokeWidth:2}),s.jsx("span",{className:"text-[13px] font-medium theme-text-primary",children:L===0?"No pending changes":"No files match filter"}),s.jsx("span",{className:"text-[11px] theme-text-muted",children:L===0?"File edits appear here in real-time.":"Try a different search."})]}):V.map(C=>{const{icon:D,color:W}=B4(C.filePath),X=C.filePath.split("/"),ie=X.pop()??C.filePath,I=X.join("/"),K=b===C.filePath;return s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:theme-bg-overlay border-b theme-border",children:[s.jsx(D,{className:`h-[15px] w-[15px] shrink-0 ${W}`,strokeWidth:1.75}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-[12.5px] font-medium theme-text-primary",children:ie}),I&&s.jsxs("span",{className:"truncate text-[11px] theme-text-faint",children:[I,"/"]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] border theme-border theme-bg-overlay theme-text-faint",children:C.eventType}),s.jsx("span",{className:"w-14 text-right text-[11px] theme-text-muted",children:q4(C.changedAt)}),s.jsx("button",{type:"button",onClick:()=>A(C.filePath),title:"Copy path",className:"flex h-6 w-6 items-center justify-center rounded transition-colors border theme-border theme-bg-overlay theme-text-faint",children:K?s.jsx(ut,{className:"h-3 w-3 text-blue-400",strokeWidth:2}):s.jsx(T0,{className:"h-3 w-3",strokeWidth:2})})]})]},C.filePath)})})]})}function xs({icon:n,label:r,description:i}){return s.jsxs("div",{className:"flex items-start gap-3 pb-4 border-b theme-border",children:[s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border theme-border theme-bg-overlay",children:s.jsx(n,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium theme-text-primary",children:r}),i&&s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:i})]})]})}function lt({label:n,description:r,children:i}){return s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b theme-border last:border-0",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[13px] theme-text-primary",children:n}),r&&s.jsx("p",{className:"text-[11px] theme-text-muted mt-0.5",children:r})]}),s.jsx("div",{className:"shrink-0",children:i})]})}function sn({value:n,onChange:r}){return s.jsx("button",{onClick:()=>r(!n),className:`relative flex h-5 w-9 items-center rounded-full border transition-colors ${n?"bg-blue-500 border-blue-400":"bg-white/[0.04] border-white/10"}`,children:s.jsx("span",{className:`absolute h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${n?"translate-x-4":"translate-x-0.5"}`})})}function Y4({value:n,onChange:r,placeholder:i,mono:o=!1,type:u="text"}){return s.jsx("input",{type:u,value:n,onChange:f=>r(f.target.value),placeholder:i,className:`w-56 rounded-lg border theme-border theme-bg-overlay px-3 py-1.5 text-[12px] theme-text-primary outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md placeholder:theme-text-faint transition-colors ${o?"font-mono":""}`})}function yl({value:n,onChange:r,options:i}){return s.jsx("select",{value:n,onChange:o=>r(o.target.value),className:"rounded-lg border theme-border theme-bg-surface px-3 py-1.5 text-[12px] theme-text-primary outline-none focus:border-blue-500/50 transition-colors",children:i.map(o=>s.jsx("option",{value:o,children:o},o))})}function gs({children:n,className:r=""}){return s.jsx("div",{className:`rounded-lg border border-white/10 bg-white/[0.02] p-5 space-y-1 ${r}`,children:n})}function by({saving:n,onClick:r}){return s.jsxs("button",{onClick:r,disabled:n,className:"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-[12px] font-medium text-white hover:bg-blue-400 disabled:opacity-50 transition-colors",children:[n?s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):s.jsx(Lv,{className:"h-3.5 w-3.5",strokeWidth:2}),n?"Saving…":"Save"]})}const V4=[{id:"general",label:"General",icon:zr},{id:"environments",label:"Environments",icon:vl},{id:"appearance",label:"Appearance",icon:D0},{id:"editor",label:"Editor",icon:Vo},{id:"notifications",label:"Notifications",icon:C0},{id:"api",label:"API & Auth",icon:La},{id:"advanced",label:"Advanced",icon:Pd}];function G4({model:n}){const[r,i]=j.useState(n?.project?.name??""),[o,u]=j.useState(n?.project?.language??"TypeScript"),[f,h]=j.useState(n?.project?.framework??"Express"),[g,x]=j.useState(!1),[m,p]=j.useState(!1);j.useEffect(()=>{i(n?.project?.name??""),u(n?.project?.language??"TypeScript"),h(n?.project?.framework??"Express")},[n]);const b=async()=>{x(!0),await new Promise(v=>setTimeout(v,600)),x(!1),p(!0),setTimeout(()=>p(!1),2e3)};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:zr,label:"General",description:"Project identity and basic configuration"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Project Name",description:"Display name shown in the dashboard",children:s.jsx(Y4,{value:r,onChange:i,placeholder:"My API"})}),s.jsx(lt,{label:"Language",description:"Primary language of your backend",children:s.jsx(yl,{value:o,onChange:u,options:["TypeScript","JavaScript","Python","Go","Rust"]})}),s.jsx(lt,{label:"Framework",description:"HTTP framework used by your server",children:s.jsx(yl,{value:f,onChange:h,options:["Express","Fastify","Hono","Koa","NestJS","Other"]})}),s.jsxs("div",{className:"flex justify-end pt-2 gap-2",children:[m&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[s.jsx(ut,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(by,{saving:g,onClick:b})]})]})]})}function X4({model:n}){const[r,i]=j.useState(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}]),[o,u]=j.useState(!1),[f,h]=j.useState(!1);j.useEffect(()=>{i(n?.environments??[{name:"local",baseUrl:"http://localhost:3000"}])},[n]);const g=()=>i(b=>[...b,{name:"",baseUrl:""}]),x=b=>i(v=>v.filter((N,T)=>T!==b)),m=(b,v,N)=>i(T=>T.map((_,M)=>M===b?{..._,[v]:N}:_)),p=async()=>{u(!0),await new Promise(b=>setTimeout(b,600)),u(!1),h(!0),setTimeout(()=>h(!1),2e3)};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:vl,label:"Environments",description:"Configure your API base URLs for simulation"}),s.jsxs(gs,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-4 px-1 mb-2",children:[s.jsx("p",{className:"w-24 text-[10px] uppercase tracking-wider theme-text-faint font-semibold",children:"Name"}),s.jsx("p",{className:"flex-1 text-[10px] uppercase tracking-wider theme-text-faint font-semibold",children:"Base URL"})]}),r.map((b,v)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{value:b.name,onChange:N=>m(v,"name",N.target.value),placeholder:"local",className:"w-24 rounded-lg border theme-border theme-bg-overlay px-3 py-1.5 text-[12px] theme-text-primary outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md placeholder:theme-text-faint transition-colors"}),s.jsx("input",{value:b.baseUrl,onChange:N=>m(v,"baseUrl",N.target.value),placeholder:"http://localhost:3000",className:"flex-1 rounded-lg border theme-border theme-bg-overlay px-3 py-1.5 font-mono text-[12px] theme-text-primary outline-none focus:border-blue-500/50 focus:theme-bg-overlay-md placeholder:theme-text-faint transition-colors"}),s.jsx("button",{onClick:()=>x(v),className:"flex h-7 w-7 items-center justify-center rounded-lg border theme-border theme-bg-overlay theme-text-muted hover:bg-red-500/10 hover:border-red-500/30 hover:text-red-400 transition-colors",children:s.jsx(_t,{className:"h-3.5 w-3.5",strokeWidth:2})})]},v)),s.jsx("button",{onClick:g,className:"text-[12px] text-blue-400 hover:text-blue-300 transition-colors mt-1",children:"+ Add environment"})]}),s.jsxs("div",{className:"flex justify-end pt-3 gap-2 border-t border-white/[0.06]",children:[f&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-emerald-400",children:[s.jsx(ut,{className:"h-3.5 w-3.5",strokeWidth:2})," Saved"]}),s.jsx(by,{saving:o,onClick:p})]})]}),s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay px-4 py-3 flex items-start gap-2.5",children:[s.jsx(yv,{className:"h-3.5 w-3.5 text-blue-400/70 shrink-0 mt-0.5",strokeWidth:2}),s.jsxs("p",{className:"text-[11px] theme-text-muted",children:["The"," ",s.jsx("code",{className:"theme-text-primary theme-bg-overlay-md px-1 py-0.5 rounded text-[10px]",children:"local"})," ","environment is used as the default base URL for simulations and endpoint testing."]})]})]})}function Z4(){const[n,r]=j.useState("dark"),[i,o]=j.useState("blue"),[u,f]=j.useState("comfortable"),[h,g]=j.useState(!0),x=["blue","violet","emerald","amber","rose"],m={blue:"#3b82f6",violet:"#8b5cf6",emerald:"#34d399",amber:"#fbbf24",rose:"#fb7185"};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:D0,label:"Appearance",description:"Customize the look and feel of the dashboard"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Theme",description:"Choose your preferred colour scheme",children:s.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["dark","darker"].map(p=>s.jsx("button",{onClick:()=>r(p),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${n===p?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:p},p))})}),s.jsx(lt,{label:"Accent Colour",description:"Primary highlight colour throughout the UI",children:s.jsx("div",{className:"flex items-center gap-2",children:x.map(p=>s.jsx("button",{onClick:()=>o(p),className:`h-5 w-5 rounded-full border-2 transition-transform ${i===p?"scale-110 border-white/40":"border-transparent hover:scale-105"}`,style:{background:m[p]}},p))})}),s.jsx(lt,{label:"Density",description:"Controls spacing throughout the layout",children:s.jsx("div",{className:"flex gap-px overflow-hidden rounded-lg border border-white/10",children:["comfortable","compact"].map(p=>s.jsx("button",{onClick:()=>f(p),className:`px-3 py-1.5 text-[12px] transition-colors capitalize ${u===p?"bg-blue-500 text-white":"text-zinc-400 hover:text-zinc-200 bg-white/[0.02] hover:bg-white/[0.05]"}`,children:p},p))})}),s.jsx(lt,{label:"Animations",description:"Smooth transitions and micro-animations",children:s.jsx(sn,{value:h,onChange:g})})]})]})}function W4(){const[n,r]=j.useState("11"),[i,o]=j.useState("2"),[u,f]=j.useState(!0),[h,g]=j.useState(!0),[x,m]=j.useState(!0);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:Vo,label:"Editor",description:"Source viewer and code display preferences"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Font Size",description:"Monospace font size in the source viewer",children:s.jsx(yl,{value:n,onChange:r,options:["10","11","12","13","14"]})}),s.jsx(lt,{label:"Tab Size",description:"Number of spaces per indentation level",children:s.jsx(yl,{value:i,onChange:o,options:["2","4","8"]})}),s.jsx(lt,{label:"Word Wrap",description:"Wrap long lines in the source viewer",children:s.jsx(sn,{value:u,onChange:f})}),s.jsx(lt,{label:"Line Numbers",description:"Show line numbers in the source viewer gutter",children:s.jsx(sn,{value:h,onChange:g})}),s.jsx(lt,{label:"Highlight Handler Line",description:"Highlight the matched handler line in source view",children:s.jsx(sn,{value:x,onChange:m})})]})]})}function Q4(){const[n,r]=j.useState(!0),[i,o]=j.useState(!0),[u,f]=j.useState(!0),[h,g]=j.useState(!1),[x,m]=j.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:C0,label:"Notifications",description:"Control when and how you're notified"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Scan complete",description:"Notify when a project scan finishes",children:s.jsx(sn,{value:n,onChange:r})}),s.jsx(lt,{label:"Simulation complete",description:"Notify when a workflow run finishes",children:s.jsx(sn,{value:i,onChange:o})}),s.jsx(lt,{label:"Simulation failure",description:"Notify when a workflow step fails",children:s.jsx(sn,{value:u,onChange:f})}),s.jsx(lt,{label:"Memory updates",description:"Notify on runtime memory changes",children:s.jsx(sn,{value:h,onChange:g})}),s.jsx(lt,{label:"Desktop notifications",description:"Show browser push notifications",children:s.jsx(sn,{value:x,onChange:m})})]})]})}function K4(){const[n,r]=j.useState(""),[i,o]=j.useState("10000"),[u,f]=j.useState(!1),[h,g]=j.useState(!1);return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:La,label:"API & Auth",description:"Default request settings for endpoint simulation"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Default Bearer Token",description:"Pre-fill bearer token in simulate panels",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{type:h?"text":"password",value:n,onChange:x=>r(x.target.value),placeholder:"eyJ…",className:"w-48 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 font-mono text-[12px] text-zinc-200 outline-none focus:border-blue-500/50 focus:bg-white/[0.05] placeholder-zinc-600 transition-colors"}),s.jsx("button",{onClick:()=>g(x=>!x),className:"text-[11px] text-zinc-500 hover:text-zinc-300 transition-colors",children:h?"Hide":"Show"})]})}),s.jsx(lt,{label:"Request Timeout",description:"Milliseconds before a simulated request times out",children:s.jsx(yl,{value:i,onChange:o,options:["5000","10000","15000","30000","60000"]})}),s.jsx(lt,{label:"Auto-retry on 5xx",description:"Automatically retry failed requests once",children:s.jsx(sn,{value:u,onChange:f})})]})]})}function J4({onClearMemory:n}){const[r,i]=j.useState(!1),[o,u]=j.useState(!1),[f,h]=j.useState(!1),[g,x]=j.useState("30"),[m,p]=j.useState(!1),[b,v]=j.useState(!1),N=async()=>{p(!0),await new Promise(T=>setTimeout(T,800)),p(!1),v(!0),setTimeout(()=>v(!1),2e3),n()};return s.jsxs("div",{className:"space-y-5",children:[s.jsx(xs,{icon:Pd,label:"Advanced",description:"Developer and diagnostic options"}),s.jsxs(gs,{children:[s.jsx(lt,{label:"Scan on start",description:"Auto-scan project when the dashboard loads",children:s.jsx(sn,{value:r,onChange:i})}),s.jsx(lt,{label:"Auto-refresh model",description:"Periodically reload model.json from disk",children:s.jsx(sn,{value:f,onChange:h})}),f&&s.jsx(lt,{label:"Refresh interval",description:"How often to poll for model changes",children:s.jsx(yl,{value:g,onChange:x,options:["10","30","60","120"]})}),s.jsx(lt,{label:"Debug mode",description:"Verbose logging in the browser console",children:s.jsx(sn,{value:o,onChange:u})})]}),s.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.03] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-red-500/10",children:[s.jsx(Yt,{className:"h-[15px] w-[15px] text-red-400/60",strokeWidth:2}),s.jsx("span",{className:"text-[11px] font-semibold tracking-wider text-red-400/70",children:"DANGER ZONE"})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[13px] theme-text-primary",children:"Clear Runtime Memory"}),s.jsx("p",{className:"text-[11px] theme-text-muted mt-0.5",children:"Delete all stored memory keys and values"})]}),s.jsxs("button",{onClick:N,disabled:m,className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/[0.06] px-3 py-1.5 text-[12px] text-red-400 hover:bg-red-500/10 disabled:opacity-50 transition-colors",children:[m?s.jsx(dt,{className:"h-3.5 w-3.5 animate-spin",strokeWidth:2}):b?s.jsx(ut,{className:"h-3.5 w-3.5",strokeWidth:2}):s.jsx(Yt,{className:"h-3.5 w-3.5",strokeWidth:2}),m?"Clearing…":b?"Cleared":"Clear Memory"]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-4 pt-3 border-t border-red-500/10",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[13px] theme-text-primary",children:"Reset Model"}),s.jsxs("p",{className:"text-[11px] theme-text-muted mt-0.5",children:["Delete"," ",s.jsx("code",{className:"theme-text-muted theme-bg-overlay-md px-1 py-0.5 rounded text-[10px]",children:".jetic/model.json"})," ","and start fresh"]})]}),s.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/[0.06] px-3 py-1.5 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[s.jsx(Yt,{className:"h-3.5 w-3.5",strokeWidth:2})," Reset Model"]})]})]})]})]})}function I4(){return s.jsxs("div",{className:"rounded-lg border theme-border theme-bg-overlay p-4 flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border theme-border theme-bg-overlay-md",children:s.jsx(hs,{className:"h-[15px] w-[15px] text-blue-400",strokeWidth:2})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[13.5px] font-medium theme-text-primary",children:"Jetic Studio"}),s.jsx("p",{className:"text-[11px] theme-text-muted",children:"v0.1.0 · Local development dashboard"})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-1.5 rounded-full border theme-border theme-bg-overlay px-2.5 py-1",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 animate-pulse"}),s.jsx("span",{className:"text-[11px] theme-text-muted font-medium",children:"Running"})]})]})}function F4({icon:n,label:r,active:i,onClick:o}){return s.jsxs("button",{type:"button",onClick:o,className:`relative flex w-full items-center gap-3 rounded-lg px-3 py-1.5 text-left text-[13.5px] transition-colors ${i?"theme-bg-overlay-md theme-text-primary font-medium":"theme-text-muted hover:theme-bg-overlay hover:theme-text-primary"}`,children:[i&&s.jsx("span",{className:"absolute -left-3 top-1/2 h-4 w-[3px] -translate-y-1/2 rounded-full bg-blue-500"}),s.jsx(n,{className:"h-[15px] w-[15px] shrink-0",strokeWidth:2}),s.jsx("span",{children:r}),i&&s.jsx(bl,{className:"ml-auto h-3.5 w-3.5 opacity-40",strokeWidth:2})]})}function P4(){const[n,r]=j.useState("general"),[i,o]=j.useState(null),[u,f]=j.useState(!0);j.useEffect(()=>{fetch("/api/model").then(g=>g.ok?g.json():null).then(g=>o(g)).catch(()=>{}).finally(()=>f(!1))},[]);const h=()=>{switch(n){case"general":return s.jsx(G4,{model:i});case"environments":return s.jsx(X4,{model:i});case"appearance":return s.jsx(Z4,{});case"editor":return s.jsx(W4,{});case"notifications":return s.jsx(Q4,{});case"api":return s.jsx(K4,{});case"advanced":return s.jsx(J4,{onClearMemory:()=>{}});default:return null}};return s.jsxs("div",{className:"flex min-h-full w-full flex-col",children:[s.jsx("div",{className:"flex items-center justify-between border-b theme-border px-6 py-5",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-[15px] font-medium theme-text-primary leading-none",children:"Settings"}),s.jsx("p",{className:"mt-0.5 text-[11px] theme-text-muted",children:"Configure Jetic Studio"})]})}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsxs("nav",{className:"w-52 shrink-0 border-r theme-border theme-sidebar select-none overflow-y-auto p-3 space-y-0.5",children:[s.jsx("span",{className:"px-3 pb-1.5 pt-1 block text-[11px] font-semibold tracking-wider theme-text-muted",children:"CONFIGURATION"}),s.jsx("div",{className:"flex flex-col gap-0.5",children:V4.map(({id:g,label:x,icon:m})=>s.jsx(F4,{icon:m,label:x,active:n===g,onClick:()=>r(g)},g))}),s.jsx("div",{className:"hidden pt-4 mt-2 border-t theme-border",children:s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border theme-border theme-bg-overlay px-2.5 py-1 w-fit",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500"}),s.jsx("span",{className:"text-[11px] font-medium theme-text-muted",children:"v0.1.0"})]})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:u?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(g=>s.jsx("div",{className:"h-16 animate-pulse rounded-lg border border-white/10 bg-white/[0.02]",style:{opacity:1-g*.25}},g))}):s.jsxs(s.Fragment,{children:[s.jsx(I4,{}),h()]})})]})]})}function eE(){return s.jsxs("div",{className:"p-8",children:[s.jsx("h1",{className:"text-2xl font-semibold theme-text-primary",children:"Docs"}),s.jsx("p",{className:"mt-4 theme-text-muted",children:"This is the Docs page."})]})}const tE=["overview","simulations","model","inspect","agents","tools","context","memory","apis","email","oauth","webhooks","traces","events","changes","settings","docs"];function nE(){const[n,r]=j.useState(()=>{const v=localStorage.getItem("active_sidebar_item");return tE.includes(v)?v:"overview"}),[i,o]=j.useState(!1),[u,f]=j.useState(()=>{try{const v=localStorage.getItem("inspected_endpoint");return v?JSON.parse(v):null}catch{return null}}),[h,g]=j.useState(void 0);j.useEffect(()=>{localStorage.setItem("active_sidebar_item",n)},[n]),j.useEffect(()=>{u?localStorage.setItem("inspected_endpoint",JSON.stringify(u)):localStorage.removeItem("inspected_endpoint")},[u]);const x=v=>{v!=="inspect"&&f(null),v!=="traces"&&g(void 0),r(v)},m=v=>{f(v),r("inspect")},p=v=>{g(v),r("traces")},b=()=>{switch(n){case"overview":return s.jsx(xx,{onNavigate:x});case"simulations":return s.jsx(H3,{onViewTraces:p});case"model":return s.jsx(K3,{onInspect:m,onViewTraces:p});case"inspect":return s.jsx(P3,{endpoint:u,onBack:()=>x("model")});case"agents":return s.jsx(e4,{});case"tools":return s.jsx(t4,{});case"context":return s.jsx(n4,{});case"memory":return s.jsx(m4,{});case"apis":return s.jsx(p4,{});case"email":return s.jsx(x4,{});case"oauth":return s.jsx(g4,{});case"webhooks":return s.jsx(y4,{});case"traces":return s.jsx($4,{initialFilter:h,onNavigate:x});case"events":return s.jsx(U4,{});case"changes":return s.jsx(L4,{onNavigate:x});case"settings":return s.jsx(P4,{});case"docs":return s.jsx(eE,{});default:return s.jsx(xx,{})}};return s.jsxs("div",{className:"flex h-screen w-full overflow-hidden antialiased [font-feature-settings:'ss01'] font-sans text-xs transition-colors duration-300 theme-bg-base theme-text",children:[s.jsx(d2,{currentPage:n,onNavigate:x,onToggleAssistant:()=>o(!i),isAssistantOpen:i}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col relative",children:[s.jsx("div",{className:"flex min-h-0 flex-1 overflow-auto transition-colors duration-300 theme-bg-base",children:b()}),s.jsx(f2,{isOpen:i,onClose:()=>o(!1)}),s.jsx(h2,{onNavigateToChanges:()=>x("changes")})]})]})}const aE=()=>s.jsx(i2,{children:s.jsx(nE,{})});Ob.createRoot(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(aE,{})}));
|