@marktoflow/gui 2.0.0-alpha.15 → 2.0.0-alpha.16
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 +36 -547
- package/dist/client/assets/index-CFPMTv8H.css +1 -0
- package/dist/client/assets/index-DIjBDUL-.js +708 -0
- package/dist/client/assets/index-DIjBDUL-.js.map +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +10 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/form.js +160 -0
- package/dist/server/routes/form.js.map +1 -0
- package/dist/server/services/ExecutionManager.js +148 -5
- package/dist/server/services/ExecutionManager.js.map +1 -1
- package/package.json +3 -2
- package/dist/client/assets/index-CIvjE2Ts.js +0 -703
- package/dist/client/assets/index-CIvjE2Ts.js.map +0 -1
- package/dist/client/assets/index-Cu3CHOQw.css +0 -1
|
@@ -1,703 +0,0 @@
|
|
|
1
|
-
function y3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hp={exports:{}},Ca={},pp={exports:{}},Oe={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var h_;function v3(){if(h_)return Oe;h_=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function g(L){return L===null||typeof L!="object"?null:(L=p&&L[p]||L["@@iterator"],typeof L=="function"?L:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function w(L,W,oe){this.props=L,this.context=W,this.refs=x,this.updater=oe||v}w.prototype.isReactComponent={},w.prototype.setState=function(L,W){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,W,"setState")},w.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function S(){}S.prototype=w.prototype;function N(L,W,oe){this.props=L,this.context=W,this.refs=x,this.updater=oe||v}var k=N.prototype=new S;k.constructor=N,b(k,w.prototype),k.isPureReactComponent=!0;var C=Array.isArray,j=Object.prototype.hasOwnProperty,R={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function M(L,W,oe){var K,J={},te=null,X=null;if(W!=null)for(K in W.ref!==void 0&&(X=W.ref),W.key!==void 0&&(te=""+W.key),W)j.call(W,K)&&!T.hasOwnProperty(K)&&(J[K]=W[K]);var ee=arguments.length-2;if(ee===1)J.children=oe;else if(1<ee){for(var ie=Array(ee),ue=0;ue<ee;ue++)ie[ue]=arguments[ue+2];J.children=ie}if(L&&L.defaultProps)for(K in ee=L.defaultProps,ee)J[K]===void 0&&(J[K]=ee[K]);return{$$typeof:e,type:L,key:te,ref:X,props:J,_owner:R.current}}function P(L,W){return{$$typeof:e,type:L.type,key:W,ref:L.ref,props:L.props,_owner:L._owner}}function B(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function O(L){var W={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(oe){return W[oe]})}var $=/\/+/g;function U(L,W){return typeof L=="object"&&L!==null&&L.key!=null?O(""+L.key):W.toString(36)}function D(L,W,oe,K,J){var te=typeof L;(te==="undefined"||te==="boolean")&&(L=null);var X=!1;if(L===null)X=!0;else switch(te){case"string":case"number":X=!0;break;case"object":switch(L.$$typeof){case e:case t:X=!0}}if(X)return X=L,J=J(X),L=K===""?"."+U(X,0):K,C(J)?(oe="",L!=null&&(oe=L.replace($,"$&/")+"/"),D(J,W,oe,"",function(ue){return ue})):J!=null&&(B(J)&&(J=P(J,oe+(!J.key||X&&X.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+L)),W.push(J)),1;if(X=0,K=K===""?".":K+":",C(L))for(var ee=0;ee<L.length;ee++){te=L[ee];var ie=K+U(te,ee);X+=D(te,W,oe,ie,J)}else if(ie=g(L),typeof ie=="function")for(L=ie.call(L),ee=0;!(te=L.next()).done;)te=te.value,ie=K+U(te,ee++),X+=D(te,W,oe,ie,J);else if(te==="object")throw W=String(L),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return X}function z(L,W,oe){if(L==null)return L;var K=[],J=0;return D(L,K,"","",function(te){return W.call(oe,te,J++)}),K}function V(L){if(L._status===-1){var W=L._result;W=W(),W.then(function(oe){(L._status===0||L._status===-1)&&(L._status=1,L._result=oe)},function(oe){(L._status===0||L._status===-1)&&(L._status=2,L._result=oe)}),L._status===-1&&(L._status=0,L._result=W)}if(L._status===1)return L._result.default;throw L._result}var Y={current:null},F={transition:null},q={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:F,ReactCurrentOwner:R};function G(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:z,forEach:function(L,W,oe){z(L,function(){W.apply(this,arguments)},oe)},count:function(L){var W=0;return z(L,function(){W++}),W},toArray:function(L){return z(L,function(W){return W})||[]},only:function(L){if(!B(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},Oe.Component=w,Oe.Fragment=n,Oe.Profiler=s,Oe.PureComponent=N,Oe.StrictMode=r,Oe.Suspense=u,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Oe.act=G,Oe.cloneElement=function(L,W,oe){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var K=b({},L.props),J=L.key,te=L.ref,X=L._owner;if(W!=null){if(W.ref!==void 0&&(te=W.ref,X=R.current),W.key!==void 0&&(J=""+W.key),L.type&&L.type.defaultProps)var ee=L.type.defaultProps;for(ie in W)j.call(W,ie)&&!T.hasOwnProperty(ie)&&(K[ie]=W[ie]===void 0&&ee!==void 0?ee[ie]:W[ie])}var ie=arguments.length-2;if(ie===1)K.children=oe;else if(1<ie){ee=Array(ie);for(var ue=0;ue<ie;ue++)ee[ue]=arguments[ue+2];K.children=ee}return{$$typeof:e,type:L.type,key:J,ref:te,props:K,_owner:X}},Oe.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:o,_context:L},L.Consumer=L},Oe.createElement=M,Oe.createFactory=function(L){var W=M.bind(null,L);return W.type=L,W},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(L){return{$$typeof:c,render:L}},Oe.isValidElement=B,Oe.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:V}},Oe.memo=function(L,W){return{$$typeof:d,type:L,compare:W===void 0?null:W}},Oe.startTransition=function(L){var W=F.transition;F.transition={};try{L()}finally{F.transition=W}},Oe.unstable_act=G,Oe.useCallback=function(L,W){return Y.current.useCallback(L,W)},Oe.useContext=function(L){return Y.current.useContext(L)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(L){return Y.current.useDeferredValue(L)},Oe.useEffect=function(L,W){return Y.current.useEffect(L,W)},Oe.useId=function(){return Y.current.useId()},Oe.useImperativeHandle=function(L,W,oe){return Y.current.useImperativeHandle(L,W,oe)},Oe.useInsertionEffect=function(L,W){return Y.current.useInsertionEffect(L,W)},Oe.useLayoutEffect=function(L,W){return Y.current.useLayoutEffect(L,W)},Oe.useMemo=function(L,W){return Y.current.useMemo(L,W)},Oe.useReducer=function(L,W,oe){return Y.current.useReducer(L,W,oe)},Oe.useRef=function(L){return Y.current.useRef(L)},Oe.useState=function(L){return Y.current.useState(L)},Oe.useSyncExternalStore=function(L,W,oe){return Y.current.useSyncExternalStore(L,W,oe)},Oe.useTransition=function(){return Y.current.useTransition()},Oe.version="18.3.1",Oe}var p_;function yl(){return p_||(p_=1,pp.exports=v3()),pp.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var m_;function x3(){if(m_)return Ca;m_=1;var e=yl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,d){var m,p={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(m in u)r.call(u,m)&&!o.hasOwnProperty(m)&&(p[m]=u[m]);if(c&&c.defaultProps)for(m in u=c.defaultProps,u)p[m]===void 0&&(p[m]=u[m]);return{$$typeof:t,type:c,key:g,ref:v,props:p,_owner:s.current}}return Ca.Fragment=n,Ca.jsx=a,Ca.jsxs=a,Ca}var g_;function w3(){return g_||(g_=1,hp.exports=x3()),hp.exports}var h=w3(),A=yl();const pt=gl(A),cR=y3({__proto__:null,default:pt},[A]);var ou={},mp={exports:{}},Xt={},gp={exports:{}},yp={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var y_;function b3(){return y_||(y_=1,(function(e){function t(F,q){var G=F.length;F.push(q);e:for(;0<G;){var L=G-1>>>1,W=F[L];if(0<s(W,q))F[L]=q,F[G]=W,G=L;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var q=F[0],G=F.pop();if(G!==q){F[0]=G;e:for(var L=0,W=F.length,oe=W>>>1;L<oe;){var K=2*(L+1)-1,J=F[K],te=K+1,X=F[te];if(0>s(J,G))te<W&&0>s(X,J)?(F[L]=X,F[te]=G,L=te):(F[L]=J,F[K]=G,L=K);else if(te<W&&0>s(X,G))F[L]=X,F[te]=G,L=te;else break e}}return q}function s(F,q){var G=F.sortIndex-q.sortIndex;return G!==0?G:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],d=[],m=1,p=null,g=3,v=!1,b=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(F){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=F)r(d),q.sortIndex=q.expirationTime,t(u,q);else break;q=n(d)}}function C(F){if(x=!1,k(F),!b)if(n(u)!==null)b=!0,V(j);else{var q=n(d);q!==null&&Y(C,q.startTime-F)}}function j(F,q){b=!1,x&&(x=!1,S(M),M=-1),v=!0;var G=g;try{for(k(q),p=n(u);p!==null&&(!(p.expirationTime>q)||F&&!O());){var L=p.callback;if(typeof L=="function"){p.callback=null,g=p.priorityLevel;var W=L(p.expirationTime<=q);q=e.unstable_now(),typeof W=="function"?p.callback=W:p===n(u)&&r(u),k(q)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var K=n(d);K!==null&&Y(C,K.startTime-q),oe=!1}return oe}finally{p=null,g=G,v=!1}}var R=!1,T=null,M=-1,P=5,B=-1;function O(){return!(e.unstable_now()-B<P)}function $(){if(T!==null){var F=e.unstable_now();B=F;var q=!0;try{q=T(!0,F)}finally{q?U():(R=!1,T=null)}}else R=!1}var U;if(typeof N=="function")U=function(){N($)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,z=D.port2;D.port1.onmessage=$,U=function(){z.postMessage(null)}}else U=function(){w($,0)};function V(F){T=F,R||(R=!0,U())}function Y(F,q){M=w(function(){F(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,V(j))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var G=g;g=q;try{return F()}finally{g=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=g;g=F;try{return q()}finally{g=G}},e.unstable_scheduleCallback=function(F,q,G){var L=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?L+G:L):G=L,F){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=G+W,F={id:m++,callback:q,priorityLevel:F,startTime:G,expirationTime:W,sortIndex:-1},G>L?(F.sortIndex=G,t(d,F),n(u)===null&&F===n(d)&&(x?(S(M),M=-1):x=!0,Y(C,G-L))):(F.sortIndex=W,t(u,F),b||v||(b=!0,V(j))),F},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(F){var q=g;return function(){var G=g;g=q;try{return F.apply(this,arguments)}finally{g=G}}}})(yp)),yp}var v_;function S3(){return v_||(v_=1,gp.exports=b3()),gp.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var x_;function _3(){if(x_)return Xt;x_=1;var e=yl(),t=S3();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,l){a(i,l),a(i+"Capture",l)}function a(i,l){for(s[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,m={},p={};function g(i){return u.call(p,i)?!0:u.call(m,i)?!1:d.test(i)?p[i]=!0:(m[i]=!0,!1)}function v(i,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,l,f,y){if(l===null||typeof l>"u"||v(i,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function x(i,l,f,y,_,E,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=_,this.mustUseProperty=f,this.propertyName=i,this.type=l,this.sanitizeURL=E,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){w[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];w[l]=new x(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){w[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){w[i]=new x(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){w[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){w[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){w[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){w[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){w[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var l=i.replace(S,N);w[l]=new x(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(S,N);w[l]=new x(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(S,N);w[l]=new x(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){w[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),w.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){w[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function k(i,l,f,y){var _=w.hasOwnProperty(l)?w[l]:null;(_!==null?_.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,f,_,y)&&(f=null),y||_===null?g(l)&&(f===null?i.removeAttribute(l):i.setAttribute(l,""+f)):_.mustUseProperty?i[_.propertyName]=f===null?_.type===3?!1:"":f:(l=_.attributeName,y=_.attributeNamespace,f===null?i.removeAttribute(l):(_=_.type,f=_===3||_===4&&f===!0?"":""+f,y?i.setAttributeNS(y,l,f):i.setAttribute(l,f))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,j=Symbol.for("react.element"),R=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),O=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),F=Symbol.iterator;function q(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var G=Object.assign,L;function W(i){if(L===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);L=l&&l[1]||""}return`
|
|
34
|
-
`+L+i}var oe=!1;function K(i,l){if(!i||oe)return"";oe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var y=se}Reflect.construct(i,[],l)}else{try{l.call()}catch(se){y=se}i.call(l.prototype)}else{try{throw Error()}catch(se){y=se}i()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var _=se.stack.split(`
|
|
35
|
-
`),E=y.stack.split(`
|
|
36
|
-
`),I=_.length-1,H=E.length-1;1<=I&&0<=H&&_[I]!==E[H];)H--;for(;1<=I&&0<=H;I--,H--)if(_[I]!==E[H]){if(I!==1||H!==1)do if(I--,H--,0>H||_[I]!==E[H]){var Q=`
|
|
37
|
-
`+_[I].replace(" at new "," at ");return i.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",i.displayName)),Q}while(1<=I&&0<=H);break}}}finally{oe=!1,Error.prepareStackTrace=f}return(i=i?i.displayName||i.name:"")?W(i):""}function J(i){switch(i.tag){case 5:return W(i.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return i=K(i.type,!1),i;case 11:return i=K(i.type.render,!1),i;case 1:return i=K(i.type,!0),i;default:return""}}function te(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case R:return"Portal";case P:return"Profiler";case M:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case B:return(i._context.displayName||"Context")+".Provider";case $:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return l=i.displayName||null,l!==null?l:te(i.type)||"Memo";case V:l=i._payload,i=i._init;try{return te(i(l))}catch{}}return null}function X(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(l);case 8:return l===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ee(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ie(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ue(i){var l=ie(i)?"checked":"value",f=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),y=""+i[l];if(!i.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var _=f.get,E=f.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return _.call(this)},set:function(I){y=""+I,E.call(this,I)}}),Object.defineProperty(i,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(I){y=""+I},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function me(i){i._valueTracker||(i._valueTracker=ue(i))}function ye(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return i&&(y=ie(i)?i.checked?"true":"false":i.value),i=y,i!==f?(l.setValue(i),!0):!1}function pe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function _e(i,l){var f=l.checked;return G({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??i._wrapperState.initialChecked})}function xe(i,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ee(l.value!=null?l.value:f),i._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ce(i,l){l=l.checked,l!=null&&k(i,"checked",l,!1)}function Ne(i,l){Ce(i,l);var f=ee(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&i.value===""||i.value!=f)&&(i.value=""+f):i.value!==""+f&&(i.value=""+f);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Le(i,l.type,f):l.hasOwnProperty("defaultValue")&&Le(i,l.type,ee(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function tt(i,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,f||l===i.value||(i.value=l),i.defaultValue=l}f=i.name,f!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,f!==""&&(i.name=f)}function Le(i,l,f){(l!=="number"||pe(i.ownerDocument)!==i)&&(f==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+f&&(i.defaultValue=""+f))}var vt=Array.isArray;function xt(i,l,f,y){if(i=i.options,l){l={};for(var _=0;_<f.length;_++)l["$"+f[_]]=!0;for(f=0;f<i.length;f++)_=l.hasOwnProperty("$"+i[f].value),i[f].selected!==_&&(i[f].selected=_),_&&y&&(i[f].defaultSelected=!0)}else{for(f=""+ee(f),l=null,_=0;_<i.length;_++){if(i[_].value===f){i[_].selected=!0,y&&(i[_].defaultSelected=!0);return}l!==null||i[_].disabled||(l=i[_])}l!==null&&(l.selected=!0)}}function it(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return G({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function We(i,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(vt(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}i._wrapperState={initialValue:ee(f)}}function It(i,l){var f=ee(l.value),y=ee(l.defaultValue);f!=null&&(f=""+f,f!==i.value&&(i.value=f),l.defaultValue==null&&i.defaultValue!==f&&(i.defaultValue=f)),y!=null&&(i.defaultValue=""+y)}function Mt(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Vt(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ie(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Vt(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var be,ot=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,_){MSApp.execUnsafeLocalFunction(function(){return i(l,f,y,_)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(be=be||document.createElement("div"),be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=be.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function Ve(i,l){if(l){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=l;return}}i.textContent=l}var Ut={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hn=["Webkit","ms","Moz","O"];Object.keys(Ut).forEach(function(i){hn.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),Ut[l]=Ut[i]})});function Ot(i,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Ut.hasOwnProperty(i)&&Ut[i]?(""+l).trim():l+"px"}function Pt(i,l){i=i.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,_=Ot(f,l[f],y);f==="float"&&(f="cssFloat"),y?i.setProperty(f,_):i[f]=_}}var hi=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lt(i,l){if(l){if(hi[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function tn(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 $o=null;function qo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Fo=null,Br=null,zr=null;function Ul(i){if(i=da(i)){if(typeof Fo!="function")throw Error(n(280));var l=i.stateNode;l&&(l=wc(l),Fo(i.stateNode,i.type,l))}}function Hl(i){Br?zr?zr.push(i):zr=[i]:Br=i}function Wl(){if(Br){var i=Br,l=zr;if(zr=Br=null,Ul(i),l)for(i=0;i<l.length;i++)Ul(l[i])}}function Kl(i,l){return i(l)}function Gl(){}var Bo=!1;function Yl(i,l,f){if(Bo)return i(l,f);Bo=!0;try{return Kl(i,l,f)}finally{Bo=!1,(Br!==null||zr!==null)&&(Gl(),Wl())}}function Cs(i,l){var f=i.stateNode;if(f===null)return null;var y=wc(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var zo=!1;if(c)try{var Es={};Object.defineProperty(Es,"passive",{get:function(){zo=!0}}),window.addEventListener("test",Es,Es),window.removeEventListener("test",Es,Es)}catch{zo=!1}function _f(i,l,f,y,_,E,I,H,Q){var se=Array.prototype.slice.call(arguments,3);try{l.apply(f,se)}catch(le){this.onError(le)}}var js=!1,pi=null,mi=!1,Vo=null,kf={onError:function(i){js=!0,pi=i}};function Nf(i,l,f,y,_,E,I,H,Q){js=!1,pi=null,_f.apply(kf,arguments)}function Cf(i,l,f,y,_,E,I,H,Q){if(Nf.apply(this,arguments),js){if(js){var se=pi;js=!1,pi=null}else throw Error(n(198));mi||(mi=!0,Vo=se)}}function Yn(i){var l=i,f=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(f=l.return),i=l.return;while(i)}return l.tag===3?f:null}function Uo(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Ho(i){if(Yn(i)!==i)throw Error(n(188))}function Ef(i){var l=i.alternate;if(!l){if(l=Yn(i),l===null)throw Error(n(188));return l!==i?null:i}for(var f=i,y=l;;){var _=f.return;if(_===null)break;var E=_.alternate;if(E===null){if(y=_.return,y!==null){f=y;continue}break}if(_.child===E.child){for(E=_.child;E;){if(E===f)return Ho(_),i;if(E===y)return Ho(_),l;E=E.sibling}throw Error(n(188))}if(f.return!==y.return)f=_,y=E;else{for(var I=!1,H=_.child;H;){if(H===f){I=!0,f=_,y=E;break}if(H===y){I=!0,y=_,f=E;break}H=H.sibling}if(!I){for(H=E.child;H;){if(H===f){I=!0,f=E,y=_;break}if(H===y){I=!0,y=E,f=_;break}H=H.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==y)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?i:l}function Xl(i){return i=Ef(i),i!==null?Ql(i):null}function Ql(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Ql(i);if(l!==null)return l;i=i.sibling}return null}var Jl=t.unstable_scheduleCallback,Zl=t.unstable_cancelCallback,jf=t.unstable_shouldYield,ec=t.unstable_requestPaint,nt=t.unstable_now,Af=t.unstable_getCurrentPriorityLevel,Wo=t.unstable_ImmediatePriority,tc=t.unstable_UserBlockingPriority,gi=t.unstable_NormalPriority,Rf=t.unstable_LowPriority,nc=t.unstable_IdlePriority,As=null,pn=null;function Tf(i){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(As,i,void 0,(i.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:Of,If=Math.log,Mf=Math.LN2;function Of(i){return i>>>=0,i===0?32:31-(If(i)/Mf|0)|0}var yi=64,vi=4194304;function Xn(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function xi(i,l){var f=i.pendingLanes;if(f===0)return 0;var y=0,_=i.suspendedLanes,E=i.pingedLanes,I=f&268435455;if(I!==0){var H=I&~_;H!==0?y=Xn(H):(E&=I,E!==0&&(y=Xn(E)))}else I=f&~_,I!==0?y=Xn(I):E!==0&&(y=Xn(E));if(y===0)return 0;if(l!==0&&l!==y&&(l&_)===0&&(_=y&-y,E=l&-l,_>=E||_===16&&(E&4194240)!==0))return l;if((y&4)!==0&&(y|=f&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=y;0<l;)f=31-nn(l),_=1<<f,y|=i[f],l&=~_;return y}function rc(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(i,l){for(var f=i.suspendedLanes,y=i.pingedLanes,_=i.expirationTimes,E=i.pendingLanes;0<E;){var I=31-nn(E),H=1<<I,Q=_[I];Q===-1?((H&f)===0||(H&y)!==0)&&(_[I]=rc(H,l)):Q<=l&&(i.expiredLanes|=H),E&=~H}}function Ko(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function wi(){var i=yi;return yi<<=1,(yi&4194240)===0&&(yi=64),i}function Go(i){for(var l=[],f=0;31>f;f++)l.push(i);return l}function Rs(i,l,f){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-nn(l),i[l]=f}function sc(i,l){var f=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<f;){var _=31-nn(f),E=1<<_;l[_]=0,y[_]=-1,i[_]=-1,f&=~E}}function Lf(i,l){var f=i.entangledLanes|=l;for(i=i.entanglements;f;){var y=31-nn(f),_=1<<y;_&l|i[y]&l&&(i[y]|=l),f&=~_}}var ze=0;function Hb(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Wb,Df,Kb,Gb,Yb,$f=!1,ic=[],Vr=null,Ur=null,Hr=null,Yo=new Map,Xo=new Map,Wr=[],q4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Xb(i,l){switch(i){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Yo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(l.pointerId)}}function Qo(i,l,f,y,_,E){return i===null||i.nativeEvent!==E?(i={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:E,targetContainers:[_]},l!==null&&(l=da(l),l!==null&&Df(l)),i):(i.eventSystemFlags|=y,l=i.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),i)}function F4(i,l,f,y,_){switch(l){case"focusin":return Vr=Qo(Vr,i,l,f,y,_),!0;case"dragenter":return Ur=Qo(Ur,i,l,f,y,_),!0;case"mouseover":return Hr=Qo(Hr,i,l,f,y,_),!0;case"pointerover":var E=_.pointerId;return Yo.set(E,Qo(Yo.get(E)||null,i,l,f,y,_)),!0;case"gotpointercapture":return E=_.pointerId,Xo.set(E,Qo(Xo.get(E)||null,i,l,f,y,_)),!0}return!1}function Qb(i){var l=Ts(i.target);if(l!==null){var f=Yn(l);if(f!==null){if(l=f.tag,l===13){if(l=Uo(f),l!==null){i.blockedOn=l,Yb(i.priority,function(){Kb(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function oc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var f=Ff(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(f===null){f=i.nativeEvent;var y=new f.constructor(f.type,f);$o=y,f.target.dispatchEvent(y),$o=null}else return l=da(f),l!==null&&Df(l),i.blockedOn=f,!1;l.shift()}return!0}function Jb(i,l,f){oc(i)&&f.delete(l)}function B4(){$f=!1,Vr!==null&&oc(Vr)&&(Vr=null),Ur!==null&&oc(Ur)&&(Ur=null),Hr!==null&&oc(Hr)&&(Hr=null),Yo.forEach(Jb),Xo.forEach(Jb)}function Jo(i,l){i.blockedOn===l&&(i.blockedOn=null,$f||($f=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B4)))}function Zo(i){function l(_){return Jo(_,i)}if(0<ic.length){Jo(ic[0],i);for(var f=1;f<ic.length;f++){var y=ic[f];y.blockedOn===i&&(y.blockedOn=null)}}for(Vr!==null&&Jo(Vr,i),Ur!==null&&Jo(Ur,i),Hr!==null&&Jo(Hr,i),Yo.forEach(l),Xo.forEach(l),f=0;f<Wr.length;f++)y=Wr[f],y.blockedOn===i&&(y.blockedOn=null);for(;0<Wr.length&&(f=Wr[0],f.blockedOn===null);)Qb(f),f.blockedOn===null&&Wr.shift()}var bi=C.ReactCurrentBatchConfig,ac=!0;function z4(i,l,f,y){var _=ze,E=bi.transition;bi.transition=null;try{ze=1,qf(i,l,f,y)}finally{ze=_,bi.transition=E}}function V4(i,l,f,y){var _=ze,E=bi.transition;bi.transition=null;try{ze=4,qf(i,l,f,y)}finally{ze=_,bi.transition=E}}function qf(i,l,f,y){if(ac){var _=Ff(i,l,f,y);if(_===null)rh(i,l,y,lc,f),Xb(i,y);else if(F4(_,i,l,f,y))y.stopPropagation();else if(Xb(i,y),l&4&&-1<q4.indexOf(i)){for(;_!==null;){var E=da(_);if(E!==null&&Wb(E),E=Ff(i,l,f,y),E===null&&rh(i,l,y,lc,f),E===_)break;_=E}_!==null&&y.stopPropagation()}else rh(i,l,y,null,f)}}var lc=null;function Ff(i,l,f,y){if(lc=null,i=qo(y),i=Ts(i),i!==null)if(l=Yn(i),l===null)i=null;else if(f=l.tag,f===13){if(i=Uo(l),i!==null)return i;i=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return lc=i,null}function Zb(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Af()){case Wo:return 1;case tc:return 4;case gi:case Rf:return 16;case nc:return 536870912;default:return 16}default:return 16}}var Kr=null,Bf=null,cc=null;function e1(){if(cc)return cc;var i,l=Bf,f=l.length,y,_="value"in Kr?Kr.value:Kr.textContent,E=_.length;for(i=0;i<f&&l[i]===_[i];i++);var I=f-i;for(y=1;y<=I&&l[f-y]===_[E-y];y++);return cc=_.slice(i,1<y?1-y:void 0)}function uc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function dc(){return!0}function t1(){return!1}function rn(i){function l(f,y,_,E,I){this._reactName=f,this._targetInst=_,this.type=y,this.nativeEvent=E,this.target=I,this.currentTarget=null;for(var H in i)i.hasOwnProperty(H)&&(f=i[H],this[H]=f?f(E):E[H]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?dc:t1,this.isPropagationStopped=t1,this}return G(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),l}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zf=rn(Si),ea=G({},Si,{view:0,detail:0}),U4=rn(ea),Vf,Uf,ta,fc=G({},ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ta&&(ta&&i.type==="mousemove"?(Vf=i.screenX-ta.screenX,Uf=i.screenY-ta.screenY):Uf=Vf=0,ta=i),Vf)},movementY:function(i){return"movementY"in i?i.movementY:Uf}}),n1=rn(fc),H4=G({},fc,{dataTransfer:0}),W4=rn(H4),K4=G({},ea,{relatedTarget:0}),Hf=rn(K4),G4=G({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),Y4=rn(G4),X4=G({},Si,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Q4=rn(X4),J4=G({},Si,{data:0}),r1=rn(J4),Z4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eL={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"},tL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nL(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=tL[i])?!!l[i]:!1}function Wf(){return nL}var rL=G({},ea,{key:function(i){if(i.key){var l=Z4[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=uc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?eL[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wf,charCode:function(i){return i.type==="keypress"?uc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?uc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),sL=rn(rL),iL=G({},fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s1=rn(iL),oL=G({},ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wf}),aL=rn(oL),lL=G({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),cL=rn(lL),uL=G({},fc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),dL=rn(uL),fL=[9,13,27,32],Kf=c&&"CompositionEvent"in window,na=null;c&&"documentMode"in document&&(na=document.documentMode);var hL=c&&"TextEvent"in window&&!na,i1=c&&(!Kf||na&&8<na&&11>=na),o1=" ",a1=!1;function l1(i,l){switch(i){case"keyup":return fL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var _i=!1;function pL(i,l){switch(i){case"compositionend":return c1(l);case"keypress":return l.which!==32?null:(a1=!0,o1);case"textInput":return i=l.data,i===o1&&a1?null:i;default:return null}}function mL(i,l){if(_i)return i==="compositionend"||!Kf&&l1(i,l)?(i=e1(),cc=Bf=Kr=null,_i=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return i1&&l.locale!=="ko"?null:l.data;default:return null}}var gL={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 u1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!gL[i.type]:l==="textarea"}function d1(i,l,f,y){Hl(y),l=yc(l,"onChange"),0<l.length&&(f=new zf("onChange","change",null,f,y),i.push({event:f,listeners:l}))}var ra=null,sa=null;function yL(i){A1(i,0)}function hc(i){var l=ji(i);if(ye(l))return i}function vL(i,l){if(i==="change")return l}var f1=!1;if(c){var Gf;if(c){var Yf="oninput"in document;if(!Yf){var h1=document.createElement("div");h1.setAttribute("oninput","return;"),Yf=typeof h1.oninput=="function"}Gf=Yf}else Gf=!1;f1=Gf&&(!document.documentMode||9<document.documentMode)}function p1(){ra&&(ra.detachEvent("onpropertychange",m1),sa=ra=null)}function m1(i){if(i.propertyName==="value"&&hc(sa)){var l=[];d1(l,sa,i,qo(i)),Yl(yL,l)}}function xL(i,l,f){i==="focusin"?(p1(),ra=l,sa=f,ra.attachEvent("onpropertychange",m1)):i==="focusout"&&p1()}function wL(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return hc(sa)}function bL(i,l){if(i==="click")return hc(l)}function SL(i,l){if(i==="input"||i==="change")return hc(l)}function _L(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var jn=typeof Object.is=="function"?Object.is:_L;function ia(i,l){if(jn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var f=Object.keys(i),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var _=f[y];if(!u.call(l,_)||!jn(i[_],l[_]))return!1}return!0}function g1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function y1(i,l){var f=g1(i);i=0;for(var y;f;){if(f.nodeType===3){if(y=i+f.textContent.length,i<=l&&y>=l)return{node:f,offset:l-i};i=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=g1(f)}}function v1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?v1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function x1(){for(var i=window,l=pe();l instanceof i.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)i=l.contentWindow;else break;l=pe(i.document)}return l}function Xf(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function kL(i){var l=x1(),f=i.focusedElem,y=i.selectionRange;if(l!==f&&f&&f.ownerDocument&&v1(f.ownerDocument.documentElement,f)){if(y!==null&&Xf(f)){if(l=y.start,i=y.end,i===void 0&&(i=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(i,f.value.length);else if(i=(l=f.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var _=f.textContent.length,E=Math.min(y.start,_);y=y.end===void 0?E:Math.min(y.end,_),!i.extend&&E>y&&(_=y,y=E,E=_),_=y1(f,E);var I=y1(f,y);_&&I&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==I.node||i.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),i.removeAllRanges(),E>y?(i.addRange(l),i.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),i.addRange(l)))}}for(l=[],i=f;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)i=l[f],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var NL=c&&"documentMode"in document&&11>=document.documentMode,ki=null,Qf=null,oa=null,Jf=!1;function w1(i,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Jf||ki==null||ki!==pe(y)||(y=ki,"selectionStart"in y&&Xf(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),oa&&ia(oa,y)||(oa=y,y=yc(Qf,"onSelect"),0<y.length&&(l=new zf("onSelect","select",null,l,f),i.push({event:l,listeners:y}),l.target=ki)))}function pc(i,l){var f={};return f[i.toLowerCase()]=l.toLowerCase(),f["Webkit"+i]="webkit"+l,f["Moz"+i]="moz"+l,f}var Ni={animationend:pc("Animation","AnimationEnd"),animationiteration:pc("Animation","AnimationIteration"),animationstart:pc("Animation","AnimationStart"),transitionend:pc("Transition","TransitionEnd")},Zf={},b1={};c&&(b1=document.createElement("div").style,"AnimationEvent"in window||(delete Ni.animationend.animation,delete Ni.animationiteration.animation,delete Ni.animationstart.animation),"TransitionEvent"in window||delete Ni.transitionend.transition);function mc(i){if(Zf[i])return Zf[i];if(!Ni[i])return i;var l=Ni[i],f;for(f in l)if(l.hasOwnProperty(f)&&f in b1)return Zf[i]=l[f];return i}var S1=mc("animationend"),_1=mc("animationiteration"),k1=mc("animationstart"),N1=mc("transitionend"),C1=new Map,E1="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Gr(i,l){C1.set(i,l),o(l,[i])}for(var eh=0;eh<E1.length;eh++){var th=E1[eh],CL=th.toLowerCase(),EL=th[0].toUpperCase()+th.slice(1);Gr(CL,"on"+EL)}Gr(S1,"onAnimationEnd"),Gr(_1,"onAnimationIteration"),Gr(k1,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(N1,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var aa="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(" "),jL=new Set("cancel close invalid load scroll toggle".split(" ").concat(aa));function j1(i,l,f){var y=i.type||"unknown-event";i.currentTarget=f,Cf(y,l,void 0,i),i.currentTarget=null}function A1(i,l){l=(l&4)!==0;for(var f=0;f<i.length;f++){var y=i[f],_=y.event;y=y.listeners;e:{var E=void 0;if(l)for(var I=y.length-1;0<=I;I--){var H=y[I],Q=H.instance,se=H.currentTarget;if(H=H.listener,Q!==E&&_.isPropagationStopped())break e;j1(_,H,se),E=Q}else for(I=0;I<y.length;I++){if(H=y[I],Q=H.instance,se=H.currentTarget,H=H.listener,Q!==E&&_.isPropagationStopped())break e;j1(_,H,se),E=Q}}}if(mi)throw i=Vo,mi=!1,Vo=null,i}function Ke(i,l){var f=l[ch];f===void 0&&(f=l[ch]=new Set);var y=i+"__bubble";f.has(y)||(R1(l,i,2,!1),f.add(y))}function nh(i,l,f){var y=0;l&&(y|=4),R1(f,i,y,l)}var gc="_reactListening"+Math.random().toString(36).slice(2);function la(i){if(!i[gc]){i[gc]=!0,r.forEach(function(f){f!=="selectionchange"&&(jL.has(f)||nh(f,!1,i),nh(f,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[gc]||(l[gc]=!0,nh("selectionchange",!1,l))}}function R1(i,l,f,y){switch(Zb(l)){case 1:var _=z4;break;case 4:_=V4;break;default:_=qf}f=_.bind(null,l,f,i),_=void 0,!zo||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),y?_!==void 0?i.addEventListener(l,f,{capture:!0,passive:_}):i.addEventListener(l,f,!0):_!==void 0?i.addEventListener(l,f,{passive:_}):i.addEventListener(l,f,!1)}function rh(i,l,f,y,_){var E=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var I=y.tag;if(I===3||I===4){var H=y.stateNode.containerInfo;if(H===_||H.nodeType===8&&H.parentNode===_)break;if(I===4)for(I=y.return;I!==null;){var Q=I.tag;if((Q===3||Q===4)&&(Q=I.stateNode.containerInfo,Q===_||Q.nodeType===8&&Q.parentNode===_))return;I=I.return}for(;H!==null;){if(I=Ts(H),I===null)return;if(Q=I.tag,Q===5||Q===6){y=E=I;continue e}H=H.parentNode}}y=y.return}Yl(function(){var se=E,le=qo(f),ce=[];e:{var ae=C1.get(i);if(ae!==void 0){var ge=zf,we=i;switch(i){case"keypress":if(uc(f)===0)break e;case"keydown":case"keyup":ge=sL;break;case"focusin":we="focus",ge=Hf;break;case"focusout":we="blur",ge=Hf;break;case"beforeblur":case"afterblur":ge=Hf;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=n1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=W4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=aL;break;case S1:case _1:case k1:ge=Y4;break;case N1:ge=cL;break;case"scroll":ge=U4;break;case"wheel":ge=dL;break;case"copy":case"cut":case"paste":ge=Q4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=s1}var Se=(l&4)!==0,ct=!Se&&i==="scroll",ne=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var Z=se,re;Z!==null;){re=Z;var de=re.stateNode;if(re.tag===5&&de!==null&&(re=de,ne!==null&&(de=Cs(Z,ne),de!=null&&Se.push(ca(Z,de,re)))),ct)break;Z=Z.return}0<Se.length&&(ae=new ge(ae,we,null,f,le),ce.push({event:ae,listeners:Se}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ge=i==="mouseout"||i==="pointerout",ae&&f!==$o&&(we=f.relatedTarget||f.fromElement)&&(Ts(we)||we[yr]))break e;if((ge||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(we=f.relatedTarget||f.toElement,ge=se,we=we?Ts(we):null,we!==null&&(ct=Yn(we),we!==ct||we.tag!==5&&we.tag!==6)&&(we=null)):(ge=null,we=se),ge!==we)){if(Se=n1,de="onMouseLeave",ne="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(Se=s1,de="onPointerLeave",ne="onPointerEnter",Z="pointer"),ct=ge==null?ae:ji(ge),re=we==null?ae:ji(we),ae=new Se(de,Z+"leave",ge,f,le),ae.target=ct,ae.relatedTarget=re,de=null,Ts(le)===se&&(Se=new Se(ne,Z+"enter",we,f,le),Se.target=re,Se.relatedTarget=ct,de=Se),ct=de,ge&&we)t:{for(Se=ge,ne=we,Z=0,re=Se;re;re=Ci(re))Z++;for(re=0,de=ne;de;de=Ci(de))re++;for(;0<Z-re;)Se=Ci(Se),Z--;for(;0<re-Z;)ne=Ci(ne),re--;for(;Z--;){if(Se===ne||ne!==null&&Se===ne.alternate)break t;Se=Ci(Se),ne=Ci(ne)}Se=null}else Se=null;ge!==null&&T1(ce,ae,ge,Se,!1),we!==null&&ct!==null&&T1(ce,ct,we,Se,!0)}}e:{if(ae=se?ji(se):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var ke=vL;else if(u1(ae))if(f1)ke=SL;else{ke=wL;var Ee=xL}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(ke=bL);if(ke&&(ke=ke(i,se))){d1(ce,ke,f,le);break e}Ee&&Ee(i,ae,se),i==="focusout"&&(Ee=ae._wrapperState)&&Ee.controlled&&ae.type==="number"&&Le(ae,"number",ae.value)}switch(Ee=se?ji(se):window,i){case"focusin":(u1(Ee)||Ee.contentEditable==="true")&&(ki=Ee,Qf=se,oa=null);break;case"focusout":oa=Qf=ki=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,w1(ce,f,le);break;case"selectionchange":if(NL)break;case"keydown":case"keyup":w1(ce,f,le)}var je;if(Kf)e:{switch(i){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else _i?l1(i,f)&&(Ae="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(Ae="onCompositionStart");Ae&&(i1&&f.locale!=="ko"&&(_i||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&_i&&(je=e1()):(Kr=le,Bf="value"in Kr?Kr.value:Kr.textContent,_i=!0)),Ee=yc(se,Ae),0<Ee.length&&(Ae=new r1(Ae,i,null,f,le),ce.push({event:Ae,listeners:Ee}),je?Ae.data=je:(je=c1(f),je!==null&&(Ae.data=je)))),(je=hL?pL(i,f):mL(i,f))&&(se=yc(se,"onBeforeInput"),0<se.length&&(le=new r1("onBeforeInput","beforeinput",null,f,le),ce.push({event:le,listeners:se}),le.data=je))}A1(ce,l)})}function ca(i,l,f){return{instance:i,listener:l,currentTarget:f}}function yc(i,l){for(var f=l+"Capture",y=[];i!==null;){var _=i,E=_.stateNode;_.tag===5&&E!==null&&(_=E,E=Cs(i,f),E!=null&&y.unshift(ca(i,E,_)),E=Cs(i,l),E!=null&&y.push(ca(i,E,_))),i=i.return}return y}function Ci(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function T1(i,l,f,y,_){for(var E=l._reactName,I=[];f!==null&&f!==y;){var H=f,Q=H.alternate,se=H.stateNode;if(Q!==null&&Q===y)break;H.tag===5&&se!==null&&(H=se,_?(Q=Cs(f,E),Q!=null&&I.unshift(ca(f,Q,H))):_||(Q=Cs(f,E),Q!=null&&I.push(ca(f,Q,H)))),f=f.return}I.length!==0&&i.push({event:l,listeners:I})}var AL=/\r\n?/g,RL=/\u0000|\uFFFD/g;function I1(i){return(typeof i=="string"?i:""+i).replace(AL,`
|
|
38
|
-
`).replace(RL,"")}function vc(i,l,f){if(l=I1(l),I1(i)!==l&&f)throw Error(n(425))}function xc(){}var sh=null,ih=null;function oh(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ah=typeof setTimeout=="function"?setTimeout:void 0,TL=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,IL=typeof queueMicrotask=="function"?queueMicrotask:typeof M1<"u"?function(i){return M1.resolve(null).then(i).catch(ML)}:ah;function ML(i){setTimeout(function(){throw i})}function lh(i,l){var f=l,y=0;do{var _=f.nextSibling;if(i.removeChild(f),_&&_.nodeType===8)if(f=_.data,f==="/$"){if(y===0){i.removeChild(_),Zo(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=_}while(f);Zo(l)}function Yr(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function O1(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return i;l--}else f==="/$"&&l++}i=i.previousSibling}return null}var Ei=Math.random().toString(36).slice(2),Qn="__reactFiber$"+Ei,ua="__reactProps$"+Ei,yr="__reactContainer$"+Ei,ch="__reactEvents$"+Ei,OL="__reactListeners$"+Ei,PL="__reactHandles$"+Ei;function Ts(i){var l=i[Qn];if(l)return l;for(var f=i.parentNode;f;){if(l=f[yr]||f[Qn]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(i=O1(i);i!==null;){if(f=i[Qn])return f;i=O1(i)}return l}i=f,f=i.parentNode}return null}function da(i){return i=i[Qn]||i[yr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ji(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function wc(i){return i[ua]||null}var uh=[],Ai=-1;function Xr(i){return{current:i}}function Ge(i){0>Ai||(i.current=uh[Ai],uh[Ai]=null,Ai--)}function Ue(i,l){Ai++,uh[Ai]=i.current,i.current=l}var Qr={},jt=Xr(Qr),Ht=Xr(!1),Is=Qr;function Ri(i,l){var f=i.type.contextTypes;if(!f)return Qr;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var _={},E;for(E in f)_[E]=l[E];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=_),_}function Wt(i){return i=i.childContextTypes,i!=null}function bc(){Ge(Ht),Ge(jt)}function P1(i,l,f){if(jt.current!==Qr)throw Error(n(168));Ue(jt,l),Ue(Ht,f)}function L1(i,l,f){var y=i.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var _ in y)if(!(_ in l))throw Error(n(108,X(i)||"Unknown",_));return G({},f,y)}function Sc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Qr,Is=jt.current,Ue(jt,i),Ue(Ht,Ht.current),!0}function D1(i,l,f){var y=i.stateNode;if(!y)throw Error(n(169));f?(i=L1(i,l,Is),y.__reactInternalMemoizedMergedChildContext=i,Ge(Ht),Ge(jt),Ue(jt,i)):Ge(Ht),Ue(Ht,f)}var vr=null,_c=!1,dh=!1;function $1(i){vr===null?vr=[i]:vr.push(i)}function LL(i){_c=!0,$1(i)}function Jr(){if(!dh&&vr!==null){dh=!0;var i=0,l=ze;try{var f=vr;for(ze=1;i<f.length;i++){var y=f[i];do y=y(!0);while(y!==null)}vr=null,_c=!1}catch(_){throw vr!==null&&(vr=vr.slice(i+1)),Jl(Wo,Jr),_}finally{ze=l,dh=!1}}return null}var Ti=[],Ii=0,kc=null,Nc=0,mn=[],gn=0,Ms=null,xr=1,wr="";function Os(i,l){Ti[Ii++]=Nc,Ti[Ii++]=kc,kc=i,Nc=l}function q1(i,l,f){mn[gn++]=xr,mn[gn++]=wr,mn[gn++]=Ms,Ms=i;var y=xr;i=wr;var _=32-nn(y)-1;y&=~(1<<_),f+=1;var E=32-nn(l)+_;if(30<E){var I=_-_%5;E=(y&(1<<I)-1).toString(32),y>>=I,_-=I,xr=1<<32-nn(l)+_|f<<_|y,wr=E+i}else xr=1<<E|f<<_|y,wr=i}function fh(i){i.return!==null&&(Os(i,1),q1(i,1,0))}function hh(i){for(;i===kc;)kc=Ti[--Ii],Ti[Ii]=null,Nc=Ti[--Ii],Ti[Ii]=null;for(;i===Ms;)Ms=mn[--gn],mn[gn]=null,wr=mn[--gn],mn[gn]=null,xr=mn[--gn],mn[gn]=null}var sn=null,on=null,Xe=!1,An=null;function F1(i,l){var f=wn(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=i,l=i.deletions,l===null?(i.deletions=[f],i.flags|=16):l.push(f)}function B1(i,l){switch(i.tag){case 5:var f=i.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,sn=i,on=Yr(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,sn=i,on=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Ms!==null?{id:xr,overflow:wr}:null,i.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=wn(18,null,null,0),f.stateNode=l,f.return=i,i.child=f,sn=i,on=null,!0):!1;default:return!1}}function ph(i){return(i.mode&1)!==0&&(i.flags&128)===0}function mh(i){if(Xe){var l=on;if(l){var f=l;if(!B1(i,l)){if(ph(i))throw Error(n(418));l=Yr(f.nextSibling);var y=sn;l&&B1(i,l)?F1(y,f):(i.flags=i.flags&-4097|2,Xe=!1,sn=i)}}else{if(ph(i))throw Error(n(418));i.flags=i.flags&-4097|2,Xe=!1,sn=i}}}function z1(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;sn=i}function Cc(i){if(i!==sn)return!1;if(!Xe)return z1(i),Xe=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!oh(i.type,i.memoizedProps)),l&&(l=on)){if(ph(i))throw V1(),Error(n(418));for(;l;)F1(i,l),l=Yr(l.nextSibling)}if(z1(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var f=i.data;if(f==="/$"){if(l===0){on=Yr(i.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}i=i.nextSibling}on=null}}else on=sn?Yr(i.stateNode.nextSibling):null;return!0}function V1(){for(var i=on;i;)i=Yr(i.nextSibling)}function Mi(){on=sn=null,Xe=!1}function gh(i){An===null?An=[i]:An.push(i)}var DL=C.ReactCurrentBatchConfig;function fa(i,l,f){if(i=f.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var y=f.stateNode}if(!y)throw Error(n(147,i));var _=y,E=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(I){var H=_.refs;I===null?delete H[E]:H[E]=I},l._stringRef=E,l)}if(typeof i!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,i))}return i}function Ec(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function U1(i){var l=i._init;return l(i._payload)}function H1(i){function l(ne,Z){if(i){var re=ne.deletions;re===null?(ne.deletions=[Z],ne.flags|=16):re.push(Z)}}function f(ne,Z){if(!i)return null;for(;Z!==null;)l(ne,Z),Z=Z.sibling;return null}function y(ne,Z){for(ne=new Map;Z!==null;)Z.key!==null?ne.set(Z.key,Z):ne.set(Z.index,Z),Z=Z.sibling;return ne}function _(ne,Z){return ne=os(ne,Z),ne.index=0,ne.sibling=null,ne}function E(ne,Z,re){return ne.index=re,i?(re=ne.alternate,re!==null?(re=re.index,re<Z?(ne.flags|=2,Z):re):(ne.flags|=2,Z)):(ne.flags|=1048576,Z)}function I(ne){return i&&ne.alternate===null&&(ne.flags|=2),ne}function H(ne,Z,re,de){return Z===null||Z.tag!==6?(Z=ap(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function Q(ne,Z,re,de){var ke=re.type;return ke===T?le(ne,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===V&&U1(ke)===Z.type)?(de=_(Z,re.props),de.ref=fa(ne,Z,re),de.return=ne,de):(de=Qc(re.type,re.key,re.props,null,ne.mode,de),de.ref=fa(ne,Z,re),de.return=ne,de)}function se(ne,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=lp(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re.children||[]),Z.return=ne,Z)}function le(ne,Z,re,de,ke){return Z===null||Z.tag!==7?(Z=zs(re,ne.mode,de,ke),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function ce(ne,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=ap(""+Z,ne.mode,re),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case j:return re=Qc(Z.type,Z.key,Z.props,null,ne.mode,re),re.ref=fa(ne,null,Z),re.return=ne,re;case R:return Z=lp(Z,ne.mode,re),Z.return=ne,Z;case V:var de=Z._init;return ce(ne,de(Z._payload),re)}if(vt(Z)||q(Z))return Z=zs(Z,ne.mode,re,null),Z.return=ne,Z;Ec(ne,Z)}return null}function ae(ne,Z,re,de){var ke=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return ke!==null?null:H(ne,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case j:return re.key===ke?Q(ne,Z,re,de):null;case R:return re.key===ke?se(ne,Z,re,de):null;case V:return ke=re._init,ae(ne,Z,ke(re._payload),de)}if(vt(re)||q(re))return ke!==null?null:le(ne,Z,re,de,null);Ec(ne,re)}return null}function ge(ne,Z,re,de,ke){if(typeof de=="string"&&de!==""||typeof de=="number")return ne=ne.get(re)||null,H(Z,ne,""+de,ke);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case j:return ne=ne.get(de.key===null?re:de.key)||null,Q(Z,ne,de,ke);case R:return ne=ne.get(de.key===null?re:de.key)||null,se(Z,ne,de,ke);case V:var Ee=de._init;return ge(ne,Z,re,Ee(de._payload),ke)}if(vt(de)||q(de))return ne=ne.get(re)||null,le(Z,ne,de,ke,null);Ec(Z,de)}return null}function we(ne,Z,re,de){for(var ke=null,Ee=null,je=Z,Ae=Z=0,kt=null;je!==null&&Ae<re.length;Ae++){je.index>Ae?(kt=je,je=null):kt=je.sibling;var Fe=ae(ne,je,re[Ae],de);if(Fe===null){je===null&&(je=kt);break}i&&je&&Fe.alternate===null&&l(ne,je),Z=E(Fe,Z,Ae),Ee===null?ke=Fe:Ee.sibling=Fe,Ee=Fe,je=kt}if(Ae===re.length)return f(ne,je),Xe&&Os(ne,Ae),ke;if(je===null){for(;Ae<re.length;Ae++)je=ce(ne,re[Ae],de),je!==null&&(Z=E(je,Z,Ae),Ee===null?ke=je:Ee.sibling=je,Ee=je);return Xe&&Os(ne,Ae),ke}for(je=y(ne,je);Ae<re.length;Ae++)kt=ge(je,ne,Ae,re[Ae],de),kt!==null&&(i&&kt.alternate!==null&&je.delete(kt.key===null?Ae:kt.key),Z=E(kt,Z,Ae),Ee===null?ke=kt:Ee.sibling=kt,Ee=kt);return i&&je.forEach(function(as){return l(ne,as)}),Xe&&Os(ne,Ae),ke}function Se(ne,Z,re,de){var ke=q(re);if(typeof ke!="function")throw Error(n(150));if(re=ke.call(re),re==null)throw Error(n(151));for(var Ee=ke=null,je=Z,Ae=Z=0,kt=null,Fe=re.next();je!==null&&!Fe.done;Ae++,Fe=re.next()){je.index>Ae?(kt=je,je=null):kt=je.sibling;var as=ae(ne,je,Fe.value,de);if(as===null){je===null&&(je=kt);break}i&&je&&as.alternate===null&&l(ne,je),Z=E(as,Z,Ae),Ee===null?ke=as:Ee.sibling=as,Ee=as,je=kt}if(Fe.done)return f(ne,je),Xe&&Os(ne,Ae),ke;if(je===null){for(;!Fe.done;Ae++,Fe=re.next())Fe=ce(ne,Fe.value,de),Fe!==null&&(Z=E(Fe,Z,Ae),Ee===null?ke=Fe:Ee.sibling=Fe,Ee=Fe);return Xe&&Os(ne,Ae),ke}for(je=y(ne,je);!Fe.done;Ae++,Fe=re.next())Fe=ge(je,ne,Ae,Fe.value,de),Fe!==null&&(i&&Fe.alternate!==null&&je.delete(Fe.key===null?Ae:Fe.key),Z=E(Fe,Z,Ae),Ee===null?ke=Fe:Ee.sibling=Fe,Ee=Fe);return i&&je.forEach(function(g3){return l(ne,g3)}),Xe&&Os(ne,Ae),ke}function ct(ne,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===T&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case j:e:{for(var ke=re.key,Ee=Z;Ee!==null;){if(Ee.key===ke){if(ke=re.type,ke===T){if(Ee.tag===7){f(ne,Ee.sibling),Z=_(Ee,re.props.children),Z.return=ne,ne=Z;break e}}else if(Ee.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===V&&U1(ke)===Ee.type){f(ne,Ee.sibling),Z=_(Ee,re.props),Z.ref=fa(ne,Ee,re),Z.return=ne,ne=Z;break e}f(ne,Ee);break}else l(ne,Ee);Ee=Ee.sibling}re.type===T?(Z=zs(re.props.children,ne.mode,de,re.key),Z.return=ne,ne=Z):(de=Qc(re.type,re.key,re.props,null,ne.mode,de),de.ref=fa(ne,Z,re),de.return=ne,ne=de)}return I(ne);case R:e:{for(Ee=re.key;Z!==null;){if(Z.key===Ee)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){f(ne,Z.sibling),Z=_(Z,re.children||[]),Z.return=ne,ne=Z;break e}else{f(ne,Z);break}else l(ne,Z);Z=Z.sibling}Z=lp(re,ne.mode,de),Z.return=ne,ne=Z}return I(ne);case V:return Ee=re._init,ct(ne,Z,Ee(re._payload),de)}if(vt(re))return we(ne,Z,re,de);if(q(re))return Se(ne,Z,re,de);Ec(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Z!==null&&Z.tag===6?(f(ne,Z.sibling),Z=_(Z,re),Z.return=ne,ne=Z):(f(ne,Z),Z=ap(re,ne.mode,de),Z.return=ne,ne=Z),I(ne)):f(ne,Z)}return ct}var Oi=H1(!0),W1=H1(!1),jc=Xr(null),Ac=null,Pi=null,yh=null;function vh(){yh=Pi=Ac=null}function xh(i){var l=jc.current;Ge(jc),i._currentValue=l}function wh(i,l,f){for(;i!==null;){var y=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),i===f)break;i=i.return}}function Li(i,l){Ac=i,yh=Pi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(Kt=!0),i.firstContext=null)}function yn(i){var l=i._currentValue;if(yh!==i)if(i={context:i,memoizedValue:l,next:null},Pi===null){if(Ac===null)throw Error(n(308));Pi=i,Ac.dependencies={lanes:0,firstContext:i}}else Pi=Pi.next=i;return l}var Ps=null;function bh(i){Ps===null?Ps=[i]:Ps.push(i)}function K1(i,l,f,y){var _=l.interleaved;return _===null?(f.next=f,bh(l)):(f.next=_.next,_.next=f),l.interleaved=f,br(i,y)}function br(i,l){i.lanes|=l;var f=i.alternate;for(f!==null&&(f.lanes|=l),f=i,i=i.return;i!==null;)i.childLanes|=l,f=i.alternate,f!==null&&(f.childLanes|=l),f=i,i=i.return;return f.tag===3?f.stateNode:null}var Zr=!1;function Sh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function G1(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Sr(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function es(i,l,f){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,($e&2)!==0){var _=y.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),y.pending=l,br(i,f)}return _=y.interleaved,_===null?(l.next=l,bh(y)):(l.next=_.next,_.next=l),y.interleaved=l,br(i,f)}function Rc(i,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=i.pendingLanes,f|=y,l.lanes=f,Lf(i,f)}}function Y1(i,l){var f=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var _=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};E===null?_=E=I:E=E.next=I,f=f.next}while(f!==null);E===null?_=E=l:E=E.next=l}else _=E=l;f={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:E,shared:y.shared,effects:y.effects},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=l:i.next=l,f.lastBaseUpdate=l}function Tc(i,l,f,y){var _=i.updateQueue;Zr=!1;var E=_.firstBaseUpdate,I=_.lastBaseUpdate,H=_.shared.pending;if(H!==null){_.shared.pending=null;var Q=H,se=Q.next;Q.next=null,I===null?E=se:I.next=se,I=Q;var le=i.alternate;le!==null&&(le=le.updateQueue,H=le.lastBaseUpdate,H!==I&&(H===null?le.firstBaseUpdate=se:H.next=se,le.lastBaseUpdate=Q))}if(E!==null){var ce=_.baseState;I=0,le=se=Q=null,H=E;do{var ae=H.lane,ge=H.eventTime;if((y&ae)===ae){le!==null&&(le=le.next={eventTime:ge,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var we=i,Se=H;switch(ae=l,ge=f,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ce=we.call(ge,ce,ae);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,ae=typeof we=="function"?we.call(ge,ce,ae):we,ae==null)break e;ce=G({},ce,ae);break e;case 2:Zr=!0}}H.callback!==null&&H.lane!==0&&(i.flags|=64,ae=_.effects,ae===null?_.effects=[H]:ae.push(H))}else ge={eventTime:ge,lane:ae,tag:H.tag,payload:H.payload,callback:H.callback,next:null},le===null?(se=le=ge,Q=ce):le=le.next=ge,I|=ae;if(H=H.next,H===null){if(H=_.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,_.lastBaseUpdate=ae,_.shared.pending=null}}while(!0);if(le===null&&(Q=ce),_.baseState=Q,_.firstBaseUpdate=se,_.lastBaseUpdate=le,l=_.shared.interleaved,l!==null){_=l;do I|=_.lane,_=_.next;while(_!==l)}else E===null&&(_.shared.lanes=0);$s|=I,i.lanes=I,i.memoizedState=ce}}function X1(i,l,f){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var y=i[l],_=y.callback;if(_!==null){if(y.callback=null,y=f,typeof _!="function")throw Error(n(191,_));_.call(y)}}}var ha={},Jn=Xr(ha),pa=Xr(ha),ma=Xr(ha);function Ls(i){if(i===ha)throw Error(n(174));return i}function _h(i,l){switch(Ue(ma,l),Ue(pa,i),Ue(Jn,ha),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Ie(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Ie(l,i)}Ge(Jn),Ue(Jn,l)}function Di(){Ge(Jn),Ge(pa),Ge(ma)}function Q1(i){Ls(ma.current);var l=Ls(Jn.current),f=Ie(l,i.type);l!==f&&(Ue(pa,i),Ue(Jn,f))}function kh(i){pa.current===i&&(Ge(Jn),Ge(pa))}var rt=Xr(0);function Ic(i){for(var l=i;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Nh=[];function Ch(){for(var i=0;i<Nh.length;i++)Nh[i]._workInProgressVersionPrimary=null;Nh.length=0}var Mc=C.ReactCurrentDispatcher,Eh=C.ReactCurrentBatchConfig,Ds=0,st=null,wt=null,St=null,Oc=!1,ga=!1,ya=0,$L=0;function At(){throw Error(n(321))}function jh(i,l){if(l===null)return!1;for(var f=0;f<l.length&&f<i.length;f++)if(!jn(i[f],l[f]))return!1;return!0}function Ah(i,l,f,y,_,E){if(Ds=E,st=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Mc.current=i===null||i.memoizedState===null?zL:VL,i=f(y,_),ga){E=0;do{if(ga=!1,ya=0,25<=E)throw Error(n(301));E+=1,St=wt=null,l.updateQueue=null,Mc.current=UL,i=f(y,_)}while(ga)}if(Mc.current=Dc,l=wt!==null&&wt.next!==null,Ds=0,St=wt=st=null,Oc=!1,l)throw Error(n(300));return i}function Rh(){var i=ya!==0;return ya=0,i}function Zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?st.memoizedState=St=i:St=St.next=i,St}function vn(){if(wt===null){var i=st.alternate;i=i!==null?i.memoizedState:null}else i=wt.next;var l=St===null?st.memoizedState:St.next;if(l!==null)St=l,wt=i;else{if(i===null)throw Error(n(310));wt=i,i={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},St===null?st.memoizedState=St=i:St=St.next=i}return St}function va(i,l){return typeof l=="function"?l(i):l}function Th(i){var l=vn(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=i;var y=wt,_=y.baseQueue,E=f.pending;if(E!==null){if(_!==null){var I=_.next;_.next=E.next,E.next=I}y.baseQueue=_=E,f.pending=null}if(_!==null){E=_.next,y=y.baseState;var H=I=null,Q=null,se=E;do{var le=se.lane;if((Ds&le)===le)Q!==null&&(Q=Q.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:i(y,se.action);else{var ce={lane:le,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};Q===null?(H=Q=ce,I=y):Q=Q.next=ce,st.lanes|=le,$s|=le}se=se.next}while(se!==null&&se!==E);Q===null?I=y:Q.next=H,jn(y,l.memoizedState)||(Kt=!0),l.memoizedState=y,l.baseState=I,l.baseQueue=Q,f.lastRenderedState=y}if(i=f.interleaved,i!==null){_=i;do E=_.lane,st.lanes|=E,$s|=E,_=_.next;while(_!==i)}else _===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Ih(i){var l=vn(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=i;var y=f.dispatch,_=f.pending,E=l.memoizedState;if(_!==null){f.pending=null;var I=_=_.next;do E=i(E,I.action),I=I.next;while(I!==_);jn(E,l.memoizedState)||(Kt=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),f.lastRenderedState=E}return[E,y]}function J1(){}function Z1(i,l){var f=st,y=vn(),_=l(),E=!jn(y.memoizedState,_);if(E&&(y.memoizedState=_,Kt=!0),y=y.queue,Mh(nS.bind(null,f,y,i),[i]),y.getSnapshot!==l||E||St!==null&&St.memoizedState.tag&1){if(f.flags|=2048,xa(9,tS.bind(null,f,y,_,l),void 0,null),_t===null)throw Error(n(349));(Ds&30)!==0||eS(f,l,_)}return _}function eS(i,l,f){i.flags|=16384,i={getSnapshot:l,value:f},l=st.updateQueue,l===null?(l={lastEffect:null,stores:null},st.updateQueue=l,l.stores=[i]):(f=l.stores,f===null?l.stores=[i]:f.push(i))}function tS(i,l,f,y){l.value=f,l.getSnapshot=y,rS(l)&&sS(i)}function nS(i,l,f){return f(function(){rS(l)&&sS(i)})}function rS(i){var l=i.getSnapshot;i=i.value;try{var f=l();return!jn(i,f)}catch{return!0}}function sS(i){var l=br(i,1);l!==null&&Mn(l,i,1,-1)}function iS(i){var l=Zn();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:i},l.queue=i,i=i.dispatch=BL.bind(null,st,i),[l.memoizedState,i]}function xa(i,l,f,y){return i={tag:i,create:l,destroy:f,deps:y,next:null},l=st.updateQueue,l===null?(l={lastEffect:null,stores:null},st.updateQueue=l,l.lastEffect=i.next=i):(f=l.lastEffect,f===null?l.lastEffect=i.next=i:(y=f.next,f.next=i,i.next=y,l.lastEffect=i)),i}function oS(){return vn().memoizedState}function Pc(i,l,f,y){var _=Zn();st.flags|=i,_.memoizedState=xa(1|l,f,void 0,y===void 0?null:y)}function Lc(i,l,f,y){var _=vn();y=y===void 0?null:y;var E=void 0;if(wt!==null){var I=wt.memoizedState;if(E=I.destroy,y!==null&&jh(y,I.deps)){_.memoizedState=xa(l,f,E,y);return}}st.flags|=i,_.memoizedState=xa(1|l,f,E,y)}function aS(i,l){return Pc(8390656,8,i,l)}function Mh(i,l){return Lc(2048,8,i,l)}function lS(i,l){return Lc(4,2,i,l)}function cS(i,l){return Lc(4,4,i,l)}function uS(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function dS(i,l,f){return f=f!=null?f.concat([i]):null,Lc(4,4,uS.bind(null,l,i),f)}function Oh(){}function fS(i,l){var f=vn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&jh(l,y[1])?y[0]:(f.memoizedState=[i,l],i)}function hS(i,l){var f=vn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&jh(l,y[1])?y[0]:(i=i(),f.memoizedState=[i,l],i)}function pS(i,l,f){return(Ds&21)===0?(i.baseState&&(i.baseState=!1,Kt=!0),i.memoizedState=f):(jn(f,l)||(f=wi(),st.lanes|=f,$s|=f,i.baseState=!0),l)}function qL(i,l){var f=ze;ze=f!==0&&4>f?f:4,i(!0);var y=Eh.transition;Eh.transition={};try{i(!1),l()}finally{ze=f,Eh.transition=y}}function mS(){return vn().memoizedState}function FL(i,l,f){var y=ss(i);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},gS(i))yS(l,f);else if(f=K1(i,l,f,y),f!==null){var _=$t();Mn(f,i,y,_),vS(f,l,y)}}function BL(i,l,f){var y=ss(i),_={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(gS(i))yS(l,_);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var I=l.lastRenderedState,H=E(I,f);if(_.hasEagerState=!0,_.eagerState=H,jn(H,I)){var Q=l.interleaved;Q===null?(_.next=_,bh(l)):(_.next=Q.next,Q.next=_),l.interleaved=_;return}}catch{}finally{}f=K1(i,l,_,y),f!==null&&(_=$t(),Mn(f,i,y,_),vS(f,l,y))}}function gS(i){var l=i.alternate;return i===st||l!==null&&l===st}function yS(i,l){ga=Oc=!0;var f=i.pending;f===null?l.next=l:(l.next=f.next,f.next=l),i.pending=l}function vS(i,l,f){if((f&4194240)!==0){var y=l.lanes;y&=i.pendingLanes,f|=y,l.lanes=f,Lf(i,f)}}var Dc={readContext:yn,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},zL={readContext:yn,useCallback:function(i,l){return Zn().memoizedState=[i,l===void 0?null:l],i},useContext:yn,useEffect:aS,useImperativeHandle:function(i,l,f){return f=f!=null?f.concat([i]):null,Pc(4194308,4,uS.bind(null,l,i),f)},useLayoutEffect:function(i,l){return Pc(4194308,4,i,l)},useInsertionEffect:function(i,l){return Pc(4,2,i,l)},useMemo:function(i,l){var f=Zn();return l=l===void 0?null:l,i=i(),f.memoizedState=[i,l],i},useReducer:function(i,l,f){var y=Zn();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},y.queue=i,i=i.dispatch=FL.bind(null,st,i),[y.memoizedState,i]},useRef:function(i){var l=Zn();return i={current:i},l.memoizedState=i},useState:iS,useDebugValue:Oh,useDeferredValue:function(i){return Zn().memoizedState=i},useTransition:function(){var i=iS(!1),l=i[0];return i=qL.bind(null,i[1]),Zn().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,f){var y=st,_=Zn();if(Xe){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),_t===null)throw Error(n(349));(Ds&30)!==0||eS(y,l,f)}_.memoizedState=f;var E={value:f,getSnapshot:l};return _.queue=E,aS(nS.bind(null,y,E,i),[i]),y.flags|=2048,xa(9,tS.bind(null,y,E,f,l),void 0,null),f},useId:function(){var i=Zn(),l=_t.identifierPrefix;if(Xe){var f=wr,y=xr;f=(y&~(1<<32-nn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=ya++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=$L++,l=":"+l+"r"+f.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},VL={readContext:yn,useCallback:fS,useContext:yn,useEffect:Mh,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:cS,useMemo:hS,useReducer:Th,useRef:oS,useState:function(){return Th(va)},useDebugValue:Oh,useDeferredValue:function(i){var l=vn();return pS(l,wt.memoizedState,i)},useTransition:function(){var i=Th(va)[0],l=vn().memoizedState;return[i,l]},useMutableSource:J1,useSyncExternalStore:Z1,useId:mS,unstable_isNewReconciler:!1},UL={readContext:yn,useCallback:fS,useContext:yn,useEffect:Mh,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:cS,useMemo:hS,useReducer:Ih,useRef:oS,useState:function(){return Ih(va)},useDebugValue:Oh,useDeferredValue:function(i){var l=vn();return wt===null?l.memoizedState=i:pS(l,wt.memoizedState,i)},useTransition:function(){var i=Ih(va)[0],l=vn().memoizedState;return[i,l]},useMutableSource:J1,useSyncExternalStore:Z1,useId:mS,unstable_isNewReconciler:!1};function Rn(i,l){if(i&&i.defaultProps){l=G({},l),i=i.defaultProps;for(var f in i)l[f]===void 0&&(l[f]=i[f]);return l}return l}function Ph(i,l,f,y){l=i.memoizedState,f=f(y,l),f=f==null?l:G({},l,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var $c={isMounted:function(i){return(i=i._reactInternals)?Yn(i)===i:!1},enqueueSetState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ss(i),E=Sr(y,_);E.payload=l,f!=null&&(E.callback=f),l=es(i,E,_),l!==null&&(Mn(l,i,_,y),Rc(l,i,_))},enqueueReplaceState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ss(i),E=Sr(y,_);E.tag=1,E.payload=l,f!=null&&(E.callback=f),l=es(i,E,_),l!==null&&(Mn(l,i,_,y),Rc(l,i,_))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var f=$t(),y=ss(i),_=Sr(f,y);_.tag=2,l!=null&&(_.callback=l),l=es(i,_,y),l!==null&&(Mn(l,i,y,f),Rc(l,i,y))}};function xS(i,l,f,y,_,E,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,E,I):l.prototype&&l.prototype.isPureReactComponent?!ia(f,y)||!ia(_,E):!0}function wS(i,l,f){var y=!1,_=Qr,E=l.contextType;return typeof E=="object"&&E!==null?E=yn(E):(_=Wt(l)?Is:jt.current,y=l.contextTypes,E=(y=y!=null)?Ri(i,_):Qr),l=new l(f,E),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=$c,i.stateNode=l,l._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=_,i.__reactInternalMemoizedMaskedChildContext=E),l}function bS(i,l,f,y){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==i&&$c.enqueueReplaceState(l,l.state,null)}function Lh(i,l,f,y){var _=i.stateNode;_.props=f,_.state=i.memoizedState,_.refs={},Sh(i);var E=l.contextType;typeof E=="object"&&E!==null?_.context=yn(E):(E=Wt(l)?Is:jt.current,_.context=Ri(i,E)),_.state=i.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Ph(i,l,E,f),_.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(l=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),l!==_.state&&$c.enqueueReplaceState(_,_.state,null),Tc(i,f,_,y),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308)}function $i(i,l){try{var f="",y=l;do f+=J(y),y=y.return;while(y);var _=f}catch(E){_=`
|
|
39
|
-
Error generating stack: `+E.message+`
|
|
40
|
-
`+E.stack}return{value:i,source:l,stack:_,digest:null}}function Dh(i,l,f){return{value:i,source:null,stack:f??null,digest:l??null}}function $h(i,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var HL=typeof WeakMap=="function"?WeakMap:Map;function SS(i,l,f){f=Sr(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){Hc||(Hc=!0,Zh=y),$h(i,l)},f}function _S(i,l,f){f=Sr(-1,f),f.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var _=l.value;f.payload=function(){return y(_)},f.callback=function(){$h(i,l)}}var E=i.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(f.callback=function(){$h(i,l),typeof y!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function kS(i,l,f){var y=i.pingCache;if(y===null){y=i.pingCache=new HL;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(f)||(_.add(f),i=i3.bind(null,i,l,f),l.then(i,i))}function NS(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function CS(i,l,f,y,_){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Sr(-1,1),l.tag=2,es(f,l,1))),f.lanes|=1),i):(i.flags|=65536,i.lanes=_,i)}var WL=C.ReactCurrentOwner,Kt=!1;function Dt(i,l,f,y){l.child=i===null?W1(l,null,f,y):Oi(l,i.child,f,y)}function ES(i,l,f,y,_){f=f.render;var E=l.ref;return Li(l,_),y=Ah(i,l,f,y,E,_),f=Rh(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,_r(i,l,_)):(Xe&&f&&fh(l),l.flags|=1,Dt(i,l,y,_),l.child)}function jS(i,l,f,y,_){if(i===null){var E=f.type;return typeof E=="function"&&!op(E)&&E.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=E,AS(i,l,E,y,_)):(i=Qc(f.type,null,y,l,l.mode,_),i.ref=l.ref,i.return=l,l.child=i)}if(E=i.child,(i.lanes&_)===0){var I=E.memoizedProps;if(f=f.compare,f=f!==null?f:ia,f(I,y)&&i.ref===l.ref)return _r(i,l,_)}return l.flags|=1,i=os(E,y),i.ref=l.ref,i.return=l,l.child=i}function AS(i,l,f,y,_){if(i!==null){var E=i.memoizedProps;if(ia(E,y)&&i.ref===l.ref)if(Kt=!1,l.pendingProps=y=E,(i.lanes&_)!==0)(i.flags&131072)!==0&&(Kt=!0);else return l.lanes=i.lanes,_r(i,l,_)}return qh(i,l,f,y,_)}function RS(i,l,f){var y=l.pendingProps,_=y.children,E=i!==null?i.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(Fi,an),an|=f;else{if((f&1073741824)===0)return i=E!==null?E.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Ue(Fi,an),an|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=E!==null?E.baseLanes:f,Ue(Fi,an),an|=y}else E!==null?(y=E.baseLanes|f,l.memoizedState=null):y=f,Ue(Fi,an),an|=y;return Dt(i,l,_,f),l.child}function TS(i,l){var f=l.ref;(i===null&&f!==null||i!==null&&i.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function qh(i,l,f,y,_){var E=Wt(f)?Is:jt.current;return E=Ri(l,E),Li(l,_),f=Ah(i,l,f,y,E,_),y=Rh(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,_r(i,l,_)):(Xe&&y&&fh(l),l.flags|=1,Dt(i,l,f,_),l.child)}function IS(i,l,f,y,_){if(Wt(f)){var E=!0;Sc(l)}else E=!1;if(Li(l,_),l.stateNode===null)Fc(i,l),wS(l,f,y),Lh(l,f,y,_),y=!0;else if(i===null){var I=l.stateNode,H=l.memoizedProps;I.props=H;var Q=I.context,se=f.contextType;typeof se=="object"&&se!==null?se=yn(se):(se=Wt(f)?Is:jt.current,se=Ri(l,se));var le=f.getDerivedStateFromProps,ce=typeof le=="function"||typeof I.getSnapshotBeforeUpdate=="function";ce||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(H!==y||Q!==se)&&bS(l,I,y,se),Zr=!1;var ae=l.memoizedState;I.state=ae,Tc(l,y,I,_),Q=l.memoizedState,H!==y||ae!==Q||Ht.current||Zr?(typeof le=="function"&&(Ph(l,f,le,y),Q=l.memoizedState),(H=Zr||xS(l,f,H,y,ae,Q,se))?(ce||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=Q),I.props=y,I.state=Q,I.context=se,y=H):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{I=l.stateNode,G1(i,l),H=l.memoizedProps,se=l.type===l.elementType?H:Rn(l.type,H),I.props=se,ce=l.pendingProps,ae=I.context,Q=f.contextType,typeof Q=="object"&&Q!==null?Q=yn(Q):(Q=Wt(f)?Is:jt.current,Q=Ri(l,Q));var ge=f.getDerivedStateFromProps;(le=typeof ge=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(H!==ce||ae!==Q)&&bS(l,I,y,Q),Zr=!1,ae=l.memoizedState,I.state=ae,Tc(l,y,I,_);var we=l.memoizedState;H!==ce||ae!==we||Ht.current||Zr?(typeof ge=="function"&&(Ph(l,f,ge,y),we=l.memoizedState),(se=Zr||xS(l,f,se,y,ae,we,Q)||!1)?(le||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(y,we,Q),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(y,we,Q)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=we),I.props=y,I.state=we,I.context=Q,y=se):(typeof I.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),y=!1)}return Fh(i,l,f,y,E,_)}function Fh(i,l,f,y,_,E){TS(i,l);var I=(l.flags&128)!==0;if(!y&&!I)return _&&D1(l,f,!1),_r(i,l,E);y=l.stateNode,WL.current=l;var H=I&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,i!==null&&I?(l.child=Oi(l,i.child,null,E),l.child=Oi(l,null,H,E)):Dt(i,l,H,E),l.memoizedState=y.state,_&&D1(l,f,!0),l.child}function MS(i){var l=i.stateNode;l.pendingContext?P1(i,l.pendingContext,l.pendingContext!==l.context):l.context&&P1(i,l.context,!1),_h(i,l.containerInfo)}function OS(i,l,f,y,_){return Mi(),gh(_),l.flags|=256,Dt(i,l,f,y),l.child}var Bh={dehydrated:null,treeContext:null,retryLane:0};function zh(i){return{baseLanes:i,cachePool:null,transitions:null}}function PS(i,l,f){var y=l.pendingProps,_=rt.current,E=!1,I=(l.flags&128)!==0,H;if((H=I)||(H=i!==null&&i.memoizedState===null?!1:(_&2)!==0),H?(E=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(_|=1),Ue(rt,_&1),i===null)return mh(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=y.children,i=y.fallback,E?(y=l.mode,E=l.child,I={mode:"hidden",children:I},(y&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=I):E=Jc(I,y,0,null),i=zs(i,y,f,null),E.return=l,i.return=l,E.sibling=i,l.child=E,l.child.memoizedState=zh(f),l.memoizedState=Bh,i):Vh(l,I));if(_=i.memoizedState,_!==null&&(H=_.dehydrated,H!==null))return KL(i,l,I,y,H,_,f);if(E){E=y.fallback,I=l.mode,_=i.child,H=_.sibling;var Q={mode:"hidden",children:y.children};return(I&1)===0&&l.child!==_?(y=l.child,y.childLanes=0,y.pendingProps=Q,l.deletions=null):(y=os(_,Q),y.subtreeFlags=_.subtreeFlags&14680064),H!==null?E=os(H,E):(E=zs(E,I,f,null),E.flags|=2),E.return=l,y.return=l,y.sibling=E,l.child=y,y=E,E=l.child,I=i.child.memoizedState,I=I===null?zh(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=i.childLanes&~f,l.memoizedState=Bh,y}return E=i.child,i=E.sibling,y=os(E,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=f),y.return=l,y.sibling=null,i!==null&&(f=l.deletions,f===null?(l.deletions=[i],l.flags|=16):f.push(i)),l.child=y,l.memoizedState=null,y}function Vh(i,l){return l=Jc({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function qc(i,l,f,y){return y!==null&&gh(y),Oi(l,i.child,null,f),i=Vh(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function KL(i,l,f,y,_,E,I){if(f)return l.flags&256?(l.flags&=-257,y=Dh(Error(n(422))),qc(i,l,I,y)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(E=y.fallback,_=l.mode,y=Jc({mode:"visible",children:y.children},_,0,null),E=zs(E,_,I,null),E.flags|=2,y.return=l,E.return=l,y.sibling=E,l.child=y,(l.mode&1)!==0&&Oi(l,i.child,null,I),l.child.memoizedState=zh(I),l.memoizedState=Bh,E);if((l.mode&1)===0)return qc(i,l,I,null);if(_.data==="$!"){if(y=_.nextSibling&&_.nextSibling.dataset,y)var H=y.dgst;return y=H,E=Error(n(419)),y=Dh(E,y,void 0),qc(i,l,I,y)}if(H=(I&i.childLanes)!==0,Kt||H){if(y=_t,y!==null){switch(I&-I){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(y.suspendedLanes|I))!==0?0:_,_!==0&&_!==E.retryLane&&(E.retryLane=_,br(i,_),Mn(y,i,_,-1))}return ip(),y=Dh(Error(n(421))),qc(i,l,I,y)}return _.data==="$?"?(l.flags|=128,l.child=i.child,l=o3.bind(null,i),_._reactRetry=l,null):(i=E.treeContext,on=Yr(_.nextSibling),sn=l,Xe=!0,An=null,i!==null&&(mn[gn++]=xr,mn[gn++]=wr,mn[gn++]=Ms,xr=i.id,wr=i.overflow,Ms=l),l=Vh(l,y.children),l.flags|=4096,l)}function LS(i,l,f){i.lanes|=l;var y=i.alternate;y!==null&&(y.lanes|=l),wh(i.return,l,f)}function Uh(i,l,f,y,_){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:_}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=y,E.tail=f,E.tailMode=_)}function DS(i,l,f){var y=l.pendingProps,_=y.revealOrder,E=y.tail;if(Dt(i,l,y.children,f),y=rt.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&LS(i,f,l);else if(i.tag===19)LS(i,f,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(Ue(rt,y),(l.mode&1)===0)l.memoizedState=null;else switch(_){case"forwards":for(f=l.child,_=null;f!==null;)i=f.alternate,i!==null&&Ic(i)===null&&(_=f),f=f.sibling;f=_,f===null?(_=l.child,l.child=null):(_=f.sibling,f.sibling=null),Uh(l,!1,_,f,E);break;case"backwards":for(f=null,_=l.child,l.child=null;_!==null;){if(i=_.alternate,i!==null&&Ic(i)===null){l.child=_;break}i=_.sibling,_.sibling=f,f=_,_=i}Uh(l,!0,f,null,E);break;case"together":Uh(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Fc(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function _r(i,l,f){if(i!==null&&(l.dependencies=i.dependencies),$s|=l.lanes,(f&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,f=os(i,i.pendingProps),l.child=f,f.return=l;i.sibling!==null;)i=i.sibling,f=f.sibling=os(i,i.pendingProps),f.return=l;f.sibling=null}return l.child}function GL(i,l,f){switch(l.tag){case 3:MS(l),Mi();break;case 5:Q1(l);break;case 1:Wt(l.type)&&Sc(l);break;case 4:_h(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,_=l.memoizedProps.value;Ue(jc,y._currentValue),y._currentValue=_;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Ue(rt,rt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?PS(i,l,f):(Ue(rt,rt.current&1),i=_r(i,l,f),i!==null?i.sibling:null);Ue(rt,rt.current&1);break;case 19:if(y=(f&l.childLanes)!==0,(i.flags&128)!==0){if(y)return DS(i,l,f);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Ue(rt,rt.current),y)break;return null;case 22:case 23:return l.lanes=0,RS(i,l,f)}return _r(i,l,f)}var $S,Hh,qS,FS;$S=function(i,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Hh=function(){},qS=function(i,l,f,y){var _=i.memoizedProps;if(_!==y){i=l.stateNode,Ls(Jn.current);var E=null;switch(f){case"input":_=_e(i,_),y=_e(i,y),E=[];break;case"select":_=G({},_,{value:void 0}),y=G({},y,{value:void 0}),E=[];break;case"textarea":_=it(i,_),y=it(i,y),E=[];break;default:typeof _.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=xc)}Lt(f,y);var I;f=null;for(se in _)if(!y.hasOwnProperty(se)&&_.hasOwnProperty(se)&&_[se]!=null)if(se==="style"){var H=_[se];for(I in H)H.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?E||(E=[]):(E=E||[]).push(se,null));for(se in y){var Q=y[se];if(H=_!=null?_[se]:void 0,y.hasOwnProperty(se)&&Q!==H&&(Q!=null||H!=null))if(se==="style")if(H){for(I in H)!H.hasOwnProperty(I)||Q&&Q.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in Q)Q.hasOwnProperty(I)&&H[I]!==Q[I]&&(f||(f={}),f[I]=Q[I])}else f||(E||(E=[]),E.push(se,f)),f=Q;else se==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,H=H?H.__html:void 0,Q!=null&&H!==Q&&(E=E||[]).push(se,Q)):se==="children"?typeof Q!="string"&&typeof Q!="number"||(E=E||[]).push(se,""+Q):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(Q!=null&&se==="onScroll"&&Ke("scroll",i),E||H===Q||(E=[])):(E=E||[]).push(se,Q))}f&&(E=E||[]).push("style",f);var se=E;(l.updateQueue=se)&&(l.flags|=4)}},FS=function(i,l,f,y){f!==y&&(l.flags|=4)};function wa(i,l){if(!Xe)switch(i.tailMode){case"hidden":l=i.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function Rt(i){var l=i.alternate!==null&&i.alternate.child===i.child,f=0,y=0;if(l)for(var _=i.child;_!==null;)f|=_.lanes|_.childLanes,y|=_.subtreeFlags&14680064,y|=_.flags&14680064,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)f|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=y,i.childLanes=f,l}function YL(i,l,f){var y=l.pendingProps;switch(hh(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(l),null;case 1:return Wt(l.type)&&bc(),Rt(l),null;case 3:return y=l.stateNode,Di(),Ge(Ht),Ge(jt),Ch(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Cc(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,An!==null&&(np(An),An=null))),Hh(i,l),Rt(l),null;case 5:kh(l);var _=Ls(ma.current);if(f=l.type,i!==null&&l.stateNode!=null)qS(i,l,f,y,_),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return Rt(l),null}if(i=Ls(Jn.current),Cc(l)){y=l.stateNode,f=l.type;var E=l.memoizedProps;switch(y[Qn]=l,y[ua]=E,i=(l.mode&1)!==0,f){case"dialog":Ke("cancel",y),Ke("close",y);break;case"iframe":case"object":case"embed":Ke("load",y);break;case"video":case"audio":for(_=0;_<aa.length;_++)Ke(aa[_],y);break;case"source":Ke("error",y);break;case"img":case"image":case"link":Ke("error",y),Ke("load",y);break;case"details":Ke("toggle",y);break;case"input":xe(y,E),Ke("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!E.multiple},Ke("invalid",y);break;case"textarea":We(y,E),Ke("invalid",y)}Lt(f,E),_=null;for(var I in E)if(E.hasOwnProperty(I)){var H=E[I];I==="children"?typeof H=="string"?y.textContent!==H&&(E.suppressHydrationWarning!==!0&&vc(y.textContent,H,i),_=["children",H]):typeof H=="number"&&y.textContent!==""+H&&(E.suppressHydrationWarning!==!0&&vc(y.textContent,H,i),_=["children",""+H]):s.hasOwnProperty(I)&&H!=null&&I==="onScroll"&&Ke("scroll",y)}switch(f){case"input":me(y),tt(y,E,!0);break;case"textarea":me(y),Mt(y);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(y.onclick=xc)}y=_,l.updateQueue=y,y!==null&&(l.flags|=4)}else{I=_.nodeType===9?_:_.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Vt(f)),i==="http://www.w3.org/1999/xhtml"?f==="script"?(i=I.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=I.createElement(f,{is:y.is}):(i=I.createElement(f),f==="select"&&(I=i,y.multiple?I.multiple=!0:y.size&&(I.size=y.size))):i=I.createElementNS(i,f),i[Qn]=l,i[ua]=y,$S(i,l,!1,!1),l.stateNode=i;e:{switch(I=tn(f,y),f){case"dialog":Ke("cancel",i),Ke("close",i),_=y;break;case"iframe":case"object":case"embed":Ke("load",i),_=y;break;case"video":case"audio":for(_=0;_<aa.length;_++)Ke(aa[_],i);_=y;break;case"source":Ke("error",i),_=y;break;case"img":case"image":case"link":Ke("error",i),Ke("load",i),_=y;break;case"details":Ke("toggle",i),_=y;break;case"input":xe(i,y),_=_e(i,y),Ke("invalid",i);break;case"option":_=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},_=G({},y,{value:void 0}),Ke("invalid",i);break;case"textarea":We(i,y),_=it(i,y),Ke("invalid",i);break;default:_=y}Lt(f,_),H=_;for(E in H)if(H.hasOwnProperty(E)){var Q=H[E];E==="style"?Pt(i,Q):E==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&ot(i,Q)):E==="children"?typeof Q=="string"?(f!=="textarea"||Q!=="")&&Ve(i,Q):typeof Q=="number"&&Ve(i,""+Q):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(s.hasOwnProperty(E)?Q!=null&&E==="onScroll"&&Ke("scroll",i):Q!=null&&k(i,E,Q,I))}switch(f){case"input":me(i),tt(i,y,!1);break;case"textarea":me(i),Mt(i);break;case"option":y.value!=null&&i.setAttribute("value",""+ee(y.value));break;case"select":i.multiple=!!y.multiple,E=y.value,E!=null?xt(i,!!y.multiple,E,!1):y.defaultValue!=null&&xt(i,!!y.multiple,y.defaultValue,!0);break;default:typeof _.onClick=="function"&&(i.onclick=xc)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Rt(l),null;case 6:if(i&&l.stateNode!=null)FS(i,l,i.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(f=Ls(ma.current),Ls(Jn.current),Cc(l)){if(y=l.stateNode,f=l.memoizedProps,y[Qn]=l,(E=y.nodeValue!==f)&&(i=sn,i!==null))switch(i.tag){case 3:vc(y.nodeValue,f,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&vc(y.nodeValue,f,(i.mode&1)!==0)}E&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[Qn]=l,l.stateNode=y}return Rt(l),null;case 13:if(Ge(rt),y=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Xe&&on!==null&&(l.mode&1)!==0&&(l.flags&128)===0)V1(),Mi(),l.flags|=98560,E=!1;else if(E=Cc(l),y!==null&&y.dehydrated!==null){if(i===null){if(!E)throw Error(n(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Qn]=l}else Mi(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Rt(l),E=!1}else An!==null&&(np(An),An=null),E=!0;if(!E)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(rt.current&1)!==0?bt===0&&(bt=3):ip())),l.updateQueue!==null&&(l.flags|=4),Rt(l),null);case 4:return Di(),Hh(i,l),i===null&&la(l.stateNode.containerInfo),Rt(l),null;case 10:return xh(l.type._context),Rt(l),null;case 17:return Wt(l.type)&&bc(),Rt(l),null;case 19:if(Ge(rt),E=l.memoizedState,E===null)return Rt(l),null;if(y=(l.flags&128)!==0,I=E.rendering,I===null)if(y)wa(E,!1);else{if(bt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(I=Ic(i),I!==null){for(l.flags|=128,wa(E,!1),y=I.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)E=f,i=y,E.flags&=14680066,I=E.alternate,I===null?(E.childLanes=0,E.lanes=i,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=I.childLanes,E.lanes=I.lanes,E.child=I.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=I.memoizedProps,E.memoizedState=I.memoizedState,E.updateQueue=I.updateQueue,E.type=I.type,i=I.dependencies,E.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),f=f.sibling;return Ue(rt,rt.current&1|2),l.child}i=i.sibling}E.tail!==null&&nt()>Bi&&(l.flags|=128,y=!0,wa(E,!1),l.lanes=4194304)}else{if(!y)if(i=Ic(I),i!==null){if(l.flags|=128,y=!0,f=i.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),wa(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!Xe)return Rt(l),null}else 2*nt()-E.renderingStartTime>Bi&&f!==1073741824&&(l.flags|=128,y=!0,wa(E,!1),l.lanes=4194304);E.isBackwards?(I.sibling=l.child,l.child=I):(f=E.last,f!==null?f.sibling=I:l.child=I,E.last=I)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=nt(),l.sibling=null,f=rt.current,Ue(rt,y?f&1|2:f&1),l):(Rt(l),null);case 22:case 23:return sp(),y=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(an&1073741824)!==0&&(Rt(l),l.subtreeFlags&6&&(l.flags|=8192)):Rt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function XL(i,l){switch(hh(l),l.tag){case 1:return Wt(l.type)&&bc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Di(),Ge(Ht),Ge(jt),Ch(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return kh(l),null;case 13:if(Ge(rt),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Mi()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Ge(rt),null;case 4:return Di(),null;case 10:return xh(l.type._context),null;case 22:case 23:return sp(),null;case 24:return null;default:return null}}var Bc=!1,Tt=!1,QL=typeof WeakSet=="function"?WeakSet:Set,ve=null;function qi(i,l){var f=i.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){at(i,l,y)}else f.current=null}function Wh(i,l,f){try{f()}catch(y){at(i,l,y)}}var BS=!1;function JL(i,l){if(sh=ac,i=x1(),Xf(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var _=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var I=0,H=-1,Q=-1,se=0,le=0,ce=i,ae=null;t:for(;;){for(var ge;ce!==f||_!==0&&ce.nodeType!==3||(H=I+_),ce!==E||y!==0&&ce.nodeType!==3||(Q=I+y),ce.nodeType===3&&(I+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)ae=ce,ce=ge;for(;;){if(ce===i)break t;if(ae===f&&++se===_&&(H=I),ae===E&&++le===y&&(Q=I),(ge=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=ge}f=H===-1||Q===-1?null:{start:H,end:Q}}else f=null}f=f||{start:0,end:0}}else f=null;for(ih={focusedElem:i,selectionRange:f},ac=!1,ve=l;ve!==null;)if(l=ve,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ve=i;else for(;ve!==null;){l=ve;try{var we=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,ct=we.memoizedState,ne=l.stateNode,Z=ne.getSnapshotBeforeUpdate(l.elementType===l.type?Se:Rn(l.type,Se),ct);ne.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var re=l.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){at(l,l.return,de)}if(i=l.sibling,i!==null){i.return=l.return,ve=i;break}ve=l.return}return we=BS,BS=!1,we}function ba(i,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var _=y=y.next;do{if((_.tag&i)===i){var E=_.destroy;_.destroy=void 0,E!==void 0&&Wh(l,f,E)}_=_.next}while(_!==y)}}function zc(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&i)===i){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function Kh(i){var l=i.ref;if(l!==null){var f=i.stateNode;switch(i.tag){case 5:i=f;break;default:i=f}typeof l=="function"?l(i):l.current=i}}function zS(i){var l=i.alternate;l!==null&&(i.alternate=null,zS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Qn],delete l[ua],delete l[ch],delete l[OL],delete l[PL])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function VS(i){return i.tag===5||i.tag===3||i.tag===4}function US(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||VS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Gh(i,l,f){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(i,l):f.insertBefore(i,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(i,f)):(l=f,l.appendChild(i)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=xc));else if(y!==4&&(i=i.child,i!==null))for(Gh(i,l,f),i=i.sibling;i!==null;)Gh(i,l,f),i=i.sibling}function Yh(i,l,f){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?f.insertBefore(i,l):f.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(Yh(i,l,f),i=i.sibling;i!==null;)Yh(i,l,f),i=i.sibling}var Nt=null,Tn=!1;function ts(i,l,f){for(f=f.child;f!==null;)HS(i,l,f),f=f.sibling}function HS(i,l,f){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(As,f)}catch{}switch(f.tag){case 5:Tt||qi(f,l);case 6:var y=Nt,_=Tn;Nt=null,ts(i,l,f),Nt=y,Tn=_,Nt!==null&&(Tn?(i=Nt,f=f.stateNode,i.nodeType===8?i.parentNode.removeChild(f):i.removeChild(f)):Nt.removeChild(f.stateNode));break;case 18:Nt!==null&&(Tn?(i=Nt,f=f.stateNode,i.nodeType===8?lh(i.parentNode,f):i.nodeType===1&&lh(i,f),Zo(i)):lh(Nt,f.stateNode));break;case 4:y=Nt,_=Tn,Nt=f.stateNode.containerInfo,Tn=!0,ts(i,l,f),Nt=y,Tn=_;break;case 0:case 11:case 14:case 15:if(!Tt&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){_=y=y.next;do{var E=_,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&Wh(f,l,I),_=_.next}while(_!==y)}ts(i,l,f);break;case 1:if(!Tt&&(qi(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(H){at(f,l,H)}ts(i,l,f);break;case 21:ts(i,l,f);break;case 22:f.mode&1?(Tt=(y=Tt)||f.memoizedState!==null,ts(i,l,f),Tt=y):ts(i,l,f);break;default:ts(i,l,f)}}function WS(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var f=i.stateNode;f===null&&(f=i.stateNode=new QL),l.forEach(function(y){var _=a3.bind(null,i,y);f.has(y)||(f.add(y),y.then(_,_))})}}function In(i,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var _=f[y];try{var E=i,I=l,H=I;e:for(;H!==null;){switch(H.tag){case 5:Nt=H.stateNode,Tn=!1;break e;case 3:Nt=H.stateNode.containerInfo,Tn=!0;break e;case 4:Nt=H.stateNode.containerInfo,Tn=!0;break e}H=H.return}if(Nt===null)throw Error(n(160));HS(E,I,_),Nt=null,Tn=!1;var Q=_.alternate;Q!==null&&(Q.return=null),_.return=null}catch(se){at(_,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)KS(l,i),l=l.sibling}function KS(i,l){var f=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(In(l,i),er(i),y&4){try{ba(3,i,i.return),zc(3,i)}catch(Se){at(i,i.return,Se)}try{ba(5,i,i.return)}catch(Se){at(i,i.return,Se)}}break;case 1:In(l,i),er(i),y&512&&f!==null&&qi(f,f.return);break;case 5:if(In(l,i),er(i),y&512&&f!==null&&qi(f,f.return),i.flags&32){var _=i.stateNode;try{Ve(_,"")}catch(Se){at(i,i.return,Se)}}if(y&4&&(_=i.stateNode,_!=null)){var E=i.memoizedProps,I=f!==null?f.memoizedProps:E,H=i.type,Q=i.updateQueue;if(i.updateQueue=null,Q!==null)try{H==="input"&&E.type==="radio"&&E.name!=null&&Ce(_,E),tn(H,I);var se=tn(H,E);for(I=0;I<Q.length;I+=2){var le=Q[I],ce=Q[I+1];le==="style"?Pt(_,ce):le==="dangerouslySetInnerHTML"?ot(_,ce):le==="children"?Ve(_,ce):k(_,le,ce,se)}switch(H){case"input":Ne(_,E);break;case"textarea":It(_,E);break;case"select":var ae=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!E.multiple;var ge=E.value;ge!=null?xt(_,!!E.multiple,ge,!1):ae!==!!E.multiple&&(E.defaultValue!=null?xt(_,!!E.multiple,E.defaultValue,!0):xt(_,!!E.multiple,E.multiple?[]:"",!1))}_[ua]=E}catch(Se){at(i,i.return,Se)}}break;case 6:if(In(l,i),er(i),y&4){if(i.stateNode===null)throw Error(n(162));_=i.stateNode,E=i.memoizedProps;try{_.nodeValue=E}catch(Se){at(i,i.return,Se)}}break;case 3:if(In(l,i),er(i),y&4&&f!==null&&f.memoizedState.isDehydrated)try{Zo(l.containerInfo)}catch(Se){at(i,i.return,Se)}break;case 4:In(l,i),er(i);break;case 13:In(l,i),er(i),_=i.child,_.flags&8192&&(E=_.memoizedState!==null,_.stateNode.isHidden=E,!E||_.alternate!==null&&_.alternate.memoizedState!==null||(Jh=nt())),y&4&&WS(i);break;case 22:if(le=f!==null&&f.memoizedState!==null,i.mode&1?(Tt=(se=Tt)||le,In(l,i),Tt=se):In(l,i),er(i),y&8192){if(se=i.memoizedState!==null,(i.stateNode.isHidden=se)&&!le&&(i.mode&1)!==0)for(ve=i,le=i.child;le!==null;){for(ce=ve=le;ve!==null;){switch(ae=ve,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:ba(4,ae,ae.return);break;case 1:qi(ae,ae.return);var we=ae.stateNode;if(typeof we.componentWillUnmount=="function"){y=ae,f=ae.return;try{l=y,we.props=l.memoizedProps,we.state=l.memoizedState,we.componentWillUnmount()}catch(Se){at(y,f,Se)}}break;case 5:qi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){XS(ce);continue}}ge!==null?(ge.return=ae,ve=ge):XS(ce)}le=le.sibling}e:for(le=null,ce=i;;){if(ce.tag===5){if(le===null){le=ce;try{_=ce.stateNode,se?(E=_.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(H=ce.stateNode,Q=ce.memoizedProps.style,I=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,H.style.display=Ot("display",I))}catch(Se){at(i,i.return,Se)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=se?"":ce.memoizedProps}catch(Se){at(i,i.return,Se)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===i)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===i)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===i)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:In(l,i),er(i),y&4&&WS(i);break;case 21:break;default:In(l,i),er(i)}}function er(i){var l=i.flags;if(l&2){try{e:{for(var f=i.return;f!==null;){if(VS(f)){var y=f;break e}f=f.return}throw Error(n(160))}switch(y.tag){case 5:var _=y.stateNode;y.flags&32&&(Ve(_,""),y.flags&=-33);var E=US(i);Yh(i,E,_);break;case 3:case 4:var I=y.stateNode.containerInfo,H=US(i);Gh(i,H,I);break;default:throw Error(n(161))}}catch(Q){at(i,i.return,Q)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function ZL(i,l,f){ve=i,GS(i)}function GS(i,l,f){for(var y=(i.mode&1)!==0;ve!==null;){var _=ve,E=_.child;if(_.tag===22&&y){var I=_.memoizedState!==null||Bc;if(!I){var H=_.alternate,Q=H!==null&&H.memoizedState!==null||Tt;H=Bc;var se=Tt;if(Bc=I,(Tt=Q)&&!se)for(ve=_;ve!==null;)I=ve,Q=I.child,I.tag===22&&I.memoizedState!==null?QS(_):Q!==null?(Q.return=I,ve=Q):QS(_);for(;E!==null;)ve=E,GS(E),E=E.sibling;ve=_,Bc=H,Tt=se}YS(i)}else(_.subtreeFlags&8772)!==0&&E!==null?(E.return=_,ve=E):YS(i)}}function YS(i){for(;ve!==null;){var l=ve;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Tt||zc(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Tt)if(f===null)y.componentDidMount();else{var _=l.elementType===l.type?f.memoizedProps:Rn(l.type,f.memoizedProps);y.componentDidUpdate(_,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var E=l.updateQueue;E!==null&&X1(l,E,y);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}X1(l,I,f)}break;case 5:var H=l.stateNode;if(f===null&&l.flags&4){f=H;var Q=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&f.focus();break;case"img":Q.src&&(f.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var le=se.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&Zo(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Tt||l.flags&512&&Kh(l)}catch(ae){at(l,l.return,ae)}}if(l===i){ve=null;break}if(f=l.sibling,f!==null){f.return=l.return,ve=f;break}ve=l.return}}function XS(i){for(;ve!==null;){var l=ve;if(l===i){ve=null;break}var f=l.sibling;if(f!==null){f.return=l.return,ve=f;break}ve=l.return}}function QS(i){for(;ve!==null;){var l=ve;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{zc(4,l)}catch(Q){at(l,f,Q)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var _=l.return;try{y.componentDidMount()}catch(Q){at(l,_,Q)}}var E=l.return;try{Kh(l)}catch(Q){at(l,E,Q)}break;case 5:var I=l.return;try{Kh(l)}catch(Q){at(l,I,Q)}}}catch(Q){at(l,l.return,Q)}if(l===i){ve=null;break}var H=l.sibling;if(H!==null){H.return=l.return,ve=H;break}ve=l.return}}var e3=Math.ceil,Vc=C.ReactCurrentDispatcher,Xh=C.ReactCurrentOwner,xn=C.ReactCurrentBatchConfig,$e=0,_t=null,ht=null,Ct=0,an=0,Fi=Xr(0),bt=0,Sa=null,$s=0,Uc=0,Qh=0,_a=null,Gt=null,Jh=0,Bi=1/0,kr=null,Hc=!1,Zh=null,ns=null,Wc=!1,rs=null,Kc=0,ka=0,ep=null,Gc=-1,Yc=0;function $t(){return($e&6)!==0?nt():Gc!==-1?Gc:Gc=nt()}function ss(i){return(i.mode&1)===0?1:($e&2)!==0&&Ct!==0?Ct&-Ct:DL.transition!==null?(Yc===0&&(Yc=wi()),Yc):(i=ze,i!==0||(i=window.event,i=i===void 0?16:Zb(i.type)),i)}function Mn(i,l,f,y){if(50<ka)throw ka=0,ep=null,Error(n(185));Rs(i,f,y),(($e&2)===0||i!==_t)&&(i===_t&&(($e&2)===0&&(Uc|=f),bt===4&&is(i,Ct)),Yt(i,y),f===1&&$e===0&&(l.mode&1)===0&&(Bi=nt()+500,_c&&Jr()))}function Yt(i,l){var f=i.callbackNode;Pf(i,l);var y=xi(i,i===_t?Ct:0);if(y===0)f!==null&&Zl(f),i.callbackNode=null,i.callbackPriority=0;else if(l=y&-y,i.callbackPriority!==l){if(f!=null&&Zl(f),l===1)i.tag===0?LL(ZS.bind(null,i)):$1(ZS.bind(null,i)),IL(function(){($e&6)===0&&Jr()}),f=null;else{switch(Hb(y)){case 1:f=Wo;break;case 4:f=tc;break;case 16:f=gi;break;case 536870912:f=nc;break;default:f=gi}f=a_(f,JS.bind(null,i))}i.callbackPriority=l,i.callbackNode=f}}function JS(i,l){if(Gc=-1,Yc=0,($e&6)!==0)throw Error(n(327));var f=i.callbackNode;if(zi()&&i.callbackNode!==f)return null;var y=xi(i,i===_t?Ct:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||l)l=Xc(i,y);else{l=y;var _=$e;$e|=2;var E=t_();(_t!==i||Ct!==l)&&(kr=null,Bi=nt()+500,Fs(i,l));do try{r3();break}catch(H){e_(i,H)}while(!0);vh(),Vc.current=E,$e=_,ht!==null?l=0:(_t=null,Ct=0,l=bt)}if(l!==0){if(l===2&&(_=Ko(i),_!==0&&(y=_,l=tp(i,_))),l===1)throw f=Sa,Fs(i,0),is(i,y),Yt(i,nt()),f;if(l===6)is(i,y);else{if(_=i.current.alternate,(y&30)===0&&!t3(_)&&(l=Xc(i,y),l===2&&(E=Ko(i),E!==0&&(y=E,l=tp(i,E))),l===1))throw f=Sa,Fs(i,0),is(i,y),Yt(i,nt()),f;switch(i.finishedWork=_,i.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Bs(i,Gt,kr);break;case 3:if(is(i,y),(y&130023424)===y&&(l=Jh+500-nt(),10<l)){if(xi(i,0)!==0)break;if(_=i.suspendedLanes,(_&y)!==y){$t(),i.pingedLanes|=i.suspendedLanes&_;break}i.timeoutHandle=ah(Bs.bind(null,i,Gt,kr),l);break}Bs(i,Gt,kr);break;case 4:if(is(i,y),(y&4194240)===y)break;for(l=i.eventTimes,_=-1;0<y;){var I=31-nn(y);E=1<<I,I=l[I],I>_&&(_=I),y&=~E}if(y=_,y=nt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*e3(y/1960))-y,10<y){i.timeoutHandle=ah(Bs.bind(null,i,Gt,kr),y);break}Bs(i,Gt,kr);break;case 5:Bs(i,Gt,kr);break;default:throw Error(n(329))}}}return Yt(i,nt()),i.callbackNode===f?JS.bind(null,i):null}function tp(i,l){var f=_a;return i.current.memoizedState.isDehydrated&&(Fs(i,l).flags|=256),i=Xc(i,l),i!==2&&(l=Gt,Gt=f,l!==null&&np(l)),i}function np(i){Gt===null?Gt=i:Gt.push.apply(Gt,i)}function t3(i){for(var l=i;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var _=f[y],E=_.getSnapshot;_=_.value;try{if(!jn(E(),_))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function is(i,l){for(l&=~Qh,l&=~Uc,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var f=31-nn(l),y=1<<f;i[f]=-1,l&=~y}}function ZS(i){if(($e&6)!==0)throw Error(n(327));zi();var l=xi(i,0);if((l&1)===0)return Yt(i,nt()),null;var f=Xc(i,l);if(i.tag!==0&&f===2){var y=Ko(i);y!==0&&(l=y,f=tp(i,y))}if(f===1)throw f=Sa,Fs(i,0),is(i,l),Yt(i,nt()),f;if(f===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Bs(i,Gt,kr),Yt(i,nt()),null}function rp(i,l){var f=$e;$e|=1;try{return i(l)}finally{$e=f,$e===0&&(Bi=nt()+500,_c&&Jr())}}function qs(i){rs!==null&&rs.tag===0&&($e&6)===0&&zi();var l=$e;$e|=1;var f=xn.transition,y=ze;try{if(xn.transition=null,ze=1,i)return i()}finally{ze=y,xn.transition=f,$e=l,($e&6)===0&&Jr()}}function sp(){an=Fi.current,Ge(Fi)}function Fs(i,l){i.finishedWork=null,i.finishedLanes=0;var f=i.timeoutHandle;if(f!==-1&&(i.timeoutHandle=-1,TL(f)),ht!==null)for(f=ht.return;f!==null;){var y=f;switch(hh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&bc();break;case 3:Di(),Ge(Ht),Ge(jt),Ch();break;case 5:kh(y);break;case 4:Di();break;case 13:Ge(rt);break;case 19:Ge(rt);break;case 10:xh(y.type._context);break;case 22:case 23:sp()}f=f.return}if(_t=i,ht=i=os(i.current,null),Ct=an=l,bt=0,Sa=null,Qh=Uc=$s=0,Gt=_a=null,Ps!==null){for(l=0;l<Ps.length;l++)if(f=Ps[l],y=f.interleaved,y!==null){f.interleaved=null;var _=y.next,E=f.pending;if(E!==null){var I=E.next;E.next=_,y.next=I}f.pending=y}Ps=null}return i}function e_(i,l){do{var f=ht;try{if(vh(),Mc.current=Dc,Oc){for(var y=st.memoizedState;y!==null;){var _=y.queue;_!==null&&(_.pending=null),y=y.next}Oc=!1}if(Ds=0,St=wt=st=null,ga=!1,ya=0,Xh.current=null,f===null||f.return===null){bt=1,Sa=l,ht=null;break}e:{var E=i,I=f.return,H=f,Q=l;if(l=Ct,H.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var se=Q,le=H,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var ge=NS(I);if(ge!==null){ge.flags&=-257,CS(ge,I,H,E,l),ge.mode&1&&kS(E,se,l),l=ge,Q=se;var we=l.updateQueue;if(we===null){var Se=new Set;Se.add(Q),l.updateQueue=Se}else we.add(Q);break e}else{if((l&1)===0){kS(E,se,l),ip();break e}Q=Error(n(426))}}else if(Xe&&H.mode&1){var ct=NS(I);if(ct!==null){(ct.flags&65536)===0&&(ct.flags|=256),CS(ct,I,H,E,l),gh($i(Q,H));break e}}E=Q=$i(Q,H),bt!==4&&(bt=2),_a===null?_a=[E]:_a.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ne=SS(E,Q,l);Y1(E,ne);break e;case 1:H=Q;var Z=E.type,re=E.stateNode;if((E.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(ns===null||!ns.has(re)))){E.flags|=65536,l&=-l,E.lanes|=l;var de=_S(E,H,l);Y1(E,de);break e}}E=E.return}while(E!==null)}r_(f)}catch(ke){l=ke,ht===f&&f!==null&&(ht=f=f.return);continue}break}while(!0)}function t_(){var i=Vc.current;return Vc.current=Dc,i===null?Dc:i}function ip(){(bt===0||bt===3||bt===2)&&(bt=4),_t===null||($s&268435455)===0&&(Uc&268435455)===0||is(_t,Ct)}function Xc(i,l){var f=$e;$e|=2;var y=t_();(_t!==i||Ct!==l)&&(kr=null,Fs(i,l));do try{n3();break}catch(_){e_(i,_)}while(!0);if(vh(),$e=f,Vc.current=y,ht!==null)throw Error(n(261));return _t=null,Ct=0,bt}function n3(){for(;ht!==null;)n_(ht)}function r3(){for(;ht!==null&&!jf();)n_(ht)}function n_(i){var l=o_(i.alternate,i,an);i.memoizedProps=i.pendingProps,l===null?r_(i):ht=l,Xh.current=null}function r_(i){var l=i;do{var f=l.alternate;if(i=l.return,(l.flags&32768)===0){if(f=YL(f,l,an),f!==null){ht=f;return}}else{if(f=XL(f,l),f!==null){f.flags&=32767,ht=f;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{bt=6,ht=null;return}}if(l=l.sibling,l!==null){ht=l;return}ht=l=i}while(l!==null);bt===0&&(bt=5)}function Bs(i,l,f){var y=ze,_=xn.transition;try{xn.transition=null,ze=1,s3(i,l,f,y)}finally{xn.transition=_,ze=y}return null}function s3(i,l,f,y){do zi();while(rs!==null);if(($e&6)!==0)throw Error(n(327));f=i.finishedWork;var _=i.finishedLanes;if(f===null)return null;if(i.finishedWork=null,i.finishedLanes=0,f===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var E=f.lanes|f.childLanes;if(sc(i,E),i===_t&&(ht=_t=null,Ct=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Wc||(Wc=!0,a_(gi,function(){return zi(),null})),E=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||E){E=xn.transition,xn.transition=null;var I=ze;ze=1;var H=$e;$e|=4,Xh.current=null,JL(i,f),KS(f,i),kL(ih),ac=!!sh,ih=sh=null,i.current=f,ZL(f),ec(),$e=H,ze=I,xn.transition=E}else i.current=f;if(Wc&&(Wc=!1,rs=i,Kc=_),E=i.pendingLanes,E===0&&(ns=null),Tf(f.stateNode),Yt(i,nt()),l!==null)for(y=i.onRecoverableError,f=0;f<l.length;f++)_=l[f],y(_.value,{componentStack:_.stack,digest:_.digest});if(Hc)throw Hc=!1,i=Zh,Zh=null,i;return(Kc&1)!==0&&i.tag!==0&&zi(),E=i.pendingLanes,(E&1)!==0?i===ep?ka++:(ka=0,ep=i):ka=0,Jr(),null}function zi(){if(rs!==null){var i=Hb(Kc),l=xn.transition,f=ze;try{if(xn.transition=null,ze=16>i?16:i,rs===null)var y=!1;else{if(i=rs,rs=null,Kc=0,($e&6)!==0)throw Error(n(331));var _=$e;for($e|=4,ve=i.current;ve!==null;){var E=ve,I=E.child;if((ve.flags&16)!==0){var H=E.deletions;if(H!==null){for(var Q=0;Q<H.length;Q++){var se=H[Q];for(ve=se;ve!==null;){var le=ve;switch(le.tag){case 0:case 11:case 15:ba(8,le,E)}var ce=le.child;if(ce!==null)ce.return=le,ve=ce;else for(;ve!==null;){le=ve;var ae=le.sibling,ge=le.return;if(zS(le),le===se){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var we=E.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var ct=Se.sibling;Se.sibling=null,Se=ct}while(Se!==null)}}ve=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,ve=I;else e:for(;ve!==null;){if(E=ve,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:ba(9,E,E.return)}var ne=E.sibling;if(ne!==null){ne.return=E.return,ve=ne;break e}ve=E.return}}var Z=i.current;for(ve=Z;ve!==null;){I=ve;var re=I.child;if((I.subtreeFlags&2064)!==0&&re!==null)re.return=I,ve=re;else e:for(I=Z;ve!==null;){if(H=ve,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:zc(9,H)}}catch(ke){at(H,H.return,ke)}if(H===I){ve=null;break e}var de=H.sibling;if(de!==null){de.return=H.return,ve=de;break e}ve=H.return}}if($e=_,Jr(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(As,i)}catch{}y=!0}return y}finally{ze=f,xn.transition=l}}return!1}function s_(i,l,f){l=$i(f,l),l=SS(i,l,1),i=es(i,l,1),l=$t(),i!==null&&(Rs(i,1,l),Yt(i,l))}function at(i,l,f){if(i.tag===3)s_(i,i,f);else for(;l!==null;){if(l.tag===3){s_(l,i,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ns===null||!ns.has(y))){i=$i(f,i),i=_S(l,i,1),l=es(l,i,1),i=$t(),l!==null&&(Rs(l,1,i),Yt(l,i));break}}l=l.return}}function i3(i,l,f){var y=i.pingCache;y!==null&&y.delete(l),l=$t(),i.pingedLanes|=i.suspendedLanes&f,_t===i&&(Ct&f)===f&&(bt===4||bt===3&&(Ct&130023424)===Ct&&500>nt()-Jh?Fs(i,0):Qh|=f),Yt(i,l)}function i_(i,l){l===0&&((i.mode&1)===0?l=1:(l=vi,vi<<=1,(vi&130023424)===0&&(vi=4194304)));var f=$t();i=br(i,l),i!==null&&(Rs(i,l,f),Yt(i,f))}function o3(i){var l=i.memoizedState,f=0;l!==null&&(f=l.retryLane),i_(i,f)}function a3(i,l){var f=0;switch(i.tag){case 13:var y=i.stateNode,_=i.memoizedState;_!==null&&(f=_.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),i_(i,f)}var o_;o_=function(i,l,f){if(i!==null)if(i.memoizedProps!==l.pendingProps||Ht.current)Kt=!0;else{if((i.lanes&f)===0&&(l.flags&128)===0)return Kt=!1,GL(i,l,f);Kt=(i.flags&131072)!==0}else Kt=!1,Xe&&(l.flags&1048576)!==0&&q1(l,Nc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Fc(i,l),i=l.pendingProps;var _=Ri(l,jt.current);Li(l,f),_=Ah(null,l,y,i,_,f);var E=Rh();return l.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Wt(y)?(E=!0,Sc(l)):E=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Sh(l),_.updater=$c,l.stateNode=_,_._reactInternals=l,Lh(l,y,i,f),l=Fh(null,l,y,!0,E,f)):(l.tag=0,Xe&&E&&fh(l),Dt(null,l,_,f),l=l.child),l;case 16:y=l.elementType;e:{switch(Fc(i,l),i=l.pendingProps,_=y._init,y=_(y._payload),l.type=y,_=l.tag=c3(y),i=Rn(y,i),_){case 0:l=qh(null,l,y,i,f);break e;case 1:l=IS(null,l,y,i,f);break e;case 11:l=ES(null,l,y,i,f);break e;case 14:l=jS(null,l,y,Rn(y.type,i),f);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Rn(y,_),qh(i,l,y,_,f);case 1:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Rn(y,_),IS(i,l,y,_,f);case 3:e:{if(MS(l),i===null)throw Error(n(387));y=l.pendingProps,E=l.memoizedState,_=E.element,G1(i,l),Tc(l,y,null,f);var I=l.memoizedState;if(y=I.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){_=$i(Error(n(423)),l),l=OS(i,l,y,f,_);break e}else if(y!==_){_=$i(Error(n(424)),l),l=OS(i,l,y,f,_);break e}else for(on=Yr(l.stateNode.containerInfo.firstChild),sn=l,Xe=!0,An=null,f=W1(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Mi(),y===_){l=_r(i,l,f);break e}Dt(i,l,y,f)}l=l.child}return l;case 5:return Q1(l),i===null&&mh(l),y=l.type,_=l.pendingProps,E=i!==null?i.memoizedProps:null,I=_.children,oh(y,_)?I=null:E!==null&&oh(y,E)&&(l.flags|=32),TS(i,l),Dt(i,l,I,f),l.child;case 6:return i===null&&mh(l),null;case 13:return PS(i,l,f);case 4:return _h(l,l.stateNode.containerInfo),y=l.pendingProps,i===null?l.child=Oi(l,null,y,f):Dt(i,l,y,f),l.child;case 11:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Rn(y,_),ES(i,l,y,_,f);case 7:return Dt(i,l,l.pendingProps,f),l.child;case 8:return Dt(i,l,l.pendingProps.children,f),l.child;case 12:return Dt(i,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,_=l.pendingProps,E=l.memoizedProps,I=_.value,Ue(jc,y._currentValue),y._currentValue=I,E!==null)if(jn(E.value,I)){if(E.children===_.children&&!Ht.current){l=_r(i,l,f);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var H=E.dependencies;if(H!==null){I=E.child;for(var Q=H.firstContext;Q!==null;){if(Q.context===y){if(E.tag===1){Q=Sr(-1,f&-f),Q.tag=2;var se=E.updateQueue;if(se!==null){se=se.shared;var le=se.pending;le===null?Q.next=Q:(Q.next=le.next,le.next=Q),se.pending=Q}}E.lanes|=f,Q=E.alternate,Q!==null&&(Q.lanes|=f),wh(E.return,f,l),H.lanes|=f;break}Q=Q.next}}else if(E.tag===10)I=E.type===l.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=f,H=I.alternate,H!==null&&(H.lanes|=f),wh(I,f,l),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===l){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}Dt(i,l,_.children,f),l=l.child}return l;case 9:return _=l.type,y=l.pendingProps.children,Li(l,f),_=yn(_),y=y(_),l.flags|=1,Dt(i,l,y,f),l.child;case 14:return y=l.type,_=Rn(y,l.pendingProps),_=Rn(y.type,_),jS(i,l,y,_,f);case 15:return AS(i,l,l.type,l.pendingProps,f);case 17:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Rn(y,_),Fc(i,l),l.tag=1,Wt(y)?(i=!0,Sc(l)):i=!1,Li(l,f),wS(l,y,_),Lh(l,y,_,f),Fh(null,l,y,!0,i,f);case 19:return DS(i,l,f);case 22:return RS(i,l,f)}throw Error(n(156,l.tag))};function a_(i,l){return Jl(i,l)}function l3(i,l,f,y){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(i,l,f,y){return new l3(i,l,f,y)}function op(i){return i=i.prototype,!(!i||!i.isReactComponent)}function c3(i){if(typeof i=="function")return op(i)?1:0;if(i!=null){if(i=i.$$typeof,i===$)return 11;if(i===z)return 14}return 2}function os(i,l){var f=i.alternate;return f===null?(f=wn(i.tag,l,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=l,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&14680064,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,l=i.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f}function Qc(i,l,f,y,_,E){var I=2;if(y=i,typeof i=="function")op(i)&&(I=1);else if(typeof i=="string")I=5;else e:switch(i){case T:return zs(f.children,_,E,l);case M:I=8,_|=8;break;case P:return i=wn(12,f,l,_|2),i.elementType=P,i.lanes=E,i;case U:return i=wn(13,f,l,_),i.elementType=U,i.lanes=E,i;case D:return i=wn(19,f,l,_),i.elementType=D,i.lanes=E,i;case Y:return Jc(f,_,E,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:I=10;break e;case O:I=9;break e;case $:I=11;break e;case z:I=14;break e;case V:I=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=wn(I,f,l,_),l.elementType=i,l.type=y,l.lanes=E,l}function zs(i,l,f,y){return i=wn(7,i,y,l),i.lanes=f,i}function Jc(i,l,f,y){return i=wn(22,i,y,l),i.elementType=Y,i.lanes=f,i.stateNode={isHidden:!1},i}function ap(i,l,f){return i=wn(6,i,null,l),i.lanes=f,i}function lp(i,l,f){return l=wn(4,i.children!==null?i.children:[],i.key,l),l.lanes=f,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function u3(i,l,f,y,_){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Go(0),this.expirationTimes=Go(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.identifierPrefix=y,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function cp(i,l,f,y,_,E,I,H,Q){return i=new u3(i,l,f,H,Q),l===1?(l=1,E===!0&&(l|=8)):l=0,E=wn(3,null,null,l),i.current=E,E.stateNode=i,E.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sh(E),i}function d3(i,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:y==null?null:""+y,children:i,containerInfo:l,implementation:f}}function l_(i){if(!i)return Qr;i=i._reactInternals;e:{if(Yn(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Wt(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var f=i.type;if(Wt(f))return L1(i,f,l)}return l}function c_(i,l,f,y,_,E,I,H,Q){return i=cp(f,y,!0,i,_,E,I,H,Q),i.context=l_(null),f=i.current,y=$t(),_=ss(f),E=Sr(y,_),E.callback=l??null,es(f,E,_),i.current.lanes=_,Rs(i,_,y),Yt(i,y),i}function Zc(i,l,f,y){var _=l.current,E=$t(),I=ss(_);return f=l_(f),l.context===null?l.context=f:l.pendingContext=f,l=Sr(E,I),l.payload={element:i},y=y===void 0?null:y,y!==null&&(l.callback=y),i=es(_,l,I),i!==null&&(Mn(i,_,I,E),Rc(i,_,I)),I}function eu(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function u_(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<l?f:l}}function up(i,l){u_(i,l),(i=i.alternate)&&u_(i,l)}function f3(){return null}var d_=typeof reportError=="function"?reportError:function(i){console.error(i)};function dp(i){this._internalRoot=i}tu.prototype.render=dp.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));Zc(i,l,null,null)},tu.prototype.unmount=dp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;qs(function(){Zc(null,i,null,null)}),l[yr]=null}};function tu(i){this._internalRoot=i}tu.prototype.unstable_scheduleHydration=function(i){if(i){var l=Gb();i={blockedOn:null,target:i,priority:l};for(var f=0;f<Wr.length&&l!==0&&l<Wr[f].priority;f++);Wr.splice(f,0,i),f===0&&Qb(i)}};function fp(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function nu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function f_(){}function h3(i,l,f,y,_){if(_){if(typeof y=="function"){var E=y;y=function(){var se=eu(I);E.call(se)}}var I=c_(l,y,i,0,null,!1,!1,"",f_);return i._reactRootContainer=I,i[yr]=I.current,la(i.nodeType===8?i.parentNode:i),qs(),I}for(;_=i.lastChild;)i.removeChild(_);if(typeof y=="function"){var H=y;y=function(){var se=eu(Q);H.call(se)}}var Q=cp(i,0,!1,null,null,!1,!1,"",f_);return i._reactRootContainer=Q,i[yr]=Q.current,la(i.nodeType===8?i.parentNode:i),qs(function(){Zc(l,Q,f,y)}),Q}function ru(i,l,f,y,_){var E=f._reactRootContainer;if(E){var I=E;if(typeof _=="function"){var H=_;_=function(){var Q=eu(I);H.call(Q)}}Zc(l,I,i,_)}else I=h3(f,l,i,_,y);return eu(I)}Wb=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var f=Xn(l.pendingLanes);f!==0&&(Lf(l,f|1),Yt(l,nt()),($e&6)===0&&(Bi=nt()+500,Jr()))}break;case 13:qs(function(){var y=br(i,1);if(y!==null){var _=$t();Mn(y,i,1,_)}}),up(i,1)}},Df=function(i){if(i.tag===13){var l=br(i,134217728);if(l!==null){var f=$t();Mn(l,i,134217728,f)}up(i,134217728)}},Kb=function(i){if(i.tag===13){var l=ss(i),f=br(i,l);if(f!==null){var y=$t();Mn(f,i,l,y)}up(i,l)}},Gb=function(){return ze},Yb=function(i,l){var f=ze;try{return ze=i,l()}finally{ze=f}},Fo=function(i,l,f){switch(l){case"input":if(Ne(i,f),l=f.name,f.type==="radio"&&l!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==i&&y.form===i.form){var _=wc(y);if(!_)throw Error(n(90));ye(y),Ne(y,_)}}}break;case"textarea":It(i,f);break;case"select":l=f.value,l!=null&&xt(i,!!f.multiple,l,!1)}},Kl=rp,Gl=qs;var p3={usingClientEntryPoint:!1,Events:[da,ji,wc,Hl,Wl,rp]},Na={findFiberByHostInstance:Ts,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},m3={bundleType:Na.bundleType,version:Na.version,rendererPackageName:Na.rendererPackageName,rendererConfig:Na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Xl(i),i===null?null:i.stateNode},findFiberByHostInstance:Na.findFiberByHostInstance||f3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!su.isDisabled&&su.supportsFiber)try{As=su.inject(m3),pn=su}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p3,Xt.createPortal=function(i,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fp(l))throw Error(n(200));return d3(i,l,null,f)},Xt.createRoot=function(i,l){if(!fp(i))throw Error(n(299));var f=!1,y="",_=d_;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),l=cp(i,1,!1,null,null,f,!1,y,_),i[yr]=l.current,la(i.nodeType===8?i.parentNode:i),new dp(l)},Xt.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Xl(l),i=i===null?null:i.stateNode,i},Xt.flushSync=function(i){return qs(i)},Xt.hydrate=function(i,l,f){if(!nu(l))throw Error(n(200));return ru(null,i,l,!0,f)},Xt.hydrateRoot=function(i,l,f){if(!fp(i))throw Error(n(405));var y=f!=null&&f.hydratedSources||null,_=!1,E="",I=d_;if(f!=null&&(f.unstable_strictMode===!0&&(_=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=c_(l,null,i,1,f??null,_,!1,E,I),i[yr]=l.current,la(i),y)for(i=0;i<y.length;i++)f=y[i],_=f._getVersion,_=_(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,_]:l.mutableSourceEagerHydrationData.push(f,_);return new tu(l)},Xt.render=function(i,l,f){if(!nu(l))throw Error(n(200));return ru(null,i,l,!1,f)},Xt.unmountComponentAtNode=function(i){if(!nu(i))throw Error(n(40));return i._reactRootContainer?(qs(function(){ru(null,null,i,!1,function(){i._reactRootContainer=null,i[yr]=null})}),!0):!1},Xt.unstable_batchedUpdates=rp,Xt.unstable_renderSubtreeIntoContainer=function(i,l,f,y){if(!nu(f))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return ru(i,l,f,!1,y)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var w_;function uR(){if(w_)return mp.exports;w_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mp.exports=_3(),mp.exports}var b_;function k3(){if(b_)return ou;b_=1;var e=uR();return ou.createRoot=e.createRoot,ou.hydrateRoot=e.hydrateRoot,ou}var N3=k3();const C3=gl(N3);function gt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=gt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var E3={value:()=>{}};function Sd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Mu(n)}function Mu(e){this._=e}function j3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Mu.prototype=Sd.prototype={constructor:Mu,on:function(e,t){var n=this._,r=j3(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=A3(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)n[s]=S_(n[s],e.name,t);else if(t==null)for(s in n)n[s]=S_(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Mu(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function A3(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function S_(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=E3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bx="http://www.w3.org/1999/xhtml";const __={svg:"http://www.w3.org/2000/svg",xhtml:bx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _d(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),__.hasOwnProperty(t)?{space:__[t],local:e}:e}function R3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bx&&t.documentElement.namespaceURI===bx?t.createElement(e):t.createElementNS(n,e)}}function T3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function dR(e){var t=_d(e);return(t.local?T3:R3)(t)}function I3(){}function cw(e){return e==null?I3:function(){return this.querySelector(e)}}function M3(e){typeof e!="function"&&(e=cw(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=new Array(a),u,d,m=0;m<a;++m)(u=o[m])&&(d=e.call(u,u.__data__,m,o))&&("__data__"in u&&(d.__data__=u.__data__),c[m]=d);return new fn(r,this._parents)}function O3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function P3(){return[]}function fR(e){return e==null?P3:function(){return this.querySelectorAll(e)}}function L3(e){return function(){return O3(e.apply(this,arguments))}}function D3(e){typeof e=="function"?e=L3(e):e=fR(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var a=t[o],c=a.length,u,d=0;d<c;++d)(u=a[d])&&(r.push(e.call(u,u.__data__,d,a)),s.push(u));return new fn(r,s)}function hR(e){return function(){return this.matches(e)}}function pR(e){return function(t){return t.matches(e)}}var $3=Array.prototype.find;function q3(e){return function(){return $3.call(this.children,e)}}function F3(){return this.firstElementChild}function B3(e){return this.select(e==null?F3:q3(typeof e=="function"?e:pR(e)))}var z3=Array.prototype.filter;function V3(){return Array.from(this.children)}function U3(e){return function(){return z3.call(this.children,e)}}function H3(e){return this.selectAll(e==null?V3:U3(typeof e=="function"?e:pR(e)))}function W3(e){typeof e!="function"&&(e=hR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,d=0;d<a;++d)(u=o[d])&&e.call(u,u.__data__,d,o)&&c.push(u);return new fn(r,this._parents)}function mR(e){return new Array(e.length)}function K3(){return new fn(this._enter||this._groups.map(mR),this._parents)}function Yu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Yu.prototype={constructor:Yu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function G3(e){return function(){return e}}function Y3(e,t,n,r,s,o){for(var a=0,c,u=t.length,d=o.length;a<d;++a)(c=t[a])?(c.__data__=o[a],r[a]=c):n[a]=new Yu(e,o[a]);for(;a<u;++a)(c=t[a])&&(s[a]=c)}function X3(e,t,n,r,s,o,a){var c,u,d=new Map,m=t.length,p=o.length,g=new Array(m),v;for(c=0;c<m;++c)(u=t[c])&&(g[c]=v=a.call(u,u.__data__,c,t)+"",d.has(v)?s[c]=u:d.set(v,u));for(c=0;c<p;++c)v=a.call(e,o[c],c,o)+"",(u=d.get(v))?(r[c]=u,u.__data__=o[c],d.delete(v)):n[c]=new Yu(e,o[c]);for(c=0;c<m;++c)(u=t[c])&&d.get(g[c])===u&&(s[c]=u)}function Q3(e){return e.__data__}function J3(e,t){if(!arguments.length)return Array.from(this,Q3);var n=t?X3:Y3,r=this._parents,s=this._groups;typeof e!="function"&&(e=G3(e));for(var o=s.length,a=new Array(o),c=new Array(o),u=new Array(o),d=0;d<o;++d){var m=r[d],p=s[d],g=p.length,v=Z3(e.call(m,m&&m.__data__,d,r)),b=v.length,x=c[d]=new Array(b),w=a[d]=new Array(b),S=u[d]=new Array(g);n(m,p,x,w,S,v,t);for(var N=0,k=0,C,j;N<b;++N)if(C=x[N]){for(N>=k&&(k=N+1);!(j=w[k])&&++k<b;);C._next=j||null}}return a=new fn(a,r),a._enter=c,a._exit=u,a}function Z3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function e5(){return new fn(this._exit||this._groups.map(mR),this._parents)}function t5(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function n5(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,a=Math.min(s,o),c=new Array(s),u=0;u<a;++u)for(var d=n[u],m=r[u],p=d.length,g=c[u]=new Array(p),v,b=0;b<p;++b)(v=d[b]||m[b])&&(g[b]=v);for(;u<s;++u)c[u]=n[u];return new fn(c,this._parents)}function r5(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function s5(e){e||(e=i5);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var a=n[o],c=a.length,u=s[o]=new Array(c),d,m=0;m<c;++m)(d=a[m])&&(u[m]=d);u.sort(t)}return new fn(s,this._parents).order()}function i5(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function o5(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a5(){return Array.from(this)}function l5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function c5(){let e=0;for(const t of this)++e;return e}function u5(){return!this.node()}function d5(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,a=s.length,c;o<a;++o)(c=s[o])&&e.call(c,c.__data__,o,s);return this}function f5(e){return function(){this.removeAttribute(e)}}function h5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p5(e,t){return function(){this.setAttribute(e,t)}}function m5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function g5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function y5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function v5(e,t){var n=_d(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?h5:f5:typeof t=="function"?n.local?y5:g5:n.local?m5:p5)(n,t))}function gR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function x5(e){return function(){this.style.removeProperty(e)}}function w5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function b5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function S5(e,t,n){return arguments.length>1?this.each((t==null?x5:typeof t=="function"?b5:w5)(e,t,n??"")):uo(this.node(),e)}function uo(e,t){return e.style.getPropertyValue(t)||gR(e).getComputedStyle(e,null).getPropertyValue(t)}function _5(e){return function(){delete this[e]}}function k5(e,t){return function(){this[e]=t}}function N5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function C5(e,t){return arguments.length>1?this.each((t==null?_5:typeof t=="function"?N5:k5)(e,t)):this.node()[e]}function yR(e){return e.trim().split(/^|\s+/)}function uw(e){return e.classList||new vR(e)}function vR(e){this._node=e,this._names=yR(e.getAttribute("class")||"")}vR.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xR(e,t){for(var n=uw(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function wR(e,t){for(var n=uw(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function E5(e){return function(){xR(this,e)}}function j5(e){return function(){wR(this,e)}}function A5(e,t){return function(){(t.apply(this,arguments)?xR:wR)(this,e)}}function R5(e,t){var n=yR(e+"");if(arguments.length<2){for(var r=uw(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?A5:t?E5:j5)(n,t))}function T5(){this.textContent=""}function I5(e){return function(){this.textContent=e}}function M5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function O5(e){return arguments.length?this.each(e==null?T5:(typeof e=="function"?M5:I5)(e)):this.node().textContent}function P5(){this.innerHTML=""}function L5(e){return function(){this.innerHTML=e}}function D5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $5(e){return arguments.length?this.each(e==null?P5:(typeof e=="function"?D5:L5)(e)):this.node().innerHTML}function q5(){this.nextSibling&&this.parentNode.appendChild(this)}function F5(){return this.each(q5)}function B5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function z5(){return this.each(B5)}function V5(e){var t=typeof e=="function"?e:dR(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function U5(){return null}function H5(e,t){var n=typeof e=="function"?e:dR(e),r=t==null?U5:typeof t=="function"?t:cw(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function W5(){var e=this.parentNode;e&&e.removeChild(this)}function K5(){return this.each(W5)}function G5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X5(e){return this.select(e?Y5:G5)}function Q5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J5(e){return function(t){e.call(this,t,this.__data__)}}function Z5(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function eD(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function tD(e,t,n){return function(){var r=this.__on,s,o=J5(t);if(r){for(var a=0,c=r.length;a<c;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function nD(e,t,n){var r=Z5(e+""),s,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,d=c.length,m;u<d;++u)for(s=0,m=c[u];s<o;++s)if((a=r[s]).type===m.type&&a.name===m.name)return m.value}return}for(c=t?tD:eD,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function bR(e,t,n){var r=gR(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function rD(e,t){return function(){return bR(this,e,t)}}function sD(e,t){return function(){return bR(this,e,t.apply(this,arguments))}}function iD(e,t){return this.each((typeof t=="function"?sD:rD)(e,t))}function*oD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var SR=[null];function fn(e,t){this._groups=e,this._parents=t}function vl(){return new fn([[document.documentElement]],SR)}function aD(){return this}fn.prototype=vl.prototype={constructor:fn,select:M3,selectAll:D3,selectChild:B3,selectChildren:H3,filter:W3,data:J3,enter:K3,exit:e5,join:t5,merge:n5,selection:aD,order:r5,sort:s5,call:o5,nodes:a5,node:l5,size:c5,empty:u5,each:d5,attr:v5,style:S5,property:C5,classed:R5,text:O5,html:$5,raise:F5,lower:z5,append:V5,insert:H5,remove:K5,clone:X5,datum:Q5,on:nD,dispatch:iD,[Symbol.iterator]:oD};function un(e){return typeof e=="string"?new fn([[document.querySelector(e)]],[document.documentElement]):new fn([[e]],SR)}function lD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ln(e,t){if(e=lD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const cD={passive:!1},Ja={capture:!0,passive:!1};function vp(e){e.stopImmediatePropagation()}function ro(e){e.preventDefault(),e.stopImmediatePropagation()}function _R(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",ro,Ja);"onselectstart"in t?n.on("selectstart.drag",ro,Ja):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function kR(e,t){var n=e.document.documentElement,r=un(e).on("dragstart.drag",null);t&&(r.on("click.drag",ro,Ja),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const au=e=>()=>e;function Sx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:a,y:c,dx:u,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Sx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uD(e){return!e.ctrlKey&&!e.button}function dD(){return this.parentNode}function fD(e,t){return t??{x:e.x,y:e.y}}function hD(){return navigator.maxTouchPoints||"ontouchstart"in this}function NR(){var e=uD,t=dD,n=fD,r=hD,s={},o=Sd("start","drag","end"),a=0,c,u,d,m,p=0;function g(C){C.on("mousedown.drag",v).filter(r).on("touchstart.drag",w).on("touchmove.drag",S,cD).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,j){if(!(m||!e.call(this,C,j))){var R=k(this,t.call(this,C,j),C,j,"mouse");R&&(un(C.view).on("mousemove.drag",b,Ja).on("mouseup.drag",x,Ja),_R(C.view),vp(C),d=!1,c=C.clientX,u=C.clientY,R("start",C))}}function b(C){if(ro(C),!d){var j=C.clientX-c,R=C.clientY-u;d=j*j+R*R>p}s.mouse("drag",C)}function x(C){un(C.view).on("mousemove.drag mouseup.drag",null),kR(C.view,d),ro(C),s.mouse("end",C)}function w(C,j){if(e.call(this,C,j)){var R=C.changedTouches,T=t.call(this,C,j),M=R.length,P,B;for(P=0;P<M;++P)(B=k(this,T,C,j,R[P].identifier,R[P]))&&(vp(C),B("start",C,R[P]))}}function S(C){var j=C.changedTouches,R=j.length,T,M;for(T=0;T<R;++T)(M=s[j[T].identifier])&&(ro(C),M("drag",C,j[T]))}function N(C){var j=C.changedTouches,R=j.length,T,M;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),T=0;T<R;++T)(M=s[j[T].identifier])&&(vp(C),M("end",C,j[T]))}function k(C,j,R,T,M,P){var B=o.copy(),O=Ln(P||R,j),$,U,D;if((D=n.call(C,new Sx("beforestart",{sourceEvent:R,target:g,identifier:M,active:a,x:O[0],y:O[1],dx:0,dy:0,dispatch:B}),T))!=null)return $=D.x-O[0]||0,U=D.y-O[1]||0,function z(V,Y,F){var q=O,G;switch(V){case"start":s[M]=z,G=a++;break;case"end":delete s[M],--a;case"drag":O=Ln(F||Y,j),G=a;break}B.call(V,C,new Sx(V,{sourceEvent:Y,subject:D,target:g,identifier:M,active:G,x:O[0]+$,y:O[1]+U,dx:O[0]-q[0],dy:O[1]-q[1],dispatch:B}),T)}}return g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:au(!!C),g):e},g.container=function(C){return arguments.length?(t=typeof C=="function"?C:au(C),g):t},g.subject=function(C){return arguments.length?(n=typeof C=="function"?C:au(C),g):n},g.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:au(!!C),g):r},g.on=function(){var C=o.on.apply(o,arguments);return C===o?g:C},g.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,g):Math.sqrt(p)},g}function dw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function CR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xl(){}var Za=.7,Xu=1/Za,so="\\s*([+-]?\\d+)\\s*",el="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pD=/^#([0-9a-f]{3,8})$/,mD=new RegExp(`^rgb\\(${so},${so},${so}\\)$`),gD=new RegExp(`^rgb\\(${or},${or},${or}\\)$`),yD=new RegExp(`^rgba\\(${so},${so},${so},${el}\\)$`),vD=new RegExp(`^rgba\\(${or},${or},${or},${el}\\)$`),xD=new RegExp(`^hsl\\(${el},${or},${or}\\)$`),wD=new RegExp(`^hsla\\(${el},${or},${or},${el}\\)$`),k_={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};dw(xl,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:N_,formatHex:N_,formatHex8:bD,formatHsl:SD,formatRgb:C_,toString:C_});function N_(){return this.rgb().formatHex()}function bD(){return this.rgb().formatHex8()}function SD(){return ER(this).formatHsl()}function C_(){return this.rgb().formatRgb()}function Xs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?E_(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?lu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?lu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mD.exec(e))?new Qt(t[1],t[2],t[3],1):(t=gD.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yD.exec(e))?lu(t[1],t[2],t[3],t[4]):(t=vD.exec(e))?lu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xD.exec(e))?R_(t[1],t[2]/100,t[3]/100,1):(t=wD.exec(e))?R_(t[1],t[2]/100,t[3]/100,t[4]):k_.hasOwnProperty(e)?E_(k_[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function E_(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function lu(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qt(e,t,n,r)}function _D(e){return e instanceof xl||(e=Xs(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function _x(e,t,n,r){return arguments.length===1?_D(e):new Qt(e,t,n,r??1)}function Qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dw(Qt,_x,CR(xl,{brighter(e){return e=e==null?Xu:Math.pow(Xu,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Za:Math.pow(Za,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(Gs(this.r),Gs(this.g),Gs(this.b),Qu(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:j_,formatHex:j_,formatHex8:kD,formatRgb:A_,toString:A_}));function j_(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function kD(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function A_(){const e=Qu(this.opacity);return`${e===1?"rgb(":"rgba("}${Gs(this.r)}, ${Gs(this.g)}, ${Gs(this.b)}${e===1?")":`, ${e})`}`}function Qu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=Gs(e),(e<16?"0":"")+e.toString(16)}function R_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $n(e,t,n,r)}function ER(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof xl||(e=Xs(e)),!e)return new $n;if(e instanceof $n)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,c=o-s,u=(o+s)/2;return c?(t===o?a=(n-r)/c+(n<r)*6:n===o?a=(r-t)/c+2:a=(t-n)/c+4,c/=u<.5?o+s:2-o-s,a*=60):c=u>0&&u<1?0:a,new $n(a,c,u,e.opacity)}function ND(e,t,n,r){return arguments.length===1?ER(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dw($n,ND,CR(xl,{brighter(e){return e=e==null?Xu:Math.pow(Xu,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Za:Math.pow(Za,e),new $n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Qt(xp(e>=240?e-240:e+120,s,r),xp(e,s,r),xp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new $n(T_(this.h),cu(this.s),cu(this.l),Qu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qu(this.opacity);return`${e===1?"hsl(":"hsla("}${T_(this.h)}, ${cu(this.s)*100}%, ${cu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function T_(e){return e=(e||0)%360,e<0?e+360:e}function cu(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const fw=e=>()=>e;function CD(e,t){return function(n){return e+n*t}}function ED(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function jD(e){return(e=+e)==1?jR:function(t,n){return n-t?ED(t,n,e):fw(isNaN(t)?n:t)}}function jR(e,t){var n=t-e;return n?CD(e,n):fw(isNaN(e)?t:e)}const Ju=(function e(t){var n=jD(t);function r(s,o){var a=n((s=_x(s)).r,(o=_x(o)).r),c=n(s.g,o.g),u=n(s.b,o.b),d=jR(s.opacity,o.opacity);return function(m){return s.r=a(m),s.g=c(m),s.b=u(m),s.opacity=d(m),s+""}}return r.gamma=e,r})(1);function AD(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function RD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function TD(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)s[a]=Ha(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(c){for(a=0;a<r;++a)o[a]=s[a](c);return o}}function ID(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function MD(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Ha(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var kx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wp=new RegExp(kx.source,"g");function OD(e){return function(){return e}}function PD(e){return function(t){return e(t)+""}}function AR(e,t){var n=kx.lastIndex=wp.lastIndex=0,r,s,o,a=-1,c=[],u=[];for(e=e+"",t=t+"";(r=kx.exec(e))&&(s=wp.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,u.push({i:a,x:tr(r,s)})),n=wp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?PD(u[0].x):OD(t):(t=u.length,function(d){for(var m=0,p;m<t;++m)c[(p=u[m]).i]=p.x(d);return c.join("")})}function Ha(e,t){var n=typeof t,r;return t==null||n==="boolean"?fw(t):(n==="number"?tr:n==="string"?(r=Xs(t))?(t=r,Ju):AR:t instanceof Xs?Ju:t instanceof Date?ID:RD(t)?AD:Array.isArray(t)?TD:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?MD:tr)(e,t)}var I_=180/Math.PI,Nx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function RR(e,t,n,r,s,o){var a,c,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*I_,skewX:Math.atan(u)*I_,scaleX:a,scaleY:c}}var uu;function LD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nx:RR(t.a,t.b,t.c,t.d,t.e,t.f)}function DD(e){return e==null||(uu||(uu=document.createElementNS("http://www.w3.org/2000/svg","g")),uu.setAttribute("transform",e),!(e=uu.transform.baseVal.consolidate()))?Nx:(e=e.matrix,RR(e.a,e.b,e.c,e.d,e.e,e.f))}function TR(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function o(d,m,p,g,v,b){if(d!==p||m!==g){var x=v.push("translate(",null,t,null,n);b.push({i:x-4,x:tr(d,p)},{i:x-2,x:tr(m,g)})}else(p||g)&&v.push("translate("+p+t+g+n)}function a(d,m,p,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:p.push(s(p)+"rotate(",null,r)-2,x:tr(d,m)})):m&&p.push(s(p)+"rotate("+m+r)}function c(d,m,p,g){d!==m?g.push({i:p.push(s(p)+"skewX(",null,r)-2,x:tr(d,m)}):m&&p.push(s(p)+"skewX("+m+r)}function u(d,m,p,g,v,b){if(d!==p||m!==g){var x=v.push(s(v)+"scale(",null,",",null,")");b.push({i:x-4,x:tr(d,p)},{i:x-2,x:tr(m,g)})}else(p!==1||g!==1)&&v.push(s(v)+"scale("+p+","+g+")")}return function(d,m){var p=[],g=[];return d=e(d),m=e(m),o(d.translateX,d.translateY,m.translateX,m.translateY,p,g),a(d.rotate,m.rotate,p,g),c(d.skewX,m.skewX,p,g),u(d.scaleX,d.scaleY,m.scaleX,m.scaleY,p,g),d=m=null,function(v){for(var b=-1,x=g.length,w;++b<x;)p[(w=g[b]).i]=w.x(v);return p.join("")}}}var $D=TR(LD,"px, ","px)","deg)"),qD=TR(DD,", ",")",")"),FD=1e-12;function M_(e){return((e=Math.exp(e))+1/e)/2}function BD(e){return((e=Math.exp(e))-1/e)/2}function zD(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ou=(function e(t,n,r){function s(o,a){var c=o[0],u=o[1],d=o[2],m=a[0],p=a[1],g=a[2],v=m-c,b=p-u,x=v*v+b*b,w,S;if(x<FD)S=Math.log(g/d)/t,w=function(T){return[c+T*v,u+T*b,d*Math.exp(t*T*S)]};else{var N=Math.sqrt(x),k=(g*g-d*d+r*x)/(2*d*n*N),C=(g*g-d*d-r*x)/(2*g*n*N),j=Math.log(Math.sqrt(k*k+1)-k),R=Math.log(Math.sqrt(C*C+1)-C);S=(R-j)/t,w=function(T){var M=T*S,P=M_(j),B=d/(n*N)*(P*zD(t*M+j)-BD(j));return[c+B*v,u+B*b,d*P/M_(t*M+j)]}}return w.duration=S*1e3*t/Math.SQRT2,w}return s.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return e(a,c,u)},s})(Math.SQRT2,2,4);var fo=0,Oa=0,Ea=0,IR=1e3,Zu,Pa,ed=0,Qs=0,kd=0,tl=typeof performance=="object"&&performance.now?performance:Date,MR=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hw(){return Qs||(MR(VD),Qs=tl.now()+kd)}function VD(){Qs=0}function td(){this._call=this._time=this._next=null}td.prototype=OR.prototype={constructor:td,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?hw():+n)+(t==null?0:+t),!this._next&&Pa!==this&&(Pa?Pa._next=this:Zu=this,Pa=this),this._call=e,this._time=n,Cx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cx())}};function OR(e,t,n){var r=new td;return r.restart(e,t,n),r}function UD(){hw(),++fo;for(var e=Zu,t;e;)(t=Qs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fo}function O_(){Qs=(ed=tl.now())+kd,fo=Oa=0;try{UD()}finally{fo=0,WD(),Qs=0}}function HD(){var e=tl.now(),t=e-ed;t>IR&&(kd-=t,ed=e)}function WD(){for(var e,t=Zu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Zu=n);Pa=e,Cx(r)}function Cx(e){if(!fo){Oa&&(Oa=clearTimeout(Oa));var t=e-Qs;t>24?(e<1/0&&(Oa=setTimeout(O_,e-tl.now()-kd)),Ea&&(Ea=clearInterval(Ea))):(Ea||(ed=tl.now(),Ea=setInterval(HD,IR)),fo=1,MR(O_))}}function P_(e,t,n){var r=new td;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var KD=Sd("start","end","cancel","interrupt"),GD=[],PR=0,L_=1,Ex=2,Pu=3,D_=4,jx=5,Lu=6;function Nd(e,t,n,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;YD(e,n,{name:t,index:r,group:s,on:KD,tween:GD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:PR})}function pw(e,t){var n=Un(e,t);if(n.state>PR)throw new Error("too late; already scheduled");return n}function pr(e,t){var n=Un(e,t);if(n.state>Pu)throw new Error("too late; already running");return n}function Un(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=OR(o,0,n.time);function o(d){n.state=L_,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var m,p,g,v;if(n.state!==L_)return u();for(m in r)if(v=r[m],v.name===n.name){if(v.state===Pu)return P_(a);v.state===D_?(v.state=Lu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=Lu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(P_(function(){n.state===Pu&&(n.state=D_,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Ex,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ex){for(n.state=Pu,s=new Array(g=n.tween.length),m=0,p=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=v);s.length=p+1}}function c(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=jx,1),p=-1,g=s.length;++p<g;)s[p].call(e,m);n.state===jx&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Lu,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Du(e,t){var n=e.__transition,r,s,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}s=r.state>Ex&&r.state<jx,r.state=Lu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function XD(e){return this.each(function(){Du(this,e)})}function QD(e,t){var n,r;return function(){var s=pr(this,e),o=s.tween;if(o!==n){r=n=o;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function JD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=pr(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var c={name:t,value:n},u=0,d=s.length;u<d;++u)if(s[u].name===t){s[u]=c;break}u===d&&s.push(c)}o.tween=s}}function ZD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Un(this.node(),n).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?QD:JD)(n,e,t))}function mw(e,t,n){var r=e._id;return e.each(function(){var s=pr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Un(s,r).value[t]}}function LR(e,t){var n;return(typeof t=="number"?tr:t instanceof Xs?Ju:(n=Xs(t))?(t=n,Ju):AR)(e,t)}function e$(e){return function(){this.removeAttribute(e)}}function t$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function n$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,n)}}function r$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,n)}}function s$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function i$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function o$(e,t){var n=_d(e),r=n==="transform"?qD:LR;return this.attrTween(e,typeof t=="function"?(n.local?i$:s$)(n,r,mw(this,"attr."+e,t)):t==null?(n.local?t$:e$)(n):(n.local?r$:n$)(n,r,t))}function a$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function l$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function c$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&l$(e,o)),n}return s._value=t,s}function u$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&a$(e,o)),n}return s._value=t,s}function d$(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_d(e);return this.tween(n,(r.local?c$:u$)(r,t))}function f$(e,t){return function(){pw(this,e).delay=+t.apply(this,arguments)}}function h$(e,t){return t=+t,function(){pw(this,e).delay=t}}function p$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?f$:h$)(t,e)):Un(this.node(),t).delay}function m$(e,t){return function(){pr(this,e).duration=+t.apply(this,arguments)}}function g$(e,t){return t=+t,function(){pr(this,e).duration=t}}function y$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m$:g$)(t,e)):Un(this.node(),t).duration}function v$(e,t){if(typeof t!="function")throw new Error;return function(){pr(this,e).ease=t}}function x$(e){var t=this._id;return arguments.length?this.each(v$(t,e)):Un(this.node(),t).ease}function w$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pr(this,e).ease=n}}function b$(e){if(typeof e!="function")throw new Error;return this.each(w$(this._id,e))}function S$(e){typeof e!="function"&&(e=hR(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,d=0;d<a;++d)(u=o[d])&&e.call(u,u.__data__,d,o)&&c.push(u);return new Ir(r,this._parents,this._name,this._id)}function _$(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),a=new Array(r),c=0;c<o;++c)for(var u=t[c],d=n[c],m=u.length,p=a[c]=new Array(m),g,v=0;v<m;++v)(g=u[v]||d[v])&&(p[v]=g);for(;c<r;++c)a[c]=t[c];return new Ir(a,this._parents,this._name,this._id)}function k$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function N$(e,t,n){var r,s,o=k$(t)?pw:pr;return function(){var a=o(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function C$(e,t){var n=this._id;return arguments.length<2?Un(this.node(),n).on.on(e):this.each(N$(n,e,t))}function E$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function j$(){return this.on("end.remove",E$(this._id))}function A$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cw(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var c=r[a],u=c.length,d=o[a]=new Array(u),m,p,g=0;g<u;++g)(m=c[g])&&(p=e.call(m,m.__data__,g,c))&&("__data__"in m&&(p.__data__=m.__data__),d[g]=p,Nd(d[g],t,n,g,d,Un(m,n)));return new Ir(o,this._parents,t,n)}function R$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fR(e));for(var r=this._groups,s=r.length,o=[],a=[],c=0;c<s;++c)for(var u=r[c],d=u.length,m,p=0;p<d;++p)if(m=u[p]){for(var g=e.call(m,m.__data__,p,u),v,b=Un(m,n),x=0,w=g.length;x<w;++x)(v=g[x])&&Nd(v,t,n,x,g,b);o.push(g),a.push(m)}return new Ir(o,a,t,n)}var T$=vl.prototype.constructor;function I$(){return new T$(this._groups,this._parents)}function M$(e,t){var n,r,s;return function(){var o=uo(this,e),a=(this.style.removeProperty(e),uo(this,e));return o===a?null:o===n&&a===r?s:s=t(n=o,r=a)}}function DR(e){return function(){this.style.removeProperty(e)}}function O$(e,t,n){var r,s=n+"",o;return function(){var a=uo(this,e);return a===s?null:a===r?o:o=t(r=a,n)}}function P$(e,t,n){var r,s,o;return function(){var a=uo(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),uo(this,e))),a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c))}}function L$(e,t){var n,r,s,o="style."+t,a="end."+o,c;return function(){var u=pr(this,e),d=u.on,m=u.value[o]==null?c||(c=DR(t)):void 0;(d!==n||s!==m)&&(r=(n=d).copy()).on(a,s=m),u.on=r}}function D$(e,t,n){var r=(e+="")=="transform"?$D:LR;return t==null?this.styleTween(e,M$(e,r)).on("end.style."+e,DR(e)):typeof t=="function"?this.styleTween(e,P$(e,r,mw(this,"style."+e,t))).each(L$(this._id,e)):this.styleTween(e,O$(e,r,t),n).on("end.style."+e,null)}function $$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function q$(e,t,n){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&$$(e,a,n)),r}return o._value=t,o}function F$(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,q$(e,t,n??""))}function B$(e){return function(){this.textContent=e}}function z$(e){return function(){var t=e(this);this.textContent=t??""}}function V$(e){return this.tween("text",typeof e=="function"?z$(mw(this,"text",e)):B$(e==null?"":e+""))}function U$(e){return function(t){this.textContent=e.call(this,t)}}function H$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&U$(s)),t}return r._value=e,r}function W$(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,H$(e))}function K$(){for(var e=this._name,t=this._id,n=$R(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,d=0;d<c;++d)if(u=a[d]){var m=Un(u,t);Nd(u,e,n,d,a,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Ir(r,this._parents,e,n)}function G$(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,a){var c={value:a},u={value:function(){--s===0&&o()}};n.each(function(){var d=pr(this,r),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),d.on=t}),s===0&&o()})}var Y$=0;function Ir(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $R(){return++Y$}var Nr=vl.prototype;Ir.prototype={constructor:Ir,select:A$,selectAll:R$,selectChild:Nr.selectChild,selectChildren:Nr.selectChildren,filter:S$,merge:_$,selection:I$,transition:K$,call:Nr.call,nodes:Nr.nodes,node:Nr.node,size:Nr.size,empty:Nr.empty,each:Nr.each,on:C$,attr:o$,attrTween:d$,style:D$,styleTween:F$,text:V$,textTween:W$,remove:j$,tween:ZD,delay:p$,duration:y$,ease:x$,easeVarying:b$,end:G$,[Symbol.iterator]:Nr[Symbol.iterator]};function X$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Q$={time:null,delay:0,duration:250,ease:X$};function J$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Z$(e){var t,n;e instanceof Ir?(t=e._id,e=e._name):(t=$R(),(n=Q$).time=hw(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,d=0;d<c;++d)(u=a[d])&&Nd(u,e,t,d,a,n||J$(u,t));return new Ir(r,this._parents,e,t)}vl.prototype.interrupt=XD;vl.prototype.transition=Z$;const du=e=>()=>e;function eq(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function jr(e,t,n){this.k=e,this.x=t,this.y=n}jr.prototype={constructor:jr,scale:function(e){return e===1?this:new jr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Cd=new jr(1,0,0);qR.prototype=jr.prototype;function qR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cd;return e.__zoom}function bp(e){e.stopImmediatePropagation()}function ja(e){e.preventDefault(),e.stopImmediatePropagation()}function tq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function $_(){return this.__zoom||Cd}function rq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sq(){return navigator.maxTouchPoints||"ontouchstart"in this}function iq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function FR(){var e=tq,t=nq,n=iq,r=rq,s=sq,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Ou,d=Sd("start","zoom","end"),m,p,g,v=500,b=150,x=0,w=10;function S(D){D.property("__zoom",$_).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",O).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(D,z,V,Y){var F=D.selection?D.selection():D;F.property("__zoom",$_),D!==F?j(D,z,V,Y):F.interrupt().each(function(){R(this,arguments).event(Y).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},S.scaleBy=function(D,z,V,Y){S.scaleTo(D,function(){var F=this.__zoom.k,q=typeof z=="function"?z.apply(this,arguments):z;return F*q},V,Y)},S.scaleTo=function(D,z,V,Y){S.transform(D,function(){var F=t.apply(this,arguments),q=this.__zoom,G=V==null?C(F):typeof V=="function"?V.apply(this,arguments):V,L=q.invert(G),W=typeof z=="function"?z.apply(this,arguments):z;return n(k(N(q,W),G,L),F,a)},V,Y)},S.translateBy=function(D,z,V,Y){S.transform(D,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),a)},null,Y)},S.translateTo=function(D,z,V,Y,F){S.transform(D,function(){var q=t.apply(this,arguments),G=this.__zoom,L=Y==null?C(q):typeof Y=="function"?Y.apply(this,arguments):Y;return n(Cd.translate(L[0],L[1]).scale(G.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof V=="function"?-V.apply(this,arguments):-V),q,a)},Y,F)};function N(D,z){return z=Math.max(o[0],Math.min(o[1],z)),z===D.k?D:new jr(z,D.x,D.y)}function k(D,z,V){var Y=z[0]-V[0]*D.k,F=z[1]-V[1]*D.k;return Y===D.x&&F===D.y?D:new jr(D.k,Y,F)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function j(D,z,V,Y){D.on("start.zoom",function(){R(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(Y).end()}).tween("zoom",function(){var F=this,q=arguments,G=R(F,q).event(Y),L=t.apply(F,q),W=V==null?C(L):typeof V=="function"?V.apply(F,q):V,oe=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),K=F.__zoom,J=typeof z=="function"?z.apply(F,q):z,te=u(K.invert(W).concat(oe/K.k),J.invert(W).concat(oe/J.k));return function(X){if(X===1)X=J;else{var ee=te(X),ie=oe/ee[2];X=new jr(ie,W[0]-ee[0]*ie,W[1]-ee[1]*ie)}G.zoom(null,X)}})}function R(D,z,V){return!V&&D.__zooming||new T(D,z)}function T(D,z){this.that=D,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,z),this.taps=0}T.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,z){return this.mouse&&D!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var z=un(this.that).datum();d.call(D,this.that,new eq(D,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:d}),z)}};function M(D,...z){if(!e.apply(this,arguments))return;var V=R(this,z).event(D),Y=this.__zoom,F=Math.max(o[0],Math.min(o[1],Y.k*Math.pow(2,r.apply(this,arguments)))),q=Ln(D);if(V.wheel)(V.mouse[0][0]!==q[0]||V.mouse[0][1]!==q[1])&&(V.mouse[1]=Y.invert(V.mouse[0]=q)),clearTimeout(V.wheel);else{if(Y.k===F)return;V.mouse=[q,Y.invert(q)],Du(this),V.start()}ja(D),V.wheel=setTimeout(G,b),V.zoom("mouse",n(k(N(Y,F),V.mouse[0],V.mouse[1]),V.extent,a));function G(){V.wheel=null,V.end()}}function P(D,...z){if(g||!e.apply(this,arguments))return;var V=D.currentTarget,Y=R(this,z,!0).event(D),F=un(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",oe,!0),q=Ln(D,V),G=D.clientX,L=D.clientY;_R(D.view),bp(D),Y.mouse=[q,this.__zoom.invert(q)],Du(this),Y.start();function W(K){if(ja(K),!Y.moved){var J=K.clientX-G,te=K.clientY-L;Y.moved=J*J+te*te>x}Y.event(K).zoom("mouse",n(k(Y.that.__zoom,Y.mouse[0]=Ln(K,V),Y.mouse[1]),Y.extent,a))}function oe(K){F.on("mousemove.zoom mouseup.zoom",null),kR(K.view,Y.moved),ja(K),Y.event(K).end()}}function B(D,...z){if(e.apply(this,arguments)){var V=this.__zoom,Y=Ln(D.changedTouches?D.changedTouches[0]:D,this),F=V.invert(Y),q=V.k*(D.shiftKey?.5:2),G=n(k(N(V,q),Y,F),t.apply(this,z),a);ja(D),c>0?un(this).transition().duration(c).call(j,G,Y,D):un(this).call(S.transform,G,Y,D)}}function O(D,...z){if(e.apply(this,arguments)){var V=D.touches,Y=V.length,F=R(this,z,D.changedTouches.length===Y).event(D),q,G,L,W;for(bp(D),G=0;G<Y;++G)L=V[G],W=Ln(L,this),W=[W,this.__zoom.invert(W),L.identifier],F.touch0?!F.touch1&&F.touch0[2]!==W[2]&&(F.touch1=W,F.taps=0):(F.touch0=W,q=!0,F.taps=1+!!m);m&&(m=clearTimeout(m)),q&&(F.taps<2&&(p=W[0],m=setTimeout(function(){m=null},v)),Du(this),F.start())}}function $(D,...z){if(this.__zooming){var V=R(this,z).event(D),Y=D.changedTouches,F=Y.length,q,G,L,W;for(ja(D),q=0;q<F;++q)G=Y[q],L=Ln(G,this),V.touch0&&V.touch0[2]===G.identifier?V.touch0[0]=L:V.touch1&&V.touch1[2]===G.identifier&&(V.touch1[0]=L);if(G=V.that.__zoom,V.touch1){var oe=V.touch0[0],K=V.touch0[1],J=V.touch1[0],te=V.touch1[1],X=(X=J[0]-oe[0])*X+(X=J[1]-oe[1])*X,ee=(ee=te[0]-K[0])*ee+(ee=te[1]-K[1])*ee;G=N(G,Math.sqrt(X/ee)),L=[(oe[0]+J[0])/2,(oe[1]+J[1])/2],W=[(K[0]+te[0])/2,(K[1]+te[1])/2]}else if(V.touch0)L=V.touch0[0],W=V.touch0[1];else return;V.zoom("touch",n(k(G,L,W),V.extent,a))}}function U(D,...z){if(this.__zooming){var V=R(this,z).event(D),Y=D.changedTouches,F=Y.length,q,G;for(bp(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),q=0;q<F;++q)G=Y[q],V.touch0&&V.touch0[2]===G.identifier?delete V.touch0:V.touch1&&V.touch1[2]===G.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(G=Ln(G,this),Math.hypot(p[0]-G[0],p[1]-G[1])<w)){var L=un(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return S.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:du(+D),S):r},S.filter=function(D){return arguments.length?(e=typeof D=="function"?D:du(!!D),S):e},S.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:du(!!D),S):s},S.extent=function(D){return arguments.length?(t=typeof D=="function"?D:du([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),S):t},S.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],S):[o[0],o[1]]},S.translateExtent=function(D){return arguments.length?(a[0][0]=+D[0][0],a[1][0]=+D[1][0],a[0][1]=+D[0][1],a[1][1]=+D[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(D){return arguments.length?(n=D,S):n},S.duration=function(D){return arguments.length?(c=+D,S):c},S.interpolate=function(D){return arguments.length?(u=D,S):u},S.on=function(){var D=d.on.apply(d,arguments);return D===d?S:D},S.clickDistance=function(D){return arguments.length?(x=(D=+D)*D,S):Math.sqrt(x)},S.tapDistance=function(D){return arguments.length?(w=+D,S):w},S}const cr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},nl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],BR=["Enter"," ","Escape"],zR={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ho;(function(e){e.Strict="strict",e.Loose="loose"})(ho||(ho={}));var Ys;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ys||(Ys={}));var rl;(function(e){e.Partial="partial",e.Full="full"})(rl||(rl={}));const VR={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ms;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ms||(ms={}));var nd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nd||(nd={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const q_={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function UR(e){return e===null?null:e?"valid":"invalid"}const HR=e=>"id"in e&&"source"in e&&"target"in e,oq=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),gw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),wl=(e,t=[0,0])=>{const{width:n,height:r}=Lr(e),s=e.origin??t,o=n*s[0],a=r*s[1];return{x:e.position.x-o,y:e.position.y-a}},aq=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let a=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(a=o?t.nodeLookup.get(s):gw(s)?s:t.nodeLookup.get(s.id));const c=a?rd(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ed(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return jd(n)},bl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Ed(n,rd(s)),r=!0)}),r?jd(n):{x:0,y:0,width:0,height:0}},yw=(e,t,[n,r,s]=[0,0,1],o=!1,a=!1)=>{const c={..._l(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const d of e.values()){const{measured:m,selectable:p=!0,hidden:g=!1}=d;if(a&&!p||g)continue;const v=m.width??d.width??d.initialWidth??null,b=m.height??d.height??d.initialHeight??null,x=sl(c,mo(d)),w=(v??0)*(b??0),S=o&&x>0;(!d.internals.handleBounds||S||x>=w||d.dragging)&&u.push(d)}return u},lq=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function cq(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function uq({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=cq(e,a),u=bl(c),d=vw(u,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??o,(a==null?void 0:a.padding)??.1);return await r.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function WR({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:u,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},m=a.origin??r;let p=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)o==null||o("005",cr.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(p=[[u,d],[u+v,d+b]])}else c&&go(a.extent)&&(p=[[a.extent[0][0]+u,a.extent[0][1]+d],[a.extent[1][0]+u,a.extent[1][1]+d]]);const g=go(p)?Js(t,p,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(o==null||o("015",cr.error015())),{position:{x:g.x-u+(a.measured.width??0)*m[0],y:g.y-d+(a.measured.height??0)*m[1]},positionAbsolute:g}}async function dq({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=o.has(g.id),b=!v&&g.parentId&&a.find(x=>x.id===g.parentId);(v||b)&&a.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=lq(a,u);for(const g of u)c.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!s)return{edges:m,nodes:a};const p=await s({nodes:a,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:a}:{edges:[],nodes:[]}:p}const po=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Js=(e={x:0,y:0},t,n)=>({x:po(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:po(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function KR(e,t,n){const{width:r,height:s}=Lr(n),{x:o,y:a}=n.internals.positionAbsolute;return Js(e,[[o,a],[o+r,a+s]],t)}const F_=(e,t,n)=>e<t?po(Math.abs(e-t),1,t)/t:e>n?-po(Math.abs(e-n),1,t)/t:0,GR=(e,t,n=15,r=40)=>{const s=F_(e.x,r,t.width-r)*n,o=F_(e.y,r,t.height-r)*n;return[s,o]},Ed=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ax=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mo=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gw(e)?e.internals.positionAbsolute:wl(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},rd=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gw(e)?e.internals.positionAbsolute:wl(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},YR=(e,t)=>jd(Ed(Ax(e),Ax(t))),sl=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},B_=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),fq=(e,t)=>{},Sl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_l=({x:e,y:t},[n,r,s],o=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?Sl(c,a):c},sd=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Vi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function hq(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Vi(e,n),s=Vi(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Vi(e.top??e.y??0,n),s=Vi(e.bottom??e.y??0,n),o=Vi(e.left??e.x??0,t),a=Vi(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:o,x:o+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pq(e,t,n,r,s,o){const{x:a,y:c}=sd(e,[t,n,r]),{x:u,y:d}=sd({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=s-u,p=o-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(p)}}const vw=(e,t,n,r,s,o)=>{const a=hq(o,t,n),c=(t-a.x)/e.width,u=(n-a.y)/e.height,d=Math.min(c,u),m=po(d,r,s),p=e.x+e.width/2,g=e.y+e.height/2,v=t/2-p*m,b=n/2-g*m,x=pq(e,v,b,m,t,n),w={left:Math.min(x.left-a.left,0),top:Math.min(x.top-a.top,0),right:Math.min(x.right-a.right,0),bottom:Math.min(x.bottom-a.bottom,0)};return{x:v-w.left+w.right,y:b-w.top+w.bottom,zoom:m}},il=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function go(e){return e!=null&&e!=="parent"}function Lr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function XR(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function QR(e,t={width:0,height:0},n,r,s){const o={...e},a=r.get(n);if(a){const c=a.origin||s;o.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function z_(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mq(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function gq(e){return{...zR,...e||{}}}function Wa(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:a}=Fn(e),c=_l({x:o-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:u,y:d}=n?Sl(c,t):c;return{xSnapped:u,ySnapped:d,...c}}const xw=e=>({width:e.offsetWidth,height:e.offsetHeight}),JR=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},yq=["INPUT","SELECT","TEXTAREA"];function ZR(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:yq.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const eT=e=>"clientX"in e,Fn=(e,t)=>{var o,a;const n=eT(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},V_=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...xw(a)}})};function tT({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:a,targetControlY:c}){const u=e*.125+s*.375+a*.375+n*.125,d=t*.125+o*.375+c*.375+r*.125,m=Math.abs(u-e),p=Math.abs(d-t);return[u,d,m,p]}function fu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function U_({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case he.Left:return[t-fu(t-r,o),n];case he.Right:return[t+fu(r-t,o),n];case he.Top:return[t,n-fu(n-s,o)];case he.Bottom:return[t,n+fu(s-n,o)]}}function nT({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,curvature:a=.25}){const[c,u]=U_({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[d,m]=U_({pos:o,x1:r,y1:s,x2:e,y2:t,c:a}),[p,g,v,b]=tT({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:d,targetControlY:m});return[`M${e},${t} C${c},${u} ${d},${m} ${r},${s}`,p,g,v,b]}function rT({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[o,c,s,a]}function vq({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const a=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return a+c}function xq({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Ed(rd(e),rd(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return sl(a,jd(o))>0}const wq=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,bq=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sT=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||wq;let s;return HR(e)?s={...e}:s={...e,id:r(e)},bq(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function iT({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,a,c]=rT({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,a,c]}const H_={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},Sq=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},W_=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function _q({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:s,offset:o,stepPosition:a}){const c=H_[t],u=H_[r],d={x:e.x+c.x*o,y:e.y+c.y*o},m={x:n.x+u.x*o,y:n.y+u.y*o},p=Sq({source:d,sourcePosition:t,target:m}),g=p.x!==0?"x":"y",v=p[g];let b=[],x,w;const S={x:0,y:0},N={x:0,y:0},[,,k,C]=rT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(x=s.x??d.x+(m.x-d.x)*a,w=s.y??(d.y+m.y)/2):(x=s.x??(d.x+m.x)/2,w=s.y??d.y+(m.y-d.y)*a);const R=[{x,y:d.y},{x,y:m.y}],T=[{x:d.x,y:w},{x:m.x,y:w}];c[g]===v?b=g==="x"?R:T:b=g==="x"?T:R}else{const R=[{x:d.x,y:m.y}],T=[{x:m.x,y:d.y}];if(g==="x"?b=c.x===v?T:R:b=c.y===v?R:T,t===r){const $=Math.abs(e[g]-n[g]);if($<=o){const U=Math.min(o-1,o-$);c[g]===v?S[g]=(d[g]>e[g]?-1:1)*U:N[g]=(m[g]>n[g]?-1:1)*U}}if(t!==r){const $=g==="x"?"y":"x",U=c[g]===u[$],D=d[$]>m[$],z=d[$]<m[$];(c[g]===1&&(!U&&D||U&&z)||c[g]!==1&&(!U&&z||U&&D))&&(b=g==="x"?R:T)}const M={x:d.x+S.x,y:d.y+S.y},P={x:m.x+N.x,y:m.y+N.y},B=Math.max(Math.abs(M.x-b[0].x),Math.abs(P.x-b[0].x)),O=Math.max(Math.abs(M.y-b[0].y),Math.abs(P.y-b[0].y));B>=O?(x=(M.x+P.x)/2,w=b[0].y):(x=b[0].x,w=(M.y+P.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...b,{x:m.x+N.x,y:m.y+N.y},n],x,w,k,C]}function kq(e,t,n,r){const s=Math.min(W_(e,t)/2,W_(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${o+s*d},${a}Q ${o},${a} ${o},${a+s*m}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${a+s*u}Q ${o},${a} ${o+s*c},${a}`}function Rx({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,borderRadius:a=5,centerX:c,centerY:u,offset:d=20,stepPosition:m=.5}){const[p,g,v,b,x]=_q({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:u},offset:d,stepPosition:m});return[p.reduce((S,N,k)=>{let C="";return k>0&&k<p.length-1?C=kq(p[k-1],N,p[k+1],a):C=`${k===0?"M":"L"}${N.x} ${N.y}`,S+=C,S},""),g,v,b,x]}function K_(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Nq(e){var p;const{sourceNode:t,targetNode:n}=e;if(!K_(t)||!K_(n))return null;const r=t.internals.handleBounds||G_(t.handles),s=n.internals.handleBounds||G_(n.handles),o=Y_((r==null?void 0:r.source)??[],e.sourceHandle),a=Y_(e.connectionMode===ho.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!a)return(p=e.onError)==null||p.call(e,"008",cr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||he.Bottom,u=(a==null?void 0:a.position)||he.Top,d=Zs(t,o,c),m=Zs(n,a,u);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:u}}function G_(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Zs(e,t,n=he.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Lr(e);if(r)return{x:s+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case he.Top:return{x:s+a/2,y:o};case he.Right:return{x:s+a,y:o+c/2};case he.Bottom:return{x:s+a/2,y:o+c};case he.Left:return{x:s,y:o+c/2}}}function Y_(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Tx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Cq(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const d=Tx(u,t);o.has(d)||(a.push({id:d,color:u.color||n,...u}),o.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const oT=1e3,Eq=10,ww={nodeOrigin:[0,0],nodeExtent:nl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jq={...ww,checkEquality:!0};function bw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Aq(e,t,n){const r=bw(ww,n);for(const s of e.values())if(s.parentId)_w(s,e,t,r);else{const o=wl(s,r.nodeOrigin),a=go(s.extent)?s.extent:r.nodeExtent,c=Js(o,a,Lr(s));s.internals.positionAbsolute=c}}function Rq(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function Sw(e){return e==="manual"}function Ix(e,t,n,r={}){var d,m;const s=bw(jq,r),o={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!Sw(s.zIndexMode)?oT:0;let u=e.length>0;t.clear(),n.clear();for(const p of e){let g=a.get(p.id);if(s.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const v=wl(p,s.nodeOrigin),b=go(p.extent)?p.extent:s.nodeExtent,x=Js(v,b,Lr(p));g={...s.defaults,...p,measured:{width:(d=p.measured)==null?void 0:d.width,height:(m=p.measured)==null?void 0:m.height},internals:{positionAbsolute:x,handleBounds:Rq(p,g),z:aT(p,c,s.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),p.parentId&&_w(g,t,n,r,o)}return u}function Tq(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function _w(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:u}=bw(ww,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Tq(e,n),s&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++s.i,m.internals.z=m.internals.z+s.i*Eq),s&&m.internals.rootParentIndex!==void 0&&(s.i=m.internals.rootParentIndex);const p=o&&!Sw(u)?oT:0,{x:g,y:v,z:b}=Iq(e,m,a,c,p,u),{positionAbsolute:x}=e.internals,w=g!==x.x||v!==x.y;(w||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:g,y:v}:x,z:b}})}function aT(e,t,n){const r=qn(e.zIndex)?e.zIndex:0;return Sw(n)?r:r+(e.selected?t:0)}function Iq(e,t,n,r,s,o){const{x:a,y:c}=t.internals.positionAbsolute,u=Lr(e),d=wl(e,n),m=go(e.extent)?Js(d,e.extent,u):d;let p=Js({x:a+m.x,y:c+m.y},r,u);e.extent==="parent"&&(p=KR(p,u,t));const g=aT(e,s,o),v=t.internals.z??0;return{x:p.x,y:p.y,z:v>=g?v+1:g}}function kw(e,t,n,r=[0,0]){var a;const s=[],o=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const d=((a=o.get(c.parentId))==null?void 0:a.expandedRect)??mo(u),m=YR(d,c.rect);o.set(c.parentId,{expandedRect:m,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},d)=>{var k;const m=u.internals.positionAbsolute,p=Lr(u),g=u.origin??r,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,b=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,x=Math.max(p.width,Math.round(c.width)),w=Math.max(p.height,Math.round(c.height)),S=(x-p.width)*g[0],N=(w-p.height)*g[1];(v>0||b>0||S||N)&&(s.push({id:d,type:"position",position:{x:u.position.x-v+S,y:u.position.y-b+N}}),(k=n.get(d))==null||k.forEach(C=>{e.some(j=>j.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+v,y:C.position.y+b}})})),(p.width<c.width||p.height<c.height||v||b)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:x+(v?g[0]*v-S:0),height:w+(b?g[1]*b-N:0)}})}),s}function Mq(e,t,n,r,s,o,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const d=[],m=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const x=xw(v.nodeElement),w=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!b.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),k=go(b.extent)?b.extent:o;let{positionAbsolute:C}=b.internals;b.parentId&&b.extent==="parent"?C=KR(C,x,t.get(b.parentId)):k&&(C=Js(C,k,x));const j={...b,measured:x,internals:{...b.internals,positionAbsolute:C,handleBounds:{source:V_("source",v.nodeElement,N,p,b.id),target:V_("target",v.nodeElement,N,p,b.id)}}};t.set(b.id,j),b.parentId&&_w(j,t,n,{nodeOrigin:s,zIndexMode:a}),u=!0,w&&(d.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:mo(j,s)}))}}if(g.length>0){const v=kw(g,t,n,s);d.push(...v)}return{changes:d,updatedInternals:u}}async function Oq({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function X_(e,t,n,r,s,o){let a=s;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${s}-${e}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),o){a=`${s}-${e}-${o}`;const d=r.get(a)||new Map;r.set(a,d.set(n,t))}}function lT(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:a=null,targetHandle:c=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:a,targetHandle:c},d=`${s}-${a}--${o}-${c}`,m=`${o}-${c}--${s}-${a}`;X_("source",u,m,e,s,a),X_("target",u,d,e,o,c),t.set(r.id,r)}}function cT(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cT(n,t):!1}function Q_(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Pq(e,t,n,r){const s=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!cT(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(o);c&&s.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function Sp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,u;const s=[];for(const[d,m]of t){const p=(a=n.get(d))==null?void 0:a.internals.userNode;p&&s.push({...p,position:m.position,dragging:r})}if(!e)return[s[0],s];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function Lq({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},a=Sl(o,t);return{x:a.x-o.x,y:a.y-o.y}}function Dq({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},a=0,c=new Map,u=!1,d={x:0,y:0},m=null,p=!1,g=null,v=!1,b=!1,x=null;function w({noDragClassName:N,handleSelector:k,domNode:C,isSelectable:j,nodeId:R,nodeClickDistance:T=0}){g=un(C);function M({x:$,y:U}){const{nodeLookup:D,nodeExtent:z,snapGrid:V,snapToGrid:Y,nodeOrigin:F,onNodeDrag:q,onSelectionDrag:G,onError:L,updateNodePositions:W}=t();o={x:$,y:U};let oe=!1;const K=c.size>1,J=K&&z?Ax(bl(c)):null,te=K&&Y?Lq({dragItems:c,snapGrid:V,x:$,y:U}):null;for(const[X,ee]of c){if(!D.has(X))continue;let ie={x:$-ee.distance.x,y:U-ee.distance.y};Y&&(ie=te?{x:Math.round(ie.x+te.x),y:Math.round(ie.y+te.y)}:Sl(ie,V));let ue=null;if(K&&z&&!ee.extent&&J){const{positionAbsolute:pe}=ee.internals,_e=pe.x-J.x+z[0][0],xe=pe.x+ee.measured.width-J.x2+z[1][0],Ce=pe.y-J.y+z[0][1],Ne=pe.y+ee.measured.height-J.y2+z[1][1];ue=[[_e,Ce],[xe,Ne]]}const{position:me,positionAbsolute:ye}=WR({nodeId:X,nextPosition:ie,nodeLookup:D,nodeExtent:ue||z,nodeOrigin:F,onError:L});oe=oe||ee.position.x!==me.x||ee.position.y!==me.y,ee.position=me,ee.internals.positionAbsolute=ye}if(b=b||oe,!!oe&&(W(c,!0),x&&(r||q||!R&&G))){const[X,ee]=Sp({nodeId:R,dragItems:c,nodeLookup:D});r==null||r(x,c,X,ee),q==null||q(x,X,ee),R||G==null||G(x,ee)}}async function P(){if(!m)return;const{transform:$,panBy:U,autoPanSpeed:D,autoPanOnNodeDrag:z}=t();if(!z){u=!1,cancelAnimationFrame(a);return}const[V,Y]=GR(d,m,D);(V!==0||Y!==0)&&(o.x=(o.x??0)-V/$[2],o.y=(o.y??0)-Y/$[2],await U({x:V,y:Y})&&M(o)),a=requestAnimationFrame(P)}function B($){var K;const{nodeLookup:U,multiSelectionActive:D,nodesDraggable:z,transform:V,snapGrid:Y,snapToGrid:F,selectNodesOnDrag:q,onNodeDragStart:G,onSelectionDragStart:L,unselectNodesAndEdges:W}=t();p=!0,(!q||!j)&&!D&&R&&((K=U.get(R))!=null&&K.selected||W()),j&&q&&R&&(e==null||e(R));const oe=Wa($.sourceEvent,{transform:V,snapGrid:Y,snapToGrid:F,containerBounds:m});if(o=oe,c=Pq(U,z,oe,R),c.size>0&&(n||G||!R&&L)){const[J,te]=Sp({nodeId:R,dragItems:c,nodeLookup:U});n==null||n($.sourceEvent,c,J,te),G==null||G($.sourceEvent,J,te),R||L==null||L($.sourceEvent,te)}}const O=NR().clickDistance(T).on("start",$=>{const{domNode:U,nodeDragThreshold:D,transform:z,snapGrid:V,snapToGrid:Y}=t();m=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,b=!1,x=$.sourceEvent,D===0&&B($),o=Wa($.sourceEvent,{transform:z,snapGrid:V,snapToGrid:Y,containerBounds:m}),d=Fn($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:U,transform:D,snapGrid:z,snapToGrid:V,nodeDragThreshold:Y,nodeLookup:F}=t(),q=Wa($.sourceEvent,{transform:D,snapGrid:z,snapToGrid:V,containerBounds:m});if(x=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||R&&!F.has(R))&&(v=!0),!v){if(!u&&U&&p&&(u=!0,P()),!p){const G=Fn($.sourceEvent,m),L=G.x-d.x,W=G.y-d.y;Math.sqrt(L*L+W*W)>Y&&B($)}(o.x!==q.xSnapped||o.y!==q.ySnapped)&&c&&p&&(d=Fn($.sourceEvent,m),M(q))}}).on("end",$=>{if(!(!p||v)&&(u=!1,p=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:U,updateNodePositions:D,onNodeDragStop:z,onSelectionDragStop:V}=t();if(b&&(D(c,!1),b=!1),s||z||!R&&V){const[Y,F]=Sp({nodeId:R,dragItems:c,nodeLookup:U,dragging:!1});s==null||s($.sourceEvent,c,Y,F),z==null||z($.sourceEvent,Y,F),R||V==null||V($.sourceEvent,F)}}}).filter($=>{const U=$.target;return!$.button&&(!N||!Q_(U,`.${N}`,C))&&(!k||Q_(U,k,C))});g.call(O)}function S(){g==null||g.on(".drag",null)}return{update:w,destroy:S}}function $q(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())sl(s,mo(o))>0&&r.push(o);return r}const qq=250;function Fq(e,t,n,r){var c,u;let s=[],o=1/0;const a=$q(e,n,t+qq);for(const d of a){const m=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of m){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:g,y:v}=Zs(d,p,p.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<o?(s=[{...p,x:g,y:v}],o=b):b===o&&s.push({...p,x:g,y:v}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(m=>m.type===d)??s[0]}return s[0]}function uT(e,t,n,r,s,o=!1){var d,m,p;const a=r.get(e);if(!a)return null;const c=s==="strict"?(d=a.internals.handleBounds)==null?void 0:d[t]:[...((m=a.internals.handleBounds)==null?void 0:m.source)??[],...((p=a.internals.handleBounds)==null?void 0:p.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&o?{...u,...Zs(a,u,u.position,!0)}:u}function dT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Bq(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const fT=()=>!0;function zq(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:u,lib:d,autoPanOnConnect:m,flowId:p,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:x,onConnectEnd:w,isValidConnection:S=fT,onReconnectEnd:N,updateConnection:k,getTransform:C,getFromHandle:j,autoPanSpeed:R,dragThreshold:T=1,handleDomNode:M}){const P=JR(e.target);let B=0,O;const{x:$,y:U}=Fn(e),D=dT(o,M),z=c==null?void 0:c.getBoundingClientRect();let V=!1;if(!z||!D)return;const Y=uT(s,D,r,u,t);if(!Y)return;let F=Fn(e,z),q=!1,G=null,L=!1,W=null;function oe(){if(!m||!z)return;const[me,ye]=GR(F,z,R);g({x:me,y:ye}),B=requestAnimationFrame(oe)}const K={...Y,nodeId:s,type:D,position:Y.position},J=u.get(s);let X={inProgress:!0,isValid:null,from:Zs(J,K,he.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:F,toHandle:null,toPosition:q_[K.position],toNode:null,pointer:F};function ee(){V=!0,k(X),b==null||b(e,{nodeId:s,handleId:r,handleType:D})}T===0&&ee();function ie(me){if(!V){const{x:Ne,y:tt}=Fn(me),Le=Ne-$,vt=tt-U;if(!(Le*Le+vt*vt>T*T))return;ee()}if(!j()||!K){ue(me);return}const ye=C();F=Fn(me,z),O=Fq(_l(F,ye,!1,[1,1]),n,u,K),q||(oe(),q=!0);const pe=hT(me,{handle:O,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:P,lib:d,flowId:p,nodeLookup:u});W=pe.handleDomNode,G=pe.connection,L=Bq(!!O,pe.isValid);const _e=u.get(s),xe=_e?Zs(_e,K,he.Left,!0):X.from,Ce={...X,from:xe,isValid:L,to:pe.toHandle&&L?sd({x:pe.toHandle.x,y:pe.toHandle.y},ye):F,toHandle:pe.toHandle,toPosition:L&&pe.toHandle?pe.toHandle.position:q_[K.position],toNode:pe.toHandle?u.get(pe.toHandle.nodeId):null,pointer:F};k(Ce),X=Ce}function ue(me){if(!("touches"in me&&me.touches.length>0)){if(V){(O||W)&&G&&L&&(x==null||x(G));const{inProgress:ye,...pe}=X,_e={...pe,toPosition:X.toHandle?X.toPosition:null};w==null||w(me,_e),o&&(N==null||N(me,_e))}v(),cancelAnimationFrame(B),q=!1,L=!1,G=null,W=null,P.removeEventListener("mousemove",ie),P.removeEventListener("mouseup",ue),P.removeEventListener("touchmove",ie),P.removeEventListener("touchend",ue)}}P.addEventListener("mousemove",ie),P.addEventListener("mouseup",ue),P.addEventListener("touchmove",ie),P.addEventListener("touchend",ue)}function hT(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:a,lib:c,flowId:u,isValidConnection:d=fT,nodeLookup:m}){const p=o==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Fn(e),x=a.elementFromPoint(v,b),w=x!=null&&x.classList.contains(`${c}-flow__handle`)?x:g,S={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const N=dT(void 0,w),k=w.getAttribute("data-nodeid"),C=w.getAttribute("data-handleid"),j=w.classList.contains("connectable"),R=w.classList.contains("connectableend");if(!k||!N)return S;const T={source:p?k:r,sourceHandle:p?C:s,target:p?r:k,targetHandle:p?s:C};S.connection=T;const P=j&&R&&(n===ho.Strict?p&&N==="source"||!p&&N==="target":k!==r||C!==s);S.isValid=P&&d(T),S.toHandle=uT(k,N,C,m,n,!0)}return S}const Mx={onPointerDown:zq,isValid:hT};function Vq({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=un(e);function o({translateExtent:c,width:u,height:d,zoomStep:m=1,pannable:p=!0,zoomable:g=!0,inversePan:v=!1}){const b=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const C=n(),j=k.sourceEvent.ctrlKey&&il()?10:1,R=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*m,T=C[2]*Math.pow(2,R*j);t.scaleTo(T)};let x=[0,0];const w=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(x=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},S=k=>{const C=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const j=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],R=[j[0]-x[0],j[1]-x[1]];x=j;const T=r()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),M={x:C[0]-R[0]*T,y:C[1]-R[1]*T},P=[[0,0],[u,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:C[2]},P,c)},N=FR().on("start",w).on("zoom",p?S:null).on("zoom.wheel",g?b:null);s.call(N,{})}function a(){s.on("zoom",null)}return{update:o,destroy:a,pointer:Ln}}const Ad=e=>({x:e.x,y:e.y,zoom:e.k}),_p=({x:e,y:t,zoom:n})=>Cd.translate(e,t).scale(n),Qi=(e,t)=>e.target.closest(`.${t}`),pT=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Uq=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kp=(e,t=0,n=Uq,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},mT=e=>{const t=e.ctrlKey&&il()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hq({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}){return m=>{if(Qi(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(m.ctrlKey&&a){const w=Ln(m),S=mT(m),N=p*Math.pow(2,S);r.scaleTo(n,N,w,m);return}const g=m.deltaMode===1?20:1;let v=s===Ys.Vertical?0:m.deltaX*g,b=s===Ys.Horizontal?0:m.deltaY*g;!il()&&m.shiftKey&&s!==Ys.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/p)*o,-(b/p)*o,{internal:!0});const x=Ad(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,x),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,x))}}function Wq({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=Qi(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function Kq({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ad(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Gq({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&pT(t,e.mouseButton??0)),(a=o.sourceEvent)!=null&&a.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((c=o.sourceEvent)!=null&&c.internal)&&(s==null||s(o.sourceEvent,Ad(o.transform)))}}function Yq({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&pT(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Ad(a.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,u)},n?150:0)}}}function Xq({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:m}){return p=>{var w;const g=e||t,v=n&&p.ctrlKey,b=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Qi(p,`${d}-flow__node`)||Qi(p,`${d}-flow__edge`)))return!0;if(!r&&!g&&!s&&!o&&!n||a||m&&!b||Qi(p,c)&&b||Qi(p,u)&&(!b||s&&b&&!e)||!n&&p.ctrlKey&&b)return!1;if(!n&&p.type==="touchstart"&&((w=p.touches)==null?void 0:w.length)>1)return p.preventDefault(),!1;if(!g&&!s&&!v&&b||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||b)&&x}}function Qq({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),p=FR().scaleExtent([t,n]).translateExtent(r),g=un(e).call(p);N({x:s.x,y:s.y,zoom:po(s.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(mT);function x(O,$){return g?new Promise(U=>{p==null||p.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).transform(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),O)}):Promise.resolve(!1)}function w({noWheelClassName:O,noPanClassName:$,onPaneContextMenu:U,userSelectionActive:D,panOnScroll:z,panOnDrag:V,panOnScrollMode:Y,panOnScrollSpeed:F,preventScrolling:q,zoomOnPinch:G,zoomOnScroll:L,zoomOnDoubleClick:W,zoomActivationKeyPressed:oe,lib:K,onTransformChange:J,connectionInProgress:te,paneClickDistance:X,selectionOnDrag:ee}){D&&!d.isZoomingOrPanning&&S();const ie=z&&!oe&&!D;p.clickDistance(ee?1/0:!qn(X)||X<0?0:X);const ue=ie?Hq({zoomPanValues:d,noWheelClassName:O,d3Selection:g,d3Zoom:p,panOnScrollMode:Y,panOnScrollSpeed:F,zoomOnPinch:G,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):Wq({noWheelClassName:O,preventScrolling:q,d3ZoomHandler:v});if(g.on("wheel.zoom",ue,{passive:!1}),!D){const ye=Kq({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:a});p.on("start",ye);const pe=Gq({zoomPanValues:d,panOnDrag:V,onPaneContextMenu:!!U,onPanZoom:o,onTransformChange:J});p.on("zoom",pe);const _e=Yq({zoomPanValues:d,panOnDrag:V,panOnScroll:z,onPaneContextMenu:U,onPanZoomEnd:c,onDraggingChange:u});p.on("end",_e)}const me=Xq({zoomActivationKeyPressed:oe,panOnDrag:V,zoomOnScroll:L,panOnScroll:z,zoomOnDoubleClick:W,zoomOnPinch:G,userSelectionActive:D,noPanClassName:$,noWheelClassName:O,lib:K,connectionInProgress:te});p.filter(me),W?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){p.on("zoom",null)}async function N(O,$,U){const D=_p(O),z=p==null?void 0:p.constrain()(D,$,U);return z&&await x(z),new Promise(V=>V(z))}async function k(O,$){const U=_p(O);return await x(U,$),new Promise(D=>D(U))}function C(O){if(g){const $=_p(O),U=g.property("__zoom");(U.k!==O.zoom||U.x!==O.x||U.y!==O.y)&&(p==null||p.transform(g,$,null,{sync:!0}))}}function j(){const O=g?qR(g.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function R(O,$){return g?new Promise(U=>{p==null||p.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).scaleTo(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),O)}):Promise.resolve(!1)}function T(O,$){return g?new Promise(U=>{p==null||p.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).scaleBy(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),O)}):Promise.resolve(!1)}function M(O){p==null||p.scaleExtent(O)}function P(O){p==null||p.translateExtent(O)}function B(O){const $=!qn(O)||O<0?0:O;p==null||p.clickDistance($)}return{update:w,destroy:S,setViewport:k,setViewportConstrained:N,getViewport:j,scaleTo:R,scaleBy:T,setScaleExtent:M,setTranslateExtent:P,syncViewport:C,setClickDistance:B}}var yo;(function(e){e.Line="line",e.Handle="handle"})(yo||(yo={}));function Jq({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const a=e-t,c=n-r,u=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(u[0]=u[0]*-1),c&&o&&(u[1]=u[1]*-1),u}function J_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function ls(e,t){return Math.max(0,t-e)}function cs(e,t){return Math.max(0,e-t)}function hu(e,t,n){return Math.max(0,t-e,e-n)}function Z_(e,t){return e?!t:t}function Zq(e,t,n,r,s,o,a,c){let{affectsX:u,affectsY:d}=t;const{isHorizontal:m,isVertical:p}=t,g=m&&p,{xSnapped:v,ySnapped:b}=n,{minWidth:x,maxWidth:w,minHeight:S,maxHeight:N}=r,{x:k,y:C,width:j,height:R,aspectRatio:T}=e;let M=Math.floor(m?v-e.pointerX:0),P=Math.floor(p?b-e.pointerY:0);const B=j+(u?-M:M),O=R+(d?-P:P),$=-o[0]*j,U=-o[1]*R;let D=hu(B,x,w),z=hu(O,S,N);if(a){let F=0,q=0;u&&M<0?F=ls(k+M+$,a[0][0]):!u&&M>0&&(F=cs(k+B+$,a[1][0])),d&&P<0?q=ls(C+P+U,a[0][1]):!d&&P>0&&(q=cs(C+O+U,a[1][1])),D=Math.max(D,F),z=Math.max(z,q)}if(c){let F=0,q=0;u&&M>0?F=cs(k+M,c[0][0]):!u&&M<0&&(F=ls(k+B,c[1][0])),d&&P>0?q=cs(C+P,c[0][1]):!d&&P<0&&(q=ls(C+O,c[1][1])),D=Math.max(D,F),z=Math.max(z,q)}if(s){if(m){const F=hu(B/T,S,N)*T;if(D=Math.max(D,F),a){let q=0;!u&&!d||u&&!d&&g?q=cs(C+U+B/T,a[1][1])*T:q=ls(C+U+(u?M:-M)/T,a[0][1])*T,D=Math.max(D,q)}if(c){let q=0;!u&&!d||u&&!d&&g?q=ls(C+B/T,c[1][1])*T:q=cs(C+(u?M:-M)/T,c[0][1])*T,D=Math.max(D,q)}}if(p){const F=hu(O*T,x,w)/T;if(z=Math.max(z,F),a){let q=0;!u&&!d||d&&!u&&g?q=cs(k+O*T+$,a[1][0])/T:q=ls(k+(d?P:-P)*T+$,a[0][0])/T,z=Math.max(z,q)}if(c){let q=0;!u&&!d||d&&!u&&g?q=ls(k+O*T,c[1][0])/T:q=cs(k+(d?P:-P)*T,c[0][0])/T,z=Math.max(z,q)}}}P=P+(P<0?z:-z),M=M+(M<0?D:-D),s&&(g?B>O*T?P=(Z_(u,d)?-M:M)/T:M=(Z_(u,d)?-P:P)*T:m?(P=M/T,d=u):(M=P*T,u=d));const V=u?k+M:k,Y=d?C+P:C;return{width:j+(u?-M:M),height:R+(d?-P:P),x:o[0]*M*(u?-1:1)+V,y:o[1]*P*(d?-1:1)+Y}}const gT={width:0,height:0,x:0,y:0},eF={...gT,pointerX:0,pointerY:0,aspectRatio:1};function tF(e){return[[0,0],[e.measured.width,e.measured.height]]}function nF(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,c=n[0]*o,u=n[1]*a;return[[r-c,s-u],[r+o-c,s+a-u]]}function rF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=un(e);let a={controlDirection:J_("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:m,keepAspectRatio:p,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:x,shouldResize:w}){let S={...gT},N={...eF};a={boundaries:m,resizeDirection:g,keepAspectRatio:p,controlDirection:J_(d)};let k,C=null,j=[],R,T,M,P=!1;const B=NR().on("start",O=>{const{nodeLookup:$,transform:U,snapGrid:D,snapToGrid:z,nodeOrigin:V,paneDomNode:Y}=n();if(k=$.get(t),!k)return;C=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:q}=Wa(O.sourceEvent,{transform:U,snapGrid:D,snapToGrid:z,containerBounds:C});S={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},N={...S,pointerX:F,pointerY:q,aspectRatio:S.width/S.height},R=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(R=$.get(k.parentId),T=R&&k.extent==="parent"?tF(R):void 0),j=[],M=void 0;for(const[G,L]of $)if(L.parentId===t&&(j.push({id:G,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const W=nF(L,k,L.origin??V);M?M=[[Math.min(W[0][0],M[0][0]),Math.min(W[0][1],M[0][1])],[Math.max(W[1][0],M[1][0]),Math.max(W[1][1],M[1][1])]]:M=W}v==null||v(O,{...S})}).on("drag",O=>{const{transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:z}=n(),V=Wa(O.sourceEvent,{transform:$,snapGrid:U,snapToGrid:D,containerBounds:C}),Y=[];if(!k)return;const{x:F,y:q,width:G,height:L}=S,W={},oe=k.origin??z,{width:K,height:J,x:te,y:X}=Zq(N,a.controlDirection,V,a.boundaries,a.keepAspectRatio,oe,T,M),ee=K!==G,ie=J!==L,ue=te!==F&&ee,me=X!==q&&ie;if(!ue&&!me&&!ee&&!ie)return;if((ue||me||oe[0]===1||oe[1]===1)&&(W.x=ue?te:S.x,W.y=me?X:S.y,S.x=W.x,S.y=W.y,j.length>0)){const xe=te-F,Ce=X-q;for(const Ne of j)Ne.position={x:Ne.position.x-xe+oe[0]*(K-G),y:Ne.position.y-Ce+oe[1]*(J-L)},Y.push(Ne)}if((ee||ie)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:S.width,W.height=ie&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:S.height,S.width=W.width,S.height=W.height),R&&k.expandParent){const xe=oe[0]*(W.width??0);W.x&&W.x<xe&&(S.x=xe,N.x=N.x-(W.x-xe));const Ce=oe[1]*(W.height??0);W.y&&W.y<Ce&&(S.y=Ce,N.y=N.y-(W.y-Ce))}const ye=Jq({width:S.width,prevWidth:G,height:S.height,prevHeight:L,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),pe={...S,direction:ye};(w==null?void 0:w(O,pe))!==!1&&(P=!0,b==null||b(O,pe),r(W,Y))}).on("end",O=>{P&&(x==null||x(O,{...S}),s==null||s({...S}),P=!1)});o.call(B)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}var Np={exports:{}},Cp={},Ep={exports:{}},jp={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var ek;function sF(){if(ek)return jp;ek=1;var e=yl();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(p,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),x=b[0].inst,w=b[1];return o(function(){x.value=v,x.getSnapshot=g,u(x)&&w({inst:x})},[p,v,g]),s(function(){return u(x)&&w({inst:x}),p(function(){u(x)&&w({inst:x})})},[p]),a(v),v}function u(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function d(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return jp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,jp}var tk;function iF(){return tk||(tk=1,Ep.exports=sF()),Ep.exports}/**
|
|
49
|
-
* @license React
|
|
50
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var nk;function oF(){if(nk)return Cp;nk=1;var e=yl(),t=iF();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Cp.useSyncExternalStoreWithSelector=function(d,m,p,g,v){var b=o(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=c(function(){function S(R){if(!N){if(N=!0,k=R,R=g(R),v!==void 0&&x.hasValue){var T=x.value;if(v(T,R))return C=T}return C=R}if(T=C,r(k,R))return T;var M=g(R);return v!==void 0&&v(T,M)?(k=R,T):(k=R,C=M)}var N=!1,k,C,j=p===void 0?null:p;return[function(){return S(m())},j===null?void 0:function(){return S(j())}]},[m,p,g,v]);var w=s(d,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w},Cp}var rk;function aF(){return rk||(rk=1,Np.exports=oF()),Np.exports}var lF=aF();const cF=gl(lF),uF={},sk=e=>{let t;const n=new Set,r=(m,p)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(uF?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,s,u);return u},dF=e=>e?sk(e):sk,{useDebugValue:fF}=pt,{useSyncExternalStoreWithSelector:hF}=cF,pF=e=>e;function yT(e,t=pF,n){const r=hF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return fF(r),r}const ik=(e,t)=>{const n=dF(e),r=(s,o=t)=>yT(n,s,o);return Object.assign(r,n),r},mF=(e,t)=>e?ik(e,t):ik;function Qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Nw=uR();const gF=gl(Nw),Rd=A.createContext(null),yF=Rd.Provider,vT=cr.error001();function De(e,t){const n=A.useContext(Rd);if(n===null)throw new Error(vT);return yT(n,e,t)}function Je(){const e=A.useContext(Rd);if(e===null)throw new Error(vT);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ok={display:"none"},vF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xT="react-flow__node-desc",wT="react-flow__edge-desc",xF="react-flow__aria-live",wF=e=>e.ariaLiveMessage,bF=e=>e.ariaLabelConfig;function SF({rfId:e}){const t=De(wF);return h.jsx("div",{id:`${xF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vF,children:t})}function _F({rfId:e,disableKeyboardA11y:t}){const n=De(bF);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${xT}-${e}`,style:ok,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${wT}-${e}`,style:ok,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(SF,{rfId:e})]})}const Td=A.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const a=`${e}`.split("-");return h.jsx("div",{className:gt(["react-flow__panel",n,...a]),style:r,ref:o,...s,children:t})});Td.displayName="Panel";function kF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(Td,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const NF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},pu=e=>e.id;function CF(e,t){return Qe(e.selectedNodes.map(pu),t.selectedNodes.map(pu))&&Qe(e.selectedEdges.map(pu),t.selectedEdges.map(pu))}function EF({onSelectionChange:e}){const t=Je(),{selectedNodes:n,selectedEdges:r}=De(NF,CF);return A.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const jF=e=>!!e.onSelectionChangeHandlers;function AF({onSelectionChange:e}){const t=De(jF);return e||t?h.jsx(EF,{onSelectionChange:e}):null}const bT=[0,0],RF={x:0,y:0,zoom:1},TF=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ak=[...TF,"rfId"],IF=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),lk={translateExtent:nl,nodeOrigin:bT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function MF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:u}=De(IF,Qe),d=Je();A.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=lk,c()}),[]);const m=A.useRef(lk);return A.useEffect(()=>{for(const p of ak){const g=e[p],v=m.current[p];g!==v&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?r(g):p==="maxZoom"?s(g):p==="translateExtent"?o(g):p==="nodeExtent"?a(g):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:gq(g)}):p==="fitView"?d.setState({fitViewQueued:g}):p==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[p]:g})))}m.current=e},ak.map(p=>e[p])),null}function ck(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function OF(e){var r;const[t,n]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){n(e);return}const s=ck(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=ck())!=null&&r.matches?"dark":"light"}const uk=typeof document<"u"?document:null;function ol(e=null,t={target:uk,actInsideInputWithModifier:!0}){const[n,r]=A.useState(!1),s=A.useRef(!1),o=A.useRef(new Set([])),[a,c]=A.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),m=d.reduce((p,g)=>p.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return A.useEffect(()=>{const u=(t==null?void 0:t.target)??uk,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var w,S;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&ZR(v))return!1;const x=fk(v.code,c);if(o.current.add(v[x]),dk(a,o.current,!1)){const N=((S=(w=v.composedPath)==null?void 0:w.call(v))==null?void 0:S[0])||v.target,k=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(s.current||!k)&&v.preventDefault(),r(!0)}},p=v=>{const b=fk(v.code,c);dk(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function dk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function fk(e,t){return t.includes(e)?"code":"key"}const PF=()=>{const e=Je();return A.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),u=vw(t,r,s,o,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:u}=a.getBoundingClientRect(),d={x:t.x-c,y:t.y-u},m=n.snapGrid??s,p=n.snapToGrid??o;return _l(d,r,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),a=sd(t,n);return{x:a.x+s,y:a.y+o}}}),[])};function ST(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const u of a)LF(u,c);n.push(c)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function LF(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function _T(e,t){return ST(e,t)}function kT(e,t){return ST(e,t)}function Vs(e,t){return{id:e,type:"select",selected:t}}function Ji(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const a=t.has(s);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Vs(o.id,a)))}return r}function hk({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,a]of e.entries()){const c=t.get(a.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function pk(e){return{id:e.id,type:"remove"}}const mk=e=>oq(e),DF=e=>HR(e);function NT(e){return A.forwardRef(e)}const $F=typeof window<"u"?A.useLayoutEffect:A.useEffect;function gk(e){const[t,n]=A.useState(BigInt(0)),[r]=A.useState(()=>qF(()=>n(s=>s+BigInt(1))));return $F(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function qF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const CT=A.createContext(null);function FF({children:e}){const t=Je(),n=A.useCallback(c=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:m,onNodesChange:p,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let x=u;for(const S of c)x=typeof S=="function"?S(x):S;let w=hk({items:x,lookup:g});for(const S of b.values())w=S(w);m&&d(x),w.length>0?p==null||p(w):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:N,setNodes:k}=t.getState();S&&k(N)})},[]),r=gk(n),s=A.useCallback(c=>{const{edges:u=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:g}=t.getState();let v=u;for(const b of c)v=typeof b=="function"?b(v):b;m?d(v):p&&p(hk({items:v,lookup:g}))},[]),o=gk(s),a=A.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(CT.Provider,{value:a,children:e})}function BF(){const e=A.useContext(CT);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zF=e=>!!e.panZoom;function _o(){const e=PF(),t=Je(),n=BF(),r=De(zF),s=A.useMemo(()=>{const o=p=>t.getState().nodeLookup.get(p),a=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var S,N;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=mk(p)?p:g.get(p.id),x=b.parentId?QR(b.position,b.measured,b.parentId,g,v):b.position,w={...b,position:x,width:((S=b.measured)==null?void 0:S.width)??b.width,height:((N=b.measured)==null?void 0:N.height)??b.height};return mo(w)},d=(p,g,v={replace:!1})=>{a(b=>b.map(x=>{if(x.id===p){const w=typeof g=="function"?g(x):g;return v.replace&&mk(w)?w:{...x,...w}}return x}))},m=(p,g,v={replace:!1})=>{c(b=>b.map(x=>{if(x.id===p){const w=typeof g=="function"?g(x):g;return v.replace&&DF(w)?w:{...x,...w}}return x}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var g;return(g=o(p))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:a,setEdges:c,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(v=>[...v,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:v}=t.getState(),[b,x,w]=v;return{nodes:p.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:b,y:x,zoom:w}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:x,onEdgesDelete:w,triggerNodeChanges:S,triggerEdgeChanges:N,onDelete:k,onBeforeDelete:C}=t.getState(),{nodes:j,edges:R}=await dq({nodesToRemove:p,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:C}),T=R.length>0,M=j.length>0;if(T){const P=R.map(pk);w==null||w(R),N(P)}if(M){const P=j.map(pk);x==null||x(j),S(P)}return(M||T)&&(k==null||k({nodes:j,edges:R})),{deletedNodes:j,deletedEdges:R}},getIntersectingNodes:(p,g=!0,v)=>{const b=B_(p),x=b?p:u(p),w=v!==void 0;return x?(v||t.getState().nodes).filter(S=>{const N=t.getState().nodeLookup.get(S.id);if(N&&!b&&(S.id===p.id||!N.internals.positionAbsolute))return!1;const k=mo(w?S:N),C=sl(k,x);return g&&C>0||C>=k.width*k.height||C>=x.width*x.height}):[]},isNodeIntersecting:(p,g,v=!0)=>{const x=B_(p)?p:u(p);if(!x)return!1;const w=sl(x,g);return v&&w>0||w>=g.width*g.height||w>=x.width*x.height},updateNode:d,updateNodeData:(p,g,v={replace:!1})=>{d(p,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},updateEdge:m,updateEdgeData:(p,g,v={replace:!1})=>{m(p,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return aq(p,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:p,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${p}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${p?g?`-${p}-${g}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const g=t.getState().fitViewResolver??mq();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return A.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const yk=e=>e.selected,VF=typeof window<"u"?window:void 0;function UF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Je(),{deleteElements:r}=_o(),s=ol(e,{actInsideInputWithModifier:!1}),o=ol(t,{target:VF});A.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(yk),edges:a.filter(yk)}),n.setState({nodesSelectionActive:!1})}},[s]),A.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function HF(e){const t=Je();A.useEffect(()=>{const n=()=>{var s,o,a,c;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=xw(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",cr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Id={position:"absolute",width:"100%",height:"100%",top:0,left:0},WF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function KF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Ys.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:m,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:x,noPanClassName:w,onViewportChange:S,isControlledViewport:N,paneClickDistance:k,selectionOnDrag:C}){const j=Je(),R=A.useRef(null),{userSelectionActive:T,lib:M,connectionInProgress:P}=De(WF,Qe),B=ol(g),O=A.useRef();HF(R);const $=A.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),N||j.setState({transform:U})},[S,N]);return A.useEffect(()=>{if(R.current){O.current=Qq({domNode:R.current,minZoom:m,maxZoom:p,translateExtent:d,viewport:u,onDraggingChange:V=>j.setState({paneDragging:V}),onPanZoomStart:(V,Y)=>{const{onViewportChangeStart:F,onMoveStart:q}=j.getState();q==null||q(V,Y),F==null||F(Y)},onPanZoom:(V,Y)=>{const{onViewportChange:F,onMove:q}=j.getState();q==null||q(V,Y),F==null||F(Y)},onPanZoomEnd:(V,Y)=>{const{onViewportChangeEnd:F,onMoveEnd:q}=j.getState();q==null||q(V,Y),F==null||F(Y)}});const{x:U,y:D,zoom:z}=O.current.getViewport();return j.setState({panZoom:O.current,transform:[U,D,z],domNode:R.current.closest(".react-flow")}),()=>{var V;(V=O.current)==null||V.destroy()}}},[]),A.useEffect(()=>{var U;(U=O.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:w,userSelectionActive:T,noWheelClassName:x,lib:M,onTransformChange:$,connectionInProgress:P,selectionOnDrag:C,paneClickDistance:k})},[e,t,n,r,s,o,a,c,B,v,w,T,x,M,$,P,C,k]),h.jsx("div",{className:"react-flow__renderer",ref:R,style:Id,children:b})}const GF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YF(){const{userSelectionActive:e,userSelectionRect:t}=De(GF,Qe);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ap=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},XF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function QF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=rl.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const x=Je(),{userSelectionActive:w,elementsSelectable:S,dragging:N,connectionInProgress:k}=De(XF,Qe),C=S&&(e||w),j=A.useRef(null),R=A.useRef(),T=A.useRef(new Set),M=A.useRef(new Set),P=A.useRef(!1),B=F=>{if(P.current||k){P.current=!1;return}u==null||u(F),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},O=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}d==null||d(F)},$=m?F=>m(F):void 0,U=F=>{P.current&&(F.stopPropagation(),P.current=!1)},D=F=>{var J,te;const{domNode:q}=x.getState();if(R.current=q==null?void 0:q.getBoundingClientRect(),!R.current)return;const G=F.target===j.current;if(!G&&!!F.target.closest(".nokey")||!e||!(o&&G||t)||F.button!==0||!F.isPrimary)return;(te=(J=F.target)==null?void 0:J.setPointerCapture)==null||te.call(J,F.pointerId),P.current=!1;const{x:oe,y:K}=Fn(F.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:oe,startY:K,x:oe,y:K}}),G||(F.stopPropagation(),F.preventDefault())},z=F=>{const{userSelectionRect:q,transform:G,nodeLookup:L,edgeLookup:W,connectionLookup:oe,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:te,resetSelectedElements:X}=x.getState();if(!R.current||!q)return;const{x:ee,y:ie}=Fn(F.nativeEvent,R.current),{startX:ue,startY:me}=q;if(!P.current){const Ce=t?0:s;if(Math.hypot(ee-ue,ie-me)<=Ce)return;X(),a==null||a(F)}P.current=!0;const ye={startX:ue,startY:me,x:ee<ue?ee:ue,y:ie<me?ie:me,width:Math.abs(ee-ue),height:Math.abs(ie-me)},pe=T.current,_e=M.current;T.current=new Set(yw(L,ye,G,n===rl.Partial,!0).map(Ce=>Ce.id)),M.current=new Set;const xe=(te==null?void 0:te.selectable)??!0;for(const Ce of T.current){const Ne=oe.get(Ce);if(Ne)for(const{edgeId:tt}of Ne.values()){const Le=W.get(tt);Le&&(Le.selectable??xe)&&M.current.add(tt)}}if(!z_(pe,T.current)){const Ce=Ji(L,T.current,!0);K(Ce)}if(!z_(_e,M.current)){const Ce=Ji(W,M.current);J(Ce)}x.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},V=F=>{var q,G;F.button===0&&((G=(q=F.target)==null?void 0:q.releasePointerCapture)==null||G.call(q,F.pointerId),!w&&F.target===j.current&&x.getState().userSelectionRect&&(B==null||B(F)),x.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(F),x.setState({nodesSelectionActive:T.current.size>0})))},Y=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:gt(["react-flow__pane",{draggable:Y,dragging:N,selection:e}]),onClick:C?void 0:Ap(B,j),onContextMenu:Ap(O,j),onWheel:Ap($,j),onPointerEnter:C?void 0:p,onPointerMove:C?z:g,onPointerUp:C?V:void 0,onPointerDownCapture:C?D:void 0,onClickCapture:C?U:void 0,onPointerLeave:v,ref:j,style:Id,children:[b,h.jsx(YF,{})]})}function Ox({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:a,nodeLookup:c,onError:u}=t.getState(),d=c.get(e);if(!d){u==null||u("012",cr.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):s([e])}function ET({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:a}){const c=Je(),[u,d]=A.useState(!1),m=A.useRef();return A.useEffect(()=>{m.current=Dq({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{Ox({id:p,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),A.useEffect(()=>{var p,g;if(t)(p=m.current)==null||p.destroy();else if(e.current)return(g=m.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:a}),()=>{var v;(v=m.current)==null||v.destroy()}},[n,r,t,o,e,s]),u}const JF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function jT(){const e=Je();return A.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:u,nodeLookup:d,nodeOrigin:m}=e.getState(),p=new Map,g=JF(a),v=s?o[0]:5,b=s?o[1]:5,x=n.direction.x*v*n.factor,w=n.direction.y*b*n.factor;for(const[,S]of d){if(!g(S))continue;let N={x:S.internals.positionAbsolute.x+x,y:S.internals.positionAbsolute.y+w};s&&(N=Sl(N,o));const{position:k,positionAbsolute:C}=WR({nodeId:S.id,nextPosition:N,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:c});S.position=k,S.internals.positionAbsolute=C,p.set(S.id,S)}u(p)},[])}const Cw=A.createContext(null),ZF=Cw.Provider;Cw.Consumer;const AT=()=>A.useContext(Cw),eB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),tB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:u,isValid:d}=a,m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===ho.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:m&&d}};function nB({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:u,className:d,onMouseDown:m,onTouchStart:p,...g},v){var z,V;const b=a||null,x=e==="target",w=Je(),S=AT(),{connectOnClick:N,noPanClassName:k,rfId:C}=De(eB,Qe),{connectingFrom:j,connectingTo:R,clickConnecting:T,isPossibleEndHandle:M,connectionInProcess:P,clickConnectionInProcess:B,valid:O}=De(tB(S,b,e),Qe);S||(V=(z=w.getState()).onError)==null||V.call(z,"010",cr.error010());const $=Y=>{const{defaultEdgeOptions:F,onConnect:q,hasDefaultEdges:G}=w.getState(),L={...F,...Y};if(G){const{edges:W,setEdges:oe}=w.getState();oe(sT(L,W))}q==null||q(L),c==null||c(L)},U=Y=>{if(!S)return;const F=eT(Y.nativeEvent);if(s&&(F&&Y.button===0||!F)){const q=w.getState();Mx.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:x,handleId:b,nodeId:S,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:q.onConnectEnd,updateConnection:q.updateConnection,onConnect:$,isValidConnection:n||q.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}F?m==null||m(Y):p==null||p(Y)},D=Y=>{const{onClickConnectStart:F,onClickConnectEnd:q,connectionClickStartHandle:G,connectionMode:L,isValidConnection:W,lib:oe,rfId:K,nodeLookup:J,connection:te}=w.getState();if(!S||!G&&!s)return;if(!G){F==null||F(Y.nativeEvent,{nodeId:S,handleId:b,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const X=JR(Y.target),ee=n||W,{connection:ie,isValid:ue}=Mx.isValid(Y.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:L,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:ee,flowId:K,doc:X,lib:oe,nodeLookup:J});ue&&ie&&$(ie);const me=structuredClone(te);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,q==null||q(Y,me),w.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":b,"data-nodeid":S,"data-handlepos":t,"data-id":`${C}-${S}-${b}-${e}`,className:gt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,d,{source:!x,target:x,connectable:r,connectablestart:s,connectableend:o,clickconnecting:T,connectingfrom:j,connectingto:R,valid:O,connectionindicator:r&&(!P||M)&&(P||B?o:s)}]),onMouseDown:U,onTouchStart:U,onClick:N?D:void 0,ref:v,...g,children:u})}const qe=A.memo(NT(nB));function rB({data:e,isConnectable:t,sourcePosition:n=he.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(qe,{type:"source",position:n,isConnectable:t})]})}function sB({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(qe,{type:"source",position:r,isConnectable:t})]})}function iB(){return null}function oB({data:e,isConnectable:t,targetPosition:n=he.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const id={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vk={input:rB,default:sB,output:oB,group:iB};function aB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const lB=e=>{const{width:t,height:n,x:r,y:s}=bl(e.nodeLookup,{filter:o=>!!o.selected});return{width:qn(t)?t:null,height:qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function cB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Je(),{width:s,height:o,transformString:a,userSelectionActive:c}=De(lB,Qe),u=jT(),d=A.useRef(null);if(A.useEffect(()=>{var g;n||(g=d.current)==null||g.focus({preventScroll:!0})},[n]),ET({nodeRef:d}),c||!s||!o)return null;const m=e?g=>{const v=r.getState().nodes.filter(b=>b.selected);e(g,v)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(id,g.key)&&(g.preventDefault(),u({direction:id[g.key],factor:g.shiftKey?4:1}))};return h.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:s,height:o}})})}const xk=typeof window<"u"?window:void 0,uB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function RT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:m,selectionMode:p,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:j,panOnScrollMode:R,zoomOnDoubleClick:T,panOnDrag:M,defaultViewport:P,translateExtent:B,minZoom:O,maxZoom:$,preventScrolling:U,onSelectionContextMenu:D,noWheelClassName:z,noPanClassName:V,disableKeyboardA11y:Y,onViewportChange:F,isControlledViewport:q}){const{nodesSelectionActive:G,userSelectionActive:L}=De(uB,Qe),W=ol(d,{target:xk}),oe=ol(x,{target:xk}),K=oe||M,J=oe||C,te=m&&K!==!0,X=W||L||te;return UF({deleteKeyCode:u,multiSelectionKeyCode:b}),h.jsx(KF,{onPaneContextMenu:o,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:k,panOnScroll:J,panOnScrollSpeed:j,panOnScrollMode:R,zoomOnDoubleClick:T,panOnDrag:!W&&K,defaultViewport:P,translateExtent:B,minZoom:O,maxZoom:$,zoomActivationKeyCode:w,preventScrolling:U,noWheelClassName:z,noPanClassName:V,onViewportChange:F,isControlledViewport:q,paneClickDistance:c,selectionOnDrag:te,children:h.jsxs(QF,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:K,isSelecting:!!X,selectionMode:p,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:te,children:[e,G&&h.jsx(cB,{onSelectionContextMenu:D,noPanClassName:V,disableKeyboardA11y:Y})]})})}RT.displayName="FlowRenderer";const dB=A.memo(RT),fB=e=>t=>e?yw(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function hB(e){return De(A.useCallback(fB(e),[e]),Qe)}const pB=e=>e.updateNodeInternals;function mB(){const e=De(pB),[t]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function gB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Je(),o=A.useRef(null),a=A.useRef(null),c=A.useRef(e.sourcePosition),u=A.useRef(e.targetPosition),d=A.useRef(t),m=n&&!!e.internals.handleBounds;return A.useEffect(()=>{o.current&&!e.hidden&&(!m||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[m,e.hidden]),A.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),A.useEffect(()=>{if(o.current){const p=d.current!==t,g=c.current!==e.sourcePosition,v=u.current!==e.targetPosition;(p||g||v)&&(d.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function yB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:m,resizeObserver:p,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:x,nodeTypes:w,nodeClickDistance:S,onError:N}){const{node:k,internals:C,isParent:j}=De(ee=>{const ie=ee.nodeLookup.get(e),ue=ee.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ue}},Qe);let R=k.type||"default",T=(w==null?void 0:w[R])||vk[R];T===void 0&&(N==null||N("003",cr.error003(R)),R="default",T=(w==null?void 0:w.default)||vk.default);const M=!!(k.draggable||c&&typeof k.draggable>"u"),P=!!(k.selectable||u&&typeof k.selectable>"u"),B=!!(k.connectable||d&&typeof k.connectable>"u"),O=!!(k.focusable||m&&typeof k.focusable>"u"),$=Je(),U=XR(k),D=gB({node:k,nodeType:R,hasDimensions:U,resizeObserver:p}),z=ET({nodeRef:D,disabled:k.hidden||!M,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:S}),V=jT();if(k.hidden)return null;const Y=Lr(k),F=aB(k),q=P||M||t||n||r||s,G=n?ee=>n(ee,{...C.userNode}):void 0,L=r?ee=>r(ee,{...C.userNode}):void 0,W=s?ee=>s(ee,{...C.userNode}):void 0,oe=o?ee=>o(ee,{...C.userNode}):void 0,K=a?ee=>a(ee,{...C.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ue}=$.getState();P&&(!ie||!M||ue>0)&&Ox({id:e,store:$,nodeRef:D}),t&&t(ee,{...C.userNode})},te=ee=>{if(!(ZR(ee.nativeEvent)||b)){if(BR.includes(ee.key)&&P){const ie=ee.key==="Escape";Ox({id:e,store:$,unselect:ie,nodeRef:D})}else if(M&&k.selected&&Object.prototype.hasOwnProperty.call(id,ee.key)){ee.preventDefault();const{ariaLabelConfig:ie}=$.getState();$.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:id[ee.key],factor:ee.shiftKey?4:1})}}},X=()=>{var _e;if(b||!((_e=D.current)!=null&&_e.matches(":focus-visible")))return;const{transform:ee,width:ie,height:ue,autoPanOnNodeFocus:me,setCenter:ye}=$.getState();if(!me)return;yw(new Map([[e,k]]),{x:0,y:0,width:ie,height:ue},ee,!0).length>0||ye(k.position.x+Y.width/2,k.position.y+Y.height/2,{zoom:ee[2]})};return h.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${R}`,{[v]:M},k.className,{selected:k.selected,selectable:P,parent:j,draggable:M,dragging:z}]),ref:D,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:U?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:L,onMouseLeave:W,onContextMenu:oe,onClick:J,onDoubleClick:K,onKeyDown:O?te:void 0,tabIndex:O?0:void 0,onFocus:O?X:void 0,role:k.ariaRole??(O?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${xT}-${x}`,"aria-label":k.ariaLabel,...k.domAttributes,children:h.jsx(ZF,{value:e,children:h.jsx(T,{id:e,data:k.data,type:R,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:P,draggable:M,deletable:k.deletable??!0,isConnectable:B,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:z,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...Y})})})}var vB=A.memo(yB);const xB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function TT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=De(xB,Qe),a=hB(e.onlyRenderVisibleElements),c=mB();return h.jsx("div",{className:"react-flow__nodes",style:Id,children:a.map(u=>h.jsx(vB,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}TT.displayName="NodeRenderer";const wB=A.memo(TT);function bB(e){return De(A.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);o&&a&&xq({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Qe)}const SB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},_B=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},wk={[nd.Arrow]:SB,[nd.ArrowClosed]:_B};function kB(e){const t=Je();return A.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(wk,e)?wk[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",cr.error009(e)),null)},[e])}const NB=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const u=kB(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:h.jsx(u,{color:n,strokeWidth:a})}):null},IT=({defaultColor:e,rfId:t})=>{const n=De(o=>o.edges),r=De(o=>o.defaultEdgeOptions),s=A.useMemo(()=>Cq(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:s.map(o=>h.jsx(NB,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};IT.displayName="MarkerDefinitions";var CB=A.memo(IT);function MT({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...m}){const[p,g]=A.useState({x:1,y:0,width:0,height:0}),v=gt(["react-flow__edge-textwrapper",d]),b=A.useRef(null);return A.useEffect(()=>{if(b.current){const x=b.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...m,children:[s&&h.jsx("rect",{width:p.width+2*a[0],x:-a[0],y:-a[1],height:p.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),h.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}MT.displayName="EdgeText";const EB=A.memo(MT);function Md({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:gt(["react-flow__edge-path",m.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&qn(t)&&qn(n)?h.jsx(EB,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function bk({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===he.Left||e===he.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function OT({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top}){const[a,c]=bk({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,d]=bk({pos:o,x1:r,y1:s,x2:e,y2:t}),[m,p,g,v]=tT({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${c} ${u},${d} ${r},${s}`,m,p,g,v]}function PT(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a,targetPosition:c,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})=>{const[N,k,C]=OT({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c}),j=e.isInternal?void 0:t;return h.jsx(Md,{id:j,path:N,labelX:k,labelY:C,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})})}const jB=PT({isInternal:!1}),LT=PT({isInternal:!0});jB.displayName="SimpleBezierEdge";LT.displayName="SimpleBezierEdgeInternal";function DT(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:g,sourcePosition:v=he.Bottom,targetPosition:b=he.Top,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:N})=>{const[k,C,j]=Rx({sourceX:n,sourceY:r,sourcePosition:v,targetX:s,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),R=e.isInternal?void 0:t;return h.jsx(Md,{id:R,path:k,labelX:C,labelY:j,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:x,markerStart:w,interactionWidth:N})})}const $T=DT({isInternal:!1}),qT=DT({isInternal:!0});$T.displayName="SmoothStepEdge";qT.displayName="SmoothStepEdgeInternal";function FT(e){return A.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx($T,{...n,id:r,pathOptions:A.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const AB=FT({isInternal:!1}),BT=FT({isInternal:!0});AB.displayName="StepEdge";BT.displayName="StepEdgeInternal";function zT(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:x})=>{const[w,S,N]=iT({sourceX:n,sourceY:r,targetX:s,targetY:o}),k=e.isInternal?void 0:t;return h.jsx(Md,{id:k,path:w,labelX:S,labelY:N,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:x})})}const RB=zT({isInternal:!1}),VT=zT({isInternal:!0});RB.displayName="StraightEdge";VT.displayName="StraightEdgeInternal";function UT(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a=he.Bottom,targetPosition:c=he.Top,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:N})=>{const[k,C,j]=nT({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c,curvature:S==null?void 0:S.curvature}),R=e.isInternal?void 0:t;return h.jsx(Md,{id:R,path:k,labelX:C,labelY:j,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:N})})}const TB=UT({isInternal:!1}),HT=UT({isInternal:!0});TB.displayName="BezierEdge";HT.displayName="BezierEdgeInternal";const Sk={default:HT,straight:VT,step:BT,smoothstep:qT,simplebezier:LT},_k={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},IB=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,MB=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,kk="react-flow__edgeupdater";function Nk({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:a,type:c}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:a,className:gt([kk,`${kk}-${c}`]),cx:IB(t,r,e),cy:MB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function OB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:c,targetPosition:u,onReconnect:d,onReconnectStart:m,onReconnectEnd:p,setReconnecting:g,setUpdateHover:v}){const b=Je(),x=(C,j)=>{if(C.button!==0)return;const{autoPanOnConnect:R,domNode:T,isValidConnection:M,connectionMode:P,connectionRadius:B,lib:O,onConnectStart:$,onConnectEnd:U,cancelConnection:D,nodeLookup:z,rfId:V,panBy:Y,updateConnection:F}=b.getState(),q=j.type==="target",G=(oe,K)=>{g(!1),p==null||p(oe,n,j.type,K)},L=oe=>d==null?void 0:d(n,oe),W=(oe,K)=>{g(!0),m==null||m(C,n,j.type),$==null||$(oe,K)};Mx.onPointerDown(C.nativeEvent,{autoPanOnConnect:R,connectionMode:P,connectionRadius:B,domNode:T,handleId:j.id,nodeId:j.nodeId,nodeLookup:z,isTarget:q,edgeUpdaterType:j.type,lib:O,flowId:V,cancelConnection:D,panBy:Y,isValidConnection:M,onConnect:L,onConnectStart:W,onConnectEnd:U,onReconnectEnd:G,updateConnection:F,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},w=C=>x(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=C=>x(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>v(!0),k=()=>v(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Nk,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:N,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&h.jsx(Nk,{position:u,centerX:o,centerY:a,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:k,type:"target"})]})}function PB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:x,noPanClassName:w,onError:S,disableKeyboardA11y:N}){let k=De(ye=>ye.edgeLookup.get(e));const C=De(ye=>ye.defaultEdgeOptions);k=C?{...C,...k}:k;let j=k.type||"default",R=(x==null?void 0:x[j])||Sk[j];R===void 0&&(S==null||S("011",cr.error011(j)),j="default",R=(x==null?void 0:x.default)||Sk.default);const T=!!(k.focusable||t&&typeof k.focusable>"u"),M=typeof p<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),P=!!(k.selectable||r&&typeof k.selectable>"u"),B=A.useRef(null),[O,$]=A.useState(!1),[U,D]=A.useState(!1),z=Je(),{zIndex:V,sourceX:Y,sourceY:F,targetX:q,targetY:G,sourcePosition:L,targetPosition:W}=De(A.useCallback(ye=>{const pe=ye.nodeLookup.get(k.source),_e=ye.nodeLookup.get(k.target);if(!pe||!_e)return{zIndex:k.zIndex,..._k};const xe=Nq({id:e,sourceNode:pe,targetNode:_e,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ye.connectionMode,onError:S});return{zIndex:vq({selected:k.selected,zIndex:k.zIndex,sourceNode:pe,targetNode:_e,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...xe||_k}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Qe),oe=A.useMemo(()=>k.markerStart?`url('#${Tx(k.markerStart,b)}')`:void 0,[k.markerStart,b]),K=A.useMemo(()=>k.markerEnd?`url('#${Tx(k.markerEnd,b)}')`:void 0,[k.markerEnd,b]);if(k.hidden||Y===null||F===null||q===null||G===null)return null;const J=ye=>{var Ce;const{addSelectedEdges:pe,unselectNodesAndEdges:_e,multiSelectionActive:xe}=z.getState();P&&(z.setState({nodesSelectionActive:!1}),k.selected&&xe?(_e({nodes:[],edges:[k]}),(Ce=B.current)==null||Ce.blur()):pe([e])),s&&s(ye,k)},te=o?ye=>{o(ye,{...k})}:void 0,X=a?ye=>{a(ye,{...k})}:void 0,ee=c?ye=>{c(ye,{...k})}:void 0,ie=u?ye=>{u(ye,{...k})}:void 0,ue=d?ye=>{d(ye,{...k})}:void 0,me=ye=>{var pe;if(!N&&BR.includes(ye.key)&&P){const{unselectNodesAndEdges:_e,addSelectedEdges:xe}=z.getState();ye.key==="Escape"?((pe=B.current)==null||pe.blur(),_e({edges:[k]})):xe([e])}};return h.jsx("svg",{style:{zIndex:V},children:h.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${j}`,k.className,w,{selected:k.selected,animated:k.animated,inactive:!P&&!s,updating:O,selectable:P}]),onClick:J,onDoubleClick:te,onContextMenu:X,onMouseEnter:ee,onMouseMove:ie,onMouseLeave:ue,onKeyDown:T?me:void 0,tabIndex:T?0:void 0,role:k.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":T?`${wT}-${b}`:void 0,ref:B,...k.domAttributes,children:[!U&&h.jsx(R,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:P,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Y,sourceY:F,targetX:q,targetY:G,sourcePosition:L,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:oe,markerEnd:K,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),M&&h.jsx(OB,{edge:k,isReconnectable:M,reconnectRadius:m,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,sourceX:Y,sourceY:F,targetX:q,targetY:G,sourcePosition:L,targetPosition:W,setUpdateHover:$,setReconnecting:D})]})})}var LB=A.memo(PB);const DB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function WT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:S,elementsSelectable:N,onError:k}=De(DB,Qe),C=bB(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(CB,{defaultColor:e,rfId:n}),C.map(j=>h.jsx(LB,{id:j,edgesFocusable:w,edgesReconnectable:S,elementsSelectable:N,noPanClassName:s,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:m,reconnectRadius:p,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:k,edgeTypes:r,disableKeyboardA11y:x},j))]})}WT.displayName="EdgeRenderer";const $B=A.memo(WT),qB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function FB({children:e}){const t=De(qB);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function BB(e){const t=_o(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const zB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function VB(e){const t=De(zB),n=Je();return A.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function UB(e){return e.connection.inProgress?{...e.connection,to:_l(e.connection.to,e.transform)}:{...e.connection}}function HB(e){return UB}function WB(e){const t=HB();return De(t,Qe)}const KB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function GB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:a,isValid:c,inProgress:u}=De(KB,Qe);return!(o&&s&&u)?null:h.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:gt(["react-flow__connection",UR(c)]),children:h.jsx(KT,{style:t,type:n,CustomComponent:r,isValid:c})})})}const KT=({style:e,type:t=ms.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:a,fromHandle:c,fromPosition:u,to:d,toNode:m,toHandle:p,toPosition:g,pointer:v}=WB();if(!s)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:UR(r),toNode:m,toHandle:p,pointer:v});let b="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case ms.Bezier:[b]=nT(x);break;case ms.SimpleBezier:[b]=OT(x);break;case ms.Step:[b]=Rx({...x,borderRadius:0});break;case ms.SmoothStep:[b]=Rx(x);break;default:[b]=iT(x)}return h.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};KT.displayName="ConnectionLine";const YB={};function Ck(e=YB){A.useRef(e),Je(),A.useEffect(()=>{},[e])}function XB(){Je(),A.useRef(!1),A.useEffect(()=>{},[])}function GT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:N,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:j,panActivationKeyCode:R,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:P,elementsSelectable:B,defaultViewport:O,translateExtent:$,minZoom:U,maxZoom:D,preventScrolling:z,defaultMarkerColor:V,zoomOnScroll:Y,zoomOnPinch:F,panOnScroll:q,panOnScrollSpeed:G,panOnScrollMode:L,zoomOnDoubleClick:W,panOnDrag:oe,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:X,onPaneScroll:ee,onPaneContextMenu:ie,paneClickDistance:ue,nodeClickDistance:me,onEdgeContextMenu:ye,onEdgeMouseEnter:pe,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:Ce,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:We,nodeExtent:It,rfId:Mt,viewport:Vt,onViewportChange:Ie}){return Ck(e),Ck(t),XB(),BB(n),VB(Vt),h.jsx(dB,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:X,onPaneContextMenu:ie,onPaneScroll:ee,paneClickDistance:ue,deleteKeyCode:M,selectionKeyCode:N,selectionOnDrag:k,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:R,zoomActivationKeyCode:T,elementsSelectable:B,zoomOnScroll:Y,zoomOnPinch:F,zoomOnDoubleClick:W,panOnScroll:q,panOnScrollSpeed:G,panOnScrollMode:L,panOnDrag:oe,defaultViewport:O,translateExtent:$,minZoom:U,maxZoom:D,onSelectionContextMenu:p,preventScrolling:z,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:We,onViewportChange:Ie,isControlledViewport:!!Vt,children:h.jsxs(FB,{children:[h.jsx($B,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,onlyRenderVisibleElements:P,onEdgeContextMenu:ye,onEdgeMouseEnter:pe,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:Ce,defaultMarkerColor:V,noPanClassName:it,disableKeyboardA11y:We,rfId:Mt}),h.jsx(GB,{style:x,type:b,component:w,containerStyle:S}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(wB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:me,onlyRenderVisibleElements:P,noPanClassName:it,noDragClassName:vt,disableKeyboardA11y:We,nodeExtent:It,rfId:Mt}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}GT.displayName="GraphView";const QB=A.memo(GT),Ek=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:p,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,x=new Map,w=new Map,S=r??t??[],N=n??e??[],k=m??[0,0],C=p??nl;lT(x,w,S);const j=Ix(N,v,b,{nodeOrigin:k,nodeExtent:C,zIndexMode:g});let R=[0,0,1];if(a&&s&&o){const T=bl(v,{filter:O=>!!((O.width||O.initialWidth)&&(O.height||O.initialHeight))}),{x:M,y:P,zoom:B}=vw(T,s,o,u,d,(c==null?void 0:c.padding)??.1);R=[M,P,B]}return{rfId:"1",width:s??0,height:o??0,transform:R,nodes:N,nodesInitialized:j,nodeLookup:v,parentLookup:b,edges:S,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:nl,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ho.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:c,fitViewResolver:null,connection:{...VR},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:fq,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:zR,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:p,zIndexMode:g})=>mF((v,b)=>{async function x(){const{nodeLookup:w,panZoom:S,fitViewOptions:N,fitViewResolver:k,width:C,height:j,minZoom:R,maxZoom:T}=b();S&&(await uq({nodes:w,width:C,height:j,panZoom:S,minZoom:R,maxZoom:T},N),k==null||k.resolve(!0),v({fitViewResolver:null}))}return{...Ek({nodes:e,edges:t,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:p,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:w=>{const{nodeLookup:S,parentLookup:N,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:j,zIndexMode:R}=b(),T=Ix(w,S,N,{nodeOrigin:k,nodeExtent:p,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:R});j&&T?(x(),v({nodes:w,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:T})},setEdges:w=>{const{connectionLookup:S,edgeLookup:N}=b();lT(S,N,w),v({edges:w})},setDefaultNodesAndEdges:(w,S)=>{if(w){const{setNodes:N}=b();N(w),v({hasDefaultNodes:!0})}if(S){const{setEdges:N}=b();N(S),v({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:S,nodeLookup:N,parentLookup:k,domNode:C,nodeOrigin:j,nodeExtent:R,debug:T,fitViewQueued:M,zIndexMode:P}=b(),{changes:B,updatedInternals:O}=Mq(w,N,k,C,j,R,P);O&&(Aq(N,k,{nodeOrigin:j,nodeExtent:R,zIndexMode:P}),M?(x(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(T&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(w,S=!1)=>{const N=[];let k=[];const{nodeLookup:C,triggerNodeChanges:j,connection:R,updateConnection:T,onNodesChangeMiddlewareMap:M}=b();for(const[P,B]of w){const O=C.get(P),$=!!(O!=null&&O.expandParent&&(O!=null&&O.parentId)&&(B!=null&&B.position)),U={id:P,type:"position",position:$?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(O&&R.inProgress&&R.fromNode.id===O.id){const D=Zs(O,R.fromHandle,he.Left,!0);T({...R,from:D})}$&&O.parentId&&N.push({id:P,parentId:O.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),k.push(U)}if(N.length>0){const{parentLookup:P,nodeOrigin:B}=b(),O=kw(N,C,P,B);k.push(...O)}for(const P of M.values())k=P(k);j(k)},triggerNodeChanges:w=>{const{onNodesChange:S,setNodes:N,nodes:k,hasDefaultNodes:C,debug:j}=b();if(w!=null&&w.length){if(C){const R=_T(w,k);N(R)}j&&console.log("React Flow: trigger node changes",w),S==null||S(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:S,setEdges:N,edges:k,hasDefaultEdges:C,debug:j}=b();if(w!=null&&w.length){if(C){const R=kT(w,k);N(R)}j&&console.log("React Flow: trigger edge changes",w),S==null||S(w)}},addSelectedNodes:w=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:j}=b();if(S){const R=w.map(T=>Vs(T,!0));C(R);return}C(Ji(k,new Set([...w]),!0)),j(Ji(N))},addSelectedEdges:w=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:j}=b();if(S){const R=w.map(T=>Vs(T,!0));j(R);return}j(Ji(N,new Set([...w]))),C(Ji(k,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:S}={})=>{const{edges:N,nodes:k,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:R}=b(),T=w||k,M=S||N,P=T.map(O=>{const $=C.get(O.id);return $&&($.selected=!1),Vs(O.id,!1)}),B=M.map(O=>Vs(O.id,!1));j(P),R(B)},setMinZoom:w=>{const{panZoom:S,maxZoom:N}=b();S==null||S.setScaleExtent([w,N]),v({minZoom:w})},setMaxZoom:w=>{const{panZoom:S,minZoom:N}=b();S==null||S.setScaleExtent([N,w]),v({maxZoom:w})},setTranslateExtent:w=>{var S;(S=b().panZoom)==null||S.setTranslateExtent(w),v({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:S,triggerNodeChanges:N,triggerEdgeChanges:k,elementsSelectable:C}=b();if(!C)return;const j=S.reduce((T,M)=>M.selected?[...T,Vs(M.id,!1)]:T,[]),R=w.reduce((T,M)=>M.selected?[...T,Vs(M.id,!1)]:T,[]);N(j),k(R)},setNodeExtent:w=>{const{nodes:S,nodeLookup:N,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:j,nodeExtent:R,zIndexMode:T}=b();w[0][0]===R[0][0]&&w[0][1]===R[0][1]&&w[1][0]===R[1][0]&&w[1][1]===R[1][1]||(Ix(S,N,k,{nodeOrigin:C,nodeExtent:w,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:T}),v({nodeExtent:w}))},panBy:w=>{const{transform:S,width:N,height:k,panZoom:C,translateExtent:j}=b();return Oq({delta:w,panZoom:C,transform:S,translateExtent:j,width:N,height:k})},setCenter:async(w,S,N)=>{const{width:k,height:C,maxZoom:j,panZoom:R}=b();if(!R)return Promise.resolve(!1);const T=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:j;return await R.setViewport({x:k/2-w*T,y:C/2-S*T,zoom:T},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...VR}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...Ek()})}},Object.is);function YT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:m,nodeExtent:p,zIndexMode:g,children:v}){const[b]=A.useState(()=>JB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:d,minZoom:a,maxZoom:c,fitViewOptions:u,nodeOrigin:m,nodeExtent:p,zIndexMode:g}));return h.jsx(yF,{value:b,children:h.jsx(FF,{children:v})})}function ZB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:v}){return A.useContext(Rd)?h.jsx(h.Fragment,{children:e}):h.jsx(YT,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:p,nodeExtent:g,zIndexMode:v,children:e})}const ez={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:m,onMoveStart:p,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,onNodeMouseEnter:N,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:j,onNodeDoubleClick:R,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:P,onNodesDelete:B,onEdgesDelete:O,onDelete:$,onSelectionChange:U,onSelectionDragStart:D,onSelectionDrag:z,onSelectionDragStop:V,onSelectionContextMenu:Y,onSelectionStart:F,onSelectionEnd:q,onBeforeDelete:G,connectionMode:L,connectionLineType:W=ms.Bezier,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:te="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:ee=!1,selectionMode:ie=rl.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:me=il()?"Meta":"Control",zoomActivationKeyCode:ye=il()?"Meta":"Control",snapToGrid:pe,snapGrid:_e,onlyRenderVisibleElements:xe=!1,selectNodesOnDrag:Ce,nodesDraggable:Ne,autoPanOnNodeFocus:tt,nodesConnectable:Le,nodesFocusable:vt,nodeOrigin:xt=bT,edgesFocusable:it,edgesReconnectable:We,elementsSelectable:It=!0,defaultViewport:Mt=RF,minZoom:Vt=.5,maxZoom:Ie=2,translateExtent:be=nl,preventScrolling:ot=!0,nodeExtent:Ve,defaultMarkerColor:Ut="#b1b1b7",zoomOnScroll:hn=!0,zoomOnPinch:Ot=!0,panOnScroll:Pt=!1,panOnScrollSpeed:hi=.5,panOnScrollMode:Lt=Ys.Free,zoomOnDoubleClick:tn=!0,panOnDrag:$o=!0,onPaneClick:qo,onPaneMouseEnter:Fo,onPaneMouseMove:Br,onPaneMouseLeave:zr,onPaneScroll:Ul,onPaneContextMenu:Hl,paneClickDistance:Wl=1,nodeClickDistance:Kl=0,children:Gl,onReconnect:Bo,onReconnectStart:Yl,onReconnectEnd:Cs,onEdgeContextMenu:zo,onEdgeDoubleClick:Es,onEdgeMouseEnter:_f,onEdgeMouseMove:js,onEdgeMouseLeave:pi,reconnectRadius:mi=10,onNodesChange:Vo,onEdgesChange:kf,noDragClassName:Nf="nodrag",noWheelClassName:Cf="nowheel",noPanClassName:Yn="nopan",fitView:Uo,fitViewOptions:Ho,connectOnClick:Ef,attributionPosition:Xl,proOptions:Ql,defaultEdgeOptions:Jl,elevateNodesOnSelect:Zl=!0,elevateEdgesOnSelect:jf=!1,disableKeyboardA11y:ec=!1,autoPanOnConnect:nt,autoPanOnNodeDrag:Af,autoPanSpeed:Wo,connectionRadius:tc,isValidConnection:gi,onError:Rf,style:nc,id:As,nodeDragThreshold:pn,connectionDragThreshold:Tf,viewport:nn,onViewportChange:If,width:Mf,height:Of,colorMode:yi="light",debug:vi,onScroll:Xn,ariaLabelConfig:xi,zIndexMode:rc="basic",...Pf},Ko){const wi=As||"1",Go=OF(yi),Rs=A.useCallback(sc=>{sc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xn==null||Xn(sc)},[Xn]);return h.jsx("div",{"data-testid":"rf__wrapper",...Pf,onScroll:Rs,style:{...nc,...ez},ref:Ko,className:gt(["react-flow",s,Go]),id:As,role:"application",children:h.jsxs(ZB,{nodes:e,edges:t,width:Mf,height:Of,fitView:Uo,fitViewOptions:Ho,minZoom:Vt,maxZoom:Ie,nodeOrigin:xt,nodeExtent:Ve,zIndexMode:rc,children:[h.jsx(QB,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:N,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:j,onNodeDoubleClick:R,nodeTypes:o,edgeTypes:a,connectionLineType:W,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:X,selectionOnDrag:ee,selectionMode:ie,deleteKeyCode:te,multiSelectionKeyCode:me,panActivationKeyCode:ue,zoomActivationKeyCode:ye,onlyRenderVisibleElements:xe,defaultViewport:Mt,translateExtent:be,minZoom:Vt,maxZoom:Ie,preventScrolling:ot,zoomOnScroll:hn,zoomOnPinch:Ot,zoomOnDoubleClick:tn,panOnScroll:Pt,panOnScrollSpeed:hi,panOnScrollMode:Lt,panOnDrag:$o,onPaneClick:qo,onPaneMouseEnter:Fo,onPaneMouseMove:Br,onPaneMouseLeave:zr,onPaneScroll:Ul,onPaneContextMenu:Hl,paneClickDistance:Wl,nodeClickDistance:Kl,onSelectionContextMenu:Y,onSelectionStart:F,onSelectionEnd:q,onReconnect:Bo,onReconnectStart:Yl,onReconnectEnd:Cs,onEdgeContextMenu:zo,onEdgeDoubleClick:Es,onEdgeMouseEnter:_f,onEdgeMouseMove:js,onEdgeMouseLeave:pi,reconnectRadius:mi,defaultMarkerColor:Ut,noDragClassName:Nf,noWheelClassName:Cf,noPanClassName:Yn,rfId:wi,disableKeyboardA11y:ec,nodeExtent:Ve,viewport:nn,onViewportChange:If}),h.jsx(MF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,nodesDraggable:Ne,autoPanOnNodeFocus:tt,nodesConnectable:Le,nodesFocusable:vt,edgesFocusable:it,edgesReconnectable:We,elementsSelectable:It,elevateNodesOnSelect:Zl,elevateEdgesOnSelect:jf,minZoom:Vt,maxZoom:Ie,nodeExtent:Ve,onNodesChange:Vo,onEdgesChange:kf,snapToGrid:pe,snapGrid:_e,connectionMode:L,translateExtent:be,connectOnClick:Ef,defaultEdgeOptions:Jl,fitView:Uo,fitViewOptions:Ho,onNodesDelete:B,onEdgesDelete:O,onDelete:$,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:P,onSelectionDrag:z,onSelectionDragStart:D,onSelectionDragStop:V,onMove:m,onMoveStart:p,onMoveEnd:g,noPanClassName:Yn,nodeOrigin:xt,rfId:wi,autoPanOnConnect:nt,autoPanOnNodeDrag:Af,autoPanSpeed:Wo,onError:Rf,connectionRadius:tc,isValidConnection:gi,selectNodesOnDrag:Ce,nodeDragThreshold:pn,connectionDragThreshold:Tf,onBeforeDelete:G,debug:vi,ariaLabelConfig:xi,zIndexMode:rc}),h.jsx(AF,{onSelectionChange:U}),Gl,h.jsx(kF,{proOptions:Ql,position:Xl}),h.jsx(_F,{rfId:wi,disableKeyboardA11y:ec})]})})}var nz=NT(tz);function rz({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gt(["react-flow__background-pattern",n,r])})}function sz({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:gt(["react-flow__background-pattern","dots",t])})}var Rr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Rr||(Rr={}));const iz={[Rr.Dots]:1,[Rr.Lines]:1,[Rr.Cross]:6},oz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function XT({id:e,variant:t=Rr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:a,bgColor:c,style:u,className:d,patternClassName:m}){const p=A.useRef(null),{transform:g,patternId:v}=De(oz,Qe),b=r||iz[t],x=t===Rr.Dots,w=t===Rr.Cross,S=Array.isArray(n)?n:[n,n],N=[S[0]*g[2]||1,S[1]*g[2]||1],k=b*g[2],C=Array.isArray(o)?o:[o,o],j=w?[k,k]:N,R=[C[0]*g[2]||1+j[0]/2,C[1]*g[2]||1+j[1]/2],T=`${v}${e||""}`;return h.jsxs("svg",{className:gt(["react-flow__background",d]),style:{...u,...Id,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:p,"data-testid":"rf__background",children:[h.jsx("pattern",{id:T,x:g[0]%N[0],y:g[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:x?h.jsx(sz,{radius:k/2,className:m}):h.jsx(rz,{dimensions:j,lineWidth:s,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}XT.displayName="Background";const az=A.memo(XT);function lz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function uz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function dz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function fz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function mu({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:gt(["react-flow__controls-button",t]),...n,children:e})}const hz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function QT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:u,className:d,children:m,position:p="bottom-left",orientation:g="vertical","aria-label":v}){const b=Je(),{isInteractive:x,minZoomReached:w,maxZoomReached:S,ariaLabelConfig:N}=De(hz,Qe),{zoomIn:k,zoomOut:C,fitView:j}=_o(),R=()=>{k(),o==null||o()},T=()=>{C(),a==null||a()},M=()=>{j(s),c==null||c()},P=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},B=g==="horizontal"?"horizontal":"vertical";return h.jsxs(Td,{className:gt(["react-flow__controls",B,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(mu,{onClick:R,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:S,children:h.jsx(lz,{})}),h.jsx(mu,{onClick:T,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:w,children:h.jsx(cz,{})})]}),n&&h.jsx(mu,{className:"react-flow__controls-fitview",onClick:M,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:h.jsx(uz,{})}),r&&h.jsx(mu,{className:"react-flow__controls-interactive",onClick:P,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:x?h.jsx(fz,{}):h.jsx(dz,{})}),m]})}QT.displayName="Controls";const pz=A.memo(QT);function mz({id:e,x:t,y:n,width:r,height:s,style:o,color:a,strokeColor:c,strokeWidth:u,className:d,borderRadius:m,shapeRendering:p,selected:g,onClick:v}){const{background:b,backgroundColor:x}=o||{},w=a||b||x;return h.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:s,style:{fill:w,stroke:c,strokeWidth:u},shapeRendering:p,onClick:v?S=>v(S,e):void 0})}const gz=A.memo(mz),yz=e=>e.nodes.map(t=>t.id),Rp=e=>e instanceof Function?e:()=>e;function vz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=gz,onClick:a}){const c=De(yz,Qe),u=Rp(t),d=Rp(e),m=Rp(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:c.map(g=>h.jsx(wz,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:a,shapeRendering:p},g))})}function xz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:u}){const{node:d,x:m,y:p,width:g,height:v}=De(b=>{const{internals:x}=b.nodeLookup.get(e),w=x.userNode,{x:S,y:N}=x.positionAbsolute,{width:k,height:C}=Lr(w);return{node:w,x:S,y:N,width:k,height:C}},Qe);return!d||d.hidden||!XR(d)?null:h.jsx(c,{x:m,y:p,width:g,height:v,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:o,shapeRendering:a,onClick:u,id:d.id})}const wz=A.memo(xz);var bz=A.memo(vz);const Sz=200,_z=150,kz=e=>!e.hidden,Nz=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?YR(bl(e.nodeLookup,{filter:kz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Cz="react-flow__minimap-desc";function JT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:m,maskStrokeWidth:p,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:x=!1,zoomable:w=!1,ariaLabel:S,inversePan:N,zoomStep:k=1,offsetScale:C=5}){const j=Je(),R=A.useRef(null),{boundingRect:T,viewBB:M,rfId:P,panZoom:B,translateExtent:O,flowWidth:$,flowHeight:U,ariaLabelConfig:D}=De(Nz,Qe),z=(e==null?void 0:e.width)??Sz,V=(e==null?void 0:e.height)??_z,Y=T.width/z,F=T.height/V,q=Math.max(Y,F),G=q*z,L=q*V,W=C*q,oe=T.x-(G-T.width)/2-W,K=T.y-(L-T.height)/2-W,J=G+W*2,te=L+W*2,X=`${Cz}-${P}`,ee=A.useRef(0),ie=A.useRef();ee.current=q,A.useEffect(()=>{if(R.current&&B)return ie.current=Vq({domNode:R.current,panZoom:B,getTransform:()=>j.getState().transform,getViewScale:()=>ee.current}),()=>{var pe;(pe=ie.current)==null||pe.destroy()}},[B]),A.useEffect(()=>{var pe;(pe=ie.current)==null||pe.update({translateExtent:O,width:$,height:U,inversePan:N,pannable:x,zoomStep:k,zoomable:w})},[x,w,N,k,O,$,U]);const ue=v?pe=>{var Ce;const[_e,xe]=((Ce=ie.current)==null?void 0:Ce.pointer(pe))||[0,0];v(pe,{x:_e,y:xe})}:void 0,me=b?A.useCallback((pe,_e)=>{const xe=j.getState().nodeLookup.get(_e).internals.userNode;b(pe,xe)},[]):void 0,ye=S??D["minimap.ariaLabel"];return h.jsx(Td,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*q:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:gt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:z,height:V,viewBox:`${oe} ${K} ${J} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:R,onClick:ue,children:[ye&&h.jsx("title",{id:X,children:ye}),h.jsx(bz,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-W},${K-W}h${J+W*2}v${te+W*2}h${-J-W*2}z
|
|
62
|
-
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JT.displayName="MiniMap";const Ez=A.memo(JT),jz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Az={[yo.Line]:"right",[yo.Handle]:"bottom-right"};function Rz({nodeId:e,position:t,variant:n=yo.Handle,className:r,style:s=void 0,children:o,color:a,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:S}){const N=AT(),k=typeof e=="string"?e:N,C=Je(),j=A.useRef(null),R=n===yo.Handle,T=De(A.useCallback(jz(R&&v),[R,v]),Qe),M=A.useRef(null),P=t??Az[n];A.useEffect(()=>{if(!(!j.current||!k))return M.current||(M.current=rF({domNode:j.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:O,transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:z,domNode:V}=C.getState();return{nodeLookup:O,transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:z,paneDomNode:V}},onChange:(O,$)=>{const{triggerNodeChanges:U,nodeLookup:D,parentLookup:z,nodeOrigin:V}=C.getState(),Y=[],F={x:O.x,y:O.y},q=D.get(k);if(q&&q.expandParent&&q.parentId){const G=q.origin??V,L=O.width??q.measured.width??0,W=O.height??q.measured.height??0,oe={id:q.id,parentId:q.parentId,rect:{width:L,height:W,...QR({x:O.x??q.position.x,y:O.y??q.position.y},{width:L,height:W},q.parentId,D,G)}},K=kw([oe],D,z,V);Y.push(...K),F.x=O.x?Math.max(G[0]*L,O.x):void 0,F.y=O.y?Math.max(G[1]*W,O.y):void 0}if(F.x!==void 0&&F.y!==void 0){const G={id:k,type:"position",position:{...F}};Y.push(G)}if(O.width!==void 0&&O.height!==void 0){const L={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:O.width,height:O.height}};Y.push(L)}for(const G of $){const L={...G,type:"position"};Y.push(L)}U(Y)},onEnd:({width:O,height:$})=>{const U={id:k,type:"dimensions",resizing:!1,dimensions:{width:O,height:$}};C.getState().triggerNodeChanges([U])}})),M.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:m},keepAspectRatio:p,resizeDirection:g,onResizeStart:x,onResize:w,onResizeEnd:S,shouldResize:b}),()=>{var O;(O=M.current)==null||O.destroy()}},[P,c,u,d,m,p,x,w,S,b]);const B=P.split("-");return h.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...B,n,r]),ref:j,style:{...s,scale:T,...a&&{[R?"backgroundColor":"borderColor"]:a}},children:o})}A.memo(Rz);/**
|
|
63
|
-
* @license lucide-react v0.468.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const Tz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZT=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
68
|
-
* @license lucide-react v0.468.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/var Iz={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"};/**
|
|
73
|
-
* @license lucide-react v0.468.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const Mz=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>A.createElement("svg",{ref:u,...Iz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZT("lucide",s),...c},[...a.map(([d,m])=>A.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
|
|
78
|
-
* @license lucide-react v0.468.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const fe=(e,t)=>{const n=A.forwardRef(({className:r,...s},o)=>A.createElement(Mz,{ref:o,iconNode:t,className:ZT(`lucide-${Tz(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
83
|
-
* @license lucide-react v0.468.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const Oz=fe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
88
|
-
* @license lucide-react v0.468.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const Pz=fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
93
|
-
* @license lucide-react v0.468.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const al=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
98
|
-
* @license lucide-react v0.468.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const Lz=fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
103
|
-
* @license lucide-react v0.468.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const $u=fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
108
|
-
* @license lucide-react v0.468.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const jk=fe("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
113
|
-
* @license lucide-react v0.468.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const Px=fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
118
|
-
* @license lucide-react v0.468.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const ei=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
123
|
-
* @license lucide-react v0.468.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const gs=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
128
|
-
* @license lucide-react v0.468.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const Dz=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
133
|
-
* @license lucide-react v0.468.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Jt=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
138
|
-
* @license lucide-react v0.468.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const $z=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
143
|
-
* @license lucide-react v0.468.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const kl=fe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
148
|
-
* @license lucide-react v0.468.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const en=fe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
153
|
-
* @license lucide-react v0.468.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const qz=fe("CircleHelp",[["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"}]]);/**
|
|
158
|
-
* @license lucide-react v0.468.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const lt=fe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
163
|
-
* @license lucide-react v0.468.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const Lx=fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
168
|
-
* @license lucide-react v0.468.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const Fz=fe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
173
|
-
* @license lucide-react v0.468.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const Hn=fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
178
|
-
* @license lucide-react v0.468.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const Bz=fe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
183
|
-
* @license lucide-react v0.468.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const Ew=fe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
188
|
-
* @license lucide-react v0.468.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const vo=fe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
193
|
-
* @license lucide-react v0.468.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const zz=fe("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
|
|
198
|
-
* @license lucide-react v0.468.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const Vz=fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
203
|
-
* @license lucide-react v0.468.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const Uz=fe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
208
|
-
* @license lucide-react v0.468.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const Hz=fe("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
213
|
-
* @license lucide-react v0.468.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const Wz=fe("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
|
|
218
|
-
* @license lucide-react v0.468.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const od=fe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
223
|
-
* @license lucide-react v0.468.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const eI=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
228
|
-
* @license lucide-react v0.468.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const Kz=fe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
|
|
233
|
-
* @license lucide-react v0.468.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const ad=fe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
238
|
-
* @license lucide-react v0.468.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const tI=fe("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
|
|
243
|
-
* @license lucide-react v0.468.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const Dx=fe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
248
|
-
* @license lucide-react v0.468.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const Gz=fe("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
253
|
-
* @license lucide-react v0.468.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const Ak=fe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
258
|
-
* @license lucide-react v0.468.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const Yz=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
263
|
-
* @license lucide-react v0.468.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const Rk=fe("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
268
|
-
* @license lucide-react v0.468.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const Xz=fe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
|
|
273
|
-
* @license lucide-react v0.468.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const jw=fe("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
278
|
-
* @license lucide-react v0.468.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const Qz=fe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
283
|
-
* @license lucide-react v0.468.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const Jz=fe("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
288
|
-
* @license lucide-react v0.468.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const Tk=fe("Layers",[["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"}]]);/**
|
|
293
|
-
* @license lucide-react v0.468.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const ws=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
298
|
-
* @license lucide-react v0.468.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const nI=fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
303
|
-
* @license lucide-react v0.468.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const Ik=fe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
308
|
-
* @license lucide-react v0.468.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const Zz=fe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
|
|
313
|
-
* @license lucide-react v0.468.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const e6=fe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
318
|
-
* @license lucide-react v0.468.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const t6=fe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
323
|
-
* @license lucide-react v0.468.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const n6=fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
328
|
-
* @license lucide-react v0.468.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const r6=fe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
333
|
-
* @license lucide-react v0.468.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const s6=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
338
|
-
* @license lucide-react v0.468.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const i6=fe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
343
|
-
* @license lucide-react v0.468.0 - ISC
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the ISC license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const o6=fe("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
|
|
348
|
-
* @license lucide-react v0.468.0 - ISC
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the ISC license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const rI=fe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
353
|
-
* @license lucide-react v0.468.0 - ISC
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the ISC license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const a6=fe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
358
|
-
* @license lucide-react v0.468.0 - ISC
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the ISC license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const Nl=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
363
|
-
* @license lucide-react v0.468.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the ISC license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const Od=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
368
|
-
* @license lucide-react v0.468.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const l6=fe("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
|
|
373
|
-
* @license lucide-react v0.468.0 - ISC
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the ISC license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/const c6=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
378
|
-
* @license lucide-react v0.468.0 - ISC
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the ISC license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/const Mk=fe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
383
|
-
* @license lucide-react v0.468.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the ISC license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/const Ok=fe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
388
|
-
* @license lucide-react v0.468.0 - ISC
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the ISC license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/const u6=fe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
393
|
-
* @license lucide-react v0.468.0 - ISC
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the ISC license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/const $x=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
398
|
-
* @license lucide-react v0.468.0 - ISC
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the ISC license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/const sI=fe("Send",[["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"}]]);/**
|
|
403
|
-
* @license lucide-react v0.468.0 - ISC
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the ISC license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/const Pd=fe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
408
|
-
* @license lucide-react v0.468.0 - ISC
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the ISC license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const Pk=fe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
413
|
-
* @license lucide-react v0.468.0 - ISC
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the ISC license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/const d6=fe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
|
|
418
|
-
* @license lucide-react v0.468.0 - ISC
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the ISC license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/const iI=fe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
423
|
-
* @license lucide-react v0.468.0 - ISC
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the ISC license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/const f6=fe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
428
|
-
* @license lucide-react v0.468.0 - ISC
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the ISC license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/const h6=fe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
433
|
-
* @license lucide-react v0.468.0 - ISC
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the ISC license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/const p6=fe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
438
|
-
* @license lucide-react v0.468.0 - ISC
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the ISC license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/const oI=fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
443
|
-
* @license lucide-react v0.468.0 - ISC
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the ISC license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/const m6=fe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
448
|
-
* @license lucide-react v0.468.0 - ISC
|
|
449
|
-
*
|
|
450
|
-
* This source code is licensed under the ISC license.
|
|
451
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
-
*/const ko=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
453
|
-
* @license lucide-react v0.468.0 - ISC
|
|
454
|
-
*
|
|
455
|
-
* This source code is licensed under the ISC license.
|
|
456
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
-
*/const Lk=fe("Trello",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["rect",{width:"3",height:"9",x:"7",y:"7",key:"14n3xi"}],["rect",{width:"3",height:"5",x:"14",y:"7",key:"s4azjd"}]]);/**
|
|
458
|
-
* @license lucide-react v0.468.0 - ISC
|
|
459
|
-
*
|
|
460
|
-
* This source code is licensed under the ISC license.
|
|
461
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
-
*/const Ld=fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
463
|
-
* @license lucide-react v0.468.0 - ISC
|
|
464
|
-
*
|
|
465
|
-
* This source code is licensed under the ISC license.
|
|
466
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
-
*/const g6=fe("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
|
|
468
|
-
* @license lucide-react v0.468.0 - ISC
|
|
469
|
-
*
|
|
470
|
-
* This source code is licensed under the ISC license.
|
|
471
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
-
*/const aI=fe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
473
|
-
* @license lucide-react v0.468.0 - ISC
|
|
474
|
-
*
|
|
475
|
-
* This source code is licensed under the ISC license.
|
|
476
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
-
*/const y6=fe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
478
|
-
* @license lucide-react v0.468.0 - ISC
|
|
479
|
-
*
|
|
480
|
-
* This source code is licensed under the ISC license.
|
|
481
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
-
*/const Dd=fe("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
|
|
483
|
-
* @license lucide-react v0.468.0 - ISC
|
|
484
|
-
*
|
|
485
|
-
* This source code is licensed under the ISC license.
|
|
486
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
487
|
-
*/const v6=fe("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
|
|
488
|
-
* @license lucide-react v0.468.0 - ISC
|
|
489
|
-
*
|
|
490
|
-
* This source code is licensed under the ISC license.
|
|
491
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
-
*/const Cl=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
493
|
-
* @license lucide-react v0.468.0 - ISC
|
|
494
|
-
*
|
|
495
|
-
* This source code is licensed under the ISC license.
|
|
496
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
-
*/const ld=fe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
|
|
498
|
-
* @license lucide-react v0.468.0 - ISC
|
|
499
|
-
*
|
|
500
|
-
* This source code is licensed under the ISC license.
|
|
501
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
502
|
-
*/const x6=fe("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
503
|
-
* @license lucide-react v0.468.0 - ISC
|
|
504
|
-
*
|
|
505
|
-
* This source code is licensed under the ISC license.
|
|
506
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
507
|
-
*/const w6=fe("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Dk=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const g=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,s,c);return c},b6=(e=>e?Dk(e):Dk),S6=e=>e;function _6(e,t=S6){const n=pt.useSyncExternalStore(e.subscribe,pt.useCallback(()=>t(e.getState()),[e,t]),pt.useCallback(()=>t(e.getInitialState()),[e,t]));return pt.useDebugValue(n),n}const $k=e=>{const t=b6(e),n=r=>_6(t,r);return Object.assign(n,t),n},Dr=(e=>e?$k(e):$k),k6=[{id:"trigger",type:"step",position:{x:250,y:0},data:{id:"trigger",name:"PR Opened",action:"github.webhook",status:"completed"}},{id:"fetch_pr",type:"step",position:{x:250,y:120},data:{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",status:"completed"}},{id:"get_files",type:"step",position:{x:250,y:240},data:{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",status:"running"}},{id:"analyze",type:"step",position:{x:250,y:360},data:{id:"analyze",name:"Analyze Changes",action:"claude.analyze",status:"pending"}},{id:"post_review",type:"step",position:{x:250,y:480},data:{id:"post_review",name:"Post Review",action:"github.pulls.createReview",status:"pending"}}],N6=[{id:"e1",source:"trigger",target:"fetch_pr",animated:!0},{id:"e2",source:"fetch_pr",target:"get_files",animated:!0},{id:"e3",source:"get_files",target:"analyze"},{id:"e4",source:"analyze",target:"post_review"}],xo=Dr((e,t)=>({nodes:k6,edges:N6,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(s=>s.type!=="position"&&s.type!=="select"&&s.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:_T(n,t().nodes)})},onEdgesChange:n=>{n.some(s=>s.type!=="select")&&t().saveCheckpoint(),e({edges:kT(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:sT({...n,animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},t().edges)})},setNodes:n=>{t().saveCheckpoint(),e({nodes:n,future:[]})},setEdges:n=>{t().saveCheckpoint(),e({edges:n,future:[]})},updateNodeData:(n,r)=>{t().saveCheckpoint(),e({nodes:t().nodes.map(s=>s.id===n?{...s,data:{...s.data,...r}}:s),future:[]})},clearCanvas:()=>{t().saveCheckpoint(),e({nodes:[],edges:[],future:[]})},saveCheckpoint:()=>{const{nodes:n,edges:r,past:s,maxHistorySize:o}=t();if(s.length>0){const u=s[s.length-1];if(JSON.stringify(u.nodes)===JSON.stringify(n)&&JSON.stringify(u.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...s,a];c.length>o&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(s.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=s[s.length-1],u=s.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:u,future:[a,...o]})},redo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(o.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=o[0],u=o.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...s,a],future:u})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(u=>u.selected);if(r.length===0)return;const s=new Set(r.map(u=>u.id)),{edges:o}=t(),a=o.filter(u=>s.has(u.source)&&s.has(u.target)),c={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(a))};e({clipboard:c})},paste:(n={x:50,y:50})=>{const{clipboard:r,nodes:s,edges:o}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),u=r.nodes.map((p,g)=>{const v=`${p.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(p.id,v),{...p,id:v,position:{x:p.position.x+n.x,y:p.position.y+n.y},selected:!0,data:{...p.data,id:v}}}),d=r.edges.map((p,g)=>({...p,id:`${p.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(p.source)||p.source,target:a.get(p.target)||p.target})),m=s.map(p=>({...p,selected:!1}));e({nodes:[...m,...u],edges:[...o,...d],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),qk=[{path:"examples/code-review/workflow.md",name:"Code Review"},{path:"examples/daily-standup/workflow.md",name:"Daily Standup"},{path:"examples/incident-response/workflow.md",name:"Incident Response"},{path:"examples/sprint-planning/workflow.md",name:"Sprint Planning"},{path:"examples/dependency-update/workflow.md",name:"Dependency Update"}],C6={metadata:{id:"code-review",name:"Code Review",version:"1.0.0",description:"Automatically review pull requests using Claude AI",author:"Marktoflow",tags:["github","ai","code-review"]},steps:[{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"pr_details"},{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"changed_files"},{id:"analyze",name:"Analyze Changes",action:"claude.analyze",inputs:{prompt:"Review the following code changes",context:"{{ changed_files }}"},outputVariable:"analysis"},{id:"post_review",name:"Post Review",action:"github.pulls.createReview",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}",body:"{{ analysis.summary }}",event:"COMMENT"},outputVariable:"review_result"}]},Mr=Dr((e,t)=>({workflows:qk,selectedWorkflow:null,currentWorkflow:null,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();console.log("Loaded workflows:",r.workflows.length),e({workflows:r.workflows,isLoading:!1})}catch(n){console.error("Failed to load workflows, using demo data:",n),e({workflows:qk,isLoading:!1})}},fetchWorkflows:async()=>{await t().loadWorkflows()},selectWorkflow:n=>{e({selectedWorkflow:n}),t().loadWorkflow(n)},loadWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch(`/api/workflows/${encodeURIComponent(n)}`);if(!r.ok)throw new Error("Failed to load workflow");const s=await r.json();e({currentWorkflow:s.workflow,isLoading:!1})}catch{e({currentWorkflow:C6,isLoading:!1})}},saveWorkflow:async n=>{const r=t().selectedWorkflow;if(r){e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:n})})).ok)throw new Error("Failed to save workflow");e({currentWorkflow:n,isLoading:!1})}catch{e({error:"Failed to save workflow",isLoading:!1})}}},createWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error("Failed to create workflow");const s=await r.json(),o=[...t().workflows,s.workflow];e({workflows:o,selectedWorkflow:s.workflow.path,isLoading:!1}),t().loadWorkflow(s.workflow.path)}catch{e({error:"Failed to create workflow",isLoading:!1})}},deleteWorkflow:async n=>{var r;e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(n)}`,{method:"DELETE"})).ok)throw new Error("Failed to delete workflow");const o=t().workflows.filter(a=>a.path!==n);e({workflows:o,selectedWorkflow:((r=o[0])==null?void 0:r.path)||null,isLoading:!1})}catch{e({error:"Failed to delete workflow",isLoading:!1})}}})),E6=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.platform.toUpperCase().includes("MAC"),El=()=>E6()?"⌘":"Ctrl",j6={slack:n6,github:Dx,jira:Fz,gmail:Ik,outlook:Px,linear:Lk,notion:od,discord:t6,airtable:Vz,confluence:od,http:Yz,claude:$u,opencode:$u,ollama:$u,webhook:ld,schedule:Px,trigger:ld,stripe:zz,teams:y6,twilio:a6,sendgrid:sI,shopify:d6,zendesk:Xz,mailchimp:Ik,asana:h6,trello:Lk,dropbox:Bz,s3:Rk,"aws-s3":Rk};function qx(e){const t=e.toLowerCase().split(".")[0];return j6[t]||qz}function A6({data:e,selected:t}){var d,m;const n=((d=e.action)==null?void 0:d.split(".")[0])||"unknown",r=((m=e.action)==null?void 0:m.split(".").slice(1).join("."))||e.action,s=qx(n),o={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Nl,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:kl,color:"text-gray-500",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],u=c.icon;return h.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:h.jsx(s,{className:"w-5 h-5 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),h.jsx("div",{className:"text-xs text-gray-400 truncate",children:n})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:h.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3",children:[h.jsx("div",{className:"text-xs text-gray-300 font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&h.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&h.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const R6=A.memo(A6),Aw=Dr((e,t)=>({breadcrumbs:[],pushWorkflow:n=>{e({breadcrumbs:[...t().breadcrumbs,n]})},popToIndex:n=>{const{breadcrumbs:r}=t();n>=0&&n<r.length&&e({breadcrumbs:r.slice(0,n+1)})},popWorkflow:()=>{const{breadcrumbs:n}=t();n.length>1&&e({breadcrumbs:n.slice(0,-1)})},resetNavigation:()=>{e({breadcrumbs:[]})},setRootWorkflow:n=>{e({breadcrumbs:[n]})}}));function T6({data:e,selected:t}){const[n,r]=A.useState(!1),{pushWorkflow:s,breadcrumbs:o,setRootWorkflow:a}=Aw(),{loadWorkflow:c,selectedWorkflow:u,currentWorkflow:d}=Mr(),m=A.useCallback(()=>{var v;o.length===0&&u&&d&&a({id:u,name:((v=d.metadata)==null?void 0:v.name)||"Main Workflow",path:u}),s({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,s,o,a,u,d,c]),p={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return h.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${p[g]}`,children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[h.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?h.jsx(gs,{className:"w-4 h-4 text-info"}):h.jsx(Jt,{className:"w-4 h-4 text-info"})}),h.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:h.jsx(ad,{className:"w-5 h-5 text-info"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),h.jsx("div",{className:"text-xs text-gray-400",children:"Sub-workflow"})]}),h.jsx("button",{onClick:m,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:h.jsx(al,{className:"w-4 h-4 text-info"})})]}),h.jsxs("div",{className:"p-3",children:[h.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&h.jsx("div",{className:"mt-2 flex items-center gap-2",children:h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&h.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:h.jsxs("button",{onClick:m,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[h.jsx(ad,{className:"w-4 h-4"}),"Open Sub-workflow",h.jsx(al,{className:"w-4 h-4"})]})}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const I6=A.memo(T6),Fk={manual:{icon:Nl,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:Px,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:v6,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:ad,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:ld,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function M6({data:e,selected:t}){const n=Fk[e.type]||Fk.manual,r=n.icon,s=()=>{var o;switch(e.type){case"schedule":return e.cron||"No schedule set";case"webhook":return`${e.method||"POST"} ${e.path||"/webhook"}`;case"file":return e.pattern||"**/*";case"event":return((o=e.events)==null?void 0:o.join(", "))||"No events";default:return"Click to run"}};return h.jsxs("div",{className:`min-w-[180px] rounded-lg border-2 ${n.borderColor} ${n.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[h.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[h.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:h.jsx(r,{className:`w-4 h-4 ${n.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:n.label}),h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Trigger"})]}),e.active!==!1&&h.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:s(),children:s()}),e.lastTriggered&&h.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const O6=A.memo(M6);function P6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:en,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`min-w-[160px] rounded-lg border-2 ${s.borderColor} ${s.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),h.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[h.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(Kz,{className:`w-4 h-4 ${s.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Output"}),h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Workflow End"})]}),h.jsx(o,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output Variables"}),h.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>h.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&h.jsx("div",{className:"px-3 py-2 border-t border-white/10",children:h.jsx("div",{className:"text-xs text-gray-400",children:e.description})}),r==="completed"&&e.result!==void 0&&h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Result"}),h.jsxs("pre",{className:"text-xs text-success font-mono bg-black/20 rounded p-1.5 overflow-x-auto max-h-20",children:[typeof e.result=="string"?e.result.slice(0,100):JSON.stringify(e.result,null,2).slice(0,100),(typeof e.result=="string"?e.result:JSON.stringify(e.result)).length>100&&"..."]})]})]})}const L6=A.memo(P6);function D6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Dx,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Dx,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),h.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="then"?"bg-green-500/30 text-green-200 ring-1 ring-green-400/50":e.skippedBranch==="then"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✓ Then",e.skippedBranch==="then"&&h.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]}),h.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="else"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":e.skippedBranch==="else"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✗ Else",e.skippedBranch==="else"&&h.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),h.jsx(qe,{type:"source",position:he.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const $6=A.memo(D6);function q6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Mk,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Mk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),h.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[h.jsx("span",{className:"text-white/60",children:"Items:"})," ",h.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Variable:"})," ",h.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.earlyExit&&h.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[h.jsx(nI,{className:"w-4 h-4 text-orange-200"}),h.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":"Loop stopped on error"})]}),e.totalIterations!==void 0&&h.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),h.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations,e.earlyExit&&h.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),h.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-pink-400"}`,style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(qe,{id:"body",type:"source",position:he.Right,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),h.jsx(qe,{id:"loop-back",type:"target",position:he.Left,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const F6=A.memo(q6);function B6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ok,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Ok,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),h.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Condition:"})," ",h.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",h.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.earlyExit&&h.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[e.exitReason==="max_iterations"?h.jsx(Ld,{className:"w-4 h-4 text-orange-200"}):h.jsx(nI,{className:"w-4 h-4 text-orange-200"}),h.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":e.exitReason==="max_iterations"?"Max iterations reached":"Loop stopped on error"})]}),e.currentIteration!==void 0&&h.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),h.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100,e.earlyExit&&h.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),h.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-orange-500"}`,style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"⚠️"}),h.jsx("span",{children:"Exits when condition becomes false"})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(qe,{id:"body",type:"source",position:he.Right,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),h.jsx(qe,{id:"loop-back",type:"target",position:he.Left,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const z6=A.memo(B6);function V6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ak,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon,a=Object.keys(e.cases||{}),c=a.slice(0,4),u=a.length>4,d=Math.min(a.length,4)+(e.hasDefault?1:0),m=p=>d===1?50:(p+1)/(d+1)*100;return h.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Ak,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),h.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Expression:"})," ",h.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((p,g)=>{var x;const v=e.activeCase===p,b=(x=e.skippedBranches)==null?void 0:x.includes(p);return h.jsx("div",{className:"relative",children:h.jsxs("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors relative ${v?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":b?"bg-gray-500/20 text-gray-400 line-through":"bg-white/5 text-white/70"}`,children:[p,b&&h.jsx("span",{className:"ml-2 text-[8px] px-1 py-0.5 rounded bg-gray-500/30",children:"SKIPPED"})]})},p)}),u&&h.jsxs("div",{className:"text-xs px-2 py-1 rounded bg-white/5 text-white/60 text-center",children:["+",a.length-4," more cases"]}),e.hasDefault&&h.jsx("div",{className:"relative",children:h.jsx("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors ${e.activeCase==="default"?"bg-gray-500/30 text-gray-200 ring-1 ring-gray-400/50":"bg-white/5 text-white/70"}`,children:"default"})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]}),c.map((p,g)=>h.jsx(qe,{type:"source",position:he.Bottom,id:`case-${p}`,style:{left:`${m(g)}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"},`handle-${p}`)),e.hasDefault&&h.jsx(qe,{type:"source",position:he.Bottom,id:"case-default",style:{left:`${m(c.length)}%`},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})}const U6=A.memo(V6);function H6({data:e,selected:t}){var a,c;const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Tk,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Tk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),h.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[e.maxConcurrentExceeded&&h.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/20 border border-yellow-500/30 rounded flex items-center gap-2",children:[h.jsx(Ld,{className:"w-4 h-4 text-yellow-200"}),h.jsx("span",{className:"text-xs text-yellow-200 font-medium",children:"Rate limiting active"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Branches:"})," ",h.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&h.jsxs(h.Fragment,{children:[" ",h.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",h.jsx("span",{className:`font-medium ${e.maxConcurrentExceeded?"text-yellow-300":""}`,children:e.maxConcurrent})]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(u=>{var g,v,b;const d=(g=e.activeBranches)==null?void 0:g.includes(u.id),m=(v=e.completedBranches)==null?void 0:v.includes(u.id),p=(b=e.failedBranches)==null?void 0:b.includes(u.id);return h.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${p?"bg-red-500/30 text-red-200":m?"bg-green-500/30 text-green-200":d?"bg-blue-500/30 text-blue-200 animate-pulse":"bg-white/10 text-white/60"}`,title:u.name||u.id,children:u.name||`B${u.id.slice(-2)}`},u.id)}),e.branches&&e.branches.length>6&&h.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),h.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[h.jsx("span",{children:"On Error:"}),h.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const W6=A.memo(H6);function K6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Pk,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node try-catch-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Pk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),h.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&h.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[h.jsx(Ld,{className:"w-4 h-4 text-red-200"}),h.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="try"?"bg-blue-500/30 text-blue-200 ring-1 ring-blue-400/50":"bg-white/5 text-white/60"}`,children:"✓ Try"}),e.hasCatch&&h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="catch"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":"bg-white/5 text-white/60"}`,children:"⚠ Catch"}),e.hasFinally&&h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="finally"?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":"bg-white/5 text-white/60"}`,children:"⟳ Finally"})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:"Finally always executes"})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&h.jsx(qe,{type:"source",position:he.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&h.jsx(qe,{type:"source",position:he.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const G6=A.memo(K6);function Y6({data:e,selected:t}){const n={map:{icon:al,label:"Map",color:"#14b8a6"},filter:{icon:eI,label:"Filter",color:"#10b981"},reduce:{icon:r6,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:n[e.transformType].icon,color:"text-teal-400",bgColor:"bg-teal-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},s=e.status||"pending",o=r[s],a=o.icon,c=n[e.transformType],u=c.icon,d=e.transformType==="filter"?e.condition:e.transformType==="reduce"?`${e.accumulatorVariable||"acc"}: ${e.expression||"Not set"}`:e.expression;return h.jsxs("div",{className:`control-flow-node transform-node p-0 ${t?"selected":""} ${s==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%)"},children:[h.jsx(qe,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(u,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),h.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${o.bgColor} flex items-center justify-center`,children:h.jsx(a,{className:`w-4 h-4 ${o.color} ${o.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[h.jsx("span",{className:"text-white/60",children:"Items:"})," ",h.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Variable:"})," ",h.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),h.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[h.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),h.jsx("div",{className:"text-xs text-white font-mono break-all",children:d||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Initial:"})," ",h.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&h.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[h.jsxs("div",{className:"text-xs",children:[h.jsx("span",{className:"text-white/60",children:"In:"})," ",h.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),h.jsx("div",{className:"text-white/40",children:"→"}),h.jsxs("div",{className:"text-xs",children:[h.jsx("span",{className:"text-white/60",children:"Out:"})," ",h.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),h.jsx(qe,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(qe,{id:"loop-back",type:"source",position:he.Left,className:"!w-3 !h-3 !bg-teal-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const Tp=A.memo(Y6);function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Bk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Bk(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Bk(e[s],null)}}}}function Et(...e){return A.useCallback(Rw(...e),e)}function X6(e,t){const n=A.createContext(t),r=o=>{const{children:a,...c}=o,u=A.useMemo(()=>c,Object.values(c));return h.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function s(o){const a=A.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function ii(e,t=[]){let n=[];function r(o,a){const c=A.createContext(a),u=n.length;n=[...n,a];const d=p=>{var S;const{scope:g,children:v,...b}=p,x=((S=g==null?void 0:g[e])==null?void 0:S[u])||c,w=A.useMemo(()=>b,Object.values(b));return h.jsx(x.Provider,{value:w,children:v})};d.displayName=o+"Provider";function m(p,g){var x;const v=((x=g==null?void 0:g[e])==null?void 0:x[u])||c,b=A.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,m]}const s=()=>{const o=n.map(a=>A.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,Q6(s,...t)]}function Q6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:d})=>{const p=u(o)[`__scope${d}`];return{...c,...p}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var bs=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{},J6=cR[" useId ".trim().toString()]||(()=>{}),Z6=0;function Ka(e){const[t,n]=A.useState(J6());return bs(()=>{n(r=>r??String(Z6++))},[e]),t?`radix-${t}`:""}var e8=cR[" useInsertionEffect ".trim().toString()]||bs;function Tw({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=t8({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s;{const m=A.useRef(e!==void 0);A.useEffect(()=>{const p=m.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,r])}const d=A.useCallback(m=>{var p;if(c){const g=n8(m)?m(e):m;g!==e&&((p=a.current)==null||p.call(a,g))}else o(m)},[c,e,o,a]);return[u,d]}function t8({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),s=A.useRef(n),o=A.useRef(t);return e8(()=>{o.current=t},[t]),A.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function n8(e){return typeof e=="function"}function ll(e){const t=r8(e),n=A.forwardRef((r,s)=>{const{children:o,...a}=r,c=A.Children.toArray(o),u=c.find(i8);if(u){const d=u.props.children,m=c.map(p=>p===u?A.Children.count(d)>1?A.Children.only(null):A.isValidElement(d)?d.props.children:null:p);return h.jsx(t,{...a,ref:s,children:A.isValidElement(d)?A.cloneElement(d,void 0,m):null})}return h.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function r8(e){const t=A.forwardRef((n,r)=>{const{children:s,...o}=n;if(A.isValidElement(s)){const a=a8(s),c=o8(o,s.props);return s.type!==A.Fragment&&(c.ref=r?Rw(r,a):a),A.cloneElement(s,c)}return A.Children.count(s)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var s8=Symbol("radix.slottable");function i8(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===s8}function o8(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const u=o(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function a8(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var l8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=l8.reduce((e,t)=>{const n=ll(`Primitive.${t}`),r=A.forwardRef((s,o)=>{const{asChild:a,...c}=s,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lI(e,t){e&&Nw.flushSync(()=>e.dispatchEvent(t))}function ur(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function c8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e);A.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var u8="DismissableLayer",Fx="dismissableLayer.update",d8="dismissableLayer.pointerDownOutside",f8="dismissableLayer.focusOutside",zk,cI=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Iw=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,d=A.useContext(cI),[m,p]=A.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=A.useState({}),b=Et(t,T=>p(T)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),N=m?x.indexOf(m):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,C=N>=S,j=m8(T=>{const M=T.target,P=[...d.branches].some(B=>B.contains(M));!C||P||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),R=g8(T=>{const M=T.target;[...d.branches].some(B=>B.contains(M))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return c8(T=>{N===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),A.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(zk=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),Vk(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=zk)}},[m,g,n,d]),A.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),Vk())},[m,d]),A.useEffect(()=>{const T=()=>v({});return document.addEventListener(Fx,T),()=>document.removeEventListener(Fx,T)},[]),h.jsx(Ze.div,{...u,ref:b,style:{pointerEvents:k?C?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,j.onPointerDownCapture)})});Iw.displayName=u8;var h8="DismissableLayerBranch",p8=A.forwardRef((e,t)=>{const n=A.useContext(cI),r=A.useRef(null),s=Et(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(Ze.div,{...e,ref:s})});p8.displayName=h8;function m8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=A.useRef(!1),s=A.useRef(()=>{});return A.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){uI(d8,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function g8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=A.useRef(!1);return A.useEffect(()=>{const s=o=>{o.target&&!r.current&&uI(f8,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vk(){const e=new CustomEvent(Fx);document.dispatchEvent(e)}function uI(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?lI(s,o):s.dispatchEvent(o)}var Ip="focusScope.autoFocusOnMount",Mp="focusScope.autoFocusOnUnmount",Uk={bubbles:!1,cancelable:!0},y8="FocusScope",Mw=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=A.useState(null),d=ur(s),m=ur(o),p=A.useRef(null),g=Et(t,x=>u(x)),v=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let x=function(k){if(v.paused||!c)return;const C=k.target;c.contains(C)?p.current=C:hs(p.current,{select:!0})},w=function(k){if(v.paused||!c)return;const C=k.relatedTarget;C!==null&&(c.contains(C)||hs(p.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const j of k)j.removedNodes.length>0&&hs(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",w);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),N.disconnect()}}},[r,c,v.paused]),A.useEffect(()=>{if(c){Wk.add(v);const x=document.activeElement;if(!c.contains(x)){const S=new CustomEvent(Ip,Uk);c.addEventListener(Ip,d),c.dispatchEvent(S),S.defaultPrevented||(v8(_8(dI(c)),{select:!0}),document.activeElement===x&&hs(c))}return()=>{c.removeEventListener(Ip,d),setTimeout(()=>{const S=new CustomEvent(Mp,Uk);c.addEventListener(Mp,m),c.dispatchEvent(S),S.defaultPrevented||hs(x??document.body,{select:!0}),c.removeEventListener(Mp,m),Wk.remove(v)},0)}}},[c,d,m,v]);const b=A.useCallback(x=>{if(!n&&!r||v.paused)return;const w=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,S=document.activeElement;if(w&&S){const N=x.currentTarget,[k,C]=x8(N);k&&C?!x.shiftKey&&S===C?(x.preventDefault(),n&&hs(k,{select:!0})):x.shiftKey&&S===k&&(x.preventDefault(),n&&hs(C,{select:!0})):S===N&&x.preventDefault()}},[n,r,v.paused]);return h.jsx(Ze.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Mw.displayName=y8;function v8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function x8(e){const t=dI(e),n=Hk(t,e),r=Hk(t.reverse(),e);return[n,r]}function dI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hk(e,t){for(const n of e)if(!w8(n,{upTo:t}))return n}function w8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function b8(e){return e instanceof HTMLInputElement&&"select"in e}function hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&b8(e)&&t&&e.select()}}var Wk=S8();function S8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Kk(e,t),e.unshift(t)},remove(t){var n;e=Kk(e,t),(n=e[0])==null||n.resume()}}}function Kk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _8(e){return e.filter(t=>t.tagName!=="A")}var k8="Portal",Ow=A.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=A.useState(!1);bs(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?gF.createPortal(h.jsx(Ze.div,{...r,ref:t}),a):null});Ow.displayName=k8;function N8(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=C8(t),s=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=Et(r.ref,E8(s));return typeof n=="function"||r.isPresent?A.cloneElement(s,{ref:o}):null};$r.displayName="Presence";function C8(e){const[t,n]=A.useState(),r=A.useRef(null),s=A.useRef(e),o=A.useRef("none"),a=e?"mounted":"unmounted",[c,u]=N8(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const d=gu(r.current);o.current=c==="mounted"?d:"none"},[c]),bs(()=>{const d=r.current,m=s.current;if(m!==e){const g=o.current,v=gu(d);e?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),bs(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,p=v=>{const x=gu(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&x&&(u("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=v=>{v.target===t&&(o.current=gu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:A.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function gu(e){return(e==null?void 0:e.animationName)||"none"}function E8(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Op=0;function fI(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gk()),document.body.insertAdjacentElement("beforeend",e[1]??Gk()),Op++,()=>{Op===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Op--}},[])}function Gk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var sr=function(){return sr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},sr.apply(this,arguments)};function hI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function j8(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var qu="right-scroll-bar-position",Fu="width-before-scroll-bar",A8="with-scroll-bars-hidden",R8="--removed-body-scroll-bar-size";function Pp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T8(e,t){var n=A.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var I8=typeof window<"u"?A.useLayoutEffect:A.useEffect,Yk=new WeakMap;function M8(e,t){var n=T8(null,function(r){return e.forEach(function(s){return Pp(s,r)})});return I8(function(){var r=Yk.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(c){o.has(c)||Pp(c,null)}),o.forEach(function(c){s.has(c)||Pp(c,a)})}Yk.set(n,e)},[e]),n}function O8(e){return e}function P8(e,t){t===void 0&&(t=O8);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var u=function(){var m=a;a=[],m.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){a.push(m),d()},filter:function(m){return a=a.filter(m),n}}}};return s}function L8(e){e===void 0&&(e={});var t=P8(null);return t.options=sr({async:!0,ssr:!1},e),t}var pI=function(e){var t=e.sideCar,n=hI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,sr({},n))};pI.isSideCarExport=!0;function D8(e,t){return e.useMedium(t),pI}var mI=L8(),Lp=function(){},$d=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Lp,onWheelCapture:Lp,onTouchMoveCapture:Lp}),s=r[0],o=r[1],a=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,m=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,k=e.gapMode,C=hI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,R=M8([n,t]),T=sr(sr({},C),s);return A.createElement(A.Fragment,null,m&&A.createElement(j,{sideCar:mI,removeScrollBar:d,shards:p,noRelative:v,noIsolation:b,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:k}),a?A.cloneElement(A.Children.only(c),sr(sr({},T),{ref:R})):A.createElement(N,sr({},T,{className:u,ref:R}),c))});$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$d.classNames={fullWidth:Fu,zeroRight:qu};var $8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function q8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$8();return t&&e.setAttribute("nonce",t),e}function F8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var z8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=q8())&&(F8(t,n),B8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},V8=function(){var e=z8();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gI=function(){var e=V8(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},U8={left:0,top:0,right:0,gap:0},Dp=function(e){return parseInt(e||"",10)||0},H8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Dp(n),Dp(r),Dp(s)]},W8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return U8;var t=H8(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},K8=gI(),io="data-scroll-locked",G8=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
508
|
-
.`.concat(A8,` {
|
|
509
|
-
overflow: hidden `).concat(r,`;
|
|
510
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
511
|
-
}
|
|
512
|
-
body[`).concat(io,`] {
|
|
513
|
-
overflow: hidden `).concat(r,`;
|
|
514
|
-
overscroll-behavior: contain;
|
|
515
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
516
|
-
padding-left: `.concat(s,`px;
|
|
517
|
-
padding-top: `).concat(o,`px;
|
|
518
|
-
padding-right: `).concat(a,`px;
|
|
519
|
-
margin-left:0;
|
|
520
|
-
margin-top:0;
|
|
521
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
522
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
.`).concat(qu,` {
|
|
526
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
.`).concat(Fu,` {
|
|
530
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
.`).concat(qu," .").concat(qu,` {
|
|
534
|
-
right: 0 `).concat(r,`;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.`).concat(Fu," .").concat(Fu,` {
|
|
538
|
-
margin-right: 0 `).concat(r,`;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
body[`).concat(io,`] {
|
|
542
|
-
`).concat(R8,": ").concat(c,`px;
|
|
543
|
-
}
|
|
544
|
-
`)},Xk=function(){var e=parseInt(document.body.getAttribute(io)||"0",10);return isFinite(e)?e:0},Y8=function(){A.useEffect(function(){return document.body.setAttribute(io,(Xk()+1).toString()),function(){var e=Xk()-1;e<=0?document.body.removeAttribute(io):document.body.setAttribute(io,e.toString())}},[])},X8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Y8();var o=A.useMemo(function(){return W8(s)},[s]);return A.createElement(K8,{styles:G8(o,!t,s,n?"":"!important")})},Bx=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return Bx=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{Bx=!1}var Ui=Bx?{passive:!1}:!1,Q8=function(e){return e.tagName==="TEXTAREA"},yI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q8(e)&&n[t]==="visible")},J8=function(e){return yI(e,"overflowY")},Z8=function(e){return yI(e,"overflowX")},Qk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=vI(e,r);if(s){var o=xI(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},eV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},tV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},vI=function(e,t){return e==="v"?J8(t):Z8(t)},xI=function(e,t){return e==="v"?eV(t):tV(t)},nV=function(e,t){return e==="h"&&t==="rtl"?-1:1},rV=function(e,t,n,r,s){var o=nV(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),d=!1,m=a>0,p=0,g=0;do{if(!c)break;var v=xI(e,c),b=v[0],x=v[1],w=v[2],S=x-w-o*b;(b||S)&&vI(e,c)&&(p+=S,g+=b);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(d=!0),d},vu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jk=function(e){return[e.deltaX,e.deltaY]},Zk=function(e){return e&&"current"in e?e.current:e},sV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iV=function(e){return`
|
|
545
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
546
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
547
|
-
`)},oV=0,Hi=[];function aV(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),s=A.useState(oV++)[0],o=A.useState(gI)[0],a=A.useRef(e);A.useEffect(function(){a.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var x=j8([e.lockRef.current],(e.shards||[]).map(Zk),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=A.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var S=vu(x),N=n.current,k="deltaX"in x?x.deltaX:N[0]-S[0],C="deltaY"in x?x.deltaY:N[1]-S[1],j,R=x.target,T=Math.abs(k)>Math.abs(C)?"h":"v";if("touches"in x&&T==="h"&&R.type==="range")return!1;var M=window.getSelection(),P=M&&M.anchorNode,B=P?P===R||P.contains(R):!1;if(B)return!1;var O=Qk(T,R);if(!O)return!0;if(O?j=T:(j=T==="v"?"h":"v",O=Qk(T,R)),!O)return!1;if(!r.current&&"changedTouches"in x&&(k||C)&&(r.current=j),!j)return!0;var $=r.current||j;return rV($,w,x,$==="h"?k:C)},[]),u=A.useCallback(function(x){var w=x;if(!(!Hi.length||Hi[Hi.length-1]!==o)){var S="deltaY"in w?Jk(w):vu(w),N=t.current.filter(function(j){return j.name===w.type&&(j.target===w.target||w.target===j.shadowParent)&&sV(j.delta,S)})[0];if(N&&N.should){w.cancelable&&w.preventDefault();return}if(!N){var k=(a.current.shards||[]).map(Zk).filter(Boolean).filter(function(j){return j.contains(w.target)}),C=k.length>0?c(w,k[0]):!a.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),d=A.useCallback(function(x,w,S,N){var k={name:x,delta:w,target:S,should:N,shadowParent:lV(S)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(C){return C!==k})},1)},[]),m=A.useCallback(function(x){n.current=vu(x),r.current=void 0},[]),p=A.useCallback(function(x){d(x.type,Jk(x),x.target,c(x,e.lockRef.current))},[]),g=A.useCallback(function(x){d(x.type,vu(x),x.target,c(x,e.lockRef.current))},[]);A.useEffect(function(){return Hi.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ui),document.addEventListener("touchmove",u,Ui),document.addEventListener("touchstart",m,Ui),function(){Hi=Hi.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,Ui),document.removeEventListener("touchmove",u,Ui),document.removeEventListener("touchstart",m,Ui)}},[]);var v=e.removeScrollBar,b=e.inert;return A.createElement(A.Fragment,null,b?A.createElement(o,{styles:iV(s)}):null,v?A.createElement(X8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cV=D8(mI,aV);var Pw=A.forwardRef(function(e,t){return A.createElement($d,sr({},e,{ref:t,sideCar:cV}))});Pw.classNames=$d.classNames;var uV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wi=new WeakMap,xu=new WeakMap,wu={},$p=0,wI=function(e){return e&&(e.host||wI(e.parentNode))},dV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wI(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fV=function(e,t,n,r){var s=dV(t,Array.isArray(e)?e:[e]);wu[n]||(wu[n]=new WeakMap);var o=wu[n],a=[],c=new Set,u=new Set(s),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};s.forEach(d);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",x=(Wi.get(g)||0)+1,w=(o.get(g)||0)+1;Wi.set(g,x),o.set(g,w),a.push(g),x===1&&b&&xu.set(g,!0),w===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(t),c.clear(),$p++,function(){a.forEach(function(p){var g=Wi.get(p)-1,v=o.get(p)-1;Wi.set(p,g),o.set(p,v),g||(xu.has(p)||p.removeAttribute(r),xu.delete(p)),v||p.removeAttribute(n)}),$p--,$p||(Wi=new WeakMap,Wi=new WeakMap,xu=new WeakMap,wu={})}},bI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=uV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),fV(r,s,n,"aria-hidden")):function(){return null}},qd="Dialog",[SI]=ii(qd),[hV,Wn]=SI(qd),_I=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=A.useRef(null),u=A.useRef(null),[d,m]=Tw({prop:r,defaultProp:s??!1,onChange:o,caller:qd});return h.jsx(hV,{scope:t,triggerRef:c,contentRef:u,contentId:Ka(),titleId:Ka(),descriptionId:Ka(),open:d,onOpenChange:m,onOpenToggle:A.useCallback(()=>m(p=>!p),[m]),modal:a,children:n})};_I.displayName=qd;var kI="DialogTrigger",pV=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(kI,n),o=Et(t,s.triggerRef);return h.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$w(s.open),...r,ref:o,onClick:Te(e.onClick,s.onOpenToggle)})});pV.displayName=kI;var Lw="DialogPortal",[mV,NI]=SI(Lw,{forceMount:void 0}),CI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Wn(Lw,t);return h.jsx(mV,{scope:t,forceMount:n,children:A.Children.map(r,a=>h.jsx($r,{present:n||o.open,children:h.jsx(Ow,{asChild:!0,container:s,children:a})}))})};CI.displayName=Lw;var cd="DialogOverlay",EI=A.forwardRef((e,t)=>{const n=NI(cd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(cd,e.__scopeDialog);return o.modal?h.jsx($r,{present:r||o.open,children:h.jsx(yV,{...s,ref:t})}):null});EI.displayName=cd;var gV=ll("DialogOverlay.RemoveScroll"),yV=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(cd,n);return h.jsx(Pw,{as:gV,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(Ze.div,{"data-state":$w(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ti="DialogContent",jI=A.forwardRef((e,t)=>{const n=NI(ti,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(ti,e.__scopeDialog);return h.jsx($r,{present:r||o.open,children:o.modal?h.jsx(vV,{...s,ref:t}):h.jsx(xV,{...s,ref:t})})});jI.displayName=ti;var vV=A.forwardRef((e,t)=>{const n=Wn(ti,e.__scopeDialog),r=A.useRef(null),s=Et(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return bI(o)},[]),h.jsx(AI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault())})}),xV=A.forwardRef((e,t)=>{const n=Wn(ti,e.__scopeDialog),r=A.useRef(!1),s=A.useRef(!1);return h.jsx(AI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),AI=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=Wn(ti,n),u=A.useRef(null),d=Et(t,u);return fI(),h.jsxs(h.Fragment,{children:[h.jsx(Mw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:h.jsx(Iw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":$w(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(wV,{titleId:c.titleId}),h.jsx(SV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Dw="DialogTitle",RI=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(Dw,n);return h.jsx(Ze.h2,{id:s.titleId,...r,ref:t})});RI.displayName=Dw;var TI="DialogDescription",II=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(TI,n);return h.jsx(Ze.p,{id:s.descriptionId,...r,ref:t})});II.displayName=TI;var MI="DialogClose",OI=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(MI,n);return h.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});OI.displayName=MI;function $w(e){return e?"open":"closed"}var PI="DialogTitleWarning",[$J,LI]=X6(PI,{contentName:ti,titleName:Dw,docsSlug:"dialog"}),wV=({titleId:e})=>{const t=LI(PI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
548
|
-
|
|
549
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
550
|
-
|
|
551
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bV="DialogDescriptionWarning",SV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${LI(bV).contentName}}.`;return A.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_V=_I,kV=CI,NV=EI,CV=jI,EV=RI,jV=II,AV=OI;function DI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=DI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function RV(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=DI(e))&&(r&&(r+=" "),r+=t);return r}const qw="-",TV=e=>{const t=MV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(qw);return c[0]===""&&c.length!==1&&c.shift(),$I(c,t)||IV(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},$I=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?$I(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(qw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},eN=/^\[(.+)\]$/,IV=e=>{if(eN.test(e)){const t=eN.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},MV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return PV(Object.entries(e.classGroups),n).forEach(([o,a])=>{zx(a,r,o,t)}),r},zx=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:tN(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(OV(s)){zx(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{zx(a,tN(t,o),n,r)})})},tN=(e,t)=>{let n=e;return t.split(qw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},OV=e=>e.isThemeGetter,PV=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e,LV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},qI="!",DV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=c=>{const u=[];let d=0,m=0,p;for(let w=0;w<c.length;w++){let S=c[w];if(d===0){if(S===s&&(r||c.slice(w,w+o)===t)){u.push(c.slice(m,w)),m=w+o;continue}if(S==="/"){p=w;continue}}S==="["?d++:S==="]"&&d--}const g=u.length===0?c:c.substring(m),v=g.startsWith(qI),b=v?g.substring(1):g,x=p&&p>m?p-m:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}};return n?c=>n({className:c,parseClassName:a}):a},$V=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},qV=e=>({cache:LV(e.cacheSize),parseClassName:DV(e),...TV(e)}),FV=/\s+/,BV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(FV);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{modifiers:m,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=n(d);let b=!!v,x=r(b?g.substring(0,v):g);if(!x){if(!b){c=d+(c.length>0?" "+c:c);continue}if(x=r(g),!x){c=d+(c.length>0?" "+c:c);continue}b=!1}const w=$V(m).join(":"),S=p?w+qI:w,N=S+x;if(o.includes(N))continue;o.push(N);const k=s(x,b);for(let C=0;C<k.length;++C){const j=k[C];o.push(S+j)}c=d+(c.length>0?" "+c:c)}return c};function zV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=FI(t))&&(r&&(r+=" "),r+=n);return r}const FI=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=FI(e[r]))&&(n&&(n+=" "),n+=t);return n};function VV(e,...t){let n,r,s,o=a;function a(u){const d=t.reduce((m,p)=>p(m),e());return n=qV(d),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const d=r(u);if(d)return d;const m=BV(u,n);return s(u,m),m}return function(){return o(zV.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},BI=/^\[(?:([a-z-]+):)?(.+)\]$/i,UV=/^\d+\/\d+$/,HV=new Set(["px","full","screen"]),WV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>oo(e)||HV.has(e)||UV.test(e),us=e=>No(e,"length",s9),oo=e=>!!e&&!Number.isNaN(Number(e)),qp=e=>No(e,"number",oo),Aa=e=>!!e&&Number.isInteger(Number(e)),QV=e=>e.endsWith("%")&&oo(e.slice(0,-1)),Me=e=>BI.test(e),ds=e=>WV.test(e),JV=new Set(["length","size","percentage"]),ZV=e=>No(e,JV,zI),e9=e=>No(e,"position",zI),t9=new Set(["image","url"]),n9=e=>No(e,t9,o9),r9=e=>No(e,"",i9),Ra=()=>!0,No=(e,t,n)=>{const r=BI.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},s9=e=>KV.test(e)&&!GV.test(e),zI=()=>!1,i9=e=>YV.test(e),o9=e=>XV.test(e),a9=()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),s=Ye("borderColor"),o=Ye("borderRadius"),a=Ye("borderSpacing"),c=Ye("borderWidth"),u=Ye("contrast"),d=Ye("grayscale"),m=Ye("hueRotate"),p=Ye("invert"),g=Ye("gap"),v=Ye("gradientColorStops"),b=Ye("gradientColorStopPositions"),x=Ye("inset"),w=Ye("margin"),S=Ye("opacity"),N=Ye("padding"),k=Ye("saturate"),C=Ye("scale"),j=Ye("sepia"),R=Ye("skew"),T=Ye("space"),M=Ye("translate"),P=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Me,t],$=()=>[Me,t],U=()=>["",Cr,us],D=()=>["auto",oo,Me],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Me],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[oo,Me];return{cacheSize:500,separator:":",theme:{colors:[Ra],spacing:[Cr,us],blur:["none","",ds,Me],brightness:L(),borderColor:[e],borderRadius:["none","","full",ds,Me],borderSpacing:$(),borderWidth:U(),contrast:L(),grayscale:q(),hueRotate:L(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[QV,us],inset:O(),margin:O(),opacity:L(),padding:$(),saturate:L(),scale:L(),sepia:q(),skew:L(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),Me]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Aa,Me]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Aa,Me]}],"grid-cols":[{"grid-cols":[Ra]}],"col-start-end":[{col:["auto",{span:["full",Aa,Me]},Me]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Ra]}],"row-start-end":[{row:["auto",{span:[Aa,Me]},Me]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qp]}],"font-family":[{font:[Ra]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",oo,qp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Cr,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Cr,us]}],"underline-offset":[{"underline-offset":["auto",Cr,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),e9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},n9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[Cr,Me]}],"outline-w":[{outline:[Cr,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Cr,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,r9]}],"shadow-color":[{shadow:[Ra]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ds,Me]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[k]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Aa,Me]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Cr,us,qp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},l9=VV(a9);function Bt(...e){return l9(RV(e))}const c9={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function Ss({open:e,onOpenChange:t,title:n,description:r,children:s,className:o,size:a="md"}){return h.jsx(_V,{open:e,onOpenChange:t,children:h.jsxs(kV,{children:[h.jsx(NV,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),h.jsxs(CV,{className:Bt("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]","w-full rounded-lg border border-node-border bg-panel-bg shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","duration-200",c9[a],o),children:[(n||r)&&h.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[h.jsxs("div",{children:[n&&h.jsx(EV,{className:"text-lg font-semibold text-white",children:n}),r&&h.jsx(jV,{className:"mt-1 text-sm text-gray-400",children:r})]}),h.jsx(AV,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:h.jsx(Cl,{className:"w-5 h-5 text-gray-400"})})]}),h.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function ni({children:e,className:t}){return h.jsx("div",{className:Bt("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const u9={primary:"bg-primary hover:bg-primary-dark text-white border-transparent",secondary:"bg-node-bg hover:bg-white/10 text-gray-300 border-node-border hover:border-primary",ghost:"bg-transparent hover:bg-white/10 text-gray-300 border-transparent",destructive:"bg-error/10 hover:bg-error/20 text-error border-error/20 hover:border-error"},d9={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Be=A.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:o,children:a,...c},u)=>h.jsxs("button",{ref:u,disabled:o||r,className:Bt("inline-flex items-center justify-center gap-2 rounded-lg border font-medium transition-colors","focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2 focus:ring-offset-panel-bg","disabled:opacity-50 disabled:cursor-not-allowed",u9[t],d9[n],e),...c,children:[r?h.jsx(ws,{className:"w-4 h-4 animate-spin"}):s&&h.jsx("span",{className:"flex-shrink-0",children:s}),a]}));Be.displayName="Button";function VI(e){const t=e+"CollectionProvider",[n,r]=ii(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:w,children:S}=x,N=pt.useRef(null),k=pt.useRef(new Map).current;return h.jsx(s,{scope:w,itemMap:k,collectionRef:N,children:S})};a.displayName=t;const c=e+"CollectionSlot",u=ll(c),d=pt.forwardRef((x,w)=>{const{scope:S,children:N}=x,k=o(c,S),C=Et(w,k.collectionRef);return h.jsx(u,{ref:C,children:N})});d.displayName=c;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=ll(m),v=pt.forwardRef((x,w)=>{const{scope:S,children:N,...k}=x,C=pt.useRef(null),j=Et(w,C),R=o(m,S);return pt.useEffect(()=>(R.itemMap.set(C,{ref:C,...k}),()=>void R.itemMap.delete(C))),h.jsx(g,{[p]:"",ref:j,children:N})});v.displayName=m;function b(x){const w=o(e+"CollectionConsumer",x);return pt.useCallback(()=>{const N=w.collectionRef.current;if(!N)return[];const k=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((R,T)=>k.indexOf(R.ref.current)-k.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:d,ItemSlot:v},b,r]}var f9=A.createContext(void 0);function Fw(e){const t=A.useContext(f9);return e||t||"ltr"}var Fp="rovingFocusGroup.onEntryFocus",h9={bubbles:!1,cancelable:!0},jl="RovingFocusGroup",[Vx,UI,p9]=VI(jl),[m9,Fd]=ii(jl,[p9]),[g9,y9]=m9(jl),HI=A.forwardRef((e,t)=>h.jsx(Vx.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Vx.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(v9,{...e,ref:t})})}));HI.displayName=jl;var v9=A.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=e,g=A.useRef(null),v=Et(t,g),b=Fw(o),[x,w]=Tw({prop:a,defaultProp:c??null,onChange:u,caller:jl}),[S,N]=A.useState(!1),k=ur(d),C=UI(n),j=A.useRef(!1),[R,T]=A.useState(0);return A.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(Fp,k),()=>M.removeEventListener(Fp,k)},[k]),h.jsx(g9,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:x,onItemFocus:A.useCallback(M=>w(M),[w]),onItemShiftTab:A.useCallback(()=>N(!0),[]),onFocusableItemAdd:A.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:A.useCallback(()=>T(M=>M-1),[]),children:h.jsx(Ze.div,{tabIndex:S||R===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{j.current=!0}),onFocus:Te(e.onFocus,M=>{const P=!j.current;if(M.target===M.currentTarget&&P&&!S){const B=new CustomEvent(Fp,h9);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const O=C().filter(V=>V.focusable),$=O.find(V=>V.active),U=O.find(V=>V.id===x),z=[$,U,...O].filter(Boolean).map(V=>V.ref.current);GI(z,m)}}j.current=!1}),onBlur:Te(e.onBlur,()=>N(!1))})})}),WI="RovingFocusGroupItem",KI=A.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...c}=e,u=Ka(),d=o||u,m=y9(WI,n),p=m.currentTabStopId===d,g=UI(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=m;return A.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),h.jsx(Vx.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:h.jsx(Ze.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:t,onMouseDown:Te(e.onMouseDown,w=>{r?m.onItemFocus(d):w.preventDefault()}),onFocus:Te(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Te(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=b9(w,m.orientation,m.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=g().filter(C=>C.focusable).map(C=>C.ref.current);if(S==="last")k.reverse();else if(S==="prev"||S==="next"){S==="prev"&&k.reverse();const C=k.indexOf(w.currentTarget);k=m.loop?S9(k,C+1):k.slice(C+1)}setTimeout(()=>GI(k))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:x!=null}):a})})});KI.displayName=WI;var x9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function b9(e,t,n){const r=w9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return x9[r]}function GI(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function S9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YI=HI,XI=KI,Bd="Tabs",[_9]=ii(Bd,[Fd]),QI=Fd(),[k9,Bw]=_9(Bd),JI=A.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,m=Fw(c),[p,g]=Tw({prop:r,onChange:s,defaultProp:o??"",caller:Bd});return h.jsx(k9,{scope:n,baseId:Ka(),value:p,onValueChange:g,orientation:a,dir:m,activationMode:u,children:h.jsx(Ze.div,{dir:m,"data-orientation":a,...d,ref:t})})});JI.displayName=Bd;var ZI="TabsList",eM=A.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Bw(ZI,n),a=QI(n);return h.jsx(YI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:h.jsx(Ze.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});eM.displayName=ZI;var tM="TabsTrigger",nM=A.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Bw(tM,n),c=QI(n),u=iM(a.baseId,r),d=oM(a.baseId,r),m=r===a.value;return h.jsx(XI,{asChild:!0,...c,focusable:!s,active:m,children:h.jsx(Ze.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const p=a.activationMode!=="manual";!m&&!s&&p&&a.onValueChange(r)})})})});nM.displayName=tM;var rM="TabsContent",sM=A.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Bw(rM,n),u=iM(c.baseId,r),d=oM(c.baseId,r),m=r===c.value,p=A.useRef(m);return A.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx($r,{present:s||m,children:({present:g})=>h.jsx(Ze.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});sM.displayName=rM;function iM(e,t){return`${e}-trigger-${t}`}function oM(e,t){return`${e}-content-${t}`}var N9=JI,aM=eM,lM=nM,cM=sM;const uM=N9,zw=A.forwardRef(({className:e,...t},n)=>h.jsx(aM,{ref:n,className:Bt("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));zw.displayName=aM.displayName;const nr=A.forwardRef(({className:e,...t},n)=>h.jsx(lM,{ref:n,className:Bt("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm font-medium","text-gray-400 transition-all","hover:text-gray-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:text-primary data-[state=active]:border-b-2 data-[state=active]:border-primary data-[state=active]:-mb-px",e),...t}));nr.displayName=lM.displayName;const rr=A.forwardRef(({className:e,...t},n)=>h.jsx(cM,{ref:n,className:Bt("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));rr.displayName=cM.displayName;function nN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C9(e){if(Array.isArray(e))return e}function E9(e,t,n){return(t=O9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,a,c=[],u=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(m){d=!0,s=m}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function A9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
552
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function sN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rN(Object(n),!0).forEach(function(r){E9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R9(e,t){if(e==null)return{};var n,r,s=T9(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function T9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function I9(e,t){return C9(e)||j9(e,t)||P9(e,t)||A9()}function M9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O9(e){var t=M9(e,"string");return typeof t=="symbol"?t:t+""}function P9(e,t){if(e){if(typeof e=="string")return nN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nN(e,t):void 0}}function L9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function oN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iN(Object(n),!0).forEach(function(r){L9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,o){return o(s)},r)}}function La(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function ud(e){return{}.toString.call(e).includes("Object")}function $9(e){return!Object.keys(e).length}function cl(e){return typeof e=="function"}function q9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function F9(e,t){return ud(t)||ys("changeType"),Object.keys(t).some(function(n){return!q9(e,n)})&&ys("changeField"),t}function B9(e){cl(e)||ys("selectorType")}function z9(e){cl(e)||ud(e)||ys("handlerType"),ud(e)&&Object.values(e).some(function(t){return!cl(t)})&&ys("handlersType")}function V9(e){e||ys("initialIsRequired"),ud(e)||ys("initialType"),$9(e)&&ys("initialContent")}function U9(e,t){throw new Error(e[t]||e.default)}var H9={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ys=La(U9)(H9),bu={changes:F9,selector:B9,handler:z9,initial:V9};function W9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bu.initial(e),bu.handler(t);var n={current:e},r=La(Y9)(n,t),s=La(G9)(n),o=La(bu.changes)(e),a=La(K9)(n);function c(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return bu.selector(d),d(n.current)}function u(d){D9(r,s,o,a)(d)}return[c,u]}function K9(e,t){return cl(t)?t(e.current):t}function G9(e,t){return e.current=oN(oN({},e.current),t),t}function Y9(e,t,n){return cl(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var X9={create:W9},Q9={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function J9(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function Z9(e){return{}.toString.call(e).includes("Object")}function eU(e){return e||aN("configIsRequired"),Z9(e)||aN("configType"),e.urls?(tU(),{paths:{vs:e.urls.monacoBase}}):e}function tU(){console.warn(dM.deprecation)}function nU(e,t){throw new Error(e[t]||e.default)}var dM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
553
|
-
You are using deprecated way of configuration.
|
|
554
|
-
|
|
555
|
-
Instead of using
|
|
556
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
557
|
-
use
|
|
558
|
-
monaco.config({ paths: { vs: '...' } })
|
|
559
|
-
|
|
560
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
561
|
-
`},aN=J9(nU)(dM),rU={config:eU},sU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function fM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],fM(e[n],t[n]))}),sN(sN({},e),t)}var iU={type:"cancelation",msg:"operation is manually canceled"};function Bp(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(iU):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var oU=["monaco"],aU=X9.create({config:Q9,isInitialized:!1,resolve:null,reject:null,monaco:null}),hM=I9(aU,2),Al=hM[0],zd=hM[1];function lU(e){var t=rU.config(e),n=t.monaco,r=R9(t,oU);zd(function(s){return{config:fM(s.config,r),monaco:n}})}function cU(){var e=Al(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(zd({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Bp(zp);if(window.monaco&&window.monaco.editor)return pM(window.monaco),e.resolve(window.monaco),Bp(zp);sU(uU,fU)(hU)}return Bp(zp)}function uU(e){return document.body.appendChild(e)}function dU(e){var t=document.createElement("script");return e&&(t.src=e),t}function fU(e){var t=Al(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=dU("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function hU(){var e=Al(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;pM(r),e.resolve(r)},function(n){e.reject(n)})}function pM(e){Al().monaco||zd({monaco:e})}function pU(){return Al(function(e){var t=e.monaco;return t})}var zp=new Promise(function(e,t){return zd({resolve:e,reject:t})}),mM={config:lU,init:cU,__getMonacoInstance:pU},mU={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Vp=mU,gU={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},yU=gU;function vU({children:e}){return pt.createElement("div",{style:yU.container},e)}var xU=vU,wU=xU;function bU({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return pt.createElement("section",{style:{...Vp.wrapper,width:e,height:t},...a},!n&&pt.createElement(wU,null,r),pt.createElement("div",{ref:s,style:{...Vp.fullWidth,...!n&&Vp.hide},className:o}))}var SU=bU,gM=A.memo(SU);function _U(e){A.useEffect(e,[])}var yM=_U;function kU(e,t,n=!0){let r=A.useRef(!0);A.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ln=kU;function Ga(){}function Zi(e,t,n,r){return NU(e,r)||CU(e,t,n,r)}function NU(e,t){return e.editor.getModel(vM(e,t))}function CU(e,t,n,r){return e.editor.createModel(t,n,r?vM(e,r):void 0)}function vM(e,t){return e.Uri.parse(t)}function EU({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:d="light",loading:m="Loading...",options:p={},height:g="100%",width:v="100%",className:b,wrapperProps:x={},beforeMount:w=Ga,onMount:S=Ga}){let[N,k]=A.useState(!1),[C,j]=A.useState(!0),R=A.useRef(null),T=A.useRef(null),M=A.useRef(null),P=A.useRef(S),B=A.useRef(w),O=A.useRef(!1);yM(()=>{let z=mM.init();return z.then(V=>(T.current=V)&&j(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>R.current?D():z.cancel()}),ln(()=>{if(R.current&&T.current){let z=R.current.getOriginalEditor(),V=Zi(T.current,e||"",r||n||"text",o||"");V!==z.getModel()&&z.setModel(V)}},[o],N),ln(()=>{if(R.current&&T.current){let z=R.current.getModifiedEditor(),V=Zi(T.current,t||"",s||n||"text",a||"");V!==z.getModel()&&z.setModel(V)}},[a],N),ln(()=>{let z=R.current.getModifiedEditor();z.getOption(T.current.editor.EditorOption.readOnly)?z.setValue(t||""):t!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[t],N),ln(()=>{var z,V;(V=(z=R.current)==null?void 0:z.getModel())==null||V.original.setValue(e||"")},[e],N),ln(()=>{let{original:z,modified:V}=R.current.getModel();T.current.editor.setModelLanguage(z,r||n||"text"),T.current.editor.setModelLanguage(V,s||n||"text")},[n,r,s],N),ln(()=>{var z;(z=T.current)==null||z.editor.setTheme(d)},[d],N),ln(()=>{var z;(z=R.current)==null||z.updateOptions(p)},[p],N);let $=A.useCallback(()=>{var Y;if(!T.current)return;B.current(T.current);let z=Zi(T.current,e||"",r||n||"text",o||""),V=Zi(T.current,t||"",s||n||"text",a||"");(Y=R.current)==null||Y.setModel({original:z,modified:V})},[n,t,s,e,r,o,a]),U=A.useCallback(()=>{var z;!O.current&&M.current&&(R.current=T.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...p}),$(),(z=T.current)==null||z.editor.setTheme(d),k(!0),O.current=!0)},[p,d,$]);A.useEffect(()=>{N&&P.current(R.current,T.current)},[N]),A.useEffect(()=>{!C&&!N&&U()},[C,N,U]);function D(){var V,Y,F,q;let z=(V=R.current)==null?void 0:V.getModel();c||((Y=z==null?void 0:z.original)==null||Y.dispose()),u||((F=z==null?void 0:z.modified)==null||F.dispose()),(q=R.current)==null||q.dispose()}return pt.createElement(gM,{width:v,height:g,isEditorReady:N,loading:m,_ref:M,className:b,wrapperProps:x})}var jU=EU;A.memo(jU);function AU(e){let t=A.useRef();return A.useEffect(()=>{t.current=e},[e]),t.current}var RU=AU,Su=new Map;function TU({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:c,loading:u="Loading...",options:d={},overrideServices:m={},saveViewState:p=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:x,wrapperProps:w={},beforeMount:S=Ga,onMount:N=Ga,onChange:k,onValidate:C=Ga}){let[j,R]=A.useState(!1),[T,M]=A.useState(!0),P=A.useRef(null),B=A.useRef(null),O=A.useRef(null),$=A.useRef(N),U=A.useRef(S),D=A.useRef(),z=A.useRef(r),V=RU(o),Y=A.useRef(!1),F=A.useRef(!1);yM(()=>{let L=mM.init();return L.then(W=>(P.current=W)&&M(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>B.current?G():L.cancel()}),ln(()=>{var W,oe,K,J;let L=Zi(P.current,e||r||"",t||s||"",o||n||"");L!==((W=B.current)==null?void 0:W.getModel())&&(p&&Su.set(V,(oe=B.current)==null?void 0:oe.saveViewState()),(K=B.current)==null||K.setModel(L),p&&((J=B.current)==null||J.restoreViewState(Su.get(o))))},[o],j),ln(()=>{var L;(L=B.current)==null||L.updateOptions(d)},[d],j),ln(()=>{!B.current||r===void 0||(B.current.getOption(P.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(F.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),F.current=!1))},[r],j),ln(()=>{var W,oe;let L=(W=B.current)==null?void 0:W.getModel();L&&s&&((oe=P.current)==null||oe.editor.setModelLanguage(L,s))},[s],j),ln(()=>{var L;c!==void 0&&((L=B.current)==null||L.revealLine(c))},[c],j),ln(()=>{var L;(L=P.current)==null||L.editor.setTheme(a)},[a],j);let q=A.useCallback(()=>{var L;if(!(!O.current||!P.current)&&!Y.current){U.current(P.current);let W=o||n,oe=Zi(P.current,r||e||"",t||s||"",W||"");B.current=(L=P.current)==null?void 0:L.editor.create(O.current,{model:oe,automaticLayout:!0,...d},m),p&&B.current.restoreViewState(Su.get(W)),P.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),R(!0),Y.current=!0}},[e,t,n,r,s,o,d,m,p,a,c]);A.useEffect(()=>{j&&$.current(B.current,P.current)},[j]),A.useEffect(()=>{!T&&!j&&q()},[T,j,q]),z.current=r,A.useEffect(()=>{var L,W;j&&k&&((L=D.current)==null||L.dispose(),D.current=(W=B.current)==null?void 0:W.onDidChangeModelContent(oe=>{F.current||k(B.current.getValue(),oe)}))},[j,k]),A.useEffect(()=>{if(j){let L=P.current.editor.onDidChangeMarkers(W=>{var K;let oe=(K=B.current.getModel())==null?void 0:K.uri;if(oe&&W.find(J=>J.path===oe.path)){let J=P.current.editor.getModelMarkers({resource:oe});C==null||C(J)}});return()=>{L==null||L.dispose()}}return()=>{}},[j,C]);function G(){var L,W;(L=D.current)==null||L.dispose(),g?p&&Su.set(o,B.current.saveViewState()):(W=B.current.getModel())==null||W.dispose(),B.current.dispose()}return pt.createElement(gM,{width:v,height:b,isEditorReady:j,loading:u,_ref:O,className:x,wrapperProps:w})}var IU=TU,MU=A.memo(IU),Ya=MU;const Vw=Symbol.for("yaml.alias"),Ux=Symbol.for("yaml.document"),vs=Symbol.for("yaml.map"),xM=Symbol.for("yaml.pair"),dr=Symbol.for("yaml.scalar"),Co=Symbol.for("yaml.seq"),Nn=Symbol.for("yaml.node.type"),oi=e=>!!e&&typeof e=="object"&&e[Nn]===Vw,Rl=e=>!!e&&typeof e=="object"&&e[Nn]===Ux,Tl=e=>!!e&&typeof e=="object"&&e[Nn]===vs,ft=e=>!!e&&typeof e=="object"&&e[Nn]===xM,He=e=>!!e&&typeof e=="object"&&e[Nn]===dr,Il=e=>!!e&&typeof e=="object"&&e[Nn]===Co;function ut(e){if(e&&typeof e=="object")switch(e[Nn]){case vs:case Co:return!0}return!1}function dt(e){if(e&&typeof e=="object")switch(e[Nn]){case Vw:case vs:case dr:case Co:return!0}return!1}const wM=e=>(He(e)||ut(e))&&!!e.anchor,Us=Symbol("break visit"),OU=Symbol("skip children"),Xa=Symbol("remove node");function Eo(e,t){const n=PU(t);Rl(e)?eo(null,e.contents,n,Object.freeze([e]))===Xa&&(e.contents=null):eo(null,e,n,Object.freeze([]))}Eo.BREAK=Us;Eo.SKIP=OU;Eo.REMOVE=Xa;function eo(e,t,n,r){const s=LU(e,t,n,r);if(dt(s)||ft(s))return DU(e,r,s),eo(e,s,n,r);if(typeof s!="symbol"){if(ut(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=eo(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===Us)return Us;a===Xa&&(t.items.splice(o,1),o-=1)}}}else if(ft(t)){r=Object.freeze(r.concat(t));const o=eo("key",t.key,n,r);if(o===Us)return Us;o===Xa&&(t.key=null);const a=eo("value",t.value,n,r);if(a===Us)return Us;a===Xa&&(t.value=null)}}return s}function PU(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function LU(e,t,n,r){var s,o,a,c,u;if(typeof n=="function")return n(e,t,r);if(Tl(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(Il(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(ft(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(He(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(oi(t))return(u=n.Alias)==null?void 0:u.call(n,e,t,r)}function DU(e,t,n){const r=t[t.length-1];if(ut(r))r.items[e]=n;else if(ft(r))e==="key"?r.key=n:r.value=n;else if(Rl(r))r.contents=n;else{const s=oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const $U={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qU=e=>e.replace(/[!,[\]{}]/g,t=>$U[t]);class qt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},qt.defaultYaml,t),this.tags=Object.assign({},qt.defaultTags,n)}clone(){const t=new qt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new qt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:qt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},qt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:qt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},qt.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,a]=r;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+qU(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&dt(t.contents)){const o={};Eo(t.contents,(a,c)=>{dt(c)&&c.tag&&(o[c.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,a]of r)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
|
|
562
|
-
`)}}qt.defaultYaml={explicit:!1,version:"1.2"};qt.defaultTags={"!!":"tag:yaml.org,2002:"};function bM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function SM(e){const t=new Set;return Eo(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function _M(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function FU(e,t){const n=[],r=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=SM(e));const a=_M(t,s);return s.add(a),a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a=="object"&&a.anchor&&(He(a.node)||ut(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=o,c}}},sourceObjects:r}}function to(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,o=r.length;s<o;++s){const a=r[s],c=to(e,r,String(s),a);c===void 0?delete r[s]:c!==a&&(r[s]=c)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const o=r.get(s),a=to(e,r,s,o);a===void 0?r.delete(s):a!==o&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const o=to(e,r,s,s);o===void 0?r.delete(s):o!==s&&(r.delete(s),r.add(o))}else for(const[s,o]of Object.entries(r)){const a=to(e,r,s,o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}return e.call(t,n,r)}function _n(e,t,n){if(Array.isArray(e))return e.map((r,s)=>_n(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!wM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Uw{constructor(t){Object.defineProperty(this,Nn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:o}={}){if(!Rl(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=_n(this,"",a);if(typeof s=="function")for(const{count:u,res:d}of a.anchors.values())s(d,u);return typeof o=="function"?to(o,{"":c},"",c):c}}class Hw extends Uw{constructor(t){super(Vw),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Eo(t,{Node:(o,a)=>{(oi(a)||wM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const o of r){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:o}=n,a=this.resolve(s,n);if(!a){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let c=r.get(a);if(c||(_n(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Bu(s,a,r)),c.count*c.aliasCount>o)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(bM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}}function Bu(e,t,n){if(oi(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ut(t)){let r=0;for(const s of t.items){const o=Bu(e,s,n);o>r&&(r=o)}return r}else if(ft(t)){const r=Bu(e,t.key,n),s=Bu(e,t.value,n);return Math.max(r,s)}return 1}const kM=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Uw{constructor(t){super(dr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:_n(this.value,t,n)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const BU="tag:yaml.org,2002:";function zU(e,t,n){if(t){const r=n.filter(o=>o.tag===t),s=r.find(o=>!o.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function ul(e,t,n){var p,g,v;if(Rl(e)&&(e=e.contents),dt(e))return e;if(ft(e)){const b=(g=(p=n.schema[vs]).createNode)==null?void 0:g.call(p,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:o,schema:a,sourceObjects:c}=n;let u;if(r&&e&&typeof e=="object"){if(u=c.get(e),u)return u.anchor??(u.anchor=s(e)),new Hw(u.anchor);u={anchor:null,node:null},c.set(e,u)}t!=null&&t.startsWith("!!")&&(t=BU+t.slice(2));let d=zU(e,t,a.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new Re(e);return u&&(u.node=b),b}d=e instanceof Map?a[vs]:Symbol.iterator in Object(e)?a[Co]:a[vs]}o&&(o(d),delete n.onTagObj);const m=d!=null&&d.createNode?d.createNode(n.schema,e,n):typeof((v=d==null?void 0:d.nodeClass)==null?void 0:v.from)=="function"?d.nodeClass.from(n.schema,e,n):new Re(e);return t?m.tag=t:d.default||(m.tag=d.tag),u&&(u.node=m),m}function dd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r,r=a}else r=new Map([[o,r]])}return ul(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Da=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let NM=class extends Uw{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>dt(r)||ft(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Da(t))this.add(n);else{const[r,...s]=t,o=this.get(r,!0);if(ut(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(r,dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(ut(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,o=this.get(r,!0);return s.length===0?!n&&He(o)?o.value:o:ut(o)?o.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ft(n))return!1;const r=n.value;return r==null||t&&He(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return ut(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const o=this.get(r,!0);if(ut(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(r,dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const VU=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ar(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ws=(e,t,n)=>e.endsWith(`
|
|
563
|
-
`)?Ar(n,t):n.includes(`
|
|
564
|
-
`)?`
|
|
565
|
-
`+Ar(n,t):(e.endsWith(" ")?"":" ")+n,CM="flow",Hx="block",zu="quoted";function Vd(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:o=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<o&&(o=0);const u=Math.max(1+o,1+s-t.length);if(e.length<=u)return e;const d=[],m={};let p=s-t.length;typeof r=="number"&&(r>s-Math.max(2,o)?d.push(0):p=s-r);let g,v,b=!1,x=-1,w=-1,S=-1;n===Hx&&(x=lN(e,x,t.length),x!==-1&&(p=x+u));for(let k;k=e[x+=1];){if(n===zu&&k==="\\"){switch(w=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}S=x}if(k===`
|
|
566
|
-
`)n===Hx&&(x=lN(e,x,t.length)),p=x+t.length+u,g=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
|
|
567
|
-
`&&v!==" "){const C=e[x+1];C&&C!==" "&&C!==`
|
|
568
|
-
`&&C!==" "&&(g=x)}if(x>=p)if(g)d.push(g),p=g+u,g=void 0;else if(n===zu){for(;v===" "||v===" ";)v=k,k=e[x+=1],b=!0;const C=x>S+1?x-2:w-1;if(m[C])return e;d.push(C),m[C]=!0,p=C+u,g=void 0}else b=!0}v=k}if(b&&c&&c(),d.length===0)return e;a&&a();let N=e.slice(0,d[0]);for(let k=0;k<d.length;++k){const C=d[k],j=d[k+1]||e.length;C===0?N=`
|
|
569
|
-
${t}${e.slice(0,j)}`:(n===zu&&m[C]&&(N+=`${e[C]}\\`),N+=`
|
|
570
|
-
${t}${e.slice(C+1,j)}`)}return N}function lN(e,t,n){let r=t,s=t+1,o=e[s];for(;o===" "||o===" ";)if(t<s+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
571
|
-
`);r=t,s=t+1,o=e[s]}return r}const Ud=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Hd=e=>/^(%|---|\.\.\.)/m.test(e);function UU(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let o=0,a=0;o<s;++o)if(e[o]===`
|
|
572
|
-
`){if(o-a>r)return!0;if(a=o+1,s-a<=r)return!1}return!0}function Qa(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Hd(e)?" ":"");let a="",c=0;for(let u=0,d=n[u];d;d=n[++u])if(d===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(a+=n.slice(c,u)+"\\ ",u+=1,c=u,d="\\"),d==="\\")switch(n[u+1]){case"u":{a+=n.slice(c,u);const m=n.substr(u+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=n.substr(u,6)}u+=5,c=u+1}break;case"n":if(r||n[u+2]==='"'||n.length<s)u+=1;else{for(a+=n.slice(c,u)+`
|
|
573
|
-
|
|
574
|
-
`;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)a+=`
|
|
575
|
-
`,u+=2;a+=o,n[u+2]===" "&&(a+="\\"),u+=1,c=u+1}break;default:u+=1}return a=c?a+n.slice(c):n,r?a:Vd(a,o,zu,Ud(t,!1))}function Wx(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
576
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return Qa(e,t);const n=t.indent||(Hd(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
577
|
-
${n}`)+"'";return t.implicitKey?r:Vd(r,n,CM,Ud(t,!1))}function no(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Qa;else{const s=e.includes('"'),o=e.includes("'");s&&!o?r=Wx:o&&!s?r=Qa:r=n?Wx:Qa}return r(e,t)}let Kx;try{Kx=new RegExp(`(^|(?<!
|
|
578
|
-
))
|
|
579
|
-
+(?!
|
|
580
|
-
|$)`,"g")}catch{Kx=/\n+(?!\n|$)/g}function Vu({comment:e,type:t,value:n},r,s,o){const{blockQuote:a,commentString:c,lineWidth:u}=r.options;if(!a||/\n[\t ]+$/.test(n))return no(n,r);const d=r.indent||(r.forceBlockIndent||Hd(n)?" ":""),m=a==="literal"?!0:a==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!UU(n,u,d.length);if(!n)return m?`|
|
|
581
|
-
`:`>
|
|
582
|
-
`;let p,g;for(g=n.length;g>0;--g){const j=n[g-1];if(j!==`
|
|
583
|
-
`&&j!==" "&&j!==" ")break}let v=n.substring(g);const b=v.indexOf(`
|
|
584
|
-
`);b===-1?p="-":n===v||b!==v.length-1?(p="+",o&&o()):p="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
585
|
-
`&&(v=v.slice(0,-1)),v=v.replace(Kx,`$&${d}`));let x=!1,w,S=-1;for(w=0;w<n.length;++w){const j=n[w];if(j===" ")x=!0;else if(j===`
|
|
586
|
-
`)S=w;else break}let N=n.substring(0,S<w?S+1:w);N&&(n=n.substring(N.length),N=N.replace(/\n+/g,`$&${d}`));let C=(x?d?"2":"1":"")+p;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!m){const j=n.replace(/\n+/g,`
|
|
587
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let R=!1;const T=Ud(r,!0);a!=="folded"&&t!==Re.BLOCK_FOLDED&&(T.onOverflow=()=>{R=!0});const M=Vd(`${N}${j}${v}`,d,Hx,T);if(!R)return`>${C}
|
|
588
|
-
${d}${M}`}return n=n.replace(/\n+/g,`$&${d}`),`|${C}
|
|
589
|
-
${d}${N}${n}${v}`}function HU(e,t,n,r){const{type:s,value:o}=e,{actualString:a,implicitKey:c,indent:u,indentStep:d,inFlow:m}=t;if(c&&o.includes(`
|
|
590
|
-
`)||m&&/[[\]{},]/.test(o))return no(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||m||!o.includes(`
|
|
591
|
-
`)?no(o,t):Vu(e,t,n,r);if(!c&&!m&&s!==Re.PLAIN&&o.includes(`
|
|
592
|
-
`))return Vu(e,t,n,r);if(Hd(o)){if(u==="")return t.forceBlockIndent=!0,Vu(e,t,n,r);if(c&&u===d)return no(o,t)}const p=o.replace(/\n+/g,`$&
|
|
593
|
-
${u}`);if(a){const g=x=>{var w;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((w=x.test)==null?void 0:w.test(p))},{compat:v,tags:b}=t.doc.schema;if(b.some(g)||v!=null&&v.some(g))return no(o,t)}return c?p:Vd(p,u,CM,Ud(t,!1))}function Ww(e,t,n,r){const{implicitKey:s,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Re.QUOTE_DOUBLE);const u=m=>{switch(m){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return s||o?no(a.value,t):Vu(a,t,n,r);case Re.QUOTE_DOUBLE:return Qa(a.value,t);case Re.QUOTE_SINGLE:return Wx(a.value,t);case Re.PLAIN:return HU(a,t,n,r);default:return null}};let d=u(c);if(d===null){const{defaultKeyType:m,defaultStringType:p}=t.options,g=s&&m||p;if(d=u(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function EM(e,t){const n=Object.assign({blockQuote:!0,commentString:VU,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function WU(e,t){var s;if(t.tag){const o=e.filter(a=>a.tag===t.tag);if(o.length>0)return o.find(a=>a.format===t.format)??o[0]}let n,r;if(He(t)){r=t.value;let o=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(o.length>1){const a=o.filter(c=>c.test);a.length>0&&(o=a)}n=o.find(a=>a.format===t.format)??o.find(a=>!a.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function KU(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],o=(He(e)||ut(e))&&e.anchor;o&&bM(o)&&(n.add(o),s.push(`&${o}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function wo(e,t,n,r){var u;if(ft(e))return e.toString(t,n,r);if(oi(e)){if(t.doc.directives)return e.toString(t);if((u=t.resolvedAliases)!=null&&u.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=dt(e)?e:t.doc.createNode(e,{onTagObj:d=>s=d});s??(s=WU(t.doc.schema.tags,o));const a=KU(o,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(o,t,n,r):He(o)?Ww(o,t,n,r):o.toString(t,n,r);return a?He(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
594
|
-
${t.indent}${c}`:c}function GU({key:e,value:t},n,r,s){const{allNullValues:o,doc:a,indent:c,indentStep:u,options:{commentString:d,indentSeq:m,simpleKeys:p}}=n;let g=dt(e)&&e.comment||null;if(p){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ut(e)||!dt(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let v=!p&&(!e||g&&t==null&&!n.inFlow||ut(e)||(He(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(p||!o),indent:c+u});let b=!1,x=!1,w=wo(e,n,()=>b=!0,()=>x=!0);if(!v&&!n.inFlow&&w.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(o||t==null)return b&&r&&r(),w===""?"?":v?`? ${w}`:w}else if(o&&!p||t==null&&v)return w=`? ${w}`,g&&!b?w+=Ws(w,n.indent,d(g)):x&&s&&s(),w;b&&(g=null),v?(g&&(w+=Ws(w,n.indent,d(g))),w=`? ${w}
|
|
595
|
-
${c}:`):(w=`${w}:`,g&&(w+=Ws(w,n.indent,d(g))));let S,N,k;dt(t)?(S=!!t.spaceBefore,N=t.commentBefore,k=t.comment):(S=!1,N=null,k=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!v&&!g&&He(t)&&(n.indentAtStart=w.length+1),x=!1,!m&&u.length>=2&&!n.inFlow&&!v&&Il(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const j=wo(t,n,()=>C=!0,()=>x=!0);let R=" ";if(g||S||N){if(R=S?`
|
|
596
|
-
`:"",N){const T=d(N);R+=`
|
|
597
|
-
${Ar(T,n.indent)}`}j===""&&!n.inFlow?R===`
|
|
598
|
-
`&&k&&(R=`
|
|
599
|
-
|
|
600
|
-
`):R+=`
|
|
601
|
-
${n.indent}`}else if(!v&&ut(t)){const T=j[0],M=j.indexOf(`
|
|
602
|
-
`),P=M!==-1,B=n.inFlow??t.flow??t.items.length===0;if(P||!B){let O=!1;if(P&&(T==="&"||T==="!")){let $=j.indexOf(" ");T==="&"&&$!==-1&&$<M&&j[$+1]==="!"&&($=j.indexOf(" ",$+1)),($===-1||M<$)&&(O=!0)}O||(R=`
|
|
603
|
-
${n.indent}`)}}else(j===""||j[0]===`
|
|
604
|
-
`)&&(R="");return w+=R+j,n.inFlow?C&&r&&r():k&&!C?w+=Ws(w,n.indent,d(k)):x&&s&&s(),w}function jM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const _u="<<",Tr={identify:e=>e===_u||typeof e=="symbol"&&e.description===_u,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(_u)),{addToJSMap:AM}),stringify:()=>_u},YU=(e,t)=>(Tr.identify(t)||He(t)&&(!t.type||t.type===Re.PLAIN)&&Tr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Tr.tag&&n.default));function AM(e,t,n){if(n=e&&oi(n)?n.resolve(e.doc):n,Il(n))for(const r of n.items)Up(e,t,r);else if(Array.isArray(n))for(const r of n)Up(e,t,r);else Up(e,t,n)}function Up(e,t,n){const r=e&&oi(n)?n.resolve(e.doc):n;if(!Tl(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[o,a]of s)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function RM(e,t,{key:n,value:r}){if(dt(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(YU(e,n))AM(e,t,r);else{const s=_n(n,"",e);if(t instanceof Map)t.set(s,_n(r,s,e));else if(t instanceof Set)t.add(s);else{const o=XU(n,s,e),a=_n(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function XU(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(dt(e)&&(n!=null&&n.doc)){const r=EM(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),jM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Kw(e,t,n){const r=ul(e,void 0,n),s=ul(t,void 0,n);return new Ft(r,s)}class Ft{constructor(t,n=null){Object.defineProperty(this,Nn,{value:xM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return dt(n)&&(n=n.clone(t)),dt(r)&&(r=r.clone(t)),new Ft(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return RM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?GU(this,t,n,r):JSON.stringify(this)}}function TM(e,t,n){return(t.inFlow??e.flow?JU:QU)(e,t,n)}function QU({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:u,options:{commentString:d}}=n,m=Object.assign({},n,{indent:o,type:null});let p=!1;const g=[];for(let b=0;b<t.length;++b){const x=t[b];let w=null;if(dt(x))!p&&x.spaceBefore&&g.push(""),fd(n,g,x.commentBefore,p),x.comment&&(w=x.comment);else if(ft(x)){const N=dt(x.key)?x.key:null;N&&(!p&&N.spaceBefore&&g.push(""),fd(n,g,N.commentBefore,p))}p=!1;let S=wo(x,m,()=>w=null,()=>p=!0);w&&(S+=Ws(S,o,d(w))),p&&w&&(p=!1),g.push(r+S)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let b=1;b<g.length;++b){const x=g[b];v+=x?`
|
|
605
|
-
${u}${x}`:`
|
|
606
|
-
`}}return e?(v+=`
|
|
607
|
-
`+Ar(d(e),u),c&&c()):p&&a&&a(),v}function JU({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:o,flowCollectionPadding:a,options:{commentString:c}}=t;r+=o;const u=Object.assign({},t,{indent:r,inFlow:!0,type:null});let d=!1,m=0;const p=[];for(let b=0;b<e.length;++b){const x=e[b];let w=null;if(dt(x))x.spaceBefore&&p.push(""),fd(t,p,x.commentBefore,!1),x.comment&&(w=x.comment);else if(ft(x)){const N=dt(x.key)?x.key:null;N&&(N.spaceBefore&&p.push(""),fd(t,p,N.commentBefore,!1),N.comment&&(d=!0));const k=dt(x.value)?x.value:null;k?(k.comment&&(w=k.comment),k.commentBefore&&(d=!0)):x.value==null&&(N!=null&&N.comment)&&(w=N.comment)}w&&(d=!0);let S=wo(x,u,()=>w=null);b<e.length-1&&(S+=","),w&&(S+=Ws(S,r,c(w))),!d&&(p.length>m||S.includes(`
|
|
608
|
-
`))&&(d=!0),p.push(S),m=p.length}const{start:g,end:v}=n;if(p.length===0)return g+v;if(!d){const b=p.reduce((x,w)=>x+w.length+2,2);d=t.options.lineWidth>0&&b>t.options.lineWidth}if(d){let b=g;for(const x of p)b+=x?`
|
|
609
|
-
${o}${s}${x}`:`
|
|
610
|
-
`;return`${b}
|
|
611
|
-
${s}${v}`}else return`${g}${a}${p.join(" ")}${a}${v}`}function fd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const o=Ar(t(r),e);n.push(o.trimStart())}}function Ks(e,t){const n=He(t)?t.value:t;for(const r of e)if(ft(r)&&(r.key===t||r.key===n||He(r.key)&&r.key.value===n))return r}class Sn extends NM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(vs,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:o}=r,a=new this(t),c=(u,d)=>{if(typeof o=="function")d=o.call(n,u,d);else if(Array.isArray(o)&&!o.includes(u))return;(d!==void 0||s)&&a.items.push(Kw(u,d,r))};if(n instanceof Map)for(const[u,d]of n)c(u,d);else if(n&&typeof n=="object")for(const u of Object.keys(n))c(u,n[u]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;ft(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Ft(t,t==null?void 0:t.value):r=new Ft(t.key,t.value);const s=Ks(this.items,r.key),o=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);He(s.value)&&kM(r.value)?s.value.value=r.value:s.value=r.value}else if(o){const c=this.items.findIndex(u=>o(r,u)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=Ks(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ks(this.items,t),s=r==null?void 0:r.value;return(!n&&He(s)?s.value:s)??void 0}has(t){return!!Ks(this.items,t)}set(t,n){this.add(new Ft(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items)RM(n,s,o);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!ft(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),TM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const jo={collection:"map",default:!0,nodeClass:Sn,tag:"tag:yaml.org,2002:map",resolve(e,t){return Tl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Sn.from(e,t,n)};class ri extends NM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Co,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ku(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ku(t);if(typeof r!="number")return;const s=this.items[r];return!n&&He(s)?s.value:s}has(t){const n=ku(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=ku(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];He(s)&&kM(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const o of this.items)r.push(_n(o,String(s++),n));return r}toString(t,n,r){return t?TM(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const u=n instanceof Set?c:String(a++);c=s.call(n,u,c)}o.items.push(ul(c,void 0,r))}}return o}}function ku(e){let t=He(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ao={collection:"seq",default:!0,nodeClass:ri,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Il(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ri.from(e,t,n)},Wd={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ww(e,t,n,r)}},Kd={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&Kd.test.test(e)?e:t.options.nullStr},Gw={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Gw.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Kn({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let c=t-(o.length-a-1);for(;c-- >0;)o+="0"}return o}const IM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},MM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Kn(e)}},OM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Re(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Kn},Gd=e=>typeof e=="bigint"||Number.isInteger(e),Yw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function PM(e,t,n){const{value:r}=e;return Gd(r)&&r>=0?n+r.toString(t):Kn(e)}const LM={identify:e=>Gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Yw(e,2,8,n),stringify:e=>PM(e,8,"0o")},DM={identify:Gd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Yw(e,0,10,n),stringify:Kn},$M={identify:e=>Gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Yw(e,2,16,n),stringify:e=>PM(e,16,"0x")},ZU=[jo,Ao,Wd,Kd,Gw,LM,DM,$M,IM,MM,OM];function cN(e){return typeof e=="bigint"||Number.isInteger(e)}const Nu=({value:e})=>JSON.stringify(e),eH=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Nu},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Nu},{identify:cN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>cN(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Nu}],tH={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},nH=[jo,Ao].concat(eH,tH),Xw={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,o){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let u="";for(let d=0;d<a.length;++d)u+=String.fromCharCode(a[d]);c=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),d=Math.ceil(c.length/u),m=new Array(d);for(let p=0,g=0;p<d;++p,g+=u)m[p]=c.substr(g,u);c=m.join(t===Re.BLOCK_LITERAL?`
|
|
612
|
-
`:" ")}return Ww({comment:e,type:t,value:c},r,s,o)}};function qM(e,t){if(Il(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ft(r)){if(Tl(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Ft(new Re(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
613
|
-
${s.key.commentBefore}`:r.commentBefore),r.comment){const o=s.value??s.key;o.comment=o.comment?`${r.comment}
|
|
614
|
-
${o.comment}`:r.comment}r=s}e.items[n]=ft(r)?r:new Ft(r)}}else t("Expected a sequence for this tag");return e}function FM(e,t,n){const{replacer:r}=n,s=new ri(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(o++),a));let c,u;if(Array.isArray(a))if(a.length===2)c=a[0],u=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const d=Object.keys(a);if(d.length===1)c=d[0],u=a[c];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else c=a;s.items.push(Kw(c,u,n))}return s}const Qw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qM,createNode:FM};class ao extends ri{constructor(){super(),this.add=Sn.prototype.add.bind(this),this.delete=Sn.prototype.delete.bind(this),this.get=Sn.prototype.get.bind(this),this.has=Sn.prototype.has.bind(this),this.set=Sn.prototype.set.bind(this),this.tag=ao.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let o,a;if(ft(s)?(o=_n(s.key,"",n),a=_n(s.value,o,n)):o=_n(s,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const s=FM(t,n,r),o=new this;return o.items=s.items,o}}ao.tag="tag:yaml.org,2002:omap";const Jw={collection:"seq",identify:e=>e instanceof Map,nodeClass:ao,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=qM(e,t),r=[];for(const{key:s}of n.items)He(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new ao,n)},createNode:(e,t,n)=>ao.from(e,t,n)};function BM({value:e,source:t},n){return t&&(e?zM:VM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const zM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Re(!0),stringify:BM},VM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Re(!1),stringify:BM},rH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},sH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Kn(e)}},iH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Re(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Kn},Ml=e=>typeof e=="bigint"||Number.isInteger(e);function Yd(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return s==="-"?-1*o:o}function Zw(e,t,n){const{value:r}=e;if(Ml(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Kn(e)}const oH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Yd(e,2,2,n),stringify:e=>Zw(e,2,"0b")},aH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Yd(e,1,8,n),stringify:e=>Zw(e,8,"0")},lH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Yd(e,0,10,n),stringify:Kn},cH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Yd(e,2,16,n),stringify:e=>Zw(e,16,"0x")};class lo extends Sn{constructor(t){super(t),this.tag=lo.tag}add(t){let n;ft(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ft(t.key,null):n=new Ft(t,null),Ks(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ks(this.items,t);return!n&&ft(r)?He(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Ks(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ft(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),o.items.push(Kw(a,null,r));return o}}lo.tag="tag:yaml.org,2002:set";const eb={collection:"map",identify:e=>e instanceof Set,nodeClass:lo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>lo.from(e,t,n),resolve(e,t){if(Tl(e)){if(e.hasAllNullValues(!0))return Object.assign(new lo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function tb(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),o=r.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*o:o}function UM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Kn(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const HM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>tb(e,n),stringify:UM},WM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>tb(e,!1),stringify:UM},Xd={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Xd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,o,a,c]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let d=Date.UTC(n,r-1,s,o||0,a||0,c||0,u);const m=t[8];if(m&&m!=="Z"){let p=tb(m,!1);Math.abs(p)<30&&(p*=60),d-=6e4*p}return new Date(d)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},uN=[jo,Ao,Wd,Kd,zM,VM,oH,aH,lH,cH,rH,sH,iH,Xw,Tr,Jw,Qw,eb,HM,WM,Xd],dN=new Map([["core",ZU],["failsafe",[jo,Ao,Wd]],["json",nH],["yaml11",uN],["yaml-1.1",uN]]),fN={binary:Xw,bool:Gw,float:OM,floatExp:MM,floatNaN:IM,floatTime:WM,int:DM,intHex:$M,intOct:LM,intTime:HM,map:jo,merge:Tr,null:Kd,omap:Jw,pairs:Qw,seq:Ao,set:eb,timestamp:Xd},uH={"tag:yaml.org,2002:binary":Xw,"tag:yaml.org,2002:merge":Tr,"tag:yaml.org,2002:omap":Jw,"tag:yaml.org,2002:pairs":Qw,"tag:yaml.org,2002:set":eb,"tag:yaml.org,2002:timestamp":Xd};function Hp(e,t,n){const r=dN.get(t);if(r&&!e)return n&&!r.includes(Tr)?r.concat(Tr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(dN.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Tr)),s.reduce((o,a)=>{const c=typeof a=="string"?fN[a]:a;if(!c){const u=JSON.stringify(a),d=Object.keys(fN).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return o.includes(c)||o.push(c),o},[])}const dH=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class nb{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?Hp(t,"compat"):t?Hp(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?uH:{},this.tags=Hp(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,vs,{value:jo}),Object.defineProperty(this,dr,{value:Wd}),Object.defineProperty(this,Co,{value:Ao}),this.sortMapEntries=typeof a=="function"?a:a===!0?dH:null}clone(){const t=Object.create(nb.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function fH(e,t){var u;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=EM(e,t),{commentString:o}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=o(e.commentBefore);n.unshift(Ar(d,""))}let a=!1,c=null;if(e.contents){if(dt(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=o(e.contents.commentBefore);n.push(Ar(p,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>a=!0;let m=wo(e.contents,s,()=>c=null,d);c&&(m+=Ws(m,"",o(c))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(wo(e.contents,s));if((u=e.directives)!=null&&u.docEnd)if(e.comment){const d=o(e.comment);d.includes(`
|
|
615
|
-
`)?(n.push("..."),n.push(Ar(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||c)&&n[n.length-1]!==""&&n.push(""),n.push(Ar(o(d),"")))}return n.join(`
|
|
616
|
-
`)+`
|
|
617
|
-
`}class Ol{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nn,{value:Ux});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:a}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new qt({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Ol.prototype,{[Nn]:{value:Ux}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=dt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Ki(this.contents)&&this.contents.add(t)}addIn(t,n){Ki(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=SM(this);t.anchor=!n||r.has(n)?_M(n||"a",r):n}return new Hw(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=N=>typeof N=="number"||N instanceof String||N instanceof Number,S=n.filter(w).map(String);S.length>0&&(n=n.concat(S)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:a,flow:c,keepUndefined:u,onTagObj:d,tag:m}=r??{},{onAnchor:p,setAnchors:g,sourceObjects:v}=FU(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:p,onTagObj:d,replacer:s,schema:this.schema,sourceObjects:v},x=ul(t,m,b);return c&&ut(x)&&(x.flow=!0),g(),x}createPair(t,n,r={}){const s=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Ft(s,o)}delete(t){return Ki(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Da(t)?this.contents==null?!1:(this.contents=null,!0):Ki(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ut(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Da(t)?!n&&He(this.contents)?this.contents.value:this.contents:ut(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ut(this.contents)?this.contents.has(t):!1}hasIn(t){return Da(t)?this.contents!==void 0:ut(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=dd(this.schema,[t],n):Ki(this.contents)&&this.contents.set(t,n)}setIn(t,n){Da(t)?this.contents=n:this.contents==null?this.contents=dd(this.schema,Array.from(t),n):Ki(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new qt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new qt({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new nb(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:o,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},u=_n(this.contents,n??"",c);if(typeof o=="function")for(const{count:d,res:m}of c.anchors.values())o(m,d);return typeof a=="function"?to(a,{"":u},"",u):u}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return fH(this,t)}}function Ki(e){if(ut(e))return!0;throw new Error("Expected a YAML collection as document contents")}class KM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class $a extends KM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class hH extends KM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const hN=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let o=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const c=Math.min(o-39,a.length-79);a="…"+a.substring(c),o-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
618
|
-
`),a=c+a}if(/[^ ]/.test(a)){let c=1;const u=n.linePos[1];(u==null?void 0:u.line)===r&&u.col>s&&(c=Math.max(1,Math.min(u.col-s,80-o)));const d=" ".repeat(o)+"^".repeat(c);n.message+=`:
|
|
619
|
-
|
|
620
|
-
${a}
|
|
621
|
-
${d}
|
|
622
|
-
`}};function bo(e,{flow:t,indicator:n,next:r,offset:s,onError:o,parentIndent:a,startOnNewline:c}){let u=!1,d=c,m=c,p="",g="",v=!1,b=!1,x=null,w=null,S=null,N=null,k=null,C=null,j=null;for(const M of e)switch(b&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&o(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),x&&(d&&M.type!=="comment"&&M.type!=="newline"&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),M.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&M.source.includes(" ")&&(x=M),m=!0;break;case"comment":{m||o(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=M.source.substring(1)||" ";p?p+=g+P:p=P,g="",d=!1;break}case"newline":d?p?p+=M.source:(!C||n!=="seq-item-ind")&&(u=!0):g+=M.source,d=!0,v=!0,(w||S)&&(N=M),m=!0;break;case"anchor":w&&o(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&o(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=M,j??(j=M.offset),d=!1,m=!1,b=!0;break;case"tag":{S&&o(M,"MULTIPLE_TAGS","A node can have at most one tag"),S=M,j??(j=M.offset),d=!1,m=!1,b=!0;break}case n:(w||S)&&o(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),C&&o(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${t??"collection"}`),C=M,d=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){k&&o(M,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=M,d=!1,m=!1;break}default:o(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),d=!1,m=!1}const R=e[e.length-1],T=R?R.offset+R.source.length:s;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(d&&x.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:C,spaceBefore:u,comment:p,hasNewline:v,anchor:w,tag:S,newlineAfterProp:N,end:T,start:j??T}}function dl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
623
|
-
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(dl(t.key)||dl(t.value))return!0}return!1;default:return!0}}function Gx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&dl(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function GM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(o,a)=>o===a||He(o)&&He(a)&&o.value===a.value;return t.some(o=>s(o.key,n))}const pN="All mapping items must start at the same column";function pH({composeNode:e,composeEmptyNode:t},n,r,s,o){var m;const a=(o==null?void 0:o.nodeClass)??Sn,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let u=r.offset,d=null;for(const p of r.items){const{start:g,key:v,sep:b,value:x}=p,w=bo(g,{indicator:"explicit-key-ind",next:v??(b==null?void 0:b[0]),offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!w.found;if(S){if(v&&(v.type==="block-seq"?s(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&s(u,"BAD_INDENT",pN)),!w.anchor&&!w.tag&&!b){d=w.end,w.comment&&(c.comment?c.comment+=`
|
|
624
|
-
`+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||dl(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=w.found)==null?void 0:m.indent)!==r.indent&&s(u,"BAD_INDENT",pN);n.atKey=!0;const N=w.end,k=v?e(n,v,w,s):t(n,N,g,null,w,s);n.schema.compat&&Gx(r.indent,v,s),n.atKey=!1,GM(n,c.items,k)&&s(N,"DUPLICATE_KEY","Map keys must be unique");const C=bo(b??[],{indicator:"map-value-ind",next:x,offset:k.range[2],onError:s,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(u=C.end,C.found){S&&((x==null?void 0:x.type)==="block-map"&&!C.hasNewline&&s(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<C.found.offset-1024&&s(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const j=x?e(n,x,C,s):t(n,u,b,null,C,s);n.schema.compat&&Gx(r.indent,x,s),u=j.range[2];const R=new Ft(k,j);n.options.keepSourceTokens&&(R.srcToken=p),c.items.push(R)}else{S&&s(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(k.comment?k.comment+=`
|
|
625
|
-
`+C.comment:k.comment=C.comment);const j=new Ft(k);n.options.keepSourceTokens&&(j.srcToken=p),c.items.push(j)}}return d&&d<u&&s(d,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,u,d??u],c}function mH({composeNode:e,composeEmptyNode:t},n,r,s,o){const a=(o==null?void 0:o.nodeClass)??ri,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset,d=null;for(const{start:m,value:p}of r.items){const g=bo(m,{indicator:"seq-item-ind",next:p,offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||p)(p==null?void 0:p.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(u,"MISSING_CHAR","Sequence item without - indicator");else{d=g.end,g.comment&&(c.comment=g.comment);continue}const v=p?e(n,p,g,s):t(n,g.end,m,null,g,s);n.schema.compat&&Gx(r.indent,p,s),u=v.range[2],c.items.push(v)}return c.range=[r.offset,u,d??u],c}function Pl(e,t,n,r){let s="";if(e){let o=!1,a="";for(const c of e){const{source:u,type:d}=c;switch(d){case"space":o=!0;break;case"comment":{n&&!o&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=u.substring(1)||" ";s?s+=a+m:s=m,a="";break}case"newline":s&&(a+=u),o=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}t+=u.length}}return{comment:s,offset:t}}const Wp="Block collections are not allowed within flow collections",Kp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function gH({composeNode:e,composeEmptyNode:t},n,r,s,o){var w;const a=r.start.source==="{",c=a?"flow map":"flow sequence",u=(o==null?void 0:o.nodeClass)??(a?Sn:ri),d=new u(n.schema);d.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){const N=r.items[S],{start:k,key:C,sep:j,value:R}=N,T=bo(k,{flow:c,indicator:"explicit-key-ind",next:C??(j==null?void 0:j[0]),offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!j&&!R){S===0&&T.comma?s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<r.items.length-1&&s(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),T.comment&&(d.comment?d.comment+=`
|
|
626
|
-
`+T.comment:d.comment=T.comment),p=T.end;continue}!a&&n.options.strict&&dl(C)&&s(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)T.comma&&s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(T.comma||s(T.start,"MISSING_CHAR",`Missing , between ${c} items`),T.comment){let M="";e:for(const P of k)switch(P.type){case"comma":case"space":break;case"comment":M=P.source.substring(1);break e;default:break e}if(M){let P=d.items[d.items.length-1];ft(P)&&(P=P.value??P.key),P.comment?P.comment+=`
|
|
627
|
-
`+M:P.comment=M,T.comment=T.comment.substring(M.length+1)}}if(!a&&!j&&!T.found){const M=R?e(n,R,T,s):t(n,T.end,j,null,T,s);d.items.push(M),p=M.range[2],Kp(R)&&s(M.range,"BLOCK_IN_FLOW",Wp)}else{n.atKey=!0;const M=T.end,P=C?e(n,C,T,s):t(n,M,k,null,T,s);Kp(C)&&s(P.range,"BLOCK_IN_FLOW",Wp),n.atKey=!1;const B=bo(j??[],{flow:c,indicator:"map-value-ind",next:R,offset:P.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!T.found&&n.options.strict){if(j)for(const U of j){if(U===B.found)break;if(U.type==="newline"){s(U,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<B.found.offset-1024&&s(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else R&&("source"in R&&((w=R.source)==null?void 0:w[0])===":"?s(R,"MISSING_CHAR",`Missing space after : in ${c}`):s(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const O=R?e(n,R,B,s):B.found?t(n,B.end,j,null,B,s):null;O?Kp(R)&&s(O.range,"BLOCK_IN_FLOW",Wp):B.comment&&(P.comment?P.comment+=`
|
|
628
|
-
`+B.comment:P.comment=B.comment);const $=new Ft(P,O);if(n.options.keepSourceTokens&&($.srcToken=N),a){const U=d;GM(n,U.items,P)&&s(M,"DUPLICATE_KEY","Map keys must be unique"),U.items.push($)}else{const U=new Sn(n.schema);U.flow=!0,U.items.push($);const D=(O??P).range;U.range=[P.range[0],D[1],D[2]],d.items.push(U)}p=O?O.range[2]:B.end}}const g=a?"}":"]",[v,...b]=r.end;let x=p;if((v==null?void 0:v.source)===g)x=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),N=m?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;s(p,m?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&b.unshift(v)}if(b.length>0){const S=Pl(b,x,n.options.strict,s);S.comment&&(d.comment?d.comment+=`
|
|
629
|
-
`+S.comment:d.comment=S.comment),d.range=[r.offset,x,S.offset]}else d.range=[r.offset,x,x];return d}function Gp(e,t,n,r,s,o){const a=n.type==="block-map"?pH(e,t,n,r,o):n.type==="block-seq"?mH(e,t,n,r,o):gH(e,t,n,r,o),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function yH(e,t,n,r,s){var g;const o=r.tag,a=o?t.directives.tagName(o.source,v=>s(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:b}=r,x=v&&o?v.offset>o.offset?v:o:v??o;x&&(!b||b.offset<x.offset)&&s(x,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===Sn.tagName&&c==="map"||a===ri.tagName&&c==="seq")return Gp(e,t,n,s,a);let u=t.schema.tags.find(v=>v.tag===a&&v.collection===c);if(!u){const v=t.schema.knownTags[a];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),u=v;else return v?s(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gp(e,t,n,s,a)}const d=Gp(e,t,n,s,a,u),m=((g=u.resolve)==null?void 0:g.call(u,d,v=>s(o,"TAG_RESOLVE_FAILED",v),t.options))??d,p=dt(m)?m:new Re(m);return p.range=d.range,p.tag=a,u!=null&&u.format&&(p.format=u.format),p}function vH(e,t,n){const r=t.offset,s=xH(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const o=s.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,a=t.source?wH(t.source):[];let c=a.length;for(let x=a.length-1;x>=0;--x){const w=a[x][1];if(w===""||w==="\r")c=x;else break}if(c===0){const x=s.chomp==="+"&&a.length>0?`
|
|
630
|
-
`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:x,type:o,comment:s.comment,range:[r,w,w]}}let u=t.indent+s.indent,d=t.offset+s.length,m=0;for(let x=0;x<c;++x){const[w,S]=a[x];if(S===""||S==="\r")s.indent===0&&w.length>u&&(u=w.length);else{w.length<u&&n(d+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(u=w.length),m=x,u===0&&!e.atRoot&&n(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=w.length+S.length+1}for(let x=a.length-1;x>=c;--x)a[x][0].length>u&&(c=x+1);let p="",g="",v=!1;for(let x=0;x<m;++x)p+=a[x][0].slice(u)+`
|
|
631
|
-
`;for(let x=m;x<c;++x){let[w,S]=a[x];d+=w.length+S.length+1;const N=S[S.length-1]==="\r";if(N&&(S=S.slice(0,-1)),S&&w.length<u){const C=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(d-S.length-(N?2:1),"BAD_INDENT",C),w=""}o===Re.BLOCK_LITERAL?(p+=g+w.slice(u)+S,g=`
|
|
632
|
-
`):w.length>u||S[0]===" "?(g===" "?g=`
|
|
633
|
-
`:!v&&g===`
|
|
634
|
-
`&&(g=`
|
|
635
|
-
|
|
636
|
-
`),p+=g+w.slice(u)+S,g=`
|
|
637
|
-
`,v=!0):S===""?g===`
|
|
638
|
-
`?p+=`
|
|
639
|
-
`:g=`
|
|
640
|
-
`:(p+=g+S,g=" ",v=!1)}switch(s.chomp){case"-":break;case"+":for(let x=c;x<a.length;++x)p+=`
|
|
641
|
-
`+a[x][0].slice(u);p[p.length-1]!==`
|
|
642
|
-
`&&(p+=`
|
|
643
|
-
`);break;default:p+=`
|
|
644
|
-
`}const b=r+s.length+t.source.length;return{value:p,type:o,comment:s.comment,range:[r,b,b]}}function xH({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],o=s[0];let a=0,c="",u=-1;for(let g=1;g<s.length;++g){const v=s[g];if(!c&&(v==="-"||v==="+"))c=v;else{const b=Number(v);!a&&b?a=b:u===-1&&(u=e+g)}}u!==-1&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let d=!1,m="",p=s.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":d=!0;case"newline":p+=v.source.length;break;case"comment":n&&!d&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=v.source.length,m=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),p+=v.source.length;break;default:{const b=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",b);const x=v.source;x&&typeof x=="string"&&(p+=x.length)}}}return{mode:o,indent:a,chomp:c,comment:m,length:p}}function wH(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)o.push([t[a],t[a+1]]);return o}function bH(e,t,n){const{offset:r,type:s,source:o,end:a}=e;let c,u;const d=(g,v,b)=>n(r+g,v,b);switch(s){case"scalar":c=Re.PLAIN,u=SH(o,d);break;case"single-quoted-scalar":c=Re.QUOTE_SINGLE,u=_H(o,d);break;case"double-quoted-scalar":c=Re.QUOTE_DOUBLE,u=kH(o,d);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const m=r+o.length,p=Pl(a,m,t,n);return{value:u,type:c,comment:p.comment,range:[r,m,p.offset]}}function SH(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),YM(e)}function _H(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),YM(e.slice(1,-1)).replace(/''/g,"'")}function YM(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
645
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
646
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?o===`
|
|
647
|
-
`?s+=o:o=`
|
|
648
|
-
`:(s+=o+r[1],o=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+o+((r==null?void 0:r[1])??"")}function kH(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
649
|
-
`))if(s===`
|
|
650
|
-
`){const{fold:o,offset:a}=NH(e,r);n+=o,r=a}else if(s==="\\"){let o=e[++r];const a=CH[o];if(a)n+=a;else if(o===`
|
|
651
|
-
`)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
|
|
652
|
-
`)for(o=e[++r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="x"||o==="u"||o==="U"){const c={x:2,u:4,U:8}[o];n+=EH(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(s===" "||s===" "){const o=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
|
|
653
|
-
`&&!(a==="\r"&&e[r+2]===`
|
|
654
|
-
`)&&(n+=r>o?e.slice(o,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function NH(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
655
|
-
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
656
|
-
`);)r===`
|
|
657
|
-
`&&(n+=`
|
|
658
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const CH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
659
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function EH(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(a)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(a)}function XM(e,t,n,r){const{value:s,type:o,comment:a,range:c}=t.type==="block-scalar"?vH(e,t,r):bH(t,e.options.strict,r),u=n?e.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let d;e.options.stringKeys&&e.atKey?d=e.schema[dr]:u?d=jH(e.schema,s,u,n,r):t.type==="scalar"?d=AH(e,s,t,r):d=e.schema[dr];let m;try{const p=d.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=He(p)?p:new Re(p)}catch(p){const g=p instanceof Error?p.message:String(p);r(n??t,"TAG_RESOLVE_FAILED",g),m=new Re(s)}return m.range=c,m.source=s,o&&(m.type=o),u&&(m.tag=u),d.format&&(m.format=d.format),a&&(m.comment=a),m}function jH(e,t,n,r,s){var c;if(n==="!")return e[dr];const o=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)o.push(u);else return u;for(const u of o)if((c=u.test)!=null&&c.test(t))return u;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[dr])}function AH({atKey:e,directives:t,schema:n},r,s,o){const a=n.tags.find(c=>{var u;return(c.default===!0||e&&c.default==="key")&&((u=c.test)==null?void 0:u.test(r))})||n[dr];if(n.compat){const c=n.compat.find(u=>{var d;return u.default&&((d=u.test)==null?void 0:d.test(r))})??n[dr];if(a.tag!==c.tag){const u=t.tagString(a.tag),d=t.tagString(c.tag),m=`Value may be parsed as either ${u} or ${d}`;o(s,"TAG_RESOLVE_FAILED",m,!0)}}return a}function RH(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const TH={composeNode:QM,composeEmptyNode:rb};function QM(e,t,n,r){const s=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:u}=n;let d,m=!0;switch(t.type){case"alias":d=IH(e,t,r),(c||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=XM(e,t,u,r),c&&(d.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":d=yH(TH,e,t,n,r),c&&(d.anchor=c.source.substring(1));break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),d=rb(e,t.offset,void 0,null,n,r),m=!1}}return c&&d.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!He(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(d.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?d.comment=a:d.commentBefore=a),e.options.keepSourceTokens&&m&&(d.srcToken=t),d}function rb(e,t,n,r,{spaceBefore:s,comment:o,anchor:a,tag:c,end:u},d){const m={type:"scalar",offset:RH(t,n,r),indent:-1,source:""},p=XM(e,m,c,d);return a&&(p.anchor=a.source.substring(1),p.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),o&&(p.comment=o,p.range[2]=u),p}function IH({options:e},{offset:t,source:n,end:r},s){const o=new Hw(n.substring(1));o.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=Pl(r,a,e.strict,s);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function MH(e,t,{offset:n,start:r,value:s,end:o},a){const c=Object.assign({_directives:t},e),u=new Ol(void 0,c),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},m=bo(r,{indicator:"doc-start",next:s??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(u.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=s?QM(d,s,m,a):rb(d,m.end,r,null,m,a);const p=u.contents.range[2],g=Pl(o,p,!1,a);return g.comment&&(u.comment=g.comment),u.range=[n,p,g.offset],u}function Ta(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function mN(e){var s;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const a=e[o];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
660
|
-
|
|
661
|
-
`:`
|
|
662
|
-
`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[o+1])==null?void 0:s[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class OH{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,o)=>{const a=Ta(n);o?this.warnings.push(new hH(a,r,s)):this.errors.push(new $a(a,r,s))},this.directives=new qt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=mN(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
663
|
-
${r}`:r;else if(s||t.directives.docStart||!o)t.commentBefore=r;else if(ut(o)&&!o.flow&&o.items.length>0){let a=o.items[0];ft(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
|
|
664
|
-
${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
665
|
-
${a}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:mN(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const o=Ta(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=MH(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new $a(Ta(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new $a(Ta(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Pl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
666
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new $a(Ta(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Ol(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const JM="\uFEFF",ZM="",eO="",Yx="";function PH(e){switch(e){case JM:return"byte-order-mark";case ZM:return"doc-mode";case eO:return"flow-error-end";case Yx:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
667
|
-
`:case`\r
|
|
668
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function On(e){switch(e){case void 0:case" ":case`
|
|
669
|
-
`:case"\r":case" ":return!0;default:return!1}}const gN=new Set("0123456789ABCDEFabcdef"),LH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Cu=new Set(",[]{}"),DH=new Set(` ,[]{}
|
|
670
|
-
\r `),Yp=e=>!e||DH.has(e);class $H{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
671
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
672
|
-
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
|
|
673
|
-
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
674
|
-
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&On(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
675
|
-
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===JM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield ZM,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&On(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!On(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&On(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Yp),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&On(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield eO,yield*this.parseLineStart();let o=0;for(;s[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),s[o]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Yp),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||On(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
676
|
-
`,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=r.indexOf(`
|
|
677
|
-
`,o)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>On(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
|
|
678
|
-
`:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
679
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
|
|
680
|
-
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
681
|
-
`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);const c=o;for(;a===" ";)a=this.buffer[--o];if(a===`
|
|
682
|
-
`&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield Yx,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const o=this.buffer[r+1];if(On(o)||t&&Cu.has(o))break;n=r}else if(On(s)){let o=this.buffer[r+1];if(s==="\r"&&(o===`
|
|
683
|
-
`?(r+=1,s=`
|
|
684
|
-
`,o=this.buffer[r+1]):n=r),o==="#"||t&&Cu.has(o))break;if(s===`
|
|
685
|
-
`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Cu.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Yx,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Yp))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(On(n)||t&&Cu.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!On(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(LH.has(n))n=this.buffer[++t];else if(n==="%"&&gN.has(this.buffer[t+1])&&gN.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
686
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
687
|
-
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class qH{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function ps(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yN(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function tO(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Eu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Gi(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function vN(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ps(t.start,"explicit-key-ind")&&!ps(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,tO(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class FH{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new $H,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=PH(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&vN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&yN(s.start)===-1&&(n.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{yN(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Eu(this.peek(2)),r=Gi(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
688
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
689
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(o&&n.sep&&!n.value){const c=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":c.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(a=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(tO(n.key)&&!ps(n.sep,"newline")){const c=Gi(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ps(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Gi(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ps(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);o||n.value?(t.items.push({start:a,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ps(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ps(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Eu(r),o=Gi(s);vN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
690
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
691
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Eu(t),r=Gi(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Eu(t),r=Gi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function BH(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new qH||null,prettyErrors:t}}function zH(e,t={}){const{lineCounter:n,prettyErrors:r}=BH(t),s=new FH(n==null?void 0:n.addNewLine),o=new OH(t);let a=null;for(const c of o.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new $a(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(hN(e,n)),a.warnings.forEach(hN(e,n))),a}function nO(e,t,n){let r;const s=zH(e,n);if(!s)return null;if(s.warnings.forEach(o=>jM(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function hd(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return Rl(e)&&!r?e.toString(n):new Ol(e,r,n).toString(n)}function VH({value:e,onChange:t}){const[n,r]=A.useState(""),[s,o]=A.useState(null),[a,c]=A.useState(!0);A.useEffect(()=>{try{const d=hd(e,{indent:2,lineWidth:0});r(d),o(null),c(!0)}catch(d){o(d instanceof Error?d.message:"Failed to serialize"),c(!1)}},[e]);const u=d=>{if(d){r(d);try{const m=nO(d);if(!m.id)throw new Error("Step ID is required");if(!m.action&&!m.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(m)}catch(m){o(m instanceof Error?m.message:"Invalid YAML"),c(!1)}}};return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2",children:a?h.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[h.jsx(ei,{className:"w-3 h-3"}),"Valid YAML"]}):h.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[h.jsx(kl,{className:"w-3 h-3"}),s]})}),h.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
|
|
692
|
-
`).length," lines"]})]}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:n,onChange:u,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})}),h.jsx("div",{className:"text-xs text-gray-500",children:h.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function UH({value:e,title:t}){const[n,r]=A.useState("");return A.useEffect(()=>{try{const s=hd(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),h.jsxs("div",{className:"space-y-2",children:[t&&h.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"300px",language:"yaml",value:n,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})})]})}function HH({inputs:e,onChange:t,availableVariables:n}){const[r,s]=A.useState(""),o=Object.entries(e),a=(p,g)=>{t({...e,[p]:g})},c=p=>{const g={...e};delete g[p],t(g)},u=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),s(""))},d=(p,g)=>{if(g&&g!==p&&!e.hasOwnProperty(g)){const v={};for(const[b,x]of Object.entries(e))b===p?v[g]=x:v[b]=x;t(v)}},m=(p,g)=>{const v=String(e[p]||"");a(p,v+`{{ ${g} }}`)};return h.jsxs("div",{className:"space-y-4",children:[o.length===0?h.jsx("div",{className:"text-center py-8",children:h.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):h.jsx("div",{className:"space-y-3",children:o.map(([p,g])=>h.jsx(WH,{inputKey:p,value:g,onChange:v=>a(p,v),onRemove:()=>c(p),onRename:v=>d(p,v),availableVariables:n,onInsertVariable:v=>m(p,v)},p))}),h.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[h.jsx("input",{type:"text",value:r,onChange:p=>s(p.target.value),placeholder:"New input key...",className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",onKeyDown:p=>{p.key==="Enter"&&u()}}),h.jsx(Be,{variant:"secondary",size:"sm",onClick:u,disabled:!r||e.hasOwnProperty(r),icon:h.jsx(Od,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx(Dd,{className:"w-4 h-4 text-primary"}),h.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(p=>h.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:p},p))}),h.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function WH({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:o,onInsertVariable:a}){const[c,u]=A.useState(!1),[d,m]=A.useState(e),[p,g]=A.useState(!1),v=typeof t,b=v==="object"&&t!==null,x=Array.isArray(t),w=()=>{d!==e&&s(d),u(!1)},S=()=>x||b?h.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:N=>{try{n(JSON.parse(N.target.value))}catch{n(N.target.value)}},className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary resize-none",rows:3}):v==="boolean"?h.jsxs("select",{value:String(t),onChange:N=>n(N.target.value==="true"),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[h.jsx("option",{value:"true",children:"true"}),h.jsx("option",{value:"false",children:"false"})]}):v==="number"?h.jsx("input",{type:"number",value:String(t),onChange:N=>n(parseFloat(N.target.value)||0),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary"}):h.jsx(KH,{value:String(t),onChange:N=>n(N),variables:o,placeholder:"Value or {{ variable }}"});return h.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[c?h.jsx("input",{type:"text",value:d,onChange:N=>m(N.target.value),onBlur:w,onKeyDown:N=>{N.key==="Enter"&&w(),N.key==="Escape"&&(m(e),u(!1))},className:"flex-1 px-2 py-1 bg-node-bg border border-primary rounded text-white text-sm font-mono focus:outline-none",autoFocus:!0}):h.jsx("button",{onClick:()=>u(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),h.jsx("span",{className:"text-xs text-gray-500",children:v}),h.jsx(Be,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:h.jsx(ko,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex gap-2",children:[S(),o.length>0&&!x&&!b&&h.jsxs("div",{className:"relative",children:[h.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>g(!p),className:"!p-2",children:h.jsx(Dd,{className:"w-4 h-4"})}),p&&h.jsxs("div",{className:"absolute right-0 top-full mt-1 z-10 p-2 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[150px]",children:[h.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),h.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(N=>h.jsx("button",{onClick:()=>{a(N),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:N},N))})]})]})]})]})}function KH({value:e,onChange:t,variables:n,placeholder:r}){const[s,o]=A.useState(!1),[a,c]=A.useState(0),[u,d]=A.useState(0),m=A.useRef(null),g=(()=>{const k=e.substring(0,a),C=k.lastIndexOf("{{");if(C===-1)return null;const j=k.substring(C);return j.includes("}}")?null:{text:j.substring(2).trim(),start:C,end:a}})(),v=g?n.filter(k=>k.toLowerCase().includes(g.text.toLowerCase())):[],b=s&&g&&v.length>0,x=k=>{t(k.target.value),c(k.target.selectionStart||0),o(!0),d(0)},w=k=>{const C=k.target;c(C.selectionStart||0)},S=k=>{if(b)switch(k.key){case"ArrowDown":k.preventDefault(),d(C=>C<v.length-1?C+1:0);break;case"ArrowUp":k.preventDefault(),d(C=>C>0?C-1:v.length-1);break;case"Enter":case"Tab":k.preventDefault(),N(v[u]);break;case"Escape":o(!1);break}},N=k=>{if(!g)return;const C=e.substring(0,g.start),j=e.substring(g.end),R=`${C}{{ ${k} }}${j}`;t(R),o(!1),setTimeout(()=>{if(m.current){const T=g.start+k.length+6;m.current.setSelectionRange(T,T),m.current.focus()}},0)};return A.useEffect(()=>{const k=()=>o(!1);return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[]),h.jsxs("div",{className:"relative flex-1",children:[h.jsx("input",{ref:m,type:"text",value:e,onChange:x,onSelect:w,onKeyDown:S,onFocus:()=>o(!0),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:r}),b&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 z-20 p-1 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[200px] max-h-[200px] overflow-y-auto",onClick:k=>k.stopPropagation(),children:[h.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),v.map((k,C)=>h.jsxs("button",{onClick:()=>N(k),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${C===u?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[h.jsx(Dd,{className:"w-3 h-3"}),k]},k)),h.jsx("div",{className:"text-xs text-gray-600 px-2 pt-1 border-t border-node-border mt-1",children:"↑↓ to navigate, Enter to select"})]})]})}function xN(e){const t=[];return!e.id||e.id.trim()===""?t.push({field:"id",message:"Step ID is required"}):/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.id)||t.push({field:"id",message:"Step ID must start with a letter and contain only letters, numbers, underscores, and hyphens"}),!e.action&&!e.workflow&&t.push({field:"action",message:"Step must have either an action or a workflow reference"}),e.action&&e.action.split(".").length<2&&t.push({field:"action",message:"Action must be in format: service.method (e.g., slack.chat.postMessage)"}),e.workflow&&!e.workflow.endsWith(".md")&&!e.workflow.endsWith(".yaml")&&!e.workflow.endsWith(".yml")&&t.push({field:"workflow",message:"Workflow reference should end with .md, .yaml, or .yml"}),e.outputVariable&&(/^[a-zA-Z][a-zA-Z0-9_]*$/.test(e.outputVariable)||t.push({field:"outputVariable",message:"Output variable must start with a letter and contain only letters, numbers, and underscores"})),e.timeout!==void 0&&(typeof e.timeout!="number"||e.timeout<=0)&&t.push({field:"timeout",message:"Timeout must be a positive number"}),e.errorHandling&&(["stop","continue","retry"].includes(e.errorHandling.action)||t.push({field:"errorHandling.action",message:"Error action must be one of: stop, continue, retry"}),e.errorHandling.action==="retry"&&(e.errorHandling.maxRetries!==void 0&&(typeof e.errorHandling.maxRetries!="number"||e.errorHandling.maxRetries<1)&&t.push({field:"errorHandling.maxRetries",message:"Max retries must be at least 1"}),e.errorHandling.retryDelay!==void 0&&(typeof e.errorHandling.retryDelay!="number"||e.errorHandling.retryDelay<0)&&t.push({field:"errorHandling.retryDelay",message:"Retry delay must be a non-negative number"})),e.errorHandling.fallbackStep&&(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.errorHandling.fallbackStep)||t.push({field:"errorHandling.fallbackStep",message:"Fallback step ID must be a valid identifier"}))),e.conditions&&e.conditions.length>0&&e.conditions.forEach((n,r)=>{(!n||n.trim()==="")&&t.push({field:`conditions[${r}]`,message:`Condition ${r+1} cannot be empty`})}),{valid:t.length===0,errors:t}}function GH(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function YH({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[o,a]=A.useState(null),[c,u]=A.useState("properties"),[d,m]=A.useState([]),[p,g]=A.useState(!1);if(A.useEffect(()=>{n&&(a({...n}),u("properties"),m([]),g(!1))},[n]),A.useMemo(()=>o?xN(o):{valid:!0,errors:[]},[o]),!o)return null;const v=()=>{if(!o)return;const w=xN(o);if(m(w.errors),g(!0),w.valid)r(o),t(!1);else{const S=w.errors[0];S&&(S.field==="id"||S.field==="action"||S.field==="workflow"||S.field==="timeout"?u("properties"):S.field==="outputVariable"?u("output"):S.field.startsWith("errorHandling")?u("errors"):S.field.startsWith("conditions")&&u("conditions"))}},b=w=>{a(S=>S?{...S,...w}:null)},x=w=>{if(p)return GH(d,w)};return h.jsxs(Ss,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[h.jsxs(uM,{value:c,onValueChange:u,children:[h.jsxs(zw,{children:[h.jsxs(nr,{value:"properties",children:[h.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),h.jsxs(nr,{value:"inputs",children:[h.jsx(Hz,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),h.jsxs(nr,{value:"output",children:[h.jsx(Wz,{className:"w-4 h-4 mr-1.5"}),"Output"]}),h.jsxs(nr,{value:"errors",children:[h.jsx(Ld,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),h.jsxs(nr,{value:"conditions",children:[h.jsx(eI,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),h.jsxs(nr,{value:"yaml",children:[h.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),h.jsxs("div",{className:"p-4",children:[h.jsx(rr,{value:"properties",children:h.jsx(XH,{step:o,onChange:b,getError:x})}),h.jsx(rr,{value:"inputs",children:h.jsx(HH,{inputs:o.inputs,onChange:w=>b({inputs:w}),availableVariables:s})}),h.jsx(rr,{value:"output",children:h.jsx(QH,{step:o,onChange:b})}),h.jsx(rr,{value:"errors",children:h.jsx(JH,{step:o,onChange:b})}),h.jsx(rr,{value:"conditions",children:h.jsx(ZH,{step:o,onChange:b,availableVariables:s})}),h.jsx(rr,{value:"yaml",children:h.jsx(VH,{value:o,onChange:w=>a(w)})})]})]}),h.jsxs(ni,{children:[p&&d.length>0&&h.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[h.jsx(kl,{className:"w-4 h-4 flex-shrink-0"}),h.jsxs("span",{children:[d.length," validation error",d.length>1?"s":""]})]}),h.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Be,{onClick:v,children:"Save Changes"})]})]})}function XH({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),o=n("workflow"),a=n("timeout");return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",h.jsx("span",{className:"text-error",children:"*"})]}),h.jsx("input",{type:"text",value:e.id,onChange:c=>t({id:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${r?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"unique-step-id"}),r?h.jsx("p",{className:"mt-1 text-xs text-error",children:r}):h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),h.jsx("input",{type:"text",value:e.name||"",onChange:c=>t({name:c.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&h.jsx("span",{className:"text-error",children:"*"})]}),h.jsx("input",{type:"text",value:e.action||"",onChange:c=>t({action:c.target.value||void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${s?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"service.method (e.g., slack.chat.postMessage)"}),s?h.jsx("p",{className:"mt-1 text-xs text-error",children:s}):h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),h.jsx("input",{type:"text",value:e.workflow,onChange:c=>t({workflow:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${o?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),o&&h.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),h.jsx("input",{type:"number",value:e.timeout||"",onChange:c=>t({timeout:c.target.value?parseInt(c.target.value,10):void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${a?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"30",min:"1"}),a&&h.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function QH({step:e,onChange:t}){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),h.jsx("input",{type:"text",value:e.outputVariable||"",onChange:n=>t({outputVariable:n.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"result_variable"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),h.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),h.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),h.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function JH({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),h.jsxs("select",{value:n.action,onChange:s=>r({action:s.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[h.jsx("option",{value:"stop",children:"Stop workflow on error"}),h.jsx("option",{value:"continue",children:"Continue to next step"}),h.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),h.jsx("input",{type:"number",value:n.maxRetries||3,onChange:s=>r({maxRetries:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"1",max:"10"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),h.jsx("input",{type:"number",value:n.retryDelay||1e3,onChange:s=>r({retryDelay:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"100",step:"100"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),h.jsx("input",{type:"text",value:n.fallbackStep||"",onChange:s=>r({fallbackStep:s.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"fallback-step-id"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function ZH({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],s=()=>{t({conditions:[...r,""]})},o=(c,u)=>{const d=[...r];d[c]=u,t({conditions:d})},a=c=>{const u=r.filter((d,m)=>m!==c);t({conditions:u.length>0?u:void 0})};return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?h.jsxs("div",{className:"text-center py-8",children:[h.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),h.jsx(Be,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):h.jsxs("div",{className:"space-y-3",children:[r.map((c,u)=>h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:c,onChange:d=>o(u,d.target.value),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"{{ variable }} === 'value'"}),h.jsx(Be,{variant:"ghost",size:"sm",onClick:()=>a(u),children:"×"})]},u)),h.jsx(Be,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&h.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>h.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded cursor-pointer hover:bg-primary/20",onClick:()=>{navigator.clipboard.writeText(`{{ ${c} }}`)},children:c},c))})]})]})}const e7=["top","right","bottom","left"],_s=Math.min,cn=Math.max,pd=Math.round,ju=Math.floor,ar=e=>({x:e,y:e}),t7={left:"right",right:"left",bottom:"top",top:"bottom"},n7={start:"end",end:"start"};function Xx(e,t,n){return cn(e,_s(t,n))}function Or(e,t){return typeof e=="function"?e(t):e}function Pr(e){return e.split("-")[0]}function Ro(e){return e.split("-")[1]}function sb(e){return e==="x"?"y":"x"}function ib(e){return e==="y"?"height":"width"}const r7=new Set(["top","bottom"]);function ir(e){return r7.has(Pr(e))?"y":"x"}function ob(e){return sb(ir(e))}function s7(e,t,n){n===void 0&&(n=!1);const r=Ro(e),s=ob(e),o=ib(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=md(a)),[a,md(a)]}function i7(e){const t=md(e);return[Qx(e),t,Qx(t)]}function Qx(e){return e.replace(/start|end/g,t=>n7[t])}const wN=["left","right"],bN=["right","left"],o7=["top","bottom"],a7=["bottom","top"];function l7(e,t,n){switch(e){case"top":case"bottom":return n?t?bN:wN:t?wN:bN;case"left":case"right":return t?o7:a7;default:return[]}}function c7(e,t,n,r){const s=Ro(e);let o=l7(Pr(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Qx)))),o}function md(e){return e.replace(/left|right|bottom|top/g,t=>t7[t])}function u7(e){return{top:0,right:0,bottom:0,left:0,...e}}function rO(e){return typeof e!="number"?u7(e):{top:e,right:e,bottom:e,left:e}}function gd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function SN(e,t,n){let{reference:r,floating:s}=e;const o=ir(t),a=ob(t),c=ib(a),u=Pr(t),d=o==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let v;switch(u){case"top":v={x:m,y:r.y-s.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}switch(Ro(t)){case"start":v[a]-=g*(n&&d?-1:1);break;case"end":v[a]+=g*(n&&d?-1:1);break}return v}const d7=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=SN(d,r,u),g=r,v={},b=0;for(let x=0;x<c.length;x++){const{name:w,fn:S}=c[x],{x:N,y:k,data:C,reset:j}=await S({x:m,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:v,rects:d,platform:a,elements:{reference:e,floating:t}});m=N??m,p=k??p,v={...v,[w]:{...v[w],...C}},j&&b<=50&&(b++,typeof j=="object"&&(j.placement&&(g=j.placement),j.rects&&(d=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:m,y:p}=SN(d,g,u)),x=-1)}return{x:m,y:p,placement:g,strategy:s,middlewareData:v}};async function fl(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=Or(t,e),b=rO(v),w=c[g?p==="floating"?"reference":"floating":p],S=gd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:u})),N=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),C=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},j=gd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:k,strategy:u}):N);return{top:(S.top-j.top+b.top)/C.y,bottom:(j.bottom-S.bottom+b.bottom)/C.y,left:(S.left-j.left+b.left)/C.x,right:(j.right-S.right+b.right)/C.x}}const f7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:d,padding:m=0}=Or(e,t)||{};if(d==null)return{};const p=rO(m),g={x:n,y:r},v=ob(s),b=ib(v),x=await a.getDimensions(d),w=v==="y",S=w?"top":"left",N=w?"bottom":"right",k=w?"clientHeight":"clientWidth",C=o.reference[b]+o.reference[v]-g[v]-o.floating[b],j=g[v]-o.reference[v],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let T=R?R[k]:0;(!T||!await(a.isElement==null?void 0:a.isElement(R)))&&(T=c.floating[k]||o.floating[b]);const M=C/2-j/2,P=T/2-x[b]/2-1,B=_s(p[S],P),O=_s(p[N],P),$=B,U=T-x[b]-O,D=T/2-x[b]/2+M,z=Xx($,D,U),V=!u.arrow&&Ro(s)!=null&&D!==z&&o.reference[b]/2-(D<$?B:O)-x[b]/2<0,Y=V?D<$?D-$:D-U:0;return{[v]:g[v]+Y,data:{[v]:z,centerOffset:D-z-Y,...V&&{alignmentOffset:Y}},reset:V}}}),h7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Or(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Pr(s),N=ir(c),k=Pr(c)===c,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=g||(k||!x?[md(c)]:i7(c)),R=b!=="none";!g&&R&&j.push(...c7(c,x,b,C));const T=[c,...j],M=await fl(t,w),P=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&P.push(M[S]),p){const D=s7(s,a,C);P.push(M[D[0]],M[D[1]])}if(B=[...B,{placement:s,overflows:P}],!P.every(D=>D<=0)){var O,$;const D=(((O=o.flip)==null?void 0:O.index)||0)+1,z=T[D];if(z&&(!(p==="alignment"?N!==ir(z):!1)||B.every(F=>ir(F.placement)===N?F.overflows[0]>0:!0)))return{data:{index:D,overflows:B},reset:{placement:z}};let V=($=B.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(v){case"bestFit":{var U;const Y=(U=B.filter(F=>{if(R){const q=ir(F.placement);return q===N||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,G)=>q+G,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:U[0];Y&&(V=Y);break}case"initialPlacement":V=c;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function _N(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kN(e){return e7.some(t=>e[t]>=0)}const p7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Or(e,t);switch(r){case"referenceHidden":{const o=await fl(t,{...s,elementContext:"reference"}),a=_N(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kN(a)}}}case"escaped":{const o=await fl(t,{...s,altBoundary:!0}),a=_N(o,n.floating);return{data:{escapedOffsets:a,escaped:kN(a)}}}default:return{}}}}},sO=new Set(["left","top"]);async function m7(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Pr(n),c=Ro(n),u=ir(n)==="y",d=sO.has(a)?-1:1,m=o&&u?-1:1,p=Or(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*m,y:g*d}:{x:g*d,y:v*m}}const g7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await m7(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},y7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:S,y:N}=w;return{x:S,y:N}}},...u}=Or(e,t),d={x:n,y:r},m=await fl(t,u),p=ir(Pr(s)),g=sb(p);let v=d[g],b=d[p];if(o){const w=g==="y"?"top":"left",S=g==="y"?"bottom":"right",N=v+m[w],k=v-m[S];v=Xx(N,v,k)}if(a){const w=p==="y"?"top":"left",S=p==="y"?"bottom":"right",N=b+m[w],k=b-m[S];b=Xx(N,b,k)}const x=c.fn({...t,[g]:v,[p]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[p]:a}}}}}},v7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Or(e,t),m={x:n,y:r},p=ir(s),g=sb(p);let v=m[g],b=m[p];const x=Or(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const k=g==="y"?"height":"width",C=o.reference[g]-o.floating[k]+w.mainAxis,j=o.reference[g]+o.reference[k]-w.mainAxis;v<C?v=C:v>j&&(v=j)}if(d){var S,N;const k=g==="y"?"width":"height",C=sO.has(Pr(s)),j=o.reference[p]-o.floating[k]+(C&&((S=a.offset)==null?void 0:S[p])||0)+(C?0:w.crossAxis),R=o.reference[p]+o.reference[k]+(C?0:((N=a.offset)==null?void 0:N[p])||0)-(C?w.crossAxis:0);b<j?b=j:b>R&&(b=R)}return{[g]:v,[p]:b}}}},x7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...d}=Or(e,t),m=await fl(t,d),p=Pr(s),g=Ro(s),v=ir(s)==="y",{width:b,height:x}=o.floating;let w,S;p==="top"||p==="bottom"?(w=p,S=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,w=g==="end"?"top":"bottom");const N=x-m.top-m.bottom,k=b-m.left-m.right,C=_s(x-m[w],N),j=_s(b-m[S],k),R=!t.middlewareData.shift;let T=C,M=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=N),R&&!g){const B=cn(m.left,0),O=cn(m.right,0),$=cn(m.top,0),U=cn(m.bottom,0);v?M=b-2*(B!==0||O!==0?B+O:cn(m.left,m.right)):T=x-2*($!==0||U!==0?$+U:cn(m.top,m.bottom))}await u({...t,availableWidth:M,availableHeight:T});const P=await a.getDimensions(c.floating);return b!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function Qd(){return typeof window<"u"}function To(e){return iO(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){var t;return(t=(iO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iO(e){return Qd()?e instanceof Node||e instanceof dn(e).Node:!1}function Bn(e){return Qd()?e instanceof Element||e instanceof dn(e).Element:!1}function fr(e){return Qd()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function NN(e){return!Qd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}const w7=new Set(["inline","contents"]);function Ll(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!w7.has(s)}const b7=new Set(["table","td","th"]);function S7(e){return b7.has(To(e))}const _7=[":popover-open",":modal"];function Jd(e){return _7.some(t=>{try{return e.matches(t)}catch{return!1}})}const k7=["transform","translate","scale","rotate","perspective"],N7=["transform","translate","scale","rotate","perspective","filter"],C7=["paint","layout","strict","content"];function ab(e){const t=lb(),n=Bn(e)?zn(e):e;return k7.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||N7.some(r=>(n.willChange||"").includes(r))||C7.some(r=>(n.contain||"").includes(r))}function E7(e){let t=ks(e);for(;fr(t)&&!So(t);){if(ab(t))return t;if(Jd(t))return null;t=ks(t)}return null}function lb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const j7=new Set(["html","body","#document"]);function So(e){return j7.has(To(e))}function zn(e){return dn(e).getComputedStyle(e)}function Zd(e){return Bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ks(e){if(To(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NN(e)&&e.host||mr(e);return NN(t)?t.host:t}function oO(e){const t=ks(e);return So(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&Ll(t)?t:oO(t)}function hl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=oO(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=dn(s);if(o){const c=Jx(a);return t.concat(a,a.visualViewport||[],Ll(s)?s:[],c&&n?hl(c):[])}return t.concat(s,hl(s,[],n))}function Jx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function aO(e){const t=zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=fr(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=pd(n)!==o||pd(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function cb(e){return Bn(e)?e:e.contextElement}function co(e){const t=cb(e);if(!fr(t))return ar(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=aO(t);let a=(o?pd(n.width):n.width)/r,c=(o?pd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const A7=ar(0);function lO(e){const t=dn(e);return!lb()||!t.visualViewport?A7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dn(e)?!1:t}function si(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=cb(e);let a=ar(1);t&&(r?Bn(r)&&(a=co(r)):a=co(e));const c=R7(o,n,r)?lO(o):ar(0);let u=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,m=s.width/a.x,p=s.height/a.y;if(o){const g=dn(o),v=r&&Bn(r)?dn(r):r;let b=g,x=Jx(b);for(;x&&r&&v!==b;){const w=co(x),S=x.getBoundingClientRect(),N=zn(x),k=S.left+(x.clientLeft+parseFloat(N.paddingLeft))*w.x,C=S.top+(x.clientTop+parseFloat(N.paddingTop))*w.y;u*=w.x,d*=w.y,m*=w.x,p*=w.y,u+=k,d+=C,b=dn(x),x=Jx(b)}}return gd({width:m,height:p,x:u,y:d})}function ef(e,t){const n=Zd(e).scrollLeft;return t?t.left+n:si(mr(e)).left+n}function cO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ef(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function T7(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=mr(r),c=t?Jd(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=ar(1);const m=ar(0),p=fr(r);if((p||!p&&!o)&&((To(r)!=="body"||Ll(a))&&(u=Zd(r)),fr(r))){const v=si(r);d=co(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=a&&!p&&!o?cO(a,u):ar(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-u.scrollTop*d.y+m.y+g.y}}function I7(e){return Array.from(e.getClientRects())}function M7(e){const t=mr(e),n=Zd(e),r=e.ownerDocument.body,s=cn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=cn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ef(e);const c=-n.scrollTop;return zn(r).direction==="rtl"&&(a+=cn(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}const CN=25;function O7(e,t){const n=dn(e),r=mr(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const m=lb();(!m||m&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}const d=ef(r);if(d<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-v);b<=CN&&(o-=b)}else d<=CN&&(o+=d);return{width:o,height:a,x:c,y:u}}const P7=new Set(["absolute","fixed"]);function L7(e,t){const n=si(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=fr(e)?co(e):ar(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:a,height:c,x:u,y:d}}function EN(e,t,n){let r;if(t==="viewport")r=O7(e,n);else if(t==="document")r=M7(mr(e));else if(Bn(t))r=L7(t,n);else{const s=lO(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return gd(r)}function uO(e,t){const n=ks(e);return n===t||!Bn(n)||So(n)?!1:zn(n).position==="fixed"||uO(n,t)}function D7(e,t){const n=t.get(e);if(n)return n;let r=hl(e,[],!1).filter(c=>Bn(c)&&To(c)!=="body"),s=null;const o=zn(e).position==="fixed";let a=o?ks(e):e;for(;Bn(a)&&!So(a);){const c=zn(a),u=ab(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&P7.has(s.position)||Ll(a)&&!u&&uO(e,a))?r=r.filter(m=>m!==a):s=c,a=ks(a)}return t.set(e,r),r}function $7(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Jd(t)?[]:D7(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((d,m)=>{const p=EN(t,m,s);return d.top=cn(p.top,d.top),d.right=_s(p.right,d.right),d.bottom=_s(p.bottom,d.bottom),d.left=cn(p.left,d.left),d},EN(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function q7(e){const{width:t,height:n}=aO(e);return{width:t,height:n}}function F7(e,t,n){const r=fr(t),s=mr(t),o=n==="fixed",a=si(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ar(0);function d(){u.x=ef(s)}if(r||!r&&!o)if((To(t)!=="body"||Ll(s))&&(c=Zd(t)),r){const v=si(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else s&&d();o&&!r&&s&&d();const m=s&&!r&&!o?cO(s,c):ar(0),p=a.left+c.scrollLeft-u.x-m.x,g=a.top+c.scrollTop-u.y-m.y;return{x:p,y:g,width:a.width,height:a.height}}function Xp(e){return zn(e).position==="static"}function jN(e,t){if(!fr(e)||zn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mr(e)===n&&(n=n.ownerDocument.body),n}function dO(e,t){const n=dn(e);if(Jd(e))return n;if(!fr(e)){let s=ks(e);for(;s&&!So(s);){if(Bn(s)&&!Xp(s))return s;s=ks(s)}return n}let r=jN(e,t);for(;r&&S7(r)&&Xp(r);)r=jN(r,t);return r&&So(r)&&Xp(r)&&!ab(r)?n:r||E7(e)||n}const B7=async function(e){const t=this.getOffsetParent||dO,n=this.getDimensions,r=await n(e.floating);return{reference:F7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z7(e){return zn(e).direction==="rtl"}const V7={convertOffsetParentRelativeRectToViewportRelativeRect:T7,getDocumentElement:mr,getClippingRect:$7,getOffsetParent:dO,getElementRects:B7,getClientRects:I7,getDimensions:q7,getScale:co,isElement:Bn,isRTL:z7};function fO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U7(e,t){let n=null,r;const s=mr(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:m,top:p,width:g,height:v}=d;if(c||t(),!g||!v)return;const b=ju(p),x=ju(s.clientWidth-(m+g)),w=ju(s.clientHeight-(p+v)),S=ju(m),k={rootMargin:-b+"px "+-x+"px "+-w+"px "+-S+"px",threshold:cn(0,_s(1,u))||1};let C=!0;function j(R){const T=R[0].intersectionRatio;if(T!==u){if(!C)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!fO(d,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(j,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,k)}n.observe(e)}return a(!0),o}function H7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=cb(e),m=s||o?[...d?hl(d):[],...hl(t)]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=d&&c?U7(d,n):null;let g=-1,v=null;a&&(v=new ResizeObserver(S=>{let[N]=S;N&&N.target===d&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(t)})),n()}),d&&!u&&v.observe(d),v.observe(t));let b,x=u?si(e):null;u&&w();function w(){const S=si(e);x&&!fO(x,S)&&n(),x=S,b=requestAnimationFrame(w)}return n(),()=>{var S;m.forEach(N=>{s&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const W7=g7,K7=y7,G7=h7,Y7=x7,X7=p7,AN=f7,Q7=v7,J7=(e,t,n)=>{const r=new Map,s={platform:V7,...n},o={...s.platform,_c:r};return d7(e,t,{...s,platform:o})};var Z7=typeof document<"u",eW=function(){},Uu=Z7?A.useLayoutEffect:eW;function yd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!yd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function hO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RN(e,t){const n=hO(e);return Math.round(t*n)/n}function Qp(e){const t=A.useRef(e);return Uu(()=>{t.current=e}),t}function tW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[m,p]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=A.useState(r);yd(g,r)||v(r);const[b,x]=A.useState(null),[w,S]=A.useState(null),N=A.useCallback(F=>{F!==R.current&&(R.current=F,x(F))},[]),k=A.useCallback(F=>{F!==T.current&&(T.current=F,S(F))},[]),C=o||b,j=a||w,R=A.useRef(null),T=A.useRef(null),M=A.useRef(m),P=u!=null,B=Qp(u),O=Qp(s),$=Qp(d),U=A.useCallback(()=>{if(!R.current||!T.current)return;const F={placement:t,strategy:n,middleware:g};O.current&&(F.platform=O.current),J7(R.current,T.current,F).then(q=>{const G={...q,isPositioned:$.current!==!1};D.current&&!yd(M.current,G)&&(M.current=G,Nw.flushSync(()=>{p(G)}))})},[g,t,n,O,$]);Uu(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[d]);const D=A.useRef(!1);Uu(()=>(D.current=!0,()=>{D.current=!1}),[]),Uu(()=>{if(C&&(R.current=C),j&&(T.current=j),C&&j){if(B.current)return B.current(C,j,U);U()}},[C,j,U,B,P]);const z=A.useMemo(()=>({reference:R,floating:T,setReference:N,setFloating:k}),[N,k]),V=A.useMemo(()=>({reference:C,floating:j}),[C,j]),Y=A.useMemo(()=>{const F={position:n,left:0,top:0};if(!V.floating)return F;const q=RN(V.floating,m.x),G=RN(V.floating,m.y);return c?{...F,transform:"translate("+q+"px, "+G+"px)",...hO(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:G}},[n,c,V.floating,m.x,m.y]);return A.useMemo(()=>({...m,update:U,refs:z,elements:V,floatingStyles:Y}),[m,U,z,V,Y])}const nW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?AN({element:r.current,padding:s}).fn(n):{}:r?AN({element:r,padding:s}).fn(n):{}}}},rW=(e,t)=>({...W7(e),options:[e,t]}),sW=(e,t)=>({...K7(e),options:[e,t]}),iW=(e,t)=>({...Q7(e),options:[e,t]}),oW=(e,t)=>({...G7(e),options:[e,t]}),aW=(e,t)=>({...Y7(e),options:[e,t]}),lW=(e,t)=>({...X7(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",pO=A.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return h.jsx(Ze.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});pO.displayName=uW;var dW=pO;function fW(e){const[t,n]=A.useState(void 0);return bs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ub="Popper",[mO,gO]=ii(ub),[hW,yO]=mO(ub),vO=e=>{const{__scopePopper:t,children:n}=e,[r,s]=A.useState(null);return h.jsx(hW,{scope:t,anchor:r,onAnchorChange:s,children:n})};vO.displayName=ub;var xO="PopperAnchor",wO=A.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=yO(xO,n),a=A.useRef(null),c=Et(t,a),u=A.useRef(null);return A.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||a.current,d!==u.current&&o.onAnchorChange(u.current)}),r?null:h.jsx(Ze.div,{...s,ref:c})});wO.displayName=xO;var db="PopperContent",[pW,mW]=mO(db),bO=A.forwardRef((e,t)=>{var X,ee,ie,ue,me,ye;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=e,w=yO(db,n),[S,N]=A.useState(null),k=Et(t,pe=>N(pe)),[C,j]=A.useState(null),R=fW(C),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,P=r+(o!=="center"?"-"+o:""),B=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},O=Array.isArray(d)?d:[d],$=O.length>0,U={padding:B,boundary:O.filter(yW),altBoundary:$},{refs:D,floatingStyles:z,placement:V,isPositioned:Y,middlewareData:F}=tW({strategy:"fixed",placement:P,whileElementsMounted:(...pe)=>H7(...pe,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[rW({mainAxis:s+M,alignmentAxis:a}),u&&sW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?iW():void 0,...U}),u&&oW({...U}),aW({...U,apply:({elements:pe,rects:_e,availableWidth:xe,availableHeight:Ce})=>{const{width:Ne,height:tt}=_e.reference,Le=pe.floating.style;Le.setProperty("--radix-popper-available-width",`${xe}px`),Le.setProperty("--radix-popper-available-height",`${Ce}px`),Le.setProperty("--radix-popper-anchor-width",`${Ne}px`),Le.setProperty("--radix-popper-anchor-height",`${tt}px`)}}),C&&cW({element:C,padding:c}),vW({arrowWidth:T,arrowHeight:M}),g&&lW({strategy:"referenceHidden",...U})]}),[q,G]=kO(V),L=ur(b);bs(()=>{Y&&(L==null||L())},[Y,L]);const W=(X=F.arrow)==null?void 0:X.x,oe=(ee=F.arrow)==null?void 0:ee.y,K=((ie=F.arrow)==null?void 0:ie.centerOffset)!==0,[J,te]=A.useState();return bs(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),h.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:Y?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ue=F.transformOrigin)==null?void 0:ue.x,(me=F.transformOrigin)==null?void 0:me.y].join(" "),...((ye=F.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(pW,{scope:n,placedSide:q,onArrowChange:j,arrowX:W,arrowY:oe,shouldHideArrow:K,children:h.jsx(Ze.div,{"data-side":q,"data-align":G,...x,ref:k,style:{...x.style,animation:Y?void 0:"none"}})})})});bO.displayName=db;var SO="PopperArrow",gW={top:"bottom",right:"left",bottom:"top",left:"right"},_O=A.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=mW(SO,r),a=gW[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(dW,{...s,ref:n,style:{...s.style,display:"block"}})})});_O.displayName=SO;function yW(e){return e!==null}var vW=e=>({name:"transformOrigin",options:e,fn(t){var w,S,N;const{placement:n,rects:r,middlewareData:s}=t,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,m]=kO(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,v=(((N=s.arrow)==null?void 0:N.y)??0)+u/2;let b="",x="";return d==="bottom"?(b=a?p:`${g}px`,x=`${-u}px`):d==="top"?(b=a?p:`${g}px`,x=`${r.floating.height+u}px`):d==="right"?(b=`${-u}px`,x=a?p:`${v}px`):d==="left"&&(b=`${r.floating.width+u}px`,x=a?p:`${v}px`),{data:{x:b,y:x}}}});function kO(e){const[t,n="center"]=e.split("-");return[t,n]}var xW=vO,wW=wO,bW=bO,SW=_O,Zx=["Enter"," "],_W=["ArrowDown","PageUp","Home"],NO=["ArrowUp","PageDown","End"],kW=[..._W,...NO],NW={ltr:[...Zx,"ArrowRight"],rtl:[...Zx,"ArrowLeft"]},CW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dl="Menu",[pl,EW,jW]=VI(Dl),[ai,CO]=ii(Dl,[jW,gO,Fd]),tf=gO(),EO=Fd(),[AW,li]=ai(Dl),[RW,$l]=ai(Dl),jO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=tf(t),[u,d]=A.useState(null),m=A.useRef(!1),p=ur(o),g=Fw(s);return A.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),h.jsx(xW,{...c,children:h.jsx(AW,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:d,children:h.jsx(RW,{scope:t,onClose:A.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:a,children:r})})})};jO.displayName=Dl;var TW="MenuAnchor",fb=A.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=tf(n);return h.jsx(wW,{...s,...r,ref:t})});fb.displayName=TW;var hb="MenuPortal",[IW,AO]=ai(hb,{forceMount:void 0}),RO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=li(hb,t);return h.jsx(IW,{scope:t,forceMount:n,children:h.jsx($r,{present:n||o.open,children:h.jsx(Ow,{asChild:!0,container:s,children:r})})})};RO.displayName=hb;var kn="MenuContent",[MW,pb]=ai(kn),TO=A.forwardRef((e,t)=>{const n=AO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=li(kn,e.__scopeMenu),a=$l(kn,e.__scopeMenu);return h.jsx(pl.Provider,{scope:e.__scopeMenu,children:h.jsx($r,{present:r||o.open,children:h.jsx(pl.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(OW,{...s,ref:t}):h.jsx(PW,{...s,ref:t})})})})}),OW=A.forwardRef((e,t)=>{const n=li(kn,e.__scopeMenu),r=A.useRef(null),s=Et(t,r);return A.useEffect(()=>{const o=r.current;if(o)return bI(o)},[]),h.jsx(mb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PW=A.forwardRef((e,t)=>{const n=li(kn,e.__scopeMenu);return h.jsx(mb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LW=ll("MenuContent.ScrollLock"),mb=A.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...x}=e,w=li(kn,n),S=$l(kn,n),N=tf(n),k=EO(n),C=EW(n),[j,R]=A.useState(null),T=A.useRef(null),M=Et(t,T,w.onContentChange),P=A.useRef(0),B=A.useRef(""),O=A.useRef(0),$=A.useRef(null),U=A.useRef("right"),D=A.useRef(0),z=b?Pw:A.Fragment,V=b?{as:LW,allowPinchZoom:!0}:void 0,Y=q=>{var X,ee;const G=B.current+q,L=C().filter(ie=>!ie.disabled),W=document.activeElement,oe=(X=L.find(ie=>ie.ref.current===W))==null?void 0:X.textValue,K=L.map(ie=>ie.textValue),J=GW(K,G,oe),te=(ee=L.find(ie=>ie.textValue===J))==null?void 0:ee.ref.current;(function ie(ue){B.current=ue,window.clearTimeout(P.current),ue!==""&&(P.current=window.setTimeout(()=>ie(""),1e3))})(G),te&&setTimeout(()=>te.focus())};A.useEffect(()=>()=>window.clearTimeout(P.current),[]),fI();const F=A.useCallback(q=>{var L,W;return U.current===((L=$.current)==null?void 0:L.side)&&XW(q,(W=$.current)==null?void 0:W.area)},[]);return h.jsx(MW,{scope:n,searchRef:B,onItemEnter:A.useCallback(q=>{F(q)&&q.preventDefault()},[F]),onItemLeave:A.useCallback(q=>{var G;F(q)||((G=T.current)==null||G.focus(),R(null))},[F]),onTriggerLeave:A.useCallback(q=>{F(q)&&q.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:A.useCallback(q=>{$.current=q},[]),children:h.jsx(z,{...V,children:h.jsx(Mw,{asChild:!0,trapped:s,onMountAutoFocus:Te(o,q=>{var G;q.preventDefault(),(G=T.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(Iw,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:v,children:h.jsx(YI,{asChild:!0,...k,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:R,onEntryFocus:Te(u,q=>{S.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(bW,{role:"menu","aria-orientation":"vertical","data-state":KO(w.open),"data-radix-menu-content":"",dir:S.dir,...N,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:Te(x.onKeyDown,q=>{const L=q.target.closest("[data-radix-menu-content]")===q.currentTarget,W=q.ctrlKey||q.altKey||q.metaKey,oe=q.key.length===1;L&&(q.key==="Tab"&&q.preventDefault(),!W&&oe&&Y(q.key));const K=T.current;if(q.target!==K||!kW.includes(q.key))return;q.preventDefault();const te=C().filter(X=>!X.disabled).map(X=>X.ref.current);NO.includes(q.key)&&te.reverse(),WW(te)}),onBlur:Te(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(P.current),B.current="")}),onPointerMove:Te(e.onPointerMove,ml(q=>{const G=q.target,L=D.current!==q.clientX;if(q.currentTarget.contains(G)&&L){const W=q.clientX>D.current?"right":"left";U.current=W,D.current=q.clientX}}))})})})})})})});TO.displayName=kn;var DW="MenuGroup",gb=A.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{role:"group",...r,ref:t})});gb.displayName=DW;var $W="MenuLabel",IO=A.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{...r,ref:t})});IO.displayName=$W;var vd="MenuItem",TN="menu.itemSelect",nf=A.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=A.useRef(null),a=$l(vd,e.__scopeMenu),c=pb(vd,e.__scopeMenu),u=Et(t,o),d=A.useRef(!1),m=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(TN,{bubbles:!0,cancelable:!0});p.addEventListener(TN,v=>r==null?void 0:r(v),{once:!0}),lI(p,g),g.defaultPrevented?d.current=!1:a.onClose()}};return h.jsx(MO,{...s,ref:u,disabled:n,onClick:Te(e.onClick,m),onPointerDown:p=>{var g;(g=e.onPointerDown)==null||g.call(e,p),d.current=!0},onPointerUp:Te(e.onPointerUp,p=>{var g;d.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:Te(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||Zx.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});nf.displayName=vd;var MO=A.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=pb(vd,n),c=EO(n),u=A.useRef(null),d=Et(t,u),[m,p]=A.useState(!1),[g,v]=A.useState("");return A.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[o.children]),h.jsx(pl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:h.jsx(XI,{asChild:!0,...c,focusable:!r,children:h.jsx(Ze.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Te(e.onPointerMove,ml(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,ml(b=>a.onItemLeave(b))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),qW="MenuCheckboxItem",OO=A.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return h.jsx(qO,{scope:e.__scopeMenu,checked:n,children:h.jsx(nf,{role:"menuitemcheckbox","aria-checked":xd(n)?"mixed":n,...s,ref:t,"data-state":vb(n),onSelect:Te(s.onSelect,()=>r==null?void 0:r(xd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});OO.displayName=qW;var PO="MenuRadioGroup",[FW,BW]=ai(PO,{value:void 0,onValueChange:()=>{}}),LO=A.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=ur(r);return h.jsx(FW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:h.jsx(gb,{...s,ref:t})})});LO.displayName=PO;var DO="MenuRadioItem",$O=A.forwardRef((e,t)=>{const{value:n,...r}=e,s=BW(DO,e.__scopeMenu),o=n===s.value;return h.jsx(qO,{scope:e.__scopeMenu,checked:o,children:h.jsx(nf,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":vb(o),onSelect:Te(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});$O.displayName=DO;var yb="MenuItemIndicator",[qO,zW]=ai(yb,{checked:!1}),FO=A.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=zW(yb,n);return h.jsx($r,{present:r||xd(o.checked)||o.checked===!0,children:h.jsx(Ze.span,{...s,ref:t,"data-state":vb(o.checked)})})});FO.displayName=yb;var VW="MenuSeparator",BO=A.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});BO.displayName=VW;var UW="MenuArrow",zO=A.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=tf(n);return h.jsx(SW,{...s,...r,ref:t})});zO.displayName=UW;var HW="MenuSub",[FJ,VO]=ai(HW),qa="MenuSubTrigger",UO=A.forwardRef((e,t)=>{const n=li(qa,e.__scopeMenu),r=$l(qa,e.__scopeMenu),s=VO(qa,e.__scopeMenu),o=pb(qa,e.__scopeMenu),a=A.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},m=A.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return A.useEffect(()=>m,[m]),A.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),h.jsx(fb,{asChild:!0,...d,children:h.jsx(MO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":KO(n.open),...e,ref:Rw(t,s.onTriggerChange),onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,ml(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Te(e.onPointerLeave,ml(p=>{var v,b;m();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const x=(b=n.content)==null?void 0:b.dataset.side,w=x==="right",S=w?-5:5,N=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:N,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:N,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{var v;const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||NW[r.dir].includes(p.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),p.preventDefault())})})})});UO.displayName=qa;var HO="MenuSubContent",WO=A.forwardRef((e,t)=>{const n=AO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=li(kn,e.__scopeMenu),a=$l(kn,e.__scopeMenu),c=VO(HO,e.__scopeMenu),u=A.useRef(null),d=Et(t,u);return h.jsx(pl.Provider,{scope:e.__scopeMenu,children:h.jsx($r,{present:r||o.open,children:h.jsx(pl.Slot,{scope:e.__scopeMenu,children:h.jsx(mb,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Te(e.onFocusOutside,m=>{m.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:Te(e.onKeyDown,m=>{var v;const p=m.currentTarget.contains(m.target),g=CW[a.dir].includes(m.key);p&&g&&(o.onOpenChange(!1),(v=c.trigger)==null||v.focus(),m.preventDefault())})})})})})});WO.displayName=HO;function KO(e){return e?"open":"closed"}function xd(e){return e==="indeterminate"}function vb(e){return xd(e)?"indeterminate":e?"checked":"unchecked"}function WW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function KW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GW(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=KW(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function YW(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],u=t[a],d=c.x,m=c.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-d)*(r-m)/(g-m)+d&&(s=!s)}return s}function XW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YW(n,t)}function ml(e){return t=>t.pointerType==="mouse"?e(t):void 0}var QW=jO,JW=fb,ZW=RO,eK=TO,tK=gb,nK=IO,rK=nf,sK=OO,iK=LO,oK=$O,aK=FO,lK=BO,cK=zO,uK=UO,dK=WO,xb="ContextMenu",[fK]=ii(xb,[CO]),zt=CO(),[hK,GO]=fK(xb),YO=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[a,c]=A.useState(!1),u=zt(t),d=ur(r),m=A.useCallback(p=>{c(p),d(p)},[d]);return h.jsx(hK,{scope:t,open:a,onOpenChange:m,modal:o,children:h.jsx(QW,{...u,dir:s,open:a,onOpenChange:m,modal:o,children:n})})};YO.displayName=xb;var XO="ContextMenuTrigger",QO=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=GO(XO,n),a=zt(n),c=A.useRef({x:0,y:0}),u=A.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=A.useRef(0),m=A.useCallback(()=>window.clearTimeout(d.current),[]),p=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return A.useEffect(()=>m,[m]),A.useEffect(()=>void(r&&m()),[r,m]),h.jsxs(h.Fragment,{children:[h.jsx(JW,{...a,virtualRef:u}),h.jsx(Ze.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Te(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Te(e.onPointerDown,Au(g=>{m(),d.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Te(e.onPointerMove,Au(m)),onPointerCancel:r?e.onPointerCancel:Te(e.onPointerCancel,Au(m)),onPointerUp:r?e.onPointerUp:Te(e.onPointerUp,Au(m))})]})});QO.displayName=XO;var pK="ContextMenuPortal",JO=e=>{const{__scopeContextMenu:t,...n}=e,r=zt(t);return h.jsx(ZW,{...r,...n})};JO.displayName=pK;var ZO="ContextMenuContent",eP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=GO(ZO,n),o=zt(n),a=A.useRef(!1);return h.jsx(eK,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eP.displayName=ZO;var mK="ContextMenuGroup",gK=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(tK,{...s,...r,ref:t})});gK.displayName=mK;var yK="ContextMenuLabel",tP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(nK,{...s,...r,ref:t})});tP.displayName=yK;var vK="ContextMenuItem",nP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(rK,{...s,...r,ref:t})});nP.displayName=vK;var xK="ContextMenuCheckboxItem",rP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(sK,{...s,...r,ref:t})});rP.displayName=xK;var wK="ContextMenuRadioGroup",bK=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(iK,{...s,...r,ref:t})});bK.displayName=wK;var SK="ContextMenuRadioItem",sP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(oK,{...s,...r,ref:t})});sP.displayName=SK;var _K="ContextMenuItemIndicator",iP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(aK,{...s,...r,ref:t})});iP.displayName=_K;var kK="ContextMenuSeparator",oP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(lK,{...s,...r,ref:t})});oP.displayName=kK;var NK="ContextMenuArrow",CK=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(cK,{...s,...r,ref:t})});CK.displayName=NK;var EK="ContextMenuSubTrigger",aP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(uK,{...s,...r,ref:t})});aP.displayName=EK;var jK="ContextMenuSubContent",lP=A.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(dK,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lP.displayName=jK;function Au(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var AK=YO,RK=QO,TK=JO,cP=eP,uP=tP,dP=nP,fP=rP,hP=sP,pP=iP,mP=oP,gP=aP,yP=lP;const IK=AK,MK=RK,OK=A.forwardRef(({className:e,inset:t,children:n,...r},s)=>h.jsxs(gP,{ref:s,className:Bt("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 data-[state=open]:bg-white/10",t&&"pl-8",e),...r,children:[n,h.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));OK.displayName=gP.displayName;const PK=A.forwardRef(({className:e,...t},n)=>h.jsx(yP,{ref:n,className:Bt("z-50 min-w-[8rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t}));PK.displayName=yP.displayName;const vP=A.forwardRef(({className:e,...t},n)=>h.jsx(TK,{children:h.jsx(cP,{ref:n,className:Bt("z-50 min-w-[12rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t})}));vP.displayName=cP.displayName;const Xi=A.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>h.jsx(dP,{ref:s,className:Bt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"text-error focus:bg-error/10 focus:text-error",t&&"pl-8",e),...r}));Xi.displayName=dP.displayName;const LK=A.forwardRef(({className:e,children:t,checked:n,...r},s)=>h.jsxs(fP,{ref:s,className:Bt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(pP,{children:h.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));LK.displayName=fP.displayName;const DK=A.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(hP,{ref:r,className:Bt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(pP,{children:h.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));DK.displayName=hP.displayName;const $K=A.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(uP,{ref:r,className:Bt("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));$K.displayName=uP.displayName;const ew=A.forwardRef(({className:e,...t},n)=>h.jsx(mP,{ref:n,className:Bt("-mx-1 my-1 h-px bg-node-border",e),...t}));ew.displayName=mP.displayName;const Fa=({className:e,...t})=>h.jsx("span",{className:Bt("ml-auto text-xs tracking-widest text-gray-500",e),...t});Fa.displayName="ContextMenuShortcut";function wb(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jp,IN;function qK(){if(IN)return Jp;IN=1;function e(){this.__data__=[],this.size=0}return Jp=e,Jp}var Zp,MN;function Io(){if(MN)return Zp;MN=1;function e(t,n){return t===n||t!==t&&n!==n}return Zp=e,Zp}var em,ON;function rf(){if(ON)return em;ON=1;var e=Io();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return em=t,em}var tm,PN;function FK(){if(PN)return tm;PN=1;var e=rf(),t=Array.prototype,n=t.splice;function r(s){var o=this.__data__,a=e(o,s);if(a<0)return!1;var c=o.length-1;return a==c?o.pop():n.call(o,a,1),--this.size,!0}return tm=r,tm}var nm,LN;function BK(){if(LN)return nm;LN=1;var e=rf();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return nm=t,nm}var rm,DN;function zK(){if(DN)return rm;DN=1;var e=rf();function t(n){return e(this.__data__,n)>-1}return rm=t,rm}var sm,$N;function VK(){if($N)return sm;$N=1;var e=rf();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return sm=t,sm}var im,qN;function sf(){if(qN)return im;qN=1;var e=qK(),t=FK(),n=BK(),r=zK(),s=VK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,im=o,im}var om,FN;function UK(){if(FN)return om;FN=1;var e=sf();function t(){this.__data__=new e,this.size=0}return om=t,om}var am,BN;function HK(){if(BN)return am;BN=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return am=e,am}var lm,zN;function WK(){if(zN)return lm;zN=1;function e(t){return this.__data__.get(t)}return lm=e,lm}var cm,VN;function KK(){if(VN)return cm;VN=1;function e(t){return this.__data__.has(t)}return cm=e,cm}var um,UN;function xP(){if(UN)return um;UN=1;var e=typeof iu=="object"&&iu&&iu.Object===Object&&iu;return um=e,um}var dm,HN;function Gn(){if(HN)return dm;HN=1;var e=xP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dm=n,dm}var fm,WN;function Mo(){if(WN)return fm;WN=1;var e=Gn(),t=e.Symbol;return fm=t,fm}var hm,KN;function GK(){if(KN)return hm;KN=1;var e=Mo(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var c=n.call(a,s),u=a[s];try{a[s]=void 0;var d=!0}catch{}var m=r.call(a);return d&&(c?a[s]=u:delete a[s]),m}return hm=o,hm}var pm,GN;function YK(){if(GN)return pm;GN=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return pm=n,pm}var mm,YN;function ci(){if(YN)return mm;YN=1;var e=Mo(),t=GK(),n=YK(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?s:r:o&&o in Object(c)?t(c):n(c)}return mm=a,mm}var gm,XN;function Cn(){if(XN)return gm;XN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return gm=e,gm}var ym,QN;function ql(){if(QN)return ym;QN=1;var e=ci(),t=Cn(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(c){if(!t(c))return!1;var u=e(c);return u==r||u==s||u==n||u==o}return ym=a,ym}var vm,JN;function XK(){if(JN)return vm;JN=1;var e=Gn(),t=e["__core-js_shared__"];return vm=t,vm}var xm,ZN;function QK(){if(ZN)return xm;ZN=1;var e=XK(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return xm=n,xm}var wm,eC;function wP(){if(eC)return wm;eC=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return wm=n,wm}var bm,tC;function JK(){if(tC)return bm;tC=1;var e=ql(),t=QK(),n=Cn(),r=wP(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,u=a.toString,d=c.hasOwnProperty,m=RegExp("^"+u.call(d).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var v=e(g)?m:o;return v.test(r(g))}return bm=p,bm}var Sm,nC;function ZK(){if(nC)return Sm;nC=1;function e(t,n){return t==null?void 0:t[n]}return Sm=e,Sm}var _m,rC;function ui(){if(rC)return _m;rC=1;var e=JK(),t=ZK();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return _m=n,_m}var km,sC;function bb(){if(sC)return km;sC=1;var e=ui(),t=Gn(),n=e(t,"Map");return km=n,km}var Nm,iC;function of(){if(iC)return Nm;iC=1;var e=ui(),t=e(Object,"create");return Nm=t,Nm}var Cm,oC;function eG(){if(oC)return Cm;oC=1;var e=of();function t(){this.__data__=e?e(null):{},this.size=0}return Cm=t,Cm}var Em,aC;function tG(){if(aC)return Em;aC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Em=e,Em}var jm,lC;function nG(){if(lC)return jm;lC=1;var e=of(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var c=a[o];return c===t?void 0:c}return r.call(a,o)?a[o]:void 0}return jm=s,jm}var Am,cC;function rG(){if(cC)return Am;cC=1;var e=of(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return Am=r,Am}var Rm,uC;function sG(){if(uC)return Rm;uC=1;var e=of(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return Rm=n,Rm}var Tm,dC;function iG(){if(dC)return Tm;dC=1;var e=eG(),t=tG(),n=nG(),r=rG(),s=sG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,Tm=o,Tm}var Im,fC;function oG(){if(fC)return Im;fC=1;var e=iG(),t=sf(),n=bb();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Im=r,Im}var Mm,hC;function aG(){if(hC)return Mm;hC=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Mm=e,Mm}var Om,pC;function af(){if(pC)return Om;pC=1;var e=aG();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return Om=t,Om}var Pm,mC;function lG(){if(mC)return Pm;mC=1;var e=af();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Pm=t,Pm}var Lm,gC;function cG(){if(gC)return Lm;gC=1;var e=af();function t(n){return e(this,n).get(n)}return Lm=t,Lm}var Dm,yC;function uG(){if(yC)return Dm;yC=1;var e=af();function t(n){return e(this,n).has(n)}return Dm=t,Dm}var $m,vC;function dG(){if(vC)return $m;vC=1;var e=af();function t(n,r){var s=e(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return $m=t,$m}var qm,xC;function Sb(){if(xC)return qm;xC=1;var e=oG(),t=lG(),n=cG(),r=uG(),s=dG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,qm=o,qm}var Fm,wC;function fG(){if(wC)return Fm;wC=1;var e=sf(),t=bb(),n=Sb(),r=200;function s(o,a){var c=this.__data__;if(c instanceof e){var u=c.__data__;if(!t||u.length<r-1)return u.push([o,a]),this.size=++c.size,this;c=this.__data__=new n(u)}return c.set(o,a),this.size=c.size,this}return Fm=s,Fm}var Bm,bC;function lf(){if(bC)return Bm;bC=1;var e=sf(),t=UK(),n=HK(),r=WK(),s=KK(),o=fG();function a(c){var u=this.__data__=new e(c);this.size=u.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,Bm=a,Bm}var zm,SC;function _b(){if(SC)return zm;SC=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s&&n(t[r],r,t)!==!1;);return t}return zm=e,zm}var Vm,_C;function bP(){if(_C)return Vm;_C=1;var e=ui(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Vm=t,Vm}var Um,kC;function cf(){if(kC)return Um;kC=1;var e=bP();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return Um=t,Um}var Hm,NC;function uf(){if(NC)return Hm;NC=1;var e=cf(),t=Io(),n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c){var u=o[a];(!(r.call(o,a)&&t(u,c))||c===void 0&&!(a in o))&&e(o,a,c)}return Hm=s,Hm}var Wm,CC;function Fl(){if(CC)return Wm;CC=1;var e=uf(),t=cf();function n(r,s,o,a){var c=!o;o||(o={});for(var u=-1,d=s.length;++u<d;){var m=s[u],p=a?a(o[m],r[m],m,o,r):void 0;p===void 0&&(p=r[m]),c?t(o,m,p):e(o,m,p)}return o}return Wm=n,Wm}var Km,EC;function hG(){if(EC)return Km;EC=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return Km=e,Km}var Gm,jC;function gr(){if(jC)return Gm;jC=1;function e(t){return t!=null&&typeof t=="object"}return Gm=e,Gm}var Ym,AC;function pG(){if(AC)return Ym;AC=1;var e=ci(),t=gr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return Ym=r,Ym}var Xm,RC;function Bl(){if(RC)return Xm;RC=1;var e=pG(),t=gr(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return Xm=o,Xm}var Qm,TC;function yt(){if(TC)return Qm;TC=1;var e=Array.isArray;return Qm=e,Qm}var Ba={exports:{}},Jm,IC;function mG(){if(IC)return Jm;IC=1;function e(){return!1}return Jm=e,Jm}Ba.exports;var MC;function Oo(){return MC||(MC=1,(function(e,t){var n=Gn(),r=mG(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,c=a?n.Buffer:void 0,u=c?c.isBuffer:void 0,d=u||r;e.exports=d})(Ba,Ba.exports)),Ba.exports}var Zm,OC;function df(){if(OC)return Zm;OC=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return Zm=n,Zm}var eg,PC;function kb(){if(PC)return eg;PC=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return eg=t,eg}var tg,LC;function gG(){if(LC)return tg;LC=1;var e=ci(),t=kb(),n=gr(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",k="[object Float64Array]",C="[object Int8Array]",j="[object Int16Array]",R="[object Int32Array]",T="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",O={};O[N]=O[k]=O[C]=O[j]=O[R]=O[T]=O[M]=O[P]=O[B]=!0,O[r]=O[s]=O[w]=O[o]=O[S]=O[a]=O[c]=O[u]=O[d]=O[m]=O[p]=O[g]=O[v]=O[b]=O[x]=!1;function $(U){return n(U)&&t(U.length)&&!!O[e(U)]}return tg=$,tg}var ng,DC;function ff(){if(DC)return ng;DC=1;function e(t){return function(n){return t(n)}}return ng=e,ng}var za={exports:{}};za.exports;var $C;function Nb(){return $C||($C=1,(function(e,t){var n=xP(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o&&n.process,c=(function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(za,za.exports)),za.exports}var rg,qC;function zl(){if(qC)return rg;qC=1;var e=gG(),t=ff(),n=Nb(),r=n&&n.isTypedArray,s=r?t(r):e;return rg=s,rg}var sg,FC;function SP(){if(FC)return sg;FC=1;var e=hG(),t=Bl(),n=yt(),r=Oo(),s=df(),o=zl(),a=Object.prototype,c=a.hasOwnProperty;function u(d,m){var p=n(d),g=!p&&t(d),v=!p&&!g&&r(d),b=!p&&!g&&!v&&o(d),x=p||g||v||b,w=x?e(d.length,String):[],S=w.length;for(var N in d)(m||c.call(d,N))&&!(x&&(N=="length"||v&&(N=="offset"||N=="parent")||b&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||s(N,S)))&&w.push(N);return w}return sg=u,sg}var ig,BC;function hf(){if(BC)return ig;BC=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return ig=t,ig}var og,zC;function _P(){if(zC)return og;zC=1;function e(t,n){return function(r){return t(n(r))}}return og=e,og}var ag,VC;function yG(){if(VC)return ag;VC=1;var e=_P(),t=e(Object.keys,Object);return ag=t,ag}var lg,UC;function Cb(){if(UC)return lg;UC=1;var e=hf(),t=yG(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!e(o))return t(o);var a=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&a.push(c);return a}return lg=s,lg}var cg,HC;function qr(){if(HC)return cg;HC=1;var e=ql(),t=kb();function n(r){return r!=null&&t(r.length)&&!e(r)}return cg=n,cg}var ug,WC;function Ns(){if(WC)return ug;WC=1;var e=SP(),t=Cb(),n=qr();function r(s){return n(s)?e(s):t(s)}return ug=r,ug}var dg,KC;function vG(){if(KC)return dg;KC=1;var e=Fl(),t=Ns();function n(r,s){return r&&e(s,t(s),r)}return dg=n,dg}var fg,GC;function xG(){if(GC)return fg;GC=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return fg=e,fg}var hg,YC;function wG(){if(YC)return hg;YC=1;var e=Cn(),t=hf(),n=xG(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return n(a);var c=t(a),u=[];for(var d in a)d=="constructor"&&(c||!s.call(a,d))||u.push(d);return u}return hg=o,hg}var pg,XC;function di(){if(XC)return pg;XC=1;var e=SP(),t=wG(),n=qr();function r(s){return n(s)?e(s,!0):t(s)}return pg=r,pg}var mg,QC;function bG(){if(QC)return mg;QC=1;var e=Fl(),t=di();function n(r,s){return r&&e(s,t(s),r)}return mg=n,mg}var Va={exports:{}};Va.exports;var JC;function kP(){return JC||(JC=1,(function(e,t){var n=Gn(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function u(d,m){if(m)return d.slice();var p=d.length,g=c?c(p):new d.constructor(p);return d.copy(g),g}e.exports=u})(Va,Va.exports)),Va.exports}var gg,ZC;function NP(){if(ZC)return gg;ZC=1;function e(t,n){var r=-1,s=t.length;for(n||(n=Array(s));++r<s;)n[r]=t[r];return n}return gg=e,gg}var yg,e2;function CP(){if(e2)return yg;e2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=0,a=[];++r<s;){var c=t[r];n(c,r,t)&&(a[o++]=c)}return a}return yg=e,yg}var vg,t2;function EP(){if(t2)return vg;t2=1;function e(){return[]}return vg=e,vg}var xg,n2;function Eb(){if(n2)return xg;n2=1;var e=CP(),t=EP(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(c){return r.call(a,c)}))}:t;return xg=o,xg}var wg,r2;function SG(){if(r2)return wg;r2=1;var e=Fl(),t=Eb();function n(r,s){return e(r,t(r),s)}return wg=n,wg}var bg,s2;function jb(){if(s2)return bg;s2=1;function e(t,n){for(var r=-1,s=n.length,o=t.length;++r<s;)t[o+r]=n[r];return t}return bg=e,bg}var Sg,i2;function pf(){if(i2)return Sg;i2=1;var e=_P(),t=e(Object.getPrototypeOf,Object);return Sg=t,Sg}var _g,o2;function jP(){if(o2)return _g;o2=1;var e=jb(),t=pf(),n=Eb(),r=EP(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return _g=o,_g}var kg,a2;function _G(){if(a2)return kg;a2=1;var e=Fl(),t=jP();function n(r,s){return e(r,t(r),s)}return kg=n,kg}var Ng,l2;function AP(){if(l2)return Ng;l2=1;var e=jb(),t=yt();function n(r,s,o){var a=s(r);return t(r)?a:e(a,o(r))}return Ng=n,Ng}var Cg,c2;function RP(){if(c2)return Cg;c2=1;var e=AP(),t=Eb(),n=Ns();function r(s){return e(s,n,t)}return Cg=r,Cg}var Eg,u2;function kG(){if(u2)return Eg;u2=1;var e=AP(),t=jP(),n=di();function r(s){return e(s,n,t)}return Eg=r,Eg}var jg,d2;function NG(){if(d2)return jg;d2=1;var e=ui(),t=Gn(),n=e(t,"DataView");return jg=n,jg}var Ag,f2;function CG(){if(f2)return Ag;f2=1;var e=ui(),t=Gn(),n=e(t,"Promise");return Ag=n,Ag}var Rg,h2;function TP(){if(h2)return Rg;h2=1;var e=ui(),t=Gn(),n=e(t,"Set");return Rg=n,Rg}var Tg,p2;function EG(){if(p2)return Tg;p2=1;var e=ui(),t=Gn(),n=e(t,"WeakMap");return Tg=n,Tg}var Ig,m2;function Po(){if(m2)return Ig;m2=1;var e=NG(),t=bb(),n=CG(),r=TP(),s=EG(),o=ci(),a=wP(),c="[object Map]",u="[object Object]",d="[object Promise]",m="[object Set]",p="[object WeakMap]",g="[object DataView]",v=a(e),b=a(t),x=a(n),w=a(r),S=a(s),N=o;return(e&&N(new e(new ArrayBuffer(1)))!=g||t&&N(new t)!=c||n&&N(n.resolve())!=d||r&&N(new r)!=m||s&&N(new s)!=p)&&(N=function(k){var C=o(k),j=C==u?k.constructor:void 0,R=j?a(j):"";if(R)switch(R){case v:return g;case b:return c;case x:return d;case w:return m;case S:return p}return C}),Ig=N,Ig}var Mg,g2;function jG(){if(g2)return Mg;g2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var s=r.length,o=new r.constructor(s);return s&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return Mg=n,Mg}var Og,y2;function IP(){if(y2)return Og;y2=1;var e=Gn(),t=e.Uint8Array;return Og=t,Og}var Pg,v2;function Ab(){if(v2)return Pg;v2=1;var e=IP();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Pg=t,Pg}var Lg,x2;function AG(){if(x2)return Lg;x2=1;var e=Ab();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return Lg=t,Lg}var Dg,w2;function RG(){if(w2)return Dg;w2=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return Dg=t,Dg}var $g,b2;function TG(){if(b2)return $g;b2=1;var e=Mo(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return $g=r,$g}var qg,S2;function MP(){if(S2)return qg;S2=1;var e=Ab();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return qg=t,qg}var Fg,_2;function IG(){if(_2)return Fg;_2=1;var e=Ab(),t=AG(),n=RG(),r=TG(),s=MP(),o="[object Boolean]",a="[object Date]",c="[object Map]",u="[object Number]",d="[object RegExp]",m="[object Set]",p="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",N="[object Int16Array]",k="[object Int32Array]",C="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",T="[object Uint32Array]";function M(P,B,O){var $=P.constructor;switch(B){case v:return e(P);case o:case a:return new $(+P);case b:return t(P,O);case x:case w:case S:case N:case k:case C:case j:case R:case T:return s(P,O);case c:return new $;case u:case p:return new $(P);case d:return n(P);case m:return new $;case g:return r(P)}}return Fg=M,Fg}var Bg,k2;function OP(){if(k2)return Bg;k2=1;var e=Cn(),t=Object.create,n=(function(){function r(){}return function(s){if(!e(s))return{};if(t)return t(s);r.prototype=s;var o=new r;return r.prototype=void 0,o}})();return Bg=n,Bg}var zg,N2;function PP(){if(N2)return zg;N2=1;var e=OP(),t=pf(),n=hf();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return zg=r,zg}var Vg,C2;function MG(){if(C2)return Vg;C2=1;var e=Po(),t=gr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return Vg=r,Vg}var Ug,E2;function OG(){if(E2)return Ug;E2=1;var e=MG(),t=ff(),n=Nb(),r=n&&n.isMap,s=r?t(r):e;return Ug=s,Ug}var Hg,j2;function PG(){if(j2)return Hg;j2=1;var e=Po(),t=gr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return Hg=r,Hg}var Wg,A2;function LG(){if(A2)return Wg;A2=1;var e=PG(),t=ff(),n=Nb(),r=n&&n.isSet,s=r?t(r):e;return Wg=s,Wg}var Kg,R2;function LP(){if(R2)return Kg;R2=1;var e=lf(),t=_b(),n=uf(),r=vG(),s=bG(),o=kP(),a=NP(),c=SG(),u=_G(),d=RP(),m=kG(),p=Po(),g=jG(),v=IG(),b=PP(),x=yt(),w=Oo(),S=OG(),N=Cn(),k=LG(),C=Ns(),j=di(),R=1,T=2,M=4,P="[object Arguments]",B="[object Array]",O="[object Boolean]",$="[object Date]",U="[object Error]",D="[object Function]",z="[object GeneratorFunction]",V="[object Map]",Y="[object Number]",F="[object Object]",q="[object RegExp]",G="[object Set]",L="[object String]",W="[object Symbol]",oe="[object WeakMap]",K="[object ArrayBuffer]",J="[object DataView]",te="[object Float32Array]",X="[object Float64Array]",ee="[object Int8Array]",ie="[object Int16Array]",ue="[object Int32Array]",me="[object Uint8Array]",ye="[object Uint8ClampedArray]",pe="[object Uint16Array]",_e="[object Uint32Array]",xe={};xe[P]=xe[B]=xe[K]=xe[J]=xe[O]=xe[$]=xe[te]=xe[X]=xe[ee]=xe[ie]=xe[ue]=xe[V]=xe[Y]=xe[F]=xe[q]=xe[G]=xe[L]=xe[W]=xe[me]=xe[ye]=xe[pe]=xe[_e]=!0,xe[U]=xe[D]=xe[oe]=!1;function Ce(Ne,tt,Le,vt,xt,it){var We,It=tt&R,Mt=tt&T,Vt=tt&M;if(Le&&(We=xt?Le(Ne,vt,xt,it):Le(Ne)),We!==void 0)return We;if(!N(Ne))return Ne;var Ie=x(Ne);if(Ie){if(We=g(Ne),!It)return a(Ne,We)}else{var be=p(Ne),ot=be==D||be==z;if(w(Ne))return o(Ne,It);if(be==F||be==P||ot&&!xt){if(We=Mt||ot?{}:b(Ne),!It)return Mt?u(Ne,s(We,Ne)):c(Ne,r(We,Ne))}else{if(!xe[be])return xt?Ne:{};We=v(Ne,be,It)}}it||(it=new e);var Ve=it.get(Ne);if(Ve)return Ve;it.set(Ne,We),k(Ne)?Ne.forEach(function(Ot){We.add(Ce(Ot,tt,Le,Ot,Ne,it))}):S(Ne)&&Ne.forEach(function(Ot,Pt){We.set(Pt,Ce(Ot,tt,Le,Pt,Ne,it))});var Ut=Vt?Mt?m:d:Mt?j:C,hn=Ie?void 0:Ut(Ne);return t(hn||Ne,function(Ot,Pt){hn&&(Pt=Ot,Ot=Ne[Pt]),n(We,Pt,Ce(Ot,tt,Le,Pt,Ne,it))}),We}return Kg=Ce,Kg}var Gg,T2;function DG(){if(T2)return Gg;T2=1;var e=LP(),t=4;function n(r){return e(r,t)}return Gg=n,Gg}var Yg,I2;function Rb(){if(I2)return Yg;I2=1;function e(t){return function(){return t}}return Yg=e,Yg}var Xg,M2;function $G(){if(M2)return Xg;M2=1;function e(t){return function(n,r,s){for(var o=-1,a=Object(n),c=s(n),u=c.length;u--;){var d=c[t?u:++o];if(r(a[d],d,a)===!1)break}return n}}return Xg=e,Xg}var Qg,O2;function Tb(){if(O2)return Qg;O2=1;var e=$G(),t=e();return Qg=t,Qg}var Jg,P2;function Ib(){if(P2)return Jg;P2=1;var e=Tb(),t=Ns();function n(r,s){return r&&e(r,s,t)}return Jg=n,Jg}var Zg,L2;function qG(){if(L2)return Zg;L2=1;var e=qr();function t(n,r){return function(s,o){if(s==null)return s;if(!e(s))return n(s,o);for(var a=s.length,c=r?a:-1,u=Object(s);(r?c--:++c<a)&&o(u[c],c,u)!==!1;);return s}}return Zg=t,Zg}var ey,D2;function mf(){if(D2)return ey;D2=1;var e=Ib(),t=qG(),n=t(e);return ey=n,ey}var ty,$2;function fi(){if($2)return ty;$2=1;function e(t){return t}return ty=e,ty}var ny,q2;function DP(){if(q2)return ny;q2=1;var e=fi();function t(n){return typeof n=="function"?n:e}return ny=t,ny}var ry,F2;function $P(){if(F2)return ry;F2=1;var e=_b(),t=mf(),n=DP(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a))}return ry=s,ry}var sy,B2;function qP(){return B2||(B2=1,sy=$P()),sy}var iy,z2;function FG(){if(z2)return iy;z2=1;var e=mf();function t(n,r){var s=[];return e(n,function(o,a,c){r(o,a,c)&&s.push(o)}),s}return iy=t,iy}var oy,V2;function BG(){if(V2)return oy;V2=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return oy=t,oy}var ay,U2;function zG(){if(U2)return ay;U2=1;function e(t){return this.__data__.has(t)}return ay=e,ay}var ly,H2;function FP(){if(H2)return ly;H2=1;var e=Sb(),t=BG(),n=zG();function r(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new e;++o<a;)this.add(s[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,ly=r,ly}var cy,W2;function VG(){if(W2)return cy;W2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return cy=e,cy}var uy,K2;function BP(){if(K2)return uy;K2=1;function e(t,n){return t.has(n)}return uy=e,uy}var dy,G2;function zP(){if(G2)return dy;G2=1;var e=FP(),t=VG(),n=BP(),r=1,s=2;function o(a,c,u,d,m,p){var g=u&r,v=a.length,b=c.length;if(v!=b&&!(g&&b>v))return!1;var x=p.get(a),w=p.get(c);if(x&&w)return x==c&&w==a;var S=-1,N=!0,k=u&s?new e:void 0;for(p.set(a,c),p.set(c,a);++S<v;){var C=a[S],j=c[S];if(d)var R=g?d(j,C,S,c,a,p):d(C,j,S,a,c,p);if(R!==void 0){if(R)continue;N=!1;break}if(k){if(!t(c,function(T,M){if(!n(k,M)&&(C===T||m(C,T,u,d,p)))return k.push(M)})){N=!1;break}}else if(!(C===j||m(C,j,u,d,p))){N=!1;break}}return p.delete(a),p.delete(c),N}return dy=o,dy}var fy,Y2;function UG(){if(Y2)return fy;Y2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return fy=e,fy}var hy,X2;function Mb(){if(X2)return hy;X2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return hy=e,hy}var py,Q2;function HG(){if(Q2)return py;Q2=1;var e=Mo(),t=IP(),n=Io(),r=zP(),s=UG(),o=Mb(),a=1,c=2,u="[object Boolean]",d="[object Date]",m="[object Error]",p="[object Map]",g="[object Number]",v="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",k=e?e.prototype:void 0,C=k?k.valueOf:void 0;function j(R,T,M,P,B,O,$){switch(M){case N:if(R.byteLength!=T.byteLength||R.byteOffset!=T.byteOffset)return!1;R=R.buffer,T=T.buffer;case S:return!(R.byteLength!=T.byteLength||!O(new t(R),new t(T)));case u:case d:case g:return n(+R,+T);case m:return R.name==T.name&&R.message==T.message;case v:case x:return R==T+"";case p:var U=s;case b:var D=P&a;if(U||(U=o),R.size!=T.size&&!D)return!1;var z=$.get(R);if(z)return z==T;P|=c,$.set(R,T);var V=r(U(R),U(T),P,B,O,$);return $.delete(R),V;case w:if(C)return C.call(R)==C.call(T)}return!1}return py=j,py}var my,J2;function WG(){if(J2)return my;J2=1;var e=RP(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c,u,d,m){var p=c&t,g=e(o),v=g.length,b=e(a),x=b.length;if(v!=x&&!p)return!1;for(var w=v;w--;){var S=g[w];if(!(p?S in a:r.call(a,S)))return!1}var N=m.get(o),k=m.get(a);if(N&&k)return N==a&&k==o;var C=!0;m.set(o,a),m.set(a,o);for(var j=p;++w<v;){S=g[w];var R=o[S],T=a[S];if(u)var M=p?u(T,R,S,a,o,m):u(R,T,S,o,a,m);if(!(M===void 0?R===T||d(R,T,c,u,m):M)){C=!1;break}j||(j=S=="constructor")}if(C&&!j){var P=o.constructor,B=a.constructor;P!=B&&"constructor"in o&&"constructor"in a&&!(typeof P=="function"&&P instanceof P&&typeof B=="function"&&B instanceof B)&&(C=!1)}return m.delete(o),m.delete(a),C}return my=s,my}var gy,Z2;function KG(){if(Z2)return gy;Z2=1;var e=lf(),t=zP(),n=HG(),r=WG(),s=Po(),o=yt(),a=Oo(),c=zl(),u=1,d="[object Arguments]",m="[object Array]",p="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function b(x,w,S,N,k,C){var j=o(x),R=o(w),T=j?m:s(x),M=R?m:s(w);T=T==d?p:T,M=M==d?p:M;var P=T==p,B=M==p,O=T==M;if(O&&a(x)){if(!a(w))return!1;j=!0,P=!1}if(O&&!P)return C||(C=new e),j||c(x)?t(x,w,S,N,k,C):n(x,w,T,S,N,k,C);if(!(S&u)){var $=P&&v.call(x,"__wrapped__"),U=B&&v.call(w,"__wrapped__");if($||U){var D=$?x.value():x,z=U?w.value():w;return C||(C=new e),k(D,z,S,N,C)}}return O?(C||(C=new e),r(x,w,S,N,k,C)):!1}return gy=b,gy}var yy,eE;function VP(){if(eE)return yy;eE=1;var e=KG(),t=gr();function n(r,s,o,a,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,o,a,n,c)}return yy=n,yy}var vy,tE;function GG(){if(tE)return vy;tE=1;var e=lf(),t=VP(),n=1,r=2;function s(o,a,c,u){var d=c.length,m=d,p=!u;if(o==null)return!m;for(o=Object(o);d--;){var g=c[d];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++d<m;){g=c[d];var v=g[0],b=o[v],x=g[1];if(p&&g[2]){if(b===void 0&&!(v in o))return!1}else{var w=new e;if(u)var S=u(b,x,v,o,a,w);if(!(S===void 0?t(x,b,n|r,u,w):S))return!1}}return!0}return vy=s,vy}var xy,nE;function UP(){if(nE)return xy;nE=1;var e=Cn();function t(n){return n===n&&!e(n)}return xy=t,xy}var wy,rE;function YG(){if(rE)return wy;rE=1;var e=UP(),t=Ns();function n(r){for(var s=t(r),o=s.length;o--;){var a=s[o],c=r[a];s[o]=[a,c,e(c)]}return s}return wy=n,wy}var by,sE;function HP(){if(sE)return by;sE=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return by=e,by}var Sy,iE;function XG(){if(iE)return Sy;iE=1;var e=GG(),t=YG(),n=HP();function r(s){var o=t(s);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(a){return a===s||e(a,s,o)}}return Sy=r,Sy}var _y,oE;function Lo(){if(oE)return _y;oE=1;var e=ci(),t=gr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return _y=r,_y}var ky,aE;function Ob(){if(aE)return ky;aE=1;var e=yt(),t=Lo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,a){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return ky=s,ky}var Ny,lE;function QG(){if(lE)return Ny;lE=1;var e=Sb(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var a=arguments,c=s?s.apply(this,a):a[0],u=o.cache;if(u.has(c))return u.get(c);var d=r.apply(this,a);return o.cache=u.set(c,d)||u,d};return o.cache=new(n.Cache||e),o}return n.Cache=e,Ny=n,Ny}var Cy,cE;function JG(){if(cE)return Cy;cE=1;var e=QG(),t=500;function n(r){var s=e(r,function(a){return o.size===t&&o.clear(),a}),o=s.cache;return s}return Cy=n,Cy}var Ey,uE;function ZG(){if(uE)return Ey;uE=1;var e=JG(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(a,c,u,d){o.push(u?d.replace(n,"$1"):c||a)}),o});return Ey=r,Ey}var jy,dE;function gf(){if(dE)return jy;dE=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=Array(s);++r<s;)o[r]=n(t[r],r,t);return o}return jy=e,jy}var Ay,fE;function eY(){if(fE)return Ay;fE=1;var e=Mo(),t=gf(),n=yt(),r=Lo(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function a(c){if(typeof c=="string")return c;if(n(c))return t(c,a)+"";if(r(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return Ay=a,Ay}var Ry,hE;function WP(){if(hE)return Ry;hE=1;var e=eY();function t(n){return n==null?"":e(n)}return Ry=t,Ry}var Ty,pE;function yf(){if(pE)return Ty;pE=1;var e=yt(),t=Ob(),n=ZG(),r=WP();function s(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return Ty=s,Ty}var Iy,mE;function Vl(){if(mE)return Iy;mE=1;var e=Lo();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Iy=t,Iy}var My,gE;function vf(){if(gE)return My;gE=1;var e=yf(),t=Vl();function n(r,s){s=e(s,r);for(var o=0,a=s.length;r!=null&&o<a;)r=r[t(s[o++])];return o&&o==a?r:void 0}return My=n,My}var Oy,yE;function tY(){if(yE)return Oy;yE=1;var e=vf();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return Oy=t,Oy}var Py,vE;function nY(){if(vE)return Py;vE=1;function e(t,n){return t!=null&&n in Object(t)}return Py=e,Py}var Ly,xE;function KP(){if(xE)return Ly;xE=1;var e=yf(),t=Bl(),n=yt(),r=df(),s=kb(),o=Vl();function a(c,u,d){u=e(u,c);for(var m=-1,p=u.length,g=!1;++m<p;){var v=o(u[m]);if(!(g=c!=null&&d(c,v)))break;c=c[v]}return g||++m!=p?g:(p=c==null?0:c.length,!!p&&s(p)&&r(v,p)&&(n(c)||t(c)))}return Ly=a,Ly}var Dy,wE;function GP(){if(wE)return Dy;wE=1;var e=nY(),t=KP();function n(r,s){return r!=null&&t(r,s,e)}return Dy=n,Dy}var $y,bE;function rY(){if(bE)return $y;bE=1;var e=VP(),t=tY(),n=GP(),r=Ob(),s=UP(),o=HP(),a=Vl(),c=1,u=2;function d(m,p){return r(m)&&s(p)?o(a(m),p):function(g){var v=t(g,m);return v===void 0&&v===p?n(g,m):e(p,v,c|u)}}return $y=d,$y}var qy,SE;function YP(){if(SE)return qy;SE=1;function e(t){return function(n){return n==null?void 0:n[t]}}return qy=e,qy}var Fy,_E;function sY(){if(_E)return Fy;_E=1;var e=vf();function t(n){return function(r){return e(r,n)}}return Fy=t,Fy}var By,kE;function iY(){if(kE)return By;kE=1;var e=YP(),t=sY(),n=Ob(),r=Vl();function s(o){return n(o)?e(r(o)):t(o)}return By=s,By}var zy,NE;function Fr(){if(NE)return zy;NE=1;var e=XG(),t=rY(),n=fi(),r=yt(),s=iY();function o(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):s(a)}return zy=o,zy}var Vy,CE;function XP(){if(CE)return Vy;CE=1;var e=CP(),t=FG(),n=Fr(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return Vy=s,Vy}var Uy,EE;function oY(){if(EE)return Uy;EE=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return Uy=n,Uy}var Hy,jE;function QP(){if(jE)return Hy;jE=1;var e=oY(),t=KP();function n(r,s){return r!=null&&t(r,s,e)}return Hy=n,Hy}var Wy,AE;function aY(){if(AE)return Wy;AE=1;var e=Cb(),t=Po(),n=Bl(),r=yt(),s=qr(),o=Oo(),a=hf(),c=zl(),u="[object Map]",d="[object Set]",m=Object.prototype,p=m.hasOwnProperty;function g(v){if(v==null)return!0;if(s(v)&&(r(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||c(v)||n(v)))return!v.length;var b=t(v);if(b==u||b==d)return!v.size;if(a(v))return!e(v).length;for(var x in v)if(p.call(v,x))return!1;return!0}return Wy=g,Wy}var Ky,RE;function JP(){if(RE)return Ky;RE=1;function e(t){return t===void 0}return Ky=e,Ky}var Gy,TE;function ZP(){if(TE)return Gy;TE=1;var e=mf(),t=qr();function n(r,s){var o=-1,a=t(r)?Array(r.length):[];return e(r,function(c,u,d){a[++o]=s(c,u,d)}),a}return Gy=n,Gy}var Yy,IE;function e4(){if(IE)return Yy;IE=1;var e=gf(),t=Fr(),n=ZP(),r=yt();function s(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return Yy=s,Yy}var Xy,ME;function lY(){if(ME)return Xy;ME=1;function e(t,n,r,s){var o=-1,a=t==null?0:t.length;for(s&&a&&(r=t[++o]);++o<a;)r=n(r,t[o],o,t);return r}return Xy=e,Xy}var Qy,OE;function cY(){if(OE)return Qy;OE=1;function e(t,n,r,s,o){return o(t,function(a,c,u){r=s?(s=!1,a):n(r,a,c,u)}),r}return Qy=e,Qy}var Jy,PE;function t4(){if(PE)return Jy;PE=1;var e=lY(),t=mf(),n=Fr(),r=cY(),s=yt();function o(a,c,u){var d=s(a)?e:r,m=arguments.length<3;return d(a,n(c,4),u,m,t)}return Jy=o,Jy}var Zy,LE;function uY(){if(LE)return Zy;LE=1;var e=ci(),t=yt(),n=gr(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Zy=s,Zy}var ev,DE;function dY(){if(DE)return ev;DE=1;var e=YP(),t=e("length");return ev=t,ev}var tv,$E;function fY(){if($E)return tv;$E=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+s+o+"]");function u(d){return c.test(d)}return tv=u,tv}var nv,qE;function hY(){if(qE)return nv;qE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="["+e+"]",c="["+s+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+u+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=d+"?",x="["+o+"]?",w="(?:"+v+"(?:"+[m,p,g].join("|")+")"+x+b+")*",S=x+b+w,N="(?:"+[m+c+"?",c,p,g,a].join("|")+")",k=RegExp(u+"(?="+u+")|"+N+S,"g");function C(j){for(var R=k.lastIndex=0;k.test(j);)++R;return R}return nv=C,nv}var rv,FE;function pY(){if(FE)return rv;FE=1;var e=dY(),t=fY(),n=hY();function r(s){return t(s)?n(s):e(s)}return rv=r,rv}var sv,BE;function mY(){if(BE)return sv;BE=1;var e=Cb(),t=Po(),n=qr(),r=uY(),s=pY(),o="[object Map]",a="[object Set]";function c(u){if(u==null)return 0;if(n(u))return r(u)?s(u):u.length;var d=t(u);return d==o||d==a?u.size:e(u).length}return sv=c,sv}var iv,zE;function gY(){if(zE)return iv;zE=1;var e=_b(),t=OP(),n=Ib(),r=Fr(),s=pf(),o=yt(),a=Oo(),c=ql(),u=Cn(),d=zl();function m(p,g,v){var b=o(p),x=b||a(p)||d(p);if(g=r(g,4),v==null){var w=p&&p.constructor;x?v=b?new w:[]:u(p)?v=c(w)?t(s(p)):{}:v={}}return(x?e:n)(p,function(S,N,k){return g(v,S,N,k)}),v}return iv=m,iv}var ov,VE;function yY(){if(VE)return ov;VE=1;var e=Mo(),t=Bl(),n=yt(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return ov=s,ov}var av,UE;function Pb(){if(UE)return av;UE=1;var e=jb(),t=yY();function n(r,s,o,a,c){var u=-1,d=r.length;for(o||(o=t),c||(c=[]);++u<d;){var m=r[u];s>0&&o(m)?s>1?n(m,s-1,o,a,c):e(c,m):a||(c[c.length]=m)}return c}return av=n,av}var lv,HE;function vY(){if(HE)return lv;HE=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return lv=e,lv}var cv,WE;function n4(){if(WE)return cv;WE=1;var e=vY(),t=Math.max;function n(r,s,o){return s=t(s===void 0?r.length-1:s,0),function(){for(var a=arguments,c=-1,u=t(a.length-s,0),d=Array(u);++c<u;)d[c]=a[s+c];c=-1;for(var m=Array(s+1);++c<s;)m[c]=a[c];return m[s]=o(d),e(r,this,m)}}return cv=n,cv}var uv,KE;function xY(){if(KE)return uv;KE=1;var e=Rb(),t=bP(),n=fi(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return uv=r,uv}var dv,GE;function wY(){if(GE)return dv;GE=1;var e=800,t=16,n=Date.now;function r(s){var o=0,a=0;return function(){var c=n(),u=t-(c-a);if(a=c,u>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return dv=r,dv}var fv,YE;function r4(){if(YE)return fv;YE=1;var e=xY(),t=wY(),n=t(e);return fv=n,fv}var hv,XE;function xf(){if(XE)return hv;XE=1;var e=fi(),t=n4(),n=r4();function r(s,o){return n(t(s,o,e),s+"")}return hv=r,hv}var pv,QE;function s4(){if(QE)return pv;QE=1;function e(t,n,r,s){for(var o=t.length,a=r+(s?1:-1);s?a--:++a<o;)if(n(t[a],a,t))return a;return-1}return pv=e,pv}var mv,JE;function bY(){if(JE)return mv;JE=1;function e(t){return t!==t}return mv=e,mv}var gv,ZE;function SY(){if(ZE)return gv;ZE=1;function e(t,n,r){for(var s=r-1,o=t.length;++s<o;)if(t[s]===n)return s;return-1}return gv=e,gv}var yv,ej;function _Y(){if(ej)return yv;ej=1;var e=s4(),t=bY(),n=SY();function r(s,o,a){return o===o?n(s,o,a):e(s,t,a)}return yv=r,yv}var vv,tj;function kY(){if(tj)return vv;tj=1;var e=_Y();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return vv=t,vv}var xv,nj;function NY(){if(nj)return xv;nj=1;function e(t,n,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(n,t[s]))return!0;return!1}return xv=e,xv}var wv,rj;function CY(){if(rj)return wv;rj=1;function e(){}return wv=e,wv}var bv,sj;function EY(){if(sj)return bv;sj=1;var e=TP(),t=CY(),n=Mb(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return bv=s,bv}var Sv,ij;function jY(){if(ij)return Sv;ij=1;var e=FP(),t=kY(),n=NY(),r=BP(),s=EY(),o=Mb(),a=200;function c(u,d,m){var p=-1,g=t,v=u.length,b=!0,x=[],w=x;if(m)b=!1,g=n;else if(v>=a){var S=d?null:s(u);if(S)return o(S);b=!1,g=r,w=new e}else w=d?[]:x;e:for(;++p<v;){var N=u[p],k=d?d(N):N;if(N=m||N!==0?N:0,b&&k===k){for(var C=w.length;C--;)if(w[C]===k)continue e;d&&w.push(k),x.push(N)}else g(w,k,m)||(w!==x&&w.push(k),x.push(N))}return x}return Sv=c,Sv}var _v,oj;function i4(){if(oj)return _v;oj=1;var e=qr(),t=gr();function n(r){return t(r)&&e(r)}return _v=n,_v}var kv,aj;function AY(){if(aj)return kv;aj=1;var e=Pb(),t=xf(),n=jY(),r=i4(),s=t(function(o){return n(e(o,1,r,!0))});return kv=s,kv}var Nv,lj;function RY(){if(lj)return Nv;lj=1;var e=gf();function t(n,r){return e(r,function(s){return n[s]})}return Nv=t,Nv}var Cv,cj;function o4(){if(cj)return Cv;cj=1;var e=RY(),t=Ns();function n(r){return r==null?[]:e(r,t(r))}return Cv=n,Cv}var Ev,uj;function En(){if(uj)return Ev;uj=1;var e;if(typeof wb=="function")try{e={clone:DG(),constant:Rb(),each:qP(),filter:XP(),has:QP(),isArray:yt(),isEmpty:aY(),isFunction:ql(),isUndefined:JP(),keys:Ns(),map:e4(),reduce:t4(),size:mY(),transform:gY(),union:AY(),values:o4()}}catch{}return e||(e=window._),Ev=e,Ev}var jv,dj;function Lb(){if(dj)return jv;dj=1;var e=En();jv=s;var t="\0",n="\0",r="";function s(m){this._isDirected=e.has(m,"directed")?m.directed:!0,this._isMultigraph=e.has(m,"multigraph")?m.multigraph:!1,this._isCompound=e.has(m,"compound")?m.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(m){return this._label=m,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(m){return e.isFunction(m)||(m=e.constant(m)),this._defaultNodeLabelFn=m,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var m=this;return e.filter(this.nodes(),function(p){return e.isEmpty(m._in[p])})},s.prototype.sinks=function(){var m=this;return e.filter(this.nodes(),function(p){return e.isEmpty(m._out[p])})},s.prototype.setNodes=function(m,p){var g=arguments,v=this;return e.each(m,function(b){g.length>1?v.setNode(b,p):v.setNode(b)}),this},s.prototype.setNode=function(m,p){return e.has(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=p),this):(this._nodes[m]=arguments.length>1?p:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=n,this._children[m]={},this._children[n][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)},s.prototype.node=function(m){return this._nodes[m]},s.prototype.hasNode=function(m){return e.has(this._nodes,m)},s.prototype.removeNode=function(m){var p=this;if(e.has(this._nodes,m)){var g=function(v){p.removeEdge(p._edgeObjs[v])};delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],e.each(this.children(m),function(v){p.setParent(v)}),delete this._children[m]),e.each(e.keys(this._in[m]),g),delete this._in[m],delete this._preds[m],e.each(e.keys(this._out[m]),g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this},s.prototype.setParent=function(m,p){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(p))p=n;else{p+="";for(var g=p;!e.isUndefined(g);g=this.parent(g))if(g===m)throw new Error("Setting "+p+" as parent of "+m+" would create a cycle");this.setNode(p)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=p,this._children[p][m]=!0,this},s.prototype._removeFromParentsChildList=function(m){delete this._children[this._parent[m]][m]},s.prototype.parent=function(m){if(this._isCompound){var p=this._parent[m];if(p!==n)return p}},s.prototype.children=function(m){if(e.isUndefined(m)&&(m=n),this._isCompound){var p=this._children[m];if(p)return e.keys(p)}else{if(m===n)return this.nodes();if(this.hasNode(m))return[]}},s.prototype.predecessors=function(m){var p=this._preds[m];if(p)return e.keys(p)},s.prototype.successors=function(m){var p=this._sucs[m];if(p)return e.keys(p)},s.prototype.neighbors=function(m){var p=this.predecessors(m);if(p)return e.union(p,this.successors(m))},s.prototype.isLeaf=function(m){var p;return this.isDirected()?p=this.successors(m):p=this.neighbors(m),p.length===0},s.prototype.filterNodes=function(m){var p=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});p.setGraph(this.graph());var g=this;e.each(this._nodes,function(x,w){m(w)&&p.setNode(w,x)}),e.each(this._edgeObjs,function(x){p.hasNode(x.v)&&p.hasNode(x.w)&&p.setEdge(x,g.edge(x))});var v={};function b(x){var w=g.parent(x);return w===void 0||p.hasNode(w)?(v[x]=w,w):w in v?v[w]:b(w)}return this._isCompound&&e.each(p.nodes(),function(x){p.setParent(x,b(x))}),p},s.prototype.setDefaultEdgeLabel=function(m){return e.isFunction(m)||(m=e.constant(m)),this._defaultEdgeLabelFn=m,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(m,p){var g=this,v=arguments;return e.reduce(m,function(b,x){return v.length>1?g.setEdge(b,x,p):g.setEdge(b,x),x}),this},s.prototype.setEdge=function(){var m,p,g,v,b=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(m=x.v,p=x.w,g=x.name,arguments.length===2&&(v=arguments[1],b=!0)):(m=x,p=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),m=""+m,p=""+p,e.isUndefined(g)||(g=""+g);var w=c(this._isDirected,m,p,g);if(e.has(this._edgeLabels,w))return b&&(this._edgeLabels[w]=v),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(p),this._edgeLabels[w]=b?v:this._defaultEdgeLabelFn(m,p,g);var S=u(this._isDirected,m,p,g);return m=S.v,p=S.w,Object.freeze(S),this._edgeObjs[w]=S,o(this._preds[p],m),o(this._sucs[m],p),this._in[p][w]=S,this._out[m][w]=S,this._edgeCount++,this},s.prototype.edge=function(m,p,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,m,p,g);return this._edgeLabels[v]},s.prototype.hasEdge=function(m,p,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,m,p,g);return e.has(this._edgeLabels,v)},s.prototype.removeEdge=function(m,p,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,m,p,g),b=this._edgeObjs[v];return b&&(m=b.v,p=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[p],m),a(this._sucs[m],p),delete this._in[p][v],delete this._out[m][v],this._edgeCount--),this},s.prototype.inEdges=function(m,p){var g=this._in[m];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.v===p}):v}},s.prototype.outEdges=function(m,p){var g=this._out[m];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.w===p}):v}},s.prototype.nodeEdges=function(m,p){var g=this.inEdges(m,p);if(g)return g.concat(this.outEdges(m,p))};function o(m,p){m[p]?m[p]++:m[p]=1}function a(m,p){--m[p]||delete m[p]}function c(m,p,g,v){var b=""+p,x=""+g;if(!m&&b>x){var w=b;b=x,x=w}return b+r+x+r+(e.isUndefined(v)?t:v)}function u(m,p,g,v){var b=""+p,x=""+g;if(!m&&b>x){var w=b;b=x,x=w}var S={v:b,w:x};return v&&(S.name=v),S}function d(m,p){return c(m,p.v,p.w,p.name)}return jv}var Av,fj;function TY(){return fj||(fj=1,Av="2.1.8"),Av}var Rv,hj;function IY(){return hj||(hj=1,Rv={Graph:Lb(),version:TY()}),Rv}var Tv,pj;function MY(){if(pj)return Tv;pj=1;var e=En(),t=Lb();Tv={write:n,read:o};function n(a){var c={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return e.isUndefined(a.graph())||(c.value=e.clone(a.graph())),c}function r(a){return e.map(a.nodes(),function(c){var u=a.node(c),d=a.parent(c),m={v:c};return e.isUndefined(u)||(m.value=u),e.isUndefined(d)||(m.parent=d),m})}function s(a){return e.map(a.edges(),function(c){var u=a.edge(c),d={v:c.v,w:c.w};return e.isUndefined(c.name)||(d.name=c.name),e.isUndefined(u)||(d.value=u),d})}function o(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(u){c.setNode(u.v,u.value),u.parent&&c.setParent(u.v,u.parent)}),e.each(a.edges,function(u){c.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),c}return Tv}var Iv,mj;function OY(){if(mj)return Iv;mj=1;var e=En();Iv=t;function t(n){var r={},s=[],o;function a(c){e.has(r,c)||(r[c]=!0,o.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){o=[],a(c),o.length&&s.push(o)}),s}return Iv}var Mv,gj;function a4(){if(gj)return Mv;gj=1;var e=En();Mv=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!e.has(s,n)){var o=this._arr,a=o.length;return s[n]=a,o.push({key:n,priority:r}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},t.prototype._heapify=function(n){var r=this._arr,s=2*n,o=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,o<r.length&&(a=r[o].priority<r[a].priority?o:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<s));)this._swap(n,o),n=o},t.prototype._swap=function(n,r){var s=this._arr,o=this._keyIndices,a=s[n],c=s[r];s[n]=c,s[r]=a,o[c.key]=n,o[a.key]=r},Mv}var Ov,yj;function l4(){if(yj)return Ov;yj=1;var e=En(),t=a4();Ov=r;var n=e.constant(1);function r(o,a,c,u){return s(o,String(a),c||n,u||function(d){return o.outEdges(d)})}function s(o,a,c,u){var d={},m=new t,p,g,v=function(b){var x=b.v!==p?b.v:b.w,w=d[x],S=c(b),N=g.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+S);N<w.distance&&(w.distance=N,w.predecessor=p,m.decrease(x,N))};for(o.nodes().forEach(function(b){var x=b===a?0:Number.POSITIVE_INFINITY;d[b]={distance:x},m.add(b,x)});m.size()>0&&(p=m.removeMin(),g=d[p],g.distance!==Number.POSITIVE_INFINITY);)u(p).forEach(v);return d}return Ov}var Pv,vj;function PY(){if(vj)return Pv;vj=1;var e=l4(),t=En();Pv=n;function n(r,s,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,o)},{})}return Pv}var Lv,xj;function c4(){if(xj)return Lv;xj=1;var e=En();Lv=t;function t(n){var r=0,s=[],o={},a=[];function c(u){var d=o[u]={onStack:!0,lowlink:r,index:r++};if(s.push(u),n.successors(u).forEach(function(g){e.has(o,g)?o[g].onStack&&(d.lowlink=Math.min(d.lowlink,o[g].index)):(c(g),d.lowlink=Math.min(d.lowlink,o[g].lowlink))}),d.lowlink===d.index){var m=[],p;do p=s.pop(),o[p].onStack=!1,m.push(p);while(u!==p);a.push(m)}}return n.nodes().forEach(function(u){e.has(o,u)||c(u)}),a}return Lv}var Dv,wj;function LY(){if(wj)return Dv;wj=1;var e=En(),t=c4();Dv=n;function n(r){return e.filter(t(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return Dv}var $v,bj;function DY(){if(bj)return $v;bj=1;var e=En();$v=n;var t=e.constant(1);function n(s,o,a){return r(s,o||t,a||function(c){return s.outEdges(c)})}function r(s,o,a){var c={},u=s.nodes();return u.forEach(function(d){c[d]={},c[d][d]={distance:0},u.forEach(function(m){d!==m&&(c[d][m]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(m){var p=m.v===d?m.w:m.v,g=o(m);c[d][p]={distance:g,predecessor:d}})}),u.forEach(function(d){var m=c[d];u.forEach(function(p){var g=c[p];u.forEach(function(v){var b=g[d],x=m[v],w=g[v],S=b.distance+x.distance;S<w.distance&&(w.distance=S,w.predecessor=x.predecessor)})})}),c}return $v}var qv,Sj;function u4(){if(Sj)return qv;Sj=1;var e=En();qv=t,t.CycleException=n;function t(r){var s={},o={},a=[];function c(u){if(e.has(o,u))throw new n;e.has(s,u)||(o[u]=!0,s[u]=!0,e.each(r.predecessors(u),c),delete o[u],a.push(u))}if(e.each(r.sinks(),c),e.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,qv}var Fv,_j;function $Y(){if(_j)return Fv;_j=1;var e=u4();Fv=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Fv}var Bv,kj;function d4(){if(kj)return Bv;kj=1;var e=En();Bv=t;function t(r,s,o){e.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],u={};return e.each(s,function(d){if(!r.hasNode(d))throw new Error("Graph does not have node: "+d);n(r,d,o==="post",u,a,c)}),c}function n(r,s,o,a,c,u){e.has(a,s)||(a[s]=!0,o||u.push(s),e.each(c(s),function(d){n(r,d,o,a,c,u)}),o&&u.push(s))}return Bv}var zv,Nj;function qY(){if(Nj)return zv;Nj=1;var e=d4();zv=t;function t(n,r){return e(n,r,"post")}return zv}var Vv,Cj;function FY(){if(Cj)return Vv;Cj=1;var e=d4();Vv=t;function t(n,r){return e(n,r,"pre")}return Vv}var Uv,Ej;function BY(){if(Ej)return Uv;Ej=1;var e=En(),t=Lb(),n=a4();Uv=r;function r(s,o){var a=new t,c={},u=new n,d;function m(g){var v=g.v===d?g.w:g.v,b=u.priority(v);if(b!==void 0){var x=o(g);x<b&&(c[v]=d,u.decrease(v,x))}}if(s.nodeCount()===0)return a;e.each(s.nodes(),function(g){u.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),u.decrease(s.nodes()[0],0);for(var p=!1;u.size()>0;){if(d=u.removeMin(),e.has(c,d))a.setEdge(d,c[d]);else{if(p)throw new Error("Input graph is not connected: "+s);p=!0}s.nodeEdges(d).forEach(m)}return a}return Uv}var Hv,jj;function zY(){return jj||(jj=1,Hv={components:OY(),dijkstra:l4(),dijkstraAll:PY(),findCycles:LY(),floydWarshall:DY(),isAcyclic:$Y(),postorder:qY(),preorder:FY(),prim:BY(),tarjan:c4(),topsort:u4()}),Hv}var Wv,Aj;function VY(){if(Aj)return Wv;Aj=1;var e=IY();return Wv={Graph:e.Graph,json:MY(),alg:zY(),version:e.version},Wv}var Kv,Rj;function Vn(){if(Rj)return Kv;Rj=1;var e;if(typeof wb=="function")try{e=VY()}catch{}return e||(e=window.graphlib),Kv=e,Kv}var Gv,Tj;function UY(){if(Tj)return Gv;Tj=1;var e=LP(),t=1,n=4;function r(s){return e(s,t|n)}return Gv=r,Gv}var Yv,Ij;function wf(){if(Ij)return Yv;Ij=1;var e=Io(),t=qr(),n=df(),r=Cn();function s(o,a,c){if(!r(c))return!1;var u=typeof a;return(u=="number"?t(c)&&n(a,c.length):u=="string"&&a in c)?e(c[a],o):!1}return Yv=s,Yv}var Xv,Mj;function HY(){if(Mj)return Xv;Mj=1;var e=xf(),t=Io(),n=wf(),r=di(),s=Object.prototype,o=s.hasOwnProperty,a=e(function(c,u){c=Object(c);var d=-1,m=u.length,p=m>2?u[2]:void 0;for(p&&n(u[0],u[1],p)&&(m=1);++d<m;)for(var g=u[d],v=r(g),b=-1,x=v.length;++b<x;){var w=v[b],S=c[w];(S===void 0||t(S,s[w])&&!o.call(c,w))&&(c[w]=g[w])}return c});return Xv=a,Xv}var Qv,Oj;function WY(){if(Oj)return Qv;Oj=1;var e=Fr(),t=qr(),n=Ns();function r(s){return function(o,a,c){var u=Object(o);if(!t(o)){var d=e(a,3);o=n(o),a=function(p){return d(u[p],p,u)}}var m=s(o,a,c);return m>-1?u[d?o[m]:m]:void 0}}return Qv=r,Qv}var Jv,Pj;function KY(){if(Pj)return Jv;Pj=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Jv=t,Jv}var Zv,Lj;function GY(){if(Lj)return Zv;Lj=1;var e=KY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Zv=n,Zv}var e0,Dj;function YY(){if(Dj)return e0;Dj=1;var e=GY(),t=Cn(),n=Lo(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function u(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var p=o.test(d);return p||a.test(d)?c(d.slice(2),p?2:8):s.test(d)?r:+d}return e0=u,e0}var t0,$j;function f4(){if($j)return t0;$j=1;var e=YY(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*n}return s===s?s:0}return t0=r,t0}var n0,qj;function XY(){if(qj)return n0;qj=1;var e=f4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return n0=t,n0}var r0,Fj;function QY(){if(Fj)return r0;Fj=1;var e=s4(),t=Fr(),n=XY(),r=Math.max;function s(o,a,c){var u=o==null?0:o.length;if(!u)return-1;var d=c==null?0:n(c);return d<0&&(d=r(u+d,0)),e(o,t(a,3),d)}return r0=s,r0}var s0,Bj;function JY(){if(Bj)return s0;Bj=1;var e=WY(),t=QY(),n=e(t);return s0=n,s0}var i0,zj;function h4(){if(zj)return i0;zj=1;var e=Pb();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return i0=t,i0}var o0,Vj;function ZY(){if(Vj)return o0;Vj=1;var e=Tb(),t=DP(),n=di();function r(s,o){return s==null?s:e(s,t(o),n)}return o0=r,o0}var a0,Uj;function eX(){if(Uj)return a0;Uj=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return a0=e,a0}var l0,Hj;function tX(){if(Hj)return l0;Hj=1;var e=cf(),t=Ib(),n=Fr();function r(s,o){var a={};return o=n(o,3),t(s,function(c,u,d){e(a,u,o(c,u,d))}),a}return l0=r,l0}var c0,Wj;function Db(){if(Wj)return c0;Wj=1;var e=Lo();function t(n,r,s){for(var o=-1,a=n.length;++o<a;){var c=n[o],u=r(c);if(u!=null&&(d===void 0?u===u&&!e(u):s(u,d)))var d=u,m=c}return m}return c0=t,c0}var u0,Kj;function nX(){if(Kj)return u0;Kj=1;function e(t,n){return t>n}return u0=e,u0}var d0,Gj;function rX(){if(Gj)return d0;Gj=1;var e=Db(),t=nX(),n=fi();function r(s){return s&&s.length?e(s,n,t):void 0}return d0=r,d0}var f0,Yj;function p4(){if(Yj)return f0;Yj=1;var e=cf(),t=Io();function n(r,s,o){(o!==void 0&&!t(r[s],o)||o===void 0&&!(s in r))&&e(r,s,o)}return f0=n,f0}var h0,Xj;function sX(){if(Xj)return h0;Xj=1;var e=ci(),t=pf(),n=gr(),r="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,c=o.hasOwnProperty,u=a.call(Object);function d(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}return h0=d,h0}var p0,Qj;function m4(){if(Qj)return p0;Qj=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return p0=e,p0}var m0,Jj;function iX(){if(Jj)return m0;Jj=1;var e=Fl(),t=di();function n(r){return e(r,t(r))}return m0=n,m0}var g0,Zj;function oX(){if(Zj)return g0;Zj=1;var e=p4(),t=kP(),n=MP(),r=NP(),s=PP(),o=Bl(),a=yt(),c=i4(),u=Oo(),d=ql(),m=Cn(),p=sX(),g=zl(),v=m4(),b=iX();function x(w,S,N,k,C,j,R){var T=v(w,N),M=v(S,N),P=R.get(M);if(P){e(w,N,P);return}var B=j?j(T,M,N+"",w,S,R):void 0,O=B===void 0;if(O){var $=a(M),U=!$&&u(M),D=!$&&!U&&g(M);B=M,$||U||D?a(T)?B=T:c(T)?B=r(T):U?(O=!1,B=t(M,!0)):D?(O=!1,B=n(M,!0)):B=[]:p(M)||o(M)?(B=T,o(T)?B=b(T):(!m(T)||d(T))&&(B=s(M))):O=!1}O&&(R.set(M,B),C(B,M,k,j,R),R.delete(M)),e(w,N,B)}return g0=x,g0}var y0,eA;function aX(){if(eA)return y0;eA=1;var e=lf(),t=p4(),n=Tb(),r=oX(),s=Cn(),o=di(),a=m4();function c(u,d,m,p,g){u!==d&&n(d,function(v,b){if(g||(g=new e),s(v))r(u,d,b,m,c,p,g);else{var x=p?p(a(u,b),v,b+"",u,d,g):void 0;x===void 0&&(x=v),t(u,b,x)}},o)}return y0=c,y0}var v0,tA;function lX(){if(tA)return v0;tA=1;var e=xf(),t=wf();function n(r){return e(function(s,o){var a=-1,c=o.length,u=c>1?o[c-1]:void 0,d=c>2?o[2]:void 0;for(u=r.length>3&&typeof u=="function"?(c--,u):void 0,d&&t(o[0],o[1],d)&&(u=c<3?void 0:u,c=1),s=Object(s);++a<c;){var m=o[a];m&&r(s,m,a,u)}return s})}return v0=n,v0}var x0,nA;function cX(){if(nA)return x0;nA=1;var e=aX(),t=lX(),n=t(function(r,s,o){e(r,s,o)});return x0=n,x0}var w0,rA;function g4(){if(rA)return w0;rA=1;function e(t,n){return t<n}return w0=e,w0}var b0,sA;function uX(){if(sA)return b0;sA=1;var e=Db(),t=g4(),n=fi();function r(s){return s&&s.length?e(s,n,t):void 0}return b0=r,b0}var S0,iA;function dX(){if(iA)return S0;iA=1;var e=Db(),t=Fr(),n=g4();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return S0=r,S0}var _0,oA;function fX(){if(oA)return _0;oA=1;var e=Gn(),t=function(){return e.Date.now()};return _0=t,_0}var k0,aA;function hX(){if(aA)return k0;aA=1;var e=uf(),t=yf(),n=df(),r=Cn(),s=Vl();function o(a,c,u,d){if(!r(a))return a;c=t(c,a);for(var m=-1,p=c.length,g=p-1,v=a;v!=null&&++m<p;){var b=s(c[m]),x=u;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(m!=g){var w=v[b];x=d?d(w,b,v):void 0,x===void 0&&(x=r(w)?w:n(c[m+1])?[]:{})}e(v,b,x),v=v[b]}return a}return k0=o,k0}var N0,lA;function pX(){if(lA)return N0;lA=1;var e=vf(),t=hX(),n=yf();function r(s,o,a){for(var c=-1,u=o.length,d={};++c<u;){var m=o[c],p=e(s,m);a(p,m)&&t(d,n(m,s),p)}return d}return N0=r,N0}var C0,cA;function mX(){if(cA)return C0;cA=1;var e=pX(),t=GP();function n(r,s){return e(r,s,function(o,a){return t(r,a)})}return C0=n,C0}var E0,uA;function gX(){if(uA)return E0;uA=1;var e=h4(),t=n4(),n=r4();function r(s){return n(t(s,void 0,e),s+"")}return E0=r,E0}var j0,dA;function yX(){if(dA)return j0;dA=1;var e=mX(),t=gX(),n=t(function(r,s){return r==null?{}:e(r,s)});return j0=n,j0}var A0,fA;function vX(){if(fA)return A0;fA=1;var e=Math.ceil,t=Math.max;function n(r,s,o,a){for(var c=-1,u=t(e((s-r)/(o||1)),0),d=Array(u);u--;)d[a?u:++c]=r,r+=o;return d}return A0=n,A0}var R0,hA;function xX(){if(hA)return R0;hA=1;var e=vX(),t=wf(),n=f4();function r(s){return function(o,a,c){return c&&typeof c!="number"&&t(o,a,c)&&(a=c=void 0),o=n(o),a===void 0?(a=o,o=0):a=n(a),c=c===void 0?o<a?1:-1:n(c),e(o,a,c,s)}}return R0=r,R0}var T0,pA;function wX(){if(pA)return T0;pA=1;var e=xX(),t=e();return T0=t,T0}var I0,mA;function bX(){if(mA)return I0;mA=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return I0=e,I0}var M0,gA;function SX(){if(gA)return M0;gA=1;var e=Lo();function t(n,r){if(n!==r){var s=n!==void 0,o=n===null,a=n===n,c=e(n),u=r!==void 0,d=r===null,m=r===r,p=e(r);if(!d&&!p&&!c&&n>r||c&&u&&m&&!d&&!p||o&&u&&m||!s&&m||!a)return 1;if(!o&&!c&&!p&&n<r||p&&s&&a&&!o&&!c||d&&s&&a||!u&&a||!m)return-1}return 0}return M0=t,M0}var O0,yA;function _X(){if(yA)return O0;yA=1;var e=SX();function t(n,r,s){for(var o=-1,a=n.criteria,c=r.criteria,u=a.length,d=s.length;++o<u;){var m=e(a[o],c[o]);if(m){if(o>=d)return m;var p=s[o];return m*(p=="desc"?-1:1)}}return n.index-r.index}return O0=t,O0}var P0,vA;function kX(){if(vA)return P0;vA=1;var e=gf(),t=vf(),n=Fr(),r=ZP(),s=bX(),o=ff(),a=_X(),c=fi(),u=yt();function d(m,p,g){p.length?p=e(p,function(x){return u(x)?function(w){return t(w,x.length===1?x[0]:x)}:x}):p=[c];var v=-1;p=e(p,o(n));var b=r(m,function(x,w,S){var N=e(p,function(k){return k(x)});return{criteria:N,index:++v,value:x}});return s(b,function(x,w){return a(x,w,g)})}return P0=d,P0}var L0,xA;function NX(){if(xA)return L0;xA=1;var e=Pb(),t=kX(),n=xf(),r=wf(),s=n(function(o,a){if(o==null)return[];var c=a.length;return c>1&&r(o,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return L0=s,L0}var D0,wA;function CX(){if(wA)return D0;wA=1;var e=WP(),t=0;function n(r){var s=++t;return e(r)+s}return D0=n,D0}var $0,bA;function EX(){if(bA)return $0;bA=1;function e(t,n,r){for(var s=-1,o=t.length,a=n.length,c={};++s<o;){var u=s<a?n[s]:void 0;r(c,t[s],u)}return c}return $0=e,$0}var q0,SA;function jX(){if(SA)return q0;SA=1;var e=uf(),t=EX();function n(r,s){return t(r||[],s||[],e)}return q0=n,q0}var F0,_A;function et(){if(_A)return F0;_A=1;var e;if(typeof wb=="function")try{e={cloneDeep:UY(),constant:Rb(),defaults:HY(),each:qP(),filter:XP(),find:JY(),flatten:h4(),forEach:$P(),forIn:ZY(),has:QP(),isUndefined:JP(),last:eX(),map:e4(),mapValues:tX(),max:rX(),merge:cX(),min:uX(),minBy:dX(),now:fX(),pick:yX(),range:wX(),reduce:t4(),sortBy:NX(),uniqueId:CX(),values:o4(),zipObject:jX()}}catch{}return e||(e=window._),F0=e,F0}var B0,kA;function AX(){if(kA)return B0;kA=1,B0=e;function e(){var r={};r._next=r._prev=r,this._sentinel=r}e.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return t(s),s},e.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&t(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},e.prototype.toString=function(){for(var r=[],s=this._sentinel,o=s._prev;o!==s;)r.push(JSON.stringify(o,n)),o=o._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return B0}var z0,NA;function RX(){if(NA)return z0;NA=1;var e=et(),t=Vn().Graph,n=AX();z0=s;var r=e.constant(1);function s(d,m){if(d.nodeCount()<=1)return[];var p=c(d,m||r),g=o(p.graph,p.buckets,p.zeroIdx);return e.flatten(e.map(g,function(v){return d.outEdges(v.v,v.w)}),!0)}function o(d,m,p){for(var g=[],v=m[m.length-1],b=m[0],x;d.nodeCount();){for(;x=b.dequeue();)a(d,m,p,x);for(;x=v.dequeue();)a(d,m,p,x);if(d.nodeCount()){for(var w=m.length-2;w>0;--w)if(x=m[w].dequeue(),x){g=g.concat(a(d,m,p,x,!0));break}}}return g}function a(d,m,p,g,v){var b=v?[]:void 0;return e.forEach(d.inEdges(g.v),function(x){var w=d.edge(x),S=d.node(x.v);v&&b.push({v:x.v,w:x.w}),S.out-=w,u(m,p,S)}),e.forEach(d.outEdges(g.v),function(x){var w=d.edge(x),S=x.w,N=d.node(S);N.in-=w,u(m,p,N)}),d.removeNode(g.v),b}function c(d,m){var p=new t,g=0,v=0;e.forEach(d.nodes(),function(w){p.setNode(w,{v:w,in:0,out:0})}),e.forEach(d.edges(),function(w){var S=p.edge(w.v,w.w)||0,N=m(w),k=S+N;p.setEdge(w.v,w.w,k),v=Math.max(v,p.node(w.v).out+=N),g=Math.max(g,p.node(w.w).in+=N)});var b=e.range(v+g+3).map(function(){return new n}),x=g+1;return e.forEach(p.nodes(),function(w){u(b,x,p.node(w))}),{graph:p,buckets:b,zeroIdx:x}}function u(d,m,p){p.out?p.in?d[p.out-p.in+m].enqueue(p):d[d.length-1].enqueue(p):d[0].enqueue(p)}return z0}var V0,CA;function TX(){if(CA)return V0;CA=1;var e=et(),t=RX();V0={run:n,undo:s};function n(o){var a=o.graph().acyclicer==="greedy"?t(o,c(o)):r(o);e.forEach(a,function(u){var d=o.edge(u);o.removeEdge(u),d.forwardName=u.name,d.reversed=!0,o.setEdge(u.w,u.v,d,e.uniqueId("rev"))});function c(u){return function(d){return u.edge(d).weight}}}function r(o){var a=[],c={},u={};function d(m){e.has(u,m)||(u[m]=!0,c[m]=!0,e.forEach(o.outEdges(m),function(p){e.has(c,p.w)?a.push(p):d(p.w)}),delete c[m])}return e.forEach(o.nodes(),d),a}function s(o){e.forEach(o.edges(),function(a){var c=o.edge(a);if(c.reversed){o.removeEdge(a);var u=c.forwardName;delete c.reversed,delete c.forwardName,o.setEdge(a.w,a.v,c,u)}})}return V0}var U0,EA;function Zt(){if(EA)return U0;EA=1;var e=et(),t=Vn().Graph;U0={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:u,normalizeRanks:d,removeEmptyRanks:m,addBorderNode:p,maxRank:g,partition:v,time:b,notime:x};function n(w,S,N,k){var C;do C=e.uniqueId(k);while(w.hasNode(C));return N.dummy=S,w.setNode(C,N),C}function r(w){var S=new t().setGraph(w.graph());return e.forEach(w.nodes(),function(N){S.setNode(N,w.node(N))}),e.forEach(w.edges(),function(N){var k=S.edge(N.v,N.w)||{weight:0,minlen:1},C=w.edge(N);S.setEdge(N.v,N.w,{weight:k.weight+C.weight,minlen:Math.max(k.minlen,C.minlen)})}),S}function s(w){var S=new t({multigraph:w.isMultigraph()}).setGraph(w.graph());return e.forEach(w.nodes(),function(N){w.children(N).length||S.setNode(N,w.node(N))}),e.forEach(w.edges(),function(N){S.setEdge(N,w.edge(N))}),S}function o(w){var S=e.map(w.nodes(),function(N){var k={};return e.forEach(w.outEdges(N),function(C){k[C.w]=(k[C.w]||0)+w.edge(C).weight}),k});return e.zipObject(w.nodes(),S)}function a(w){var S=e.map(w.nodes(),function(N){var k={};return e.forEach(w.inEdges(N),function(C){k[C.v]=(k[C.v]||0)+w.edge(C).weight}),k});return e.zipObject(w.nodes(),S)}function c(w,S){var N=w.x,k=w.y,C=S.x-N,j=S.y-k,R=w.width/2,T=w.height/2;if(!C&&!j)throw new Error("Not possible to find intersection inside of the rectangle");var M,P;return Math.abs(j)*R>Math.abs(C)*T?(j<0&&(T=-T),M=T*C/j,P=T):(C<0&&(R=-R),M=R,P=R*j/C),{x:N+M,y:k+P}}function u(w){var S=e.map(e.range(g(w)+1),function(){return[]});return e.forEach(w.nodes(),function(N){var k=w.node(N),C=k.rank;e.isUndefined(C)||(S[C][k.order]=N)}),S}function d(w){var S=e.min(e.map(w.nodes(),function(N){return w.node(N).rank}));e.forEach(w.nodes(),function(N){var k=w.node(N);e.has(k,"rank")&&(k.rank-=S)})}function m(w){var S=e.min(e.map(w.nodes(),function(j){return w.node(j).rank})),N=[];e.forEach(w.nodes(),function(j){var R=w.node(j).rank-S;N[R]||(N[R]=[]),N[R].push(j)});var k=0,C=w.graph().nodeRankFactor;e.forEach(N,function(j,R){e.isUndefined(j)&&R%C!==0?--k:k&&e.forEach(j,function(T){w.node(T).rank+=k})})}function p(w,S,N,k){var C={width:0,height:0};return arguments.length>=4&&(C.rank=N,C.order=k),n(w,"border",C,S)}function g(w){return e.max(e.map(w.nodes(),function(S){var N=w.node(S).rank;if(!e.isUndefined(N))return N}))}function v(w,S){var N={lhs:[],rhs:[]};return e.forEach(w,function(k){S(k)?N.lhs.push(k):N.rhs.push(k)}),N}function b(w,S){var N=e.now();try{return S()}finally{console.log(w+" time: "+(e.now()-N)+"ms")}}function x(w,S){return S()}return U0}var H0,jA;function IX(){if(jA)return H0;jA=1;var e=et(),t=Zt();H0={run:n,undo:s};function n(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){r(o,a)})}function r(o,a){var c=a.v,u=o.node(c).rank,d=a.w,m=o.node(d).rank,p=a.name,g=o.edge(a),v=g.labelRank;if(m!==u+1){o.removeEdge(a);var b,x,w;for(w=0,++u;u<m;++w,++u)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:a,rank:u},b=t.addDummyNode(o,"edge",x,"_d"),u===v&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),o.setEdge(c,b,{weight:g.weight},p),w===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,d,{weight:g.weight},p)}}function s(o){e.forEach(o.graph().dummyChains,function(a){var c=o.node(a),u=c.edgeLabel,d;for(o.setEdge(c.edgeObj,u);c.dummy;)d=o.successors(a)[0],o.removeNode(a),u.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(u.x=c.x,u.y=c.y,u.width=c.width,u.height=c.height),a=d,c=o.node(a)})}return H0}var W0,AA;function wd(){if(AA)return W0;AA=1;var e=et();W0={longestPath:t,slack:n};function t(r){var s={};function o(a){var c=r.node(a);if(e.has(s,a))return c.rank;s[a]=!0;var u=e.min(e.map(r.outEdges(a),function(d){return o(d.w)-r.edge(d).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),c.rank=u}e.forEach(r.sources(),o)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return W0}var K0,RA;function y4(){if(RA)return K0;RA=1;var e=et(),t=Vn().Graph,n=wd().slack;K0=r;function r(c){var u=new t({directed:!1}),d=c.nodes()[0],m=c.nodeCount();u.setNode(d,{});for(var p,g;s(u,c)<m;)p=o(u,c),g=u.hasNode(p.v)?n(c,p):-n(c,p),a(u,c,g);return u}function s(c,u){function d(m){e.forEach(u.nodeEdges(m),function(p){var g=p.v,v=m===g?p.w:g;!c.hasNode(v)&&!n(u,p)&&(c.setNode(v,{}),c.setEdge(m,v,{}),d(v))})}return e.forEach(c.nodes(),d),c.nodeCount()}function o(c,u){return e.minBy(u.edges(),function(d){if(c.hasNode(d.v)!==c.hasNode(d.w))return n(u,d)})}function a(c,u,d){e.forEach(c.nodes(),function(m){u.node(m).rank+=d})}return K0}var G0,TA;function MX(){if(TA)return G0;TA=1;var e=et(),t=y4(),n=wd().slack,r=wd().longestPath,s=Vn().alg.preorder,o=Vn().alg.postorder,a=Zt().simplify;G0=c,c.initLowLimValues=p,c.initCutValues=u,c.calcCutValue=m,c.leaveEdge=v,c.enterEdge=b,c.exchangeEdges=x;function c(k){k=a(k),r(k);var C=t(k);p(C),u(C,k);for(var j,R;j=v(C);)R=b(C,k,j),x(C,k,j,R)}function u(k,C){var j=o(k,k.nodes());j=j.slice(0,j.length-1),e.forEach(j,function(R){d(k,C,R)})}function d(k,C,j){var R=k.node(j),T=R.parent;k.edge(j,T).cutvalue=m(k,C,j)}function m(k,C,j){var R=k.node(j),T=R.parent,M=!0,P=C.edge(j,T),B=0;return P||(M=!1,P=C.edge(T,j)),B=P.weight,e.forEach(C.nodeEdges(j),function(O){var $=O.v===j,U=$?O.w:O.v;if(U!==T){var D=$===M,z=C.edge(O).weight;if(B+=D?z:-z,S(k,j,U)){var V=k.edge(j,U).cutvalue;B+=D?-V:V}}}),B}function p(k,C){arguments.length<2&&(C=k.nodes()[0]),g(k,{},1,C)}function g(k,C,j,R,T){var M=j,P=k.node(R);return C[R]=!0,e.forEach(k.neighbors(R),function(B){e.has(C,B)||(j=g(k,C,j,B,R))}),P.low=M,P.lim=j++,T?P.parent=T:delete P.parent,j}function v(k){return e.find(k.edges(),function(C){return k.edge(C).cutvalue<0})}function b(k,C,j){var R=j.v,T=j.w;C.hasEdge(R,T)||(R=j.w,T=j.v);var M=k.node(R),P=k.node(T),B=M,O=!1;M.lim>P.lim&&(B=P,O=!0);var $=e.filter(C.edges(),function(U){return O===N(k,k.node(U.v),B)&&O!==N(k,k.node(U.w),B)});return e.minBy($,function(U){return n(C,U)})}function x(k,C,j,R){var T=j.v,M=j.w;k.removeEdge(T,M),k.setEdge(R.v,R.w,{}),p(k),u(k,C),w(k,C)}function w(k,C){var j=e.find(k.nodes(),function(T){return!C.node(T).parent}),R=s(k,j);R=R.slice(1),e.forEach(R,function(T){var M=k.node(T).parent,P=C.edge(T,M),B=!1;P||(P=C.edge(M,T),B=!0),C.node(T).rank=C.node(M).rank+(B?P.minlen:-P.minlen)})}function S(k,C,j){return k.hasEdge(C,j)}function N(k,C,j){return j.low<=C.lim&&C.lim<=j.lim}return G0}var Y0,IA;function OX(){if(IA)return Y0;IA=1;var e=wd(),t=e.longestPath,n=y4(),r=MX();Y0=s;function s(u){switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":a(u);break;case"longest-path":o(u);break;default:c(u)}}var o=t;function a(u){t(u),n(u)}function c(u){r(u)}return Y0}var X0,MA;function PX(){if(MA)return X0;MA=1;var e=et();X0=t;function t(s){var o=r(s);e.forEach(s.graph().dummyChains,function(a){for(var c=s.node(a),u=c.edgeObj,d=n(s,o,u.v,u.w),m=d.path,p=d.lca,g=0,v=m[g],b=!0;a!==u.w;){if(c=s.node(a),b){for(;(v=m[g])!==p&&s.node(v).maxRank<c.rank;)g++;v===p&&(b=!1)}if(!b){for(;g<m.length-1&&s.node(v=m[g+1]).minRank<=c.rank;)g++;v=m[g]}s.setParent(a,v),a=s.successors(a)[0]}})}function n(s,o,a,c){var u=[],d=[],m=Math.min(o[a].low,o[c].low),p=Math.max(o[a].lim,o[c].lim),g,v;g=a;do g=s.parent(g),u.push(g);while(g&&(o[g].low>m||p>o[g].lim));for(v=g,g=c;(g=s.parent(g))!==v;)d.push(g);return{path:u.concat(d.reverse()),lca:v}}function r(s){var o={},a=0;function c(u){var d=a;e.forEach(s.children(u),c),o[u]={low:d,lim:a++}}return e.forEach(s.children(),c),o}return X0}var Q0,OA;function LX(){if(OA)return Q0;OA=1;var e=et(),t=Zt();Q0={run:n,cleanup:a};function n(c){var u=t.addDummyNode(c,"root",{},"_root"),d=s(c),m=e.max(e.values(d))-1,p=2*m+1;c.graph().nestingRoot=u,e.forEach(c.edges(),function(v){c.edge(v).minlen*=p});var g=o(c)+1;e.forEach(c.children(),function(v){r(c,u,p,g,m,d,v)}),c.graph().nodeRankFactor=p}function r(c,u,d,m,p,g,v){var b=c.children(v);if(!b.length){v!==u&&c.setEdge(u,v,{weight:0,minlen:d});return}var x=t.addBorderNode(c,"_bt"),w=t.addBorderNode(c,"_bb"),S=c.node(v);c.setParent(x,v),S.borderTop=x,c.setParent(w,v),S.borderBottom=w,e.forEach(b,function(N){r(c,u,d,m,p,g,N);var k=c.node(N),C=k.borderTop?k.borderTop:N,j=k.borderBottom?k.borderBottom:N,R=k.borderTop?m:2*m,T=C!==j?1:p-g[v]+1;c.setEdge(x,C,{weight:R,minlen:T,nestingEdge:!0}),c.setEdge(j,w,{weight:R,minlen:T,nestingEdge:!0})}),c.parent(v)||c.setEdge(u,x,{weight:0,minlen:p+g[v]})}function s(c){var u={};function d(m,p){var g=c.children(m);g&&g.length&&e.forEach(g,function(v){d(v,p+1)}),u[m]=p}return e.forEach(c.children(),function(m){d(m,1)}),u}function o(c){return e.reduce(c.edges(),function(u,d){return u+c.edge(d).weight},0)}function a(c){var u=c.graph();c.removeNode(u.nestingRoot),delete u.nestingRoot,e.forEach(c.edges(),function(d){var m=c.edge(d);m.nestingEdge&&c.removeEdge(d)})}return Q0}var J0,PA;function DX(){if(PA)return J0;PA=1;var e=et(),t=Zt();J0=n;function n(s){function o(a){var c=s.children(a),u=s.node(a);if(c.length&&e.forEach(c,o),e.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var d=u.minRank,m=u.maxRank+1;d<m;++d)r(s,"borderLeft","_bl",a,u,d),r(s,"borderRight","_br",a,u,d)}}e.forEach(s.children(),o)}function r(s,o,a,c,u,d){var m={width:0,height:0,rank:d,borderType:o},p=u[o][d-1],g=t.addDummyNode(s,"border",m,a);u[o][d]=g,s.setParent(g,c),p&&s.setEdge(p,g,{weight:1})}return J0}var Z0,LA;function $X(){if(LA)return Z0;LA=1;var e=et();Z0={adjust:t,undo:n};function t(d){var m=d.graph().rankdir.toLowerCase();(m==="lr"||m==="rl")&&r(d)}function n(d){var m=d.graph().rankdir.toLowerCase();(m==="bt"||m==="rl")&&o(d),(m==="lr"||m==="rl")&&(c(d),r(d))}function r(d){e.forEach(d.nodes(),function(m){s(d.node(m))}),e.forEach(d.edges(),function(m){s(d.edge(m))})}function s(d){var m=d.width;d.width=d.height,d.height=m}function o(d){e.forEach(d.nodes(),function(m){a(d.node(m))}),e.forEach(d.edges(),function(m){var p=d.edge(m);e.forEach(p.points,a),e.has(p,"y")&&a(p)})}function a(d){d.y=-d.y}function c(d){e.forEach(d.nodes(),function(m){u(d.node(m))}),e.forEach(d.edges(),function(m){var p=d.edge(m);e.forEach(p.points,u),e.has(p,"x")&&u(p)})}function u(d){var m=d.x;d.x=d.y,d.y=m}return Z0}var ex,DA;function qX(){if(DA)return ex;DA=1;var e=et();ex=t;function t(n){var r={},s=e.filter(n.nodes(),function(d){return!n.children(d).length}),o=e.max(e.map(s,function(d){return n.node(d).rank})),a=e.map(e.range(o+1),function(){return[]});function c(d){if(!e.has(r,d)){r[d]=!0;var m=n.node(d);a[m.rank].push(d),e.forEach(n.successors(d),c)}}var u=e.sortBy(s,function(d){return n.node(d).rank});return e.forEach(u,c),a}return ex}var tx,$A;function FX(){if($A)return tx;$A=1;var e=et();tx=t;function t(r,s){for(var o=0,a=1;a<s.length;++a)o+=n(r,s[a-1],s[a]);return o}function n(r,s,o){for(var a=e.zipObject(o,e.map(o,function(g,v){return v})),c=e.flatten(e.map(s,function(g){return e.sortBy(e.map(r.outEdges(g),function(v){return{pos:a[v.w],weight:r.edge(v).weight}}),"pos")}),!0),u=1;u<o.length;)u<<=1;var d=2*u-1;u-=1;var m=e.map(new Array(d),function(){return 0}),p=0;return e.forEach(c.forEach(function(g){var v=g.pos+u;m[v]+=g.weight;for(var b=0;v>0;)v%2&&(b+=m[v+1]),v=v-1>>1,m[v]+=g.weight;p+=g.weight*b})),p}return tx}var nx,qA;function BX(){if(qA)return nx;qA=1;var e=et();nx=t;function t(n,r){return e.map(r,function(s){var o=n.inEdges(s);if(o.length){var a=e.reduce(o,function(c,u){var d=n.edge(u),m=n.node(u.v);return{sum:c.sum+d.weight*m.order,weight:c.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return nx}var rx,FA;function zX(){if(FA)return rx;FA=1;var e=et();rx=t;function t(s,o){var a={};e.forEach(s,function(u,d){var m=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};e.isUndefined(u.barycenter)||(m.barycenter=u.barycenter,m.weight=u.weight)}),e.forEach(o.edges(),function(u){var d=a[u.v],m=a[u.w];!e.isUndefined(d)&&!e.isUndefined(m)&&(m.indegree++,d.out.push(a[u.w]))});var c=e.filter(a,function(u){return!u.indegree});return n(c)}function n(s){var o=[];function a(d){return function(m){m.merged||(e.isUndefined(m.barycenter)||e.isUndefined(d.barycenter)||m.barycenter>=d.barycenter)&&r(d,m)}}function c(d){return function(m){m.in.push(d),--m.indegree===0&&s.push(m)}}for(;s.length;){var u=s.pop();o.push(u),e.forEach(u.in.reverse(),a(u)),e.forEach(u.out,c(u))}return e.map(e.filter(o,function(d){return!d.merged}),function(d){return e.pick(d,["vs","i","barycenter","weight"])})}function r(s,o){var a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),o.weight&&(a+=o.barycenter*o.weight,c+=o.weight),s.vs=o.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(o.i,s.i),o.merged=!0}return rx}var sx,BA;function VX(){if(BA)return sx;BA=1;var e=et(),t=Zt();sx=n;function n(o,a){var c=t.partition(o,function(x){return e.has(x,"barycenter")}),u=c.lhs,d=e.sortBy(c.rhs,function(x){return-x.i}),m=[],p=0,g=0,v=0;u.sort(s(!!a)),v=r(m,d,v),e.forEach(u,function(x){v+=x.vs.length,m.push(x.vs),p+=x.barycenter*x.weight,g+=x.weight,v=r(m,d,v)});var b={vs:e.flatten(m,!0)};return g&&(b.barycenter=p/g,b.weight=g),b}function r(o,a,c){for(var u;a.length&&(u=e.last(a)).i<=c;)a.pop(),o.push(u.vs),c++;return c}function s(o){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:o?c.i-a.i:a.i-c.i}}return sx}var ix,zA;function UX(){if(zA)return ix;zA=1;var e=et(),t=BX(),n=zX(),r=VX();ix=s;function s(c,u,d,m){var p=c.children(u),g=c.node(u),v=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};v&&(p=e.filter(p,function(j){return j!==v&&j!==b}));var w=t(c,p);e.forEach(w,function(j){if(c.children(j.v).length){var R=s(c,j.v,d,m);x[j.v]=R,e.has(R,"barycenter")&&a(j,R)}});var S=n(w,d);o(S,x);var N=r(S,m);if(v&&(N.vs=e.flatten([v,N.vs,b],!0),c.predecessors(v).length)){var k=c.node(c.predecessors(v)[0]),C=c.node(c.predecessors(b)[0]);e.has(N,"barycenter")||(N.barycenter=0,N.weight=0),N.barycenter=(N.barycenter*N.weight+k.order+C.order)/(N.weight+2),N.weight+=2}return N}function o(c,u){e.forEach(c,function(d){d.vs=e.flatten(d.vs.map(function(m){return u[m]?u[m].vs:m}),!0)})}function a(c,u){e.isUndefined(c.barycenter)?(c.barycenter=u.barycenter,c.weight=u.weight):(c.barycenter=(c.barycenter*c.weight+u.barycenter*u.weight)/(c.weight+u.weight),c.weight+=u.weight)}return ix}var ox,VA;function HX(){if(VA)return ox;VA=1;var e=et(),t=Vn().Graph;ox=n;function n(s,o,a){var c=r(s),u=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(d){return s.node(d)});return e.forEach(s.nodes(),function(d){var m=s.node(d),p=s.parent(d);(m.rank===o||m.minRank<=o&&o<=m.maxRank)&&(u.setNode(d),u.setParent(d,p||c),e.forEach(s[a](d),function(g){var v=g.v===d?g.w:g.v,b=u.edge(v,d),x=e.isUndefined(b)?0:b.weight;u.setEdge(v,d,{weight:s.edge(g).weight+x})}),e.has(m,"minRank")&&u.setNode(d,{borderLeft:m.borderLeft[o],borderRight:m.borderRight[o]}))}),u}function r(s){for(var o;s.hasNode(o=e.uniqueId("_root")););return o}return ox}var ax,UA;function WX(){if(UA)return ax;UA=1;var e=et();ax=t;function t(n,r,s){var o={},a;e.forEach(s,function(c){for(var u=n.parent(c),d,m;u;){if(d=n.parent(u),d?(m=o[d],o[d]=u):(m=a,a=u),m&&m!==u){r.setEdge(m,u);return}u=d}})}return ax}var lx,HA;function KX(){if(HA)return lx;HA=1;var e=et(),t=qX(),n=FX(),r=UX(),s=HX(),o=WX(),a=Vn().Graph,c=Zt();lx=u;function u(g){var v=c.maxRank(g),b=d(g,e.range(1,v+1),"inEdges"),x=d(g,e.range(v-1,-1,-1),"outEdges"),w=t(g);p(g,w);for(var S=Number.POSITIVE_INFINITY,N,k=0,C=0;C<4;++k,++C){m(k%2?b:x,k%4>=2),w=c.buildLayerMatrix(g);var j=n(g,w);j<S&&(C=0,N=e.cloneDeep(w),S=j)}p(g,N)}function d(g,v,b){return e.map(v,function(x){return s(g,x,b)})}function m(g,v){var b=new a;e.forEach(g,function(x){var w=x.graph().root,S=r(x,w,b,v);e.forEach(S.vs,function(N,k){x.node(N).order=k}),o(x,b,S.vs)})}function p(g,v){e.forEach(v,function(b){e.forEach(b,function(x,w){g.node(x).order=w})})}return lx}var cx,WA;function GX(){if(WA)return cx;WA=1;var e=et(),t=Vn().Graph,n=Zt();cx={positionX:b,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:g,findSmallestWidthAlignment:p,balance:v};function r(S,N){var k={};function C(j,R){var T=0,M=0,P=j.length,B=e.last(R);return e.forEach(R,function(O,$){var U=o(S,O),D=U?S.node(U).order:P;(U||O===B)&&(e.forEach(R.slice(M,$+1),function(z){e.forEach(S.predecessors(z),function(V){var Y=S.node(V),F=Y.order;(F<T||D<F)&&!(Y.dummy&&S.node(z).dummy)&&a(k,V,z)})}),M=$+1,T=D)}),R}return e.reduce(N,C),k}function s(S,N){var k={};function C(R,T,M,P,B){var O;e.forEach(e.range(T,M),function($){O=R[$],S.node(O).dummy&&e.forEach(S.predecessors(O),function(U){var D=S.node(U);D.dummy&&(D.order<P||D.order>B)&&a(k,U,O)})})}function j(R,T){var M=-1,P,B=0;return e.forEach(T,function(O,$){if(S.node(O).dummy==="border"){var U=S.predecessors(O);U.length&&(P=S.node(U[0]).order,C(T,B,$,M,P),B=$,M=P)}C(T,B,T.length,P,R.length)}),T}return e.reduce(N,j),k}function o(S,N){if(S.node(N).dummy)return e.find(S.predecessors(N),function(k){return S.node(k).dummy})}function a(S,N,k){if(N>k){var C=N;N=k,k=C}var j=S[N];j||(S[N]=j={}),j[k]=!0}function c(S,N,k){if(N>k){var C=N;N=k,k=C}return e.has(S[N],k)}function u(S,N,k,C){var j={},R={},T={};return e.forEach(N,function(M){e.forEach(M,function(P,B){j[P]=P,R[P]=P,T[P]=B})}),e.forEach(N,function(M){var P=-1;e.forEach(M,function(B){var O=C(B);if(O.length){O=e.sortBy(O,function(V){return T[V]});for(var $=(O.length-1)/2,U=Math.floor($),D=Math.ceil($);U<=D;++U){var z=O[U];R[B]===B&&P<T[z]&&!c(k,B,z)&&(R[z]=B,R[B]=j[B]=j[z],P=T[z])}}})}),{root:j,align:R}}function d(S,N,k,C,j){var R={},T=m(S,N,k,j),M=j?"borderLeft":"borderRight";function P($,U){for(var D=T.nodes(),z=D.pop(),V={};z;)V[z]?$(z):(V[z]=!0,D.push(z),D=D.concat(U(z))),z=D.pop()}function B($){R[$]=T.inEdges($).reduce(function(U,D){return Math.max(U,R[D.v]+T.edge(D))},0)}function O($){var U=T.outEdges($).reduce(function(z,V){return Math.min(z,R[V.w]-T.edge(V))},Number.POSITIVE_INFINITY),D=S.node($);U!==Number.POSITIVE_INFINITY&&D.borderType!==M&&(R[$]=Math.max(R[$],U))}return P(B,T.predecessors.bind(T)),P(O,T.successors.bind(T)),e.forEach(C,function($){R[$]=R[k[$]]}),R}function m(S,N,k,C){var j=new t,R=S.graph(),T=x(R.nodesep,R.edgesep,C);return e.forEach(N,function(M){var P;e.forEach(M,function(B){var O=k[B];if(j.setNode(O),P){var $=k[P],U=j.edge($,O);j.setEdge($,O,Math.max(T(S,B,P),U||0))}P=B})}),j}function p(S,N){return e.minBy(e.values(N),function(k){var C=Number.NEGATIVE_INFINITY,j=Number.POSITIVE_INFINITY;return e.forIn(k,function(R,T){var M=w(S,T)/2;C=Math.max(R+M,C),j=Math.min(R-M,j)}),C-j})}function g(S,N){var k=e.values(N),C=e.min(k),j=e.max(k);e.forEach(["u","d"],function(R){e.forEach(["l","r"],function(T){var M=R+T,P=S[M],B;if(P!==N){var O=e.values(P);B=T==="l"?C-e.min(O):j-e.max(O),B&&(S[M]=e.mapValues(P,function($){return $+B}))}})})}function v(S,N){return e.mapValues(S.ul,function(k,C){if(N)return S[N.toLowerCase()][C];var j=e.sortBy(e.map(S,C));return(j[1]+j[2])/2})}function b(S){var N=n.buildLayerMatrix(S),k=e.merge(r(S,N),s(S,N)),C={},j;e.forEach(["u","d"],function(T){j=T==="u"?N:e.values(N).reverse(),e.forEach(["l","r"],function(M){M==="r"&&(j=e.map(j,function($){return e.values($).reverse()}));var P=(T==="u"?S.predecessors:S.successors).bind(S),B=u(S,j,k,P),O=d(S,j,B.root,B.align,M==="r");M==="r"&&(O=e.mapValues(O,function($){return-$})),C[T+M]=O})});var R=p(S,C);return g(C,R),v(C,S.graph().align)}function x(S,N,k){return function(C,j,R){var T=C.node(j),M=C.node(R),P=0,B;if(P+=T.width/2,e.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":B=-T.width/2;break;case"r":B=T.width/2;break}if(B&&(P+=k?B:-B),B=0,P+=(T.dummy?N:S)/2,P+=(M.dummy?N:S)/2,P+=M.width/2,e.has(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":B=M.width/2;break;case"r":B=-M.width/2;break}return B&&(P+=k?B:-B),B=0,P}}function w(S,N){return S.node(N).width}return cx}var ux,KA;function YX(){if(KA)return ux;KA=1;var e=et(),t=Zt(),n=GX().positionX;ux=r;function r(o){o=t.asNonCompoundGraph(o),s(o),e.forEach(n(o),function(a,c){o.node(c).x=a})}function s(o){var a=t.buildLayerMatrix(o),c=o.graph().ranksep,u=0;e.forEach(a,function(d){var m=e.max(e.map(d,function(p){return o.node(p).height}));e.forEach(d,function(p){o.node(p).y=u+m/2}),u+=m+c})}return ux}var dx,GA;function XX(){if(GA)return dx;GA=1;var e=et(),t=TX(),n=IX(),r=OX(),s=Zt().normalizeRanks,o=PX(),a=Zt().removeEmptyRanks,c=LX(),u=DX(),d=$X(),m=KX(),p=YX(),g=Zt(),v=Vn().Graph;dx=b;function b(K,J){var te=J&&J.debugTiming?g.time:g.notime;te("layout",function(){var X=te(" buildLayoutGraph",function(){return P(K)});te(" runLayout",function(){x(X,te)}),te(" updateInputGraph",function(){w(K,X)})})}function x(K,J){J(" makeSpaceForEdgeLabels",function(){B(K)}),J(" removeSelfEdges",function(){q(K)}),J(" acyclic",function(){t.run(K)}),J(" nestingGraph.run",function(){c.run(K)}),J(" rank",function(){r(g.asNonCompoundGraph(K))}),J(" injectEdgeLabelProxies",function(){O(K)}),J(" removeEmptyRanks",function(){a(K)}),J(" nestingGraph.cleanup",function(){c.cleanup(K)}),J(" normalizeRanks",function(){s(K)}),J(" assignRankMinMax",function(){$(K)}),J(" removeEdgeLabelProxies",function(){U(K)}),J(" normalize.run",function(){n.run(K)}),J(" parentDummyChains",function(){o(K)}),J(" addBorderSegments",function(){u(K)}),J(" order",function(){m(K)}),J(" insertSelfEdges",function(){G(K)}),J(" adjustCoordinateSystem",function(){d.adjust(K)}),J(" position",function(){p(K)}),J(" positionSelfEdges",function(){L(K)}),J(" removeBorderNodes",function(){F(K)}),J(" normalize.undo",function(){n.undo(K)}),J(" fixupEdgeLabelCoords",function(){V(K)}),J(" undoCoordinateSystem",function(){d.undo(K)}),J(" translateGraph",function(){D(K)}),J(" assignNodeIntersects",function(){z(K)}),J(" reversePoints",function(){Y(K)}),J(" acyclic.undo",function(){t.undo(K)})}function w(K,J){e.forEach(K.nodes(),function(te){var X=K.node(te),ee=J.node(te);X&&(X.x=ee.x,X.y=ee.y,J.children(te).length&&(X.width=ee.width,X.height=ee.height))}),e.forEach(K.edges(),function(te){var X=K.edge(te),ee=J.edge(te);X.points=ee.points,e.has(ee,"x")&&(X.x=ee.x,X.y=ee.y)}),K.graph().width=J.graph().width,K.graph().height=J.graph().height}var S=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],C=["width","height"],j={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function P(K){var J=new v({multigraph:!0,compound:!0}),te=oe(K.graph());return J.setGraph(e.merge({},N,W(te,S),e.pick(te,k))),e.forEach(K.nodes(),function(X){var ee=oe(K.node(X));J.setNode(X,e.defaults(W(ee,C),j)),J.setParent(X,K.parent(X))}),e.forEach(K.edges(),function(X){var ee=oe(K.edge(X));J.setEdge(X,e.merge({},T,W(ee,R),e.pick(ee,M)))}),J}function B(K){var J=K.graph();J.ranksep/=2,e.forEach(K.edges(),function(te){var X=K.edge(te);X.minlen*=2,X.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?X.width+=X.labeloffset:X.height+=X.labeloffset)})}function O(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(te.width&&te.height){var X=K.node(J.v),ee=K.node(J.w),ie={rank:(ee.rank-X.rank)/2+X.rank,e:J};g.addDummyNode(K,"edge-proxy",ie,"_ep")}})}function $(K){var J=0;e.forEach(K.nodes(),function(te){var X=K.node(te);X.borderTop&&(X.minRank=K.node(X.borderTop).rank,X.maxRank=K.node(X.borderBottom).rank,J=e.max(J,X.maxRank))}),K.graph().maxRank=J}function U(K){e.forEach(K.nodes(),function(J){var te=K.node(J);te.dummy==="edge-proxy"&&(K.edge(te.e).labelRank=te.rank,K.removeNode(J))})}function D(K){var J=Number.POSITIVE_INFINITY,te=0,X=Number.POSITIVE_INFINITY,ee=0,ie=K.graph(),ue=ie.marginx||0,me=ie.marginy||0;function ye(pe){var _e=pe.x,xe=pe.y,Ce=pe.width,Ne=pe.height;J=Math.min(J,_e-Ce/2),te=Math.max(te,_e+Ce/2),X=Math.min(X,xe-Ne/2),ee=Math.max(ee,xe+Ne/2)}e.forEach(K.nodes(),function(pe){ye(K.node(pe))}),e.forEach(K.edges(),function(pe){var _e=K.edge(pe);e.has(_e,"x")&&ye(_e)}),J-=ue,X-=me,e.forEach(K.nodes(),function(pe){var _e=K.node(pe);_e.x-=J,_e.y-=X}),e.forEach(K.edges(),function(pe){var _e=K.edge(pe);e.forEach(_e.points,function(xe){xe.x-=J,xe.y-=X}),e.has(_e,"x")&&(_e.x-=J),e.has(_e,"y")&&(_e.y-=X)}),ie.width=te-J+ue,ie.height=ee-X+me}function z(K){e.forEach(K.edges(),function(J){var te=K.edge(J),X=K.node(J.v),ee=K.node(J.w),ie,ue;te.points?(ie=te.points[0],ue=te.points[te.points.length-1]):(te.points=[],ie=ee,ue=X),te.points.unshift(g.intersectRect(X,ie)),te.points.push(g.intersectRect(ee,ue))})}function V(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(e.has(te,"x"))switch((te.labelpos==="l"||te.labelpos==="r")&&(te.width-=te.labeloffset),te.labelpos){case"l":te.x-=te.width/2+te.labeloffset;break;case"r":te.x+=te.width/2+te.labeloffset;break}})}function Y(K){e.forEach(K.edges(),function(J){var te=K.edge(J);te.reversed&&te.points.reverse()})}function F(K){e.forEach(K.nodes(),function(J){if(K.children(J).length){var te=K.node(J),X=K.node(te.borderTop),ee=K.node(te.borderBottom),ie=K.node(e.last(te.borderLeft)),ue=K.node(e.last(te.borderRight));te.width=Math.abs(ue.x-ie.x),te.height=Math.abs(ee.y-X.y),te.x=ie.x+te.width/2,te.y=X.y+te.height/2}}),e.forEach(K.nodes(),function(J){K.node(J).dummy==="border"&&K.removeNode(J)})}function q(K){e.forEach(K.edges(),function(J){if(J.v===J.w){var te=K.node(J.v);te.selfEdges||(te.selfEdges=[]),te.selfEdges.push({e:J,label:K.edge(J)}),K.removeEdge(J)}})}function G(K){var J=g.buildLayerMatrix(K);e.forEach(J,function(te){var X=0;e.forEach(te,function(ee,ie){var ue=K.node(ee);ue.order=ie+X,e.forEach(ue.selfEdges,function(me){g.addDummyNode(K,"selfedge",{width:me.label.width,height:me.label.height,rank:ue.rank,order:ie+ ++X,e:me.e,label:me.label},"_se")}),delete ue.selfEdges})})}function L(K){e.forEach(K.nodes(),function(J){var te=K.node(J);if(te.dummy==="selfedge"){var X=K.node(te.e.v),ee=X.x+X.width/2,ie=X.y,ue=te.x-ee,me=X.height/2;K.setEdge(te.e,te.label),K.removeNode(J),te.label.points=[{x:ee+2*ue/3,y:ie-me},{x:ee+5*ue/6,y:ie-me},{x:ee+ue,y:ie},{x:ee+5*ue/6,y:ie+me},{x:ee+2*ue/3,y:ie+me}],te.label.x=te.x,te.label.y=te.y}})}function W(K,J){return e.mapValues(e.pick(K,J),Number)}function oe(K){var J={};return e.forEach(K,function(te,X){J[X.toLowerCase()]=te}),J}return dx}var fx,YA;function QX(){if(YA)return fx;YA=1;var e=et(),t=Zt(),n=Vn().Graph;fx={debugOrdering:r};function r(s){var o=t.buildLayerMatrix(s),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(s.nodes(),function(c){a.setNode(c,{label:c}),a.setParent(c,"layer"+s.node(c).rank)}),e.forEach(s.edges(),function(c){a.setEdge(c.v,c.w,{},c.name)}),e.forEach(o,function(c,u){var d="layer"+u;a.setNode(d,{rank:"same"}),e.reduce(c,function(m,p){return a.setEdge(m,p,{style:"invis"}),p})}),a}return fx}var hx,XA;function JX(){return XA||(XA=1,hx="0.8.5"),hx}var px,QA;function ZX(){return QA||(QA=1,px={graphlib:Vn(),layout:XX(),debug:QX(),util:{time:Zt().time,notime:Zt().notime},version:JX()}),px}var eQ=ZX();const JA=gl(eQ);function v4(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:o}=xo(),a=_o(),c=A.useMemo(()=>e.filter(O=>O.selected),[e]),u=A.useMemo(()=>t.filter(O=>O.selected),[t]),d=A.useCallback(O=>e.find($=>$.id===O),[e]),m=A.useCallback(O=>t.find($=>$.id===O),[t]),p=A.useCallback(O=>{n([...e,O])},[e,n]),g=A.useCallback(O=>{n(e.filter($=>$.id!==O)),r(t.filter($=>$.source!==O&&$.target!==O))},[e,t,n,r]),v=A.useCallback(()=>{const O=[],$=new Map;for(const D of c){const z=`${D.id}-copy-${Date.now()}`;$.set(D.id,z),O.push({...D,id:z,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:z}})}n([...e,...O]);const U=[];for(const D of t)$.has(D.source)&&$.has(D.target)&&U.push({...D,id:`${D.id}-copy-${Date.now()}`,source:$.get(D.source),target:$.get(D.target)});U.length>0&&r([...t,...U])},[c,e,t,n,r]),b=A.useCallback(()=>{const O=new Set(c.map(U=>U.id)),$=new Set(u.map(U=>U.id));n(e.filter(U=>!O.has(U.id))),r(t.filter(U=>!$.has(U.id)&&!O.has(U.source)&&!O.has(U.target)))},[c,u,e,t,n,r]),x=A.useCallback(()=>{const O=new JA.graphlib.Graph;O.setDefaultEdgeLabel(()=>({})),O.setGraph({rankdir:"TB",nodesep:50,ranksep:80});for(const U of e)O.setNode(U.id,{width:200,height:100});for(const U of t)O.setEdge(U.source,U.target);JA.layout(O);const $=e.map(U=>{const D=O.node(U.id);return{...U,position:{x:D.x-100,y:D.y-50}}});n($),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),w=A.useCallback(()=>{a.fitView({padding:.2})},[a]),S=A.useCallback(O=>{const $=d(O);$&&a.setCenter($.position.x+100,$.position.y+50,{zoom:1.5,duration:300})},[d,a]),N=A.useCallback((O,$=!1)=>{n(e.map(U=>({...U,selected:$&&U.selected||U.id===O})))},[e,n]),k=A.useCallback(()=>{n(e.map(O=>({...O,selected:!1}))),r(t.map(O=>({...O,selected:!1})))},[e,t,n,r]),{undo:C,redo:j,canUndo:R,canRedo:T,copySelected:M,paste:P,canPaste:B}=xo();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:u,getNode:d,getEdge:m,addNode:p,removeNode:g,updateNodeData:s,setNodes:n,setEdges:r,clearCanvas:o,selectNode:N,clearSelection:k,duplicateSelected:v,deleteSelected:b,autoLayout:x,fitView:w,zoomToNode:S,undo:C,redo:j,canUndo:R,canRedo:T,copySelected:M,paste:P,canPaste:B}}const tQ={step:R6,subworkflow:I6,trigger:O6,output:L6,if:$6,for_each:F6,while:z6,switch:U6,parallel:W6,try:G6,map:Tp,filter:Tp,reduce:Tp};function nQ(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,setNodes:o}=xo(),{autoLayout:a,deleteSelected:c,duplicateSelected:u}=v4(),d=Mr(X=>X.currentWorkflow),{screenToFlowPosition:m}=_o(),p=El(),[g,v]=A.useState(null),[b,x]=A.useState(!1),[w,S]=A.useState(null),[N,k]=A.useState(!1),[C,j]=A.useState(null),R=A.useRef(null),T=A.useCallback((X,ee)=>{if(X.preventDefault(),ee.type==="trigger"||ee.type==="output")return;const ie=d==null?void 0:d.steps.find(ue=>ue.id===ee.data.id);ie&&(v(ie),x(!0))},[d]),M=A.useCallback(()=>{if(!d)return null;const X=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"],ee=e.find(ie=>ie.selected&&X.includes(ie.type||""));return ee&&d.steps.find(ie=>ie.id===ee.data.id)||null},[d,e]),{undo:P,redo:B,canUndo:O,canRedo:$,copySelected:U,paste:D,canPaste:z}=xo(),V=A.useCallback(X=>{const ee=X.metaKey||X.ctrlKey;if((X.key==="Backspace"||X.key==="Delete")&&c(),ee&&X.key==="d"&&(X.preventDefault(),u()),ee&&X.key==="l"&&(X.preventDefault(),a()),ee&&X.key==="z"&&!X.shiftKey&&(X.preventDefault(),O()&&P()),(ee&&X.shiftKey&&X.key==="z"||ee&&X.key==="y")&&(X.preventDefault(),$()&&B()),ee&&X.key==="c"&&(X.preventDefault(),U()),ee&&X.key==="v"&&(X.preventDefault(),z()&&D()),X.key==="e"&&!ee&&!X.shiftKey&&!X.altKey){X.preventDefault();const ie=M();ie&&(v(ie),x(!0))}if(X.key==="y"&&!ee&&!X.shiftKey&&!X.altKey){X.preventDefault();const ie=M();ie&&(S(ie),k(!0))}},[c,u,a,M,P,B,O,$,U,D,z]),Y=A.useCallback(X=>{console.log("Saving step:",X),x(!1),v(null)},[]),F=A.useCallback(()=>{if(!C||!d)return;const X=d.steps.find(ee=>ee.id===C.data.id);X&&(v(X),x(!0)),j(null)},[C,d]),q=A.useCallback(()=>{if(!C||!d)return;const X=d.steps.find(ee=>ee.id===C.data.id);X&&(S(X),k(!0)),j(null)},[C,d]),G=A.useCallback(()=>{C&&u(),j(null)},[C,u]),L=A.useCallback(()=>{C&&c(),j(null)},[C,c]),W=A.useCallback(()=>{C&&console.log("Execute step:",C.data.id),j(null)},[C]),oe=A.useCallback((X,ee)=>{X.preventDefault(),["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"].includes(ee.type||"")&&j(ee)},[]),K=A.useCallback(X=>{X.preventDefault(),X.dataTransfer.dropEffect="copy"},[]),J=A.useCallback(X=>{var ie;X.preventDefault();const ee=X.dataTransfer.getData("application/marktoflow-tool");if(ee)try{const ue=JSON.parse(ee),me=m({x:X.clientX,y:X.clientY}),ye=ue.id+"-"+Date.now().toString(36),pe={id:ye,type:"step",position:me,data:{id:ye,name:ue.name+" Action",action:ue.id+"."+(((ie=ue.actions)==null?void 0:ie[0])||"action"),status:"pending"}};o([...e,pe])}catch(ue){console.error("Failed to parse dropped tool data:",ue)}},[e,o,m]),te=A.useCallback(()=>{if(!d||!g)return[];const X=[];if(d.inputs)for(const ie of Object.keys(d.inputs))X.push(`inputs.${ie}`);const ee=d.steps.findIndex(ie=>ie.id===g.id);for(let ie=0;ie<ee;ie++){const ue=d.steps[ie];ue.outputVariable&&X.push(ue.outputVariable)}return X},[d,g]);return h.jsxs(IK,{children:[h.jsx(MK,{asChild:!0,children:h.jsx("div",{ref:R,className:"w-full h-full",onKeyDown:V,onDragOver:K,onDrop:J,tabIndex:0,children:h.jsxs(nz,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:T,onNodeContextMenu:oe,nodeTypes:tQ,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[h.jsx(az,{variant:Rr.Dots,gap:24,size:1,color:"#3d3d5c"}),h.jsx(pz,{}),h.jsx(Ez,{nodeColor:X=>{var ee;switch((ee=X.data)==null?void 0:ee.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),h.jsxs(vP,{children:[h.jsxs(Xi,{onClick:F,children:[h.jsx(p6,{className:"w-4 h-4 mr-2"}),"Edit Step",h.jsx(Fa,{children:"E"})]}),h.jsxs(Xi,{onClick:q,children:[h.jsx(Ew,{className:"w-4 h-4 mr-2"}),"View YAML",h.jsx(Fa,{children:"Y"})]}),h.jsx(ew,{}),h.jsxs(Xi,{onClick:W,children:[h.jsx(Nl,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),h.jsx(ew,{}),h.jsxs(Xi,{onClick:G,children:[h.jsx(vo,{className:"w-4 h-4 mr-2"}),"Duplicate",h.jsxs(Fa,{children:[p,"D"]})]}),h.jsxs(Xi,{onClick:L,destructive:!0,children:[h.jsx(ko,{className:"w-4 h-4 mr-2"}),"Delete",h.jsx(Fa,{children:"⌫"})]})]}),h.jsx(YH,{open:b,onOpenChange:x,step:g,onSave:Y,availableVariables:te()}),h.jsx(Ss,{open:N,onOpenChange:k,title:`YAML: ${(w==null?void 0:w.name)||(w==null?void 0:w.id)}`,size:"lg",children:h.jsx("div",{className:"p-4",children:h.jsx(UH,{value:w})})})]})}const x4=Dr((e,t)=>({editingStep:null,isEditorOpen:!1,yamlViewStep:null,isYamlViewOpen:!1,isNewStepOpen:!1,newStepPosition:null,copiedNodes:[],undoStack:[],redoStack:[],openEditor:n=>e({editingStep:n,isEditorOpen:!0}),closeEditor:()=>e({editingStep:null,isEditorOpen:!1}),openYamlViewer:n=>e({yamlViewStep:n,isYamlViewOpen:!0}),closeYamlViewer:()=>e({yamlViewStep:null,isYamlViewOpen:!1}),openNewStepWizard:n=>e({isNewStepOpen:!0,newStepPosition:n??null}),closeNewStepWizard:()=>e({isNewStepOpen:!1,newStepPosition:null}),copyNodes:n=>e({copiedNodes:n.map(r=>({...r}))}),clearClipboard:()=>e({copiedNodes:[]}),pushUndo:n=>{const{undoStack:r}=t();e({undoStack:[...r,n],redoStack:[]})},undo:()=>{const{undoStack:n,redoStack:r}=t();if(n.length===0)return null;const s=n[n.length-1];return e({undoStack:n.slice(0,-1),redoStack:[...r,s]}),s},redo:()=>{const{undoStack:n,redoStack:r}=t();if(r.length===0)return null;const s=r[r.length-1];return e({redoStack:r.slice(0,-1),undoStack:[...n,s]}),s},clearHistory:()=>e({undoStack:[],redoStack:[]})})),w4=Dr((e,t)=>({providers:[],activeProviderId:null,isLoading:!1,error:null,loadProviders:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/ai/providers");if(!n.ok)throw new Error("Failed to load providers");const r=await n.json();e({providers:r.providers,activeProviderId:r.activeProvider,isLoading:!1})}catch(n){console.error("Error loading providers:",n),e({error:n instanceof Error?n.message:"Unknown error",isLoading:!1})}},setProvider:async(n,r)=>{e({isLoading:!0,error:null});try{const s=await fetch(`/api/ai/providers/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r||{})});if(!s.ok){const a=await s.json();throw new Error(a.message||"Failed to set provider")}const o=await s.json();return o.success&&o.status?(e({providers:o.status.providers,activeProviderId:o.status.activeProvider,isLoading:!1}),!0):!1}catch(s){return console.error("Error setting provider:",s),e({error:s instanceof Error?s.message:"Unknown error",isLoading:!1}),!1}},refreshStatus:async()=>{await t().loadProviders()}}));function rQ({open:e,onOpenChange:t}){var N,k,C;const{providers:n,activeProviderId:r,isLoading:s,error:o,loadProviders:a,setProvider:c}=w4(),[u,d]=A.useState(null),[m,p]=A.useState(!1),[g,v]=A.useState({apiKey:"",baseUrl:"",model:""});A.useEffect(()=>{e&&a()},[e,a]);const b=async j=>{const R=n.find(T=>T.id===j);R&&(R.status==="needs_config"?(d(j),p(!0)):R.status==="ready"&&await c(j)&&t(!1))},x=async()=>{if(!u)return;await c(u,g)&&(p(!1),v({apiKey:"",baseUrl:"",model:""}),t(!1))},w=j=>{switch(j){case"ready":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"});case"needs_config":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500"});case"unavailable":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"});default:return h.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-500"})}},S=j=>{switch(j){case"ready":return"Ready";case"needs_config":return"Needs Configuration";case"unavailable":return"Unavailable";default:return"Unknown"}};if(m){const j=n.find(R=>R.id===u);return j?h.jsxs(Ss,{open:m,onOpenChange:p,title:`Configure ${j.name}`,description:"Enter configuration details for this provider",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-4",children:[((N=j.configOptions)==null?void 0:N.apiKey)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"API Key"}),h.jsx("input",{type:"password",value:g.apiKey,onChange:R=>v({...g,apiKey:R.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter API key"})]}),((k=j.configOptions)==null?void 0:k.baseUrl)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Base URL"}),h.jsx("input",{type:"text",value:g.baseUrl,onChange:R=>v({...g,baseUrl:R.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter base URL"})]}),((C=j.configOptions)==null?void 0:C.model)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),h.jsx("input",{type:"text",value:g.model,onChange:R=>v({...g,model:R.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter model name"})]})]}),h.jsxs(ni,{children:[h.jsx(Be,{variant:"secondary",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Be,{variant:"primary",onClick:x,disabled:s,children:s?h.jsx(ws,{className:"w-4 h-4 animate-spin"}):"Save & Activate"})]})]}):null}return h.jsxs(Ss,{open:e,onOpenChange:t,title:"AI Provider",description:"Select which AI provider to use for agent prompts",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-2",children:[o&&h.jsxs("div",{className:"flex items-center gap-2 p-3 bg-error/10 border border-error/30 rounded text-error text-sm",children:[h.jsx(kl,{className:"w-4 h-4 flex-shrink-0"}),h.jsx("span",{children:o})]}),s&&n.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(ws,{className:"w-6 h-6 animate-spin text-gray-500"})}):h.jsx("div",{className:"space-y-2",children:n.map(j=>{const R=j.status==="unavailable"||j.status!=="ready"&&j.status!=="needs_config";return h.jsxs("button",{onClick:()=>b(j.id),disabled:R,className:`
|
|
693
|
-
w-full flex items-center justify-between p-3 rounded border transition-all
|
|
694
|
-
${j.isActive?"bg-primary/10 border-primary text-white":"bg-node-bg border-node-border text-gray-300 hover:bg-white/5"}
|
|
695
|
-
${R?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
696
|
-
`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[w(j.status),h.jsxs("div",{className:"text-left",children:[h.jsx("div",{className:"font-medium",children:j.name}),j.description&&h.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:j.description})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[j.isActive&&h.jsx(ei,{className:"w-4 h-4 text-primary"}),j.status==="needs_config"&&h.jsx(Pd,{className:"w-4 h-4 text-yellow-500"}),h.jsx("span",{className:"text-xs text-gray-500",children:S(j.status)})]})]},j.id)})})]}),h.jsx(ni,{children:h.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function sQ({onAddStep:e,onExecute:t,onSave:n,isExecuting:r=!1}){const{autoLayout:s,fitView:o,selectedNodes:a,deleteSelected:c,duplicateSelected:u}=v4(),{undo:d,redo:m,undoStack:p,redoStack:g}=x4(),{zoomIn:v,zoomOut:b}=_o(),x=El(),{providers:w,activeProviderId:S,loadProviders:N}=w4(),[k,C]=A.useState(!1),j=p.length>0,R=g.length>0,T=a.length>0;A.useEffect(()=>{N()},[N]);const M=w.find(P=>P.id===S);return h.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1 px-2 py-1.5 bg-panel-bg/95 backdrop-blur border border-node-border rounded-lg shadow-lg",children:[h.jsx(Pn,{icon:h.jsx(Od,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(g6,{className:"w-4 h-4"}),label:"Undo",onClick:()=>d(),disabled:!j,shortcut:`${x}Z`}),h.jsx(Pn,{icon:h.jsx(l6,{className:"w-4 h-4"}),label:"Redo",onClick:()=>m(),disabled:!R,shortcut:`${x}⇧Z`}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(vo,{className:"w-4 h-4"}),label:"Duplicate",onClick:u,disabled:!T,shortcut:`${x}D`}),h.jsx(Pn,{icon:h.jsx(ko,{className:"w-4 h-4"}),label:"Delete",onClick:c,disabled:!T,shortcut:"⌫"}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(o6,{className:"w-4 h-4"}),label:"Auto Layout",onClick:s,shortcut:`${x}L`}),h.jsx(Pn,{icon:h.jsx(x6,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>v(),shortcut:`${x}+`}),h.jsx(Pn,{icon:h.jsx(w6,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>b(),shortcut:`${x}-`}),h.jsx(Pn,{icon:h.jsx(Zz,{className:"w-4 h-4"}),label:"Fit View",onClick:o,shortcut:`${x}0`}),h.jsx(Ia,{}),h.jsxs("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded text-sm text-gray-300 hover:text-white hover:bg-white/10 transition-colors",title:"Select AI Provider",children:[h.jsx($u,{className:"w-4 h-4"}),h.jsx("span",{className:"hidden sm:inline text-xs",children:(M==null?void 0:M.name)||"No Provider"}),h.jsx(gs,{className:"w-3 h-3"})]}),t&&h.jsxs(h.Fragment,{children:[h.jsx(Ia,{}),h.jsx(Pn,{icon:r?h.jsx(rI,{className:"w-4 h-4"}):h.jsx(Nl,{className:"w-4 h-4"}),label:r?"Stop":"Execute",onClick:t,variant:r?"destructive":"primary",shortcut:`${x}⏎`})]}),n&&h.jsx(Pn,{icon:h.jsx(u6,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:`${x}S`}),h.jsx(rQ,{open:k,onOpenChange:C})]})}function Pn({icon:e,label:t,onClick:n,disabled:r,shortcut:s,variant:o="default"}){const a={default:"text-gray-300 hover:text-white hover:bg-white/10",primary:"text-primary hover:text-primary-light hover:bg-primary/10",destructive:"text-error hover:text-error hover:bg-error/10"};return h.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[o]}`,title:`${t}${s?` (${s})`:""}`,children:[e,h.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-black/90 rounded text-xs text-white whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:[t,s&&h.jsx("span",{className:"ml-2 text-gray-400",children:s})]})]})}function Ia(){return h.jsx("div",{className:"w-px h-6 bg-node-border mx-1"})}function iQ({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:o,onPause:a,onResume:c,onStop:u,onStepOver:d,onClose:m,debug:p,onToggleDebugMode:g,onToggleBreakpoint:v,onStepInto:b,onStepOut:x,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:N}){const[k,C]=A.useState("steps"),j=(p==null?void 0:p.enabled)??!1,R=s.filter(P=>P.status==="completed").length,T=s.filter(P=>P.status==="failed").length,M=s.length>0?R/s.length*100:0;return!e&&n==="pending"?null:h.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-panel-bg border border-node-border rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-node-border",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(cQ,{status:n}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-white",children:dQ(n)}),h.jsxs("div",{className:"text-xs text-gray-400",children:[R,"/",s.length," steps completed",T>0&&` • ${T} failed`]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[g&&h.jsx(Be,{variant:j?"primary":"ghost",size:"sm",onClick:g,icon:h.jsx(jk,{className:"w-4 h-4"}),title:j?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&h.jsxs(h.Fragment,{children:[t?h.jsx(Be,{variant:"secondary",size:"sm",onClick:c,icon:h.jsx(Nl,{className:"w-4 h-4"}),children:"Resume"}):h.jsx(Be,{variant:"secondary",size:"sm",onClick:a,icon:h.jsx(rI,{className:"w-4 h-4"}),children:"Pause"}),j&&t&&h.jsxs(h.Fragment,{children:[h.jsx(Be,{variant:"secondary",size:"sm",onClick:d,icon:h.jsx(al,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&h.jsx(Be,{variant:"secondary",size:"sm",onClick:b,icon:h.jsx(Pz,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),x&&h.jsx(Be,{variant:"secondary",size:"sm",onClick:x,icon:h.jsx(Lz,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!j&&h.jsx(Be,{variant:"secondary",size:"sm",onClick:d,icon:h.jsx(iI,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),h.jsx(Be,{variant:"destructive",size:"sm",onClick:u,icon:h.jsx(oI,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&h.jsx(Be,{variant:"secondary",size:"sm",onClick:m,children:"Close"})]})]}),h.jsx("div",{className:"h-1 bg-node-bg",children:h.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${M}%`}})}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx("button",{onClick:()=>C("steps"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="steps"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Steps"}),h.jsx("button",{onClick:()=>C("variables"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="variables"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Variables"}),h.jsx("button",{onClick:()=>C("logs"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="logs"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Logs"}),j&&h.jsxs("button",{onClick:()=>C("debug"),className:`px-4 py-2 text-sm font-medium transition-colors flex items-center gap-1 ${k==="debug"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[h.jsx(jk,{className:"w-3 h-3"}),"Debug"]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[k==="steps"&&h.jsx(oQ,{steps:s,currentStepId:r,debugEnabled:j,breakpoints:p==null?void 0:p.breakpoints,onToggleBreakpoint:v}),k==="variables"&&h.jsx(lQ,{steps:s}),k==="logs"&&h.jsx(aQ,{logs:o}),k==="debug"&&j&&h.jsx(fQ,{debug:p,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:N})]})]})}function oQ({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return h.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return h.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${o.stepId===t?"bg-primary/10 border-primary":a?"bg-error/10 border-error/50":"bg-node-bg border-node-border"}`,children:[n&&s&&h.jsx("button",{onClick:()=>s(o.stepId),className:`w-4 h-4 rounded-full flex items-center justify-center transition-colors ${a?"bg-error":"bg-transparent border border-gray-500 hover:border-error hover:bg-error/20"}`,title:a?"Remove breakpoint":"Add breakpoint",children:a&&h.jsx(Lx,{className:"w-2 h-2 fill-current text-white"})}),h.jsx(uQ,{status:o.status}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:o.stepName||o.stepId}),o.error&&h.jsx("div",{className:"text-xs text-error mt-1 truncate",children:o.error})]}),o.duration!==void 0&&h.jsxs("div",{className:"text-xs text-gray-400",children:[o.duration,"ms"]})]},o.stepId)})})}function aQ({logs:e}){return h.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?h.jsx("div",{className:"text-gray-500",children:"No logs yet..."}):e.map((t,n)=>h.jsx("div",{className:"text-gray-300",children:t},n))})}function lQ({steps:e}){const[t,n]=A.useState(new Set),[r,s]=A.useState(new Set),[o,a]=A.useState(null),c=e.filter(p=>p.inputs!==void 0||p.output!==void 0&&p.outputVariable),u=p=>{n(g=>{const v=new Set(g);return v.has(p)?v.delete(p):v.add(p),v})},d=p=>{s(g=>{const v=new Set(g);return v.has(p)?v.delete(p):v.add(p),v})},m=async(p,g)=>{try{const v=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(v),a(p),setTimeout(()=>a(null),2e3)}catch(v){console.error("Failed to copy:",v)}};return c.length===0?h.jsxs("div",{className:"text-center py-8 text-gray-500 text-sm",children:["No data available yet.",h.jsx("br",{}),h.jsx("span",{className:"text-xs",children:"Step inputs and outputs will appear as steps execute."})]}):h.jsx("div",{className:"space-y-2",children:c.map(p=>{const g=t.has(p.stepId),v=p.inputs&&Object.keys(p.inputs).length>0,b=p.output!==void 0&&p.outputVariable;return h.jsxs("div",{className:"border border-node-border rounded-lg overflow-hidden",children:[h.jsxs("button",{onClick:()=>u(p.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-node-bg hover:bg-white/5 transition-colors",children:[g?h.jsx(gs,{className:"w-4 h-4 text-gray-400"}):h.jsx(Jt,{className:"w-4 h-4 text-gray-400"}),h.jsx("code",{className:"text-sm text-white font-mono",children:p.stepName||p.stepId}),h.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[v&&`${Object.keys(p.inputs).length} inputs`,v&&b&&" • ",b&&p.outputVariable]})]}),g&&h.jsxs("div",{className:"bg-panel-bg border-t border-node-border",children:[v&&h.jsxs("div",{className:"border-b border-node-border",children:[h.jsxs("button",{onClick:()=>d(`${p.stepId}-inputs`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${p.stepId}-inputs`)?h.jsx(gs,{className:"w-3 h-3 text-gray-400"}):h.jsx(Jt,{className:"w-3 h-3 text-gray-400"}),h.jsxs("span",{className:"text-xs font-medium text-gray-400",children:["Inputs (",Object.keys(p.inputs).length,")"]})]}),r.has(`${p.stepId}-inputs`)&&h.jsx("div",{className:"px-3 pb-3",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("div",{className:"flex-1 overflow-x-auto",children:h.jsx(bd,{value:p.inputs,onCopy:(x,w)=>m(x,w),copiedKey:o,path:"inputs"})}),h.jsx("button",{onClick:()=>m(`${p.stepId}-inputs`,p.inputs),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy inputs",children:o===`${p.stepId}-inputs`?h.jsx(ei,{className:"w-4 h-4 text-success"}):h.jsx(vo,{className:"w-4 h-4 text-gray-400"})})]})})]}),b&&h.jsxs("div",{children:[h.jsxs("button",{onClick:()=>d(`${p.stepId}-output`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${p.stepId}-output`)?h.jsx(gs,{className:"w-3 h-3 text-gray-400"}):h.jsx(Jt,{className:"w-3 h-3 text-gray-400"}),h.jsx("span",{className:"text-xs font-medium text-gray-400",children:"Output"}),h.jsx("code",{className:"text-xs text-primary font-mono ml-auto",children:p.outputVariable})]}),r.has(`${p.stepId}-output`)&&h.jsx("div",{className:"px-3 pb-3",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("div",{className:"flex-1 overflow-x-auto",children:h.jsx(bd,{value:p.output,onCopy:(x,w)=>m(x,w),copiedKey:o,path:p.outputVariable||"output"})}),h.jsx("button",{onClick:()=>m(p.outputVariable||"",p.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy output",children:o===p.outputVariable?h.jsx(ei,{className:"w-4 h-4 text-success"}):h.jsx(vo,{className:"w-4 h-4 text-gray-400"})})]})})]})]})]},p.stepId)})})}function bd({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[o,a]=A.useState(s<2);if(e===null)return h.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"null"});if(e===void 0)return h.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return h.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return h.jsx("span",{className:"text-warning font-mono text-xs",children:e});if(typeof e=="string"){const c=e.length>200?e.substring(0,200)+"...":e;return h.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"[]"}):h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?h.jsx(gs,{className:"w-3 h-3"}):h.jsx(Jt,{className:"w-3 h-3"}),h.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&h.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[e.slice(0,20).map((c,u)=>h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsxs("span",{className:"text-gray-500 font-mono text-xs",children:["[",u,"]:"]}),h.jsx(bd,{value:c,onCopy:t,copiedKey:n,path:`${r}[${u}]`,depth:s+1})]},u)),e.length>20&&h.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"{}"}):h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?h.jsx(gs,{className:"w-3 h-3"}):h.jsx(Jt,{className:"w-3 h-3"}),h.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&h.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[c.slice(0,30).map(([u,d])=>h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsxs("span",{className:"text-primary font-mono text-xs",children:[u,":"]}),h.jsx(bd,{value:d,onCopy:t,copiedKey:n,path:`${r}.${u}`,depth:s+1})]},u)),c.length>30&&h.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:String(e)})}function cQ({status:e}){switch(e){case"running":return h.jsx(ws,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return h.jsx(en,{className:"w-5 h-5 text-success"});case"failed":return h.jsx(lt,{className:"w-5 h-5 text-error"});case"cancelled":return h.jsx(oI,{className:"w-5 h-5 text-gray-400"});default:return h.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function uQ({status:e}){switch(e){case"running":return h.jsx(ws,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return h.jsx(en,{className:"w-4 h-4 text-success"});case"failed":return h.jsx(lt,{className:"w-4 h-4 text-error"});case"skipped":return h.jsx(iI,{className:"w-4 h-4 text-gray-400"});default:return h.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function dQ(e){switch(e){case"pending":return"Pending";case"running":return"Executing Workflow...";case"completed":return"Workflow Completed";case"failed":return"Workflow Failed";case"cancelled":return"Workflow Cancelled";default:return"Unknown"}}function fQ({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,o]=A.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),o(""))};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("h4",{className:"text-sm font-medium text-white flex items-center gap-2",children:[h.jsx(Lx,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&h.jsxs("button",{onClick:t,className:"text-xs text-gray-400 hover:text-white flex items-center gap-1",children:[h.jsx(ko,{className:"w-3 h-3"}),"Clear all"]})]}),h.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.breakpoints.size===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No breakpoints set. Click the dot next to a step to add one."}):h.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>h.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-300",children:[h.jsx(Lx,{className:"w-2 h-2 fill-current text-error"}),h.jsx("span",{className:"font-mono",children:c})]},c))})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Call Stack"}),h.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.callStack.length===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No active call stack"}):h.jsx("div",{className:"space-y-1",children:e.callStack.map((c,u)=>h.jsxs("div",{className:`flex items-center gap-2 text-xs ${u===0?"text-primary":"text-gray-400"}`,children:[h.jsx(al,{className:"w-3 h-3"}),h.jsx("span",{className:"font-mono",children:c})]},u))})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Watch Expressions"}),h.jsxs("div",{className:"bg-node-bg rounded-lg p-3 space-y-2",children:[n&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-node-border rounded px-2 py-1 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-primary"}),h.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-gray-400 hover:text-white disabled:opacity-50",children:h.jsx(Od,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No watch expressions. Add an expression to monitor its value."}):h.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>h.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:"text-primary font-mono truncate",children:c}),h.jsx("span",{className:"text-gray-500",children:"="}),h.jsx("span",{className:"text-gray-300 font-mono truncate",children:"(not evaluated)"})]}),r&&h.jsx("button",{onClick:()=>r(c),className:"p-1 text-gray-500 hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(Cl,{className:"w-3 h-3"})})]},c))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Debug State"}),h.jsxs("div",{className:"bg-node-bg rounded-lg p-3 text-xs space-y-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Current Step:"}),h.jsx("span",{className:"text-white font-mono",children:e.currentStepId||"(none)"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Paused at Breakpoint:"}),h.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-gray-500",children:e.pausedAtBreakpoint?"Yes":"No"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Step Over Pending:"}),h.jsx("span",{className:e.stepOverPending?"text-warning":"text-gray-500",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function hQ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const a=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const tw=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return tw(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return tw(r)(n)}}}},pQ=(e,t)=>(n,r,s)=>{let o={storage:hQ(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...t},a=!1,c=0;const u=new Set,d=new Set;let m=o.storage;if(!m)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...w)},r,s);const p=()=>{const w=o.partialize({...r()});return m.setItem(o.name,{state:w,version:o.version})},g=s.setState;s.setState=(w,S)=>(g(w,S),p());const v=e((...w)=>(n(...w),p()),r,s);s.getInitialState=()=>v;let b;const x=()=>{var w,S;if(!m)return;const N=++c;a=!1,u.forEach(C=>{var j;return C((j=r())!=null?j:v)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(w=r())!=null?w:v))||void 0;return tw(m.getItem.bind(m))(o.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==o.version){if(o.migrate){const j=o.migrate(C.state,C.version);return j instanceof Promise?j.then(R=>[!0,R]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var j;if(N!==c)return;const[R,T]=C;if(b=o.merge(T,(j=r())!=null?j:v),n(b,!0),R)return p()}).then(()=>{N===c&&(k==null||k(b,void 0),b=r(),a=!0,d.forEach(C=>C(b)))}).catch(C=>{N===c&&(k==null||k(void 0,C))})};return s.persist={setOptions:w=>{o={...o,...w},w.storage&&(m=w.storage)},clearStorage:()=>{m==null||m.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>a,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(d.add(w),()=>{d.delete(w)})},o.skipHydration||x(),b||v},b4=pQ,ZA={tablet:768,desktop:1024};function mQ(e){return e>=ZA.desktop?"desktop":e>=ZA.tablet?"tablet":"mobile"}const $b=Dr()(b4((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),togglePropertiesPanel:()=>e(n=>({propertiesPanelOpen:!n.propertiesPanelOpen})),setPropertiesPanelOpen:n=>e({propertiesPanelOpen:n}),toggleMobileMenu:()=>e(n=>({mobileMenuOpen:!n.mobileMenuOpen})),setMobileMenuOpen:n=>e({mobileMenuOpen:n}),setBreakpoint:n=>{t(),e(n==="mobile"?{breakpoint:n,sidebarOpen:!1,propertiesPanelOpen:!1}:n==="tablet"?{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!1}:{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!0})},closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen})}));function gQ({open:e,onOpenChange:t,onImportComplete:n}){const[r,s]=A.useState(null),[o,a]=A.useState(!1),[c,u]=A.useState([]),[d,m]=A.useState(!1),p=A.useRef(null),g=C=>{var R;const j=(R=C.target.files)==null?void 0:R[0];j&&(s(j),u([]))},v=C=>{C.preventDefault(),C.stopPropagation(),m(!0)},b=C=>{C.preventDefault(),C.stopPropagation(),m(!1)},x=C=>{var R;C.preventDefault(),C.stopPropagation(),m(!1);const j=(R=C.dataTransfer.files)==null?void 0:R[0];j&&(s(j),u([]))},w=async()=>{if(r){a(!0),u([]);try{const C=new FormData;C.append("file",r);const j=await fetch("/api/workflows/import",{method:"POST",body:C});if(!j.ok){const T=await j.json();throw new Error(T.message||"Upload failed")}const R=await j.json();Array.isArray(R.results)?u(R.results):R.success&&u([{success:!0,filename:R.filename||r.name,message:R.message}]),setTimeout(()=>{n&&n()},1500)}catch(C){u([{success:!1,filename:r.name,message:C instanceof Error?C.message:"Unknown error"}])}finally{a(!1)}}},S=()=>{s(null),u([]),t(!1)},N=C=>C?[".md",".yaml",".yml",".zip"].some(R=>C.name.toLowerCase().endsWith(R)):!1,k=C=>C.endsWith(".zip")?h.jsx(Oz,{className:"w-5 h-5 text-purple-400"}):h.jsx(od,{className:"w-5 h-5 text-blue-400"});return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Import Workflow",description:"Upload workflow files from your computer",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-4",children:[!r&&c.length===0&&h.jsxs("div",{onClick:()=>{var C;return(C=p.current)==null?void 0:C.click()},onDragOver:v,onDragLeave:b,onDrop:x,className:`
|
|
697
|
-
border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors
|
|
698
|
-
${d?"border-primary bg-primary/10":"border-node-border hover:border-primary/50 hover:bg-white/5"}
|
|
699
|
-
`,children:[h.jsx(aI,{className:"w-12 h-12 mx-auto mb-4 text-gray-500"}),h.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"Drag and drop a file here, or click to browse"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Supported formats: .md, .yaml, .yml, .zip"}),h.jsx("input",{ref:p,type:"file",accept:".md,.yaml,.yml,.zip",onChange:g,className:"hidden"})]}),r&&c.length===0&&h.jsxs("div",{className:"border border-node-border rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[k(r.name),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-white truncate",children:r.name}),h.jsxs("p",{className:"text-xs text-gray-500",children:[(r.size/1024).toFixed(2)," KB"]})]}),!N(r)&&h.jsx(kl,{className:"w-5 h-5 text-error flex-shrink-0"})]}),!N(r)&&h.jsx("p",{className:"text-xs text-error mt-2",children:"Invalid file type. Please select a .md, .yaml, .yml, or .zip file."})]}),c.length>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Import Results:"}),c.map((C,j)=>h.jsxs("div",{className:`
|
|
700
|
-
flex items-start gap-3 p-3 rounded-lg border
|
|
701
|
-
${C.success?"border-success/30 bg-success/10":"border-error/30 bg-error/10"}
|
|
702
|
-
`,children:[C.success?h.jsx(en,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):h.jsx(lt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-white truncate",children:C.filename}),C.message&&h.jsx("p",{className:"text-xs text-gray-400 mt-1",children:C.message})]})]},j))]})]}),h.jsx(ni,{children:c.length>0?h.jsx(Be,{variant:"secondary",onClick:S,children:"Close"}):h.jsxs(h.Fragment,{children:[h.jsx(Be,{variant:"secondary",onClick:S,disabled:o,children:"Cancel"}),h.jsx(Be,{variant:"primary",onClick:w,disabled:!r||!N(r)||o,children:o?"Uploading...":"Import"})]})})]})}function yQ(){const[e,t]=A.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=Mr(),{resetNavigation:o}=Aw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:u}=$b(),d=A.useCallback(m=>{o(),s(m),u==="mobile"&&c(!1)},[o,s,u,c]);return!a&&u!=="mobile"?h.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-panel-bg border-r border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand sidebar",children:[h.jsx(Jt,{className:"w-4 h-4 text-gray-400"}),h.jsx(tI,{className:"w-5 h-5 text-primary"})]}):u==="mobile"?a?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),h.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-panel-bg border-r border-node-border flex flex-col z-50 md:hidden animate-slide-in-left",children:h.jsx(eR,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:!0})})]}):null:h.jsx("div",{className:"w-64 bg-panel-bg border-r border-node-border flex flex-col",children:h.jsx(eR,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:u==="tablet"})})}function eR({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:o,showClose:a}){const[c,u]=A.useState(!1),{fetchWorkflows:d}=Mr();return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"p-4 border-b border-node-border flex items-center justify-between",children:[h.jsxs("h1",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[h.jsx(tI,{className:"w-5 h-5 text-primary"}),"Marktoflow"]}),a&&h.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close sidebar",children:h.jsx(Cl,{className:"w-4 h-4 text-gray-400"})})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Workflows"}),h.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Tools"})]}),h.jsx("div",{className:"p-3 border-b border-node-border",children:h.jsxs("div",{className:"relative",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary"})]})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?h.jsx(vQ,{workflows:n,selectedWorkflow:r,onSelect:s}):h.jsx(wQ,{})}),e==="workflows"&&h.jsxs("div",{className:"p-3 border-t border-node-border space-y-2",children:[h.jsxs("button",{className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-primary hover:bg-primary-dark text-white rounded-lg text-sm font-medium transition-colors",children:[h.jsx(Od,{className:"w-4 h-4"}),"New Workflow"]}),h.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-node-bg border border-node-border hover:bg-white/5 text-gray-300 rounded-lg text-sm font-medium transition-colors",children:[h.jsx(aI,{className:"w-4 h-4"}),"Import"]})]}),h.jsx(gQ,{open:c,onOpenChange:u,onImportComplete:()=>d()})]})}function vQ({workflows:e,selectedWorkflow:t,onSelect:n}){return e.length===0?h.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No workflows found"}):h.jsx("div",{className:"space-y-1",children:e.map(r=>h.jsxs("button",{onClick:()=>n(r.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===r.path?"bg-primary/10 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[h.jsx(od,{className:"w-4 h-4 flex-shrink-0"}),h.jsx("span",{className:"text-sm truncate",children:r.name}),h.jsx(Jt,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},r.path))})}const xQ=[{id:"slack",name:"Slack",icon:"💬",category:"Communication",sdk:"@slack/web-api"},{id:"github",name:"GitHub",icon:"🐙",category:"Development",sdk:"@octokit/rest"},{id:"jira",name:"Jira",icon:"📋",category:"Project Management",sdk:"jira.js"},{id:"gmail",name:"Gmail",icon:"📧",category:"Communication",sdk:"googleapis"},{id:"http",name:"HTTP",icon:"🌐",category:"Network"},{id:"claude",name:"Claude",icon:"🤖",category:"AI"}];function wQ(){const[e,t]=A.useState(xQ),[n,r]=A.useState(!0),[s,o]=A.useState("");A.useEffect(()=>{async function d(){try{const m=await fetch("/api/tools");if(m.ok){const p=await m.json();t(p.tools)}}catch(m){console.error("Failed to fetch tools:",m)}finally{r(!1)}}d()},[]);const a=s?e.filter(d=>{var m;return d.name.toLowerCase().includes(s.toLowerCase())||d.category.toLowerCase().includes(s.toLowerCase())||((m=d.description)==null?void 0:m.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(d=>d.category))],u=(d,m)=>{d.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(m)),d.dataTransfer.effectAllowed="copy"};return n?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(ws,{className:"w-5 h-5 text-gray-500 animate-spin"})}):h.jsxs("div",{className:"space-y-4",children:[c.map(d=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:d}),h.jsx("div",{className:"space-y-1",children:a.filter(m=>m.category===d).map(m=>h.jsxs("div",{draggable:!0,onDragStart:p=>u(p,m),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:m.description||(m.sdk?"SDK: "+m.sdk:void 0),children:[h.jsx("span",{className:"text-lg",children:m.icon}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-sm block truncate",children:m.name}),m.actionCount!==void 0&&h.jsxs("span",{className:"text-xs text-gray-500",children:[m.actionCount," actions"]})]})]},m.id))})]},d)),a.length===0&&h.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const tR={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},S4=Dr((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,isLoadingHistory:!1,debug:tR,startExecution:(n,r,s)=>{const o="run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),a={id:o,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:s};return e({runs:[a,...t().runs].slice(0,50),currentRunId:o,isExecuting:!0,isPaused:!1}),o},updateStepStatus:(n,r,s,o,a,c,u)=>{const{debug:d}=t(),m=d.enabled&&s==="running"&&d.breakpoints.has(r);e({runs:t().runs.map(p=>{if(p.id!==n)return p;const g=p.steps.find(b=>b.stepId===r),v=new Date().toISOString();return g?{...p,steps:p.steps.map(b=>{if(b.stepId!==r)return b;const x=s!=="running"?v:void 0,w=x&&b.startTime?new Date(x).getTime()-new Date(b.startTime).getTime():void 0;return{...b,status:s,endTime:x,duration:w,inputs:u??b.inputs,output:o??b.output,outputVariable:c??b.outputVariable,error:a??b.error}})}:{...p,steps:[...p.steps,{stepId:r,stepName:r,status:s,startTime:v,inputs:u,output:o,outputVariable:c,error:a}]}}),...m?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),m&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,s)=>{const o=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(o).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:o,duration:c,outputs:s,logs:[...a.logs,r==="completed"?"Workflow completed successfully":r==="failed"?"Workflow execution failed":"Workflow execution cancelled"]}}),currentRunId:null,isExecuting:!1,isPaused:!1})},addLog:(n,r)=>{e({runs:t().runs.map(s=>s.id===n?{...s,logs:[...s.logs,"["+new Date().toLocaleTimeString()+"] "+r]}:s)})},pauseExecution:()=>{e({isPaused:!0});const{currentRunId:n,runs:r}=t();n&&r.find(o=>o.id===n)&&t().addLog(n,"Execution paused")},resumeExecution:()=>{e({isPaused:!1});const{currentRunId:n}=t();n&&t().addLog(n,"Execution resumed")},cancelExecution:n=>{t().addLog(n,"Execution cancelled by user"),t().completeExecution(n,"cancelled")},clearHistory:()=>{e({runs:[]})},getRun:n=>t().runs.find(r=>r.id===n),enableDebugMode:()=>{e({debug:{...t().debug,enabled:!0}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode enabled")},disableDebugMode:()=>{e({debug:{...tR,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),s=new Set(r.breakpoints);s.has(n)?s.delete(n):s.add(n),e({debug:{...r,breakpoints:s}})},hasBreakpoint:n=>t().debug.breakpoints.has(n),clearAllBreakpoints:()=>{e({debug:{...t().debug,breakpoints:new Set}});const{currentRunId:n}=t();n&&t().addLog(n,"All breakpoints cleared")},stepOver:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!1,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬆️ Step out"))},setCurrentDebugStep:n=>{e({debug:{...t().debug,currentStepId:n}})},addWatchExpression:n=>{const{debug:r}=t();r.watchExpressions.includes(n)||e({debug:{...r,watchExpressions:[...r.watchExpressions,n]}})},removeWatchExpression:n=>{const{debug:r}=t();e({debug:{...r,watchExpressions:r.watchExpressions.filter(s=>s!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})},loadHistory:async n=>{e({isLoadingHistory:!0});try{const r=n?`/api/executions?workflowId=${encodeURIComponent(n)}&limit=50`:"/api/executions?limit=50",s=await fetch(r);if(!s.ok)throw new Error("Failed to load execution history");const a=(await s.json()).map(d=>{var m;return{id:d.runId,workflowId:d.workflowId,workflowName:((m=d.workflowPath.split("/").pop())==null?void 0:m.replace(".md",""))||d.workflowId,status:d.status,startTime:d.startedAt,endTime:d.completedAt||void 0,duration:d.completedAt?new Date(d.completedAt).getTime()-new Date(d.startedAt).getTime():void 0,steps:[],logs:[],inputs:d.inputs||void 0,outputs:d.outputs||void 0}}),c=new Set(t().runs.map(d=>d.id)),u=a.filter(d=>!c.has(d.id));e({runs:[...t().runs,...u].slice(0,50),isLoadingHistory:!1})}catch(r){console.error("Error loading execution history:",r),e({isLoadingHistory:!1})}},syncRunWithBackend:async n=>{console.log("Syncing run with backend:",n)}}));function nw(e){if(e<1e3)return e+"ms";if(e<6e4)return(e/1e3).toFixed(1)+"s";const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return t+"m "+n+"s"}function bQ(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/1e3),o=Math.floor(s/60),a=Math.floor(o/60),c=Math.floor(a/24);return s<60?"just now":o<60?o+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}function SQ(){const[e,t]=A.useState("properties"),n=xo(u=>u.nodes),r=A.useMemo(()=>n.filter(u=>u.selected),[n]),s=Mr(u=>u.currentWorkflow),{propertiesPanelOpen:o,setPropertiesPanelOpen:a,breakpoint:c}=$b();return c==="mobile"?o?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>a(!1)}),h.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-panel-bg border-l border-node-border flex flex-col z-50 animate-slide-in-right",children:h.jsx(nR,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:!0})})]}):null:o?h.jsx("div",{className:"w-80 bg-panel-bg border-l border-node-border flex flex-col",children:h.jsx(nR,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:c==="tablet"})}):h.jsxs("button",{onClick:()=>a(!0),className:"w-10 bg-panel-bg border-l border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand properties panel",children:[h.jsx(Dz,{className:"w-4 h-4 text-gray-400"}),h.jsx(Pd,{className:"w-5 h-5 text-gray-400"})]})}function nR({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,onClose:s,showClose:o}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-node-border",children:[h.jsx("h2",{className:"text-sm font-medium text-white",children:"Properties"}),o&&h.jsx("button",{onClick:s,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close properties panel",children:h.jsx(Cl,{className:"w-4 h-4 text-gray-400"})})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx(mx,{active:e==="properties",onClick:()=>t("properties"),icon:h.jsx(Pd,{className:"w-4 h-4"}),label:"Properties"}),h.jsx(mx,{active:e==="variables",onClick:()=>t("variables"),icon:h.jsx(Dd,{className:"w-4 h-4"}),label:"Variables"}),h.jsx(mx,{active:e==="history",onClick:()=>t("history"),icon:h.jsx(jw,{className:"w-4 h-4"}),label:"History"})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&h.jsx(_Q,{selectedNodes:n,workflow:r}),e==="variables"&&h.jsx(kQ,{}),e==="history"&&h.jsx(NQ,{})]})]})}function mx({active:e,onClick:t,icon:n,label:r}){return h.jsxs("button",{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${e?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[n,r]})}function _Q({selectedNodes:e,workflow:t}){var n,r,s,o,a,c,u,d,m,p,g,v,b,x,w;if(e.length===0)return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx(Yi,{title:"Workflow",children:t?h.jsxs("div",{className:"space-y-3",children:[h.jsx(fs,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),h.jsx(fs,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),h.jsx(fs,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),h.jsx(fs,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):h.jsx("div",{className:"text-sm text-gray-500",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&h.jsx(Yi,{title:"Description",children:h.jsx("p",{className:"text-sm text-gray-300",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&h.jsx(Yi,{title:"Tags",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(S=>h.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:S},S))})})]});if(e.length===1){const S=e[0];return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx(Yi,{title:"Step",children:h.jsxs("div",{className:"space-y-3",children:[h.jsx(fs,{label:"ID",value:((u=S.data)==null?void 0:u.id)||S.id}),h.jsx(fs,{label:"Name",value:((d=S.data)==null?void 0:d.name)||"(unnamed)"}),h.jsx(fs,{label:"Action",value:((m=S.data)==null?void 0:m.action)||((p=S.data)==null?void 0:p.workflowPath)||"-"}),h.jsx(fs,{label:"Status",value:((g=S.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((v=S.data)==null?void 0:v.status)==="completed"?"success":((b=S.data)==null?void 0:b.status)==="failed"?"error":((x=S.data)==null?void 0:x.status)==="running"?"warning":"default"})]})}),((w=S.data)==null?void 0:w.error)&&h.jsx(Yi,{title:"Error",children:h.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:S.data.error})}),h.jsx(Yi,{title:"Actions",children:h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"Edit"}),h.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"View YAML"})]})})]})}return h.jsx("div",{className:"p-4",children:h.jsxs("div",{className:"text-sm text-gray-400",children:[e.length," nodes selected"]})})}function kQ(){const e=[{name:"inputs.repo",value:"owner/repo",type:"string"},{name:"inputs.pr_number",value:"123",type:"number"},{name:"pr_details.title",value:"Fix bug",type:"string"},{name:"pr_details.state",value:"open",type:"string"}];return h.jsx("div",{className:"p-4 space-y-2",children:e.map(t=>h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs font-mono text-primary",children:t.name}),h.jsx("span",{className:"text-xs text-gray-500",children:t.type})]}),h.jsx("div",{className:"text-sm text-gray-300 font-mono truncate",children:t.value})]},t.name))})}function NQ(){const{runs:e,clearHistory:t}=S4(),[n,r]=A.useState(null);return n?h.jsx(CQ,{run:n,onBack:()=>r(null)}):e.length===0?h.jsxs("div",{className:"p-4 text-center",children:[h.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-node-bg flex items-center justify-center",children:h.jsx(jw,{className:"w-6 h-6 text-gray-500"})}),h.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"No execution history"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Run a workflow to see execution history here"})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>h.jsxs("button",{onClick:()=>r(s),className:"w-full p-3 bg-node-bg rounded-lg border border-node-border cursor-pointer hover:border-primary transition-colors text-left",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),h.jsx(_4,{status:s.status})]}),h.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[h.jsx("span",{children:s.duration?nw(s.duration):"-"}),h.jsx("span",{children:bQ(s.startTime)})]}),s.steps.length>0&&h.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(o=>h.jsx(jQ,{status:o.status},o.stepId)),s.steps.length>5&&h.jsxs("span",{className:"text-xs text-gray-500",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&h.jsx("div",{className:"p-3 border-t border-node-border",children:h.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-gray-400 hover:text-error transition-colors",children:[h.jsx(ko,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function CQ({run:e,onBack:t}){const[n,r]=A.useState(!1);return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"p-3 border-b border-node-border",children:[h.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-white mb-2",children:[h.jsx(Jt,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),h.jsx(_4,{status:e.status})]}),h.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-gray-400",children:[h.jsx("span",{children:e.duration?nw(e.duration):"Running..."}),h.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-gray-400 hover:text-white":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),h.jsxs("button",{onClick:()=>r(!0),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:["Logs (",e.logs.length,")"]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,o)=>h.jsx("div",{className:"text-gray-300 break-words",children:s},o))}):h.jsx("div",{className:"space-y-2",children:e.steps.map(s=>h.jsxs("div",{className:"p-2 bg-node-bg rounded border border-node-border",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),h.jsx(EQ,{status:s.status})]}),s.duration&&h.jsx("div",{className:"text-xs text-gray-500 mt-1",children:nw(s.duration)}),s.error&&h.jsx("div",{className:"mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error",children:s.error})]},s.stepId))})})]})}function _4({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:ws},completed:{bg:"bg-success/10",text:"text-success",icon:en},failed:{bg:"bg-error/10",text:"text-error",icon:lt},cancelled:{bg:"bg-gray-500/10",text:"text-gray-400",icon:lt},pending:{bg:"bg-gray-500/10",text:"text-gray-400",icon:Hn}},{bg:n,text:r,icon:s}=t[e]||t.pending;return h.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[h.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function EQ({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning"},completed:{bg:"bg-success/10",text:"text-success"},failed:{bg:"bg-error/10",text:"text-error"},pending:{bg:"bg-gray-500/10",text:"text-gray-400"}},{bg:n,text:r}=t[e]||t.pending;return h.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function jQ({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return h.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Yi({title:e,children:t}){return h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2",children:e}),t]})}function fs({label:e,value:t,badge:n,badgeColor:r="default"}){const s={default:"bg-gray-500/10 text-gray-400",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-gray-400",children:e}),n?h.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):h.jsx("span",{className:"text-sm text-gray-200 font-mono truncate max-w-[180px]",children:t})]})}const qb=Dr((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=Mr.getState().currentWorkflow;try{const s=await fetch("/api/ai/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,workflow:r})});if(!s.ok)throw new Error("Failed to process prompt");const o=await s.json(),a={prompt:n,response:o.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:o.workflow,isProcessing:!1}),o.workflow&&t().acceptChanges()}catch(s){const o=s instanceof Error?s.message:"Unknown error";e({history:[{prompt:n,response:o,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:o,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;n&&(Mr.getState().saveWorkflow(n),e({pendingChanges:null}))},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function AQ({onSelectPrompt:e}){const[t,n]=A.useState(!1),[r,s]=A.useState(null),[o,a]=A.useState(null),{history:c,clearHistory:u,sendPrompt:d,isProcessing:m}=qb(),p=async b=>{m||await d(b)},g=async(b,x)=>{try{await navigator.clipboard.writeText(b),a(x),setTimeout(()=>a(null),2e3)}catch(w){console.error("Failed to copy:",w)}},v=b=>{const w=new Date().getTime()-new Date(b).getTime();return w<6e4?"Just now":w<36e5?`${Math.floor(w/6e4)}m ago`:w<864e5?`${Math.floor(w/36e5)}h ago`:new Date(b).toLocaleDateString()};return c.length===0?null:h.jsxs("div",{className:"border-t border-node-border",children:[h.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center justify-between px-4 py-2 bg-panel-bg hover:bg-white/5 transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(jw,{className:"w-4 h-4 text-gray-400"}),h.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),h.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?h.jsx(gs,{className:"w-4 h-4 text-gray-400"}):h.jsx($z,{className:"w-4 h-4 text-gray-400"})]}),t&&h.jsxs("div",{className:"bg-panel-bg",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[h.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),h.jsx(Be,{variant:"ghost",size:"sm",onClick:u,icon:h.jsx(ko,{className:"w-3 h-3"}),children:"Clear"})]}),h.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,x)=>{const w=`${x}-${b.timestamp}`,S=r===b;return h.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[h.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${S?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>s(S?null:b),children:[b.success?h.jsx(en,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):h.jsx(lt,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx(Hn,{className:"w-3 h-3 text-gray-500"}),h.jsx("span",{className:"text-xs text-gray-500",children:v(b.timestamp)})]})]}),h.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("button",{onClick:N=>{N.stopPropagation(),g(b.prompt,w)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:o===w?h.jsx(ei,{className:"w-3.5 h-3.5 text-success"}):h.jsx(vo,{className:"w-3.5 h-3.5 text-gray-400"})}),h.jsx("button",{onClick:N=>{N.stopPropagation(),p(b.prompt)},disabled:m,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:h.jsx(c6,{className:`w-3.5 h-3.5 text-gray-400 ${m?"animate-spin":""}`})}),e&&h.jsx("button",{onClick:N=>{N.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:h.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),S&&h.jsx("div",{className:"px-4 pb-3 pl-11",children:h.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),h.jsx("button",{onClick:()=>g(b.response,`${w}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${w}-response`?h.jsx(ei,{className:"w-3 h-3 text-success"}):h.jsx(vo,{className:"w-3 h-3 text-gray-400"})})]}),h.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},w)})})]})]})}function RQ(){const[e,t]=A.useState(""),n=A.useRef(null),{isProcessing:r,history:s,sendPrompt:o}=qb(),a=El();A.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const c=async()=>{!e.trim()||r||(await o(e),t(""))},u=m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),c()),m.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},d=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return h.jsxs("div",{className:"bg-panel-bg",children:[h.jsx(AQ,{onSelectPrompt:t}),!e&&!r&&h.jsx("div",{className:"px-4 py-2 border-t border-node-border/50",children:h.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[h.jsx(f6,{className:"w-4 h-4 text-primary flex-shrink-0"}),d.map(m=>h.jsx("button",{onClick:()=>t(m),className:"px-3 py-1 bg-node-bg border border-node-border rounded-full text-xs text-gray-300 hover:border-primary hover:text-primary transition-colors whitespace-nowrap",children:m},m))]})}),h.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-node-border",children:[h.jsxs("div",{className:"flex-1 relative",children:[h.jsx("textarea",{ref:n,value:e,onChange:m=>t(m.target.value),onKeyDown:u,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary resize-none disabled:opacity-50"}),r&&h.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:h.jsx(ws,{className:"w-5 h-5 text-primary animate-spin"})})]}),h.jsx("button",{onClick:c,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:h.jsx(sI,{className:"w-5 h-5 text-white"})})]}),h.jsxs("div",{className:"px-4 pb-2 text-xs text-gray-500",children:["Press ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:a})," +"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"Enter"})," to send",s.length>0&&h.jsxs("span",{className:"ml-4",children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"↑"})," for last prompt"]})]})]})}function TQ({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:o,onReject:a}){const[c,u]=A.useState("explanation"),d=n?hd(n,{indent:2}):"",m=r?hd(r,{indent:2}):"",p=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[h.jsxs(uM,{value:c,onValueChange:u,children:[h.jsxs(zw,{children:[h.jsxs(nr,{value:"explanation",children:[h.jsx(Uz,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),h.jsxs(nr,{value:"diff",children:[h.jsx(Gz,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),h.jsxs(nr,{value:"modified",children:[h.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),h.jsxs("div",{className:"p-4",children:[h.jsx(rr,{value:"explanation",children:h.jsxs("div",{className:"prose prose-invert max-w-none",children:[h.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:h.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&h.jsxs("div",{className:"mt-4",children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),h.jsx("ul",{className:"space-y-2",children:IQ(n,r).map((v,b)=>h.jsxs("li",{className:`flex items-start gap-2 text-sm ${v.type==="added"?"text-success":v.type==="removed"?"text-error":"text-warning"}`,children:[h.jsx("span",{className:"flex-shrink-0",children:v.type==="added"?"+":v.type==="removed"?"-":"~"}),h.jsx("span",{children:v.description})]},b))})]})]})}),h.jsx(rr,{value:"diff",children:h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:d,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:m,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),h.jsx(rr,{value:"modified",children:h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"500px",language:"yaml",value:m,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),h.jsxs(ni,{children:[h.jsx(Be,{variant:"secondary",onClick:g,icon:h.jsx(Cl,{className:"w-4 h-4"}),children:"Reject"}),h.jsx(Be,{onClick:p,icon:h.jsx(ei,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function IQ(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(o=>o.id)),s=new Set(t.steps.map(o=>o.id));for(const o of t.steps)r.has(o.id)||n.push({type:"added",description:`Added step "${o.name||o.id}"`});for(const o of e.steps)s.has(o.id)||n.push({type:"removed",description:`Removed step "${o.name||o.id}"`});for(const o of t.steps)if(r.has(o.id)){const a=e.steps.find(c=>c.id===o.id);if(a&&JSON.stringify(a)!==JSON.stringify(o)){const c=[];a.action!==o.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(o.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(o.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(o.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${o.name||o.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const Er={WORKFLOW_UPDATED:"workflow:updated",EXECUTION_STEP:"execution:step",EXECUTION_COMPLETED:"execution:completed",AI_PROCESSING:"ai:processing",AI_RESPONSE:"ai:response",WORKFLOW_SUBSCRIBE:"workflow:subscribe",WORKFLOW_UNSUBSCRIBE:"workflow:unsubscribe",EXECUTION_SUBSCRIBE:"execution:subscribe",EXECUTION_UNSUBSCRIBE:"execution:unsubscribe"},Ru={slack:{name:"Slack",icon:"slack",methods:["chat.postMessage","chat.update","chat.delete","conversations.list","conversations.create","files.upload","users.info"]},github:{name:"GitHub",icon:"github",methods:["pulls.get","pulls.list","pulls.create","pulls.createReview","pulls.listFiles","issues.get","issues.create","issues.createComment","repos.getContent","search.code"]},jira:{name:"Jira",icon:"jira",methods:["issues.getIssue","issues.createIssue","issues.editIssue","issues.search","issues.addComment","issues.transition"]},gmail:{name:"Gmail",icon:"gmail",methods:["messages.list","messages.get","messages.send","drafts.create","labels.list"]},outlook:{name:"Outlook",icon:"outlook",methods:["messages.list","messages.get","messages.send","calendar.events.list","calendar.events.create"]},linear:{name:"Linear",icon:"linear",methods:["issues.get","issues.create","issues.update","issues.search","projects.list"]},notion:{name:"Notion",icon:"notion",methods:["pages.get","pages.create","pages.update","databases.query","search"]},discord:{name:"Discord",icon:"discord",methods:["messages.send","messages.edit","messages.delete","channels.get","webhooks.execute"]},airtable:{name:"Airtable",icon:"airtable",methods:["records.list","records.get","records.create","records.update","records.delete"]},confluence:{name:"Confluence",icon:"confluence",methods:["pages.list","pages.get","pages.create","pages.update","search"]},http:{name:"HTTP",icon:"http",methods:["request","get","post","put","patch","delete"]},claude:{name:"Claude",icon:"claude",methods:["analyze","generate","summarize","chat"]},opencode:{name:"OpenCode",icon:"opencode",methods:["chat","complete","analyze"]},ollama:{name:"Ollama",icon:"ollama",methods:["generate","chat","embeddings"]}};function MQ({open:e,onOpenChange:t,onCreateStep:n,position:r}){var P,B;const[s,o]=A.useState("select-type"),[a,c]=A.useState(""),[u,d]=A.useState("action"),[m,p]=A.useState(null),[g,v]=A.useState(null),[b,x]=A.useState({id:"",name:""}),w=()=>{o("select-type"),c(""),d("action"),p(null),v(null),x({id:"",name:""})},S=()=>{w(),t(!1)},N=O=>{d(O),o(O==="action"?"select-service":"configure")},k=O=>{p(O),o("select-method")},C=O=>{v(O);const $=Ru[m];x({id:`${m}-${Date.now()}`,name:`${($==null?void 0:$.name)||m} - ${O}`}),o("configure")},j=()=>{const O={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};u==="action"&&m&&g&&(O.action=`${m}.${g}`),n(O),S()},R=Object.entries(Ru).filter(([O,$])=>$.name.toLowerCase().includes(a.toLowerCase())||O.toLowerCase().includes(a.toLowerCase())),M=(m?((P=Ru[m])==null?void 0:P.methods)||[]:[]).filter(O=>O.toLowerCase().includes(a.toLowerCase()));return h.jsxs(Ss,{open:e,onOpenChange:S,title:"Add New Step",description:OQ(s),size:"lg",children:[h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[h.jsx("button",{onClick:()=>o("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),u==="action"&&h.jsxs(h.Fragment,{children:[h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("button",{onClick:()=>m&&o("select-service"),className:`${s==="select-service"?"text-primary":m?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!m,children:"Service"}),h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("button",{onClick:()=>g&&o("select-method"),className:`${s==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("button",{onClick:()=>N("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[h.jsx(ld,{className:"w-8 h-8 text-primary mb-3"}),h.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),h.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),h.jsxs("button",{onClick:()=>N("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[h.jsx(ad,{className:"w-8 h-8 text-info mb-3"}),h.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),h.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&h.jsxs("div",{children:[h.jsxs("div",{className:"relative mb-4",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",value:a,onChange:O=>c(O.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),h.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:R.map(([O,$])=>{const U=qx(O);return h.jsxs("button",{onClick:()=>k(O),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[h.jsx(U,{className:"w-8 h-8 text-primary"}),h.jsx("span",{className:"text-sm text-white",children:$.name})]},O)})})]}),s==="select-method"&&m&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const O=qx(m);return h.jsx(O,{className:"w-6 h-6 text-primary"})})(),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-white",children:(B=Ru[m])==null?void 0:B.name}),h.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),h.jsxs("div",{className:"relative mb-4",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",value:a,onChange:O=>c(O.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),h.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:M.map(O=>h.jsxs("button",{onClick:()=>C(O),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[h.jsx("span",{className:"text-sm font-mono text-white",children:O}),h.jsx(Jt,{className:"w-4 h-4 text-gray-500"})]},O))})]}),s==="configure"&&h.jsxs("div",{className:"space-y-4",children:[u==="action"&&m&&g&&h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),h.jsxs("div",{className:"text-sm font-mono text-primary",children:[m,".",g]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),h.jsx("input",{type:"text",value:b.id,onChange:O=>x($=>({...$,id:O.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),h.jsx("input",{type:"text",value:b.name,onChange:O=>x($=>({...$,name:O.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&h.jsx("div",{className:"text-xs text-gray-500",children:r.afterStepId?`Will be inserted after "${r.afterStepId}"`:r.beforeStepId?`Will be inserted before "${r.beforeStepId}"`:"Will be added at the end"})]})]}),h.jsxs(ni,{children:[s!=="select-type"&&h.jsx(Be,{variant:"ghost",onClick:()=>{s==="select-service"?o("select-type"):s==="select-method"?o("select-service"):s==="configure"&&o(u==="action"?"select-method":"select-type"),c("")},children:"Back"}),h.jsx(Be,{variant:"secondary",onClick:S,children:"Cancel"}),s==="configure"&&h.jsx(Be,{onClick:j,disabled:!b.id,children:"Create Step"})]})]})}function OQ(e){switch(e){case"select-type":return"Choose what type of step to add";case"select-service":return"Select a service to use";case"select-method":return"Choose the method to call";case"configure":return"Configure your new step";default:return""}}const rR=[{keys:["⌘","S"],description:"Save workflow",category:"General"},{keys:["⌘","Z"],description:"Undo",category:"General"},{keys:["⌘","⇧","Z"],description:"Redo",category:"General"},{keys:["⌘","?"],description:"Show keyboard shortcuts",category:"General"},{keys:["N"],description:"Add new step",category:"Canvas"},{keys:["⌘","L"],description:"Auto-layout canvas",category:"Canvas"},{keys:["⌘","0"],description:"Fit view",category:"Canvas"},{keys:["⌘","+"],description:"Zoom in",category:"Canvas"},{keys:["⌘","-"],description:"Zoom out",category:"Canvas"},{keys:["⌫"],description:"Delete selected",category:"Canvas"},{keys:["⌘","D"],description:"Duplicate selected",category:"Canvas"},{keys:["Double-click"],description:"Edit step",category:"Editing"},{keys:["E"],description:"Edit selected step",category:"Editing"},{keys:["Y"],description:"View YAML",category:"Editing"},{keys:["Escape"],description:"Close modal / deselect",category:"Editing"},{keys:["⌘","←"],description:"Back to parent workflow",category:"Navigation"},{keys:["⌘","↑"],description:"Go to root workflow",category:"Navigation"},{keys:["⌘","↵"],description:"Execute workflow",category:"Execution"},{keys:["F9"],description:"Toggle debug mode",category:"Debugging"},{keys:["F5"],description:"Continue execution",category:"Debugging"},{keys:["F10"],description:"Step over",category:"Debugging"},{keys:["F11"],description:"Step into",category:"Debugging"},{keys:["⇧","F11"],description:"Step out",category:"Debugging"}];function PQ({open:e,onOpenChange:t}){const n=[...new Set(rR.map(s=>s.category))],r=El();return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[h.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(s=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:s}),h.jsx("div",{className:"space-y-2",children:rR.filter(o=>o.category===s).map((o,a)=>h.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[h.jsx("span",{className:"text-sm text-gray-300",children:o.description}),h.jsx("div",{className:"flex items-center gap-1",children:o.keys.map((c,u)=>h.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:c==="⌘"?r:c},u))})]},a))})]},s))}),h.jsx(ni,{children:h.jsx(Be,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function LQ(){const[e,t]=A.useState(!1);return A.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="/"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{isOpen:e,setIsOpen:t,openShortcuts:()=>t(!0)}}function DQ({onClick:e}){const t=El();return h.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:`Keyboard shortcuts (${t}/)`,children:[h.jsx(Jz,{className:"w-3.5 h-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function gx(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yx(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.add("light"),t.classList.remove("dark"))}const k4=Dr()(b4((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?gx():n;yx(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?gx():r;yx(s),e({theme:r,resolvedTheme:s})}}),{name:"marktoflow-theme",onRehydrateStorage:()=>e=>{if(e){const t=e.theme==="system"?gx():e.theme;yx(t),e.resolvedTheme=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{const{theme:t,setTheme:n}=k4.getState();t==="system"&&n("system")});function $Q({showLabel:e=!1}){const{theme:t,toggleTheme:n}=k4();return h.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/10 dark:hover:bg-white/10 light:hover:bg-black/5 transition-colors",title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[t==="dark"?h.jsx(s6,{className:"w-4 h-4 text-gray-400"}):h.jsx(m6,{className:"w-4 h-4 text-yellow-500"}),e&&h.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function qQ({items:e,onNavigate:t}){return e.length<=1?null:h.jsx("nav",{className:"flex items-center gap-1 px-4 py-2 bg-panel-bg border-b border-node-border",children:e.map((n,r)=>h.jsxs("div",{className:"flex items-center",children:[r>0&&h.jsx(Jt,{className:"w-4 h-4 text-gray-600 mx-1"}),h.jsxs("button",{onClick:()=>t(n,r),className:`flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors ${r===e.length-1?"text-white font-medium cursor-default":"text-gray-400 hover:text-white hover:bg-white/5"}`,disabled:r===e.length-1,children:[r===0&&h.jsx(Qz,{className:"w-3.5 h-3.5"}),h.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}const hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const Hu=Object.create(null);Object.keys(hr).forEach(e=>{Hu[hr[e]]=e});const rw={type:"error",data:"parser error"},N4=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",C4=typeof ArrayBuffer=="function",E4=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fb=({type:e,data:t},n,r)=>N4&&t instanceof Blob?n?r(t):sR(t,r):C4&&(t instanceof ArrayBuffer||E4(t))?n?r(t):sR(new Blob([t]),r):r(hr[e]+(t||"")),sR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function iR(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let vx;function FQ(e,t){if(N4&&e.data instanceof Blob)return e.data.arrayBuffer().then(iR).then(t);if(C4&&(e.data instanceof ArrayBuffer||E4(e.data)))return t(iR(e.data));Fb(e,!1,n=>{vx||(vx=new TextEncoder),t(vx.encode(n))})}const oR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ua=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oR.length;e++)Ua[oR.charCodeAt(e)]=e;const BQ=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),m=new Uint8Array(d);for(r=0;r<n;r+=4)o=Ua[e.charCodeAt(r)],a=Ua[e.charCodeAt(r+1)],c=Ua[e.charCodeAt(r+2)],u=Ua[e.charCodeAt(r+3)],m[s++]=o<<2|a>>4,m[s++]=(a&15)<<4|c>>2,m[s++]=(c&3)<<6|u&63;return d},zQ=typeof ArrayBuffer=="function",Bb=(e,t)=>{if(typeof e!="string")return{type:"message",data:j4(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:VQ(e.substring(1),t)}:Hu[n]?e.length>1?{type:Hu[n],data:e.substring(1)}:{type:Hu[n]}:rw},VQ=(e,t)=>{if(zQ){const n=BQ(e);return j4(n,t)}else return{base64:!0,data:e}},j4=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},A4="",UQ=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{Fb(o,!1,c=>{r[a]=c,++s===n&&t(r.join(A4))})})},HQ=(e,t)=>{const n=e.split(A4),r=[];for(let s=0;s<n.length;s++){const o=Bb(n[s],t);if(r.push(o),o.type==="error")break}return r};function WQ(){return new TransformStream({transform(e,t){FQ(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let xx;function Tu(e){return e.reduce((t,n)=>t+n.length,0)}function Iu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function KQ(e,t){xx||(xx=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(Tu(n)<1)break;const u=Iu(n,1);o=(u[0]&128)===128,s=u[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Tu(n)<2)break;const u=Iu(n,2);s=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Tu(n)<8)break;const u=Iu(n,8),d=new DataView(u.buffer,u.byteOffset,u.length),m=d.getUint32(0);if(m>Math.pow(2,21)-1){c.enqueue(rw);break}s=m*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Tu(n)<s)break;const u=Iu(n,s);c.enqueue(Bb(o?u:xx.decode(u),t)),r=0}if(s===0||s>e){c.enqueue(rw);break}}}})}const R4=4;function mt(e){if(e)return GQ(e)}function GQ(e){for(var t in mt.prototype)e[t]=mt.prototype[t];return e}mt.prototype.on=mt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};mt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};mt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};mt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const bf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),YQ="arraybuffer";function T4(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const XQ=bn.setTimeout,QQ=bn.clearTimeout;function Sf(e,t){t.useNativeTimers?(e.setTimeoutFn=XQ.bind(bn),e.clearTimeoutFn=QQ.bind(bn)):(e.setTimeoutFn=bn.setTimeout.bind(bn),e.clearTimeoutFn=bn.clearTimeout.bind(bn))}const JQ=1.33;function ZQ(e){return typeof e=="string"?eJ(e):Math.ceil((e.byteLength||e.size)*JQ)}function eJ(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function I4(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function tJ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function nJ(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class rJ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class zb extends mt{constructor(t){super(),this.writable=!1,Sf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new rJ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Bb(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=tJ(t);return n.length?"?"+n:""}}class sJ extends zb{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};HQ(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,UQ(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=I4()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let M4=!1;try{M4=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const iJ=M4;function oJ(){}class aJ extends sJ{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class lr extends mt{constructor(t,n,r){super(),this.createRequest=t,Sf(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=T4(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=lr.requestsCount++,lr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=oJ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete lr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}lr.requestsCount=0;lr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",aR);else if(typeof addEventListener=="function"){const e="onpagehide"in bn?"pagehide":"unload";addEventListener(e,aR,!1)}}function aR(){for(let e in lr.requests)lr.requests.hasOwnProperty(e)&&lr.requests[e].abort()}const lJ=(function(){const e=O4({xdomain:!1});return e&&e.responseType!==null})();class cJ extends aJ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=lJ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new lr(O4,this.uri(),t)}}function O4(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||iJ))return new XMLHttpRequest}catch{}if(!t)try{return new bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const P4=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class uJ extends zb{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=P4?{}:T4(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Fb(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=I4()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const wx=bn.WebSocket||bn.MozWebSocket;class dJ extends uJ{createSocket(t,n,r){return P4?new wx(t,n,r):n?new wx(t,n):new wx(t)}doWrite(t,n){this.ws.send(n)}}class fJ extends zb{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=KQ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=WQ();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const hJ={websocket:dJ,webtransport:fJ,polling:cJ},pJ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mJ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sw(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=pJ.exec(e||""),o={},a=14;for(;a--;)o[mJ[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=gJ(o,o.path),o.queryKey=yJ(o,o.query),o}function gJ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function yJ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const iw=typeof addEventListener=="function"&&typeof removeEventListener=="function",Wu=[];iw&&addEventListener("offline",()=>{Wu.forEach(e=>e())},!1);class xs extends mt{constructor(t,n){if(super(),this.binaryType=YQ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=sw(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=sw(n.host).host);Sf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=nJ(this.opts.query)),iw&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Wu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=R4,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&xs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",xs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=ZQ(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,bf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(xs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),iw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Wu.indexOf(this._offlineEventListener);r!==-1&&Wu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}xs.protocol=R4;class vJ extends xs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;xs.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;xs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const a=p=>{const g=new Error("probe error: "+p);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function u(){a("socket closed")}function d(p){n&&p.name!==n.name&&o()}const m=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",d)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let xJ=class extends vJ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>hJ[s]).filter(s=>!!s)),super(t,r)}};function wJ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=sw(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const bJ=typeof ArrayBuffer=="function",SJ=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,L4=Object.prototype.toString,_J=typeof Blob=="function"||typeof Blob<"u"&&L4.call(Blob)==="[object BlobConstructor]",kJ=typeof File=="function"||typeof File<"u"&&L4.call(File)==="[object FileConstructor]";function Vb(e){return bJ&&(e instanceof ArrayBuffer||SJ(e))||_J&&e instanceof Blob||kJ&&e instanceof File}function Ku(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ku(e[n]))return!0;return!1}if(Vb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ku(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ku(e[n]))return!0;return!1}function NJ(e){const t=[],n=e.data,r=e;return r.data=ow(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ow(e,t){if(!e)return e;if(Vb(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ow(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ow(e[r],t));return n}return e}function CJ(e,t){return e.data=aw(e.data,t),delete e.attachments,e}function aw(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=aw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=aw(e[n],t));return e}const EJ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Pe;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Pe||(Pe={}));class jJ{constructor(t){this.replacer=t}encode(t){return(t.type===Pe.EVENT||t.type===Pe.ACK)&&Ku(t)?this.encodeAsBinary({type:t.type===Pe.EVENT?Pe.BINARY_EVENT:Pe.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Pe.BINARY_EVENT||t.type===Pe.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NJ(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Ub extends mt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Pe.BINARY_EVENT;r||n.type===Pe.BINARY_ACK?(n.type=r?Pe.EVENT:Pe.ACK,this.reconstructor=new AJ(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Vb(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Pe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Pe.BINARY_EVENT||r.type===Pe.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Ub.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Pe.CONNECT:return lR(n);case Pe.DISCONNECT:return n===void 0;case Pe.CONNECT_ERROR:return typeof n=="string"||lR(n);case Pe.EVENT:case Pe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&EJ.indexOf(n[0])===-1);case Pe.ACK:case Pe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class AJ{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=CJ(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function lR(e){return Object.prototype.toString.call(e)==="[object Object]"}const RJ=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ub,Encoder:jJ,get PacketType(){return Pe}},Symbol.toStringTag,{value:"Module"}));function Dn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const TJ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class D4 extends mt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Dn(t,"open",this.onopen.bind(this)),Dn(t,"packet",this.onpacket.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(TJ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Pe.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),a.id=m}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!c||(u?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},s),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,c)=>a?s(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Pe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Pe.EVENT:case Pe.BINARY_EVENT:this.onevent(t);break;case Pe.ACK:case Pe.BINARY_ACK:this.onack(t);break;case Pe.DISCONNECT:this.ondisconnect();break;case Pe.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Pe.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Do(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Do.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Do.prototype.reset=function(){this.attempts=0};Do.prototype.setMin=function(e){this.ms=e};Do.prototype.setMax=function(e){this.max=e};Do.prototype.setJitter=function(e){this.jitter=e};class lw extends mt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Sf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Do({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||RJ;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new xJ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Dn(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=Dn(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Dn(t,"ping",this.onping.bind(this)),Dn(t,"data",this.ondata.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this)),Dn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){bf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new D4(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ma={};function Gu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=wJ(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Ma[s]&&o in Ma[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new lw(r,t):(Ma[s]||(Ma[s]=new lw(r,t)),u=Ma[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Gu,{Manager:lw,Socket:D4,io:Gu,connect:Gu});function $4(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}=e,c=A.useRef(null),[u,d]=A.useState(!1),m=A.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a});A.useEffect(()=>{m.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}},[n,r,s,o,a]);const p=A.useCallback(()=>{var N;if((N=c.current)!=null&&N.connected)return;const S=Gu({transports:["websocket"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});S.on("connect",()=>{console.log("WebSocket connected"),d(!0)}),S.on("disconnect",()=>{console.log("WebSocket disconnected"),d(!1)}),S.on("connect_error",k=>{console.error("WebSocket connection error:",k),d(!1)}),S.on(Er.WORKFLOW_UPDATED,k=>{var C,j;(j=(C=m.current).onWorkflowUpdated)==null||j.call(C,k)}),S.on(Er.EXECUTION_STEP,k=>{var C,j;(j=(C=m.current).onExecutionStep)==null||j.call(C,k)}),S.on(Er.EXECUTION_COMPLETED,k=>{var C,j;(j=(C=m.current).onExecutionCompleted)==null||j.call(C,k)}),S.on(Er.AI_PROCESSING,({processing:k})=>{var C,j;(j=(C=m.current).onAIProcessing)==null||j.call(C,k)}),S.on(Er.AI_RESPONSE,k=>{var C,j;(j=(C=m.current).onAIResponse)==null||j.call(C,k)}),c.current=S},[]),g=A.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,d(!1))},[]),v=A.useCallback(S=>{var N;(N=c.current)==null||N.emit(Er.WORKFLOW_SUBSCRIBE,S)},[]),b=A.useCallback(S=>{var N;(N=c.current)==null||N.emit(Er.WORKFLOW_UNSUBSCRIBE,S)},[]),x=A.useCallback(S=>{var N;(N=c.current)==null||N.emit(Er.EXECUTION_SUBSCRIBE,S)},[]),w=A.useCallback(S=>{var N;(N=c.current)==null||N.emit(Er.EXECUTION_UNSUBSCRIBE,S)},[]);return A.useEffect(()=>(t&&p(),()=>{g()}),[t,p,g]),{connected:u,socket:c.current,subscribeToWorkflow:v,unsubscribeFromWorkflow:b,subscribeToExecution:x,unsubscribeFromExecution:w,connect:p,disconnect:g}}function IJ(e){if(!e)return[];const t=[],n=/```yaml\s*\n([\s\S]*?)\n```/g;let r,s=0;for(;(r=n.exec(e))!==null;){const o=r[1];try{const a=nO(o);if(a&&a.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(a.type)){const c=a.id||`control-flow-${a.type}-${s++}`,u={...a,id:c,inputs:a.inputs||{}};t.push(u)}}catch(a){console.warn("Failed to parse control flow YAML block:",a)}}return t}function MJ(e){const t=[],n=[],o=IJ(e.markdown),a=[...e.steps,...o],c=(g,v,b,x)=>{let w=b,S=null;return g.forEach((N,k)=>{var B,O,$,U,D;N.id||(N.id=x?`${x}-step-${k}`:`step-${Date.now()}-${k}`);const C=!!N.workflow,j=!!N.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(N.type);let R="step";C?R="subworkflow":j&&(R=N.type);const T={id:N.id,name:N.name,action:N.action,workflowPath:N.workflow,status:"pending"};let M={...T};if(N.type==="while")M={...T,condition:N.condition||"true",maxIterations:N.maxIterations||100,variables:N.variables};else if(N.type==="for_each"||N.type==="for"){const z=N.items||"[]";M={...T,items:z==="unknown"?"[]":z,itemVariable:(B=N.inputs)==null?void 0:B.itemVariable}}else if(N.type==="switch")M={...T,expression:((O=N.inputs)==null?void 0:O.expression)||N.condition||"",cases:{},hasDefault:!0};else if(N.type==="parallel")M={...T,branches:[],maxConcurrent:0};else if(N.type==="try")M={...T,hasCatch:!0,hasFinally:!1};else if(N.type==="if")M={...T,condition:N.condition||"true",hasElse:!0};else if(N.type==="map"||N.type==="filter"||N.type==="reduce"){const z=N.items||(($=N.inputs)==null?void 0:$.items)||"[]";M={...T,transformType:N.type,items:z==="unknown"?"[]":z,itemVariable:(U=N.inputs)==null?void 0:U.itemVariable,expression:(D=N.inputs)==null?void 0:D.expression,condition:N.condition}}else M={...T,condition:N.condition,items:N.items,maxIterations:N.maxIterations,variables:N.variables};const P={id:N.id,type:R,position:{x:v,y:w},data:M};if(t.push(P),S){const z={id:`e-${S}-${N.id}`,source:S,target:N.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};N.conditions&&N.conditions.length>0&&(z.label="conditional",z.labelStyle={fill:"#a0a0c0",fontSize:10},z.labelBgStyle={fill:"#232340"}),n.push(z)}if((N.type==="while"||N.type==="for_each"||N.type==="for")&&N.steps&&N.steps.length>0){const z=v+350,V=w+20,{lastNodeId:Y,endY:F}=c(N.steps,z,V,N.id),q=N.type==="while"?"#fb923c":"#f093fb";n.push({id:`e-${N.id}-body-start`,source:N.id,target:N.steps[0].id,sourceHandle:"body",type:"smoothstep",animated:!0,style:{stroke:q,strokeWidth:2},label:N.type==="while"?"do":"each",labelStyle:{fill:q,fontSize:10},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}}),Y&&n.push({id:`e-${Y}-${N.id}-loop-back`,source:Y,target:N.id,targetHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:q,strokeWidth:2,strokeDasharray:"5,5"}}),w=Math.max(w+180,F)}else w+=180;S=N.id}),{lastNodeId:S,endY:w}};let u=0,d=null;if(e.triggers&&e.triggers.length>0){const g=e.triggers[0];d=`trigger-${e.metadata.id}`,t.push({id:d,type:"trigger",position:{x:250,y:u},data:{id:d,name:e.metadata.name,type:g.type||"manual",cron:g.cron,path:g.path,events:g.events,active:!0}}),u+=180}const{lastNodeId:m,endY:p}=c(a,250,u);if(d&&a.length>0&&n.push({id:`e-${d}-${a[0].id}`,source:d,target:a[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}}),a.length>0){const g=`output-${e.metadata.id}`,v=S=>{let N=[];return S.forEach(k=>{N.push(k),k.steps&&(N=N.concat(v(k.steps)))}),N},b=v(a),x=b.filter(S=>S.outputVariable).map(S=>S.outputVariable);t.push({id:g,type:"output",position:{x:250,y:p},data:{id:g,name:"Workflow Output",variables:x,status:"pending"}}),m&&n.push({id:`e-${m}-${g}`,source:m,target:g,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}});const w=OJ(b);n.push(...w)}return{nodes:t,edges:n}}function OJ(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{PJ(r.inputs).forEach(o=>{const a=o.split(".")[0],c=n.get(a);if(c&&c!==r.id){const u=`data-${c}-${r.id}-${a}`;t.find(d=>d.id===u)||t.push({id:u,source:c,target:r.id,type:"smoothstep",animated:!0,style:{stroke:"#5bc0de",strokeWidth:1,strokeDasharray:"5,5"},label:a,labelStyle:{fill:"#5bc0de",fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}})}})}),t}function PJ(e){const t=[];if(!e)return t;const n=/\{\{\s*([^}]+)\s*\}\}/g;function r(s){if(typeof s=="string"){let o;for(;(o=n.exec(s))!==null;){const c=o[1].trim().split(".")[0].replace(/\[.*\]/,"");c!=="inputs"&&!t.includes(c)&&t.push(c)}}else Array.isArray(s)?s.forEach(r):s&&typeof s=="object"&&Object.values(s).forEach(r)}return Object.values(e).forEach(r),t}function LJ(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:u,createWorkflow:d,deleteWorkflow:m}=Mr(),{setNodes:p,setEdges:g}=xo(),{subscribeToWorkflow:v,unsubscribeFromWorkflow:b,connected:x}=$4({onWorkflowUpdated:j=>{j.path===t&&c(j.path),(j.event==="add"||j.event==="remove")&&o()}});A.useEffect(()=>{o()},[o]),A.useEffect(()=>{if(x&&t)return v(t),()=>{b(t)}},[x,t,v,b]),A.useEffect(()=>{if(n){const{nodes:j,edges:R}=MJ(n);p(j),g(R)}},[n,p,g]);const w=A.useCallback(j=>{a(j)},[a]),S=A.useCallback(async j=>{j&&await u(j)},[u]),N=A.useCallback(async j=>{await d(j)},[d]),k=A.useCallback(async j=>{await m(j)},[m]),C=A.useCallback(j=>{if(!n)return[];const R=[];if(n.inputs)for(const T of Object.keys(n.inputs))R.push(`inputs.${T}`);for(let T=0;T<j&&T<n.steps.length;T++){const M=n.steps[T];M.outputVariable&&R.push(M.outputVariable)}return R},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,selectWorkflow:w,saveWorkflow:S,createWorkflow:N,deleteWorkflow:k,refreshWorkflows:o,getAvailableVariables:C}}function DJ(){const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=LJ(),{isNewStepOpen:s,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=x4(),{pendingChanges:u,acceptChanges:d,rejectChanges:m}=qb(),{isOpen:p,setIsOpen:g,openShortcuts:v}=LQ(),{breadcrumbs:b,popToIndex:x,resetNavigation:w}=Aw(),{loadWorkflow:S}=Mr(),N=A.useCallback((Ie,be)=>{x(be),S(Ie.path||"")},[x,S]),{connected:k}=$4({onWorkflowUpdated:()=>{r()}}),{isExecuting:C,isPaused:j,currentRunId:R,runs:T,startExecution:M,updateStepStatus:P,completeExecution:B,addLog:O,pauseExecution:$,resumeExecution:U,cancelExecution:D,debug:z,enableDebugMode:V,disableDebugMode:Y,toggleBreakpoint:F,clearAllBreakpoints:q,stepOver:G,stepInto:L,stepOut:W,addWatchExpression:oe,removeWatchExpression:K}=S4(),{breakpoint:J,setBreakpoint:te,sidebarOpen:X,setSidebarOpen:ee,propertiesPanelOpen:ie,setPropertiesPanelOpen:ue}=$b();A.useEffect(()=>{const Ie=()=>{const be=mQ(window.innerWidth);be!==J&&te(be)};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[J,te]);const[me,ye]=A.useState("pending"),[pe,_e]=A.useState([]),[xe,Ce]=A.useState([]),[Ne,tt]=A.useState(null),Le=A.useRef(null),vt=A.useCallback(()=>{a()},[a]),xt=A.useCallback(Ie=>{if(!e)return;const be={...e,steps:[...e.steps,Ie]};n(be),console.log("Created step:",Ie)},[e,n]),it=A.useCallback(()=>{var ot;if(C){Le.current&&D(Le.current),ye("cancelled"),Ce(Ve=>[...Ve,"Execution cancelled by user"]);return}if(!e)return;const Ie=((ot=e.metadata)==null?void 0:ot.name)||"Untitled Workflow",be=M(t||"unknown",Ie);Le.current=be,ye("running"),tt(null),Ce(["Starting workflow execution..."]),_e(e.steps.map(Ve=>({stepId:Ve.id,stepName:Ve.name||Ve.id,status:"pending"}))),We(e.steps,be)},[C,e,t,M,D]),We=A.useCallback(async(Ie,be)=>{for(let ot=0;ot<Ie.length;ot++){const Ve=Ie[ot],Ut=Ve.name||Ve.id;tt(Ve.id),_e(Lt=>Lt.map(tn=>tn.stepId===Ve.id?{...tn,status:"running"}:tn)),Ce(Lt=>[...Lt,"Executing step: "+Ut]),P(be,Ve.id,"running"),O(be,"Executing step: "+Ut),await new Promise(Lt=>setTimeout(Lt,1e3+Math.random()*1e3));const hn=Math.random()>.1,Ot=Math.floor(1e3+Math.random()*1e3),Pt=hn?void 0:"Simulated error";_e(Lt=>Lt.map(tn=>tn.stepId===Ve.id?{...tn,status:hn?"completed":"failed",duration:Ot,error:Pt}:tn));const hi=hn?'Step "'+Ut+'" completed':'Step "'+Ut+'" failed';if(Ce(Lt=>[...Lt,hi]),P(be,Ve.id,hn?"completed":"failed",void 0,Pt),O(be,hi),!hn){ye("failed"),B(be,"failed"),Le.current=null;return}}ye("completed"),Ce(ot=>[...ot,"Workflow completed successfully!"]),B(be,"completed"),Le.current=null},[P,O,B]),It=A.useCallback(()=>{e&&n(e)},[e,n]),Mt=A.useCallback(()=>{if(b.length>1){const Ie=b.length-2,be=b[Ie];x(Ie),S(be.path)}},[b,x,S]),Vt=A.useCallback(()=>{if(b.length>1){const Ie=b[0];x(0),S(Ie.path)}},[b,x,S]);return A.useEffect(()=>{const Ie=be=>{if(be.target instanceof HTMLInputElement||be.target instanceof HTMLTextAreaElement)return;const ot=be.metaKey||be.ctrlKey;ot&&be.key==="s"&&(be.preventDefault(),It()),ot&&be.key==="Enter"&&(be.preventDefault(),it()),be.key==="n"&&!ot&&!be.shiftKey&&!be.altKey&&(be.preventDefault(),vt()),ot&&be.key==="ArrowLeft"&&(be.preventDefault(),Mt()),ot&&be.key==="ArrowUp"&&(be.preventDefault(),Vt()),be.key==="F9"&&(be.preventDefault(),z.enabled?Y():V()),be.key==="F10"&&z.enabled&&j&&(be.preventDefault(),G()),be.key==="F11"&&!be.shiftKey&&z.enabled&&j&&(be.preventDefault(),L()),be.key==="F11"&&be.shiftKey&&z.enabled&&j&&(be.preventDefault(),W()),be.key==="F5"&&j&&(be.preventDefault(),U())};return window.addEventListener("keydown",Ie),()=>window.removeEventListener("keydown",Ie)},[It,it,vt,Mt,Vt,z.enabled,j,V,Y,G,L,W,U]),h.jsx(YT,{children:h.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-canvas-bg",children:[h.jsx(yQ,{}),h.jsxs("div",{className:"flex flex-1 flex-col relative",children:[J==="mobile"&&h.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-node-border bg-panel-bg",children:[h.jsx("button",{onClick:()=>ee(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open menu",children:h.jsx(e6,{className:"w-5 h-5 text-gray-400"})}),h.jsx("h1",{className:"text-sm font-medium text-white",children:"Marktoflow"}),h.jsx("button",{onClick:()=>ue(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open properties",children:h.jsx(i6,{className:"w-5 h-5 text-gray-400"})})]}),J!=="mobile"&&h.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[h.jsx($Q,{showLabel:!0}),h.jsx(DQ,{onClick:v}),h.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs ${k?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-success":"bg-error"}`}),k?"Connected":"Disconnected"]})]}),h.jsx(sQ,{onAddStep:vt,onExecute:it,onSave:It,isExecuting:C}),h.jsx(qQ,{items:b,onNavigate:N}),h.jsxs("div",{className:"flex-1 relative",children:[h.jsx(nQ,{}),h.jsx(iQ,{isExecuting:C,isPaused:j,workflowStatus:me,currentStepId:Ne,steps:pe,logs:xe,onPause:()=>$(),onResume:()=>U(),onStop:()=>{Le.current&&(D(Le.current),Le.current=null),ye("cancelled")},onStepOver:()=>G(),onClose:()=>{ye("pending"),_e([]),Ce([])},debug:z,onToggleDebugMode:()=>{z.enabled?Y():V()},onToggleBreakpoint:Ie=>F(Ie),onStepInto:()=>L(),onStepOut:()=>W(),onClearBreakpoints:()=>q(),onAddWatchExpression:Ie=>oe(Ie),onRemoveWatchExpression:Ie=>K(Ie)})]}),h.jsx(RQ,{})]}),h.jsx(SQ,{}),h.jsx(MQ,{open:s,onOpenChange:Ie=>{Ie||c()},onCreateStep:xt,position:o||void 0}),u&&h.jsx(TQ,{open:!!u,onOpenChange:()=>m(),originalWorkflow:e,modifiedWorkflow:u,explanation:"AI has suggested the following changes to your workflow.",onAccept:d,onReject:m}),h.jsx(PQ,{open:p,onOpenChange:g})]})})}C3.createRoot(document.getElementById("root")).render(h.jsx(pt.StrictMode,{children:h.jsx(DJ,{})}));
|
|
703
|
-
//# sourceMappingURL=index-CIvjE2Ts.js.map
|