@agentic-surfaces/server 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var hk=Object.defineProperty;var pk=(e,t,n)=>t in e?hk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>pk(e,typeof t!="symbol"?t+"":t,n);function mk(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>i[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"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function du(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Af={exports:{}},ds={},Mf={exports:{}},Pe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var dk=Object.defineProperty;var hk=(e,t,n)=>t in e?dk(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Yg;function
|
|
9
|
+
*/var Yg;function gk(){if(Yg)return Pe;Yg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.iterator;function g(D){return D===null||typeof D!="object"?null:(D=h&&D[h]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function b(D,W,V){this.props=D,this.context=W,this.refs=w,this.updater=V||v}b.prototype.isReactComponent={},b.prototype.setState=function(D,W){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,W,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function k(){}k.prototype=b.prototype;function N(D,W,V){this.props=D,this.context=W,this.refs=w,this.updater=V||v}var E=N.prototype=new k;E.constructor=N,S(E,b.prototype),E.isPureReactComponent=!0;var _=Array.isArray,A=Object.prototype.hasOwnProperty,M={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function C(D,W,V){var K,Q={},re=null,se=null;if(W!=null)for(K in W.ref!==void 0&&(se=W.ref),W.key!==void 0&&(re=""+W.key),W)A.call(W,K)&&!L.hasOwnProperty(K)&&(Q[K]=W[K]);var ee=arguments.length-2;if(ee===1)Q.children=V;else if(1<ee){for(var oe=Array(ee),de=0;de<ee;de++)oe[de]=arguments[de+2];Q.children=oe}if(D&&D.defaultProps)for(K in ee=D.defaultProps,ee)Q[K]===void 0&&(Q[K]=ee[K]);return{$$typeof:e,type:D,key:re,ref:se,props:Q,_owner:M.current}}function I(D,W){return{$$typeof:e,type:D.type,key:W,ref:D.ref,props:D.props,_owner:D._owner}}function F(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function R(D){var W={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(V){return W[V]})}var $=/\/+/g;function Z(D,W){return typeof D=="object"&&D!==null&&D.key!=null?R(""+D.key):W.toString(36)}function j(D,W,V,K,Q){var re=typeof D;(re==="undefined"||re==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(re){case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0}}if(se)return se=D,Q=Q(se),D=K===""?"."+Z(se,0):K,_(Q)?(V="",D!=null&&(V=D.replace($,"$&/")+"/"),j(Q,W,V,"",function(de){return de})):Q!=null&&(F(Q)&&(Q=I(Q,V+(!Q.key||se&&se.key===Q.key?"":(""+Q.key).replace($,"$&/")+"/")+D)),W.push(Q)),1;if(se=0,K=K===""?".":K+":",_(D))for(var ee=0;ee<D.length;ee++){re=D[ee];var oe=K+Z(re,ee);se+=j(re,W,V,oe,Q)}else if(oe=g(D),typeof oe=="function")for(D=oe.call(D),ee=0;!(re=D.next()).done;)re=re.value,oe=K+Z(re,ee++),se+=j(re,W,V,oe,Q);else if(re==="object")throw W=String(D),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return se}function G(D,W,V){if(D==null)return D;var K=[],Q=0;return j(D,K,"","",function(re){return W.call(V,re,Q++)}),K}function q(D){if(D._status===-1){var W=D._result;W=W(),W.then(function(V){(D._status===0||D._status===-1)&&(D._status=1,D._result=V)},function(V){(D._status===0||D._status===-1)&&(D._status=2,D._result=V)}),D._status===-1&&(D._status=0,D._result=W)}if(D._status===1)return D._result.default;throw D._result}var J={current:null},Y={transition:null},U={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:Y,ReactCurrentOwner:M};function B(){throw Error("act(...) is not supported in production builds of React.")}return Pe.Children={map:G,forEach:function(D,W,V){G(D,function(){W.apply(this,arguments)},V)},count:function(D){var W=0;return G(D,function(){W++}),W},toArray:function(D){return G(D,function(W){return W})||[]},only:function(D){if(!F(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Pe.Component=b,Pe.Fragment=n,Pe.Profiler=s,Pe.PureComponent=N,Pe.StrictMode=i,Pe.Suspense=f,Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,Pe.act=B,Pe.cloneElement=function(D,W,V){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var K=S({},D.props),Q=D.key,re=D.ref,se=D._owner;if(W!=null){if(W.ref!==void 0&&(re=W.ref,se=M.current),W.key!==void 0&&(Q=""+W.key),D.type&&D.type.defaultProps)var ee=D.type.defaultProps;for(oe in W)A.call(W,oe)&&!L.hasOwnProperty(oe)&&(K[oe]=W[oe]===void 0&&ee!==void 0?ee[oe]:W[oe])}var oe=arguments.length-2;if(oe===1)K.children=V;else if(1<oe){ee=Array(oe);for(var de=0;de<oe;de++)ee[de]=arguments[de+2];K.children=ee}return{$$typeof:e,type:D.type,key:Q,ref:re,props:K,_owner:se}},Pe.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:l,_context:D},D.Consumer=D},Pe.createElement=C,Pe.createFactory=function(D){var W=C.bind(null,D);return W.type=D,W},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(D){return{$$typeof:c,render:D}},Pe.isValidElement=F,Pe.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:q}},Pe.memo=function(D,W){return{$$typeof:d,type:D,compare:W===void 0?null:W}},Pe.startTransition=function(D){var W=Y.transition;Y.transition={};try{D()}finally{Y.transition=W}},Pe.unstable_act=B,Pe.useCallback=function(D,W){return J.current.useCallback(D,W)},Pe.useContext=function(D){return J.current.useContext(D)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(D){return J.current.useDeferredValue(D)},Pe.useEffect=function(D,W){return J.current.useEffect(D,W)},Pe.useId=function(){return J.current.useId()},Pe.useImperativeHandle=function(D,W,V){return J.current.useImperativeHandle(D,W,V)},Pe.useInsertionEffect=function(D,W){return J.current.useInsertionEffect(D,W)},Pe.useLayoutEffect=function(D,W){return J.current.useLayoutEffect(D,W)},Pe.useMemo=function(D,W){return J.current.useMemo(D,W)},Pe.useReducer=function(D,W,V){return J.current.useReducer(D,W,V)},Pe.useRef=function(D){return J.current.useRef(D)},Pe.useState=function(D){return J.current.useState(D)},Pe.useSyncExternalStore=function(D,W,V){return J.current.useSyncExternalStore(D,W,V)},Pe.useTransition=function(){return J.current.useTransition()},Pe.version="18.3.1",Pe}var Kg;function zs(){return Kg||(Kg=1,Mf.exports=gk()),Mf.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var dk=Object.defineProperty;var hk=(e,t,n)=>t in e?dk(e,t,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Gg;function
|
|
17
|
+
*/var Gg;function yk(){if(Gg)return ds;Gg=1;var e=zs(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(c,f,d){var m,h={},g=null,v=null;d!==void 0&&(g=""+d),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(v=f.ref);for(m in f)i.call(f,m)&&!l.hasOwnProperty(m)&&(h[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)h[m]===void 0&&(h[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:v,props:h,_owner:s.current}}return ds.Fragment=n,ds.jsx=a,ds.jsxs=a,ds}var Xg;function vk(){return Xg||(Xg=1,Af.exports=yk()),Af.exports}var P=vk(),O=zs();const Ph=du(O),Ih=mk({__proto__:null,default:Ph},[O]);var ha={},Lf={exports:{}},At={},Rf={exports:{}},Df={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var dk=Object.defineProperty;var hk=(e,t,n)=>t in e?dk(e,t,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Qg;function
|
|
25
|
+
*/var Qg;function wk(){return Qg||(Qg=1,(function(e){function t(Y,U){var B=Y.length;Y.push(U);e:for(;0<B;){var D=B-1>>>1,W=Y[D];if(0<s(W,U))Y[D]=U,Y[B]=W,B=D;else break e}}function n(Y){return Y.length===0?null:Y[0]}function i(Y){if(Y.length===0)return null;var U=Y[0],B=Y.pop();if(B!==U){Y[0]=B;e:for(var D=0,W=Y.length,V=W>>>1;D<V;){var K=2*(D+1)-1,Q=Y[K],re=K+1,se=Y[re];if(0>s(Q,B))re<W&&0>s(se,Q)?(Y[D]=se,Y[re]=B,D=re):(Y[D]=Q,Y[K]=B,D=K);else if(re<W&&0>s(se,B))Y[D]=se,Y[re]=B,D=re;else break e}}return U}function s(Y,U){var B=Y.sortIndex-U.sortIndex;return B!==0?B:Y.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var f=[],d=[],m=1,h=null,g=3,v=!1,S=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,k=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 E(Y){for(var U=n(d);U!==null;){if(U.callback===null)i(d);else if(U.startTime<=Y)i(d),U.sortIndex=U.expirationTime,t(f,U);else break;U=n(d)}}function _(Y){if(w=!1,E(Y),!S)if(n(f)!==null)S=!0,q(A);else{var U=n(d);U!==null&&J(_,U.startTime-Y)}}function A(Y,U){S=!1,w&&(w=!1,k(C),C=-1),v=!0;var B=g;try{for(E(U),h=n(f);h!==null&&(!(h.expirationTime>U)||Y&&!R());){var D=h.callback;if(typeof D=="function"){h.callback=null,g=h.priorityLevel;var W=D(h.expirationTime<=U);U=e.unstable_now(),typeof W=="function"?h.callback=W:h===n(f)&&i(f),E(U)}else i(f);h=n(f)}if(h!==null)var V=!0;else{var K=n(d);K!==null&&J(_,K.startTime-U),V=!1}return V}finally{h=null,g=B,v=!1}}var M=!1,L=null,C=-1,I=5,F=-1;function R(){return!(e.unstable_now()-F<I)}function $(){if(L!==null){var Y=e.unstable_now();F=Y;var U=!0;try{U=L(!0,Y)}finally{U?Z():(M=!1,L=null)}}else M=!1}var Z;if(typeof N=="function")Z=function(){N($)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=$,Z=function(){G.postMessage(null)}}else Z=function(){b($,0)};function q(Y){L=Y,M||(M=!0,Z())}function J(Y,U){C=b(function(){Y(e.unstable_now())},U)}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(Y){Y.callback=null},e.unstable_continueExecution=function(){S||v||(S=!0,q(A))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(Y){switch(g){case 1:case 2:case 3:var U=3;break;default:U=g}var B=g;g=U;try{return Y()}finally{g=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,U){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var B=g;g=Y;try{return U()}finally{g=B}},e.unstable_scheduleCallback=function(Y,U,B){var D=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?D+B:D):B=D,Y){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=B+W,Y={id:m++,callback:U,priorityLevel:Y,startTime:B,expirationTime:W,sortIndex:-1},B>D?(Y.sortIndex=B,t(d,Y),n(f)===null&&Y===n(d)&&(w?(k(C),C=-1):w=!0,J(_,B-D))):(Y.sortIndex=W,t(f,Y),S||v||(S=!0,q(A))),Y},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(Y){var U=g;return function(){var B=g;g=U;try{return Y.apply(this,arguments)}finally{g=B}}}})(Df)),Df}var Jg;function xk(){return Jg||(Jg=1,Rf.exports=wk()),Rf.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var dk=Object.defineProperty;var hk=(e,t,n)=>t in e?dk(e,t,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Zg;function
|
|
33
|
+
*/var Zg;function bk(){if(Zg)return At;Zg=1;var e=zs(),t=xk();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function l(r,o){a(r,o),a(r+"Capture",o)}function a(r,o){for(s[r]=o,r=0;r<o.length;r++)i.add(o[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=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={},h={};function g(r){return f.call(h,r)?!0:f.call(m,r)?!1:d.test(r)?h[r]=!0:(m[r]=!0,!1)}function v(r,o,u,p){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,o,u,p){if(o===null||typeof o>"u"||v(r,o,u,p))return!0;if(p)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function w(r,o,u,p,y,x,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=o,this.sanitizeURL=x,this.removeEmptyString=T}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){b[r]=new w(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];b[o]=new w(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){b[r]=new w(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){b[r]=new w(r,2,!1,r,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(r){b[r]=new w(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){b[r]=new w(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){b[r]=new w(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){b[r]=new w(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){b[r]=new w(r,5,!1,r.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function N(r){return r[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(r){var o=r.replace(k,N);b[o]=new w(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(k,N);b[o]=new w(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(k,N);b[o]=new w(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,o,u,p){var y=b.hasOwnProperty(o)?b[o]:null;(y!==null?y.type!==0:p||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(S(o,u,y,p)&&(u=null),p||y===null?g(o)&&(u===null?r.removeAttribute(o):r.setAttribute(o,""+u)):y.mustUseProperty?r[y.propertyName]=u===null?y.type===3?!1:"":u:(o=y.attributeName,p=y.attributeNamespace,u===null?r.removeAttribute(o):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,p?r.setAttributeNS(p,o,u):r.setAttribute(o,u))))}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),R=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),Y=Symbol.iterator;function U(r){return r===null||typeof r!="object"?null:(r=Y&&r[Y]||r["@@iterator"],typeof r=="function"?r:null)}var B=Object.assign,D;function W(r){if(D===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);D=o&&o[1]||""}return`
|
|
34
34
|
`+D+r}var V=!1;function K(r,o){if(!r||V)return"";V=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(ie){var p=ie}Reflect.construct(r,[],o)}else{try{o.call()}catch(ie){p=ie}r.call(o.prototype)}else{try{throw Error()}catch(ie){p=ie}r()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var y=ie.stack.split(`
|
|
35
35
|
`),x=p.stack.split(`
|
|
36
36
|
`),T=y.length-1,z=x.length-1;1<=T&&0<=z&&y[T]!==x[z];)z--;for(;1<=T&&0<=z;T--,z--)if(y[T]!==x[z]){if(T!==1||z!==1)do if(T--,z--,0>z||y[T]!==x[z]){var H=`
|
|
37
|
-
`+y[T].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),H}while(1<=T&&0<=z);break}}}finally{V=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?W(r):""}function Q(r){switch(r.tag){case 5:return W(r.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return r=K(r.type,!1),r;case 11:return r=K(r.type.render,!1),r;case 1:return r=K(r.type,!0),r;default:return""}}function re(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case M:return"Portal";case A:return"Profiler";case C:return"StrictMode";case Z:return"Suspense";case j:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case L:return(r.displayName||"Context")+".Consumer";case F:return(r._context.displayName||"Context")+".Provider";case $:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case G:return o=r.displayName||null,o!==null?o:re(r.type)||"Memo";case q:o=r._payload,r=r._init;try{return re(r(o))}catch{}}return null}function se(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(o);case 8:return o===C?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ee(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function oe(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function de(r){var o=oe(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),p=""+r[o];if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,x=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){p=""+T,x.call(this,T)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(T){p=""+T},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function xe(r){r._valueTracker||(r._valueTracker=de(r))}function he(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),p="";return r&&(p=oe(r)?r.checked?"true":"false":r.value),r=p,r!==u?(o.setValue(r),!0):!1}function fe(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function ke(r,o){var u=o.checked;return B({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ie(r,o){var u=o.defaultValue==null?"":o.defaultValue,p=o.checked!=null?o.checked:o.defaultChecked;u=ee(o.value!=null?o.value:u),r._wrapperState={initialChecked:p,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Ae(r,o){o=o.checked,o!=null&&E(r,"checked",o,!1)}function ze(r,o){Ae(r,o);var u=ee(o.value),p=o.type;if(u!=null)p==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(p==="submit"||p==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?_t(r,o.type,u):o.hasOwnProperty("defaultValue")&&_t(r,o.type,ee(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function wt(r,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var p=o.type;if(!(p!=="submit"&&p!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,u||o===r.value||(r.value=o),r.defaultValue=o}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function _t(r,o,u){(o!=="number"||fe(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var ht=Array.isArray;function pt(r,o,u,p){if(r=r.options,o){o={};for(var y=0;y<u.length;y++)o["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=o.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+ee(u),o=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}o!==null||r[y].disabled||(o=r[y])}o!==null&&(o.selected=!0)}}function Dn(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function bn(r,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(ht(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:ee(u)}}function Sn(r,o){var u=ee(o.value),p=ee(o.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),o.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),p!=null&&(r.defaultValue=""+p)}function Nt(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function Ht(r){switch(r){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 Rt(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?Ht(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var qt,Gs=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,p,y){MSApp.execUnsafeLocalFunction(function(){return r(o,u,p,y)})}:r})(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(qt=qt||document.createElement("div"),qt.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=qt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function jn(r,o){if(o){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=o;return}}r.textContent=o}var Ar={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},zu=["Webkit","ms","Moz","O"];Object.keys(Ar).forEach(function(r){zu.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),Ar[o]=Ar[r]})});function Xs(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||Ar.hasOwnProperty(r)&&Ar[r]?(""+o).trim():o+"px"}function Qs(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var p=u.indexOf("--")===0,y=Xs(u,o[u],p);u==="float"&&(u="cssFloat"),p?r.setProperty(u,y):r[u]=y}}var Fu=B({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 ko(r,o){if(o){if(Fu[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Eo(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){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 No(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Co=null,tr=null,nr=null;function Js(r){if(r=Qo(r)){if(typeof Co!="function")throw Error(n(280));var o=r.stateNode;o&&(o=Tl(o),Co(r.stateNode,r.type,o))}}function Zs(r){tr?nr?nr.push(r):nr=[r]:tr=r}function el(){if(tr){var r=tr,o=nr;if(nr=tr=null,Js(r),o)for(r=0;r<o.length;r++)Js(o[r])}}function tl(r,o){return r(o)}function nl(){}var To=!1;function rl(r,o,u){if(To)return r(o,u);To=!0;try{return tl(r,o,u)}finally{To=!1,(tr!==null||nr!==null)&&(nl(),el())}}function Mr(r,o){var u=r.stateNode;if(u===null)return null;var p=Tl(u);if(p===null)return null;u=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Oo=!1;if(c)try{var Lr={};Object.defineProperty(Lr,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",Lr,Lr),window.removeEventListener("test",Lr,Lr)}catch{Oo=!1}function Bu(r,o,u,p,y,x,T,z,H){var ie=Array.prototype.slice.call(arguments,3);try{o.apply(u,ie)}catch(ae){this.onError(ae)}}var Rr=!1,di=null,hi=!1,Po=null,Vu={onError:function(r){Rr=!0,di=r}};function Wu(r,o,u,p,y,x,T,z,H){Rr=!1,di=null,Bu.apply(Vu,arguments)}function Uu(r,o,u,p,y,x,T,z,H){if(Wu.apply(this,arguments),Rr){if(Rr){var ie=di;Rr=!1,di=null}else throw Error(n(198));hi||(hi=!0,Po=ie)}}function kn(r){var o=r,u=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(u=o.return),r=o.return;while(r)}return o.tag===3?u:null}function Io(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function Ao(r){if(kn(r)!==r)throw Error(n(188))}function Hu(r){var o=r.alternate;if(!o){if(o=kn(r),o===null)throw Error(n(188));return o!==r?null:r}for(var u=r,p=o;;){var y=u.return;if(y===null)break;var x=y.alternate;if(x===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return Ao(y),r;if(x===p)return Ao(y),o;x=x.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=x;else{for(var T=!1,z=y.child;z;){if(z===u){T=!0,u=y,p=x;break}if(z===p){T=!0,p=y,u=x;break}z=z.sibling}if(!T){for(z=x.child;z;){if(z===u){T=!0,u=x,p=y;break}if(z===p){T=!0,p=x,u=y;break}z=z.sibling}if(!T)throw Error(n(189))}}if(u.alternate!==p)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:o}function il(r){return r=Hu(r),r!==null?ol(r):null}function ol(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=ol(r);if(o!==null)return o;r=r.sibling}return null}var sl=t.unstable_scheduleCallback,ll=t.unstable_cancelCallback,qu=t.unstable_shouldYield,al=t.unstable_requestPaint,qe=t.unstable_now,Yu=t.unstable_getCurrentPriorityLevel,Mo=t.unstable_ImmediatePriority,ul=t.unstable_UserBlockingPriority,pi=t.unstable_NormalPriority,Ku=t.unstable_LowPriority,cl=t.unstable_IdlePriority,mi=null,Dt=null;function Gu(r){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(mi,r,void 0,(r.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:Ju,Xu=Math.log,Qu=Math.LN2;function Ju(r){return r>>>=0,r===0?32:31-(Xu(r)/Qu|0)|0}var gi=64,yi=4194304;function Dr(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function $n(r,o){var u=r.pendingLanes;if(u===0)return 0;var p=0,y=r.suspendedLanes,x=r.pingedLanes,T=u&268435455;if(T!==0){var z=T&~y;z!==0?p=Dr(z):(x&=T,x!==0&&(p=Dr(x)))}else T=u&~y,T!==0?p=Dr(T):x!==0&&(p=Dr(x));if(p===0)return 0;if(o!==0&&o!==p&&(o&y)===0&&(y=p&-p,x=o&-o,y>=x||y===16&&(x&4194240)!==0))return o;if((p&4)!==0&&(p|=u&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=p;0<o;)u=31-jt(o),y=1<<u,p|=r[u],o&=~y;return p}function Zu(r,o){switch(r){case 1:case 2:case 4:return o+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 o+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 fl(r,o){for(var u=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,x=r.pendingLanes;0<x;){var T=31-jt(x),z=1<<T,H=y[T];H===-1?((z&u)===0||(z&p)!==0)&&(y[T]=Zu(z,o)):H<=o&&(r.expiredLanes|=z),x&=~z}}function Lo(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function dl(){var r=gi;return gi<<=1,(gi&4194240)===0&&(gi=64),r}function jr(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function $r(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-jt(o),r[o]=u}function ec(r,o){var u=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var p=r.eventTimes;for(r=r.expirationTimes;0<u;){var y=31-jt(u),x=1<<y;o[y]=0,p[y]=-1,r[y]=-1,u&=~x}}function vi(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var p=31-jt(u),y=1<<p;y&o|r[p]&o&&(r[p]|=o),u&=~y}}var De=0;function _p(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Np,tc,Cp,Tp,Op,nc=!1,hl=[],rr=null,ir=null,or=null,Ro=new Map,Do=new Map,sr=[],Lb="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 Pp(r,o){switch(r){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ro.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(o.pointerId)}}function jo(r,o,u,p,y,x){return r===null||r.nativeEvent!==x?(r={blockedOn:o,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[y]},o!==null&&(o=Qo(o),o!==null&&tc(o)),r):(r.eventSystemFlags|=p,o=r.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),r)}function Rb(r,o,u,p,y){switch(o){case"focusin":return rr=jo(rr,r,o,u,p,y),!0;case"dragenter":return ir=jo(ir,r,o,u,p,y),!0;case"mouseover":return or=jo(or,r,o,u,p,y),!0;case"pointerover":var x=y.pointerId;return Ro.set(x,jo(Ro.get(x)||null,r,o,u,p,y)),!0;case"gotpointercapture":return x=y.pointerId,Do.set(x,jo(Do.get(x)||null,r,o,u,p,y)),!0}return!1}function Ip(r){var o=zr(r.target);if(o!==null){var u=kn(o);if(u!==null){if(o=u.tag,o===13){if(o=Io(u),o!==null){r.blockedOn=o,Op(r.priority,function(){Cp(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pl(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=ic(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);_o=p,u.target.dispatchEvent(p),_o=null}else return o=Qo(u),o!==null&&tc(o),r.blockedOn=u,!1;o.shift()}return!0}function Ap(r,o,u){pl(r)&&u.delete(o)}function Db(){nc=!1,rr!==null&&pl(rr)&&(rr=null),ir!==null&&pl(ir)&&(ir=null),or!==null&&pl(or)&&(or=null),Ro.forEach(Ap),Do.forEach(Ap)}function $o(r,o){r.blockedOn===o&&(r.blockedOn=null,nc||(nc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Db)))}function zo(r){function o(y){return $o(y,r)}if(0<hl.length){$o(hl[0],r);for(var u=1;u<hl.length;u++){var p=hl[u];p.blockedOn===r&&(p.blockedOn=null)}}for(rr!==null&&$o(rr,r),ir!==null&&$o(ir,r),or!==null&&$o(or,r),Ro.forEach(o),Do.forEach(o),u=0;u<sr.length;u++)p=sr[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<sr.length&&(u=sr[0],u.blockedOn===null);)Ip(u),u.blockedOn===null&&sr.shift()}var wi=N.ReactCurrentBatchConfig,ml=!0;function jb(r,o,u,p){var y=De,x=wi.transition;wi.transition=null;try{De=1,rc(r,o,u,p)}finally{De=y,wi.transition=x}}function $b(r,o,u,p){var y=De,x=wi.transition;wi.transition=null;try{De=4,rc(r,o,u,p)}finally{De=y,wi.transition=x}}function rc(r,o,u,p){if(ml){var y=ic(r,o,u,p);if(y===null)bc(r,o,p,gl,u),Pp(r,p);else if(Rb(y,r,o,u,p))p.stopPropagation();else if(Pp(r,p),o&4&&-1<Lb.indexOf(r)){for(;y!==null;){var x=Qo(y);if(x!==null&&Np(x),x=ic(r,o,u,p),x===null&&bc(r,o,p,gl,u),x===y)break;y=x}y!==null&&p.stopPropagation()}else bc(r,o,p,null,u)}}var gl=null;function ic(r,o,u,p){if(gl=null,r=No(p),r=zr(r),r!==null)if(o=kn(r),o===null)r=null;else if(u=o.tag,u===13){if(r=Io(o),r!==null)return r;r=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return gl=r,null}function Mp(r){switch(r){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(Yu()){case Mo:return 1;case ul:return 4;case pi:case Ku:return 16;case cl:return 536870912;default:return 16}default:return 16}}var lr=null,oc=null,yl=null;function Lp(){if(yl)return yl;var r,o=oc,u=o.length,p,y="value"in lr?lr.value:lr.textContent,x=y.length;for(r=0;r<u&&o[r]===y[r];r++);var T=u-r;for(p=1;p<=T&&o[u-p]===y[x-p];p++);return yl=y.slice(r,1<p?1-p:void 0)}function vl(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function wl(){return!0}function Rp(){return!1}function $t(r){function o(u,p,y,x,T){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var z in r)r.hasOwnProperty(z)&&(u=r[z],this[z]=u?u(x):x[z]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wl:Rp,this.isPropagationStopped=Rp,this}return B(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=wl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),o}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sc=$t(xi),Fo=B({},xi,{view:0,detail:0}),zb=$t(Fo),lc,ac,Bo,xl=B({},Fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bo&&(Bo&&r.type==="mousemove"?(lc=r.screenX-Bo.screenX,ac=r.screenY-Bo.screenY):ac=lc=0,Bo=r),lc)},movementY:function(r){return"movementY"in r?r.movementY:ac}}),Dp=$t(xl),Fb=B({},xl,{dataTransfer:0}),Bb=$t(Fb),Vb=B({},Fo,{relatedTarget:0}),uc=$t(Vb),Wb=B({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ub=$t(Wb),Hb=B({},xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),qb=$t(Hb),Yb=B({},xi,{data:0}),jp=$t(Yb),Kb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gb={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"},Xb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qb(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Xb[r])?!!o[r]:!1}function cc(){return Qb}var Jb=B({},Fo,{key:function(r){if(r.key){var o=Kb[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=vl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Gb[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cc,charCode:function(r){return r.type==="keypress"?vl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?vl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Zb=$t(Jb),eS=B({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$p=$t(eS),tS=B({},Fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),nS=$t(tS),rS=B({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),iS=$t(rS),oS=B({},xl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),sS=$t(oS),lS=[9,13,27,32],fc=c&&"CompositionEvent"in window,Vo=null;c&&"documentMode"in document&&(Vo=document.documentMode);var aS=c&&"TextEvent"in window&&!Vo,zp=c&&(!fc||Vo&&8<Vo&&11>=Vo),Fp=" ",Bp=!1;function Vp(r,o){switch(r){case"keyup":return lS.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var bi=!1;function uS(r,o){switch(r){case"compositionend":return Wp(o);case"keypress":return o.which!==32?null:(Bp=!0,Fp);case"textInput":return r=o.data,r===Fp&&Bp?null:r;default:return null}}function cS(r,o){if(bi)return r==="compositionend"||!fc&&Vp(r,o)?(r=Lp(),yl=oc=lr=null,bi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return zp&&o.locale!=="ko"?null:o.data;default:return null}}var fS={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 Up(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!fS[r.type]:o==="textarea"}function Hp(r,o,u,p){Zs(p),o=_l(o,"onChange"),0<o.length&&(u=new sc("onChange","change",null,u,p),r.push({event:u,listeners:o}))}var Wo=null,Uo=null;function dS(r){um(r,0)}function bl(r){var o=Ni(r);if(he(o))return r}function hS(r,o){if(r==="change")return o}var qp=!1;if(c){var dc;if(c){var hc="oninput"in document;if(!hc){var Yp=document.createElement("div");Yp.setAttribute("oninput","return;"),hc=typeof Yp.oninput=="function"}dc=hc}else dc=!1;qp=dc&&(!document.documentMode||9<document.documentMode)}function Kp(){Wo&&(Wo.detachEvent("onpropertychange",Gp),Uo=Wo=null)}function Gp(r){if(r.propertyName==="value"&&bl(Uo)){var o=[];Hp(o,Uo,r,No(r)),rl(dS,o)}}function pS(r,o,u){r==="focusin"?(Kp(),Wo=o,Uo=u,Wo.attachEvent("onpropertychange",Gp)):r==="focusout"&&Kp()}function mS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bl(Uo)}function gS(r,o){if(r==="click")return bl(o)}function yS(r,o){if(r==="input"||r==="change")return bl(o)}function vS(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var on=typeof Object.is=="function"?Object.is:vS;function Ho(r,o){if(on(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var u=Object.keys(r),p=Object.keys(o);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!f.call(o,y)||!on(r[y],o[y]))return!1}return!0}function Xp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Qp(r,o){var u=Xp(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=o&&p>=o)return{node:u,offset:o-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Xp(u)}}function Jp(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Jp(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Zp(){for(var r=window,o=fe();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=fe(r.document)}return o}function pc(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function wS(r){var o=Zp(),u=r.focusedElem,p=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&Jp(u.ownerDocument.documentElement,u)){if(p!==null&&pc(u)){if(o=p.start,r=p.end,r===void 0&&(r=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(r,u.value.length);else if(r=(o=u.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var y=u.textContent.length,x=Math.min(p.start,y);p=p.end===void 0?x:Math.min(p.end,y),!r.extend&&x>p&&(y=p,p=x,x=y),y=Qp(u,x);var T=Qp(u,p);y&&T&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==T.node||r.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),r.removeAllRanges(),x>p?(r.addRange(o),r.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),r.addRange(o)))}}for(o=[],r=u;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)r=o[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var xS=c&&"documentMode"in document&&11>=document.documentMode,Si=null,mc=null,qo=null,gc=!1;function em(r,o,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;gc||Si==null||Si!==fe(p)||(p=Si,"selectionStart"in p&&pc(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),qo&&Ho(qo,p)||(qo=p,p=_l(mc,"onSelect"),0<p.length&&(o=new sc("onSelect","select",null,o,u),r.push({event:o,listeners:p}),o.target=Si)))}function Sl(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var ki={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionend:Sl("Transition","TransitionEnd")},yc={},tm={};c&&(tm=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function kl(r){if(yc[r])return yc[r];if(!ki[r])return r;var o=ki[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in tm)return yc[r]=o[u];return r}var nm=kl("animationend"),rm=kl("animationiteration"),im=kl("animationstart"),om=kl("transitionend"),sm=new Map,lm="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 ar(r,o){sm.set(r,o),l(o,[r])}for(var vc=0;vc<lm.length;vc++){var wc=lm[vc],bS=wc.toLowerCase(),SS=wc[0].toUpperCase()+wc.slice(1);ar(bS,"on"+SS)}ar(nm,"onAnimationEnd"),ar(rm,"onAnimationIteration"),ar(im,"onAnimationStart"),ar("dblclick","onDoubleClick"),ar("focusin","onFocus"),ar("focusout","onBlur"),ar(om,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="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(" "),kS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yo));function am(r,o,u){var p=r.type||"unknown-event";r.currentTarget=u,Uu(p,o,void 0,r),r.currentTarget=null}function um(r,o){o=(o&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],y=p.event;p=p.listeners;e:{var x=void 0;if(o)for(var T=p.length-1;0<=T;T--){var z=p[T],H=z.instance,ie=z.currentTarget;if(z=z.listener,H!==x&&y.isPropagationStopped())break e;am(y,z,ie),x=H}else for(T=0;T<p.length;T++){if(z=p[T],H=z.instance,ie=z.currentTarget,z=z.listener,H!==x&&y.isPropagationStopped())break e;am(y,z,ie),x=H}}}if(hi)throw r=Po,hi=!1,Po=null,r}function Fe(r,o){var u=o[Cc];u===void 0&&(u=o[Cc]=new Set);var p=r+"__bubble";u.has(p)||(cm(o,r,2,!1),u.add(p))}function xc(r,o,u){var p=0;o&&(p|=4),cm(u,r,p,o)}var El="_reactListening"+Math.random().toString(36).slice(2);function Ko(r){if(!r[El]){r[El]=!0,i.forEach(function(u){u!=="selectionchange"&&(kS.has(u)||xc(u,!1,r),xc(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[El]||(o[El]=!0,xc("selectionchange",!1,o))}}function cm(r,o,u,p){switch(Mp(o)){case 1:var y=jb;break;case 4:y=$b;break;default:y=rc}u=y.bind(null,o,u,r),y=void 0,!Oo||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(o,u,{capture:!0,passive:y}):r.addEventListener(o,u,!0):y!==void 0?r.addEventListener(o,u,{passive:y}):r.addEventListener(o,u,!1)}function bc(r,o,u,p,y){var x=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var T=p.tag;if(T===3||T===4){var z=p.stateNode.containerInfo;if(z===y||z.nodeType===8&&z.parentNode===y)break;if(T===4)for(T=p.return;T!==null;){var H=T.tag;if((H===3||H===4)&&(H=T.stateNode.containerInfo,H===y||H.nodeType===8&&H.parentNode===y))return;T=T.return}for(;z!==null;){if(T=zr(z),T===null)return;if(H=T.tag,H===5||H===6){p=x=T;continue e}z=z.parentNode}}p=p.return}rl(function(){var ie=x,ae=No(u),ue=[];e:{var le=sm.get(r);if(le!==void 0){var pe=sc,ve=r;switch(r){case"keypress":if(vl(u)===0)break e;case"keydown":case"keyup":pe=Zb;break;case"focusin":ve="focus",pe=uc;break;case"focusout":ve="blur",pe=uc;break;case"beforeblur":case"afterblur":pe=uc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Dp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Bb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=nS;break;case nm:case rm:case im:pe=Ub;break;case om:pe=iS;break;case"scroll":pe=zb;break;case"wheel":pe=sS;break;case"copy":case"cut":case"paste":pe=qb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=$p}var we=(o&4)!==0,Xe=!we&&r==="scroll",te=we?le!==null?le+"Capture":null:le;we=[];for(var X=ie,ne;X!==null;){ne=X;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Mr(X,te),ce!=null&&we.push(Go(X,ce,ne)))),Xe)break;X=X.return}0<we.length&&(le=new pe(le,ve,null,u,ae),ue.push({event:le,listeners:we}))}}if((o&7)===0){e:{if(le=r==="mouseover"||r==="pointerover",pe=r==="mouseout"||r==="pointerout",le&&u!==_o&&(ve=u.relatedTarget||u.fromElement)&&(zr(ve)||ve[zn]))break e;if((pe||le)&&(le=ae.window===ae?ae:(le=ae.ownerDocument)?le.defaultView||le.parentWindow:window,pe?(ve=u.relatedTarget||u.toElement,pe=ie,ve=ve?zr(ve):null,ve!==null&&(Xe=kn(ve),ve!==Xe||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(pe=null,ve=ie),pe!==ve)){if(we=Dp,ce="onMouseLeave",te="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&(we=$p,ce="onPointerLeave",te="onPointerEnter",X="pointer"),Xe=pe==null?le:Ni(pe),ne=ve==null?le:Ni(ve),le=new we(ce,X+"leave",pe,u,ae),le.target=Xe,le.relatedTarget=ne,ce=null,zr(ae)===ie&&(we=new we(te,X+"enter",ve,u,ae),we.target=ne,we.relatedTarget=Xe,ce=we),Xe=ce,pe&&ve)t:{for(we=pe,te=ve,X=0,ne=we;ne;ne=Ei(ne))X++;for(ne=0,ce=te;ce;ce=Ei(ce))ne++;for(;0<X-ne;)we=Ei(we),X--;for(;0<ne-X;)te=Ei(te),ne--;for(;X--;){if(we===te||te!==null&&we===te.alternate)break t;we=Ei(we),te=Ei(te)}we=null}else we=null;pe!==null&&fm(ue,le,pe,we,!1),ve!==null&&Xe!==null&&fm(ue,Xe,ve,we,!0)}}e:{if(le=ie?Ni(ie):window,pe=le.nodeName&&le.nodeName.toLowerCase(),pe==="select"||pe==="input"&&le.type==="file")var be=hS;else if(Up(le))if(qp)be=yS;else{be=mS;var Ee=pS}else(pe=le.nodeName)&&pe.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(be=gS);if(be&&(be=be(r,ie))){Hp(ue,be,u,ae);break e}Ee&&Ee(r,le,ie),r==="focusout"&&(Ee=le._wrapperState)&&Ee.controlled&&le.type==="number"&&_t(le,"number",le.value)}switch(Ee=ie?Ni(ie):window,r){case"focusin":(Up(Ee)||Ee.contentEditable==="true")&&(Si=Ee,mc=ie,qo=null);break;case"focusout":qo=mc=Si=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,em(ue,u,ae);break;case"selectionchange":if(xS)break;case"keydown":case"keyup":em(ue,u,ae)}var _e;if(fc)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else bi?Vp(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(zp&&u.locale!=="ko"&&(bi||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&bi&&(_e=Lp()):(lr=ae,oc="value"in lr?lr.value:lr.textContent,bi=!0)),Ee=_l(ie,Ce),0<Ee.length&&(Ce=new jp(Ce,r,null,u,ae),ue.push({event:Ce,listeners:Ee}),_e?Ce.data=_e:(_e=Wp(u),_e!==null&&(Ce.data=_e)))),(_e=aS?uS(r,u):cS(r,u))&&(ie=_l(ie,"onBeforeInput"),0<ie.length&&(ae=new jp("onBeforeInput","beforeinput",null,u,ae),ue.push({event:ae,listeners:ie}),ae.data=_e))}um(ue,o)})}function Go(r,o,u){return{instance:r,listener:o,currentTarget:u}}function _l(r,o){for(var u=o+"Capture",p=[];r!==null;){var y=r,x=y.stateNode;y.tag===5&&x!==null&&(y=x,x=Mr(r,u),x!=null&&p.unshift(Go(r,x,y)),x=Mr(r,o),x!=null&&p.push(Go(r,x,y))),r=r.return}return p}function Ei(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function fm(r,o,u,p,y){for(var x=o._reactName,T=[];u!==null&&u!==p;){var z=u,H=z.alternate,ie=z.stateNode;if(H!==null&&H===p)break;z.tag===5&&ie!==null&&(z=ie,y?(H=Mr(u,x),H!=null&&T.unshift(Go(u,H,z))):y||(H=Mr(u,x),H!=null&&T.push(Go(u,H,z)))),u=u.return}T.length!==0&&r.push({event:o,listeners:T})}var ES=/\r\n?/g,_S=/\u0000|\uFFFD/g;function dm(r){return(typeof r=="string"?r:""+r).replace(ES,`
|
|
38
|
-
`).replace(_S,"")}function Nl(r,o,u){if(o=dm(o),dm(r)!==o&&u)throw Error(n(425))}function Cl(){}var Sc=null,kc=null;function Ec(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var _c=typeof setTimeout=="function"?setTimeout:void 0,NS=typeof clearTimeout=="function"?clearTimeout:void 0,hm=typeof Promise=="function"?Promise:void 0,CS=typeof queueMicrotask=="function"?queueMicrotask:typeof hm<"u"?function(r){return hm.resolve(null).then(r).catch(TS)}:_c;function TS(r){setTimeout(function(){throw r})}function Nc(r,o){var u=o,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(p===0){r.removeChild(y),zo(o);return}p--}else u!=="$"&&u!=="$?"&&u!=="$!"||p++;u=y}while(u);zo(o)}function ur(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function pm(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return r;o--}else u==="/$"&&o++}r=r.previousSibling}return null}var _i=Math.random().toString(36).slice(2),En="__reactFiber$"+_i,Xo="__reactProps$"+_i,zn="__reactContainer$"+_i,Cc="__reactEvents$"+_i,OS="__reactListeners$"+_i,PS="__reactHandles$"+_i;function zr(r){var o=r[En];if(o)return o;for(var u=r.parentNode;u;){if(o=u[zn]||u[En]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=pm(r);r!==null;){if(u=r[En])return u;r=pm(r)}return o}r=u,u=r.parentNode}return null}function Qo(r){return r=r[En]||r[zn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ni(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Tl(r){return r[Xo]||null}var Tc=[],Ci=-1;function cr(r){return{current:r}}function Be(r){0>Ci||(r.current=Tc[Ci],Tc[Ci]=null,Ci--)}function je(r,o){Ci++,Tc[Ci]=r.current,r.current=o}var fr={},mt=cr(fr),Ct=cr(!1),Fr=fr;function Ti(r,o){var u=r.type.contextTypes;if(!u)return fr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===o)return p.__reactInternalMemoizedMaskedChildContext;var y={},x;for(x in u)y[x]=o[x];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Ol(){Be(Ct),Be(mt)}function mm(r,o,u){if(mt.current!==fr)throw Error(n(168));je(mt,o),je(Ct,u)}function gm(r,o,u){var p=r.stateNode;if(o=o.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var y in p)if(!(y in o))throw Error(n(108,se(r)||"Unknown",y));return B({},u,p)}function Pl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||fr,Fr=mt.current,je(mt,r),je(Ct,Ct.current),!0}function ym(r,o,u){var p=r.stateNode;if(!p)throw Error(n(169));u?(r=gm(r,o,Fr),p.__reactInternalMemoizedMergedChildContext=r,Be(Ct),Be(mt),je(mt,r)):Be(Ct),je(Ct,u)}var Fn=null,Il=!1,Oc=!1;function vm(r){Fn===null?Fn=[r]:Fn.push(r)}function IS(r){Il=!0,vm(r)}function dr(){if(!Oc&&Fn!==null){Oc=!0;var r=0,o=De;try{var u=Fn;for(De=1;r<u.length;r++){var p=u[r];do p=p(!0);while(p!==null)}Fn=null,Il=!1}catch(y){throw Fn!==null&&(Fn=Fn.slice(r+1)),sl(Mo,dr),y}finally{De=o,Oc=!1}}return null}var Oi=[],Pi=0,Al=null,Ml=0,Yt=[],Kt=0,Br=null,Bn=1,Vn="";function Vr(r,o){Oi[Pi++]=Ml,Oi[Pi++]=Al,Al=r,Ml=o}function wm(r,o,u){Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Br,Br=r;var p=Bn;r=Vn;var y=32-jt(p)-1;p&=~(1<<y),u+=1;var x=32-jt(o)+y;if(30<x){var T=y-y%5;x=(p&(1<<T)-1).toString(32),p>>=T,y-=T,Bn=1<<32-jt(o)+y|u<<y|p,Vn=x+r}else Bn=1<<x|u<<y|p,Vn=r}function Pc(r){r.return!==null&&(Vr(r,1),wm(r,1,0))}function Ic(r){for(;r===Al;)Al=Oi[--Pi],Oi[Pi]=null,Ml=Oi[--Pi],Oi[Pi]=null;for(;r===Br;)Br=Yt[--Kt],Yt[Kt]=null,Vn=Yt[--Kt],Yt[Kt]=null,Bn=Yt[--Kt],Yt[Kt]=null}var zt=null,Ft=null,We=!1,sn=null;function xm(r,o){var u=Jt(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=r,o=r.deletions,o===null?(r.deletions=[u],r.flags|=16):o.push(u)}function bm(r,o){switch(r.tag){case 5:var u=r.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,zt=r,Ft=ur(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,zt=r,Ft=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=Br!==null?{id:Bn,overflow:Vn}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=Jt(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,zt=r,Ft=null,!0):!1;default:return!1}}function Ac(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Mc(r){if(We){var o=Ft;if(o){var u=o;if(!bm(r,o)){if(Ac(r))throw Error(n(418));o=ur(u.nextSibling);var p=zt;o&&bm(r,o)?xm(p,u):(r.flags=r.flags&-4097|2,We=!1,zt=r)}}else{if(Ac(r))throw Error(n(418));r.flags=r.flags&-4097|2,We=!1,zt=r}}}function Sm(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;zt=r}function Ll(r){if(r!==zt)return!1;if(!We)return Sm(r),We=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!Ec(r.type,r.memoizedProps)),o&&(o=Ft)){if(Ac(r))throw km(),Error(n(418));for(;o;)xm(r,o),o=ur(o.nextSibling)}if(Sm(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(o===0){Ft=ur(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}Ft=null}}else Ft=zt?ur(r.stateNode.nextSibling):null;return!0}function km(){for(var r=Ft;r;)r=ur(r.nextSibling)}function Ii(){Ft=zt=null,We=!1}function Lc(r){sn===null?sn=[r]:sn.push(r)}var AS=N.ReactCurrentBatchConfig;function Jo(r,o,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var p=u.stateNode}if(!p)throw Error(n(147,r));var y=p,x=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(T){var z=y.refs;T===null?delete z[x]:z[x]=T},o._stringRef=x,o)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function Rl(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function Em(r){var o=r._init;return o(r._payload)}function _m(r){function o(te,X){if(r){var ne=te.deletions;ne===null?(te.deletions=[X],te.flags|=16):ne.push(X)}}function u(te,X){if(!r)return null;for(;X!==null;)o(te,X),X=X.sibling;return null}function p(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function y(te,X){return te=xr(te,X),te.index=0,te.sibling=null,te}function x(te,X,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<X?(te.flags|=2,X):ne):(te.flags|=2,X)):(te.flags|=1048576,X)}function T(te){return r&&te.alternate===null&&(te.flags|=2),te}function z(te,X,ne,ce){return X===null||X.tag!==6?(X=Nf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne),X.return=te,X)}function H(te,X,ne,ce){var be=ne.type;return be===R?ae(te,X,ne.props.children,ce,ne.key):X!==null&&(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===q&&Em(be)===X.type)?(ce=y(X,ne.props),ce.ref=Jo(te,X,ne),ce.return=te,ce):(ce=oa(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Jo(te,X,ne),ce.return=te,ce)}function ie(te,X,ne,ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Cf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne.children||[]),X.return=te,X)}function ae(te,X,ne,ce,be){return X===null||X.tag!==7?(X=Xr(ne,te.mode,ce,be),X.return=te,X):(X=y(X,ne),X.return=te,X)}function ue(te,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Nf(""+X,te.mode,ne),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case I:return ne=oa(X.type,X.key,X.props,null,te.mode,ne),ne.ref=Jo(te,null,X),ne.return=te,ne;case M:return X=Cf(X,te.mode,ne),X.return=te,X;case q:var ce=X._init;return ue(te,ce(X._payload),ne)}if(ht(X)||U(X))return X=Xr(X,te.mode,ne,null),X.return=te,X;Rl(te,X)}return null}function le(te,X,ne,ce){var be=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:z(te,X,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:return ne.key===be?H(te,X,ne,ce):null;case M:return ne.key===be?ie(te,X,ne,ce):null;case q:return be=ne._init,le(te,X,be(ne._payload),ce)}if(ht(ne)||U(ne))return be!==null?null:ae(te,X,ne,ce,null);Rl(te,ne)}return null}function pe(te,X,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,z(X,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case I:return te=te.get(ce.key===null?ne:ce.key)||null,H(X,te,ce,be);case M:return te=te.get(ce.key===null?ne:ce.key)||null,ie(X,te,ce,be);case q:var Ee=ce._init;return pe(te,X,ne,Ee(ce._payload),be)}if(ht(ce)||U(ce))return te=te.get(ne)||null,ae(X,te,ce,be,null);Rl(X,ce)}return null}function ve(te,X,ne,ce){for(var be=null,Ee=null,_e=X,Ce=X=0,at=null;_e!==null&&Ce<ne.length;Ce++){_e.index>Ce?(at=_e,_e=null):at=_e.sibling;var Re=le(te,_e,ne[Ce],ce);if(Re===null){_e===null&&(_e=at);break}r&&_e&&Re.alternate===null&&o(te,_e),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re,_e=at}if(Ce===ne.length)return u(te,_e),We&&Vr(te,Ce),be;if(_e===null){for(;Ce<ne.length;Ce++)_e=ue(te,ne[Ce],ce),_e!==null&&(X=x(_e,X,Ce),Ee===null?be=_e:Ee.sibling=_e,Ee=_e);return We&&Vr(te,Ce),be}for(_e=p(te,_e);Ce<ne.length;Ce++)at=pe(_e,te,Ce,ne[Ce],ce),at!==null&&(r&&at.alternate!==null&&_e.delete(at.key===null?Ce:at.key),X=x(at,X,Ce),Ee===null?be=at:Ee.sibling=at,Ee=at);return r&&_e.forEach(function(br){return o(te,br)}),We&&Vr(te,Ce),be}function we(te,X,ne,ce){var be=U(ne);if(typeof be!="function")throw Error(n(150));if(ne=be.call(ne),ne==null)throw Error(n(151));for(var Ee=be=null,_e=X,Ce=X=0,at=null,Re=ne.next();_e!==null&&!Re.done;Ce++,Re=ne.next()){_e.index>Ce?(at=_e,_e=null):at=_e.sibling;var br=le(te,_e,Re.value,ce);if(br===null){_e===null&&(_e=at);break}r&&_e&&br.alternate===null&&o(te,_e),X=x(br,X,Ce),Ee===null?be=br:Ee.sibling=br,Ee=br,_e=at}if(Re.done)return u(te,_e),We&&Vr(te,Ce),be;if(_e===null){for(;!Re.done;Ce++,Re=ne.next())Re=ue(te,Re.value,ce),Re!==null&&(X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return We&&Vr(te,Ce),be}for(_e=p(te,_e);!Re.done;Ce++,Re=ne.next())Re=pe(_e,te,Ce,Re.value,ce),Re!==null&&(r&&Re.alternate!==null&&_e.delete(Re.key===null?Ce:Re.key),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return r&&_e.forEach(function(fk){return o(te,fk)}),We&&Vr(te,Ce),be}function Xe(te,X,ne,ce){if(typeof ne=="object"&&ne!==null&&ne.type===R&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:e:{for(var be=ne.key,Ee=X;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===R){if(Ee.tag===7){u(te,Ee.sibling),X=y(Ee,ne.props.children),X.return=te,te=X;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===q&&Em(be)===Ee.type){u(te,Ee.sibling),X=y(Ee,ne.props),X.ref=Jo(te,Ee,ne),X.return=te,te=X;break e}u(te,Ee);break}else o(te,Ee);Ee=Ee.sibling}ne.type===R?(X=Xr(ne.props.children,te.mode,ce,ne.key),X.return=te,te=X):(ce=oa(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Jo(te,X,ne),ce.return=te,te=ce)}return T(te);case M:e:{for(Ee=ne.key;X!==null;){if(X.key===Ee)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){u(te,X.sibling),X=y(X,ne.children||[]),X.return=te,te=X;break e}else{u(te,X);break}else o(te,X);X=X.sibling}X=Cf(ne,te.mode,ce),X.return=te,te=X}return T(te);case q:return Ee=ne._init,Xe(te,X,Ee(ne._payload),ce)}if(ht(ne))return ve(te,X,ne,ce);if(U(ne))return we(te,X,ne,ce);Rl(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(u(te,X.sibling),X=y(X,ne),X.return=te,te=X):(u(te,X),X=Nf(ne,te.mode,ce),X.return=te,te=X),T(te)):u(te,X)}return Xe}var Ai=_m(!0),Nm=_m(!1),Dl=cr(null),jl=null,Mi=null,Rc=null;function Dc(){Rc=Mi=jl=null}function jc(r){var o=Dl.current;Be(Dl),r._currentValue=o}function $c(r,o,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),r===u)break;r=r.return}}function Li(r,o){jl=r,Rc=Mi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(Ot=!0),r.firstContext=null)}function Gt(r){var o=r._currentValue;if(Rc!==r)if(r={context:r,memoizedValue:o,next:null},Mi===null){if(jl===null)throw Error(n(308));Mi=r,jl.dependencies={lanes:0,firstContext:r}}else Mi=Mi.next=r;return o}var Wr=null;function zc(r){Wr===null?Wr=[r]:Wr.push(r)}function Cm(r,o,u,p){var y=o.interleaved;return y===null?(u.next=u,zc(o)):(u.next=y.next,y.next=u),o.interleaved=u,Wn(r,p)}function Wn(r,o){r.lanes|=o;var u=r.alternate;for(u!==null&&(u.lanes|=o),u=r,r=r.return;r!==null;)r.childLanes|=o,u=r.alternate,u!==null&&(u.childLanes|=o),u=r,r=r.return;return u.tag===3?u.stateNode:null}var hr=!1;function Fc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Un(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function pr(r,o,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Le&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,Wn(r,u)}return y=p.interleaved,y===null?(o.next=o,zc(p)):(o.next=y.next,y.next=o),p.interleaved=o,Wn(r,u)}function $l(r,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var p=o.lanes;p&=r.pendingLanes,u|=p,o.lanes=u,vi(r,u)}}function Om(r,o){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var T={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?y=x=T:x=x.next=T,u=u.next}while(u!==null);x===null?y=x=o:x=x.next=o}else y=x=o;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:p.shared,effects:p.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=o:r.next=o,u.lastBaseUpdate=o}function zl(r,o,u,p){var y=r.updateQueue;hr=!1;var x=y.firstBaseUpdate,T=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var H=z,ie=H.next;H.next=null,T===null?x=ie:T.next=ie,T=H;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,z=ae.lastBaseUpdate,z!==T&&(z===null?ae.firstBaseUpdate=ie:z.next=ie,ae.lastBaseUpdate=H))}if(x!==null){var ue=y.baseState;T=0,ae=ie=H=null,z=x;do{var le=z.lane,pe=z.eventTime;if((p&le)===le){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var ve=r,we=z;switch(le=o,pe=u,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ue=ve.call(pe,ue,le);break e}ue=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,le=typeof ve=="function"?ve.call(pe,ue,le):ve,le==null)break e;ue=B({},ue,le);break e;case 2:hr=!0}}z.callback!==null&&z.lane!==0&&(r.flags|=64,le=y.effects,le===null?y.effects=[z]:le.push(z))}else pe={eventTime:pe,lane:le,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ae===null?(ie=ae=pe,H=ue):ae=ae.next=pe,T|=le;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;le=z,z=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);if(ae===null&&(H=ue),y.baseState=H,y.firstBaseUpdate=ie,y.lastBaseUpdate=ae,o=y.shared.interleaved,o!==null){y=o;do T|=y.lane,y=y.next;while(y!==o)}else x===null&&(y.shared.lanes=0);qr|=T,r.lanes=T,r.memoizedState=ue}}function Pm(r,o,u){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var p=r[o],y=p.callback;if(y!==null){if(p.callback=null,p=u,typeof y!="function")throw Error(n(191,y));y.call(p)}}}var Zo={},_n=cr(Zo),es=cr(Zo),ts=cr(Zo);function Ur(r){if(r===Zo)throw Error(n(174));return r}function Bc(r,o){switch(je(ts,o),je(es,r),je(_n,Zo),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:Rt(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=Rt(o,r)}Be(_n),je(_n,o)}function Ri(){Be(_n),Be(es),Be(ts)}function Im(r){Ur(ts.current);var o=Ur(_n.current),u=Rt(o,r.type);o!==u&&(je(es,r),je(_n,u))}function Vc(r){es.current===r&&(Be(_n),Be(es))}var Ye=cr(0);function Fl(r){for(var o=r;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Wc=[];function Uc(){for(var r=0;r<Wc.length;r++)Wc[r]._workInProgressVersionPrimary=null;Wc.length=0}var Bl=N.ReactCurrentDispatcher,Hc=N.ReactCurrentBatchConfig,Hr=0,Ke=null,rt=null,st=null,Vl=!1,ns=!1,rs=0,MS=0;function gt(){throw Error(n(321))}function qc(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!on(r[u],o[u]))return!1;return!0}function Yc(r,o,u,p,y,x){if(Hr=x,Ke=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Bl.current=r===null||r.memoizedState===null?jS:$S,r=u(p,y),ns){x=0;do{if(ns=!1,rs=0,25<=x)throw Error(n(301));x+=1,st=rt=null,o.updateQueue=null,Bl.current=zS,r=u(p,y)}while(ns)}if(Bl.current=Hl,o=rt!==null&&rt.next!==null,Hr=0,st=rt=Ke=null,Vl=!1,o)throw Error(n(300));return r}function Kc(){var r=rs!==0;return rs=0,r}function Nn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Ke.memoizedState=st=r:st=st.next=r,st}function Xt(){if(rt===null){var r=Ke.alternate;r=r!==null?r.memoizedState:null}else r=rt.next;var o=st===null?Ke.memoizedState:st.next;if(o!==null)st=o,rt=r;else{if(r===null)throw Error(n(310));rt=r,r={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},st===null?Ke.memoizedState=st=r:st=st.next=r}return st}function is(r,o){return typeof o=="function"?o(r):o}function Gc(r){var o=Xt(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=rt,y=p.baseQueue,x=u.pending;if(x!==null){if(y!==null){var T=y.next;y.next=x.next,x.next=T}p.baseQueue=y=x,u.pending=null}if(y!==null){x=y.next,p=p.baseState;var z=T=null,H=null,ie=x;do{var ae=ie.lane;if((Hr&ae)===ae)H!==null&&(H=H.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),p=ie.hasEagerState?ie.eagerState:r(p,ie.action);else{var ue={lane:ae,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};H===null?(z=H=ue,T=p):H=H.next=ue,Ke.lanes|=ae,qr|=ae}ie=ie.next}while(ie!==null&&ie!==x);H===null?T=p:H.next=z,on(p,o.memoizedState)||(Ot=!0),o.memoizedState=p,o.baseState=T,o.baseQueue=H,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do x=y.lane,Ke.lanes|=x,qr|=x,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function Xc(r){var o=Xt(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,x=o.memoizedState;if(y!==null){u.pending=null;var T=y=y.next;do x=r(x,T.action),T=T.next;while(T!==y);on(x,o.memoizedState)||(Ot=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,p]}function Am(){}function Mm(r,o){var u=Ke,p=Xt(),y=o(),x=!on(p.memoizedState,y);if(x&&(p.memoizedState=y,Ot=!0),p=p.queue,Qc(Dm.bind(null,u,p,r),[r]),p.getSnapshot!==o||x||st!==null&&st.memoizedState.tag&1){if(u.flags|=2048,os(9,Rm.bind(null,u,p,y,o),void 0,null),lt===null)throw Error(n(349));(Hr&30)!==0||Lm(u,o,y)}return y}function Lm(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=Ke.updateQueue,o===null?(o={lastEffect:null,stores:null},Ke.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function Rm(r,o,u,p){o.value=u,o.getSnapshot=p,jm(o)&&$m(r)}function Dm(r,o,u){return u(function(){jm(o)&&$m(r)})}function jm(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!on(r,u)}catch{return!0}}function $m(r){var o=Wn(r,1);o!==null&&cn(o,r,1,-1)}function zm(r){var o=Nn();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:r},o.queue=r,r=r.dispatch=DS.bind(null,Ke,r),[o.memoizedState,r]}function os(r,o,u,p){return r={tag:r,create:o,destroy:u,deps:p,next:null},o=Ke.updateQueue,o===null?(o={lastEffect:null,stores:null},Ke.updateQueue=o,o.lastEffect=r.next=r):(u=o.lastEffect,u===null?o.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,o.lastEffect=r)),r}function Fm(){return Xt().memoizedState}function Wl(r,o,u,p){var y=Nn();Ke.flags|=r,y.memoizedState=os(1|o,u,void 0,p===void 0?null:p)}function Ul(r,o,u,p){var y=Xt();p=p===void 0?null:p;var x=void 0;if(rt!==null){var T=rt.memoizedState;if(x=T.destroy,p!==null&&qc(p,T.deps)){y.memoizedState=os(o,u,x,p);return}}Ke.flags|=r,y.memoizedState=os(1|o,u,x,p)}function Bm(r,o){return Wl(8390656,8,r,o)}function Qc(r,o){return Ul(2048,8,r,o)}function Vm(r,o){return Ul(4,2,r,o)}function Wm(r,o){return Ul(4,4,r,o)}function Um(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Hm(r,o,u){return u=u!=null?u.concat([r]):null,Ul(4,4,Um.bind(null,o,r),u)}function Jc(){}function qm(r,o){var u=Xt();o=o===void 0?null:o;var p=u.memoizedState;return p!==null&&o!==null&&qc(o,p[1])?p[0]:(u.memoizedState=[r,o],r)}function Ym(r,o){var u=Xt();o=o===void 0?null:o;var p=u.memoizedState;return p!==null&&o!==null&&qc(o,p[1])?p[0]:(r=r(),u.memoizedState=[r,o],r)}function Km(r,o,u){return(Hr&21)===0?(r.baseState&&(r.baseState=!1,Ot=!0),r.memoizedState=u):(on(u,o)||(u=dl(),Ke.lanes|=u,qr|=u,r.baseState=!0),o)}function LS(r,o){var u=De;De=u!==0&&4>u?u:4,r(!0);var p=Hc.transition;Hc.transition={};try{r(!1),o()}finally{De=u,Hc.transition=p}}function Gm(){return Xt().memoizedState}function RS(r,o,u){var p=vr(r);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},Xm(r))Qm(o,u);else if(u=Cm(r,o,u,p),u!==null){var y=bt();cn(u,r,p,y),Jm(u,o,p)}}function DS(r,o,u){var p=vr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(Xm(r))Qm(o,y);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var T=o.lastRenderedState,z=x(T,u);if(y.hasEagerState=!0,y.eagerState=z,on(z,T)){var H=o.interleaved;H===null?(y.next=y,zc(o)):(y.next=H.next,H.next=y),o.interleaved=y;return}}catch{}finally{}u=Cm(r,o,y,p),u!==null&&(y=bt(),cn(u,r,p,y),Jm(u,o,p))}}function Xm(r){var o=r.alternate;return r===Ke||o!==null&&o===Ke}function Qm(r,o){ns=Vl=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function Jm(r,o,u){if((u&4194240)!==0){var p=o.lanes;p&=r.pendingLanes,u|=p,o.lanes=u,vi(r,u)}}var Hl={readContext:Gt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},jS={readContext:Gt,useCallback:function(r,o){return Nn().memoizedState=[r,o===void 0?null:o],r},useContext:Gt,useEffect:Bm,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,Wl(4194308,4,Um.bind(null,o,r),u)},useLayoutEffect:function(r,o){return Wl(4194308,4,r,o)},useInsertionEffect:function(r,o){return Wl(4,2,r,o)},useMemo:function(r,o){var u=Nn();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var p=Nn();return o=u!==void 0?u(o):o,p.memoizedState=p.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},p.queue=r,r=r.dispatch=RS.bind(null,Ke,r),[p.memoizedState,r]},useRef:function(r){var o=Nn();return r={current:r},o.memoizedState=r},useState:zm,useDebugValue:Jc,useDeferredValue:function(r){return Nn().memoizedState=r},useTransition:function(){var r=zm(!1),o=r[0];return r=LS.bind(null,r[1]),Nn().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var p=Ke,y=Nn();if(We){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),lt===null)throw Error(n(349));(Hr&30)!==0||Lm(p,o,u)}y.memoizedState=u;var x={value:u,getSnapshot:o};return y.queue=x,Bm(Dm.bind(null,p,x,r),[r]),p.flags|=2048,os(9,Rm.bind(null,p,x,u,o),void 0,null),u},useId:function(){var r=Nn(),o=lt.identifierPrefix;if(We){var u=Vn,p=Bn;u=(p&~(1<<32-jt(p)-1)).toString(32)+u,o=":"+o+"R"+u,u=rs++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=MS++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},$S={readContext:Gt,useCallback:qm,useContext:Gt,useEffect:Qc,useImperativeHandle:Hm,useInsertionEffect:Vm,useLayoutEffect:Wm,useMemo:Ym,useReducer:Gc,useRef:Fm,useState:function(){return Gc(is)},useDebugValue:Jc,useDeferredValue:function(r){var o=Xt();return Km(o,rt.memoizedState,r)},useTransition:function(){var r=Gc(is)[0],o=Xt().memoizedState;return[r,o]},useMutableSource:Am,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1},zS={readContext:Gt,useCallback:qm,useContext:Gt,useEffect:Qc,useImperativeHandle:Hm,useInsertionEffect:Vm,useLayoutEffect:Wm,useMemo:Ym,useReducer:Xc,useRef:Fm,useState:function(){return Xc(is)},useDebugValue:Jc,useDeferredValue:function(r){var o=Xt();return rt===null?o.memoizedState=r:Km(o,rt.memoizedState,r)},useTransition:function(){var r=Xc(is)[0],o=Xt().memoizedState;return[r,o]},useMutableSource:Am,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1};function ln(r,o){if(r&&r.defaultProps){o=B({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function Zc(r,o,u,p){o=r.memoizedState,u=u(p,o),u=u==null?o:B({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var ql={isMounted:function(r){return(r=r._reactInternals)?kn(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.payload=o,u!=null&&(x.callback=u),o=pr(r,x,y),o!==null&&(cn(o,r,y,p),$l(o,r,y))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=pr(r,x,y),o!==null&&(cn(o,r,y,p),$l(o,r,y))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=bt(),p=vr(r),y=Un(u,p);y.tag=2,o!=null&&(y.callback=o),o=pr(r,y,p),o!==null&&(cn(o,r,p,u),$l(o,r,p))}};function Zm(r,o,u,p,y,x,T){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,x,T):o.prototype&&o.prototype.isPureReactComponent?!Ho(u,p)||!Ho(y,x):!0}function eg(r,o,u){var p=!1,y=fr,x=o.contextType;return typeof x=="object"&&x!==null?x=Gt(x):(y=Tt(o)?Fr:mt.current,p=o.contextTypes,x=(p=p!=null)?Ti(r,y):fr),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ql,r.stateNode=o,o._reactInternals=r,p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=x),o}function tg(r,o,u,p){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,p),o.state!==r&&ql.enqueueReplaceState(o,o.state,null)}function ef(r,o,u,p){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},Fc(r);var x=o.contextType;typeof x=="object"&&x!==null?y.context=Gt(x):(x=Tt(o)?Fr:mt.current,y.context=Ti(r,x)),y.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(Zc(r,o,x,u),y.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(o=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),o!==y.state&&ql.enqueueReplaceState(y,y.state,null),zl(r,u,y,p),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function Di(r,o){try{var u="",p=o;do u+=Q(p),p=p.return;while(p);var y=u}catch(x){y=`
|
|
37
|
+
`+y[T].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),H}while(1<=T&&0<=z);break}}}finally{V=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?W(r):""}function Q(r){switch(r.tag){case 5:return W(r.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return r=K(r.type,!1),r;case 11:return r=K(r.type.render,!1),r;case 1:return r=K(r.type,!0),r;default:return""}}function re(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case L:return"Fragment";case M:return"Portal";case I:return"Profiler";case C:return"StrictMode";case Z:return"Suspense";case j:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case R:return(r.displayName||"Context")+".Consumer";case F:return(r._context.displayName||"Context")+".Provider";case $:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case G:return o=r.displayName||null,o!==null?o:re(r.type)||"Memo";case q:o=r._payload,r=r._init;try{return re(r(o))}catch{}}return null}function se(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(o);case 8:return o===C?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ee(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function oe(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function de(r){var o=oe(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),p=""+r[o];if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,x=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){p=""+T,x.call(this,T)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(T){p=""+T},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function xe(r){r._valueTracker||(r._valueTracker=de(r))}function he(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),p="";return r&&(p=oe(r)?r.checked?"true":"false":r.value),r=p,r!==u?(o.setValue(r),!0):!1}function fe(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function ke(r,o){var u=o.checked;return B({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ie(r,o){var u=o.defaultValue==null?"":o.defaultValue,p=o.checked!=null?o.checked:o.defaultChecked;u=ee(o.value!=null?o.value:u),r._wrapperState={initialChecked:p,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Ae(r,o){o=o.checked,o!=null&&E(r,"checked",o,!1)}function ze(r,o){Ae(r,o);var u=ee(o.value),p=o.type;if(u!=null)p==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(p==="submit"||p==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?Nt(r,o.type,u):o.hasOwnProperty("defaultValue")&&Nt(r,o.type,ee(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function wt(r,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var p=o.type;if(!(p!=="submit"&&p!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,u||o===r.value||(r.value=o),r.defaultValue=o}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Nt(r,o,u){(o!=="number"||fe(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var ht=Array.isArray;function pt(r,o,u,p){if(r=r.options,o){o={};for(var y=0;y<u.length;y++)o["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=o.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+ee(u),o=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}o!==null||r[y].disabled||(o=r[y])}o!==null&&(o.selected=!0)}}function Dn(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function bn(r,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(ht(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:ee(u)}}function Sn(r,o){var u=ee(o.value),p=ee(o.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),o.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),p!=null&&(r.defaultValue=""+p)}function _t(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function Ht(r){switch(r){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 Rt(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?Ht(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var qt,Gs=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,p,y){MSApp.execUnsafeLocalFunction(function(){return r(o,u,p,y)})}:r})(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(qt=qt||document.createElement("div"),qt.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=qt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function jn(r,o){if(o){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=o;return}}r.textContent=o}var Ar={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},zu=["Webkit","ms","Moz","O"];Object.keys(Ar).forEach(function(r){zu.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),Ar[o]=Ar[r]})});function Xs(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||Ar.hasOwnProperty(r)&&Ar[r]?(""+o).trim():o+"px"}function Qs(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var p=u.indexOf("--")===0,y=Xs(u,o[u],p);u==="float"&&(u="cssFloat"),p?r.setProperty(u,y):r[u]=y}}var Fu=B({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 ko(r,o){if(o){if(Fu[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Eo(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){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 No=null;function _o(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Co=null,tr=null,nr=null;function Js(r){if(r=Qo(r)){if(typeof Co!="function")throw Error(n(280));var o=r.stateNode;o&&(o=Tl(o),Co(r.stateNode,r.type,o))}}function Zs(r){tr?nr?nr.push(r):nr=[r]:tr=r}function el(){if(tr){var r=tr,o=nr;if(nr=tr=null,Js(r),o)for(r=0;r<o.length;r++)Js(o[r])}}function tl(r,o){return r(o)}function nl(){}var To=!1;function rl(r,o,u){if(To)return r(o,u);To=!0;try{return tl(r,o,u)}finally{To=!1,(tr!==null||nr!==null)&&(nl(),el())}}function Mr(r,o){var u=r.stateNode;if(u===null)return null;var p=Tl(u);if(p===null)return null;u=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Oo=!1;if(c)try{var Lr={};Object.defineProperty(Lr,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",Lr,Lr),window.removeEventListener("test",Lr,Lr)}catch{Oo=!1}function Bu(r,o,u,p,y,x,T,z,H){var ie=Array.prototype.slice.call(arguments,3);try{o.apply(u,ie)}catch(ae){this.onError(ae)}}var Rr=!1,di=null,hi=!1,Po=null,Vu={onError:function(r){Rr=!0,di=r}};function Wu(r,o,u,p,y,x,T,z,H){Rr=!1,di=null,Bu.apply(Vu,arguments)}function Uu(r,o,u,p,y,x,T,z,H){if(Wu.apply(this,arguments),Rr){if(Rr){var ie=di;Rr=!1,di=null}else throw Error(n(198));hi||(hi=!0,Po=ie)}}function kn(r){var o=r,u=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(u=o.return),r=o.return;while(r)}return o.tag===3?u:null}function Io(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function Ao(r){if(kn(r)!==r)throw Error(n(188))}function Hu(r){var o=r.alternate;if(!o){if(o=kn(r),o===null)throw Error(n(188));return o!==r?null:r}for(var u=r,p=o;;){var y=u.return;if(y===null)break;var x=y.alternate;if(x===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return Ao(y),r;if(x===p)return Ao(y),o;x=x.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=x;else{for(var T=!1,z=y.child;z;){if(z===u){T=!0,u=y,p=x;break}if(z===p){T=!0,p=y,u=x;break}z=z.sibling}if(!T){for(z=x.child;z;){if(z===u){T=!0,u=x,p=y;break}if(z===p){T=!0,p=x,u=y;break}z=z.sibling}if(!T)throw Error(n(189))}}if(u.alternate!==p)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:o}function il(r){return r=Hu(r),r!==null?ol(r):null}function ol(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=ol(r);if(o!==null)return o;r=r.sibling}return null}var sl=t.unstable_scheduleCallback,ll=t.unstable_cancelCallback,qu=t.unstable_shouldYield,al=t.unstable_requestPaint,qe=t.unstable_now,Yu=t.unstable_getCurrentPriorityLevel,Mo=t.unstable_ImmediatePriority,ul=t.unstable_UserBlockingPriority,pi=t.unstable_NormalPriority,Ku=t.unstable_LowPriority,cl=t.unstable_IdlePriority,mi=null,Dt=null;function Gu(r){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(mi,r,void 0,(r.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:Ju,Xu=Math.log,Qu=Math.LN2;function Ju(r){return r>>>=0,r===0?32:31-(Xu(r)/Qu|0)|0}var gi=64,yi=4194304;function Dr(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function $n(r,o){var u=r.pendingLanes;if(u===0)return 0;var p=0,y=r.suspendedLanes,x=r.pingedLanes,T=u&268435455;if(T!==0){var z=T&~y;z!==0?p=Dr(z):(x&=T,x!==0&&(p=Dr(x)))}else T=u&~y,T!==0?p=Dr(T):x!==0&&(p=Dr(x));if(p===0)return 0;if(o!==0&&o!==p&&(o&y)===0&&(y=p&-p,x=o&-o,y>=x||y===16&&(x&4194240)!==0))return o;if((p&4)!==0&&(p|=u&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=p;0<o;)u=31-jt(o),y=1<<u,p|=r[u],o&=~y;return p}function Zu(r,o){switch(r){case 1:case 2:case 4:return o+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 o+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 fl(r,o){for(var u=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,x=r.pendingLanes;0<x;){var T=31-jt(x),z=1<<T,H=y[T];H===-1?((z&u)===0||(z&p)!==0)&&(y[T]=Zu(z,o)):H<=o&&(r.expiredLanes|=z),x&=~z}}function Lo(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function dl(){var r=gi;return gi<<=1,(gi&4194240)===0&&(gi=64),r}function jr(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function $r(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-jt(o),r[o]=u}function ec(r,o){var u=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var p=r.eventTimes;for(r=r.expirationTimes;0<u;){var y=31-jt(u),x=1<<y;o[y]=0,p[y]=-1,r[y]=-1,u&=~x}}function vi(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var p=31-jt(u),y=1<<p;y&o|r[p]&o&&(r[p]|=o),u&=~y}}var De=0;function Np(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var _p,tc,Cp,Tp,Op,nc=!1,hl=[],rr=null,ir=null,or=null,Ro=new Map,Do=new Map,sr=[],Rb="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 Pp(r,o){switch(r){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ro.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(o.pointerId)}}function jo(r,o,u,p,y,x){return r===null||r.nativeEvent!==x?(r={blockedOn:o,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[y]},o!==null&&(o=Qo(o),o!==null&&tc(o)),r):(r.eventSystemFlags|=p,o=r.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),r)}function Db(r,o,u,p,y){switch(o){case"focusin":return rr=jo(rr,r,o,u,p,y),!0;case"dragenter":return ir=jo(ir,r,o,u,p,y),!0;case"mouseover":return or=jo(or,r,o,u,p,y),!0;case"pointerover":var x=y.pointerId;return Ro.set(x,jo(Ro.get(x)||null,r,o,u,p,y)),!0;case"gotpointercapture":return x=y.pointerId,Do.set(x,jo(Do.get(x)||null,r,o,u,p,y)),!0}return!1}function Ip(r){var o=zr(r.target);if(o!==null){var u=kn(o);if(u!==null){if(o=u.tag,o===13){if(o=Io(u),o!==null){r.blockedOn=o,Op(r.priority,function(){Cp(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pl(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=ic(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);No=p,u.target.dispatchEvent(p),No=null}else return o=Qo(u),o!==null&&tc(o),r.blockedOn=u,!1;o.shift()}return!0}function Ap(r,o,u){pl(r)&&u.delete(o)}function jb(){nc=!1,rr!==null&&pl(rr)&&(rr=null),ir!==null&&pl(ir)&&(ir=null),or!==null&&pl(or)&&(or=null),Ro.forEach(Ap),Do.forEach(Ap)}function $o(r,o){r.blockedOn===o&&(r.blockedOn=null,nc||(nc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jb)))}function zo(r){function o(y){return $o(y,r)}if(0<hl.length){$o(hl[0],r);for(var u=1;u<hl.length;u++){var p=hl[u];p.blockedOn===r&&(p.blockedOn=null)}}for(rr!==null&&$o(rr,r),ir!==null&&$o(ir,r),or!==null&&$o(or,r),Ro.forEach(o),Do.forEach(o),u=0;u<sr.length;u++)p=sr[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<sr.length&&(u=sr[0],u.blockedOn===null);)Ip(u),u.blockedOn===null&&sr.shift()}var wi=_.ReactCurrentBatchConfig,ml=!0;function $b(r,o,u,p){var y=De,x=wi.transition;wi.transition=null;try{De=1,rc(r,o,u,p)}finally{De=y,wi.transition=x}}function zb(r,o,u,p){var y=De,x=wi.transition;wi.transition=null;try{De=4,rc(r,o,u,p)}finally{De=y,wi.transition=x}}function rc(r,o,u,p){if(ml){var y=ic(r,o,u,p);if(y===null)bc(r,o,p,gl,u),Pp(r,p);else if(Db(y,r,o,u,p))p.stopPropagation();else if(Pp(r,p),o&4&&-1<Rb.indexOf(r)){for(;y!==null;){var x=Qo(y);if(x!==null&&_p(x),x=ic(r,o,u,p),x===null&&bc(r,o,p,gl,u),x===y)break;y=x}y!==null&&p.stopPropagation()}else bc(r,o,p,null,u)}}var gl=null;function ic(r,o,u,p){if(gl=null,r=_o(p),r=zr(r),r!==null)if(o=kn(r),o===null)r=null;else if(u=o.tag,u===13){if(r=Io(o),r!==null)return r;r=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return gl=r,null}function Mp(r){switch(r){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(Yu()){case Mo:return 1;case ul:return 4;case pi:case Ku:return 16;case cl:return 536870912;default:return 16}default:return 16}}var lr=null,oc=null,yl=null;function Lp(){if(yl)return yl;var r,o=oc,u=o.length,p,y="value"in lr?lr.value:lr.textContent,x=y.length;for(r=0;r<u&&o[r]===y[r];r++);var T=u-r;for(p=1;p<=T&&o[u-p]===y[x-p];p++);return yl=y.slice(r,1<p?1-p:void 0)}function vl(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function wl(){return!0}function Rp(){return!1}function $t(r){function o(u,p,y,x,T){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var z in r)r.hasOwnProperty(z)&&(u=r[z],this[z]=u?u(x):x[z]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wl:Rp,this.isPropagationStopped=Rp,this}return B(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=wl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),o}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sc=$t(xi),Fo=B({},xi,{view:0,detail:0}),Fb=$t(Fo),lc,ac,Bo,xl=B({},Fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bo&&(Bo&&r.type==="mousemove"?(lc=r.screenX-Bo.screenX,ac=r.screenY-Bo.screenY):ac=lc=0,Bo=r),lc)},movementY:function(r){return"movementY"in r?r.movementY:ac}}),Dp=$t(xl),Bb=B({},xl,{dataTransfer:0}),Vb=$t(Bb),Wb=B({},Fo,{relatedTarget:0}),uc=$t(Wb),Ub=B({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),Hb=$t(Ub),qb=B({},xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Yb=$t(qb),Kb=B({},xi,{data:0}),jp=$t(Kb),Gb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xb={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"},Qb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jb(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Qb[r])?!!o[r]:!1}function cc(){return Jb}var Zb=B({},Fo,{key:function(r){if(r.key){var o=Gb[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=vl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Xb[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cc,charCode:function(r){return r.type==="keypress"?vl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?vl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),eS=$t(Zb),tS=B({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$p=$t(tS),nS=B({},Fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),rS=$t(nS),iS=B({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),oS=$t(iS),sS=B({},xl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),lS=$t(sS),aS=[9,13,27,32],fc=c&&"CompositionEvent"in window,Vo=null;c&&"documentMode"in document&&(Vo=document.documentMode);var uS=c&&"TextEvent"in window&&!Vo,zp=c&&(!fc||Vo&&8<Vo&&11>=Vo),Fp=" ",Bp=!1;function Vp(r,o){switch(r){case"keyup":return aS.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var bi=!1;function cS(r,o){switch(r){case"compositionend":return Wp(o);case"keypress":return o.which!==32?null:(Bp=!0,Fp);case"textInput":return r=o.data,r===Fp&&Bp?null:r;default:return null}}function fS(r,o){if(bi)return r==="compositionend"||!fc&&Vp(r,o)?(r=Lp(),yl=oc=lr=null,bi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return zp&&o.locale!=="ko"?null:o.data;default:return null}}var dS={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 Up(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!dS[r.type]:o==="textarea"}function Hp(r,o,u,p){Zs(p),o=Nl(o,"onChange"),0<o.length&&(u=new sc("onChange","change",null,u,p),r.push({event:u,listeners:o}))}var Wo=null,Uo=null;function hS(r){um(r,0)}function bl(r){var o=_i(r);if(he(o))return r}function pS(r,o){if(r==="change")return o}var qp=!1;if(c){var dc;if(c){var hc="oninput"in document;if(!hc){var Yp=document.createElement("div");Yp.setAttribute("oninput","return;"),hc=typeof Yp.oninput=="function"}dc=hc}else dc=!1;qp=dc&&(!document.documentMode||9<document.documentMode)}function Kp(){Wo&&(Wo.detachEvent("onpropertychange",Gp),Uo=Wo=null)}function Gp(r){if(r.propertyName==="value"&&bl(Uo)){var o=[];Hp(o,Uo,r,_o(r)),rl(hS,o)}}function mS(r,o,u){r==="focusin"?(Kp(),Wo=o,Uo=u,Wo.attachEvent("onpropertychange",Gp)):r==="focusout"&&Kp()}function gS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bl(Uo)}function yS(r,o){if(r==="click")return bl(o)}function vS(r,o){if(r==="input"||r==="change")return bl(o)}function wS(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var on=typeof Object.is=="function"?Object.is:wS;function Ho(r,o){if(on(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var u=Object.keys(r),p=Object.keys(o);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!f.call(o,y)||!on(r[y],o[y]))return!1}return!0}function Xp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Qp(r,o){var u=Xp(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=o&&p>=o)return{node:u,offset:o-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Xp(u)}}function Jp(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Jp(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Zp(){for(var r=window,o=fe();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=fe(r.document)}return o}function pc(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function xS(r){var o=Zp(),u=r.focusedElem,p=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&Jp(u.ownerDocument.documentElement,u)){if(p!==null&&pc(u)){if(o=p.start,r=p.end,r===void 0&&(r=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(r,u.value.length);else if(r=(o=u.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var y=u.textContent.length,x=Math.min(p.start,y);p=p.end===void 0?x:Math.min(p.end,y),!r.extend&&x>p&&(y=p,p=x,x=y),y=Qp(u,x);var T=Qp(u,p);y&&T&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==T.node||r.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),r.removeAllRanges(),x>p?(r.addRange(o),r.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),r.addRange(o)))}}for(o=[],r=u;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)r=o[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var bS=c&&"documentMode"in document&&11>=document.documentMode,Si=null,mc=null,qo=null,gc=!1;function em(r,o,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;gc||Si==null||Si!==fe(p)||(p=Si,"selectionStart"in p&&pc(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),qo&&Ho(qo,p)||(qo=p,p=Nl(mc,"onSelect"),0<p.length&&(o=new sc("onSelect","select",null,o,u),r.push({event:o,listeners:p}),o.target=Si)))}function Sl(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var ki={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionend:Sl("Transition","TransitionEnd")},yc={},tm={};c&&(tm=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function kl(r){if(yc[r])return yc[r];if(!ki[r])return r;var o=ki[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in tm)return yc[r]=o[u];return r}var nm=kl("animationend"),rm=kl("animationiteration"),im=kl("animationstart"),om=kl("transitionend"),sm=new Map,lm="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 ar(r,o){sm.set(r,o),l(o,[r])}for(var vc=0;vc<lm.length;vc++){var wc=lm[vc],SS=wc.toLowerCase(),kS=wc[0].toUpperCase()+wc.slice(1);ar(SS,"on"+kS)}ar(nm,"onAnimationEnd"),ar(rm,"onAnimationIteration"),ar(im,"onAnimationStart"),ar("dblclick","onDoubleClick"),ar("focusin","onFocus"),ar("focusout","onBlur"),ar(om,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="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(" "),ES=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yo));function am(r,o,u){var p=r.type||"unknown-event";r.currentTarget=u,Uu(p,o,void 0,r),r.currentTarget=null}function um(r,o){o=(o&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],y=p.event;p=p.listeners;e:{var x=void 0;if(o)for(var T=p.length-1;0<=T;T--){var z=p[T],H=z.instance,ie=z.currentTarget;if(z=z.listener,H!==x&&y.isPropagationStopped())break e;am(y,z,ie),x=H}else for(T=0;T<p.length;T++){if(z=p[T],H=z.instance,ie=z.currentTarget,z=z.listener,H!==x&&y.isPropagationStopped())break e;am(y,z,ie),x=H}}}if(hi)throw r=Po,hi=!1,Po=null,r}function Fe(r,o){var u=o[Cc];u===void 0&&(u=o[Cc]=new Set);var p=r+"__bubble";u.has(p)||(cm(o,r,2,!1),u.add(p))}function xc(r,o,u){var p=0;o&&(p|=4),cm(u,r,p,o)}var El="_reactListening"+Math.random().toString(36).slice(2);function Ko(r){if(!r[El]){r[El]=!0,i.forEach(function(u){u!=="selectionchange"&&(ES.has(u)||xc(u,!1,r),xc(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[El]||(o[El]=!0,xc("selectionchange",!1,o))}}function cm(r,o,u,p){switch(Mp(o)){case 1:var y=$b;break;case 4:y=zb;break;default:y=rc}u=y.bind(null,o,u,r),y=void 0,!Oo||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(o,u,{capture:!0,passive:y}):r.addEventListener(o,u,!0):y!==void 0?r.addEventListener(o,u,{passive:y}):r.addEventListener(o,u,!1)}function bc(r,o,u,p,y){var x=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var T=p.tag;if(T===3||T===4){var z=p.stateNode.containerInfo;if(z===y||z.nodeType===8&&z.parentNode===y)break;if(T===4)for(T=p.return;T!==null;){var H=T.tag;if((H===3||H===4)&&(H=T.stateNode.containerInfo,H===y||H.nodeType===8&&H.parentNode===y))return;T=T.return}for(;z!==null;){if(T=zr(z),T===null)return;if(H=T.tag,H===5||H===6){p=x=T;continue e}z=z.parentNode}}p=p.return}rl(function(){var ie=x,ae=_o(u),ue=[];e:{var le=sm.get(r);if(le!==void 0){var pe=sc,ve=r;switch(r){case"keypress":if(vl(u)===0)break e;case"keydown":case"keyup":pe=eS;break;case"focusin":ve="focus",pe=uc;break;case"focusout":ve="blur",pe=uc;break;case"beforeblur":case"afterblur":pe=uc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Dp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Vb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=rS;break;case nm:case rm:case im:pe=Hb;break;case om:pe=oS;break;case"scroll":pe=Fb;break;case"wheel":pe=lS;break;case"copy":case"cut":case"paste":pe=Yb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=$p}var we=(o&4)!==0,Xe=!we&&r==="scroll",te=we?le!==null?le+"Capture":null:le;we=[];for(var X=ie,ne;X!==null;){ne=X;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Mr(X,te),ce!=null&&we.push(Go(X,ce,ne)))),Xe)break;X=X.return}0<we.length&&(le=new pe(le,ve,null,u,ae),ue.push({event:le,listeners:we}))}}if((o&7)===0){e:{if(le=r==="mouseover"||r==="pointerover",pe=r==="mouseout"||r==="pointerout",le&&u!==No&&(ve=u.relatedTarget||u.fromElement)&&(zr(ve)||ve[zn]))break e;if((pe||le)&&(le=ae.window===ae?ae:(le=ae.ownerDocument)?le.defaultView||le.parentWindow:window,pe?(ve=u.relatedTarget||u.toElement,pe=ie,ve=ve?zr(ve):null,ve!==null&&(Xe=kn(ve),ve!==Xe||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(pe=null,ve=ie),pe!==ve)){if(we=Dp,ce="onMouseLeave",te="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&(we=$p,ce="onPointerLeave",te="onPointerEnter",X="pointer"),Xe=pe==null?le:_i(pe),ne=ve==null?le:_i(ve),le=new we(ce,X+"leave",pe,u,ae),le.target=Xe,le.relatedTarget=ne,ce=null,zr(ae)===ie&&(we=new we(te,X+"enter",ve,u,ae),we.target=ne,we.relatedTarget=Xe,ce=we),Xe=ce,pe&&ve)t:{for(we=pe,te=ve,X=0,ne=we;ne;ne=Ei(ne))X++;for(ne=0,ce=te;ce;ce=Ei(ce))ne++;for(;0<X-ne;)we=Ei(we),X--;for(;0<ne-X;)te=Ei(te),ne--;for(;X--;){if(we===te||te!==null&&we===te.alternate)break t;we=Ei(we),te=Ei(te)}we=null}else we=null;pe!==null&&fm(ue,le,pe,we,!1),ve!==null&&Xe!==null&&fm(ue,Xe,ve,we,!0)}}e:{if(le=ie?_i(ie):window,pe=le.nodeName&&le.nodeName.toLowerCase(),pe==="select"||pe==="input"&&le.type==="file")var be=pS;else if(Up(le))if(qp)be=vS;else{be=gS;var Ee=mS}else(pe=le.nodeName)&&pe.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(be=yS);if(be&&(be=be(r,ie))){Hp(ue,be,u,ae);break e}Ee&&Ee(r,le,ie),r==="focusout"&&(Ee=le._wrapperState)&&Ee.controlled&&le.type==="number"&&Nt(le,"number",le.value)}switch(Ee=ie?_i(ie):window,r){case"focusin":(Up(Ee)||Ee.contentEditable==="true")&&(Si=Ee,mc=ie,qo=null);break;case"focusout":qo=mc=Si=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,em(ue,u,ae);break;case"selectionchange":if(bS)break;case"keydown":case"keyup":em(ue,u,ae)}var Ne;if(fc)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else bi?Vp(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(zp&&u.locale!=="ko"&&(bi||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&bi&&(Ne=Lp()):(lr=ae,oc="value"in lr?lr.value:lr.textContent,bi=!0)),Ee=Nl(ie,Ce),0<Ee.length&&(Ce=new jp(Ce,r,null,u,ae),ue.push({event:Ce,listeners:Ee}),Ne?Ce.data=Ne:(Ne=Wp(u),Ne!==null&&(Ce.data=Ne)))),(Ne=uS?cS(r,u):fS(r,u))&&(ie=Nl(ie,"onBeforeInput"),0<ie.length&&(ae=new jp("onBeforeInput","beforeinput",null,u,ae),ue.push({event:ae,listeners:ie}),ae.data=Ne))}um(ue,o)})}function Go(r,o,u){return{instance:r,listener:o,currentTarget:u}}function Nl(r,o){for(var u=o+"Capture",p=[];r!==null;){var y=r,x=y.stateNode;y.tag===5&&x!==null&&(y=x,x=Mr(r,u),x!=null&&p.unshift(Go(r,x,y)),x=Mr(r,o),x!=null&&p.push(Go(r,x,y))),r=r.return}return p}function Ei(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function fm(r,o,u,p,y){for(var x=o._reactName,T=[];u!==null&&u!==p;){var z=u,H=z.alternate,ie=z.stateNode;if(H!==null&&H===p)break;z.tag===5&&ie!==null&&(z=ie,y?(H=Mr(u,x),H!=null&&T.unshift(Go(u,H,z))):y||(H=Mr(u,x),H!=null&&T.push(Go(u,H,z)))),u=u.return}T.length!==0&&r.push({event:o,listeners:T})}var NS=/\r\n?/g,_S=/\u0000|\uFFFD/g;function dm(r){return(typeof r=="string"?r:""+r).replace(NS,`
|
|
38
|
+
`).replace(_S,"")}function _l(r,o,u){if(o=dm(o),dm(r)!==o&&u)throw Error(n(425))}function Cl(){}var Sc=null,kc=null;function Ec(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Nc=typeof setTimeout=="function"?setTimeout:void 0,CS=typeof clearTimeout=="function"?clearTimeout:void 0,hm=typeof Promise=="function"?Promise:void 0,TS=typeof queueMicrotask=="function"?queueMicrotask:typeof hm<"u"?function(r){return hm.resolve(null).then(r).catch(OS)}:Nc;function OS(r){setTimeout(function(){throw r})}function _c(r,o){var u=o,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(p===0){r.removeChild(y),zo(o);return}p--}else u!=="$"&&u!=="$?"&&u!=="$!"||p++;u=y}while(u);zo(o)}function ur(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function pm(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return r;o--}else u==="/$"&&o++}r=r.previousSibling}return null}var Ni=Math.random().toString(36).slice(2),En="__reactFiber$"+Ni,Xo="__reactProps$"+Ni,zn="__reactContainer$"+Ni,Cc="__reactEvents$"+Ni,PS="__reactListeners$"+Ni,IS="__reactHandles$"+Ni;function zr(r){var o=r[En];if(o)return o;for(var u=r.parentNode;u;){if(o=u[zn]||u[En]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=pm(r);r!==null;){if(u=r[En])return u;r=pm(r)}return o}r=u,u=r.parentNode}return null}function Qo(r){return r=r[En]||r[zn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function _i(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Tl(r){return r[Xo]||null}var Tc=[],Ci=-1;function cr(r){return{current:r}}function Be(r){0>Ci||(r.current=Tc[Ci],Tc[Ci]=null,Ci--)}function je(r,o){Ci++,Tc[Ci]=r.current,r.current=o}var fr={},mt=cr(fr),Ct=cr(!1),Fr=fr;function Ti(r,o){var u=r.type.contextTypes;if(!u)return fr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===o)return p.__reactInternalMemoizedMaskedChildContext;var y={},x;for(x in u)y[x]=o[x];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Ol(){Be(Ct),Be(mt)}function mm(r,o,u){if(mt.current!==fr)throw Error(n(168));je(mt,o),je(Ct,u)}function gm(r,o,u){var p=r.stateNode;if(o=o.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var y in p)if(!(y in o))throw Error(n(108,se(r)||"Unknown",y));return B({},u,p)}function Pl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||fr,Fr=mt.current,je(mt,r),je(Ct,Ct.current),!0}function ym(r,o,u){var p=r.stateNode;if(!p)throw Error(n(169));u?(r=gm(r,o,Fr),p.__reactInternalMemoizedMergedChildContext=r,Be(Ct),Be(mt),je(mt,r)):Be(Ct),je(Ct,u)}var Fn=null,Il=!1,Oc=!1;function vm(r){Fn===null?Fn=[r]:Fn.push(r)}function AS(r){Il=!0,vm(r)}function dr(){if(!Oc&&Fn!==null){Oc=!0;var r=0,o=De;try{var u=Fn;for(De=1;r<u.length;r++){var p=u[r];do p=p(!0);while(p!==null)}Fn=null,Il=!1}catch(y){throw Fn!==null&&(Fn=Fn.slice(r+1)),sl(Mo,dr),y}finally{De=o,Oc=!1}}return null}var Oi=[],Pi=0,Al=null,Ml=0,Yt=[],Kt=0,Br=null,Bn=1,Vn="";function Vr(r,o){Oi[Pi++]=Ml,Oi[Pi++]=Al,Al=r,Ml=o}function wm(r,o,u){Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Br,Br=r;var p=Bn;r=Vn;var y=32-jt(p)-1;p&=~(1<<y),u+=1;var x=32-jt(o)+y;if(30<x){var T=y-y%5;x=(p&(1<<T)-1).toString(32),p>>=T,y-=T,Bn=1<<32-jt(o)+y|u<<y|p,Vn=x+r}else Bn=1<<x|u<<y|p,Vn=r}function Pc(r){r.return!==null&&(Vr(r,1),wm(r,1,0))}function Ic(r){for(;r===Al;)Al=Oi[--Pi],Oi[Pi]=null,Ml=Oi[--Pi],Oi[Pi]=null;for(;r===Br;)Br=Yt[--Kt],Yt[Kt]=null,Vn=Yt[--Kt],Yt[Kt]=null,Bn=Yt[--Kt],Yt[Kt]=null}var zt=null,Ft=null,We=!1,sn=null;function xm(r,o){var u=Jt(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=r,o=r.deletions,o===null?(r.deletions=[u],r.flags|=16):o.push(u)}function bm(r,o){switch(r.tag){case 5:var u=r.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,zt=r,Ft=ur(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,zt=r,Ft=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=Br!==null?{id:Bn,overflow:Vn}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=Jt(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,zt=r,Ft=null,!0):!1;default:return!1}}function Ac(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Mc(r){if(We){var o=Ft;if(o){var u=o;if(!bm(r,o)){if(Ac(r))throw Error(n(418));o=ur(u.nextSibling);var p=zt;o&&bm(r,o)?xm(p,u):(r.flags=r.flags&-4097|2,We=!1,zt=r)}}else{if(Ac(r))throw Error(n(418));r.flags=r.flags&-4097|2,We=!1,zt=r}}}function Sm(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;zt=r}function Ll(r){if(r!==zt)return!1;if(!We)return Sm(r),We=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!Ec(r.type,r.memoizedProps)),o&&(o=Ft)){if(Ac(r))throw km(),Error(n(418));for(;o;)xm(r,o),o=ur(o.nextSibling)}if(Sm(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(o===0){Ft=ur(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}Ft=null}}else Ft=zt?ur(r.stateNode.nextSibling):null;return!0}function km(){for(var r=Ft;r;)r=ur(r.nextSibling)}function Ii(){Ft=zt=null,We=!1}function Lc(r){sn===null?sn=[r]:sn.push(r)}var MS=_.ReactCurrentBatchConfig;function Jo(r,o,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var p=u.stateNode}if(!p)throw Error(n(147,r));var y=p,x=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(T){var z=y.refs;T===null?delete z[x]:z[x]=T},o._stringRef=x,o)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function Rl(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function Em(r){var o=r._init;return o(r._payload)}function Nm(r){function o(te,X){if(r){var ne=te.deletions;ne===null?(te.deletions=[X],te.flags|=16):ne.push(X)}}function u(te,X){if(!r)return null;for(;X!==null;)o(te,X),X=X.sibling;return null}function p(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function y(te,X){return te=xr(te,X),te.index=0,te.sibling=null,te}function x(te,X,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<X?(te.flags|=2,X):ne):(te.flags|=2,X)):(te.flags|=1048576,X)}function T(te){return r&&te.alternate===null&&(te.flags|=2),te}function z(te,X,ne,ce){return X===null||X.tag!==6?(X=_f(ne,te.mode,ce),X.return=te,X):(X=y(X,ne),X.return=te,X)}function H(te,X,ne,ce){var be=ne.type;return be===L?ae(te,X,ne.props.children,ce,ne.key):X!==null&&(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===q&&Em(be)===X.type)?(ce=y(X,ne.props),ce.ref=Jo(te,X,ne),ce.return=te,ce):(ce=oa(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Jo(te,X,ne),ce.return=te,ce)}function ie(te,X,ne,ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Cf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne.children||[]),X.return=te,X)}function ae(te,X,ne,ce,be){return X===null||X.tag!==7?(X=Xr(ne,te.mode,ce,be),X.return=te,X):(X=y(X,ne),X.return=te,X)}function ue(te,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=_f(""+X,te.mode,ne),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case A:return ne=oa(X.type,X.key,X.props,null,te.mode,ne),ne.ref=Jo(te,null,X),ne.return=te,ne;case M:return X=Cf(X,te.mode,ne),X.return=te,X;case q:var ce=X._init;return ue(te,ce(X._payload),ne)}if(ht(X)||U(X))return X=Xr(X,te.mode,ne,null),X.return=te,X;Rl(te,X)}return null}function le(te,X,ne,ce){var be=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:z(te,X,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===be?H(te,X,ne,ce):null;case M:return ne.key===be?ie(te,X,ne,ce):null;case q:return be=ne._init,le(te,X,be(ne._payload),ce)}if(ht(ne)||U(ne))return be!==null?null:ae(te,X,ne,ce,null);Rl(te,ne)}return null}function pe(te,X,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,z(X,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case A:return te=te.get(ce.key===null?ne:ce.key)||null,H(X,te,ce,be);case M:return te=te.get(ce.key===null?ne:ce.key)||null,ie(X,te,ce,be);case q:var Ee=ce._init;return pe(te,X,ne,Ee(ce._payload),be)}if(ht(ce)||U(ce))return te=te.get(ne)||null,ae(X,te,ce,be,null);Rl(X,ce)}return null}function ve(te,X,ne,ce){for(var be=null,Ee=null,Ne=X,Ce=X=0,at=null;Ne!==null&&Ce<ne.length;Ce++){Ne.index>Ce?(at=Ne,Ne=null):at=Ne.sibling;var Re=le(te,Ne,ne[Ce],ce);if(Re===null){Ne===null&&(Ne=at);break}r&&Ne&&Re.alternate===null&&o(te,Ne),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re,Ne=at}if(Ce===ne.length)return u(te,Ne),We&&Vr(te,Ce),be;if(Ne===null){for(;Ce<ne.length;Ce++)Ne=ue(te,ne[Ce],ce),Ne!==null&&(X=x(Ne,X,Ce),Ee===null?be=Ne:Ee.sibling=Ne,Ee=Ne);return We&&Vr(te,Ce),be}for(Ne=p(te,Ne);Ce<ne.length;Ce++)at=pe(Ne,te,Ce,ne[Ce],ce),at!==null&&(r&&at.alternate!==null&&Ne.delete(at.key===null?Ce:at.key),X=x(at,X,Ce),Ee===null?be=at:Ee.sibling=at,Ee=at);return r&&Ne.forEach(function(br){return o(te,br)}),We&&Vr(te,Ce),be}function we(te,X,ne,ce){var be=U(ne);if(typeof be!="function")throw Error(n(150));if(ne=be.call(ne),ne==null)throw Error(n(151));for(var Ee=be=null,Ne=X,Ce=X=0,at=null,Re=ne.next();Ne!==null&&!Re.done;Ce++,Re=ne.next()){Ne.index>Ce?(at=Ne,Ne=null):at=Ne.sibling;var br=le(te,Ne,Re.value,ce);if(br===null){Ne===null&&(Ne=at);break}r&&Ne&&br.alternate===null&&o(te,Ne),X=x(br,X,Ce),Ee===null?be=br:Ee.sibling=br,Ee=br,Ne=at}if(Re.done)return u(te,Ne),We&&Vr(te,Ce),be;if(Ne===null){for(;!Re.done;Ce++,Re=ne.next())Re=ue(te,Re.value,ce),Re!==null&&(X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return We&&Vr(te,Ce),be}for(Ne=p(te,Ne);!Re.done;Ce++,Re=ne.next())Re=pe(Ne,te,Ce,Re.value,ce),Re!==null&&(r&&Re.alternate!==null&&Ne.delete(Re.key===null?Ce:Re.key),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return r&&Ne.forEach(function(dk){return o(te,dk)}),We&&Vr(te,Ce),be}function Xe(te,X,ne,ce){if(typeof ne=="object"&&ne!==null&&ne.type===L&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var be=ne.key,Ee=X;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===L){if(Ee.tag===7){u(te,Ee.sibling),X=y(Ee,ne.props.children),X.return=te,te=X;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===q&&Em(be)===Ee.type){u(te,Ee.sibling),X=y(Ee,ne.props),X.ref=Jo(te,Ee,ne),X.return=te,te=X;break e}u(te,Ee);break}else o(te,Ee);Ee=Ee.sibling}ne.type===L?(X=Xr(ne.props.children,te.mode,ce,ne.key),X.return=te,te=X):(ce=oa(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Jo(te,X,ne),ce.return=te,te=ce)}return T(te);case M:e:{for(Ee=ne.key;X!==null;){if(X.key===Ee)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){u(te,X.sibling),X=y(X,ne.children||[]),X.return=te,te=X;break e}else{u(te,X);break}else o(te,X);X=X.sibling}X=Cf(ne,te.mode,ce),X.return=te,te=X}return T(te);case q:return Ee=ne._init,Xe(te,X,Ee(ne._payload),ce)}if(ht(ne))return ve(te,X,ne,ce);if(U(ne))return we(te,X,ne,ce);Rl(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(u(te,X.sibling),X=y(X,ne),X.return=te,te=X):(u(te,X),X=_f(ne,te.mode,ce),X.return=te,te=X),T(te)):u(te,X)}return Xe}var Ai=Nm(!0),_m=Nm(!1),Dl=cr(null),jl=null,Mi=null,Rc=null;function Dc(){Rc=Mi=jl=null}function jc(r){var o=Dl.current;Be(Dl),r._currentValue=o}function $c(r,o,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),r===u)break;r=r.return}}function Li(r,o){jl=r,Rc=Mi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(Ot=!0),r.firstContext=null)}function Gt(r){var o=r._currentValue;if(Rc!==r)if(r={context:r,memoizedValue:o,next:null},Mi===null){if(jl===null)throw Error(n(308));Mi=r,jl.dependencies={lanes:0,firstContext:r}}else Mi=Mi.next=r;return o}var Wr=null;function zc(r){Wr===null?Wr=[r]:Wr.push(r)}function Cm(r,o,u,p){var y=o.interleaved;return y===null?(u.next=u,zc(o)):(u.next=y.next,y.next=u),o.interleaved=u,Wn(r,p)}function Wn(r,o){r.lanes|=o;var u=r.alternate;for(u!==null&&(u.lanes|=o),u=r,r=r.return;r!==null;)r.childLanes|=o,u=r.alternate,u!==null&&(u.childLanes|=o),u=r,r=r.return;return u.tag===3?u.stateNode:null}var hr=!1;function Fc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Un(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function pr(r,o,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Le&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,Wn(r,u)}return y=p.interleaved,y===null?(o.next=o,zc(p)):(o.next=y.next,y.next=o),p.interleaved=o,Wn(r,u)}function $l(r,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var p=o.lanes;p&=r.pendingLanes,u|=p,o.lanes=u,vi(r,u)}}function Om(r,o){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var T={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?y=x=T:x=x.next=T,u=u.next}while(u!==null);x===null?y=x=o:x=x.next=o}else y=x=o;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:p.shared,effects:p.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=o:r.next=o,u.lastBaseUpdate=o}function zl(r,o,u,p){var y=r.updateQueue;hr=!1;var x=y.firstBaseUpdate,T=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var H=z,ie=H.next;H.next=null,T===null?x=ie:T.next=ie,T=H;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,z=ae.lastBaseUpdate,z!==T&&(z===null?ae.firstBaseUpdate=ie:z.next=ie,ae.lastBaseUpdate=H))}if(x!==null){var ue=y.baseState;T=0,ae=ie=H=null,z=x;do{var le=z.lane,pe=z.eventTime;if((p&le)===le){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var ve=r,we=z;switch(le=o,pe=u,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ue=ve.call(pe,ue,le);break e}ue=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,le=typeof ve=="function"?ve.call(pe,ue,le):ve,le==null)break e;ue=B({},ue,le);break e;case 2:hr=!0}}z.callback!==null&&z.lane!==0&&(r.flags|=64,le=y.effects,le===null?y.effects=[z]:le.push(z))}else pe={eventTime:pe,lane:le,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ae===null?(ie=ae=pe,H=ue):ae=ae.next=pe,T|=le;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;le=z,z=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);if(ae===null&&(H=ue),y.baseState=H,y.firstBaseUpdate=ie,y.lastBaseUpdate=ae,o=y.shared.interleaved,o!==null){y=o;do T|=y.lane,y=y.next;while(y!==o)}else x===null&&(y.shared.lanes=0);qr|=T,r.lanes=T,r.memoizedState=ue}}function Pm(r,o,u){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var p=r[o],y=p.callback;if(y!==null){if(p.callback=null,p=u,typeof y!="function")throw Error(n(191,y));y.call(p)}}}var Zo={},Nn=cr(Zo),es=cr(Zo),ts=cr(Zo);function Ur(r){if(r===Zo)throw Error(n(174));return r}function Bc(r,o){switch(je(ts,o),je(es,r),je(Nn,Zo),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:Rt(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=Rt(o,r)}Be(Nn),je(Nn,o)}function Ri(){Be(Nn),Be(es),Be(ts)}function Im(r){Ur(ts.current);var o=Ur(Nn.current),u=Rt(o,r.type);o!==u&&(je(es,r),je(Nn,u))}function Vc(r){es.current===r&&(Be(Nn),Be(es))}var Ye=cr(0);function Fl(r){for(var o=r;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Wc=[];function Uc(){for(var r=0;r<Wc.length;r++)Wc[r]._workInProgressVersionPrimary=null;Wc.length=0}var Bl=_.ReactCurrentDispatcher,Hc=_.ReactCurrentBatchConfig,Hr=0,Ke=null,rt=null,st=null,Vl=!1,ns=!1,rs=0,LS=0;function gt(){throw Error(n(321))}function qc(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!on(r[u],o[u]))return!1;return!0}function Yc(r,o,u,p,y,x){if(Hr=x,Ke=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Bl.current=r===null||r.memoizedState===null?$S:zS,r=u(p,y),ns){x=0;do{if(ns=!1,rs=0,25<=x)throw Error(n(301));x+=1,st=rt=null,o.updateQueue=null,Bl.current=FS,r=u(p,y)}while(ns)}if(Bl.current=Hl,o=rt!==null&&rt.next!==null,Hr=0,st=rt=Ke=null,Vl=!1,o)throw Error(n(300));return r}function Kc(){var r=rs!==0;return rs=0,r}function _n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?Ke.memoizedState=st=r:st=st.next=r,st}function Xt(){if(rt===null){var r=Ke.alternate;r=r!==null?r.memoizedState:null}else r=rt.next;var o=st===null?Ke.memoizedState:st.next;if(o!==null)st=o,rt=r;else{if(r===null)throw Error(n(310));rt=r,r={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},st===null?Ke.memoizedState=st=r:st=st.next=r}return st}function is(r,o){return typeof o=="function"?o(r):o}function Gc(r){var o=Xt(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=rt,y=p.baseQueue,x=u.pending;if(x!==null){if(y!==null){var T=y.next;y.next=x.next,x.next=T}p.baseQueue=y=x,u.pending=null}if(y!==null){x=y.next,p=p.baseState;var z=T=null,H=null,ie=x;do{var ae=ie.lane;if((Hr&ae)===ae)H!==null&&(H=H.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),p=ie.hasEagerState?ie.eagerState:r(p,ie.action);else{var ue={lane:ae,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};H===null?(z=H=ue,T=p):H=H.next=ue,Ke.lanes|=ae,qr|=ae}ie=ie.next}while(ie!==null&&ie!==x);H===null?T=p:H.next=z,on(p,o.memoizedState)||(Ot=!0),o.memoizedState=p,o.baseState=T,o.baseQueue=H,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do x=y.lane,Ke.lanes|=x,qr|=x,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function Xc(r){var o=Xt(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,x=o.memoizedState;if(y!==null){u.pending=null;var T=y=y.next;do x=r(x,T.action),T=T.next;while(T!==y);on(x,o.memoizedState)||(Ot=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,p]}function Am(){}function Mm(r,o){var u=Ke,p=Xt(),y=o(),x=!on(p.memoizedState,y);if(x&&(p.memoizedState=y,Ot=!0),p=p.queue,Qc(Dm.bind(null,u,p,r),[r]),p.getSnapshot!==o||x||st!==null&&st.memoizedState.tag&1){if(u.flags|=2048,os(9,Rm.bind(null,u,p,y,o),void 0,null),lt===null)throw Error(n(349));(Hr&30)!==0||Lm(u,o,y)}return y}function Lm(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=Ke.updateQueue,o===null?(o={lastEffect:null,stores:null},Ke.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function Rm(r,o,u,p){o.value=u,o.getSnapshot=p,jm(o)&&$m(r)}function Dm(r,o,u){return u(function(){jm(o)&&$m(r)})}function jm(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!on(r,u)}catch{return!0}}function $m(r){var o=Wn(r,1);o!==null&&cn(o,r,1,-1)}function zm(r){var o=_n();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:r},o.queue=r,r=r.dispatch=jS.bind(null,Ke,r),[o.memoizedState,r]}function os(r,o,u,p){return r={tag:r,create:o,destroy:u,deps:p,next:null},o=Ke.updateQueue,o===null?(o={lastEffect:null,stores:null},Ke.updateQueue=o,o.lastEffect=r.next=r):(u=o.lastEffect,u===null?o.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,o.lastEffect=r)),r}function Fm(){return Xt().memoizedState}function Wl(r,o,u,p){var y=_n();Ke.flags|=r,y.memoizedState=os(1|o,u,void 0,p===void 0?null:p)}function Ul(r,o,u,p){var y=Xt();p=p===void 0?null:p;var x=void 0;if(rt!==null){var T=rt.memoizedState;if(x=T.destroy,p!==null&&qc(p,T.deps)){y.memoizedState=os(o,u,x,p);return}}Ke.flags|=r,y.memoizedState=os(1|o,u,x,p)}function Bm(r,o){return Wl(8390656,8,r,o)}function Qc(r,o){return Ul(2048,8,r,o)}function Vm(r,o){return Ul(4,2,r,o)}function Wm(r,o){return Ul(4,4,r,o)}function Um(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Hm(r,o,u){return u=u!=null?u.concat([r]):null,Ul(4,4,Um.bind(null,o,r),u)}function Jc(){}function qm(r,o){var u=Xt();o=o===void 0?null:o;var p=u.memoizedState;return p!==null&&o!==null&&qc(o,p[1])?p[0]:(u.memoizedState=[r,o],r)}function Ym(r,o){var u=Xt();o=o===void 0?null:o;var p=u.memoizedState;return p!==null&&o!==null&&qc(o,p[1])?p[0]:(r=r(),u.memoizedState=[r,o],r)}function Km(r,o,u){return(Hr&21)===0?(r.baseState&&(r.baseState=!1,Ot=!0),r.memoizedState=u):(on(u,o)||(u=dl(),Ke.lanes|=u,qr|=u,r.baseState=!0),o)}function RS(r,o){var u=De;De=u!==0&&4>u?u:4,r(!0);var p=Hc.transition;Hc.transition={};try{r(!1),o()}finally{De=u,Hc.transition=p}}function Gm(){return Xt().memoizedState}function DS(r,o,u){var p=vr(r);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},Xm(r))Qm(o,u);else if(u=Cm(r,o,u,p),u!==null){var y=bt();cn(u,r,p,y),Jm(u,o,p)}}function jS(r,o,u){var p=vr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(Xm(r))Qm(o,y);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var T=o.lastRenderedState,z=x(T,u);if(y.hasEagerState=!0,y.eagerState=z,on(z,T)){var H=o.interleaved;H===null?(y.next=y,zc(o)):(y.next=H.next,H.next=y),o.interleaved=y;return}}catch{}finally{}u=Cm(r,o,y,p),u!==null&&(y=bt(),cn(u,r,p,y),Jm(u,o,p))}}function Xm(r){var o=r.alternate;return r===Ke||o!==null&&o===Ke}function Qm(r,o){ns=Vl=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function Jm(r,o,u){if((u&4194240)!==0){var p=o.lanes;p&=r.pendingLanes,u|=p,o.lanes=u,vi(r,u)}}var Hl={readContext:Gt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},$S={readContext:Gt,useCallback:function(r,o){return _n().memoizedState=[r,o===void 0?null:o],r},useContext:Gt,useEffect:Bm,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,Wl(4194308,4,Um.bind(null,o,r),u)},useLayoutEffect:function(r,o){return Wl(4194308,4,r,o)},useInsertionEffect:function(r,o){return Wl(4,2,r,o)},useMemo:function(r,o){var u=_n();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var p=_n();return o=u!==void 0?u(o):o,p.memoizedState=p.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},p.queue=r,r=r.dispatch=DS.bind(null,Ke,r),[p.memoizedState,r]},useRef:function(r){var o=_n();return r={current:r},o.memoizedState=r},useState:zm,useDebugValue:Jc,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=zm(!1),o=r[0];return r=RS.bind(null,r[1]),_n().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var p=Ke,y=_n();if(We){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),lt===null)throw Error(n(349));(Hr&30)!==0||Lm(p,o,u)}y.memoizedState=u;var x={value:u,getSnapshot:o};return y.queue=x,Bm(Dm.bind(null,p,x,r),[r]),p.flags|=2048,os(9,Rm.bind(null,p,x,u,o),void 0,null),u},useId:function(){var r=_n(),o=lt.identifierPrefix;if(We){var u=Vn,p=Bn;u=(p&~(1<<32-jt(p)-1)).toString(32)+u,o=":"+o+"R"+u,u=rs++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=LS++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},zS={readContext:Gt,useCallback:qm,useContext:Gt,useEffect:Qc,useImperativeHandle:Hm,useInsertionEffect:Vm,useLayoutEffect:Wm,useMemo:Ym,useReducer:Gc,useRef:Fm,useState:function(){return Gc(is)},useDebugValue:Jc,useDeferredValue:function(r){var o=Xt();return Km(o,rt.memoizedState,r)},useTransition:function(){var r=Gc(is)[0],o=Xt().memoizedState;return[r,o]},useMutableSource:Am,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1},FS={readContext:Gt,useCallback:qm,useContext:Gt,useEffect:Qc,useImperativeHandle:Hm,useInsertionEffect:Vm,useLayoutEffect:Wm,useMemo:Ym,useReducer:Xc,useRef:Fm,useState:function(){return Xc(is)},useDebugValue:Jc,useDeferredValue:function(r){var o=Xt();return rt===null?o.memoizedState=r:Km(o,rt.memoizedState,r)},useTransition:function(){var r=Xc(is)[0],o=Xt().memoizedState;return[r,o]},useMutableSource:Am,useSyncExternalStore:Mm,useId:Gm,unstable_isNewReconciler:!1};function ln(r,o){if(r&&r.defaultProps){o=B({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function Zc(r,o,u,p){o=r.memoizedState,u=u(p,o),u=u==null?o:B({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var ql={isMounted:function(r){return(r=r._reactInternals)?kn(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.payload=o,u!=null&&(x.callback=u),o=pr(r,x,y),o!==null&&(cn(o,r,y,p),$l(o,r,y))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=pr(r,x,y),o!==null&&(cn(o,r,y,p),$l(o,r,y))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=bt(),p=vr(r),y=Un(u,p);y.tag=2,o!=null&&(y.callback=o),o=pr(r,y,p),o!==null&&(cn(o,r,p,u),$l(o,r,p))}};function Zm(r,o,u,p,y,x,T){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,x,T):o.prototype&&o.prototype.isPureReactComponent?!Ho(u,p)||!Ho(y,x):!0}function eg(r,o,u){var p=!1,y=fr,x=o.contextType;return typeof x=="object"&&x!==null?x=Gt(x):(y=Tt(o)?Fr:mt.current,p=o.contextTypes,x=(p=p!=null)?Ti(r,y):fr),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ql,r.stateNode=o,o._reactInternals=r,p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=x),o}function tg(r,o,u,p){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,p),o.state!==r&&ql.enqueueReplaceState(o,o.state,null)}function ef(r,o,u,p){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},Fc(r);var x=o.contextType;typeof x=="object"&&x!==null?y.context=Gt(x):(x=Tt(o)?Fr:mt.current,y.context=Ti(r,x)),y.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(Zc(r,o,x,u),y.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(o=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),o!==y.state&&ql.enqueueReplaceState(y,y.state,null),zl(r,u,y,p),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function Di(r,o){try{var u="",p=o;do u+=Q(p),p=p.return;while(p);var y=u}catch(x){y=`
|
|
39
39
|
Error generating stack: `+x.message+`
|
|
40
|
-
`+x.stack}return{value:r,source:o,stack:y,digest:null}}function tf(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function nf(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var FS=typeof WeakMap=="function"?WeakMap:Map;function ng(r,o,u){u=Un(-1,u),u.tag=3,u.payload={element:null};var p=o.value;return u.callback=function(){Zl||(Zl=!0,vf=p),nf(r,o)},u}function rg(r,o,u){u=Un(-1,u),u.tag=3;var p=r.type.getDerivedStateFromError;if(typeof p=="function"){var y=o.value;u.payload=function(){return p(y)},u.callback=function(){nf(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){nf(r,o),typeof p!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),u}function ig(r,o,u){var p=r.pingCache;if(p===null){p=r.pingCache=new FS;var y=new Set;p.set(o,y)}else y=p.get(o),y===void 0&&(y=new Set,p.set(o,y));y.has(u)||(y.add(u),r=ek.bind(null,r,o,u),o.then(r,r))}function og(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function sg(r,o,u,p,y){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=Un(-1,1),o.tag=2,pr(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var BS=N.ReactCurrentOwner,Ot=!1;function xt(r,o,u,p){o.child=r===null?Nm(o,null,u,p):Ai(o,r.child,u,p)}function lg(r,o,u,p,y){u=u.render;var x=o.ref;return Li(o,y),p=Yc(r,o,u,p,x,y),u=Kc(),r!==null&&!Ot?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Hn(r,o,y)):(We&&u&&Pc(o),o.flags|=1,xt(r,o,p,y),o.child)}function ag(r,o,u,p,y){if(r===null){var x=u.type;return typeof x=="function"&&!_f(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,ug(r,o,x,p,y)):(r=oa(u.type,null,p,o,o.mode,y),r.ref=o.ref,r.return=o,o.child=r)}if(x=r.child,(r.lanes&y)===0){var T=x.memoizedProps;if(u=u.compare,u=u!==null?u:Ho,u(T,p)&&r.ref===o.ref)return Hn(r,o,y)}return o.flags|=1,r=xr(x,p),r.ref=o.ref,r.return=o,o.child=r}function ug(r,o,u,p,y){if(r!==null){var x=r.memoizedProps;if(Ho(x,p)&&r.ref===o.ref)if(Ot=!1,o.pendingProps=p=x,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Ot=!0);else return o.lanes=r.lanes,Hn(r,o,y)}return rf(r,o,u,p,y)}function cg(r,o,u){var p=o.pendingProps,y=p.children,x=r!==null?r.memoizedState:null;if(p.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},je($i,Bt),Bt|=u;else{if((u&1073741824)===0)return r=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,je($i,Bt),Bt|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=x!==null?x.baseLanes:u,je($i,Bt),Bt|=p}else x!==null?(p=x.baseLanes|u,o.memoizedState=null):p=u,je($i,Bt),Bt|=p;return xt(r,o,y,u),o.child}function fg(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function rf(r,o,u,p,y){var x=Tt(u)?Fr:mt.current;return x=Ti(o,x),Li(o,y),u=Yc(r,o,u,p,x,y),p=Kc(),r!==null&&!Ot?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Hn(r,o,y)):(We&&p&&Pc(o),o.flags|=1,xt(r,o,u,y),o.child)}function dg(r,o,u,p,y){if(Tt(u)){var x=!0;Pl(o)}else x=!1;if(Li(o,y),o.stateNode===null)Kl(r,o),eg(o,u,p),ef(o,u,p,y),p=!0;else if(r===null){var T=o.stateNode,z=o.memoizedProps;T.props=z;var H=T.context,ie=u.contextType;typeof ie=="object"&&ie!==null?ie=Gt(ie):(ie=Tt(u)?Fr:mt.current,ie=Ti(o,ie));var ae=u.getDerivedStateFromProps,ue=typeof ae=="function"||typeof T.getSnapshotBeforeUpdate=="function";ue||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==p||H!==ie)&&tg(o,T,p,ie),hr=!1;var le=o.memoizedState;T.state=le,zl(o,p,T,y),H=o.memoizedState,z!==p||le!==H||Ct.current||hr?(typeof ae=="function"&&(Zc(o,u,ae,p),H=o.memoizedState),(z=hr||Zm(o,u,z,p,le,H,ie))?(ue||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=H),T.props=p,T.state=H,T.context=ie,p=z):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{T=o.stateNode,Tm(r,o),z=o.memoizedProps,ie=o.type===o.elementType?z:ln(o.type,z),T.props=ie,ue=o.pendingProps,le=T.context,H=u.contextType,typeof H=="object"&&H!==null?H=Gt(H):(H=Tt(u)?Fr:mt.current,H=Ti(o,H));var pe=u.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==ue||le!==H)&&tg(o,T,p,H),hr=!1,le=o.memoizedState,T.state=le,zl(o,p,T,y);var ve=o.memoizedState;z!==ue||le!==ve||Ct.current||hr?(typeof pe=="function"&&(Zc(o,u,pe,p),ve=o.memoizedState),(ie=hr||Zm(o,u,ie,p,le,ve,H)||!1)?(ae||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(p,ve,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(p,ve,H)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=ve),T.props=p,T.state=ve,T.context=H,p=ie):(typeof T.componentDidUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=1024),p=!1)}return of(r,o,u,p,x,y)}function of(r,o,u,p,y,x){fg(r,o);var T=(o.flags&128)!==0;if(!p&&!T)return y&&ym(o,u,!1),Hn(r,o,x);p=o.stateNode,BS.current=o;var z=T&&typeof u.getDerivedStateFromError!="function"?null:p.render();return o.flags|=1,r!==null&&T?(o.child=Ai(o,r.child,null,x),o.child=Ai(o,null,z,x)):xt(r,o,z,x),o.memoizedState=p.state,y&&ym(o,u,!0),o.child}function hg(r){var o=r.stateNode;o.pendingContext?mm(r,o.pendingContext,o.pendingContext!==o.context):o.context&&mm(r,o.context,!1),Bc(r,o.containerInfo)}function pg(r,o,u,p,y){return Ii(),Lc(y),o.flags|=256,xt(r,o,u,p),o.child}var sf={dehydrated:null,treeContext:null,retryLane:0};function lf(r){return{baseLanes:r,cachePool:null,transitions:null}}function mg(r,o,u){var p=o.pendingProps,y=Ye.current,x=!1,T=(o.flags&128)!==0,z;if((z=T)||(z=r!==null&&r.memoizedState===null?!1:(y&2)!==0),z?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),je(Ye,y&1),r===null)return Mc(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=p.children,r=p.fallback,x?(p=o.mode,x=o.child,T={mode:"hidden",children:T},(p&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=T):x=sa(T,p,0,null),r=Xr(r,p,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=lf(u),o.memoizedState=sf,r):af(o,T));if(y=r.memoizedState,y!==null&&(z=y.dehydrated,z!==null))return VS(r,o,T,p,z,y,u);if(x){x=p.fallback,T=o.mode,y=r.child,z=y.sibling;var H={mode:"hidden",children:p.children};return(T&1)===0&&o.child!==y?(p=o.child,p.childLanes=0,p.pendingProps=H,o.deletions=null):(p=xr(y,H),p.subtreeFlags=y.subtreeFlags&14680064),z!==null?x=xr(z,x):(x=Xr(x,T,u,null),x.flags|=2),x.return=o,p.return=o,p.sibling=x,o.child=p,p=x,x=o.child,T=r.child.memoizedState,T=T===null?lf(u):{baseLanes:T.baseLanes|u,cachePool:null,transitions:T.transitions},x.memoizedState=T,x.childLanes=r.childLanes&~u,o.memoizedState=sf,p}return x=r.child,r=x.sibling,p=xr(x,{mode:"visible",children:p.children}),(o.mode&1)===0&&(p.lanes=u),p.return=o,p.sibling=null,r!==null&&(u=o.deletions,u===null?(o.deletions=[r],o.flags|=16):u.push(r)),o.child=p,o.memoizedState=null,p}function af(r,o){return o=sa({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Yl(r,o,u,p){return p!==null&&Lc(p),Ai(o,r.child,null,u),r=af(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function VS(r,o,u,p,y,x,T){if(u)return o.flags&256?(o.flags&=-257,p=tf(Error(n(422))),Yl(r,o,T,p)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=p.fallback,y=o.mode,p=sa({mode:"visible",children:p.children},y,0,null),x=Xr(x,y,T,null),x.flags|=2,p.return=o,x.return=o,p.sibling=x,o.child=p,(o.mode&1)!==0&&Ai(o,r.child,null,T),o.child.memoizedState=lf(T),o.memoizedState=sf,x);if((o.mode&1)===0)return Yl(r,o,T,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var z=p.dgst;return p=z,x=Error(n(419)),p=tf(x,p,void 0),Yl(r,o,T,p)}if(z=(T&r.childLanes)!==0,Ot||z){if(p=lt,p!==null){switch(T&-T){case 4:y=2;break;case 16:y=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:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(p.suspendedLanes|T))!==0?0:y,y!==0&&y!==x.retryLane&&(x.retryLane=y,Wn(r,y),cn(p,r,y,-1))}return Ef(),p=tf(Error(n(421))),Yl(r,o,T,p)}return y.data==="$?"?(o.flags|=128,o.child=r.child,o=tk.bind(null,r),y._reactRetry=o,null):(r=x.treeContext,Ft=ur(y.nextSibling),zt=o,We=!0,sn=null,r!==null&&(Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Br,Bn=r.id,Vn=r.overflow,Br=o),o=af(o,p.children),o.flags|=4096,o)}function gg(r,o,u){r.lanes|=o;var p=r.alternate;p!==null&&(p.lanes|=o),$c(r.return,o,u)}function uf(r,o,u,p,y){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=p,x.tail=u,x.tailMode=y)}function yg(r,o,u){var p=o.pendingProps,y=p.revealOrder,x=p.tail;if(xt(r,o,p.children,u),p=Ye.current,(p&2)!==0)p=p&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&gg(r,u,o);else if(r.tag===19)gg(r,u,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}p&=1}if(je(Ye,p),(o.mode&1)===0)o.memoizedState=null;else switch(y){case"forwards":for(u=o.child,y=null;u!==null;)r=u.alternate,r!==null&&Fl(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),uf(o,!1,y,u,x);break;case"backwards":for(u=null,y=o.child,o.child=null;y!==null;){if(r=y.alternate,r!==null&&Fl(r)===null){o.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}uf(o,!0,u,null,x);break;case"together":uf(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Kl(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function Hn(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),qr|=o.lanes,(u&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,u=xr(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=xr(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function WS(r,o,u){switch(o.tag){case 3:hg(o),Ii();break;case 5:Im(o);break;case 1:Tt(o.type)&&Pl(o);break;case 4:Bc(o,o.stateNode.containerInfo);break;case 10:var p=o.type._context,y=o.memoizedProps.value;je(Dl,p._currentValue),p._currentValue=y;break;case 13:if(p=o.memoizedState,p!==null)return p.dehydrated!==null?(je(Ye,Ye.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?mg(r,o,u):(je(Ye,Ye.current&1),r=Hn(r,o,u),r!==null?r.sibling:null);je(Ye,Ye.current&1);break;case 19:if(p=(u&o.childLanes)!==0,(r.flags&128)!==0){if(p)return yg(r,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),je(Ye,Ye.current),p)break;return null;case 22:case 23:return o.lanes=0,cg(r,o,u)}return Hn(r,o,u)}var vg,cf,wg,xg;vg=function(r,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},cf=function(){},wg=function(r,o,u,p){var y=r.memoizedProps;if(y!==p){r=o.stateNode,Ur(_n.current);var x=null;switch(u){case"input":y=ke(r,y),p=ke(r,p),x=[];break;case"select":y=B({},y,{value:void 0}),p=B({},p,{value:void 0}),x=[];break;case"textarea":y=Dn(r,y),p=Dn(r,p),x=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Cl)}ko(u,p);var T;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var z=y[ie];for(T in z)z.hasOwnProperty(T)&&(u||(u={}),u[T]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in p){var H=p[ie];if(z=y!=null?y[ie]:void 0,p.hasOwnProperty(ie)&&H!==z&&(H!=null||z!=null))if(ie==="style")if(z){for(T in z)!z.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(u||(u={}),u[T]="");for(T in H)H.hasOwnProperty(T)&&z[T]!==H[T]&&(u||(u={}),u[T]=H[T])}else u||(x||(x=[]),x.push(ie,u)),u=H;else ie==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,z=z?z.__html:void 0,H!=null&&z!==H&&(x=x||[]).push(ie,H)):ie==="children"?typeof H!="string"&&typeof H!="number"||(x=x||[]).push(ie,""+H):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(H!=null&&ie==="onScroll"&&Fe("scroll",r),x||z===H||(x=[])):(x=x||[]).push(ie,H))}u&&(x=x||[]).push("style",u);var ie=x;(o.updateQueue=ie)&&(o.flags|=4)}},xg=function(r,o,u,p){u!==p&&(o.flags|=4)};function ss(r,o){if(!We)switch(r.tailMode){case"hidden":o=r.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function yt(r){var o=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(o)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&14680064,p|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,o}function US(r,o,u){var p=o.pendingProps;switch(Ic(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(o),null;case 1:return Tt(o.type)&&Ol(),yt(o),null;case 3:return p=o.stateNode,Ri(),Be(Ct),Be(mt),Uc(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(r===null||r.child===null)&&(Ll(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,sn!==null&&(bf(sn),sn=null))),cf(r,o),yt(o),null;case 5:Vc(o);var y=Ur(ts.current);if(u=o.type,r!==null&&o.stateNode!=null)wg(r,o,u,p,y),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!p){if(o.stateNode===null)throw Error(n(166));return yt(o),null}if(r=Ur(_n.current),Ll(o)){p=o.stateNode,u=o.type;var x=o.memoizedProps;switch(p[En]=o,p[Xo]=x,r=(o.mode&1)!==0,u){case"dialog":Fe("cancel",p),Fe("close",p);break;case"iframe":case"object":case"embed":Fe("load",p);break;case"video":case"audio":for(y=0;y<Yo.length;y++)Fe(Yo[y],p);break;case"source":Fe("error",p);break;case"img":case"image":case"link":Fe("error",p),Fe("load",p);break;case"details":Fe("toggle",p);break;case"input":Ie(p,x),Fe("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!x.multiple},Fe("invalid",p);break;case"textarea":bn(p,x),Fe("invalid",p)}ko(u,x),y=null;for(var T in x)if(x.hasOwnProperty(T)){var z=x[T];T==="children"?typeof z=="string"?p.textContent!==z&&(x.suppressHydrationWarning!==!0&&Nl(p.textContent,z,r),y=["children",z]):typeof z=="number"&&p.textContent!==""+z&&(x.suppressHydrationWarning!==!0&&Nl(p.textContent,z,r),y=["children",""+z]):s.hasOwnProperty(T)&&z!=null&&T==="onScroll"&&Fe("scroll",p)}switch(u){case"input":xe(p),wt(p,x,!0);break;case"textarea":xe(p),Nt(p);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(p.onclick=Cl)}p=y,o.updateQueue=p,p!==null&&(o.flags|=4)}else{T=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ht(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=T.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=T.createElement(u,{is:p.is}):(r=T.createElement(u),u==="select"&&(T=r,p.multiple?T.multiple=!0:p.size&&(T.size=p.size))):r=T.createElementNS(r,u),r[En]=o,r[Xo]=p,vg(r,o,!1,!1),o.stateNode=r;e:{switch(T=Eo(u,p),u){case"dialog":Fe("cancel",r),Fe("close",r),y=p;break;case"iframe":case"object":case"embed":Fe("load",r),y=p;break;case"video":case"audio":for(y=0;y<Yo.length;y++)Fe(Yo[y],r);y=p;break;case"source":Fe("error",r),y=p;break;case"img":case"image":case"link":Fe("error",r),Fe("load",r),y=p;break;case"details":Fe("toggle",r),y=p;break;case"input":Ie(r,p),y=ke(r,p),Fe("invalid",r);break;case"option":y=p;break;case"select":r._wrapperState={wasMultiple:!!p.multiple},y=B({},p,{value:void 0}),Fe("invalid",r);break;case"textarea":bn(r,p),y=Dn(r,p),Fe("invalid",r);break;default:y=p}ko(u,y),z=y;for(x in z)if(z.hasOwnProperty(x)){var H=z[x];x==="style"?Qs(r,H):x==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&Gs(r,H)):x==="children"?typeof H=="string"?(u!=="textarea"||H!=="")&&jn(r,H):typeof H=="number"&&jn(r,""+H):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?H!=null&&x==="onScroll"&&Fe("scroll",r):H!=null&&E(r,x,H,T))}switch(u){case"input":xe(r),wt(r,p,!1);break;case"textarea":xe(r),Nt(r);break;case"option":p.value!=null&&r.setAttribute("value",""+ee(p.value));break;case"select":r.multiple=!!p.multiple,x=p.value,x!=null?pt(r,!!p.multiple,x,!1):p.defaultValue!=null&&pt(r,!!p.multiple,p.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=Cl)}switch(u){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}}p&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return yt(o),null;case 6:if(r&&o.stateNode!=null)xg(r,o,r.memoizedProps,p);else{if(typeof p!="string"&&o.stateNode===null)throw Error(n(166));if(u=Ur(ts.current),Ur(_n.current),Ll(o)){if(p=o.stateNode,u=o.memoizedProps,p[En]=o,(x=p.nodeValue!==u)&&(r=zt,r!==null))switch(r.tag){case 3:Nl(p.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Nl(p.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else p=(u.nodeType===9?u:u.ownerDocument).createTextNode(p),p[En]=o,o.stateNode=p}return yt(o),null;case 13:if(Be(Ye),p=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(We&&Ft!==null&&(o.mode&1)!==0&&(o.flags&128)===0)km(),Ii(),o.flags|=98560,x=!1;else if(x=Ll(o),p!==null&&p.dehydrated!==null){if(r===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[En]=o}else Ii(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yt(o),x=!1}else sn!==null&&(bf(sn),sn=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(p=p!==null,p!==(r!==null&&r.memoizedState!==null)&&p&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(Ye.current&1)!==0?it===0&&(it=3):Ef())),o.updateQueue!==null&&(o.flags|=4),yt(o),null);case 4:return Ri(),cf(r,o),r===null&&Ko(o.stateNode.containerInfo),yt(o),null;case 10:return jc(o.type._context),yt(o),null;case 17:return Tt(o.type)&&Ol(),yt(o),null;case 19:if(Be(Ye),x=o.memoizedState,x===null)return yt(o),null;if(p=(o.flags&128)!==0,T=x.rendering,T===null)if(p)ss(x,!1);else{if(it!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(T=Fl(r),T!==null){for(o.flags|=128,ss(x,!1),p=T.updateQueue,p!==null&&(o.updateQueue=p,o.flags|=4),o.subtreeFlags=0,p=u,u=o.child;u!==null;)x=u,r=p,x.flags&=14680066,T=x.alternate,T===null?(x.childLanes=0,x.lanes=r,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=T.childLanes,x.lanes=T.lanes,x.child=T.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=T.memoizedProps,x.memoizedState=T.memoizedState,x.updateQueue=T.updateQueue,x.type=T.type,r=T.dependencies,x.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return je(Ye,Ye.current&1|2),o.child}r=r.sibling}x.tail!==null&&qe()>zi&&(o.flags|=128,p=!0,ss(x,!1),o.lanes=4194304)}else{if(!p)if(r=Fl(T),r!==null){if(o.flags|=128,p=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),ss(x,!0),x.tail===null&&x.tailMode==="hidden"&&!T.alternate&&!We)return yt(o),null}else 2*qe()-x.renderingStartTime>zi&&u!==1073741824&&(o.flags|=128,p=!0,ss(x,!1),o.lanes=4194304);x.isBackwards?(T.sibling=o.child,o.child=T):(u=x.last,u!==null?u.sibling=T:o.child=T,x.last=T)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=qe(),o.sibling=null,u=Ye.current,je(Ye,p?u&1|2:u&1),o):(yt(o),null);case 22:case 23:return kf(),p=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==p&&(o.flags|=8192),p&&(o.mode&1)!==0?(Bt&1073741824)!==0&&(yt(o),o.subtreeFlags&6&&(o.flags|=8192)):yt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function HS(r,o){switch(Ic(o),o.tag){case 1:return Tt(o.type)&&Ol(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Ri(),Be(Ct),Be(mt),Uc(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return Vc(o),null;case 13:if(Be(Ye),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ii()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return Be(Ye),null;case 4:return Ri(),null;case 10:return jc(o.type._context),null;case 22:case 23:return kf(),null;case 24:return null;default:return null}}var Gl=!1,vt=!1,qS=typeof WeakSet=="function"?WeakSet:Set,ge=null;function ji(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(p){Ge(r,o,p)}else u.current=null}function ff(r,o,u){try{u()}catch(p){Ge(r,o,p)}}var bg=!1;function YS(r,o){if(Sc=ml,r=Zp(),pc(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var T=0,z=-1,H=-1,ie=0,ae=0,ue=r,le=null;t:for(;;){for(var pe;ue!==u||y!==0&&ue.nodeType!==3||(z=T+y),ue!==x||p!==0&&ue.nodeType!==3||(H=T+p),ue.nodeType===3&&(T+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)le=ue,ue=pe;for(;;){if(ue===r)break t;if(le===u&&++ie===y&&(z=T),le===x&&++ae===p&&(H=T),(pe=ue.nextSibling)!==null)break;ue=le,le=ue.parentNode}ue=pe}u=z===-1||H===-1?null:{start:z,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(kc={focusedElem:r,selectionRange:u},ml=!1,ge=o;ge!==null;)if(o=ge,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,ge=r;else for(;ge!==null;){o=ge;try{var ve=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Xe=ve.memoizedState,te=o.stateNode,X=te.getSnapshotBeforeUpdate(o.elementType===o.type?we:ln(o.type,we),Xe);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=o.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){Ge(o,o.return,ce)}if(r=o.sibling,r!==null){r.return=o.return,ge=r;break}ge=o.return}return ve=bg,bg=!1,ve}function ls(r,o,u){var p=o.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&r)===r){var x=y.destroy;y.destroy=void 0,x!==void 0&&ff(o,u,x)}y=y.next}while(y!==p)}}function Xl(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&r)===r){var p=u.create;u.destroy=p()}u=u.next}while(u!==o)}}function df(r){var o=r.ref;if(o!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof o=="function"?o(r):o.current=r}}function Sg(r){var o=r.alternate;o!==null&&(r.alternate=null,Sg(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[En],delete o[Xo],delete o[Cc],delete o[OS],delete o[PS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function kg(r){return r.tag===5||r.tag===3||r.tag===4}function Eg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||kg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function hf(r,o,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(r,o):u.insertBefore(r,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(r,u)):(o=u,o.appendChild(r)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Cl));else if(p!==4&&(r=r.child,r!==null))for(hf(r,o,u),r=r.sibling;r!==null;)hf(r,o,u),r=r.sibling}function pf(r,o,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,o?u.insertBefore(r,o):u.appendChild(r);else if(p!==4&&(r=r.child,r!==null))for(pf(r,o,u),r=r.sibling;r!==null;)pf(r,o,u),r=r.sibling}var ct=null,an=!1;function mr(r,o,u){for(u=u.child;u!==null;)_g(r,o,u),u=u.sibling}function _g(r,o,u){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(mi,u)}catch{}switch(u.tag){case 5:vt||ji(u,o);case 6:var p=ct,y=an;ct=null,mr(r,o,u),ct=p,an=y,ct!==null&&(an?(r=ct,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):ct.removeChild(u.stateNode));break;case 18:ct!==null&&(an?(r=ct,u=u.stateNode,r.nodeType===8?Nc(r.parentNode,u):r.nodeType===1&&Nc(r,u),zo(r)):Nc(ct,u.stateNode));break;case 4:p=ct,y=an,ct=u.stateNode.containerInfo,an=!0,mr(r,o,u),ct=p,an=y;break;case 0:case 11:case 14:case 15:if(!vt&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var x=y,T=x.destroy;x=x.tag,T!==void 0&&((x&2)!==0||(x&4)!==0)&&ff(u,o,T),y=y.next}while(y!==p)}mr(r,o,u);break;case 1:if(!vt&&(ji(u,o),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(z){Ge(u,o,z)}mr(r,o,u);break;case 21:mr(r,o,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,mr(r,o,u),vt=p):mr(r,o,u);break;default:mr(r,o,u)}}function Ng(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new qS),o.forEach(function(p){var y=nk.bind(null,r,p);u.has(p)||(u.add(p),p.then(y,y))})}}function un(r,o){var u=o.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];try{var x=r,T=o,z=T;e:for(;z!==null;){switch(z.tag){case 5:ct=z.stateNode,an=!1;break e;case 3:ct=z.stateNode.containerInfo,an=!0;break e;case 4:ct=z.stateNode.containerInfo,an=!0;break e}z=z.return}if(ct===null)throw Error(n(160));_g(x,T,y),ct=null,an=!1;var H=y.alternate;H!==null&&(H.return=null),y.return=null}catch(ie){Ge(y,o,ie)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Cg(o,r),o=o.sibling}function Cg(r,o){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(un(o,r),Cn(r),p&4){try{ls(3,r,r.return),Xl(3,r)}catch(we){Ge(r,r.return,we)}try{ls(5,r,r.return)}catch(we){Ge(r,r.return,we)}}break;case 1:un(o,r),Cn(r),p&512&&u!==null&&ji(u,u.return);break;case 5:if(un(o,r),Cn(r),p&512&&u!==null&&ji(u,u.return),r.flags&32){var y=r.stateNode;try{jn(y,"")}catch(we){Ge(r,r.return,we)}}if(p&4&&(y=r.stateNode,y!=null)){var x=r.memoizedProps,T=u!==null?u.memoizedProps:x,z=r.type,H=r.updateQueue;if(r.updateQueue=null,H!==null)try{z==="input"&&x.type==="radio"&&x.name!=null&&Ae(y,x),Eo(z,T);var ie=Eo(z,x);for(T=0;T<H.length;T+=2){var ae=H[T],ue=H[T+1];ae==="style"?Qs(y,ue):ae==="dangerouslySetInnerHTML"?Gs(y,ue):ae==="children"?jn(y,ue):E(y,ae,ue,ie)}switch(z){case"input":ze(y,x);break;case"textarea":Sn(y,x);break;case"select":var le=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!x.multiple;var pe=x.value;pe!=null?pt(y,!!x.multiple,pe,!1):le!==!!x.multiple&&(x.defaultValue!=null?pt(y,!!x.multiple,x.defaultValue,!0):pt(y,!!x.multiple,x.multiple?[]:"",!1))}y[Xo]=x}catch(we){Ge(r,r.return,we)}}break;case 6:if(un(o,r),Cn(r),p&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,x=r.memoizedProps;try{y.nodeValue=x}catch(we){Ge(r,r.return,we)}}break;case 3:if(un(o,r),Cn(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{zo(o.containerInfo)}catch(we){Ge(r,r.return,we)}break;case 4:un(o,r),Cn(r);break;case 13:un(o,r),Cn(r),y=r.child,y.flags&8192&&(x=y.memoizedState!==null,y.stateNode.isHidden=x,!x||y.alternate!==null&&y.alternate.memoizedState!==null||(yf=qe())),p&4&&Ng(r);break;case 22:if(ae=u!==null&&u.memoizedState!==null,r.mode&1?(vt=(ie=vt)||ae,un(o,r),vt=ie):un(o,r),Cn(r),p&8192){if(ie=r.memoizedState!==null,(r.stateNode.isHidden=ie)&&!ae&&(r.mode&1)!==0)for(ge=r,ae=r.child;ae!==null;){for(ue=ge=ae;ge!==null;){switch(le=ge,pe=le.child,le.tag){case 0:case 11:case 14:case 15:ls(4,le,le.return);break;case 1:ji(le,le.return);var ve=le.stateNode;if(typeof ve.componentWillUnmount=="function"){p=le,u=le.return;try{o=p,ve.props=o.memoizedProps,ve.state=o.memoizedState,ve.componentWillUnmount()}catch(we){Ge(p,u,we)}}break;case 5:ji(le,le.return);break;case 22:if(le.memoizedState!==null){Pg(ue);continue}}pe!==null?(pe.return=le,ge=pe):Pg(ue)}ae=ae.sibling}e:for(ae=null,ue=r;;){if(ue.tag===5){if(ae===null){ae=ue;try{y=ue.stateNode,ie?(x=y.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(z=ue.stateNode,H=ue.memoizedProps.style,T=H!=null&&H.hasOwnProperty("display")?H.display:null,z.style.display=Xs("display",T))}catch(we){Ge(r,r.return,we)}}}else if(ue.tag===6){if(ae===null)try{ue.stateNode.nodeValue=ie?"":ue.memoizedProps}catch(we){Ge(r,r.return,we)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===r)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===r)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===r)break e;ae===ue&&(ae=null),ue=ue.return}ae===ue&&(ae=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:un(o,r),Cn(r),p&4&&Ng(r);break;case 21:break;default:un(o,r),Cn(r)}}function Cn(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(kg(u)){var p=u;break e}u=u.return}throw Error(n(160))}switch(p.tag){case 5:var y=p.stateNode;p.flags&32&&(jn(y,""),p.flags&=-33);var x=Eg(r);pf(r,x,y);break;case 3:case 4:var T=p.stateNode.containerInfo,z=Eg(r);hf(r,z,T);break;default:throw Error(n(161))}}catch(H){Ge(r,r.return,H)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function KS(r,o,u){ge=r,Tg(r)}function Tg(r,o,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,x=y.child;if(y.tag===22&&p){var T=y.memoizedState!==null||Gl;if(!T){var z=y.alternate,H=z!==null&&z.memoizedState!==null||vt;z=Gl;var ie=vt;if(Gl=T,(vt=H)&&!ie)for(ge=y;ge!==null;)T=ge,H=T.child,T.tag===22&&T.memoizedState!==null?Ig(y):H!==null?(H.return=T,ge=H):Ig(y);for(;x!==null;)ge=x,Tg(x),x=x.sibling;ge=y,Gl=z,vt=ie}Og(r)}else(y.subtreeFlags&8772)!==0&&x!==null?(x.return=y,ge=x):Og(r)}}function Og(r){for(;ge!==null;){var o=ge;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:vt||Xl(5,o);break;case 1:var p=o.stateNode;if(o.flags&4&&!vt)if(u===null)p.componentDidMount();else{var y=o.elementType===o.type?u.memoizedProps:ln(o.type,u.memoizedProps);p.componentDidUpdate(y,u.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&Pm(o,x,p);break;case 3:var T=o.updateQueue;if(T!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}Pm(o,T,u)}break;case 5:var z=o.stateNode;if(u===null&&o.flags&4){u=z;var H=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&u.focus();break;case"img":H.src&&(u.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var ie=o.alternate;if(ie!==null){var ae=ie.memoizedState;if(ae!==null){var ue=ae.dehydrated;ue!==null&&zo(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vt||o.flags&512&&df(o)}catch(le){Ge(o,o.return,le)}}if(o===r){ge=null;break}if(u=o.sibling,u!==null){u.return=o.return,ge=u;break}ge=o.return}}function Pg(r){for(;ge!==null;){var o=ge;if(o===r){ge=null;break}var u=o.sibling;if(u!==null){u.return=o.return,ge=u;break}ge=o.return}}function Ig(r){for(;ge!==null;){var o=ge;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{Xl(4,o)}catch(H){Ge(o,u,H)}break;case 1:var p=o.stateNode;if(typeof p.componentDidMount=="function"){var y=o.return;try{p.componentDidMount()}catch(H){Ge(o,y,H)}}var x=o.return;try{df(o)}catch(H){Ge(o,x,H)}break;case 5:var T=o.return;try{df(o)}catch(H){Ge(o,T,H)}}}catch(H){Ge(o,o.return,H)}if(o===r){ge=null;break}var z=o.sibling;if(z!==null){z.return=o.return,ge=z;break}ge=o.return}}var GS=Math.ceil,Ql=N.ReactCurrentDispatcher,mf=N.ReactCurrentOwner,Qt=N.ReactCurrentBatchConfig,Le=0,lt=null,et=null,ft=0,Bt=0,$i=cr(0),it=0,as=null,qr=0,Jl=0,gf=0,us=null,Pt=null,yf=0,zi=1/0,qn=null,Zl=!1,vf=null,gr=null,ea=!1,yr=null,ta=0,cs=0,wf=null,na=-1,ra=0;function bt(){return(Le&6)!==0?qe():na!==-1?na:na=qe()}function vr(r){return(r.mode&1)===0?1:(Le&2)!==0&&ft!==0?ft&-ft:AS.transition!==null?(ra===0&&(ra=dl()),ra):(r=De,r!==0||(r=window.event,r=r===void 0?16:Mp(r.type)),r)}function cn(r,o,u,p){if(50<cs)throw cs=0,wf=null,Error(n(185));$r(r,u,p),((Le&2)===0||r!==lt)&&(r===lt&&((Le&2)===0&&(Jl|=u),it===4&&wr(r,ft)),It(r,p),u===1&&Le===0&&(o.mode&1)===0&&(zi=qe()+500,Il&&dr()))}function It(r,o){var u=r.callbackNode;fl(r,o);var p=$n(r,r===lt?ft:0);if(p===0)u!==null&&ll(u),r.callbackNode=null,r.callbackPriority=0;else if(o=p&-p,r.callbackPriority!==o){if(u!=null&&ll(u),o===1)r.tag===0?IS(Mg.bind(null,r)):vm(Mg.bind(null,r)),CS(function(){(Le&6)===0&&dr()}),u=null;else{switch(_p(p)){case 1:u=Mo;break;case 4:u=ul;break;case 16:u=pi;break;case 536870912:u=cl;break;default:u=pi}u=Bg(u,Ag.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function Ag(r,o){if(na=-1,ra=0,(Le&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Fi()&&r.callbackNode!==u)return null;var p=$n(r,r===lt?ft:0);if(p===0)return null;if((p&30)!==0||(p&r.expiredLanes)!==0||o)o=ia(r,p);else{o=p;var y=Le;Le|=2;var x=Rg();(lt!==r||ft!==o)&&(qn=null,zi=qe()+500,Kr(r,o));do try{JS();break}catch(z){Lg(r,z)}while(!0);Dc(),Ql.current=x,Le=y,et!==null?o=0:(lt=null,ft=0,o=it)}if(o!==0){if(o===2&&(y=Lo(r),y!==0&&(p=y,o=xf(r,y))),o===1)throw u=as,Kr(r,0),wr(r,p),It(r,qe()),u;if(o===6)wr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!XS(y)&&(o=ia(r,p),o===2&&(x=Lo(r),x!==0&&(p=x,o=xf(r,x))),o===1))throw u=as,Kr(r,0),wr(r,p),It(r,qe()),u;switch(r.finishedWork=y,r.finishedLanes=p,o){case 0:case 1:throw Error(n(345));case 2:Gr(r,Pt,qn);break;case 3:if(wr(r,p),(p&130023424)===p&&(o=yf+500-qe(),10<o)){if($n(r,0)!==0)break;if(y=r.suspendedLanes,(y&p)!==p){bt(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=_c(Gr.bind(null,r,Pt,qn),o);break}Gr(r,Pt,qn);break;case 4:if(wr(r,p),(p&4194240)===p)break;for(o=r.eventTimes,y=-1;0<p;){var T=31-jt(p);x=1<<T,T=o[T],T>y&&(y=T),p&=~x}if(p=y,p=qe()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*GS(p/1960))-p,10<p){r.timeoutHandle=_c(Gr.bind(null,r,Pt,qn),p);break}Gr(r,Pt,qn);break;case 5:Gr(r,Pt,qn);break;default:throw Error(n(329))}}}return It(r,qe()),r.callbackNode===u?Ag.bind(null,r):null}function xf(r,o){var u=us;return r.current.memoizedState.isDehydrated&&(Kr(r,o).flags|=256),r=ia(r,o),r!==2&&(o=Pt,Pt=u,o!==null&&bf(o)),r}function bf(r){Pt===null?Pt=r:Pt.push.apply(Pt,r)}function XS(r){for(var o=r;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var p=0;p<u.length;p++){var y=u[p],x=y.getSnapshot;y=y.value;try{if(!on(x(),y))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wr(r,o){for(o&=~gf,o&=~Jl,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-jt(o),p=1<<u;r[u]=-1,o&=~p}}function Mg(r){if((Le&6)!==0)throw Error(n(327));Fi();var o=$n(r,0);if((o&1)===0)return It(r,qe()),null;var u=ia(r,o);if(r.tag!==0&&u===2){var p=Lo(r);p!==0&&(o=p,u=xf(r,p))}if(u===1)throw u=as,Kr(r,0),wr(r,o),It(r,qe()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,Gr(r,Pt,qn),It(r,qe()),null}function Sf(r,o){var u=Le;Le|=1;try{return r(o)}finally{Le=u,Le===0&&(zi=qe()+500,Il&&dr())}}function Yr(r){yr!==null&&yr.tag===0&&(Le&6)===0&&Fi();var o=Le;Le|=1;var u=Qt.transition,p=De;try{if(Qt.transition=null,De=1,r)return r()}finally{De=p,Qt.transition=u,Le=o,(Le&6)===0&&dr()}}function kf(){Bt=$i.current,Be($i)}function Kr(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,NS(u)),et!==null)for(u=et.return;u!==null;){var p=u;switch(Ic(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&Ol();break;case 3:Ri(),Be(Ct),Be(mt),Uc();break;case 5:Vc(p);break;case 4:Ri();break;case 13:Be(Ye);break;case 19:Be(Ye);break;case 10:jc(p.type._context);break;case 22:case 23:kf()}u=u.return}if(lt=r,et=r=xr(r.current,null),ft=Bt=o,it=0,as=null,gf=Jl=qr=0,Pt=us=null,Wr!==null){for(o=0;o<Wr.length;o++)if(u=Wr[o],p=u.interleaved,p!==null){u.interleaved=null;var y=p.next,x=u.pending;if(x!==null){var T=x.next;x.next=y,p.next=T}u.pending=p}Wr=null}return r}function Lg(r,o){do{var u=et;try{if(Dc(),Bl.current=Hl,Vl){for(var p=Ke.memoizedState;p!==null;){var y=p.queue;y!==null&&(y.pending=null),p=p.next}Vl=!1}if(Hr=0,st=rt=Ke=null,ns=!1,rs=0,mf.current=null,u===null||u.return===null){it=1,as=o,et=null;break}e:{var x=r,T=u.return,z=u,H=o;if(o=ft,z.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=H,ae=z,ue=ae.tag;if((ae.mode&1)===0&&(ue===0||ue===11||ue===15)){var le=ae.alternate;le?(ae.updateQueue=le.updateQueue,ae.memoizedState=le.memoizedState,ae.lanes=le.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var pe=og(T);if(pe!==null){pe.flags&=-257,sg(pe,T,z,x,o),pe.mode&1&&ig(x,ie,o),o=pe,H=ie;var ve=o.updateQueue;if(ve===null){var we=new Set;we.add(H),o.updateQueue=we}else ve.add(H);break e}else{if((o&1)===0){ig(x,ie,o),Ef();break e}H=Error(n(426))}}else if(We&&z.mode&1){var Xe=og(T);if(Xe!==null){(Xe.flags&65536)===0&&(Xe.flags|=256),sg(Xe,T,z,x,o),Lc(Di(H,z));break e}}x=H=Di(H,z),it!==4&&(it=2),us===null?us=[x]:us.push(x),x=T;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var te=ng(x,H,o);Om(x,te);break e;case 1:z=H;var X=x.type,ne=x.stateNode;if((x.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(gr===null||!gr.has(ne)))){x.flags|=65536,o&=-o,x.lanes|=o;var ce=rg(x,z,o);Om(x,ce);break e}}x=x.return}while(x!==null)}jg(u)}catch(be){o=be,et===u&&u!==null&&(et=u=u.return);continue}break}while(!0)}function Rg(){var r=Ql.current;return Ql.current=Hl,r===null?Hl:r}function Ef(){(it===0||it===3||it===2)&&(it=4),lt===null||(qr&268435455)===0&&(Jl&268435455)===0||wr(lt,ft)}function ia(r,o){var u=Le;Le|=2;var p=Rg();(lt!==r||ft!==o)&&(qn=null,Kr(r,o));do try{QS();break}catch(y){Lg(r,y)}while(!0);if(Dc(),Le=u,Ql.current=p,et!==null)throw Error(n(261));return lt=null,ft=0,it}function QS(){for(;et!==null;)Dg(et)}function JS(){for(;et!==null&&!qu();)Dg(et)}function Dg(r){var o=Fg(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,o===null?jg(r):et=o,mf.current=null}function jg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=US(u,o,Bt),u!==null){et=u;return}}else{if(u=HS(u,o),u!==null){u.flags&=32767,et=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{it=6,et=null;return}}if(o=o.sibling,o!==null){et=o;return}et=o=r}while(o!==null);it===0&&(it=5)}function Gr(r,o,u){var p=De,y=Qt.transition;try{Qt.transition=null,De=1,ZS(r,o,u,p)}finally{Qt.transition=y,De=p}return null}function ZS(r,o,u,p){do Fi();while(yr!==null);if((Le&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var x=u.lanes|u.childLanes;if(ec(r,x),r===lt&&(et=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||ea||(ea=!0,Bg(pi,function(){return Fi(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Qt.transition,Qt.transition=null;var T=De;De=1;var z=Le;Le|=4,mf.current=null,YS(r,u),Cg(u,r),wS(kc),ml=!!Sc,kc=Sc=null,r.current=u,KS(u),al(),Le=z,De=T,Qt.transition=x}else r.current=u;if(ea&&(ea=!1,yr=r,ta=y),x=r.pendingLanes,x===0&&(gr=null),Gu(u.stateNode),It(r,qe()),o!==null)for(p=r.onRecoverableError,u=0;u<o.length;u++)y=o[u],p(y.value,{componentStack:y.stack,digest:y.digest});if(Zl)throw Zl=!1,r=vf,vf=null,r;return(ta&1)!==0&&r.tag!==0&&Fi(),x=r.pendingLanes,(x&1)!==0?r===wf?cs++:(cs=0,wf=r):cs=0,dr(),null}function Fi(){if(yr!==null){var r=_p(ta),o=Qt.transition,u=De;try{if(Qt.transition=null,De=16>r?16:r,yr===null)var p=!1;else{if(r=yr,yr=null,ta=0,(Le&6)!==0)throw Error(n(331));var y=Le;for(Le|=4,ge=r.current;ge!==null;){var x=ge,T=x.child;if((ge.flags&16)!==0){var z=x.deletions;if(z!==null){for(var H=0;H<z.length;H++){var ie=z[H];for(ge=ie;ge!==null;){var ae=ge;switch(ae.tag){case 0:case 11:case 15:ls(8,ae,x)}var ue=ae.child;if(ue!==null)ue.return=ae,ge=ue;else for(;ge!==null;){ae=ge;var le=ae.sibling,pe=ae.return;if(Sg(ae),ae===ie){ge=null;break}if(le!==null){le.return=pe,ge=le;break}ge=pe}}}var ve=x.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Xe=we.sibling;we.sibling=null,we=Xe}while(we!==null)}}ge=x}}if((x.subtreeFlags&2064)!==0&&T!==null)T.return=x,ge=T;else e:for(;ge!==null;){if(x=ge,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ls(9,x,x.return)}var te=x.sibling;if(te!==null){te.return=x.return,ge=te;break e}ge=x.return}}var X=r.current;for(ge=X;ge!==null;){T=ge;var ne=T.child;if((T.subtreeFlags&2064)!==0&&ne!==null)ne.return=T,ge=ne;else e:for(T=X;ge!==null;){if(z=ge,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:Xl(9,z)}}catch(be){Ge(z,z.return,be)}if(z===T){ge=null;break e}var ce=z.sibling;if(ce!==null){ce.return=z.return,ge=ce;break e}ge=z.return}}if(Le=y,dr(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(mi,r)}catch{}p=!0}return p}finally{De=u,Qt.transition=o}}return!1}function $g(r,o,u){o=Di(u,o),o=ng(r,o,1),r=pr(r,o,1),o=bt(),r!==null&&($r(r,1,o),It(r,o))}function Ge(r,o,u){if(r.tag===3)$g(r,r,u);else for(;o!==null;){if(o.tag===3){$g(o,r,u);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(gr===null||!gr.has(p))){r=Di(u,r),r=rg(o,r,1),o=pr(o,r,1),r=bt(),o!==null&&($r(o,1,r),It(o,r));break}}o=o.return}}function ek(r,o,u){var p=r.pingCache;p!==null&&p.delete(o),o=bt(),r.pingedLanes|=r.suspendedLanes&u,lt===r&&(ft&u)===u&&(it===4||it===3&&(ft&130023424)===ft&&500>qe()-yf?Kr(r,0):gf|=u),It(r,o)}function zg(r,o){o===0&&((r.mode&1)===0?o=1:(o=yi,yi<<=1,(yi&130023424)===0&&(yi=4194304)));var u=bt();r=Wn(r,o),r!==null&&($r(r,o,u),It(r,u))}function tk(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),zg(r,u)}function nk(r,o){var u=0;switch(r.tag){case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=r.stateNode;break;default:throw Error(n(314))}p!==null&&p.delete(o),zg(r,u)}var Fg;Fg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||Ct.current)Ot=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return Ot=!1,WS(r,o,u);Ot=(r.flags&131072)!==0}else Ot=!1,We&&(o.flags&1048576)!==0&&wm(o,Ml,o.index);switch(o.lanes=0,o.tag){case 2:var p=o.type;Kl(r,o),r=o.pendingProps;var y=Ti(o,mt.current);Li(o,u),y=Yc(null,o,p,r,y,u);var x=Kc();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Tt(p)?(x=!0,Pl(o)):x=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Fc(o),y.updater=ql,o.stateNode=y,y._reactInternals=o,ef(o,p,r,u),o=of(null,o,p,!0,x,u)):(o.tag=0,We&&x&&Pc(o),xt(null,o,y,u),o=o.child),o;case 16:p=o.elementType;e:{switch(Kl(r,o),r=o.pendingProps,y=p._init,p=y(p._payload),o.type=p,y=o.tag=ik(p),r=ln(p,r),y){case 0:o=rf(null,o,p,r,u);break e;case 1:o=dg(null,o,p,r,u);break e;case 11:o=lg(null,o,p,r,u);break e;case 14:o=ag(null,o,p,ln(p.type,r),u);break e}throw Error(n(306,p,""))}return o;case 0:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),rf(r,o,p,y,u);case 1:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),dg(r,o,p,y,u);case 3:e:{if(hg(o),r===null)throw Error(n(387));p=o.pendingProps,x=o.memoizedState,y=x.element,Tm(r,o),zl(o,p,null,u);var T=o.memoizedState;if(p=T.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){y=Di(Error(n(423)),o),o=pg(r,o,p,u,y);break e}else if(p!==y){y=Di(Error(n(424)),o),o=pg(r,o,p,u,y);break e}else for(Ft=ur(o.stateNode.containerInfo.firstChild),zt=o,We=!0,sn=null,u=Nm(o,null,p,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ii(),p===y){o=Hn(r,o,u);break e}xt(r,o,p,u)}o=o.child}return o;case 5:return Im(o),r===null&&Mc(o),p=o.type,y=o.pendingProps,x=r!==null?r.memoizedProps:null,T=y.children,Ec(p,y)?T=null:x!==null&&Ec(p,x)&&(o.flags|=32),fg(r,o),xt(r,o,T,u),o.child;case 6:return r===null&&Mc(o),null;case 13:return mg(r,o,u);case 4:return Bc(o,o.stateNode.containerInfo),p=o.pendingProps,r===null?o.child=Ai(o,null,p,u):xt(r,o,p,u),o.child;case 11:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),lg(r,o,p,y,u);case 7:return xt(r,o,o.pendingProps,u),o.child;case 8:return xt(r,o,o.pendingProps.children,u),o.child;case 12:return xt(r,o,o.pendingProps.children,u),o.child;case 10:e:{if(p=o.type._context,y=o.pendingProps,x=o.memoizedProps,T=y.value,je(Dl,p._currentValue),p._currentValue=T,x!==null)if(on(x.value,T)){if(x.children===y.children&&!Ct.current){o=Hn(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var z=x.dependencies;if(z!==null){T=x.child;for(var H=z.firstContext;H!==null;){if(H.context===p){if(x.tag===1){H=Un(-1,u&-u),H.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var ae=ie.pending;ae===null?H.next=H:(H.next=ae.next,ae.next=H),ie.pending=H}}x.lanes|=u,H=x.alternate,H!==null&&(H.lanes|=u),$c(x.return,u,o),z.lanes|=u;break}H=H.next}}else if(x.tag===10)T=x.type===o.type?null:x.child;else if(x.tag===18){if(T=x.return,T===null)throw Error(n(341));T.lanes|=u,z=T.alternate,z!==null&&(z.lanes|=u),$c(T,u,o),T=x.sibling}else T=x.child;if(T!==null)T.return=x;else for(T=x;T!==null;){if(T===o){T=null;break}if(x=T.sibling,x!==null){x.return=T.return,T=x;break}T=T.return}x=T}xt(r,o,y.children,u),o=o.child}return o;case 9:return y=o.type,p=o.pendingProps.children,Li(o,u),y=Gt(y),p=p(y),o.flags|=1,xt(r,o,p,u),o.child;case 14:return p=o.type,y=ln(p,o.pendingProps),y=ln(p.type,y),ag(r,o,p,y,u);case 15:return ug(r,o,o.type,o.pendingProps,u);case 17:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),Kl(r,o),o.tag=1,Tt(p)?(r=!0,Pl(o)):r=!1,Li(o,u),eg(o,p,y),ef(o,p,y,u),of(null,o,p,!0,r,u);case 19:return yg(r,o,u);case 22:return cg(r,o,u)}throw Error(n(156,o.tag))};function Bg(r,o){return sl(r,o)}function rk(r,o,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(r,o,u,p){return new rk(r,o,u,p)}function _f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ik(r){if(typeof r=="function")return _f(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$)return 11;if(r===G)return 14}return 2}function xr(r,o){var u=r.alternate;return u===null?(u=Jt(r.tag,o,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=o,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,o=r.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function oa(r,o,u,p,y,x){var T=2;if(p=r,typeof r=="function")_f(r)&&(T=1);else if(typeof r=="string")T=5;else e:switch(r){case R:return Xr(u.children,y,x,o);case C:T=8,y|=8;break;case A:return r=Jt(12,u,o,y|2),r.elementType=A,r.lanes=x,r;case Z:return r=Jt(13,u,o,y),r.elementType=Z,r.lanes=x,r;case j:return r=Jt(19,u,o,y),r.elementType=j,r.lanes=x,r;case J:return sa(u,y,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case F:T=10;break e;case L:T=9;break e;case $:T=11;break e;case G:T=14;break e;case q:T=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=Jt(T,u,o,y),o.elementType=r,o.type=p,o.lanes=x,o}function Xr(r,o,u,p){return r=Jt(7,r,p,o),r.lanes=u,r}function sa(r,o,u,p){return r=Jt(22,r,p,o),r.elementType=J,r.lanes=u,r.stateNode={isHidden:!1},r}function Nf(r,o,u){return r=Jt(6,r,null,o),r.lanes=u,r}function Cf(r,o,u){return o=Jt(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function ok(r,o,u,p,y){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jr(0),this.expirationTimes=jr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jr(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Tf(r,o,u,p,y,x,T,z,H){return r=new ok(r,o,u,z,H),o===1?(o=1,x===!0&&(o|=8)):o=0,x=Jt(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fc(x),r}function sk(r,o,u){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:p==null?null:""+p,children:r,containerInfo:o,implementation:u}}function Vg(r){if(!r)return fr;r=r._reactInternals;e:{if(kn(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Tt(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Tt(u))return gm(r,u,o)}return o}function Wg(r,o,u,p,y,x,T,z,H){return r=Tf(u,p,!0,r,y,x,T,z,H),r.context=Vg(null),u=r.current,p=bt(),y=vr(u),x=Un(p,y),x.callback=o??null,pr(u,x,y),r.current.lanes=y,$r(r,y,p),It(r,p),r}function la(r,o,u,p){var y=o.current,x=bt(),T=vr(y);return u=Vg(u),o.context===null?o.context=u:o.pendingContext=u,o=Un(x,T),o.payload={element:r},p=p===void 0?null:p,p!==null&&(o.callback=p),r=pr(y,o,T),r!==null&&(cn(r,y,T,x),$l(r,y,T)),T}function aa(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Ug(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Of(r,o){Ug(r,o),(r=r.alternate)&&Ug(r,o)}function lk(){return null}var Hg=typeof reportError=="function"?reportError:function(r){console.error(r)};function Pf(r){this._internalRoot=r}ua.prototype.render=Pf.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));la(r,o,null,null)},ua.prototype.unmount=Pf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Yr(function(){la(null,r,null,null)}),o[zn]=null}};function ua(r){this._internalRoot=r}ua.prototype.unstable_scheduleHydration=function(r){if(r){var o=Tp();r={blockedOn:null,target:r,priority:o};for(var u=0;u<sr.length&&o!==0&&o<sr[u].priority;u++);sr.splice(u,0,r),u===0&&Ip(r)}};function If(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function ca(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function qg(){}function ak(r,o,u,p,y){if(y){if(typeof p=="function"){var x=p;p=function(){var ie=aa(T);x.call(ie)}}var T=Wg(o,p,r,0,null,!1,!1,"",qg);return r._reactRootContainer=T,r[zn]=T.current,Ko(r.nodeType===8?r.parentNode:r),Yr(),T}for(;y=r.lastChild;)r.removeChild(y);if(typeof p=="function"){var z=p;p=function(){var ie=aa(H);z.call(ie)}}var H=Tf(r,0,!1,null,null,!1,!1,"",qg);return r._reactRootContainer=H,r[zn]=H.current,Ko(r.nodeType===8?r.parentNode:r),Yr(function(){la(o,H,u,p)}),H}function fa(r,o,u,p,y){var x=u._reactRootContainer;if(x){var T=x;if(typeof y=="function"){var z=y;y=function(){var H=aa(T);z.call(H)}}la(o,T,r,y)}else T=ak(u,o,r,y,p);return aa(T)}Np=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=Dr(o.pendingLanes);u!==0&&(vi(o,u|1),It(o,qe()),(Le&6)===0&&(zi=qe()+500,dr()))}break;case 13:Yr(function(){var p=Wn(r,1);if(p!==null){var y=bt();cn(p,r,1,y)}}),Of(r,1)}},tc=function(r){if(r.tag===13){var o=Wn(r,134217728);if(o!==null){var u=bt();cn(o,r,134217728,u)}Of(r,134217728)}},Cp=function(r){if(r.tag===13){var o=vr(r),u=Wn(r,o);if(u!==null){var p=bt();cn(u,r,o,p)}Of(r,o)}},Tp=function(){return De},Op=function(r,o){var u=De;try{return De=r,o()}finally{De=u}},Co=function(r,o,u){switch(o){case"input":if(ze(r,u),o=u.name,u.type==="radio"&&o!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var p=u[o];if(p!==r&&p.form===r.form){var y=Tl(p);if(!y)throw Error(n(90));he(p),ze(p,y)}}}break;case"textarea":Sn(r,u);break;case"select":o=u.value,o!=null&&pt(r,!!u.multiple,o,!1)}},tl=Sf,nl=Yr;var uk={usingClientEntryPoint:!1,Events:[Qo,Ni,Tl,Zs,el,Sf]},fs={findFiberByHostInstance:zr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ck={bundleType:fs.bundleType,version:fs.version,rendererPackageName:fs.rendererPackageName,rendererConfig:fs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=il(r),r===null?null:r.stateNode},findFiberByHostInstance:fs.findFiberByHostInstance||lk,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 da=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!da.isDisabled&&da.supportsFiber)try{mi=da.inject(ck),Dt=da}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uk,At.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!If(o))throw Error(n(200));return sk(r,o,null,u)},At.createRoot=function(r,o){if(!If(r))throw Error(n(299));var u=!1,p="",y=Hg;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=Tf(r,1,!1,null,null,u,!1,p,y),r[zn]=o.current,Ko(r.nodeType===8?r.parentNode:r),new Pf(o)},At.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=il(o),r=r===null?null:r.stateNode,r},At.flushSync=function(r){return Yr(r)},At.hydrate=function(r,o,u){if(!ca(o))throw Error(n(200));return fa(null,r,o,!0,u)},At.hydrateRoot=function(r,o,u){if(!If(r))throw Error(n(405));var p=u!=null&&u.hydratedSources||null,y=!1,x="",T=Hg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),o=Wg(o,null,r,1,u??null,y,!1,x,T),r[zn]=o.current,Ko(r),p)for(r=0;r<p.length;r++)u=p[r],y=u._getVersion,y=y(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,y]:o.mutableSourceEagerHydrationData.push(u,y);return new ua(o)},At.render=function(r,o,u){if(!ca(o))throw Error(n(200));return fa(null,r,o,!1,u)},At.unmountComponentAtNode=function(r){if(!ca(r))throw Error(n(40));return r._reactRootContainer?(Yr(function(){fa(null,null,r,!1,function(){r._reactRootContainer=null,r[zn]=null})}),!0):!1},At.unstable_batchedUpdates=Sf,At.unstable_renderSubtreeIntoContainer=function(r,o,u,p){if(!ca(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return fa(r,o,u,!1,p)},At.version="18.3.1-next-f1338f8080-20240426",At}var ey;function qv(){if(ey)return Lf.exports;ey=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(),Lf.exports=xk(),Lf.exports}var ty;function bk(){if(ty)return ha;ty=1;var e=qv();return ha.createRoot=e.createRoot,ha.hydrateRoot=e.hydrateRoot,ha}var Sk=bk();const kk=du(Sk);function nt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=nt(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ek={value:()=>{}};function hu(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new $a(n)}function $a(e){this._=e}function _k(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");if(s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}$a.prototype=hu.prototype={constructor:$a,on:function(e,t){var n=this._,i=_k(e+"",n),s,l=-1,a=i.length;if(arguments.length<2){for(;++l<a;)if((s=(e=i[l]).type)&&(s=Nk(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<a;)if(s=(e=i[l]).type)n[s]=ny(n[s],e.name,t);else if(t==null)for(s in n)n[s]=ny(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 $a(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),i=0,s,l;i<s;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,s=l.length;i<s;++i)l[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,l=i.length;s<l;++s)i[s].value.apply(t,n)}};function Nk(e,t){for(var n=0,i=e.length,s;n<i;++n)if((s=e[n]).name===t)return s.value}function ny(e,t,n){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=Ek,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var sh="http://www.w3.org/1999/xhtml";const ry={svg:"http://www.w3.org/2000/svg",xhtml:sh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ry.hasOwnProperty(t)?{space:ry[t],local:e}:e}function Ck(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===sh&&t.documentElement.namespaceURI===sh?t.createElement(e):t.createElementNS(n,e)}}function Tk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yv(e){var t=pu(e);return(t.local?Tk:Ck)(t)}function Ok(){}function Ah(e){return e==null?Ok:function(){return this.querySelector(e)}}function Pk(e){typeof e!="function"&&(e=Ah(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=new Array(a),f,d,m=0;m<a;++m)(f=l[m])&&(d=e.call(f,f.__data__,m,l))&&("__data__"in f&&(d.__data__=f.__data__),c[m]=d);return new Wt(i,this._parents)}function Ik(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ak(){return[]}function Kv(e){return e==null?Ak:function(){return this.querySelectorAll(e)}}function Mk(e){return function(){return Ik(e.apply(this,arguments))}}function Lk(e){typeof e=="function"?e=Mk(e):e=Kv(e);for(var t=this._groups,n=t.length,i=[],s=[],l=0;l<n;++l)for(var a=t[l],c=a.length,f,d=0;d<c;++d)(f=a[d])&&(i.push(e.call(f,f.__data__,d,a)),s.push(f));return new Wt(i,s)}function Gv(e){return function(){return this.matches(e)}}function Xv(e){return function(t){return t.matches(e)}}var Rk=Array.prototype.find;function Dk(e){return function(){return Rk.call(this.children,e)}}function jk(){return this.firstElementChild}function $k(e){return this.select(e==null?jk:Dk(typeof e=="function"?e:Xv(e)))}var zk=Array.prototype.filter;function Fk(){return Array.from(this.children)}function Bk(e){return function(){return zk.call(this.children,e)}}function Vk(e){return this.selectAll(e==null?Fk:Bk(typeof e=="function"?e:Xv(e)))}function Wk(e){typeof e!="function"&&(e=Gv(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=[],f,d=0;d<a;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Wt(i,this._parents)}function Qv(e){return new Array(e.length)}function Uk(){return new Wt(this._enter||this._groups.map(Qv),this._parents)}function Ka(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ka.prototype={constructor:Ka,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 Hk(e){return function(){return e}}function qk(e,t,n,i,s,l){for(var a=0,c,f=t.length,d=l.length;a<d;++a)(c=t[a])?(c.__data__=l[a],i[a]=c):n[a]=new Ka(e,l[a]);for(;a<f;++a)(c=t[a])&&(s[a]=c)}function Yk(e,t,n,i,s,l,a){var c,f,d=new Map,m=t.length,h=l.length,g=new Array(m),v;for(c=0;c<m;++c)(f=t[c])&&(g[c]=v=a.call(f,f.__data__,c,t)+"",d.has(v)?s[c]=f:d.set(v,f));for(c=0;c<h;++c)v=a.call(e,l[c],c,l)+"",(f=d.get(v))?(i[c]=f,f.__data__=l[c],d.delete(v)):n[c]=new Ka(e,l[c]);for(c=0;c<m;++c)(f=t[c])&&d.get(g[c])===f&&(s[c]=f)}function Kk(e){return e.__data__}function Gk(e,t){if(!arguments.length)return Array.from(this,Kk);var n=t?Yk:qk,i=this._parents,s=this._groups;typeof e!="function"&&(e=Hk(e));for(var l=s.length,a=new Array(l),c=new Array(l),f=new Array(l),d=0;d<l;++d){var m=i[d],h=s[d],g=h.length,v=Xk(e.call(m,m&&m.__data__,d,i)),S=v.length,w=c[d]=new Array(S),b=a[d]=new Array(S),k=f[d]=new Array(g);n(m,h,w,b,k,v,t);for(var _=0,E=0,N,I;_<S;++_)if(N=w[_]){for(_>=E&&(E=_+1);!(I=b[E])&&++E<S;);N._next=I||null}}return a=new Wt(a,i),a._enter=c,a._exit=f,a}function Xk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Qk(){return new Wt(this._exit||this._groups.map(Qv),this._parents)}function Jk(e,t,n){var i=this.enter(),s=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?l.remove():n(l),i&&s?i.merge(s).order():s}function Zk(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,s=n.length,l=i.length,a=Math.min(s,l),c=new Array(s),f=0;f<a;++f)for(var d=n[f],m=i[f],h=d.length,g=c[f]=new Array(h),v,S=0;S<h;++S)(v=d[S]||m[S])&&(g[S]=v);for(;f<s;++f)c[f]=n[f];return new Wt(c,this._parents)}function eE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],s=i.length-1,l=i[s],a;--s>=0;)(a=i[s])&&(l&&a.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(a,l),l=a);return this}function tE(e){e||(e=nE);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,i=n.length,s=new Array(i),l=0;l<i;++l){for(var a=n[l],c=a.length,f=s[l]=new Array(c),d,m=0;m<c;++m)(d=a[m])&&(f[m]=d);f.sort(t)}return new Wt(s,this._parents).order()}function nE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iE(){return Array.from(this)}function oE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],s=0,l=i.length;s<l;++s){var a=i[s];if(a)return a}return null}function sE(){let e=0;for(const t of this)++e;return e}function lE(){return!this.node()}function aE(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var s=t[n],l=0,a=s.length,c;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s);return this}function uE(e){return function(){this.removeAttribute(e)}}function cE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fE(e,t){return function(){this.setAttribute(e,t)}}function dE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pE(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 mE(e,t){var n=pu(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?cE:uE:typeof t=="function"?n.local?pE:hE:n.local?dE:fE)(n,t))}function Jv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gE(e){return function(){this.style.removeProperty(e)}}function yE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vE(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function wE(e,t,n){return arguments.length>1?this.each((t==null?gE:typeof t=="function"?vE:yE)(e,t,n??"")):io(this.node(),e)}function io(e,t){return e.style.getPropertyValue(t)||Jv(e).getComputedStyle(e,null).getPropertyValue(t)}function xE(e){return function(){delete this[e]}}function bE(e,t){return function(){this[e]=t}}function SE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kE(e,t){return arguments.length>1?this.each((t==null?xE:typeof t=="function"?SE:bE)(e,t)):this.node()[e]}function Zv(e){return e.trim().split(/^|\s+/)}function Mh(e){return e.classList||new ew(e)}function ew(e){this._node=e,this._names=Zv(e.getAttribute("class")||"")}ew.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 tw(e,t){for(var n=Mh(e),i=-1,s=t.length;++i<s;)n.add(t[i])}function nw(e,t){for(var n=Mh(e),i=-1,s=t.length;++i<s;)n.remove(t[i])}function EE(e){return function(){tw(this,e)}}function _E(e){return function(){nw(this,e)}}function NE(e,t){return function(){(t.apply(this,arguments)?tw:nw)(this,e)}}function CE(e,t){var n=Zv(e+"");if(arguments.length<2){for(var i=Mh(this.node()),s=-1,l=n.length;++s<l;)if(!i.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?NE:t?EE:_E)(n,t))}function TE(){this.textContent=""}function OE(e){return function(){this.textContent=e}}function PE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function IE(e){return arguments.length?this.each(e==null?TE:(typeof e=="function"?PE:OE)(e)):this.node().textContent}function AE(){this.innerHTML=""}function ME(e){return function(){this.innerHTML=e}}function LE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function RE(e){return arguments.length?this.each(e==null?AE:(typeof e=="function"?LE:ME)(e)):this.node().innerHTML}function DE(){this.nextSibling&&this.parentNode.appendChild(this)}function jE(){return this.each(DE)}function $E(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zE(){return this.each($E)}function FE(e){var t=typeof e=="function"?e:Yv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function BE(){return null}function VE(e,t){var n=typeof e=="function"?e:Yv(e),i=t==null?BE:typeof t=="function"?t:Ah(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function WE(){var e=this.parentNode;e&&e.removeChild(this)}function UE(){return this.each(WE)}function HE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YE(e){return this.select(e?qE:HE)}function KE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function GE(e){return function(t){e.call(this,t,this.__data__)}}function XE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function QE(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,s=t.length,l;n<s;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function JE(e,t,n){return function(){var i=this.__on,s,l=GE(t);if(i){for(var a=0,c=i.length;a<c;++a)if((s=i[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=n),s.value=t;return}}this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,options:n},i?i.push(s):this.__on=[s]}}function ZE(e,t,n){var i=XE(e+""),s,l=i.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,m;f<d;++f)for(s=0,m=c[f];s<l;++s)if((a=i[s]).type===m.type&&a.name===m.name)return m.value}return}for(c=t?JE:QE,s=0;s<l;++s)this.each(c(i[s],t,n));return this}function rw(e,t,n){var i=Jv(e),s=i.CustomEvent;typeof s=="function"?s=new s(t,n):(s=i.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function e_(e,t){return function(){return rw(this,e,t)}}function t_(e,t){return function(){return rw(this,e,t.apply(this,arguments))}}function n_(e,t){return this.each((typeof t=="function"?t_:e_)(e,t))}function*r_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],s=0,l=i.length,a;s<l;++s)(a=i[s])&&(yield a)}var iw=[null];function Wt(e,t){this._groups=e,this._parents=t}function Fs(){return new Wt([[document.documentElement]],iw)}function i_(){return this}Wt.prototype=Fs.prototype={constructor:Wt,select:Pk,selectAll:Lk,selectChild:$k,selectChildren:Vk,filter:Wk,data:Gk,enter:Uk,exit:Qk,join:Jk,merge:Zk,selection:i_,order:eE,sort:tE,call:rE,nodes:iE,node:oE,size:sE,empty:lE,each:aE,attr:mE,style:wE,property:kE,classed:CE,text:IE,html:RE,raise:jE,lower:zE,append:FE,insert:VE,remove:UE,clone:YE,datum:KE,on:ZE,dispatch:n_,[Symbol.iterator]:r_};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],iw)}function o_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=o_(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.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 s_={passive:!1},Ts={capture:!0,passive:!1};function jf(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function ow(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",Zi,Ts);"onselectstart"in t?n.on("selectstart.drag",Zi,Ts):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sw(e,t){var n=e.document.documentElement,i=Vt(e).on("dragstart.drag",null);t&&(i.on("click.drag",Zi,Ts),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const pa=e=>()=>e;function lh(e,{sourceEvent:t,subject:n,target:i,identifier:s,active:l,x:a,y:c,dx:f,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:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}lh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function l_(e){return!e.ctrlKey&&!e.button}function a_(){return this.parentNode}function u_(e,t){return t??{x:e.x,y:e.y}}function c_(){return navigator.maxTouchPoints||"ontouchstart"in this}function lw(){var e=l_,t=a_,n=u_,i=c_,s={},l=hu("start","drag","end"),a=0,c,f,d,m,h=0;function g(N){N.on("mousedown.drag",v).filter(i).on("touchstart.drag",b).on("touchmove.drag",k,s_).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,I){if(!(m||!e.call(this,N,I))){var M=E(this,t.call(this,N,I),N,I,"mouse");M&&(Vt(N.view).on("mousemove.drag",S,Ts).on("mouseup.drag",w,Ts),ow(N.view),jf(N),d=!1,c=N.clientX,f=N.clientY,M("start",N))}}function S(N){if(Zi(N),!d){var I=N.clientX-c,M=N.clientY-f;d=I*I+M*M>h}s.mouse("drag",N)}function w(N){Vt(N.view).on("mousemove.drag mouseup.drag",null),sw(N.view,d),Zi(N),s.mouse("end",N)}function b(N,I){if(e.call(this,N,I)){var M=N.changedTouches,R=t.call(this,N,I),C=M.length,A,F;for(A=0;A<C;++A)(F=E(this,R,N,I,M[A].identifier,M[A]))&&(jf(N),F("start",N,M[A]))}}function k(N){var I=N.changedTouches,M=I.length,R,C;for(R=0;R<M;++R)(C=s[I[R].identifier])&&(Zi(N),C("drag",N,I[R]))}function _(N){var I=N.changedTouches,M=I.length,R,C;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),R=0;R<M;++R)(C=s[I[R].identifier])&&(jf(N),C("end",N,I[R]))}function E(N,I,M,R,C,A){var F=l.copy(),L=dn(A||M,I),$,Z,j;if((j=n.call(N,new lh("beforestart",{sourceEvent:M,target:g,identifier:C,active:a,x:L[0],y:L[1],dx:0,dy:0,dispatch:F}),R))!=null)return $=j.x-L[0]||0,Z=j.y-L[1]||0,function G(q,J,Y){var U=L,B;switch(q){case"start":s[C]=G,B=a++;break;case"end":delete s[C],--a;case"drag":L=dn(Y||J,I),B=a;break}F.call(q,N,new lh(q,{sourceEvent:J,subject:j,target:g,identifier:C,active:B,x:L[0]+$,y:L[1]+Z,dx:L[0]-U[0],dy:L[1]-U[1],dispatch:F}),R)}}return g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:pa(!!N),g):e},g.container=function(N){return arguments.length?(t=typeof N=="function"?N:pa(N),g):t},g.subject=function(N){return arguments.length?(n=typeof N=="function"?N:pa(N),g):n},g.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:pa(!!N),g):i},g.on=function(){var N=l.on.apply(l,arguments);return N===l?g:N},g.clickDistance=function(N){return arguments.length?(h=(N=+N)*N,g):Math.sqrt(h)},g}function Lh(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function aw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Bs(){}var Os=.7,Ga=1/Os,eo="\\s*([+-]?\\d+)\\s*",Ps="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f_=/^#([0-9a-f]{3,8})$/,d_=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),h_=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),p_=new RegExp(`^rgba\\(${eo},${eo},${eo},${Ps}\\)$`),m_=new RegExp(`^rgba\\(${An},${An},${An},${Ps}\\)$`),g_=new RegExp(`^hsl\\(${Ps},${An},${An}\\)$`),y_=new RegExp(`^hsla\\(${Ps},${An},${An},${Ps}\\)$`),iy={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};Lh(Bs,oi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oy,formatHex:oy,formatHex8:v_,formatHsl:w_,formatRgb:sy,toString:sy});function oy(){return this.rgb().formatHex()}function v_(){return this.rgb().formatHex8()}function w_(){return uw(this).formatHsl()}function sy(){return this.rgb().formatRgb()}function oi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=f_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ly(t):n===3?new Mt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ma(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=d_.exec(e))?new Mt(t[1],t[2],t[3],1):(t=h_.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=p_.exec(e))?ma(t[1],t[2],t[3],t[4]):(t=m_.exec(e))?ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=g_.exec(e))?cy(t[1],t[2]/100,t[3]/100,1):(t=y_.exec(e))?cy(t[1],t[2]/100,t[3]/100,t[4]):iy.hasOwnProperty(e)?ly(iy[e]):e==="transparent"?new Mt(NaN,NaN,NaN,0):null}function ly(e){return new Mt(e>>16&255,e>>8&255,e&255,1)}function ma(e,t,n,i){return i<=0&&(e=t=n=NaN),new Mt(e,t,n,i)}function x_(e){return e instanceof Bs||(e=oi(e)),e?(e=e.rgb(),new Mt(e.r,e.g,e.b,e.opacity)):new Mt}function ah(e,t,n,i){return arguments.length===1?x_(e):new Mt(e,t,n,i??1)}function Mt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Lh(Mt,ah,aw(Bs,{brighter(e){return e=e==null?Ga:Math.pow(Ga,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mt(ri(this.r),ri(this.g),ri(this.b),Xa(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:ay,formatHex:ay,formatHex8:b_,formatRgb:uy,toString:uy}));function ay(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}`}function b_(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}${ei((isNaN(this.opacity)?1:this.opacity)*255)}`}function uy(){const e=Xa(this.opacity);return`${e===1?"rgb(":"rgba("}${ri(this.r)}, ${ri(this.g)}, ${ri(this.b)}${e===1?")":`, ${e})`}`}function Xa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ri(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ei(e){return e=ri(e),(e<16?"0":"")+e.toString(16)}function cy(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hn(e,t,n,i)}function uw(e){if(e instanceof hn)return new hn(e.h,e.s,e.l,e.opacity);if(e instanceof Bs||(e=oi(e)),!e)return new hn;if(e instanceof hn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,s=Math.min(t,n,i),l=Math.max(t,n,i),a=NaN,c=l-s,f=(l+s)/2;return c?(t===l?a=(n-i)/c+(n<i)*6:n===l?a=(i-t)/c+2:a=(t-n)/c+4,c/=f<.5?l+s:2-l-s,a*=60):c=f>0&&f<1?0:a,new hn(a,c,f,e.opacity)}function S_(e,t,n,i){return arguments.length===1?uw(e):new hn(e,t,n,i??1)}function hn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Lh(hn,S_,aw(Bs,{brighter(e){return e=e==null?Ga:Math.pow(Ga,e),new hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new hn(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,i=n+(n<.5?n:1-n)*t,s=2*n-i;return new Mt($f(e>=240?e-240:e+120,s,i),$f(e,s,i),$f(e<120?e+240:e-120,s,i),this.opacity)},clamp(){return new hn(fy(this.h),ga(this.s),ga(this.l),Xa(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=Xa(this.opacity);return`${e===1?"hsl(":"hsla("}${fy(this.h)}, ${ga(this.s)*100}%, ${ga(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fy(e){return e=(e||0)%360,e<0?e+360:e}function ga(e){return Math.max(0,Math.min(1,e||0))}function $f(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 Rh=e=>()=>e;function k_(e,t){return function(n){return e+n*t}}function E_(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function __(e){return(e=+e)==1?cw:function(t,n){return n-t?E_(t,n,e):Rh(isNaN(t)?n:t)}}function cw(e,t){var n=t-e;return n?k_(e,n):Rh(isNaN(e)?t:e)}const Qa=(function e(t){var n=__(t);function i(s,l){var a=n((s=ah(s)).r,(l=ah(l)).r),c=n(s.g,l.g),f=n(s.b,l.b),d=cw(s.opacity,l.opacity);return function(m){return s.r=a(m),s.g=c(m),s.b=f(m),s.opacity=d(m),s+""}}return i.gamma=e,i})(1);function N_(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),s;return function(l){for(s=0;s<n;++s)i[s]=e[s]*(1-l)+t[s]*l;return i}}function C_(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function T_(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,s=new Array(i),l=new Array(n),a;for(a=0;a<i;++a)s[a]=Es(e[a],t[a]);for(;a<n;++a)l[a]=t[a];return function(c){for(a=0;a<i;++a)l[a]=s[a](c);return l}}function O_(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Pn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function P_(e,t){var n={},i={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Es(e[s],t[s]):i[s]=t[s];return function(l){for(s in n)i[s]=n[s](l);return i}}var uh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zf=new RegExp(uh.source,"g");function I_(e){return function(){return e}}function A_(e){return function(t){return e(t)+""}}function fw(e,t){var n=uh.lastIndex=zf.lastIndex=0,i,s,l,a=-1,c=[],f=[];for(e=e+"",t=t+"";(i=uh.exec(e))&&(s=zf.exec(t));)(l=s.index)>n&&(l=t.slice(n,l),c[a]?c[a]+=l:c[++a]=l),(i=i[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,f.push({i:a,x:Pn(i,s)})),n=zf.lastIndex;return n<t.length&&(l=t.slice(n),c[a]?c[a]+=l:c[++a]=l),c.length<2?f[0]?A_(f[0].x):I_(t):(t=f.length,function(d){for(var m=0,h;m<t;++m)c[(h=f[m]).i]=h.x(d);return c.join("")})}function Es(e,t){var n=typeof t,i;return t==null||n==="boolean"?Rh(t):(n==="number"?Pn:n==="string"?(i=oi(t))?(t=i,Qa):fw:t instanceof oi?Qa:t instanceof Date?O_:C_(t)?N_:Array.isArray(t)?T_:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?P_:Pn)(e,t)}var dy=180/Math.PI,ch={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dw(e,t,n,i,s,l){var a,c,f;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(f=e*n+t*i)&&(n-=e*f,i-=t*f),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,f/=c),e*i<t*n&&(e=-e,t=-t,f=-f,a=-a),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*dy,skewX:Math.atan(f)*dy,scaleX:a,scaleY:c}}var ya;function M_(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ch:dw(t.a,t.b,t.c,t.d,t.e,t.f)}function L_(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?ch:(e=e.matrix,dw(e.a,e.b,e.c,e.d,e.e,e.f))}function hw(e,t,n,i){function s(d){return d.length?d.pop()+" ":""}function l(d,m,h,g,v,S){if(d!==h||m!==g){var w=v.push("translate(",null,t,null,n);S.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h||g)&&v.push("translate("+h+t+g+n)}function a(d,m,h,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:h.push(s(h)+"rotate(",null,i)-2,x:Pn(d,m)})):m&&h.push(s(h)+"rotate("+m+i)}function c(d,m,h,g){d!==m?g.push({i:h.push(s(h)+"skewX(",null,i)-2,x:Pn(d,m)}):m&&h.push(s(h)+"skewX("+m+i)}function f(d,m,h,g,v,S){if(d!==h||m!==g){var w=v.push(s(v)+"scale(",null,",",null,")");S.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h!==1||g!==1)&&v.push(s(v)+"scale("+h+","+g+")")}return function(d,m){var h=[],g=[];return d=e(d),m=e(m),l(d.translateX,d.translateY,m.translateX,m.translateY,h,g),a(d.rotate,m.rotate,h,g),c(d.skewX,m.skewX,h,g),f(d.scaleX,d.scaleY,m.scaleX,m.scaleY,h,g),d=m=null,function(v){for(var S=-1,w=g.length,b;++S<w;)h[(b=g[S]).i]=b.x(v);return h.join("")}}}var R_=hw(M_,"px, ","px)","deg)"),D_=hw(L_,", ",")",")"),j_=1e-12;function hy(e){return((e=Math.exp(e))+1/e)/2}function $_(e){return((e=Math.exp(e))-1/e)/2}function z_(e){return((e=Math.exp(2*e))-1)/(e+1)}const za=(function e(t,n,i){function s(l,a){var c=l[0],f=l[1],d=l[2],m=a[0],h=a[1],g=a[2],v=m-c,S=h-f,w=v*v+S*S,b,k;if(w<j_)k=Math.log(g/d)/t,b=function(R){return[c+R*v,f+R*S,d*Math.exp(t*R*k)]};else{var _=Math.sqrt(w),E=(g*g-d*d+i*w)/(2*d*n*_),N=(g*g-d*d-i*w)/(2*g*n*_),I=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(N*N+1)-N);k=(M-I)/t,b=function(R){var C=R*k,A=hy(I),F=d/(n*_)*(A*z_(t*C+I)-$_(I));return[c+F*v,f+F*S,d*A/hy(t*C+I)]}}return b.duration=k*1e3*t/Math.SQRT2,b}return s.rho=function(l){var a=Math.max(.001,+l),c=a*a,f=c*c;return e(a,c,f)},s})(Math.SQRT2,2,4);var oo=0,vs=0,hs=0,pw=1e3,Ja,ws,Za=0,si=0,mu=0,Is=typeof performance=="object"&&performance.now?performance:Date,mw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Dh(){return si||(mw(F_),si=Is.now()+mu)}function F_(){si=0}function eu(){this._call=this._time=this._next=null}eu.prototype=gw.prototype={constructor:eu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Dh():+n)+(t==null?0:+t),!this._next&&ws!==this&&(ws?ws._next=this:Ja=this,ws=this),this._call=e,this._time=n,fh()},stop:function(){this._call&&(this._call=null,this._time=1/0,fh())}};function gw(e,t,n){var i=new eu;return i.restart(e,t,n),i}function B_(){Dh(),++oo;for(var e=Ja,t;e;)(t=si-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oo}function py(){si=(Za=Is.now())+mu,oo=vs=0;try{B_()}finally{oo=0,W_(),si=0}}function V_(){var e=Is.now(),t=e-Za;t>pw&&(mu-=t,Za=e)}function W_(){for(var e,t=Ja,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ja=n);ws=e,fh(i)}function fh(e){if(!oo){vs&&(vs=clearTimeout(vs));var t=e-si;t>24?(e<1/0&&(vs=setTimeout(py,e-Is.now()-mu)),hs&&(hs=clearInterval(hs))):(hs||(Za=Is.now(),hs=setInterval(V_,pw)),oo=1,mw(py))}}function my(e,t,n){var i=new eu;return t=t==null?0:+t,i.restart(s=>{i.stop(),e(s+t)},t,n),i}var U_=hu("start","end","cancel","interrupt"),H_=[],yw=0,gy=1,dh=2,Fa=3,yy=4,hh=5,Ba=6;function gu(e,t,n,i,s,l){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;q_(e,n,{name:t,index:i,group:s,on:U_,tween:H_,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:yw})}function jh(e,t){var n=vn(e,t);if(n.state>yw)throw new Error("too late; already scheduled");return n}function Ln(e,t){var n=vn(e,t);if(n.state>Fa)throw new Error("too late; already running");return n}function vn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function q_(e,t,n){var i=e.__transition,s;i[t]=n,n.timer=gw(l,0,n.time);function l(d){n.state=gy,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var m,h,g,v;if(n.state!==gy)return f();for(m in i)if(v=i[m],v.name===n.name){if(v.state===Fa)return my(a);v.state===yy?(v.state=Ba,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=Ba,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(my(function(){n.state===Fa&&(n.state=yy,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=dh,n.on.call("start",e,e.__data__,n.index,n.group),n.state===dh){for(n.state=Fa,s=new Array(g=n.tween.length),m=0,h=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(s[++h]=v);s.length=h+1}}function c(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=hh,1),h=-1,g=s.length;++h<g;)s[h].call(e,m);n.state===hh&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=Ba,n.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function Va(e,t){var n=e.__transition,i,s,l=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){l=!1;continue}s=i.state>dh&&i.state<hh,i.state=Ba,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}l&&delete e.__transition}}function Y_(e){return this.each(function(){Va(this,e)})}function K_(e,t){var n,i;return function(){var s=Ln(this,e),l=s.tween;if(l!==n){i=n=l;for(var a=0,c=i.length;a<c;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}s.tween=i}}function G_(e,t,n){var i,s;if(typeof n!="function")throw new Error;return function(){var l=Ln(this,e),a=l.tween;if(a!==i){s=(i=a).slice();for(var c={name:t,value:n},f=0,d=s.length;f<d;++f)if(s[f].name===t){s[f]=c;break}f===d&&s.push(c)}l.tween=s}}function X_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=vn(this.node(),n).tween,s=0,l=i.length,a;s<l;++s)if((a=i[s]).name===e)return a.value;return null}return this.each((t==null?K_:G_)(n,e,t))}function $h(e,t,n){var i=e._id;return e.each(function(){var s=Ln(this,i);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return vn(s,i).value[t]}}function vw(e,t){var n;return(typeof t=="number"?Pn:t instanceof oi?Qa:(n=oi(t))?(t=n,Qa):fw)(e,t)}function Q_(e){return function(){this.removeAttribute(e)}}function J_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Z_(e,t,n){var i,s=n+"",l;return function(){var a=this.getAttribute(e);return a===s?null:a===i?l:l=t(i=a,n)}}function eN(e,t,n){var i,s=n+"",l;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===i?l:l=t(i=a,n)}}function tN(e,t,n){var i,s,l;return function(){var a,c=n(this),f;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),f=c+"",a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c)))}}function nN(e,t,n){var i,s,l;return function(){var a,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),f=c+"",a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c)))}}function rN(e,t){var n=pu(e),i=n==="transform"?D_:vw;return this.attrTween(e,typeof t=="function"?(n.local?nN:tN)(n,i,$h(this,"attr."+e,t)):t==null?(n.local?J_:Q_)(n):(n.local?eN:Z_)(n,i,t))}function iN(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function oN(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sN(e,t){var n,i;function s(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&oN(e,l)),n}return s._value=t,s}function lN(e,t){var n,i;function s(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&iN(e,l)),n}return s._value=t,s}function aN(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 i=pu(e);return this.tween(n,(i.local?sN:lN)(i,t))}function uN(e,t){return function(){jh(this,e).delay=+t.apply(this,arguments)}}function cN(e,t){return t=+t,function(){jh(this,e).delay=t}}function fN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uN:cN)(t,e)):vn(this.node(),t).delay}function dN(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function hN(e,t){return t=+t,function(){Ln(this,e).duration=t}}function pN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dN:hN)(t,e)):vn(this.node(),t).duration}function mN(e,t){if(typeof t!="function")throw new Error;return function(){Ln(this,e).ease=t}}function gN(e){var t=this._id;return arguments.length?this.each(mN(t,e)):vn(this.node(),t).ease}function yN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ln(this,e).ease=n}}function vN(e){if(typeof e!="function")throw new Error;return this.each(yN(this._id,e))}function wN(e){typeof e!="function"&&(e=Gv(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=[],f,d=0;d<a;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Zn(i,this._parents,this._name,this._id)}function xN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,s=n.length,l=Math.min(i,s),a=new Array(i),c=0;c<l;++c)for(var f=t[c],d=n[c],m=f.length,h=a[c]=new Array(m),g,v=0;v<m;++v)(g=f[v]||d[v])&&(h[v]=g);for(;c<i;++c)a[c]=t[c];return new Zn(a,this._parents,this._name,this._id)}function bN(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 SN(e,t,n){var i,s,l=bN(t)?jh:Ln;return function(){var a=l(this,e),c=a.on;c!==i&&(s=(i=c).copy()).on(t,n),a.on=s}}function kN(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(SN(n,e,t))}function EN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _N(){return this.on("end.remove",EN(this._id))}function NN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ah(e));for(var i=this._groups,s=i.length,l=new Array(s),a=0;a<s;++a)for(var c=i[a],f=c.length,d=l[a]=new Array(f),m,h,g=0;g<f;++g)(m=c[g])&&(h=e.call(m,m.__data__,g,c))&&("__data__"in m&&(h.__data__=m.__data__),d[g]=h,gu(d[g],t,n,g,d,vn(m,n)));return new Zn(l,this._parents,t,n)}function CN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kv(e));for(var i=this._groups,s=i.length,l=[],a=[],c=0;c<s;++c)for(var f=i[c],d=f.length,m,h=0;h<d;++h)if(m=f[h]){for(var g=e.call(m,m.__data__,h,f),v,S=vn(m,n),w=0,b=g.length;w<b;++w)(v=g[w])&&gu(v,t,n,w,g,S);l.push(g),a.push(m)}return new Zn(l,a,t,n)}var TN=Fs.prototype.constructor;function ON(){return new TN(this._groups,this._parents)}function PN(e,t){var n,i,s;return function(){var l=io(this,e),a=(this.style.removeProperty(e),io(this,e));return l===a?null:l===n&&a===i?s:s=t(n=l,i=a)}}function ww(e){return function(){this.style.removeProperty(e)}}function IN(e,t,n){var i,s=n+"",l;return function(){var a=io(this,e);return a===s?null:a===i?l:l=t(i=a,n)}}function AN(e,t,n){var i,s,l;return function(){var a=io(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),io(this,e))),a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c))}}function MN(e,t){var n,i,s,l="style."+t,a="end."+l,c;return function(){var f=Ln(this,e),d=f.on,m=f.value[l]==null?c||(c=ww(t)):void 0;(d!==n||s!==m)&&(i=(n=d).copy()).on(a,s=m),f.on=i}}function LN(e,t,n){var i=(e+="")=="transform"?R_:vw;return t==null?this.styleTween(e,PN(e,i)).on("end.style."+e,ww(e)):typeof t=="function"?this.styleTween(e,AN(e,i,$h(this,"style."+e,t))).each(MN(this._id,e)):this.styleTween(e,IN(e,i,t),n).on("end.style."+e,null)}function RN(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function DN(e,t,n){var i,s;function l(){var a=t.apply(this,arguments);return a!==s&&(i=(s=a)&&RN(e,a,n)),i}return l._value=t,l}function jN(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,DN(e,t,n??""))}function $N(e){return function(){this.textContent=e}}function zN(e){return function(){var t=e(this);this.textContent=t??""}}function FN(e){return this.tween("text",typeof e=="function"?zN($h(this,"text",e)):$N(e==null?"":e+""))}function BN(e){return function(t){this.textContent=e.call(this,t)}}function VN(e){var t,n;function i(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&BN(s)),t}return i._value=e,i}function WN(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,VN(e))}function UN(){for(var e=this._name,t=this._id,n=xw(),i=this._groups,s=i.length,l=0;l<s;++l)for(var a=i[l],c=a.length,f,d=0;d<c;++d)if(f=a[d]){var m=vn(f,t);gu(f,e,n,d,a,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Zn(i,this._parents,e,n)}function HN(){var e,t,n=this,i=n._id,s=n.size();return new Promise(function(l,a){var c={value:a},f={value:function(){--s===0&&l()}};n.each(function(){var d=Ln(this,i),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),s===0&&l()})}var qN=0;function Zn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function xw(){return++qN}var Yn=Fs.prototype;Zn.prototype={constructor:Zn,select:NN,selectAll:CN,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:wN,merge:xN,selection:ON,transition:UN,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:kN,attr:rN,attrTween:aN,style:LN,styleTween:jN,text:FN,textTween:WN,remove:_N,tween:X_,delay:fN,duration:pN,ease:gN,easeVarying:vN,end:HN,[Symbol.iterator]:Yn[Symbol.iterator]};function YN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var KN={time:null,delay:0,duration:250,ease:YN};function GN(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 XN(e){var t,n;e instanceof Zn?(t=e._id,e=e._name):(t=xw(),(n=KN).time=Dh(),e=e==null?null:e+"");for(var i=this._groups,s=i.length,l=0;l<s;++l)for(var a=i[l],c=a.length,f,d=0;d<c;++d)(f=a[d])&&gu(f,e,t,d,a,n||GN(f,t));return new Zn(i,this._parents,e,t)}Fs.prototype.interrupt=Y_;Fs.prototype.transition=XN;const va=e=>()=>e;function QN(e,{sourceEvent:t,target:n,transform:i,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:i,enumerable:!0,configurable:!0},_:{value:s}})}function Gn(e,t,n){this.k=e,this.x=t,this.y=n}Gn.prototype={constructor:Gn,scale:function(e){return e===1?this:new Gn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gn(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 yu=new Gn(1,0,0);bw.prototype=Gn.prototype;function bw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yu;return e.__zoom}function Ff(e){e.stopImmediatePropagation()}function ps(e){e.preventDefault(),e.stopImmediatePropagation()}function JN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ZN(){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 vy(){return this.__zoom||yu}function eC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tC(){return navigator.maxTouchPoints||"ontouchstart"in this}function nC(e,t,n){var i=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),a>l?(l+a)/2:Math.min(0,l)||Math.max(0,a))}function Sw(){var e=JN,t=ZN,n=nC,i=eC,s=tC,l=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,f=za,d=hu("start","zoom","end"),m,h,g,v=500,S=150,w=0,b=10;function k(j){j.property("__zoom",vy).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",F).filter(s).on("touchstart.zoom",L).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(j,G,q,J){var Y=j.selection?j.selection():j;Y.property("__zoom",vy),j!==Y?I(j,G,q,J):Y.interrupt().each(function(){M(this,arguments).event(J).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},k.scaleBy=function(j,G,q,J){k.scaleTo(j,function(){var Y=this.__zoom.k,U=typeof G=="function"?G.apply(this,arguments):G;return Y*U},q,J)},k.scaleTo=function(j,G,q,J){k.transform(j,function(){var Y=t.apply(this,arguments),U=this.__zoom,B=q==null?N(Y):typeof q=="function"?q.apply(this,arguments):q,D=U.invert(B),W=typeof G=="function"?G.apply(this,arguments):G;return n(E(_(U,W),B,D),Y,a)},q,J)},k.translateBy=function(j,G,q,J){k.transform(j,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),a)},null,J)},k.translateTo=function(j,G,q,J,Y){k.transform(j,function(){var U=t.apply(this,arguments),B=this.__zoom,D=J==null?N(U):typeof J=="function"?J.apply(this,arguments):J;return n(yu.translate(D[0],D[1]).scale(B.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof q=="function"?-q.apply(this,arguments):-q),U,a)},J,Y)};function _(j,G){return G=Math.max(l[0],Math.min(l[1],G)),G===j.k?j:new Gn(G,j.x,j.y)}function E(j,G,q){var J=G[0]-q[0]*j.k,Y=G[1]-q[1]*j.k;return J===j.x&&Y===j.y?j:new Gn(j.k,J,Y)}function N(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function I(j,G,q,J){j.on("start.zoom",function(){M(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(J).end()}).tween("zoom",function(){var Y=this,U=arguments,B=M(Y,U).event(J),D=t.apply(Y,U),W=q==null?N(D):typeof q=="function"?q.apply(Y,U):q,V=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),K=Y.__zoom,Q=typeof G=="function"?G.apply(Y,U):G,re=f(K.invert(W).concat(V/K.k),Q.invert(W).concat(V/Q.k));return function(se){if(se===1)se=Q;else{var ee=re(se),oe=V/ee[2];se=new Gn(oe,W[0]-ee[0]*oe,W[1]-ee[1]*oe)}B.zoom(null,se)}})}function M(j,G,q){return!q&&j.__zooming||new R(j,G)}function R(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,G),this.taps=0}R.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,G){return this.mouse&&j!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var G=Vt(this.that).datum();d.call(j,this.that,new QN(j,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),G)}};function C(j,...G){if(!e.apply(this,arguments))return;var q=M(this,G).event(j),J=this.__zoom,Y=Math.max(l[0],Math.min(l[1],J.k*Math.pow(2,i.apply(this,arguments)))),U=dn(j);if(q.wheel)(q.mouse[0][0]!==U[0]||q.mouse[0][1]!==U[1])&&(q.mouse[1]=J.invert(q.mouse[0]=U)),clearTimeout(q.wheel);else{if(J.k===Y)return;q.mouse=[U,J.invert(U)],Va(this),q.start()}ps(j),q.wheel=setTimeout(B,S),q.zoom("mouse",n(E(_(J,Y),q.mouse[0],q.mouse[1]),q.extent,a));function B(){q.wheel=null,q.end()}}function A(j,...G){if(g||!e.apply(this,arguments))return;var q=j.currentTarget,J=M(this,G,!0).event(j),Y=Vt(j.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",V,!0),U=dn(j,q),B=j.clientX,D=j.clientY;ow(j.view),Ff(j),J.mouse=[U,this.__zoom.invert(U)],Va(this),J.start();function W(K){if(ps(K),!J.moved){var Q=K.clientX-B,re=K.clientY-D;J.moved=Q*Q+re*re>w}J.event(K).zoom("mouse",n(E(J.that.__zoom,J.mouse[0]=dn(K,q),J.mouse[1]),J.extent,a))}function V(K){Y.on("mousemove.zoom mouseup.zoom",null),sw(K.view,J.moved),ps(K),J.event(K).end()}}function F(j,...G){if(e.apply(this,arguments)){var q=this.__zoom,J=dn(j.changedTouches?j.changedTouches[0]:j,this),Y=q.invert(J),U=q.k*(j.shiftKey?.5:2),B=n(E(_(q,U),J,Y),t.apply(this,G),a);ps(j),c>0?Vt(this).transition().duration(c).call(I,B,J,j):Vt(this).call(k.transform,B,J,j)}}function L(j,...G){if(e.apply(this,arguments)){var q=j.touches,J=q.length,Y=M(this,G,j.changedTouches.length===J).event(j),U,B,D,W;for(Ff(j),B=0;B<J;++B)D=q[B],W=dn(D,this),W=[W,this.__zoom.invert(W),D.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==W[2]&&(Y.touch1=W,Y.taps=0):(Y.touch0=W,U=!0,Y.taps=1+!!m);m&&(m=clearTimeout(m)),U&&(Y.taps<2&&(h=W[0],m=setTimeout(function(){m=null},v)),Va(this),Y.start())}}function $(j,...G){if(this.__zooming){var q=M(this,G).event(j),J=j.changedTouches,Y=J.length,U,B,D,W;for(ps(j),U=0;U<Y;++U)B=J[U],D=dn(B,this),q.touch0&&q.touch0[2]===B.identifier?q.touch0[0]=D:q.touch1&&q.touch1[2]===B.identifier&&(q.touch1[0]=D);if(B=q.that.__zoom,q.touch1){var V=q.touch0[0],K=q.touch0[1],Q=q.touch1[0],re=q.touch1[1],se=(se=Q[0]-V[0])*se+(se=Q[1]-V[1])*se,ee=(ee=re[0]-K[0])*ee+(ee=re[1]-K[1])*ee;B=_(B,Math.sqrt(se/ee)),D=[(V[0]+Q[0])/2,(V[1]+Q[1])/2],W=[(K[0]+re[0])/2,(K[1]+re[1])/2]}else if(q.touch0)D=q.touch0[0],W=q.touch0[1];else return;q.zoom("touch",n(E(B,D,W),q.extent,a))}}function Z(j,...G){if(this.__zooming){var q=M(this,G).event(j),J=j.changedTouches,Y=J.length,U,B;for(Ff(j),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),U=0;U<Y;++U)B=J[U],q.touch0&&q.touch0[2]===B.identifier?delete q.touch0:q.touch1&&q.touch1[2]===B.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(B=dn(B,this),Math.hypot(h[0]-B[0],h[1]-B[1])<b)){var D=Vt(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return k.wheelDelta=function(j){return arguments.length?(i=typeof j=="function"?j:va(+j),k):i},k.filter=function(j){return arguments.length?(e=typeof j=="function"?j:va(!!j),k):e},k.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:va(!!j),k):s},k.extent=function(j){return arguments.length?(t=typeof j=="function"?j:va([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),k):t},k.scaleExtent=function(j){return arguments.length?(l[0]=+j[0],l[1]=+j[1],k):[l[0],l[1]]},k.translateExtent=function(j){return arguments.length?(a[0][0]=+j[0][0],a[1][0]=+j[1][0],a[0][1]=+j[0][1],a[1][1]=+j[1][1],k):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},k.constrain=function(j){return arguments.length?(n=j,k):n},k.duration=function(j){return arguments.length?(c=+j,k):c},k.interpolate=function(j){return arguments.length?(f=j,k):f},k.on=function(){var j=d.on.apply(d,arguments);return j===d?k:j},k.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,k):Math.sqrt(w)},k.tapDistance=function(j){return arguments.length?(b=+j,k):b},k}const gn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.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 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:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},As=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],kw=["Enter"," ","Escape"],Ew={"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 so;(function(e){e.Strict="strict",e.Loose="loose"})(so||(so={}));var ii;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ii||(ii={}));var Ms;(function(e){e.Partial="partial",e.Full="full"})(Ms||(Ms={}));const _w={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Cr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Cr||(Cr={}));var tu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tu||(tu={}));var Se;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Se||(Se={}));const wy={[Se.Left]:Se.Right,[Se.Right]:Se.Left,[Se.Top]:Se.Bottom,[Se.Bottom]:Se.Top};function Nw(e){return e===null?null:e?"valid":"invalid"}const Cw=e=>"id"in e&&"source"in e&&"target"in e,rC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),zh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vs=(e,t=[0,0])=>{const{width:n,height:i}=er(e),s=e.origin??t,l=n*s[0],a=i*s[1];return{x:e.position.x-l,y:e.position.y-a}},iC=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,s)=>{const l=typeof s=="string";let a=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(a=l?t.nodeLookup.get(s):zh(s)?s:t.nodeLookup.get(s.id));const c=a?nu(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vu(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wu(n)},Ws=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=vu(n,nu(s)),i=!0)}),i?wu(n):{x:0,y:0,width:0,height:0}},Fh=(e,t,[n,i,s]=[0,0,1],l=!1,a=!1)=>{const c={...yo(t,[n,i,s]),width:t.width/s,height:t.height/s},f=[];for(const d of e.values()){const{measured:m,selectable:h=!0,hidden:g=!1}=d;if(a&&!h||g)continue;const v=m.width??d.width??d.initialWidth??null,S=m.height??d.height??d.initialHeight??null,w=Ls(c,ao(d)),b=(v??0)*(S??0),k=l&&w>0;(!d.internals.handleBounds||k||w>=b||d.dragging)&&f.push(d)}return f},oC=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function sC(e,t){const n=new Map,i=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)&&(!i||i.has(s.id))&&n.set(s.id,s)}),n}async function lC({nodes:e,width:t,height:n,panZoom:i,minZoom:s,maxZoom:l},a){if(e.size===0)return!0;const c=sC(e,a),f=Ws(c),d=Vh(f,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??l,(a==null?void 0:a.padding)??.1);return await i.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Tw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:s,onError:l}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:f,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},m=a.origin??i;let h=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)l==null||l("005",gn.error005());else{const v=c.measured.width,S=c.measured.height;v&&S&&(h=[[f,d],[f+v,d+S]])}else c&&ai(a.extent)&&(h=[[a.extent[0][0]+f,a.extent[0][1]+d],[a.extent[1][0]+f,a.extent[1][1]+d]]);const g=ai(h)?li(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(l==null||l("015",gn.error015())),{position:{x:g.x-f+(a.measured.width??0)*m[0],y:g.y-d+(a.measured.height??0)*m[1]},positionAbsolute:g}}async function aC({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:s}){const l=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=l.has(g.id),S=!v&&g.parentId&&a.find(w=>w.id===g.parentId);(v||S)&&a.push(g)}const c=new Set(t.map(g=>g.id)),f=i.filter(g=>g.deletable!==!1),m=oC(a,f);for(const g of f)c.has(g.id)&&!m.find(S=>S.id===g.id)&&m.push(g);if(!s)return{edges:m,nodes:a};const h=await s({nodes:a,edges:m});return typeof h=="boolean"?h?{edges:m,nodes:a}:{edges:[],nodes:[]}:h}const lo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),li=(e={x:0,y:0},t,n)=>({x:lo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ow(e,t,n){const{width:i,height:s}=er(n),{x:l,y:a}=n.internals.positionAbsolute;return li(e,[[l,a],[l+i,a+s]],t)}const xy=(e,t,n)=>e<t?lo(Math.abs(e-t),1,t)/t:e>n?-lo(Math.abs(e-n),1,t)/t:0,Bh=(e,t,n=15,i=40)=>{const s=xy(e.x,i,t.width-i)*n,l=xy(e.y,i,t.height-i)*n;return[s,l]},vu=(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)}),ph=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),wu=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),ao=(e,t=[0,0])=>{var s,l;const{x:n,y:i}=zh(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},nu=(e,t=[0,0])=>{var s,l;const{x:n,y:i}=zh(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:i+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},Pw=(e,t)=>wu(vu(ph(e),ph(t))),Ls=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},by=e=>pn(e.width)&&pn(e.height)&&pn(e.x)&&pn(e.y),pn=e=>!isNaN(e)&&isFinite(e),Iw=(e,t)=>(n,i)=>{},Us=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),yo=({x:e,y:t},[n,i,s],l=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-i)/s};return l?Us(c,a):c},uo=({x:e,y:t},[n,i,s])=>({x:e*s+n,y:t*s+i});function Bi(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(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function uC(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Bi(e,n),s=Bi(e,t);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof e=="object"){const i=Bi(e.top??e.y??0,n),s=Bi(e.bottom??e.y??0,n),l=Bi(e.left??e.x??0,t),a=Bi(e.right??e.x??0,t);return{top:i,right:a,bottom:s,left:l,x:l+a,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function cC(e,t,n,i,s,l){const{x:a,y:c}=uo(e,[t,n,i]),{x:f,y:d}=uo({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=s-f,h=l-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(h)}}const Vh=(e,t,n,i,s,l)=>{const a=uC(l,t,n),c=(t-a.x)/e.width,f=(n-a.y)/e.height,d=Math.min(c,f),m=lo(d,i,s),h=e.x+e.width/2,g=e.y+e.height/2,v=t/2-h*m,S=n/2-g*m,w=cC(e,v,S,m,t,n),b={left:Math.min(w.left-a.left,0),top:Math.min(w.top-a.top,0),right:Math.min(w.right-a.right,0),bottom:Math.min(w.bottom-a.bottom,0)};return{x:v-b.left+b.right,y:S-b.top+b.bottom,zoom:m}},Rs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ai(e){return e!=null&&e!=="parent"}function er(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 Aw(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 Mw(e,t={width:0,height:0},n,i,s){const l={...e},a=i.get(n);if(a){const c=a.origin||s;l.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function Sy(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function fC(){let e,t;return{promise:new Promise((i,s)=>{e=i,t=s}),resolve:e,reject:t}}function dC(e){return{...Ew,...e||{}}}function _s(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:s}){const{x:l,y:a}=mn(e),c=yo({x:l-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},i),{x:f,y:d}=n?Us(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Wh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Lw=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hC=["INPUT","SELECT","TEXTAREA"];function Rw(e){var i,s;const t=((s=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:hC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Dw=e=>"clientX"in e,mn=(e,t)=>{var l,a;const n=Dw(e),i=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},ky=(e,t,n,i,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).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)/i,y:(c.top-n.top)/i,...Wh(a)}})};function jw({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:c}){const f=e*.125+s*.375+a*.375+n*.125,d=t*.125+l*.375+c*.375+i*.125,m=Math.abs(f-e),h=Math.abs(d-t);return[f,d,m,h]}function wa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ey({pos:e,x1:t,y1:n,x2:i,y2:s,c:l}){switch(e){case Se.Left:return[t-wa(t-i,l),n];case Se.Right:return[t+wa(i-t,l),n];case Se.Top:return[t,n-wa(n-s,l)];case Se.Bottom:return[t,n+wa(s-n,l)]}}function $w({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top,curvature:a=.25}){const[c,f]=Ey({pos:n,x1:e,y1:t,x2:i,y2:s,c:a}),[d,m]=Ey({pos:l,x1:i,y1:s,x2:e,y2:t,c:a}),[h,g,v,S]=jw({sourceX:e,sourceY:t,targetX:i,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:m});return[`M${e},${t} C${c},${f} ${d},${m} ${i},${s}`,h,g,v,S]}function zw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const s=Math.abs(n-e)/2,l=n<e?n+s:n-s,a=Math.abs(i-t)/2,c=i<t?i+a:i-a;return[l,c,s,a]}function pC({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return i;const a=s&&n?i+1e3:i,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 mC({sourceNode:e,targetNode:t,width:n,height:i,transform:s}){const l=vu(nu(e),nu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:i/s[2]};return Ls(a,wu(l))>0}const gC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,yC=(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)),vC=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",gn.error006()),t;const i=n.getEdgeId||gC;let s;return Cw(e)?s={...e}:s={...e,id:i(e)},yC(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Fw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[s,l,a,c]=zw({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,s,l,a,c]}const _y={[Se.Left]:{x:-1,y:0},[Se.Right]:{x:1,y:0},[Se.Top]:{x:0,y:-1},[Se.Bottom]:{x:0,y:1}},wC=({source:e,sourcePosition:t=Se.Bottom,target:n})=>t===Se.Left||t===Se.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},Ny=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xC({source:e,sourcePosition:t=Se.Bottom,target:n,targetPosition:i=Se.Top,center:s,offset:l,stepPosition:a}){const c=_y[t],f=_y[i],d={x:e.x+c.x*l,y:e.y+c.y*l},m={x:n.x+f.x*l,y:n.y+f.y*l},h=wC({source:d,sourcePosition:t,target:m}),g=h.x!==0?"x":"y",v=h[g];let S=[],w,b;const k={x:0,y:0},_={x:0,y:0},[,,E,N]=zw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(w=s.x??d.x+(m.x-d.x)*a,b=s.y??(d.y+m.y)/2):(w=s.x??(d.x+m.x)/2,b=s.y??d.y+(m.y-d.y)*a);const C=[{x:w,y:d.y},{x:w,y:m.y}],A=[{x:d.x,y:b},{x:m.x,y:b}];c[g]===v?S=g==="x"?C:A:S=g==="x"?A:C}else{const C=[{x:d.x,y:m.y}],A=[{x:m.x,y:d.y}];if(g==="x"?S=c.x===v?A:C:S=c.y===v?C:A,t===i){const j=Math.abs(e[g]-n[g]);if(j<=l){const G=Math.min(l-1,l-j);c[g]===v?k[g]=(d[g]>e[g]?-1:1)*G:_[g]=(m[g]>n[g]?-1:1)*G}}if(t!==i){const j=g==="x"?"y":"x",G=c[g]===f[j],q=d[j]>m[j],J=d[j]<m[j];(c[g]===1&&(!G&&q||G&&J)||c[g]!==1&&(!G&&J||G&&q))&&(S=g==="x"?C:A)}const F={x:d.x+k.x,y:d.y+k.y},L={x:m.x+_.x,y:m.y+_.y},$=Math.max(Math.abs(F.x-S[0].x),Math.abs(L.x-S[0].x)),Z=Math.max(Math.abs(F.y-S[0].y),Math.abs(L.y-S[0].y));$>=Z?(w=(F.x+L.x)/2,b=S[0].y):(w=S[0].x,b=(F.y+L.y)/2)}const I={x:d.x+k.x,y:d.y+k.y},M={x:m.x+_.x,y:m.y+_.y};return[[e,...I.x!==S[0].x||I.y!==S[0].y?[I]:[],...S,...M.x!==S[S.length-1].x||M.y!==S[S.length-1].y?[M]:[],n],w,b,E,N]}function bC(e,t,n,i){const s=Math.min(Ny(e,t)/2,Ny(t,n)/2,i),{x:l,y:a}=t;if(e.x===l&&l===n.x||e.y===a&&a===n.y)return`L${l} ${a}`;if(e.y===a){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${l+s*d},${a}Q ${l},${a} ${l},${a+s*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${a+s*f}Q ${l},${a} ${l+s*c},${a}`}function mh({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top,borderRadius:a=5,centerX:c,centerY:f,offset:d=20,stepPosition:m=.5}){const[h,g,v,S,w]=xC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:s},targetPosition:l,center:{x:c,y:f},offset:d,stepPosition:m});let b=`M${h[0].x} ${h[0].y}`;for(let k=1;k<h.length-1;k++)b+=bC(h[k-1],h[k],h[k+1],a);return b+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[b,g,v,S,w]}function Cy(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SC(e){var h;const{sourceNode:t,targetNode:n}=e;if(!Cy(t)||!Cy(n))return null;const i=t.internals.handleBounds||Ty(t.handles),s=n.internals.handleBounds||Ty(n.handles),l=Oy((i==null?void 0:i.source)??[],e.sourceHandle),a=Oy(e.connectionMode===so.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!a)return(h=e.onError)==null||h.call(e,"008",gn.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(l==null?void 0:l.position)||Se.Bottom,f=(a==null?void 0:a.position)||Se.Top,d=ui(t,l,c),m=ui(n,a,f);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function Ty(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function ui(e,t,n=Se.Left,i=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??er(e);if(i)return{x:s+a/2,y:l+c/2};switch((t==null?void 0:t.position)??n){case Se.Top:return{x:s+a/2,y:l};case Se.Right:return{x:s+a,y:l+c/2};case Se.Bottom:return{x:s+a/2,y:l+c};case Se.Left:return{x:s,y:l+c/2}}}function Oy(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function gh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function kC(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:s}){const l=new Set;return e.reduce((a,c)=>([c.markerStart||i,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const d=gh(f,t);l.has(d)||(a.push({id:d,color:f.color||n,...f}),l.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const Bw=1e3,EC=10,Uh={nodeOrigin:[0,0],nodeExtent:As,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_C={...Uh,checkEquality:!0};function Hh(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function NC(e,t,n){const i=Hh(Uh,n);for(const s of e.values())if(s.parentId)Yh(s,e,t,i);else{const l=Vs(s,i.nodeOrigin),a=ai(s.extent)?s.extent:i.nodeExtent,c=li(l,a,er(s));s.internals.positionAbsolute=c}}function CC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const s of e.handles){const l={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(l):s.type==="target"&&i.push(l)}return{source:n,target:i}}function qh(e){return e==="manual"}function yh(e,t,n,i={}){var m,h;const s=Hh(_C,i),l={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!qh(s.zIndexMode)?Bw:0;let f=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let v=a.get(g.id);if(s.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const S=Vs(g,s.nodeOrigin),w=ai(g.extent)?g.extent:s.nodeExtent,b=li(S,w,er(g));v={...s.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(h=g.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:CC(g,v),z:Vw(g,c,s.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(f=!1),g.parentId&&Yh(v,t,n,i,l),d||(d=g.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:d}}function TC(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 Yh(e,t,n,i,s){const{elevateNodesOnSelect:l,nodeOrigin:a,nodeExtent:c,zIndexMode:f}=Hh(Uh,i),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}TC(e,n),s&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++s.i,m.internals.z=m.internals.z+s.i*EC),s&&m.internals.rootParentIndex!==void 0&&(s.i=m.internals.rootParentIndex);const h=l&&!qh(f)?Bw:0,{x:g,y:v,z:S}=OC(e,m,a,c,h,f),{positionAbsolute:w}=e.internals,b=g!==w.x||v!==w.y;(b||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y:v}:w,z:S}})}function Vw(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return qh(n)?i:i+(e.selected?t:0)}function OC(e,t,n,i,s,l){const{x:a,y:c}=t.internals.positionAbsolute,f=er(e),d=Vs(e,n),m=ai(e.extent)?li(d,e.extent,f):d;let h=li({x:a+m.x,y:c+m.y},i,f);e.extent==="parent"&&(h=Ow(h,f,t));const g=Vw(e,s,l),v=t.internals.z??0;return{x:h.x,y:h.y,z:v>=g?v+1:g}}function Kh(e,t,n,i=[0,0]){var a;const s=[],l=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const d=((a=l.get(c.parentId))==null?void 0:a.expandedRect)??ao(f),m=Pw(d,c.rect);l.set(c.parentId,{expandedRect:m,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},d)=>{var E;const m=f.internals.positionAbsolute,h=er(f),g=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,S=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(h.width,Math.round(c.width)),b=Math.max(h.height,Math.round(c.height)),k=(w-h.width)*g[0],_=(b-h.height)*g[1];(v>0||S>0||k||_)&&(s.push({id:d,type:"position",position:{x:f.position.x-v+k,y:f.position.y-S+_}}),(E=n.get(d))==null||E.forEach(N=>{e.some(I=>I.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+v,y:N.position.y+S}})})),(h.width<c.width||h.height<c.height||v||S)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-k:0),height:b+(S?g[1]*S-_:0)}})}),s}function PC(e,t,n,i,s,l,a){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const d=[],m=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const S=t.get(v.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const w=Wh(v.nodeElement),b=S.measured.width!==w.width||S.measured.height!==w.height;if(!!(w.width&&w.height&&(b||!S.internals.handleBounds||v.force))){const _=v.nodeElement.getBoundingClientRect(),E=ai(S.extent)?S.extent:l;let{positionAbsolute:N}=S.internals;S.parentId&&S.extent==="parent"?N=Ow(N,w,t.get(S.parentId)):E&&(N=li(N,E,w));const I={...S,measured:w,internals:{...S.internals,positionAbsolute:N,handleBounds:{source:ky("source",v.nodeElement,_,h,S.id),target:ky("target",v.nodeElement,_,h,S.id)}}};t.set(S.id,I),S.parentId&&Yh(I,t,n,{nodeOrigin:s,zIndexMode:a}),f=!0,b&&(d.push({id:S.id,type:"dimensions",dimensions:w}),S.expandParent&&S.parentId&&g.push({id:S.id,parentId:S.parentId,rect:ao(I,s)}))}}if(g.length>0){const v=Kh(g,t,n,s);d.push(...v)}return{changes:d,updatedInternals:f}}async function IC({delta:e,panZoom:t,transform:n,translateExtent:i,width:s,height:l}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,l]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function Py(e,t,n,i,s,l){let a=s;const c=i.get(a)||new Map;i.set(a,c.set(n,t)),a=`${s}-${e}`;const f=i.get(a)||new Map;if(i.set(a,f.set(n,t)),l){a=`${s}-${e}-${l}`;const d=i.get(a)||new Map;i.set(a,d.set(n,t))}}function Ww(e,t,n){e.clear(),t.clear();for(const i of n){const{source:s,target:l,sourceHandle:a=null,targetHandle:c=null}=i,f={edgeId:i.id,source:s,target:l,sourceHandle:a,targetHandle:c},d=`${s}-${a}--${l}-${c}`,m=`${l}-${c}--${s}-${a}`;Py("source",f,m,e,s,a),Py("target",f,d,e,l,c),t.set(i.id,i)}}function Uw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Uw(n,t):!1}function Iy(e,t,n){var s;let i=e;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function AC(e,t,n,i){const s=new Map;for(const[l,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!Uw(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(l);c&&s.set(l,{id:l,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 Bf({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,c,f;const s=[];for(const[d,m]of t){const h=(a=n.get(d))==null?void 0:a.internals.userNode;h&&s.push({...h,position:m.position,dragging:i})}if(!e)return[s[0],s];const l=(c=n.get(e))==null?void 0:c.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:i}:s[0],s]}function MC({dragItems:e,snapGrid:t,x:n,y:i}){const s=e.values().next().value;if(!s)return null;const l={x:n-s.distance.x,y:i-s.distance.y},a=Us(l,t);return{x:a.x-l.x,y:a.y-l.y}}function LC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:s}){let l={x:null,y:null},a=0,c=new Map,f=!1,d={x:0,y:0},m=null,h=!1,g=null,v=!1,S=!1,w=null;function b({noDragClassName:_,handleSelector:E,domNode:N,isSelectable:I,nodeId:M,nodeClickDistance:R=0}){g=Vt(N);function C({x:$,y:Z}){const{nodeLookup:j,nodeExtent:G,snapGrid:q,snapToGrid:J,nodeOrigin:Y,onNodeDrag:U,onSelectionDrag:B,onError:D,updateNodePositions:W}=t();l={x:$,y:Z};let V=!1;const K=c.size>1,Q=K&&G?ph(Ws(c)):null,re=K&&J?MC({dragItems:c,snapGrid:q,x:$,y:Z}):null;for(const[se,ee]of c){if(!j.has(se))continue;let oe={x:$-ee.distance.x,y:Z-ee.distance.y};J&&(oe=re?{x:Math.round(oe.x+re.x),y:Math.round(oe.y+re.y)}:Us(oe,q));let de=null;if(K&&G&&!ee.extent&&Q){const{positionAbsolute:fe}=ee.internals,ke=fe.x-Q.x+G[0][0],Ie=fe.x+ee.measured.width-Q.x2+G[1][0],Ae=fe.y-Q.y+G[0][1],ze=fe.y+ee.measured.height-Q.y2+G[1][1];de=[[ke,Ae],[Ie,ze]]}const{position:xe,positionAbsolute:he}=Tw({nodeId:se,nextPosition:oe,nodeLookup:j,nodeExtent:de||G,nodeOrigin:Y,onError:D});V=V||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=he}if(S=S||V,!!V&&(W(c,!0),w&&(i||U||!M&&B))){const[se,ee]=Bf({nodeId:M,dragItems:c,nodeLookup:j});i==null||i(w,c,se,ee),U==null||U(w,se,ee),M||B==null||B(w,ee)}}async function A(){if(!m)return;const{transform:$,panBy:Z,autoPanSpeed:j,autoPanOnNodeDrag:G}=t();if(!G){f=!1,cancelAnimationFrame(a);return}const[q,J]=Bh(d,m,j);(q!==0||J!==0)&&(l.x=(l.x??0)-q/$[2],l.y=(l.y??0)-J/$[2],await Z({x:q,y:J})&&C(l)),a=requestAnimationFrame(A)}function F($){var K;const{nodeLookup:Z,multiSelectionActive:j,nodesDraggable:G,transform:q,snapGrid:J,snapToGrid:Y,selectNodesOnDrag:U,onNodeDragStart:B,onSelectionDragStart:D,unselectNodesAndEdges:W}=t();h=!0,(!U||!I)&&!j&&M&&((K=Z.get(M))!=null&&K.selected||W()),I&&U&&M&&(e==null||e(M));const V=_s($.sourceEvent,{transform:q,snapGrid:J,snapToGrid:Y,containerBounds:m});if(l=V,c=AC(Z,G,V,M),c.size>0&&(n||B||!M&&D)){const[Q,re]=Bf({nodeId:M,dragItems:c,nodeLookup:Z});n==null||n($.sourceEvent,c,Q,re),B==null||B($.sourceEvent,Q,re),M||D==null||D($.sourceEvent,re)}}const L=lw().clickDistance(R).on("start",$=>{const{domNode:Z,nodeDragThreshold:j,transform:G,snapGrid:q,snapToGrid:J}=t();m=(Z==null?void 0:Z.getBoundingClientRect())||null,v=!1,S=!1,w=$.sourceEvent,j===0&&F($),l=_s($.sourceEvent,{transform:G,snapGrid:q,snapToGrid:J,containerBounds:m}),d=mn($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:Z,transform:j,snapGrid:G,snapToGrid:q,nodeDragThreshold:J,nodeLookup:Y}=t(),U=_s($.sourceEvent,{transform:j,snapGrid:G,snapToGrid:q,containerBounds:m});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||M&&!Y.has(M))&&(v=!0),!v){if(!f&&Z&&h&&(f=!0,A()),!h){const B=mn($.sourceEvent,m),D=B.x-d.x,W=B.y-d.y;Math.sqrt(D*D+W*W)>J&&F($)}(l.x!==U.xSnapped||l.y!==U.ySnapped)&&c&&h&&(d=mn($.sourceEvent,m),C(U))}}).on("end",$=>{if(!h||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(f=!1,h=!1,cancelAnimationFrame(a),c.size>0){const{nodeLookup:Z,updateNodePositions:j,onNodeDragStop:G,onSelectionDragStop:q}=t();if(S&&(j(c,!1),S=!1),s||G||!M&&q){const[J,Y]=Bf({nodeId:M,dragItems:c,nodeLookup:Z,dragging:!1});s==null||s($.sourceEvent,c,J,Y),G==null||G($.sourceEvent,J,Y),M||q==null||q($.sourceEvent,Y)}}}).filter($=>{const Z=$.target;return!$.button&&(!_||!Iy(Z,`.${_}`,N))&&(!E||Iy(Z,E,N))});g.call(L)}function k(){g==null||g.on(".drag",null)}return{update:b,destroy:k}}function RC(e,t,n){const i=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Ls(s,ao(l))>0&&i.push(l);return i}const DC=250;function jC(e,t,n,i){var c,f;let s=[],l=1/0;const a=RC(e,n,t+DC);for(const d of a){const m=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((f=d.internals.handleBounds)==null?void 0:f.target)??[]];for(const h of m){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:g,y:v}=ui(d,h,h.position,!0),S=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));S>t||(S<l?(s=[{...h,x:g,y:v}],l=S):S===l&&s.push({...h,x:g,y:v}))}}if(!s.length)return null;if(s.length>1){const d=i.type==="source"?"target":"source";return s.find(m=>m.type===d)??s[0]}return s[0]}function Hw(e,t,n,i,s,l=!1){var d,m,h;const a=i.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)??[],...((h=a.internals.handleBounds)==null?void 0:h.target)??[]],f=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return f&&l?{...f,...ui(a,f,f.position,!0)}:f}function qw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $C(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Yw=()=>!0;function zC(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:s,edgeUpdaterType:l,isTarget:a,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:m,flowId:h,panBy:g,cancelConnection:v,onConnectStart:S,onConnect:w,onConnectEnd:b,isValidConnection:k=Yw,onReconnectEnd:_,updateConnection:E,getTransform:N,getFromHandle:I,autoPanSpeed:M,dragThreshold:R=1,handleDomNode:C}){const A=Lw(e.target);let F=0,L;const{x:$,y:Z}=mn(e),j=qw(l,C),G=c==null?void 0:c.getBoundingClientRect();let q=!1;if(!G||!j)return;const J=Hw(s,j,i,f,t);if(!J)return;let Y=mn(e,G),U=!1,B=null,D=!1,W=null;function V(){if(!m||!G)return;const[xe,he]=Bh(Y,G,M);g({x:xe,y:he}),F=requestAnimationFrame(V)}const K={...J,nodeId:s,type:j,position:J.position},Q=f.get(s);let se={inProgress:!0,isValid:null,from:ui(Q,K,Se.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:Q,to:Y,toHandle:null,toPosition:wy[K.position],toNode:null,pointer:Y};function ee(){q=!0,E(se),S==null||S(e,{nodeId:s,handleId:i,handleType:j})}R===0&&ee();function oe(xe){if(!q){const{x:ze,y:wt}=mn(xe),_t=ze-$,ht=wt-Z;if(!(_t*_t+ht*ht>R*R))return;ee()}if(!I()||!K){de(xe);return}const he=N();Y=mn(xe,G),L=jC(yo(Y,he,!1,[1,1]),n,f,K),U||(V(),U=!0);const fe=Kw(xe,{handle:L,connectionMode:t,fromNodeId:s,fromHandleId:i,fromType:a?"target":"source",isValidConnection:k,doc:A,lib:d,flowId:h,nodeLookup:f});W=fe.handleDomNode,B=fe.connection,D=$C(!!L,fe.isValid);const ke=f.get(s),Ie=ke?ui(ke,K,Se.Left,!0):se.from,Ae={...se,from:Ie,isValid:D,to:fe.toHandle&&D?uo({x:fe.toHandle.x,y:fe.toHandle.y},he):Y,toHandle:fe.toHandle,toPosition:D&&fe.toHandle?fe.toHandle.position:wy[K.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:Y};E(Ae),se=Ae}function de(xe){if(!("touches"in xe&&xe.touches.length>0)){if(q){(L||W)&&B&&D&&(w==null||w(B));const{inProgress:he,...fe}=se,ke={...fe,toPosition:se.toHandle?se.toPosition:null};b==null||b(xe,ke),l&&(_==null||_(xe,ke))}v(),cancelAnimationFrame(F),U=!1,D=!1,B=null,W=null,A.removeEventListener("mousemove",oe),A.removeEventListener("mouseup",de),A.removeEventListener("touchmove",oe),A.removeEventListener("touchend",de)}}A.addEventListener("mousemove",oe),A.addEventListener("mouseup",de),A.addEventListener("touchmove",oe),A.addEventListener("touchend",de)}function Kw(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:s,fromType:l,doc:a,lib:c,flowId:f,isValidConnection:d=Yw,nodeLookup:m}){const h=l==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:S}=mn(e),w=a.elementFromPoint(v,S),b=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,k={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const _=qw(void 0,b),E=b.getAttribute("data-nodeid"),N=b.getAttribute("data-handleid"),I=b.classList.contains("connectable"),M=b.classList.contains("connectableend");if(!E||!_)return k;const R={source:h?E:i,sourceHandle:h?N:s,target:h?i:E,targetHandle:h?s:N};k.connection=R;const A=I&&M&&(n===so.Strict?h&&_==="source"||!h&&_==="target":E!==i||N!==s);k.isValid=A&&d(R),k.toHandle=Hw(E,_,N,m,n,!0)}return k}const vh={onPointerDown:zC,isValid:Kw};function FC({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const s=Vt(e);function l({translateExtent:c,width:f,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const S=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const N=n(),I=E.sourceEvent.ctrlKey&&Rs()?10:1,M=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,R=N[2]*Math.pow(2,M*I);t.scaleTo(R)};let w=[0,0];const b=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},k=E=>{const N=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const I=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],M=[I[0]-w[0],I[1]-w[1]];w=I;const R=i()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),C={x:N[0]-M[0]*R,y:N[1]-M[1]*R},A=[[0,0],[f,d]];t.setViewportConstrained({x:C.x,y:C.y,zoom:N[2]},A,c)},_=Sw().on("start",b).on("zoom",h?k:null).on("zoom.wheel",g?S:null);s.call(_,{})}function a(){s.on("zoom",null)}return{update:l,destroy:a,pointer:dn}}const xu=e=>({x:e.x,y:e.y,zoom:e.k}),Vf=({x:e,y:t,zoom:n})=>yu.translate(e,t).scale(n),Ki=(e,t)=>e.target.closest(`.${t}`),Gw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),BC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wf=(e,t=0,n=BC,i=()=>{})=>{const s=typeof t=="number"&&t>0;return s||i(),s?e.transition().duration(t).ease(n).on("end",i):e},Xw=e=>{const t=e.ctrlKey&&Rs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function VC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return m=>{if(Ki(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(m.ctrlKey&&a){const b=dn(m),k=Xw(m),_=h*Math.pow(2,k);i.scaleTo(n,_,b,m);return}const g=m.deltaMode===1?20:1;let v=s===ii.Vertical?0:m.deltaX*g,S=s===ii.Horizontal?0:m.deltaY*g;!Rs()&&m.shiftKey&&s!==ii.Vertical&&(v=m.deltaY*g,S=0),i.translateBy(n,-(v/h)*l,-(S/h)*l,{internal:!0});const w=xu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function WC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,s){const l=i.type==="wheel",a=!t&&l&&!i.ctrlKey,c=Ki(i,e);if(i.ctrlKey&&l&&c&&i.preventDefault(),a||c)return null;i.preventDefault(),n.call(this,i,s)}}function UC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var l,a,c;if((l=i.sourceEvent)!=null&&l.internal)return;const s=xu(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,s))}}function HC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:s}){return l=>{var a,c;e.usedRightMouseButton=!!(n&&Gw(t,e.mouseButton??0)),(a=l.sourceEvent)!=null&&a.sync||i([l.transform.x,l.transform.y,l.transform.k]),s&&!((c=l.sourceEvent)!=null&&c.internal)&&(s==null||s(l.sourceEvent,xu(l.transform)))}}function qC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:l}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,l&&Gw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&l(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),s)){const f=xu(a.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,f)},n?150:0)}}}function YC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:a,noWheelClassName:c,noPanClassName:f,lib:d,connectionInProgress:m}){return h=>{var b;const g=e||t,v=n&&h.ctrlKey,S=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Ki(h,`${d}-flow__node`)||Ki(h,`${d}-flow__edge`)))return!0;if(!i&&!g&&!s&&!l&&!n||a||m&&!S||Ki(h,c)&&S||Ki(h,f)&&(!S||s&&S&&!e)||!n&&h.ctrlKey&&S)return!1;if(!n&&h.type==="touchstart"&&((b=h.touches)==null?void 0:b.length)>1)return h.preventDefault(),!1;if(!g&&!s&&!v&&S||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||S)&&w}}function KC({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:s,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:f}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),h=Sw().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(h);_({x:s.x,y:s.y,zoom:lo(s.zoom,t,n)},[[0,0],[m.width,m.height]],i);const v=g.on("wheel.zoom"),S=g.on("dblclick.zoom");h.wheelDelta(Xw);async function w(L,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).transform(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),L)}):!1}function b({noWheelClassName:L,noPanClassName:$,onPaneContextMenu:Z,userSelectionActive:j,panOnScroll:G,panOnDrag:q,panOnScrollMode:J,panOnScrollSpeed:Y,preventScrolling:U,zoomOnPinch:B,zoomOnScroll:D,zoomOnDoubleClick:W,zoomActivationKeyPressed:V,lib:K,onTransformChange:Q,connectionInProgress:re,paneClickDistance:se,selectionOnDrag:ee}){j&&!d.isZoomingOrPanning&&k();const oe=G&&!V&&!j;h.clickDistance(ee?1/0:!pn(se)||se<0?0:se);const de=oe?VC({zoomPanValues:d,noWheelClassName:L,d3Selection:g,d3Zoom:h,panOnScrollMode:J,panOnScrollSpeed:Y,zoomOnPinch:B,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):WC({noWheelClassName:L,preventScrolling:U,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=UC({zoomPanValues:d,onDraggingChange:f,onPanZoomStart:a});h.on("start",xe);const he=HC({zoomPanValues:d,panOnDrag:q,onPaneContextMenu:!!Z,onPanZoom:l,onTransformChange:Q});h.on("zoom",he);const fe=qC({zoomPanValues:d,panOnDrag:q,panOnScroll:G,onPaneContextMenu:Z,onPanZoomEnd:c,onDraggingChange:f});h.on("end",fe);const ke=YC({zoomActivationKeyPressed:V,panOnDrag:q,zoomOnScroll:D,panOnScroll:G,zoomOnDoubleClick:W,zoomOnPinch:B,userSelectionActive:j,noPanClassName:$,noWheelClassName:L,lib:K,connectionInProgress:re});h.filter(ke),W?g.on("dblclick.zoom",S):g.on("dblclick.zoom",null)}function k(){h.on("zoom",null)}async function _(L,$,Z){const j=Vf(L),G=h==null?void 0:h.constrain()(j,$,Z);return G&&await w(G),G}async function E(L,$){const Z=Vf(L);return await w(Z,$),Z}function N(L){if(g){const $=Vf(L),Z=g.property("__zoom");(Z.k!==L.zoom||Z.x!==L.x||Z.y!==L.y)&&(h==null||h.transform(g,$,null,{sync:!0}))}}function I(){const L=g?bw(g.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function M(L,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).scaleTo(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),L)}):!1}async function R(L,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).scaleBy(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),L)}):!1}function C(L){h==null||h.scaleExtent(L)}function A(L){h==null||h.translateExtent(L)}function F(L){const $=!pn(L)||L<0?0:L;h==null||h.clickDistance($)}return{update:b,destroy:k,setViewport:E,setViewportConstrained:_,getViewport:I,scaleTo:M,scaleBy:R,setScaleExtent:C,setTranslateExtent:A,syncViewport:N,setClickDistance:F}}var co;(function(e){e.Line="line",e.Handle="handle"})(co||(co={}));function GC({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:s,affectsY:l}){const a=e-t,c=n-i,f=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function Ay(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:s}}function Sr(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function xa(e,t,n){return Math.max(0,t-e,e-n)}function My(e,t){return e?!t:t}function XC(e,t,n,i,s,l,a,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:m,isVertical:h}=t,g=m&&h,{xSnapped:v,ySnapped:S}=n,{minWidth:w,maxWidth:b,minHeight:k,maxHeight:_}=i,{x:E,y:N,width:I,height:M,aspectRatio:R}=e;let C=Math.floor(m?v-e.pointerX:0),A=Math.floor(h?S-e.pointerY:0);const F=I+(f?-C:C),L=M+(d?-A:A),$=-l[0]*I,Z=-l[1]*M;let j=xa(F,w,b),G=xa(L,k,_);if(a){let Y=0,U=0;f&&C<0?Y=Sr(E+C+$,a[0][0]):!f&&C>0&&(Y=kr(E+F+$,a[1][0])),d&&A<0?U=Sr(N+A+Z,a[0][1]):!d&&A>0&&(U=kr(N+L+Z,a[1][1])),j=Math.max(j,Y),G=Math.max(G,U)}if(c){let Y=0,U=0;f&&C>0?Y=kr(E+C,c[0][0]):!f&&C<0&&(Y=Sr(E+F,c[1][0])),d&&A>0?U=kr(N+A,c[0][1]):!d&&A<0&&(U=Sr(N+L,c[1][1])),j=Math.max(j,Y),G=Math.max(G,U)}if(s){if(m){const Y=xa(F/R,k,_)*R;if(j=Math.max(j,Y),a){let U=0;!f&&!d||f&&!d&&g?U=kr(N+Z+F/R,a[1][1])*R:U=Sr(N+Z+(f?C:-C)/R,a[0][1])*R,j=Math.max(j,U)}if(c){let U=0;!f&&!d||f&&!d&&g?U=Sr(N+F/R,c[1][1])*R:U=kr(N+(f?C:-C)/R,c[0][1])*R,j=Math.max(j,U)}}if(h){const Y=xa(L*R,w,b)/R;if(G=Math.max(G,Y),a){let U=0;!f&&!d||d&&!f&&g?U=kr(E+L*R+$,a[1][0])/R:U=Sr(E+(d?A:-A)*R+$,a[0][0])/R,G=Math.max(G,U)}if(c){let U=0;!f&&!d||d&&!f&&g?U=Sr(E+L*R,c[1][0])/R:U=kr(E+(d?A:-A)*R,c[0][0])/R,G=Math.max(G,U)}}}A=A+(A<0?G:-G),C=C+(C<0?j:-j),s&&(g?F>L*R?A=(My(f,d)?-C:C)/R:C=(My(f,d)?-A:A)*R:m?(A=C/R,d=f):(C=A*R,f=d));const q=f?E+C:E,J=d?N+A:N;return{width:I+(f?-C:C),height:M+(d?-A:A),x:l[0]*C*(f?-1:1)+q,y:l[1]*A*(d?-1:1)+J}}const Qw={width:0,height:0,x:0,y:0},QC={...Qw,pointerX:0,pointerY:0,aspectRatio:1};function JC(e,t,n){const i=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,a=e.measured.height??0,c=n[0]*l,f=n[1]*a;return[[i-c,s-f],[i+l-c,s+a-f]]}function ZC({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:s}){const l=Vt(e);let a={controlDirection:Ay("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:h,resizeDirection:g,onResizeStart:v,onResize:S,onResizeEnd:w,shouldResize:b}){let k={...Qw},_={...QC};a={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:Ay(d)};let E,N=null,I=[],M,R,C,A=!1;const F=lw().on("start",L=>{const{nodeLookup:$,transform:Z,snapGrid:j,snapToGrid:G,nodeOrigin:q,paneDomNode:J}=n();if(E=$.get(t),!E)return;N=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:U}=_s(L.sourceEvent,{transform:Z,snapGrid:j,snapToGrid:G,containerBounds:N});k={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},_={...k,pointerX:Y,pointerY:U,aspectRatio:k.width/k.height},M=void 0,R=ai(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(M=$.get(E.parentId)),M&&E.extent==="parent"&&(R=[[0,0],[M.measured.width,M.measured.height]]),I=[],C=void 0;for(const[B,D]of $)if(D.parentId===t&&(I.push({id:B,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const W=JC(D,E,D.origin??q);C?C=[[Math.min(W[0][0],C[0][0]),Math.min(W[0][1],C[0][1])],[Math.max(W[1][0],C[1][0]),Math.max(W[1][1],C[1][1])]]:C=W}v==null||v(L,{...k})}).on("drag",L=>{const{transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G}=n(),q=_s(L.sourceEvent,{transform:$,snapGrid:Z,snapToGrid:j,containerBounds:N}),J=[];if(!E)return;const{x:Y,y:U,width:B,height:D}=k,W={},V=E.origin??G,{width:K,height:Q,x:re,y:se}=XC(_,a.controlDirection,q,a.boundaries,a.keepAspectRatio,V,R,C),ee=K!==B,oe=Q!==D,de=re!==Y&&ee,xe=se!==U&&oe;if(!de&&!xe&&!ee&&!oe)return;if((de||xe||V[0]===1||V[1]===1)&&(W.x=de?re:k.x,W.y=xe?se:k.y,k.x=W.x,k.y=W.y,I.length>0)){const Ie=re-Y,Ae=se-U;for(const ze of I)ze.position={x:ze.position.x-Ie+V[0]*(K-B),y:ze.position.y-Ae+V[1]*(Q-D)},J.push(ze)}if((ee||oe)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:k.width,W.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:k.height,k.width=W.width,k.height=W.height),M&&E.expandParent){const Ie=V[0]*(W.width??0);W.x&&W.x<Ie&&(k.x=Ie,_.x=_.x-(W.x-Ie));const Ae=V[1]*(W.height??0);W.y&&W.y<Ae&&(k.y=Ae,_.y=_.y-(W.y-Ae))}const he=GC({width:k.width,prevWidth:B,height:k.height,prevHeight:D,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),fe={...k,direction:he};(b==null?void 0:b(L,fe))!==!1&&(A=!0,S==null||S(L,fe),i(W,J))}).on("end",L=>{A&&(w==null||w(L,{...k}),s==null||s({...k}),A=!1)});l.call(F)}function f(){l.on(".drag",null)}return{update:c,destroy:f}}var Uf={exports:{}},Hf={},qf={exports:{}},Yf={};/**
|
|
40
|
+
`+x.stack}return{value:r,source:o,stack:y,digest:null}}function tf(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function nf(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var BS=typeof WeakMap=="function"?WeakMap:Map;function ng(r,o,u){u=Un(-1,u),u.tag=3,u.payload={element:null};var p=o.value;return u.callback=function(){Zl||(Zl=!0,vf=p),nf(r,o)},u}function rg(r,o,u){u=Un(-1,u),u.tag=3;var p=r.type.getDerivedStateFromError;if(typeof p=="function"){var y=o.value;u.payload=function(){return p(y)},u.callback=function(){nf(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){nf(r,o),typeof p!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),u}function ig(r,o,u){var p=r.pingCache;if(p===null){p=r.pingCache=new BS;var y=new Set;p.set(o,y)}else y=p.get(o),y===void 0&&(y=new Set,p.set(o,y));y.has(u)||(y.add(u),r=tk.bind(null,r,o,u),o.then(r,r))}function og(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function sg(r,o,u,p,y){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=Un(-1,1),o.tag=2,pr(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var VS=_.ReactCurrentOwner,Ot=!1;function xt(r,o,u,p){o.child=r===null?_m(o,null,u,p):Ai(o,r.child,u,p)}function lg(r,o,u,p,y){u=u.render;var x=o.ref;return Li(o,y),p=Yc(r,o,u,p,x,y),u=Kc(),r!==null&&!Ot?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Hn(r,o,y)):(We&&u&&Pc(o),o.flags|=1,xt(r,o,p,y),o.child)}function ag(r,o,u,p,y){if(r===null){var x=u.type;return typeof x=="function"&&!Nf(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,ug(r,o,x,p,y)):(r=oa(u.type,null,p,o,o.mode,y),r.ref=o.ref,r.return=o,o.child=r)}if(x=r.child,(r.lanes&y)===0){var T=x.memoizedProps;if(u=u.compare,u=u!==null?u:Ho,u(T,p)&&r.ref===o.ref)return Hn(r,o,y)}return o.flags|=1,r=xr(x,p),r.ref=o.ref,r.return=o,o.child=r}function ug(r,o,u,p,y){if(r!==null){var x=r.memoizedProps;if(Ho(x,p)&&r.ref===o.ref)if(Ot=!1,o.pendingProps=p=x,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Ot=!0);else return o.lanes=r.lanes,Hn(r,o,y)}return rf(r,o,u,p,y)}function cg(r,o,u){var p=o.pendingProps,y=p.children,x=r!==null?r.memoizedState:null;if(p.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},je($i,Bt),Bt|=u;else{if((u&1073741824)===0)return r=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,je($i,Bt),Bt|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=x!==null?x.baseLanes:u,je($i,Bt),Bt|=p}else x!==null?(p=x.baseLanes|u,o.memoizedState=null):p=u,je($i,Bt),Bt|=p;return xt(r,o,y,u),o.child}function fg(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function rf(r,o,u,p,y){var x=Tt(u)?Fr:mt.current;return x=Ti(o,x),Li(o,y),u=Yc(r,o,u,p,x,y),p=Kc(),r!==null&&!Ot?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~y,Hn(r,o,y)):(We&&p&&Pc(o),o.flags|=1,xt(r,o,u,y),o.child)}function dg(r,o,u,p,y){if(Tt(u)){var x=!0;Pl(o)}else x=!1;if(Li(o,y),o.stateNode===null)Kl(r,o),eg(o,u,p),ef(o,u,p,y),p=!0;else if(r===null){var T=o.stateNode,z=o.memoizedProps;T.props=z;var H=T.context,ie=u.contextType;typeof ie=="object"&&ie!==null?ie=Gt(ie):(ie=Tt(u)?Fr:mt.current,ie=Ti(o,ie));var ae=u.getDerivedStateFromProps,ue=typeof ae=="function"||typeof T.getSnapshotBeforeUpdate=="function";ue||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==p||H!==ie)&&tg(o,T,p,ie),hr=!1;var le=o.memoizedState;T.state=le,zl(o,p,T,y),H=o.memoizedState,z!==p||le!==H||Ct.current||hr?(typeof ae=="function"&&(Zc(o,u,ae,p),H=o.memoizedState),(z=hr||Zm(o,u,z,p,le,H,ie))?(ue||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=H),T.props=p,T.state=H,T.context=ie,p=z):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{T=o.stateNode,Tm(r,o),z=o.memoizedProps,ie=o.type===o.elementType?z:ln(o.type,z),T.props=ie,ue=o.pendingProps,le=T.context,H=u.contextType,typeof H=="object"&&H!==null?H=Gt(H):(H=Tt(u)?Fr:mt.current,H=Ti(o,H));var pe=u.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==ue||le!==H)&&tg(o,T,p,H),hr=!1,le=o.memoizedState,T.state=le,zl(o,p,T,y);var ve=o.memoizedState;z!==ue||le!==ve||Ct.current||hr?(typeof pe=="function"&&(Zc(o,u,pe,p),ve=o.memoizedState),(ie=hr||Zm(o,u,ie,p,le,ve,H)||!1)?(ae||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(p,ve,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(p,ve,H)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=ve),T.props=p,T.state=ve,T.context=H,p=ie):(typeof T.componentDidUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===r.memoizedProps&&le===r.memoizedState||(o.flags|=1024),p=!1)}return of(r,o,u,p,x,y)}function of(r,o,u,p,y,x){fg(r,o);var T=(o.flags&128)!==0;if(!p&&!T)return y&&ym(o,u,!1),Hn(r,o,x);p=o.stateNode,VS.current=o;var z=T&&typeof u.getDerivedStateFromError!="function"?null:p.render();return o.flags|=1,r!==null&&T?(o.child=Ai(o,r.child,null,x),o.child=Ai(o,null,z,x)):xt(r,o,z,x),o.memoizedState=p.state,y&&ym(o,u,!0),o.child}function hg(r){var o=r.stateNode;o.pendingContext?mm(r,o.pendingContext,o.pendingContext!==o.context):o.context&&mm(r,o.context,!1),Bc(r,o.containerInfo)}function pg(r,o,u,p,y){return Ii(),Lc(y),o.flags|=256,xt(r,o,u,p),o.child}var sf={dehydrated:null,treeContext:null,retryLane:0};function lf(r){return{baseLanes:r,cachePool:null,transitions:null}}function mg(r,o,u){var p=o.pendingProps,y=Ye.current,x=!1,T=(o.flags&128)!==0,z;if((z=T)||(z=r!==null&&r.memoizedState===null?!1:(y&2)!==0),z?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),je(Ye,y&1),r===null)return Mc(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=p.children,r=p.fallback,x?(p=o.mode,x=o.child,T={mode:"hidden",children:T},(p&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=T):x=sa(T,p,0,null),r=Xr(r,p,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=lf(u),o.memoizedState=sf,r):af(o,T));if(y=r.memoizedState,y!==null&&(z=y.dehydrated,z!==null))return WS(r,o,T,p,z,y,u);if(x){x=p.fallback,T=o.mode,y=r.child,z=y.sibling;var H={mode:"hidden",children:p.children};return(T&1)===0&&o.child!==y?(p=o.child,p.childLanes=0,p.pendingProps=H,o.deletions=null):(p=xr(y,H),p.subtreeFlags=y.subtreeFlags&14680064),z!==null?x=xr(z,x):(x=Xr(x,T,u,null),x.flags|=2),x.return=o,p.return=o,p.sibling=x,o.child=p,p=x,x=o.child,T=r.child.memoizedState,T=T===null?lf(u):{baseLanes:T.baseLanes|u,cachePool:null,transitions:T.transitions},x.memoizedState=T,x.childLanes=r.childLanes&~u,o.memoizedState=sf,p}return x=r.child,r=x.sibling,p=xr(x,{mode:"visible",children:p.children}),(o.mode&1)===0&&(p.lanes=u),p.return=o,p.sibling=null,r!==null&&(u=o.deletions,u===null?(o.deletions=[r],o.flags|=16):u.push(r)),o.child=p,o.memoizedState=null,p}function af(r,o){return o=sa({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Yl(r,o,u,p){return p!==null&&Lc(p),Ai(o,r.child,null,u),r=af(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function WS(r,o,u,p,y,x,T){if(u)return o.flags&256?(o.flags&=-257,p=tf(Error(n(422))),Yl(r,o,T,p)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=p.fallback,y=o.mode,p=sa({mode:"visible",children:p.children},y,0,null),x=Xr(x,y,T,null),x.flags|=2,p.return=o,x.return=o,p.sibling=x,o.child=p,(o.mode&1)!==0&&Ai(o,r.child,null,T),o.child.memoizedState=lf(T),o.memoizedState=sf,x);if((o.mode&1)===0)return Yl(r,o,T,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var z=p.dgst;return p=z,x=Error(n(419)),p=tf(x,p,void 0),Yl(r,o,T,p)}if(z=(T&r.childLanes)!==0,Ot||z){if(p=lt,p!==null){switch(T&-T){case 4:y=2;break;case 16:y=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:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(p.suspendedLanes|T))!==0?0:y,y!==0&&y!==x.retryLane&&(x.retryLane=y,Wn(r,y),cn(p,r,y,-1))}return Ef(),p=tf(Error(n(421))),Yl(r,o,T,p)}return y.data==="$?"?(o.flags|=128,o.child=r.child,o=nk.bind(null,r),y._reactRetry=o,null):(r=x.treeContext,Ft=ur(y.nextSibling),zt=o,We=!0,sn=null,r!==null&&(Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Br,Bn=r.id,Vn=r.overflow,Br=o),o=af(o,p.children),o.flags|=4096,o)}function gg(r,o,u){r.lanes|=o;var p=r.alternate;p!==null&&(p.lanes|=o),$c(r.return,o,u)}function uf(r,o,u,p,y){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=p,x.tail=u,x.tailMode=y)}function yg(r,o,u){var p=o.pendingProps,y=p.revealOrder,x=p.tail;if(xt(r,o,p.children,u),p=Ye.current,(p&2)!==0)p=p&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&gg(r,u,o);else if(r.tag===19)gg(r,u,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}p&=1}if(je(Ye,p),(o.mode&1)===0)o.memoizedState=null;else switch(y){case"forwards":for(u=o.child,y=null;u!==null;)r=u.alternate,r!==null&&Fl(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),uf(o,!1,y,u,x);break;case"backwards":for(u=null,y=o.child,o.child=null;y!==null;){if(r=y.alternate,r!==null&&Fl(r)===null){o.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}uf(o,!0,u,null,x);break;case"together":uf(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Kl(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function Hn(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),qr|=o.lanes,(u&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,u=xr(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=xr(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function US(r,o,u){switch(o.tag){case 3:hg(o),Ii();break;case 5:Im(o);break;case 1:Tt(o.type)&&Pl(o);break;case 4:Bc(o,o.stateNode.containerInfo);break;case 10:var p=o.type._context,y=o.memoizedProps.value;je(Dl,p._currentValue),p._currentValue=y;break;case 13:if(p=o.memoizedState,p!==null)return p.dehydrated!==null?(je(Ye,Ye.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?mg(r,o,u):(je(Ye,Ye.current&1),r=Hn(r,o,u),r!==null?r.sibling:null);je(Ye,Ye.current&1);break;case 19:if(p=(u&o.childLanes)!==0,(r.flags&128)!==0){if(p)return yg(r,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),je(Ye,Ye.current),p)break;return null;case 22:case 23:return o.lanes=0,cg(r,o,u)}return Hn(r,o,u)}var vg,cf,wg,xg;vg=function(r,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},cf=function(){},wg=function(r,o,u,p){var y=r.memoizedProps;if(y!==p){r=o.stateNode,Ur(Nn.current);var x=null;switch(u){case"input":y=ke(r,y),p=ke(r,p),x=[];break;case"select":y=B({},y,{value:void 0}),p=B({},p,{value:void 0}),x=[];break;case"textarea":y=Dn(r,y),p=Dn(r,p),x=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Cl)}ko(u,p);var T;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var z=y[ie];for(T in z)z.hasOwnProperty(T)&&(u||(u={}),u[T]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in p){var H=p[ie];if(z=y!=null?y[ie]:void 0,p.hasOwnProperty(ie)&&H!==z&&(H!=null||z!=null))if(ie==="style")if(z){for(T in z)!z.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(u||(u={}),u[T]="");for(T in H)H.hasOwnProperty(T)&&z[T]!==H[T]&&(u||(u={}),u[T]=H[T])}else u||(x||(x=[]),x.push(ie,u)),u=H;else ie==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,z=z?z.__html:void 0,H!=null&&z!==H&&(x=x||[]).push(ie,H)):ie==="children"?typeof H!="string"&&typeof H!="number"||(x=x||[]).push(ie,""+H):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(H!=null&&ie==="onScroll"&&Fe("scroll",r),x||z===H||(x=[])):(x=x||[]).push(ie,H))}u&&(x=x||[]).push("style",u);var ie=x;(o.updateQueue=ie)&&(o.flags|=4)}},xg=function(r,o,u,p){u!==p&&(o.flags|=4)};function ss(r,o){if(!We)switch(r.tailMode){case"hidden":o=r.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function yt(r){var o=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(o)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&14680064,p|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,o}function HS(r,o,u){var p=o.pendingProps;switch(Ic(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(o),null;case 1:return Tt(o.type)&&Ol(),yt(o),null;case 3:return p=o.stateNode,Ri(),Be(Ct),Be(mt),Uc(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(r===null||r.child===null)&&(Ll(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,sn!==null&&(bf(sn),sn=null))),cf(r,o),yt(o),null;case 5:Vc(o);var y=Ur(ts.current);if(u=o.type,r!==null&&o.stateNode!=null)wg(r,o,u,p,y),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!p){if(o.stateNode===null)throw Error(n(166));return yt(o),null}if(r=Ur(Nn.current),Ll(o)){p=o.stateNode,u=o.type;var x=o.memoizedProps;switch(p[En]=o,p[Xo]=x,r=(o.mode&1)!==0,u){case"dialog":Fe("cancel",p),Fe("close",p);break;case"iframe":case"object":case"embed":Fe("load",p);break;case"video":case"audio":for(y=0;y<Yo.length;y++)Fe(Yo[y],p);break;case"source":Fe("error",p);break;case"img":case"image":case"link":Fe("error",p),Fe("load",p);break;case"details":Fe("toggle",p);break;case"input":Ie(p,x),Fe("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!x.multiple},Fe("invalid",p);break;case"textarea":bn(p,x),Fe("invalid",p)}ko(u,x),y=null;for(var T in x)if(x.hasOwnProperty(T)){var z=x[T];T==="children"?typeof z=="string"?p.textContent!==z&&(x.suppressHydrationWarning!==!0&&_l(p.textContent,z,r),y=["children",z]):typeof z=="number"&&p.textContent!==""+z&&(x.suppressHydrationWarning!==!0&&_l(p.textContent,z,r),y=["children",""+z]):s.hasOwnProperty(T)&&z!=null&&T==="onScroll"&&Fe("scroll",p)}switch(u){case"input":xe(p),wt(p,x,!0);break;case"textarea":xe(p),_t(p);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(p.onclick=Cl)}p=y,o.updateQueue=p,p!==null&&(o.flags|=4)}else{T=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ht(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=T.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=T.createElement(u,{is:p.is}):(r=T.createElement(u),u==="select"&&(T=r,p.multiple?T.multiple=!0:p.size&&(T.size=p.size))):r=T.createElementNS(r,u),r[En]=o,r[Xo]=p,vg(r,o,!1,!1),o.stateNode=r;e:{switch(T=Eo(u,p),u){case"dialog":Fe("cancel",r),Fe("close",r),y=p;break;case"iframe":case"object":case"embed":Fe("load",r),y=p;break;case"video":case"audio":for(y=0;y<Yo.length;y++)Fe(Yo[y],r);y=p;break;case"source":Fe("error",r),y=p;break;case"img":case"image":case"link":Fe("error",r),Fe("load",r),y=p;break;case"details":Fe("toggle",r),y=p;break;case"input":Ie(r,p),y=ke(r,p),Fe("invalid",r);break;case"option":y=p;break;case"select":r._wrapperState={wasMultiple:!!p.multiple},y=B({},p,{value:void 0}),Fe("invalid",r);break;case"textarea":bn(r,p),y=Dn(r,p),Fe("invalid",r);break;default:y=p}ko(u,y),z=y;for(x in z)if(z.hasOwnProperty(x)){var H=z[x];x==="style"?Qs(r,H):x==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&Gs(r,H)):x==="children"?typeof H=="string"?(u!=="textarea"||H!=="")&&jn(r,H):typeof H=="number"&&jn(r,""+H):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?H!=null&&x==="onScroll"&&Fe("scroll",r):H!=null&&E(r,x,H,T))}switch(u){case"input":xe(r),wt(r,p,!1);break;case"textarea":xe(r),_t(r);break;case"option":p.value!=null&&r.setAttribute("value",""+ee(p.value));break;case"select":r.multiple=!!p.multiple,x=p.value,x!=null?pt(r,!!p.multiple,x,!1):p.defaultValue!=null&&pt(r,!!p.multiple,p.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=Cl)}switch(u){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}}p&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return yt(o),null;case 6:if(r&&o.stateNode!=null)xg(r,o,r.memoizedProps,p);else{if(typeof p!="string"&&o.stateNode===null)throw Error(n(166));if(u=Ur(ts.current),Ur(Nn.current),Ll(o)){if(p=o.stateNode,u=o.memoizedProps,p[En]=o,(x=p.nodeValue!==u)&&(r=zt,r!==null))switch(r.tag){case 3:_l(p.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&_l(p.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else p=(u.nodeType===9?u:u.ownerDocument).createTextNode(p),p[En]=o,o.stateNode=p}return yt(o),null;case 13:if(Be(Ye),p=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(We&&Ft!==null&&(o.mode&1)!==0&&(o.flags&128)===0)km(),Ii(),o.flags|=98560,x=!1;else if(x=Ll(o),p!==null&&p.dehydrated!==null){if(r===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[En]=o}else Ii(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yt(o),x=!1}else sn!==null&&(bf(sn),sn=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(p=p!==null,p!==(r!==null&&r.memoizedState!==null)&&p&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(Ye.current&1)!==0?it===0&&(it=3):Ef())),o.updateQueue!==null&&(o.flags|=4),yt(o),null);case 4:return Ri(),cf(r,o),r===null&&Ko(o.stateNode.containerInfo),yt(o),null;case 10:return jc(o.type._context),yt(o),null;case 17:return Tt(o.type)&&Ol(),yt(o),null;case 19:if(Be(Ye),x=o.memoizedState,x===null)return yt(o),null;if(p=(o.flags&128)!==0,T=x.rendering,T===null)if(p)ss(x,!1);else{if(it!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(T=Fl(r),T!==null){for(o.flags|=128,ss(x,!1),p=T.updateQueue,p!==null&&(o.updateQueue=p,o.flags|=4),o.subtreeFlags=0,p=u,u=o.child;u!==null;)x=u,r=p,x.flags&=14680066,T=x.alternate,T===null?(x.childLanes=0,x.lanes=r,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=T.childLanes,x.lanes=T.lanes,x.child=T.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=T.memoizedProps,x.memoizedState=T.memoizedState,x.updateQueue=T.updateQueue,x.type=T.type,r=T.dependencies,x.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return je(Ye,Ye.current&1|2),o.child}r=r.sibling}x.tail!==null&&qe()>zi&&(o.flags|=128,p=!0,ss(x,!1),o.lanes=4194304)}else{if(!p)if(r=Fl(T),r!==null){if(o.flags|=128,p=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),ss(x,!0),x.tail===null&&x.tailMode==="hidden"&&!T.alternate&&!We)return yt(o),null}else 2*qe()-x.renderingStartTime>zi&&u!==1073741824&&(o.flags|=128,p=!0,ss(x,!1),o.lanes=4194304);x.isBackwards?(T.sibling=o.child,o.child=T):(u=x.last,u!==null?u.sibling=T:o.child=T,x.last=T)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=qe(),o.sibling=null,u=Ye.current,je(Ye,p?u&1|2:u&1),o):(yt(o),null);case 22:case 23:return kf(),p=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==p&&(o.flags|=8192),p&&(o.mode&1)!==0?(Bt&1073741824)!==0&&(yt(o),o.subtreeFlags&6&&(o.flags|=8192)):yt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function qS(r,o){switch(Ic(o),o.tag){case 1:return Tt(o.type)&&Ol(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Ri(),Be(Ct),Be(mt),Uc(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return Vc(o),null;case 13:if(Be(Ye),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ii()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return Be(Ye),null;case 4:return Ri(),null;case 10:return jc(o.type._context),null;case 22:case 23:return kf(),null;case 24:return null;default:return null}}var Gl=!1,vt=!1,YS=typeof WeakSet=="function"?WeakSet:Set,ge=null;function ji(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(p){Ge(r,o,p)}else u.current=null}function ff(r,o,u){try{u()}catch(p){Ge(r,o,p)}}var bg=!1;function KS(r,o){if(Sc=ml,r=Zp(),pc(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var T=0,z=-1,H=-1,ie=0,ae=0,ue=r,le=null;t:for(;;){for(var pe;ue!==u||y!==0&&ue.nodeType!==3||(z=T+y),ue!==x||p!==0&&ue.nodeType!==3||(H=T+p),ue.nodeType===3&&(T+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)le=ue,ue=pe;for(;;){if(ue===r)break t;if(le===u&&++ie===y&&(z=T),le===x&&++ae===p&&(H=T),(pe=ue.nextSibling)!==null)break;ue=le,le=ue.parentNode}ue=pe}u=z===-1||H===-1?null:{start:z,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(kc={focusedElem:r,selectionRange:u},ml=!1,ge=o;ge!==null;)if(o=ge,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,ge=r;else for(;ge!==null;){o=ge;try{var ve=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Xe=ve.memoizedState,te=o.stateNode,X=te.getSnapshotBeforeUpdate(o.elementType===o.type?we:ln(o.type,we),Xe);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=o.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){Ge(o,o.return,ce)}if(r=o.sibling,r!==null){r.return=o.return,ge=r;break}ge=o.return}return ve=bg,bg=!1,ve}function ls(r,o,u){var p=o.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&r)===r){var x=y.destroy;y.destroy=void 0,x!==void 0&&ff(o,u,x)}y=y.next}while(y!==p)}}function Xl(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&r)===r){var p=u.create;u.destroy=p()}u=u.next}while(u!==o)}}function df(r){var o=r.ref;if(o!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof o=="function"?o(r):o.current=r}}function Sg(r){var o=r.alternate;o!==null&&(r.alternate=null,Sg(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[En],delete o[Xo],delete o[Cc],delete o[PS],delete o[IS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function kg(r){return r.tag===5||r.tag===3||r.tag===4}function Eg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||kg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function hf(r,o,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(r,o):u.insertBefore(r,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(r,u)):(o=u,o.appendChild(r)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Cl));else if(p!==4&&(r=r.child,r!==null))for(hf(r,o,u),r=r.sibling;r!==null;)hf(r,o,u),r=r.sibling}function pf(r,o,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,o?u.insertBefore(r,o):u.appendChild(r);else if(p!==4&&(r=r.child,r!==null))for(pf(r,o,u),r=r.sibling;r!==null;)pf(r,o,u),r=r.sibling}var ct=null,an=!1;function mr(r,o,u){for(u=u.child;u!==null;)Ng(r,o,u),u=u.sibling}function Ng(r,o,u){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(mi,u)}catch{}switch(u.tag){case 5:vt||ji(u,o);case 6:var p=ct,y=an;ct=null,mr(r,o,u),ct=p,an=y,ct!==null&&(an?(r=ct,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):ct.removeChild(u.stateNode));break;case 18:ct!==null&&(an?(r=ct,u=u.stateNode,r.nodeType===8?_c(r.parentNode,u):r.nodeType===1&&_c(r,u),zo(r)):_c(ct,u.stateNode));break;case 4:p=ct,y=an,ct=u.stateNode.containerInfo,an=!0,mr(r,o,u),ct=p,an=y;break;case 0:case 11:case 14:case 15:if(!vt&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var x=y,T=x.destroy;x=x.tag,T!==void 0&&((x&2)!==0||(x&4)!==0)&&ff(u,o,T),y=y.next}while(y!==p)}mr(r,o,u);break;case 1:if(!vt&&(ji(u,o),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(z){Ge(u,o,z)}mr(r,o,u);break;case 21:mr(r,o,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,mr(r,o,u),vt=p):mr(r,o,u);break;default:mr(r,o,u)}}function _g(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new YS),o.forEach(function(p){var y=rk.bind(null,r,p);u.has(p)||(u.add(p),p.then(y,y))})}}function un(r,o){var u=o.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];try{var x=r,T=o,z=T;e:for(;z!==null;){switch(z.tag){case 5:ct=z.stateNode,an=!1;break e;case 3:ct=z.stateNode.containerInfo,an=!0;break e;case 4:ct=z.stateNode.containerInfo,an=!0;break e}z=z.return}if(ct===null)throw Error(n(160));Ng(x,T,y),ct=null,an=!1;var H=y.alternate;H!==null&&(H.return=null),y.return=null}catch(ie){Ge(y,o,ie)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Cg(o,r),o=o.sibling}function Cg(r,o){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(un(o,r),Cn(r),p&4){try{ls(3,r,r.return),Xl(3,r)}catch(we){Ge(r,r.return,we)}try{ls(5,r,r.return)}catch(we){Ge(r,r.return,we)}}break;case 1:un(o,r),Cn(r),p&512&&u!==null&&ji(u,u.return);break;case 5:if(un(o,r),Cn(r),p&512&&u!==null&&ji(u,u.return),r.flags&32){var y=r.stateNode;try{jn(y,"")}catch(we){Ge(r,r.return,we)}}if(p&4&&(y=r.stateNode,y!=null)){var x=r.memoizedProps,T=u!==null?u.memoizedProps:x,z=r.type,H=r.updateQueue;if(r.updateQueue=null,H!==null)try{z==="input"&&x.type==="radio"&&x.name!=null&&Ae(y,x),Eo(z,T);var ie=Eo(z,x);for(T=0;T<H.length;T+=2){var ae=H[T],ue=H[T+1];ae==="style"?Qs(y,ue):ae==="dangerouslySetInnerHTML"?Gs(y,ue):ae==="children"?jn(y,ue):E(y,ae,ue,ie)}switch(z){case"input":ze(y,x);break;case"textarea":Sn(y,x);break;case"select":var le=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!x.multiple;var pe=x.value;pe!=null?pt(y,!!x.multiple,pe,!1):le!==!!x.multiple&&(x.defaultValue!=null?pt(y,!!x.multiple,x.defaultValue,!0):pt(y,!!x.multiple,x.multiple?[]:"",!1))}y[Xo]=x}catch(we){Ge(r,r.return,we)}}break;case 6:if(un(o,r),Cn(r),p&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,x=r.memoizedProps;try{y.nodeValue=x}catch(we){Ge(r,r.return,we)}}break;case 3:if(un(o,r),Cn(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{zo(o.containerInfo)}catch(we){Ge(r,r.return,we)}break;case 4:un(o,r),Cn(r);break;case 13:un(o,r),Cn(r),y=r.child,y.flags&8192&&(x=y.memoizedState!==null,y.stateNode.isHidden=x,!x||y.alternate!==null&&y.alternate.memoizedState!==null||(yf=qe())),p&4&&_g(r);break;case 22:if(ae=u!==null&&u.memoizedState!==null,r.mode&1?(vt=(ie=vt)||ae,un(o,r),vt=ie):un(o,r),Cn(r),p&8192){if(ie=r.memoizedState!==null,(r.stateNode.isHidden=ie)&&!ae&&(r.mode&1)!==0)for(ge=r,ae=r.child;ae!==null;){for(ue=ge=ae;ge!==null;){switch(le=ge,pe=le.child,le.tag){case 0:case 11:case 14:case 15:ls(4,le,le.return);break;case 1:ji(le,le.return);var ve=le.stateNode;if(typeof ve.componentWillUnmount=="function"){p=le,u=le.return;try{o=p,ve.props=o.memoizedProps,ve.state=o.memoizedState,ve.componentWillUnmount()}catch(we){Ge(p,u,we)}}break;case 5:ji(le,le.return);break;case 22:if(le.memoizedState!==null){Pg(ue);continue}}pe!==null?(pe.return=le,ge=pe):Pg(ue)}ae=ae.sibling}e:for(ae=null,ue=r;;){if(ue.tag===5){if(ae===null){ae=ue;try{y=ue.stateNode,ie?(x=y.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(z=ue.stateNode,H=ue.memoizedProps.style,T=H!=null&&H.hasOwnProperty("display")?H.display:null,z.style.display=Xs("display",T))}catch(we){Ge(r,r.return,we)}}}else if(ue.tag===6){if(ae===null)try{ue.stateNode.nodeValue=ie?"":ue.memoizedProps}catch(we){Ge(r,r.return,we)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===r)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===r)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===r)break e;ae===ue&&(ae=null),ue=ue.return}ae===ue&&(ae=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:un(o,r),Cn(r),p&4&&_g(r);break;case 21:break;default:un(o,r),Cn(r)}}function Cn(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(kg(u)){var p=u;break e}u=u.return}throw Error(n(160))}switch(p.tag){case 5:var y=p.stateNode;p.flags&32&&(jn(y,""),p.flags&=-33);var x=Eg(r);pf(r,x,y);break;case 3:case 4:var T=p.stateNode.containerInfo,z=Eg(r);hf(r,z,T);break;default:throw Error(n(161))}}catch(H){Ge(r,r.return,H)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function GS(r,o,u){ge=r,Tg(r)}function Tg(r,o,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,x=y.child;if(y.tag===22&&p){var T=y.memoizedState!==null||Gl;if(!T){var z=y.alternate,H=z!==null&&z.memoizedState!==null||vt;z=Gl;var ie=vt;if(Gl=T,(vt=H)&&!ie)for(ge=y;ge!==null;)T=ge,H=T.child,T.tag===22&&T.memoizedState!==null?Ig(y):H!==null?(H.return=T,ge=H):Ig(y);for(;x!==null;)ge=x,Tg(x),x=x.sibling;ge=y,Gl=z,vt=ie}Og(r)}else(y.subtreeFlags&8772)!==0&&x!==null?(x.return=y,ge=x):Og(r)}}function Og(r){for(;ge!==null;){var o=ge;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:vt||Xl(5,o);break;case 1:var p=o.stateNode;if(o.flags&4&&!vt)if(u===null)p.componentDidMount();else{var y=o.elementType===o.type?u.memoizedProps:ln(o.type,u.memoizedProps);p.componentDidUpdate(y,u.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&Pm(o,x,p);break;case 3:var T=o.updateQueue;if(T!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}Pm(o,T,u)}break;case 5:var z=o.stateNode;if(u===null&&o.flags&4){u=z;var H=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&u.focus();break;case"img":H.src&&(u.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var ie=o.alternate;if(ie!==null){var ae=ie.memoizedState;if(ae!==null){var ue=ae.dehydrated;ue!==null&&zo(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vt||o.flags&512&&df(o)}catch(le){Ge(o,o.return,le)}}if(o===r){ge=null;break}if(u=o.sibling,u!==null){u.return=o.return,ge=u;break}ge=o.return}}function Pg(r){for(;ge!==null;){var o=ge;if(o===r){ge=null;break}var u=o.sibling;if(u!==null){u.return=o.return,ge=u;break}ge=o.return}}function Ig(r){for(;ge!==null;){var o=ge;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{Xl(4,o)}catch(H){Ge(o,u,H)}break;case 1:var p=o.stateNode;if(typeof p.componentDidMount=="function"){var y=o.return;try{p.componentDidMount()}catch(H){Ge(o,y,H)}}var x=o.return;try{df(o)}catch(H){Ge(o,x,H)}break;case 5:var T=o.return;try{df(o)}catch(H){Ge(o,T,H)}}}catch(H){Ge(o,o.return,H)}if(o===r){ge=null;break}var z=o.sibling;if(z!==null){z.return=o.return,ge=z;break}ge=o.return}}var XS=Math.ceil,Ql=_.ReactCurrentDispatcher,mf=_.ReactCurrentOwner,Qt=_.ReactCurrentBatchConfig,Le=0,lt=null,et=null,ft=0,Bt=0,$i=cr(0),it=0,as=null,qr=0,Jl=0,gf=0,us=null,Pt=null,yf=0,zi=1/0,qn=null,Zl=!1,vf=null,gr=null,ea=!1,yr=null,ta=0,cs=0,wf=null,na=-1,ra=0;function bt(){return(Le&6)!==0?qe():na!==-1?na:na=qe()}function vr(r){return(r.mode&1)===0?1:(Le&2)!==0&&ft!==0?ft&-ft:MS.transition!==null?(ra===0&&(ra=dl()),ra):(r=De,r!==0||(r=window.event,r=r===void 0?16:Mp(r.type)),r)}function cn(r,o,u,p){if(50<cs)throw cs=0,wf=null,Error(n(185));$r(r,u,p),((Le&2)===0||r!==lt)&&(r===lt&&((Le&2)===0&&(Jl|=u),it===4&&wr(r,ft)),It(r,p),u===1&&Le===0&&(o.mode&1)===0&&(zi=qe()+500,Il&&dr()))}function It(r,o){var u=r.callbackNode;fl(r,o);var p=$n(r,r===lt?ft:0);if(p===0)u!==null&&ll(u),r.callbackNode=null,r.callbackPriority=0;else if(o=p&-p,r.callbackPriority!==o){if(u!=null&&ll(u),o===1)r.tag===0?AS(Mg.bind(null,r)):vm(Mg.bind(null,r)),TS(function(){(Le&6)===0&&dr()}),u=null;else{switch(Np(p)){case 1:u=Mo;break;case 4:u=ul;break;case 16:u=pi;break;case 536870912:u=cl;break;default:u=pi}u=Bg(u,Ag.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function Ag(r,o){if(na=-1,ra=0,(Le&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Fi()&&r.callbackNode!==u)return null;var p=$n(r,r===lt?ft:0);if(p===0)return null;if((p&30)!==0||(p&r.expiredLanes)!==0||o)o=ia(r,p);else{o=p;var y=Le;Le|=2;var x=Rg();(lt!==r||ft!==o)&&(qn=null,zi=qe()+500,Kr(r,o));do try{ZS();break}catch(z){Lg(r,z)}while(!0);Dc(),Ql.current=x,Le=y,et!==null?o=0:(lt=null,ft=0,o=it)}if(o!==0){if(o===2&&(y=Lo(r),y!==0&&(p=y,o=xf(r,y))),o===1)throw u=as,Kr(r,0),wr(r,p),It(r,qe()),u;if(o===6)wr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!QS(y)&&(o=ia(r,p),o===2&&(x=Lo(r),x!==0&&(p=x,o=xf(r,x))),o===1))throw u=as,Kr(r,0),wr(r,p),It(r,qe()),u;switch(r.finishedWork=y,r.finishedLanes=p,o){case 0:case 1:throw Error(n(345));case 2:Gr(r,Pt,qn);break;case 3:if(wr(r,p),(p&130023424)===p&&(o=yf+500-qe(),10<o)){if($n(r,0)!==0)break;if(y=r.suspendedLanes,(y&p)!==p){bt(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=Nc(Gr.bind(null,r,Pt,qn),o);break}Gr(r,Pt,qn);break;case 4:if(wr(r,p),(p&4194240)===p)break;for(o=r.eventTimes,y=-1;0<p;){var T=31-jt(p);x=1<<T,T=o[T],T>y&&(y=T),p&=~x}if(p=y,p=qe()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*XS(p/1960))-p,10<p){r.timeoutHandle=Nc(Gr.bind(null,r,Pt,qn),p);break}Gr(r,Pt,qn);break;case 5:Gr(r,Pt,qn);break;default:throw Error(n(329))}}}return It(r,qe()),r.callbackNode===u?Ag.bind(null,r):null}function xf(r,o){var u=us;return r.current.memoizedState.isDehydrated&&(Kr(r,o).flags|=256),r=ia(r,o),r!==2&&(o=Pt,Pt=u,o!==null&&bf(o)),r}function bf(r){Pt===null?Pt=r:Pt.push.apply(Pt,r)}function QS(r){for(var o=r;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var p=0;p<u.length;p++){var y=u[p],x=y.getSnapshot;y=y.value;try{if(!on(x(),y))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wr(r,o){for(o&=~gf,o&=~Jl,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-jt(o),p=1<<u;r[u]=-1,o&=~p}}function Mg(r){if((Le&6)!==0)throw Error(n(327));Fi();var o=$n(r,0);if((o&1)===0)return It(r,qe()),null;var u=ia(r,o);if(r.tag!==0&&u===2){var p=Lo(r);p!==0&&(o=p,u=xf(r,p))}if(u===1)throw u=as,Kr(r,0),wr(r,o),It(r,qe()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,Gr(r,Pt,qn),It(r,qe()),null}function Sf(r,o){var u=Le;Le|=1;try{return r(o)}finally{Le=u,Le===0&&(zi=qe()+500,Il&&dr())}}function Yr(r){yr!==null&&yr.tag===0&&(Le&6)===0&&Fi();var o=Le;Le|=1;var u=Qt.transition,p=De;try{if(Qt.transition=null,De=1,r)return r()}finally{De=p,Qt.transition=u,Le=o,(Le&6)===0&&dr()}}function kf(){Bt=$i.current,Be($i)}function Kr(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,CS(u)),et!==null)for(u=et.return;u!==null;){var p=u;switch(Ic(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&Ol();break;case 3:Ri(),Be(Ct),Be(mt),Uc();break;case 5:Vc(p);break;case 4:Ri();break;case 13:Be(Ye);break;case 19:Be(Ye);break;case 10:jc(p.type._context);break;case 22:case 23:kf()}u=u.return}if(lt=r,et=r=xr(r.current,null),ft=Bt=o,it=0,as=null,gf=Jl=qr=0,Pt=us=null,Wr!==null){for(o=0;o<Wr.length;o++)if(u=Wr[o],p=u.interleaved,p!==null){u.interleaved=null;var y=p.next,x=u.pending;if(x!==null){var T=x.next;x.next=y,p.next=T}u.pending=p}Wr=null}return r}function Lg(r,o){do{var u=et;try{if(Dc(),Bl.current=Hl,Vl){for(var p=Ke.memoizedState;p!==null;){var y=p.queue;y!==null&&(y.pending=null),p=p.next}Vl=!1}if(Hr=0,st=rt=Ke=null,ns=!1,rs=0,mf.current=null,u===null||u.return===null){it=1,as=o,et=null;break}e:{var x=r,T=u.return,z=u,H=o;if(o=ft,z.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=H,ae=z,ue=ae.tag;if((ae.mode&1)===0&&(ue===0||ue===11||ue===15)){var le=ae.alternate;le?(ae.updateQueue=le.updateQueue,ae.memoizedState=le.memoizedState,ae.lanes=le.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var pe=og(T);if(pe!==null){pe.flags&=-257,sg(pe,T,z,x,o),pe.mode&1&&ig(x,ie,o),o=pe,H=ie;var ve=o.updateQueue;if(ve===null){var we=new Set;we.add(H),o.updateQueue=we}else ve.add(H);break e}else{if((o&1)===0){ig(x,ie,o),Ef();break e}H=Error(n(426))}}else if(We&&z.mode&1){var Xe=og(T);if(Xe!==null){(Xe.flags&65536)===0&&(Xe.flags|=256),sg(Xe,T,z,x,o),Lc(Di(H,z));break e}}x=H=Di(H,z),it!==4&&(it=2),us===null?us=[x]:us.push(x),x=T;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var te=ng(x,H,o);Om(x,te);break e;case 1:z=H;var X=x.type,ne=x.stateNode;if((x.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(gr===null||!gr.has(ne)))){x.flags|=65536,o&=-o,x.lanes|=o;var ce=rg(x,z,o);Om(x,ce);break e}}x=x.return}while(x!==null)}jg(u)}catch(be){o=be,et===u&&u!==null&&(et=u=u.return);continue}break}while(!0)}function Rg(){var r=Ql.current;return Ql.current=Hl,r===null?Hl:r}function Ef(){(it===0||it===3||it===2)&&(it=4),lt===null||(qr&268435455)===0&&(Jl&268435455)===0||wr(lt,ft)}function ia(r,o){var u=Le;Le|=2;var p=Rg();(lt!==r||ft!==o)&&(qn=null,Kr(r,o));do try{JS();break}catch(y){Lg(r,y)}while(!0);if(Dc(),Le=u,Ql.current=p,et!==null)throw Error(n(261));return lt=null,ft=0,it}function JS(){for(;et!==null;)Dg(et)}function ZS(){for(;et!==null&&!qu();)Dg(et)}function Dg(r){var o=Fg(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,o===null?jg(r):et=o,mf.current=null}function jg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=HS(u,o,Bt),u!==null){et=u;return}}else{if(u=qS(u,o),u!==null){u.flags&=32767,et=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{it=6,et=null;return}}if(o=o.sibling,o!==null){et=o;return}et=o=r}while(o!==null);it===0&&(it=5)}function Gr(r,o,u){var p=De,y=Qt.transition;try{Qt.transition=null,De=1,ek(r,o,u,p)}finally{Qt.transition=y,De=p}return null}function ek(r,o,u,p){do Fi();while(yr!==null);if((Le&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var x=u.lanes|u.childLanes;if(ec(r,x),r===lt&&(et=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||ea||(ea=!0,Bg(pi,function(){return Fi(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Qt.transition,Qt.transition=null;var T=De;De=1;var z=Le;Le|=4,mf.current=null,KS(r,u),Cg(u,r),xS(kc),ml=!!Sc,kc=Sc=null,r.current=u,GS(u),al(),Le=z,De=T,Qt.transition=x}else r.current=u;if(ea&&(ea=!1,yr=r,ta=y),x=r.pendingLanes,x===0&&(gr=null),Gu(u.stateNode),It(r,qe()),o!==null)for(p=r.onRecoverableError,u=0;u<o.length;u++)y=o[u],p(y.value,{componentStack:y.stack,digest:y.digest});if(Zl)throw Zl=!1,r=vf,vf=null,r;return(ta&1)!==0&&r.tag!==0&&Fi(),x=r.pendingLanes,(x&1)!==0?r===wf?cs++:(cs=0,wf=r):cs=0,dr(),null}function Fi(){if(yr!==null){var r=Np(ta),o=Qt.transition,u=De;try{if(Qt.transition=null,De=16>r?16:r,yr===null)var p=!1;else{if(r=yr,yr=null,ta=0,(Le&6)!==0)throw Error(n(331));var y=Le;for(Le|=4,ge=r.current;ge!==null;){var x=ge,T=x.child;if((ge.flags&16)!==0){var z=x.deletions;if(z!==null){for(var H=0;H<z.length;H++){var ie=z[H];for(ge=ie;ge!==null;){var ae=ge;switch(ae.tag){case 0:case 11:case 15:ls(8,ae,x)}var ue=ae.child;if(ue!==null)ue.return=ae,ge=ue;else for(;ge!==null;){ae=ge;var le=ae.sibling,pe=ae.return;if(Sg(ae),ae===ie){ge=null;break}if(le!==null){le.return=pe,ge=le;break}ge=pe}}}var ve=x.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Xe=we.sibling;we.sibling=null,we=Xe}while(we!==null)}}ge=x}}if((x.subtreeFlags&2064)!==0&&T!==null)T.return=x,ge=T;else e:for(;ge!==null;){if(x=ge,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ls(9,x,x.return)}var te=x.sibling;if(te!==null){te.return=x.return,ge=te;break e}ge=x.return}}var X=r.current;for(ge=X;ge!==null;){T=ge;var ne=T.child;if((T.subtreeFlags&2064)!==0&&ne!==null)ne.return=T,ge=ne;else e:for(T=X;ge!==null;){if(z=ge,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:Xl(9,z)}}catch(be){Ge(z,z.return,be)}if(z===T){ge=null;break e}var ce=z.sibling;if(ce!==null){ce.return=z.return,ge=ce;break e}ge=z.return}}if(Le=y,dr(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(mi,r)}catch{}p=!0}return p}finally{De=u,Qt.transition=o}}return!1}function $g(r,o,u){o=Di(u,o),o=ng(r,o,1),r=pr(r,o,1),o=bt(),r!==null&&($r(r,1,o),It(r,o))}function Ge(r,o,u){if(r.tag===3)$g(r,r,u);else for(;o!==null;){if(o.tag===3){$g(o,r,u);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(gr===null||!gr.has(p))){r=Di(u,r),r=rg(o,r,1),o=pr(o,r,1),r=bt(),o!==null&&($r(o,1,r),It(o,r));break}}o=o.return}}function tk(r,o,u){var p=r.pingCache;p!==null&&p.delete(o),o=bt(),r.pingedLanes|=r.suspendedLanes&u,lt===r&&(ft&u)===u&&(it===4||it===3&&(ft&130023424)===ft&&500>qe()-yf?Kr(r,0):gf|=u),It(r,o)}function zg(r,o){o===0&&((r.mode&1)===0?o=1:(o=yi,yi<<=1,(yi&130023424)===0&&(yi=4194304)));var u=bt();r=Wn(r,o),r!==null&&($r(r,o,u),It(r,u))}function nk(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),zg(r,u)}function rk(r,o){var u=0;switch(r.tag){case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=r.stateNode;break;default:throw Error(n(314))}p!==null&&p.delete(o),zg(r,u)}var Fg;Fg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||Ct.current)Ot=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return Ot=!1,US(r,o,u);Ot=(r.flags&131072)!==0}else Ot=!1,We&&(o.flags&1048576)!==0&&wm(o,Ml,o.index);switch(o.lanes=0,o.tag){case 2:var p=o.type;Kl(r,o),r=o.pendingProps;var y=Ti(o,mt.current);Li(o,u),y=Yc(null,o,p,r,y,u);var x=Kc();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Tt(p)?(x=!0,Pl(o)):x=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Fc(o),y.updater=ql,o.stateNode=y,y._reactInternals=o,ef(o,p,r,u),o=of(null,o,p,!0,x,u)):(o.tag=0,We&&x&&Pc(o),xt(null,o,y,u),o=o.child),o;case 16:p=o.elementType;e:{switch(Kl(r,o),r=o.pendingProps,y=p._init,p=y(p._payload),o.type=p,y=o.tag=ok(p),r=ln(p,r),y){case 0:o=rf(null,o,p,r,u);break e;case 1:o=dg(null,o,p,r,u);break e;case 11:o=lg(null,o,p,r,u);break e;case 14:o=ag(null,o,p,ln(p.type,r),u);break e}throw Error(n(306,p,""))}return o;case 0:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),rf(r,o,p,y,u);case 1:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),dg(r,o,p,y,u);case 3:e:{if(hg(o),r===null)throw Error(n(387));p=o.pendingProps,x=o.memoizedState,y=x.element,Tm(r,o),zl(o,p,null,u);var T=o.memoizedState;if(p=T.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){y=Di(Error(n(423)),o),o=pg(r,o,p,u,y);break e}else if(p!==y){y=Di(Error(n(424)),o),o=pg(r,o,p,u,y);break e}else for(Ft=ur(o.stateNode.containerInfo.firstChild),zt=o,We=!0,sn=null,u=_m(o,null,p,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ii(),p===y){o=Hn(r,o,u);break e}xt(r,o,p,u)}o=o.child}return o;case 5:return Im(o),r===null&&Mc(o),p=o.type,y=o.pendingProps,x=r!==null?r.memoizedProps:null,T=y.children,Ec(p,y)?T=null:x!==null&&Ec(p,x)&&(o.flags|=32),fg(r,o),xt(r,o,T,u),o.child;case 6:return r===null&&Mc(o),null;case 13:return mg(r,o,u);case 4:return Bc(o,o.stateNode.containerInfo),p=o.pendingProps,r===null?o.child=Ai(o,null,p,u):xt(r,o,p,u),o.child;case 11:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),lg(r,o,p,y,u);case 7:return xt(r,o,o.pendingProps,u),o.child;case 8:return xt(r,o,o.pendingProps.children,u),o.child;case 12:return xt(r,o,o.pendingProps.children,u),o.child;case 10:e:{if(p=o.type._context,y=o.pendingProps,x=o.memoizedProps,T=y.value,je(Dl,p._currentValue),p._currentValue=T,x!==null)if(on(x.value,T)){if(x.children===y.children&&!Ct.current){o=Hn(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var z=x.dependencies;if(z!==null){T=x.child;for(var H=z.firstContext;H!==null;){if(H.context===p){if(x.tag===1){H=Un(-1,u&-u),H.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var ae=ie.pending;ae===null?H.next=H:(H.next=ae.next,ae.next=H),ie.pending=H}}x.lanes|=u,H=x.alternate,H!==null&&(H.lanes|=u),$c(x.return,u,o),z.lanes|=u;break}H=H.next}}else if(x.tag===10)T=x.type===o.type?null:x.child;else if(x.tag===18){if(T=x.return,T===null)throw Error(n(341));T.lanes|=u,z=T.alternate,z!==null&&(z.lanes|=u),$c(T,u,o),T=x.sibling}else T=x.child;if(T!==null)T.return=x;else for(T=x;T!==null;){if(T===o){T=null;break}if(x=T.sibling,x!==null){x.return=T.return,T=x;break}T=T.return}x=T}xt(r,o,y.children,u),o=o.child}return o;case 9:return y=o.type,p=o.pendingProps.children,Li(o,u),y=Gt(y),p=p(y),o.flags|=1,xt(r,o,p,u),o.child;case 14:return p=o.type,y=ln(p,o.pendingProps),y=ln(p.type,y),ag(r,o,p,y,u);case 15:return ug(r,o,o.type,o.pendingProps,u);case 17:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:ln(p,y),Kl(r,o),o.tag=1,Tt(p)?(r=!0,Pl(o)):r=!1,Li(o,u),eg(o,p,y),ef(o,p,y,u),of(null,o,p,!0,r,u);case 19:return yg(r,o,u);case 22:return cg(r,o,u)}throw Error(n(156,o.tag))};function Bg(r,o){return sl(r,o)}function ik(r,o,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(r,o,u,p){return new ik(r,o,u,p)}function Nf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ok(r){if(typeof r=="function")return Nf(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$)return 11;if(r===G)return 14}return 2}function xr(r,o){var u=r.alternate;return u===null?(u=Jt(r.tag,o,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=o,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,o=r.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function oa(r,o,u,p,y,x){var T=2;if(p=r,typeof r=="function")Nf(r)&&(T=1);else if(typeof r=="string")T=5;else e:switch(r){case L:return Xr(u.children,y,x,o);case C:T=8,y|=8;break;case I:return r=Jt(12,u,o,y|2),r.elementType=I,r.lanes=x,r;case Z:return r=Jt(13,u,o,y),r.elementType=Z,r.lanes=x,r;case j:return r=Jt(19,u,o,y),r.elementType=j,r.lanes=x,r;case J:return sa(u,y,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case F:T=10;break e;case R:T=9;break e;case $:T=11;break e;case G:T=14;break e;case q:T=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=Jt(T,u,o,y),o.elementType=r,o.type=p,o.lanes=x,o}function Xr(r,o,u,p){return r=Jt(7,r,p,o),r.lanes=u,r}function sa(r,o,u,p){return r=Jt(22,r,p,o),r.elementType=J,r.lanes=u,r.stateNode={isHidden:!1},r}function _f(r,o,u){return r=Jt(6,r,null,o),r.lanes=u,r}function Cf(r,o,u){return o=Jt(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function sk(r,o,u,p,y){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jr(0),this.expirationTimes=jr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jr(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Tf(r,o,u,p,y,x,T,z,H){return r=new sk(r,o,u,z,H),o===1?(o=1,x===!0&&(o|=8)):o=0,x=Jt(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fc(x),r}function lk(r,o,u){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:p==null?null:""+p,children:r,containerInfo:o,implementation:u}}function Vg(r){if(!r)return fr;r=r._reactInternals;e:{if(kn(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Tt(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Tt(u))return gm(r,u,o)}return o}function Wg(r,o,u,p,y,x,T,z,H){return r=Tf(u,p,!0,r,y,x,T,z,H),r.context=Vg(null),u=r.current,p=bt(),y=vr(u),x=Un(p,y),x.callback=o??null,pr(u,x,y),r.current.lanes=y,$r(r,y,p),It(r,p),r}function la(r,o,u,p){var y=o.current,x=bt(),T=vr(y);return u=Vg(u),o.context===null?o.context=u:o.pendingContext=u,o=Un(x,T),o.payload={element:r},p=p===void 0?null:p,p!==null&&(o.callback=p),r=pr(y,o,T),r!==null&&(cn(r,y,T,x),$l(r,y,T)),T}function aa(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Ug(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Of(r,o){Ug(r,o),(r=r.alternate)&&Ug(r,o)}function ak(){return null}var Hg=typeof reportError=="function"?reportError:function(r){console.error(r)};function Pf(r){this._internalRoot=r}ua.prototype.render=Pf.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));la(r,o,null,null)},ua.prototype.unmount=Pf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Yr(function(){la(null,r,null,null)}),o[zn]=null}};function ua(r){this._internalRoot=r}ua.prototype.unstable_scheduleHydration=function(r){if(r){var o=Tp();r={blockedOn:null,target:r,priority:o};for(var u=0;u<sr.length&&o!==0&&o<sr[u].priority;u++);sr.splice(u,0,r),u===0&&Ip(r)}};function If(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function ca(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function qg(){}function uk(r,o,u,p,y){if(y){if(typeof p=="function"){var x=p;p=function(){var ie=aa(T);x.call(ie)}}var T=Wg(o,p,r,0,null,!1,!1,"",qg);return r._reactRootContainer=T,r[zn]=T.current,Ko(r.nodeType===8?r.parentNode:r),Yr(),T}for(;y=r.lastChild;)r.removeChild(y);if(typeof p=="function"){var z=p;p=function(){var ie=aa(H);z.call(ie)}}var H=Tf(r,0,!1,null,null,!1,!1,"",qg);return r._reactRootContainer=H,r[zn]=H.current,Ko(r.nodeType===8?r.parentNode:r),Yr(function(){la(o,H,u,p)}),H}function fa(r,o,u,p,y){var x=u._reactRootContainer;if(x){var T=x;if(typeof y=="function"){var z=y;y=function(){var H=aa(T);z.call(H)}}la(o,T,r,y)}else T=uk(u,o,r,y,p);return aa(T)}_p=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=Dr(o.pendingLanes);u!==0&&(vi(o,u|1),It(o,qe()),(Le&6)===0&&(zi=qe()+500,dr()))}break;case 13:Yr(function(){var p=Wn(r,1);if(p!==null){var y=bt();cn(p,r,1,y)}}),Of(r,1)}},tc=function(r){if(r.tag===13){var o=Wn(r,134217728);if(o!==null){var u=bt();cn(o,r,134217728,u)}Of(r,134217728)}},Cp=function(r){if(r.tag===13){var o=vr(r),u=Wn(r,o);if(u!==null){var p=bt();cn(u,r,o,p)}Of(r,o)}},Tp=function(){return De},Op=function(r,o){var u=De;try{return De=r,o()}finally{De=u}},Co=function(r,o,u){switch(o){case"input":if(ze(r,u),o=u.name,u.type==="radio"&&o!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var p=u[o];if(p!==r&&p.form===r.form){var y=Tl(p);if(!y)throw Error(n(90));he(p),ze(p,y)}}}break;case"textarea":Sn(r,u);break;case"select":o=u.value,o!=null&&pt(r,!!u.multiple,o,!1)}},tl=Sf,nl=Yr;var ck={usingClientEntryPoint:!1,Events:[Qo,_i,Tl,Zs,el,Sf]},fs={findFiberByHostInstance:zr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fk={bundleType:fs.bundleType,version:fs.version,rendererPackageName:fs.rendererPackageName,rendererConfig:fs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=il(r),r===null?null:r.stateNode},findFiberByHostInstance:fs.findFiberByHostInstance||ak,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 da=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!da.isDisabled&&da.supportsFiber)try{mi=da.inject(fk),Dt=da}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ck,At.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!If(o))throw Error(n(200));return lk(r,o,null,u)},At.createRoot=function(r,o){if(!If(r))throw Error(n(299));var u=!1,p="",y=Hg;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=Tf(r,1,!1,null,null,u,!1,p,y),r[zn]=o.current,Ko(r.nodeType===8?r.parentNode:r),new Pf(o)},At.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=il(o),r=r===null?null:r.stateNode,r},At.flushSync=function(r){return Yr(r)},At.hydrate=function(r,o,u){if(!ca(o))throw Error(n(200));return fa(null,r,o,!0,u)},At.hydrateRoot=function(r,o,u){if(!If(r))throw Error(n(405));var p=u!=null&&u.hydratedSources||null,y=!1,x="",T=Hg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),o=Wg(o,null,r,1,u??null,y,!1,x,T),r[zn]=o.current,Ko(r),p)for(r=0;r<p.length;r++)u=p[r],y=u._getVersion,y=y(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,y]:o.mutableSourceEagerHydrationData.push(u,y);return new ua(o)},At.render=function(r,o,u){if(!ca(o))throw Error(n(200));return fa(null,r,o,!1,u)},At.unmountComponentAtNode=function(r){if(!ca(r))throw Error(n(40));return r._reactRootContainer?(Yr(function(){fa(null,null,r,!1,function(){r._reactRootContainer=null,r[zn]=null})}),!0):!1},At.unstable_batchedUpdates=Sf,At.unstable_renderSubtreeIntoContainer=function(r,o,u,p){if(!ca(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return fa(r,o,u,!1,p)},At.version="18.3.1-next-f1338f8080-20240426",At}var ey;function Yv(){if(ey)return Lf.exports;ey=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(),Lf.exports=bk(),Lf.exports}var ty;function Sk(){if(ty)return ha;ty=1;var e=Yv();return ha.createRoot=e.createRoot,ha.hydrateRoot=e.hydrateRoot,ha}var kk=Sk();const Ek=du(kk);function nt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=nt(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Nk={value:()=>{}};function hu(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new $a(n)}function $a(e){this._=e}function _k(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");if(s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}$a.prototype=hu.prototype={constructor:$a,on:function(e,t){var n=this._,i=_k(e+"",n),s,l=-1,a=i.length;if(arguments.length<2){for(;++l<a;)if((s=(e=i[l]).type)&&(s=Ck(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<a;)if(s=(e=i[l]).type)n[s]=ny(n[s],e.name,t);else if(t==null)for(s in n)n[s]=ny(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 $a(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),i=0,s,l;i<s;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,s=l.length;i<s;++i)l[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,l=i.length;s<l;++s)i[s].value.apply(t,n)}};function Ck(e,t){for(var n=0,i=e.length,s;n<i;++n)if((s=e[n]).name===t)return s.value}function ny(e,t,n){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=Nk,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var sh="http://www.w3.org/1999/xhtml";const ry={svg:"http://www.w3.org/2000/svg",xhtml:sh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ry.hasOwnProperty(t)?{space:ry[t],local:e}:e}function Tk(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===sh&&t.documentElement.namespaceURI===sh?t.createElement(e):t.createElementNS(n,e)}}function Ok(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kv(e){var t=pu(e);return(t.local?Ok:Tk)(t)}function Pk(){}function Ah(e){return e==null?Pk:function(){return this.querySelector(e)}}function Ik(e){typeof e!="function"&&(e=Ah(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=new Array(a),f,d,m=0;m<a;++m)(f=l[m])&&(d=e.call(f,f.__data__,m,l))&&("__data__"in f&&(d.__data__=f.__data__),c[m]=d);return new Wt(i,this._parents)}function Ak(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Mk(){return[]}function Gv(e){return e==null?Mk:function(){return this.querySelectorAll(e)}}function Lk(e){return function(){return Ak(e.apply(this,arguments))}}function Rk(e){typeof e=="function"?e=Lk(e):e=Gv(e);for(var t=this._groups,n=t.length,i=[],s=[],l=0;l<n;++l)for(var a=t[l],c=a.length,f,d=0;d<c;++d)(f=a[d])&&(i.push(e.call(f,f.__data__,d,a)),s.push(f));return new Wt(i,s)}function Xv(e){return function(){return this.matches(e)}}function Qv(e){return function(t){return t.matches(e)}}var Dk=Array.prototype.find;function jk(e){return function(){return Dk.call(this.children,e)}}function $k(){return this.firstElementChild}function zk(e){return this.select(e==null?$k:jk(typeof e=="function"?e:Qv(e)))}var Fk=Array.prototype.filter;function Bk(){return Array.from(this.children)}function Vk(e){return function(){return Fk.call(this.children,e)}}function Wk(e){return this.selectAll(e==null?Bk:Vk(typeof e=="function"?e:Qv(e)))}function Uk(e){typeof e!="function"&&(e=Xv(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=[],f,d=0;d<a;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Wt(i,this._parents)}function Jv(e){return new Array(e.length)}function Hk(){return new Wt(this._enter||this._groups.map(Jv),this._parents)}function Ka(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ka.prototype={constructor:Ka,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 qk(e){return function(){return e}}function Yk(e,t,n,i,s,l){for(var a=0,c,f=t.length,d=l.length;a<d;++a)(c=t[a])?(c.__data__=l[a],i[a]=c):n[a]=new Ka(e,l[a]);for(;a<f;++a)(c=t[a])&&(s[a]=c)}function Kk(e,t,n,i,s,l,a){var c,f,d=new Map,m=t.length,h=l.length,g=new Array(m),v;for(c=0;c<m;++c)(f=t[c])&&(g[c]=v=a.call(f,f.__data__,c,t)+"",d.has(v)?s[c]=f:d.set(v,f));for(c=0;c<h;++c)v=a.call(e,l[c],c,l)+"",(f=d.get(v))?(i[c]=f,f.__data__=l[c],d.delete(v)):n[c]=new Ka(e,l[c]);for(c=0;c<m;++c)(f=t[c])&&d.get(g[c])===f&&(s[c]=f)}function Gk(e){return e.__data__}function Xk(e,t){if(!arguments.length)return Array.from(this,Gk);var n=t?Kk:Yk,i=this._parents,s=this._groups;typeof e!="function"&&(e=qk(e));for(var l=s.length,a=new Array(l),c=new Array(l),f=new Array(l),d=0;d<l;++d){var m=i[d],h=s[d],g=h.length,v=Qk(e.call(m,m&&m.__data__,d,i)),S=v.length,w=c[d]=new Array(S),b=a[d]=new Array(S),k=f[d]=new Array(g);n(m,h,w,b,k,v,t);for(var N=0,E=0,_,A;N<S;++N)if(_=w[N]){for(N>=E&&(E=N+1);!(A=b[E])&&++E<S;);_._next=A||null}}return a=new Wt(a,i),a._enter=c,a._exit=f,a}function Qk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jk(){return new Wt(this._exit||this._groups.map(Jv),this._parents)}function Zk(e,t,n){var i=this.enter(),s=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?l.remove():n(l),i&&s?i.merge(s).order():s}function eE(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,s=n.length,l=i.length,a=Math.min(s,l),c=new Array(s),f=0;f<a;++f)for(var d=n[f],m=i[f],h=d.length,g=c[f]=new Array(h),v,S=0;S<h;++S)(v=d[S]||m[S])&&(g[S]=v);for(;f<s;++f)c[f]=n[f];return new Wt(c,this._parents)}function tE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],s=i.length-1,l=i[s],a;--s>=0;)(a=i[s])&&(l&&a.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(a,l),l=a);return this}function nE(e){e||(e=rE);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,i=n.length,s=new Array(i),l=0;l<i;++l){for(var a=n[l],c=a.length,f=s[l]=new Array(c),d,m=0;m<c;++m)(d=a[m])&&(f[m]=d);f.sort(t)}return new Wt(s,this._parents).order()}function rE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function iE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oE(){return Array.from(this)}function sE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],s=0,l=i.length;s<l;++s){var a=i[s];if(a)return a}return null}function lE(){let e=0;for(const t of this)++e;return e}function aE(){return!this.node()}function uE(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var s=t[n],l=0,a=s.length,c;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s);return this}function cE(e){return function(){this.removeAttribute(e)}}function fE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dE(e,t){return function(){this.setAttribute(e,t)}}function hE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function mE(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 gE(e,t){var n=pu(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?fE:cE:typeof t=="function"?n.local?mE:pE:n.local?hE:dE)(n,t))}function Zv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yE(e){return function(){this.style.removeProperty(e)}}function vE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function wE(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function xE(e,t,n){return arguments.length>1?this.each((t==null?yE:typeof t=="function"?wE:vE)(e,t,n??"")):io(this.node(),e)}function io(e,t){return e.style.getPropertyValue(t)||Zv(e).getComputedStyle(e,null).getPropertyValue(t)}function bE(e){return function(){delete this[e]}}function SE(e,t){return function(){this[e]=t}}function kE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function EE(e,t){return arguments.length>1?this.each((t==null?bE:typeof t=="function"?kE:SE)(e,t)):this.node()[e]}function ew(e){return e.trim().split(/^|\s+/)}function Mh(e){return e.classList||new tw(e)}function tw(e){this._node=e,this._names=ew(e.getAttribute("class")||"")}tw.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 nw(e,t){for(var n=Mh(e),i=-1,s=t.length;++i<s;)n.add(t[i])}function rw(e,t){for(var n=Mh(e),i=-1,s=t.length;++i<s;)n.remove(t[i])}function NE(e){return function(){nw(this,e)}}function _E(e){return function(){rw(this,e)}}function CE(e,t){return function(){(t.apply(this,arguments)?nw:rw)(this,e)}}function TE(e,t){var n=ew(e+"");if(arguments.length<2){for(var i=Mh(this.node()),s=-1,l=n.length;++s<l;)if(!i.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?CE:t?NE:_E)(n,t))}function OE(){this.textContent=""}function PE(e){return function(){this.textContent=e}}function IE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AE(e){return arguments.length?this.each(e==null?OE:(typeof e=="function"?IE:PE)(e)):this.node().textContent}function ME(){this.innerHTML=""}function LE(e){return function(){this.innerHTML=e}}function RE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function DE(e){return arguments.length?this.each(e==null?ME:(typeof e=="function"?RE:LE)(e)):this.node().innerHTML}function jE(){this.nextSibling&&this.parentNode.appendChild(this)}function $E(){return this.each(jE)}function zE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function FE(){return this.each(zE)}function BE(e){var t=typeof e=="function"?e:Kv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VE(){return null}function WE(e,t){var n=typeof e=="function"?e:Kv(e),i=t==null?VE:typeof t=="function"?t:Ah(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function UE(){var e=this.parentNode;e&&e.removeChild(this)}function HE(){return this.each(UE)}function qE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KE(e){return this.select(e?YE:qE)}function GE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function XE(e){return function(t){e.call(this,t,this.__data__)}}function QE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function JE(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,s=t.length,l;n<s;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function ZE(e,t,n){return function(){var i=this.__on,s,l=XE(t);if(i){for(var a=0,c=i.length;a<c;++a)if((s=i[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=n),s.value=t;return}}this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,options:n},i?i.push(s):this.__on=[s]}}function eN(e,t,n){var i=QE(e+""),s,l=i.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,m;f<d;++f)for(s=0,m=c[f];s<l;++s)if((a=i[s]).type===m.type&&a.name===m.name)return m.value}return}for(c=t?ZE:JE,s=0;s<l;++s)this.each(c(i[s],t,n));return this}function iw(e,t,n){var i=Zv(e),s=i.CustomEvent;typeof s=="function"?s=new s(t,n):(s=i.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function tN(e,t){return function(){return iw(this,e,t)}}function nN(e,t){return function(){return iw(this,e,t.apply(this,arguments))}}function rN(e,t){return this.each((typeof t=="function"?nN:tN)(e,t))}function*iN(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],s=0,l=i.length,a;s<l;++s)(a=i[s])&&(yield a)}var ow=[null];function Wt(e,t){this._groups=e,this._parents=t}function Fs(){return new Wt([[document.documentElement]],ow)}function oN(){return this}Wt.prototype=Fs.prototype={constructor:Wt,select:Ik,selectAll:Rk,selectChild:zk,selectChildren:Wk,filter:Uk,data:Xk,enter:Hk,exit:Jk,join:Zk,merge:eE,selection:oN,order:tE,sort:nE,call:iE,nodes:oE,node:sE,size:lE,empty:aE,each:uE,attr:gE,style:xE,property:EE,classed:TE,text:AE,html:DE,raise:$E,lower:FE,append:BE,insert:WE,remove:HE,clone:KE,datum:GE,on:eN,dispatch:rN,[Symbol.iterator]:iN};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],ow)}function sN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=sN(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.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 lN={passive:!1},Ts={capture:!0,passive:!1};function jf(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function sw(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",Zi,Ts);"onselectstart"in t?n.on("selectstart.drag",Zi,Ts):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function lw(e,t){var n=e.document.documentElement,i=Vt(e).on("dragstart.drag",null);t&&(i.on("click.drag",Zi,Ts),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const pa=e=>()=>e;function lh(e,{sourceEvent:t,subject:n,target:i,identifier:s,active:l,x:a,y:c,dx:f,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:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}lh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aN(e){return!e.ctrlKey&&!e.button}function uN(){return this.parentNode}function cN(e,t){return t??{x:e.x,y:e.y}}function fN(){return navigator.maxTouchPoints||"ontouchstart"in this}function aw(){var e=aN,t=uN,n=cN,i=fN,s={},l=hu("start","drag","end"),a=0,c,f,d,m,h=0;function g(_){_.on("mousedown.drag",v).filter(i).on("touchstart.drag",b).on("touchmove.drag",k,lN).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(_,A){if(!(m||!e.call(this,_,A))){var M=E(this,t.call(this,_,A),_,A,"mouse");M&&(Vt(_.view).on("mousemove.drag",S,Ts).on("mouseup.drag",w,Ts),sw(_.view),jf(_),d=!1,c=_.clientX,f=_.clientY,M("start",_))}}function S(_){if(Zi(_),!d){var A=_.clientX-c,M=_.clientY-f;d=A*A+M*M>h}s.mouse("drag",_)}function w(_){Vt(_.view).on("mousemove.drag mouseup.drag",null),lw(_.view,d),Zi(_),s.mouse("end",_)}function b(_,A){if(e.call(this,_,A)){var M=_.changedTouches,L=t.call(this,_,A),C=M.length,I,F;for(I=0;I<C;++I)(F=E(this,L,_,A,M[I].identifier,M[I]))&&(jf(_),F("start",_,M[I]))}}function k(_){var A=_.changedTouches,M=A.length,L,C;for(L=0;L<M;++L)(C=s[A[L].identifier])&&(Zi(_),C("drag",_,A[L]))}function N(_){var A=_.changedTouches,M=A.length,L,C;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),L=0;L<M;++L)(C=s[A[L].identifier])&&(jf(_),C("end",_,A[L]))}function E(_,A,M,L,C,I){var F=l.copy(),R=dn(I||M,A),$,Z,j;if((j=n.call(_,new lh("beforestart",{sourceEvent:M,target:g,identifier:C,active:a,x:R[0],y:R[1],dx:0,dy:0,dispatch:F}),L))!=null)return $=j.x-R[0]||0,Z=j.y-R[1]||0,function G(q,J,Y){var U=R,B;switch(q){case"start":s[C]=G,B=a++;break;case"end":delete s[C],--a;case"drag":R=dn(Y||J,A),B=a;break}F.call(q,_,new lh(q,{sourceEvent:J,subject:j,target:g,identifier:C,active:B,x:R[0]+$,y:R[1]+Z,dx:R[0]-U[0],dy:R[1]-U[1],dispatch:F}),L)}}return g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:pa(!!_),g):e},g.container=function(_){return arguments.length?(t=typeof _=="function"?_:pa(_),g):t},g.subject=function(_){return arguments.length?(n=typeof _=="function"?_:pa(_),g):n},g.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:pa(!!_),g):i},g.on=function(){var _=l.on.apply(l,arguments);return _===l?g:_},g.clickDistance=function(_){return arguments.length?(h=(_=+_)*_,g):Math.sqrt(h)},g}function Lh(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Bs(){}var Os=.7,Ga=1/Os,eo="\\s*([+-]?\\d+)\\s*",Ps="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dN=/^#([0-9a-f]{3,8})$/,hN=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),pN=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),mN=new RegExp(`^rgba\\(${eo},${eo},${eo},${Ps}\\)$`),gN=new RegExp(`^rgba\\(${An},${An},${An},${Ps}\\)$`),yN=new RegExp(`^hsl\\(${Ps},${An},${An}\\)$`),vN=new RegExp(`^hsla\\(${Ps},${An},${An},${Ps}\\)$`),iy={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};Lh(Bs,oi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oy,formatHex:oy,formatHex8:wN,formatHsl:xN,formatRgb:sy,toString:sy});function oy(){return this.rgb().formatHex()}function wN(){return this.rgb().formatHex8()}function xN(){return cw(this).formatHsl()}function sy(){return this.rgb().formatRgb()}function oi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ly(t):n===3?new Mt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ma(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=hN.exec(e))?new Mt(t[1],t[2],t[3],1):(t=pN.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mN.exec(e))?ma(t[1],t[2],t[3],t[4]):(t=gN.exec(e))?ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yN.exec(e))?cy(t[1],t[2]/100,t[3]/100,1):(t=vN.exec(e))?cy(t[1],t[2]/100,t[3]/100,t[4]):iy.hasOwnProperty(e)?ly(iy[e]):e==="transparent"?new Mt(NaN,NaN,NaN,0):null}function ly(e){return new Mt(e>>16&255,e>>8&255,e&255,1)}function ma(e,t,n,i){return i<=0&&(e=t=n=NaN),new Mt(e,t,n,i)}function bN(e){return e instanceof Bs||(e=oi(e)),e?(e=e.rgb(),new Mt(e.r,e.g,e.b,e.opacity)):new Mt}function ah(e,t,n,i){return arguments.length===1?bN(e):new Mt(e,t,n,i??1)}function Mt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Lh(Mt,ah,uw(Bs,{brighter(e){return e=e==null?Ga:Math.pow(Ga,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mt(ri(this.r),ri(this.g),ri(this.b),Xa(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:ay,formatHex:ay,formatHex8:SN,formatRgb:uy,toString:uy}));function ay(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}`}function SN(){return`#${ei(this.r)}${ei(this.g)}${ei(this.b)}${ei((isNaN(this.opacity)?1:this.opacity)*255)}`}function uy(){const e=Xa(this.opacity);return`${e===1?"rgb(":"rgba("}${ri(this.r)}, ${ri(this.g)}, ${ri(this.b)}${e===1?")":`, ${e})`}`}function Xa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ri(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ei(e){return e=ri(e),(e<16?"0":"")+e.toString(16)}function cy(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hn(e,t,n,i)}function cw(e){if(e instanceof hn)return new hn(e.h,e.s,e.l,e.opacity);if(e instanceof Bs||(e=oi(e)),!e)return new hn;if(e instanceof hn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,s=Math.min(t,n,i),l=Math.max(t,n,i),a=NaN,c=l-s,f=(l+s)/2;return c?(t===l?a=(n-i)/c+(n<i)*6:n===l?a=(i-t)/c+2:a=(t-n)/c+4,c/=f<.5?l+s:2-l-s,a*=60):c=f>0&&f<1?0:a,new hn(a,c,f,e.opacity)}function kN(e,t,n,i){return arguments.length===1?cw(e):new hn(e,t,n,i??1)}function hn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Lh(hn,kN,uw(Bs,{brighter(e){return e=e==null?Ga:Math.pow(Ga,e),new hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Os:Math.pow(Os,e),new hn(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,i=n+(n<.5?n:1-n)*t,s=2*n-i;return new Mt($f(e>=240?e-240:e+120,s,i),$f(e,s,i),$f(e<120?e+240:e-120,s,i),this.opacity)},clamp(){return new hn(fy(this.h),ga(this.s),ga(this.l),Xa(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=Xa(this.opacity);return`${e===1?"hsl(":"hsla("}${fy(this.h)}, ${ga(this.s)*100}%, ${ga(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fy(e){return e=(e||0)%360,e<0?e+360:e}function ga(e){return Math.max(0,Math.min(1,e||0))}function $f(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 Rh=e=>()=>e;function EN(e,t){return function(n){return e+n*t}}function NN(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function _N(e){return(e=+e)==1?fw:function(t,n){return n-t?NN(t,n,e):Rh(isNaN(t)?n:t)}}function fw(e,t){var n=t-e;return n?EN(e,n):Rh(isNaN(e)?t:e)}const Qa=(function e(t){var n=_N(t);function i(s,l){var a=n((s=ah(s)).r,(l=ah(l)).r),c=n(s.g,l.g),f=n(s.b,l.b),d=fw(s.opacity,l.opacity);return function(m){return s.r=a(m),s.g=c(m),s.b=f(m),s.opacity=d(m),s+""}}return i.gamma=e,i})(1);function CN(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),s;return function(l){for(s=0;s<n;++s)i[s]=e[s]*(1-l)+t[s]*l;return i}}function TN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ON(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,s=new Array(i),l=new Array(n),a;for(a=0;a<i;++a)s[a]=Es(e[a],t[a]);for(;a<n;++a)l[a]=t[a];return function(c){for(a=0;a<i;++a)l[a]=s[a](c);return l}}function PN(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Pn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function IN(e,t){var n={},i={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Es(e[s],t[s]):i[s]=t[s];return function(l){for(s in n)i[s]=n[s](l);return i}}var uh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zf=new RegExp(uh.source,"g");function AN(e){return function(){return e}}function MN(e){return function(t){return e(t)+""}}function dw(e,t){var n=uh.lastIndex=zf.lastIndex=0,i,s,l,a=-1,c=[],f=[];for(e=e+"",t=t+"";(i=uh.exec(e))&&(s=zf.exec(t));)(l=s.index)>n&&(l=t.slice(n,l),c[a]?c[a]+=l:c[++a]=l),(i=i[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,f.push({i:a,x:Pn(i,s)})),n=zf.lastIndex;return n<t.length&&(l=t.slice(n),c[a]?c[a]+=l:c[++a]=l),c.length<2?f[0]?MN(f[0].x):AN(t):(t=f.length,function(d){for(var m=0,h;m<t;++m)c[(h=f[m]).i]=h.x(d);return c.join("")})}function Es(e,t){var n=typeof t,i;return t==null||n==="boolean"?Rh(t):(n==="number"?Pn:n==="string"?(i=oi(t))?(t=i,Qa):dw:t instanceof oi?Qa:t instanceof Date?PN:TN(t)?CN:Array.isArray(t)?ON:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?IN:Pn)(e,t)}var dy=180/Math.PI,ch={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function hw(e,t,n,i,s,l){var a,c,f;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(f=e*n+t*i)&&(n-=e*f,i-=t*f),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,f/=c),e*i<t*n&&(e=-e,t=-t,f=-f,a=-a),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*dy,skewX:Math.atan(f)*dy,scaleX:a,scaleY:c}}var ya;function LN(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ch:hw(t.a,t.b,t.c,t.d,t.e,t.f)}function RN(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?ch:(e=e.matrix,hw(e.a,e.b,e.c,e.d,e.e,e.f))}function pw(e,t,n,i){function s(d){return d.length?d.pop()+" ":""}function l(d,m,h,g,v,S){if(d!==h||m!==g){var w=v.push("translate(",null,t,null,n);S.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h||g)&&v.push("translate("+h+t+g+n)}function a(d,m,h,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:h.push(s(h)+"rotate(",null,i)-2,x:Pn(d,m)})):m&&h.push(s(h)+"rotate("+m+i)}function c(d,m,h,g){d!==m?g.push({i:h.push(s(h)+"skewX(",null,i)-2,x:Pn(d,m)}):m&&h.push(s(h)+"skewX("+m+i)}function f(d,m,h,g,v,S){if(d!==h||m!==g){var w=v.push(s(v)+"scale(",null,",",null,")");S.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h!==1||g!==1)&&v.push(s(v)+"scale("+h+","+g+")")}return function(d,m){var h=[],g=[];return d=e(d),m=e(m),l(d.translateX,d.translateY,m.translateX,m.translateY,h,g),a(d.rotate,m.rotate,h,g),c(d.skewX,m.skewX,h,g),f(d.scaleX,d.scaleY,m.scaleX,m.scaleY,h,g),d=m=null,function(v){for(var S=-1,w=g.length,b;++S<w;)h[(b=g[S]).i]=b.x(v);return h.join("")}}}var DN=pw(LN,"px, ","px)","deg)"),jN=pw(RN,", ",")",")"),$N=1e-12;function hy(e){return((e=Math.exp(e))+1/e)/2}function zN(e){return((e=Math.exp(e))-1/e)/2}function FN(e){return((e=Math.exp(2*e))-1)/(e+1)}const za=(function e(t,n,i){function s(l,a){var c=l[0],f=l[1],d=l[2],m=a[0],h=a[1],g=a[2],v=m-c,S=h-f,w=v*v+S*S,b,k;if(w<$N)k=Math.log(g/d)/t,b=function(L){return[c+L*v,f+L*S,d*Math.exp(t*L*k)]};else{var N=Math.sqrt(w),E=(g*g-d*d+i*w)/(2*d*n*N),_=(g*g-d*d-i*w)/(2*g*n*N),A=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(_*_+1)-_);k=(M-A)/t,b=function(L){var C=L*k,I=hy(A),F=d/(n*N)*(I*FN(t*C+A)-zN(A));return[c+F*v,f+F*S,d*I/hy(t*C+A)]}}return b.duration=k*1e3*t/Math.SQRT2,b}return s.rho=function(l){var a=Math.max(.001,+l),c=a*a,f=c*c;return e(a,c,f)},s})(Math.SQRT2,2,4);var oo=0,vs=0,hs=0,mw=1e3,Ja,ws,Za=0,si=0,mu=0,Is=typeof performance=="object"&&performance.now?performance:Date,gw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Dh(){return si||(gw(BN),si=Is.now()+mu)}function BN(){si=0}function eu(){this._call=this._time=this._next=null}eu.prototype=yw.prototype={constructor:eu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Dh():+n)+(t==null?0:+t),!this._next&&ws!==this&&(ws?ws._next=this:Ja=this,ws=this),this._call=e,this._time=n,fh()},stop:function(){this._call&&(this._call=null,this._time=1/0,fh())}};function yw(e,t,n){var i=new eu;return i.restart(e,t,n),i}function VN(){Dh(),++oo;for(var e=Ja,t;e;)(t=si-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oo}function py(){si=(Za=Is.now())+mu,oo=vs=0;try{VN()}finally{oo=0,UN(),si=0}}function WN(){var e=Is.now(),t=e-Za;t>mw&&(mu-=t,Za=e)}function UN(){for(var e,t=Ja,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ja=n);ws=e,fh(i)}function fh(e){if(!oo){vs&&(vs=clearTimeout(vs));var t=e-si;t>24?(e<1/0&&(vs=setTimeout(py,e-Is.now()-mu)),hs&&(hs=clearInterval(hs))):(hs||(Za=Is.now(),hs=setInterval(WN,mw)),oo=1,gw(py))}}function my(e,t,n){var i=new eu;return t=t==null?0:+t,i.restart(s=>{i.stop(),e(s+t)},t,n),i}var HN=hu("start","end","cancel","interrupt"),qN=[],vw=0,gy=1,dh=2,Fa=3,yy=4,hh=5,Ba=6;function gu(e,t,n,i,s,l){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;YN(e,n,{name:t,index:i,group:s,on:HN,tween:qN,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:vw})}function jh(e,t){var n=vn(e,t);if(n.state>vw)throw new Error("too late; already scheduled");return n}function Ln(e,t){var n=vn(e,t);if(n.state>Fa)throw new Error("too late; already running");return n}function vn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YN(e,t,n){var i=e.__transition,s;i[t]=n,n.timer=yw(l,0,n.time);function l(d){n.state=gy,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var m,h,g,v;if(n.state!==gy)return f();for(m in i)if(v=i[m],v.name===n.name){if(v.state===Fa)return my(a);v.state===yy?(v.state=Ba,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=Ba,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(my(function(){n.state===Fa&&(n.state=yy,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=dh,n.on.call("start",e,e.__data__,n.index,n.group),n.state===dh){for(n.state=Fa,s=new Array(g=n.tween.length),m=0,h=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(s[++h]=v);s.length=h+1}}function c(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=hh,1),h=-1,g=s.length;++h<g;)s[h].call(e,m);n.state===hh&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=Ba,n.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function Va(e,t){var n=e.__transition,i,s,l=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){l=!1;continue}s=i.state>dh&&i.state<hh,i.state=Ba,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}l&&delete e.__transition}}function KN(e){return this.each(function(){Va(this,e)})}function GN(e,t){var n,i;return function(){var s=Ln(this,e),l=s.tween;if(l!==n){i=n=l;for(var a=0,c=i.length;a<c;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}s.tween=i}}function XN(e,t,n){var i,s;if(typeof n!="function")throw new Error;return function(){var l=Ln(this,e),a=l.tween;if(a!==i){s=(i=a).slice();for(var c={name:t,value:n},f=0,d=s.length;f<d;++f)if(s[f].name===t){s[f]=c;break}f===d&&s.push(c)}l.tween=s}}function QN(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=vn(this.node(),n).tween,s=0,l=i.length,a;s<l;++s)if((a=i[s]).name===e)return a.value;return null}return this.each((t==null?GN:XN)(n,e,t))}function $h(e,t,n){var i=e._id;return e.each(function(){var s=Ln(this,i);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return vn(s,i).value[t]}}function ww(e,t){var n;return(typeof t=="number"?Pn:t instanceof oi?Qa:(n=oi(t))?(t=n,Qa):dw)(e,t)}function JN(e){return function(){this.removeAttribute(e)}}function ZN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e_(e,t,n){var i,s=n+"",l;return function(){var a=this.getAttribute(e);return a===s?null:a===i?l:l=t(i=a,n)}}function t_(e,t,n){var i,s=n+"",l;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===i?l:l=t(i=a,n)}}function n_(e,t,n){var i,s,l;return function(){var a,c=n(this),f;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),f=c+"",a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c)))}}function r_(e,t,n){var i,s,l;return function(){var a,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),f=c+"",a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c)))}}function i_(e,t){var n=pu(e),i=n==="transform"?jN:ww;return this.attrTween(e,typeof t=="function"?(n.local?r_:n_)(n,i,$h(this,"attr."+e,t)):t==null?(n.local?ZN:JN)(n):(n.local?t_:e_)(n,i,t))}function o_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function s_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function l_(e,t){var n,i;function s(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&s_(e,l)),n}return s._value=t,s}function a_(e,t){var n,i;function s(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&o_(e,l)),n}return s._value=t,s}function u_(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 i=pu(e);return this.tween(n,(i.local?l_:a_)(i,t))}function c_(e,t){return function(){jh(this,e).delay=+t.apply(this,arguments)}}function f_(e,t){return t=+t,function(){jh(this,e).delay=t}}function d_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?c_:f_)(t,e)):vn(this.node(),t).delay}function h_(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function p_(e,t){return t=+t,function(){Ln(this,e).duration=t}}function m_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?h_:p_)(t,e)):vn(this.node(),t).duration}function g_(e,t){if(typeof t!="function")throw new Error;return function(){Ln(this,e).ease=t}}function y_(e){var t=this._id;return arguments.length?this.each(g_(t,e)):vn(this.node(),t).ease}function v_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ln(this,e).ease=n}}function w_(e){if(typeof e!="function")throw new Error;return this.each(v_(this._id,e))}function x_(e){typeof e!="function"&&(e=Xv(e));for(var t=this._groups,n=t.length,i=new Array(n),s=0;s<n;++s)for(var l=t[s],a=l.length,c=i[s]=[],f,d=0;d<a;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Zn(i,this._parents,this._name,this._id)}function b_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,s=n.length,l=Math.min(i,s),a=new Array(i),c=0;c<l;++c)for(var f=t[c],d=n[c],m=f.length,h=a[c]=new Array(m),g,v=0;v<m;++v)(g=f[v]||d[v])&&(h[v]=g);for(;c<i;++c)a[c]=t[c];return new Zn(a,this._parents,this._name,this._id)}function S_(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 k_(e,t,n){var i,s,l=S_(t)?jh:Ln;return function(){var a=l(this,e),c=a.on;c!==i&&(s=(i=c).copy()).on(t,n),a.on=s}}function E_(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(k_(n,e,t))}function N_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function __(){return this.on("end.remove",N_(this._id))}function C_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ah(e));for(var i=this._groups,s=i.length,l=new Array(s),a=0;a<s;++a)for(var c=i[a],f=c.length,d=l[a]=new Array(f),m,h,g=0;g<f;++g)(m=c[g])&&(h=e.call(m,m.__data__,g,c))&&("__data__"in m&&(h.__data__=m.__data__),d[g]=h,gu(d[g],t,n,g,d,vn(m,n)));return new Zn(l,this._parents,t,n)}function T_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gv(e));for(var i=this._groups,s=i.length,l=[],a=[],c=0;c<s;++c)for(var f=i[c],d=f.length,m,h=0;h<d;++h)if(m=f[h]){for(var g=e.call(m,m.__data__,h,f),v,S=vn(m,n),w=0,b=g.length;w<b;++w)(v=g[w])&&gu(v,t,n,w,g,S);l.push(g),a.push(m)}return new Zn(l,a,t,n)}var O_=Fs.prototype.constructor;function P_(){return new O_(this._groups,this._parents)}function I_(e,t){var n,i,s;return function(){var l=io(this,e),a=(this.style.removeProperty(e),io(this,e));return l===a?null:l===n&&a===i?s:s=t(n=l,i=a)}}function xw(e){return function(){this.style.removeProperty(e)}}function A_(e,t,n){var i,s=n+"",l;return function(){var a=io(this,e);return a===s?null:a===i?l:l=t(i=a,n)}}function M_(e,t,n){var i,s,l;return function(){var a=io(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),io(this,e))),a===f?null:a===i&&f===s?l:(s=f,l=t(i=a,c))}}function L_(e,t){var n,i,s,l="style."+t,a="end."+l,c;return function(){var f=Ln(this,e),d=f.on,m=f.value[l]==null?c||(c=xw(t)):void 0;(d!==n||s!==m)&&(i=(n=d).copy()).on(a,s=m),f.on=i}}function R_(e,t,n){var i=(e+="")=="transform"?DN:ww;return t==null?this.styleTween(e,I_(e,i)).on("end.style."+e,xw(e)):typeof t=="function"?this.styleTween(e,M_(e,i,$h(this,"style."+e,t))).each(L_(this._id,e)):this.styleTween(e,A_(e,i,t),n).on("end.style."+e,null)}function D_(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function j_(e,t,n){var i,s;function l(){var a=t.apply(this,arguments);return a!==s&&(i=(s=a)&&D_(e,a,n)),i}return l._value=t,l}function $_(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,j_(e,t,n??""))}function z_(e){return function(){this.textContent=e}}function F_(e){return function(){var t=e(this);this.textContent=t??""}}function B_(e){return this.tween("text",typeof e=="function"?F_($h(this,"text",e)):z_(e==null?"":e+""))}function V_(e){return function(t){this.textContent=e.call(this,t)}}function W_(e){var t,n;function i(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&V_(s)),t}return i._value=e,i}function U_(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,W_(e))}function H_(){for(var e=this._name,t=this._id,n=bw(),i=this._groups,s=i.length,l=0;l<s;++l)for(var a=i[l],c=a.length,f,d=0;d<c;++d)if(f=a[d]){var m=vn(f,t);gu(f,e,n,d,a,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Zn(i,this._parents,e,n)}function q_(){var e,t,n=this,i=n._id,s=n.size();return new Promise(function(l,a){var c={value:a},f={value:function(){--s===0&&l()}};n.each(function(){var d=Ln(this,i),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),s===0&&l()})}var Y_=0;function Zn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function bw(){return++Y_}var Yn=Fs.prototype;Zn.prototype={constructor:Zn,select:C_,selectAll:T_,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:x_,merge:b_,selection:P_,transition:H_,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:E_,attr:i_,attrTween:u_,style:R_,styleTween:$_,text:B_,textTween:U_,remove:__,tween:QN,delay:d_,duration:m_,ease:y_,easeVarying:w_,end:q_,[Symbol.iterator]:Yn[Symbol.iterator]};function K_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var G_={time:null,delay:0,duration:250,ease:K_};function X_(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 Q_(e){var t,n;e instanceof Zn?(t=e._id,e=e._name):(t=bw(),(n=G_).time=Dh(),e=e==null?null:e+"");for(var i=this._groups,s=i.length,l=0;l<s;++l)for(var a=i[l],c=a.length,f,d=0;d<c;++d)(f=a[d])&&gu(f,e,t,d,a,n||X_(f,t));return new Zn(i,this._parents,e,t)}Fs.prototype.interrupt=KN;Fs.prototype.transition=Q_;const va=e=>()=>e;function J_(e,{sourceEvent:t,target:n,transform:i,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:i,enumerable:!0,configurable:!0},_:{value:s}})}function Gn(e,t,n){this.k=e,this.x=t,this.y=n}Gn.prototype={constructor:Gn,scale:function(e){return e===1?this:new Gn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gn(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 yu=new Gn(1,0,0);Sw.prototype=Gn.prototype;function Sw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yu;return e.__zoom}function Ff(e){e.stopImmediatePropagation()}function ps(e){e.preventDefault(),e.stopImmediatePropagation()}function Z_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function eC(){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 vy(){return this.__zoom||yu}function tC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nC(){return navigator.maxTouchPoints||"ontouchstart"in this}function rC(e,t,n){var i=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),a>l?(l+a)/2:Math.min(0,l)||Math.max(0,a))}function kw(){var e=Z_,t=eC,n=rC,i=tC,s=nC,l=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,f=za,d=hu("start","zoom","end"),m,h,g,v=500,S=150,w=0,b=10;function k(j){j.property("__zoom",vy).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",F).filter(s).on("touchstart.zoom",R).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(j,G,q,J){var Y=j.selection?j.selection():j;Y.property("__zoom",vy),j!==Y?A(j,G,q,J):Y.interrupt().each(function(){M(this,arguments).event(J).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},k.scaleBy=function(j,G,q,J){k.scaleTo(j,function(){var Y=this.__zoom.k,U=typeof G=="function"?G.apply(this,arguments):G;return Y*U},q,J)},k.scaleTo=function(j,G,q,J){k.transform(j,function(){var Y=t.apply(this,arguments),U=this.__zoom,B=q==null?_(Y):typeof q=="function"?q.apply(this,arguments):q,D=U.invert(B),W=typeof G=="function"?G.apply(this,arguments):G;return n(E(N(U,W),B,D),Y,a)},q,J)},k.translateBy=function(j,G,q,J){k.transform(j,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),a)},null,J)},k.translateTo=function(j,G,q,J,Y){k.transform(j,function(){var U=t.apply(this,arguments),B=this.__zoom,D=J==null?_(U):typeof J=="function"?J.apply(this,arguments):J;return n(yu.translate(D[0],D[1]).scale(B.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof q=="function"?-q.apply(this,arguments):-q),U,a)},J,Y)};function N(j,G){return G=Math.max(l[0],Math.min(l[1],G)),G===j.k?j:new Gn(G,j.x,j.y)}function E(j,G,q){var J=G[0]-q[0]*j.k,Y=G[1]-q[1]*j.k;return J===j.x&&Y===j.y?j:new Gn(j.k,J,Y)}function _(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function A(j,G,q,J){j.on("start.zoom",function(){M(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(J).end()}).tween("zoom",function(){var Y=this,U=arguments,B=M(Y,U).event(J),D=t.apply(Y,U),W=q==null?_(D):typeof q=="function"?q.apply(Y,U):q,V=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),K=Y.__zoom,Q=typeof G=="function"?G.apply(Y,U):G,re=f(K.invert(W).concat(V/K.k),Q.invert(W).concat(V/Q.k));return function(se){if(se===1)se=Q;else{var ee=re(se),oe=V/ee[2];se=new Gn(oe,W[0]-ee[0]*oe,W[1]-ee[1]*oe)}B.zoom(null,se)}})}function M(j,G,q){return!q&&j.__zooming||new L(j,G)}function L(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,G),this.taps=0}L.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,G){return this.mouse&&j!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var G=Vt(this.that).datum();d.call(j,this.that,new J_(j,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),G)}};function C(j,...G){if(!e.apply(this,arguments))return;var q=M(this,G).event(j),J=this.__zoom,Y=Math.max(l[0],Math.min(l[1],J.k*Math.pow(2,i.apply(this,arguments)))),U=dn(j);if(q.wheel)(q.mouse[0][0]!==U[0]||q.mouse[0][1]!==U[1])&&(q.mouse[1]=J.invert(q.mouse[0]=U)),clearTimeout(q.wheel);else{if(J.k===Y)return;q.mouse=[U,J.invert(U)],Va(this),q.start()}ps(j),q.wheel=setTimeout(B,S),q.zoom("mouse",n(E(N(J,Y),q.mouse[0],q.mouse[1]),q.extent,a));function B(){q.wheel=null,q.end()}}function I(j,...G){if(g||!e.apply(this,arguments))return;var q=j.currentTarget,J=M(this,G,!0).event(j),Y=Vt(j.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",V,!0),U=dn(j,q),B=j.clientX,D=j.clientY;sw(j.view),Ff(j),J.mouse=[U,this.__zoom.invert(U)],Va(this),J.start();function W(K){if(ps(K),!J.moved){var Q=K.clientX-B,re=K.clientY-D;J.moved=Q*Q+re*re>w}J.event(K).zoom("mouse",n(E(J.that.__zoom,J.mouse[0]=dn(K,q),J.mouse[1]),J.extent,a))}function V(K){Y.on("mousemove.zoom mouseup.zoom",null),lw(K.view,J.moved),ps(K),J.event(K).end()}}function F(j,...G){if(e.apply(this,arguments)){var q=this.__zoom,J=dn(j.changedTouches?j.changedTouches[0]:j,this),Y=q.invert(J),U=q.k*(j.shiftKey?.5:2),B=n(E(N(q,U),J,Y),t.apply(this,G),a);ps(j),c>0?Vt(this).transition().duration(c).call(A,B,J,j):Vt(this).call(k.transform,B,J,j)}}function R(j,...G){if(e.apply(this,arguments)){var q=j.touches,J=q.length,Y=M(this,G,j.changedTouches.length===J).event(j),U,B,D,W;for(Ff(j),B=0;B<J;++B)D=q[B],W=dn(D,this),W=[W,this.__zoom.invert(W),D.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==W[2]&&(Y.touch1=W,Y.taps=0):(Y.touch0=W,U=!0,Y.taps=1+!!m);m&&(m=clearTimeout(m)),U&&(Y.taps<2&&(h=W[0],m=setTimeout(function(){m=null},v)),Va(this),Y.start())}}function $(j,...G){if(this.__zooming){var q=M(this,G).event(j),J=j.changedTouches,Y=J.length,U,B,D,W;for(ps(j),U=0;U<Y;++U)B=J[U],D=dn(B,this),q.touch0&&q.touch0[2]===B.identifier?q.touch0[0]=D:q.touch1&&q.touch1[2]===B.identifier&&(q.touch1[0]=D);if(B=q.that.__zoom,q.touch1){var V=q.touch0[0],K=q.touch0[1],Q=q.touch1[0],re=q.touch1[1],se=(se=Q[0]-V[0])*se+(se=Q[1]-V[1])*se,ee=(ee=re[0]-K[0])*ee+(ee=re[1]-K[1])*ee;B=N(B,Math.sqrt(se/ee)),D=[(V[0]+Q[0])/2,(V[1]+Q[1])/2],W=[(K[0]+re[0])/2,(K[1]+re[1])/2]}else if(q.touch0)D=q.touch0[0],W=q.touch0[1];else return;q.zoom("touch",n(E(B,D,W),q.extent,a))}}function Z(j,...G){if(this.__zooming){var q=M(this,G).event(j),J=j.changedTouches,Y=J.length,U,B;for(Ff(j),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),U=0;U<Y;++U)B=J[U],q.touch0&&q.touch0[2]===B.identifier?delete q.touch0:q.touch1&&q.touch1[2]===B.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(B=dn(B,this),Math.hypot(h[0]-B[0],h[1]-B[1])<b)){var D=Vt(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return k.wheelDelta=function(j){return arguments.length?(i=typeof j=="function"?j:va(+j),k):i},k.filter=function(j){return arguments.length?(e=typeof j=="function"?j:va(!!j),k):e},k.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:va(!!j),k):s},k.extent=function(j){return arguments.length?(t=typeof j=="function"?j:va([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),k):t},k.scaleExtent=function(j){return arguments.length?(l[0]=+j[0],l[1]=+j[1],k):[l[0],l[1]]},k.translateExtent=function(j){return arguments.length?(a[0][0]=+j[0][0],a[1][0]=+j[1][0],a[0][1]=+j[0][1],a[1][1]=+j[1][1],k):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},k.constrain=function(j){return arguments.length?(n=j,k):n},k.duration=function(j){return arguments.length?(c=+j,k):c},k.interpolate=function(j){return arguments.length?(f=j,k):f},k.on=function(){var j=d.on.apply(d,arguments);return j===d?k:j},k.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,k):Math.sqrt(w)},k.tapDistance=function(j){return arguments.length?(b=+j,k):b},k}const gn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.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 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:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},As=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ew=["Enter"," ","Escape"],Nw={"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 so;(function(e){e.Strict="strict",e.Loose="loose"})(so||(so={}));var ii;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ii||(ii={}));var Ms;(function(e){e.Partial="partial",e.Full="full"})(Ms||(Ms={}));const _w={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Cr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Cr||(Cr={}));var tu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tu||(tu={}));var Se;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Se||(Se={}));const wy={[Se.Left]:Se.Right,[Se.Right]:Se.Left,[Se.Top]:Se.Bottom,[Se.Bottom]:Se.Top};function Cw(e){return e===null?null:e?"valid":"invalid"}const Tw=e=>"id"in e&&"source"in e&&"target"in e,iC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),zh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vs=(e,t=[0,0])=>{const{width:n,height:i}=er(e),s=e.origin??t,l=n*s[0],a=i*s[1];return{x:e.position.x-l,y:e.position.y-a}},oC=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,s)=>{const l=typeof s=="string";let a=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(a=l?t.nodeLookup.get(s):zh(s)?s:t.nodeLookup.get(s.id));const c=a?nu(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vu(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wu(n)},Ws=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=vu(n,nu(s)),i=!0)}),i?wu(n):{x:0,y:0,width:0,height:0}},Fh=(e,t,[n,i,s]=[0,0,1],l=!1,a=!1)=>{const c={...yo(t,[n,i,s]),width:t.width/s,height:t.height/s},f=[];for(const d of e.values()){const{measured:m,selectable:h=!0,hidden:g=!1}=d;if(a&&!h||g)continue;const v=m.width??d.width??d.initialWidth??null,S=m.height??d.height??d.initialHeight??null,w=Ls(c,ao(d)),b=(v??0)*(S??0),k=l&&w>0;(!d.internals.handleBounds||k||w>=b||d.dragging)&&f.push(d)}return f},sC=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function lC(e,t){const n=new Map,i=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)&&(!i||i.has(s.id))&&n.set(s.id,s)}),n}async function aC({nodes:e,width:t,height:n,panZoom:i,minZoom:s,maxZoom:l},a){if(e.size===0)return!0;const c=lC(e,a),f=Ws(c),d=Vh(f,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??l,(a==null?void 0:a.padding)??.1);return await i.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Ow({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:s,onError:l}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:f,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},m=a.origin??i;let h=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)l==null||l("005",gn.error005());else{const v=c.measured.width,S=c.measured.height;v&&S&&(h=[[f,d],[f+v,d+S]])}else c&&ai(a.extent)&&(h=[[a.extent[0][0]+f,a.extent[0][1]+d],[a.extent[1][0]+f,a.extent[1][1]+d]]);const g=ai(h)?li(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(l==null||l("015",gn.error015())),{position:{x:g.x-f+(a.measured.width??0)*m[0],y:g.y-d+(a.measured.height??0)*m[1]},positionAbsolute:g}}async function uC({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:s}){const l=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=l.has(g.id),S=!v&&g.parentId&&a.find(w=>w.id===g.parentId);(v||S)&&a.push(g)}const c=new Set(t.map(g=>g.id)),f=i.filter(g=>g.deletable!==!1),m=sC(a,f);for(const g of f)c.has(g.id)&&!m.find(S=>S.id===g.id)&&m.push(g);if(!s)return{edges:m,nodes:a};const h=await s({nodes:a,edges:m});return typeof h=="boolean"?h?{edges:m,nodes:a}:{edges:[],nodes:[]}:h}const lo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),li=(e={x:0,y:0},t,n)=>({x:lo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Pw(e,t,n){const{width:i,height:s}=er(n),{x:l,y:a}=n.internals.positionAbsolute;return li(e,[[l,a],[l+i,a+s]],t)}const xy=(e,t,n)=>e<t?lo(Math.abs(e-t),1,t)/t:e>n?-lo(Math.abs(e-n),1,t)/t:0,Bh=(e,t,n=15,i=40)=>{const s=xy(e.x,i,t.width-i)*n,l=xy(e.y,i,t.height-i)*n;return[s,l]},vu=(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)}),ph=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),wu=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),ao=(e,t=[0,0])=>{var s,l;const{x:n,y:i}=zh(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},nu=(e,t=[0,0])=>{var s,l;const{x:n,y:i}=zh(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:i,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:i+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},Iw=(e,t)=>wu(vu(ph(e),ph(t))),Ls=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},by=e=>pn(e.width)&&pn(e.height)&&pn(e.x)&&pn(e.y),pn=e=>!isNaN(e)&&isFinite(e),Aw=(e,t)=>(n,i)=>{},Us=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),yo=({x:e,y:t},[n,i,s],l=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-i)/s};return l?Us(c,a):c},uo=({x:e,y:t},[n,i,s])=>({x:e*s+n,y:t*s+i});function Bi(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(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cC(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Bi(e,n),s=Bi(e,t);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof e=="object"){const i=Bi(e.top??e.y??0,n),s=Bi(e.bottom??e.y??0,n),l=Bi(e.left??e.x??0,t),a=Bi(e.right??e.x??0,t);return{top:i,right:a,bottom:s,left:l,x:l+a,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fC(e,t,n,i,s,l){const{x:a,y:c}=uo(e,[t,n,i]),{x:f,y:d}=uo({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=s-f,h=l-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(h)}}const Vh=(e,t,n,i,s,l)=>{const a=cC(l,t,n),c=(t-a.x)/e.width,f=(n-a.y)/e.height,d=Math.min(c,f),m=lo(d,i,s),h=e.x+e.width/2,g=e.y+e.height/2,v=t/2-h*m,S=n/2-g*m,w=fC(e,v,S,m,t,n),b={left:Math.min(w.left-a.left,0),top:Math.min(w.top-a.top,0),right:Math.min(w.right-a.right,0),bottom:Math.min(w.bottom-a.bottom,0)};return{x:v-b.left+b.right,y:S-b.top+b.bottom,zoom:m}},Rs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ai(e){return e!=null&&e!=="parent"}function er(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 Mw(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 Lw(e,t={width:0,height:0},n,i,s){const l={...e},a=i.get(n);if(a){const c=a.origin||s;l.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function Sy(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dC(){let e,t;return{promise:new Promise((i,s)=>{e=i,t=s}),resolve:e,reject:t}}function hC(e){return{...Nw,...e||{}}}function Ns(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:s}){const{x:l,y:a}=mn(e),c=yo({x:l-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},i),{x:f,y:d}=n?Us(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Wh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Rw=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pC=["INPUT","SELECT","TEXTAREA"];function Dw(e){var i,s;const t=((s=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:pC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const jw=e=>"clientX"in e,mn=(e,t)=>{var l,a;const n=jw(e),i=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},ky=(e,t,n,i,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).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)/i,y:(c.top-n.top)/i,...Wh(a)}})};function $w({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:c}){const f=e*.125+s*.375+a*.375+n*.125,d=t*.125+l*.375+c*.375+i*.125,m=Math.abs(f-e),h=Math.abs(d-t);return[f,d,m,h]}function wa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ey({pos:e,x1:t,y1:n,x2:i,y2:s,c:l}){switch(e){case Se.Left:return[t-wa(t-i,l),n];case Se.Right:return[t+wa(i-t,l),n];case Se.Top:return[t,n-wa(n-s,l)];case Se.Bottom:return[t,n+wa(s-n,l)]}}function zw({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top,curvature:a=.25}){const[c,f]=Ey({pos:n,x1:e,y1:t,x2:i,y2:s,c:a}),[d,m]=Ey({pos:l,x1:i,y1:s,x2:e,y2:t,c:a}),[h,g,v,S]=$w({sourceX:e,sourceY:t,targetX:i,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:m});return[`M${e},${t} C${c},${f} ${d},${m} ${i},${s}`,h,g,v,S]}function Fw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const s=Math.abs(n-e)/2,l=n<e?n+s:n-s,a=Math.abs(i-t)/2,c=i<t?i+a:i-a;return[l,c,s,a]}function mC({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return i;const a=s&&n?i+1e3:i,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 gC({sourceNode:e,targetNode:t,width:n,height:i,transform:s}){const l=vu(nu(e),nu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:i/s[2]};return Ls(a,wu(l))>0}const yC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,vC=(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)),wC=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",gn.error006()),t;const i=n.getEdgeId||yC;let s;return Tw(e)?s={...e}:s={...e,id:i(e)},vC(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Bw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[s,l,a,c]=Fw({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,s,l,a,c]}const Ny={[Se.Left]:{x:-1,y:0},[Se.Right]:{x:1,y:0},[Se.Top]:{x:0,y:-1},[Se.Bottom]:{x:0,y:1}},xC=({source:e,sourcePosition:t=Se.Bottom,target:n})=>t===Se.Left||t===Se.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},_y=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function bC({source:e,sourcePosition:t=Se.Bottom,target:n,targetPosition:i=Se.Top,center:s,offset:l,stepPosition:a}){const c=Ny[t],f=Ny[i],d={x:e.x+c.x*l,y:e.y+c.y*l},m={x:n.x+f.x*l,y:n.y+f.y*l},h=xC({source:d,sourcePosition:t,target:m}),g=h.x!==0?"x":"y",v=h[g];let S=[],w,b;const k={x:0,y:0},N={x:0,y:0},[,,E,_]=Fw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(w=s.x??d.x+(m.x-d.x)*a,b=s.y??(d.y+m.y)/2):(w=s.x??(d.x+m.x)/2,b=s.y??d.y+(m.y-d.y)*a);const C=[{x:w,y:d.y},{x:w,y:m.y}],I=[{x:d.x,y:b},{x:m.x,y:b}];c[g]===v?S=g==="x"?C:I:S=g==="x"?I:C}else{const C=[{x:d.x,y:m.y}],I=[{x:m.x,y:d.y}];if(g==="x"?S=c.x===v?I:C:S=c.y===v?C:I,t===i){const j=Math.abs(e[g]-n[g]);if(j<=l){const G=Math.min(l-1,l-j);c[g]===v?k[g]=(d[g]>e[g]?-1:1)*G:N[g]=(m[g]>n[g]?-1:1)*G}}if(t!==i){const j=g==="x"?"y":"x",G=c[g]===f[j],q=d[j]>m[j],J=d[j]<m[j];(c[g]===1&&(!G&&q||G&&J)||c[g]!==1&&(!G&&J||G&&q))&&(S=g==="x"?C:I)}const F={x:d.x+k.x,y:d.y+k.y},R={x:m.x+N.x,y:m.y+N.y},$=Math.max(Math.abs(F.x-S[0].x),Math.abs(R.x-S[0].x)),Z=Math.max(Math.abs(F.y-S[0].y),Math.abs(R.y-S[0].y));$>=Z?(w=(F.x+R.x)/2,b=S[0].y):(w=S[0].x,b=(F.y+R.y)/2)}const A={x:d.x+k.x,y:d.y+k.y},M={x:m.x+N.x,y:m.y+N.y};return[[e,...A.x!==S[0].x||A.y!==S[0].y?[A]:[],...S,...M.x!==S[S.length-1].x||M.y!==S[S.length-1].y?[M]:[],n],w,b,E,_]}function SC(e,t,n,i){const s=Math.min(_y(e,t)/2,_y(t,n)/2,i),{x:l,y:a}=t;if(e.x===l&&l===n.x||e.y===a&&a===n.y)return`L${l} ${a}`;if(e.y===a){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${l+s*d},${a}Q ${l},${a} ${l},${a+s*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${a+s*f}Q ${l},${a} ${l+s*c},${a}`}function mh({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top,borderRadius:a=5,centerX:c,centerY:f,offset:d=20,stepPosition:m=.5}){const[h,g,v,S,w]=bC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:s},targetPosition:l,center:{x:c,y:f},offset:d,stepPosition:m});let b=`M${h[0].x} ${h[0].y}`;for(let k=1;k<h.length-1;k++)b+=SC(h[k-1],h[k],h[k+1],a);return b+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[b,g,v,S,w]}function Cy(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function kC(e){var h;const{sourceNode:t,targetNode:n}=e;if(!Cy(t)||!Cy(n))return null;const i=t.internals.handleBounds||Ty(t.handles),s=n.internals.handleBounds||Ty(n.handles),l=Oy((i==null?void 0:i.source)??[],e.sourceHandle),a=Oy(e.connectionMode===so.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!a)return(h=e.onError)==null||h.call(e,"008",gn.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(l==null?void 0:l.position)||Se.Bottom,f=(a==null?void 0:a.position)||Se.Top,d=ui(t,l,c),m=ui(n,a,f);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function Ty(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function ui(e,t,n=Se.Left,i=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??er(e);if(i)return{x:s+a/2,y:l+c/2};switch((t==null?void 0:t.position)??n){case Se.Top:return{x:s+a/2,y:l};case Se.Right:return{x:s+a,y:l+c/2};case Se.Bottom:return{x:s+a/2,y:l+c};case Se.Left:return{x:s,y:l+c/2}}}function Oy(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function gh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function EC(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:s}){const l=new Set;return e.reduce((a,c)=>([c.markerStart||i,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const d=gh(f,t);l.has(d)||(a.push({id:d,color:f.color||n,...f}),l.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const Vw=1e3,NC=10,Uh={nodeOrigin:[0,0],nodeExtent:As,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_C={...Uh,checkEquality:!0};function Hh(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function CC(e,t,n){const i=Hh(Uh,n);for(const s of e.values())if(s.parentId)Yh(s,e,t,i);else{const l=Vs(s,i.nodeOrigin),a=ai(s.extent)?s.extent:i.nodeExtent,c=li(l,a,er(s));s.internals.positionAbsolute=c}}function TC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const s of e.handles){const l={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(l):s.type==="target"&&i.push(l)}return{source:n,target:i}}function qh(e){return e==="manual"}function yh(e,t,n,i={}){var m,h;const s=Hh(_C,i),l={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!qh(s.zIndexMode)?Vw:0;let f=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let v=a.get(g.id);if(s.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const S=Vs(g,s.nodeOrigin),w=ai(g.extent)?g.extent:s.nodeExtent,b=li(S,w,er(g));v={...s.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(h=g.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:TC(g,v),z:Ww(g,c,s.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(f=!1),g.parentId&&Yh(v,t,n,i,l),d||(d=g.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:d}}function OC(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 Yh(e,t,n,i,s){const{elevateNodesOnSelect:l,nodeOrigin:a,nodeExtent:c,zIndexMode:f}=Hh(Uh,i),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}OC(e,n),s&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++s.i,m.internals.z=m.internals.z+s.i*NC),s&&m.internals.rootParentIndex!==void 0&&(s.i=m.internals.rootParentIndex);const h=l&&!qh(f)?Vw:0,{x:g,y:v,z:S}=PC(e,m,a,c,h,f),{positionAbsolute:w}=e.internals,b=g!==w.x||v!==w.y;(b||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y:v}:w,z:S}})}function Ww(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return qh(n)?i:i+(e.selected?t:0)}function PC(e,t,n,i,s,l){const{x:a,y:c}=t.internals.positionAbsolute,f=er(e),d=Vs(e,n),m=ai(e.extent)?li(d,e.extent,f):d;let h=li({x:a+m.x,y:c+m.y},i,f);e.extent==="parent"&&(h=Pw(h,f,t));const g=Ww(e,s,l),v=t.internals.z??0;return{x:h.x,y:h.y,z:v>=g?v+1:g}}function Kh(e,t,n,i=[0,0]){var a;const s=[],l=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const d=((a=l.get(c.parentId))==null?void 0:a.expandedRect)??ao(f),m=Iw(d,c.rect);l.set(c.parentId,{expandedRect:m,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},d)=>{var E;const m=f.internals.positionAbsolute,h=er(f),g=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,S=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(h.width,Math.round(c.width)),b=Math.max(h.height,Math.round(c.height)),k=(w-h.width)*g[0],N=(b-h.height)*g[1];(v>0||S>0||k||N)&&(s.push({id:d,type:"position",position:{x:f.position.x-v+k,y:f.position.y-S+N}}),(E=n.get(d))==null||E.forEach(_=>{e.some(A=>A.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+v,y:_.position.y+S}})})),(h.width<c.width||h.height<c.height||v||S)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-k:0),height:b+(S?g[1]*S-N:0)}})}),s}function IC(e,t,n,i,s,l,a){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const d=[],m=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const S=t.get(v.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),f=!0;continue}const w=Wh(v.nodeElement),b=S.measured.width!==w.width||S.measured.height!==w.height;if(!!(w.width&&w.height&&(b||!S.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),E=ai(S.extent)?S.extent:l;let{positionAbsolute:_}=S.internals;S.parentId&&S.extent==="parent"?_=Pw(_,w,t.get(S.parentId)):E&&(_=li(_,E,w));const A={...S,measured:w,internals:{...S.internals,positionAbsolute:_,handleBounds:{source:ky("source",v.nodeElement,N,h,S.id),target:ky("target",v.nodeElement,N,h,S.id)}}};t.set(S.id,A),S.parentId&&Yh(A,t,n,{nodeOrigin:s,zIndexMode:a}),f=!0,b&&(d.push({id:S.id,type:"dimensions",dimensions:w}),S.expandParent&&S.parentId&&g.push({id:S.id,parentId:S.parentId,rect:ao(A,s)}))}}if(g.length>0){const v=Kh(g,t,n,s);d.push(...v)}return{changes:d,updatedInternals:f}}async function AC({delta:e,panZoom:t,transform:n,translateExtent:i,width:s,height:l}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,l]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function Py(e,t,n,i,s,l){let a=s;const c=i.get(a)||new Map;i.set(a,c.set(n,t)),a=`${s}-${e}`;const f=i.get(a)||new Map;if(i.set(a,f.set(n,t)),l){a=`${s}-${e}-${l}`;const d=i.get(a)||new Map;i.set(a,d.set(n,t))}}function Uw(e,t,n){e.clear(),t.clear();for(const i of n){const{source:s,target:l,sourceHandle:a=null,targetHandle:c=null}=i,f={edgeId:i.id,source:s,target:l,sourceHandle:a,targetHandle:c},d=`${s}-${a}--${l}-${c}`,m=`${l}-${c}--${s}-${a}`;Py("source",f,m,e,s,a),Py("target",f,d,e,l,c),t.set(i.id,i)}}function Hw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Hw(n,t):!1}function Iy(e,t,n){var s;let i=e;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function MC(e,t,n,i){const s=new Map;for(const[l,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!Hw(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(l);c&&s.set(l,{id:l,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 Bf({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,c,f;const s=[];for(const[d,m]of t){const h=(a=n.get(d))==null?void 0:a.internals.userNode;h&&s.push({...h,position:m.position,dragging:i})}if(!e)return[s[0],s];const l=(c=n.get(e))==null?void 0:c.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:i}:s[0],s]}function LC({dragItems:e,snapGrid:t,x:n,y:i}){const s=e.values().next().value;if(!s)return null;const l={x:n-s.distance.x,y:i-s.distance.y},a=Us(l,t);return{x:a.x-l.x,y:a.y-l.y}}function RC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:s}){let l={x:null,y:null},a=0,c=new Map,f=!1,d={x:0,y:0},m=null,h=!1,g=null,v=!1,S=!1,w=null;function b({noDragClassName:N,handleSelector:E,domNode:_,isSelectable:A,nodeId:M,nodeClickDistance:L=0}){g=Vt(_);function C({x:$,y:Z}){const{nodeLookup:j,nodeExtent:G,snapGrid:q,snapToGrid:J,nodeOrigin:Y,onNodeDrag:U,onSelectionDrag:B,onError:D,updateNodePositions:W}=t();l={x:$,y:Z};let V=!1;const K=c.size>1,Q=K&&G?ph(Ws(c)):null,re=K&&J?LC({dragItems:c,snapGrid:q,x:$,y:Z}):null;for(const[se,ee]of c){if(!j.has(se))continue;let oe={x:$-ee.distance.x,y:Z-ee.distance.y};J&&(oe=re?{x:Math.round(oe.x+re.x),y:Math.round(oe.y+re.y)}:Us(oe,q));let de=null;if(K&&G&&!ee.extent&&Q){const{positionAbsolute:fe}=ee.internals,ke=fe.x-Q.x+G[0][0],Ie=fe.x+ee.measured.width-Q.x2+G[1][0],Ae=fe.y-Q.y+G[0][1],ze=fe.y+ee.measured.height-Q.y2+G[1][1];de=[[ke,Ae],[Ie,ze]]}const{position:xe,positionAbsolute:he}=Ow({nodeId:se,nextPosition:oe,nodeLookup:j,nodeExtent:de||G,nodeOrigin:Y,onError:D});V=V||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=he}if(S=S||V,!!V&&(W(c,!0),w&&(i||U||!M&&B))){const[se,ee]=Bf({nodeId:M,dragItems:c,nodeLookup:j});i==null||i(w,c,se,ee),U==null||U(w,se,ee),M||B==null||B(w,ee)}}async function I(){if(!m)return;const{transform:$,panBy:Z,autoPanSpeed:j,autoPanOnNodeDrag:G}=t();if(!G){f=!1,cancelAnimationFrame(a);return}const[q,J]=Bh(d,m,j);(q!==0||J!==0)&&(l.x=(l.x??0)-q/$[2],l.y=(l.y??0)-J/$[2],await Z({x:q,y:J})&&C(l)),a=requestAnimationFrame(I)}function F($){var K;const{nodeLookup:Z,multiSelectionActive:j,nodesDraggable:G,transform:q,snapGrid:J,snapToGrid:Y,selectNodesOnDrag:U,onNodeDragStart:B,onSelectionDragStart:D,unselectNodesAndEdges:W}=t();h=!0,(!U||!A)&&!j&&M&&((K=Z.get(M))!=null&&K.selected||W()),A&&U&&M&&(e==null||e(M));const V=Ns($.sourceEvent,{transform:q,snapGrid:J,snapToGrid:Y,containerBounds:m});if(l=V,c=MC(Z,G,V,M),c.size>0&&(n||B||!M&&D)){const[Q,re]=Bf({nodeId:M,dragItems:c,nodeLookup:Z});n==null||n($.sourceEvent,c,Q,re),B==null||B($.sourceEvent,Q,re),M||D==null||D($.sourceEvent,re)}}const R=aw().clickDistance(L).on("start",$=>{const{domNode:Z,nodeDragThreshold:j,transform:G,snapGrid:q,snapToGrid:J}=t();m=(Z==null?void 0:Z.getBoundingClientRect())||null,v=!1,S=!1,w=$.sourceEvent,j===0&&F($),l=Ns($.sourceEvent,{transform:G,snapGrid:q,snapToGrid:J,containerBounds:m}),d=mn($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:Z,transform:j,snapGrid:G,snapToGrid:q,nodeDragThreshold:J,nodeLookup:Y}=t(),U=Ns($.sourceEvent,{transform:j,snapGrid:G,snapToGrid:q,containerBounds:m});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||M&&!Y.has(M))&&(v=!0),!v){if(!f&&Z&&h&&(f=!0,I()),!h){const B=mn($.sourceEvent,m),D=B.x-d.x,W=B.y-d.y;Math.sqrt(D*D+W*W)>J&&F($)}(l.x!==U.xSnapped||l.y!==U.ySnapped)&&c&&h&&(d=mn($.sourceEvent,m),C(U))}}).on("end",$=>{if(!h||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(f=!1,h=!1,cancelAnimationFrame(a),c.size>0){const{nodeLookup:Z,updateNodePositions:j,onNodeDragStop:G,onSelectionDragStop:q}=t();if(S&&(j(c,!1),S=!1),s||G||!M&&q){const[J,Y]=Bf({nodeId:M,dragItems:c,nodeLookup:Z,dragging:!1});s==null||s($.sourceEvent,c,J,Y),G==null||G($.sourceEvent,J,Y),M||q==null||q($.sourceEvent,Y)}}}).filter($=>{const Z=$.target;return!$.button&&(!N||!Iy(Z,`.${N}`,_))&&(!E||Iy(Z,E,_))});g.call(R)}function k(){g==null||g.on(".drag",null)}return{update:b,destroy:k}}function DC(e,t,n){const i=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Ls(s,ao(l))>0&&i.push(l);return i}const jC=250;function $C(e,t,n,i){var c,f;let s=[],l=1/0;const a=DC(e,n,t+jC);for(const d of a){const m=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((f=d.internals.handleBounds)==null?void 0:f.target)??[]];for(const h of m){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:g,y:v}=ui(d,h,h.position,!0),S=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));S>t||(S<l?(s=[{...h,x:g,y:v}],l=S):S===l&&s.push({...h,x:g,y:v}))}}if(!s.length)return null;if(s.length>1){const d=i.type==="source"?"target":"source";return s.find(m=>m.type===d)??s[0]}return s[0]}function qw(e,t,n,i,s,l=!1){var d,m,h;const a=i.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)??[],...((h=a.internals.handleBounds)==null?void 0:h.target)??[]],f=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return f&&l?{...f,...ui(a,f,f.position,!0)}:f}function Yw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Kw=()=>!0;function FC(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:s,edgeUpdaterType:l,isTarget:a,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:m,flowId:h,panBy:g,cancelConnection:v,onConnectStart:S,onConnect:w,onConnectEnd:b,isValidConnection:k=Kw,onReconnectEnd:N,updateConnection:E,getTransform:_,getFromHandle:A,autoPanSpeed:M,dragThreshold:L=1,handleDomNode:C}){const I=Rw(e.target);let F=0,R;const{x:$,y:Z}=mn(e),j=Yw(l,C),G=c==null?void 0:c.getBoundingClientRect();let q=!1;if(!G||!j)return;const J=qw(s,j,i,f,t);if(!J)return;let Y=mn(e,G),U=!1,B=null,D=!1,W=null;function V(){if(!m||!G)return;const[xe,he]=Bh(Y,G,M);g({x:xe,y:he}),F=requestAnimationFrame(V)}const K={...J,nodeId:s,type:j,position:J.position},Q=f.get(s);let se={inProgress:!0,isValid:null,from:ui(Q,K,Se.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:Q,to:Y,toHandle:null,toPosition:wy[K.position],toNode:null,pointer:Y};function ee(){q=!0,E(se),S==null||S(e,{nodeId:s,handleId:i,handleType:j})}L===0&&ee();function oe(xe){if(!q){const{x:ze,y:wt}=mn(xe),Nt=ze-$,ht=wt-Z;if(!(Nt*Nt+ht*ht>L*L))return;ee()}if(!A()||!K){de(xe);return}const he=_();Y=mn(xe,G),R=$C(yo(Y,he,!1,[1,1]),n,f,K),U||(V(),U=!0);const fe=Gw(xe,{handle:R,connectionMode:t,fromNodeId:s,fromHandleId:i,fromType:a?"target":"source",isValidConnection:k,doc:I,lib:d,flowId:h,nodeLookup:f});W=fe.handleDomNode,B=fe.connection,D=zC(!!R,fe.isValid);const ke=f.get(s),Ie=ke?ui(ke,K,Se.Left,!0):se.from,Ae={...se,from:Ie,isValid:D,to:fe.toHandle&&D?uo({x:fe.toHandle.x,y:fe.toHandle.y},he):Y,toHandle:fe.toHandle,toPosition:D&&fe.toHandle?fe.toHandle.position:wy[K.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:Y};E(Ae),se=Ae}function de(xe){if(!("touches"in xe&&xe.touches.length>0)){if(q){(R||W)&&B&&D&&(w==null||w(B));const{inProgress:he,...fe}=se,ke={...fe,toPosition:se.toHandle?se.toPosition:null};b==null||b(xe,ke),l&&(N==null||N(xe,ke))}v(),cancelAnimationFrame(F),U=!1,D=!1,B=null,W=null,I.removeEventListener("mousemove",oe),I.removeEventListener("mouseup",de),I.removeEventListener("touchmove",oe),I.removeEventListener("touchend",de)}}I.addEventListener("mousemove",oe),I.addEventListener("mouseup",de),I.addEventListener("touchmove",oe),I.addEventListener("touchend",de)}function Gw(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:s,fromType:l,doc:a,lib:c,flowId:f,isValidConnection:d=Kw,nodeLookup:m}){const h=l==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:S}=mn(e),w=a.elementFromPoint(v,S),b=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,k={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const N=Yw(void 0,b),E=b.getAttribute("data-nodeid"),_=b.getAttribute("data-handleid"),A=b.classList.contains("connectable"),M=b.classList.contains("connectableend");if(!E||!N)return k;const L={source:h?E:i,sourceHandle:h?_:s,target:h?i:E,targetHandle:h?s:_};k.connection=L;const I=A&&M&&(n===so.Strict?h&&N==="source"||!h&&N==="target":E!==i||_!==s);k.isValid=I&&d(L),k.toHandle=qw(E,N,_,m,n,!0)}return k}const vh={onPointerDown:FC,isValid:Gw};function BC({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const s=Vt(e);function l({translateExtent:c,width:f,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const S=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const _=n(),A=E.sourceEvent.ctrlKey&&Rs()?10:1,M=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,L=_[2]*Math.pow(2,M*A);t.scaleTo(L)};let w=[0,0];const b=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},k=E=>{const _=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const A=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],M=[A[0]-w[0],A[1]-w[1]];w=A;const L=i()*Math.max(_[2],Math.log(_[2]))*(v?-1:1),C={x:_[0]-M[0]*L,y:_[1]-M[1]*L},I=[[0,0],[f,d]];t.setViewportConstrained({x:C.x,y:C.y,zoom:_[2]},I,c)},N=kw().on("start",b).on("zoom",h?k:null).on("zoom.wheel",g?S:null);s.call(N,{})}function a(){s.on("zoom",null)}return{update:l,destroy:a,pointer:dn}}const xu=e=>({x:e.x,y:e.y,zoom:e.k}),Vf=({x:e,y:t,zoom:n})=>yu.translate(e,t).scale(n),Ki=(e,t)=>e.target.closest(`.${t}`),Xw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),VC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wf=(e,t=0,n=VC,i=()=>{})=>{const s=typeof t=="number"&&t>0;return s||i(),s?e.transition().duration(t).ease(n).on("end",i):e},Qw=e=>{const t=e.ctrlKey&&Rs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function WC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return m=>{if(Ki(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(m.ctrlKey&&a){const b=dn(m),k=Qw(m),N=h*Math.pow(2,k);i.scaleTo(n,N,b,m);return}const g=m.deltaMode===1?20:1;let v=s===ii.Vertical?0:m.deltaX*g,S=s===ii.Horizontal?0:m.deltaY*g;!Rs()&&m.shiftKey&&s!==ii.Vertical&&(v=m.deltaY*g,S=0),i.translateBy(n,-(v/h)*l,-(S/h)*l,{internal:!0});const w=xu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function UC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,s){const l=i.type==="wheel",a=!t&&l&&!i.ctrlKey,c=Ki(i,e);if(i.ctrlKey&&l&&c&&i.preventDefault(),a||c)return null;i.preventDefault(),n.call(this,i,s)}}function HC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var l,a,c;if((l=i.sourceEvent)!=null&&l.internal)return;const s=xu(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,s))}}function qC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:s}){return l=>{var a,c;e.usedRightMouseButton=!!(n&&Xw(t,e.mouseButton??0)),(a=l.sourceEvent)!=null&&a.sync||i([l.transform.x,l.transform.y,l.transform.k]),s&&!((c=l.sourceEvent)!=null&&c.internal)&&(s==null||s(l.sourceEvent,xu(l.transform)))}}function YC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:l}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,l&&Xw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&l(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),s)){const f=xu(a.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,f)},n?150:0)}}}function KC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:a,noWheelClassName:c,noPanClassName:f,lib:d,connectionInProgress:m}){return h=>{var b;const g=e||t,v=n&&h.ctrlKey,S=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Ki(h,`${d}-flow__node`)||Ki(h,`${d}-flow__edge`)))return!0;if(!i&&!g&&!s&&!l&&!n||a||m&&!S||Ki(h,c)&&S||Ki(h,f)&&(!S||s&&S&&!e)||!n&&h.ctrlKey&&S)return!1;if(!n&&h.type==="touchstart"&&((b=h.touches)==null?void 0:b.length)>1)return h.preventDefault(),!1;if(!g&&!s&&!v&&S||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||S)&&w}}function GC({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:s,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:f}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),h=kw().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(h);N({x:s.x,y:s.y,zoom:lo(s.zoom,t,n)},[[0,0],[m.width,m.height]],i);const v=g.on("wheel.zoom"),S=g.on("dblclick.zoom");h.wheelDelta(Qw);async function w(R,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).transform(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}function b({noWheelClassName:R,noPanClassName:$,onPaneContextMenu:Z,userSelectionActive:j,panOnScroll:G,panOnDrag:q,panOnScrollMode:J,panOnScrollSpeed:Y,preventScrolling:U,zoomOnPinch:B,zoomOnScroll:D,zoomOnDoubleClick:W,zoomActivationKeyPressed:V,lib:K,onTransformChange:Q,connectionInProgress:re,paneClickDistance:se,selectionOnDrag:ee}){j&&!d.isZoomingOrPanning&&k();const oe=G&&!V&&!j;h.clickDistance(ee?1/0:!pn(se)||se<0?0:se);const de=oe?WC({zoomPanValues:d,noWheelClassName:R,d3Selection:g,d3Zoom:h,panOnScrollMode:J,panOnScrollSpeed:Y,zoomOnPinch:B,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):UC({noWheelClassName:R,preventScrolling:U,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=HC({zoomPanValues:d,onDraggingChange:f,onPanZoomStart:a});h.on("start",xe);const he=qC({zoomPanValues:d,panOnDrag:q,onPaneContextMenu:!!Z,onPanZoom:l,onTransformChange:Q});h.on("zoom",he);const fe=YC({zoomPanValues:d,panOnDrag:q,panOnScroll:G,onPaneContextMenu:Z,onPanZoomEnd:c,onDraggingChange:f});h.on("end",fe);const ke=KC({zoomActivationKeyPressed:V,panOnDrag:q,zoomOnScroll:D,panOnScroll:G,zoomOnDoubleClick:W,zoomOnPinch:B,userSelectionActive:j,noPanClassName:$,noWheelClassName:R,lib:K,connectionInProgress:re});h.filter(ke),W?g.on("dblclick.zoom",S):g.on("dblclick.zoom",null)}function k(){h.on("zoom",null)}async function N(R,$,Z){const j=Vf(R),G=h==null?void 0:h.constrain()(j,$,Z);return G&&await w(G),G}async function E(R,$){const Z=Vf(R);return await w(Z,$),Z}function _(R){if(g){const $=Vf(R),Z=g.property("__zoom");(Z.k!==R.zoom||Z.x!==R.x||Z.y!==R.y)&&(h==null||h.transform(g,$,null,{sync:!0}))}}function A(){const R=g?Sw(g.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function M(R,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).scaleTo(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}async function L(R,$){return g?new Promise(Z=>{h==null||h.interpolate(($==null?void 0:$.interpolate)==="linear"?Es:za).scaleBy(Wf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}function C(R){h==null||h.scaleExtent(R)}function I(R){h==null||h.translateExtent(R)}function F(R){const $=!pn(R)||R<0?0:R;h==null||h.clickDistance($)}return{update:b,destroy:k,setViewport:E,setViewportConstrained:N,getViewport:A,scaleTo:M,scaleBy:L,setScaleExtent:C,setTranslateExtent:I,syncViewport:_,setClickDistance:F}}var co;(function(e){e.Line="line",e.Handle="handle"})(co||(co={}));function XC({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:s,affectsY:l}){const a=e-t,c=n-i,f=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function Ay(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:s}}function Sr(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function xa(e,t,n){return Math.max(0,t-e,e-n)}function My(e,t){return e?!t:t}function QC(e,t,n,i,s,l,a,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:m,isVertical:h}=t,g=m&&h,{xSnapped:v,ySnapped:S}=n,{minWidth:w,maxWidth:b,minHeight:k,maxHeight:N}=i,{x:E,y:_,width:A,height:M,aspectRatio:L}=e;let C=Math.floor(m?v-e.pointerX:0),I=Math.floor(h?S-e.pointerY:0);const F=A+(f?-C:C),R=M+(d?-I:I),$=-l[0]*A,Z=-l[1]*M;let j=xa(F,w,b),G=xa(R,k,N);if(a){let Y=0,U=0;f&&C<0?Y=Sr(E+C+$,a[0][0]):!f&&C>0&&(Y=kr(E+F+$,a[1][0])),d&&I<0?U=Sr(_+I+Z,a[0][1]):!d&&I>0&&(U=kr(_+R+Z,a[1][1])),j=Math.max(j,Y),G=Math.max(G,U)}if(c){let Y=0,U=0;f&&C>0?Y=kr(E+C,c[0][0]):!f&&C<0&&(Y=Sr(E+F,c[1][0])),d&&I>0?U=kr(_+I,c[0][1]):!d&&I<0&&(U=Sr(_+R,c[1][1])),j=Math.max(j,Y),G=Math.max(G,U)}if(s){if(m){const Y=xa(F/L,k,N)*L;if(j=Math.max(j,Y),a){let U=0;!f&&!d||f&&!d&&g?U=kr(_+Z+F/L,a[1][1])*L:U=Sr(_+Z+(f?C:-C)/L,a[0][1])*L,j=Math.max(j,U)}if(c){let U=0;!f&&!d||f&&!d&&g?U=Sr(_+F/L,c[1][1])*L:U=kr(_+(f?C:-C)/L,c[0][1])*L,j=Math.max(j,U)}}if(h){const Y=xa(R*L,w,b)/L;if(G=Math.max(G,Y),a){let U=0;!f&&!d||d&&!f&&g?U=kr(E+R*L+$,a[1][0])/L:U=Sr(E+(d?I:-I)*L+$,a[0][0])/L,G=Math.max(G,U)}if(c){let U=0;!f&&!d||d&&!f&&g?U=Sr(E+R*L,c[1][0])/L:U=kr(E+(d?I:-I)*L,c[0][0])/L,G=Math.max(G,U)}}}I=I+(I<0?G:-G),C=C+(C<0?j:-j),s&&(g?F>R*L?I=(My(f,d)?-C:C)/L:C=(My(f,d)?-I:I)*L:m?(I=C/L,d=f):(C=I*L,f=d));const q=f?E+C:E,J=d?_+I:_;return{width:A+(f?-C:C),height:M+(d?-I:I),x:l[0]*C*(f?-1:1)+q,y:l[1]*I*(d?-1:1)+J}}const Jw={width:0,height:0,x:0,y:0},JC={...Jw,pointerX:0,pointerY:0,aspectRatio:1};function ZC(e,t,n){const i=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,a=e.measured.height??0,c=n[0]*l,f=n[1]*a;return[[i-c,s-f],[i+l-c,s+a-f]]}function e2({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:s}){const l=Vt(e);let a={controlDirection:Ay("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:h,resizeDirection:g,onResizeStart:v,onResize:S,onResizeEnd:w,shouldResize:b}){let k={...Jw},N={...JC};a={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:Ay(d)};let E,_=null,A=[],M,L,C,I=!1;const F=aw().on("start",R=>{const{nodeLookup:$,transform:Z,snapGrid:j,snapToGrid:G,nodeOrigin:q,paneDomNode:J}=n();if(E=$.get(t),!E)return;_=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:U}=Ns(R.sourceEvent,{transform:Z,snapGrid:j,snapToGrid:G,containerBounds:_});k={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},N={...k,pointerX:Y,pointerY:U,aspectRatio:k.width/k.height},M=void 0,L=ai(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(M=$.get(E.parentId)),M&&E.extent==="parent"&&(L=[[0,0],[M.measured.width,M.measured.height]]),A=[],C=void 0;for(const[B,D]of $)if(D.parentId===t&&(A.push({id:B,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const W=ZC(D,E,D.origin??q);C?C=[[Math.min(W[0][0],C[0][0]),Math.min(W[0][1],C[0][1])],[Math.max(W[1][0],C[1][0]),Math.max(W[1][1],C[1][1])]]:C=W}v==null||v(R,{...k})}).on("drag",R=>{const{transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G}=n(),q=Ns(R.sourceEvent,{transform:$,snapGrid:Z,snapToGrid:j,containerBounds:_}),J=[];if(!E)return;const{x:Y,y:U,width:B,height:D}=k,W={},V=E.origin??G,{width:K,height:Q,x:re,y:se}=QC(N,a.controlDirection,q,a.boundaries,a.keepAspectRatio,V,L,C),ee=K!==B,oe=Q!==D,de=re!==Y&&ee,xe=se!==U&&oe;if(!de&&!xe&&!ee&&!oe)return;if((de||xe||V[0]===1||V[1]===1)&&(W.x=de?re:k.x,W.y=xe?se:k.y,k.x=W.x,k.y=W.y,A.length>0)){const Ie=re-Y,Ae=se-U;for(const ze of A)ze.position={x:ze.position.x-Ie+V[0]*(K-B),y:ze.position.y-Ae+V[1]*(Q-D)},J.push(ze)}if((ee||oe)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:k.width,W.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:k.height,k.width=W.width,k.height=W.height),M&&E.expandParent){const Ie=V[0]*(W.width??0);W.x&&W.x<Ie&&(k.x=Ie,N.x=N.x-(W.x-Ie));const Ae=V[1]*(W.height??0);W.y&&W.y<Ae&&(k.y=Ae,N.y=N.y-(W.y-Ae))}const he=XC({width:k.width,prevWidth:B,height:k.height,prevHeight:D,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),fe={...k,direction:he};(b==null?void 0:b(R,fe))!==!1&&(I=!0,S==null||S(R,fe),i(W,J))}).on("end",R=>{I&&(w==null||w(R,{...k}),s==null||s({...k}),I=!1)});l.call(F)}function f(){l.on(".drag",null)}return{update:c,destroy:f}}var Uf={exports:{}},Hf={},qf={exports:{}},Yf={};/**
|
|
41
41
|
* @license React
|
|
42
42
|
* use-sync-external-store-shim.production.js
|
|
43
43
|
*
|
|
@@ -45,7 +45,7 @@ Error generating stack: `+x.message+`
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var Ly;function
|
|
48
|
+
*/var Ly;function t2(){if(Ly)return Yf;Ly=1;var e=zs();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,a=e.useDebugValue;function c(h,g){var v=g(),S=i({inst:{value:v,getSnapshot:g}}),w=S[0].inst,b=S[1];return l(function(){w.value=v,w.getSnapshot=g,f(w)&&b({inst:w})},[h,v,g]),s(function(){return f(w)&&b({inst:w}),h(function(){f(w)&&b({inst:w})})},[h]),a(v),v}function f(h){var g=h.getSnapshot;h=h.value;try{var v=g();return!n(h,v)}catch{return!0}}function d(h,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Yf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Yf}var Ry;function n2(){return Ry||(Ry=1,qf.exports=t2()),qf.exports}/**
|
|
49
49
|
* @license React
|
|
50
50
|
* use-sync-external-store-shim/with-selector.production.js
|
|
51
51
|
*
|
|
@@ -53,14 +53,14 @@ Error generating stack: `+x.message+`
|
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the MIT license found in the
|
|
55
55
|
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var Dy;function
|
|
56
|
+
*/var Dy;function r2(){if(Dy)return Hf;Dy=1;var e=zs(),t=n2();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,a=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Hf.useSyncExternalStoreWithSelector=function(d,m,h,g,v){var S=l(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=c(function(){function k(M){if(!N){if(N=!0,E=M,M=g(M),v!==void 0&&w.hasValue){var L=w.value;if(v(L,M))return _=L}return _=M}if(L=_,i(E,M))return L;var C=g(M);return v!==void 0&&v(L,C)?(E=M,L):(E=M,_=C)}var N=!1,E,_,A=h===void 0?null:h;return[function(){return k(m())},A===null?void 0:function(){return k(A())}]},[m,h,g,v]);var b=s(d,S[0],S[1]);return a(function(){w.hasValue=!0,w.value=b},[b]),f(b),b},Hf}var jy;function i2(){return jy||(jy=1,Uf.exports=r2()),Uf.exports}var o2=i2();const s2=du(o2),l2={},$y=e=>{let t;const n=new Set,i=(m,h)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(S=>S(t,v))}},s=()=>t,f={setState:i,getState:s,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(l2?"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(i,s,f);return f},a2=e=>e?$y(e):$y,{useDebugValue:u2}=Ph,{useSyncExternalStoreWithSelector:c2}=s2,f2=e=>e;function Zw(e,t=f2,n){const i=c2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return u2(i),i}const zy=(e,t)=>{const n=a2(e),i=(s,l=t)=>Zw(n,s,l);return Object.assign(i,n),i},d2=(e,t)=>e?zy(e,t):zy;function Ue(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[i,s]of e)if(!Object.is(s,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}var e1=Yv();const bu=O.createContext(null),h2=bu.Provider,t1=gn.error001("react");function Me(e,t){const n=O.useContext(bu);if(n===null)throw new Error(t1);return Zw(n,e,t)}function He(){const e=O.useContext(bu);if(e===null)throw new Error(t1);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Fy={display:"none"},p2={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},n1="react-flow__node-desc",r1="react-flow__edge-desc",m2="react-flow__aria-live",g2=e=>e.ariaLiveMessage,y2=e=>e.ariaLabelConfig;function v2({rfId:e}){const t=Me(g2);return P.jsx("div",{id:`${m2}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:p2,children:t})}function w2({rfId:e,disableKeyboardA11y:t}){const n=Me(y2);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${n1}-${e}`,style:Fy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${r1}-${e}`,style:Fy,children:n["edge.a11yDescription.default"]}),!t&&P.jsx(v2,{rfId:e})]})}const Su=O.forwardRef(({position:e="top-left",children:t,className:n,style:i,...s},l)=>{const a=`${e}`.split("-");return P.jsx("div",{className:nt(["react-flow__panel",n,...a]),style:i,ref:l,...s,children:t})});Su.displayName="Panel";function x2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:P.jsx(Su,{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:P.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const b2=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},ba=e=>e.id;function S2(e,t){return Ue(e.selectedNodes.map(ba),t.selectedNodes.map(ba))&&Ue(e.selectedEdges.map(ba),t.selectedEdges.map(ba))}function k2({onSelectionChange:e}){const t=He(),{selectedNodes:n,selectedEdges:i}=Me(b2,S2);return O.useEffect(()=>{const s={nodes:n,edges:i};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[n,i,e]),null}const E2=e=>!!e.onSelectionChangeHandlers;function N2({onSelectionChange:e}){const t=Me(E2);return e||t?P.jsx(k2,{onSelectionChange:e}):null}const i1=[0,0],_2={x:0,y:0,zoom:1},C2=["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"],By=[...C2,"rfId"],T2=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}),Vy={translateExtent:As,nodeOrigin:i1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function O2(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:f}=Me(T2,Ue),d=He();O.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=Vy,c()}),[]);const m=O.useRef(Vy);return O.useEffect(()=>{for(const h of By){const g=e[h],v=m.current[h];g!==v&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?i(g):h==="maxZoom"?s(g):h==="translateExtent"?l(g):h==="nodeExtent"?a(g):h==="ariaLabelConfig"?d.setState({ariaLabelConfig:hC(g)}):h==="fitView"?d.setState({fitViewQueued:g}):h==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[h]:g})))}m.current=e},By.map(h=>e[h])),null}function Wy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function P2(e){var i;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const s=Wy(),l=()=>n(s!=null&&s.matches?"dark":"light");return l(),s==null||s.addEventListener("change",l),()=>{s==null||s.removeEventListener("change",l)}},[e]),t!==null?t:(i=Wy())!=null&&i.matches?"dark":"light"}const Uy=typeof document<"u"?document:null;function Ds(e=null,t={target:Uy,actInsideInputWithModifier:!0}){const[n,i]=O.useState(!1),s=O.useRef(!1),l=O.useRef(new Set([])),[a,c]=O.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
|
|
57
57
|
`).replace(`
|
|
58
58
|
|
|
59
59
|
`,`
|
|
60
60
|
+`).split(`
|
|
61
|
-
`)),m=d.reduce((h,g)=>h.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return O.useEffect(()=>{const f=(t==null?void 0:t.target)??Uy,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var b,k;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&Rw(v))return!1;const w=qy(v.code,c);if(l.current.add(v[w]),Hy(a,l.current,!1)){const _=((k=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:k[0])||v.target,E=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(s.current||!E)&&v.preventDefault(),i(!0)}},h=v=>{const S=qy(v.code,c);Hy(a,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(v[S]),v.key==="Meta"&&l.current.clear(),s.current=!1},g=()=>{l.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,i]),n}function Hy(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(s=>t.has(s)))}function qy(e,t){return t.includes(e)?"code":"key"}const P2=()=>{const e=He();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,s,l],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??s,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:s,minZoom:l,maxZoom:a,panZoom:c}=e.getState(),f=Vh(t,i,s,l,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:s,snapToGrid:l,domNode:a}=e.getState();if(!a)return t;const{x:c,y:f}=a.getBoundingClientRect(),d={x:t.x-c,y:t.y-f},m=n.snapGrid??s,h=n.snapToGrid??l;return yo(d,i,h,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:s,y:l}=i.getBoundingClientRect(),a=uo(t,n);return{x:a.x+s,y:a.y+l}}}),[])};function i1(e,t){const n=[],i=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")i.set(l.id,[l]);else{const a=i.get(l.id);a?a.push(l):i.set(l.id,[l])}for(const l of t){const a=i.get(l.id);if(!a){n.push(l);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...l};for(const f of a)I2(f,c);n.push(c)}return s.length&&s.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function I2(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 A2(e,t){return i1(e,t)}function M2(e,t){return i1(e,t)}function Jr(e,t){return{id:e,type:"select",selected:t}}function Gi(e,t=new Set,n=!1){const i=[];for(const[s,l]of e){const a=t.has(s);!(l.selected===void 0&&!a)&&l.selected!==a&&(n&&(l.selected=a),i.push(Jr(l.id,a)))}return i}function Yy({items:e=[],lookup:t}){var s;const n=[],i=new Map(e.map(l=>[l.id,l]));for(const[l,a]of e.entries()){const c=t.get(a.id),f=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;f!==void 0&&f!==a&&n.push({id:a.id,item:a,type:"replace"}),f===void 0&&n.push({item:a,type:"add",index:l})}for(const[l]of t)i.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function Ky(e){return{id:e.id,type:"remove"}}const L2=Iw();function R2(e,t,n={}){return vC(e,t,{...n,onError:n.onError??L2})}const Gy=e=>rC(e),D2=e=>Cw(e);function o1(e){return O.forwardRef(e)}const j2=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Xy(e){const[t,n]=O.useState(BigInt(0)),[i]=O.useState(()=>$2(()=>n(s=>s+BigInt(1))));return j2(()=>{const s=i.get();s.length&&(e(s),i.reset())},[t]),i}function $2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const s1=O.createContext(null);function z2({children:e}){const t=He(),n=O.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:m,onNodesChange:h,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=t.getState();let w=f;for(const k of c)w=typeof k=="function"?k(w):k;let b=Yy({items:w,lookup:g});for(const k of S.values())b=k(b);m&&d(w),b.length>0?h==null||h(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:_,setNodes:E}=t.getState();k&&E(_)})},[]),i=Xy(n),s=O.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:h,edgeLookup:g}=t.getState();let v=f;for(const S of c)v=typeof S=="function"?S(v):S;m?d(v):h&&h(Yy({items:v,lookup:g}))},[]),l=Xy(s),a=O.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return P.jsx(s1.Provider,{value:a,children:e})}function F2(){const e=O.useContext(s1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const B2=e=>!!e.panZoom;function Gh(){const e=P2(),t=He(),n=F2(),i=Me(B2),s=O.useMemo(()=>{const l=h=>t.getState().nodeLookup.get(h),a=h=>{n.nodeQueue.push(h)},c=h=>{n.edgeQueue.push(h)},f=h=>{var k,_;const{nodeLookup:g,nodeOrigin:v}=t.getState(),S=Gy(h)?h:g.get(h.id),w=S.parentId?Mw(S.position,S.measured,S.parentId,g,v):S.position,b={...S,position:w,width:((k=S.measured)==null?void 0:k.width)??S.width,height:((_=S.measured)==null?void 0:_.height)??S.height};return ao(b)},d=(h,g,v={replace:!1})=>{a(S=>S.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&Gy(b)?b:{...w,...b}}return w}))},m=(h,g,v={replace:!1})=>{c(S=>S.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&D2(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=l(h))==null?void 0:g.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:a,setEdges:c,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(v=>[...v,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:v}=t.getState(),[S,w,b]=v;return{nodes:h.map(k=>({...k})),edges:g.map(k=>({...k})),viewport:{x:S,y:w,zoom:b}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:v,edges:S,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:k,triggerEdgeChanges:_,onDelete:E,onBeforeDelete:N}=t.getState(),{nodes:I,edges:M}=await aC({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:S,onBeforeDelete:N}),R=M.length>0,C=I.length>0;if(R){const A=M.map(Ky);b==null||b(M),_(A)}if(C){const A=I.map(Ky);w==null||w(I),k(A)}return(C||R)&&(E==null||E({nodes:I,edges:M})),{deletedNodes:I,deletedEdges:M}},getIntersectingNodes:(h,g=!0,v)=>{const S=by(h),w=S?h:f(h),b=v!==void 0;return w?(v||t.getState().nodes).filter(k=>{const _=t.getState().nodeLookup.get(k.id);if(_&&!S&&(k.id===h.id||!_.internals.positionAbsolute))return!1;const E=ao(b?k:_),N=Ls(E,w);return g&&N>0||N>=E.width*E.height||N>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=by(h)?h:f(h);if(!w)return!1;const b=Ls(w,g);return v&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:d,updateNodeData:(h,g,v={replace:!1})=>{d(h,S=>{const w=typeof g=="function"?g(S):g;return v.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},v)},updateEdge:m,updateEdgeData:(h,g,v={replace:!1})=>{m(h,S=>{const w=typeof g=="function"?g(S):g;return v.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},v)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return iC(h,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:h,id:g,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}-${h}${g?`-${g}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:S.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??fC();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return O.useMemo(()=>({...s,...e,viewportInitialized:i}),[i])}const Qy=e=>e.selected,V2=typeof window<"u"?window:void 0;function W2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=He(),{deleteElements:i}=Gh(),s=Ds(e,{actInsideInputWithModifier:!1}),l=Ds(t,{target:V2});O.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();i({nodes:c.filter(Qy),edges:a.filter(Qy)}),n.setState({nodesSelectionActive:!1})}},[s]),O.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function U2(e){const t=He();O.useEffect(()=>{const n=()=>{var s,l,a,c;if(!e.current||!(((l=(s=e.current).checkVisibility)==null?void 0:l.call(s))??!0))return!1;const i=Wh(e.current);(i.height===0||i.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",gn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const ku={position:"absolute",width:"100%",height:"100%",top:0,left:0},H2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function q2({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=ii.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:d,minZoom:m,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:v=!0,children:S,noWheelClassName:w,noPanClassName:b,onViewportChange:k,isControlledViewport:_,paneClickDistance:E,selectionOnDrag:N}){const I=He(),M=O.useRef(null),{userSelectionActive:R,lib:C,connectionInProgress:A}=Me(H2,Ue),F=Ds(g),L=O.useRef();U2(M);const $=O.useCallback(Z=>{k==null||k({x:Z[0],y:Z[1],zoom:Z[2]}),_||I.setState({transform:Z})},[k,_]);return O.useEffect(()=>{if(M.current){L.current=KC({domNode:M.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:f,onDraggingChange:q=>I.setState(J=>J.paneDragging===q?J:{paneDragging:q}),onPanZoomStart:(q,J)=>{const{onViewportChangeStart:Y,onMoveStart:U}=I.getState();U==null||U(q,J),Y==null||Y(J)},onPanZoom:(q,J)=>{const{onViewportChange:Y,onMove:U}=I.getState();U==null||U(q,J),Y==null||Y(J)},onPanZoomEnd:(q,J)=>{const{onViewportChangeEnd:Y,onMoveEnd:U}=I.getState();U==null||U(q,J),Y==null||Y(J)}});const{x:Z,y:j,zoom:G}=L.current.getViewport();return I.setState({panZoom:L.current,transform:[Z,j,G],domNode:M.current.closest(".react-flow")}),()=>{var q;(q=L.current)==null||q.destroy()}}},[]),O.useEffect(()=>{var Z;(Z=L.current)==null||Z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:F,preventScrolling:v,noPanClassName:b,userSelectionActive:R,noWheelClassName:w,lib:C,onTransformChange:$,connectionInProgress:A,selectionOnDrag:N,paneClickDistance:E})},[e,t,n,i,s,l,a,c,F,v,b,R,w,C,$,A,N,E]),P.jsx("div",{className:"react-flow__renderer",ref:M,style:ku,children:S})}const Y2=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function K2(){const{userSelectionActive:e,userSelectionRect:t}=Me(Y2,Ue);return e&&t?P.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 Kf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},G2=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function X2({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ms.Full,panOnDrag:i,autoPanOnSelection:s,paneClickDistance:l,selectionOnDrag:a,onSelectionStart:c,onSelectionEnd:f,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:h,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:S,children:w}){const b=O.useRef(0),k=He(),{userSelectionActive:_,elementsSelectable:E,dragging:N,connectionInProgress:I,panBy:M,autoPanSpeed:R}=Me(G2,Ue),C=E&&(e||_),A=O.useRef(null),F=O.useRef(),L=O.useRef(new Set),$=O.useRef(new Set),Z=O.useRef(!1),j=O.useRef({x:0,y:0}),G=O.useRef(!1),q=ee=>{if(Z.current||I){Z.current=!1;return}d==null||d(ee),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},J=ee=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){ee.preventDefault();return}m==null||m(ee)},Y=h?ee=>h(ee):void 0,U=ee=>{Z.current&&(ee.stopPropagation(),Z.current=!1)},B=ee=>{var ze,wt;const{domNode:oe,transform:de}=k.getState();if(F.current=oe==null?void 0:oe.getBoundingClientRect(),!F.current)return;const xe=ee.target===A.current;if(!xe&&!!ee.target.closest(".nokey")||!e||!(a&&xe||t)||ee.button!==0||!ee.isPrimary)return;(wt=(ze=ee.target)==null?void 0:ze.setPointerCapture)==null||wt.call(ze,ee.pointerId),Z.current=!1;const{x:ke,y:Ie}=mn(ee.nativeEvent,F.current),Ae=yo({x:ke,y:Ie},de);k.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:ke,y:Ie}}),xe||(ee.stopPropagation(),ee.preventDefault())};function D(ee,oe){const{userSelectionRect:de}=k.getState();if(!de)return;const{transform:xe,nodeLookup:he,edgeLookup:fe,connectionLookup:ke,triggerNodeChanges:Ie,triggerEdgeChanges:Ae,defaultEdgeOptions:ze}=k.getState(),wt={x:de.startX,y:de.startY},{x:_t,y:ht}=uo(wt,xe),pt={startX:wt.x,startY:wt.y,x:ee<_t?ee:_t,y:oe<ht?oe:ht,width:Math.abs(ee-_t),height:Math.abs(oe-ht)},Dn=L.current,bn=$.current;L.current=new Set(Fh(he,pt,xe,n===Ms.Partial,!0).map(Nt=>Nt.id)),$.current=new Set;const Sn=(ze==null?void 0:ze.selectable)??!0;for(const Nt of L.current){const Ht=ke.get(Nt);if(Ht)for(const{edgeId:Rt}of Ht.values()){const qt=fe.get(Rt);qt&&(qt.selectable??Sn)&&$.current.add(Rt)}}if(!Sy(Dn,L.current)){const Nt=Gi(he,L.current,!0);Ie(Nt)}if(!Sy(bn,$.current)){const Nt=Gi(fe,$.current);Ae(Nt)}k.setState({userSelectionRect:pt,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!F.current)return;const[ee,oe]=Bh(j.current,F.current,R);M({x:ee,y:oe}).then(de=>{if(!Z.current||!de){b.current=requestAnimationFrame(W);return}const{x:xe,y:he}=j.current;D(xe,he),b.current=requestAnimationFrame(W)})}const V=()=>{cancelAnimationFrame(b.current),b.current=0,G.current=!1};O.useEffect(()=>()=>V(),[]);const K=ee=>{const{userSelectionRect:oe,transform:de,resetSelectedElements:xe}=k.getState();if(!F.current||!oe)return;const{x:he,y:fe}=mn(ee.nativeEvent,F.current);j.current={x:he,y:fe};const ke=uo({x:oe.startX,y:oe.startY},de);if(!Z.current){const Ie=t?0:l;if(Math.hypot(he-ke.x,fe-ke.y)<=Ie)return;xe(),c==null||c(ee)}Z.current=!0,G.current||(W(),G.current=!0),D(he,fe)},Q=ee=>{var oe,de;ee.button===0&&((de=(oe=ee.target)==null?void 0:oe.releasePointerCapture)==null||de.call(oe,ee.pointerId),!_&&ee.target===A.current&&k.getState().userSelectionRect&&(q==null||q(ee)),k.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f==null||f(ee),k.setState({nodesSelectionActive:L.current.size>0})),V())},re=ee=>{var oe,de;(de=(oe=ee.target)==null?void 0:oe.releasePointerCapture)==null||de.call(oe,ee.pointerId),V()},se=i===!0||Array.isArray(i)&&i.includes(0);return P.jsxs("div",{className:nt(["react-flow__pane",{draggable:se,dragging:N,selection:e}]),onClick:C?void 0:Kf(q,A),onContextMenu:Kf(J,A),onWheel:Kf(Y,A),onPointerEnter:C?void 0:g,onPointerMove:C?K:v,onPointerUp:C?Q:void 0,onPointerCancel:C?re:void 0,onPointerDownCapture:C?B:void 0,onClickCapture:C?U:void 0,onPointerLeave:S,ref:A,style:ku,children:[w,P.jsx(K2,{})]})}function wh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:a,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f==null||f("012",gn.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):s([e])}function l1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:s,isSelectable:l,nodeClickDistance:a}){const c=He(),[f,d]=O.useState(!1),m=O.useRef();return O.useEffect(()=>{m.current=LC({getStoreItems:()=>c.getState(),onNodeMouseDown:h=>{wh({id:h,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:a}),()=>{var h;(h=m.current)==null||h.destroy()}},[n,i,t,l,e,s,a]),f}const Q2=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function a1(){const e=He();return O.useCallback(n=>{const{nodeExtent:i,snapToGrid:s,snapGrid:l,nodesDraggable:a,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:m}=e.getState(),h=new Map,g=Q2(a),v=s?l[0]:5,S=s?l[1]:5,w=n.direction.x*v*n.factor,b=n.direction.y*S*n.factor;for(const[,k]of d){if(!g(k))continue;let _={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+b};s&&(_=Us(_,l));const{position:E,positionAbsolute:N}=Tw({nodeId:k.id,nextPosition:_,nodeLookup:d,nodeExtent:i,nodeOrigin:m,onError:c});k.position=E,k.internals.positionAbsolute=N,h.set(k.id,k)}f(h)},[])}const Xh=O.createContext(null),J2=Xh.Provider;Xh.Consumer;const u1=()=>O.useContext(Xh),Z2=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),eT=(e,t,n)=>i=>{const{connectionClickStartHandle:s,connectionMode:l,connection:a}=i,{fromHandle:c,toHandle:f,isValid:d}=a,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.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:l===so.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 tT({type:e="source",position:t=Se.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:a,onConnect:c,children:f,className:d,onMouseDown:m,onTouchStart:h,...g},v){var G,q;const S=a||null,w=e==="target",b=He(),k=u1(),{connectOnClick:_,noPanClassName:E,rfId:N}=Me(Z2,Ue),{connectingFrom:I,connectingTo:M,clickConnecting:R,isPossibleEndHandle:C,connectionInProcess:A,clickConnectionInProcess:F,valid:L}=Me(eT(k,S,e),Ue);k||(q=(G=b.getState()).onError)==null||q.call(G,"010",gn.error010());const $=J=>{const{defaultEdgeOptions:Y,onConnect:U,hasDefaultEdges:B}=b.getState(),D={...Y,...J};if(B){const{edges:W,setEdges:V,onError:K}=b.getState();V(R2(D,W,{onError:K}))}U==null||U(D),c==null||c(D)},Z=J=>{if(!k)return;const Y=Dw(J.nativeEvent);if(s&&(Y&&J.button===0||!Y)){const U=b.getState();vh.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:w,handleId:S,nodeId:k,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...B)=>{var D,W;return(W=(D=b.getState()).onConnectEnd)==null?void 0:W.call(D,...B)},updateConnection:U.updateConnection,onConnect:$,isValidConnection:n||((...B)=>{var D,W;return((W=(D=b.getState()).isValidConnection)==null?void 0:W.call(D,...B))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}Y?m==null||m(J):h==null||h(J)},j=J=>{const{onClickConnectStart:Y,onClickConnectEnd:U,connectionClickStartHandle:B,connectionMode:D,isValidConnection:W,lib:V,rfId:K,nodeLookup:Q,connection:re}=b.getState();if(!k||!B&&!s)return;if(!B){Y==null||Y(J.nativeEvent,{nodeId:k,handleId:S,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:k,type:e,id:S}});return}const se=Lw(J.target),ee=n||W,{connection:oe,isValid:de}=vh.isValid(J.nativeEvent,{handle:{nodeId:k,id:S,type:e},connectionMode:D,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ee,flowId:K,doc:se,lib:V,nodeLookup:Q});de&&oe&&$(oe);const xe=structuredClone(re);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,U==null||U(J,xe),b.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":t,"data-id":`${N}-${k}-${S}-${e}`,className:nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,d,{source:!w,target:w,connectable:i,connectablestart:s,connectableend:l,clickconnecting:R,connectingfrom:I,connectingto:M,valid:L,connectionindicator:i&&(!A||C)&&(A||F?l:s)}]),onMouseDown:Z,onTouchStart:Z,onClick:_?j:void 0,ref:v,...g,children:f})}const Tr=O.memo(o1(tT));function nT({data:e,isConnectable:t,sourcePosition:n=Se.Bottom}){return P.jsxs(P.Fragment,{children:[e==null?void 0:e.label,P.jsx(Tr,{type:"source",position:n,isConnectable:t})]})}function rT({data:e,isConnectable:t,targetPosition:n=Se.Top,sourcePosition:i=Se.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,P.jsx(Tr,{type:"source",position:i,isConnectable:t})]})}function iT(){return null}function oT({data:e,isConnectable:t,targetPosition:n=Se.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ru={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Jy={input:nT,default:rT,output:oT,group:iT};function sT(e){var t,n,i,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??((i=e.style)==null?void 0:i.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const lT=e=>{const{width:t,height:n,x:i,y:s}=Ws(e.nodeLookup,{filter:l=>!!l.selected});return{width:pn(t)?t:null,height:pn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${s}px)`}};function aT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=He(),{width:s,height:l,transformString:a,userSelectionActive:c}=Me(lT,Ue),f=a1(),d=O.useRef(null);O.useEffect(()=>{var v;n||(v=d.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&s!==null&&l!==null;if(l1({nodeRef:d,disabled:!m}),!m)return null;const h=e?v=>{const S=i.getState().nodes.filter(w=>w.selected);e(v,S)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(ru,v.key)&&(v.preventDefault(),f({direction:ru[v.key],factor:v.shiftKey?4:1}))};return P.jsx("div",{className:nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:P.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:l}})})}const Zy=typeof window<"u"?window:void 0,uT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function c1({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:m,selectionMode:h,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:k,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:N,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:C,autoPanOnSelection:A,defaultViewport:F,translateExtent:L,minZoom:$,maxZoom:Z,preventScrolling:j,onSelectionContextMenu:G,noWheelClassName:q,noPanClassName:J,disableKeyboardA11y:Y,onViewportChange:U,isControlledViewport:B}){const{nodesSelectionActive:D,userSelectionActive:W}=Me(uT,Ue),V=Ds(d,{target:Zy}),K=Ds(w,{target:Zy}),Q=K||C,re=K||N,se=m&&Q!==!0,ee=V||W||se;return W2({deleteKeyCode:f,multiSelectionKeyCode:S}),P.jsx(q2,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:!V&&Q,defaultViewport:F,translateExtent:L,minZoom:$,maxZoom:Z,zoomActivationKeyCode:b,preventScrolling:j,noWheelClassName:q,noPanClassName:J,onViewportChange:U,isControlledViewport:B,paneClickDistance:c,selectionOnDrag:se,children:P.jsxs(X2,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:A,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:V,paneClickDistance:c,selectionOnDrag:se,children:[e,D&&P.jsx(aT,{onSelectionContextMenu:G,noPanClassName:J,disableKeyboardA11y:Y})]})})}c1.displayName="FlowRenderer";const cT=O.memo(c1),fT=e=>t=>e?Fh(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 dT(e){return Me(O.useCallback(fT(e),[e]),Ue)}const hT=e=>e.updateNodeInternals;function pT(){const e=Me(hT),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(s=>{const l=s.target.getAttribute("data-id");i.set(l,{id:l,nodeElement:s.target,force:!0})}),e(i)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function mT({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const s=He(),l=O.useRef(null),a=O.useRef(null),c=O.useRef(e.sourcePosition),f=O.useRef(e.targetPosition),d=O.useRef(t),m=n&&!!e.internals.handleBounds;return O.useEffect(()=>{l.current&&!e.hidden&&(!m||a.current!==l.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(l.current),a.current=l.current)},[m,e.hidden]),O.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),O.useEffect(()=>{if(l.current){const h=d.current!==t,g=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(h||g||v)&&(d.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function gT({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:s,onContextMenu:l,onDoubleClick:a,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:m,resizeObserver:h,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:S,rfId:w,nodeTypes:b,nodeClickDistance:k,onError:_}){const{node:E,internals:N,isParent:I}=Me(ee=>{const oe=ee.nodeLookup.get(e),de=ee.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:de}},Ue);let M=E.type||"default",R=(b==null?void 0:b[M])||Jy[M];R===void 0&&(_==null||_("003",gn.error003(M)),M="default",R=(b==null?void 0:b.default)||Jy.default);const C=!!(E.draggable||c&&typeof E.draggable>"u"),A=!!(E.selectable||f&&typeof E.selectable>"u"),F=!!(E.connectable||d&&typeof E.connectable>"u"),L=!!(E.focusable||m&&typeof E.focusable>"u"),$=He(),Z=Aw(E),j=mT({node:E,nodeType:M,hasDimensions:Z,resizeObserver:h}),G=l1({nodeRef:j,disabled:E.hidden||!C,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:k}),q=a1();if(E.hidden)return null;const J=er(E),Y=sT(E),U=A||C||t||n||i||s,B=n?ee=>n(ee,{...N.userNode}):void 0,D=i?ee=>i(ee,{...N.userNode}):void 0,W=s?ee=>s(ee,{...N.userNode}):void 0,V=l?ee=>l(ee,{...N.userNode}):void 0,K=a?ee=>a(ee,{...N.userNode}):void 0,Q=ee=>{const{selectNodesOnDrag:oe,nodeDragThreshold:de}=$.getState();A&&(!oe||!C||de>0)&&wh({id:e,store:$,nodeRef:j}),t&&t(ee,{...N.userNode})},re=ee=>{if(!(Rw(ee.nativeEvent)||S)){if(kw.includes(ee.key)&&A){const oe=ee.key==="Escape";wh({id:e,store:$,unselect:oe,nodeRef:j})}else if(C&&E.selected&&Object.prototype.hasOwnProperty.call(ru,ee.key)){ee.preventDefault();const{ariaLabelConfig:oe}=$.getState();$.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),q({direction:ru[ee.key],factor:ee.shiftKey?4:1})}}},se=()=>{var ke;if(S||!((ke=j.current)!=null&&ke.matches(":focus-visible")))return;const{transform:ee,width:oe,height:de,autoPanOnNodeFocus:xe,setCenter:he}=$.getState();if(!xe)return;Fh(new Map([[e,E]]),{x:0,y:0,width:oe,height:de},ee,!0).length>0||he(E.position.x+J.width/2,E.position.y+J.height/2,{zoom:ee[2]})};return P.jsx("div",{className:nt(["react-flow__node",`react-flow__node-${M}`,{[v]:C},E.className,{selected:E.selected,selectable:A,parent:I,draggable:C,dragging:G}]),ref:j,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:Z?"visible":"hidden",...E.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:D,onMouseLeave:W,onContextMenu:V,onClick:Q,onDoubleClick:K,onKeyDown:L?re:void 0,tabIndex:L?0:void 0,onFocus:L?se:void 0,role:E.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${t1}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:P.jsx(J2,{value:e,children:P.jsx(R,{id:e,data:E.data,type:M,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:E.selected??!1,selectable:A,draggable:C,deletable:E.deletable??!0,isConnectable:F,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:N.z,parentId:E.parentId,...J})})})}var yT=O.memo(gT);const vT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function f1(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:s,onError:l}=Me(vT,Ue),a=dT(e.onlyRenderVisibleElements),c=pT();return P.jsx("div",{className:"react-flow__nodes",style:ku,children:a.map(f=>P.jsx(yT,{id:f,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:i,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}f1.displayName="NodeRenderer";const wT=O.memo(f1);function xT(e){return Me(O.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const i=[];if(n.width&&n.height)for(const s of n.edges){const l=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);l&&a&&mC({sourceNode:l,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(s.id)}return i},[e]),Ue)}const bT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return P.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ST=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return P.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},e0={[tu.Arrow]:bT,[tu.ArrowClosed]:ST};function kT(e){const t=He();return O.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(e0,e)?e0[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",gn.error009(e)),null)},[e])}const ET=({id:e,type:t,color:n,width:i=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const f=kT(t);return f?P.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:P.jsx(f,{color:n,strokeWidth:a})}):null},d1=({defaultColor:e,rfId:t})=>{const n=Me(l=>l.edges),i=Me(l=>l.defaultEdgeOptions),s=O.useMemo(()=>kC(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return s.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:s.map(l=>P.jsx(ET,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};d1.displayName="MarkerDefinitions";var _T=O.memo(d1);function h1({x:e,y:t,label:n,labelStyle:i,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...m}){const[h,g]=O.useState({x:1,y:0,width:0,height:0}),v=nt(["react-flow__edge-textwrapper",d]),S=O.useRef(null);return O.useEffect(()=>{if(S.current){const w=S.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?P.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...m,children:[s&&P.jsx("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),P.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:S,style:i,children:n}),f]}):null}h1.displayName="EdgeText";const NT=O.memo(h1);function Eu({path:e,labelX:t,labelY:n,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...m}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...m,d:e,fill:"none",className:nt(["react-flow__edge-path",m.className])}),d?P.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?P.jsx(NT,{x:t,y:n,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function t0({pos:e,x1:t,y1:n,x2:i,y2:s}){return e===Se.Left||e===Se.Right?[.5*(t+i),n]:[t,.5*(n+s)]}function p1({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top}){const[a,c]=t0({pos:n,x1:e,y1:t,x2:i,y2:s}),[f,d]=t0({pos:l,x1:i,y1:s,x2:e,y2:t}),[m,h,g,v]=jw({sourceX:e,sourceY:t,targetX:i,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${a},${c} ${f},${d} ${i},${s}`,m,h,g,v]}function m1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,sourcePosition:a,targetPosition:c,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:k})=>{const[_,E,N]=p1({sourceX:n,sourceY:i,sourcePosition:a,targetX:s,targetY:l,targetPosition:c}),I=e.isInternal?void 0:t;return P.jsx(Eu,{id:I,path:_,labelX:E,labelY:N,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:k})})}const CT=m1({isInternal:!1}),g1=m1({isInternal:!0});CT.displayName="SimpleBezierEdge";g1.displayName="SimpleBezierEdgeInternal";function y1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Se.Bottom,targetPosition:S=Se.Top,markerEnd:w,markerStart:b,pathOptions:k,interactionWidth:_})=>{const[E,N,I]=mh({sourceX:n,sourceY:i,sourcePosition:v,targetX:s,targetY:l,targetPosition:S,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),M=e.isInternal?void 0:t;return P.jsx(Eu,{id:M,path:E,labelX:N,labelY:I,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:b,interactionWidth:_})})}const v1=y1({isInternal:!1}),w1=y1({isInternal:!0});v1.displayName="SmoothStepEdge";w1.displayName="SmoothStepEdgeInternal";function x1(e){return O.memo(({id:t,...n})=>{var s;const i=e.isInternal?void 0:t;return P.jsx(v1,{...n,id:i,pathOptions:O.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const TT=x1({isInternal:!1}),b1=x1({isInternal:!0});TT.displayName="StepEdge";b1.displayName="StepEdgeInternal";function S1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:S,interactionWidth:w})=>{const[b,k,_]=Fw({sourceX:n,sourceY:i,targetX:s,targetY:l}),E=e.isInternal?void 0:t;return P.jsx(Eu,{id:E,path:b,labelX:k,labelY:_,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:S,interactionWidth:w})})}const OT=S1({isInternal:!1}),k1=S1({isInternal:!0});OT.displayName="StraightEdge";k1.displayName="StraightEdgeInternal";function E1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,sourcePosition:a=Se.Bottom,targetPosition:c=Se.Top,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,pathOptions:k,interactionWidth:_})=>{const[E,N,I]=$w({sourceX:n,sourceY:i,sourcePosition:a,targetX:s,targetY:l,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return P.jsx(Eu,{id:M,path:E,labelX:N,labelY:I,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:_})})}const PT=E1({isInternal:!1}),_1=E1({isInternal:!0});PT.displayName="BezierEdge";_1.displayName="BezierEdgeInternal";const n0={default:_1,straight:k1,step:b1,smoothstep:w1,simplebezier:g1},r0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},IT=(e,t,n)=>n===Se.Left?e-t:n===Se.Right?e+t:e,AT=(e,t,n)=>n===Se.Top?e-t:n===Se.Bottom?e+t:e,i0="react-flow__edgeupdater";function o0({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:s,onMouseEnter:l,onMouseOut:a,type:c}){return P.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:a,className:nt([i0,`${i0}-${c}`]),cx:IT(t,i,e),cy:AT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function MT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:s,targetX:l,targetY:a,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:m,onReconnectEnd:h,setReconnecting:g,setUpdateHover:v}){const S=He(),w=(N,I)=>{if(N.button!==0)return;const{autoPanOnConnect:M,domNode:R,connectionMode:C,connectionRadius:A,lib:F,onConnectStart:L,cancelConnection:$,nodeLookup:Z,rfId:j,panBy:G,updateConnection:q}=S.getState(),J=I.type==="target",Y=(D,W)=>{g(!1),h==null||h(D,n,I.type,W)},U=D=>d==null?void 0:d(n,D),B=(D,W)=>{g(!0),m==null||m(N,n,I.type),L==null||L(D,W)};vh.onPointerDown(N.nativeEvent,{autoPanOnConnect:M,connectionMode:C,connectionRadius:A,domNode:R,handleId:I.id,nodeId:I.nodeId,nodeLookup:Z,isTarget:J,edgeUpdaterType:I.type,lib:F,flowId:j,cancelConnection:$,panBy:G,isValidConnection:(...D)=>{var W,V;return((V=(W=S.getState()).isValidConnection)==null?void 0:V.call(W,...D))??!0},onConnect:U,onConnectStart:B,onConnectEnd:(...D)=>{var W,V;return(V=(W=S.getState()).onConnectEnd)==null?void 0:V.call(W,...D)},onReconnectEnd:Y,updateConnection:q,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},b=N=>w(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=N=>w(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>v(!0),E=()=>v(!1);return P.jsxs(P.Fragment,{children:[(e===!0||e==="source")&&P.jsx(o0,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:b,onMouseEnter:_,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&P.jsx(o0,{position:f,centerX:l,centerY:a,radius:t,onMouseDown:k,onMouseEnter:_,onMouseOut:E,type:"target"})]})}function LT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:s,onDoubleClick:l,onContextMenu:a,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,rfId:S,edgeTypes:w,noPanClassName:b,onError:k,disableKeyboardA11y:_}){let E=Me(he=>he.edgeLookup.get(e));const N=Me(he=>he.defaultEdgeOptions);E=N?{...N,...E}:E;let I=E.type||"default",M=(w==null?void 0:w[I])||n0[I];M===void 0&&(k==null||k("011",gn.error011(I)),I="default",M=(w==null?void 0:w.default)||n0.default);const R=!!(E.focusable||t&&typeof E.focusable>"u"),C=typeof h<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),A=!!(E.selectable||i&&typeof E.selectable>"u"),F=O.useRef(null),[L,$]=O.useState(!1),[Z,j]=O.useState(!1),G=He(),{zIndex:q,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W}=Me(O.useCallback(he=>{const fe=he.nodeLookup.get(E.source),ke=he.nodeLookup.get(E.target);if(!fe||!ke)return{zIndex:E.zIndex,...r0};const Ie=SC({id:e,sourceNode:fe,targetNode:ke,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:he.connectionMode,onError:k});return{zIndex:pC({selected:E.selected,zIndex:E.zIndex,sourceNode:fe,targetNode:ke,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Ie||r0}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),Ue),V=O.useMemo(()=>E.markerStart?`url('#${gh(E.markerStart,S)}')`:void 0,[E.markerStart,S]),K=O.useMemo(()=>E.markerEnd?`url('#${gh(E.markerEnd,S)}')`:void 0,[E.markerEnd,S]);if(E.hidden||J===null||Y===null||U===null||B===null)return null;const Q=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:ke,multiSelectionActive:Ie}=G.getState();A&&(G.setState({nodesSelectionActive:!1}),E.selected&&Ie?(ke({nodes:[],edges:[E]}),(Ae=F.current)==null||Ae.blur()):fe([e])),s&&s(he,E)},re=l?he=>{l(he,{...E})}:void 0,se=a?he=>{a(he,{...E})}:void 0,ee=c?he=>{c(he,{...E})}:void 0,oe=f?he=>{f(he,{...E})}:void 0,de=d?he=>{d(he,{...E})}:void 0,xe=he=>{var fe;if(!_&&kw.includes(he.key)&&A){const{unselectNodesAndEdges:ke,addSelectedEdges:Ie}=G.getState();he.key==="Escape"?((fe=F.current)==null||fe.blur(),ke({edges:[E]})):Ie([e])}};return P.jsx("svg",{style:{zIndex:q},children:P.jsxs("g",{className:nt(["react-flow__edge",`react-flow__edge-${I}`,E.className,b,{selected:E.selected,animated:E.animated,inactive:!A&&!s,updating:L,selectable:A}]),onClick:Q,onDoubleClick:re,onContextMenu:se,onMouseEnter:ee,onMouseMove:oe,onMouseLeave:de,onKeyDown:R?xe:void 0,tabIndex:R?0:void 0,role:E.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":R?`${n1}-${S}`:void 0,ref:F,...E.domAttributes,children:[!Z&&P.jsx(M,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:A,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:V,markerEnd:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),C&&P.jsx(MT,{edge:E,isReconnectable:C,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W,setUpdateHover:$,setReconnecting:j})]})})}var RT=O.memo(LT);const DT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function N1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:s,onReconnect:l,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:k,elementsSelectable:_,onError:E}=Me(DT,Ue),N=xT(t);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(_T,{defaultColor:e,rfId:n}),N.map(I=>P.jsx(RT,{id:I,edgesFocusable:b,edgesReconnectable:k,elementsSelectable:_,noPanClassName:s,onReconnect:l,onContextMenu:a,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:m,reconnectRadius:h,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:S,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:w},I))]})}N1.displayName="EdgeRenderer";const jT=O.memo(N1),$T=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zT({children:e}){const t=Me($T);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function FT(e){const t=Gh(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const BT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function VT(e){const t=Me(BT),n=He();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function WT(e){return e.connection.inProgress?{...e.connection,to:yo(e.connection.to,e.transform)}:{...e.connection}}function UT(e){return WT}function HT(e){const t=UT();return Me(t,Ue)}const qT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function YT({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:s,width:l,height:a,isValid:c,inProgress:f}=Me(qT,Ue);return!(l&&s&&f)?null:P.jsx("svg",{style:e,width:l,height:a,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:nt(["react-flow__connection",Nw(c)]),children:P.jsx(C1,{style:t,type:n,CustomComponent:i,isValid:c})})})}const C1=({style:e,type:t=Cr.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:s,from:l,fromNode:a,fromHandle:c,fromPosition:f,to:d,toNode:m,toHandle:h,toPosition:g,pointer:v}=HT();if(!s)return;if(n)return P.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:g,connectionStatus:Nw(i),toNode:m,toHandle:h,pointer:v});let S="";const w={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Cr.Bezier:[S]=$w(w);break;case Cr.SimpleBezier:[S]=p1(w);break;case Cr.Step:[S]=mh({...w,borderRadius:0});break;case Cr.SmoothStep:[S]=mh(w);break;default:[S]=Fw(w)}return P.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};C1.displayName="ConnectionLine";const KT={};function s0(e=KT){O.useRef(e),He(),O.useEffect(()=>{},[e])}function GT(){He(),O.useRef(!1),O.useEffect(()=>{},[])}function T1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:k,selectionKeyCode:_,selectionOnDrag:E,selectionMode:N,multiSelectionKeyCode:I,panActivationKeyCode:M,zoomActivationKeyCode:R,deleteKeyCode:C,onlyRenderVisibleElements:A,elementsSelectable:F,defaultViewport:L,translateExtent:$,minZoom:Z,maxZoom:j,preventScrolling:G,defaultMarkerColor:q,zoomOnScroll:J,zoomOnPinch:Y,panOnScroll:U,panOnScrollSpeed:B,panOnScrollMode:D,zoomOnDoubleClick:W,panOnDrag:V,autoPanOnSelection:K,onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneScroll:oe,onPaneContextMenu:de,paneClickDistance:xe,nodeClickDistance:he,onEdgeContextMenu:fe,onEdgeMouseEnter:ke,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:ze,onReconnect:wt,onReconnectStart:_t,onReconnectEnd:ht,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:Sn,nodeExtent:Nt,rfId:Ht,viewport:Rt,onViewportChange:qt}){return s0(e),s0(t),GT(),FT(n),VT(Rt),P.jsx(cT,{onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:oe,paneClickDistance:xe,deleteKeyCode:C,selectionKeyCode:_,selectionOnDrag:E,selectionMode:N,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:M,zoomActivationKeyCode:R,elementsSelectable:F,zoomOnScroll:J,zoomOnPinch:Y,zoomOnDoubleClick:W,panOnScroll:U,panOnScrollSpeed:B,panOnScrollMode:D,panOnDrag:V,autoPanOnSelection:K,defaultViewport:L,translateExtent:$,minZoom:Z,maxZoom:j,onSelectionContextMenu:h,preventScrolling:G,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:Sn,onViewportChange:qt,isControlledViewport:!!Rt,children:P.jsxs(zT,{children:[P.jsx(jT,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:wt,onReconnectStart:_t,onReconnectEnd:ht,onlyRenderVisibleElements:A,onEdgeContextMenu:fe,onEdgeMouseEnter:ke,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:ze,defaultMarkerColor:q,noPanClassName:bn,disableKeyboardA11y:Sn,rfId:Ht}),P.jsx(YT,{style:w,type:S,component:b,containerStyle:k}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(wT,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:A,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:Sn,nodeExtent:Nt,rfId:Ht}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}T1.displayName="GraphView";const XT=O.memo(T1),QT=Iw(),l0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:h,zIndexMode:g="basic"}={})=>{const v=new Map,S=new Map,w=new Map,b=new Map,k=i??t??[],_=n??e??[],E=m??[0,0],N=h??As;Ww(w,b,k);const{nodesInitialized:I}=yh(_,v,S,{nodeOrigin:E,nodeExtent:N,zIndexMode:g});let M=[0,0,1];if(a&&s&&l){const R=Ws(v,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:C,y:A,zoom:F}=Vh(R,s,l,f,d,(c==null?void 0:c.padding)??.1);M=[C,A,F]}return{rfId:"1",width:s??0,height:l??0,transform:M,nodes:_,nodesInitialized:I,nodeLookup:v,parentLookup:S,edges:k,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:As,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:so.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:{..._w},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:QT,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ew,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g})=>f2((v,S)=>{async function w(){const{nodeLookup:b,panZoom:k,fitViewOptions:_,fitViewResolver:E,width:N,height:I,minZoom:M,maxZoom:R}=S();k&&(await lC({nodes:b,width:N,height:I,panZoom:k,minZoom:M,maxZoom:R},_),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...l0({nodes:e,edges:t,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:b=>{const{nodeLookup:k,parentLookup:_,nodeOrigin:E,elevateNodesOnSelect:N,fitViewQueued:I,zIndexMode:M,nodesSelectionActive:R}=S(),{nodesInitialized:C,hasSelectedNodes:A}=yh(b,k,_,{nodeOrigin:E,nodeExtent:h,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:M}),F=R&&A;I&&C?(w(),v({nodes:b,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):v({nodes:b,nodesInitialized:C,nodesSelectionActive:F})},setEdges:b=>{const{connectionLookup:k,edgeLookup:_}=S();Ww(k,_,b),v({edges:b})},setDefaultNodesAndEdges:(b,k)=>{if(b){const{setNodes:_}=S();_(b),v({hasDefaultNodes:!0})}if(k){const{setEdges:_}=S();_(k),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:k,nodeLookup:_,parentLookup:E,domNode:N,nodeOrigin:I,nodeExtent:M,debug:R,fitViewQueued:C,zIndexMode:A}=S(),{changes:F,updatedInternals:L}=PC(b,_,E,N,I,M,A);L&&(NC(_,E,{nodeOrigin:I,nodeExtent:M,zIndexMode:A}),C?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(F==null?void 0:F.length)>0&&(R&&console.log("React Flow: trigger node changes",F),k==null||k(F)))},updateNodePositions:(b,k=!1)=>{const _=[];let E=[];const{nodeLookup:N,triggerNodeChanges:I,connection:M,updateConnection:R,onNodesChangeMiddlewareMap:C}=S();for(const[A,F]of b){const L=N.get(A),$=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(F!=null&&F.position)),Z={id:A,type:"position",position:$?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:k};if(L&&M.inProgress&&M.fromNode.id===L.id){const j=ui(L,M.fromHandle,Se.Left,!0);R({...M,from:j})}$&&L.parentId&&_.push({id:A,parentId:L.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),E.push(Z)}if(_.length>0){const{parentLookup:A,nodeOrigin:F}=S(),L=Kh(_,N,A,F);E.push(...L)}for(const A of C.values())E=A(E);I(E)},triggerNodeChanges:b=>{const{onNodesChange:k,setNodes:_,nodes:E,hasDefaultNodes:N,debug:I}=S();if(b!=null&&b.length){if(N){const M=A2(b,E);_(M)}I&&console.log("React Flow: trigger node changes",b),k==null||k(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:k,setEdges:_,edges:E,hasDefaultEdges:N,debug:I}=S();if(b!=null&&b.length){if(N){const M=M2(b,E);_(M)}I&&console.log("React Flow: trigger edge changes",b),k==null||k(b)}},addSelectedNodes:b=>{const{multiSelectionActive:k,edgeLookup:_,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:I}=S();if(k){const M=b.map(R=>Jr(R,!0));N(M);return}N(Gi(E,new Set([...b]),!0)),I(Gi(_))},addSelectedEdges:b=>{const{multiSelectionActive:k,edgeLookup:_,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:I}=S();if(k){const M=b.map(R=>Jr(R,!0));I(M);return}I(Gi(_,new Set([...b]))),N(Gi(E,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:k}={})=>{const{edges:_,nodes:E,nodeLookup:N,triggerNodeChanges:I,triggerEdgeChanges:M}=S(),R=b||E,C=k||_,A=[];for(const L of R){if(!L.selected)continue;const $=N.get(L.id);$&&($.selected=!1),A.push(Jr(L.id,!1))}const F=[];for(const L of C)L.selected&&F.push(Jr(L.id,!1));I(A),M(F)},setMinZoom:b=>{const{panZoom:k,maxZoom:_}=S();k==null||k.setScaleExtent([b,_]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:k,minZoom:_}=S();k==null||k.setScaleExtent([_,b]),v({maxZoom:b})},setTranslateExtent:b=>{var k;(k=S().panZoom)==null||k.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:k,triggerNodeChanges:_,triggerEdgeChanges:E,elementsSelectable:N}=S();if(!N)return;const I=k.reduce((R,C)=>C.selected?[...R,Jr(C.id,!1)]:R,[]),M=b.reduce((R,C)=>C.selected?[...R,Jr(C.id,!1)]:R,[]);_(I),E(M)},setNodeExtent:b=>{const{nodes:k,nodeLookup:_,parentLookup:E,nodeOrigin:N,elevateNodesOnSelect:I,nodeExtent:M,zIndexMode:R}=S();b[0][0]===M[0][0]&&b[0][1]===M[0][1]&&b[1][0]===M[1][0]&&b[1][1]===M[1][1]||(yh(k,_,E,{nodeOrigin:N,nodeExtent:b,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:R}),v({nodeExtent:b}))},panBy:b=>{const{transform:k,width:_,height:E,panZoom:N,translateExtent:I}=S();return IC({delta:b,panZoom:N,transform:k,translateExtent:I,width:_,height:E})},setCenter:async(b,k,_)=>{const{width:E,height:N,maxZoom:I,panZoom:M}=S();if(!M)return!1;const R=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:I;return await M.setViewport({x:E/2-b*R,y:N/2-k*R,zoom:R},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),!0},cancelConnection:()=>{v({connection:{..._w}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...l0()})}},Object.is);function O1({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:s,initialHeight:l,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g,children:v}){const[S]=O.useState(()=>JT({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:d,minZoom:a,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:h,zIndexMode:g}));return P.jsx(d2,{value:S,children:P.jsx(z2,{children:v})})}function ZT({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:s,width:l,height:a,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v}){return O.useContext(bu)?P.jsx(P.Fragment,{children:e}):P.jsx(O1,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:a,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v,children:e})}const eO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:s,nodeTypes:l,edgeTypes:a,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:m,onMoveStart:h,onMoveEnd:g,onConnect:v,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:I,onNodeDoubleClick:M,onNodeDragStart:R,onNodeDrag:C,onNodeDragStop:A,onNodesDelete:F,onEdgesDelete:L,onDelete:$,onSelectionChange:Z,onSelectionDragStart:j,onSelectionDrag:G,onSelectionDragStop:q,onSelectionContextMenu:J,onSelectionStart:Y,onSelectionEnd:U,onBeforeDelete:B,connectionMode:D,connectionLineType:W=Cr.Bezier,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:Q,deleteKeyCode:re="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:ee=!1,selectionMode:oe=Ms.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:xe=Rs()?"Meta":"Control",zoomActivationKeyCode:he=Rs()?"Meta":"Control",snapToGrid:fe,snapGrid:ke,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:Ae,nodesDraggable:ze,autoPanOnNodeFocus:wt,nodesConnectable:_t,nodesFocusable:ht,nodeOrigin:pt=r1,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:Sn=!0,defaultViewport:Nt=_2,minZoom:Ht=.5,maxZoom:Rt=2,translateExtent:qt=As,preventScrolling:Gs=!0,nodeExtent:jn,defaultMarkerColor:Ar="#b1b1b7",zoomOnScroll:zu=!0,zoomOnPinch:Xs=!0,panOnScroll:Qs=!1,panOnScrollSpeed:Fu=.5,panOnScrollMode:ko=ii.Free,zoomOnDoubleClick:Eo=!0,panOnDrag:_o=!0,onPaneClick:No,onPaneMouseEnter:Co,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Js,onPaneContextMenu:Zs,paneClickDistance:el=1,nodeClickDistance:tl=0,children:nl,onReconnect:To,onReconnectStart:rl,onReconnectEnd:Mr,onEdgeContextMenu:Oo,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Bu,onEdgeMouseMove:Rr,onEdgeMouseLeave:di,reconnectRadius:hi=10,onNodesChange:Po,onEdgesChange:Vu,noDragClassName:Wu="nodrag",noWheelClassName:Uu="nowheel",noPanClassName:kn="nopan",fitView:Io,fitViewOptions:Ao,connectOnClick:Hu,attributionPosition:il,proOptions:ol,defaultEdgeOptions:sl,elevateNodesOnSelect:ll=!0,elevateEdgesOnSelect:qu=!1,disableKeyboardA11y:al=!1,autoPanOnConnect:qe,autoPanOnNodeDrag:Yu,autoPanOnSelection:Mo=!0,autoPanSpeed:ul,connectionRadius:pi,isValidConnection:Ku,onError:cl,style:mi,id:Dt,nodeDragThreshold:Gu,connectionDragThreshold:jt,viewport:Xu,onViewportChange:Qu,width:Ju,height:gi,colorMode:yi="light",debug:Dr,onScroll:$n,ariaLabelConfig:Zu,zIndexMode:fl="basic",...Lo},dl){const jr=Dt||"1",$r=O2(yi),ec=O.useCallback(vi=>{vi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$n==null||$n(vi)},[$n]);return P.jsx("div",{"data-testid":"rf__wrapper",...Lo,onScroll:ec,style:{...mi,...eO},ref:dl,className:nt(["react-flow",s,$r]),id:Dt,role:"application",children:P.jsxs(ZT,{nodes:e,edges:t,width:Ju,height:gi,fitView:Io,fitViewOptions:Ao,minZoom:Ht,maxZoom:Rt,nodeOrigin:pt,nodeExtent:jn,zIndexMode:fl,children:[P.jsx(T2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:ze,autoPanOnNodeFocus:wt,nodesConnectable:_t,nodesFocusable:ht,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:Sn,elevateNodesOnSelect:ll,elevateEdgesOnSelect:qu,minZoom:Ht,maxZoom:Rt,nodeExtent:jn,onNodesChange:Po,onEdgesChange:Vu,snapToGrid:fe,snapGrid:ke,connectionMode:D,translateExtent:qt,connectOnClick:Hu,defaultEdgeOptions:sl,fitView:Io,fitViewOptions:Ao,onNodesDelete:F,onEdgesDelete:L,onDelete:$,onNodeDragStart:R,onNodeDrag:C,onNodeDragStop:A,onSelectionDrag:G,onSelectionDragStart:j,onSelectionDragStop:q,onMove:m,onMoveStart:h,onMoveEnd:g,noPanClassName:kn,nodeOrigin:pt,rfId:jr,autoPanOnConnect:qe,autoPanOnNodeDrag:Yu,autoPanSpeed:ul,onError:cl,connectionRadius:pi,isValidConnection:Ku,selectNodesOnDrag:Ae,nodeDragThreshold:Gu,connectionDragThreshold:jt,onBeforeDelete:B,debug:Dr,ariaLabelConfig:Zu,zIndexMode:fl}),P.jsx(XT,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:I,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:a,connectionLineType:W,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:Q,selectionKeyCode:se,selectionOnDrag:ee,selectionMode:oe,deleteKeyCode:re,multiSelectionKeyCode:xe,panActivationKeyCode:de,zoomActivationKeyCode:he,onlyRenderVisibleElements:Ie,defaultViewport:Nt,translateExtent:qt,minZoom:Ht,maxZoom:Rt,preventScrolling:Gs,zoomOnScroll:zu,zoomOnPinch:Xs,zoomOnDoubleClick:Eo,panOnScroll:Qs,panOnScrollSpeed:Fu,panOnScrollMode:ko,panOnDrag:_o,autoPanOnSelection:Mo,onPaneClick:No,onPaneMouseEnter:Co,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Js,onPaneContextMenu:Zs,paneClickDistance:el,nodeClickDistance:tl,onSelectionContextMenu:J,onSelectionStart:Y,onSelectionEnd:U,onReconnect:To,onReconnectStart:rl,onReconnectEnd:Mr,onEdgeContextMenu:Oo,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Bu,onEdgeMouseMove:Rr,onEdgeMouseLeave:di,reconnectRadius:hi,defaultMarkerColor:Ar,noDragClassName:Wu,noWheelClassName:Uu,noPanClassName:kn,rfId:jr,disableKeyboardA11y:al,nodeExtent:jn,viewport:Xu,onViewportChange:Qu}),P.jsx(E2,{onSelectionChange:Z}),nl,P.jsx(w2,{proOptions:ol,position:il}),P.jsx(v2,{rfId:jr,disableKeyboardA11y:al})]})})}var nO=o1(tO);function rO({dimensions:e,lineWidth:t,variant:n,className:i}){return P.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nt(["react-flow__background-pattern",n,i])})}function iO({radius:e,className:t}){return P.jsx("circle",{cx:e,cy:e,r:e,className:nt(["react-flow__background-pattern","dots",t])})}var Qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qn||(Qn={}));const oO={[Qn.Dots]:1,[Qn.Lines]:1,[Qn.Cross]:6},sO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function P1({id:e,variant:t=Qn.Dots,gap:n=20,size:i,lineWidth:s=1,offset:l=0,color:a,bgColor:c,style:f,className:d,patternClassName:m}){const h=O.useRef(null),{transform:g,patternId:v}=Me(sO,Ue),S=i||oO[t],w=t===Qn.Dots,b=t===Qn.Cross,k=Array.isArray(n)?n:[n,n],_=[k[0]*g[2]||1,k[1]*g[2]||1],E=S*g[2],N=Array.isArray(l)?l:[l,l],I=b?[E,E]:_,M=[N[0]*g[2]||1+I[0]/2,N[1]*g[2]||1+I[1]/2],R=`${v}${e||""}`;return P.jsxs("svg",{className:nt(["react-flow__background",d]),style:{...f,...ku,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:h,"data-testid":"rf__background",children:[P.jsx("pattern",{id:R,x:g[0]%_[0],y:g[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?P.jsx(iO,{radius:E/2,className:m}):P.jsx(rO,{dimensions:I,lineWidth:s,variant:t,className:m})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}P1.displayName="Background";const lO=O.memo(P1);function aO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function cO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.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 fO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 dO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 Sa({children:e,className:t,...n}){return P.jsx("button",{type:"button",className:nt(["react-flow__controls-button",t]),...n,children:e})}const hO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function I1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:a,onFitView:c,onInteractiveChange:f,className:d,children:m,position:h="bottom-left",orientation:g="vertical","aria-label":v}){const S=He(),{isInteractive:w,minZoomReached:b,maxZoomReached:k,ariaLabelConfig:_}=Me(hO,Ue),{zoomIn:E,zoomOut:N,fitView:I}=Gh(),M=()=>{E(),l==null||l()},R=()=>{N(),a==null||a()},C=()=>{I(s),c==null||c()},A=()=>{S.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},F=g==="horizontal"?"horizontal":"vertical";return P.jsxs(Su,{className:nt(["react-flow__controls",F,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??_["controls.ariaLabel"],children:[t&&P.jsxs(P.Fragment,{children:[P.jsx(Sa,{onClick:M,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:k,children:P.jsx(aO,{})}),P.jsx(Sa,{onClick:R,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:b,children:P.jsx(uO,{})})]}),n&&P.jsx(Sa,{className:"react-flow__controls-fitview",onClick:C,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:P.jsx(cO,{})}),i&&P.jsx(Sa,{className:"react-flow__controls-interactive",onClick:A,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?P.jsx(dO,{}):P.jsx(fO,{})}),m]})}I1.displayName="Controls";const pO=O.memo(I1);function mO({id:e,x:t,y:n,width:i,height:s,style:l,color:a,strokeColor:c,strokeWidth:f,className:d,borderRadius:m,shapeRendering:h,selected:g,onClick:v}){const{background:S,backgroundColor:w}=l||{},b=a||S||w;return P.jsx("rect",{className:nt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:i,height:s,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:h,onClick:v?k=>v(k,e):void 0})}const gO=O.memo(mO),yO=e=>e.nodes.map(t=>t.id),Gf=e=>e instanceof Function?e:()=>e;function vO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l=gO,onClick:a}){const c=Me(yO,Ue),f=Gf(t),d=Gf(e),m=Gf(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:c.map(g=>P.jsx(xO,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:l,onClick:a,shapeRendering:h},g))})}function wO({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:a,NodeComponent:c,onClick:f}){const{node:d,x:m,y:h,width:g,height:v}=Me(S=>{const w=S.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:k,y:_}=w.internals.positionAbsolute,{width:E,height:N}=er(b);return{node:b,x:k,y:_,width:E,height:N}},Ue);return!d||d.hidden||!Aw(d)?null:P.jsx(c,{x:m,y:h,width:g,height:v,style:d.style,selected:!!d.selected,className:i(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:l,shapeRendering:a,onClick:f,id:d.id})}const xO=O.memo(wO);var bO=O.memo(vO);const SO=200,kO=150,EO=e=>!e.hidden,_O=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?Pw(Ws(e.nodeLookup,{filter:EO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},NO="react-flow__minimap-desc";function A1({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:m,maskStrokeWidth:h,position:g="bottom-right",onClick:v,onNodeClick:S,pannable:w=!1,zoomable:b=!1,ariaLabel:k,inversePan:_,zoomStep:E=1,offsetScale:N=5}){const I=He(),M=O.useRef(null),{boundingRect:R,viewBB:C,rfId:A,panZoom:F,translateExtent:L,flowWidth:$,flowHeight:Z,ariaLabelConfig:j}=Me(_O,Ue),G=(e==null?void 0:e.width)??SO,q=(e==null?void 0:e.height)??kO,J=R.width/G,Y=R.height/q,U=Math.max(J,Y),B=U*G,D=U*q,W=N*U,V=R.x-(B-R.width)/2-W,K=R.y-(D-R.height)/2-W,Q=B+W*2,re=D+W*2,se=`${NO}-${A}`,ee=O.useRef(0),oe=O.useRef();ee.current=U,O.useEffect(()=>{if(M.current&&F)return oe.current=FC({domNode:M.current,panZoom:F,getTransform:()=>I.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=oe.current)==null||fe.destroy()}},[F]),O.useEffect(()=>{var fe;(fe=oe.current)==null||fe.update({translateExtent:L,width:$,height:Z,inversePan:_,pannable:w,zoomStep:E,zoomable:b})},[w,b,_,E,L,$,Z]);const de=v?fe=>{var Ae;const[ke,Ie]=((Ae=oe.current)==null?void 0:Ae.pointer(fe))||[0,0];v(fe,{x:ke,y:Ie})}:void 0,xe=S?O.useCallback((fe,ke)=>{const Ie=I.getState().nodeLookup.get(ke).internals.userNode;S(fe,Ie)},[]):void 0,he=k??j["minimap.ariaLabel"];return P.jsx(Su,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f: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 h=="number"?h*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i: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:nt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:G,height:q,viewBox:`${V} ${K} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:M,onClick:de,children:[he&&P.jsx("title",{id:se,children:he}),P.jsx(bO,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-W},${K-W}h${Q+W*2}v${re+W*2}h${-Q-W*2}z
|
|
62
|
-
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}A1.displayName="MiniMap";O.memo(A1);const CO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,TO={[co.Line]:"right",[co.Handle]:"bottom-right"};function OO({nodeId:e,position:t,variant:n=co.Handle,className:i,style:s=void 0,children:l,color:a,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:v=!0,shouldResize:S,onResizeStart:w,onResize:b,onResizeEnd:k}){const _=u1(),E=typeof e=="string"?e:_,N=He(),I=O.useRef(null),M=n===co.Handle,R=Me(O.useCallback(CO(M&&v),[M,v]),Ue),C=O.useRef(null),A=t??TO[n];O.useEffect(()=>{if(!(!I.current||!E))return C.current||(C.current=ZC({domNode:I.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:L,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,domNode:q}=N.getState();return{nodeLookup:L,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,paneDomNode:q}},onChange:(L,$)=>{const{triggerNodeChanges:Z,nodeLookup:j,parentLookup:G,nodeOrigin:q}=N.getState(),J=[],Y={x:L.x,y:L.y},U=j.get(E);if(U&&U.expandParent&&U.parentId){const B=U.origin??q,D=L.width??U.measured.width??0,W=L.height??U.measured.height??0,V={id:U.id,parentId:U.parentId,rect:{width:D,height:W,...Mw({x:L.x??U.position.x,y:L.y??U.position.y},{width:D,height:W},U.parentId,j,B)}},K=Kh([V],j,G,q);J.push(...K),Y.x=L.x?Math.max(B[0]*D,L.x):void 0,Y.y=L.y?Math.max(B[1]*W,L.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const B={id:E,type:"position",position:{...Y}};J.push(B)}if(L.width!==void 0&&L.height!==void 0){const D={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};J.push(D)}for(const B of $){const D={...B,type:"position"};J.push(D)}Z(J)},onEnd:({width:L,height:$})=>{const Z={id:E,type:"dimensions",resizing:!1,dimensions:{width:L,height:$}};N.getState().triggerNodeChanges([Z])}})),C.current.update({controlPosition:A,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:m},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:k,shouldResize:S}),()=>{var L;(L=C.current)==null||L.destroy()}},[A,c,f,d,m,h,w,b,k,S]);const F=A.split("-");return P.jsx("div",{className:nt(["react-flow__resize-control","nodrag",...F,n,i]),ref:I,style:{...s,scale:R,...a&&{[M?"backgroundColor":"borderColor"]:a}},children:l})}O.memo(OO);function M1(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=M1(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function L1(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=M1(e))&&(i&&(i+=" "),i+=t);return i}const PO=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},IO=(e,t)=>({classGroupId:e,validator:t}),R1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),iu="-",a0=[],AO="arbitrary..",MO=e=>{const t=RO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return LO(a);const c=a.split(iu),f=c[0]===""&&c.length>1?1:0;return D1(c,f,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const f=i[a],d=n[a];return f?d?PO(d,f):f:d||a0}return n[a]||a0}}},D1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const d=D1(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const c=t===0?e.join(iu):e.slice(t).join(iu),f=a.length;for(let d=0;d<f;d++){const m=a[d];if(m.validator(c))return m.classGroupId}},LO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?AO+i:void 0})(),RO=e=>{const{theme:t,classGroups:n}=e;return DO(n,t)},DO=(e,t)=>{const n=R1();for(const i in e){const s=e[i];Qh(s,n,i,t)}return n},Qh=(e,t,n,i)=>{const s=e.length;for(let l=0;l<s;l++){const a=e[l];jO(a,t,n,i)}},jO=(e,t,n,i)=>{if(typeof e=="string"){$O(e,t,n);return}if(typeof e=="function"){zO(e,t,n,i);return}FO(e,t,n,i)},$O=(e,t,n)=>{const i=e===""?t:j1(t,e);i.classGroupId=n},zO=(e,t,n,i)=>{if(BO(e)){Qh(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(IO(n,e))},FO=(e,t,n,i)=>{const s=Object.entries(e),l=s.length;for(let a=0;a<l;a++){const[c,f]=s[a];Qh(f,j1(t,c),n,i)}},j1=(e,t)=>{let n=e;const i=t.split(iu),s=i.length;for(let l=0;l<s;l++){const a=i[l];let c=n.nextPart.get(a);c||(c=R1(),n.nextPart.set(a,c)),n=c}return n},BO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const s=(l,a)=>{n[l]=a,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=i[l])!==void 0)return s(l,a),a},set(l,a){l in n?n[l]=a:s(l,a)}}},xh="!",u0=":",WO=[],c0=(e,t,n,i,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:s}),UO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=s=>{const l=[];let a=0,c=0,f=0,d;const m=s.length;for(let w=0;w<m;w++){const b=s[w];if(a===0&&c===0){if(b===u0){l.push(s.slice(f,w)),f=w+1;continue}if(b==="/"){d=w;continue}}b==="["?a++:b==="]"?a--:b==="("?c++:b===")"&&c--}const h=l.length===0?s:s.slice(f);let g=h,v=!1;h.endsWith(xh)?(g=h.slice(0,-1),v=!0):h.startsWith(xh)&&(g=h.slice(1),v=!0);const S=d&&d>f?d-f:void 0;return c0(l,v,g,S)};if(t){const s=t+u0,l=i;i=a=>a.startsWith(s)?l(a.slice(s.length)):c0(WO,!1,a,void 0,!0)}if(n){const s=i;i=l=>n({className:l,parseClassName:s})}return i},HO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let s=[];for(let l=0;l<n.length;l++){const a=n[l],c=a[0]==="[",f=t.has(a);c||f?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(a)):s.push(a)}return s.length>0&&(s.sort(),i.push(...s)),i}},qO=e=>({cache:VO(e.cacheSize),parseClassName:UO(e),sortModifiers:HO(e),postfixLookupClassGroupIds:YO(e),...MO(e)}),YO=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let i=0;i<n.length;i++)t[n[i]]=!0;return t},KO=/\s+/,GO=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:a}=t,c=[],f=e.trim().split(KO);let d="";for(let m=f.length-1;m>=0;m-=1){const h=f[m],{isExternal:g,modifiers:v,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:b}=n(h);if(g){d=h+(d.length>0?" "+d:d);continue}let k=!!b,_;if(k){const R=w.substring(0,b);_=i(R);const C=_&&a[_]?i(w):void 0;C&&C!==_&&(_=C,k=!1)}else _=i(w);if(!_){if(!k){d=h+(d.length>0?" "+d:d);continue}if(_=i(w),!_){d=h+(d.length>0?" "+d:d);continue}k=!1}const E=v.length===0?"":v.length===1?v[0]:l(v).join(":"),N=S?E+xh:E,I=N+_;if(c.indexOf(I)>-1)continue;c.push(I);const M=s(_,k);for(let R=0;R<M.length;++R){const C=M[R];c.push(N+C)}d=h+(d.length>0?" "+d:d)}return d},XO=(...e)=>{let t=0,n,i,s="";for(;t<e.length;)(n=e[t++])&&(i=$1(n))&&(s&&(s+=" "),s+=i);return s},$1=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=$1(e[i]))&&(n&&(n+=" "),n+=t);return n},QO=(e,...t)=>{let n,i,s,l;const a=f=>{const d=t.reduce((m,h)=>h(m),e());return n=qO(d),i=n.cache.get,s=n.cache.set,l=c,c(f)},c=f=>{const d=i(f);if(d)return d;const m=GO(f,n);return s(f,m),m};return l=a,(...f)=>l(XO(...f))},JO=[],ot=e=>{const t=n=>n[e]||JO;return t.isThemeGetter=!0,t},z1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tP=/\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$/,nP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Er=e=>ZO.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),Xf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Kn=e=>eP.test(e),B1=()=>!0,oP=e=>tP.test(e)&&!nP.test(e),Jh=()=>!1,sP=e=>rP.test(e),lP=e=>iP.test(e),aP=e=>!me(e)&&!ye(e),uP=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),cP=e=>Pr(e,U1,Jh),me=e=>z1.test(e),Qr=e=>Pr(e,H1,oP),f0=e=>Pr(e,vP,Oe),fP=e=>Pr(e,Y1,B1),dP=e=>Pr(e,q1,Jh),d0=e=>Pr(e,V1,Jh),hP=e=>Pr(e,W1,lP),ka=e=>Pr(e,K1,sP),ye=e=>F1.test(e),ms=e=>fi(e,H1),pP=e=>fi(e,q1),h0=e=>fi(e,V1),mP=e=>fi(e,U1),gP=e=>fi(e,W1),Ea=e=>fi(e,K1,!0),yP=e=>fi(e,Y1,!0),Pr=(e,t,n)=>{const i=z1.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},fi=(e,t,n=!1)=>{const i=F1.exec(e);return i?i[1]?t(i[1]):n:!1},V1=e=>e==="position"||e==="percentage",W1=e=>e==="image"||e==="url",U1=e=>e==="length"||e==="size"||e==="bg-size",H1=e=>e==="length",vP=e=>e==="number",q1=e=>e==="family-name",Y1=e=>e==="number"||e==="weight",K1=e=>e==="shadow",wP=()=>{const e=ot("color"),t=ot("font"),n=ot("text"),i=ot("font-weight"),s=ot("tracking"),l=ot("leading"),a=ot("breakpoint"),c=ot("container"),f=ot("spacing"),d=ot("radius"),m=ot("shadow"),h=ot("inset-shadow"),g=ot("text-shadow"),v=ot("drop-shadow"),S=ot("blur"),w=ot("perspective"),b=ot("aspect"),k=ot("ease"),_=ot("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...N(),ye,me],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],C=()=>[ye,me,f],A=()=>[Er,"full","auto",...C()],F=()=>[Tn,"none","subgrid",ye,me],L=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],$=()=>[Tn,"auto",ye,me],Z=()=>["auto","min","max","fr",ye,me],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...C()],J=()=>[Er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],Y=()=>[Er,"screen","full","dvw","lvw","svw","min","max","fit",...C()],U=()=>[Er,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],B=()=>[e,ye,me],D=()=>[...N(),h0,d0,{position:[ye,me]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",mP,cP,{size:[ye,me]}],K=()=>[Xf,ms,Qr],Q=()=>["","none","full",d,ye,me],re=()=>["",Oe,ms,Qr],se=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Oe,Xf,h0,d0],de=()=>["","none",S,ye,me],xe=()=>["none",Oe,ye,me],he=()=>["none",Oe,ye,me],fe=()=>[Oe,ye,me],ke=()=>[Er,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[B1],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[aP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",Oe],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Er,me,ye,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[uP],columns:[{columns:[Oe,me,ye,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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"],sr:["sr-only","not-sr-only"],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:I()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Er,"full","auto",c,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Er,"auto","initial","none",me]}],grow:[{grow:["",Oe,ye,me]}],shrink:[{shrink:["",Oe,ye,me]}],order:[{order:[Tn,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,ms,Qr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,yP,fP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xf,me]}],"font-family":[{font:[pP,dP,t]}],"font-features":[{"font-features":[me]}],"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:[s,ye,me]}],"line-clamp":[{"line-clamp":[Oe,"none",ye,f0]}],leading:[{leading:[l,...C()]}],"list-image":[{"list-image":["none",ye,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Qr]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Tn,ye,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,ye,me],radial:["",ye,me],conic:[Tn,ye,me]},gP,hP]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,me]}],"outline-w":[{outline:["",Oe,ms,Qr]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",m,Ea,ka]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,Ea,ka]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Oe,Qr]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",g,Ea,ka]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Oe,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:de()}],brightness:[{brightness:[Oe,ye,me]}],contrast:[{contrast:[Oe,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Ea,ka]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Oe,ye,me]}],"hue-rotate":[{"hue-rotate":[Oe,ye,me]}],invert:[{invert:["",Oe,ye,me]}],saturate:[{saturate:[Oe,ye,me]}],sepia:[{sepia:["",Oe,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ye,me]}],ease:[{ease:["linear","initial",k,ye,me]}],delay:[{delay:[Oe,ye,me]}],animate:[{animate:["none",_,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ye,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],zoom:[{zoom:[Tn,ye,me]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",ye,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Oe,ms,Qr,f0]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},xP=QO(wP);function ut(...e){return xP(L1(e))}function gs(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function Qf(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function bP(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw new Error("Invalid ISO8601 passed to timezone parser.");let i=e.substring(9);return i.includes("Z")||i.includes("+")||i.includes("-")?bh(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Etc/UTC"):bh(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function p0(e,t,n){return G1(bP(e,t),n)}function G1(e,t){let n=new Date(gs(e)),i=xs(n,e.tz),s=gs(e),l=gs(i),a=s-l,c=new Date(n.getTime()+a),f=xs(c,e.tz);if(Qf(f,e)){let h=new Date(c.getTime()-36e5),g=xs(h,e.tz);return Qf(g,e)?h:c}let d=new Date(c.getTime()+gs(e)-gs(f)),m=xs(d,e.tz);if(Qf(m,e))return d;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>d.getTime()?c:d}function xs(e,t){let n,i;try{n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=n.formatToParts(e)}catch(l){let a=l instanceof Error?l.message:String(l);throw new RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${a}`)}let s={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let l of i)(l.type==="year"||l.type==="month"||l.type==="day"||l.type==="hour"||l.type==="minute"||l.type==="second")&&(s[l.type]=parseInt(l.value,10));if(isNaN(s.year)||isNaN(s.month)||isNaN(s.day)||isNaN(s.hour)||isNaN(s.minute)||isNaN(s.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(s)}`);return s.hour===24&&(s.hour=0),{y:s.year,m:s.month,d:s.day,h:s.hour,i:s.minute,s:s.second,tz:t}}function bh(e,t,n,i,s,l,a){return{y:e,m:t,d:n,h:i,i:s,s:l,tz:a}}var X1=[1,2,4,8,16],m0=class{constructor(e,t,n){Ne(this,"pattern");Ne(this,"timezone");Ne(this,"mode");Ne(this,"alternativeWeekdays");Ne(this,"sloppyRanges");Ne(this,"second");Ne(this,"minute");Ne(this,"hour");Ne(this,"day");Ne(this,"month");Ne(this,"dayOfWeek");Ne(this,"year");Ne(this,"lastDayOfMonth");Ne(this,"lastWeekday");Ne(this,"nearestWeekdays");Ne(this,"starDOM");Ne(this,"starDOW");Ne(this,"starYear");Ne(this,"useAndLogic");this.pattern=e,this.timezone=t,this.mode=(n==null?void 0:n.mode)??"auto",this.alternativeWeekdays=(n==null?void 0:n.alternativeWeekdays)??!1,this.sloppyRanges=(n==null?void 0:n.sloppyRanges)??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[""],t=e.length;if(e.length<5||e.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(t):t===i)){let s=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${s} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift("0"),e.length===6&&e.push("*"),e[3].toUpperCase()==="LW"?(this.lastWeekday=!0,e[3]=""):e[3].toUpperCase().indexOf("L")>=0&&(e[3]=e[3].replace(/L/gi,""),this.lastDayOfMonth=!0),e[3]=="*"&&(this.starDOM=!0),e[6]=="*"&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith("+")&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(e[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(e[0]=e[0].replace(/\?/g,"*"),e[1]=e[1].replace(/\?/g,"*"),e[2]=e[2].replace(/\?/g,"*"),e[3]=e[3].replace(/\?/g,"*"),e[4]=e[4].replace(/\?/g,"*"),e[5]=e[5].replace(/\?/g,"*"),e[6]&&(e[6]=e[6].replace(/\?/g,"*"))),this.mode){case"5-part":e[0]="0",e[6]="*";break;case"6-part":e[6]="*";break;case"5-or-6-parts":e[6]="*";break}this.throwAtIllegalCharacters(e),this.partToArray("second",e[0],0,1),this.partToArray("minute",e[1],0,1),this.partToArray("hour",e[2],0,1),this.partToArray("day",e[3],-1,1),this.partToArray("month",e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",e[5],n,63),this.partToArray("year",e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,i){let s=this[e],l=e==="day"&&this.lastDayOfMonth,a=e==="day"&&this.lastWeekday;if(t===""&&!l&&!a)throw new TypeError("CronPattern: configuration entry "+e+" ("+t+") is empty, check for trailing spaces.");if(t==="*")return s.fill(i);let c=t.split(",");if(c.length>1)for(let f=0;f<c.length;f++)this.partToArray(e,c[f],n,i);else t.indexOf("-")!==-1&&t.indexOf("/")!==-1?this.handleRangeWithStepping(t,e,n,i):t.indexOf("-")!==-1?this.handleRange(t,e,n,i):t.indexOf("/")!==-1?this.handleStepping(t,e,n,i):t!==""&&this.handleNumber(t,e,n,i)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw new TypeError("CronPattern: configuration entry "+t+" ("+e[t]+") contains illegal characters.")}handleNumber(e,t,n,i){let s=this.extractNth(e,t),l=e.toUpperCase().includes("W");if(t!=="day"&&l)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");l&&(t="nearestWeekdays");let a=parseInt(s[0],10)+n;if(isNaN(a))throw new TypeError("CronPattern: "+t+" is not a number: '"+e+"'");this.setPart(t,a,s[1]||i)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw new TypeError("CronPattern: Invalid part specified: "+e);if(e==="dayOfWeek"){if(t===7&&(t=0),t<0||t>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+t);this.setNthWeekdayOfMonth(t,n);return}if(e==="second"||e==="minute"){if(t<0||t>=60)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="hour"){if(t<0||t>=24)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="day"||e==="nearestWeekdays"){if(t<0||t>=31)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="month"){if(t<0||t>=12)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="year"&&(t<1||t>=1e4))throw new RangeError("CronPattern: Invalid value for "+e+": "+t+" (supported range: 1-9999)");this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw new TypeError(t)}validateRange(e,t,n,i,s){if(e>t)throw new TypeError("CronPattern: From value is larger than to value: '"+s+"'");if(n!==void 0){if(n===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(n>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let s=this.extractNth(e,t),l=s[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(l===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+e+"'");let[,a,c,f]=l,d=parseInt(a,10)+n,m=parseInt(c,10)+n,h=parseInt(f,10);this.validateNotNaN(d,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(h,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(d,m,h,t,e);for(let g=d;g<=m;g+=h)this.setPart(t,g,s[1]||i)}extractNth(e,t){let n=e,i;if(n.includes("#")){if(t!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=n.split("#")[1],n=n.split("#")[0]}else if(n.toUpperCase().endsWith("L")){if(t!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",n=n.slice(0,-1)}return[n,i]}handleRange(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let s=this.extractNth(e,t),l=s[0].split("-");if(l.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+e+"'");let a=parseInt(l[0],10)+n,c=parseInt(l[1],10)+n;this.validateNotNaN(a,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(c,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(a,c,void 0,t,e);for(let f=a;f<=c;f++)this.setPart(t,f,s[1]||i)}handleStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let s=this.extractNth(e,t),l=s[0].split("/");if(l.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+e+"'");if(this.sloppyRanges)l[0]===""&&(l[0]="*");else{if(l[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(l[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let a=0;l[0]!=="*"&&(a=parseInt(l[0],10)+n);let c=parseInt(l[1],10);this.validateNotNaN(c,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[t].length-1,c,t,e);for(let f=a;f<this[t].length;f+=c)this.setPart(t,f,s[1]||i)}replaceAlphaDays(e){return e.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(e){return e.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(e){let t=e.trim().toLowerCase();if(t==="@yearly"||t==="@annually")return"0 0 1 1 *";if(t==="@monthly")return"0 0 1 * *";if(t==="@weekly")return"0 0 * * 0";if(t==="@daily"||t==="@midnight")return"0 0 * * *";if(t==="@hourly")return"0 * * * *";if(t==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return e}setNthWeekdayOfMonth(e,t){if(typeof t!="number"&&t.toUpperCase()==="L")this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|X1[t-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},Jf=[31,28,31,30,31,30,31,31,30,31,30,31],Ve=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],dt=class Q1{constructor(t,n){Ne(this,"tz");Ne(this,"ms");Ne(this,"second");Ne(this,"minute");Ne(this,"hour");Ne(this,"day");Ne(this,"month");Ne(this,"year");if(this.tz=n,t&&t instanceof Date)if(!isNaN(t))this.fromDate(t);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(t==null)this.fromDate(new Date);else if(t&&typeof t=="string")this.fromString(t);else if(t instanceof Q1)this.fromCronDate(t);else throw new TypeError("CronDate: Invalid type ("+typeof t+") passed to CronDate constructor")}getLastDayOfMonth(t,n){return n!==1?Jf[n]:new Date(Date.UTC(t,n+1,0)).getUTCDate()}getLastWeekday(t,n){let i=this.getLastDayOfMonth(t,n),s=new Date(Date.UTC(t,n,i)).getUTCDay();return s===0?i-2:s===6?i-1:i}getNearestWeekday(t,n,i){let s=this.getLastDayOfMonth(t,n);if(i>s)return-1;let l=new Date(Date.UTC(t,n,i)).getUTCDay();return l===0?i===s?i-2:i+1:l===6?i===1?i+2:i-1:i}isNthWeekdayOfMonth(t,n,i,s){let l=new Date(Date.UTC(t,n,i)).getUTCDay(),a=0;for(let c=1;c<=i;c++)new Date(Date.UTC(t,n,c)).getUTCDay()===l&&a++;if(s&63&&X1[a-1]&s)return!0;if(s&32){let c=this.getLastDayOfMonth(t,n);for(let f=i+1;f<=c;f++)if(new Date(Date.UTC(t,n,f)).getUTCDay()===l)return!1;return!0}return!1}fromDate(t){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes()+this.tz,this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply();else try{let n=xs(t,this.tz);this.ms=t.getMilliseconds(),this.second=n.s,this.minute=n.i,this.hour=n.h,this.day=n.d,this.month=n.m-1,this.year=n.y}catch(n){let i=n instanceof Error?n.message:String(n);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${i}`)}else this.ms=t.getMilliseconds(),this.second=t.getSeconds(),this.minute=t.getMinutes(),this.hour=t.getHours(),this.day=t.getDate(),this.month=t.getMonth(),this.year=t.getFullYear()}fromCronDate(t){this.tz=t.tz,this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.ms=t.ms}apply(){if(this.month>11||this.month<0||this.day>Jf[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let t=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),!0}else return!1}fromString(t){if(typeof this.tz=="number"){let n=p0(t);this.ms=n.getUTCMilliseconds(),this.second=n.getUTCSeconds(),this.minute=n.getUTCMinutes(),this.hour=n.getUTCHours(),this.day=n.getUTCDate(),this.month=n.getUTCMonth(),this.year=n.getUTCFullYear(),this.apply()}else return this.fromDate(p0(t,this.tz))}findNext(t,n,i,s){return this._findMatch(t,n,i,s,1)}_findMatch(t,n,i,s,l){let a=this[n],c;i.lastDayOfMonth&&(c=this.getLastDayOfMonth(this.year,this.month));let f=!i.starDOW&&n=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,d=this[n]+s,m=l===1?h=>h<i[n].length:h=>h>=0;for(let h=d;m(h);h+=l){let g=i[n][h];if(n==="day"&&!g){for(let v=0;v<i.nearestWeekdays.length;v++)if(i.nearestWeekdays[v]){let S=this.getNearestWeekday(this.year,this.month,v-s);if(S===-1)continue;if(S===h-s){g=1;break}}}if(n==="day"&&i.lastWeekday){let v=this.getLastWeekday(this.year,this.month);h-s===v&&(g=1)}if(n==="day"&&i.lastDayOfMonth&&h-s==c&&(g=1),n==="day"&&!i.starDOW){let v=i.dayOfWeek[(f+(h-s-1))%7];if(v&&v&63)v=this.isNthWeekdayOfMonth(this.year,this.month,h-s,v)?1:0;else if(v)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${v}`);i.useAndLogic?g=g&&v:!t.domAndDow&&!i.starDOM?g=g||v:g=g&&v}if(g)return this[n]=h-s,a!==this[n]?2:1}return 3}recurse(t,n,i){if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let l=-1;for(let a=this.year+1;a<t.year.length&&a<1e4;a++)if(t.year[a]===1){l=a;break}if(l===-1)return null;this.year=l,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let s=this.findNext(n,Ve[i][0],t,Ve[i][2]);if(s>1){let l=i+1;for(;l<Ve.length;)this[Ve[l][0]]=-Ve[l][2],l++;if(s===3){if(this[Ve[i][1]]++,this[Ve[i][0]]=-Ve[i][2],this.apply(),i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=t.year.length)return null}return this.recurse(t,n,0)}else if(this.apply())return this.recurse(t,n,i-1)}return i+=1,i>=Ve.length?this:(t.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(t,n,i)}increment(t,n,i){return this.second+=n.interval!==void 0&&n.interval>1&&i?n.interval:1,this.ms=0,this.apply(),this.recurse(t,n,0)}decrement(t,n){return this.second-=n.interval!==void 0&&n.interval>1?n.interval:1,this.ms=0,this.apply(),this.recurseBackward(t,n,0,0)}recurseBackward(t,n,i,s=0){if(s>1e4)return null;if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let a=-1;for(let c=this.year-1;c>=0;c--)if(t.year[c]===1){a=c;break}if(a===-1)return null;this.year=a,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let l=this.findPrevious(n,Ve[i][0],t,Ve[i][2]);if(l>1){let a=i+1;for(;a<Ve.length;){let c=Ve[a][0],f=Ve[a][2],d=this.getMaxPatternValue(c,t,f);this[c]=d,a++}if(l===3){if(this[Ve[i][1]]--,i===0){let m=this.getLastDayOfMonth(this.year,this.month);this.day>m&&(this.day=m)}if(i===1)if(this.day<=0)this.day=1;else{let m=this.year,h=this.month;for(;h<0;)h+=12,m--;for(;h>11;)h-=12,m++;let g=h!==1?Jf[h]:new Date(Date.UTC(m,h+1,0)).getUTCDate();this.day>g&&(this.day=g)}this.apply();let c=Ve[i][0],f=Ve[i][2],d=this.getMaxPatternValue(c,t,f);if(c==="day"){let m=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(d,m)}else this[c]=d;if(this.apply(),i===0){let m=Ve[1][2],h=this.getMaxPatternValue("day",t,m),g=this.getLastDayOfMonth(this.year,this.month),v=Math.min(h,g);v!==this.day&&(this.day=v,this.hour=this.getMaxPatternValue("hour",t,Ve[2][2]),this.minute=this.getMaxPatternValue("minute",t,Ve[3][2]),this.second=this.getMaxPatternValue("second",t,Ve[4][2]))}if(i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(t,n,0,s+1)}else if(this.apply())return this.recurseBackward(t,n,i-1,s+1)}return i+=1,i>=Ve.length?this:this.year<0?null:this.recurseBackward(t,n,i,s+1)}getMaxPatternValue(t,n,i){if(t==="day"&&n.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(t==="day"&&!n.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let s=n[t].length-1;s>=0;s--)if(n[t][s])return s-i;return n[t].length-1-i}findPrevious(t,n,i,s){return this._findMatch(t,n,i,s,-1)}getDate(t){return t||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):G1(bh(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(t,n){if(!t.starYear&&(this.year<0||this.year>=t.year.length||t.year[this.year]===0))return!1;for(let i=0;i<Ve.length;i++){let s=Ve[i][0],l=Ve[i][2],a=this[s];if(a+l<0||a+l>=t[s].length)return!1;let c=t[s][a+l];if(s==="day"){if(!c){for(let f=0;f<t.nearestWeekdays.length;f++)if(t.nearestWeekdays[f]){let d=this.getNearestWeekday(this.year,this.month,f-l);if(d!==-1&&d===a){c=1;break}}}if(t.lastWeekday){let f=this.getLastWeekday(this.year,this.month);a===f&&(c=1)}if(t.lastDayOfMonth){let f=this.getLastDayOfMonth(this.year,this.month);a===f&&(c=1)}if(!t.starDOW){let f=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),d=t.dayOfWeek[(f+(a-1))%7];d&&d&63&&(d=this.isNthWeekdayOfMonth(this.year,this.month,a,d)?1:0),t.useAndLogic?c=c&&d:!n.domAndDow&&!t.starDOM?c=c||d:c=c&&d}}if(!c)return!1}return!0}};function SP(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused===void 0?!1:e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch===void 0?!1:e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref===void 0?!1:e.unref,e.mode=e.mode===void 0?"auto":e.mode,e.alternativeWeekdays=e.alternativeWeekdays===void 0?!1:e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges===void 0?!1:e.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(e.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(e.startAt&&(e.startAt=new dt(e.startAt,e.timezone)),e.stopAt&&(e.stopAt=new dt(e.stopAt,e.timezone)),e.interval!==null){if(isNaN(e.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(e.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(e.utcOffset<-870||e.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(e.utcOffset!==void 0&&e.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(e.unref!==!0&&e.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return e}function bs(e){return Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function}function kP(e){return bs(e)}function EP(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var g0=30*1e3,_a=[],_P=class{constructor(e,t,n){Ne(this,"name");Ne(this,"options");Ne(this,"_states");Ne(this,"fn");let i,s;if(bs(t))s=t;else if(typeof t=="object")i=t;else if(t!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(bs(n))s=n;else if(typeof n=="object")i=n;else if(n!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=i==null?void 0:i.name,this.options=SP(i),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:i?i.maxRuns:void 0,paused:i?i.paused:!1,pattern:new m0("* * * * *",void 0,{mode:"auto"})},e&&(e instanceof Date||typeof e=="string"&&e.indexOf(":")>0)?this._states.once=new dt(e,this.getTz()):this._states.pattern=new m0(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(_a.find(l=>l.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");_a.push(this)}return s!==void 0&&kP(s)&&(this.fn=s,this.schedule()),this}getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,"next")}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,"previous")}_enumerateRuns(e,t,n){let i=[],s=t?new dt(t,this.getTz()):null,l=n==="next"?this._next:this._previous;for(;e--;){let a=l.call(this,s);if(!a)break;let c=a.getDate(!1);i.push(this.applyDayOffset(c)),s=a}return i}match(e){if(this._states.once){let n=new dt(e,this.getTz());n.ms=0;let i=new dt(this._states.once,this.getTz());return i.ms=0,n.getTime()===i.getTime()}let t=new dt(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,i=!this._states.kill;return t&&n&&i&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof dt||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new dt(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=_a.indexOf(this);e>=0&&_a.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>g0&&(t=g0),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&EP(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new dt(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(t){if(bs(this.options.catch))try{this.options.catch(t,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new dt(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),i=this._states.blocking&&this.options.protect;n&&!i?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&i&&bs(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new dt(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let i=this._states.once||new dt(e,this.getTz());return!n&&i!==this._states.once&&(i=i.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||i===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&i.getTime()>=this.options.stopAt.getTime()?null:i}_previous(e){let t=new dt(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new dt(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new dt(void 0,this.getTz()),i=e;if(this.options.startAt.getTime()<=n.getTime()){i=this.options.startAt;let s=i.getTime()+this.options.interval*1e3;for(;s<=n.getTime();)i=new dt(i,this.getTz()).increment(this._states.pattern,this.options,!0),s=i.getTime()+this.options.interval*1e3;t=!0}return i===null&&(i=void 0),[i,t]}};function NP(e){var i,s;const t=(i=e.nodes)==null?void 0:i.find(l=>l.type==="trigger.cron"),n=(s=t==null?void 0:t.config)==null?void 0:s.cron;return typeof n=="string"?n:null}function CP(e,t=new Date){try{return new _P(e).nextRun(t)}catch{return null}}function TP(e){const t=Math.round(e/6e4);if(t<1)return"<1m";if(t<60)return`${t}m`;const n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function OP(e,t=new Date){const n=CP(e,t);if(!n)return null;const i=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),s=n.toLocaleString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}),l=TP(n.getTime()-t.getTime());return{short:i,title:`Next run ${s} (in ${l}) · cron ${e}`}}function y0(e){return e?e.replace(/^trigger\./,""):""}function PP({activeView:e,onViewChange:t,liveConnected:n,workflows:i=[],selected:s,onSelect:l,onRun:a,version:c}){return P.jsxs("aside",{className:"w-60 shrink-0 bg-bg border-r border-border flex flex-col",children:[P.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[P.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),P.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),c&&P.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",c]})]}),P.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),P.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their ",P.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover a workflow → ",P.jsx("span",{className:"font-mono text-fg",children:"▶ run"})," to trigger now."]}),P.jsxs("nav",{className:"px-2 space-y-0.5",children:[i.length===0&&P.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),i.map(f=>{const d=NP(f),m=d?OP(d):null;return P.jsxs("div",{"data-testid":"workflow-item",className:ut("group w-full px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px] cursor-pointer",f.name===s?"bg-muted":"hover:bg-muted text-mutedfg"),onClick:()=>l==null?void 0:l(f.name),children:[P.jsx("span",{className:ut("size-1.5 rounded-full flex-shrink-0",f.name===s?"bg-ok":"bg-border")}),P.jsx("span",{className:"truncate",children:f.name}),P.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[m?P.jsxs("span",{"data-testid":"next-run",title:m.title,className:"text-[10px] text-mutedfg font-mono whitespace-nowrap",children:["next ",m.short]}):y0(f.triggerType)&&P.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:y0(f.triggerType)}),f.runnable&&a&&P.jsx("button",{"data-testid":"run-workflow",title:`Run ${f.name} now`,onClick:h=>{h.stopPropagation(),a(f.name)},className:"text-[11px] font-mono text-mutedfg hover:text-ok px-1 rounded opacity-0 group-hover:opacity-100",children:"▶ run"})]})]},f.name)})]}),P.jsx("div",{className:"px-3 pt-5 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"View"}),P.jsxs("nav",{className:"px-2 space-y-0.5",children:[P.jsx("button",{onClick:()=>t("board"),className:ut("w-full text-left px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px]",e==="board"?"bg-muted":"hover:bg-muted text-mutedfg"),children:"Whiteboard"}),P.jsxs("button",{onClick:()=>t("runs"),className:ut("w-full text-left px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px]",e==="runs"?"bg-muted":"hover:bg-muted text-mutedfg"),children:["Runs",n&&P.jsx("span",{className:"ml-auto size-1.5 rounded-full bg-ok pulse-dot"})]})]}),P.jsxs("div",{className:"mt-auto p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx("span",{className:ut("size-1.5 rounded-full",n?"bg-ok":"bg-border")}),n?"server connected":"scheduler running"]}),P.jsxs("div",{className:"mt-1 font-mono",children:["no fleet state stored —",P.jsx("br",{}),"surfaces are the source of truth"]})]})]})}function IP({workflow:e,onLoadYaml:t}){const n=(e==null?void 0:e.name)??"no workflow loaded",i=e?`workflows/${e.name}.yaml`:"",[s,l]=O.useState(!1),a=O.useRef(null),c=O.useCallback(()=>{var m;const d=((m=a.current)==null?void 0:m.value)??"";d.trim()&&(t(d),l(!1))},[t]),f=O.useCallback(()=>{l(!1)},[]);return P.jsxs(P.Fragment,{children:[P.jsxs("header",{className:"h-12 shrink-0 bg-bg border-b border-border flex items-center px-4 gap-3",children:[P.jsx("h1",{className:"font-semibold tracking-tight",children:n}),i&&P.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded",children:i}),P.jsx("div",{className:"ml-auto",children:P.jsx("button",{onClick:()=>l(!0),className:"text-[12px] px-2.5 py-1 rounded bg-muted hover:bg-border text-fg transition-colors",children:"Paste YAML"})})]}),s&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:P.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[520px] max-w-[90vw]",children:[P.jsxs("div",{className:"flex items-center justify-between",children:[P.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),P.jsx("button",{onClick:f,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),P.jsx("textarea",{ref:a,className:"w-full h-64 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary",placeholder:"Paste your workflow YAML here...",spellCheck:!1}),P.jsxs("div",{className:"flex justify-end gap-2",children:[P.jsx("button",{onClick:f,className:"text-[12px] px-3 py-1.5 rounded bg-muted hover:bg-border text-fg transition-colors",children:"Cancel"}),P.jsx("button",{onClick:c,className:"text-[12px] px-3 py-1.5 rounded bg-primary hover:opacity-90 text-white transition-opacity",children:"Apply"})]})]})})]})}function v0({status:e}){return P.jsx("span",{"data-testid":"status-dot","data-status":e,className:ut("size-1.5 rounded-full flex-shrink-0",e==="idle"&&"bg-border",e==="running"&&"bg-run pulse-dot",e==="success"&&"bg-ok",e==="failed"&&"bg-fail")})}function w0({data:e,selected:t}){const{node:n,liveStatus:i="idle"}=e;if(n.type==="agent.run"){const l=i==="running";return P.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className:ut("rounded-lg border overflow-hidden cursor-pointer","bg-agentbg border-agent/40",l?"agent-ring agent-live":"agent-ring"),style:{width:220,height:60},onClick:()=>{var a;return(a=e.onNodeClick)==null?void 0:a.call(e,n)},children:[P.jsx("div",{className:"h-1 bg-agent"}),P.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx(v0,{status:i}),P.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),P.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),P.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),P.jsx(Tr,{type:"target",position:Se.Left,className:"!bg-agent/50"}),P.jsx(Tr,{type:"source",position:Se.Right,className:"!bg-agent/50"})]})}return P.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className:ut("rounded-lg border overflow-hidden cursor-pointer bg-bg border-border shadow-sm",t&&"ring-2 ring-fg/20"),style:{width:n.type==="task.branch"||n.type.startsWith("trigger.")?140:220,height:60},onClick:()=>{var l;return(l=e.onNodeClick)==null?void 0:l.call(e,n)},children:[P.jsx("div",{className:"h-1 bg-mutedfg/30"}),P.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx(v0,{status:i}),P.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),P.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),P.jsx(Tr,{type:"target",position:Se.Left,className:"!bg-mutedfg/50"}),P.jsx(Tr,{type:"source",position:Se.Right,className:"!bg-mutedfg/50"})]})}var Zf,x0;function Zh(){if(x0)return Zf;x0=1;var e="\0",t="\0",n="";class i{constructor(m){Ne(this,"_isDirected",!0);Ne(this,"_isMultigraph",!1);Ne(this,"_isCompound",!1);Ne(this,"_label");Ne(this,"_defaultNodeLabelFn",()=>{});Ne(this,"_defaultEdgeLabelFn",()=>{});Ne(this,"_nodes",{});Ne(this,"_in",{});Ne(this,"_preds",{});Ne(this,"_out",{});Ne(this,"_sucs",{});Ne(this,"_edgeObjs",{});Ne(this,"_edgeLabels",{});Ne(this,"_nodeCount",0);Ne(this,"_edgeCount",0);Ne(this,"_parent");Ne(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(h=>Object.keys(m._in[h]).length===0)}sinks(){var m=this;return this.nodes().filter(h=>Object.keys(m._out[h]).length===0)}setNodes(m,h){var g=arguments,v=this;return m.forEach(function(S){g.length>1?v.setNode(S,h):v.setNode(S)}),this}setNode(m,h){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=h),this):(this._nodes[m]=arguments.length>1?h:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var h=this;if(Object.hasOwn(this._nodes,m)){var g=v=>h.removeEdge(h._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){h.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(g),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var g=h;g!==void 0;g=this.parent(g))if(g===m)throw new Error("Setting "+h+" as parent of "+m+" would create a cycle");this.setNode(h)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=h,this._children[h][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var h=this._parent[m];if(h!==t)return h}}children(m=t){if(this._isCompound){var h=this._children[m];if(h)return Object.keys(h)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var h=this._preds[m];if(h)return Object.keys(h)}successors(m){var h=this._sucs[m];if(h)return Object.keys(h)}neighbors(m){var h=this.predecessors(m);if(h){const v=new Set(h);for(var g of this.successors(m))v.add(g);return Array.from(v.values())}}isLeaf(m){var h;return this.isDirected()?h=this.successors(m):h=this.neighbors(m),h.length===0}filterNodes(m){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var g=this;Object.entries(this._nodes).forEach(function([w,b]){m(w)&&h.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,g.edge(w))});var v={};function S(w){var b=g.parent(w);return b===void 0||h.hasNode(b)?(v[w]=b,b):b in v?v[b]:S(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,S(w))),h}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,h){var g=this,v=arguments;return m.reduce(function(S,w){return v.length>1?g.setEdge(S,w,h):g.setEdge(S,w),w}),this}setEdge(){var m,h,g,v,S=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,h=w.w,g=w.name,arguments.length===2&&(v=arguments[1],S=!0)):(m=w,h=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],S=!0)),m=""+m,h=""+h,g!==void 0&&(g=""+g);var b=a(this._isDirected,m,h,g);if(Object.hasOwn(this._edgeLabels,b))return S&&(this._edgeLabels[b]=v),this;if(g!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(h),this._edgeLabels[b]=S?v:this._defaultEdgeLabelFn(m,h,g);var k=c(this._isDirected,m,h,g);return m=k.v,h=k.w,Object.freeze(k),this._edgeObjs[b]=k,s(this._preds[h],m),s(this._sucs[m],h),this._in[h][b]=k,this._out[m][b]=k,this._edgeCount++,this}edge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g),S=this._edgeObjs[v];return S&&(m=S.v,h=S.w,delete this._edgeLabels[v],delete this._edgeObjs[v],l(this._preds[h],m),l(this._sucs[m],h),delete this._in[h][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,h){var g=this._in[m];if(g){var v=Object.values(g);return h?v.filter(S=>S.v===h):v}}outEdges(m,h){var g=this._out[m];if(g){var v=Object.values(g);return h?v.filter(S=>S.w===h):v}}nodeEdges(m,h){var g=this.inEdges(m,h);if(g)return g.concat(this.outEdges(m,h))}}function s(d,m){d[m]?d[m]++:d[m]=1}function l(d,m){--d[m]||delete d[m]}function a(d,m,h,g){var v=""+m,S=""+h;if(!d&&v>S){var w=v;v=S,S=w}return v+n+S+n+(g===void 0?e:g)}function c(d,m,h,g){var v=""+m,S=""+h;if(!d&&v>S){var w=v;v=S,S=w}var b={v,w:S};return g&&(b.name=g),b}function f(d,m){return a(d,m.v,m.w,m.name)}return Zf=i,Zf}var ed,b0;function AP(){return b0||(b0=1,ed="2.2.4"),ed}var td,S0;function MP(){return S0||(S0=1,td={Graph:Zh(),version:AP()}),td}var nd,k0;function LP(){if(k0)return nd;k0=1;var e=Zh();nd={write:t,read:s};function t(l){var a={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:n(l),edges:i(l)};return l.graph()!==void 0&&(a.value=structuredClone(l.graph())),a}function n(l){return l.nodes().map(function(a){var c=l.node(a),f=l.parent(a),d={v:a};return c!==void 0&&(d.value=c),f!==void 0&&(d.parent=f),d})}function i(l){return l.edges().map(function(a){var c=l.edge(a),f={v:a.v,w:a.w};return a.name!==void 0&&(f.name=a.name),c!==void 0&&(f.value=c),f})}function s(l){var a=new e(l.options).setGraph(l.value);return l.nodes.forEach(function(c){a.setNode(c.v,c.value),c.parent&&a.setParent(c.v,c.parent)}),l.edges.forEach(function(c){a.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),a}return nd}var rd,E0;function RP(){if(E0)return rd;E0=1,rd=e;function e(t){var n={},i=[],s;function l(a){Object.hasOwn(n,a)||(n[a]=!0,s.push(a),t.successors(a).forEach(l),t.predecessors(a).forEach(l))}return t.nodes().forEach(function(a){s=[],l(a),s.length&&i.push(s)}),i}return rd}var id,_0;function J1(){if(_0)return id;_0=1;class e{constructor(){Ne(this,"_arr",[]);Ne(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var s=this._keyIndices;if(n=String(n),!Object.hasOwn(s,n)){var l=this._arr,a=l.length;return s[n]=a,l.push({key:n,priority:i}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var s=this._keyIndices[n];if(i>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+i);this._arr[s].priority=i,this._decrease(s)}_heapify(n){var i=this._arr,s=2*n,l=s+1,a=n;s<i.length&&(a=i[s].priority<i[a].priority?s:a,l<i.length&&(a=i[l].priority<i[a].priority?l:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){for(var i=this._arr,s=i[n].priority,l;n!==0&&(l=n>>1,!(i[l].priority<s));)this._swap(n,l),n=l}_swap(n,i){var s=this._arr,l=this._keyIndices,a=s[n],c=s[i];s[n]=c,s[i]=a,l[c.key]=n,l[a.key]=i}}return id=e,id}var od,N0;function Z1(){if(N0)return od;N0=1;var e=J1();od=n;var t=()=>1;function n(s,l,a,c){return i(s,String(l),a||t,c||function(f){return s.outEdges(f)})}function i(s,l,a,c){var f={},d=new e,m,h,g=function(v){var S=v.v!==m?v.v:v.w,w=f[S],b=a(v),k=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+b);k<w.distance&&(w.distance=k,w.predecessor=m,d.decrease(S,k))};for(s.nodes().forEach(function(v){var S=v===l?0:Number.POSITIVE_INFINITY;f[v]={distance:S},d.add(v,S)});d.size()>0&&(m=d.removeMin(),h=f[m],h.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(g);return f}return od}var sd,C0;function DP(){if(C0)return sd;C0=1;var e=Z1();sd=t;function t(n,i,s){return n.nodes().reduce(function(l,a){return l[a]=e(n,a,i,s),l},{})}return sd}var ld,T0;function ex(){if(T0)return ld;T0=1,ld=e;function e(t){var n=0,i=[],s={},l=[];function a(c){var f=s[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),t.successors(c).forEach(function(h){Object.hasOwn(s,h)?s[h].onStack&&(f.lowlink=Math.min(f.lowlink,s[h].index)):(a(h),f.lowlink=Math.min(f.lowlink,s[h].lowlink))}),f.lowlink===f.index){var d=[],m;do m=i.pop(),s[m].onStack=!1,d.push(m);while(c!==m);l.push(d)}}return t.nodes().forEach(function(c){Object.hasOwn(s,c)||a(c)}),l}return ld}var ad,O0;function jP(){if(O0)return ad;O0=1;var e=ex();ad=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return ad}var ud,P0;function $P(){if(P0)return ud;P0=1,ud=t;var e=()=>1;function t(i,s,l){return n(i,s||e,l||function(a){return i.outEdges(a)})}function n(i,s,l){var a={},c=i.nodes();return c.forEach(function(f){a[f]={},a[f][f]={distance:0},c.forEach(function(d){f!==d&&(a[f][d]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(d){var m=d.v===f?d.w:d.v,h=s(d);a[f][m]={distance:h,predecessor:f}})}),c.forEach(function(f){var d=a[f];c.forEach(function(m){var h=a[m];c.forEach(function(g){var v=h[f],S=d[g],w=h[g],b=v.distance+S.distance;b<w.distance&&(w.distance=b,w.predecessor=S.predecessor)})})}),a}return ud}var cd,I0;function tx(){if(I0)return cd;I0=1;function e(n){var i={},s={},l=[];function a(c){if(Object.hasOwn(s,c))throw new t;Object.hasOwn(i,c)||(s[c]=!0,i[c]=!0,n.predecessors(c).forEach(a),delete s[c],l.push(c))}if(n.sinks().forEach(a),Object.keys(i).length!==n.nodeCount())throw new t;return l}class t extends Error{constructor(){super(...arguments)}}return cd=e,e.CycleException=t,cd}var fd,A0;function zP(){if(A0)return fd;A0=1;var e=tx();fd=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return fd}var dd,M0;function nx(){if(M0)return dd;M0=1,dd=e;function e(s,l,a){Array.isArray(l)||(l=[l]);var c=s.isDirected()?h=>s.successors(h):h=>s.neighbors(h),f=a==="post"?t:n,d=[],m={};return l.forEach(h=>{if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);f(h,c,m,d)}),d}function t(s,l,a,c){for(var f=[[s,!1]];f.length>0;){var d=f.pop();d[1]?c.push(d[0]):Object.hasOwn(a,d[0])||(a[d[0]]=!0,f.push([d[0],!0]),i(l(d[0]),m=>f.push([m,!1])))}}function n(s,l,a,c){for(var f=[s];f.length>0;){var d=f.pop();Object.hasOwn(a,d)||(a[d]=!0,c.push(d),i(l(d),m=>f.push(m)))}}function i(s,l){for(var a=s.length;a--;)l(s[a],a,s);return s}return dd}var hd,L0;function FP(){if(L0)return hd;L0=1;var e=nx();hd=t;function t(n,i){return e(n,i,"post")}return hd}var pd,R0;function BP(){if(R0)return pd;R0=1;var e=nx();pd=t;function t(n,i){return e(n,i,"pre")}return pd}var md,D0;function VP(){if(D0)return md;D0=1;var e=Zh(),t=J1();md=n;function n(i,s){var l=new e,a={},c=new t,f;function d(h){var g=h.v===f?h.w:h.v,v=c.priority(g);if(v!==void 0){var S=s(h);S<v&&(a[g]=f,c.decrease(g,S))}}if(i.nodeCount()===0)return l;i.nodes().forEach(function(h){c.add(h,Number.POSITIVE_INFINITY),l.setNode(h)}),c.decrease(i.nodes()[0],0);for(var m=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(a,f))l.setEdge(f,a[f]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(f).forEach(d)}return l}return md}var gd,j0;function WP(){return j0||(j0=1,gd={components:RP(),dijkstra:Z1(),dijkstraAll:DP(),findCycles:jP(),floydWarshall:$P(),isAcyclic:zP(),postorder:FP(),preorder:BP(),prim:VP(),tarjan:ex(),topsort:tx()}),gd}var yd,$0;function yn(){if($0)return yd;$0=1;var e=MP();return yd={Graph:e.Graph,json:LP(),alg:WP(),version:e.version},yd}var vd,z0;function UP(){if(z0)return vd;z0=1;class e{constructor(){let s={};s._next=s._prev=s,this._sentinel=s}dequeue(){let s=this._sentinel,l=s._prev;if(l!==s)return t(l),l}enqueue(s){let l=this._sentinel;s._prev&&s._next&&t(s),s._next=l._next,l._next._prev=s,l._next=s,s._prev=l}toString(){let s=[],l=this._sentinel,a=l._prev;for(;a!==l;)s.push(JSON.stringify(a,n)),a=a._prev;return"["+s.join(", ")+"]"}}function t(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function n(i,s){if(i!=="_next"&&i!=="_prev")return s}return vd=e,vd}var wd,F0;function HP(){if(F0)return wd;F0=1;let e=yn().Graph,t=UP();wd=i;let n=()=>1;function i(d,m){if(d.nodeCount()<=1)return[];let h=a(d,m||n);return s(h.graph,h.buckets,h.zeroIdx).flatMap(v=>d.outEdges(v.v,v.w))}function s(d,m,h){let g=[],v=m[m.length-1],S=m[0],w;for(;d.nodeCount();){for(;w=S.dequeue();)l(d,m,h,w);for(;w=v.dequeue();)l(d,m,h,w);if(d.nodeCount()){for(let b=m.length-2;b>0;--b)if(w=m[b].dequeue(),w){g=g.concat(l(d,m,h,w,!0));break}}}return g}function l(d,m,h,g,v){let S=v?[]:void 0;return d.inEdges(g.v).forEach(w=>{let b=d.edge(w),k=d.node(w.v);v&&S.push({v:w.v,w:w.w}),k.out-=b,c(m,h,k)}),d.outEdges(g.v).forEach(w=>{let b=d.edge(w),k=w.w,_=d.node(k);_.in-=b,c(m,h,_)}),d.removeNode(g.v),S}function a(d,m){let h=new e,g=0,v=0;d.nodes().forEach(b=>{h.setNode(b,{v:b,in:0,out:0})}),d.edges().forEach(b=>{let k=h.edge(b.v,b.w)||0,_=m(b),E=k+_;h.setEdge(b.v,b.w,E),v=Math.max(v,h.node(b.v).out+=_),g=Math.max(g,h.node(b.w).in+=_)});let S=f(v+g+3).map(()=>new t),w=g+1;return h.nodes().forEach(b=>{c(S,w,h.node(b))}),{graph:h,buckets:S,zeroIdx:w}}function c(d,m,h){h.out?h.in?d[h.out-h.in+m].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}function f(d){const m=[];for(let h=0;h<d;h++)m.push(h);return m}return wd}var xd,B0;function tt(){if(B0)return xd;B0=1;let e=yn().Graph;xd={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:a,mapValues:M,maxRank:S,normalizeRanks:f,notime:k,partition:w,pick:I,predecessorWeights:l,range:N,removeEmptyRanks:d,simplify:n,successorWeights:s,time:b,uniqueId:E,zipObject:R};function t(C,A,F,L){for(var $=L;C.hasNode($);)$=E(L);return F.dummy=A,C.setNode($,F),$}function n(C){let A=new e().setGraph(C.graph());return C.nodes().forEach(F=>A.setNode(F,C.node(F))),C.edges().forEach(F=>{let L=A.edge(F.v,F.w)||{weight:0,minlen:1},$=C.edge(F);A.setEdge(F.v,F.w,{weight:L.weight+$.weight,minlen:Math.max(L.minlen,$.minlen)})}),A}function i(C){let A=new e({multigraph:C.isMultigraph()}).setGraph(C.graph());return C.nodes().forEach(F=>{C.children(F).length||A.setNode(F,C.node(F))}),C.edges().forEach(F=>{A.setEdge(F,C.edge(F))}),A}function s(C){let A=C.nodes().map(F=>{let L={};return C.outEdges(F).forEach($=>{L[$.w]=(L[$.w]||0)+C.edge($).weight}),L});return R(C.nodes(),A)}function l(C){let A=C.nodes().map(F=>{let L={};return C.inEdges(F).forEach($=>{L[$.v]=(L[$.v]||0)+C.edge($).weight}),L});return R(C.nodes(),A)}function a(C,A){let F=C.x,L=C.y,$=A.x-F,Z=A.y-L,j=C.width/2,G=C.height/2;if(!$&&!Z)throw new Error("Not possible to find intersection inside of the rectangle");let q,J;return Math.abs(Z)*j>Math.abs($)*G?(Z<0&&(G=-G),q=G*$/Z,J=G):($<0&&(j=-j),q=j,J=j*Z/$),{x:F+q,y:L+J}}function c(C){let A=N(S(C)+1).map(()=>[]);return C.nodes().forEach(F=>{let L=C.node(F),$=L.rank;$!==void 0&&(A[$][L.order]=F)}),A}function f(C){let A=C.nodes().map(L=>{let $=C.node(L).rank;return $===void 0?Number.MAX_VALUE:$}),F=v(Math.min,A);C.nodes().forEach(L=>{let $=C.node(L);Object.hasOwn($,"rank")&&($.rank-=F)})}function d(C){let A=C.nodes().map(j=>C.node(j).rank),F=v(Math.min,A),L=[];C.nodes().forEach(j=>{let G=C.node(j).rank-F;L[G]||(L[G]=[]),L[G].push(j)});let $=0,Z=C.graph().nodeRankFactor;Array.from(L).forEach((j,G)=>{j===void 0&&G%Z!==0?--$:j!==void 0&&$&&j.forEach(q=>C.node(q).rank+=$)})}function m(C,A,F,L){let $={width:0,height:0};return arguments.length>=4&&($.rank=F,$.order=L),t(C,"border",$,A)}function h(C,A=g){const F=[];for(let L=0;L<C.length;L+=A){const $=C.slice(L,L+A);F.push($)}return F}const g=65535;function v(C,A){if(A.length>g){const F=h(A);return C.apply(null,F.map(L=>C.apply(null,L)))}else return C.apply(null,A)}function S(C){const F=C.nodes().map(L=>{let $=C.node(L).rank;return $===void 0?Number.MIN_VALUE:$});return v(Math.max,F)}function w(C,A){let F={lhs:[],rhs:[]};return C.forEach(L=>{A(L)?F.lhs.push(L):F.rhs.push(L)}),F}function b(C,A){let F=Date.now();try{return A()}finally{console.log(C+" time: "+(Date.now()-F)+"ms")}}function k(C,A){return A()}let _=0;function E(C){var A=++_;return C+(""+A)}function N(C,A,F=1){A==null&&(A=C,C=0);let L=Z=>Z<A;F<0&&(L=Z=>A<Z);const $=[];for(let Z=C;L(Z);Z+=F)$.push(Z);return $}function I(C,A){const F={};for(const L of A)C[L]!==void 0&&(F[L]=C[L]);return F}function M(C,A){let F=A;return typeof A=="string"&&(F=L=>L[A]),Object.entries(C).reduce((L,[$,Z])=>(L[$]=F(Z,$),L),{})}function R(C,A){return C.reduce((F,L,$)=>(F[L]=A[$],F),{})}return xd}var bd,V0;function qP(){if(V0)return bd;V0=1;let e=HP(),t=tt().uniqueId;bd={run:n,undo:s};function n(l){(l.graph().acyclicer==="greedy"?e(l,c(l)):i(l)).forEach(f=>{let d=l.edge(f);l.removeEdge(f),d.forwardName=f.name,d.reversed=!0,l.setEdge(f.w,f.v,d,t("rev"))});function c(f){return d=>f.edge(d).weight}}function i(l){let a=[],c={},f={};function d(m){Object.hasOwn(f,m)||(f[m]=!0,c[m]=!0,l.outEdges(m).forEach(h=>{Object.hasOwn(c,h.w)?a.push(h):d(h.w)}),delete c[m])}return l.nodes().forEach(d),a}function s(l){l.edges().forEach(a=>{let c=l.edge(a);if(c.reversed){l.removeEdge(a);let f=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(a.w,a.v,c,f)}})}return bd}var Sd,W0;function YP(){if(W0)return Sd;W0=1;let e=tt();Sd={run:t,undo:i};function t(s){s.graph().dummyChains=[],s.edges().forEach(l=>n(s,l))}function n(s,l){let a=l.v,c=s.node(a).rank,f=l.w,d=s.node(f).rank,m=l.name,h=s.edge(l),g=h.labelRank;if(d===c+1)return;s.removeEdge(l);let v,S,w;for(w=0,++c;c<d;++w,++c)h.points=[],S={width:0,height:0,edgeLabel:h,edgeObj:l,rank:c},v=e.addDummyNode(s,"edge",S,"_d"),c===g&&(S.width=h.width,S.height=h.height,S.dummy="edge-label",S.labelpos=h.labelpos),s.setEdge(a,v,{weight:h.weight},m),w===0&&s.graph().dummyChains.push(v),a=v;s.setEdge(a,f,{weight:h.weight},m)}function i(s){s.graph().dummyChains.forEach(l=>{let a=s.node(l),c=a.edgeLabel,f;for(s.setEdge(a.edgeObj,c);a.dummy;)f=s.successors(l)[0],s.removeNode(l),c.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(c.x=a.x,c.y=a.y,c.width=a.width,c.height=a.height),l=f,a=s.node(l)})}return Sd}var kd,U0;function ou(){if(U0)return kd;U0=1;const{applyWithChunking:e}=tt();kd={longestPath:t,slack:n};function t(i){var s={};function l(a){var c=i.node(a);if(Object.hasOwn(s,a))return c.rank;s[a]=!0;let f=i.outEdges(a).map(m=>m==null?Number.POSITIVE_INFINITY:l(m.w)-i.edge(m).minlen);var d=e(Math.min,f);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}i.sources().forEach(l)}function n(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}return kd}var Ed,H0;function rx(){if(H0)return Ed;H0=1;var e=yn().Graph,t=ou().slack;Ed=n;function n(a){var c=new e({directed:!1}),f=a.nodes()[0],d=a.nodeCount();c.setNode(f,{});for(var m,h;i(c,a)<d;)m=s(c,a),h=c.hasNode(m.v)?t(a,m):-t(a,m),l(c,a,h);return c}function i(a,c){function f(d){c.nodeEdges(d).forEach(m=>{var h=m.v,g=d===h?m.w:h;!a.hasNode(g)&&!t(c,m)&&(a.setNode(g,{}),a.setEdge(d,g,{}),f(g))})}return a.nodes().forEach(f),a.nodeCount()}function s(a,c){return c.edges().reduce((d,m)=>{let h=Number.POSITIVE_INFINITY;return a.hasNode(m.v)!==a.hasNode(m.w)&&(h=t(c,m)),h<d[0]?[h,m]:d},[Number.POSITIVE_INFINITY,null])[1]}function l(a,c,f){a.nodes().forEach(d=>c.node(d).rank+=f)}return Ed}var _d,q0;function KP(){if(q0)return _d;q0=1;var e=rx(),t=ou().slack,n=ou().longestPath,i=yn().alg.preorder,s=yn().alg.postorder,l=tt().simplify;_d=a,a.initLowLimValues=m,a.initCutValues=c,a.calcCutValue=d,a.leaveEdge=g,a.enterEdge=v,a.exchangeEdges=S;function a(_){_=l(_),n(_);var E=e(_);m(E),c(E,_);for(var N,I;N=g(E);)I=v(E,_,N),S(E,_,N,I)}function c(_,E){var N=s(_,_.nodes());N=N.slice(0,N.length-1),N.forEach(I=>f(_,E,I))}function f(_,E,N){var I=_.node(N),M=I.parent;_.edge(N,M).cutvalue=d(_,E,N)}function d(_,E,N){var I=_.node(N),M=I.parent,R=!0,C=E.edge(N,M),A=0;return C||(R=!1,C=E.edge(M,N)),A=C.weight,E.nodeEdges(N).forEach(F=>{var L=F.v===N,$=L?F.w:F.v;if($!==M){var Z=L===R,j=E.edge(F).weight;if(A+=Z?j:-j,b(_,N,$)){var G=_.edge(N,$).cutvalue;A+=Z?-G:G}}}),A}function m(_,E){arguments.length<2&&(E=_.nodes()[0]),h(_,{},1,E)}function h(_,E,N,I,M){var R=N,C=_.node(I);return E[I]=!0,_.neighbors(I).forEach(A=>{Object.hasOwn(E,A)||(N=h(_,E,N,A,I))}),C.low=R,C.lim=N++,M?C.parent=M:delete C.parent,N}function g(_){return _.edges().find(E=>_.edge(E).cutvalue<0)}function v(_,E,N){var I=N.v,M=N.w;E.hasEdge(I,M)||(I=N.w,M=N.v);var R=_.node(I),C=_.node(M),A=R,F=!1;R.lim>C.lim&&(A=C,F=!0);var L=E.edges().filter($=>F===k(_,_.node($.v),A)&&F!==k(_,_.node($.w),A));return L.reduce(($,Z)=>t(E,Z)<t(E,$)?Z:$)}function S(_,E,N,I){var M=N.v,R=N.w;_.removeEdge(M,R),_.setEdge(I.v,I.w,{}),m(_),c(_,E),w(_,E)}function w(_,E){var N=_.nodes().find(M=>!E.node(M).parent),I=i(_,N);I=I.slice(1),I.forEach(M=>{var R=_.node(M).parent,C=E.edge(M,R),A=!1;C||(C=E.edge(R,M),A=!0),E.node(M).rank=E.node(R).rank+(A?C.minlen:-C.minlen)})}function b(_,E,N){return _.hasEdge(E,N)}function k(_,E,N){return N.low<=E.lim&&E.lim<=N.lim}return _d}var Nd,Y0;function GP(){if(Y0)return Nd;Y0=1;var e=ou(),t=e.longestPath,n=rx(),i=KP();Nd=s;function s(f){var d=f.graph().ranker;if(d instanceof Function)return d(f);switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":a(f);break;case"longest-path":l(f);break;case"none":break;default:c(f)}}var l=t;function a(f){t(f),n(f)}function c(f){i(f)}return Nd}var Cd,K0;function XP(){if(K0)return Cd;K0=1,Cd=e;function e(i){let s=n(i);i.graph().dummyChains.forEach(l=>{let a=i.node(l),c=a.edgeObj,f=t(i,s,c.v,c.w),d=f.path,m=f.lca,h=0,g=d[h],v=!0;for(;l!==c.w;){if(a=i.node(l),v){for(;(g=d[h])!==m&&i.node(g).maxRank<a.rank;)h++;g===m&&(v=!1)}if(!v){for(;h<d.length-1&&i.node(g=d[h+1]).minRank<=a.rank;)h++;g=d[h]}i.setParent(l,g),l=i.successors(l)[0]}})}function t(i,s,l,a){let c=[],f=[],d=Math.min(s[l].low,s[a].low),m=Math.max(s[l].lim,s[a].lim),h,g;h=l;do h=i.parent(h),c.push(h);while(h&&(s[h].low>d||m>s[h].lim));for(g=h,h=a;(h=i.parent(h))!==g;)f.push(h);return{path:c.concat(f.reverse()),lca:g}}function n(i){let s={},l=0;function a(c){let f=l;i.children(c).forEach(a),s[c]={low:f,lim:l++}}return i.children().forEach(a),s}return Cd}var Td,G0;function QP(){if(G0)return Td;G0=1;let e=tt();Td={run:t,cleanup:l};function t(a){let c=e.addDummyNode(a,"root",{},"_root"),f=i(a),d=Object.values(f),m=e.applyWithChunking(Math.max,d)-1,h=2*m+1;a.graph().nestingRoot=c,a.edges().forEach(v=>a.edge(v).minlen*=h);let g=s(a)+1;a.children().forEach(v=>n(a,c,h,g,m,f,v)),a.graph().nodeRankFactor=h}function n(a,c,f,d,m,h,g){let v=a.children(g);if(!v.length){g!==c&&a.setEdge(c,g,{weight:0,minlen:f});return}let S=e.addBorderNode(a,"_bt"),w=e.addBorderNode(a,"_bb"),b=a.node(g);a.setParent(S,g),b.borderTop=S,a.setParent(w,g),b.borderBottom=w,v.forEach(k=>{n(a,c,f,d,m,h,k);let _=a.node(k),E=_.borderTop?_.borderTop:k,N=_.borderBottom?_.borderBottom:k,I=_.borderTop?d:2*d,M=E!==N?1:m-h[g]+1;a.setEdge(S,E,{weight:I,minlen:M,nestingEdge:!0}),a.setEdge(N,w,{weight:I,minlen:M,nestingEdge:!0})}),a.parent(g)||a.setEdge(c,S,{weight:0,minlen:m+h[g]})}function i(a){var c={};function f(d,m){var h=a.children(d);h&&h.length&&h.forEach(g=>f(g,m+1)),c[d]=m}return a.children().forEach(d=>f(d,1)),c}function s(a){return a.edges().reduce((c,f)=>c+a.edge(f).weight,0)}function l(a){var c=a.graph();a.removeNode(c.nestingRoot),delete c.nestingRoot,a.edges().forEach(f=>{var d=a.edge(f);d.nestingEdge&&a.removeEdge(f)})}return Td}var Od,X0;function JP(){if(X0)return Od;X0=1;let e=tt();Od=t;function t(i){function s(l){let a=i.children(l),c=i.node(l);if(a.length&&a.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,d=c.maxRank+1;f<d;++f)n(i,"borderLeft","_bl",l,c,f),n(i,"borderRight","_br",l,c,f)}}i.children().forEach(s)}function n(i,s,l,a,c,f){let d={width:0,height:0,rank:f,borderType:s},m=c[s][f-1],h=e.addDummyNode(i,"border",d,l);c[s][f]=h,i.setParent(h,a),m&&i.setEdge(m,h,{weight:1})}return Od}var Pd,Q0;function ZP(){if(Q0)return Pd;Q0=1,Pd={adjust:e,undo:t};function e(f){let d=f.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(f)}function t(f){let d=f.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(f),(d==="lr"||d==="rl")&&(a(f),n(f))}function n(f){f.nodes().forEach(d=>i(f.node(d))),f.edges().forEach(d=>i(f.edge(d)))}function i(f){let d=f.width;f.width=f.height,f.height=d}function s(f){f.nodes().forEach(d=>l(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(l),Object.hasOwn(m,"y")&&l(m)})}function l(f){f.y=-f.y}function a(f){f.nodes().forEach(d=>c(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(f){let d=f.x;f.x=f.y,f.y=d}return Pd}var Id,J0;function eI(){if(J0)return Id;J0=1;let e=tt();Id=t;function t(n){let i={},s=n.nodes().filter(m=>!n.children(m).length),l=s.map(m=>n.node(m).rank),a=e.applyWithChunking(Math.max,l),c=e.range(a+1).map(()=>[]);function f(m){if(i[m])return;i[m]=!0;let h=n.node(m);c[h.rank].push(m),n.successors(m).forEach(f)}return s.sort((m,h)=>n.node(m).rank-n.node(h).rank).forEach(f),c}return Id}var Ad,Z0;function tI(){if(Z0)return Ad;Z0=1;let e=tt().zipObject;Ad=t;function t(i,s){let l=0;for(let a=1;a<s.length;++a)l+=n(i,s[a-1],s[a]);return l}function n(i,s,l){let a=e(l,l.map((g,v)=>v)),c=s.flatMap(g=>i.outEdges(g).map(v=>({pos:a[v.w],weight:i.edge(v).weight})).sort((v,S)=>v.pos-S.pos)),f=1;for(;f<l.length;)f<<=1;let d=2*f-1;f-=1;let m=new Array(d).fill(0),h=0;return c.forEach(g=>{let v=g.pos+f;m[v]+=g.weight;let S=0;for(;v>0;)v%2&&(S+=m[v+1]),v=v-1>>1,m[v]+=g.weight;h+=g.weight*S}),h}return Ad}var Md,ev;function nI(){if(ev)return Md;ev=1,Md=e;function e(t,n=[]){return n.map(i=>{let s=t.inEdges(i);if(s.length){let l=s.reduce((a,c)=>{let f=t.edge(c),d=t.node(c.v);return{sum:a.sum+f.weight*d.order,weight:a.weight+f.weight}},{sum:0,weight:0});return{v:i,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:i}})}return Md}var Ld,tv;function rI(){if(tv)return Ld;tv=1;let e=tt();Ld=t;function t(s,l){let a={};s.forEach((f,d)=>{let m=a[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:d};f.barycenter!==void 0&&(m.barycenter=f.barycenter,m.weight=f.weight)}),l.edges().forEach(f=>{let d=a[f.v],m=a[f.w];d!==void 0&&m!==void 0&&(m.indegree++,d.out.push(a[f.w]))});let c=Object.values(a).filter(f=>!f.indegree);return n(c)}function n(s){let l=[];function a(f){return d=>{d.merged||(d.barycenter===void 0||f.barycenter===void 0||d.barycenter>=f.barycenter)&&i(f,d)}}function c(f){return d=>{d.in.push(f),--d.indegree===0&&s.push(d)}}for(;s.length;){let f=s.pop();l.push(f),f.in.reverse().forEach(a(f)),f.out.forEach(c(f))}return l.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function i(s,l){let a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),l.weight&&(a+=l.barycenter*l.weight,c+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(l.i,s.i),l.merged=!0}return Ld}var Rd,nv;function iI(){if(nv)return Rd;nv=1;let e=tt();Rd=t;function t(s,l){let a=e.partition(s,S=>Object.hasOwn(S,"barycenter")),c=a.lhs,f=a.rhs.sort((S,w)=>w.i-S.i),d=[],m=0,h=0,g=0;c.sort(i(!!l)),g=n(d,f,g),c.forEach(S=>{g+=S.vs.length,d.push(S.vs),m+=S.barycenter*S.weight,h+=S.weight,g=n(d,f,g)});let v={vs:d.flat(!0)};return h&&(v.barycenter=m/h,v.weight=h),v}function n(s,l,a){let c;for(;l.length&&(c=l[l.length-1]).i<=a;)l.pop(),s.push(c.vs),a++;return a}function i(s){return(l,a)=>l.barycenter<a.barycenter?-1:l.barycenter>a.barycenter?1:s?a.i-l.i:l.i-a.i}return Rd}var Dd,rv;function oI(){if(rv)return Dd;rv=1;let e=nI(),t=rI(),n=iI();Dd=i;function i(a,c,f,d){let m=a.children(c),h=a.node(c),g=h?h.borderLeft:void 0,v=h?h.borderRight:void 0,S={};g&&(m=m.filter(_=>_!==g&&_!==v));let w=e(a,m);w.forEach(_=>{if(a.children(_.v).length){let E=i(a,_.v,f,d);S[_.v]=E,Object.hasOwn(E,"barycenter")&&l(_,E)}});let b=t(w,f);s(b,S);let k=n(b,d);if(g&&(k.vs=[g,k.vs,v].flat(!0),a.predecessors(g).length)){let _=a.node(a.predecessors(g)[0]),E=a.node(a.predecessors(v)[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+_.order+E.order)/(k.weight+2),k.weight+=2}return k}function s(a,c){a.forEach(f=>{f.vs=f.vs.flatMap(d=>c[d]?c[d].vs:d)})}function l(a,c){a.barycenter!==void 0?(a.barycenter=(a.barycenter*a.weight+c.barycenter*c.weight)/(a.weight+c.weight),a.weight+=c.weight):(a.barycenter=c.barycenter,a.weight=c.weight)}return Dd}var jd,iv;function sI(){if(iv)return jd;iv=1;let e=yn().Graph,t=tt();jd=n;function n(s,l,a,c){c||(c=s.nodes());let f=i(s),d=new e({compound:!0}).setGraph({root:f}).setDefaultNodeLabel(m=>s.node(m));return c.forEach(m=>{let h=s.node(m),g=s.parent(m);(h.rank===l||h.minRank<=l&&l<=h.maxRank)&&(d.setNode(m),d.setParent(m,g||f),s[a](m).forEach(v=>{let S=v.v===m?v.w:v.v,w=d.edge(S,m),b=w!==void 0?w.weight:0;d.setEdge(S,m,{weight:s.edge(v).weight+b})}),Object.hasOwn(h,"minRank")&&d.setNode(m,{borderLeft:h.borderLeft[l],borderRight:h.borderRight[l]}))}),d}function i(s){for(var l;s.hasNode(l=t.uniqueId("_root")););return l}return jd}var $d,ov;function lI(){if(ov)return $d;ov=1,$d=e;function e(t,n,i){let s={},l;i.forEach(a=>{let c=t.parent(a),f,d;for(;c;){if(f=t.parent(c),f?(d=s[f],s[f]=c):(d=l,l=c),d&&d!==c){n.setEdge(d,c);return}c=f}})}return $d}var zd,sv;function aI(){if(sv)return zd;sv=1;let e=eI(),t=tI(),n=oI(),i=sI(),s=lI(),l=yn().Graph,a=tt();zd=c;function c(h,g){if(g&&typeof g.customOrder=="function"){g.customOrder(h,c);return}let v=a.maxRank(h),S=f(h,a.range(1,v+1),"inEdges"),w=f(h,a.range(v-1,-1,-1),"outEdges"),b=e(h);if(m(h,b),g&&g.disableOptimalOrderHeuristic)return;let k=Number.POSITIVE_INFINITY,_;for(let E=0,N=0;N<4;++E,++N){d(E%2?S:w,E%4>=2),b=a.buildLayerMatrix(h);let I=t(h,b);I<k&&(N=0,_=Object.assign({},b),k=I)}m(h,_)}function f(h,g,v){const S=new Map,w=(b,k)=>{S.has(b)||S.set(b,[]),S.get(b).push(k)};for(const b of h.nodes()){const k=h.node(b);if(typeof k.rank=="number"&&w(k.rank,b),typeof k.minRank=="number"&&typeof k.maxRank=="number")for(let _=k.minRank;_<=k.maxRank;_++)_!==k.rank&&w(_,b)}return g.map(function(b){return i(h,b,v,S.get(b)||[])})}function d(h,g){let v=new l;h.forEach(function(S){let w=S.graph().root,b=n(S,w,v,g);b.vs.forEach((k,_)=>S.node(k).order=_),s(S,v,b.vs)})}function m(h,g){Object.values(g).forEach(v=>v.forEach((S,w)=>h.node(S).order=w))}return zd}var Fd,lv;function uI(){if(lv)return Fd;lv=1;let e=yn().Graph,t=tt();Fd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:l,hasConflict:a,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:h,findSmallestWidthAlignment:m,balance:g};function n(b,k){let _={};function E(N,I){let M=0,R=0,C=N.length,A=I[I.length-1];return I.forEach((F,L)=>{let $=s(b,F),Z=$?b.node($).order:C;($||F===A)&&(I.slice(R,L+1).forEach(j=>{b.predecessors(j).forEach(G=>{let q=b.node(G),J=q.order;(J<M||Z<J)&&!(q.dummy&&b.node(j).dummy)&&l(_,G,j)})}),R=L+1,M=Z)}),I}return k.length&&k.reduce(E),_}function i(b,k){let _={};function E(I,M,R,C,A){let F;t.range(M,R).forEach(L=>{F=I[L],b.node(F).dummy&&b.predecessors(F).forEach($=>{let Z=b.node($);Z.dummy&&(Z.order<C||Z.order>A)&&l(_,$,F)})})}function N(I,M){let R=-1,C,A=0;return M.forEach((F,L)=>{if(b.node(F).dummy==="border"){let $=b.predecessors(F);$.length&&(C=b.node($[0]).order,E(M,A,L,R,C),A=L,R=C)}E(M,A,M.length,C,I.length)}),M}return k.length&&k.reduce(N),_}function s(b,k){if(b.node(k).dummy)return b.predecessors(k).find(_=>b.node(_).dummy)}function l(b,k,_){if(k>_){let N=k;k=_,_=N}let E=b[k];E||(b[k]=E={}),E[_]=!0}function a(b,k,_){if(k>_){let E=k;k=_,_=E}return!!b[k]&&Object.hasOwn(b[k],_)}function c(b,k,_,E){let N={},I={},M={};return k.forEach(R=>{R.forEach((C,A)=>{N[C]=C,I[C]=C,M[C]=A})}),k.forEach(R=>{let C=-1;R.forEach(A=>{let F=E(A);if(F.length){F=F.sort(($,Z)=>M[$]-M[Z]);let L=(F.length-1)/2;for(let $=Math.floor(L),Z=Math.ceil(L);$<=Z;++$){let j=F[$];I[A]===A&&C<M[j]&&!a(_,A,j)&&(I[j]=A,I[A]=N[A]=N[j],C=M[j])}}})}),{root:N,align:I}}function f(b,k,_,E,N){let I={},M=d(b,k,_,N),R=N?"borderLeft":"borderRight";function C(L,$){let Z=M.nodes(),j=Z.pop(),G={};for(;j;)G[j]?L(j):(G[j]=!0,Z.push(j),Z=Z.concat($(j))),j=Z.pop()}function A(L){I[L]=M.inEdges(L).reduce(($,Z)=>Math.max($,I[Z.v]+M.edge(Z)),0)}function F(L){let $=M.outEdges(L).reduce((j,G)=>Math.min(j,I[G.w]-M.edge(G)),Number.POSITIVE_INFINITY),Z=b.node(L);$!==Number.POSITIVE_INFINITY&&Z.borderType!==R&&(I[L]=Math.max(I[L],$))}return C(A,M.predecessors.bind(M)),C(F,M.successors.bind(M)),Object.keys(E).forEach(L=>I[L]=I[_[L]]),I}function d(b,k,_,E){let N=new e,I=b.graph(),M=S(I.nodesep,I.edgesep,E);return k.forEach(R=>{let C;R.forEach(A=>{let F=_[A];if(N.setNode(F),C){var L=_[C],$=N.edge(L,F);N.setEdge(L,F,Math.max(M(b,A,C),$||0))}C=A})}),N}function m(b,k){return Object.values(k).reduce((_,E)=>{let N=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([R,C])=>{let A=w(b,R)/2;N=Math.max(C+A,N),I=Math.min(C-A,I)});const M=N-I;return M<_[0]&&(_=[M,E]),_},[Number.POSITIVE_INFINITY,null])[1]}function h(b,k){let _=Object.values(k),E=t.applyWithChunking(Math.min,_),N=t.applyWithChunking(Math.max,_);["u","d"].forEach(I=>{["l","r"].forEach(M=>{let R=I+M,C=b[R];if(C===k)return;let A=Object.values(C),F=E-t.applyWithChunking(Math.min,A);M!=="l"&&(F=N-t.applyWithChunking(Math.max,A)),F&&(b[R]=t.mapValues(C,L=>L+F))})})}function g(b,k){return t.mapValues(b.ul,(_,E)=>{if(k)return b[k.toLowerCase()][E];{let N=Object.values(b).map(I=>I[E]).sort((I,M)=>I-M);return(N[1]+N[2])/2}})}function v(b){let k=t.buildLayerMatrix(b),_=Object.assign(n(b,k),i(b,k)),E={},N;["u","d"].forEach(M=>{N=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(R=>{R==="r"&&(N=N.map(L=>Object.values(L).reverse()));let C=(M==="u"?b.predecessors:b.successors).bind(b),A=c(b,N,_,C),F=f(b,N,A.root,A.align,R==="r");R==="r"&&(F=t.mapValues(F,L=>-L)),E[M+R]=F})});let I=m(b,E);return h(E,I),g(E,b.graph().align)}function S(b,k,_){return(E,N,I)=>{let M=E.node(N),R=E.node(I),C=0,A;if(C+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":A=-M.width/2;break;case"r":A=M.width/2;break}if(A&&(C+=_?A:-A),A=0,C+=(M.dummy?k:b)/2,C+=(R.dummy?k:b)/2,C+=R.width/2,Object.hasOwn(R,"labelpos"))switch(R.labelpos.toLowerCase()){case"l":A=R.width/2;break;case"r":A=-R.width/2;break}return A&&(C+=_?A:-A),A=0,C}}function w(b,k){return b.node(k).width}return Fd}var Bd,av;function cI(){if(av)return Bd;av=1;let e=tt(),t=uI().positionX;Bd=n;function n(s){s=e.asNonCompoundGraph(s),i(s),Object.entries(t(s)).forEach(([l,a])=>s.node(l).x=a)}function i(s){let l=e.buildLayerMatrix(s),a=s.graph().ranksep,c=0;l.forEach(f=>{const d=f.reduce((m,h)=>{const g=s.node(h).height;return m>g?m:g},0);f.forEach(m=>s.node(m).y=c+d/2),c+=d+a})}return Bd}var Vd,uv;function fI(){if(uv)return Vd;uv=1;let e=qP(),t=YP(),n=GP(),i=tt().normalizeRanks,s=XP(),l=tt().removeEmptyRanks,a=QP(),c=JP(),f=ZP(),d=aI(),m=cI(),h=tt(),g=yn().Graph;Vd=v;function v(V,K){let Q=K&&K.debugTiming?h.time:h.notime;Q("layout",()=>{let re=Q(" buildLayoutGraph",()=>C(V));Q(" runLayout",()=>S(re,Q,K)),Q(" updateInputGraph",()=>w(V,re))})}function S(V,K,Q){K(" makeSpaceForEdgeLabels",()=>A(V)),K(" removeSelfEdges",()=>Y(V)),K(" acyclic",()=>e.run(V)),K(" nestingGraph.run",()=>a.run(V)),K(" rank",()=>n(h.asNonCompoundGraph(V))),K(" injectEdgeLabelProxies",()=>F(V)),K(" removeEmptyRanks",()=>l(V)),K(" nestingGraph.cleanup",()=>a.cleanup(V)),K(" normalizeRanks",()=>i(V)),K(" assignRankMinMax",()=>L(V)),K(" removeEdgeLabelProxies",()=>$(V)),K(" normalize.run",()=>t.run(V)),K(" parentDummyChains",()=>s(V)),K(" addBorderSegments",()=>c(V)),K(" order",()=>d(V,Q)),K(" insertSelfEdges",()=>U(V)),K(" adjustCoordinateSystem",()=>f.adjust(V)),K(" position",()=>m(V)),K(" positionSelfEdges",()=>B(V)),K(" removeBorderNodes",()=>J(V)),K(" normalize.undo",()=>t.undo(V)),K(" fixupEdgeLabelCoords",()=>G(V)),K(" undoCoordinateSystem",()=>f.undo(V)),K(" translateGraph",()=>Z(V)),K(" assignNodeIntersects",()=>j(V)),K(" reversePoints",()=>q(V)),K(" acyclic.undo",()=>e.undo(V))}function w(V,K){V.nodes().forEach(Q=>{let re=V.node(Q),se=K.node(Q);re&&(re.x=se.x,re.y=se.y,re.rank=se.rank,K.children(Q).length&&(re.width=se.width,re.height=se.height))}),V.edges().forEach(Q=>{let re=V.edge(Q),se=K.edge(Q);re.points=se.points,Object.hasOwn(se,"x")&&(re.x=se.x,re.y=se.y)}),V.graph().width=K.graph().width,V.graph().height=K.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],E=["width","height","rank"],N={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},R=["labelpos"];function C(V){let K=new g({multigraph:!0,compound:!0}),Q=W(V.graph());return K.setGraph(Object.assign({},k,D(Q,b),h.pick(Q,_))),V.nodes().forEach(re=>{let se=W(V.node(re));const ee=D(se,E);Object.keys(N).forEach(oe=>{ee[oe]===void 0&&(ee[oe]=N[oe])}),K.setNode(re,ee),K.setParent(re,V.parent(re))}),V.edges().forEach(re=>{let se=W(V.edge(re));K.setEdge(re,Object.assign({},M,D(se,I),h.pick(se,R)))}),K}function A(V){let K=V.graph();K.ranksep/=2,V.edges().forEach(Q=>{let re=V.edge(Q);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function F(V){V.edges().forEach(K=>{let Q=V.edge(K);if(Q.width&&Q.height){let re=V.node(K.v),ee={rank:(V.node(K.w).rank-re.rank)/2+re.rank,e:K};h.addDummyNode(V,"edge-proxy",ee,"_ep")}})}function L(V){let K=0;V.nodes().forEach(Q=>{let re=V.node(Q);re.borderTop&&(re.minRank=V.node(re.borderTop).rank,re.maxRank=V.node(re.borderBottom).rank,K=Math.max(K,re.maxRank))}),V.graph().maxRank=K}function $(V){V.nodes().forEach(K=>{let Q=V.node(K);Q.dummy==="edge-proxy"&&(V.edge(Q.e).labelRank=Q.rank,V.removeNode(K))})}function Z(V){let K=Number.POSITIVE_INFINITY,Q=0,re=Number.POSITIVE_INFINITY,se=0,ee=V.graph(),oe=ee.marginx||0,de=ee.marginy||0;function xe(he){let fe=he.x,ke=he.y,Ie=he.width,Ae=he.height;K=Math.min(K,fe-Ie/2),Q=Math.max(Q,fe+Ie/2),re=Math.min(re,ke-Ae/2),se=Math.max(se,ke+Ae/2)}V.nodes().forEach(he=>xe(V.node(he))),V.edges().forEach(he=>{let fe=V.edge(he);Object.hasOwn(fe,"x")&&xe(fe)}),K-=oe,re-=de,V.nodes().forEach(he=>{let fe=V.node(he);fe.x-=K,fe.y-=re}),V.edges().forEach(he=>{let fe=V.edge(he);fe.points.forEach(ke=>{ke.x-=K,ke.y-=re}),Object.hasOwn(fe,"x")&&(fe.x-=K),Object.hasOwn(fe,"y")&&(fe.y-=re)}),ee.width=Q-K+oe,ee.height=se-re+de}function j(V){V.edges().forEach(K=>{let Q=V.edge(K),re=V.node(K.v),se=V.node(K.w),ee,oe;Q.points?(ee=Q.points[0],oe=Q.points[Q.points.length-1]):(Q.points=[],ee=se,oe=re),Q.points.unshift(h.intersectRect(re,ee)),Q.points.push(h.intersectRect(se,oe))})}function G(V){V.edges().forEach(K=>{let Q=V.edge(K);if(Object.hasOwn(Q,"x"))switch((Q.labelpos==="l"||Q.labelpos==="r")&&(Q.width-=Q.labeloffset),Q.labelpos){case"l":Q.x-=Q.width/2+Q.labeloffset;break;case"r":Q.x+=Q.width/2+Q.labeloffset;break}})}function q(V){V.edges().forEach(K=>{let Q=V.edge(K);Q.reversed&&Q.points.reverse()})}function J(V){V.nodes().forEach(K=>{if(V.children(K).length){let Q=V.node(K),re=V.node(Q.borderTop),se=V.node(Q.borderBottom),ee=V.node(Q.borderLeft[Q.borderLeft.length-1]),oe=V.node(Q.borderRight[Q.borderRight.length-1]);Q.width=Math.abs(oe.x-ee.x),Q.height=Math.abs(se.y-re.y),Q.x=ee.x+Q.width/2,Q.y=re.y+Q.height/2}}),V.nodes().forEach(K=>{V.node(K).dummy==="border"&&V.removeNode(K)})}function Y(V){V.edges().forEach(K=>{if(K.v===K.w){var Q=V.node(K.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:K,label:V.edge(K)}),V.removeEdge(K)}})}function U(V){var K=h.buildLayerMatrix(V);K.forEach(Q=>{var re=0;Q.forEach((se,ee)=>{var oe=V.node(se);oe.order=ee+re,(oe.selfEdges||[]).forEach(de=>{h.addDummyNode(V,"selfedge",{width:de.label.width,height:de.label.height,rank:oe.rank,order:ee+ ++re,e:de.e,label:de.label},"_se")}),delete oe.selfEdges})})}function B(V){V.nodes().forEach(K=>{var Q=V.node(K);if(Q.dummy==="selfedge"){var re=V.node(Q.e.v),se=re.x+re.width/2,ee=re.y,oe=Q.x-se,de=re.height/2;V.setEdge(Q.e,Q.label),V.removeNode(K),Q.label.points=[{x:se+2*oe/3,y:ee-de},{x:se+5*oe/6,y:ee-de},{x:se+oe,y:ee},{x:se+5*oe/6,y:ee+de},{x:se+2*oe/3,y:ee+de}],Q.label.x=Q.x,Q.label.y=Q.y}})}function D(V,K){return h.mapValues(h.pick(V,K),Number)}function W(V){var K={};return V&&Object.entries(V).forEach(([Q,re])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),K[Q]=re}),K}return Vd}var Wd,cv;function dI(){if(cv)return Wd;cv=1;let e=tt(),t=yn().Graph;Wd={debugOrdering:n};function n(i){let s=e.buildLayerMatrix(i),l=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(a=>{l.setNode(a,{label:a}),l.setParent(a,"layer"+i.node(a).rank)}),i.edges().forEach(a=>l.setEdge(a.v,a.w,{},a.name)),s.forEach((a,c)=>{let f="layer"+c;l.setNode(f,{rank:"same"}),a.reduce((d,m)=>(l.setEdge(d,m,{style:"invis"}),m))}),l}return Wd}var Ud,fv;function hI(){return fv||(fv=1,Ud="1.1.8"),Ud}var Hd,dv;function pI(){return dv||(dv=1,Hd={graphlib:yn(),layout:fI(),debug:dI(),util:{time:tt().time,notime:tt().notime},version:hI()}),Hd}var mI=pI();const hv=du(mI),pv=220,mv=140,qd=60;function gI(e){return O.useMemo(()=>{if(!e)return{nodes:[],edges:[]};const t=new hv.graphlib.Graph;t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"LR",nodesep:40,ranksep:80});for(const s of e.nodes){const l=s.type==="task.branch"||s.type.startsWith("trigger.")?mv:pv;t.setNode(s.id,{width:l,height:qd})}for(const s of e.edges)t.setEdge(s.from,s.to);hv.layout(t);const n=e.nodes.map(s=>{const l=t.node(s.id),a=s.type==="task.branch"||s.type.startsWith("trigger.")?mv:pv;return{id:s.id,type:s.type==="agent.run"?"agentNode":"workflowNode",position:{x:l.x-a/2,y:l.y-qd/2},data:{node:s},width:a,height:qd}}),i=e.edges.map((s,l)=>({id:`e-${l}`,source:s.from,target:s.to,label:s.when,type:"smoothstep",style:{stroke:"hsl(240 5% 65%)",strokeWidth:1.5},labelStyle:{fontSize:11,fontFamily:"JetBrains Mono, monospace"}}));return{nodes:n,edges:i}},[e])}const yI={workflowNode:w0,agentNode:w0};function vI({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:s,edges:l}=gI(e),[a,c]=O.useState(!1),f=s.map(v=>({...v,data:{...v.data,onNodeClick:t,liveStatus:i[v.id]??"idle"}})),d=O.useCallback((v,S)=>{const w=S.data.node;w&&t(w)},[t]),m=O.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="copy",c(!0)},[]),h=O.useCallback(()=>{c(!1)},[]),g=O.useCallback(v=>{v.preventDefault(),c(!1);const S=v.dataTransfer.files[0];if(!S)return;const w=new FileReader;w.onload=b=>{var _;const k=(_=b.target)==null?void 0:_.result;typeof k=="string"&&n(k)},w.readAsText(S)},[n]);return P.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:m,onDragLeave:h,onDrop:g,children:[P.jsxs(nO,{nodes:f,edges:l,nodeTypes:yI,onNodeClick:d,fitView:!0,attributionPosition:"bottom-right",children:[P.jsx(lO,{variant:Qn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),P.jsx(pO,{})]}),a&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/70 border-2 border-dashed border-primary pointer-events-none z-10",children:P.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),P.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"})]})}function kt(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 gv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wI(...e){return t=>{let n=!1;const i=e.map(s=>{const l=gv(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():gv(e[s],null)}}}}function Ut(...e){return O.useCallback(wI(...e),e)}function ix(e,t=[]){let n=[];function i(l,a){const c=O.createContext(a);c.displayName=l+"Context";const f=n.length;n=[...n,a];const d=h=>{var k;const{scope:g,children:v,...S}=h,w=((k=g==null?void 0:g[e])==null?void 0:k[f])||c,b=O.useMemo(()=>S,Object.values(S));return P.jsx(w.Provider,{value:b,children:v})};d.displayName=l+"Provider";function m(h,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[f])||c,S=O.useContext(v);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${l}\``)}return[d,m]}const s=()=>{const l=n.map(a=>O.createContext(a));return function(c){const f=(c==null?void 0:c[e])||l;return O.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return s.scopeName=e,[i,xI(s,...t)]}function xI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const a=i.reduce((c,{useScope:f,scopeName:d})=>{const h=f(l)[`__scope${d}`];return{...c,...h}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var fo=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},bI=Ih[" useId ".trim().toString()]||(()=>{}),SI=0;function Yd(e){const[t,n]=O.useState(bI());return fo(()=>{n(i=>i??String(SI++))},[e]),e||(t?`radix-${t}`:"")}var kI=Ih[" useInsertionEffect ".trim().toString()]||fo;function EI({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,l,a]=_I({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s;{const m=O.useRef(e!==void 0);O.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${i} is changing from ${h?"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,i])}const d=O.useCallback(m=>{var h;if(c){const g=NI(m)?m(e):m;g!==e&&((h=a.current)==null||h.call(a,g))}else l(m)},[c,e,l,a]);return[f,d]}function _I({defaultProp:e,onChange:t}){const[n,i]=O.useState(e),s=O.useRef(n),l=O.useRef(t);return kI(()=>{l.current=t},[t]),O.useEffect(()=>{var a;s.current!==n&&((a=l.current)==null||a.call(l,n),s.current=n)},[n,s]),[n,i,l]}function NI(e){return typeof e=="function"}function ox(e){const t=O.forwardRef((n,i)=>{let{children:s,...l}=n,a=null,c=!1;const f=[];yv(s)&&typeof Na=="function"&&(s=Na(s._payload)),O.Children.forEach(s,g=>{var v;if(II(g)){c=!0;const S=g;let w="child"in S.props?S.props.child:S.props.children;yv(w)&&typeof Na=="function"&&(w=Na(w._payload)),a=TI(S,w),f.push((v=a==null?void 0:a.props)==null?void 0:v.children)}else f.push(g)}),a?a=O.cloneElement(a,void 0,f):!c&&O.Children.count(s)===1&&O.isValidElement(s)&&(a=s);const d=a?PI(a):void 0,m=Ut(i,d);if(!a){if(s||s===0)throw new Error(c?RI(e):LI(e));return s}const h=OI(l,a.props??{});return a.type!==O.Fragment&&(h.ref=i?m:d),O.cloneElement(a,h)});return t.displayName=`${e}.Slot`,t}var CI=Symbol.for("radix.slottable"),TI=(e,t)=>{if("child"in e.props){const n=e.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,e.props.children(n.props.children)):null}return O.isValidElement(t)?t:null};function OI(e,t){const n={...t};for(const i in t){const s=e[i],l=t[i];/^on[A-Z]/.test(i)?s&&l?n[i]=(...c)=>{const f=l(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...l}:i==="className"&&(n[i]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function PI(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function II(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CI}var AI=Symbol.for("react.lazy");function yv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AI&&"_payload"in e&&MI(e._payload)}function MI(e){return typeof e=="object"&&e!==null&&"then"in e}var LI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,RI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Na=Ih[" use ".trim().toString()],DI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=DI.reduce((e,t)=>{const n=ox(`Primitive.${t}`),i=O.forwardRef((s,l)=>{const{asChild:a,...c}=s,f=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(f,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function jI(e,t){e&&Zw.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function $I(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);O.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var zI="DismissableLayer",Sh="dismissableLayer.update",FI="dismissableLayer.pointerDownOutside",BI="dismissableLayer.focusOutside",vv,ep=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),sx=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:a,onInteractOutside:c,onDismiss:f,...d}=e,m=O.useContext(ep),[h,g]=O.useState(null),v=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=O.useState({}),w=Ut(t,A=>g(A)),b=Array.from(m.layers),[k]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=b.indexOf(k),E=h?b.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,I=E>=_,M=O.useRef(!1),R=HI(A=>{const F=A.target;if(!(F instanceof Node))return;const L=[...m.branches].some($=>$.contains(F));!I||L||(l==null||l(A),c==null||c(A),A.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:m.dismissableSurfaces}),C=qI(A=>{if(i&&M.current)return;const F=A.target;[...m.branches].some($=>$.contains(F))||(a==null||a(A),c==null||c(A),A.defaultPrevented||f==null||f())},v);return $I(A=>{E===m.layers.size-1&&(s==null||s(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},v),O.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(vv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),wv(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=vv))}},[h,v,n,m]),O.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),wv())},[h,m]),O.useEffect(()=>{const A=()=>S({});return document.addEventListener(Sh,A),()=>document.removeEventListener(Sh,A)},[]),P.jsx(Lt.div,{...d,ref:w,style:{pointerEvents:N?I?"auto":"none":void 0,...e.style},onFocusCapture:kt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:kt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:kt(e.onPointerDownCapture,R.onPointerDownCapture)})});sx.displayName=zI;var VI="DismissableLayerBranch",WI=O.forwardRef((e,t)=>{const n=O.useContext(ep),i=O.useRef(null),s=Ut(t,i);return O.useEffect(()=>{const l=i.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),P.jsx(Lt.div,{...e,ref:s})});WI.displayName=VI;function UI(){const e=O.useContext(ep),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function HI(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:l}=t,a=Zt(e),c=O.useRef(!1),f=O.useRef(!1),d=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function h(){f.current=!1,s.current=!1,d.current.clear()}function g(){return Array.from(d.current.values()).some(Boolean)}function v(_){if(!f.current)return;const E=_.target;E instanceof Node&&[...l].some(I=>I.contains(E))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function S(_){f.current&&d.current.set(_.type,!1)}const w=_=>{if(_.target&&!c.current){let E=function(){n.removeEventListener("click",m.current);const I=g();h(),I||lx(FI,a,N,{discrete:!0})};const N={originalEvent:_};f.current=!0,s.current=i&&_.button===0,d.current.clear(),!i||_.button!==0?E():(n.removeEventListener("click",m.current),m.current=E,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),h();c.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)n.addEventListener(_,v,!0),n.addEventListener(_,S);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const _ of b)n.removeEventListener(_,v,!0),n.removeEventListener(_,S)}},[n,a,i,s,l]),{onPointerDownCapture:()=>c.current=!0}}function qI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=O.useRef(!1);return O.useEffect(()=>{const s=l=>{l.target&&!i.current&&lx(BI,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function wv(){const e=new CustomEvent(Sh);document.dispatchEvent(e)}function lx(e,t,n,{discrete:i}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?jI(s,l):s.dispatchEvent(l)}var Kd="focusScope.autoFocusOnMount",Gd="focusScope.autoFocusOnUnmount",xv={bubbles:!1,cancelable:!0},YI="FocusScope",ax=O.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...a}=e,[c,f]=O.useState(null),d=Zt(s),m=Zt(l),h=O.useRef(null),g=Ut(t,w=>f(w)),v=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(i){let w=function(E){if(v.paused||!c)return;const N=E.target;c.contains(N)?h.current=N:_r(h.current,{select:!0})},b=function(E){if(v.paused||!c)return;const N=E.relatedTarget;N!==null&&(c.contains(N)||_r(h.current,{select:!0}))},k=function(E){if(document.activeElement===document.body)for(const I of E)I.removedNodes.length>0&&_r(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const _=new MutationObserver(k);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),_.disconnect()}}},[i,c,v.paused]),O.useEffect(()=>{if(c){Sv.add(v);const w=document.activeElement;if(!c.contains(w)){const k=new CustomEvent(Kd,xv);c.addEventListener(Kd,d),c.dispatchEvent(k),k.defaultPrevented||(KI(ZI(ux(c)),{select:!0}),document.activeElement===w&&_r(c))}return()=>{c.removeEventListener(Kd,d),setTimeout(()=>{const k=new CustomEvent(Gd,xv);c.addEventListener(Gd,m),c.dispatchEvent(k),k.defaultPrevented||_r(w??document.body,{select:!0}),c.removeEventListener(Gd,m),Sv.remove(v)},0)}}},[c,d,m,v]);const S=O.useCallback(w=>{if(!n&&!i||v.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(b&&k){const _=w.currentTarget,[E,N]=GI(_);E&&N?!w.shiftKey&&k===N?(w.preventDefault(),n&&_r(E,{select:!0})):w.shiftKey&&k===E&&(w.preventDefault(),n&&_r(N,{select:!0})):k===_&&w.preventDefault()}},[n,i,v.paused]);return P.jsx(Lt.div,{tabIndex:-1,...a,ref:g,onKeyDown:S})});ax.displayName=YI;function KI(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(_r(i,{select:t}),document.activeElement!==n)return}function GI(e){const t=ux(e),n=bv(t,e),i=bv(t.reverse(),e);return[n,i]}function ux(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bv(e,t){for(const n of e)if(!XI(n,{upTo:t}))return n}function XI(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 QI(e){return e instanceof HTMLInputElement&&"select"in e}function _r(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&QI(e)&&t&&e.select()}}var Sv=JI();function JI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kv(e,t),e.unshift(t)},remove(t){var n;e=kv(e,t),(n=e[0])==null||n.resume()}}}function kv(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function ZI(e){return e.filter(t=>t.tagName!=="A")}var eA="Portal",cx=O.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[s,l]=O.useState(!1);fo(()=>l(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Zw.createPortal(P.jsx(Lt.div,{...i,ref:t}),a):null});cx.displayName=eA;function tA(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var Ir=e=>{const{present:t,children:n}=e,i=nA(t),s=typeof n=="function"?n({present:i.isPresent}):O.Children.only(n),l=rA(i.ref,iA(s));return typeof n=="function"||i.isPresent?O.cloneElement(s,{ref:l}):null};Ir.displayName="Presence";function nA(e){const[t,n]=O.useState(),i=O.useRef(null),s=O.useRef(e),l=O.useRef("none"),a=e?"mounted":"unmounted",[c,f]=tA(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const d=Ca(i.current);l.current=c==="mounted"?d:"none"},[c]),fo(()=>{const d=i.current,m=s.current;if(m!==e){const g=l.current,v=Ca(d);e?f("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),fo(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=Ca(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(f("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=v=>{v.target===t&&(l.current=Ca(i.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:O.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function Ev(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rA(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const i=t.current;let s=!1;const l=i.map(a=>{const c=Ev(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<l.length;a++){const c=l[a];typeof c=="function"?c():Ev(i[a],null)}}},[])}function Ca(e){return(e==null?void 0:e.animationName)||"none"}function iA(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.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 Ta=0,On=null;function oA(){O.useEffect(()=>{On||(On={start:_v(),end:_v()});const{start:e,end:t}=On;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ta++,()=>{Ta===1&&(On==null||On.start.remove(),On==null||On.end.remove(),On=null),Ta=Math.max(0,Ta-1)}},[])}function _v(){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 In=function(){return In=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},In.apply(this,arguments)};function fx(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]]);return n}function sA(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var Wa="right-scroll-bar-position",Ua="width-before-scroll-bar",lA="with-scroll-bars-hidden",aA="--removed-body-scroll-bar-size";function Xd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function uA(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=t,n.facade}var cA=typeof window<"u"?O.useLayoutEffect:O.useEffect,Nv=new WeakMap;function fA(e,t){var n=uA(null,function(i){return e.forEach(function(s){return Xd(s,i)})});return cA(function(){var i=Nv.get(n);if(i){var s=new Set(i),l=new Set(e),a=n.current;s.forEach(function(c){l.has(c)||Xd(c,null)}),l.forEach(function(c){s.has(c)||Xd(c,a)})}Nv.set(n,e)},[e]),n}function dA(e){return e}function hA(e,t){t===void 0&&(t=dA);var n=[],i=!1,s={read:function(){if(i)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(l){var a=t(l,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(i=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var f=function(){var m=a;a=[],m.forEach(l)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(m){a.push(m),d()},filter:function(m){return a=a.filter(m),n}}}};return s}function pA(e){e===void 0&&(e={});var t=hA(null);return t.options=In({async:!0,ssr:!1},e),t}var dx=function(e){var t=e.sideCar,n=fx(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return O.createElement(i,In({},n))};dx.isSideCarExport=!0;function mA(e,t){return e.useMedium(t),dx}var hx=pA(),Qd=function(){},_u=O.forwardRef(function(e,t){var n=O.useRef(null),i=O.useState({onScrollCapture:Qd,onWheelCapture:Qd,onTouchMoveCapture:Qd}),s=i[0],l=i[1],a=e.forwardProps,c=e.children,f=e.className,d=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,S=e.noIsolation,w=e.inert,b=e.allowPinchZoom,k=e.as,_=k===void 0?"div":k,E=e.gapMode,N=fx(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=g,M=fA([n,t]),R=In(In({},N),s);return O.createElement(O.Fragment,null,m&&O.createElement(I,{sideCar:hx,removeScrollBar:d,shards:h,noRelative:v,noIsolation:S,inert:w,setCallbacks:l,allowPinchZoom:!!b,lockRef:n,gapMode:E}),a?O.cloneElement(O.Children.only(c),In(In({},R),{ref:M})):O.createElement(_,In({},R,{className:f,ref:M}),c))});_u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_u.classNames={fullWidth:Ua,zeroRight:Wa};var gA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gA();return t&&e.setAttribute("nonce",t),e}function vA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yA())&&(vA(t,n),wA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bA=function(){var e=xA();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},px=function(){var e=bA(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},SA={left:0,top:0,right:0,gap:0},Jd=function(e){return parseInt(e||"",10)||0},kA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Jd(n),Jd(i),Jd(s)]},EA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return SA;var t=kA(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},_A=px(),to="data-scroll-locked",NA=function(e,t,n,i){var s=e.left,l=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
63
|
-
.`.concat(
|
|
61
|
+
`)),m=d.reduce((h,g)=>h.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return O.useEffect(()=>{const f=(t==null?void 0:t.target)??Uy,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var b,k;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&Dw(v))return!1;const w=qy(v.code,c);if(l.current.add(v[w]),Hy(a,l.current,!1)){const N=((k=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:k[0])||v.target,E=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(s.current||!E)&&v.preventDefault(),i(!0)}},h=v=>{const S=qy(v.code,c);Hy(a,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(v[S]),v.key==="Meta"&&l.current.clear(),s.current=!1},g=()=>{l.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,i]),n}function Hy(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(s=>t.has(s)))}function qy(e,t){return t.includes(e)?"code":"key"}const I2=()=>{const e=He();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,s,l],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??s,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:s,minZoom:l,maxZoom:a,panZoom:c}=e.getState(),f=Vh(t,i,s,l,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:s,snapToGrid:l,domNode:a}=e.getState();if(!a)return t;const{x:c,y:f}=a.getBoundingClientRect(),d={x:t.x-c,y:t.y-f},m=n.snapGrid??s,h=n.snapToGrid??l;return yo(d,i,h,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:s,y:l}=i.getBoundingClientRect(),a=uo(t,n);return{x:a.x+s,y:a.y+l}}}),[])};function o1(e,t){const n=[],i=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")i.set(l.id,[l]);else{const a=i.get(l.id);a?a.push(l):i.set(l.id,[l])}for(const l of t){const a=i.get(l.id);if(!a){n.push(l);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...l};for(const f of a)A2(f,c);n.push(c)}return s.length&&s.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function A2(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 M2(e,t){return o1(e,t)}function L2(e,t){return o1(e,t)}function Jr(e,t){return{id:e,type:"select",selected:t}}function Gi(e,t=new Set,n=!1){const i=[];for(const[s,l]of e){const a=t.has(s);!(l.selected===void 0&&!a)&&l.selected!==a&&(n&&(l.selected=a),i.push(Jr(l.id,a)))}return i}function Yy({items:e=[],lookup:t}){var s;const n=[],i=new Map(e.map(l=>[l.id,l]));for(const[l,a]of e.entries()){const c=t.get(a.id),f=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;f!==void 0&&f!==a&&n.push({id:a.id,item:a,type:"replace"}),f===void 0&&n.push({item:a,type:"add",index:l})}for(const[l]of t)i.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function Ky(e){return{id:e.id,type:"remove"}}const R2=Aw();function D2(e,t,n={}){return wC(e,t,{...n,onError:n.onError??R2})}const Gy=e=>iC(e),j2=e=>Tw(e);function s1(e){return O.forwardRef(e)}const $2=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Xy(e){const[t,n]=O.useState(BigInt(0)),[i]=O.useState(()=>z2(()=>n(s=>s+BigInt(1))));return $2(()=>{const s=i.get();s.length&&(e(s),i.reset())},[t]),i}function z2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const l1=O.createContext(null);function F2({children:e}){const t=He(),n=O.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:m,onNodesChange:h,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=t.getState();let w=f;for(const k of c)w=typeof k=="function"?k(w):k;let b=Yy({items:w,lookup:g});for(const k of S.values())b=k(b);m&&d(w),b.length>0?h==null||h(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:N,setNodes:E}=t.getState();k&&E(N)})},[]),i=Xy(n),s=O.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:h,edgeLookup:g}=t.getState();let v=f;for(const S of c)v=typeof S=="function"?S(v):S;m?d(v):h&&h(Yy({items:v,lookup:g}))},[]),l=Xy(s),a=O.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return P.jsx(l1.Provider,{value:a,children:e})}function B2(){const e=O.useContext(l1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const V2=e=>!!e.panZoom;function Gh(){const e=I2(),t=He(),n=B2(),i=Me(V2),s=O.useMemo(()=>{const l=h=>t.getState().nodeLookup.get(h),a=h=>{n.nodeQueue.push(h)},c=h=>{n.edgeQueue.push(h)},f=h=>{var k,N;const{nodeLookup:g,nodeOrigin:v}=t.getState(),S=Gy(h)?h:g.get(h.id),w=S.parentId?Lw(S.position,S.measured,S.parentId,g,v):S.position,b={...S,position:w,width:((k=S.measured)==null?void 0:k.width)??S.width,height:((N=S.measured)==null?void 0:N.height)??S.height};return ao(b)},d=(h,g,v={replace:!1})=>{a(S=>S.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&Gy(b)?b:{...w,...b}}return w}))},m=(h,g,v={replace:!1})=>{c(S=>S.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&j2(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=l(h))==null?void 0:g.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:a,setEdges:c,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(v=>[...v,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:v}=t.getState(),[S,w,b]=v;return{nodes:h.map(k=>({...k})),edges:g.map(k=>({...k})),viewport:{x:S,y:w,zoom:b}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:v,edges:S,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:k,triggerEdgeChanges:N,onDelete:E,onBeforeDelete:_}=t.getState(),{nodes:A,edges:M}=await uC({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:S,onBeforeDelete:_}),L=M.length>0,C=A.length>0;if(L){const I=M.map(Ky);b==null||b(M),N(I)}if(C){const I=A.map(Ky);w==null||w(A),k(I)}return(C||L)&&(E==null||E({nodes:A,edges:M})),{deletedNodes:A,deletedEdges:M}},getIntersectingNodes:(h,g=!0,v)=>{const S=by(h),w=S?h:f(h),b=v!==void 0;return w?(v||t.getState().nodes).filter(k=>{const N=t.getState().nodeLookup.get(k.id);if(N&&!S&&(k.id===h.id||!N.internals.positionAbsolute))return!1;const E=ao(b?k:N),_=Ls(E,w);return g&&_>0||_>=E.width*E.height||_>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=by(h)?h:f(h);if(!w)return!1;const b=Ls(w,g);return v&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:d,updateNodeData:(h,g,v={replace:!1})=>{d(h,S=>{const w=typeof g=="function"?g(S):g;return v.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},v)},updateEdge:m,updateEdgeData:(h,g,v={replace:!1})=>{m(h,S=>{const w=typeof g=="function"?g(S):g;return v.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},v)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return oC(h,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:h,id:g,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}-${h}${g?`-${g}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:v})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${v}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:S.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??dC();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return O.useMemo(()=>({...s,...e,viewportInitialized:i}),[i])}const Qy=e=>e.selected,W2=typeof window<"u"?window:void 0;function U2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=He(),{deleteElements:i}=Gh(),s=Ds(e,{actInsideInputWithModifier:!1}),l=Ds(t,{target:W2});O.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();i({nodes:c.filter(Qy),edges:a.filter(Qy)}),n.setState({nodesSelectionActive:!1})}},[s]),O.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function H2(e){const t=He();O.useEffect(()=>{const n=()=>{var s,l,a,c;if(!e.current||!(((l=(s=e.current).checkVisibility)==null?void 0:l.call(s))??!0))return!1;const i=Wh(e.current);(i.height===0||i.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",gn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const ku={position:"absolute",width:"100%",height:"100%",top:0,left:0},q2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Y2({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=ii.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:d,minZoom:m,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:v=!0,children:S,noWheelClassName:w,noPanClassName:b,onViewportChange:k,isControlledViewport:N,paneClickDistance:E,selectionOnDrag:_}){const A=He(),M=O.useRef(null),{userSelectionActive:L,lib:C,connectionInProgress:I}=Me(q2,Ue),F=Ds(g),R=O.useRef();H2(M);const $=O.useCallback(Z=>{k==null||k({x:Z[0],y:Z[1],zoom:Z[2]}),N||A.setState({transform:Z})},[k,N]);return O.useEffect(()=>{if(M.current){R.current=GC({domNode:M.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:f,onDraggingChange:q=>A.setState(J=>J.paneDragging===q?J:{paneDragging:q}),onPanZoomStart:(q,J)=>{const{onViewportChangeStart:Y,onMoveStart:U}=A.getState();U==null||U(q,J),Y==null||Y(J)},onPanZoom:(q,J)=>{const{onViewportChange:Y,onMove:U}=A.getState();U==null||U(q,J),Y==null||Y(J)},onPanZoomEnd:(q,J)=>{const{onViewportChangeEnd:Y,onMoveEnd:U}=A.getState();U==null||U(q,J),Y==null||Y(J)}});const{x:Z,y:j,zoom:G}=R.current.getViewport();return A.setState({panZoom:R.current,transform:[Z,j,G],domNode:M.current.closest(".react-flow")}),()=>{var q;(q=R.current)==null||q.destroy()}}},[]),O.useEffect(()=>{var Z;(Z=R.current)==null||Z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:F,preventScrolling:v,noPanClassName:b,userSelectionActive:L,noWheelClassName:w,lib:C,onTransformChange:$,connectionInProgress:I,selectionOnDrag:_,paneClickDistance:E})},[e,t,n,i,s,l,a,c,F,v,b,L,w,C,$,I,_,E]),P.jsx("div",{className:"react-flow__renderer",ref:M,style:ku,children:S})}const K2=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function G2(){const{userSelectionActive:e,userSelectionRect:t}=Me(K2,Ue);return e&&t?P.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 Kf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},X2=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Q2({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ms.Full,panOnDrag:i,autoPanOnSelection:s,paneClickDistance:l,selectionOnDrag:a,onSelectionStart:c,onSelectionEnd:f,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:h,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:S,children:w}){const b=O.useRef(0),k=He(),{userSelectionActive:N,elementsSelectable:E,dragging:_,connectionInProgress:A,panBy:M,autoPanSpeed:L}=Me(X2,Ue),C=E&&(e||N),I=O.useRef(null),F=O.useRef(),R=O.useRef(new Set),$=O.useRef(new Set),Z=O.useRef(!1),j=O.useRef({x:0,y:0}),G=O.useRef(!1),q=ee=>{if(Z.current||A){Z.current=!1;return}d==null||d(ee),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},J=ee=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){ee.preventDefault();return}m==null||m(ee)},Y=h?ee=>h(ee):void 0,U=ee=>{Z.current&&(ee.stopPropagation(),Z.current=!1)},B=ee=>{var ze,wt;const{domNode:oe,transform:de}=k.getState();if(F.current=oe==null?void 0:oe.getBoundingClientRect(),!F.current)return;const xe=ee.target===I.current;if(!xe&&!!ee.target.closest(".nokey")||!e||!(a&&xe||t)||ee.button!==0||!ee.isPrimary)return;(wt=(ze=ee.target)==null?void 0:ze.setPointerCapture)==null||wt.call(ze,ee.pointerId),Z.current=!1;const{x:ke,y:Ie}=mn(ee.nativeEvent,F.current),Ae=yo({x:ke,y:Ie},de);k.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:ke,y:Ie}}),xe||(ee.stopPropagation(),ee.preventDefault())};function D(ee,oe){const{userSelectionRect:de}=k.getState();if(!de)return;const{transform:xe,nodeLookup:he,edgeLookup:fe,connectionLookup:ke,triggerNodeChanges:Ie,triggerEdgeChanges:Ae,defaultEdgeOptions:ze}=k.getState(),wt={x:de.startX,y:de.startY},{x:Nt,y:ht}=uo(wt,xe),pt={startX:wt.x,startY:wt.y,x:ee<Nt?ee:Nt,y:oe<ht?oe:ht,width:Math.abs(ee-Nt),height:Math.abs(oe-ht)},Dn=R.current,bn=$.current;R.current=new Set(Fh(he,pt,xe,n===Ms.Partial,!0).map(_t=>_t.id)),$.current=new Set;const Sn=(ze==null?void 0:ze.selectable)??!0;for(const _t of R.current){const Ht=ke.get(_t);if(Ht)for(const{edgeId:Rt}of Ht.values()){const qt=fe.get(Rt);qt&&(qt.selectable??Sn)&&$.current.add(Rt)}}if(!Sy(Dn,R.current)){const _t=Gi(he,R.current,!0);Ie(_t)}if(!Sy(bn,$.current)){const _t=Gi(fe,$.current);Ae(_t)}k.setState({userSelectionRect:pt,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!F.current)return;const[ee,oe]=Bh(j.current,F.current,L);M({x:ee,y:oe}).then(de=>{if(!Z.current||!de){b.current=requestAnimationFrame(W);return}const{x:xe,y:he}=j.current;D(xe,he),b.current=requestAnimationFrame(W)})}const V=()=>{cancelAnimationFrame(b.current),b.current=0,G.current=!1};O.useEffect(()=>()=>V(),[]);const K=ee=>{const{userSelectionRect:oe,transform:de,resetSelectedElements:xe}=k.getState();if(!F.current||!oe)return;const{x:he,y:fe}=mn(ee.nativeEvent,F.current);j.current={x:he,y:fe};const ke=uo({x:oe.startX,y:oe.startY},de);if(!Z.current){const Ie=t?0:l;if(Math.hypot(he-ke.x,fe-ke.y)<=Ie)return;xe(),c==null||c(ee)}Z.current=!0,G.current||(W(),G.current=!0),D(he,fe)},Q=ee=>{var oe,de;ee.button===0&&((de=(oe=ee.target)==null?void 0:oe.releasePointerCapture)==null||de.call(oe,ee.pointerId),!N&&ee.target===I.current&&k.getState().userSelectionRect&&(q==null||q(ee)),k.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f==null||f(ee),k.setState({nodesSelectionActive:R.current.size>0})),V())},re=ee=>{var oe,de;(de=(oe=ee.target)==null?void 0:oe.releasePointerCapture)==null||de.call(oe,ee.pointerId),V()},se=i===!0||Array.isArray(i)&&i.includes(0);return P.jsxs("div",{className:nt(["react-flow__pane",{draggable:se,dragging:_,selection:e}]),onClick:C?void 0:Kf(q,I),onContextMenu:Kf(J,I),onWheel:Kf(Y,I),onPointerEnter:C?void 0:g,onPointerMove:C?K:v,onPointerUp:C?Q:void 0,onPointerCancel:C?re:void 0,onPointerDownCapture:C?B:void 0,onClickCapture:C?U:void 0,onPointerLeave:S,ref:I,style:ku,children:[w,P.jsx(G2,{})]})}function wh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:a,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f==null||f("012",gn.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):s([e])}function a1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:s,isSelectable:l,nodeClickDistance:a}){const c=He(),[f,d]=O.useState(!1),m=O.useRef();return O.useEffect(()=>{m.current=RC({getStoreItems:()=>c.getState(),onNodeMouseDown:h=>{wh({id:h,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:a}),()=>{var h;(h=m.current)==null||h.destroy()}},[n,i,t,l,e,s,a]),f}const J2=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function u1(){const e=He();return O.useCallback(n=>{const{nodeExtent:i,snapToGrid:s,snapGrid:l,nodesDraggable:a,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:m}=e.getState(),h=new Map,g=J2(a),v=s?l[0]:5,S=s?l[1]:5,w=n.direction.x*v*n.factor,b=n.direction.y*S*n.factor;for(const[,k]of d){if(!g(k))continue;let N={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+b};s&&(N=Us(N,l));const{position:E,positionAbsolute:_}=Ow({nodeId:k.id,nextPosition:N,nodeLookup:d,nodeExtent:i,nodeOrigin:m,onError:c});k.position=E,k.internals.positionAbsolute=_,h.set(k.id,k)}f(h)},[])}const Xh=O.createContext(null),Z2=Xh.Provider;Xh.Consumer;const c1=()=>O.useContext(Xh),eT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),tT=(e,t,n)=>i=>{const{connectionClickStartHandle:s,connectionMode:l,connection:a}=i,{fromHandle:c,toHandle:f,isValid:d}=a,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.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:l===so.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 nT({type:e="source",position:t=Se.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:a,onConnect:c,children:f,className:d,onMouseDown:m,onTouchStart:h,...g},v){var G,q;const S=a||null,w=e==="target",b=He(),k=c1(),{connectOnClick:N,noPanClassName:E,rfId:_}=Me(eT,Ue),{connectingFrom:A,connectingTo:M,clickConnecting:L,isPossibleEndHandle:C,connectionInProcess:I,clickConnectionInProcess:F,valid:R}=Me(tT(k,S,e),Ue);k||(q=(G=b.getState()).onError)==null||q.call(G,"010",gn.error010());const $=J=>{const{defaultEdgeOptions:Y,onConnect:U,hasDefaultEdges:B}=b.getState(),D={...Y,...J};if(B){const{edges:W,setEdges:V,onError:K}=b.getState();V(D2(D,W,{onError:K}))}U==null||U(D),c==null||c(D)},Z=J=>{if(!k)return;const Y=jw(J.nativeEvent);if(s&&(Y&&J.button===0||!Y)){const U=b.getState();vh.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:w,handleId:S,nodeId:k,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...B)=>{var D,W;return(W=(D=b.getState()).onConnectEnd)==null?void 0:W.call(D,...B)},updateConnection:U.updateConnection,onConnect:$,isValidConnection:n||((...B)=>{var D,W;return((W=(D=b.getState()).isValidConnection)==null?void 0:W.call(D,...B))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}Y?m==null||m(J):h==null||h(J)},j=J=>{const{onClickConnectStart:Y,onClickConnectEnd:U,connectionClickStartHandle:B,connectionMode:D,isValidConnection:W,lib:V,rfId:K,nodeLookup:Q,connection:re}=b.getState();if(!k||!B&&!s)return;if(!B){Y==null||Y(J.nativeEvent,{nodeId:k,handleId:S,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:k,type:e,id:S}});return}const se=Rw(J.target),ee=n||W,{connection:oe,isValid:de}=vh.isValid(J.nativeEvent,{handle:{nodeId:k,id:S,type:e},connectionMode:D,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ee,flowId:K,doc:se,lib:V,nodeLookup:Q});de&&oe&&$(oe);const xe=structuredClone(re);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,U==null||U(J,xe),b.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":t,"data-id":`${_}-${k}-${S}-${e}`,className:nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,d,{source:!w,target:w,connectable:i,connectablestart:s,connectableend:l,clickconnecting:L,connectingfrom:A,connectingto:M,valid:R,connectionindicator:i&&(!I||C)&&(I||F?l:s)}]),onMouseDown:Z,onTouchStart:Z,onClick:N?j:void 0,ref:v,...g,children:f})}const Tr=O.memo(s1(nT));function rT({data:e,isConnectable:t,sourcePosition:n=Se.Bottom}){return P.jsxs(P.Fragment,{children:[e==null?void 0:e.label,P.jsx(Tr,{type:"source",position:n,isConnectable:t})]})}function iT({data:e,isConnectable:t,targetPosition:n=Se.Top,sourcePosition:i=Se.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,P.jsx(Tr,{type:"source",position:i,isConnectable:t})]})}function oT(){return null}function sT({data:e,isConnectable:t,targetPosition:n=Se.Top}){return P.jsxs(P.Fragment,{children:[P.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ru={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Jy={input:rT,default:iT,output:sT,group:oT};function lT(e){var t,n,i,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??((i=e.style)==null?void 0:i.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const aT=e=>{const{width:t,height:n,x:i,y:s}=Ws(e.nodeLookup,{filter:l=>!!l.selected});return{width:pn(t)?t:null,height:pn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${s}px)`}};function uT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=He(),{width:s,height:l,transformString:a,userSelectionActive:c}=Me(aT,Ue),f=u1(),d=O.useRef(null);O.useEffect(()=>{var v;n||(v=d.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&s!==null&&l!==null;if(a1({nodeRef:d,disabled:!m}),!m)return null;const h=e?v=>{const S=i.getState().nodes.filter(w=>w.selected);e(v,S)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(ru,v.key)&&(v.preventDefault(),f({direction:ru[v.key],factor:v.shiftKey?4:1}))};return P.jsx("div",{className:nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:P.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:l}})})}const Zy=typeof window<"u"?window:void 0,cT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function f1({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:m,selectionMode:h,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:k,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:A,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:C,autoPanOnSelection:I,defaultViewport:F,translateExtent:R,minZoom:$,maxZoom:Z,preventScrolling:j,onSelectionContextMenu:G,noWheelClassName:q,noPanClassName:J,disableKeyboardA11y:Y,onViewportChange:U,isControlledViewport:B}){const{nodesSelectionActive:D,userSelectionActive:W}=Me(cT,Ue),V=Ds(d,{target:Zy}),K=Ds(w,{target:Zy}),Q=K||C,re=K||_,se=m&&Q!==!0,ee=V||W||se;return U2({deleteKeyCode:f,multiSelectionKeyCode:S}),P.jsx(Y2,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:A,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:!V&&Q,defaultViewport:F,translateExtent:R,minZoom:$,maxZoom:Z,zoomActivationKeyCode:b,preventScrolling:j,noWheelClassName:q,noPanClassName:J,onViewportChange:U,isControlledViewport:B,paneClickDistance:c,selectionOnDrag:se,children:P.jsxs(Q2,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:I,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:V,paneClickDistance:c,selectionOnDrag:se,children:[e,D&&P.jsx(uT,{onSelectionContextMenu:G,noPanClassName:J,disableKeyboardA11y:Y})]})})}f1.displayName="FlowRenderer";const fT=O.memo(f1),dT=e=>t=>e?Fh(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 hT(e){return Me(O.useCallback(dT(e),[e]),Ue)}const pT=e=>e.updateNodeInternals;function mT(){const e=Me(pT),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(s=>{const l=s.target.getAttribute("data-id");i.set(l,{id:l,nodeElement:s.target,force:!0})}),e(i)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function gT({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const s=He(),l=O.useRef(null),a=O.useRef(null),c=O.useRef(e.sourcePosition),f=O.useRef(e.targetPosition),d=O.useRef(t),m=n&&!!e.internals.handleBounds;return O.useEffect(()=>{l.current&&!e.hidden&&(!m||a.current!==l.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(l.current),a.current=l.current)},[m,e.hidden]),O.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),O.useEffect(()=>{if(l.current){const h=d.current!==t,g=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(h||g||v)&&(d.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function yT({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:s,onContextMenu:l,onDoubleClick:a,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:m,resizeObserver:h,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:S,rfId:w,nodeTypes:b,nodeClickDistance:k,onError:N}){const{node:E,internals:_,isParent:A}=Me(ee=>{const oe=ee.nodeLookup.get(e),de=ee.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:de}},Ue);let M=E.type||"default",L=(b==null?void 0:b[M])||Jy[M];L===void 0&&(N==null||N("003",gn.error003(M)),M="default",L=(b==null?void 0:b.default)||Jy.default);const C=!!(E.draggable||c&&typeof E.draggable>"u"),I=!!(E.selectable||f&&typeof E.selectable>"u"),F=!!(E.connectable||d&&typeof E.connectable>"u"),R=!!(E.focusable||m&&typeof E.focusable>"u"),$=He(),Z=Mw(E),j=gT({node:E,nodeType:M,hasDimensions:Z,resizeObserver:h}),G=a1({nodeRef:j,disabled:E.hidden||!C,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:k}),q=u1();if(E.hidden)return null;const J=er(E),Y=lT(E),U=I||C||t||n||i||s,B=n?ee=>n(ee,{..._.userNode}):void 0,D=i?ee=>i(ee,{..._.userNode}):void 0,W=s?ee=>s(ee,{..._.userNode}):void 0,V=l?ee=>l(ee,{..._.userNode}):void 0,K=a?ee=>a(ee,{..._.userNode}):void 0,Q=ee=>{const{selectNodesOnDrag:oe,nodeDragThreshold:de}=$.getState();I&&(!oe||!C||de>0)&&wh({id:e,store:$,nodeRef:j}),t&&t(ee,{..._.userNode})},re=ee=>{if(!(Dw(ee.nativeEvent)||S)){if(Ew.includes(ee.key)&&I){const oe=ee.key==="Escape";wh({id:e,store:$,unselect:oe,nodeRef:j})}else if(C&&E.selected&&Object.prototype.hasOwnProperty.call(ru,ee.key)){ee.preventDefault();const{ariaLabelConfig:oe}=$.getState();$.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),q({direction:ru[ee.key],factor:ee.shiftKey?4:1})}}},se=()=>{var ke;if(S||!((ke=j.current)!=null&&ke.matches(":focus-visible")))return;const{transform:ee,width:oe,height:de,autoPanOnNodeFocus:xe,setCenter:he}=$.getState();if(!xe)return;Fh(new Map([[e,E]]),{x:0,y:0,width:oe,height:de},ee,!0).length>0||he(E.position.x+J.width/2,E.position.y+J.height/2,{zoom:ee[2]})};return P.jsx("div",{className:nt(["react-flow__node",`react-flow__node-${M}`,{[v]:C},E.className,{selected:E.selected,selectable:I,parent:A,draggable:C,dragging:G}]),ref:j,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:Z?"visible":"hidden",...E.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:D,onMouseLeave:W,onContextMenu:V,onClick:Q,onDoubleClick:K,onKeyDown:R?re:void 0,tabIndex:R?0:void 0,onFocus:R?se:void 0,role:E.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${n1}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:P.jsx(Z2,{value:e,children:P.jsx(L,{id:e,data:E.data,type:M,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:E.selected??!1,selectable:I,draggable:C,deletable:E.deletable??!0,isConnectable:F,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:_.z,parentId:E.parentId,...J})})})}var vT=O.memo(yT);const wT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function d1(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:s,onError:l}=Me(wT,Ue),a=hT(e.onlyRenderVisibleElements),c=mT();return P.jsx("div",{className:"react-flow__nodes",style:ku,children:a.map(f=>P.jsx(vT,{id:f,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:i,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}d1.displayName="NodeRenderer";const xT=O.memo(d1);function bT(e){return Me(O.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const i=[];if(n.width&&n.height)for(const s of n.edges){const l=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);l&&a&&gC({sourceNode:l,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(s.id)}return i},[e]),Ue)}const ST=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return P.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return P.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},e0={[tu.Arrow]:ST,[tu.ArrowClosed]:kT};function ET(e){const t=He();return O.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(e0,e)?e0[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",gn.error009(e)),null)},[e])}const NT=({id:e,type:t,color:n,width:i=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const f=ET(t);return f?P.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:P.jsx(f,{color:n,strokeWidth:a})}):null},h1=({defaultColor:e,rfId:t})=>{const n=Me(l=>l.edges),i=Me(l=>l.defaultEdgeOptions),s=O.useMemo(()=>EC(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return s.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:s.map(l=>P.jsx(NT,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};h1.displayName="MarkerDefinitions";var _T=O.memo(h1);function p1({x:e,y:t,label:n,labelStyle:i,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...m}){const[h,g]=O.useState({x:1,y:0,width:0,height:0}),v=nt(["react-flow__edge-textwrapper",d]),S=O.useRef(null);return O.useEffect(()=>{if(S.current){const w=S.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?P.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...m,children:[s&&P.jsx("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),P.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:S,style:i,children:n}),f]}):null}p1.displayName="EdgeText";const CT=O.memo(p1);function Eu({path:e,labelX:t,labelY:n,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...m}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...m,d:e,fill:"none",className:nt(["react-flow__edge-path",m.className])}),d?P.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?P.jsx(CT,{x:t,y:n,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function t0({pos:e,x1:t,y1:n,x2:i,y2:s}){return e===Se.Left||e===Se.Right?[.5*(t+i),n]:[t,.5*(n+s)]}function m1({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:i,targetY:s,targetPosition:l=Se.Top}){const[a,c]=t0({pos:n,x1:e,y1:t,x2:i,y2:s}),[f,d]=t0({pos:l,x1:i,y1:s,x2:e,y2:t}),[m,h,g,v]=$w({sourceX:e,sourceY:t,targetX:i,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${a},${c} ${f},${d} ${i},${s}`,m,h,g,v]}function g1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,sourcePosition:a,targetPosition:c,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:k})=>{const[N,E,_]=m1({sourceX:n,sourceY:i,sourcePosition:a,targetX:s,targetY:l,targetPosition:c}),A=e.isInternal?void 0:t;return P.jsx(Eu,{id:A,path:N,labelX:E,labelY:_,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:k})})}const TT=g1({isInternal:!1}),y1=g1({isInternal:!0});TT.displayName="SimpleBezierEdge";y1.displayName="SimpleBezierEdgeInternal";function v1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Se.Bottom,targetPosition:S=Se.Top,markerEnd:w,markerStart:b,pathOptions:k,interactionWidth:N})=>{const[E,_,A]=mh({sourceX:n,sourceY:i,sourcePosition:v,targetX:s,targetY:l,targetPosition:S,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),M=e.isInternal?void 0:t;return P.jsx(Eu,{id:M,path:E,labelX:_,labelY:A,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:b,interactionWidth:N})})}const w1=v1({isInternal:!1}),x1=v1({isInternal:!0});w1.displayName="SmoothStepEdge";x1.displayName="SmoothStepEdgeInternal";function b1(e){return O.memo(({id:t,...n})=>{var s;const i=e.isInternal?void 0:t;return P.jsx(w1,{...n,id:i,pathOptions:O.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const OT=b1({isInternal:!1}),S1=b1({isInternal:!0});OT.displayName="StepEdge";S1.displayName="StepEdgeInternal";function k1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:S,interactionWidth:w})=>{const[b,k,N]=Bw({sourceX:n,sourceY:i,targetX:s,targetY:l}),E=e.isInternal?void 0:t;return P.jsx(Eu,{id:E,path:b,labelX:k,labelY:N,label:a,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:S,interactionWidth:w})})}const PT=k1({isInternal:!1}),E1=k1({isInternal:!0});PT.displayName="StraightEdge";E1.displayName="StraightEdgeInternal";function N1(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:l,sourcePosition:a=Se.Bottom,targetPosition:c=Se.Top,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,pathOptions:k,interactionWidth:N})=>{const[E,_,A]=zw({sourceX:n,sourceY:i,sourcePosition:a,targetX:s,targetY:l,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return P.jsx(Eu,{id:M,path:E,labelX:_,labelY:A,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:S,markerEnd:w,markerStart:b,interactionWidth:N})})}const IT=N1({isInternal:!1}),_1=N1({isInternal:!0});IT.displayName="BezierEdge";_1.displayName="BezierEdgeInternal";const n0={default:_1,straight:E1,step:S1,smoothstep:x1,simplebezier:y1},r0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},AT=(e,t,n)=>n===Se.Left?e-t:n===Se.Right?e+t:e,MT=(e,t,n)=>n===Se.Top?e-t:n===Se.Bottom?e+t:e,i0="react-flow__edgeupdater";function o0({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:s,onMouseEnter:l,onMouseOut:a,type:c}){return P.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:a,className:nt([i0,`${i0}-${c}`]),cx:AT(t,i,e),cy:MT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function LT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:s,targetX:l,targetY:a,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:m,onReconnectEnd:h,setReconnecting:g,setUpdateHover:v}){const S=He(),w=(_,A)=>{if(_.button!==0)return;const{autoPanOnConnect:M,domNode:L,connectionMode:C,connectionRadius:I,lib:F,onConnectStart:R,cancelConnection:$,nodeLookup:Z,rfId:j,panBy:G,updateConnection:q}=S.getState(),J=A.type==="target",Y=(D,W)=>{g(!1),h==null||h(D,n,A.type,W)},U=D=>d==null?void 0:d(n,D),B=(D,W)=>{g(!0),m==null||m(_,n,A.type),R==null||R(D,W)};vh.onPointerDown(_.nativeEvent,{autoPanOnConnect:M,connectionMode:C,connectionRadius:I,domNode:L,handleId:A.id,nodeId:A.nodeId,nodeLookup:Z,isTarget:J,edgeUpdaterType:A.type,lib:F,flowId:j,cancelConnection:$,panBy:G,isValidConnection:(...D)=>{var W,V;return((V=(W=S.getState()).isValidConnection)==null?void 0:V.call(W,...D))??!0},onConnect:U,onConnectStart:B,onConnectEnd:(...D)=>{var W,V;return(V=(W=S.getState()).onConnectEnd)==null?void 0:V.call(W,...D)},onReconnectEnd:Y,updateConnection:q,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},b=_=>w(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=_=>w(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>v(!0),E=()=>v(!1);return P.jsxs(P.Fragment,{children:[(e===!0||e==="source")&&P.jsx(o0,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:b,onMouseEnter:N,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&P.jsx(o0,{position:f,centerX:l,centerY:a,radius:t,onMouseDown:k,onMouseEnter:N,onMouseOut:E,type:"target"})]})}function RT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:s,onDoubleClick:l,onContextMenu:a,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,rfId:S,edgeTypes:w,noPanClassName:b,onError:k,disableKeyboardA11y:N}){let E=Me(he=>he.edgeLookup.get(e));const _=Me(he=>he.defaultEdgeOptions);E=_?{..._,...E}:E;let A=E.type||"default",M=(w==null?void 0:w[A])||n0[A];M===void 0&&(k==null||k("011",gn.error011(A)),A="default",M=(w==null?void 0:w.default)||n0.default);const L=!!(E.focusable||t&&typeof E.focusable>"u"),C=typeof h<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),I=!!(E.selectable||i&&typeof E.selectable>"u"),F=O.useRef(null),[R,$]=O.useState(!1),[Z,j]=O.useState(!1),G=He(),{zIndex:q,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W}=Me(O.useCallback(he=>{const fe=he.nodeLookup.get(E.source),ke=he.nodeLookup.get(E.target);if(!fe||!ke)return{zIndex:E.zIndex,...r0};const Ie=kC({id:e,sourceNode:fe,targetNode:ke,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:he.connectionMode,onError:k});return{zIndex:mC({selected:E.selected,zIndex:E.zIndex,sourceNode:fe,targetNode:ke,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Ie||r0}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),Ue),V=O.useMemo(()=>E.markerStart?`url('#${gh(E.markerStart,S)}')`:void 0,[E.markerStart,S]),K=O.useMemo(()=>E.markerEnd?`url('#${gh(E.markerEnd,S)}')`:void 0,[E.markerEnd,S]);if(E.hidden||J===null||Y===null||U===null||B===null)return null;const Q=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:ke,multiSelectionActive:Ie}=G.getState();I&&(G.setState({nodesSelectionActive:!1}),E.selected&&Ie?(ke({nodes:[],edges:[E]}),(Ae=F.current)==null||Ae.blur()):fe([e])),s&&s(he,E)},re=l?he=>{l(he,{...E})}:void 0,se=a?he=>{a(he,{...E})}:void 0,ee=c?he=>{c(he,{...E})}:void 0,oe=f?he=>{f(he,{...E})}:void 0,de=d?he=>{d(he,{...E})}:void 0,xe=he=>{var fe;if(!N&&Ew.includes(he.key)&&I){const{unselectNodesAndEdges:ke,addSelectedEdges:Ie}=G.getState();he.key==="Escape"?((fe=F.current)==null||fe.blur(),ke({edges:[E]})):Ie([e])}};return P.jsx("svg",{style:{zIndex:q},children:P.jsxs("g",{className:nt(["react-flow__edge",`react-flow__edge-${A}`,E.className,b,{selected:E.selected,animated:E.animated,inactive:!I&&!s,updating:R,selectable:I}]),onClick:Q,onDoubleClick:re,onContextMenu:se,onMouseEnter:ee,onMouseMove:oe,onMouseLeave:de,onKeyDown:L?xe:void 0,tabIndex:L?0:void 0,role:E.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":L?`${r1}-${S}`:void 0,ref:F,...E.domAttributes,children:[!Z&&P.jsx(M,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:I,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:V,markerEnd:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),C&&P.jsx(LT,{edge:E,isReconnectable:C,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:J,sourceY:Y,targetX:U,targetY:B,sourcePosition:D,targetPosition:W,setUpdateHover:$,setReconnecting:j})]})})}var DT=O.memo(RT);const jT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function C1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:s,onReconnect:l,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:k,elementsSelectable:N,onError:E}=Me(jT,Ue),_=bT(t);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(_T,{defaultColor:e,rfId:n}),_.map(A=>P.jsx(DT,{id:A,edgesFocusable:b,edgesReconnectable:k,elementsSelectable:N,noPanClassName:s,onReconnect:l,onContextMenu:a,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:m,reconnectRadius:h,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:S,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:w},A))]})}C1.displayName="EdgeRenderer";const $T=O.memo(C1),zT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function FT({children:e}){const t=Me(zT);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function BT(e){const t=Gh(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const VT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function WT(e){const t=Me(VT),n=He();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function UT(e){return e.connection.inProgress?{...e.connection,to:yo(e.connection.to,e.transform)}:{...e.connection}}function HT(e){return UT}function qT(e){const t=HT();return Me(t,Ue)}const YT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function KT({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:s,width:l,height:a,isValid:c,inProgress:f}=Me(YT,Ue);return!(l&&s&&f)?null:P.jsx("svg",{style:e,width:l,height:a,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:nt(["react-flow__connection",Cw(c)]),children:P.jsx(T1,{style:t,type:n,CustomComponent:i,isValid:c})})})}const T1=({style:e,type:t=Cr.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:s,from:l,fromNode:a,fromHandle:c,fromPosition:f,to:d,toNode:m,toHandle:h,toPosition:g,pointer:v}=qT();if(!s)return;if(n)return P.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:g,connectionStatus:Cw(i),toNode:m,toHandle:h,pointer:v});let S="";const w={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Cr.Bezier:[S]=zw(w);break;case Cr.SimpleBezier:[S]=m1(w);break;case Cr.Step:[S]=mh({...w,borderRadius:0});break;case Cr.SmoothStep:[S]=mh(w);break;default:[S]=Bw(w)}return P.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};T1.displayName="ConnectionLine";const GT={};function s0(e=GT){O.useRef(e),He(),O.useEffect(()=>{},[e])}function XT(){He(),O.useRef(!1),O.useEffect(()=>{},[])}function O1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:k,selectionKeyCode:N,selectionOnDrag:E,selectionMode:_,multiSelectionKeyCode:A,panActivationKeyCode:M,zoomActivationKeyCode:L,deleteKeyCode:C,onlyRenderVisibleElements:I,elementsSelectable:F,defaultViewport:R,translateExtent:$,minZoom:Z,maxZoom:j,preventScrolling:G,defaultMarkerColor:q,zoomOnScroll:J,zoomOnPinch:Y,panOnScroll:U,panOnScrollSpeed:B,panOnScrollMode:D,zoomOnDoubleClick:W,panOnDrag:V,autoPanOnSelection:K,onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneScroll:oe,onPaneContextMenu:de,paneClickDistance:xe,nodeClickDistance:he,onEdgeContextMenu:fe,onEdgeMouseEnter:ke,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:ze,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:Sn,nodeExtent:_t,rfId:Ht,viewport:Rt,onViewportChange:qt}){return s0(e),s0(t),XT(),BT(n),WT(Rt),P.jsx(fT,{onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:se,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:oe,paneClickDistance:xe,deleteKeyCode:C,selectionKeyCode:N,selectionOnDrag:E,selectionMode:_,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:A,panActivationKeyCode:M,zoomActivationKeyCode:L,elementsSelectable:F,zoomOnScroll:J,zoomOnPinch:Y,zoomOnDoubleClick:W,panOnScroll:U,panOnScrollSpeed:B,panOnScrollMode:D,panOnDrag:V,autoPanOnSelection:K,defaultViewport:R,translateExtent:$,minZoom:Z,maxZoom:j,onSelectionContextMenu:h,preventScrolling:G,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:Sn,onViewportChange:qt,isControlledViewport:!!Rt,children:P.jsxs(FT,{children:[P.jsx($T,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,onlyRenderVisibleElements:I,onEdgeContextMenu:fe,onEdgeMouseEnter:ke,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:ze,defaultMarkerColor:q,noPanClassName:bn,disableKeyboardA11y:Sn,rfId:Ht}),P.jsx(KT,{style:w,type:S,component:b,containerStyle:k}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(xT,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:I,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:Sn,nodeExtent:_t,rfId:Ht}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}O1.displayName="GraphView";const QT=O.memo(O1),JT=Aw(),l0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:h,zIndexMode:g="basic"}={})=>{const v=new Map,S=new Map,w=new Map,b=new Map,k=i??t??[],N=n??e??[],E=m??[0,0],_=h??As;Uw(w,b,k);const{nodesInitialized:A}=yh(N,v,S,{nodeOrigin:E,nodeExtent:_,zIndexMode:g});let M=[0,0,1];if(a&&s&&l){const L=Ws(v,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:C,y:I,zoom:F}=Vh(L,s,l,f,d,(c==null?void 0:c.padding)??.1);M=[C,I,F]}return{rfId:"1",width:s??0,height:l??0,transform:M,nodes:N,nodesInitialized:A,nodeLookup:v,parentLookup:S,edges:k,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:As,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:so.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:{..._w},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:JT,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Nw,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},ZT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g})=>d2((v,S)=>{async function w(){const{nodeLookup:b,panZoom:k,fitViewOptions:N,fitViewResolver:E,width:_,height:A,minZoom:M,maxZoom:L}=S();k&&(await aC({nodes:b,width:_,height:A,panZoom:k,minZoom:M,maxZoom:L},N),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...l0({nodes:e,edges:t,width:s,height:l,fitView:a,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:b=>{const{nodeLookup:k,parentLookup:N,nodeOrigin:E,elevateNodesOnSelect:_,fitViewQueued:A,zIndexMode:M,nodesSelectionActive:L}=S(),{nodesInitialized:C,hasSelectedNodes:I}=yh(b,k,N,{nodeOrigin:E,nodeExtent:h,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:M}),F=L&&I;A&&C?(w(),v({nodes:b,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):v({nodes:b,nodesInitialized:C,nodesSelectionActive:F})},setEdges:b=>{const{connectionLookup:k,edgeLookup:N}=S();Uw(k,N,b),v({edges:b})},setDefaultNodesAndEdges:(b,k)=>{if(b){const{setNodes:N}=S();N(b),v({hasDefaultNodes:!0})}if(k){const{setEdges:N}=S();N(k),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:k,nodeLookup:N,parentLookup:E,domNode:_,nodeOrigin:A,nodeExtent:M,debug:L,fitViewQueued:C,zIndexMode:I}=S(),{changes:F,updatedInternals:R}=IC(b,N,E,_,A,M,I);R&&(CC(N,E,{nodeOrigin:A,nodeExtent:M,zIndexMode:I}),C?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(F==null?void 0:F.length)>0&&(L&&console.log("React Flow: trigger node changes",F),k==null||k(F)))},updateNodePositions:(b,k=!1)=>{const N=[];let E=[];const{nodeLookup:_,triggerNodeChanges:A,connection:M,updateConnection:L,onNodesChangeMiddlewareMap:C}=S();for(const[I,F]of b){const R=_.get(I),$=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(F!=null&&F.position)),Z={id:I,type:"position",position:$?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:k};if(R&&M.inProgress&&M.fromNode.id===R.id){const j=ui(R,M.fromHandle,Se.Left,!0);L({...M,from:j})}$&&R.parentId&&N.push({id:I,parentId:R.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),E.push(Z)}if(N.length>0){const{parentLookup:I,nodeOrigin:F}=S(),R=Kh(N,_,I,F);E.push(...R)}for(const I of C.values())E=I(E);A(E)},triggerNodeChanges:b=>{const{onNodesChange:k,setNodes:N,nodes:E,hasDefaultNodes:_,debug:A}=S();if(b!=null&&b.length){if(_){const M=M2(b,E);N(M)}A&&console.log("React Flow: trigger node changes",b),k==null||k(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:k,setEdges:N,edges:E,hasDefaultEdges:_,debug:A}=S();if(b!=null&&b.length){if(_){const M=L2(b,E);N(M)}A&&console.log("React Flow: trigger edge changes",b),k==null||k(b)}},addSelectedNodes:b=>{const{multiSelectionActive:k,edgeLookup:N,nodeLookup:E,triggerNodeChanges:_,triggerEdgeChanges:A}=S();if(k){const M=b.map(L=>Jr(L,!0));_(M);return}_(Gi(E,new Set([...b]),!0)),A(Gi(N))},addSelectedEdges:b=>{const{multiSelectionActive:k,edgeLookup:N,nodeLookup:E,triggerNodeChanges:_,triggerEdgeChanges:A}=S();if(k){const M=b.map(L=>Jr(L,!0));A(M);return}A(Gi(N,new Set([...b]))),_(Gi(E,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:k}={})=>{const{edges:N,nodes:E,nodeLookup:_,triggerNodeChanges:A,triggerEdgeChanges:M}=S(),L=b||E,C=k||N,I=[];for(const R of L){if(!R.selected)continue;const $=_.get(R.id);$&&($.selected=!1),I.push(Jr(R.id,!1))}const F=[];for(const R of C)R.selected&&F.push(Jr(R.id,!1));A(I),M(F)},setMinZoom:b=>{const{panZoom:k,maxZoom:N}=S();k==null||k.setScaleExtent([b,N]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:k,minZoom:N}=S();k==null||k.setScaleExtent([N,b]),v({maxZoom:b})},setTranslateExtent:b=>{var k;(k=S().panZoom)==null||k.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:k,triggerNodeChanges:N,triggerEdgeChanges:E,elementsSelectable:_}=S();if(!_)return;const A=k.reduce((L,C)=>C.selected?[...L,Jr(C.id,!1)]:L,[]),M=b.reduce((L,C)=>C.selected?[...L,Jr(C.id,!1)]:L,[]);N(A),E(M)},setNodeExtent:b=>{const{nodes:k,nodeLookup:N,parentLookup:E,nodeOrigin:_,elevateNodesOnSelect:A,nodeExtent:M,zIndexMode:L}=S();b[0][0]===M[0][0]&&b[0][1]===M[0][1]&&b[1][0]===M[1][0]&&b[1][1]===M[1][1]||(yh(k,N,E,{nodeOrigin:_,nodeExtent:b,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:L}),v({nodeExtent:b}))},panBy:b=>{const{transform:k,width:N,height:E,panZoom:_,translateExtent:A}=S();return AC({delta:b,panZoom:_,transform:k,translateExtent:A,width:N,height:E})},setCenter:async(b,k,N)=>{const{width:E,height:_,maxZoom:A,panZoom:M}=S();if(!M)return!1;const L=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:A;return await M.setViewport({x:E/2-b*L,y:_/2-k*L,zoom:L},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),!0},cancelConnection:()=>{v({connection:{..._w}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...l0()})}},Object.is);function P1({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:s,initialHeight:l,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g,children:v}){const[S]=O.useState(()=>ZT({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:l,fitView:d,minZoom:a,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:h,zIndexMode:g}));return P.jsx(h2,{value:S,children:P.jsx(F2,{children:v})})}function eO({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:s,width:l,height:a,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v}){return O.useContext(bu)?P.jsx(P.Fragment,{children:e}):P.jsx(P1,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:a,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v,children:e})}const tO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function nO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:s,nodeTypes:l,edgeTypes:a,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:m,onMoveStart:h,onMoveEnd:g,onConnect:v,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:N,onNodeMouseMove:E,onNodeMouseLeave:_,onNodeContextMenu:A,onNodeDoubleClick:M,onNodeDragStart:L,onNodeDrag:C,onNodeDragStop:I,onNodesDelete:F,onEdgesDelete:R,onDelete:$,onSelectionChange:Z,onSelectionDragStart:j,onSelectionDrag:G,onSelectionDragStop:q,onSelectionContextMenu:J,onSelectionStart:Y,onSelectionEnd:U,onBeforeDelete:B,connectionMode:D,connectionLineType:W=Cr.Bezier,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:Q,deleteKeyCode:re="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:ee=!1,selectionMode:oe=Ms.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:xe=Rs()?"Meta":"Control",zoomActivationKeyCode:he=Rs()?"Meta":"Control",snapToGrid:fe,snapGrid:ke,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:Ae,nodesDraggable:ze,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,nodeOrigin:pt=i1,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:Sn=!0,defaultViewport:_t=_2,minZoom:Ht=.5,maxZoom:Rt=2,translateExtent:qt=As,preventScrolling:Gs=!0,nodeExtent:jn,defaultMarkerColor:Ar="#b1b1b7",zoomOnScroll:zu=!0,zoomOnPinch:Xs=!0,panOnScroll:Qs=!1,panOnScrollSpeed:Fu=.5,panOnScrollMode:ko=ii.Free,zoomOnDoubleClick:Eo=!0,panOnDrag:No=!0,onPaneClick:_o,onPaneMouseEnter:Co,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Js,onPaneContextMenu:Zs,paneClickDistance:el=1,nodeClickDistance:tl=0,children:nl,onReconnect:To,onReconnectStart:rl,onReconnectEnd:Mr,onEdgeContextMenu:Oo,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Bu,onEdgeMouseMove:Rr,onEdgeMouseLeave:di,reconnectRadius:hi=10,onNodesChange:Po,onEdgesChange:Vu,noDragClassName:Wu="nodrag",noWheelClassName:Uu="nowheel",noPanClassName:kn="nopan",fitView:Io,fitViewOptions:Ao,connectOnClick:Hu,attributionPosition:il,proOptions:ol,defaultEdgeOptions:sl,elevateNodesOnSelect:ll=!0,elevateEdgesOnSelect:qu=!1,disableKeyboardA11y:al=!1,autoPanOnConnect:qe,autoPanOnNodeDrag:Yu,autoPanOnSelection:Mo=!0,autoPanSpeed:ul,connectionRadius:pi,isValidConnection:Ku,onError:cl,style:mi,id:Dt,nodeDragThreshold:Gu,connectionDragThreshold:jt,viewport:Xu,onViewportChange:Qu,width:Ju,height:gi,colorMode:yi="light",debug:Dr,onScroll:$n,ariaLabelConfig:Zu,zIndexMode:fl="basic",...Lo},dl){const jr=Dt||"1",$r=P2(yi),ec=O.useCallback(vi=>{vi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$n==null||$n(vi)},[$n]);return P.jsx("div",{"data-testid":"rf__wrapper",...Lo,onScroll:ec,style:{...mi,...tO},ref:dl,className:nt(["react-flow",s,$r]),id:Dt,role:"application",children:P.jsxs(eO,{nodes:e,edges:t,width:Ju,height:gi,fitView:Io,fitViewOptions:Ao,minZoom:Ht,maxZoom:Rt,nodeOrigin:pt,nodeExtent:jn,zIndexMode:fl,children:[P.jsx(O2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:ze,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:Sn,elevateNodesOnSelect:ll,elevateEdgesOnSelect:qu,minZoom:Ht,maxZoom:Rt,nodeExtent:jn,onNodesChange:Po,onEdgesChange:Vu,snapToGrid:fe,snapGrid:ke,connectionMode:D,translateExtent:qt,connectOnClick:Hu,defaultEdgeOptions:sl,fitView:Io,fitViewOptions:Ao,onNodesDelete:F,onEdgesDelete:R,onDelete:$,onNodeDragStart:L,onNodeDrag:C,onNodeDragStop:I,onSelectionDrag:G,onSelectionDragStart:j,onSelectionDragStop:q,onMove:m,onMoveStart:h,onMoveEnd:g,noPanClassName:kn,nodeOrigin:pt,rfId:jr,autoPanOnConnect:qe,autoPanOnNodeDrag:Yu,autoPanSpeed:ul,onError:cl,connectionRadius:pi,isValidConnection:Ku,selectNodesOnDrag:Ae,nodeDragThreshold:Gu,connectionDragThreshold:jt,onBeforeDelete:B,debug:Dr,ariaLabelConfig:Zu,zIndexMode:fl}),P.jsx(QT,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:E,onNodeMouseLeave:_,onNodeContextMenu:A,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:a,connectionLineType:W,connectionLineStyle:V,connectionLineComponent:K,connectionLineContainerStyle:Q,selectionKeyCode:se,selectionOnDrag:ee,selectionMode:oe,deleteKeyCode:re,multiSelectionKeyCode:xe,panActivationKeyCode:de,zoomActivationKeyCode:he,onlyRenderVisibleElements:Ie,defaultViewport:_t,translateExtent:qt,minZoom:Ht,maxZoom:Rt,preventScrolling:Gs,zoomOnScroll:zu,zoomOnPinch:Xs,zoomOnDoubleClick:Eo,panOnScroll:Qs,panOnScrollSpeed:Fu,panOnScrollMode:ko,panOnDrag:No,autoPanOnSelection:Mo,onPaneClick:_o,onPaneMouseEnter:Co,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Js,onPaneContextMenu:Zs,paneClickDistance:el,nodeClickDistance:tl,onSelectionContextMenu:J,onSelectionStart:Y,onSelectionEnd:U,onReconnect:To,onReconnectStart:rl,onReconnectEnd:Mr,onEdgeContextMenu:Oo,onEdgeDoubleClick:Lr,onEdgeMouseEnter:Bu,onEdgeMouseMove:Rr,onEdgeMouseLeave:di,reconnectRadius:hi,defaultMarkerColor:Ar,noDragClassName:Wu,noWheelClassName:Uu,noPanClassName:kn,rfId:jr,disableKeyboardA11y:al,nodeExtent:jn,viewport:Xu,onViewportChange:Qu}),P.jsx(N2,{onSelectionChange:Z}),nl,P.jsx(x2,{proOptions:ol,position:il}),P.jsx(w2,{rfId:jr,disableKeyboardA11y:al})]})})}var rO=s1(nO);function iO({dimensions:e,lineWidth:t,variant:n,className:i}){return P.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nt(["react-flow__background-pattern",n,i])})}function oO({radius:e,className:t}){return P.jsx("circle",{cx:e,cy:e,r:e,className:nt(["react-flow__background-pattern","dots",t])})}var Qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qn||(Qn={}));const sO={[Qn.Dots]:1,[Qn.Lines]:1,[Qn.Cross]:6},lO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function I1({id:e,variant:t=Qn.Dots,gap:n=20,size:i,lineWidth:s=1,offset:l=0,color:a,bgColor:c,style:f,className:d,patternClassName:m}){const h=O.useRef(null),{transform:g,patternId:v}=Me(lO,Ue),S=i||sO[t],w=t===Qn.Dots,b=t===Qn.Cross,k=Array.isArray(n)?n:[n,n],N=[k[0]*g[2]||1,k[1]*g[2]||1],E=S*g[2],_=Array.isArray(l)?l:[l,l],A=b?[E,E]:N,M=[_[0]*g[2]||1+A[0]/2,_[1]*g[2]||1+A[1]/2],L=`${v}${e||""}`;return P.jsxs("svg",{className:nt(["react-flow__background",d]),style:{...f,...ku,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:h,"data-testid":"rf__background",children:[P.jsx("pattern",{id:L,x:g[0]%N[0],y:g[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?P.jsx(oO,{radius:E/2,className:m}):P.jsx(iO,{dimensions:A,lineWidth:s,variant:t,className:m})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}I1.displayName="Background";const aO=O.memo(I1);function uO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.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 dO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 hO(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 Sa({children:e,className:t,...n}){return P.jsx("button",{type:"button",className:nt(["react-flow__controls-button",t]),...n,children:e})}const pO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function A1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:a,onFitView:c,onInteractiveChange:f,className:d,children:m,position:h="bottom-left",orientation:g="vertical","aria-label":v}){const S=He(),{isInteractive:w,minZoomReached:b,maxZoomReached:k,ariaLabelConfig:N}=Me(pO,Ue),{zoomIn:E,zoomOut:_,fitView:A}=Gh(),M=()=>{E(),l==null||l()},L=()=>{_(),a==null||a()},C=()=>{A(s),c==null||c()},I=()=>{S.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},F=g==="horizontal"?"horizontal":"vertical";return P.jsxs(Su,{className:nt(["react-flow__controls",F,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&P.jsxs(P.Fragment,{children:[P.jsx(Sa,{onClick:M,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:k,children:P.jsx(uO,{})}),P.jsx(Sa,{onClick:L,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:b,children:P.jsx(cO,{})})]}),n&&P.jsx(Sa,{className:"react-flow__controls-fitview",onClick:C,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:P.jsx(fO,{})}),i&&P.jsx(Sa,{className:"react-flow__controls-interactive",onClick:I,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:w?P.jsx(hO,{}):P.jsx(dO,{})}),m]})}A1.displayName="Controls";const mO=O.memo(A1);function gO({id:e,x:t,y:n,width:i,height:s,style:l,color:a,strokeColor:c,strokeWidth:f,className:d,borderRadius:m,shapeRendering:h,selected:g,onClick:v}){const{background:S,backgroundColor:w}=l||{},b=a||S||w;return P.jsx("rect",{className:nt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:i,height:s,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:h,onClick:v?k=>v(k,e):void 0})}const yO=O.memo(gO),vO=e=>e.nodes.map(t=>t.id),Gf=e=>e instanceof Function?e:()=>e;function wO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l=yO,onClick:a}){const c=Me(vO,Ue),f=Gf(t),d=Gf(e),m=Gf(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:c.map(g=>P.jsx(bO,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:l,onClick:a,shapeRendering:h},g))})}function xO({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:a,NodeComponent:c,onClick:f}){const{node:d,x:m,y:h,width:g,height:v}=Me(S=>{const w=S.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:k,y:N}=w.internals.positionAbsolute,{width:E,height:_}=er(b);return{node:b,x:k,y:N,width:E,height:_}},Ue);return!d||d.hidden||!Mw(d)?null:P.jsx(c,{x:m,y:h,width:g,height:v,style:d.style,selected:!!d.selected,className:i(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:l,shapeRendering:a,onClick:f,id:d.id})}const bO=O.memo(xO);var SO=O.memo(wO);const kO=200,EO=150,NO=e=>!e.hidden,_O=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?Iw(Ws(e.nodeLookup,{filter:NO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},CO="react-flow__minimap-desc";function M1({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:m,maskStrokeWidth:h,position:g="bottom-right",onClick:v,onNodeClick:S,pannable:w=!1,zoomable:b=!1,ariaLabel:k,inversePan:N,zoomStep:E=1,offsetScale:_=5}){const A=He(),M=O.useRef(null),{boundingRect:L,viewBB:C,rfId:I,panZoom:F,translateExtent:R,flowWidth:$,flowHeight:Z,ariaLabelConfig:j}=Me(_O,Ue),G=(e==null?void 0:e.width)??kO,q=(e==null?void 0:e.height)??EO,J=L.width/G,Y=L.height/q,U=Math.max(J,Y),B=U*G,D=U*q,W=_*U,V=L.x-(B-L.width)/2-W,K=L.y-(D-L.height)/2-W,Q=B+W*2,re=D+W*2,se=`${CO}-${I}`,ee=O.useRef(0),oe=O.useRef();ee.current=U,O.useEffect(()=>{if(M.current&&F)return oe.current=BC({domNode:M.current,panZoom:F,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=oe.current)==null||fe.destroy()}},[F]),O.useEffect(()=>{var fe;(fe=oe.current)==null||fe.update({translateExtent:R,width:$,height:Z,inversePan:N,pannable:w,zoomStep:E,zoomable:b})},[w,b,N,E,R,$,Z]);const de=v?fe=>{var Ae;const[ke,Ie]=((Ae=oe.current)==null?void 0:Ae.pointer(fe))||[0,0];v(fe,{x:ke,y:Ie})}:void 0,xe=S?O.useCallback((fe,ke)=>{const Ie=A.getState().nodeLookup.get(ke).internals.userNode;S(fe,Ie)},[]):void 0,he=k??j["minimap.ariaLabel"];return P.jsx(Su,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f: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 h=="number"?h*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i: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:nt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:P.jsxs("svg",{width:G,height:q,viewBox:`${V} ${K} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:M,onClick:de,children:[he&&P.jsx("title",{id:se,children:he}),P.jsx(SO,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-W},${K-W}h${Q+W*2}v${re+W*2}h${-Q-W*2}z
|
|
62
|
+
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}M1.displayName="MiniMap";O.memo(M1);const TO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,OO={[co.Line]:"right",[co.Handle]:"bottom-right"};function PO({nodeId:e,position:t,variant:n=co.Handle,className:i,style:s=void 0,children:l,color:a,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:v=!0,shouldResize:S,onResizeStart:w,onResize:b,onResizeEnd:k}){const N=c1(),E=typeof e=="string"?e:N,_=He(),A=O.useRef(null),M=n===co.Handle,L=Me(O.useCallback(TO(M&&v),[M,v]),Ue),C=O.useRef(null),I=t??OO[n];O.useEffect(()=>{if(!(!A.current||!E))return C.current||(C.current=e2({domNode:A.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:R,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,domNode:q}=_.getState();return{nodeLookup:R,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,paneDomNode:q}},onChange:(R,$)=>{const{triggerNodeChanges:Z,nodeLookup:j,parentLookup:G,nodeOrigin:q}=_.getState(),J=[],Y={x:R.x,y:R.y},U=j.get(E);if(U&&U.expandParent&&U.parentId){const B=U.origin??q,D=R.width??U.measured.width??0,W=R.height??U.measured.height??0,V={id:U.id,parentId:U.parentId,rect:{width:D,height:W,...Lw({x:R.x??U.position.x,y:R.y??U.position.y},{width:D,height:W},U.parentId,j,B)}},K=Kh([V],j,G,q);J.push(...K),Y.x=R.x?Math.max(B[0]*D,R.x):void 0,Y.y=R.y?Math.max(B[1]*W,R.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const B={id:E,type:"position",position:{...Y}};J.push(B)}if(R.width!==void 0&&R.height!==void 0){const D={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};J.push(D)}for(const B of $){const D={...B,type:"position"};J.push(D)}Z(J)},onEnd:({width:R,height:$})=>{const Z={id:E,type:"dimensions",resizing:!1,dimensions:{width:R,height:$}};_.getState().triggerNodeChanges([Z])}})),C.current.update({controlPosition:I,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:m},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:k,shouldResize:S}),()=>{var R;(R=C.current)==null||R.destroy()}},[I,c,f,d,m,h,w,b,k,S]);const F=I.split("-");return P.jsx("div",{className:nt(["react-flow__resize-control","nodrag",...F,n,i]),ref:A,style:{...s,scale:L,...a&&{[M?"backgroundColor":"borderColor"]:a}},children:l})}O.memo(PO);function L1(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=L1(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function R1(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=L1(e))&&(i&&(i+=" "),i+=t);return i}const IO=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},AO=(e,t)=>({classGroupId:e,validator:t}),D1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),iu="-",a0=[],MO="arbitrary..",LO=e=>{const t=DO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return RO(a);const c=a.split(iu),f=c[0]===""&&c.length>1?1:0;return j1(c,f,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const f=i[a],d=n[a];return f?d?IO(d,f):f:d||a0}return n[a]||a0}}},j1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const d=j1(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const c=t===0?e.join(iu):e.slice(t).join(iu),f=a.length;for(let d=0;d<f;d++){const m=a[d];if(m.validator(c))return m.classGroupId}},RO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?MO+i:void 0})(),DO=e=>{const{theme:t,classGroups:n}=e;return jO(n,t)},jO=(e,t)=>{const n=D1();for(const i in e){const s=e[i];Qh(s,n,i,t)}return n},Qh=(e,t,n,i)=>{const s=e.length;for(let l=0;l<s;l++){const a=e[l];$O(a,t,n,i)}},$O=(e,t,n,i)=>{if(typeof e=="string"){zO(e,t,n);return}if(typeof e=="function"){FO(e,t,n,i);return}BO(e,t,n,i)},zO=(e,t,n)=>{const i=e===""?t:$1(t,e);i.classGroupId=n},FO=(e,t,n,i)=>{if(VO(e)){Qh(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(AO(n,e))},BO=(e,t,n,i)=>{const s=Object.entries(e),l=s.length;for(let a=0;a<l;a++){const[c,f]=s[a];Qh(f,$1(t,c),n,i)}},$1=(e,t)=>{let n=e;const i=t.split(iu),s=i.length;for(let l=0;l<s;l++){const a=i[l];let c=n.nextPart.get(a);c||(c=D1(),n.nextPart.set(a,c)),n=c}return n},VO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,WO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const s=(l,a)=>{n[l]=a,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=i[l])!==void 0)return s(l,a),a},set(l,a){l in n?n[l]=a:s(l,a)}}},xh="!",u0=":",UO=[],c0=(e,t,n,i,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:s}),HO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=s=>{const l=[];let a=0,c=0,f=0,d;const m=s.length;for(let w=0;w<m;w++){const b=s[w];if(a===0&&c===0){if(b===u0){l.push(s.slice(f,w)),f=w+1;continue}if(b==="/"){d=w;continue}}b==="["?a++:b==="]"?a--:b==="("?c++:b===")"&&c--}const h=l.length===0?s:s.slice(f);let g=h,v=!1;h.endsWith(xh)?(g=h.slice(0,-1),v=!0):h.startsWith(xh)&&(g=h.slice(1),v=!0);const S=d&&d>f?d-f:void 0;return c0(l,v,g,S)};if(t){const s=t+u0,l=i;i=a=>a.startsWith(s)?l(a.slice(s.length)):c0(UO,!1,a,void 0,!0)}if(n){const s=i;i=l=>n({className:l,parseClassName:s})}return i},qO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let s=[];for(let l=0;l<n.length;l++){const a=n[l],c=a[0]==="[",f=t.has(a);c||f?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(a)):s.push(a)}return s.length>0&&(s.sort(),i.push(...s)),i}},YO=e=>({cache:WO(e.cacheSize),parseClassName:HO(e),sortModifiers:qO(e),postfixLookupClassGroupIds:KO(e),...LO(e)}),KO=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let i=0;i<n.length;i++)t[n[i]]=!0;return t},GO=/\s+/,XO=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:a}=t,c=[],f=e.trim().split(GO);let d="";for(let m=f.length-1;m>=0;m-=1){const h=f[m],{isExternal:g,modifiers:v,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:b}=n(h);if(g){d=h+(d.length>0?" "+d:d);continue}let k=!!b,N;if(k){const L=w.substring(0,b);N=i(L);const C=N&&a[N]?i(w):void 0;C&&C!==N&&(N=C,k=!1)}else N=i(w);if(!N){if(!k){d=h+(d.length>0?" "+d:d);continue}if(N=i(w),!N){d=h+(d.length>0?" "+d:d);continue}k=!1}const E=v.length===0?"":v.length===1?v[0]:l(v).join(":"),_=S?E+xh:E,A=_+N;if(c.indexOf(A)>-1)continue;c.push(A);const M=s(N,k);for(let L=0;L<M.length;++L){const C=M[L];c.push(_+C)}d=h+(d.length>0?" "+d:d)}return d},QO=(...e)=>{let t=0,n,i,s="";for(;t<e.length;)(n=e[t++])&&(i=z1(n))&&(s&&(s+=" "),s+=i);return s},z1=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=z1(e[i]))&&(n&&(n+=" "),n+=t);return n},JO=(e,...t)=>{let n,i,s,l;const a=f=>{const d=t.reduce((m,h)=>h(m),e());return n=YO(d),i=n.cache.get,s=n.cache.set,l=c,c(f)},c=f=>{const d=i(f);if(d)return d;const m=XO(f,n);return s(f,m),m};return l=a,(...f)=>l(QO(...f))},ZO=[],ot=e=>{const t=n=>n[e]||ZO;return t.isThemeGetter=!0,t},F1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,B1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nP=/\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$/,rP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Er=e=>eP.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),Xf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Kn=e=>tP.test(e),V1=()=>!0,sP=e=>nP.test(e)&&!rP.test(e),Jh=()=>!1,lP=e=>iP.test(e),aP=e=>oP.test(e),uP=e=>!me(e)&&!ye(e),cP=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),fP=e=>Pr(e,H1,Jh),me=e=>F1.test(e),Qr=e=>Pr(e,q1,sP),f0=e=>Pr(e,wP,Oe),dP=e=>Pr(e,K1,V1),hP=e=>Pr(e,Y1,Jh),d0=e=>Pr(e,W1,Jh),pP=e=>Pr(e,U1,aP),ka=e=>Pr(e,G1,lP),ye=e=>B1.test(e),ms=e=>fi(e,q1),mP=e=>fi(e,Y1),h0=e=>fi(e,W1),gP=e=>fi(e,H1),yP=e=>fi(e,U1),Ea=e=>fi(e,G1,!0),vP=e=>fi(e,K1,!0),Pr=(e,t,n)=>{const i=F1.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},fi=(e,t,n=!1)=>{const i=B1.exec(e);return i?i[1]?t(i[1]):n:!1},W1=e=>e==="position"||e==="percentage",U1=e=>e==="image"||e==="url",H1=e=>e==="length"||e==="size"||e==="bg-size",q1=e=>e==="length",wP=e=>e==="number",Y1=e=>e==="family-name",K1=e=>e==="number"||e==="weight",G1=e=>e==="shadow",xP=()=>{const e=ot("color"),t=ot("font"),n=ot("text"),i=ot("font-weight"),s=ot("tracking"),l=ot("leading"),a=ot("breakpoint"),c=ot("container"),f=ot("spacing"),d=ot("radius"),m=ot("shadow"),h=ot("inset-shadow"),g=ot("text-shadow"),v=ot("drop-shadow"),S=ot("blur"),w=ot("perspective"),b=ot("aspect"),k=ot("ease"),N=ot("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[..._(),ye,me],M=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],C=()=>[ye,me,f],I=()=>[Er,"full","auto",...C()],F=()=>[Tn,"none","subgrid",ye,me],R=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],$=()=>[Tn,"auto",ye,me],Z=()=>["auto","min","max","fr",ye,me],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...C()],J=()=>[Er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],Y=()=>[Er,"screen","full","dvw","lvw","svw","min","max","fit",...C()],U=()=>[Er,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],B=()=>[e,ye,me],D=()=>[..._(),h0,d0,{position:[ye,me]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",gP,fP,{size:[ye,me]}],K=()=>[Xf,ms,Qr],Q=()=>["","none","full",d,ye,me],re=()=>["",Oe,ms,Qr],se=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Oe,Xf,h0,d0],de=()=>["","none",S,ye,me],xe=()=>["none",Oe,ye,me],he=()=>["none",Oe,ye,me],fe=()=>[Oe,ye,me],ke=()=>[Er,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[V1],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[uP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",Oe],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Er,me,ye,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[cP],columns:[{columns:[Oe,me,ye,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Er,"full","auto",c,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Er,"auto","initial","none",me]}],grow:[{grow:["",Oe,ye,me]}],shrink:[{shrink:["",Oe,ye,me]}],order:[{order:[Tn,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,ms,Qr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,vP,dP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xf,me]}],"font-family":[{font:[mP,hP,t]}],"font-features":[{"font-features":[me]}],"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:[s,ye,me]}],"line-clamp":[{"line-clamp":[Oe,"none",ye,f0]}],leading:[{leading:[l,...C()]}],"list-image":[{"list-image":["none",ye,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Qr]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Tn,ye,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,ye,me],radial:["",ye,me],conic:[Tn,ye,me]},yP,pP]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,me]}],"outline-w":[{outline:["",Oe,ms,Qr]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",m,Ea,ka]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,Ea,ka]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Oe,Qr]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",g,Ea,ka]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Oe,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:de()}],brightness:[{brightness:[Oe,ye,me]}],contrast:[{contrast:[Oe,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Ea,ka]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Oe,ye,me]}],"hue-rotate":[{"hue-rotate":[Oe,ye,me]}],invert:[{invert:["",Oe,ye,me]}],saturate:[{saturate:[Oe,ye,me]}],sepia:[{sepia:["",Oe,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ye,me]}],ease:[{ease:["linear","initial",k,ye,me]}],delay:[{delay:[Oe,ye,me]}],animate:[{animate:["none",N,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ye,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],zoom:[{zoom:[Tn,ye,me]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",ye,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Oe,ms,Qr,f0]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},bP=JO(xP);function ut(...e){return bP(R1(e))}function gs(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function Qf(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function SP(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw new Error("Invalid ISO8601 passed to timezone parser.");let i=e.substring(9);return i.includes("Z")||i.includes("+")||i.includes("-")?bh(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Etc/UTC"):bh(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function p0(e,t,n){return X1(SP(e,t),n)}function X1(e,t){let n=new Date(gs(e)),i=xs(n,e.tz),s=gs(e),l=gs(i),a=s-l,c=new Date(n.getTime()+a),f=xs(c,e.tz);if(Qf(f,e)){let h=new Date(c.getTime()-36e5),g=xs(h,e.tz);return Qf(g,e)?h:c}let d=new Date(c.getTime()+gs(e)-gs(f)),m=xs(d,e.tz);if(Qf(m,e))return d;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>d.getTime()?c:d}function xs(e,t){let n,i;try{n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=n.formatToParts(e)}catch(l){let a=l instanceof Error?l.message:String(l);throw new RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${a}`)}let s={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let l of i)(l.type==="year"||l.type==="month"||l.type==="day"||l.type==="hour"||l.type==="minute"||l.type==="second")&&(s[l.type]=parseInt(l.value,10));if(isNaN(s.year)||isNaN(s.month)||isNaN(s.day)||isNaN(s.hour)||isNaN(s.minute)||isNaN(s.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(s)}`);return s.hour===24&&(s.hour=0),{y:s.year,m:s.month,d:s.day,h:s.hour,i:s.minute,s:s.second,tz:t}}function bh(e,t,n,i,s,l,a){return{y:e,m:t,d:n,h:i,i:s,s:l,tz:a}}var Q1=[1,2,4,8,16],m0=class{constructor(e,t,n){_e(this,"pattern");_e(this,"timezone");_e(this,"mode");_e(this,"alternativeWeekdays");_e(this,"sloppyRanges");_e(this,"second");_e(this,"minute");_e(this,"hour");_e(this,"day");_e(this,"month");_e(this,"dayOfWeek");_e(this,"year");_e(this,"lastDayOfMonth");_e(this,"lastWeekday");_e(this,"nearestWeekdays");_e(this,"starDOM");_e(this,"starDOW");_e(this,"starYear");_e(this,"useAndLogic");this.pattern=e,this.timezone=t,this.mode=(n==null?void 0:n.mode)??"auto",this.alternativeWeekdays=(n==null?void 0:n.alternativeWeekdays)??!1,this.sloppyRanges=(n==null?void 0:n.sloppyRanges)??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[""],t=e.length;if(e.length<5||e.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(t):t===i)){let s=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${s} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift("0"),e.length===6&&e.push("*"),e[3].toUpperCase()==="LW"?(this.lastWeekday=!0,e[3]=""):e[3].toUpperCase().indexOf("L")>=0&&(e[3]=e[3].replace(/L/gi,""),this.lastDayOfMonth=!0),e[3]=="*"&&(this.starDOM=!0),e[6]=="*"&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith("+")&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(e[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(e[0]=e[0].replace(/\?/g,"*"),e[1]=e[1].replace(/\?/g,"*"),e[2]=e[2].replace(/\?/g,"*"),e[3]=e[3].replace(/\?/g,"*"),e[4]=e[4].replace(/\?/g,"*"),e[5]=e[5].replace(/\?/g,"*"),e[6]&&(e[6]=e[6].replace(/\?/g,"*"))),this.mode){case"5-part":e[0]="0",e[6]="*";break;case"6-part":e[6]="*";break;case"5-or-6-parts":e[6]="*";break}this.throwAtIllegalCharacters(e),this.partToArray("second",e[0],0,1),this.partToArray("minute",e[1],0,1),this.partToArray("hour",e[2],0,1),this.partToArray("day",e[3],-1,1),this.partToArray("month",e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",e[5],n,63),this.partToArray("year",e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,i){let s=this[e],l=e==="day"&&this.lastDayOfMonth,a=e==="day"&&this.lastWeekday;if(t===""&&!l&&!a)throw new TypeError("CronPattern: configuration entry "+e+" ("+t+") is empty, check for trailing spaces.");if(t==="*")return s.fill(i);let c=t.split(",");if(c.length>1)for(let f=0;f<c.length;f++)this.partToArray(e,c[f],n,i);else t.indexOf("-")!==-1&&t.indexOf("/")!==-1?this.handleRangeWithStepping(t,e,n,i):t.indexOf("-")!==-1?this.handleRange(t,e,n,i):t.indexOf("/")!==-1?this.handleStepping(t,e,n,i):t!==""&&this.handleNumber(t,e,n,i)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw new TypeError("CronPattern: configuration entry "+t+" ("+e[t]+") contains illegal characters.")}handleNumber(e,t,n,i){let s=this.extractNth(e,t),l=e.toUpperCase().includes("W");if(t!=="day"&&l)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");l&&(t="nearestWeekdays");let a=parseInt(s[0],10)+n;if(isNaN(a))throw new TypeError("CronPattern: "+t+" is not a number: '"+e+"'");this.setPart(t,a,s[1]||i)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw new TypeError("CronPattern: Invalid part specified: "+e);if(e==="dayOfWeek"){if(t===7&&(t=0),t<0||t>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+t);this.setNthWeekdayOfMonth(t,n);return}if(e==="second"||e==="minute"){if(t<0||t>=60)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="hour"){if(t<0||t>=24)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="day"||e==="nearestWeekdays"){if(t<0||t>=31)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="month"){if(t<0||t>=12)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="year"&&(t<1||t>=1e4))throw new RangeError("CronPattern: Invalid value for "+e+": "+t+" (supported range: 1-9999)");this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw new TypeError(t)}validateRange(e,t,n,i,s){if(e>t)throw new TypeError("CronPattern: From value is larger than to value: '"+s+"'");if(n!==void 0){if(n===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(n>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let s=this.extractNth(e,t),l=s[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(l===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+e+"'");let[,a,c,f]=l,d=parseInt(a,10)+n,m=parseInt(c,10)+n,h=parseInt(f,10);this.validateNotNaN(d,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(h,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(d,m,h,t,e);for(let g=d;g<=m;g+=h)this.setPart(t,g,s[1]||i)}extractNth(e,t){let n=e,i;if(n.includes("#")){if(t!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=n.split("#")[1],n=n.split("#")[0]}else if(n.toUpperCase().endsWith("L")){if(t!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",n=n.slice(0,-1)}return[n,i]}handleRange(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let s=this.extractNth(e,t),l=s[0].split("-");if(l.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+e+"'");let a=parseInt(l[0],10)+n,c=parseInt(l[1],10)+n;this.validateNotNaN(a,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(c,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(a,c,void 0,t,e);for(let f=a;f<=c;f++)this.setPart(t,f,s[1]||i)}handleStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let s=this.extractNth(e,t),l=s[0].split("/");if(l.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+e+"'");if(this.sloppyRanges)l[0]===""&&(l[0]="*");else{if(l[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(l[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let a=0;l[0]!=="*"&&(a=parseInt(l[0],10)+n);let c=parseInt(l[1],10);this.validateNotNaN(c,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[t].length-1,c,t,e);for(let f=a;f<this[t].length;f+=c)this.setPart(t,f,s[1]||i)}replaceAlphaDays(e){return e.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(e){return e.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(e){let t=e.trim().toLowerCase();if(t==="@yearly"||t==="@annually")return"0 0 1 1 *";if(t==="@monthly")return"0 0 1 * *";if(t==="@weekly")return"0 0 * * 0";if(t==="@daily"||t==="@midnight")return"0 0 * * *";if(t==="@hourly")return"0 * * * *";if(t==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return e}setNthWeekdayOfMonth(e,t){if(typeof t!="number"&&t.toUpperCase()==="L")this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|Q1[t-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},Jf=[31,28,31,30,31,30,31,31,30,31,30,31],Ve=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],dt=class J1{constructor(t,n){_e(this,"tz");_e(this,"ms");_e(this,"second");_e(this,"minute");_e(this,"hour");_e(this,"day");_e(this,"month");_e(this,"year");if(this.tz=n,t&&t instanceof Date)if(!isNaN(t))this.fromDate(t);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(t==null)this.fromDate(new Date);else if(t&&typeof t=="string")this.fromString(t);else if(t instanceof J1)this.fromCronDate(t);else throw new TypeError("CronDate: Invalid type ("+typeof t+") passed to CronDate constructor")}getLastDayOfMonth(t,n){return n!==1?Jf[n]:new Date(Date.UTC(t,n+1,0)).getUTCDate()}getLastWeekday(t,n){let i=this.getLastDayOfMonth(t,n),s=new Date(Date.UTC(t,n,i)).getUTCDay();return s===0?i-2:s===6?i-1:i}getNearestWeekday(t,n,i){let s=this.getLastDayOfMonth(t,n);if(i>s)return-1;let l=new Date(Date.UTC(t,n,i)).getUTCDay();return l===0?i===s?i-2:i+1:l===6?i===1?i+2:i-1:i}isNthWeekdayOfMonth(t,n,i,s){let l=new Date(Date.UTC(t,n,i)).getUTCDay(),a=0;for(let c=1;c<=i;c++)new Date(Date.UTC(t,n,c)).getUTCDay()===l&&a++;if(s&63&&Q1[a-1]&s)return!0;if(s&32){let c=this.getLastDayOfMonth(t,n);for(let f=i+1;f<=c;f++)if(new Date(Date.UTC(t,n,f)).getUTCDay()===l)return!1;return!0}return!1}fromDate(t){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes()+this.tz,this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply();else try{let n=xs(t,this.tz);this.ms=t.getMilliseconds(),this.second=n.s,this.minute=n.i,this.hour=n.h,this.day=n.d,this.month=n.m-1,this.year=n.y}catch(n){let i=n instanceof Error?n.message:String(n);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${i}`)}else this.ms=t.getMilliseconds(),this.second=t.getSeconds(),this.minute=t.getMinutes(),this.hour=t.getHours(),this.day=t.getDate(),this.month=t.getMonth(),this.year=t.getFullYear()}fromCronDate(t){this.tz=t.tz,this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.ms=t.ms}apply(){if(this.month>11||this.month<0||this.day>Jf[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let t=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),!0}else return!1}fromString(t){if(typeof this.tz=="number"){let n=p0(t);this.ms=n.getUTCMilliseconds(),this.second=n.getUTCSeconds(),this.minute=n.getUTCMinutes(),this.hour=n.getUTCHours(),this.day=n.getUTCDate(),this.month=n.getUTCMonth(),this.year=n.getUTCFullYear(),this.apply()}else return this.fromDate(p0(t,this.tz))}findNext(t,n,i,s){return this._findMatch(t,n,i,s,1)}_findMatch(t,n,i,s,l){let a=this[n],c;i.lastDayOfMonth&&(c=this.getLastDayOfMonth(this.year,this.month));let f=!i.starDOW&&n=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,d=this[n]+s,m=l===1?h=>h<i[n].length:h=>h>=0;for(let h=d;m(h);h+=l){let g=i[n][h];if(n==="day"&&!g){for(let v=0;v<i.nearestWeekdays.length;v++)if(i.nearestWeekdays[v]){let S=this.getNearestWeekday(this.year,this.month,v-s);if(S===-1)continue;if(S===h-s){g=1;break}}}if(n==="day"&&i.lastWeekday){let v=this.getLastWeekday(this.year,this.month);h-s===v&&(g=1)}if(n==="day"&&i.lastDayOfMonth&&h-s==c&&(g=1),n==="day"&&!i.starDOW){let v=i.dayOfWeek[(f+(h-s-1))%7];if(v&&v&63)v=this.isNthWeekdayOfMonth(this.year,this.month,h-s,v)?1:0;else if(v)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${v}`);i.useAndLogic?g=g&&v:!t.domAndDow&&!i.starDOM?g=g||v:g=g&&v}if(g)return this[n]=h-s,a!==this[n]?2:1}return 3}recurse(t,n,i){if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let l=-1;for(let a=this.year+1;a<t.year.length&&a<1e4;a++)if(t.year[a]===1){l=a;break}if(l===-1)return null;this.year=l,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let s=this.findNext(n,Ve[i][0],t,Ve[i][2]);if(s>1){let l=i+1;for(;l<Ve.length;)this[Ve[l][0]]=-Ve[l][2],l++;if(s===3){if(this[Ve[i][1]]++,this[Ve[i][0]]=-Ve[i][2],this.apply(),i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=t.year.length)return null}return this.recurse(t,n,0)}else if(this.apply())return this.recurse(t,n,i-1)}return i+=1,i>=Ve.length?this:(t.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(t,n,i)}increment(t,n,i){return this.second+=n.interval!==void 0&&n.interval>1&&i?n.interval:1,this.ms=0,this.apply(),this.recurse(t,n,0)}decrement(t,n){return this.second-=n.interval!==void 0&&n.interval>1?n.interval:1,this.ms=0,this.apply(),this.recurseBackward(t,n,0,0)}recurseBackward(t,n,i,s=0){if(s>1e4)return null;if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let a=-1;for(let c=this.year-1;c>=0;c--)if(t.year[c]===1){a=c;break}if(a===-1)return null;this.year=a,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let l=this.findPrevious(n,Ve[i][0],t,Ve[i][2]);if(l>1){let a=i+1;for(;a<Ve.length;){let c=Ve[a][0],f=Ve[a][2],d=this.getMaxPatternValue(c,t,f);this[c]=d,a++}if(l===3){if(this[Ve[i][1]]--,i===0){let m=this.getLastDayOfMonth(this.year,this.month);this.day>m&&(this.day=m)}if(i===1)if(this.day<=0)this.day=1;else{let m=this.year,h=this.month;for(;h<0;)h+=12,m--;for(;h>11;)h-=12,m++;let g=h!==1?Jf[h]:new Date(Date.UTC(m,h+1,0)).getUTCDate();this.day>g&&(this.day=g)}this.apply();let c=Ve[i][0],f=Ve[i][2],d=this.getMaxPatternValue(c,t,f);if(c==="day"){let m=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(d,m)}else this[c]=d;if(this.apply(),i===0){let m=Ve[1][2],h=this.getMaxPatternValue("day",t,m),g=this.getLastDayOfMonth(this.year,this.month),v=Math.min(h,g);v!==this.day&&(this.day=v,this.hour=this.getMaxPatternValue("hour",t,Ve[2][2]),this.minute=this.getMaxPatternValue("minute",t,Ve[3][2]),this.second=this.getMaxPatternValue("second",t,Ve[4][2]))}if(i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(t,n,0,s+1)}else if(this.apply())return this.recurseBackward(t,n,i-1,s+1)}return i+=1,i>=Ve.length?this:this.year<0?null:this.recurseBackward(t,n,i,s+1)}getMaxPatternValue(t,n,i){if(t==="day"&&n.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(t==="day"&&!n.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let s=n[t].length-1;s>=0;s--)if(n[t][s])return s-i;return n[t].length-1-i}findPrevious(t,n,i,s){return this._findMatch(t,n,i,s,-1)}getDate(t){return t||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):X1(bh(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(t,n){if(!t.starYear&&(this.year<0||this.year>=t.year.length||t.year[this.year]===0))return!1;for(let i=0;i<Ve.length;i++){let s=Ve[i][0],l=Ve[i][2],a=this[s];if(a+l<0||a+l>=t[s].length)return!1;let c=t[s][a+l];if(s==="day"){if(!c){for(let f=0;f<t.nearestWeekdays.length;f++)if(t.nearestWeekdays[f]){let d=this.getNearestWeekday(this.year,this.month,f-l);if(d!==-1&&d===a){c=1;break}}}if(t.lastWeekday){let f=this.getLastWeekday(this.year,this.month);a===f&&(c=1)}if(t.lastDayOfMonth){let f=this.getLastDayOfMonth(this.year,this.month);a===f&&(c=1)}if(!t.starDOW){let f=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),d=t.dayOfWeek[(f+(a-1))%7];d&&d&63&&(d=this.isNthWeekdayOfMonth(this.year,this.month,a,d)?1:0),t.useAndLogic?c=c&&d:!n.domAndDow&&!t.starDOM?c=c||d:c=c&&d}}if(!c)return!1}return!0}};function kP(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused===void 0?!1:e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch===void 0?!1:e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref===void 0?!1:e.unref,e.mode=e.mode===void 0?"auto":e.mode,e.alternativeWeekdays=e.alternativeWeekdays===void 0?!1:e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges===void 0?!1:e.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(e.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(e.startAt&&(e.startAt=new dt(e.startAt,e.timezone)),e.stopAt&&(e.stopAt=new dt(e.stopAt,e.timezone)),e.interval!==null){if(isNaN(e.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(e.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(e.utcOffset<-870||e.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(e.utcOffset!==void 0&&e.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(e.unref!==!0&&e.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return e}function bs(e){return Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function}function EP(e){return bs(e)}function NP(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var g0=30*1e3,Na=[],_P=class{constructor(e,t,n){_e(this,"name");_e(this,"options");_e(this,"_states");_e(this,"fn");let i,s;if(bs(t))s=t;else if(typeof t=="object")i=t;else if(t!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(bs(n))s=n;else if(typeof n=="object")i=n;else if(n!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=i==null?void 0:i.name,this.options=kP(i),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:i?i.maxRuns:void 0,paused:i?i.paused:!1,pattern:new m0("* * * * *",void 0,{mode:"auto"})},e&&(e instanceof Date||typeof e=="string"&&e.indexOf(":")>0)?this._states.once=new dt(e,this.getTz()):this._states.pattern=new m0(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(Na.find(l=>l.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");Na.push(this)}return s!==void 0&&EP(s)&&(this.fn=s,this.schedule()),this}getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,"next")}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,"previous")}_enumerateRuns(e,t,n){let i=[],s=t?new dt(t,this.getTz()):null,l=n==="next"?this._next:this._previous;for(;e--;){let a=l.call(this,s);if(!a)break;let c=a.getDate(!1);i.push(this.applyDayOffset(c)),s=a}return i}match(e){if(this._states.once){let n=new dt(e,this.getTz());n.ms=0;let i=new dt(this._states.once,this.getTz());return i.ms=0,n.getTime()===i.getTime()}let t=new dt(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,i=!this._states.kill;return t&&n&&i&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof dt||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new dt(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=Na.indexOf(this);e>=0&&Na.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>g0&&(t=g0),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&NP(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new dt(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(t){if(bs(this.options.catch))try{this.options.catch(t,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new dt(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),i=this._states.blocking&&this.options.protect;n&&!i?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&i&&bs(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new dt(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let i=this._states.once||new dt(e,this.getTz());return!n&&i!==this._states.once&&(i=i.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||i===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&i.getTime()>=this.options.stopAt.getTime()?null:i}_previous(e){let t=new dt(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new dt(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new dt(void 0,this.getTz()),i=e;if(this.options.startAt.getTime()<=n.getTime()){i=this.options.startAt;let s=i.getTime()+this.options.interval*1e3;for(;s<=n.getTime();)i=new dt(i,this.getTz()).increment(this._states.pattern,this.options,!0),s=i.getTime()+this.options.interval*1e3;t=!0}return i===null&&(i=void 0),[i,t]}};function CP(e){var i,s;const t=(i=e.nodes)==null?void 0:i.find(l=>l.type==="trigger.cron"),n=(s=t==null?void 0:t.config)==null?void 0:s.cron;return typeof n=="string"?n:null}function TP(e,t=new Date){try{return new _P(e).nextRun(t)}catch{return null}}function OP(e){const t=Math.round(e/6e4);if(t<1)return"<1m";if(t<60)return`${t}m`;const n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function PP(e,t=new Date){const n=TP(e,t);if(!n)return null;const i=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),s=n.toLocaleString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}),l=OP(n.getTime()-t.getTime());return{short:i,title:`Next run ${s} (in ${l}) · cron ${e}`}}function y0(e){return e?e.replace(/^trigger\./,""):""}function IP({activeView:e,onViewChange:t,liveConnected:n,workflows:i=[],selected:s,onSelect:l,onRun:a,version:c}){return P.jsxs("aside",{className:"w-60 shrink-0 bg-bg border-r border-border flex flex-col",children:[P.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[P.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),P.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),c&&P.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",c]})]}),P.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),P.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their ",P.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover a workflow → ",P.jsx("span",{className:"font-mono text-fg",children:"▶ run"})," to trigger now."]}),P.jsxs("nav",{className:"px-2 space-y-0.5",children:[i.length===0&&P.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),i.map(f=>{const d=CP(f),m=d?PP(d):null;return P.jsxs("div",{"data-testid":"workflow-item",className:ut("group w-full px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px] cursor-pointer",f.name===s?"bg-muted":"hover:bg-muted text-mutedfg"),onClick:()=>l==null?void 0:l(f.name),children:[P.jsx("span",{className:ut("size-1.5 rounded-full flex-shrink-0",f.name===s?"bg-ok":"bg-border")}),P.jsx("span",{className:"truncate",children:f.name}),P.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[m?P.jsxs("span",{"data-testid":"next-run",title:m.title,className:"text-[10px] text-mutedfg font-mono whitespace-nowrap",children:["next ",m.short]}):y0(f.triggerType)&&P.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:y0(f.triggerType)}),f.runnable&&a&&P.jsx("button",{"data-testid":"run-workflow",title:`Run ${f.name} now`,onClick:h=>{h.stopPropagation(),a(f.name)},className:"text-[11px] font-mono text-mutedfg hover:text-ok px-1 rounded opacity-0 group-hover:opacity-100",children:"▶ run"})]})]},f.name)})]}),P.jsx("div",{className:"px-3 pt-5 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"View"}),P.jsxs("nav",{className:"px-2 space-y-0.5",children:[P.jsx("button",{onClick:()=>t("board"),className:ut("w-full text-left px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px]",e==="board"?"bg-muted":"hover:bg-muted text-mutedfg"),children:"Whiteboard"}),P.jsxs("button",{onClick:()=>t("runs"),className:ut("w-full text-left px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px]",e==="runs"?"bg-muted":"hover:bg-muted text-mutedfg"),children:["Runs",n&&P.jsx("span",{className:"ml-auto size-1.5 rounded-full bg-ok pulse-dot"})]})]}),P.jsxs("div",{className:"mt-auto p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx("span",{className:ut("size-1.5 rounded-full",n?"bg-ok":"bg-border")}),n?"server connected":"scheduler running"]}),P.jsxs("div",{className:"mt-1 font-mono",children:["no fleet state stored —",P.jsx("br",{}),"surfaces are the source of truth"]})]})]})}function AP({workflow:e,onLoadYaml:t}){const n=(e==null?void 0:e.name)??"no workflow loaded",i=e?`workflows/${e.name}.yaml`:"",[s,l]=O.useState(!1),a=O.useRef(null),c=O.useCallback(()=>{var m;const d=((m=a.current)==null?void 0:m.value)??"";d.trim()&&(t(d),l(!1))},[t]),f=O.useCallback(()=>{l(!1)},[]);return P.jsxs(P.Fragment,{children:[P.jsxs("header",{className:"h-12 shrink-0 bg-bg border-b border-border flex items-center px-4 gap-3",children:[P.jsx("h1",{className:"font-semibold tracking-tight",children:n}),i&&P.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded",children:i}),P.jsx("div",{className:"ml-auto",children:P.jsx("button",{onClick:()=>l(!0),className:"text-[12px] px-2.5 py-1 rounded bg-muted hover:bg-border text-fg transition-colors",children:"Paste YAML"})})]}),s&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:P.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[520px] max-w-[90vw]",children:[P.jsxs("div",{className:"flex items-center justify-between",children:[P.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),P.jsx("button",{onClick:f,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),P.jsx("textarea",{ref:a,className:"w-full h-64 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary",placeholder:"Paste your workflow YAML here...",spellCheck:!1}),P.jsxs("div",{className:"flex justify-end gap-2",children:[P.jsx("button",{onClick:f,className:"text-[12px] px-3 py-1.5 rounded bg-muted hover:bg-border text-fg transition-colors",children:"Cancel"}),P.jsx("button",{onClick:c,className:"text-[12px] px-3 py-1.5 rounded bg-primary hover:opacity-90 text-white transition-opacity",children:"Apply"})]})]})})]})}function v0({status:e}){return P.jsx("span",{"data-testid":"status-dot","data-status":e,className:ut("size-1.5 rounded-full flex-shrink-0",e==="idle"&&"bg-border",e==="running"&&"bg-run pulse-dot",e==="success"&&"bg-ok",e==="failed"&&"bg-fail")})}function w0({data:e,selected:t}){const{node:n,liveStatus:i="idle"}=e;if(n.type==="agent.run"){const l=i==="running";return P.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className:ut("rounded-lg border overflow-hidden cursor-pointer","bg-agentbg border-agent/40",l?"agent-ring agent-live":"agent-ring"),style:{width:220,height:60},onClick:()=>{var a;return(a=e.onNodeClick)==null?void 0:a.call(e,n)},children:[P.jsx("div",{className:"h-1 bg-agent"}),P.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx(v0,{status:i}),P.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),P.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),P.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),P.jsx(Tr,{type:"target",position:Se.Left,className:"!bg-agent/50"}),P.jsx(Tr,{type:"source",position:Se.Right,className:"!bg-agent/50"})]})}return P.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className:ut("rounded-lg border overflow-hidden cursor-pointer bg-bg border-border shadow-sm",t&&"ring-2 ring-fg/20"),style:{width:n.type==="task.branch"||n.type.startsWith("trigger.")?140:220,height:60},onClick:()=>{var l;return(l=e.onNodeClick)==null?void 0:l.call(e,n)},children:[P.jsx("div",{className:"h-1 bg-mutedfg/30"}),P.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx(v0,{status:i}),P.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),P.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),P.jsx(Tr,{type:"target",position:Se.Left,className:"!bg-mutedfg/50"}),P.jsx(Tr,{type:"source",position:Se.Right,className:"!bg-mutedfg/50"})]})}var Zf,x0;function Zh(){if(x0)return Zf;x0=1;var e="\0",t="\0",n="";class i{constructor(m){_e(this,"_isDirected",!0);_e(this,"_isMultigraph",!1);_e(this,"_isCompound",!1);_e(this,"_label");_e(this,"_defaultNodeLabelFn",()=>{});_e(this,"_defaultEdgeLabelFn",()=>{});_e(this,"_nodes",{});_e(this,"_in",{});_e(this,"_preds",{});_e(this,"_out",{});_e(this,"_sucs",{});_e(this,"_edgeObjs",{});_e(this,"_edgeLabels",{});_e(this,"_nodeCount",0);_e(this,"_edgeCount",0);_e(this,"_parent");_e(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(h=>Object.keys(m._in[h]).length===0)}sinks(){var m=this;return this.nodes().filter(h=>Object.keys(m._out[h]).length===0)}setNodes(m,h){var g=arguments,v=this;return m.forEach(function(S){g.length>1?v.setNode(S,h):v.setNode(S)}),this}setNode(m,h){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=h),this):(this._nodes[m]=arguments.length>1?h:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var h=this;if(Object.hasOwn(this._nodes,m)){var g=v=>h.removeEdge(h._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){h.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(g),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var g=h;g!==void 0;g=this.parent(g))if(g===m)throw new Error("Setting "+h+" as parent of "+m+" would create a cycle");this.setNode(h)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=h,this._children[h][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var h=this._parent[m];if(h!==t)return h}}children(m=t){if(this._isCompound){var h=this._children[m];if(h)return Object.keys(h)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var h=this._preds[m];if(h)return Object.keys(h)}successors(m){var h=this._sucs[m];if(h)return Object.keys(h)}neighbors(m){var h=this.predecessors(m);if(h){const v=new Set(h);for(var g of this.successors(m))v.add(g);return Array.from(v.values())}}isLeaf(m){var h;return this.isDirected()?h=this.successors(m):h=this.neighbors(m),h.length===0}filterNodes(m){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var g=this;Object.entries(this._nodes).forEach(function([w,b]){m(w)&&h.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,g.edge(w))});var v={};function S(w){var b=g.parent(w);return b===void 0||h.hasNode(b)?(v[w]=b,b):b in v?v[b]:S(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,S(w))),h}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,h){var g=this,v=arguments;return m.reduce(function(S,w){return v.length>1?g.setEdge(S,w,h):g.setEdge(S,w),w}),this}setEdge(){var m,h,g,v,S=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,h=w.w,g=w.name,arguments.length===2&&(v=arguments[1],S=!0)):(m=w,h=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],S=!0)),m=""+m,h=""+h,g!==void 0&&(g=""+g);var b=a(this._isDirected,m,h,g);if(Object.hasOwn(this._edgeLabels,b))return S&&(this._edgeLabels[b]=v),this;if(g!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(h),this._edgeLabels[b]=S?v:this._defaultEdgeLabelFn(m,h,g);var k=c(this._isDirected,m,h,g);return m=k.v,h=k.w,Object.freeze(k),this._edgeObjs[b]=k,s(this._preds[h],m),s(this._sucs[m],h),this._in[h][b]=k,this._out[m][b]=k,this._edgeCount++,this}edge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,m,h,g),S=this._edgeObjs[v];return S&&(m=S.v,h=S.w,delete this._edgeLabels[v],delete this._edgeObjs[v],l(this._preds[h],m),l(this._sucs[m],h),delete this._in[h][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,h){var g=this._in[m];if(g){var v=Object.values(g);return h?v.filter(S=>S.v===h):v}}outEdges(m,h){var g=this._out[m];if(g){var v=Object.values(g);return h?v.filter(S=>S.w===h):v}}nodeEdges(m,h){var g=this.inEdges(m,h);if(g)return g.concat(this.outEdges(m,h))}}function s(d,m){d[m]?d[m]++:d[m]=1}function l(d,m){--d[m]||delete d[m]}function a(d,m,h,g){var v=""+m,S=""+h;if(!d&&v>S){var w=v;v=S,S=w}return v+n+S+n+(g===void 0?e:g)}function c(d,m,h,g){var v=""+m,S=""+h;if(!d&&v>S){var w=v;v=S,S=w}var b={v,w:S};return g&&(b.name=g),b}function f(d,m){return a(d,m.v,m.w,m.name)}return Zf=i,Zf}var ed,b0;function MP(){return b0||(b0=1,ed="2.2.4"),ed}var td,S0;function LP(){return S0||(S0=1,td={Graph:Zh(),version:MP()}),td}var nd,k0;function RP(){if(k0)return nd;k0=1;var e=Zh();nd={write:t,read:s};function t(l){var a={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:n(l),edges:i(l)};return l.graph()!==void 0&&(a.value=structuredClone(l.graph())),a}function n(l){return l.nodes().map(function(a){var c=l.node(a),f=l.parent(a),d={v:a};return c!==void 0&&(d.value=c),f!==void 0&&(d.parent=f),d})}function i(l){return l.edges().map(function(a){var c=l.edge(a),f={v:a.v,w:a.w};return a.name!==void 0&&(f.name=a.name),c!==void 0&&(f.value=c),f})}function s(l){var a=new e(l.options).setGraph(l.value);return l.nodes.forEach(function(c){a.setNode(c.v,c.value),c.parent&&a.setParent(c.v,c.parent)}),l.edges.forEach(function(c){a.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),a}return nd}var rd,E0;function DP(){if(E0)return rd;E0=1,rd=e;function e(t){var n={},i=[],s;function l(a){Object.hasOwn(n,a)||(n[a]=!0,s.push(a),t.successors(a).forEach(l),t.predecessors(a).forEach(l))}return t.nodes().forEach(function(a){s=[],l(a),s.length&&i.push(s)}),i}return rd}var id,N0;function Z1(){if(N0)return id;N0=1;class e{constructor(){_e(this,"_arr",[]);_e(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var s=this._keyIndices;if(n=String(n),!Object.hasOwn(s,n)){var l=this._arr,a=l.length;return s[n]=a,l.push({key:n,priority:i}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var s=this._keyIndices[n];if(i>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+i);this._arr[s].priority=i,this._decrease(s)}_heapify(n){var i=this._arr,s=2*n,l=s+1,a=n;s<i.length&&(a=i[s].priority<i[a].priority?s:a,l<i.length&&(a=i[l].priority<i[a].priority?l:a),a!==n&&(this._swap(n,a),this._heapify(a)))}_decrease(n){for(var i=this._arr,s=i[n].priority,l;n!==0&&(l=n>>1,!(i[l].priority<s));)this._swap(n,l),n=l}_swap(n,i){var s=this._arr,l=this._keyIndices,a=s[n],c=s[i];s[n]=c,s[i]=a,l[c.key]=n,l[a.key]=i}}return id=e,id}var od,_0;function ex(){if(_0)return od;_0=1;var e=Z1();od=n;var t=()=>1;function n(s,l,a,c){return i(s,String(l),a||t,c||function(f){return s.outEdges(f)})}function i(s,l,a,c){var f={},d=new e,m,h,g=function(v){var S=v.v!==m?v.v:v.w,w=f[S],b=a(v),k=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+b);k<w.distance&&(w.distance=k,w.predecessor=m,d.decrease(S,k))};for(s.nodes().forEach(function(v){var S=v===l?0:Number.POSITIVE_INFINITY;f[v]={distance:S},d.add(v,S)});d.size()>0&&(m=d.removeMin(),h=f[m],h.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(g);return f}return od}var sd,C0;function jP(){if(C0)return sd;C0=1;var e=ex();sd=t;function t(n,i,s){return n.nodes().reduce(function(l,a){return l[a]=e(n,a,i,s),l},{})}return sd}var ld,T0;function tx(){if(T0)return ld;T0=1,ld=e;function e(t){var n=0,i=[],s={},l=[];function a(c){var f=s[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),t.successors(c).forEach(function(h){Object.hasOwn(s,h)?s[h].onStack&&(f.lowlink=Math.min(f.lowlink,s[h].index)):(a(h),f.lowlink=Math.min(f.lowlink,s[h].lowlink))}),f.lowlink===f.index){var d=[],m;do m=i.pop(),s[m].onStack=!1,d.push(m);while(c!==m);l.push(d)}}return t.nodes().forEach(function(c){Object.hasOwn(s,c)||a(c)}),l}return ld}var ad,O0;function $P(){if(O0)return ad;O0=1;var e=tx();ad=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return ad}var ud,P0;function zP(){if(P0)return ud;P0=1,ud=t;var e=()=>1;function t(i,s,l){return n(i,s||e,l||function(a){return i.outEdges(a)})}function n(i,s,l){var a={},c=i.nodes();return c.forEach(function(f){a[f]={},a[f][f]={distance:0},c.forEach(function(d){f!==d&&(a[f][d]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(d){var m=d.v===f?d.w:d.v,h=s(d);a[f][m]={distance:h,predecessor:f}})}),c.forEach(function(f){var d=a[f];c.forEach(function(m){var h=a[m];c.forEach(function(g){var v=h[f],S=d[g],w=h[g],b=v.distance+S.distance;b<w.distance&&(w.distance=b,w.predecessor=S.predecessor)})})}),a}return ud}var cd,I0;function nx(){if(I0)return cd;I0=1;function e(n){var i={},s={},l=[];function a(c){if(Object.hasOwn(s,c))throw new t;Object.hasOwn(i,c)||(s[c]=!0,i[c]=!0,n.predecessors(c).forEach(a),delete s[c],l.push(c))}if(n.sinks().forEach(a),Object.keys(i).length!==n.nodeCount())throw new t;return l}class t extends Error{constructor(){super(...arguments)}}return cd=e,e.CycleException=t,cd}var fd,A0;function FP(){if(A0)return fd;A0=1;var e=nx();fd=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return fd}var dd,M0;function rx(){if(M0)return dd;M0=1,dd=e;function e(s,l,a){Array.isArray(l)||(l=[l]);var c=s.isDirected()?h=>s.successors(h):h=>s.neighbors(h),f=a==="post"?t:n,d=[],m={};return l.forEach(h=>{if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);f(h,c,m,d)}),d}function t(s,l,a,c){for(var f=[[s,!1]];f.length>0;){var d=f.pop();d[1]?c.push(d[0]):Object.hasOwn(a,d[0])||(a[d[0]]=!0,f.push([d[0],!0]),i(l(d[0]),m=>f.push([m,!1])))}}function n(s,l,a,c){for(var f=[s];f.length>0;){var d=f.pop();Object.hasOwn(a,d)||(a[d]=!0,c.push(d),i(l(d),m=>f.push(m)))}}function i(s,l){for(var a=s.length;a--;)l(s[a],a,s);return s}return dd}var hd,L0;function BP(){if(L0)return hd;L0=1;var e=rx();hd=t;function t(n,i){return e(n,i,"post")}return hd}var pd,R0;function VP(){if(R0)return pd;R0=1;var e=rx();pd=t;function t(n,i){return e(n,i,"pre")}return pd}var md,D0;function WP(){if(D0)return md;D0=1;var e=Zh(),t=Z1();md=n;function n(i,s){var l=new e,a={},c=new t,f;function d(h){var g=h.v===f?h.w:h.v,v=c.priority(g);if(v!==void 0){var S=s(h);S<v&&(a[g]=f,c.decrease(g,S))}}if(i.nodeCount()===0)return l;i.nodes().forEach(function(h){c.add(h,Number.POSITIVE_INFINITY),l.setNode(h)}),c.decrease(i.nodes()[0],0);for(var m=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(a,f))l.setEdge(f,a[f]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(f).forEach(d)}return l}return md}var gd,j0;function UP(){return j0||(j0=1,gd={components:DP(),dijkstra:ex(),dijkstraAll:jP(),findCycles:$P(),floydWarshall:zP(),isAcyclic:FP(),postorder:BP(),preorder:VP(),prim:WP(),tarjan:tx(),topsort:nx()}),gd}var yd,$0;function yn(){if($0)return yd;$0=1;var e=LP();return yd={Graph:e.Graph,json:RP(),alg:UP(),version:e.version},yd}var vd,z0;function HP(){if(z0)return vd;z0=1;class e{constructor(){let s={};s._next=s._prev=s,this._sentinel=s}dequeue(){let s=this._sentinel,l=s._prev;if(l!==s)return t(l),l}enqueue(s){let l=this._sentinel;s._prev&&s._next&&t(s),s._next=l._next,l._next._prev=s,l._next=s,s._prev=l}toString(){let s=[],l=this._sentinel,a=l._prev;for(;a!==l;)s.push(JSON.stringify(a,n)),a=a._prev;return"["+s.join(", ")+"]"}}function t(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function n(i,s){if(i!=="_next"&&i!=="_prev")return s}return vd=e,vd}var wd,F0;function qP(){if(F0)return wd;F0=1;let e=yn().Graph,t=HP();wd=i;let n=()=>1;function i(d,m){if(d.nodeCount()<=1)return[];let h=a(d,m||n);return s(h.graph,h.buckets,h.zeroIdx).flatMap(v=>d.outEdges(v.v,v.w))}function s(d,m,h){let g=[],v=m[m.length-1],S=m[0],w;for(;d.nodeCount();){for(;w=S.dequeue();)l(d,m,h,w);for(;w=v.dequeue();)l(d,m,h,w);if(d.nodeCount()){for(let b=m.length-2;b>0;--b)if(w=m[b].dequeue(),w){g=g.concat(l(d,m,h,w,!0));break}}}return g}function l(d,m,h,g,v){let S=v?[]:void 0;return d.inEdges(g.v).forEach(w=>{let b=d.edge(w),k=d.node(w.v);v&&S.push({v:w.v,w:w.w}),k.out-=b,c(m,h,k)}),d.outEdges(g.v).forEach(w=>{let b=d.edge(w),k=w.w,N=d.node(k);N.in-=b,c(m,h,N)}),d.removeNode(g.v),S}function a(d,m){let h=new e,g=0,v=0;d.nodes().forEach(b=>{h.setNode(b,{v:b,in:0,out:0})}),d.edges().forEach(b=>{let k=h.edge(b.v,b.w)||0,N=m(b),E=k+N;h.setEdge(b.v,b.w,E),v=Math.max(v,h.node(b.v).out+=N),g=Math.max(g,h.node(b.w).in+=N)});let S=f(v+g+3).map(()=>new t),w=g+1;return h.nodes().forEach(b=>{c(S,w,h.node(b))}),{graph:h,buckets:S,zeroIdx:w}}function c(d,m,h){h.out?h.in?d[h.out-h.in+m].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}function f(d){const m=[];for(let h=0;h<d;h++)m.push(h);return m}return wd}var xd,B0;function tt(){if(B0)return xd;B0=1;let e=yn().Graph;xd={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:a,mapValues:M,maxRank:S,normalizeRanks:f,notime:k,partition:w,pick:A,predecessorWeights:l,range:_,removeEmptyRanks:d,simplify:n,successorWeights:s,time:b,uniqueId:E,zipObject:L};function t(C,I,F,R){for(var $=R;C.hasNode($);)$=E(R);return F.dummy=I,C.setNode($,F),$}function n(C){let I=new e().setGraph(C.graph());return C.nodes().forEach(F=>I.setNode(F,C.node(F))),C.edges().forEach(F=>{let R=I.edge(F.v,F.w)||{weight:0,minlen:1},$=C.edge(F);I.setEdge(F.v,F.w,{weight:R.weight+$.weight,minlen:Math.max(R.minlen,$.minlen)})}),I}function i(C){let I=new e({multigraph:C.isMultigraph()}).setGraph(C.graph());return C.nodes().forEach(F=>{C.children(F).length||I.setNode(F,C.node(F))}),C.edges().forEach(F=>{I.setEdge(F,C.edge(F))}),I}function s(C){let I=C.nodes().map(F=>{let R={};return C.outEdges(F).forEach($=>{R[$.w]=(R[$.w]||0)+C.edge($).weight}),R});return L(C.nodes(),I)}function l(C){let I=C.nodes().map(F=>{let R={};return C.inEdges(F).forEach($=>{R[$.v]=(R[$.v]||0)+C.edge($).weight}),R});return L(C.nodes(),I)}function a(C,I){let F=C.x,R=C.y,$=I.x-F,Z=I.y-R,j=C.width/2,G=C.height/2;if(!$&&!Z)throw new Error("Not possible to find intersection inside of the rectangle");let q,J;return Math.abs(Z)*j>Math.abs($)*G?(Z<0&&(G=-G),q=G*$/Z,J=G):($<0&&(j=-j),q=j,J=j*Z/$),{x:F+q,y:R+J}}function c(C){let I=_(S(C)+1).map(()=>[]);return C.nodes().forEach(F=>{let R=C.node(F),$=R.rank;$!==void 0&&(I[$][R.order]=F)}),I}function f(C){let I=C.nodes().map(R=>{let $=C.node(R).rank;return $===void 0?Number.MAX_VALUE:$}),F=v(Math.min,I);C.nodes().forEach(R=>{let $=C.node(R);Object.hasOwn($,"rank")&&($.rank-=F)})}function d(C){let I=C.nodes().map(j=>C.node(j).rank),F=v(Math.min,I),R=[];C.nodes().forEach(j=>{let G=C.node(j).rank-F;R[G]||(R[G]=[]),R[G].push(j)});let $=0,Z=C.graph().nodeRankFactor;Array.from(R).forEach((j,G)=>{j===void 0&&G%Z!==0?--$:j!==void 0&&$&&j.forEach(q=>C.node(q).rank+=$)})}function m(C,I,F,R){let $={width:0,height:0};return arguments.length>=4&&($.rank=F,$.order=R),t(C,"border",$,I)}function h(C,I=g){const F=[];for(let R=0;R<C.length;R+=I){const $=C.slice(R,R+I);F.push($)}return F}const g=65535;function v(C,I){if(I.length>g){const F=h(I);return C.apply(null,F.map(R=>C.apply(null,R)))}else return C.apply(null,I)}function S(C){const F=C.nodes().map(R=>{let $=C.node(R).rank;return $===void 0?Number.MIN_VALUE:$});return v(Math.max,F)}function w(C,I){let F={lhs:[],rhs:[]};return C.forEach(R=>{I(R)?F.lhs.push(R):F.rhs.push(R)}),F}function b(C,I){let F=Date.now();try{return I()}finally{console.log(C+" time: "+(Date.now()-F)+"ms")}}function k(C,I){return I()}let N=0;function E(C){var I=++N;return C+(""+I)}function _(C,I,F=1){I==null&&(I=C,C=0);let R=Z=>Z<I;F<0&&(R=Z=>I<Z);const $=[];for(let Z=C;R(Z);Z+=F)$.push(Z);return $}function A(C,I){const F={};for(const R of I)C[R]!==void 0&&(F[R]=C[R]);return F}function M(C,I){let F=I;return typeof I=="string"&&(F=R=>R[I]),Object.entries(C).reduce((R,[$,Z])=>(R[$]=F(Z,$),R),{})}function L(C,I){return C.reduce((F,R,$)=>(F[R]=I[$],F),{})}return xd}var bd,V0;function YP(){if(V0)return bd;V0=1;let e=qP(),t=tt().uniqueId;bd={run:n,undo:s};function n(l){(l.graph().acyclicer==="greedy"?e(l,c(l)):i(l)).forEach(f=>{let d=l.edge(f);l.removeEdge(f),d.forwardName=f.name,d.reversed=!0,l.setEdge(f.w,f.v,d,t("rev"))});function c(f){return d=>f.edge(d).weight}}function i(l){let a=[],c={},f={};function d(m){Object.hasOwn(f,m)||(f[m]=!0,c[m]=!0,l.outEdges(m).forEach(h=>{Object.hasOwn(c,h.w)?a.push(h):d(h.w)}),delete c[m])}return l.nodes().forEach(d),a}function s(l){l.edges().forEach(a=>{let c=l.edge(a);if(c.reversed){l.removeEdge(a);let f=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(a.w,a.v,c,f)}})}return bd}var Sd,W0;function KP(){if(W0)return Sd;W0=1;let e=tt();Sd={run:t,undo:i};function t(s){s.graph().dummyChains=[],s.edges().forEach(l=>n(s,l))}function n(s,l){let a=l.v,c=s.node(a).rank,f=l.w,d=s.node(f).rank,m=l.name,h=s.edge(l),g=h.labelRank;if(d===c+1)return;s.removeEdge(l);let v,S,w;for(w=0,++c;c<d;++w,++c)h.points=[],S={width:0,height:0,edgeLabel:h,edgeObj:l,rank:c},v=e.addDummyNode(s,"edge",S,"_d"),c===g&&(S.width=h.width,S.height=h.height,S.dummy="edge-label",S.labelpos=h.labelpos),s.setEdge(a,v,{weight:h.weight},m),w===0&&s.graph().dummyChains.push(v),a=v;s.setEdge(a,f,{weight:h.weight},m)}function i(s){s.graph().dummyChains.forEach(l=>{let a=s.node(l),c=a.edgeLabel,f;for(s.setEdge(a.edgeObj,c);a.dummy;)f=s.successors(l)[0],s.removeNode(l),c.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(c.x=a.x,c.y=a.y,c.width=a.width,c.height=a.height),l=f,a=s.node(l)})}return Sd}var kd,U0;function ou(){if(U0)return kd;U0=1;const{applyWithChunking:e}=tt();kd={longestPath:t,slack:n};function t(i){var s={};function l(a){var c=i.node(a);if(Object.hasOwn(s,a))return c.rank;s[a]=!0;let f=i.outEdges(a).map(m=>m==null?Number.POSITIVE_INFINITY:l(m.w)-i.edge(m).minlen);var d=e(Math.min,f);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}i.sources().forEach(l)}function n(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}return kd}var Ed,H0;function ix(){if(H0)return Ed;H0=1;var e=yn().Graph,t=ou().slack;Ed=n;function n(a){var c=new e({directed:!1}),f=a.nodes()[0],d=a.nodeCount();c.setNode(f,{});for(var m,h;i(c,a)<d;)m=s(c,a),h=c.hasNode(m.v)?t(a,m):-t(a,m),l(c,a,h);return c}function i(a,c){function f(d){c.nodeEdges(d).forEach(m=>{var h=m.v,g=d===h?m.w:h;!a.hasNode(g)&&!t(c,m)&&(a.setNode(g,{}),a.setEdge(d,g,{}),f(g))})}return a.nodes().forEach(f),a.nodeCount()}function s(a,c){return c.edges().reduce((d,m)=>{let h=Number.POSITIVE_INFINITY;return a.hasNode(m.v)!==a.hasNode(m.w)&&(h=t(c,m)),h<d[0]?[h,m]:d},[Number.POSITIVE_INFINITY,null])[1]}function l(a,c,f){a.nodes().forEach(d=>c.node(d).rank+=f)}return Ed}var Nd,q0;function GP(){if(q0)return Nd;q0=1;var e=ix(),t=ou().slack,n=ou().longestPath,i=yn().alg.preorder,s=yn().alg.postorder,l=tt().simplify;Nd=a,a.initLowLimValues=m,a.initCutValues=c,a.calcCutValue=d,a.leaveEdge=g,a.enterEdge=v,a.exchangeEdges=S;function a(N){N=l(N),n(N);var E=e(N);m(E),c(E,N);for(var _,A;_=g(E);)A=v(E,N,_),S(E,N,_,A)}function c(N,E){var _=s(N,N.nodes());_=_.slice(0,_.length-1),_.forEach(A=>f(N,E,A))}function f(N,E,_){var A=N.node(_),M=A.parent;N.edge(_,M).cutvalue=d(N,E,_)}function d(N,E,_){var A=N.node(_),M=A.parent,L=!0,C=E.edge(_,M),I=0;return C||(L=!1,C=E.edge(M,_)),I=C.weight,E.nodeEdges(_).forEach(F=>{var R=F.v===_,$=R?F.w:F.v;if($!==M){var Z=R===L,j=E.edge(F).weight;if(I+=Z?j:-j,b(N,_,$)){var G=N.edge(_,$).cutvalue;I+=Z?-G:G}}}),I}function m(N,E){arguments.length<2&&(E=N.nodes()[0]),h(N,{},1,E)}function h(N,E,_,A,M){var L=_,C=N.node(A);return E[A]=!0,N.neighbors(A).forEach(I=>{Object.hasOwn(E,I)||(_=h(N,E,_,I,A))}),C.low=L,C.lim=_++,M?C.parent=M:delete C.parent,_}function g(N){return N.edges().find(E=>N.edge(E).cutvalue<0)}function v(N,E,_){var A=_.v,M=_.w;E.hasEdge(A,M)||(A=_.w,M=_.v);var L=N.node(A),C=N.node(M),I=L,F=!1;L.lim>C.lim&&(I=C,F=!0);var R=E.edges().filter($=>F===k(N,N.node($.v),I)&&F!==k(N,N.node($.w),I));return R.reduce(($,Z)=>t(E,Z)<t(E,$)?Z:$)}function S(N,E,_,A){var M=_.v,L=_.w;N.removeEdge(M,L),N.setEdge(A.v,A.w,{}),m(N),c(N,E),w(N,E)}function w(N,E){var _=N.nodes().find(M=>!E.node(M).parent),A=i(N,_);A=A.slice(1),A.forEach(M=>{var L=N.node(M).parent,C=E.edge(M,L),I=!1;C||(C=E.edge(L,M),I=!0),E.node(M).rank=E.node(L).rank+(I?C.minlen:-C.minlen)})}function b(N,E,_){return N.hasEdge(E,_)}function k(N,E,_){return _.low<=E.lim&&E.lim<=_.lim}return Nd}var _d,Y0;function XP(){if(Y0)return _d;Y0=1;var e=ou(),t=e.longestPath,n=ix(),i=GP();_d=s;function s(f){var d=f.graph().ranker;if(d instanceof Function)return d(f);switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":a(f);break;case"longest-path":l(f);break;case"none":break;default:c(f)}}var l=t;function a(f){t(f),n(f)}function c(f){i(f)}return _d}var Cd,K0;function QP(){if(K0)return Cd;K0=1,Cd=e;function e(i){let s=n(i);i.graph().dummyChains.forEach(l=>{let a=i.node(l),c=a.edgeObj,f=t(i,s,c.v,c.w),d=f.path,m=f.lca,h=0,g=d[h],v=!0;for(;l!==c.w;){if(a=i.node(l),v){for(;(g=d[h])!==m&&i.node(g).maxRank<a.rank;)h++;g===m&&(v=!1)}if(!v){for(;h<d.length-1&&i.node(g=d[h+1]).minRank<=a.rank;)h++;g=d[h]}i.setParent(l,g),l=i.successors(l)[0]}})}function t(i,s,l,a){let c=[],f=[],d=Math.min(s[l].low,s[a].low),m=Math.max(s[l].lim,s[a].lim),h,g;h=l;do h=i.parent(h),c.push(h);while(h&&(s[h].low>d||m>s[h].lim));for(g=h,h=a;(h=i.parent(h))!==g;)f.push(h);return{path:c.concat(f.reverse()),lca:g}}function n(i){let s={},l=0;function a(c){let f=l;i.children(c).forEach(a),s[c]={low:f,lim:l++}}return i.children().forEach(a),s}return Cd}var Td,G0;function JP(){if(G0)return Td;G0=1;let e=tt();Td={run:t,cleanup:l};function t(a){let c=e.addDummyNode(a,"root",{},"_root"),f=i(a),d=Object.values(f),m=e.applyWithChunking(Math.max,d)-1,h=2*m+1;a.graph().nestingRoot=c,a.edges().forEach(v=>a.edge(v).minlen*=h);let g=s(a)+1;a.children().forEach(v=>n(a,c,h,g,m,f,v)),a.graph().nodeRankFactor=h}function n(a,c,f,d,m,h,g){let v=a.children(g);if(!v.length){g!==c&&a.setEdge(c,g,{weight:0,minlen:f});return}let S=e.addBorderNode(a,"_bt"),w=e.addBorderNode(a,"_bb"),b=a.node(g);a.setParent(S,g),b.borderTop=S,a.setParent(w,g),b.borderBottom=w,v.forEach(k=>{n(a,c,f,d,m,h,k);let N=a.node(k),E=N.borderTop?N.borderTop:k,_=N.borderBottom?N.borderBottom:k,A=N.borderTop?d:2*d,M=E!==_?1:m-h[g]+1;a.setEdge(S,E,{weight:A,minlen:M,nestingEdge:!0}),a.setEdge(_,w,{weight:A,minlen:M,nestingEdge:!0})}),a.parent(g)||a.setEdge(c,S,{weight:0,minlen:m+h[g]})}function i(a){var c={};function f(d,m){var h=a.children(d);h&&h.length&&h.forEach(g=>f(g,m+1)),c[d]=m}return a.children().forEach(d=>f(d,1)),c}function s(a){return a.edges().reduce((c,f)=>c+a.edge(f).weight,0)}function l(a){var c=a.graph();a.removeNode(c.nestingRoot),delete c.nestingRoot,a.edges().forEach(f=>{var d=a.edge(f);d.nestingEdge&&a.removeEdge(f)})}return Td}var Od,X0;function ZP(){if(X0)return Od;X0=1;let e=tt();Od=t;function t(i){function s(l){let a=i.children(l),c=i.node(l);if(a.length&&a.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,d=c.maxRank+1;f<d;++f)n(i,"borderLeft","_bl",l,c,f),n(i,"borderRight","_br",l,c,f)}}i.children().forEach(s)}function n(i,s,l,a,c,f){let d={width:0,height:0,rank:f,borderType:s},m=c[s][f-1],h=e.addDummyNode(i,"border",d,l);c[s][f]=h,i.setParent(h,a),m&&i.setEdge(m,h,{weight:1})}return Od}var Pd,Q0;function eI(){if(Q0)return Pd;Q0=1,Pd={adjust:e,undo:t};function e(f){let d=f.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(f)}function t(f){let d=f.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(f),(d==="lr"||d==="rl")&&(a(f),n(f))}function n(f){f.nodes().forEach(d=>i(f.node(d))),f.edges().forEach(d=>i(f.edge(d)))}function i(f){let d=f.width;f.width=f.height,f.height=d}function s(f){f.nodes().forEach(d=>l(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(l),Object.hasOwn(m,"y")&&l(m)})}function l(f){f.y=-f.y}function a(f){f.nodes().forEach(d=>c(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(f){let d=f.x;f.x=f.y,f.y=d}return Pd}var Id,J0;function tI(){if(J0)return Id;J0=1;let e=tt();Id=t;function t(n){let i={},s=n.nodes().filter(m=>!n.children(m).length),l=s.map(m=>n.node(m).rank),a=e.applyWithChunking(Math.max,l),c=e.range(a+1).map(()=>[]);function f(m){if(i[m])return;i[m]=!0;let h=n.node(m);c[h.rank].push(m),n.successors(m).forEach(f)}return s.sort((m,h)=>n.node(m).rank-n.node(h).rank).forEach(f),c}return Id}var Ad,Z0;function nI(){if(Z0)return Ad;Z0=1;let e=tt().zipObject;Ad=t;function t(i,s){let l=0;for(let a=1;a<s.length;++a)l+=n(i,s[a-1],s[a]);return l}function n(i,s,l){let a=e(l,l.map((g,v)=>v)),c=s.flatMap(g=>i.outEdges(g).map(v=>({pos:a[v.w],weight:i.edge(v).weight})).sort((v,S)=>v.pos-S.pos)),f=1;for(;f<l.length;)f<<=1;let d=2*f-1;f-=1;let m=new Array(d).fill(0),h=0;return c.forEach(g=>{let v=g.pos+f;m[v]+=g.weight;let S=0;for(;v>0;)v%2&&(S+=m[v+1]),v=v-1>>1,m[v]+=g.weight;h+=g.weight*S}),h}return Ad}var Md,ev;function rI(){if(ev)return Md;ev=1,Md=e;function e(t,n=[]){return n.map(i=>{let s=t.inEdges(i);if(s.length){let l=s.reduce((a,c)=>{let f=t.edge(c),d=t.node(c.v);return{sum:a.sum+f.weight*d.order,weight:a.weight+f.weight}},{sum:0,weight:0});return{v:i,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:i}})}return Md}var Ld,tv;function iI(){if(tv)return Ld;tv=1;let e=tt();Ld=t;function t(s,l){let a={};s.forEach((f,d)=>{let m=a[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:d};f.barycenter!==void 0&&(m.barycenter=f.barycenter,m.weight=f.weight)}),l.edges().forEach(f=>{let d=a[f.v],m=a[f.w];d!==void 0&&m!==void 0&&(m.indegree++,d.out.push(a[f.w]))});let c=Object.values(a).filter(f=>!f.indegree);return n(c)}function n(s){let l=[];function a(f){return d=>{d.merged||(d.barycenter===void 0||f.barycenter===void 0||d.barycenter>=f.barycenter)&&i(f,d)}}function c(f){return d=>{d.in.push(f),--d.indegree===0&&s.push(d)}}for(;s.length;){let f=s.pop();l.push(f),f.in.reverse().forEach(a(f)),f.out.forEach(c(f))}return l.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function i(s,l){let a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),l.weight&&(a+=l.barycenter*l.weight,c+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(l.i,s.i),l.merged=!0}return Ld}var Rd,nv;function oI(){if(nv)return Rd;nv=1;let e=tt();Rd=t;function t(s,l){let a=e.partition(s,S=>Object.hasOwn(S,"barycenter")),c=a.lhs,f=a.rhs.sort((S,w)=>w.i-S.i),d=[],m=0,h=0,g=0;c.sort(i(!!l)),g=n(d,f,g),c.forEach(S=>{g+=S.vs.length,d.push(S.vs),m+=S.barycenter*S.weight,h+=S.weight,g=n(d,f,g)});let v={vs:d.flat(!0)};return h&&(v.barycenter=m/h,v.weight=h),v}function n(s,l,a){let c;for(;l.length&&(c=l[l.length-1]).i<=a;)l.pop(),s.push(c.vs),a++;return a}function i(s){return(l,a)=>l.barycenter<a.barycenter?-1:l.barycenter>a.barycenter?1:s?a.i-l.i:l.i-a.i}return Rd}var Dd,rv;function sI(){if(rv)return Dd;rv=1;let e=rI(),t=iI(),n=oI();Dd=i;function i(a,c,f,d){let m=a.children(c),h=a.node(c),g=h?h.borderLeft:void 0,v=h?h.borderRight:void 0,S={};g&&(m=m.filter(N=>N!==g&&N!==v));let w=e(a,m);w.forEach(N=>{if(a.children(N.v).length){let E=i(a,N.v,f,d);S[N.v]=E,Object.hasOwn(E,"barycenter")&&l(N,E)}});let b=t(w,f);s(b,S);let k=n(b,d);if(g&&(k.vs=[g,k.vs,v].flat(!0),a.predecessors(g).length)){let N=a.node(a.predecessors(g)[0]),E=a.node(a.predecessors(v)[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+N.order+E.order)/(k.weight+2),k.weight+=2}return k}function s(a,c){a.forEach(f=>{f.vs=f.vs.flatMap(d=>c[d]?c[d].vs:d)})}function l(a,c){a.barycenter!==void 0?(a.barycenter=(a.barycenter*a.weight+c.barycenter*c.weight)/(a.weight+c.weight),a.weight+=c.weight):(a.barycenter=c.barycenter,a.weight=c.weight)}return Dd}var jd,iv;function lI(){if(iv)return jd;iv=1;let e=yn().Graph,t=tt();jd=n;function n(s,l,a,c){c||(c=s.nodes());let f=i(s),d=new e({compound:!0}).setGraph({root:f}).setDefaultNodeLabel(m=>s.node(m));return c.forEach(m=>{let h=s.node(m),g=s.parent(m);(h.rank===l||h.minRank<=l&&l<=h.maxRank)&&(d.setNode(m),d.setParent(m,g||f),s[a](m).forEach(v=>{let S=v.v===m?v.w:v.v,w=d.edge(S,m),b=w!==void 0?w.weight:0;d.setEdge(S,m,{weight:s.edge(v).weight+b})}),Object.hasOwn(h,"minRank")&&d.setNode(m,{borderLeft:h.borderLeft[l],borderRight:h.borderRight[l]}))}),d}function i(s){for(var l;s.hasNode(l=t.uniqueId("_root")););return l}return jd}var $d,ov;function aI(){if(ov)return $d;ov=1,$d=e;function e(t,n,i){let s={},l;i.forEach(a=>{let c=t.parent(a),f,d;for(;c;){if(f=t.parent(c),f?(d=s[f],s[f]=c):(d=l,l=c),d&&d!==c){n.setEdge(d,c);return}c=f}})}return $d}var zd,sv;function uI(){if(sv)return zd;sv=1;let e=tI(),t=nI(),n=sI(),i=lI(),s=aI(),l=yn().Graph,a=tt();zd=c;function c(h,g){if(g&&typeof g.customOrder=="function"){g.customOrder(h,c);return}let v=a.maxRank(h),S=f(h,a.range(1,v+1),"inEdges"),w=f(h,a.range(v-1,-1,-1),"outEdges"),b=e(h);if(m(h,b),g&&g.disableOptimalOrderHeuristic)return;let k=Number.POSITIVE_INFINITY,N;for(let E=0,_=0;_<4;++E,++_){d(E%2?S:w,E%4>=2),b=a.buildLayerMatrix(h);let A=t(h,b);A<k&&(_=0,N=Object.assign({},b),k=A)}m(h,N)}function f(h,g,v){const S=new Map,w=(b,k)=>{S.has(b)||S.set(b,[]),S.get(b).push(k)};for(const b of h.nodes()){const k=h.node(b);if(typeof k.rank=="number"&&w(k.rank,b),typeof k.minRank=="number"&&typeof k.maxRank=="number")for(let N=k.minRank;N<=k.maxRank;N++)N!==k.rank&&w(N,b)}return g.map(function(b){return i(h,b,v,S.get(b)||[])})}function d(h,g){let v=new l;h.forEach(function(S){let w=S.graph().root,b=n(S,w,v,g);b.vs.forEach((k,N)=>S.node(k).order=N),s(S,v,b.vs)})}function m(h,g){Object.values(g).forEach(v=>v.forEach((S,w)=>h.node(S).order=w))}return zd}var Fd,lv;function cI(){if(lv)return Fd;lv=1;let e=yn().Graph,t=tt();Fd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:l,hasConflict:a,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:h,findSmallestWidthAlignment:m,balance:g};function n(b,k){let N={};function E(_,A){let M=0,L=0,C=_.length,I=A[A.length-1];return A.forEach((F,R)=>{let $=s(b,F),Z=$?b.node($).order:C;($||F===I)&&(A.slice(L,R+1).forEach(j=>{b.predecessors(j).forEach(G=>{let q=b.node(G),J=q.order;(J<M||Z<J)&&!(q.dummy&&b.node(j).dummy)&&l(N,G,j)})}),L=R+1,M=Z)}),A}return k.length&&k.reduce(E),N}function i(b,k){let N={};function E(A,M,L,C,I){let F;t.range(M,L).forEach(R=>{F=A[R],b.node(F).dummy&&b.predecessors(F).forEach($=>{let Z=b.node($);Z.dummy&&(Z.order<C||Z.order>I)&&l(N,$,F)})})}function _(A,M){let L=-1,C,I=0;return M.forEach((F,R)=>{if(b.node(F).dummy==="border"){let $=b.predecessors(F);$.length&&(C=b.node($[0]).order,E(M,I,R,L,C),I=R,L=C)}E(M,I,M.length,C,A.length)}),M}return k.length&&k.reduce(_),N}function s(b,k){if(b.node(k).dummy)return b.predecessors(k).find(N=>b.node(N).dummy)}function l(b,k,N){if(k>N){let _=k;k=N,N=_}let E=b[k];E||(b[k]=E={}),E[N]=!0}function a(b,k,N){if(k>N){let E=k;k=N,N=E}return!!b[k]&&Object.hasOwn(b[k],N)}function c(b,k,N,E){let _={},A={},M={};return k.forEach(L=>{L.forEach((C,I)=>{_[C]=C,A[C]=C,M[C]=I})}),k.forEach(L=>{let C=-1;L.forEach(I=>{let F=E(I);if(F.length){F=F.sort(($,Z)=>M[$]-M[Z]);let R=(F.length-1)/2;for(let $=Math.floor(R),Z=Math.ceil(R);$<=Z;++$){let j=F[$];A[I]===I&&C<M[j]&&!a(N,I,j)&&(A[j]=I,A[I]=_[I]=_[j],C=M[j])}}})}),{root:_,align:A}}function f(b,k,N,E,_){let A={},M=d(b,k,N,_),L=_?"borderLeft":"borderRight";function C(R,$){let Z=M.nodes(),j=Z.pop(),G={};for(;j;)G[j]?R(j):(G[j]=!0,Z.push(j),Z=Z.concat($(j))),j=Z.pop()}function I(R){A[R]=M.inEdges(R).reduce(($,Z)=>Math.max($,A[Z.v]+M.edge(Z)),0)}function F(R){let $=M.outEdges(R).reduce((j,G)=>Math.min(j,A[G.w]-M.edge(G)),Number.POSITIVE_INFINITY),Z=b.node(R);$!==Number.POSITIVE_INFINITY&&Z.borderType!==L&&(A[R]=Math.max(A[R],$))}return C(I,M.predecessors.bind(M)),C(F,M.successors.bind(M)),Object.keys(E).forEach(R=>A[R]=A[N[R]]),A}function d(b,k,N,E){let _=new e,A=b.graph(),M=S(A.nodesep,A.edgesep,E);return k.forEach(L=>{let C;L.forEach(I=>{let F=N[I];if(_.setNode(F),C){var R=N[C],$=_.edge(R,F);_.setEdge(R,F,Math.max(M(b,I,C),$||0))}C=I})}),_}function m(b,k){return Object.values(k).reduce((N,E)=>{let _=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([L,C])=>{let I=w(b,L)/2;_=Math.max(C+I,_),A=Math.min(C-I,A)});const M=_-A;return M<N[0]&&(N=[M,E]),N},[Number.POSITIVE_INFINITY,null])[1]}function h(b,k){let N=Object.values(k),E=t.applyWithChunking(Math.min,N),_=t.applyWithChunking(Math.max,N);["u","d"].forEach(A=>{["l","r"].forEach(M=>{let L=A+M,C=b[L];if(C===k)return;let I=Object.values(C),F=E-t.applyWithChunking(Math.min,I);M!=="l"&&(F=_-t.applyWithChunking(Math.max,I)),F&&(b[L]=t.mapValues(C,R=>R+F))})})}function g(b,k){return t.mapValues(b.ul,(N,E)=>{if(k)return b[k.toLowerCase()][E];{let _=Object.values(b).map(A=>A[E]).sort((A,M)=>A-M);return(_[1]+_[2])/2}})}function v(b){let k=t.buildLayerMatrix(b),N=Object.assign(n(b,k),i(b,k)),E={},_;["u","d"].forEach(M=>{_=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(L=>{L==="r"&&(_=_.map(R=>Object.values(R).reverse()));let C=(M==="u"?b.predecessors:b.successors).bind(b),I=c(b,_,N,C),F=f(b,_,I.root,I.align,L==="r");L==="r"&&(F=t.mapValues(F,R=>-R)),E[M+L]=F})});let A=m(b,E);return h(E,A),g(E,b.graph().align)}function S(b,k,N){return(E,_,A)=>{let M=E.node(_),L=E.node(A),C=0,I;if(C+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":I=-M.width/2;break;case"r":I=M.width/2;break}if(I&&(C+=N?I:-I),I=0,C+=(M.dummy?k:b)/2,C+=(L.dummy?k:b)/2,C+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":I=L.width/2;break;case"r":I=-L.width/2;break}return I&&(C+=N?I:-I),I=0,C}}function w(b,k){return b.node(k).width}return Fd}var Bd,av;function fI(){if(av)return Bd;av=1;let e=tt(),t=cI().positionX;Bd=n;function n(s){s=e.asNonCompoundGraph(s),i(s),Object.entries(t(s)).forEach(([l,a])=>s.node(l).x=a)}function i(s){let l=e.buildLayerMatrix(s),a=s.graph().ranksep,c=0;l.forEach(f=>{const d=f.reduce((m,h)=>{const g=s.node(h).height;return m>g?m:g},0);f.forEach(m=>s.node(m).y=c+d/2),c+=d+a})}return Bd}var Vd,uv;function dI(){if(uv)return Vd;uv=1;let e=YP(),t=KP(),n=XP(),i=tt().normalizeRanks,s=QP(),l=tt().removeEmptyRanks,a=JP(),c=ZP(),f=eI(),d=uI(),m=fI(),h=tt(),g=yn().Graph;Vd=v;function v(V,K){let Q=K&&K.debugTiming?h.time:h.notime;Q("layout",()=>{let re=Q(" buildLayoutGraph",()=>C(V));Q(" runLayout",()=>S(re,Q,K)),Q(" updateInputGraph",()=>w(V,re))})}function S(V,K,Q){K(" makeSpaceForEdgeLabels",()=>I(V)),K(" removeSelfEdges",()=>Y(V)),K(" acyclic",()=>e.run(V)),K(" nestingGraph.run",()=>a.run(V)),K(" rank",()=>n(h.asNonCompoundGraph(V))),K(" injectEdgeLabelProxies",()=>F(V)),K(" removeEmptyRanks",()=>l(V)),K(" nestingGraph.cleanup",()=>a.cleanup(V)),K(" normalizeRanks",()=>i(V)),K(" assignRankMinMax",()=>R(V)),K(" removeEdgeLabelProxies",()=>$(V)),K(" normalize.run",()=>t.run(V)),K(" parentDummyChains",()=>s(V)),K(" addBorderSegments",()=>c(V)),K(" order",()=>d(V,Q)),K(" insertSelfEdges",()=>U(V)),K(" adjustCoordinateSystem",()=>f.adjust(V)),K(" position",()=>m(V)),K(" positionSelfEdges",()=>B(V)),K(" removeBorderNodes",()=>J(V)),K(" normalize.undo",()=>t.undo(V)),K(" fixupEdgeLabelCoords",()=>G(V)),K(" undoCoordinateSystem",()=>f.undo(V)),K(" translateGraph",()=>Z(V)),K(" assignNodeIntersects",()=>j(V)),K(" reversePoints",()=>q(V)),K(" acyclic.undo",()=>e.undo(V))}function w(V,K){V.nodes().forEach(Q=>{let re=V.node(Q),se=K.node(Q);re&&(re.x=se.x,re.y=se.y,re.rank=se.rank,K.children(Q).length&&(re.width=se.width,re.height=se.height))}),V.edges().forEach(Q=>{let re=V.edge(Q),se=K.edge(Q);re.points=se.points,Object.hasOwn(se,"x")&&(re.x=se.x,re.y=se.y)}),V.graph().width=K.graph().width,V.graph().height=K.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],E=["width","height","rank"],_={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function C(V){let K=new g({multigraph:!0,compound:!0}),Q=W(V.graph());return K.setGraph(Object.assign({},k,D(Q,b),h.pick(Q,N))),V.nodes().forEach(re=>{let se=W(V.node(re));const ee=D(se,E);Object.keys(_).forEach(oe=>{ee[oe]===void 0&&(ee[oe]=_[oe])}),K.setNode(re,ee),K.setParent(re,V.parent(re))}),V.edges().forEach(re=>{let se=W(V.edge(re));K.setEdge(re,Object.assign({},M,D(se,A),h.pick(se,L)))}),K}function I(V){let K=V.graph();K.ranksep/=2,V.edges().forEach(Q=>{let re=V.edge(Q);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function F(V){V.edges().forEach(K=>{let Q=V.edge(K);if(Q.width&&Q.height){let re=V.node(K.v),ee={rank:(V.node(K.w).rank-re.rank)/2+re.rank,e:K};h.addDummyNode(V,"edge-proxy",ee,"_ep")}})}function R(V){let K=0;V.nodes().forEach(Q=>{let re=V.node(Q);re.borderTop&&(re.minRank=V.node(re.borderTop).rank,re.maxRank=V.node(re.borderBottom).rank,K=Math.max(K,re.maxRank))}),V.graph().maxRank=K}function $(V){V.nodes().forEach(K=>{let Q=V.node(K);Q.dummy==="edge-proxy"&&(V.edge(Q.e).labelRank=Q.rank,V.removeNode(K))})}function Z(V){let K=Number.POSITIVE_INFINITY,Q=0,re=Number.POSITIVE_INFINITY,se=0,ee=V.graph(),oe=ee.marginx||0,de=ee.marginy||0;function xe(he){let fe=he.x,ke=he.y,Ie=he.width,Ae=he.height;K=Math.min(K,fe-Ie/2),Q=Math.max(Q,fe+Ie/2),re=Math.min(re,ke-Ae/2),se=Math.max(se,ke+Ae/2)}V.nodes().forEach(he=>xe(V.node(he))),V.edges().forEach(he=>{let fe=V.edge(he);Object.hasOwn(fe,"x")&&xe(fe)}),K-=oe,re-=de,V.nodes().forEach(he=>{let fe=V.node(he);fe.x-=K,fe.y-=re}),V.edges().forEach(he=>{let fe=V.edge(he);fe.points.forEach(ke=>{ke.x-=K,ke.y-=re}),Object.hasOwn(fe,"x")&&(fe.x-=K),Object.hasOwn(fe,"y")&&(fe.y-=re)}),ee.width=Q-K+oe,ee.height=se-re+de}function j(V){V.edges().forEach(K=>{let Q=V.edge(K),re=V.node(K.v),se=V.node(K.w),ee,oe;Q.points?(ee=Q.points[0],oe=Q.points[Q.points.length-1]):(Q.points=[],ee=se,oe=re),Q.points.unshift(h.intersectRect(re,ee)),Q.points.push(h.intersectRect(se,oe))})}function G(V){V.edges().forEach(K=>{let Q=V.edge(K);if(Object.hasOwn(Q,"x"))switch((Q.labelpos==="l"||Q.labelpos==="r")&&(Q.width-=Q.labeloffset),Q.labelpos){case"l":Q.x-=Q.width/2+Q.labeloffset;break;case"r":Q.x+=Q.width/2+Q.labeloffset;break}})}function q(V){V.edges().forEach(K=>{let Q=V.edge(K);Q.reversed&&Q.points.reverse()})}function J(V){V.nodes().forEach(K=>{if(V.children(K).length){let Q=V.node(K),re=V.node(Q.borderTop),se=V.node(Q.borderBottom),ee=V.node(Q.borderLeft[Q.borderLeft.length-1]),oe=V.node(Q.borderRight[Q.borderRight.length-1]);Q.width=Math.abs(oe.x-ee.x),Q.height=Math.abs(se.y-re.y),Q.x=ee.x+Q.width/2,Q.y=re.y+Q.height/2}}),V.nodes().forEach(K=>{V.node(K).dummy==="border"&&V.removeNode(K)})}function Y(V){V.edges().forEach(K=>{if(K.v===K.w){var Q=V.node(K.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:K,label:V.edge(K)}),V.removeEdge(K)}})}function U(V){var K=h.buildLayerMatrix(V);K.forEach(Q=>{var re=0;Q.forEach((se,ee)=>{var oe=V.node(se);oe.order=ee+re,(oe.selfEdges||[]).forEach(de=>{h.addDummyNode(V,"selfedge",{width:de.label.width,height:de.label.height,rank:oe.rank,order:ee+ ++re,e:de.e,label:de.label},"_se")}),delete oe.selfEdges})})}function B(V){V.nodes().forEach(K=>{var Q=V.node(K);if(Q.dummy==="selfedge"){var re=V.node(Q.e.v),se=re.x+re.width/2,ee=re.y,oe=Q.x-se,de=re.height/2;V.setEdge(Q.e,Q.label),V.removeNode(K),Q.label.points=[{x:se+2*oe/3,y:ee-de},{x:se+5*oe/6,y:ee-de},{x:se+oe,y:ee},{x:se+5*oe/6,y:ee+de},{x:se+2*oe/3,y:ee+de}],Q.label.x=Q.x,Q.label.y=Q.y}})}function D(V,K){return h.mapValues(h.pick(V,K),Number)}function W(V){var K={};return V&&Object.entries(V).forEach(([Q,re])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),K[Q]=re}),K}return Vd}var Wd,cv;function hI(){if(cv)return Wd;cv=1;let e=tt(),t=yn().Graph;Wd={debugOrdering:n};function n(i){let s=e.buildLayerMatrix(i),l=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(a=>{l.setNode(a,{label:a}),l.setParent(a,"layer"+i.node(a).rank)}),i.edges().forEach(a=>l.setEdge(a.v,a.w,{},a.name)),s.forEach((a,c)=>{let f="layer"+c;l.setNode(f,{rank:"same"}),a.reduce((d,m)=>(l.setEdge(d,m,{style:"invis"}),m))}),l}return Wd}var Ud,fv;function pI(){return fv||(fv=1,Ud="1.1.8"),Ud}var Hd,dv;function mI(){return dv||(dv=1,Hd={graphlib:yn(),layout:dI(),debug:hI(),util:{time:tt().time,notime:tt().notime},version:pI()}),Hd}var gI=mI();const hv=du(gI),pv=220,mv=140,qd=60;function yI(e){return O.useMemo(()=>{if(!e)return{nodes:[],edges:[]};const t=new hv.graphlib.Graph;t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"LR",nodesep:40,ranksep:80});for(const s of e.nodes){const l=s.type==="task.branch"||s.type.startsWith("trigger.")?mv:pv;t.setNode(s.id,{width:l,height:qd})}for(const s of e.edges)t.setEdge(s.from,s.to);hv.layout(t);const n=e.nodes.map(s=>{const l=t.node(s.id),a=s.type==="task.branch"||s.type.startsWith("trigger.")?mv:pv;return{id:s.id,type:s.type==="agent.run"?"agentNode":"workflowNode",position:{x:l.x-a/2,y:l.y-qd/2},data:{node:s},width:a,height:qd}}),i=e.edges.map((s,l)=>({id:`e-${l}`,source:s.from,target:s.to,label:s.when,type:"smoothstep",style:{stroke:"hsl(240 5% 65%)",strokeWidth:1.5},labelStyle:{fontSize:11,fontFamily:"JetBrains Mono, monospace"}}));return{nodes:n,edges:i}},[e])}const vI={workflowNode:w0,agentNode:w0};function wI({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:s,edges:l}=yI(e),[a,c]=O.useState(!1),f=s.map(v=>({...v,data:{...v.data,onNodeClick:t,liveStatus:i[v.id]??"idle"}})),d=O.useCallback((v,S)=>{const w=S.data.node;w&&t(w)},[t]),m=O.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="copy",c(!0)},[]),h=O.useCallback(()=>{c(!1)},[]),g=O.useCallback(v=>{v.preventDefault(),c(!1);const S=v.dataTransfer.files[0];if(!S)return;const w=new FileReader;w.onload=b=>{var N;const k=(N=b.target)==null?void 0:N.result;typeof k=="string"&&n(k)},w.readAsText(S)},[n]);return P.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:m,onDragLeave:h,onDrop:g,children:[P.jsxs(rO,{nodes:f,edges:l,nodeTypes:vI,onNodeClick:d,fitView:!0,attributionPosition:"bottom-right",children:[P.jsx(aO,{variant:Qn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),P.jsx(mO,{})]}),a&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/70 border-2 border-dashed border-primary pointer-events-none z-10",children:P.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),P.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"})]})}function kt(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 gv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xI(...e){return t=>{let n=!1;const i=e.map(s=>{const l=gv(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():gv(e[s],null)}}}}function Ut(...e){return O.useCallback(xI(...e),e)}function ox(e,t=[]){let n=[];function i(l,a){const c=O.createContext(a);c.displayName=l+"Context";const f=n.length;n=[...n,a];const d=h=>{var k;const{scope:g,children:v,...S}=h,w=((k=g==null?void 0:g[e])==null?void 0:k[f])||c,b=O.useMemo(()=>S,Object.values(S));return P.jsx(w.Provider,{value:b,children:v})};d.displayName=l+"Provider";function m(h,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[f])||c,S=O.useContext(v);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${l}\``)}return[d,m]}const s=()=>{const l=n.map(a=>O.createContext(a));return function(c){const f=(c==null?void 0:c[e])||l;return O.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return s.scopeName=e,[i,bI(s,...t)]}function bI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const a=i.reduce((c,{useScope:f,scopeName:d})=>{const h=f(l)[`__scope${d}`];return{...c,...h}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var fo=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},SI=Ih[" useId ".trim().toString()]||(()=>{}),kI=0;function Yd(e){const[t,n]=O.useState(SI());return fo(()=>{n(i=>i??String(kI++))},[e]),e||(t?`radix-${t}`:"")}var EI=Ih[" useInsertionEffect ".trim().toString()]||fo;function NI({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,l,a]=_I({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s;{const m=O.useRef(e!==void 0);O.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${i} is changing from ${h?"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,i])}const d=O.useCallback(m=>{var h;if(c){const g=CI(m)?m(e):m;g!==e&&((h=a.current)==null||h.call(a,g))}else l(m)},[c,e,l,a]);return[f,d]}function _I({defaultProp:e,onChange:t}){const[n,i]=O.useState(e),s=O.useRef(n),l=O.useRef(t);return EI(()=>{l.current=t},[t]),O.useEffect(()=>{var a;s.current!==n&&((a=l.current)==null||a.call(l,n),s.current=n)},[n,s]),[n,i,l]}function CI(e){return typeof e=="function"}function sx(e){const t=O.forwardRef((n,i)=>{let{children:s,...l}=n,a=null,c=!1;const f=[];yv(s)&&typeof _a=="function"&&(s=_a(s._payload)),O.Children.forEach(s,g=>{var v;if(AI(g)){c=!0;const S=g;let w="child"in S.props?S.props.child:S.props.children;yv(w)&&typeof _a=="function"&&(w=_a(w._payload)),a=OI(S,w),f.push((v=a==null?void 0:a.props)==null?void 0:v.children)}else f.push(g)}),a?a=O.cloneElement(a,void 0,f):!c&&O.Children.count(s)===1&&O.isValidElement(s)&&(a=s);const d=a?II(a):void 0,m=Ut(i,d);if(!a){if(s||s===0)throw new Error(c?DI(e):RI(e));return s}const h=PI(l,a.props??{});return a.type!==O.Fragment&&(h.ref=i?m:d),O.cloneElement(a,h)});return t.displayName=`${e}.Slot`,t}var TI=Symbol.for("radix.slottable"),OI=(e,t)=>{if("child"in e.props){const n=e.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,e.props.children(n.props.children)):null}return O.isValidElement(t)?t:null};function PI(e,t){const n={...t};for(const i in t){const s=e[i],l=t[i];/^on[A-Z]/.test(i)?s&&l?n[i]=(...c)=>{const f=l(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...l}:i==="className"&&(n[i]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function II(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function AI(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TI}var MI=Symbol.for("react.lazy");function yv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MI&&"_payload"in e&&LI(e._payload)}function LI(e){return typeof e=="object"&&e!==null&&"then"in e}var RI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,DI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,_a=Ih[" use ".trim().toString()],jI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=jI.reduce((e,t)=>{const n=sx(`Primitive.${t}`),i=O.forwardRef((s,l)=>{const{asChild:a,...c}=s,f=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(f,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function $I(e,t){e&&e1.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function zI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);O.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var FI="DismissableLayer",Sh="dismissableLayer.update",BI="dismissableLayer.pointerDownOutside",VI="dismissableLayer.focusOutside",vv,ep=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lx=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:a,onInteractOutside:c,onDismiss:f,...d}=e,m=O.useContext(ep),[h,g]=O.useState(null),v=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=O.useState({}),w=Ut(t,I=>g(I)),b=Array.from(m.layers),[k]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(k),E=h?b.indexOf(h):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,A=E>=N,M=O.useRef(!1),L=qI(I=>{const F=I.target;if(!(F instanceof Node))return;const R=[...m.branches].some($=>$.contains(F));!A||R||(l==null||l(I),c==null||c(I),I.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:m.dismissableSurfaces}),C=YI(I=>{if(i&&M.current)return;const F=I.target;[...m.branches].some($=>$.contains(F))||(a==null||a(I),c==null||c(I),I.defaultPrevented||f==null||f())},v);return zI(I=>{E===m.layers.size-1&&(s==null||s(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},v),O.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(vv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),wv(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=vv))}},[h,v,n,m]),O.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),wv())},[h,m]),O.useEffect(()=>{const I=()=>S({});return document.addEventListener(Sh,I),()=>document.removeEventListener(Sh,I)},[]),P.jsx(Lt.div,{...d,ref:w,style:{pointerEvents:_?A?"auto":"none":void 0,...e.style},onFocusCapture:kt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:kt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:kt(e.onPointerDownCapture,L.onPointerDownCapture)})});lx.displayName=FI;var WI="DismissableLayerBranch",UI=O.forwardRef((e,t)=>{const n=O.useContext(ep),i=O.useRef(null),s=Ut(t,i);return O.useEffect(()=>{const l=i.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),P.jsx(Lt.div,{...e,ref:s})});UI.displayName=WI;function HI(){const e=O.useContext(ep),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function qI(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:l}=t,a=Zt(e),c=O.useRef(!1),f=O.useRef(!1),d=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function h(){f.current=!1,s.current=!1,d.current.clear()}function g(){return Array.from(d.current.values()).some(Boolean)}function v(N){if(!f.current)return;const E=N.target;E instanceof Node&&[...l].some(A=>A.contains(E))||d.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function S(N){f.current&&d.current.set(N.type,!1)}const w=N=>{if(N.target&&!c.current){let E=function(){n.removeEventListener("click",m.current);const A=g();h(),A||ax(BI,a,_,{discrete:!0})};const _={originalEvent:N};f.current=!0,s.current=i&&N.button===0,d.current.clear(),!i||N.button!==0?E():(n.removeEventListener("click",m.current),m.current=E,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),h();c.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of b)n.addEventListener(N,v,!0),n.addEventListener(N,S);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const N of b)n.removeEventListener(N,v,!0),n.removeEventListener(N,S)}},[n,a,i,s,l]),{onPointerDownCapture:()=>c.current=!0}}function YI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=O.useRef(!1);return O.useEffect(()=>{const s=l=>{l.target&&!i.current&&ax(VI,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function wv(){const e=new CustomEvent(Sh);document.dispatchEvent(e)}function ax(e,t,n,{discrete:i}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?$I(s,l):s.dispatchEvent(l)}var Kd="focusScope.autoFocusOnMount",Gd="focusScope.autoFocusOnUnmount",xv={bubbles:!1,cancelable:!0},KI="FocusScope",ux=O.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...a}=e,[c,f]=O.useState(null),d=Zt(s),m=Zt(l),h=O.useRef(null),g=Ut(t,w=>f(w)),v=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(i){let w=function(E){if(v.paused||!c)return;const _=E.target;c.contains(_)?h.current=_:Nr(h.current,{select:!0})},b=function(E){if(v.paused||!c)return;const _=E.relatedTarget;_!==null&&(c.contains(_)||Nr(h.current,{select:!0}))},k=function(E){if(document.activeElement===document.body)for(const A of E)A.removedNodes.length>0&&Nr(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const N=new MutationObserver(k);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),N.disconnect()}}},[i,c,v.paused]),O.useEffect(()=>{if(c){Sv.add(v);const w=document.activeElement;if(!c.contains(w)){const k=new CustomEvent(Kd,xv);c.addEventListener(Kd,d),c.dispatchEvent(k),k.defaultPrevented||(GI(eA(cx(c)),{select:!0}),document.activeElement===w&&Nr(c))}return()=>{c.removeEventListener(Kd,d),setTimeout(()=>{const k=new CustomEvent(Gd,xv);c.addEventListener(Gd,m),c.dispatchEvent(k),k.defaultPrevented||Nr(w??document.body,{select:!0}),c.removeEventListener(Gd,m),Sv.remove(v)},0)}}},[c,d,m,v]);const S=O.useCallback(w=>{if(!n&&!i||v.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(b&&k){const N=w.currentTarget,[E,_]=XI(N);E&&_?!w.shiftKey&&k===_?(w.preventDefault(),n&&Nr(E,{select:!0})):w.shiftKey&&k===E&&(w.preventDefault(),n&&Nr(_,{select:!0})):k===N&&w.preventDefault()}},[n,i,v.paused]);return P.jsx(Lt.div,{tabIndex:-1,...a,ref:g,onKeyDown:S})});ux.displayName=KI;function GI(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(Nr(i,{select:t}),document.activeElement!==n)return}function XI(e){const t=cx(e),n=bv(t,e),i=bv(t.reverse(),e);return[n,i]}function cx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bv(e,t){for(const n of e)if(!QI(n,{upTo:t}))return n}function QI(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 JI(e){return e instanceof HTMLInputElement&&"select"in e}function Nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JI(e)&&t&&e.select()}}var Sv=ZI();function ZI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kv(e,t),e.unshift(t)},remove(t){var n;e=kv(e,t),(n=e[0])==null||n.resume()}}}function kv(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function eA(e){return e.filter(t=>t.tagName!=="A")}var tA="Portal",fx=O.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[s,l]=O.useState(!1);fo(()=>l(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?e1.createPortal(P.jsx(Lt.div,{...i,ref:t}),a):null});fx.displayName=tA;function nA(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var Ir=e=>{const{present:t,children:n}=e,i=rA(t),s=typeof n=="function"?n({present:i.isPresent}):O.Children.only(n),l=iA(i.ref,oA(s));return typeof n=="function"||i.isPresent?O.cloneElement(s,{ref:l}):null};Ir.displayName="Presence";function rA(e){const[t,n]=O.useState(),i=O.useRef(null),s=O.useRef(e),l=O.useRef("none"),a=e?"mounted":"unmounted",[c,f]=nA(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const d=Ca(i.current);l.current=c==="mounted"?d:"none"},[c]),fo(()=>{const d=i.current,m=s.current;if(m!==e){const g=l.current,v=Ca(d);e?f("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),fo(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=Ca(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(f("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=v=>{v.target===t&&(l.current=Ca(i.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:O.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function Ev(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iA(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const i=t.current;let s=!1;const l=i.map(a=>{const c=Ev(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<l.length;a++){const c=l[a];typeof c=="function"?c():Ev(i[a],null)}}},[])}function Ca(e){return(e==null?void 0:e.animationName)||"none"}function oA(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.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 Ta=0,On=null;function sA(){O.useEffect(()=>{On||(On={start:Nv(),end:Nv()});const{start:e,end:t}=On;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ta++,()=>{Ta===1&&(On==null||On.start.remove(),On==null||On.end.remove(),On=null),Ta=Math.max(0,Ta-1)}},[])}function Nv(){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 In=function(){return In=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},In.apply(this,arguments)};function dx(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]]);return n}function lA(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var Wa="right-scroll-bar-position",Ua="width-before-scroll-bar",aA="with-scroll-bars-hidden",uA="--removed-body-scroll-bar-size";function Xd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cA(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=t,n.facade}var fA=typeof window<"u"?O.useLayoutEffect:O.useEffect,_v=new WeakMap;function dA(e,t){var n=cA(null,function(i){return e.forEach(function(s){return Xd(s,i)})});return fA(function(){var i=_v.get(n);if(i){var s=new Set(i),l=new Set(e),a=n.current;s.forEach(function(c){l.has(c)||Xd(c,null)}),l.forEach(function(c){s.has(c)||Xd(c,a)})}_v.set(n,e)},[e]),n}function hA(e){return e}function pA(e,t){t===void 0&&(t=hA);var n=[],i=!1,s={read:function(){if(i)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(l){var a=t(l,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(i=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var f=function(){var m=a;a=[],m.forEach(l)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(m){a.push(m),d()},filter:function(m){return a=a.filter(m),n}}}};return s}function mA(e){e===void 0&&(e={});var t=pA(null);return t.options=In({async:!0,ssr:!1},e),t}var hx=function(e){var t=e.sideCar,n=dx(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return O.createElement(i,In({},n))};hx.isSideCarExport=!0;function gA(e,t){return e.useMedium(t),hx}var px=mA(),Qd=function(){},Nu=O.forwardRef(function(e,t){var n=O.useRef(null),i=O.useState({onScrollCapture:Qd,onWheelCapture:Qd,onTouchMoveCapture:Qd}),s=i[0],l=i[1],a=e.forwardProps,c=e.children,f=e.className,d=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,S=e.noIsolation,w=e.inert,b=e.allowPinchZoom,k=e.as,N=k===void 0?"div":k,E=e.gapMode,_=dx(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,M=dA([n,t]),L=In(In({},_),s);return O.createElement(O.Fragment,null,m&&O.createElement(A,{sideCar:px,removeScrollBar:d,shards:h,noRelative:v,noIsolation:S,inert:w,setCallbacks:l,allowPinchZoom:!!b,lockRef:n,gapMode:E}),a?O.cloneElement(O.Children.only(c),In(In({},L),{ref:M})):O.createElement(N,In({},L,{className:f,ref:M}),c))});Nu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nu.classNames={fullWidth:Ua,zeroRight:Wa};var yA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yA();return t&&e.setAttribute("nonce",t),e}function wA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vA())&&(wA(t,n),xA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},SA=function(){var e=bA();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mx=function(){var e=SA(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},kA={left:0,top:0,right:0,gap:0},Jd=function(e){return parseInt(e||"",10)||0},EA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Jd(n),Jd(i),Jd(s)]},NA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kA;var t=EA(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},_A=mx(),to="data-scroll-locked",CA=function(e,t,n,i){var s=e.left,l=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
63
|
+
.`.concat(aA,` {
|
|
64
64
|
overflow: hidden `).concat(i,`;
|
|
65
65
|
padding-right: `).concat(c,"px ").concat(i,`;
|
|
66
66
|
}
|
|
@@ -94,107 +94,107 @@ Error generating stack: `+x.message+`
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
body[`).concat(to,`] {
|
|
97
|
-
`).concat(
|
|
97
|
+
`).concat(uA,": ").concat(c,`px;
|
|
98
98
|
}
|
|
99
|
-
`)},Cv=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},
|
|
99
|
+
`)},Cv=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},TA=function(){O.useEffect(function(){return document.body.setAttribute(to,(Cv()+1).toString()),function(){var e=Cv()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},OA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;TA();var l=O.useMemo(function(){return NA(s)},[s]);return O.createElement(_A,{styles:CA(l,!t,s,n?"":"!important")})},kh=!1;if(typeof window<"u")try{var Oa=Object.defineProperty({},"passive",{get:function(){return kh=!0,!0}});window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{kh=!1}var Vi=kh?{passive:!1}:!1,PA=function(e){return e.tagName==="TEXTAREA"},gx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!PA(e)&&n[t]==="visible")},IA=function(e){return gx(e,"overflowY")},AA=function(e){return gx(e,"overflowX")},Tv=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=yx(e,i);if(s){var l=vx(e,i),a=l[1],c=l[2];if(a>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},MA=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},LA=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},yx=function(e,t){return e==="v"?IA(t):AA(t)},vx=function(e,t){return e==="v"?MA(t):LA(t)},RA=function(e,t){return e==="h"&&t==="rtl"?-1:1},DA=function(e,t,n,i,s){var l=RA(e,window.getComputedStyle(t).direction),a=l*i,c=n.target,f=t.contains(c),d=!1,m=a>0,h=0,g=0;do{if(!c)break;var v=vx(e,c),S=v[0],w=v[1],b=v[2],k=w-b-l*S;(S||k)&&yx(e,c)&&(h+=k,g+=S);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(h)<1||!m&&Math.abs(g)<1)&&(d=!0),d},Pa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ov=function(e){return[e.deltaX,e.deltaY]},Pv=function(e){return e&&"current"in e?e.current:e},jA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$A=function(e){return`
|
|
100
100
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
101
101
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
102
|
-
`)}
|
|
102
|
+
`)},zA=0,Wi=[];function FA(e){var t=O.useRef([]),n=O.useRef([0,0]),i=O.useRef(),s=O.useState(zA++)[0],l=O.useState(mx)[0],a=O.useRef(e);O.useEffect(function(){a.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=lA([e.lockRef.current],(e.shards||[]).map(Pv),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=O.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var k=Pa(w),N=n.current,E="deltaX"in w?w.deltaX:N[0]-k[0],_="deltaY"in w?w.deltaY:N[1]-k[1],A,M=w.target,L=Math.abs(E)>Math.abs(_)?"h":"v";if("touches"in w&&L==="h"&&M.type==="range")return!1;var C=window.getSelection(),I=C&&C.anchorNode,F=I?I===M||I.contains(M):!1;if(F)return!1;var R=Tv(L,M);if(!R)return!0;if(R?A=L:(A=L==="v"?"h":"v",R=Tv(L,M)),!R)return!1;if(!i.current&&"changedTouches"in w&&(E||_)&&(i.current=A),!A)return!0;var $=i.current||A;return DA($,b,w,$==="h"?E:_)},[]),f=O.useCallback(function(w){var b=w;if(!(!Wi.length||Wi[Wi.length-1]!==l)){var k="deltaY"in b?Ov(b):Pa(b),N=t.current.filter(function(A){return A.name===b.type&&(A.target===b.target||b.target===A.shadowParent)&&jA(A.delta,k)})[0];if(N&&N.should){b.cancelable&&b.preventDefault();return}if(!N){var E=(a.current.shards||[]).map(Pv).filter(Boolean).filter(function(A){return A.contains(b.target)}),_=E.length>0?c(b,E[0]):!a.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),d=O.useCallback(function(w,b,k,N){var E={name:w,delta:b,target:k,should:N,shadowParent:BA(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(_){return _!==E})},1)},[]),m=O.useCallback(function(w){n.current=Pa(w),i.current=void 0},[]),h=O.useCallback(function(w){d(w.type,Ov(w),w.target,c(w,e.lockRef.current))},[]),g=O.useCallback(function(w){d(w.type,Pa(w),w.target,c(w,e.lockRef.current))},[]);O.useEffect(function(){return Wi.push(l),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",f,Vi),document.addEventListener("touchmove",f,Vi),document.addEventListener("touchstart",m,Vi),function(){Wi=Wi.filter(function(w){return w!==l}),document.removeEventListener("wheel",f,Vi),document.removeEventListener("touchmove",f,Vi),document.removeEventListener("touchstart",m,Vi)}},[]);var v=e.removeScrollBar,S=e.inert;return O.createElement(O.Fragment,null,S?O.createElement(l,{styles:$A(s)}):null,v?O.createElement(OA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function BA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const VA=gA(px,FA);var wx=O.forwardRef(function(e,t){return O.createElement(Nu,In({},e,{ref:t,sideCar:VA}))});wx.classNames=Nu.classNames;var WA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ui=new WeakMap,Ia=new WeakMap,Aa={},Zd=0,xx=function(e){return e&&(e.host||xx(e.parentNode))},UA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=xx(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},HA=function(e,t,n,i){var s=UA(t,Array.isArray(e)?e:[e]);Aa[n]||(Aa[n]=new WeakMap);var l=Aa[n],a=[],c=new Set,f=new Set(s),d=function(h){!h||c.has(h)||(c.add(h),d(h.parentNode))};s.forEach(d);var m=function(h){!h||f.has(h)||Array.prototype.forEach.call(h.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(i),S=v!==null&&v!=="false",w=(Ui.get(g)||0)+1,b=(l.get(g)||0)+1;Ui.set(g,w),l.set(g,b),a.push(g),w===1&&S&&Ia.set(g,!0),b===1&&g.setAttribute(n,"true"),S||g.setAttribute(i,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return m(t),c.clear(),Zd++,function(){a.forEach(function(h){var g=Ui.get(h)-1,v=l.get(h)-1;Ui.set(h,g),l.set(h,v),g||(Ia.has(h)||h.removeAttribute(i),Ia.delete(h)),v||h.removeAttribute(n)}),Zd--,Zd||(Ui=new WeakMap,Ui=new WeakMap,Ia=new WeakMap,Aa={})}},qA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=WA(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),HA(i,s,n,"aria-hidden")):function(){return null}},_u="Dialog",[bx]=ox(_u),[YA,wn]=bx(_u),Sx=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,c=O.useRef(null),f=O.useRef(null),[d,m]=NI({prop:i,defaultProp:s??!1,onChange:l,caller:_u});return P.jsx(YA,{scope:t,triggerRef:c,contentRef:f,contentId:Yd(),titleId:Yd(),descriptionId:Yd(),open:d,onOpenChange:m,onOpenToggle:O.useCallback(()=>m(h=>!h),[m]),modal:a,children:n})};Sx.displayName=_u;var kx="DialogTrigger",KA=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=wn(kx,n),l=Ut(t,s.triggerRef);return P.jsx(Lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":op(s.open),...i,ref:l,onClick:kt(e.onClick,s.onOpenToggle)})});KA.displayName=kx;var tp="DialogPortal",[GA,Ex]=bx(tp,{forceMount:void 0}),Nx=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,l=wn(tp,t);return P.jsx(GA,{scope:t,forceMount:n,children:O.Children.map(i,a=>P.jsx(Ir,{present:n||l.open,children:P.jsx(fx,{asChild:!0,container:s,children:a})}))})};Nx.displayName=tp;var su="DialogOverlay",np=O.forwardRef((e,t)=>{const n=Ex(su,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,l=wn(su,e.__scopeDialog);return l.modal?P.jsx(Ir,{present:i||l.open,children:P.jsx(QA,{...s,ref:t})}):null});np.displayName=su;var XA=sx("DialogOverlay.RemoveScroll"),QA=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=wn(su,n),l=HI(),a=Ut(t,l);return P.jsx(wx,{as:XA,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(Lt.div,{"data-state":op(s.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),ho="DialogContent",rp=O.forwardRef((e,t)=>{const n=Ex(ho,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,l=wn(ho,e.__scopeDialog);return P.jsx(Ir,{present:i||l.open,children:l.modal?P.jsx(JA,{...s,ref:t}):P.jsx(ZA,{...s,ref:t})})});rp.displayName=ho;var JA=O.forwardRef((e,t)=>{const n=wn(ho,e.__scopeDialog),i=O.useRef(null),s=Ut(t,n.contentRef,i);return O.useEffect(()=>{const l=i.current;if(l)return qA(l)},[]),P.jsx(_x,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:kt(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:kt(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&l.preventDefault()}),onFocusOutside:kt(e.onFocusOutside,l=>l.preventDefault())})}),ZA=O.forwardRef((e,t)=>{const n=wn(ho,e.__scopeDialog),i=O.useRef(!1),s=O.useRef(!1);return P.jsx(_x,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(i.current||(c=n.triggerRef.current)==null||c.focus(),l.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:l=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),_x=O.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,...a}=e,c=wn(ho,n);return sA(),P.jsx(P.Fragment,{children:P.jsx(ux,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:l,children:P.jsx(lx,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":op(c.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),Cx="DialogTitle",ip=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=wn(Cx,n);return P.jsx(Lt.h2,{id:s.titleId,...i,ref:t})});ip.displayName=Cx;var Tx="DialogDescription",eM=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=wn(Tx,n);return P.jsx(Lt.p,{id:s.descriptionId,...i,ref:t})});eM.displayName=Tx;var Ox="DialogClose",Px=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=wn(Ox,n);return P.jsx(Lt.button,{type:"button",...i,ref:t,onClick:kt(e.onClick,()=>s.onOpenChange(!1))})});Px.displayName=Ox;function op(e){return e?"open":"closed"}/**
|
|
103
103
|
* @license lucide-react v0.513.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const
|
|
107
|
+
*/const tM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),Iv=e=>{const t=nM(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ix=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),rM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
108
108
|
* @license lucide-react v0.513.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/var
|
|
112
|
+
*/var iM={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"};/**
|
|
113
113
|
* @license lucide-react v0.513.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const oM=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:a,...c},f)=>O.createElement("svg",{ref:f,...iM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Ix("lucide",s),...!l&&!rM(c)&&{"aria-hidden":"true"},...c},[...a.map(([d,m])=>O.createElement(d,m)),...Array.isArray(l)?l:[l]]));/**
|
|
118
118
|
* @license lucide-react v0.513.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
122
|
+
*/const sM=(e,t)=>{const n=O.forwardRef(({className:i,...s},l)=>O.createElement(oM,{ref:l,iconNode:t,className:Ix(`lucide-${tM(Iv(e))}`,`lucide-${e}`,i),...s}));return n.displayName=Iv(e),n};/**
|
|
123
123
|
* @license lucide-react v0.513.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const sM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lM=oM("x",sM),aM=bx,uM=Ex,Ix=O.forwardRef(({className:e,...t},n)=>P.jsx(np,{className:ut("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));Ix.displayName=np.displayName;const Ax=O.forwardRef(({side:e="right",className:t,children:n,...i},s)=>P.jsxs(uM,{children:[P.jsx(Ix,{}),P.jsxs(rp,{ref:s,className:ut("fixed z-50 bg-bg shadow-lg transition flex flex-col",e==="right"&&"inset-y-0 right-0 w-80 border-l border-border",e==="left"&&"inset-y-0 left-0 w-80 border-r border-border",t),...i,children:[n,P.jsxs(Ox,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[P.jsx(lM,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ax.displayName=rp.displayName;const Mx=({className:e,...t})=>P.jsx("div",{className:ut("flex flex-col space-y-2 p-4 border-b border-border",e),...t});Mx.displayName="SheetHeader";const Lx=O.forwardRef(({className:e,...t},n)=>P.jsx(ip,{ref:n,className:ut("font-semibold",e),...t}));Lx.displayName=ip.displayName;var cM=O.createContext(void 0);function fM(e){const t=O.useContext(cM);return e||t||"ltr"}function dM(e,[t,n]){return Math.min(n,Math.max(t,e))}function hM(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var sp="ScrollArea",[Rx]=ix(sp),[pM,rn]=Rx(sp),Dx=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:s,scrollHideDelay:l=600,...a}=e,[c,f]=O.useState(null),[d,m]=O.useState(null),[h,g]=O.useState(null),[v,S]=O.useState(null),[w,b]=O.useState(null),[k,_]=O.useState(0),[E,N]=O.useState(0),[I,M]=O.useState(!1),[R,C]=O.useState(!1),A=Ut(t,L=>f(L)),F=fM(s);return P.jsx(pM,{scope:n,type:i,dir:F,scrollHideDelay:l,scrollArea:c,viewport:d,onViewportChange:m,content:h,onContentChange:g,scrollbarX:v,onScrollbarXChange:S,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:R,onScrollbarYEnabledChange:C,onCornerWidthChange:_,onCornerHeightChange:N,children:P.jsx(Lt.div,{dir:F,...a,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});Dx.displayName=sp;var jx="ScrollAreaViewport",$x=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...l}=e,a=rn(jx,n),c=O.useRef(null),f=Ut(t,c,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.jsx(mM,{nonce:s}),P.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...l,ref:f,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});$x.displayName=jx;var mM=O.memo(({nonce:e})=>P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),Rn="ScrollAreaScrollbar",lp=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=s,c=e.orientation==="horizontal";return O.useEffect(()=>(c?l(!0):a(!0),()=>{c?l(!1):a(!1)}),[c,l,a]),s.type==="hover"?P.jsx(gM,{...i,ref:t,forceMount:n}):s.type==="scroll"?P.jsx(yM,{...i,ref:t,forceMount:n}):s.type==="auto"?P.jsx(zx,{...i,ref:t,forceMount:n}):s.type==="always"?P.jsx(ap,{...i,ref:t,"data-state":"visible"}):null});lp.displayName=Rn;var gM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),[l,a]=O.useState(!1);return O.useEffect(()=>{const c=s.scrollArea;let f=0;if(c){const d=()=>{window.clearTimeout(f),a(!0)},m=()=>{f=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",m)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Ir,{present:n||l,children:P.jsx(zx,{"data-state":l?"visible":"hidden",...i,ref:t})})}),yM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),l=e.orientation==="horizontal",a=Tu(()=>f("SCROLL_END"),100),[c,f]=hM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>f("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,s.scrollHideDelay,f]),O.useEffect(()=>{const d=s.viewport,m=l?"scrollLeft":"scrollTop";if(d){let h=d[m];const g=()=>{const v=d[m];h!==v&&(f("SCROLL"),a()),h=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,l,f,a]),P.jsx(Ir,{present:n||c!=="hidden",children:P.jsx(ap,{"data-state":c==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:kt(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:kt(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),zx=O.forwardRef((e,t)=>{const n=rn(Rn,e.__scopeScrollArea),{forceMount:i,...s}=e,[l,a]=O.useState(!1),c=e.orientation==="horizontal",f=Tu(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?d:m)}},10);return po(n.viewport,f),po(n.content,f),P.jsx(Ir,{present:i||l,children:P.jsx(ap,{"data-state":l?"visible":"hidden",...s,ref:t})})}),ap=O.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=rn(Rn,e.__scopeScrollArea),l=O.useRef(null),a=O.useRef(0),[c,f]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Ux(c.viewport,c.content),m={...i,sizes:c,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:g=>l.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function h(g,v){return kM(g,a.current,c,v)}return n==="horizontal"?P.jsx(vM,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const g=s.viewport.scrollLeft,v=Av(g,c,s.dir);l.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=h(g,s.dir))}}):n==="vertical"?P.jsx(wM,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const g=s.viewport.scrollTop,v=Av(g,c);l.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=h(g))}}):null}),vM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,l=rn(Rn,e.__scopeScrollArea),[a,c]=O.useState(),f=O.useRef(null),d=Ut(t,f,l.onScrollbarXChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),P.jsx(Bx,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(l.viewport){const g=l.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),qx(g,h)&&m.preventDefault()}},onResize:()=>{f.current&&l.viewport&&a&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:au(a.paddingLeft),paddingEnd:au(a.paddingRight)}})}})}),wM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,l=rn(Rn,e.__scopeScrollArea),[a,c]=O.useState(),f=O.useRef(null),d=Ut(t,f,l.onScrollbarYChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),P.jsx(Bx,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(l.viewport){const g=l.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),qx(g,h)&&m.preventDefault()}},onResize:()=>{f.current&&l.viewport&&a&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:au(a.paddingTop),paddingEnd:au(a.paddingBottom)}})}})}),[xM,Fx]=Rx(Rn),Bx=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:s,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:m,onResize:h,...g}=e,v=rn(Rn,n),[S,w]=O.useState(null),b=Ut(t,A=>w(A)),k=O.useRef(null),_=O.useRef(""),E=v.viewport,N=i.content-i.viewport,I=Zt(m),M=Zt(f),R=Tu(h,10);function C(A){if(k.current){const F=A.clientX-k.current.left,L=A.clientY-k.current.top;d({x:F,y:L})}}return O.useEffect(()=>{const A=F=>{const L=F.target;(S==null?void 0:S.contains(L))&&I(F,N)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[E,S,N,I]),O.useEffect(M,[i,M]),po(S,R),po(v.content,R),P.jsx(xM,{scope:n,scrollbar:S,hasThumb:s,onThumbChange:Zt(l),onThumbPointerUp:Zt(a),onThumbPositionChange:M,onThumbPointerDown:Zt(c),children:P.jsx(Lt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:kt(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),k.current=S.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),C(A))}),onPointerMove:kt(e.onPointerMove,C),onPointerUp:kt(e.onPointerUp,A=>{const F=A.target;F.hasPointerCapture(A.pointerId)&&F.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),k.current=null})})})}),lu="ScrollAreaThumb",Vx=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=Fx(lu,e.__scopeScrollArea);return P.jsx(Ir,{present:n||s.hasThumb,children:P.jsx(bM,{ref:t,...i})})}),bM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,l=rn(lu,n),a=Fx(lu,n),{onThumbPositionChange:c}=a,f=Ut(t,h=>a.onThumbChange(h)),d=O.useRef(void 0),m=Tu(()=>{d.current&&(d.current(),d.current=void 0)},100);return O.useEffect(()=>{const h=l.viewport;if(h){const g=()=>{if(m(),!d.current){const v=EM(h,c);d.current=v,c()}};return c(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[l.viewport,m,c]),P.jsx(Lt.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:kt(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),S=h.clientX-v.left,w=h.clientY-v.top;a.onThumbPointerDown({x:S,y:w})}),onPointerUp:kt(e.onPointerUp,a.onThumbPointerUp)})});Vx.displayName=lu;var up="ScrollAreaCorner",Wx=O.forwardRef((e,t)=>{const n=rn(up,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?P.jsx(SM,{...e,ref:t}):null});Wx.displayName=up;var SM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=rn(up,n),[l,a]=O.useState(0),[c,f]=O.useState(0),d=!!(l&&c);return po(s.scrollbarX,()=>{var h;const m=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(m),f(m)}),po(s.scrollbarY,()=>{var h;const m=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(m),a(m)}),d?P.jsx(Lt.div,{...i,ref:t,style:{width:l,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function au(e){return e?parseInt(e,10):0}function Ux(e,t){const n=e/t;return isNaN(n)?0:n}function Cu(e){const t=Ux(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function kM(e,t,n,i="ltr"){const s=Cu(n),l=s/2,a=t||l,c=s-a,f=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,h=i==="ltr"?[0,m]:[m*-1,0];return Hx([f,d],h)(e)}function Av(e,t,n="ltr"){const i=Cu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-s,a=t.content-t.viewport,c=l-i,f=n==="ltr"?[0,a]:[a*-1,0],d=dM(e,f);return Hx([0,a],[0,c])(d)}function Hx(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function qx(e,t){return e>0&&e<t}var EM=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function s(){const l={left:e.scrollLeft,top:e.scrollTop},a=n.left!==l.left,c=n.top!==l.top;(a||c)&&t(),n=l,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function Tu(e,t){const n=Zt(e),i=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(i.current),[]),O.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function po(e,t){const n=Zt(t);fo(()=>{let i=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(i),s.unobserve(e)}}},[e,n])}var Yx=Dx,_M=$x,NM=Wx;const Kx=O.forwardRef(({className:e,children:t,...n},i)=>P.jsxs(Yx,{ref:i,className:ut("relative overflow-hidden",e),...n,children:[P.jsx(_M,{className:"h-full w-full rounded-[inherit]",children:t}),P.jsx(Gx,{}),P.jsx(NM,{})]}));Kx.displayName=Yx.displayName;const Gx=O.forwardRef(({className:e,orientation:t="vertical",...n},i)=>P.jsx(lp,{ref:i,orientation:t,className:ut("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:P.jsx(Vx,{className:"relative flex-1 rounded-full bg-border"})}));Gx.displayName=lp.displayName;const Mv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lv=L1,CM=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return Lv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,a=Object.keys(s).map(d=>{const m=n==null?void 0:n[d],h=l==null?void 0:l[d];if(m===null)return null;const g=Mv(m)||Mv(h);return s[d][g]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,g]=m;return g===void 0||(d[h]=g),d},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:h,className:g,...v}=m;return Object.entries(v).every(S=>{let[w,b]=S;return Array.isArray(b)?b.includes({...l,...c}[w]):{...l,...c}[w]===b})?[...d,h,g]:d},[]);return Lv(e,a,f,n==null?void 0:n.class,n==null?void 0:n.className)},TM=CM("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono font-medium uppercase tracking-wide transition-colors",{variants:{variant:{default:"bg-fg text-bg",agent:"bg-agent/10 text-agent",muted:"bg-muted text-mutedfg"}},defaultVariants:{variant:"default"}});function OM({className:e,variant:t,...n}){return P.jsx("div",{className:ut(TM({variant:t}),e),...n})}function PM({node:e,onClose:t,agentDefaults:n,agents:i}){const s=(e==null?void 0:e.type)==="agent.run",l=(e==null?void 0:e.config)??{},a=l.agent?i==null?void 0:i[l.agent]:void 0,c=l.model??(a==null?void 0:a.model)??(n==null?void 0:n.model)??"claude-opus-4-8",f=!l.model,d=l.model?void 0:a!=null&&a.model?`from agent ${l.agent}`:"project default",m=l.effort??(a==null?void 0:a.effort)??(n==null?void 0:n.effort)??"high",h=!l.effort,g=l.effort?void 0:a!=null&&a.effort?`from agent ${l.agent}`:n!=null&&n.effort?"project default":"model default";return P.jsx(aM,{open:!!e,onOpenChange:v=>!v&&t(),children:P.jsxs(Ax,{side:"right",children:[P.jsx(Mx,{children:P.jsxs(Lx,{className:"flex items-center gap-2",children:[s&&P.jsx(OM,{variant:"agent",children:"agent"}),P.jsx("span",{className:s?"text-agent":void 0,children:e==null?void 0:e.id})]})}),P.jsx(Kx,{className:"flex-1 p-4",children:e&&P.jsxs("div",{className:"space-y-4",children:[P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),P.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),P.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),s&&P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),l.agent&&P.jsxs("div",{"data-testid":"agent-ref",className:"mt-1 mb-2 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:[l.agent,!a&&P.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[P.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),P.jsx("div",{className:"font-mono text-[12px] truncate",children:c}),f&&d&&P.jsx("div",{className:"text-[10px] text-mutedfg",children:d})]}),P.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),P.jsx("div",{className:"font-mono text-[12px]",children:m}),h&&g&&P.jsx("div",{className:"text-[10px] text-mutedfg",children:g})]})]}),(a==null?void 0:a.commands)&&a.commands.length>0&&P.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),P.jsx("div",{className:"mt-1 space-y-1",children:a.commands.map(v=>P.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[P.jsx("span",{className:"font-mono text-[12px]",children:v.name}),v.name===a.fallback&&P.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),v.description&&P.jsx("div",{className:"text-[11px] text-mutedfg",children:v.description})]},v.name))})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),P.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all",children:JSON.stringify(e.config,null,2)})]}),e.retry&&P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),P.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[P.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",P.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),P.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",P.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}function IM(e){return e==="running"?"bg-run pulse-dot":e==="success"?"bg-ok":"bg-fail"}function AM(e){return e==="running"?"running":e==="success"?"success":"failed"}function MM(e){if(!e.finishedAt)return"…";const t=e.finishedAt-e.startedAt;return t>=1e3?`${(t/1e3).toFixed(1)}s`:`${t}ms`}function LM(e){const t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function RM({runs:e,connected:t}){return P.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[P.jsxs("header",{className:"h-12 shrink-0 bg-bg border-b border-border flex items-center px-4 gap-3",children:[P.jsx("h1",{className:"font-semibold tracking-tight",children:"Runs"}),P.jsx("span",{className:"text-[11px] text-mutedfg",children:"ephemeral activity stream · nothing persisted beyond the surfaces"}),P.jsxs("div",{className:"ml-auto flex items-center gap-1.5 text-[11px] text-mutedfg",children:[P.jsx("span",{"data-testid":"live-dot",className:ut("size-1.5 rounded-full",t?"bg-ok pulse-dot":"bg-border")}),t?"live":"offline"]})]}),P.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-2 max-w-3xl",children:[e.length===0&&P.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-4 text-center",children:t?"No runs yet — waiting for the scheduler…":"Connect a flow-server to see live runs."}),e.map(n=>P.jsxs("div",{"data-testid":"run-row","data-run-status":n.status,className:"bg-bg border border-border rounded-lg",children:[P.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[P.jsx("span",{className:ut("size-1.5 rounded-full flex-shrink-0",IM(n.status))}),P.jsx("span",{className:"font-medium",children:n.workflow}),P.jsxs("span",{className:"font-mono text-[11px] text-mutedfg",children:[n.id," · ",LM(n.startedAt),n.finishedAt&&` · ${MM(n)}`]}),P.jsx("span",{className:ut("ml-auto text-[11px] font-medium",n.status==="running"&&"text-run",n.status==="success"&&"text-ok",n.status==="failed"&&"text-fail"),children:AM(n.status)})]}),n.status==="failed"&&n.error&&P.jsx("div",{"data-testid":"run-error",className:"px-3 py-2 text-[11px] font-mono text-fail bg-fail/5 break-words",children:n.error})]},n.id))]})]})}const cp=Symbol.for("yaml.alias"),Eh=Symbol.for("yaml.document"),Or=Symbol.for("yaml.map"),Xx=Symbol.for("yaml.pair"),Mn=Symbol.for("yaml.scalar"),vo=Symbol.for("yaml.seq"),nn=Symbol.for("yaml.node.type"),wo=e=>!!e&&typeof e=="object"&&e[nn]===cp,Ou=e=>!!e&&typeof e=="object"&&e[nn]===Eh,Hs=e=>!!e&&typeof e=="object"&&e[nn]===Or,Ze=e=>!!e&&typeof e=="object"&&e[nn]===Xx,$e=e=>!!e&&typeof e=="object"&&e[nn]===Mn,qs=e=>!!e&&typeof e=="object"&&e[nn]===vo;function Qe(e){if(e&&typeof e=="object")switch(e[nn]){case Or:case vo:return!0}return!1}function Je(e){if(e&&typeof e=="object")switch(e[nn]){case cp:case Or:case Mn:case vo:return!0}return!1}const Qx=e=>($e(e)||Qe(e))&&!!e.anchor,Zr=Symbol("break visit"),DM=Symbol("skip children"),Ns=Symbol("remove node");function xo(e,t){const n=jM(t);Ou(e)?Xi(null,e.contents,n,Object.freeze([e]))===Ns&&(e.contents=null):Xi(null,e,n,Object.freeze([]))}xo.BREAK=Zr;xo.SKIP=DM;xo.REMOVE=Ns;function Xi(e,t,n,i){const s=$M(e,t,n,i);if(Je(s)||Ze(s))return zM(e,i,s),Xi(e,s,n,i);if(typeof s!="symbol"){if(Qe(t)){i=Object.freeze(i.concat(t));for(let l=0;l<t.items.length;++l){const a=Xi(l,t.items[l],n,i);if(typeof a=="number")l=a-1;else{if(a===Zr)return Zr;a===Ns&&(t.items.splice(l,1),l-=1)}}}else if(Ze(t)){i=Object.freeze(i.concat(t));const l=Xi("key",t.key,n,i);if(l===Zr)return Zr;l===Ns&&(t.key=null);const a=Xi("value",t.value,n,i);if(a===Zr)return Zr;a===Ns&&(t.value=null)}}return s}function jM(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 $M(e,t,n,i){var s,l,a,c,f;if(typeof n=="function")return n(e,t,i);if(Hs(t))return(s=n.Map)==null?void 0:s.call(n,e,t,i);if(qs(t))return(l=n.Seq)==null?void 0:l.call(n,e,t,i);if(Ze(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,i);if($e(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,i);if(wo(t))return(f=n.Alias)==null?void 0:f.call(n,e,t,i)}function zM(e,t,n){const i=t[t.length-1];if(Qe(i))i.items[e]=n;else if(Ze(i))e==="key"?i.key=n:i.value=n;else if(Ou(i))i.contents=n;else{const s=wo(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const FM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},BM=e=>e.replace(/[!,[\]{}]/g,t=>FM[t]);class St{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},St.defaultYaml,t),this.tags=Object.assign({},St.defaultTags,n)}clone(){const t=new St(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new St(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:St.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},St.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:St.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},St.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[l,a]=i;return this.tags[l]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[l]=i;if(l==="1.1"||l==="1.2")return this.yaml.version=l,!0;{const a=/^\d+\.\d+$/.test(l);return n(6,`Unsupported YAML version ${l}`,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[,i,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const l=this.tags[i];if(l)try{return l+decodeURIComponent(s)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+BM(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let s;if(t&&i.length>0&&Je(t.contents)){const l={};xo(t.contents,(a,c)=>{Je(c)&&c.tag&&(l[c.tag]=!0)}),s=Object.keys(l)}else s=[];for(const[l,a]of i)l==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${l} ${a}`);return n.join(`
|
|
128
|
-
`)}}St.defaultYaml={explicit:!1,version:"1.2"};St.defaultTags={"!!":"tag:yaml.org,2002:"};function
|
|
127
|
+
*/const lM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aM=sM("x",lM),uM=Sx,cM=Nx,Ax=O.forwardRef(({className:e,...t},n)=>P.jsx(np,{className:ut("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));Ax.displayName=np.displayName;const Mx=O.forwardRef(({side:e="right",className:t,children:n,...i},s)=>P.jsxs(cM,{children:[P.jsx(Ax,{}),P.jsxs(rp,{ref:s,className:ut("fixed z-50 bg-bg shadow-lg transition flex flex-col",e==="right"&&"inset-y-0 right-0 w-80 border-l border-border",e==="left"&&"inset-y-0 left-0 w-80 border-r border-border",t),...i,children:[n,P.jsxs(Px,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[P.jsx(aM,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Mx.displayName=rp.displayName;const Lx=({className:e,...t})=>P.jsx("div",{className:ut("flex flex-col space-y-2 p-4 border-b border-border",e),...t});Lx.displayName="SheetHeader";const Rx=O.forwardRef(({className:e,...t},n)=>P.jsx(ip,{ref:n,className:ut("font-semibold",e),...t}));Rx.displayName=ip.displayName;var fM=O.createContext(void 0);function dM(e){const t=O.useContext(fM);return e||t||"ltr"}function hM(e,[t,n]){return Math.min(n,Math.max(t,e))}function pM(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var sp="ScrollArea",[Dx]=ox(sp),[mM,rn]=Dx(sp),jx=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:s,scrollHideDelay:l=600,...a}=e,[c,f]=O.useState(null),[d,m]=O.useState(null),[h,g]=O.useState(null),[v,S]=O.useState(null),[w,b]=O.useState(null),[k,N]=O.useState(0),[E,_]=O.useState(0),[A,M]=O.useState(!1),[L,C]=O.useState(!1),I=Ut(t,R=>f(R)),F=dM(s);return P.jsx(mM,{scope:n,type:i,dir:F,scrollHideDelay:l,scrollArea:c,viewport:d,onViewportChange:m,content:h,onContentChange:g,scrollbarX:v,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:L,onScrollbarYEnabledChange:C,onCornerWidthChange:N,onCornerHeightChange:_,children:P.jsx(Lt.div,{dir:F,...a,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});jx.displayName=sp;var $x="ScrollAreaViewport",zx=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...l}=e,a=rn($x,n),c=O.useRef(null),f=Ut(t,c,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.jsx(gM,{nonce:s}),P.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...l,ref:f,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});zx.displayName=$x;var gM=O.memo(({nonce:e})=>P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),Rn="ScrollAreaScrollbar",lp=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=s,c=e.orientation==="horizontal";return O.useEffect(()=>(c?l(!0):a(!0),()=>{c?l(!1):a(!1)}),[c,l,a]),s.type==="hover"?P.jsx(yM,{...i,ref:t,forceMount:n}):s.type==="scroll"?P.jsx(vM,{...i,ref:t,forceMount:n}):s.type==="auto"?P.jsx(Fx,{...i,ref:t,forceMount:n}):s.type==="always"?P.jsx(ap,{...i,ref:t,"data-state":"visible"}):null});lp.displayName=Rn;var yM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),[l,a]=O.useState(!1);return O.useEffect(()=>{const c=s.scrollArea;let f=0;if(c){const d=()=>{window.clearTimeout(f),a(!0)},m=()=>{f=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",m)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Ir,{present:n||l,children:P.jsx(Fx,{"data-state":l?"visible":"hidden",...i,ref:t})})}),vM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=rn(Rn,e.__scopeScrollArea),l=e.orientation==="horizontal",a=Tu(()=>f("SCROLL_END"),100),[c,f]=pM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>f("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,s.scrollHideDelay,f]),O.useEffect(()=>{const d=s.viewport,m=l?"scrollLeft":"scrollTop";if(d){let h=d[m];const g=()=>{const v=d[m];h!==v&&(f("SCROLL"),a()),h=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,l,f,a]),P.jsx(Ir,{present:n||c!=="hidden",children:P.jsx(ap,{"data-state":c==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:kt(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:kt(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),Fx=O.forwardRef((e,t)=>{const n=rn(Rn,e.__scopeScrollArea),{forceMount:i,...s}=e,[l,a]=O.useState(!1),c=e.orientation==="horizontal",f=Tu(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?d:m)}},10);return po(n.viewport,f),po(n.content,f),P.jsx(Ir,{present:i||l,children:P.jsx(ap,{"data-state":l?"visible":"hidden",...s,ref:t})})}),ap=O.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=rn(Rn,e.__scopeScrollArea),l=O.useRef(null),a=O.useRef(0),[c,f]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Hx(c.viewport,c.content),m={...i,sizes:c,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:g=>l.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function h(g,v){return EM(g,a.current,c,v)}return n==="horizontal"?P.jsx(wM,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const g=s.viewport.scrollLeft,v=Av(g,c,s.dir);l.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=h(g,s.dir))}}):n==="vertical"?P.jsx(xM,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const g=s.viewport.scrollTop,v=Av(g,c);l.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=h(g))}}):null}),wM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,l=rn(Rn,e.__scopeScrollArea),[a,c]=O.useState(),f=O.useRef(null),d=Ut(t,f,l.onScrollbarXChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),P.jsx(Vx,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(l.viewport){const g=l.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),Yx(g,h)&&m.preventDefault()}},onResize:()=>{f.current&&l.viewport&&a&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:au(a.paddingLeft),paddingEnd:au(a.paddingRight)}})}})}),xM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,l=rn(Rn,e.__scopeScrollArea),[a,c]=O.useState(),f=O.useRef(null),d=Ut(t,f,l.onScrollbarYChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),P.jsx(Vx,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(l.viewport){const g=l.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),Yx(g,h)&&m.preventDefault()}},onResize:()=>{f.current&&l.viewport&&a&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:au(a.paddingTop),paddingEnd:au(a.paddingBottom)}})}})}),[bM,Bx]=Dx(Rn),Vx=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:s,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:m,onResize:h,...g}=e,v=rn(Rn,n),[S,w]=O.useState(null),b=Ut(t,I=>w(I)),k=O.useRef(null),N=O.useRef(""),E=v.viewport,_=i.content-i.viewport,A=Zt(m),M=Zt(f),L=Tu(h,10);function C(I){if(k.current){const F=I.clientX-k.current.left,R=I.clientY-k.current.top;d({x:F,y:R})}}return O.useEffect(()=>{const I=F=>{const R=F.target;(S==null?void 0:S.contains(R))&&A(F,_)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,S,_,A]),O.useEffect(M,[i,M]),po(S,L),po(v.content,L),P.jsx(bM,{scope:n,scrollbar:S,hasThumb:s,onThumbChange:Zt(l),onThumbPointerUp:Zt(a),onThumbPositionChange:M,onThumbPointerDown:Zt(c),children:P.jsx(Lt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:kt(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),k.current=S.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),C(I))}),onPointerMove:kt(e.onPointerMove,C),onPointerUp:kt(e.onPointerUp,I=>{const F=I.target;F.hasPointerCapture(I.pointerId)&&F.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),k.current=null})})})}),lu="ScrollAreaThumb",Wx=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=Bx(lu,e.__scopeScrollArea);return P.jsx(Ir,{present:n||s.hasThumb,children:P.jsx(SM,{ref:t,...i})})}),SM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,l=rn(lu,n),a=Bx(lu,n),{onThumbPositionChange:c}=a,f=Ut(t,h=>a.onThumbChange(h)),d=O.useRef(void 0),m=Tu(()=>{d.current&&(d.current(),d.current=void 0)},100);return O.useEffect(()=>{const h=l.viewport;if(h){const g=()=>{if(m(),!d.current){const v=NM(h,c);d.current=v,c()}};return c(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[l.viewport,m,c]),P.jsx(Lt.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:kt(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),S=h.clientX-v.left,w=h.clientY-v.top;a.onThumbPointerDown({x:S,y:w})}),onPointerUp:kt(e.onPointerUp,a.onThumbPointerUp)})});Wx.displayName=lu;var up="ScrollAreaCorner",Ux=O.forwardRef((e,t)=>{const n=rn(up,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?P.jsx(kM,{...e,ref:t}):null});Ux.displayName=up;var kM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=rn(up,n),[l,a]=O.useState(0),[c,f]=O.useState(0),d=!!(l&&c);return po(s.scrollbarX,()=>{var h;const m=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(m),f(m)}),po(s.scrollbarY,()=>{var h;const m=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(m),a(m)}),d?P.jsx(Lt.div,{...i,ref:t,style:{width:l,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function au(e){return e?parseInt(e,10):0}function Hx(e,t){const n=e/t;return isNaN(n)?0:n}function Cu(e){const t=Hx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function EM(e,t,n,i="ltr"){const s=Cu(n),l=s/2,a=t||l,c=s-a,f=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,h=i==="ltr"?[0,m]:[m*-1,0];return qx([f,d],h)(e)}function Av(e,t,n="ltr"){const i=Cu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-s,a=t.content-t.viewport,c=l-i,f=n==="ltr"?[0,a]:[a*-1,0],d=hM(e,f);return qx([0,a],[0,c])(d)}function qx(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function Yx(e,t){return e>0&&e<t}var NM=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function s(){const l={left:e.scrollLeft,top:e.scrollTop},a=n.left!==l.left,c=n.top!==l.top;(a||c)&&t(),n=l,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function Tu(e,t){const n=Zt(e),i=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(i.current),[]),O.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function po(e,t){const n=Zt(t);fo(()=>{let i=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(i),s.unobserve(e)}}},[e,n])}var Kx=jx,_M=zx,CM=Ux;const Gx=O.forwardRef(({className:e,children:t,...n},i)=>P.jsxs(Kx,{ref:i,className:ut("relative overflow-hidden",e),...n,children:[P.jsx(_M,{className:"h-full w-full rounded-[inherit]",children:t}),P.jsx(Xx,{}),P.jsx(CM,{})]}));Gx.displayName=Kx.displayName;const Xx=O.forwardRef(({className:e,orientation:t="vertical",...n},i)=>P.jsx(lp,{ref:i,orientation:t,className:ut("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:P.jsx(Wx,{className:"relative flex-1 rounded-full bg-border"})}));Xx.displayName=lp.displayName;const Mv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lv=R1,TM=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return Lv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,a=Object.keys(s).map(d=>{const m=n==null?void 0:n[d],h=l==null?void 0:l[d];if(m===null)return null;const g=Mv(m)||Mv(h);return s[d][g]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,g]=m;return g===void 0||(d[h]=g),d},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:h,className:g,...v}=m;return Object.entries(v).every(S=>{let[w,b]=S;return Array.isArray(b)?b.includes({...l,...c}[w]):{...l,...c}[w]===b})?[...d,h,g]:d},[]);return Lv(e,a,f,n==null?void 0:n.class,n==null?void 0:n.className)},OM=TM("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono font-medium uppercase tracking-wide transition-colors",{variants:{variant:{default:"bg-fg text-bg",agent:"bg-agent/10 text-agent",muted:"bg-muted text-mutedfg"}},defaultVariants:{variant:"default"}});function PM({className:e,variant:t,...n}){return P.jsx("div",{className:ut(OM({variant:t}),e),...n})}const Rv={idle:{label:"idle",cls:"text-mutedfg"},running:{label:"running",cls:"text-run"},success:{label:"success",cls:"text-ok"},failed:{label:"failed",cls:"text-fail"}};function IM({node:e,onClose:t,agentDefaults:n,agents:i,status:s,output:l,error:a}){const c=(e==null?void 0:e.type)==="agent.run",f=(e==null?void 0:e.config)??{},d=f.agent?i==null?void 0:i[f.agent]:void 0,m=f.model??(d==null?void 0:d.model)??(n==null?void 0:n.model)??"claude-opus-4-8",h=!f.model,g=f.model?void 0:d!=null&&d.model?`from agent ${f.agent}`:"project default",v=f.effort??(d==null?void 0:d.effort)??(n==null?void 0:n.effort)??"high",S=!f.effort,w=f.effort?void 0:d!=null&&d.effort?`from agent ${f.agent}`:n!=null&&n.effort?"project default":"model default";return P.jsx(uM,{open:!!e,onOpenChange:b=>!b&&t(),children:P.jsxs(Mx,{side:"right",children:[P.jsx(Lx,{children:P.jsxs(Rx,{className:"flex items-center gap-2",children:[c&&P.jsx(PM,{variant:"agent",children:"agent"}),P.jsx("span",{className:c?"text-agent":void 0,children:e==null?void 0:e.id})]})}),P.jsx(Gx,{className:"flex-1 p-4",children:e&&P.jsxs("div",{className:"space-y-4",children:[P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),P.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),P.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),c&&P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),f.agent&&P.jsxs("div",{"data-testid":"agent-ref",className:"mt-1 mb-2 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:[f.agent,!d&&P.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),P.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[P.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),P.jsx("div",{className:"font-mono text-[12px] truncate",children:m}),h&&g&&P.jsx("div",{className:"text-[10px] text-mutedfg",children:g})]}),P.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),P.jsx("div",{className:"font-mono text-[12px]",children:v}),S&&w&&P.jsx("div",{className:"text-[10px] text-mutedfg",children:w})]})]}),(d==null?void 0:d.commands)&&d.commands.length>0&&P.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[P.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),P.jsx("div",{className:"mt-1 space-y-1",children:d.commands.map(b=>P.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[P.jsx("span",{className:"font-mono text-[12px]",children:b.name}),b.name===d.fallback&&P.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),b.description&&P.jsx("div",{className:"text-[11px] text-mutedfg",children:b.description})]},b.name))})]})]}),(s||l!==void 0||a)&&P.jsxs("div",{"data-testid":"node-last-run",children:[P.jsxs("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg flex items-center gap-2",children:["Last run",s&&P.jsx("span",{className:`text-[11px] font-medium ${Rv[s].cls}`,children:Rv[s].label})]}),a&&P.jsx("pre",{"data-testid":"node-output-error",className:"mt-1 text-[11px] font-mono text-fail bg-fail/5 rounded-md p-2.5 whitespace-pre-wrap break-words",children:a}),l!==void 0?P.jsx("pre",{"data-testid":"node-output",className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all max-h-80 overflow-y-auto",children:l}):!a&&P.jsx("div",{className:"mt-1 text-[11px] text-mutedfg px-1",children:"No output captured yet — run the workflow to see what this node fetches."})]}),P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),P.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all",children:JSON.stringify(e.config,null,2)})]}),e.retry&&P.jsxs("div",{children:[P.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),P.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[P.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",P.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),P.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[P.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",P.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}function AM(e){return e==="running"?"bg-run pulse-dot":e==="success"?"bg-ok":"bg-fail"}function MM(e){return e==="running"?"running":e==="success"?"success":"failed"}function LM(e){if(!e.finishedAt)return"…";const t=e.finishedAt-e.startedAt;return t>=1e3?`${(t/1e3).toFixed(1)}s`:`${t}ms`}function RM(e){const t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function DM({runs:e,connected:t}){return P.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[P.jsxs("header",{className:"h-12 shrink-0 bg-bg border-b border-border flex items-center px-4 gap-3",children:[P.jsx("h1",{className:"font-semibold tracking-tight",children:"Runs"}),P.jsx("span",{className:"text-[11px] text-mutedfg",children:"ephemeral activity stream · nothing persisted beyond the surfaces"}),P.jsxs("div",{className:"ml-auto flex items-center gap-1.5 text-[11px] text-mutedfg",children:[P.jsx("span",{"data-testid":"live-dot",className:ut("size-1.5 rounded-full",t?"bg-ok pulse-dot":"bg-border")}),t?"live":"offline"]})]}),P.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-2 max-w-3xl",children:[e.length===0&&P.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-4 text-center",children:t?"No runs yet — waiting for the scheduler…":"Connect a flow-server to see live runs."}),e.map(n=>P.jsxs("div",{"data-testid":"run-row","data-run-status":n.status,className:"bg-bg border border-border rounded-lg",children:[P.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[P.jsx("span",{className:ut("size-1.5 rounded-full flex-shrink-0",AM(n.status))}),P.jsx("span",{className:"font-medium",children:n.workflow}),P.jsxs("span",{className:"font-mono text-[11px] text-mutedfg",children:[n.id," · ",RM(n.startedAt),n.finishedAt&&` · ${LM(n)}`]}),P.jsx("span",{className:ut("ml-auto text-[11px] font-medium",n.status==="running"&&"text-run",n.status==="success"&&"text-ok",n.status==="failed"&&"text-fail"),children:MM(n.status)})]}),n.status==="failed"&&n.error&&P.jsx("div",{"data-testid":"run-error",className:"px-3 py-2 text-[11px] font-mono text-fail bg-fail/5 break-words",children:n.error})]},n.id))]})]})}const cp=Symbol.for("yaml.alias"),Eh=Symbol.for("yaml.document"),Or=Symbol.for("yaml.map"),Qx=Symbol.for("yaml.pair"),Mn=Symbol.for("yaml.scalar"),vo=Symbol.for("yaml.seq"),nn=Symbol.for("yaml.node.type"),wo=e=>!!e&&typeof e=="object"&&e[nn]===cp,Ou=e=>!!e&&typeof e=="object"&&e[nn]===Eh,Hs=e=>!!e&&typeof e=="object"&&e[nn]===Or,Ze=e=>!!e&&typeof e=="object"&&e[nn]===Qx,$e=e=>!!e&&typeof e=="object"&&e[nn]===Mn,qs=e=>!!e&&typeof e=="object"&&e[nn]===vo;function Qe(e){if(e&&typeof e=="object")switch(e[nn]){case Or:case vo:return!0}return!1}function Je(e){if(e&&typeof e=="object")switch(e[nn]){case cp:case Or:case Mn:case vo:return!0}return!1}const Jx=e=>($e(e)||Qe(e))&&!!e.anchor,Zr=Symbol("break visit"),jM=Symbol("skip children"),_s=Symbol("remove node");function xo(e,t){const n=$M(t);Ou(e)?Xi(null,e.contents,n,Object.freeze([e]))===_s&&(e.contents=null):Xi(null,e,n,Object.freeze([]))}xo.BREAK=Zr;xo.SKIP=jM;xo.REMOVE=_s;function Xi(e,t,n,i){const s=zM(e,t,n,i);if(Je(s)||Ze(s))return FM(e,i,s),Xi(e,s,n,i);if(typeof s!="symbol"){if(Qe(t)){i=Object.freeze(i.concat(t));for(let l=0;l<t.items.length;++l){const a=Xi(l,t.items[l],n,i);if(typeof a=="number")l=a-1;else{if(a===Zr)return Zr;a===_s&&(t.items.splice(l,1),l-=1)}}}else if(Ze(t)){i=Object.freeze(i.concat(t));const l=Xi("key",t.key,n,i);if(l===Zr)return Zr;l===_s&&(t.key=null);const a=Xi("value",t.value,n,i);if(a===Zr)return Zr;a===_s&&(t.value=null)}}return s}function $M(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 zM(e,t,n,i){var s,l,a,c,f;if(typeof n=="function")return n(e,t,i);if(Hs(t))return(s=n.Map)==null?void 0:s.call(n,e,t,i);if(qs(t))return(l=n.Seq)==null?void 0:l.call(n,e,t,i);if(Ze(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,i);if($e(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,i);if(wo(t))return(f=n.Alias)==null?void 0:f.call(n,e,t,i)}function FM(e,t,n){const i=t[t.length-1];if(Qe(i))i.items[e]=n;else if(Ze(i))e==="key"?i.key=n:i.value=n;else if(Ou(i))i.contents=n;else{const s=wo(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const BM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},VM=e=>e.replace(/[!,[\]{}]/g,t=>BM[t]);class St{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},St.defaultYaml,t),this.tags=Object.assign({},St.defaultTags,n)}clone(){const t=new St(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new St(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:St.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},St.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:St.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},St.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[l,a]=i;return this.tags[l]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[l]=i;if(l==="1.1"||l==="1.2")return this.yaml.version=l,!0;{const a=/^\d+\.\d+$/.test(l);return n(6,`Unsupported YAML version ${l}`,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[,i,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const l=this.tags[i];if(l)try{return l+decodeURIComponent(s)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+VM(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let s;if(t&&i.length>0&&Je(t.contents)){const l={};xo(t.contents,(a,c)=>{Je(c)&&c.tag&&(l[c.tag]=!0)}),s=Object.keys(l)}else s=[];for(const[l,a]of i)l==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${l} ${a}`);return n.join(`
|
|
128
|
+
`)}}St.defaultYaml={explicit:!1,version:"1.2"};St.defaultTags={"!!":"tag:yaml.org,2002:"};function Zx(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 eb(e){const t=new Set;return xo(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function tb(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function WM(e,t){const n=[],i=new Map;let s=null;return{onAnchor:l=>{n.push(l),s??(s=eb(e));const a=tb(t,s);return s.add(a),a},setAnchors:()=>{for(const l of n){const a=i.get(l);if(typeof a=="object"&&a.anchor&&($e(a.node)||Qe(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=l,c}}},sourceObjects:i}}function Qi(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let s=0,l=i.length;s<l;++s){const a=i[s],c=Qi(e,i,String(s),a);c===void 0?delete i[s]:c!==a&&(i[s]=c)}else if(i instanceof Map)for(const s of Array.from(i.keys())){const l=i.get(s),a=Qi(e,i,s,l);a===void 0?i.delete(s):a!==l&&i.set(s,a)}else if(i instanceof Set)for(const s of Array.from(i)){const l=Qi(e,i,s,s);l===void 0?i.delete(s):l!==s&&(i.delete(s),i.add(l))}else for(const[s,l]of Object.entries(i)){const a=Qi(e,i,s,l);a===void 0?delete i[s]:a!==l&&(i[s]=a)}return e.call(t,n,i)}function tn(e,t,n){if(Array.isArray(e))return e.map((i,s)=>tn(i,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!Jx(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=l=>{i.res=l,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 fp{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:i,onAnchor:s,reviver:l}={}){if(!Ou(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 i=="number"?i:100},c=tn(this,"",a);if(typeof s=="function")for(const{count:f,res:d}of a.anchors.values())s(d,f);return typeof l=="function"?Qi(l,{"":c},"",c):c}}class dp extends fp{constructor(t){super(cp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],xo(t,{Node:(l,a)=>{(wo(a)||Jx(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let s;for(const l of i){if(l===this)break;l.anchor===this.source&&(s=l)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:s,maxAliasCount:l}=n,a=this.resolve(s,n);if(!a){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=i.get(a);if(c||(tn(a,null,n),c=i.get(a)),(c==null?void 0:c.res)===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(l>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Ha(s,a,i)),c.count*c.aliasCount>l)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,i){const s=`*${this.source}`;if(t){if(Zx(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(l)}if(t.implicitKey)return`${s} `}return s}}function Ha(e,t,n){if(wo(t)){const i=t.resolve(e),s=n&&i&&n.get(i);return s?s.count*s.aliasCount:0}else if(Qe(t)){let i=0;for(const s of t.items){const l=Ha(e,s,n);l>i&&(i=l)}return i}else if(Ze(t)){const i=Ha(e,t.key,n),s=Ha(e,t.value,n);return Math.max(i,s)}return 1}const nb=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends fp{constructor(t){super(Mn),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tn(this.value,t,n)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const UM="tag:yaml.org,2002:";function HM(e,t,n){if(t){const i=n.filter(l=>l.tag===t),s=i.find(l=>!l.format)??i[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(i=>{var s;return((s=i.identify)==null?void 0:s.call(i,e))&&!i.format})}function js(e,t,n){var h,g,v;if(Ou(e)&&(e=e.contents),Je(e))return e;if(Ze(e)){const S=(g=(h=n.schema[Or]).createNode)==null?void 0:g.call(h,n.schema,null,n);return S.items.push(e),S}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:s,onTagObj:l,schema:a,sourceObjects:c}=n;let f;if(i&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=s(e)),new dp(f.anchor);f={anchor:null,node:null},c.set(e,f)}t!=null&&t.startsWith("!!")&&(t=UM+t.slice(2));let d=HM(e,t,a.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const S=new Te(e);return f&&(f.node=S),S}d=e instanceof Map?a[Or]:Symbol.iterator in Object(e)?a[vo]:a[Or]}l&&(l(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 Te(e);return t?m.tag=t:d.default||(m.tag=d.tag),f&&(f.node=m),m}function uu(e,t,n){let i=n;for(let s=t.length-1;s>=0;--s){const l=t[s];if(typeof l=="number"&&Number.isInteger(l)&&l>=0){const a=[];a[l]=i,i=a}else i=new Map([[l,i]])}return js(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ss=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class rb extends fp{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(i=>Je(i)||Ze(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ss(t))this.add(n);else{const[i,...s]=t,l=this.get(i,!0);if(Qe(l))l.addIn(s,n);else if(l===void 0&&this.schema)this.set(i,uu(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const s=this.get(n,!0);if(Qe(s))return s.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...s]=t,l=this.get(i,!0);return s.length===0?!n&&$e(l)?l.value:l:Qe(l)?l.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ze(n))return!1;const i=n.value;return i==null||t&&$e(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const s=this.get(n,!0);return Qe(s)?s.hasIn(i):!1}setIn(t,n){const[i,...s]=t;if(s.length===0)this.set(i,n);else{const l=this.get(i,!0);if(Qe(l))l.setIn(s,n);else if(l===void 0&&this.schema)this.set(i,uu(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}}const qM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ti=(e,t,n)=>e.endsWith(`
|
|
129
129
|
`)?Xn(n,t):n.includes(`
|
|
130
130
|
`)?`
|
|
131
|
-
`+Xn(n,t):(e.endsWith(" ")?"":" ")+n,
|
|
132
|
-
`)n===
|
|
133
|
-
`&&v!==" "){const
|
|
134
|
-
`&&
|
|
135
|
-
${t}${e.slice(0,
|
|
136
|
-
${t}${e.slice(
|
|
137
|
-
`);i=t,s=t+1,l=e[s]}return i}const Iu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Au=e=>/^(%|---|\.\.\.)/m.test(e);function
|
|
131
|
+
`+Xn(n,t):(e.endsWith(" ")?"":" ")+n,ib="flow",Nh="block",qa="quoted";function Pu(e,t,n="flow",{indentAtStart:i,lineWidth:s=80,minContentWidth:l=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<l&&(l=0);const f=Math.max(1+l,1+s-t.length);if(e.length<=f)return e;const d=[],m={};let h=s-t.length;typeof i=="number"&&(i>s-Math.max(2,l)?d.push(0):h=s-i);let g,v,S=!1,w=-1,b=-1,k=-1;n===Nh&&(w=Dv(e,w,t.length),w!==-1&&(h=w+f));for(let E;E=e[w+=1];){if(n===qa&&E==="\\"){switch(b=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(E===`
|
|
132
|
+
`)n===Nh&&(w=Dv(e,w,t.length)),h=w+t.length+f,g=void 0;else{if(E===" "&&v&&v!==" "&&v!==`
|
|
133
|
+
`&&v!==" "){const _=e[w+1];_&&_!==" "&&_!==`
|
|
134
|
+
`&&_!==" "&&(g=w)}if(w>=h)if(g)d.push(g),h=g+f,g=void 0;else if(n===qa){for(;v===" "||v===" ";)v=E,E=e[w+=1],S=!0;const _=w>k+1?w-2:b-1;if(m[_])return e;d.push(_),m[_]=!0,h=_+f,g=void 0}else S=!0}v=E}if(S&&c&&c(),d.length===0)return e;a&&a();let N=e.slice(0,d[0]);for(let E=0;E<d.length;++E){const _=d[E],A=d[E+1]||e.length;_===0?N=`
|
|
135
|
+
${t}${e.slice(0,A)}`:(n===qa&&m[_]&&(N+=`${e[_]}\\`),N+=`
|
|
136
|
+
${t}${e.slice(_+1,A)}`)}return N}function Dv(e,t,n){let i=t,s=t+1,l=e[s];for(;l===" "||l===" ";)if(t<s+n)l=e[++t];else{do l=e[++t];while(l&&l!==`
|
|
137
|
+
`);i=t,s=t+1,l=e[s]}return i}const Iu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Au=e=>/^(%|---|\.\.\.)/m.test(e);function YM(e,t,n){if(!t||t<0)return!1;const i=t-n,s=e.length;if(s<=i)return!1;for(let l=0,a=0;l<s;++l)if(e[l]===`
|
|
138
138
|
`){if(l-a>i)return!0;if(a=l+1,s-a<=i)return!1}return!0}function Cs(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,s=t.options.doubleQuotedMinMultiLineLength,l=t.indent||(Au(e)?" ":"");let a="",c=0;for(let f=0,d=n[f];d;d=n[++f])if(d===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(a+=n.slice(c,f)+"\\ ",f+=1,c=f,d="\\"),d==="\\")switch(n[f+1]){case"u":{a+=n.slice(c,f);const m=n.substr(f+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(f,6)}f+=5,c=f+1}break;case"n":if(i||n[f+2]==='"'||n.length<s)f+=1;else{for(a+=n.slice(c,f)+`
|
|
139
139
|
|
|
140
140
|
`;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)a+=`
|
|
141
|
-
`,f+=2;a+=l,n[f+2]===" "&&(a+="\\"),f+=1,c=f+1}break;default:f+=1}return a=c?a+n.slice(c):n,i?a:Pu(a,l,qa,Iu(t,!1))}function
|
|
141
|
+
`,f+=2;a+=l,n[f+2]===" "&&(a+="\\"),f+=1,c=f+1}break;default:f+=1}return a=c?a+n.slice(c):n,i?a:Pu(a,l,qa,Iu(t,!1))}function _h(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
142
142
|
`)||/[ \t]\n|\n[ \t]/.test(e))return Cs(e,t);const n=t.indent||(Au(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
143
|
-
${n}`)+"'";return t.implicitKey?i:Pu(i,n,
|
|
143
|
+
${n}`)+"'";return t.implicitKey?i:Pu(i,n,ib,Iu(t,!1))}function Ji(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=Cs;else{const s=e.includes('"'),l=e.includes("'");s&&!l?i=_h:l&&!s?i=Cs:i=n?_h:Cs}return i(e,t)}let Ch;try{Ch=new RegExp(`(^|(?<!
|
|
144
144
|
))
|
|
145
145
|
+(?!
|
|
146
|
-
|$)`,"g")}catch{Ch=/\n+(?!\n|$)/g}function Ya({comment:e,type:t,value:n},i,s,l){const{blockQuote:a,commentString:c,lineWidth:f}=i.options;if(!a||/\n[\t ]+$/.test(n))return Ji(n,i);const d=i.indent||(i.forceBlockIndent||Au(n)?" ":""),m=a==="literal"?!0:a==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!
|
|
146
|
+
|$)`,"g")}catch{Ch=/\n+(?!\n|$)/g}function Ya({comment:e,type:t,value:n},i,s,l){const{blockQuote:a,commentString:c,lineWidth:f}=i.options;if(!a||/\n[\t ]+$/.test(n))return Ji(n,i);const d=i.indent||(i.forceBlockIndent||Au(n)?" ":""),m=a==="literal"?!0:a==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!YM(n,f,d.length);if(!n)return m?`|
|
|
147
147
|
`:`>
|
|
148
|
-
`;let h,g;for(g=n.length;g>0;--g){const
|
|
149
|
-
`&&
|
|
148
|
+
`;let h,g;for(g=n.length;g>0;--g){const A=n[g-1];if(A!==`
|
|
149
|
+
`&&A!==" "&&A!==" ")break}let v=n.substring(g);const S=v.indexOf(`
|
|
150
150
|
`);S===-1?h="-":n===v||S!==v.length-1?(h="+",l&&l()):h="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
151
|
-
`&&(v=v.slice(0,-1)),v=v.replace(Ch,`$&${d}`));let w=!1,b,k=-1;for(b=0;b<n.length;++b){const
|
|
152
|
-
`)k=b;else break}let
|
|
153
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let M=!1;const
|
|
154
|
-
${d}${C}`}return n=n.replace(/\n+/g,`$&${d}`),`|${
|
|
155
|
-
${d}${
|
|
151
|
+
`&&(v=v.slice(0,-1)),v=v.replace(Ch,`$&${d}`));let w=!1,b,k=-1;for(b=0;b<n.length;++b){const A=n[b];if(A===" ")w=!0;else if(A===`
|
|
152
|
+
`)k=b;else break}let N=n.substring(0,k<b?k+1:b);N&&(n=n.substring(N.length),N=N.replace(/\n+/g,`$&${d}`));let _=(w?d?"2":"1":"")+h;if(e&&(_+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!m){const A=n.replace(/\n+/g,`
|
|
153
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let M=!1;const L=Iu(i,!0);a!=="folded"&&t!==Te.BLOCK_FOLDED&&(L.onOverflow=()=>{M=!0});const C=Pu(`${N}${A}${v}`,d,Nh,L);if(!M)return`>${_}
|
|
154
|
+
${d}${C}`}return n=n.replace(/\n+/g,`$&${d}`),`|${_}
|
|
155
|
+
${d}${N}${n}${v}`}function KM(e,t,n,i){const{type:s,value:l}=e,{actualString:a,implicitKey:c,indent:f,indentStep:d,inFlow:m}=t;if(c&&l.includes(`
|
|
156
156
|
`)||m&&/[[\]{},]/.test(l))return Ji(l,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(l))return c||m||!l.includes(`
|
|
157
157
|
`)?Ji(l,t):Ya(e,t,n,i);if(!c&&!m&&s!==Te.PLAIN&&l.includes(`
|
|
158
158
|
`))return Ya(e,t,n,i);if(Au(l)){if(f==="")return t.forceBlockIndent=!0,Ya(e,t,n,i);if(c&&f===d)return Ji(l,t)}const h=l.replace(/\n+/g,`$&
|
|
159
|
-
${f}`);if(a){const g=w=>{var b;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((b=w.test)==null?void 0:b.test(h))},{compat:v,tags:S}=t.doc.schema;if(S.some(g)||v!=null&&v.some(g))return Ji(l,t)}return c?h:Pu(h,f,
|
|
160
|
-
${t.indent}${c}`:c}function
|
|
161
|
-
${c}:`):(b=`${b}:`,g&&(b+=ti(b,n.indent,d(g))));let k,
|
|
162
|
-
`:"",
|
|
163
|
-
${Xn(
|
|
159
|
+
${f}`);if(a){const g=w=>{var b;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((b=w.test)==null?void 0:b.test(h))},{compat:v,tags:S}=t.doc.schema;if(S.some(g)||v!=null&&v.some(g))return Ji(l,t)}return c?h:Pu(h,f,ib,Iu(t,!1))}function hp(e,t,n,i){const{implicitKey:s,inFlow:l}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Te.QUOTE_DOUBLE);const f=m=>{switch(m){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return s||l?Ji(a.value,t):Ya(a,t,n,i);case Te.QUOTE_DOUBLE:return Cs(a.value,t);case Te.QUOTE_SINGLE:return _h(a.value,t);case Te.PLAIN:return KM(a,t,n,i);default:return null}};let d=f(c);if(d===null){const{defaultKeyType:m,defaultStringType:h}=t.options,g=s&&m||h;if(d=f(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function ob(e,t){const n=Object.assign({blockQuote:!0,commentString:qM,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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function GM(e,t){var s;if(t.tag){const l=e.filter(a=>a.tag===t.tag);if(l.length>0)return l.find(a=>a.format===t.format)??l[0]}let n,i;if($e(t)){i=t.value;let l=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,i)});if(l.length>1){const a=l.filter(c=>c.test);a.length>0&&(l=a)}n=l.find(a=>a.format===t.format)??l.find(a=>!a.format)}else i=t,n=e.find(l=>l.nodeClass&&i instanceof l.nodeClass);if(!n){const l=((s=i==null?void 0:i.constructor)==null?void 0:s.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${l} value`)}return n}function XM(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const s=[],l=($e(e)||Qe(e))&&e.anchor;l&&Zx(l)&&(n.add(l),s.push(`&${l}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(i.directives.tagString(a)),s.join(" ")}function mo(e,t,n,i){var f;if(Ze(e))return e.toString(t,n,i);if(wo(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.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 l=Je(e)?e:t.doc.createNode(e,{onTagObj:d=>s=d});s??(s=GM(t.doc.schema.tags,l));const a=XM(l,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(l,t,n,i):$e(l)?hp(l,t,n,i):l.toString(t,n,i);return a?$e(l)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
160
|
+
${t.indent}${c}`:c}function QM({key:e,value:t},n,i,s){const{allNullValues:l,doc:a,indent:c,indentStep:f,options:{commentString:d,indentSeq:m,simpleKeys:h}}=n;let g=Je(e)&&e.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Qe(e)||!Je(e)&&typeof e=="object"){const L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let v=!h&&(!e||g&&t==null&&!n.inFlow||Qe(e)||($e(e)?e.type===Te.BLOCK_FOLDED||e.type===Te.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(h||!l),indent:c+f});let S=!1,w=!1,b=mo(e,n,()=>S=!0,()=>w=!0);if(!v&&!n.inFlow&&b.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(l||t==null)return S&&i&&i(),b===""?"?":v?`? ${b}`:b}else if(l&&!h||t==null&&v)return b=`? ${b}`,g&&!S?b+=ti(b,n.indent,d(g)):w&&s&&s(),b;S&&(g=null),v?(g&&(b+=ti(b,n.indent,d(g))),b=`? ${b}
|
|
161
|
+
${c}:`):(b=`${b}:`,g&&(b+=ti(b,n.indent,d(g))));let k,N,E;Je(t)?(k=!!t.spaceBefore,N=t.commentBefore,E=t.comment):(k=!1,N=null,E=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!v&&!g&&$e(t)&&(n.indentAtStart=b.length+1),w=!1,!m&&f.length>=2&&!n.inFlow&&!v&&qs(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const A=mo(t,n,()=>_=!0,()=>w=!0);let M=" ";if(g||k||N){if(M=k?`
|
|
162
|
+
`:"",N){const L=d(N);M+=`
|
|
163
|
+
${Xn(L,n.indent)}`}A===""&&!n.inFlow?M===`
|
|
164
164
|
`&&E&&(M=`
|
|
165
165
|
|
|
166
166
|
`):M+=`
|
|
167
|
-
${n.indent}`}else if(!v&&Qe(t)){const
|
|
168
|
-
`),
|
|
169
|
-
${n.indent}`)}}else(
|
|
170
|
-
`)&&(M="");return b+=M+
|
|
167
|
+
${n.indent}`}else if(!v&&Qe(t)){const L=A[0],C=A.indexOf(`
|
|
168
|
+
`),I=C!==-1,F=n.inFlow??t.flow??t.items.length===0;if(I||!F){let R=!1;if(I&&(L==="&"||L==="!")){let $=A.indexOf(" ");L==="&"&&$!==-1&&$<C&&A[$+1]==="!"&&($=A.indexOf(" ",$+1)),($===-1||C<$)&&(R=!0)}R||(M=`
|
|
169
|
+
${n.indent}`)}}else(A===""||A[0]===`
|
|
170
|
+
`)&&(M="");return b+=M+A,n.inFlow?_&&i&&i():E&&!_?b+=ti(b,n.indent,d(E)):w&&s&&s(),b}function sb(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ma="<<",Jn={identify:e=>e===Ma||typeof e=="symbol"&&e.description===Ma,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(Ma)),{addToJSMap:lb}),stringify:()=>Ma},JM=(e,t)=>(Jn.identify(t)||$e(t)&&(!t.type||t.type===Te.PLAIN)&&Jn.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Jn.tag&&n.default));function lb(e,t,n){const i=ab(e,n);if(qs(i))for(const s of i.items)eh(e,t,s);else if(Array.isArray(i))for(const s of i)eh(e,t,s);else eh(e,t,i)}function eh(e,t,n){const i=ab(e,n);if(!Hs(i))throw new Error("Merge sources must be maps or map aliases");const s=i.toJSON(null,e,Map);for(const[l,a]of s)t instanceof Map?t.has(l)||t.set(l,a):t instanceof Set?t.add(l):Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function ab(e,t){return e&&wo(t)?t.resolve(e.doc,e):t}function ub(e,t,{key:n,value:i}){if(Je(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(JM(e,n))lb(e,t,i);else{const s=tn(n,"",e);if(t instanceof Map)t.set(s,tn(i,s,e));else if(t instanceof Set)t.add(s);else{const l=ZM(n,s,e),a=tn(i,l,e);l in t?Object.defineProperty(t,l,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[l]=a}}return t}function ZM(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Je(e)&&(n!=null&&n.doc)){const i=ob(n.doc,{});i.anchors=new Set;for(const l of n.anchors.keys())i.anchors.add(l.anchor);i.inFlow=!0,i.inStringifyKey=!0;const s=e.toString(i);if(!n.mapKeyWarned){let l=JSON.stringify(s);l.length>40&&(l=l.substring(0,36)+'..."'),sb(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${l}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function pp(e,t,n){const i=js(e,void 0,n),s=js(t,void 0,n);return new Et(i,s)}class Et{constructor(t,n=null){Object.defineProperty(this,nn,{value:Qx}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Je(n)&&(n=n.clone(t)),Je(i)&&(i=i.clone(t)),new Et(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return ub(n,i,this)}toString(t,n,i){return t!=null&&t.doc?QM(this,t,n,i):JSON.stringify(this)}}function cb(e,t,n){return(t.inFlow??e.flow?tL:eL)(e,t,n)}function eL({comment:e,items:t},n,{blockItemPrefix:i,flowChars:s,itemIndent:l,onChompKeep:a,onComment:c}){const{indent:f,options:{commentString:d}}=n,m=Object.assign({},n,{indent:l,type:null});let h=!1;const g=[];for(let S=0;S<t.length;++S){const w=t[S];let b=null;if(Je(w))!h&&w.spaceBefore&&g.push(""),cu(n,g,w.commentBefore,h),w.comment&&(b=w.comment);else if(Ze(w)){const N=Je(w.key)?w.key:null;N&&(!h&&N.spaceBefore&&g.push(""),cu(n,g,N.commentBefore,h))}h=!1;let k=mo(w,m,()=>b=null,()=>h=!0);b&&(k+=ti(k,l,d(b))),h&&b&&(h=!1),g.push(i+k)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let S=1;S<g.length;++S){const w=g[S];v+=w?`
|
|
171
171
|
${f}${w}`:`
|
|
172
172
|
`}}return e?(v+=`
|
|
173
|
-
`+Xn(d(e),f),c&&c()):h&&a&&a(),v}function
|
|
174
|
-
`)),S<e.length-1?k+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(d||(d=h.reduce((
|
|
173
|
+
`+Xn(d(e),f),c&&c()):h&&a&&a(),v}function tL({items:e},t,{flowChars:n,itemIndent:i}){const{indent:s,indentStep:l,flowCollectionPadding:a,options:{commentString:c}}=t;i+=l;const f=Object.assign({},t,{indent:i,inFlow:!0,type:null});let d=!1,m=0;const h=[];for(let S=0;S<e.length;++S){const w=e[S];let b=null;if(Je(w))w.spaceBefore&&h.push(""),cu(t,h,w.commentBefore,!1),w.comment&&(b=w.comment);else if(Ze(w)){const N=Je(w.key)?w.key:null;N&&(N.spaceBefore&&h.push(""),cu(t,h,N.commentBefore,!1),N.comment&&(d=!0));const E=Je(w.value)?w.value:null;E?(E.comment&&(b=E.comment),E.commentBefore&&(d=!0)):w.value==null&&(N!=null&&N.comment)&&(b=N.comment)}b&&(d=!0);let k=mo(w,f,()=>b=null);d||(d=h.length>m||k.includes(`
|
|
174
|
+
`)),S<e.length-1?k+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(d||(d=h.reduce((N,E)=>N+E.length+2,2)+(k.length+2)>t.options.lineWidth)),d&&(k+=",")),b&&(k+=ti(k,i,c(b))),h.push(k),m=h.length}const{start:g,end:v}=n;if(h.length===0)return g+v;if(!d){const S=h.reduce((w,b)=>w+b.length+2,2);d=t.options.lineWidth>0&&S>t.options.lineWidth}if(d){let S=g;for(const w of h)S+=w?`
|
|
175
175
|
${l}${s}${w}`:`
|
|
176
176
|
`;return`${S}
|
|
177
|
-
${s}${v}`}else return`${g}${a}${h.join(" ")}${a}${v}`}function cu({indent:e,options:{commentString:t}},n,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){const l=Xn(t(i),e);n.push(l.trimStart())}}function ni(e,t){const n=$e(t)?t.value:t;for(const i of e)if(Ze(i)&&(i.key===t||i.key===n||$e(i.key)&&i.key.value===n))return i}class en extends
|
|
178
|
-
`:" ")}return hp({comment:e,type:t,value:c},i,s,l)}};function
|
|
177
|
+
${s}${v}`}else return`${g}${a}${h.join(" ")}${a}${v}`}function cu({indent:e,options:{commentString:t}},n,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){const l=Xn(t(i),e);n.push(l.trimStart())}}function ni(e,t){const n=$e(t)?t.value:t;for(const i of e)if(Ze(i)&&(i.key===t||i.key===n||$e(i.key)&&i.key.value===n))return i}class en extends rb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Or,t),this.items=[]}static from(t,n,i){const{keepUndefined:s,replacer:l}=i,a=new this(t),c=(f,d)=>{if(typeof l=="function")d=l.call(n,f,d);else if(Array.isArray(l)&&!l.includes(f))return;(d!==void 0||s)&&a.items.push(pp(f,d,i))};if(n instanceof Map)for(const[f,d]of n)c(f,d);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let i;Ze(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Et(t,t==null?void 0:t.value):i=new Et(t.key,t.value);const s=ni(this.items,i.key),l=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${i.key} already set`);$e(s.value)&&nb(i.value)?s.value.value=i.value:s.value=i.value}else if(l){const c=this.items.findIndex(f=>l(i,f)<0);c===-1?this.items.push(i):this.items.splice(c,0,i)}else this.items.push(i)}delete(t){const n=ni(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=ni(this.items,t),s=i==null?void 0:i.value;return(!n&&$e(s)?s.value:s)??void 0}has(t){return!!ni(this.items,t)}set(t,n){this.add(new Et(t,n),!0)}toJSON(t,n,i){const s=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const l of this.items)ub(n,s,l);return s}toString(t,n,i){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Ze(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})),cb(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const bo={collection:"map",default:!0,nodeClass:en,tag:"tag:yaml.org,2002:map",resolve(e,t){return Hs(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>en.from(e,t,n)};class ci extends rb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(vo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=La(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=La(t);if(typeof i!="number")return;const s=this.items[i];return!n&&$e(s)?s.value:s}has(t){const n=La(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=La(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[i];$e(s)&&nb(n)?s.value=n:this.items[i]=n}toJSON(t,n){const i=[];n!=null&&n.onCreate&&n.onCreate(i);let s=0;for(const l of this.items)i.push(tn(l,String(s++),n));return i}toString(t,n,i){return t?cb(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:s}=i,l=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const f=n instanceof Set?c:String(a++);c=s.call(n,f,c)}l.items.push(js(c,void 0,i))}}return l}}function La(e){let t=$e(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const So={collection:"seq",default:!0,nodeClass:ci,tag:"tag:yaml.org,2002:seq",resolve(e,t){return qs(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ci.from(e,t,n)},Mu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),hp(e,t,n,i)}},Lu={identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:e},t)=>typeof e=="string"&&Lu.test.test(e)?e:t.options.nullStr},mp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Te(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&mp.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function xn({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const s=typeof i=="number"?i:Number(i);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let l=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(l)&&!l.includes("e")){let a=l.indexOf(".");a<0&&(a=l.length,l+=".");let c=t-(l.length-a-1);for(;c-- >0;)l+="0"}return l}const fb={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:xn},db={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():xn(e)}},hb={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 Te(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xn},Ru=e=>typeof e=="bigint"||Number.isInteger(e),gp=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function pb(e,t,n){const{value:i}=e;return Ru(i)&&i>=0?n+i.toString(t):xn(e)}const mb={identify:e=>Ru(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>gp(e,2,8,n),stringify:e=>pb(e,8,"0o")},gb={identify:Ru,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>gp(e,0,10,n),stringify:xn},yb={identify:e=>Ru(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>gp(e,2,16,n),stringify:e=>pb(e,16,"0x")},nL=[bo,So,Mu,Lu,mp,mb,gb,yb,fb,db,hb];function jv(e){return typeof e=="bigint"||Number.isInteger(e)}const Ra=({value:e})=>JSON.stringify(e),rL=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ra},{identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ra},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Ra},{identify:jv,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})=>jv(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:Ra}],iL={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},oL=[bo,So].concat(rL,iL),yp={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,"")),i=new Uint8Array(n.length);for(let s=0;s<n.length;++s)i[s]=n.charCodeAt(s);return i}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},i,s,l){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let f="";for(let d=0;d<a.length;++d)f+=String.fromCharCode(a[d]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Te.BLOCK_LITERAL),t!==Te.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),d=Math.ceil(c.length/f),m=new Array(d);for(let h=0,g=0;h<d;++h,g+=f)m[h]=c.substr(g,f);c=m.join(t===Te.BLOCK_LITERAL?`
|
|
178
|
+
`:" ")}return hp({comment:e,type:t,value:c},i,s,l)}};function vb(e,t){if(qs(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ze(i)){if(Hs(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const s=i.items[0]||new Et(new Te(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore}
|
|
179
179
|
${s.key.commentBefore}`:i.commentBefore),i.comment){const l=s.value??s.key;l.comment=l.comment?`${i.comment}
|
|
180
|
-
${l.comment}`:i.comment}i=s}e.items[n]=Ze(i)?i:new Et(i)}}else t("Expected a sequence for this tag");return e}function
|
|
180
|
+
${l.comment}`:i.comment}i=s}e.items[n]=Ze(i)?i:new Et(i)}}else t("Expected a sequence for this tag");return e}function wb(e,t,n){const{replacer:i}=n,s=new ci(e);s.tag="tag:yaml.org,2002:pairs";let l=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(l++),a));let c,f;if(Array.isArray(a))if(a.length===2)c=a[0],f=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],f=a[c];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else c=a;s.items.push(pp(c,f,n))}return s}const vp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:vb,createNode:wb};class no extends ci{constructor(){super(),this.add=en.prototype.add.bind(this),this.delete=en.prototype.delete.bind(this),this.get=en.prototype.get.bind(this),this.has=en.prototype.has.bind(this),this.set=en.prototype.set.bind(this),this.tag=no.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const s of this.items){let l,a;if(Ze(s)?(l=tn(s.key,"",n),a=tn(s.value,l,n)):l=tn(s,"",n),i.has(l))throw new Error("Ordered maps must not include duplicate keys");i.set(l,a)}return i}static from(t,n,i){const s=wb(t,n,i),l=new this;return l.items=s.items,l}}no.tag="tag:yaml.org,2002:omap";const wp={collection:"seq",identify:e=>e instanceof Map,nodeClass:no,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=vb(e,t),i=[];for(const{key:s}of n.items)$e(s)&&(i.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):i.push(s.value));return Object.assign(new no,n)},createNode:(e,t,n)=>no.from(e,t,n)};function xb({value:e,source:t},n){return t&&(e?bb:Sb).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const bb={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 Te(!0),stringify:xb},Sb={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 Te(!1),stringify:xb},sL={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:xn},lL={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():xn(e)}},aL={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 Te(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:xn},Ys=e=>typeof e=="bigint"||Number.isInteger(e);function Du(e,t,n,{intAsBigInt:i}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){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 l=parseInt(e,n);return s==="-"?-1*l:l}function xp(e,t,n){const{value:i}=e;if(Ys(i)){const s=i.toString(t);return i<0?"-"+n+s.substr(1):n+s}return xn(e)}const uL={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Du(e,2,2,n),stringify:e=>xp(e,2,"0b")},cL={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Du(e,1,8,n),stringify:e=>xp(e,8,"0")},fL={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Du(e,0,10,n),stringify:xn},dL={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Du(e,2,16,n),stringify:e=>xp(e,16,"0x")};class ro extends en{constructor(t){super(t),this.tag=ro.tag}add(t){let n;Ze(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Et(t.key,null):n=new Et(t,null),ni(this.items,n.key)||this.items.push(n)}get(t,n){const i=ni(this.items,t);return!n&&Ze(i)?$e(i.key)?i.key.value:i.key:i}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 i=ni(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Et(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:s}=i,l=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),l.items.push(pp(a,null,i));return l}}ro.tag="tag:yaml.org,2002:set";const bp={collection:"map",identify:e=>e instanceof Set,nodeClass:ro,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ro.from(e,t,n),resolve(e,t){if(Hs(e)){if(e.hasAllNullValues(!0))return Object.assign(new ro,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Sp(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),l=i.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*l:l}function kb(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return xn(e);let i="";t<0&&(i="-",t*=n(-1));const s=n(60),l=[t%s];return t<60?l.unshift(0):(t=(t-l[0])/s,l.unshift(t%s),t>=60&&(t=(t-l[0])/s,l.unshift(t))),i+l.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Eb={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})=>Sp(e,n),stringify:kb},Nb={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=>Sp(e,!1),stringify:kb},ju={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(ju.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,s,l,a,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let d=Date.UTC(n,i-1,s,l||0,a||0,c||0,f);const m=t[8];if(m&&m!=="Z"){let h=Sp(m,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},$v=[bo,So,Mu,Lu,bb,Sb,uL,cL,fL,dL,sL,lL,aL,yp,Jn,wp,vp,bp,Eb,Nb,ju],zv=new Map([["core",nL],["failsafe",[bo,So,Mu]],["json",oL],["yaml11",$v],["yaml-1.1",$v]]),Fv={binary:yp,bool:mp,float:hb,floatExp:db,floatNaN:fb,floatTime:Nb,int:gb,intHex:yb,intOct:mb,intTime:Eb,map:bo,merge:Jn,null:Lu,omap:wp,pairs:vp,seq:So,set:bp,timestamp:ju},hL={"tag:yaml.org,2002:binary":yp,"tag:yaml.org,2002:merge":Jn,"tag:yaml.org,2002:omap":wp,"tag:yaml.org,2002:pairs":vp,"tag:yaml.org,2002:set":bp,"tag:yaml.org,2002:timestamp":ju};function th(e,t,n){const i=zv.get(t);if(i&&!e)return n&&!i.includes(Jn)?i.concat(Jn):i.slice();let s=i;if(!s)if(Array.isArray(e))s=[];else{const l=Array.from(zv.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${l} or define customTags array`)}if(Array.isArray(e))for(const l of e)s=s.concat(l);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Jn)),s.reduce((l,a)=>{const c=typeof a=="string"?Fv[a]:a;if(!c){const f=JSON.stringify(a),d=Object.keys(Fv).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return l.includes(c)||l.push(c),l},[])}const pL=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class kp{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:s,schema:l,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?th(t,"compat"):t?th(null,t):null,this.name=typeof l=="string"&&l||"core",this.knownTags=s?hL:{},this.tags=th(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,Or,{value:bo}),Object.defineProperty(this,Mn,{value:Mu}),Object.defineProperty(this,vo,{value:So}),this.sortMapEntries=typeof a=="function"?a:a===!0?pL:null}clone(){const t=Object.create(kp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function mL(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const s=ob(e,t),{commentString:l}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=l(e.commentBefore);n.unshift(Xn(d,""))}let a=!1,c=null;if(e.contents){if(Je(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const h=l(e.contents.commentBefore);n.push(Xn(h,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>a=!0;let m=mo(e.contents,s,()=>c=null,d);c&&(m+=ti(m,"",l(c))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(mo(e.contents,s));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const d=l(e.comment);d.includes(`
|
|
181
181
|
`)?(n.push("..."),n.push(Xn(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(Xn(l(d),"")))}return n.join(`
|
|
182
182
|
`)+`
|
|
183
|
-
`}class $u{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,nn,{value:Eh});let s=null;typeof n=="function"||Array.isArray(n)?s=n:i===void 0&&n&&(i=n,n=void 0);const l=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=l;let{version:a}=l;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new St({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,s,i)}clone(){const t=Object.create($u.prototype,{[nn]:{value:Eh}});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=Je(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hi(this.contents)&&this.contents.add(t)}addIn(t,n){Hi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=
|
|
183
|
+
`}class $u{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,nn,{value:Eh});let s=null;typeof n=="function"||Array.isArray(n)?s=n:i===void 0&&n&&(i=n,n=void 0);const l=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=l;let{version:a}=l;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new St({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,s,i)}clone(){const t=Object.create($u.prototype,{[nn]:{value:Eh}});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=Je(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hi(this.contents)&&this.contents.add(t)}addIn(t,n){Hi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=eb(this);t.anchor=!n||i.has(n)?tb(n||"a",i):n}return new dp(t.anchor)}createNode(t,n,i){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const b=N=>typeof N=="number"||N instanceof String||N instanceof Number,k=n.filter(b).map(String);k.length>0&&(n=n.concat(k)),s=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:l,anchorPrefix:a,flow:c,keepUndefined:f,onTagObj:d,tag:m}=i??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=WM(this,a||"a"),S={aliasDuplicateObjects:l??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:d,replacer:s,schema:this.schema,sourceObjects:v},w=js(t,m,S);return c&&Qe(w)&&(w.flow=!0),g(),w}createPair(t,n,i={}){const s=this.createNode(t,null,i),l=this.createNode(n,null,i);return new Et(s,l)}delete(t){return Hi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ss(t)?this.contents==null?!1:(this.contents=null,!0):Hi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Qe(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ss(t)?!n&&$e(this.contents)?this.contents.value:this.contents:Qe(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Qe(this.contents)?this.contents.has(t):!1}hasIn(t){return Ss(t)?this.contents!==void 0:Qe(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=uu(this.schema,[t],n):Hi(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ss(t)?this.contents=n:this.contents==null?this.contents=uu(this.schema,Array.from(t),n):Hi(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new St({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new St({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=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(i)this.schema=new kp(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:s,onAnchor:l,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},f=tn(this.contents,n??"",c);if(typeof l=="function")for(const{count:d,res:m}of c.anchors.values())l(m,d);return typeof a=="function"?Qi(a,{"":f},"",f):f}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 mL(this,t)}}function Hi(e){if(Qe(e))return!0;throw new Error("Expected a YAML collection as document contents")}class _b extends Error{constructor(t,n,i,s){super(),this.name=t,this.code=i,this.message=s,this.pos=n}}class ks extends _b{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class gL extends _b{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Bv=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:i,col:s}=n.linePos[0];n.message+=` at line ${i}, column ${s}`;let l=s-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(l>=60&&a.length>80){const c=Math.min(l-39,a.length-79);a="…"+a.substring(c),l-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,l))){let c=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
184
184
|
`),a=c+a}if(/[^ ]/.test(a)){let c=1;const f=n.linePos[1];(f==null?void 0:f.line)===i&&f.col>s&&(c=Math.max(1,Math.min(f.col-s,80-l)));const d=" ".repeat(l)+"^".repeat(c);n.message+=`:
|
|
185
185
|
|
|
186
186
|
${a}
|
|
187
187
|
${d}
|
|
188
|
-
`}};function go(e,{flow:t,indicator:n,next:i,offset:s,onError:l,parentIndent:a,startOnNewline:c}){let f=!1,d=c,m=c,h="",g="",v=!1,S=!1,w=null,b=null,k=null,
|
|
189
|
-
`))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($s(t.key)||$s(t.value))return!0}return!1;default:return!0}}function Th(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&$s(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function
|
|
190
|
-
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||$s(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=b.found)==null?void 0:m.indent)!==i.indent&&s(f,"BAD_INDENT",
|
|
191
|
-
`+
|
|
192
|
-
`+
|
|
193
|
-
`+C:
|
|
194
|
-
`+F.comment:
|
|
195
|
-
`+k.comment:d.comment=k.comment),d.range=[i.offset,w,k.offset]}else d.range=[i.offset,w,w];return d}function ih(e,t,n,i,s,l){const a=n.type==="block-map"?
|
|
188
|
+
`}};function go(e,{flow:t,indicator:n,next:i,offset:s,onError:l,parentIndent:a,startOnNewline:c}){let f=!1,d=c,m=c,h="",g="",v=!1,S=!1,w=null,b=null,k=null,N=null,E=null,_=null,A=null;for(const C of e)switch(S&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&l(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),w&&(d&&C.type!=="comment"&&C.type!=="newline"&&l(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&C.source.includes(" ")&&(w=C),m=!0;break;case"comment":{m||l(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=C.source.substring(1)||" ";h?h+=g+I:h=I,g="",d=!1;break}case"newline":d?h?h+=C.source:(!_||n!=="seq-item-ind")&&(f=!0):g+=C.source,d=!0,v=!0,(b||k)&&(N=C),m=!0;break;case"anchor":b&&l(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&l(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=C,A??(A=C.offset),d=!1,m=!1,S=!0;break;case"tag":{k&&l(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,A??(A=C.offset),d=!1,m=!1,S=!0;break}case n:(b||k)&&l(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),_&&l(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),_=C,d=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){E&&l(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),E=C,d=!1,m=!1;break}default:l(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),d=!1,m=!1}const M=e[e.length-1],L=M?M.offset+M.source.length:s;return S&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&l(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(d&&w.indent<=a||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&l(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:_,spaceBefore:f,comment:h,hasNewline:v,anchor:b,tag:k,newlineAfterProp:N,end:L,start:A??L}}function $s(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
189
|
+
`))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($s(t.key)||$s(t.value))return!0}return!1;default:return!0}}function Th(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&$s(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Cb(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const s=typeof i=="function"?i:(l,a)=>l===a||$e(l)&&$e(a)&&l.value===a.value;return t.some(l=>s(l.key,n))}const Vv="All mapping items must start at the same column";function yL({composeNode:e,composeEmptyNode:t},n,i,s,l){var m;const a=(l==null?void 0:l.nodeClass)??en,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let f=i.offset,d=null;for(const h of i.items){const{start:g,key:v,sep:S,value:w}=h,b=go(g,{indicator:"explicit-key-ind",next:v??(S==null?void 0:S[0]),offset:f,onError:s,parentIndent:i.indent,startOnNewline:!0}),k=!b.found;if(k){if(v&&(v.type==="block-seq"?s(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==i.indent&&s(f,"BAD_INDENT",Vv)),!b.anchor&&!b.tag&&!S){d=b.end,b.comment&&(c.comment?c.comment+=`
|
|
190
|
+
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||$s(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=b.found)==null?void 0:m.indent)!==i.indent&&s(f,"BAD_INDENT",Vv);n.atKey=!0;const N=b.end,E=v?e(n,v,b,s):t(n,N,g,null,b,s);n.schema.compat&&Th(i.indent,v,s),n.atKey=!1,Cb(n,c.items,E)&&s(N,"DUPLICATE_KEY","Map keys must be unique");const _=go(S??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:s,parentIndent:i.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=_.end,_.found){k&&((w==null?void 0:w.type)==="block-map"&&!_.hasNewline&&s(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<_.found.offset-1024&&s(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=w?e(n,w,_,s):t(n,f,S,null,_,s);n.schema.compat&&Th(i.indent,w,s),f=A.range[2];const M=new Et(E,A);n.options.keepSourceTokens&&(M.srcToken=h),c.items.push(M)}else{k&&s(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(E.comment?E.comment+=`
|
|
191
|
+
`+_.comment:E.comment=_.comment);const A=new Et(E);n.options.keepSourceTokens&&(A.srcToken=h),c.items.push(A)}}return d&&d<f&&s(d,"IMPOSSIBLE","Map comment with trailing content"),c.range=[i.offset,f,d??f],c}function vL({composeNode:e,composeEmptyNode:t},n,i,s,l){const a=(l==null?void 0:l.nodeClass)??ci,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset,d=null;for(const{start:m,value:h}of i.items){const g=go(m,{indicator:"seq-item-ind",next:h,offset:f,onError:s,parentIndent:i.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)(h==null?void 0:h.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(f,"MISSING_CHAR","Sequence item without - indicator");else{d=g.end,g.comment&&(c.comment=g.comment);continue}const v=h?e(n,h,g,s):t(n,g.end,m,null,g,s);n.schema.compat&&Th(i.indent,h,s),f=v.range[2],c.items.push(v)}return c.range=[i.offset,f,d??f],c}function Ks(e,t,n,i){let s="";if(e){let l=!1,a="";for(const c of e){const{source:f,type:d}=c;switch(d){case"space":l=!0;break;case"comment":{n&&!l&&i(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=f.substring(1)||" ";s?s+=a+m:s=m,a="";break}case"newline":s&&(a+=f),l=!0;break;default:i(c,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}t+=f.length}}return{comment:s,offset:t}}const nh="Block collections are not allowed within flow collections",rh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function wL({composeNode:e,composeEmptyNode:t},n,i,s,l){var b;const a=i.start.source==="{",c=a?"flow map":"flow sequence",f=(l==null?void 0:l.nodeClass)??(a?en:ci),d=new f(n.schema);d.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let h=i.offset+i.start.source.length;for(let k=0;k<i.items.length;++k){const N=i.items[k],{start:E,key:_,sep:A,value:M}=N,L=go(E,{flow:c,indicator:"explicit-key-ind",next:_??(A==null?void 0:A[0]),offset:h,onError:s,parentIndent:i.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!A&&!M){k===0&&L.comma?s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):k<i.items.length-1&&s(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),L.comment&&(d.comment?d.comment+=`
|
|
192
|
+
`+L.comment:d.comment=L.comment),h=L.end;continue}!a&&n.options.strict&&$s(_)&&s(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)L.comma&&s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(L.comma||s(L.start,"MISSING_CHAR",`Missing , between ${c} items`),L.comment){let C="";e:for(const I of E)switch(I.type){case"comma":case"space":break;case"comment":C=I.source.substring(1);break e;default:break e}if(C){let I=d.items[d.items.length-1];Ze(I)&&(I=I.value??I.key),I.comment?I.comment+=`
|
|
193
|
+
`+C:I.comment=C,L.comment=L.comment.substring(C.length+1)}}if(!a&&!A&&!L.found){const C=M?e(n,M,L,s):t(n,L.end,A,null,L,s);d.items.push(C),h=C.range[2],rh(M)&&s(C.range,"BLOCK_IN_FLOW",nh)}else{n.atKey=!0;const C=L.end,I=_?e(n,_,L,s):t(n,C,E,null,L,s);rh(_)&&s(I.range,"BLOCK_IN_FLOW",nh),n.atKey=!1;const F=go(A??[],{flow:c,indicator:"map-value-ind",next:M,offset:I.range[2],onError:s,parentIndent:i.indent,startOnNewline:!1});if(F.found){if(!a&&!L.found&&n.options.strict){if(A)for(const Z of A){if(Z===F.found)break;if(Z.type==="newline"){s(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<F.found.offset-1024&&s(F.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&((b=M.source)==null?void 0:b[0])===":"?s(M,"MISSING_CHAR",`Missing space after : in ${c}`):s(F.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const R=M?e(n,M,F,s):F.found?t(n,F.end,A,null,F,s):null;R?rh(M)&&s(R.range,"BLOCK_IN_FLOW",nh):F.comment&&(I.comment?I.comment+=`
|
|
194
|
+
`+F.comment:I.comment=F.comment);const $=new Et(I,R);if(n.options.keepSourceTokens&&($.srcToken=N),a){const Z=d;Cb(n,Z.items,I)&&s(C,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push($)}else{const Z=new en(n.schema);Z.flow=!0,Z.items.push($);const j=(R??I).range;Z.range=[I.range[0],j[1],j[2]],d.items.push(Z)}h=R?R.range[2]:F.end}}const g=a?"}":"]",[v,...S]=i.end;let w=h;if((v==null?void 0:v.source)===g)w=v.offset+v.source.length;else{const k=c[0].toUpperCase()+c.substring(1),N=m?`${k} must end with a ${g}`:`${k} in block collection must be sufficiently indented and end with a ${g}`;s(h,m?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&S.unshift(v)}if(S.length>0){const k=Ks(S,w,n.options.strict,s);k.comment&&(d.comment?d.comment+=`
|
|
195
|
+
`+k.comment:d.comment=k.comment),d.range=[i.offset,w,k.offset]}else d.range=[i.offset,w,w];return d}function ih(e,t,n,i,s,l){const a=n.type==="block-map"?yL(e,t,n,i,l):n.type==="block-seq"?vL(e,t,n,i,l):wL(e,t,n,i,l),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function xL(e,t,n,i,s){var g;const l=i.tag,a=l?t.directives.tagName(l.source,v=>s(l,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:S}=i,w=v&&l?v.offset>l.offset?v:l:v??l;w&&(!S||S.offset<w.offset)&&s(w,"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(!l||!a||a==="!"||a===en.tagName&&c==="map"||a===ci.tagName&&c==="seq")return ih(e,t,n,s,a);let f=t.schema.tags.find(v=>v.tag===a&&v.collection===c);if(!f){const v=t.schema.knownTags[a];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?s(l,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):s(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),ih(e,t,n,s,a)}const d=ih(e,t,n,s,a,f),m=((g=f.resolve)==null?void 0:g.call(f,d,v=>s(l,"TAG_RESOLVE_FAILED",v),t.options))??d,h=Je(m)?m:new Te(m);return h.range=d.range,h.tag=a,f!=null&&f.format&&(h.format=f.format),h}function bL(e,t,n){const i=t.offset,s=SL(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[i,i,i]};const l=s.mode===">"?Te.BLOCK_FOLDED:Te.BLOCK_LITERAL,a=t.source?kL(t.source):[];let c=a.length;for(let w=a.length-1;w>=0;--w){const b=a[w][1];if(b===""||b==="\r")c=w;else break}if(c===0){const w=s.chomp==="+"&&a.length>0?`
|
|
196
196
|
`.repeat(Math.max(1,a.length-1)):"";let b=i+s.length;return t.source&&(b+=t.source.length),{value:w,type:l,comment:s.comment,range:[i,b,b]}}let f=t.indent+s.indent,d=t.offset+s.length,m=0;for(let w=0;w<c;++w){const[b,k]=a[w];if(k===""||k==="\r")s.indent===0&&b.length>f&&(f=b.length);else{b.length<f&&n(d+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(f=b.length),m=w,f===0&&!e.atRoot&&n(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=b.length+k.length+1}for(let w=a.length-1;w>=c;--w)a[w][0].length>f&&(c=w+1);let h="",g="",v=!1;for(let w=0;w<m;++w)h+=a[w][0].slice(f)+`
|
|
197
|
-
`;for(let w=m;w<c;++w){let[b,k]=a[w];d+=b.length+k.length+1;const
|
|
197
|
+
`;for(let w=m;w<c;++w){let[b,k]=a[w];d+=b.length+k.length+1;const N=k[k.length-1]==="\r";if(N&&(k=k.slice(0,-1)),k&&b.length<f){const _=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(d-k.length-(N?2:1),"BAD_INDENT",_),b=""}l===Te.BLOCK_LITERAL?(h+=g+b.slice(f)+k,g=`
|
|
198
198
|
`):b.length>f||k[0]===" "?(g===" "?g=`
|
|
199
199
|
`:!v&&g===`
|
|
200
200
|
`&&(g=`
|
|
@@ -207,38 +207,38 @@ ${d}
|
|
|
207
207
|
`+a[w][0].slice(f);h[h.length-1]!==`
|
|
208
208
|
`&&(h+=`
|
|
209
209
|
`);break;default:h+=`
|
|
210
|
-
`}const S=i+s.length+t.source.length;return{value:h,type:l,comment:s.comment,range:[i,S,S]}}function
|
|
210
|
+
`}const S=i+s.length+t.source.length;return{value:h,type:l,comment:s.comment,range:[i,S,S]}}function SL({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],l=s[0];let a=0,c="",f=-1;for(let g=1;g<s.length;++g){const v=s[g];if(!c&&(v==="-"||v==="+"))c=v;else{const S=Number(v);!a&&S?a=S:f===-1&&(f=e+g)}}f!==-1&&i(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let d=!1,m="",h=s.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":d=!0;case"newline":h+=v.source.length;break;case"comment":n&&!d&&i(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,m=v.source.substring(1);break;case"error":i(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{const S=`Unexpected token in block scalar header: ${v.type}`;i(v,"UNEXPECTED_TOKEN",S);const w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:l,indent:a,chomp:c,comment:m,length:h}}function kL(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),l=[i!=null&&i[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)l.push([t[a],t[a+1]]);return l}function EL(e,t,n){const{offset:i,type:s,source:l,end:a}=e;let c,f;const d=(g,v,S)=>n(i+g,v,S);switch(s){case"scalar":c=Te.PLAIN,f=NL(l,d);break;case"single-quoted-scalar":c=Te.QUOTE_SINGLE,f=_L(l,d);break;case"double-quoted-scalar":c=Te.QUOTE_DOUBLE,f=CL(l,d);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[i,i+l.length,i+l.length]}}const m=i+l.length,h=Ks(a,m,t,n);return{value:f,type:c,comment:h.comment,range:[i,m,h.offset]}}function NL(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}`),Tb(e)}function _L(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Tb(e.slice(1,-1)).replace(/''/g,"'")}function Tb(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
211
211
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
212
212
|
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let s=i[1],l=" ",a=t.lastIndex;for(n.lastIndex=a;i=n.exec(e);)i[1]===""?l===`
|
|
213
213
|
`?s+=l:l=`
|
|
214
|
-
`:(s+=l+i[1],l=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,i=c.exec(e),s+l+((i==null?void 0:i[1])??"")}function
|
|
214
|
+
`:(s+=l+i[1],l=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,i=c.exec(e),s+l+((i==null?void 0:i[1])??"")}function CL(e,t){let n="";for(let i=1;i<e.length-1;++i){const s=e[i];if(!(s==="\r"&&e[i+1]===`
|
|
215
215
|
`))if(s===`
|
|
216
|
-
`){const{fold:l,offset:a}=
|
|
216
|
+
`){const{fold:l,offset:a}=TL(e,i);n+=l,i=a}else if(s==="\\"){let l=e[++i];const a=OL[l];if(a)n+=a;else if(l===`
|
|
217
217
|
`)for(l=e[i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="\r"&&e[i+1]===`
|
|
218
|
-
`)for(l=e[++i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="x"||l==="u"||l==="U"){const c=l==="x"?2:l==="u"?4:8;n+=
|
|
218
|
+
`)for(l=e[++i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="x"||l==="u"||l==="U"){const c=l==="x"?2:l==="u"?4:8;n+=PL(e,i+1,c,t),i+=c}else{const c=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(s===" "||s===" "){const l=i;let a=e[i+1];for(;a===" "||a===" ";)a=e[++i+1];a!==`
|
|
219
219
|
`&&!(a==="\r"&&e[i+2]===`
|
|
220
|
-
`)&&(n+=i>l?e.slice(l,i+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function
|
|
220
|
+
`)&&(n+=i>l?e.slice(l,i+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function TL(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
|
|
221
221
|
`||i==="\r")&&!(i==="\r"&&e[t+2]!==`
|
|
222
222
|
`);)i===`
|
|
223
223
|
`&&(n+=`
|
|
224
|
-
`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const
|
|
225
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
224
|
+
`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const OL={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
225
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function PL(e,t,n,i){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(a)}catch{const c=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}}function Ob(e,t,n,i){const{value:s,type:l,comment:a,range:c}=t.type==="block-scalar"?bL(e,t,i):EL(t,e.options.strict,i),f=n?e.directives.tagName(n.source,h=>i(n,"TAG_RESOLVE_FAILED",h)):null;let d;e.options.stringKeys&&e.atKey?d=e.schema[Mn]:f?d=IL(e.schema,s,f,n,i):t.type==="scalar"?d=AL(e,s,t,i):d=e.schema[Mn];let m;try{const h=d.resolve(s,g=>i(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=$e(h)?h:new Te(h)}catch(h){const g=h instanceof Error?h.message:String(h);i(n??t,"TAG_RESOLVE_FAILED",g),m=new Te(s)}return m.range=c,m.source=s,l&&(m.type=l),f&&(m.tag=f),d.format&&(m.format=d.format),a&&(m.comment=a),m}function IL(e,t,n,i,s){var c;if(n==="!")return e[Mn];const l=[];for(const f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)l.push(f);else return f;for(const f of l)if((c=f.test)!=null&&c.test(t))return f;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Mn])}function AL({atKey:e,directives:t,schema:n},i,s,l){const a=n.tags.find(c=>{var f;return(c.default===!0||e&&c.default==="key")&&((f=c.test)==null?void 0:f.test(i))})||n[Mn];if(n.compat){const c=n.compat.find(f=>{var d;return f.default&&((d=f.test)==null?void 0:d.test(i))})??n[Mn];if(a.tag!==c.tag){const f=t.tagString(a.tag),d=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${d}`;l(s,"TAG_RESOLVE_FAILED",m,!0)}}return a}function ML(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let s=t[i];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++i];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++i];break}}return e}const LL={composeNode:Pb,composeEmptyNode:Ep};function Pb(e,t,n,i){const s=e.atKey,{spaceBefore:l,comment:a,anchor:c,tag:f}=n;let d,m=!0;switch(t.type){case"alias":d=RL(e,t,i),(c||f)&&i(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=Ob(e,t,f,i),c&&(d.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=xL(LL,e,t,n,i),c&&(d.anchor=c.source.substring(1))}catch(h){const g=h instanceof Error?h.message:String(h);i(t,"RESOURCE_EXHAUSTION",g)}break;default:{const h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",h),m=!1}}return d??(d=Ep(e,t.offset,void 0,null,n,i)),c&&d.anchor===""&&i(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!$e(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),l&&(d.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?d.comment=a:d.commentBefore=a),e.options.keepSourceTokens&&m&&(d.srcToken=t),d}function Ep(e,t,n,i,{spaceBefore:s,comment:l,anchor:a,tag:c,end:f},d){const m={type:"scalar",offset:ML(t,n,i),indent:-1,source:""},h=Ob(e,m,c,d);return a&&(h.anchor=a.source.substring(1),h.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(h.spaceBefore=!0),l&&(h.comment=l,h.range[2]=f),h}function RL({options:e},{offset:t,source:n,end:i},s){const l=new dp(n.substring(1));l.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),l.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=Ks(i,a,e.strict,s);return l.range=[t,a,c.offset],c.comment&&(l.comment=c.comment),l}function DL(e,t,{offset:n,start:i,value:s,end:l},a){const c=Object.assign({_directives:t},e),f=new $u(void 0,c),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=go(i,{indicator:"doc-start",next:s??(l==null?void 0:l[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(f.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")),f.contents=s?Pb(d,s,m,a):Ep(d,m.end,i,null,m,a);const h=f.contents.range[2],g=Ks(l,h,!1,a);return g.comment&&(f.comment=g.comment),f.range=[n,h,g.offset],f}function ys(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 Wv(e){var s;let t="",n=!1,i=!1;for(let l=0;l<e.length;++l){const a=e[l];switch(a[0]){case"#":t+=(t===""?"":i?`
|
|
226
226
|
|
|
227
227
|
`:`
|
|
228
|
-
`)+(a.substring(1)||" "),n=!0,i=!1;break;case"%":((s=e[l+1])==null?void 0:s[0])!=="#"&&(l+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class
|
|
228
|
+
`)+(a.substring(1)||" "),n=!0,i=!1;break;case"%":((s=e[l+1])==null?void 0:s[0])!=="#"&&(l+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class jL{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,s,l)=>{const a=ys(n);l?this.warnings.push(new gL(a,i,s)):this.errors.push(new ks(a,i,s))},this.directives=new St({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:s}=Wv(this.prelude);if(i){const l=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
229
229
|
${i}`:i;else if(s||t.directives.docStart||!l)t.commentBefore=i;else if(Qe(l)&&!l.flow&&l.items.length>0){let a=l.items[0];Ze(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${i}
|
|
230
230
|
${c}`:i}else{const a=l.commentBefore;l.commentBefore=a?`${i}
|
|
231
|
-
${a}`:i}}if(n){for(let l=0;l<this.errors.length;++l)t.errors.push(this.errors[l]);for(let l=0;l<this.warnings.length;++l)t.warnings.push(this.warnings[l])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
232
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ks(ys(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 i=Object.assign({_directives:this.directives},this.options),s=new $u(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const
|
|
231
|
+
${a}`:i}}if(n){for(let l=0;l<this.errors.length;++l)t.errors.push(this.errors[l]);for(let l=0;l<this.warnings.length;++l)t.warnings.push(this.warnings[l])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Wv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const s of t)yield*this.next(s);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,s)=>{const l=ys(t);l[0]+=n,this.onError(l,"BAD_DIRECTIVE",i,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=DL(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,i=new ks(ys(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new ks(ys(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=Ks(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
232
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ks(ys(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 i=Object.assign({_directives:this.directives},this.options),s=new $u(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const Ib="\uFEFF",Ab="",Mb="",Oh="";function $L(e){switch(e){case Ib:return"byte-order-mark";case Ab:return"doc-mode";case Mb:return"flow-error-end";case Oh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
233
233
|
`:case`\r
|
|
234
234
|
`: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 fn(e){switch(e){case void 0:case" ":case`
|
|
235
|
-
`:case"\r":case" ":return!0;default:return!1}}const
|
|
236
|
-
\r `),oh=e=>!e||
|
|
235
|
+
`:case"\r":case" ":return!0;default:return!1}}const Uv=new Set("0123456789ABCDEFabcdef"),zL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Da=new Set(",[]{}"),FL=new Set(` ,[]{}
|
|
236
|
+
\r `),oh=e=>!e||FL.has(e);class BL{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 i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
237
237
|
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
238
238
|
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const s=this.buffer[i+t+1];if(s===`
|
|
239
239
|
`||!s&&!this.atEnd)return t+i+1}return n===`
|
|
240
240
|
`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&fn(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(`
|
|
241
|
-
`,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]===
|
|
241
|
+
`,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]===Ib&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const l=t[i-1];if(l===" "||l===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const l=t[n-1];if(l===" "||l===" ")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 Ab,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==="...")&&fn(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&&!fn(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===":")&&fn(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}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(oh),"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,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&s[0]!=="#"||i===0&&(s.startsWith("---")||s.startsWith("..."))&&fn(s[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Mb,yield*this.parseLineStart();let l=0;for(;s[l]===",";)l+=yield*this.pushCount(1),l+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(l+=yield*this.pushIndicators(),s[l]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-l),"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(oh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||fn(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 l=0;for(;this.buffer[n-1-l]==="\\";)l+=1;if(l%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let s=i.indexOf(`
|
|
242
242
|
`,this.pos);if(s!==-1){for(;s!==-1;){const l=this.continueScalar(s+1);if(l===-1)break;s=i.indexOf(`
|
|
243
243
|
`,l)}s!==-1&&(n=s-(i[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=>fn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let l=this.pos;i=this.buffer[l];++l)switch(i){case" ":n+=1;break;case`
|
|
244
244
|
`:t=l,n=0;break;case"\r":{const a=this.buffer[l+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
@@ -248,13 +248,13 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
248
248
|
`&&l>=this.pos&&l+1+n>c)t=l;else break}while(!0);return yield Oh,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,s;for(;s=this.buffer[++i];)if(s===":"){const l=this.buffer[i+1];if(fn(l)||t&&Da.has(l))break;n=i}else if(fn(s)){let l=this.buffer[i+1];if(s==="\r"&&(l===`
|
|
249
249
|
`?(i+=1,s=`
|
|
250
250
|
`,l=this.buffer[i+1]):n=i),l==="#"||t&&Da.has(l))break;if(s===`
|
|
251
|
-
`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&Da.has(s))break;n=i}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Oh,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 i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(oh),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(fn(i)||n&&Da.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!fn(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(
|
|
251
|
+
`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&Da.has(s))break;n=i}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Oh,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 i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(oh),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(fn(i)||n&&Da.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!fn(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(zL.has(n))n=this.buffer[++t];else if(n==="%"&&Uv.has(this.buffer[t+1])&&Uv.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===`
|
|
252
252
|
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
253
|
-
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");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,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class
|
|
253
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");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,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class VL{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){const l=n+i>>1;this.lineStarts[l]<t?n=l+1:i=l}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 _r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Hv(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 Lb(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 ja(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 qi(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 fu(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function qv(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_r(t.start,"explicit-key-ind")&&!_r(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Lb(t.value)?t.value.end?fu(t.value.end,t.sep):t.value.end=t.sep:fu(t.start,t.sep),delete t.sep)}class WL{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 BL,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(t,n))yield*this.next(i);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=$L(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 i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,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 i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&qv(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const s=i.items[i.items.length-1];if(s.value){i.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=i.items[i.items.length-1];s.value?i.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=i.items[i.items.length-1];!s||s.value?i.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((i.type==="document"||i.type==="block-map"||i.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&&Hv(s.start)===-1&&(n.indent===0||s.start.every(l=>l.type!=="comment"||l.indent<n.indent))&&(i.type==="document"?i.end=s.start:i.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":{Hv(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=ja(this.peek(2)),i=qi(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}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(`
|
|
254
254
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
255
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;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,l=Array.isArray(s)?s[s.length-1]:void 0;(l==null?void 0:l.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],l=(i=s==null?void 0:s.value)==null?void 0:i.end;if(Array.isArray(l)){fu(l,n.start),l.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,l=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(l&&n.sep&&!n.value){const c=[];for(let f=0;f<n.sep.length;++f){const d=n.sep[f];switch(d.type){case"newline":c.push(f);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":l||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):l||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(
|
|
255
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;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,l=Array.isArray(s)?s[s.length-1]:void 0;(l==null?void 0:l.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],l=(i=s==null?void 0:s.value)==null?void 0:i.end;if(Array.isArray(l)){fu(l,n.start),l.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,l=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(l&&n.sep&&!n.value){const c=[];for(let f=0;f<n.sep.length;++f){const d=n.sep[f];switch(d.type){case"newline":c.push(f);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":l||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):l||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(_r(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(Lb(n.key)&&!_r(n.sep,"newline")){const c=qi(n.start),f=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:f,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(_r(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=qi(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||l?t.items.push({start:a,key:null,sep:[this.sourceToken]}):_r(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);l||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&&!_r(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 i;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,l=Array.isArray(s)?s[s.length-1]:void 0;(l==null?void 0:l.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],l=(i=s==null?void 0:s.value)==null?void 0:i.end;if(Array.isArray(l)){fu(l,n.start),l.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||_r(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 i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.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 i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const s=ja(i),l=qi(s);qv(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:l,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(`
|
|
256
256
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
257
|
-
`,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=ja(t),i=qi(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=ja(t),i=qi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.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
|
|
257
|
+
`,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=ja(t),i=qi(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=ja(t),i=qi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.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 UL(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new VL||null,prettyErrors:t}}function HL(e,t={}){const{lineCounter:n,prettyErrors:i}=UL(t),s=new WL(n==null?void 0:n.addNewLine),l=new jL(t);let a=null;for(const c of l.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new ks(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(Bv(e,n)),a.warnings.forEach(Bv(e,n))),a}function qL(e,t,n){let i;const s=HL(e,n);if(!s)return null;if(s.warnings.forEach(l=>sb(s.options.logLevel,l)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}const YL=`name: jpd-comment-triage
|
|
258
258
|
nodes:
|
|
259
259
|
- id: hourly
|
|
260
260
|
type: trigger.cron
|
|
@@ -295,4 +295,4 @@ edges:
|
|
|
295
295
|
- { from: unhandled, to: gate }
|
|
296
296
|
- { from: gate, to: interpret, when: "true" }
|
|
297
297
|
- { from: interpret, to: reply }
|
|
298
|
-
`;function
|
|
298
|
+
`;function KL(){const[e,t]=O.useState(null),[n,i]=O.useState(null),s=O.useCallback(c=>{try{const f=qL(c);t(f),i(null)}catch(f){i(f instanceof Error?f.message:"Failed to parse YAML")}},[]),l=O.useCallback(c=>{t(c),i(null)},[]),a=O.useCallback(()=>{s(YL)},[s]);return{workflow:e,error:n,loadFromString:s,loadFromObject:l,loadDefault:a}}function GL(e){const[t,n]=O.useState({}),[i,s]=O.useState({}),[l,a]=O.useState({}),[c,f]=O.useState([]),[d,m]=O.useState(!1),[h,g]=O.useState([]),v=O.useRef(0),S=O.useRef(null),w=O.useRef(null),b=O.useCallback(k=>{if(g(N=>[...N,k]),k.type==="run:start"){const N=`run_${(++v.current).toString(16).padStart(4,"0")}`;S.current=N,w.current=null,f(E=>[{id:N,workflow:k.workflow,status:"running",startedAt:k.ts},...E]),n({}),s({}),a({})}else if(k.type==="node:start"&&k.nodeId)n(N=>({...N,[k.nodeId]:"running"}));else if(k.type==="node:finish"&&k.nodeId){const N=k.status==="failed";n(_=>({..._,[k.nodeId]:N?"failed":"success"}));const E=k.meta;if((E==null?void 0:E.output)!==void 0&&a(_=>({..._,[k.nodeId]:E.output})),N){const _=E==null?void 0:E.error;_&&(s(A=>({...A,[k.nodeId]:_})),w.current||(w.current=`${k.nodeId}: ${_}`))}}else if(k.type==="run:finish"){const N=k.status==="failed"?"failed":"success",E=S.current,_=w.current??void 0;E&&f(A=>A.map(M=>M.id===E?{...M,status:N,finishedAt:k.ts,error:N==="failed"?_:void 0}:M))}},[]);return O.useEffect(()=>{if(!e)return;let k;try{k=new EventSource(`${e}/api/events`)}catch{return}return k.onopen=()=>m(!0),k.onmessage=N=>{try{const E=JSON.parse(N.data);b(E)}catch{}},k.onerror=()=>{m(!1)},()=>{k.close(),m(!1)}},[e,b]),{nodeStatuses:t,nodeErrors:i,nodeOutputs:l,runs:c,connected:d,events:h}}function XL(e){const[t,n]=O.useState([]);return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/workflows`).then(s=>s.ok?s.json():[]).then(s=>{!i&&Array.isArray(s)&&n(s)}).catch(()=>{}),()=>{i=!0}},[e]),{workflows:t}}function QL(e){const[t,n]=O.useState({});return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/config`).then(s=>s.ok?s.json():{}).then(s=>{!i&&s&&typeof s=="object"&&n(s)}).catch(()=>{}),()=>{i=!0}},[e]),t}function JL(e){const[t,n]=O.useState({});return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/agents`).then(s=>s.ok?s.json():[]).then(s=>{if(i||!Array.isArray(s))return;const l={};for(const a of s)l[a.name]=a;n(l)}).catch(()=>{}),()=>{i=!0}},[e]),t}async function ZL(e,t){await fetch(`${e}/api/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:t})})}const Yi=typeof window<"u"&&window.location.protocol.startsWith("http")?window.location.origin:void 0;function eR(){const{workflow:e,loadDefault:t,loadFromString:n,loadFromObject:i}=KL(),[s,l]=O.useState(null),[a,c]=O.useState("board"),[f,d]=O.useState(null),{nodeStatuses:m,nodeErrors:h,nodeOutputs:g,runs:v,connected:S,events:w}=GL(Yi),{workflows:b}=XL(Yi),k=QL(Yi),N=JL(Yi);O.useEffect(()=>{if(b.length===0){t();return}const L=b.find(C=>C.name===f)??b[0];L.name!==f&&d(L.name),i(L)},[b,f,t,i]);const E=O.useCallback(L=>{d(L)},[]),_=O.useCallback(L=>{Yi&&ZL(Yi,L)},[]),A=O.useCallback(L=>{l(L)},[]),M=O.useCallback(()=>{l(null)},[]);return P.jsxs("div",{className:"h-screen w-screen flex overflow-hidden bg-muted text-fg font-sans text-[13px] antialiased relative",children:[P.jsx(IP,{activeView:a,onViewChange:c,liveConnected:S,workflows:b,selected:f,onSelect:E,onRun:_,version:k.version}),P.jsx("main",{className:"flex-1 flex flex-col min-w-0",children:a==="board"?P.jsxs(P.Fragment,{children:[P.jsx(AP,{workflow:e,onLoadYaml:n}),P.jsx("div",{className:"flex-1 flex min-h-0",children:P.jsx(P1,{children:P.jsx(wI,{workflow:e,onNodeClick:A,onLoadYaml:n,nodeStatuses:m})})})]}):P.jsx(DM,{runs:v,events:w,connected:S})}),P.jsx(IM,{node:s,onClose:M,agentDefaults:k.agent,agents:N,status:s?m[s.id]:void 0,output:s?g[s.id]:void 0,error:s?h[s.id]:void 0})]})}Ek.createRoot(document.getElementById("root")).render(P.jsx(Ph.StrictMode,{children:P.jsx(eR,{})}));
|