@fieldwangai/agentflow 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,190 @@
1
+ var Q_=Object.defineProperty;var J_=(e,t,n)=>t in e?Q_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var wt=(e,t,n)=>J_(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var tc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vS={exports:{}},Gf={},bS={exports:{}},De={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var $c=Symbol.for("react.element"),Z_=Symbol.for("react.portal"),eI=Symbol.for("react.fragment"),tI=Symbol.for("react.strict_mode"),nI=Symbol.for("react.profiler"),rI=Symbol.for("react.provider"),iI=Symbol.for("react.context"),oI=Symbol.for("react.forward_ref"),sI=Symbol.for("react.suspense"),aI=Symbol.for("react.memo"),lI=Symbol.for("react.lazy"),Lw=Symbol.iterator;function cI(e){return e===null||typeof e!="object"?null:(e=Lw&&e[Lw]||e["@@iterator"],typeof e=="function"?e:null)}var SS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kS=Object.assign,NS={};function ka(e,t,n){this.props=e,this.context=t,this.refs=NS,this.updater=n||SS}ka.prototype.isReactComponent={};ka.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ka.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function CS(){}CS.prototype=ka.prototype;function cy(e,t,n){this.props=e,this.context=t,this.refs=NS,this.updater=n||SS}var uy=cy.prototype=new CS;uy.constructor=cy;kS(uy,ka.prototype);uy.isPureReactComponent=!0;var Ow=Array.isArray,ES=Object.prototype.hasOwnProperty,dy={current:null},jS={key:!0,ref:!0,__self:!0,__source:!0};function PS(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)ES.call(t,r)&&!jS.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:$c,type:e,key:o,ref:s,props:i,_owner:dy.current}}function uI(e,t){return{$$typeof:$c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function fy(e){return typeof e=="object"&&e!==null&&e.$$typeof===$c}function dI(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mw=/\/+/g;function lh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dI(""+e.key):t.toString(36)}function Ed(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case $c:case Z_:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+lh(s,0):r,Ow(i)?(n="",e!=null&&(n=e.replace(Mw,"$&/")+"/"),Ed(i,t,n,"",function(u){return u})):i!=null&&(fy(i)&&(i=uI(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Mw,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Ow(e))for(var a=0;a<e.length;a++){o=e[a];var c=r+lh(o,a);s+=Ed(o,t,n,c,i)}else if(c=cI(e),typeof c=="function")for(e=c.call(e),a=0;!(o=e.next()).done;)o=o.value,c=r+lh(o,a++),s+=Ed(o,t,n,c,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function zu(e,t,n){if(e==null)return e;var r=[],i=0;return Ed(e,r,"","",function(o){return t.call(n,o,i++)}),r}function fI(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var an={current:null},jd={transition:null},pI={ReactCurrentDispatcher:an,ReactCurrentBatchConfig:jd,ReactCurrentOwner:dy};function _S(){throw Error("act(...) is not supported in production builds of React.")}De.Children={map:zu,forEach:function(e,t,n){zu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zu(e,function(){t++}),t},toArray:function(e){return zu(e,function(t){return t})||[]},only:function(e){if(!fy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};De.Component=ka;De.Fragment=eI;De.Profiler=nI;De.PureComponent=cy;De.StrictMode=tI;De.Suspense=sI;De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pI;De.act=_S;De.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=kS({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=dy.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)ES.call(t,c)&&!jS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:$c,type:e.type,key:i,ref:o,props:r,_owner:s}};De.createContext=function(e){return e={$$typeof:iI,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rI,_context:e},e.Consumer=e};De.createElement=PS;De.createFactory=function(e){var t=PS.bind(null,e);return t.type=e,t};De.createRef=function(){return{current:null}};De.forwardRef=function(e){return{$$typeof:oI,render:e}};De.isValidElement=fy;De.lazy=function(e){return{$$typeof:lI,_payload:{_status:-1,_result:e},_init:fI}};De.memo=function(e,t){return{$$typeof:aI,type:e,compare:t===void 0?null:t}};De.startTransition=function(e){var t=jd.transition;jd.transition={};try{e()}finally{jd.transition=t}};De.unstable_act=_S;De.useCallback=function(e,t){return an.current.useCallback(e,t)};De.useContext=function(e){return an.current.useContext(e)};De.useDebugValue=function(){};De.useDeferredValue=function(e){return an.current.useDeferredValue(e)};De.useEffect=function(e,t){return an.current.useEffect(e,t)};De.useId=function(){return an.current.useId()};De.useImperativeHandle=function(e,t,n){return an.current.useImperativeHandle(e,t,n)};De.useInsertionEffect=function(e,t){return an.current.useInsertionEffect(e,t)};De.useLayoutEffect=function(e,t){return an.current.useLayoutEffect(e,t)};De.useMemo=function(e,t){return an.current.useMemo(e,t)};De.useReducer=function(e,t,n){return an.current.useReducer(e,t,n)};De.useRef=function(e){return an.current.useRef(e)};De.useState=function(e){return an.current.useState(e)};De.useSyncExternalStore=function(e,t,n){return an.current.useSyncExternalStore(e,t,n)};De.useTransition=function(){return an.current.useTransition()};De.version="18.3.1";bS.exports=De;var w=bS.exports;const Ne=oo(w);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var hI=w,mI=Symbol.for("react.element"),gI=Symbol.for("react.fragment"),yI=Object.prototype.hasOwnProperty,xI=hI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,wI={key:!0,ref:!0,__self:!0,__source:!0};function IS(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)yI.call(t,r)&&!wI.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:mI,type:e,key:o,ref:s,props:i,_owner:xI.current}}Gf.Fragment=gI;Gf.jsx=IS;Gf.jsxs=IS;vS.exports=Gf;var l=vS.exports,Sm={},AS={exports:{}},Mn={},TS={exports:{}},RS={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(I,A){var E=I.length;I.push(A);e:for(;0<E;){var z=E-1>>>1,U=I[z];if(0<i(U,A))I[z]=A,I[E]=U,E=z;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var A=I[0],E=I.pop();if(E!==A){I[0]=E;e:for(var z=0,U=I.length,O=U>>>1;z<O;){var q=2*(z+1)-1,Z=I[q],te=q+1,ae=I[te];if(0>i(Z,E))te<U&&0>i(ae,Z)?(I[z]=ae,I[te]=E,z=te):(I[z]=Z,I[q]=E,z=q);else if(te<U&&0>i(ae,E))I[z]=ae,I[te]=E,z=te;else break e}}return A}function i(I,A){var E=I.sortIndex-A.sortIndex;return E!==0?E:I.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],p=1,d=null,f=3,h=!1,m=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(I){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=I)r(u),A.sortIndex=A.expirationTime,t(c,A);else break;A=n(u)}}function N(I){if(b=!1,y(I),!m)if(n(c)!==null)m=!0,F(j);else{var A=n(u);A!==null&&$(N,A.startTime-I)}}function j(I,A){m=!1,b&&(b=!1,g(R),R=-1),h=!0;var E=f;try{for(y(A),d=n(c);d!==null&&(!(d.expirationTime>A)||I&&!P());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var U=z(d.expirationTime<=A);A=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(c)&&r(c),y(A)}else r(c);d=n(c)}if(d!==null)var O=!0;else{var q=n(u);q!==null&&$(N,q.startTime-A),O=!1}return O}finally{d=null,f=E,h=!1}}var k=!1,_=null,R=-1,M=5,H=-1;function P(){return!(e.unstable_now()-H<M)}function T(){if(_!==null){var I=e.unstable_now();H=I;var A=!0;try{A=_(!0,I)}finally{A?V():(k=!1,_=null)}}else k=!1}var V;if(typeof v=="function")V=function(){v(T)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,B=L.port2;L.port1.onmessage=T,V=function(){B.postMessage(null)}}else V=function(){S(T,0)};function F(I){_=I,k||(k=!0,V())}function $(I,A){R=S(function(){I(e.unstable_now())},A)}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(I){I.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,F(j))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(I){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var E=f;f=A;try{return I()}finally{f=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,A){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var E=f;f=I;try{return A()}finally{f=E}},e.unstable_scheduleCallback=function(I,A,E){var z=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?z+E:z):E=z,I){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=E+U,I={id:p++,callback:A,priorityLevel:I,startTime:E,expirationTime:U,sortIndex:-1},E>z?(I.sortIndex=E,t(u,I),n(c)===null&&I===n(u)&&(b?(g(R),R=-1):b=!0,$(N,E-z))):(I.sortIndex=U,t(c,I),m||h||(m=!0,F(j))),I},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(I){var A=f;return function(){var E=f;f=A;try{return I.apply(this,arguments)}finally{f=E}}}})(RS);TS.exports=RS;var vI=TS.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bI=w,Ln=vI;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var LS=new Set,nc={};function ts(e,t){ra(e,t),ra(e+"Capture",t)}function ra(e,t){for(nc[e]=t,e=0;e<t.length;e++)LS.add(t[e])}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),km=Object.prototype.hasOwnProperty,SI=/^[: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]*$/,Dw={},Fw={};function kI(e){return km.call(Fw,e)?!0:km.call(Dw,e)?!1:SI.test(e)?Fw[e]=!0:(Dw[e]=!0,!1)}function NI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CI(e,t,n,r){if(t===null||typeof t>"u"||NI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ln(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ut[e]=new ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ut[t]=new ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ut[e]=new ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ut[e]=new ln(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ut[e]=new ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ut[e]=new ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ut[e]=new ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ut[e]=new ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ut[e]=new ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var py=/[\-:]([a-z])/g;function hy(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(py,hy);Ut[t]=new ln(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(py,hy);Ut[t]=new ln(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(py,hy);Ut[t]=new ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ut[e]=new ln(e,1,!1,e.toLowerCase(),null,!1,!1)});Ut.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ut[e]=new ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function my(e,t,n,r){var i=Ut.hasOwnProperty(t)?Ut[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(CI(t,n,i,r)&&(n=null),r||i===null?kI(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var bi=bI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bu=Symbol.for("react.element"),Ps=Symbol.for("react.portal"),_s=Symbol.for("react.fragment"),gy=Symbol.for("react.strict_mode"),Nm=Symbol.for("react.profiler"),OS=Symbol.for("react.provider"),MS=Symbol.for("react.context"),yy=Symbol.for("react.forward_ref"),Cm=Symbol.for("react.suspense"),Em=Symbol.for("react.suspense_list"),xy=Symbol.for("react.memo"),Ri=Symbol.for("react.lazy"),DS=Symbol.for("react.offscreen"),$w=Symbol.iterator;function hl(e){return e===null||typeof e!="object"?null:(e=$w&&e[$w]||e["@@iterator"],typeof e=="function"?e:null)}var gt=Object.assign,ch;function Al(e){if(ch===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ch=t&&t[1]||""}return`
34
+ `+ch+e}var uh=!1;function dh(e,t){if(!e||uh)return"";uh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var c=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=a);break}}}finally{uh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Al(e):""}function EI(e){switch(e.tag){case 5:return Al(e.type);case 16:return Al("Lazy");case 13:return Al("Suspense");case 19:return Al("SuspenseList");case 0:case 2:case 15:return e=dh(e.type,!1),e;case 11:return e=dh(e.type.render,!1),e;case 1:return e=dh(e.type,!0),e;default:return""}}function jm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _s:return"Fragment";case Ps:return"Portal";case Nm:return"Profiler";case gy:return"StrictMode";case Cm:return"Suspense";case Em:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case MS:return(e.displayName||"Context")+".Consumer";case OS:return(e._context.displayName||"Context")+".Provider";case yy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xy:return t=e.displayName||null,t!==null?t:jm(e.type)||"Memo";case Ri:t=e._payload,e=e._init;try{return jm(e(t))}catch{}}return null}function jI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jm(t);case 8:return t===gy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Zi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function FS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PI(e){var t=FS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hu(e){e._valueTracker||(e._valueTracker=PI(e))}function $S(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=FS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Pm(e,t){var n=t.checked;return gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Zi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zS(e,t){t=t.checked,t!=null&&my(e,"checked",t,!1)}function _m(e,t){zS(e,t);var n=Zi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Im(e,t.type,n):t.hasOwnProperty("defaultValue")&&Im(e,t.type,Zi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Im(e,t,n){(t!=="number"||Gd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tl=Array.isArray;function Ks(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Zi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Am(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return gt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Hw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ne(92));if(Tl(n)){if(1<n.length)throw Error(ne(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zi(n)}}function BS(e,t){var n=Zi(t.value),r=Zi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Uw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function HS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Tm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?HS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Uu,US=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Uu=Uu||document.createElement("div"),Uu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Uu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fl={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},_I=["Webkit","ms","Moz","O"];Object.keys(Fl).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fl[t]=Fl[e]})});function VS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fl.hasOwnProperty(e)&&Fl[e]?(""+t).trim():t+"px"}function WS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=VS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var II=gt({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 Rm(e,t){if(t){if(II[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function Lm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Om=null;function wy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mm=null,Ys=null,qs=null;function Vw(e){if(e=Hc(e)){if(typeof Mm!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=ep(t),Mm(e.stateNode,e.type,t))}}function KS(e){Ys?qs?qs.push(e):qs=[e]:Ys=e}function YS(){if(Ys){var e=Ys,t=qs;if(qs=Ys=null,Vw(e),t)for(e=0;e<t.length;e++)Vw(t[e])}}function qS(e,t){return e(t)}function GS(){}var fh=!1;function XS(e,t,n){if(fh)return e(t,n);fh=!0;try{return qS(e,t,n)}finally{fh=!1,(Ys!==null||qs!==null)&&(GS(),YS())}}function ic(e,t){var n=e.stateNode;if(n===null)return null;var r=ep(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ne(231,t,typeof n));return n}var Dm=!1;if(hi)try{var ml={};Object.defineProperty(ml,"passive",{get:function(){Dm=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{Dm=!1}function AI(e,t,n,r,i,o,s,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var $l=!1,Xd=null,Qd=!1,Fm=null,TI={onError:function(e){$l=!0,Xd=e}};function RI(e,t,n,r,i,o,s,a,c){$l=!1,Xd=null,AI.apply(TI,arguments)}function LI(e,t,n,r,i,o,s,a,c){if(RI.apply(this,arguments),$l){if($l){var u=Xd;$l=!1,Xd=null}else throw Error(ne(198));Qd||(Qd=!0,Fm=u)}}function ns(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function QS(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ww(e){if(ns(e)!==e)throw Error(ne(188))}function OI(e){var t=e.alternate;if(!t){if(t=ns(e),t===null)throw Error(ne(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ww(i),e;if(o===r)return Ww(i),t;o=o.sibling}throw Error(ne(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(ne(189))}}if(n.alternate!==r)throw Error(ne(190))}if(n.tag!==3)throw Error(ne(188));return n.stateNode.current===n?e:t}function JS(e){return e=OI(e),e!==null?ZS(e):null}function ZS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ZS(e);if(t!==null)return t;e=e.sibling}return null}var ek=Ln.unstable_scheduleCallback,Kw=Ln.unstable_cancelCallback,MI=Ln.unstable_shouldYield,DI=Ln.unstable_requestPaint,kt=Ln.unstable_now,FI=Ln.unstable_getCurrentPriorityLevel,vy=Ln.unstable_ImmediatePriority,tk=Ln.unstable_UserBlockingPriority,Jd=Ln.unstable_NormalPriority,$I=Ln.unstable_LowPriority,nk=Ln.unstable_IdlePriority,Xf=null,$r=null;function zI(e){if($r&&typeof $r.onCommitFiberRoot=="function")try{$r.onCommitFiberRoot(Xf,e,void 0,(e.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:UI,BI=Math.log,HI=Math.LN2;function UI(e){return e>>>=0,e===0?32:31-(BI(e)/HI|0)|0}var Vu=64,Wu=4194304;function Rl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Rl(a):(o&=s,o!==0&&(r=Rl(o)))}else s=n&~i,s!==0?r=Rl(s):o!==0&&(r=Rl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-pr(t),i=1<<n,r|=e[n],t&=~i;return r}function VI(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function WI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-pr(o),a=1<<s,c=i[s];c===-1?(!(a&n)||a&r)&&(i[s]=VI(a,t)):c<=t&&(e.expiredLanes|=a),o&=~a}}function $m(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function rk(){var e=Vu;return Vu<<=1,!(Vu&4194240)&&(Vu=64),e}function ph(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function zc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pr(t),e[t]=n}function KI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-pr(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function by(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-pr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Qe=0;function ik(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ok,Sy,sk,ak,lk,zm=!1,Ku=[],Ui=null,Vi=null,Wi=null,oc=new Map,sc=new Map,Mi=[],YI="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 Yw(e,t){switch(e){case"focusin":case"focusout":Ui=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":oc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":sc.delete(t.pointerId)}}function gl(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Hc(t),t!==null&&Sy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function qI(e,t,n,r,i){switch(t){case"focusin":return Ui=gl(Ui,e,t,n,r,i),!0;case"dragenter":return Vi=gl(Vi,e,t,n,r,i),!0;case"mouseover":return Wi=gl(Wi,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return oc.set(o,gl(oc.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,sc.set(o,gl(sc.get(o)||null,e,t,n,r,i)),!0}return!1}function ck(e){var t=Lo(e.target);if(t!==null){var n=ns(t);if(n!==null){if(t=n.tag,t===13){if(t=QS(n),t!==null){e.blockedOn=t,lk(e.priority,function(){sk(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Om=r,n.target.dispatchEvent(r),Om=null}else return t=Hc(n),t!==null&&Sy(t),e.blockedOn=n,!1;t.shift()}return!0}function qw(e,t,n){Pd(e)&&n.delete(t)}function GI(){zm=!1,Ui!==null&&Pd(Ui)&&(Ui=null),Vi!==null&&Pd(Vi)&&(Vi=null),Wi!==null&&Pd(Wi)&&(Wi=null),oc.forEach(qw),sc.forEach(qw)}function yl(e,t){e.blockedOn===t&&(e.blockedOn=null,zm||(zm=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,GI)))}function ac(e){function t(i){return yl(i,e)}if(0<Ku.length){yl(Ku[0],e);for(var n=1;n<Ku.length;n++){var r=Ku[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ui!==null&&yl(Ui,e),Vi!==null&&yl(Vi,e),Wi!==null&&yl(Wi,e),oc.forEach(t),sc.forEach(t),n=0;n<Mi.length;n++)r=Mi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Mi.length&&(n=Mi[0],n.blockedOn===null);)ck(n),n.blockedOn===null&&Mi.shift()}var Gs=bi.ReactCurrentBatchConfig,ef=!0;function XI(e,t,n,r){var i=Qe,o=Gs.transition;Gs.transition=null;try{Qe=1,ky(e,t,n,r)}finally{Qe=i,Gs.transition=o}}function QI(e,t,n,r){var i=Qe,o=Gs.transition;Gs.transition=null;try{Qe=4,ky(e,t,n,r)}finally{Qe=i,Gs.transition=o}}function ky(e,t,n,r){if(ef){var i=Bm(e,t,n,r);if(i===null)kh(e,t,r,tf,n),Yw(e,r);else if(qI(i,e,t,n,r))r.stopPropagation();else if(Yw(e,r),t&4&&-1<YI.indexOf(e)){for(;i!==null;){var o=Hc(i);if(o!==null&&ok(o),o=Bm(e,t,n,r),o===null&&kh(e,t,r,tf,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else kh(e,t,r,null,n)}}var tf=null;function Bm(e,t,n,r){if(tf=null,e=wy(r),e=Lo(e),e!==null)if(t=ns(e),t===null)e=null;else if(n=t.tag,n===13){if(e=QS(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return tf=e,null}function uk(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(FI()){case vy:return 1;case tk:return 4;case Jd:case $I:return 16;case nk:return 536870912;default:return 16}default:return 16}}var $i=null,Ny=null,_d=null;function dk(){if(_d)return _d;var e,t=Ny,n=t.length,r,i="value"in $i?$i.value:$i.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return _d=i.slice(e,1<r?1-r:void 0)}function Id(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yu(){return!0}function Gw(){return!1}function Dn(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Yu:Gw,this.isPropagationStopped=Gw,this}return gt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yu)},persist:function(){},isPersistent:Yu}),t}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cy=Dn(Na),Bc=gt({},Na,{view:0,detail:0}),JI=Dn(Bc),hh,mh,xl,Qf=gt({},Bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ey,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xl&&(xl&&e.type==="mousemove"?(hh=e.screenX-xl.screenX,mh=e.screenY-xl.screenY):mh=hh=0,xl=e),hh)},movementY:function(e){return"movementY"in e?e.movementY:mh}}),Xw=Dn(Qf),ZI=gt({},Qf,{dataTransfer:0}),e2=Dn(ZI),t2=gt({},Bc,{relatedTarget:0}),gh=Dn(t2),n2=gt({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),r2=Dn(n2),i2=gt({},Na,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),o2=Dn(i2),s2=gt({},Na,{data:0}),Qw=Dn(s2),a2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l2={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"},c2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=c2[e])?!!t[e]:!1}function Ey(){return u2}var d2=gt({},Bc,{key:function(e){if(e.key){var t=a2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Id(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?l2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ey,charCode:function(e){return e.type==="keypress"?Id(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Id(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),f2=Dn(d2),p2=gt({},Qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jw=Dn(p2),h2=gt({},Bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ey}),m2=Dn(h2),g2=gt({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),y2=Dn(g2),x2=gt({},Qf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),w2=Dn(x2),v2=[9,13,27,32],jy=hi&&"CompositionEvent"in window,zl=null;hi&&"documentMode"in document&&(zl=document.documentMode);var b2=hi&&"TextEvent"in window&&!zl,fk=hi&&(!jy||zl&&8<zl&&11>=zl),Zw=" ",e0=!1;function pk(e,t){switch(e){case"keyup":return v2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Is=!1;function S2(e,t){switch(e){case"compositionend":return hk(t);case"keypress":return t.which!==32?null:(e0=!0,Zw);case"textInput":return e=t.data,e===Zw&&e0?null:e;default:return null}}function k2(e,t){if(Is)return e==="compositionend"||!jy&&pk(e,t)?(e=dk(),_d=Ny=$i=null,Is=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fk&&t.locale!=="ko"?null:t.data;default:return null}}var N2={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 t0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!N2[e.type]:t==="textarea"}function mk(e,t,n,r){KS(r),t=nf(t,"onChange"),0<t.length&&(n=new Cy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bl=null,lc=null;function C2(e){Ek(e,0)}function Jf(e){var t=Rs(e);if($S(t))return e}function E2(e,t){if(e==="change")return t}var gk=!1;if(hi){var yh;if(hi){var xh="oninput"in document;if(!xh){var n0=document.createElement("div");n0.setAttribute("oninput","return;"),xh=typeof n0.oninput=="function"}yh=xh}else yh=!1;gk=yh&&(!document.documentMode||9<document.documentMode)}function r0(){Bl&&(Bl.detachEvent("onpropertychange",yk),lc=Bl=null)}function yk(e){if(e.propertyName==="value"&&Jf(lc)){var t=[];mk(t,lc,e,wy(e)),XS(C2,t)}}function j2(e,t,n){e==="focusin"?(r0(),Bl=t,lc=n,Bl.attachEvent("onpropertychange",yk)):e==="focusout"&&r0()}function P2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jf(lc)}function _2(e,t){if(e==="click")return Jf(t)}function I2(e,t){if(e==="input"||e==="change")return Jf(t)}function A2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mr=typeof Object.is=="function"?Object.is:A2;function cc(e,t){if(mr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!km.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function i0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o0(e,t){var n=i0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=i0(n)}}function xk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wk(){for(var e=window,t=Gd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gd(e.document)}return t}function Py(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function T2(e){var t=wk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xk(n.ownerDocument.documentElement,n)){if(r!==null&&Py(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=o0(n,o);var s=o0(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var R2=hi&&"documentMode"in document&&11>=document.documentMode,As=null,Hm=null,Hl=null,Um=!1;function s0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Um||As==null||As!==Gd(r)||(r=As,"selectionStart"in r&&Py(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hl&&cc(Hl,r)||(Hl=r,r=nf(Hm,"onSelect"),0<r.length&&(t=new Cy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=As)))}function qu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:qu("Animation","AnimationEnd"),animationiteration:qu("Animation","AnimationIteration"),animationstart:qu("Animation","AnimationStart"),transitionend:qu("Transition","TransitionEnd")},wh={},vk={};hi&&(vk=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function Zf(e){if(wh[e])return wh[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in vk)return wh[e]=t[n];return e}var bk=Zf("animationend"),Sk=Zf("animationiteration"),kk=Zf("animationstart"),Nk=Zf("transitionend"),Ck=new Map,a0="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 so(e,t){Ck.set(e,t),ts(t,[e])}for(var vh=0;vh<a0.length;vh++){var bh=a0[vh],L2=bh.toLowerCase(),O2=bh[0].toUpperCase()+bh.slice(1);so(L2,"on"+O2)}so(bk,"onAnimationEnd");so(Sk,"onAnimationIteration");so(kk,"onAnimationStart");so("dblclick","onDoubleClick");so("focusin","onFocus");so("focusout","onBlur");so(Nk,"onTransitionEnd");ra("onMouseEnter",["mouseout","mouseover"]);ra("onMouseLeave",["mouseout","mouseover"]);ra("onPointerEnter",["pointerout","pointerover"]);ra("onPointerLeave",["pointerout","pointerover"]);ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ts("onBeforeInput",["compositionend","keypress","textInput","paste"]);ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="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(" "),M2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ll));function l0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,LI(r,t,void 0,e),e.currentTarget=null}function Ek(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==o&&i.isPropagationStopped())break e;l0(i,a,u),o=c}else for(s=0;s<r.length;s++){if(a=r[s],c=a.instance,u=a.currentTarget,a=a.listener,c!==o&&i.isPropagationStopped())break e;l0(i,a,u),o=c}}}if(Qd)throw e=Fm,Qd=!1,Fm=null,e}function rt(e,t){var n=t[qm];n===void 0&&(n=t[qm]=new Set);var r=e+"__bubble";n.has(r)||(jk(t,e,2,!1),n.add(r))}function Sh(e,t,n){var r=0;t&&(r|=4),jk(n,e,r,t)}var Gu="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[Gu]){e[Gu]=!0,LS.forEach(function(n){n!=="selectionchange"&&(M2.has(n)||Sh(n,!1,e),Sh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gu]||(t[Gu]=!0,Sh("selectionchange",!1,t))}}function jk(e,t,n,r){switch(uk(t)){case 1:var i=XI;break;case 4:i=QI;break;default:i=ky}n=i.bind(null,t,n,e),i=void 0,!Dm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function kh(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;a!==null;){if(s=Lo(a),s===null)return;if(c=s.tag,c===5||c===6){r=o=s;continue e}a=a.parentNode}}r=r.return}XS(function(){var u=o,p=wy(n),d=[];e:{var f=Ck.get(e);if(f!==void 0){var h=Cy,m=e;switch(e){case"keypress":if(Id(n)===0)break e;case"keydown":case"keyup":h=f2;break;case"focusin":m="focus",h=gh;break;case"focusout":m="blur",h=gh;break;case"beforeblur":case"afterblur":h=gh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Xw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=e2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=m2;break;case bk:case Sk:case kk:h=r2;break;case Nk:h=y2;break;case"scroll":h=JI;break;case"wheel":h=w2;break;case"copy":case"cut":case"paste":h=o2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Jw}var b=(t&4)!==0,S=!b&&e==="scroll",g=b?f!==null?f+"Capture":null:f;b=[];for(var v=u,y;v!==null;){y=v;var N=y.stateNode;if(y.tag===5&&N!==null&&(y=N,g!==null&&(N=ic(v,g),N!=null&&b.push(dc(v,N,y)))),S)break;v=v.return}0<b.length&&(f=new h(f,m,null,n,p),d.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Om&&(m=n.relatedTarget||n.fromElement)&&(Lo(m)||m[mi]))break e;if((h||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?Lo(m):null,m!==null&&(S=ns(m),m!==S||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(b=Xw,N="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=Jw,N="onPointerLeave",g="onPointerEnter",v="pointer"),S=h==null?f:Rs(h),y=m==null?f:Rs(m),f=new b(N,v+"leave",h,n,p),f.target=S,f.relatedTarget=y,N=null,Lo(p)===u&&(b=new b(g,v+"enter",m,n,p),b.target=y,b.relatedTarget=S,N=b),S=N,h&&m)t:{for(b=h,g=m,v=0,y=b;y;y=vs(y))v++;for(y=0,N=g;N;N=vs(N))y++;for(;0<v-y;)b=vs(b),v--;for(;0<y-v;)g=vs(g),y--;for(;v--;){if(b===g||g!==null&&b===g.alternate)break t;b=vs(b),g=vs(g)}b=null}else b=null;h!==null&&c0(d,f,h,b,!1),m!==null&&S!==null&&c0(d,S,m,b,!0)}}e:{if(f=u?Rs(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var j=E2;else if(t0(f))if(gk)j=I2;else{j=P2;var k=j2}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=_2);if(j&&(j=j(e,u))){mk(d,j,n,p);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Im(f,"number",f.value)}switch(k=u?Rs(u):window,e){case"focusin":(t0(k)||k.contentEditable==="true")&&(As=k,Hm=u,Hl=null);break;case"focusout":Hl=Hm=As=null;break;case"mousedown":Um=!0;break;case"contextmenu":case"mouseup":case"dragend":Um=!1,s0(d,n,p);break;case"selectionchange":if(R2)break;case"keydown":case"keyup":s0(d,n,p)}var _;if(jy)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Is?pk(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(fk&&n.locale!=="ko"&&(Is||R!=="onCompositionStart"?R==="onCompositionEnd"&&Is&&(_=dk()):($i=p,Ny="value"in $i?$i.value:$i.textContent,Is=!0)),k=nf(u,R),0<k.length&&(R=new Qw(R,e,null,n,p),d.push({event:R,listeners:k}),_?R.data=_:(_=hk(n),_!==null&&(R.data=_)))),(_=b2?S2(e,n):k2(e,n))&&(u=nf(u,"onBeforeInput"),0<u.length&&(p=new Qw("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=_))}Ek(d,t)})}function dc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function nf(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=ic(e,n),o!=null&&r.unshift(dc(e,o,i)),o=ic(e,t),o!=null&&r.push(dc(e,o,i))),e=e.return}return r}function vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function c0(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,i?(c=ic(n,o),c!=null&&s.unshift(dc(n,c,a))):i||(c=ic(n,o),c!=null&&s.push(dc(n,c,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var D2=/\r\n?/g,F2=/\u0000|\uFFFD/g;function u0(e){return(typeof e=="string"?e:""+e).replace(D2,`
38
+ `).replace(F2,"")}function Xu(e,t,n){if(t=u0(t),u0(e)!==t&&n)throw Error(ne(425))}function rf(){}var Vm=null,Wm=null;function Km(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ym=typeof setTimeout=="function"?setTimeout:void 0,$2=typeof clearTimeout=="function"?clearTimeout:void 0,d0=typeof Promise=="function"?Promise:void 0,z2=typeof queueMicrotask=="function"?queueMicrotask:typeof d0<"u"?function(e){return d0.resolve(null).then(e).catch(B2)}:Ym;function B2(e){setTimeout(function(){throw e})}function Nh(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ac(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ac(t)}function Ki(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function f0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ca=Math.random().toString(36).slice(2),Or="__reactFiber$"+Ca,fc="__reactProps$"+Ca,mi="__reactContainer$"+Ca,qm="__reactEvents$"+Ca,H2="__reactListeners$"+Ca,U2="__reactHandles$"+Ca;function Lo(e){var t=e[Or];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mi]||n[Or]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=f0(e);e!==null;){if(n=e[Or])return n;e=f0(e)}return t}e=n,n=e.parentNode}return null}function Hc(e){return e=e[Or]||e[mi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function ep(e){return e[fc]||null}var Gm=[],Ls=-1;function ao(e){return{current:e}}function ot(e){0>Ls||(e.current=Gm[Ls],Gm[Ls]=null,Ls--)}function tt(e,t){Ls++,Gm[Ls]=e.current,e.current=t}var eo={},Zt=ao(eo),wn=ao(!1),Vo=eo;function ia(e,t){var n=e.type.contextTypes;if(!n)return eo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function vn(e){return e=e.childContextTypes,e!=null}function of(){ot(wn),ot(Zt)}function p0(e,t,n){if(Zt.current!==eo)throw Error(ne(168));tt(Zt,t),tt(wn,n)}function Pk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ne(108,jI(e)||"Unknown",i));return gt({},n,r)}function sf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||eo,Vo=Zt.current,tt(Zt,e),tt(wn,wn.current),!0}function h0(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=Pk(e,t,Vo),r.__reactInternalMemoizedMergedChildContext=e,ot(wn),ot(Zt),tt(Zt,e)):ot(wn),tt(wn,n)}var oi=null,tp=!1,Ch=!1;function _k(e){oi===null?oi=[e]:oi.push(e)}function V2(e){tp=!0,_k(e)}function lo(){if(!Ch&&oi!==null){Ch=!0;var e=0,t=Qe;try{var n=oi;for(Qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}oi=null,tp=!1}catch(i){throw oi!==null&&(oi=oi.slice(e+1)),ek(vy,lo),i}finally{Qe=t,Ch=!1}}return null}var Os=[],Ms=0,af=null,lf=0,Wn=[],Kn=0,Wo=null,li=1,ci="";function Io(e,t){Os[Ms++]=lf,Os[Ms++]=af,af=e,lf=t}function Ik(e,t,n){Wn[Kn++]=li,Wn[Kn++]=ci,Wn[Kn++]=Wo,Wo=e;var r=li;e=ci;var i=32-pr(r)-1;r&=~(1<<i),n+=1;var o=32-pr(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,li=1<<32-pr(t)+i|n<<i|r,ci=o+e}else li=1<<o|n<<i|r,ci=e}function _y(e){e.return!==null&&(Io(e,1),Ik(e,1,0))}function Iy(e){for(;e===af;)af=Os[--Ms],Os[Ms]=null,lf=Os[--Ms],Os[Ms]=null;for(;e===Wo;)Wo=Wn[--Kn],Wn[Kn]=null,ci=Wn[--Kn],Wn[Kn]=null,li=Wn[--Kn],Wn[Kn]=null}var Tn=null,In=null,ct=!1,lr=null;function Ak(e,t){var n=Gn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function m0(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Tn=e,In=Ki(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Tn=e,In=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wo!==null?{id:li,overflow:ci}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Gn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Tn=e,In=null,!0):!1;default:return!1}}function Xm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qm(e){if(ct){var t=In;if(t){var n=t;if(!m0(e,t)){if(Xm(e))throw Error(ne(418));t=Ki(n.nextSibling);var r=Tn;t&&m0(e,t)?Ak(r,n):(e.flags=e.flags&-4097|2,ct=!1,Tn=e)}}else{if(Xm(e))throw Error(ne(418));e.flags=e.flags&-4097|2,ct=!1,Tn=e}}}function g0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Tn=e}function Qu(e){if(e!==Tn)return!1;if(!ct)return g0(e),ct=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Km(e.type,e.memoizedProps)),t&&(t=In)){if(Xm(e))throw Tk(),Error(ne(418));for(;t;)Ak(e,t),t=Ki(t.nextSibling)}if(g0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){In=Ki(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}In=null}}else In=Tn?Ki(e.stateNode.nextSibling):null;return!0}function Tk(){for(var e=In;e;)e=Ki(e.nextSibling)}function oa(){In=Tn=null,ct=!1}function Ay(e){lr===null?lr=[e]:lr.push(e)}var W2=bi.ReactCurrentBatchConfig;function wl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ne(309));var r=n.stateNode}if(!r)throw Error(ne(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,e))}return e}function Ju(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function y0(e){var t=e._init;return t(e._payload)}function Rk(e){function t(g,v){if(e){var y=g.deletions;y===null?(g.deletions=[v],g.flags|=16):y.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function i(g,v){return g=Xi(g,v),g.index=0,g.sibling=null,g}function o(g,v,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<v?(g.flags|=2,v):y):(g.flags|=2,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,v,y,N){return v===null||v.tag!==6?(v=Th(y,g.mode,N),v.return=g,v):(v=i(v,y),v.return=g,v)}function c(g,v,y,N){var j=y.type;return j===_s?p(g,v,y.props.children,N,y.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ri&&y0(j)===v.type)?(N=i(v,y.props),N.ref=wl(g,v,y),N.return=g,N):(N=Dd(y.type,y.key,y.props,null,g.mode,N),N.ref=wl(g,v,y),N.return=g,N)}function u(g,v,y,N){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=Rh(y,g.mode,N),v.return=g,v):(v=i(v,y.children||[]),v.return=g,v)}function p(g,v,y,N,j){return v===null||v.tag!==7?(v=$o(y,g.mode,N,j),v.return=g,v):(v=i(v,y),v.return=g,v)}function d(g,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Th(""+v,g.mode,y),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Bu:return y=Dd(v.type,v.key,v.props,null,g.mode,y),y.ref=wl(g,null,v),y.return=g,y;case Ps:return v=Rh(v,g.mode,y),v.return=g,v;case Ri:var N=v._init;return d(g,N(v._payload),y)}if(Tl(v)||hl(v))return v=$o(v,g.mode,y,null),v.return=g,v;Ju(g,v)}return null}function f(g,v,y,N){var j=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return j!==null?null:a(g,v,""+y,N);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Bu:return y.key===j?c(g,v,y,N):null;case Ps:return y.key===j?u(g,v,y,N):null;case Ri:return j=y._init,f(g,v,j(y._payload),N)}if(Tl(y)||hl(y))return j!==null?null:p(g,v,y,N,null);Ju(g,y)}return null}function h(g,v,y,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return g=g.get(y)||null,a(v,g,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Bu:return g=g.get(N.key===null?y:N.key)||null,c(v,g,N,j);case Ps:return g=g.get(N.key===null?y:N.key)||null,u(v,g,N,j);case Ri:var k=N._init;return h(g,v,y,k(N._payload),j)}if(Tl(N)||hl(N))return g=g.get(y)||null,p(v,g,N,j,null);Ju(v,N)}return null}function m(g,v,y,N){for(var j=null,k=null,_=v,R=v=0,M=null;_!==null&&R<y.length;R++){_.index>R?(M=_,_=null):M=_.sibling;var H=f(g,_,y[R],N);if(H===null){_===null&&(_=M);break}e&&_&&H.alternate===null&&t(g,_),v=o(H,v,R),k===null?j=H:k.sibling=H,k=H,_=M}if(R===y.length)return n(g,_),ct&&Io(g,R),j;if(_===null){for(;R<y.length;R++)_=d(g,y[R],N),_!==null&&(v=o(_,v,R),k===null?j=_:k.sibling=_,k=_);return ct&&Io(g,R),j}for(_=r(g,_);R<y.length;R++)M=h(_,g,R,y[R],N),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?R:M.key),v=o(M,v,R),k===null?j=M:k.sibling=M,k=M);return e&&_.forEach(function(P){return t(g,P)}),ct&&Io(g,R),j}function b(g,v,y,N){var j=hl(y);if(typeof j!="function")throw Error(ne(150));if(y=j.call(y),y==null)throw Error(ne(151));for(var k=j=null,_=v,R=v=0,M=null,H=y.next();_!==null&&!H.done;R++,H=y.next()){_.index>R?(M=_,_=null):M=_.sibling;var P=f(g,_,H.value,N);if(P===null){_===null&&(_=M);break}e&&_&&P.alternate===null&&t(g,_),v=o(P,v,R),k===null?j=P:k.sibling=P,k=P,_=M}if(H.done)return n(g,_),ct&&Io(g,R),j;if(_===null){for(;!H.done;R++,H=y.next())H=d(g,H.value,N),H!==null&&(v=o(H,v,R),k===null?j=H:k.sibling=H,k=H);return ct&&Io(g,R),j}for(_=r(g,_);!H.done;R++,H=y.next())H=h(_,g,R,H.value,N),H!==null&&(e&&H.alternate!==null&&_.delete(H.key===null?R:H.key),v=o(H,v,R),k===null?j=H:k.sibling=H,k=H);return e&&_.forEach(function(T){return t(g,T)}),ct&&Io(g,R),j}function S(g,v,y,N){if(typeof y=="object"&&y!==null&&y.type===_s&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Bu:e:{for(var j=y.key,k=v;k!==null;){if(k.key===j){if(j=y.type,j===_s){if(k.tag===7){n(g,k.sibling),v=i(k,y.props.children),v.return=g,g=v;break e}}else if(k.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ri&&y0(j)===k.type){n(g,k.sibling),v=i(k,y.props),v.ref=wl(g,k,y),v.return=g,g=v;break e}n(g,k);break}else t(g,k);k=k.sibling}y.type===_s?(v=$o(y.props.children,g.mode,N,y.key),v.return=g,g=v):(N=Dd(y.type,y.key,y.props,null,g.mode,N),N.ref=wl(g,v,y),N.return=g,g=N)}return s(g);case Ps:e:{for(k=y.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(g,v.sibling),v=i(v,y.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=Rh(y,g.mode,N),v.return=g,g=v}return s(g);case Ri:return k=y._init,S(g,v,k(y._payload),N)}if(Tl(y))return m(g,v,y,N);if(hl(y))return b(g,v,y,N);Ju(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,y),v.return=g,g=v):(n(g,v),v=Th(y,g.mode,N),v.return=g,g=v),s(g)):n(g,v)}return S}var sa=Rk(!0),Lk=Rk(!1),cf=ao(null),uf=null,Ds=null,Ty=null;function Ry(){Ty=Ds=uf=null}function Ly(e){var t=cf.current;ot(cf),e._currentValue=t}function Jm(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xs(e,t){uf=e,Ty=Ds=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mn=!0),e.firstContext=null)}function Qn(e){var t=e._currentValue;if(Ty!==e)if(e={context:e,memoizedValue:t,next:null},Ds===null){if(uf===null)throw Error(ne(308));Ds=e,uf.dependencies={lanes:0,firstContext:e}}else Ds=Ds.next=e;return t}var Oo=null;function Oy(e){Oo===null?Oo=[e]:Oo.push(e)}function Ok(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Oy(t)):(n.next=i.next,i.next=n),t.interleaved=n,gi(e,r)}function gi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Li=!1;function My(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,gi(e,n)}return i=r.interleaved,i===null?(t.next=t,Oy(r)):(t.next=i.next,i.next=t),r.interleaved=t,gi(e,n)}function Ad(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,by(e,n)}}function x0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function df(e,t,n,r){var i=e.updateQueue;Li=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,u=c.next;c.next=null,s===null?o=u:s.next=u,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==s&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=c))}if(o!==null){var d=i.baseState;s=0,p=u=c=null,a=o;do{var f=a.lane,h=a.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,b=a;switch(f=t,h=n,b.tag){case 1:if(m=b.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=gt({},d,f);break e;case 2:Li=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=h,c=d):p=p.next=h,s|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(p===null&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Yo|=s,e.lanes=s,e.memoizedState=d}}function w0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ne(191,i));i.call(r)}}}var Uc={},zr=ao(Uc),pc=ao(Uc),hc=ao(Uc);function Mo(e){if(e===Uc)throw Error(ne(174));return e}function Dy(e,t){switch(tt(hc,t),tt(pc,e),tt(zr,Uc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tm(t,e)}ot(zr),tt(zr,t)}function aa(){ot(zr),ot(pc),ot(hc)}function Dk(e){Mo(hc.current);var t=Mo(zr.current),n=Tm(t,e.type);t!==n&&(tt(pc,e),tt(zr,n))}function Fy(e){pc.current===e&&(ot(zr),ot(pc))}var ht=ao(0);function ff(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Eh=[];function $y(){for(var e=0;e<Eh.length;e++)Eh[e]._workInProgressVersionPrimary=null;Eh.length=0}var Td=bi.ReactCurrentDispatcher,jh=bi.ReactCurrentBatchConfig,Ko=0,mt=null,Tt=null,Dt=null,pf=!1,Ul=!1,mc=0,K2=0;function Gt(){throw Error(ne(321))}function zy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function By(e,t,n,r,i,o){if(Ko=o,mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Td.current=e===null||e.memoizedState===null?X2:Q2,e=n(r,i),Ul){o=0;do{if(Ul=!1,mc=0,25<=o)throw Error(ne(301));o+=1,Dt=Tt=null,t.updateQueue=null,Td.current=J2,e=n(r,i)}while(Ul)}if(Td.current=hf,t=Tt!==null&&Tt.next!==null,Ko=0,Dt=Tt=mt=null,pf=!1,t)throw Error(ne(300));return e}function Hy(){var e=mc!==0;return mc=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?mt.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function Jn(){if(Tt===null){var e=mt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Dt===null?mt.memoizedState:Dt.next;if(t!==null)Dt=t,Tt=e;else{if(e===null)throw Error(ne(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Dt===null?mt.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function gc(e,t){return typeof t=="function"?t(e):t}function Ph(e){var t=Jn(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=Tt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,c=null,u=o;do{var p=u.lane;if((Ko&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,s=r):c=c.next=d,mt.lanes|=p,Yo|=p}u=u.next}while(u!==null&&u!==o);c===null?s=r:c.next=a,mr(r,t.memoizedState)||(mn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,mt.lanes|=o,Yo|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _h(e){var t=Jn(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);mr(o,t.memoizedState)||(mn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fk(){}function $k(e,t){var n=mt,r=Jn(),i=t(),o=!mr(r.memoizedState,i);if(o&&(r.memoizedState=i,mn=!0),r=r.queue,Uy(Hk.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,yc(9,Bk.bind(null,n,r,i,t),void 0,null),$t===null)throw Error(ne(349));Ko&30||zk(n,t,i)}return i}function zk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mt.updateQueue,t===null?(t={lastEffect:null,stores:null},mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bk(e,t,n,r){t.value=n,t.getSnapshot=r,Uk(t)&&Vk(e)}function Hk(e,t,n){return n(function(){Uk(t)&&Vk(e)})}function Uk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function Vk(e){var t=gi(e,1);t!==null&&hr(t,e,1,-1)}function v0(e){var t=Ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gc,lastRenderedState:e},t.queue=e,e=e.dispatch=G2.bind(null,mt,e),[t.memoizedState,e]}function yc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=mt.updateQueue,t===null?(t={lastEffect:null,stores:null},mt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Wk(){return Jn().memoizedState}function Rd(e,t,n,r){var i=Ar();mt.flags|=e,i.memoizedState=yc(1|t,n,void 0,r===void 0?null:r)}function np(e,t,n,r){var i=Jn();r=r===void 0?null:r;var o=void 0;if(Tt!==null){var s=Tt.memoizedState;if(o=s.destroy,r!==null&&zy(r,s.deps)){i.memoizedState=yc(t,n,o,r);return}}mt.flags|=e,i.memoizedState=yc(1|t,n,o,r)}function b0(e,t){return Rd(8390656,8,e,t)}function Uy(e,t){return np(2048,8,e,t)}function Kk(e,t){return np(4,2,e,t)}function Yk(e,t){return np(4,4,e,t)}function qk(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gk(e,t,n){return n=n!=null?n.concat([e]):null,np(4,4,qk.bind(null,t,e),n)}function Vy(){}function Xk(e,t){var n=Jn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qk(e,t){var n=Jn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Jk(e,t,n){return Ko&21?(mr(n,t)||(n=rk(),mt.lanes|=n,Yo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,mn=!0),e.memoizedState=n)}function Y2(e,t){var n=Qe;Qe=n!==0&&4>n?n:4,e(!0);var r=jh.transition;jh.transition={};try{e(!1),t()}finally{Qe=n,jh.transition=r}}function Zk(){return Jn().memoizedState}function q2(e,t,n){var r=Gi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eN(e))tN(t,n);else if(n=Ok(e,t,n,r),n!==null){var i=sn();hr(n,e,r,i),nN(n,t,r)}}function G2(e,t,n){var r=Gi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eN(e))tN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,mr(a,s)){var c=t.interleaved;c===null?(i.next=i,Oy(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Ok(e,t,i,r),n!==null&&(i=sn(),hr(n,e,r,i),nN(n,t,r))}}function eN(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function tN(e,t){Ul=pf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function nN(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,by(e,n)}}var hf={readContext:Qn,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},X2={readContext:Qn,useCallback:function(e,t){return Ar().memoizedState=[e,t===void 0?null:t],e},useContext:Qn,useEffect:b0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rd(4194308,4,qk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rd(4,2,e,t)},useMemo:function(e,t){var n=Ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ar();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=q2.bind(null,mt,e),[r.memoizedState,e]},useRef:function(e){var t=Ar();return e={current:e},t.memoizedState=e},useState:v0,useDebugValue:Vy,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=v0(!1),t=e[0];return e=Y2.bind(null,e[1]),Ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=mt,i=Ar();if(ct){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),$t===null)throw Error(ne(349));Ko&30||zk(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,b0(Hk.bind(null,r,o,e),[e]),r.flags|=2048,yc(9,Bk.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ar(),t=$t.identifierPrefix;if(ct){var n=ci,r=li;n=(r&~(1<<32-pr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=K2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Q2={readContext:Qn,useCallback:Xk,useContext:Qn,useEffect:Uy,useImperativeHandle:Gk,useInsertionEffect:Kk,useLayoutEffect:Yk,useMemo:Qk,useReducer:Ph,useRef:Wk,useState:function(){return Ph(gc)},useDebugValue:Vy,useDeferredValue:function(e){var t=Jn();return Jk(t,Tt.memoizedState,e)},useTransition:function(){var e=Ph(gc)[0],t=Jn().memoizedState;return[e,t]},useMutableSource:Fk,useSyncExternalStore:$k,useId:Zk,unstable_isNewReconciler:!1},J2={readContext:Qn,useCallback:Xk,useContext:Qn,useEffect:Uy,useImperativeHandle:Gk,useInsertionEffect:Kk,useLayoutEffect:Yk,useMemo:Qk,useReducer:_h,useRef:Wk,useState:function(){return _h(gc)},useDebugValue:Vy,useDeferredValue:function(e){var t=Jn();return Tt===null?t.memoizedState=e:Jk(t,Tt.memoizedState,e)},useTransition:function(){var e=_h(gc)[0],t=Jn().memoizedState;return[e,t]},useMutableSource:Fk,useSyncExternalStore:$k,useId:Zk,unstable_isNewReconciler:!1};function or(e,t){if(e&&e.defaultProps){t=gt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:gt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rp={isMounted:function(e){return(e=e._reactInternals)?ns(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=sn(),i=Gi(e),o=pi(r,i);o.payload=t,n!=null&&(o.callback=n),t=Yi(e,o,i),t!==null&&(hr(t,e,i,r),Ad(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=sn(),i=Gi(e),o=pi(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Yi(e,o,i),t!==null&&(hr(t,e,i,r),Ad(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=sn(),r=Gi(e),i=pi(n,r);i.tag=2,t!=null&&(i.callback=t),t=Yi(e,i,r),t!==null&&(hr(t,e,r,n),Ad(t,e,r))}};function S0(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!cc(n,r)||!cc(i,o):!0}function rN(e,t,n){var r=!1,i=eo,o=t.contextType;return typeof o=="object"&&o!==null?o=Qn(o):(i=vn(t)?Vo:Zt.current,r=t.contextTypes,o=(r=r!=null)?ia(e,i):eo),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function k0(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rp.enqueueReplaceState(t,t.state,null)}function eg(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},My(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Qn(o):(o=vn(t)?Vo:Zt.current,i.context=ia(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Zm(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&rp.enqueueReplaceState(i,i.state,null),df(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function la(e,t){try{var n="",r=t;do n+=EI(r),r=r.return;while(r);var i=n}catch(o){i=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:i,digest:null}}function Ih(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function tg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Z2=typeof WeakMap=="function"?WeakMap:Map;function iN(e,t,n){n=pi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gf||(gf=!0,dg=r),tg(e,t)},n}function oN(e,t,n){n=pi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){tg(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){tg(e,t),typeof r!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function N0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Z2;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=pA.bind(null,e,t,n),t.then(e,e))}function C0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function E0(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=pi(-1,1),t.tag=2,Yi(n,t,1))),n.lanes|=1),e)}var eA=bi.ReactCurrentOwner,mn=!1;function rn(e,t,n,r){t.child=e===null?Lk(t,null,n,r):sa(t,e.child,n,r)}function j0(e,t,n,r,i){n=n.render;var o=t.ref;return Xs(t,i),r=By(e,t,n,r,o,i),n=Hy(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,yi(e,t,i)):(ct&&n&&_y(t),t.flags|=1,rn(e,t,r,i),t.child)}function P0(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Jy(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,sN(e,t,o,r,i)):(e=Dd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:cc,n(s,r)&&e.ref===t.ref)return yi(e,t,i)}return t.flags|=1,e=Xi(o,r),e.ref=t.ref,e.return=t,t.child=e}function sN(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(cc(o,r)&&e.ref===t.ref)if(mn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(mn=!0);else return t.lanes=e.lanes,yi(e,t,i)}return ng(e,t,n,r,i)}function aN(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt($s,jn),jn|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,tt($s,jn),jn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,tt($s,jn),jn|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,tt($s,jn),jn|=r;return rn(e,t,i,n),t.child}function lN(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ng(e,t,n,r,i){var o=vn(n)?Vo:Zt.current;return o=ia(t,o),Xs(t,i),n=By(e,t,n,r,o,i),r=Hy(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,yi(e,t,i)):(ct&&r&&_y(t),t.flags|=1,rn(e,t,n,i),t.child)}function _0(e,t,n,r,i){if(vn(n)){var o=!0;sf(t)}else o=!1;if(Xs(t,i),t.stateNode===null)Ld(e,t),rN(t,n,r),eg(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qn(u):(u=vn(n)?Vo:Zt.current,u=ia(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||c!==u)&&k0(t,s,r,u),Li=!1;var f=t.memoizedState;s.state=f,df(t,r,s,i),c=t.memoizedState,a!==r||f!==c||wn.current||Li?(typeof p=="function"&&(Zm(t,n,p,r),c=t.memoizedState),(a=Li||S0(t,n,a,r,f,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Mk(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:or(t.type,a),s.props=u,d=t.pendingProps,f=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qn(c):(c=vn(n)?Vo:Zt.current,c=ia(t,c));var h=n.getDerivedStateFromProps;(p=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==c)&&k0(t,s,r,c),Li=!1,f=t.memoizedState,s.state=f,df(t,r,s,i);var m=t.memoizedState;a!==d||f!==m||wn.current||Li?(typeof h=="function"&&(Zm(t,n,h,r),m=t.memoizedState),(u=Li||S0(t,n,u,r,f,m,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return rg(e,t,n,r,o,i)}function rg(e,t,n,r,i,o){lN(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&h0(t,n,!1),yi(e,t,o);r=t.stateNode,eA.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=sa(t,e.child,null,o),t.child=sa(t,null,a,o)):rn(e,t,a,o),t.memoizedState=r.state,i&&h0(t,n,!0),t.child}function cN(e){var t=e.stateNode;t.pendingContext?p0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&p0(e,t.context,!1),Dy(e,t.containerInfo)}function I0(e,t,n,r,i){return oa(),Ay(i),t.flags|=256,rn(e,t,n,r),t.child}var ig={dehydrated:null,treeContext:null,retryLane:0};function og(e){return{baseLanes:e,cachePool:null,transitions:null}}function uN(e,t,n){var r=t.pendingProps,i=ht.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),tt(ht,i&1),e===null)return Qm(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=sp(s,r,0,null),e=$o(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=og(n),t.memoizedState=ig,e):Wy(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return tA(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Xi(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Xi(a,o):(o=$o(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?og(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=ig,r}return o=e.child,e=o.sibling,r=Xi(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wy(e,t){return t=sp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zu(e,t,n,r){return r!==null&&Ay(r),sa(t,e.child,null,n),e=Wy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tA(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Ih(Error(ne(422))),Zu(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=sp({mode:"visible",children:r.children},i,0,null),o=$o(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&sa(t,e.child,null,s),t.child.memoizedState=og(s),t.memoizedState=ig,o);if(!(t.mode&1))return Zu(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(ne(419)),r=Ih(o,r,void 0),Zu(e,t,s,r)}if(a=(s&e.childLanes)!==0,mn||a){if(r=$t,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,gi(e,i),hr(r,e,i,-1))}return Qy(),r=Ih(Error(ne(421))),Zu(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=hA.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,In=Ki(i.nextSibling),Tn=t,ct=!0,lr=null,e!==null&&(Wn[Kn++]=li,Wn[Kn++]=ci,Wn[Kn++]=Wo,li=e.id,ci=e.overflow,Wo=t),t=Wy(t,r.children),t.flags|=4096,t)}function A0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jm(e.return,t,n)}function Ah(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function dN(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(rn(e,t,r.children,n),r=ht.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&A0(e,n,t);else if(e.tag===19)A0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(tt(ht,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ff(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ah(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ff(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ah(t,!0,n,null,o);break;case"together":Ah(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ld(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,n=Xi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nA(e,t,n){switch(t.tag){case 3:cN(t),oa();break;case 5:Dk(t);break;case 1:vn(t.type)&&sf(t);break;case 4:Dy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;tt(cf,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(tt(ht,ht.current&1),t.flags|=128,null):n&t.child.childLanes?uN(e,t,n):(tt(ht,ht.current&1),e=yi(e,t,n),e!==null?e.sibling:null);tt(ht,ht.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return dN(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),tt(ht,ht.current),r)break;return null;case 22:case 23:return t.lanes=0,aN(e,t,n)}return yi(e,t,n)}var fN,sg,pN,hN;fN=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sg=function(){};pN=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Mo(zr.current);var o=null;switch(n){case"input":i=Pm(e,i),r=Pm(e,r),o=[];break;case"select":i=gt({},i,{value:void 0}),r=gt({},r,{value:void 0}),o=[];break;case"textarea":i=Am(e,i),r=Am(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=rf)}Rm(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(nc.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&a[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(o||(o=[]),o.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(nc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&rt("scroll",e),o||a===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};hN=function(e,t,n,r){n!==r&&(t.flags|=4)};function vl(e,t){if(!ct)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function rA(e,t,n){var r=t.pendingProps;switch(Iy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(t),null;case 1:return vn(t.type)&&of(),Xt(t),null;case 3:return r=t.stateNode,aa(),ot(wn),ot(Zt),$y(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,lr!==null&&(hg(lr),lr=null))),sg(e,t),Xt(t),null;case 5:Fy(t);var i=Mo(hc.current);if(n=t.type,e!==null&&t.stateNode!=null)pN(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ne(166));return Xt(t),null}if(e=Mo(zr.current),Qu(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Or]=t,r[fc]=o,e=(t.mode&1)!==0,n){case"dialog":rt("cancel",r),rt("close",r);break;case"iframe":case"object":case"embed":rt("load",r);break;case"video":case"audio":for(i=0;i<Ll.length;i++)rt(Ll[i],r);break;case"source":rt("error",r);break;case"img":case"image":case"link":rt("error",r),rt("load",r);break;case"details":rt("toggle",r);break;case"input":zw(r,o),rt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},rt("invalid",r);break;case"textarea":Hw(r,o),rt("invalid",r)}Rm(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Xu(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Xu(r.textContent,a,e),i=["children",""+a]):nc.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&rt("scroll",r)}switch(n){case"input":Hu(r),Bw(r,o,!0);break;case"textarea":Hu(r),Uw(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=rf)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=HS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Or]=t,e[fc]=r,fN(e,t,!1,!1),t.stateNode=e;e:{switch(s=Lm(n,r),n){case"dialog":rt("cancel",e),rt("close",e),i=r;break;case"iframe":case"object":case"embed":rt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ll.length;i++)rt(Ll[i],e);i=r;break;case"source":rt("error",e),i=r;break;case"img":case"image":case"link":rt("error",e),rt("load",e),i=r;break;case"details":rt("toggle",e),i=r;break;case"input":zw(e,r),i=Pm(e,r),rt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=gt({},r,{value:void 0}),rt("invalid",e);break;case"textarea":Hw(e,r),i=Am(e,r),rt("invalid",e);break;default:i=r}Rm(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var c=a[o];o==="style"?WS(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&US(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&rc(e,c):typeof c=="number"&&rc(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(nc.hasOwnProperty(o)?c!=null&&o==="onScroll"&&rt("scroll",e):c!=null&&my(e,o,c,s))}switch(n){case"input":Hu(e),Bw(e,r,!1);break;case"textarea":Hu(e),Uw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Zi(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Ks(e,!!r.multiple,o,!1):r.defaultValue!=null&&Ks(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=rf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xt(t),null;case 6:if(e&&t.stateNode!=null)hN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ne(166));if(n=Mo(hc.current),Mo(zr.current),Qu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Or]=t,(o=r.nodeValue!==n)&&(e=Tn,e!==null))switch(e.tag){case 3:Xu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xu(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Or]=t,t.stateNode=r}return Xt(t),null;case 13:if(ot(ht),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ct&&In!==null&&t.mode&1&&!(t.flags&128))Tk(),oa(),t.flags|=98560,o=!1;else if(o=Qu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ne(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ne(317));o[Or]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xt(t),o=!1}else lr!==null&&(hg(lr),lr=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ht.current&1?Lt===0&&(Lt=3):Qy())),t.updateQueue!==null&&(t.flags|=4),Xt(t),null);case 4:return aa(),sg(e,t),e===null&&uc(t.stateNode.containerInfo),Xt(t),null;case 10:return Ly(t.type._context),Xt(t),null;case 17:return vn(t.type)&&of(),Xt(t),null;case 19:if(ot(ht),o=t.memoizedState,o===null)return Xt(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)vl(o,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ff(e),s!==null){for(t.flags|=128,vl(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return tt(ht,ht.current&1|2),t.child}e=e.sibling}o.tail!==null&&kt()>ca&&(t.flags|=128,r=!0,vl(o,!1),t.lanes=4194304)}else{if(!r)if(e=ff(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ct)return Xt(t),null}else 2*kt()-o.renderingStartTime>ca&&n!==1073741824&&(t.flags|=128,r=!0,vl(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=kt(),t.sibling=null,n=ht.current,tt(ht,r?n&1|2:n&1),t):(Xt(t),null);case 22:case 23:return Xy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jn&1073741824&&(Xt(t),t.subtreeFlags&6&&(t.flags|=8192)):Xt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function iA(e,t){switch(Iy(t),t.tag){case 1:return vn(t.type)&&of(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(),ot(wn),ot(Zt),$y(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fy(t),null;case 13:if(ot(ht),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ot(ht),null;case 4:return aa(),null;case 10:return Ly(t.type._context),null;case 22:case 23:return Xy(),null;case 24:return null;default:return null}}var ed=!1,Qt=!1,oA=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Fs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(e,t,r)}else n.current=null}function ag(e,t,n){try{n()}catch(r){vt(e,t,r)}}var T0=!1;function sA(e,t){if(Vm=ef,e=wk(),Py(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(c=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=s),f===o&&++p===r&&(c=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wm={focusedElem:e,selectionRange:n},ef=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var b=m.memoizedProps,S=m.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:or(t.type,b),S);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(N){vt(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return m=T0,T0=!1,m}function Vl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&ag(t,n,o)}i=i.next}while(i!==r)}}function ip(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function lg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mN(e){var t=e.alternate;t!==null&&(e.alternate=null,mN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Or],delete t[fc],delete t[qm],delete t[H2],delete t[U2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gN(e){return e.tag===5||e.tag===3||e.tag===4}function R0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gN(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rf));else if(r!==4&&(e=e.child,e!==null))for(cg(e,t,n),e=e.sibling;e!==null;)cg(e,t,n),e=e.sibling}function ug(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ug(e,t,n),e=e.sibling;e!==null;)ug(e,t,n),e=e.sibling}var zt=null,sr=!1;function Pi(e,t,n){for(n=n.child;n!==null;)yN(e,t,n),n=n.sibling}function yN(e,t,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(Xf,n)}catch{}switch(n.tag){case 5:Qt||Fs(n,t);case 6:var r=zt,i=sr;zt=null,Pi(e,t,n),zt=r,sr=i,zt!==null&&(sr?(e=zt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):zt.removeChild(n.stateNode));break;case 18:zt!==null&&(sr?(e=zt,n=n.stateNode,e.nodeType===8?Nh(e.parentNode,n):e.nodeType===1&&Nh(e,n),ac(e)):Nh(zt,n.stateNode));break;case 4:r=zt,i=sr,zt=n.stateNode.containerInfo,sr=!0,Pi(e,t,n),zt=r,sr=i;break;case 0:case 11:case 14:case 15:if(!Qt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&ag(n,t,s),i=i.next}while(i!==r)}Pi(e,t,n);break;case 1:if(!Qt&&(Fs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){vt(n,t,a)}Pi(e,t,n);break;case 21:Pi(e,t,n);break;case 22:n.mode&1?(Qt=(r=Qt)||n.memoizedState!==null,Pi(e,t,n),Qt=r):Pi(e,t,n);break;default:Pi(e,t,n)}}function L0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new oA),t.forEach(function(r){var i=mA.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function rr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:zt=a.stateNode,sr=!1;break e;case 3:zt=a.stateNode.containerInfo,sr=!0;break e;case 4:zt=a.stateNode.containerInfo,sr=!0;break e}a=a.return}if(zt===null)throw Error(ne(160));yN(o,s,i),zt=null,sr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){vt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xN(t,e),t=t.sibling}function xN(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(rr(t,e),Ir(e),r&4){try{Vl(3,e,e.return),ip(3,e)}catch(b){vt(e,e.return,b)}try{Vl(5,e,e.return)}catch(b){vt(e,e.return,b)}}break;case 1:rr(t,e),Ir(e),r&512&&n!==null&&Fs(n,n.return);break;case 5:if(rr(t,e),Ir(e),r&512&&n!==null&&Fs(n,n.return),e.flags&32){var i=e.stateNode;try{rc(i,"")}catch(b){vt(e,e.return,b)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&zS(i,o),Lm(a,s);var u=Lm(a,o);for(s=0;s<c.length;s+=2){var p=c[s],d=c[s+1];p==="style"?WS(i,d):p==="dangerouslySetInnerHTML"?US(i,d):p==="children"?rc(i,d):my(i,p,d,u)}switch(a){case"input":_m(i,o);break;case"textarea":BS(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Ks(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Ks(i,!!o.multiple,o.defaultValue,!0):Ks(i,!!o.multiple,o.multiple?[]:"",!1))}i[fc]=o}catch(b){vt(e,e.return,b)}}break;case 6:if(rr(t,e),Ir(e),r&4){if(e.stateNode===null)throw Error(ne(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(b){vt(e,e.return,b)}}break;case 3:if(rr(t,e),Ir(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ac(t.containerInfo)}catch(b){vt(e,e.return,b)}break;case 4:rr(t,e),Ir(e);break;case 13:rr(t,e),Ir(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(qy=kt())),r&4&&L0(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Qt=(u=Qt)||p,rr(t,e),Qt=u):rr(t,e),Ir(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(pe=e,p=e.child;p!==null;){for(d=pe=p;pe!==null;){switch(f=pe,h=f.child,f.tag){case 0:case 11:case 14:case 15:Vl(4,f,f.return);break;case 1:Fs(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(b){vt(r,n,b)}}break;case 5:Fs(f,f.return);break;case 22:if(f.memoizedState!==null){M0(d);continue}}h!==null?(h.return=f,pe=h):M0(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=VS("display",s))}catch(b){vt(e,e.return,b)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(b){vt(e,e.return,b)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:rr(t,e),Ir(e),r&4&&L0(e);break;case 21:break;default:rr(t,e),Ir(e)}}function Ir(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(gN(n)){var r=n;break e}n=n.return}throw Error(ne(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(rc(i,""),r.flags&=-33);var o=R0(e);ug(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=R0(e);cg(e,a,s);break;default:throw Error(ne(161))}}catch(c){vt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function aA(e,t,n){pe=e,wN(e)}function wN(e,t,n){for(var r=(e.mode&1)!==0;pe!==null;){var i=pe,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||ed;if(!s){var a=i.alternate,c=a!==null&&a.memoizedState!==null||Qt;a=ed;var u=Qt;if(ed=s,(Qt=c)&&!u)for(pe=i;pe!==null;)s=pe,c=s.child,s.tag===22&&s.memoizedState!==null?D0(i):c!==null?(c.return=s,pe=c):D0(i);for(;o!==null;)pe=o,wN(o),o=o.sibling;pe=i,ed=a,Qt=u}O0(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,pe=o):O0(e)}}function O0(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qt||ip(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:or(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&w0(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}w0(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&ac(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}Qt||t.flags&512&&lg(t)}catch(f){vt(t,t.return,f)}}if(t===e){pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,pe=n;break}pe=t.return}}function M0(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,pe=n;break}pe=t.return}}function D0(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ip(4,t)}catch(c){vt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){vt(t,i,c)}}var o=t.return;try{lg(t)}catch(c){vt(t,o,c)}break;case 5:var s=t.return;try{lg(t)}catch(c){vt(t,s,c)}}}catch(c){vt(t,t.return,c)}if(t===e){pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,pe=a;break}pe=t.return}}var lA=Math.ceil,mf=bi.ReactCurrentDispatcher,Ky=bi.ReactCurrentOwner,Xn=bi.ReactCurrentBatchConfig,Ue=0,$t=null,Pt=null,Bt=0,jn=0,$s=ao(0),Lt=0,xc=null,Yo=0,op=0,Yy=0,Wl=null,hn=null,qy=0,ca=1/0,ii=null,gf=!1,dg=null,qi=null,td=!1,zi=null,yf=0,Kl=0,fg=null,Od=-1,Md=0;function sn(){return Ue&6?kt():Od!==-1?Od:Od=kt()}function Gi(e){return e.mode&1?Ue&2&&Bt!==0?Bt&-Bt:W2.transition!==null?(Md===0&&(Md=rk()),Md):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:uk(e.type)),e):1}function hr(e,t,n,r){if(50<Kl)throw Kl=0,fg=null,Error(ne(185));zc(e,n,r),(!(Ue&2)||e!==$t)&&(e===$t&&(!(Ue&2)&&(op|=n),Lt===4&&Di(e,Bt)),bn(e,r),n===1&&Ue===0&&!(t.mode&1)&&(ca=kt()+500,tp&&lo()))}function bn(e,t){var n=e.callbackNode;WI(e,t);var r=Zd(e,e===$t?Bt:0);if(r===0)n!==null&&Kw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kw(n),t===1)e.tag===0?V2(F0.bind(null,e)):_k(F0.bind(null,e)),z2(function(){!(Ue&6)&&lo()}),n=null;else{switch(ik(r)){case 1:n=vy;break;case 4:n=tk;break;case 16:n=Jd;break;case 536870912:n=nk;break;default:n=Jd}n=jN(n,vN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function vN(e,t){if(Od=-1,Md=0,Ue&6)throw Error(ne(327));var n=e.callbackNode;if(Qs()&&e.callbackNode!==n)return null;var r=Zd(e,e===$t?Bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=xf(e,r);else{t=r;var i=Ue;Ue|=2;var o=SN();($t!==e||Bt!==t)&&(ii=null,ca=kt()+500,Fo(e,t));do try{dA();break}catch(a){bN(e,a)}while(!0);Ry(),mf.current=o,Ue=i,Pt!==null?t=0:($t=null,Bt=0,t=Lt)}if(t!==0){if(t===2&&(i=$m(e),i!==0&&(r=i,t=pg(e,i))),t===1)throw n=xc,Fo(e,0),Di(e,r),bn(e,kt()),n;if(t===6)Di(e,r);else{if(i=e.current.alternate,!(r&30)&&!cA(i)&&(t=xf(e,r),t===2&&(o=$m(e),o!==0&&(r=o,t=pg(e,o))),t===1))throw n=xc,Fo(e,0),Di(e,r),bn(e,kt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ne(345));case 2:Ao(e,hn,ii);break;case 3:if(Di(e,r),(r&130023424)===r&&(t=qy+500-kt(),10<t)){if(Zd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){sn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Ym(Ao.bind(null,e,hn,ii),t);break}Ao(e,hn,ii);break;case 4:if(Di(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-pr(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*lA(r/1960))-r,10<r){e.timeoutHandle=Ym(Ao.bind(null,e,hn,ii),r);break}Ao(e,hn,ii);break;case 5:Ao(e,hn,ii);break;default:throw Error(ne(329))}}}return bn(e,kt()),e.callbackNode===n?vN.bind(null,e):null}function pg(e,t){var n=Wl;return e.current.memoizedState.isDehydrated&&(Fo(e,t).flags|=256),e=xf(e,t),e!==2&&(t=hn,hn=n,t!==null&&hg(t)),e}function hg(e){hn===null?hn=e:hn.push.apply(hn,e)}function cA(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!mr(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Di(e,t){for(t&=~Yy,t&=~op,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-pr(t),r=1<<n;e[n]=-1,t&=~r}}function F0(e){if(Ue&6)throw Error(ne(327));Qs();var t=Zd(e,0);if(!(t&1))return bn(e,kt()),null;var n=xf(e,t);if(e.tag!==0&&n===2){var r=$m(e);r!==0&&(t=r,n=pg(e,r))}if(n===1)throw n=xc,Fo(e,0),Di(e,t),bn(e,kt()),n;if(n===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ao(e,hn,ii),bn(e,kt()),null}function Gy(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(ca=kt()+500,tp&&lo())}}function qo(e){zi!==null&&zi.tag===0&&!(Ue&6)&&Qs();var t=Ue;Ue|=1;var n=Xn.transition,r=Qe;try{if(Xn.transition=null,Qe=1,e)return e()}finally{Qe=r,Xn.transition=n,Ue=t,!(Ue&6)&&lo()}}function Xy(){jn=$s.current,ot($s)}function Fo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$2(n)),Pt!==null)for(n=Pt.return;n!==null;){var r=n;switch(Iy(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&of();break;case 3:aa(),ot(wn),ot(Zt),$y();break;case 5:Fy(r);break;case 4:aa();break;case 13:ot(ht);break;case 19:ot(ht);break;case 10:Ly(r.type._context);break;case 22:case 23:Xy()}n=n.return}if($t=e,Pt=e=Xi(e.current,null),Bt=jn=t,Lt=0,xc=null,Yy=op=Yo=0,hn=Wl=null,Oo!==null){for(t=0;t<Oo.length;t++)if(n=Oo[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Oo=null}return e}function bN(e,t){do{var n=Pt;try{if(Ry(),Td.current=hf,pf){for(var r=mt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pf=!1}if(Ko=0,Dt=Tt=mt=null,Ul=!1,mc=0,Ky.current=null,n===null||n.return===null){Lt=1,xc=t,Pt=null;break}e:{var o=e,s=n.return,a=n,c=t;if(t=Bt,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=a,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var h=C0(s);if(h!==null){h.flags&=-257,E0(h,s,a,o,t),h.mode&1&&N0(o,u,t),t=h,c=u;var m=t.updateQueue;if(m===null){var b=new Set;b.add(c),t.updateQueue=b}else m.add(c);break e}else{if(!(t&1)){N0(o,u,t),Qy();break e}c=Error(ne(426))}}else if(ct&&a.mode&1){var S=C0(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),E0(S,s,a,o,t),Ay(la(c,a));break e}}o=c=la(c,a),Lt!==4&&(Lt=2),Wl===null?Wl=[o]:Wl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=iN(o,c,t);x0(o,g);break e;case 1:a=c;var v=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(qi===null||!qi.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var N=oN(o,a,t);x0(o,N);break e}}o=o.return}while(o!==null)}NN(n)}catch(j){t=j,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(!0)}function SN(){var e=mf.current;return mf.current=hf,e===null?hf:e}function Qy(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),$t===null||!(Yo&268435455)&&!(op&268435455)||Di($t,Bt)}function xf(e,t){var n=Ue;Ue|=2;var r=SN();($t!==e||Bt!==t)&&(ii=null,Fo(e,t));do try{uA();break}catch(i){bN(e,i)}while(!0);if(Ry(),Ue=n,mf.current=r,Pt!==null)throw Error(ne(261));return $t=null,Bt=0,Lt}function uA(){for(;Pt!==null;)kN(Pt)}function dA(){for(;Pt!==null&&!MI();)kN(Pt)}function kN(e){var t=EN(e.alternate,e,jn);e.memoizedProps=e.pendingProps,t===null?NN(e):Pt=t,Ky.current=null}function NN(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=iA(n,t),n!==null){n.flags&=32767,Pt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,Pt=null;return}}else if(n=rA(n,t,jn),n!==null){Pt=n;return}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Lt===0&&(Lt=5)}function Ao(e,t,n){var r=Qe,i=Xn.transition;try{Xn.transition=null,Qe=1,fA(e,t,n,r)}finally{Xn.transition=i,Qe=r}return null}function fA(e,t,n,r){do Qs();while(zi!==null);if(Ue&6)throw Error(ne(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(KI(e,o),e===$t&&(Pt=$t=null,Bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||td||(td=!0,jN(Jd,function(){return Qs(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Xn.transition,Xn.transition=null;var s=Qe;Qe=1;var a=Ue;Ue|=4,Ky.current=null,sA(e,n),xN(n,e),T2(Wm),ef=!!Vm,Wm=Vm=null,e.current=n,aA(n),DI(),Ue=a,Qe=s,Xn.transition=o}else e.current=n;if(td&&(td=!1,zi=e,yf=i),o=e.pendingLanes,o===0&&(qi=null),zI(n.stateNode),bn(e,kt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(gf)throw gf=!1,e=dg,dg=null,e;return yf&1&&e.tag!==0&&Qs(),o=e.pendingLanes,o&1?e===fg?Kl++:(Kl=0,fg=e):Kl=0,lo(),null}function Qs(){if(zi!==null){var e=ik(yf),t=Xn.transition,n=Qe;try{if(Xn.transition=null,Qe=16>e?16:e,zi===null)var r=!1;else{if(e=zi,zi=null,yf=0,Ue&6)throw Error(ne(331));var i=Ue;for(Ue|=4,pe=e.current;pe!==null;){var o=pe,s=o.child;if(pe.flags&16){var a=o.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(pe=u;pe!==null;){var p=pe;switch(p.tag){case 0:case 11:case 15:Vl(8,p,o)}var d=p.child;if(d!==null)d.return=p,pe=d;else for(;pe!==null;){p=pe;var f=p.sibling,h=p.return;if(mN(p),p===u){pe=null;break}if(f!==null){f.return=h,pe=f;break}pe=h}}}var m=o.alternate;if(m!==null){var b=m.child;if(b!==null){m.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}pe=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,pe=s;else e:for(;pe!==null;){if(o=pe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Vl(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,pe=g;break e}pe=o.return}}var v=e.current;for(pe=v;pe!==null;){s=pe;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,pe=y;else e:for(s=v;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ip(9,a)}}catch(j){vt(a,a.return,j)}if(a===s){pe=null;break e}var N=a.sibling;if(N!==null){N.return=a.return,pe=N;break e}pe=a.return}}if(Ue=i,lo(),$r&&typeof $r.onPostCommitFiberRoot=="function")try{$r.onPostCommitFiberRoot(Xf,e)}catch{}r=!0}return r}finally{Qe=n,Xn.transition=t}}return!1}function $0(e,t,n){t=la(n,t),t=iN(e,t,1),e=Yi(e,t,1),t=sn(),e!==null&&(zc(e,1,t),bn(e,t))}function vt(e,t,n){if(e.tag===3)$0(e,e,n);else for(;t!==null;){if(t.tag===3){$0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(qi===null||!qi.has(r))){e=la(n,e),e=oN(t,e,1),t=Yi(t,e,1),e=sn(),t!==null&&(zc(t,1,e),bn(t,e));break}}t=t.return}}function pA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=sn(),e.pingedLanes|=e.suspendedLanes&n,$t===e&&(Bt&n)===n&&(Lt===4||Lt===3&&(Bt&130023424)===Bt&&500>kt()-qy?Fo(e,0):Yy|=n),bn(e,t)}function CN(e,t){t===0&&(e.mode&1?(t=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):t=1);var n=sn();e=gi(e,t),e!==null&&(zc(e,t,n),bn(e,n))}function hA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),CN(e,n)}function mA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(t),CN(e,n)}var EN;EN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wn.current)mn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return mn=!1,nA(e,t,n);mn=!!(e.flags&131072)}else mn=!1,ct&&t.flags&1048576&&Ik(t,lf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ld(e,t),e=t.pendingProps;var i=ia(t,Zt.current);Xs(t,n),i=By(null,t,r,e,i,n);var o=Hy();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vn(r)?(o=!0,sf(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,My(t),i.updater=rp,t.stateNode=i,i._reactInternals=t,eg(t,r,e,n),t=rg(null,t,r,!0,o,n)):(t.tag=0,ct&&o&&_y(t),rn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ld(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=yA(r),e=or(r,e),i){case 0:t=ng(null,t,r,e,n);break e;case 1:t=_0(null,t,r,e,n);break e;case 11:t=j0(null,t,r,e,n);break e;case 14:t=P0(null,t,r,or(r.type,e),n);break e}throw Error(ne(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:or(r,i),ng(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:or(r,i),_0(e,t,r,i,n);case 3:e:{if(cN(t),e===null)throw Error(ne(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Mk(e,t),df(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=la(Error(ne(423)),t),t=I0(e,t,r,n,i);break e}else if(r!==i){i=la(Error(ne(424)),t),t=I0(e,t,r,n,i);break e}else for(In=Ki(t.stateNode.containerInfo.firstChild),Tn=t,ct=!0,lr=null,n=Lk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oa(),r===i){t=yi(e,t,n);break e}rn(e,t,r,n)}t=t.child}return t;case 5:return Dk(t),e===null&&Qm(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Km(r,i)?s=null:o!==null&&Km(r,o)&&(t.flags|=32),lN(e,t),rn(e,t,s,n),t.child;case 6:return e===null&&Qm(t),null;case 13:return uN(e,t,n);case 4:return Dy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=sa(t,null,r,n):rn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:or(r,i),j0(e,t,r,i,n);case 7:return rn(e,t,t.pendingProps,n),t.child;case 8:return rn(e,t,t.pendingProps.children,n),t.child;case 12:return rn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,tt(cf,r._currentValue),r._currentValue=s,o!==null)if(mr(o.value,s)){if(o.children===i.children&&!wn.current){t=yi(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=pi(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Jm(o.return,n,t),a.lanes|=n;break}c=c.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ne(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Jm(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}rn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Xs(t,n),i=Qn(i),r=r(i),t.flags|=1,rn(e,t,r,n),t.child;case 14:return r=t.type,i=or(r,t.pendingProps),i=or(r.type,i),P0(e,t,r,i,n);case 15:return sN(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:or(r,i),Ld(e,t),t.tag=1,vn(r)?(e=!0,sf(t)):e=!1,Xs(t,n),rN(t,r,i),eg(t,r,i,n),rg(null,t,r,!0,e,n);case 19:return dN(e,t,n);case 22:return aN(e,t,n)}throw Error(ne(156,t.tag))};function jN(e,t){return ek(e,t)}function gA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(e,t,n,r){return new gA(e,t,n,r)}function Jy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yA(e){if(typeof e=="function")return Jy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yy)return 11;if(e===xy)return 14}return 2}function Xi(e,t){var n=e.alternate;return n===null?(n=Gn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dd(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Jy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case _s:return $o(n.children,i,o,t);case gy:s=8,i|=8;break;case Nm:return e=Gn(12,n,t,i|2),e.elementType=Nm,e.lanes=o,e;case Cm:return e=Gn(13,n,t,i),e.elementType=Cm,e.lanes=o,e;case Em:return e=Gn(19,n,t,i),e.elementType=Em,e.lanes=o,e;case DS:return sp(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case OS:s=10;break e;case MS:s=9;break e;case yy:s=11;break e;case xy:s=14;break e;case Ri:s=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Gn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function $o(e,t,n,r){return e=Gn(7,e,r,t),e.lanes=n,e}function sp(e,t,n,r){return e=Gn(22,e,r,t),e.elementType=DS,e.lanes=n,e.stateNode={isHidden:!1},e}function Th(e,t,n){return e=Gn(6,e,null,t),e.lanes=n,e}function Rh(e,t,n){return t=Gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ph(0),this.expirationTimes=ph(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ph(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Zy(e,t,n,r,i,o,s,a,c){return e=new xA(e,t,n,a,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Gn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},My(o),e}function wA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ps,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function PN(e){if(!e)return eo;e=e._reactInternals;e:{if(ns(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var n=e.type;if(vn(n))return Pk(e,n,t)}return t}function _N(e,t,n,r,i,o,s,a,c){return e=Zy(n,r,!0,e,i,o,s,a,c),e.context=PN(null),n=e.current,r=sn(),i=Gi(n),o=pi(r,i),o.callback=t??null,Yi(n,o,i),e.current.lanes=i,zc(e,i,r),bn(e,r),e}function ap(e,t,n,r){var i=t.current,o=sn(),s=Gi(i);return n=PN(n),t.context===null?t.context=n:t.pendingContext=n,t=pi(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Yi(i,t,s),e!==null&&(hr(e,i,s,o),Ad(e,i,s)),s}function wf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function z0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ex(e,t){z0(e,t),(e=e.alternate)&&z0(e,t)}function vA(){return null}var IN=typeof reportError=="function"?reportError:function(e){console.error(e)};function tx(e){this._internalRoot=e}lp.prototype.render=tx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));ap(e,t,null,null)};lp.prototype.unmount=tx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qo(function(){ap(null,e,null,null)}),t[mi]=null}};function lp(e){this._internalRoot=e}lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ak();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mi.length&&t!==0&&t<Mi[n].priority;n++);Mi.splice(n,0,e),n===0&&ck(e)}};function nx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function B0(){}function bA(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=wf(s);o.call(u)}}var s=_N(t,r,e,0,null,!1,!1,"",B0);return e._reactRootContainer=s,e[mi]=s.current,uc(e.nodeType===8?e.parentNode:e),qo(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=wf(c);a.call(u)}}var c=Zy(e,0,!1,null,null,!1,!1,"",B0);return e._reactRootContainer=c,e[mi]=c.current,uc(e.nodeType===8?e.parentNode:e),qo(function(){ap(t,c,n,r)}),c}function up(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var c=wf(s);a.call(c)}}ap(t,s,e,i)}else s=bA(n,t,e,i,r);return wf(s)}ok=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Rl(t.pendingLanes);n!==0&&(by(t,n|1),bn(t,kt()),!(Ue&6)&&(ca=kt()+500,lo()))}break;case 13:qo(function(){var r=gi(e,1);if(r!==null){var i=sn();hr(r,e,1,i)}}),ex(e,1)}};Sy=function(e){if(e.tag===13){var t=gi(e,134217728);if(t!==null){var n=sn();hr(t,e,134217728,n)}ex(e,134217728)}};sk=function(e){if(e.tag===13){var t=Gi(e),n=gi(e,t);if(n!==null){var r=sn();hr(n,e,t,r)}ex(e,t)}};ak=function(){return Qe};lk=function(e,t){var n=Qe;try{return Qe=e,t()}finally{Qe=n}};Mm=function(e,t,n){switch(t){case"input":if(_m(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ep(r);if(!i)throw Error(ne(90));$S(r),_m(r,i)}}}break;case"textarea":BS(e,n);break;case"select":t=n.value,t!=null&&Ks(e,!!n.multiple,t,!1)}};qS=Gy;GS=qo;var SA={usingClientEntryPoint:!1,Events:[Hc,Rs,ep,KS,YS,Gy]},bl={findFiberByHostInstance:Lo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kA={bundleType:bl.bundleType,version:bl.version,rendererPackageName:bl.rendererPackageName,rendererConfig:bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:bi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=JS(e),e===null?null:e.stateNode},findFiberByHostInstance:bl.findFiberByHostInstance||vA,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 nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{Xf=nd.inject(kA),$r=nd}catch{}}Mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SA;Mn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nx(t))throw Error(ne(200));return wA(e,t,null,n)};Mn.createRoot=function(e,t){if(!nx(e))throw Error(ne(299));var n=!1,r="",i=IN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Zy(e,1,!1,null,null,n,!1,r,i),e[mi]=t.current,uc(e.nodeType===8?e.parentNode:e),new tx(t)};Mn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=JS(t),e=e===null?null:e.stateNode,e};Mn.flushSync=function(e){return qo(e)};Mn.hydrate=function(e,t,n){if(!cp(t))throw Error(ne(200));return up(null,e,t,!0,n)};Mn.hydrateRoot=function(e,t,n){if(!nx(e))throw Error(ne(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=IN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=_N(t,null,e,1,n??null,i,!1,o,s),e[mi]=t.current,uc(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new lp(t)};Mn.render=function(e,t,n){if(!cp(t))throw Error(ne(200));return up(null,e,t,!1,n)};Mn.unmountComponentAtNode=function(e){if(!cp(e))throw Error(ne(40));return e._reactRootContainer?(qo(function(){up(null,null,e,!1,function(){e._reactRootContainer=null,e[mi]=null})}),!0):!1};Mn.unstable_batchedUpdates=Gy;Mn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cp(n))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return up(e,t,n,!1,r)};Mn.version="18.3.1-next-f1338f8080-20240426";function AN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AN)}catch(e){console.error(e)}}AN(),AS.exports=Mn;var ui=AS.exports,H0=ui;Sm.createRoot=H0.createRoot,Sm.hydrateRoot=H0.hydrateRoot;const TN=w.createContext(null);function mg(e){let t=e||"/";return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t||"/"}function NA(){const e=mg(window.location.pathname);return e==="/"?(window.history.replaceState({},"","/projects"),"/projects"):e}function CA({children:e}){const[t,n]=w.useState(NA);w.useEffect(()=>{const o=()=>n(mg(window.location.pathname));return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[]);const r=w.useCallback(o=>{const s=o.startsWith("/")?o:`/${o}`;let a;try{a=new URL(s,window.location.origin)}catch{a=new URL("/",window.location.origin)}const c=mg(a.pathname),u=a.search||"";window.history.pushState({},"",c+u),n(c)},[]),i=w.useMemo(()=>({path:t,navigate:r}),[t,r]);return l.jsx(TN.Provider,{value:i,children:e})}function Ea(){const e=w.useContext(TN);if(!e)throw new Error("useRoute must be used within RouteProvider");return e}function EA(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const U0={};function gg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&U0[t[0]]||(typeof t[0]=="string"&&(U0[t[0]]=new Date),EA(...t))}const RN=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function V0(e,t,n){e.loadNamespaces(t,RN(e,n))}function W0(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,RN(e,r))}function jA(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=t.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!i||s(o,e)))}function PA(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(gg("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):jA(e,t,n)}const _A=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,IA={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},AA=e=>IA[e],TA=e=>e.replace(_A,AA);let yg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:TA};function RA(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yg={...yg,...e}}function LA(){return yg}let LN;function OA(e){LN=e}function MA(){return LN}const DA={type:"3rdParty",init(e){RA(e.options.react),OA(e)}},FA=w.createContext();class $A{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const zA=(e,t)=>{const n=w.useRef();return w.useEffect(()=>{n.current=e},[e,t]),n.current};function st(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=w.useContext(FA)||{},o=n||r||MA();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new $A),!o){gg("You will need to pass in an i18next instance by using initReactI18next");const y=(j,k)=>typeof k=="string"?k:k&&typeof k=="object"&&typeof k.defaultValue=="string"?k.defaultValue:Array.isArray(j)?j[j.length-1]:j,N=[y,{},!1];return N.t=y,N.i18n={},N.ready=!1,N}o.options.react&&o.options.react.wait!==void 0&&gg("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...LA(),...o.options.react,...t},{useSuspense:a,keyPrefix:c}=s;let u=e||i||o.options&&o.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const p=(o.isInitialized||o.initializedStoreOnce)&&u.every(y=>PA(y,o,s));function d(){return o.getFixedT(t.lng||null,s.nsMode==="fallback"?u:u[0],c)}const[f,h]=w.useState(d);let m=u.join();t.lng&&(m=`${t.lng}${m}`);const b=zA(m),S=w.useRef(!0);w.useEffect(()=>{const{bindI18n:y,bindI18nStore:N}=s;S.current=!0,!p&&!a&&(t.lng?W0(o,t.lng,u,()=>{S.current&&h(d)}):V0(o,u,()=>{S.current&&h(d)})),p&&b&&b!==m&&S.current&&h(d);function j(){S.current&&h(d)}return y&&o&&o.on(y,j),N&&o&&o.store.on(N,j),()=>{S.current=!1,y&&o&&y.split(" ").forEach(k=>o.off(k,j)),N&&o&&N.split(" ").forEach(k=>o.store.off(k,j))}},[o,m]);const g=w.useRef(!0);w.useEffect(()=>{S.current&&!g.current&&h(d),g.current=!1},[o,c]);const v=[f,o,p];if(v.t=f,v.i18n=o,v.ready=p,p||!p&&!a)return v;throw new Promise(y=>{t.lng?W0(o,t.lng,u,()=>y()):V0(o,u,()=>y())})}const ON="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20fill='none'%20role='img'%20aria-label='AgentFlow'%3e%3ctitle%3eAgentFlow%3c/title%3e%3crect%20width='32'%20height='32'%20rx='9'%20fill='%23131313'/%3e%3crect%20x='4.5'%20y='11'%20width='10.5'%20height='10'%20rx='3'%20fill='%232a2a2a'%20stroke='%237c4dff'%20stroke-width='1.2'/%3e%3cpath%20d='M15.25%2014.25C17.8%2012.2%2019.2%209.8%2022.25%209.25'%20stroke='%23cdbdff'%20stroke-width='1.65'%20stroke-linecap='round'%20/%3e%3cpath%20d='M15.25%2017.75C17.8%2019.8%2019.2%2022.2%2022.25%2022.75'%20stroke='%237c4dff'%20stroke-width='1.65'%20stroke-linecap='round'%20opacity='0.92'%20/%3e%3crect%20x='21.75'%20y='6'%20width='7.25'%20height='7'%20rx='2.25'%20fill='%23353534'%20stroke='%23e8deff'%20stroke-width='0.95'%20opacity='0.95'/%3e%3crect%20x='21.75'%20y='19'%20width='7.25'%20height='7'%20rx='2.25'%20fill='%23353534'%20stroke='%239ecaff'%20stroke-width='0.95'%20opacity='0.9'/%3e%3c/svg%3e",BA=[{to:"/projects",label:"Projects",icon:"folder_open"},{to:"/settings",label:"Settings",icon:"settings"}],HA=[{href:"https://agentflow-hub.com",icon:"hub",labelKey:"common:links.hub"},{href:"https://docs.agentflow-hub.com",icon:"menu_book",labelKey:"common:links.docs"},{href:"https://github.com/pproject-github/agentflow",icon:"code",labelKey:"common:links.github"}];function UA(e,t){return t==="/projects"?e==="/projects"||e==="/":e===t||e.startsWith(t+"/")}function VA(){const{path:e,navigate:t}=Ea(),{t:n}=st();return l.jsxs("aside",{className:"af-sidebar","aria-label":n("flow:sidebar.mainNav"),children:[l.jsxs("div",{className:"af-brand",children:[l.jsx("div",{className:"af-brand-mark","aria-hidden":!0,children:l.jsx("img",{src:ON,alt:"",width:"36",height:"36",decoding:"async"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"af-brand-title",children:"Agentflow"}),l.jsx("p",{className:"af-brand-tag",children:"Orchestration Engine"})]})]}),l.jsx("nav",{className:"af-nav",children:BA.map(r=>l.jsxs("button",{type:"button",className:"af-nav-link"+(UA(e,r.to)?" af-nav-link--active":""),onClick:()=>t(r.to),children:[l.jsx("span",{className:"material-symbols-outlined",children:r.icon}),l.jsx("span",{children:r.label})]},r.to))}),l.jsx("div",{className:"af-sidebar-footer",children:HA.map(r=>{const i=n(r.labelKey);return l.jsx("a",{className:"af-sidebar-ext",href:r.href,target:"_blank",rel:"noopener noreferrer","aria-label":i,title:i,children:l.jsx("span",{className:"material-symbols-outlined",children:r.icon})},r.href)})})]})}const MN="agentflow.pipelineRecent",WA=50,KA=15;function YA(e){try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function DN(){if(typeof localStorage>"u")return[];const e=localStorage.getItem(MN);return e?YA(e).filter(t=>t&&typeof t.flowId=="string"&&(t.flowSource==="user"||t.flowSource==="builtin"||t.flowSource==="workspace")&&t.kind==="opened"&&typeof t.at=="number"):[]}function rd(e,t){if(typeof localStorage>"u")return;const n=Date.now(),r=DN(),o=[{flowId:e,flowSource:t,kind:"opened",at:n},...r.filter(s=>!(s.flowId===e&&s.flowSource===t))].slice(0,WA);try{localStorage.setItem(MN,JSON.stringify(o))}catch{}}function qA(e,t){const n=e.filter(r=>r.id===t);return n.length===0||n.some(r=>(r.source??"user")==="user")?"user":n.some(r=>r.source==="workspace")?"workspace":n.some(r=>r.source==="builtin")?"builtin":n[0].source??"user"}function xg(e,t){const n=Date.now(),r=Math.max(0,n-e),i=Math.floor(r/1e3);if(i<60)return t("flow:time.justNow");const o=Math.floor(i/60);if(o<60)return t("flow:time.minutesAgo",{n:o});const s=Math.floor(o/60);if(s<24)return t("flow:time.hoursAgo",{n:s});const a=new Date(e),c=new Date,u=new Date(c);if(u.setDate(u.getDate()-1),a.toDateString()===u.toDateString())return t("flow:time.yesterday");const p=Math.floor(s/24);return p<7?t("flow:time.daysAgo",{n:p}):`${a.getMonth()+1}/${a.getDate()}`}function GA(e,t){if(e==null||!Number.isFinite(e)||e<=0)return"--";if(e<1e3)return t("flow:time.milliseconds",{n:Math.max(1,Math.round(e))});const n=e/1e3;return t("flow:time.seconds",{n:n>=10?Math.round(n):n.toFixed(1)})}function XA(e,t,n){const r=[];for(const i of e)!i||typeof i.flowId!="string"||typeof i.at!="number"||r.push({flowId:i.flowId,flowSource:qA(n,i.flowId),kind:"executed",at:i.at});for(const i of t)r.push({flowId:i.flowId,flowSource:i.flowSource,kind:"opened",at:i.at});return r.sort((i,o)=>o.at-i.at),r.slice(0,KA)}var Pn=Uint8Array,zs=Uint16Array,QA=Int32Array,FN=new Pn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$N=new Pn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),JA=new Pn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zN=function(e,t){for(var n=new zs(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new QA(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},BN=zN(FN,2),HN=BN.b,ZA=BN.r;HN[28]=258,ZA[258]=28;var eT=zN($N,0),tT=eT.b,wg=new zs(32768);for(var it=0;it<32768;++it){var _i=(it&43690)>>1|(it&21845)<<1;_i=(_i&52428)>>2|(_i&13107)<<2,_i=(_i&61680)>>4|(_i&3855)<<4,wg[it]=((_i&65280)>>8|(_i&255)<<8)>>1}var Yl=function(e,t,n){for(var r=e.length,i=0,o=new zs(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new zs(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new zs(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],p=t-e[i],d=s[e[i]-1]++<<p,f=d|(1<<p)-1;d<=f;++d)a[wg[d]>>c]=u}else for(a=new zs(r),i=0;i<r;++i)e[i]&&(a[i]=wg[s[e[i]-1]++]>>15-e[i]);return a},Vc=new Pn(288);for(var it=0;it<144;++it)Vc[it]=8;for(var it=144;it<256;++it)Vc[it]=9;for(var it=256;it<280;++it)Vc[it]=7;for(var it=280;it<288;++it)Vc[it]=8;var UN=new Pn(32);for(var it=0;it<32;++it)UN[it]=5;var nT=Yl(Vc,9,1),rT=Yl(UN,5,1),Lh=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},ir=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Oh=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},iT=function(e){return(e+7)/8|0},rx=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Pn(e.subarray(t,n))},oT=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Vn=function(e,t,n){var r=new Error(t||oT[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Vn),!n)throw r;return r},sT=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new Pn(0);var s=!n,a=s||t.i!=2,c=t.i;s&&(n=new Pn(i*3));var u=function(xe){var ge=n.length;if(xe>ge){var ye=new Pn(Math.max(ge*2,xe));ye.set(n),n=ye}},p=t.f||0,d=t.p||0,f=t.b||0,h=t.l,m=t.d,b=t.m,S=t.n,g=i*8;do{if(!h){p=ir(e,d,1);var v=ir(e,d+1,3);if(d+=3,v)if(v==1)h=nT,m=rT,b=9,S=5;else if(v==2){var k=ir(e,d,31)+257,_=ir(e,d+10,15)+4,R=k+ir(e,d+5,31)+1;d+=14;for(var M=new Pn(R),H=new Pn(19),P=0;P<_;++P)H[JA[P]]=ir(e,d+P*3,7);d+=_*3;for(var T=Lh(H),V=(1<<T)-1,L=Yl(H,T,1),P=0;P<R;){var B=L[ir(e,d,V)];d+=B&15;var y=B>>4;if(y<16)M[P++]=y;else{var F=0,$=0;for(y==16?($=3+ir(e,d,3),d+=2,F=M[P-1]):y==17?($=3+ir(e,d,7),d+=3):y==18&&($=11+ir(e,d,127),d+=7);$--;)M[P++]=F}}var I=M.subarray(0,k),A=M.subarray(k);b=Lh(I),S=Lh(A),h=Yl(I,b,1),m=Yl(A,S,1)}else Vn(1);else{var y=iT(d)+4,N=e[y-4]|e[y-3]<<8,j=y+N;if(j>i){c&&Vn(0);break}a&&u(f+N),n.set(e.subarray(y,j),f),t.b=f+=N,t.p=d=j*8,t.f=p;continue}if(d>g){c&&Vn(0);break}}a&&u(f+131072);for(var E=(1<<b)-1,z=(1<<S)-1,U=d;;U=d){var F=h[Oh(e,d)&E],O=F>>4;if(d+=F&15,d>g){c&&Vn(0);break}if(F||Vn(2),O<256)n[f++]=O;else if(O==256){U=d,h=null;break}else{var q=O-254;if(O>264){var P=O-257,Z=FN[P];q=ir(e,d,(1<<Z)-1)+HN[P],d+=Z}var te=m[Oh(e,d)&z],ae=te>>4;te||Vn(3),d+=te&15;var A=tT[ae];if(ae>3){var Z=$N[ae];A+=Oh(e,d)&(1<<Z)-1,d+=Z}if(d>g){c&&Vn(0);break}a&&u(f+131072);var ee=f+q;if(f<A){var ue=o-A,Se=Math.min(A,ee);for(ue+f<0&&Vn(3);f<Se;++f)n[f]=r[ue+f]}for(;f<ee;++f)n[f]=n[f-A]}}t.l=h,t.p=U,t.b=f,t.f=p,h&&(p=1,t.m=b,t.d=m,t.n=S)}while(!p);return f!=n.length&&s?rx(n,0,f):n.subarray(0,f)},aT=new Pn(0),Mr=function(e,t){return e[t]|e[t+1]<<8},cr=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Mh=function(e,t){return cr(e,t)+cr(e,t+4)*4294967296};function lT(e,t){return sT(e,{i:2},t&&t.out,t&&t.dictionary)}var vg=typeof TextDecoder<"u"&&new TextDecoder,cT=0;try{vg.decode(aT,{stream:!0}),cT=1}catch{}var uT=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:rx(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function dT(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(vg)return vg.decode(e);var i=uT(e),o=i.s,n=i.r;return n.length&&Vn(8),o}}var fT=function(e,t){return t+30+Mr(e,t+26)+Mr(e,t+28)},pT=function(e,t,n){var r=Mr(e,t+28),i=dT(e.subarray(t+46,t+46+r),!(Mr(e,t+8)&2048)),o=t+46+r,s=cr(e,t+20),a=n&&s==4294967295?hT(e,o):[s,cr(e,t+24),cr(e,t+42)],c=a[0],u=a[1],p=a[2];return[Mr(e,t+10),c,u,i,o+Mr(e,t+30)+Mr(e,t+32),p]},hT=function(e,t){for(;Mr(e,t)!=1;t+=4+Mr(e,t+2));return[Mh(e,t+12),Mh(e,t+4),Mh(e,t+20)]};function mT(e,t){for(var n={},r=e.length-22;cr(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Vn(13);var i=Mr(e,r+8);if(!i)return{};var o=cr(e,r+16),s=o==4294967295||i==65535;if(s){var a=cr(e,r-12);s=cr(e,a)==101075792,s&&(i=cr(e,a+32),o=cr(e,a+48))}for(var c=0;c<i;++c){var u=pT(e,o,s),p=u[0],d=u[1],f=u[2],h=u[3],m=u[4],b=u[5],S=fT(e,b);o=m,p?p==8?n[h]=lT(e.subarray(S,S+d),{out:new Pn(f)}):Vn(14,"unknown compression type "+p):n[h]=rx(e,S,S+d)}return n}const gT=8*1024*1024,yT=500;function xT(e){if(e==null||typeof e!="string")return null;let t=e.replace(/\\/g,"/").replace(/^\uFEFF/,"");for(;t.startsWith("/");)t=t.slice(1);if(!t||t.includes("\0")||/^[a-zA-Z]:/.test(t))return null;const n=t.split("/").filter(r=>r.length>0);for(const r of n)if(r==="."||r==="..")return null;return n.join("/")}function wT(e){return e?e.split("/").some(n=>n==="__MACOSX"||n.startsWith("._")):!0}function vT(e){const t=e.toLowerCase();if(t==="flow.yaml"||t==="flow.yml")return"";const n="/flow.yaml",r="/flow.yml";let i=null;if(t.endsWith(n))i=e.slice(0,-n.length);else if(t.endsWith(r))i=e.slice(0,-r.length);else return null;return i.includes("/")?null:i}const bT=/^[a-zA-Z][a-zA-Z0-9_-]*$/;async function ST(e){try{const t=new Uint8Array(await e.arrayBuffer()),n=mT(t),r=new Map;let i=0,o=0;for(const[c,u]of Object.entries(n)){if(c.endsWith("/"))continue;const p=xT(c);if(!p||wT(p))continue;const d=(u==null?void 0:u.length)??0;if(i+=d,i>gT||(o+=1,o>yT))return null;r.set(p,d)}if(r.size===0)return null;const s=new Set;for(const c of r.keys()){const u=vT(c);u!==null&&s.add(u)}if(s.size!==1)return null;const[a]=[...s];if(a==="")return null;for(const c of r.keys())if(!(c===a||c.startsWith(`${a}/`)))return null;return bT.test(a)?a:null}catch{return null}}const Dh=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function kT({file:e,onClose:t,onImported:n}){const{t:r}=st(),i=w.useId(),o=w.useRef(null),s=w.useRef(null),[a,c]=w.useState(""),[u,p]=w.useState("user"),[d,f]=w.useState(!1),[h,m]=w.useState(""),[b,S]=w.useState(null),g=b??e;w.useEffect(()=>{const j=requestAnimationFrame(()=>{var k;return(k=o.current)==null?void 0:k.focus()});return()=>cancelAnimationFrame(j)},[]),w.useEffect(()=>{let j=!1;return(async()=>{const k=g.name||"",_=k.toLowerCase();let R="";if(_.endsWith(".zip")){if(R=await ST(g)||"",!R){const M=k.replace(/\.zip$/i,"");Dh.test(M)&&(R=M)}}else if(_.endsWith(".yaml")||_.endsWith(".yml")){const M=k.replace(/\.ya?ml$/i,"");Dh.test(M)&&(R=M)}j||c(R)})(),()=>{j=!0}},[g]);const v=a.trim(),y=v.length>0&&Dh.test(v);async function N(j){if(j.preventDefault(),!(!y||d)){f(!0),m("");try{const k=new FormData;k.set("flowId",v),k.set("targetSpace",u),k.set("file",g,g.name);const _=await fetch("/api/flows/import",{method:"POST",body:k}),R=await _.json().catch(()=>({}));if(!_.ok){m(typeof R.error=="string"?R.error:r("project:importModal.importFailed"));return}n({id:R.flowId,source:R.flowSource??"user"})}catch(k){m(String((k==null?void 0:k.message)||k))}finally{f(!1)}}}return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:j=>{j.target===j.currentTarget&&t()},children:l.jsxs("div",{ref:o,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onMouseDown:j=>j.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:i,className:"af-shortcuts-panel__title",children:r("project:importModal.title")}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":r("project:importModal.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:N,children:[l.jsx("p",{className:"af-new-pipeline-lead",children:r("project:importModal.lead",{filename:g.name})}),l.jsx("input",{ref:s,type:"file",className:"af-import-file-input",accept:".yaml,.yml,.zip,application/zip","aria-hidden":!0,tabIndex:-1,onChange:j=>{var _;const k=(_=j.target.files)==null?void 0:_[0];k&&S(k),j.target.value=""}}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:importModal.nameLabel")}),l.jsx("input",{className:"af-new-pipeline-input",type:"text",name:"importFlowId",autoComplete:"off",spellCheck:!1,placeholder:r("project:importModal.namePlaceholder"),value:a,onChange:j=>c(j.target.value),"aria-invalid":v.length>0&&!y}),l.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-hint",children:r("project:importModal.nameHint")})]}),l.jsxs("fieldset",{className:"af-new-pipeline-fieldset",children:[l.jsx("legend",{className:"af-pipeline-drawer-label",children:r("project:importModal.locationLabel")}),l.jsxs("label",{className:"af-new-pipeline-radio",children:[l.jsx("input",{type:"radio",name:"importTargetSpace",value:"user",checked:u==="user",onChange:()=>p("user")}),l.jsx("span",{children:r("project:importModal.userDir")})]}),l.jsxs("label",{className:"af-new-pipeline-radio",children:[l.jsx("input",{type:"radio",name:"importTargetSpace",value:"workspace",checked:u==="workspace",onChange:()=>p("workspace")}),l.jsx("span",{children:r("project:importModal.workspaceDir")})]})]}),l.jsx("div",{className:"af-import-repick",children:l.jsx("button",{type:"button",className:"af-btn-secondary af-import-repick-btn",onClick:()=>{var j;return(j=s.current)==null?void 0:j.click()},children:r("project:importModal.changeFile")})}),h?l.jsx("p",{className:"af-err af-new-pipeline-err",children:h}):null,l.jsxs("div",{className:"af-new-pipeline-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:d,children:r("project:importModal.cancel")}),l.jsx("button",{type:"submit",className:"af-btn-primary",disabled:!y||d,children:r(d?"project:importModal.importing":"project:importModal.importAndOpen")})]})]})]})})}const NT=/^[a-zA-Z][a-zA-Z0-9_-]*$/,K0="af:newPipelineGuide";function CT({open:e,onClose:t,onCreated:n}){const{t:r}=st(),i=w.useId(),o=w.useRef(null),[s,a]=w.useState(""),[c,u]=w.useState(""),[p,d]=w.useState("user"),[f,h]=w.useState(!1),[m,b]=w.useState(""),[S,g]=w.useState(!1);w.useEffect(()=>{if(!e)return;a(""),u(""),d("user"),b(""),h(!1),localStorage.getItem(K0)==="true"&&g(!0);const _=requestAnimationFrame(()=>{var R;return(R=o.current)==null?void 0:R.focus()});return()=>cancelAnimationFrame(_)},[e]);const v=()=>{localStorage.removeItem(K0),g(!1)};if(!e)return null;const y=s.trim(),N=y.length>0&&NT.test(y);async function j(k){if(k.preventDefault(),!(!N||f)){h(!0),b(""),v();try{const _=await fetch("/api/flows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:y,description:c.trim(),targetSpace:p})}),R=await _.json().catch(()=>({}));if(!_.ok){b(typeof R.error=="string"?R.error:r("project:newPipelineModal.createFailed"));return}n({id:R.flowId,source:R.flowSource??"user"})}catch(_){b(String((_==null?void 0:_.message)||_))}finally{h(!1)}}}return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:k=>{k.target===k.currentTarget&&(v(),t())},children:l.jsxs("div",{ref:o,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onMouseDown:k=>k.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:i,className:"af-shortcuts-panel__title",children:r("project:newPipelineModal.title")}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:()=>{v(),t()},"aria-label":r("project:newPipelineModal.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),S?l.jsx("div",{className:"af-new-pipeline-guide",children:l.jsxs("div",{className:"af-new-pipeline-guide-content",children:[l.jsx("span",{className:"material-symbols-outlined af-new-pipeline-guide-icon",children:"lightbulb"}),l.jsxs("div",{className:"af-new-pipeline-guide-text",children:[l.jsx("p",{children:l.jsx("strong",{children:r("onboarding:newPipeline.guideTitle")})}),l.jsx("p",{children:r("onboarding:newPipeline.guideDesc")})]}),l.jsx("button",{type:"button",className:"af-new-pipeline-guide-close",onClick:v,children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]})}):null,l.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:j,children:[l.jsx("p",{className:"af-new-pipeline-lead",children:r("project:newPipelineModal.lead")}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.nameLabel")}),l.jsx("input",{className:"af-new-pipeline-input",type:"text",name:"pipelineName",autoComplete:"off",spellCheck:!1,placeholder:r("project:newPipelineModal.namePlaceholder"),value:s,onChange:k=>a(k.target.value),"aria-invalid":y.length>0&&!N}),l.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-hint",children:r(S?"onboarding:newPipeline.nameHintGuide":"project:newPipelineModal.nameHint")})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.descLabel")}),l.jsx("textarea",{className:"af-pipeline-drawer-textarea af-new-pipeline-textarea",name:"pipelineDescription",rows:3,placeholder:r(S?"onboarding:newPipeline.descPlaceholderGuide":"project:newPipelineModal.descPlaceholder"),value:c,onChange:k=>u(k.target.value)}),S?l.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-guide-hint",children:r("onboarding:newPipeline.descHintGuide")}):null]}),l.jsxs("fieldset",{className:"af-new-pipeline-fieldset",children:[l.jsx("legend",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.locationLabel")}),l.jsxs("label",{className:"af-new-pipeline-radio",children:[l.jsx("input",{type:"radio",name:"targetSpace",value:"user",checked:p==="user",onChange:()=>d("user")}),l.jsx("span",{children:r("project:newPipelineModal.userDir")})]}),l.jsxs("label",{className:"af-new-pipeline-radio",children:[l.jsx("input",{type:"radio",name:"targetSpace",value:"workspace",checked:p==="workspace",onChange:()=>d("workspace")}),l.jsx("span",{children:r("project:newPipelineModal.workspaceDir")})]})]}),m?l.jsx("p",{className:"af-err af-new-pipeline-err",children:m}):null,l.jsxs("div",{className:"af-new-pipeline-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:()=>{v(),t()},disabled:f,children:r("project:newPipelineModal.cancel")}),l.jsx("button",{type:"submit",className:"af-btn-primary",disabled:!N||f,children:r(f?"project:newPipelineModal.creating":S?"onboarding:newPipeline.createGuide":"project:newPipelineModal.createAndOpen")})]})]})]})})}function Y0(e){return e==="secondary"?"af-proj-badge af-proj-badge--secondary":e==="primary"?"af-proj-badge af-proj-badge--primary":e==="muted"?"af-proj-badge af-proj-badge--muted":"af-proj-badge"}function ET(e){return e==="executed"?"material-symbols-outlined af-act-icon af-act-icon--executed":"material-symbols-outlined af-act-icon af-act-icon--opened"}function bg(e,t){return e==="builtin"?{label:t("project:sourceBadge.builtin"),tone:"muted"}:e==="workspace"?{label:t("project:sourceBadge.workspace"),tone:"secondary"}:{label:t("project:sourceBadge.user"),tone:"primary"}}function VN(e){const t=e.source??"user";return t==="builtin"?`builtin/pipelines / ${e.id}`:t==="workspace"?e.archived?`.workspace/agentflow/pipelines/_archived / ${e.id}`:`.workspace/agentflow/pipelines / ${e.id}`:e.archived?`~/agentflow/pipelines/_archived / ${e.id}`:`~/agentflow/pipelines / ${e.id}`}const jT="project:defaultCardDesc";function WN(e,t){const n=e.description!=null?String(e.description).trim():"";return n!==""?n:t(jT)}function PT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bs({children:e,className:t="",query:n}){const r=n.trim(),i=String(e);if(!r)return l.jsx("span",{className:t,children:i});const o=new RegExp(`(${PT(r)})`,"gi"),s=i.split(o);return l.jsx("span",{className:t,children:s.map((a,c)=>c%2===1?l.jsx("mark",{className:"af-search-hit",children:a},c):l.jsx("span",{children:a},c))})}function _T(e,t,n){const r=[String(e.id),WN(e,n),VN(e),bg(e.source,n).label];return e.archived&&r.push(n("project:archived")),r.join(`
41
+ `).toLowerCase()}function IT(e,t,n){return t?_T(e,t,n).includes(t):!0}function AT(e,t){const n=e.trim().toLowerCase();if(!n)return!0;const r=String(t.flowId).toLowerCase(),i=String(t.flowSource??"user").toLowerCase();return r.includes(n)||i.includes(n)}function q0(){const{t:e}=st(),{navigate:t,path:n}=Ea(),[r,i]=w.useState("all"),[o,s]=w.useState([]),[a,c]=w.useState([]),[u,p]=w.useState(""),[d,f]=w.useState(!1),[h,m]=w.useState(!1),[b,S]=w.useState(null),[g,v]=w.useState(!1),[y,N]=w.useState(""),[j,k]=w.useState(!0),_=w.useRef(0),R=w.useRef(0),M=w.useCallback(async()=>{const z=++R.current;p("");try{const U=await fetch("/api/flows");if(z!==R.current)return;if(!U.ok)throw new Error("HTTP "+U.status);const O=await U.json();if(z!==R.current)return;s(Array.isArray(O)?O:[])}catch(U){if(z!==R.current)return;s([]),p(String(U.message||U))}try{const U=await fetch("/api/pipeline-recent-runs");if(z!==R.current)return;if(U.ok){const O=await U.json();if(z!==R.current)return;c(Array.isArray(O.runs)?O.runs:[])}else c([])}catch{if(z!==R.current)return;c([])}f(!0)},[]);w.useEffect(()=>{f(!1),M()},[M]),w.useEffect(()=>{if(n!=="/projects"&&n!=="/")return;const z=new URLSearchParams(window.location.search);let U=!1;if(z.get("tab")==="archived"&&(i("archived"),z.delete("tab"),U=!0),z.get("new")==="1"&&(m(!0),z.delete("new"),U=!0),U){const O=z.toString();window.history.replaceState({},"",O?`/projects?${O}`:"/projects")}},[n]);const H=w.useMemo(()=>XA(a,DN(),o),[a,o,n]),P=w.useMemo(()=>H.filter(z=>AT(y,z)),[H,y]),T=y.trim().toLowerCase(),V=w.useMemo(()=>r==="archived"?o.filter(z=>z.archived):o.filter(z=>!z.archived),[o,r]),L=w.useMemo(()=>V.filter(z=>IT(z,T,e)),[V,T,e]),B=z=>{const U=z.source??"user",O=new URLSearchParams({flowId:z.id,flowSource:U});z.archived&&O.set("flowArchived","1"),t(`/flow?${O.toString()}`)},F=z=>{t(`/flow?flowId=${encodeURIComponent(z.flowId)}&flowSource=${encodeURIComponent(z.flowSource)}`)},$=w.useCallback(z=>{var U,O;z.preventDefault(),z.stopPropagation(),(O=(U=z.dataTransfer)==null?void 0:U.types)!=null&&O.includes("Files")&&(_.current+=1,v(!0))},[]),I=w.useCallback(z=>{z.preventDefault(),z.stopPropagation(),_.current-=1,_.current<=0&&(_.current=0,v(!1))},[]),A=w.useCallback(z=>{z.preventDefault(),z.stopPropagation()},[]),E=w.useCallback(z=>{var q,Z;z.preventDefault(),z.stopPropagation(),_.current=0,v(!1);const U=(Z=(q=z.dataTransfer)==null?void 0:q.files)==null?void 0:Z[0];if(!U)return;const O=U.name.toLowerCase();!O.endsWith(".yaml")&&!O.endsWith(".yml")&&!O.endsWith(".zip")||S(U)},[]);return l.jsxs("div",{className:"af-projects"+(g?" af-projects--drop-target":""),onDragEnter:$,onDragLeave:I,onDragOver:A,onDrop:E,children:[l.jsxs("header",{className:"af-projects-top",children:[l.jsxs("div",{className:"af-projects-tabs",children:[l.jsx("button",{type:"button",className:r==="all"?"af-tab af-tab--active":"af-tab",onClick:()=>i("all"),children:e("project:all")}),l.jsx("button",{type:"button",className:r==="archived"?"af-tab af-tab--active":"af-tab",onClick:()=>i("archived"),children:e("project:archived")})]}),l.jsxs("div",{className:"af-projects-top-right",children:[l.jsxs("div",{className:"af-search-wrap",children:[l.jsx("span",{className:"material-symbols-outlined af-search-icon",children:"search"}),l.jsx("input",{className:"af-search"+(y.trim()?" af-search--has-clear":""),type:"search",placeholder:e("project:searchPipelines"),"aria-label":e("project:searchPipelines"),autoComplete:"off",value:y,onChange:z=>N(z.target.value),onKeyDown:z=>{z.key==="Escape"&&(N(""),z.currentTarget.blur())}}),y.trim()?l.jsx("button",{type:"button",className:"af-search-clear","aria-label":"Clear search",onClick:()=>N(""),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"close"})}):null]}),l.jsx("button",{type:"button",className:"af-icon-btn"+(j?" af-icon-btn--active":""),"aria-label":e("flow:palette.toggleRecentActivity"),"aria-expanded":j,"aria-controls":"af-recent-activity-panel",onClick:()=>k(z=>!z),children:l.jsx("span",{className:"material-symbols-outlined",children:"notifications"})}),l.jsx("button",{type:"button",className:"af-btn-primary af-create-btn",onClick:()=>m(!0),children:e("project:createNew")})]})]}),l.jsxs("div",{className:"af-projects-body",children:[l.jsxs("section",{className:"af-projects-main",children:[l.jsxs("header",{className:"af-projects-section-head",children:[l.jsx("h2",{className:"af-projects-h2",children:e(r==="archived"?"project:archivedPipelines":"project:activeProjects")}),l.jsx("p",{className:"af-projects-sub",children:T?e("project:filterResult",{count:L.length}):e(r==="archived"?"project:archivedHint":"project:activeHint")}),u?l.jsx("p",{className:"af-err af-projects-api-hint",children:u}):null]}),l.jsxs("div",{className:"af-project-grid",children:[L.length>0?L.map(z=>l.jsx("button",{type:"button",className:"af-project-card",onClick:()=>B(z),children:l.jsxs("div",{className:"af-project-card-body",children:[l.jsx("span",{className:Y0(bg(z.source,e).tone),children:l.jsx(bs,{query:y,children:bg(z.source,e).label})}),z.archived?l.jsx("span",{className:Y0("muted"),children:l.jsx(bs,{query:y,children:e("project:archived")})}):null,l.jsx("h3",{className:"af-project-title",children:l.jsx(bs,{query:y,children:z.id})}),l.jsx("p",{className:"af-project-desc",children:l.jsx(bs,{query:y,children:WN(z,e)})}),l.jsxs("div",{className:"af-project-path",children:[l.jsx("span",{className:"material-symbols-outlined af-path-icon",children:"database"}),l.jsx("span",{className:"af-path-text",children:l.jsx(bs,{query:y,children:VN(z)})})]})]})},`${z.id}:${z.source??"user"}:${z.archived?"a":""}`)):d?V.length===0?l.jsxs("div",{className:"af-projects-empty-block",children:[l.jsx("p",{className:"af-projects-empty",children:r==="archived"?e("project:noArchived"):o.length>0?e("project:noActive"):e(u?"project:loadFailed":"project:noPipelines")}),!u&&o.length===0&&r==="all"?l.jsx("p",{className:"af-projects-empty-hint",children:e("project:emptyHint",{code1:"agentflow ui",code2:".agentflow/pipelines"})}):null]}):l.jsx("div",{className:"af-projects-empty-block",children:l.jsx("p",{className:"af-projects-empty",children:e("project:noMatch",{query:y.trim()})})}):l.jsx("div",{className:"af-projects-empty-block",children:l.jsx("p",{className:"af-projects-empty",children:e("project:loadingPipelines")})}),l.jsxs("button",{type:"button",className:"af-project-add",onClick:()=>m(!0),children:[l.jsx("span",{className:"material-symbols-outlined af-project-add-icon",children:"add_circle"}),l.jsx("span",{className:"af-project-add-label",children:e("project:newPipeline")})]}),l.jsxs("a",{className:"af-hub-card",href:"https://agentflow-hub.com",target:"_blank",rel:"noopener noreferrer",children:[l.jsx("div",{className:"af-hub-card__glow","aria-hidden":!0}),l.jsxs("span",{className:"af-hub-card__eyebrow",children:[l.jsx("span",{className:"material-symbols-outlined af-hub-card__eyebrow-icon",children:"hub"}),e("project:hubCard.eyebrow")]}),l.jsx("h3",{className:"af-hub-card__title",children:e("project:hubCard.title")}),l.jsx("p",{className:"af-hub-card__desc",children:e("project:hubCard.desc")}),l.jsxs("span",{className:"af-hub-card__cta",children:[e("project:hubCard.cta"),l.jsx("span",{className:"material-symbols-outlined af-hub-card__cta-icon",children:"arrow_outward"})]}),l.jsx("code",{className:"af-hub-card__cli",children:e("project:hubCard.cliHint")})]})]})]}),l.jsxs("aside",{id:"af-recent-activity-panel",className:"af-activity"+(j?"":" af-activity--hidden"),"aria-hidden":!j,"aria-label":e("project:recentActivity"),children:[l.jsxs("h2",{className:"af-activity-title",children:[l.jsx("span",{className:"af-activity-bullet"}),e("project:recentActivity")]}),l.jsx("div",{className:"af-activity-list",children:P.length===0?l.jsx("p",{className:"af-activity-empty",children:H.length===0?e("project:noRecentActivity"):e("project:noMatchRecent")}):P.map(z=>l.jsxs("button",{type:"button",className:"af-activity-row af-activity-row--action",onClick:()=>F(z),children:[l.jsxs("div",{className:"af-activity-row-top",children:[l.jsx("h4",{className:"af-activity-name",children:l.jsx(bs,{query:y,children:z.flowId})}),l.jsx("span",{className:"af-activity-time",children:xg(z.at,e)})]}),l.jsxs("div",{className:"af-activity-meta",children:[l.jsx("span",{className:ET(z.kind),children:z.kind==="executed"?"play_arrow":"visibility"}),l.jsxs("p",{className:"af-activity-text",children:[z.kind==="executed"?e("project:recentRun"):e("project:recentOpen")," · ",xg(z.at,e)]})]})]},`${z.kind}-${z.flowId}-${z.flowSource}-${z.at}`))})]})]}),l.jsx(CT,{open:h,onClose:()=>m(!1),onCreated:async z=>{m(!1),await M();const U=z.source??"user";t(`/flow?flowId=${encodeURIComponent(z.id)}&flowSource=${encodeURIComponent(U)}`)}}),b?l.jsx(kT,{file:b,onClose:()=>S(null),onImported:async z=>{S(null),await M();const U=z.source??"user";t(`/flow?flowId=${encodeURIComponent(z.id)}&flowSource=${encodeURIComponent(U)}`)}},`${b.name}-${b.size}-${b.lastModified}`):null]})}function It(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=It(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var TT={value:()=>{}};function dp(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Fd(n)}function Fd(e){this._=e}function RT(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Fd.prototype=dp.prototype={constructor:Fd,on:function(e,t){var n=this._,r=RT(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=LT(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=G0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=G0(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fd(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function LT(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function G0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=TT,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Sg="http://www.w3.org/1999/xhtml";const X0={svg:"http://www.w3.org/2000/svg",xhtml:Sg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fp(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),X0.hasOwnProperty(t)?{space:X0[t],local:e}:e}function OT(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Sg&&t.documentElement.namespaceURI===Sg?t.createElement(e):t.createElementNS(n,e)}}function MT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function KN(e){var t=fp(e);return(t.local?MT:OT)(t)}function DT(){}function ix(e){return e==null?DT:function(){return this.querySelector(e)}}function FT(e){typeof e!="function"&&(e=ix(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),c,u,p=0;p<s;++p)(c=o[p])&&(u=e.call(c,c.__data__,p,o))&&("__data__"in c&&(u.__data__=c.__data__),a[p]=u);return new On(r,this._parents)}function $T(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zT(){return[]}function YN(e){return e==null?zT:function(){return this.querySelectorAll(e)}}function BT(e){return function(){return $T(e.apply(this,arguments))}}function HT(e){typeof e=="function"?e=BT(e):e=YN(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,c,u=0;u<a;++u)(c=s[u])&&(r.push(e.call(c,c.__data__,u,s)),i.push(c));return new On(r,i)}function qN(e){return function(){return this.matches(e)}}function GN(e){return function(t){return t.matches(e)}}var UT=Array.prototype.find;function VT(e){return function(){return UT.call(this.children,e)}}function WT(){return this.firstElementChild}function KT(e){return this.select(e==null?WT:VT(typeof e=="function"?e:GN(e)))}var YT=Array.prototype.filter;function qT(){return Array.from(this.children)}function GT(e){return function(){return YT.call(this.children,e)}}function XT(e){return this.selectAll(e==null?qT:GT(typeof e=="function"?e:GN(e)))}function QT(e){typeof e!="function"&&(e=qN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,u=0;u<s;++u)(c=o[u])&&e.call(c,c.__data__,u,o)&&a.push(c);return new On(r,this._parents)}function XN(e){return new Array(e.length)}function JT(){return new On(this._enter||this._groups.map(XN),this._parents)}function vf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}vf.prototype={constructor:vf,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 ZT(e){return function(){return e}}function eR(e,t,n,r,i,o){for(var s=0,a,c=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new vf(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function tR(e,t,n,r,i,o,s){var a,c,u=new Map,p=t.length,d=o.length,f=new Array(p),h;for(a=0;a<p;++a)(c=t[a])&&(f[a]=h=s.call(c,c.__data__,a,t)+"",u.has(h)?i[a]=c:u.set(h,c));for(a=0;a<d;++a)h=s.call(e,o[a],a,o)+"",(c=u.get(h))?(r[a]=c,c.__data__=o[a],u.delete(h)):n[a]=new vf(e,o[a]);for(a=0;a<p;++a)(c=t[a])&&u.get(f[a])===c&&(i[a]=c)}function nR(e){return e.__data__}function rR(e,t){if(!arguments.length)return Array.from(this,nR);var n=t?tR:eR,r=this._parents,i=this._groups;typeof e!="function"&&(e=ZT(e));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),u=0;u<o;++u){var p=r[u],d=i[u],f=d.length,h=iR(e.call(p,p&&p.__data__,u,r)),m=h.length,b=a[u]=new Array(m),S=s[u]=new Array(m),g=c[u]=new Array(f);n(p,d,b,S,g,h,t);for(var v=0,y=0,N,j;v<m;++v)if(N=b[v]){for(v>=y&&(y=v+1);!(j=S[y])&&++y<m;);N._next=j||null}}return s=new On(s,r),s._enter=a,s._exit=c,s}function iR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oR(){return new On(this._exit||this._groups.map(XN),this._parents)}function sR(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function aR(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var u=n[c],p=r[c],d=u.length,f=a[c]=new Array(d),h,m=0;m<d;++m)(h=u[m]||p[m])&&(f[m]=h);for(;c<i;++c)a[c]=n[c];return new On(a,this._parents)}function lR(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function cR(e){e||(e=uR);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),u,p=0;p<a;++p)(u=s[p])&&(c[p]=u);c.sort(t)}return new On(i,this._parents).order()}function uR(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fR(){return Array.from(this)}function pR(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function hR(){let e=0;for(const t of this)++e;return e}function mR(){return!this.node()}function gR(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function yR(e){return function(){this.removeAttribute(e)}}function xR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wR(e,t){return function(){this.setAttribute(e,t)}}function vR(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function SR(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 kR(e,t){var n=fp(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?xR:yR:typeof t=="function"?n.local?SR:bR:n.local?vR:wR)(n,t))}function QN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function NR(e){return function(){this.style.removeProperty(e)}}function CR(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ER(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function jR(e,t,n){return arguments.length>1?this.each((t==null?NR:typeof t=="function"?ER:CR)(e,t,n??"")):ua(this.node(),e)}function ua(e,t){return e.style.getPropertyValue(t)||QN(e).getComputedStyle(e,null).getPropertyValue(t)}function PR(e){return function(){delete this[e]}}function _R(e,t){return function(){this[e]=t}}function IR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function AR(e,t){return arguments.length>1?this.each((t==null?PR:typeof t=="function"?IR:_R)(e,t)):this.node()[e]}function JN(e){return e.trim().split(/^|\s+/)}function ox(e){return e.classList||new ZN(e)}function ZN(e){this._node=e,this._names=JN(e.getAttribute("class")||"")}ZN.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 eC(e,t){for(var n=ox(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function tC(e,t){for(var n=ox(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function TR(e){return function(){eC(this,e)}}function RR(e){return function(){tC(this,e)}}function LR(e,t){return function(){(t.apply(this,arguments)?eC:tC)(this,e)}}function OR(e,t){var n=JN(e+"");if(arguments.length<2){for(var r=ox(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?LR:t?TR:RR)(n,t))}function MR(){this.textContent=""}function DR(e){return function(){this.textContent=e}}function FR(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $R(e){return arguments.length?this.each(e==null?MR:(typeof e=="function"?FR:DR)(e)):this.node().textContent}function zR(){this.innerHTML=""}function BR(e){return function(){this.innerHTML=e}}function HR(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function UR(e){return arguments.length?this.each(e==null?zR:(typeof e=="function"?HR:BR)(e)):this.node().innerHTML}function VR(){this.nextSibling&&this.parentNode.appendChild(this)}function WR(){return this.each(VR)}function KR(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function YR(){return this.each(KR)}function qR(e){var t=typeof e=="function"?e:KN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GR(){return null}function XR(e,t){var n=typeof e=="function"?e:KN(e),r=t==null?GR:typeof t=="function"?t:ix(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function QR(){var e=this.parentNode;e&&e.removeChild(this)}function JR(){return this.each(QR)}function ZR(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tL(e){return this.select(e?eL:ZR)}function nL(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rL(e){return function(t){e.call(this,t,this.__data__)}}function iL(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function oL(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function sL(e,t,n){return function(){var r=this.__on,i,o=rL(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function aL(e,t,n){var r=iL(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,u=a.length,p;c<u;++c)for(i=0,p=a[c];i<o;++i)if((s=r[i]).type===p.type&&s.name===p.name)return p.value}return}for(a=t?sL:oL,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function nC(e,t,n){var r=QN(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function lL(e,t){return function(){return nC(this,e,t)}}function cL(e,t){return function(){return nC(this,e,t.apply(this,arguments))}}function uL(e,t){return this.each((typeof t=="function"?cL:lL)(e,t))}function*dL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var rC=[null];function On(e,t){this._groups=e,this._parents=t}function Wc(){return new On([[document.documentElement]],rC)}function fL(){return this}On.prototype=Wc.prototype={constructor:On,select:FT,selectAll:HT,selectChild:KT,selectChildren:XT,filter:QT,data:rR,enter:JT,exit:oR,join:sR,merge:aR,selection:fL,order:lR,sort:cR,call:dR,nodes:fR,node:pR,size:hR,empty:mR,each:gR,attr:kR,style:jR,property:AR,classed:OR,text:$R,html:UR,raise:WR,lower:YR,append:qR,insert:XR,remove:JR,clone:tL,datum:nL,on:aL,dispatch:uL,[Symbol.iterator]:dL};function _n(e){return typeof e=="string"?new On([[document.querySelector(e)]],[document.documentElement]):new On([[e]],rC)}function pL(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ar(e,t){if(e=pL(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const hL={passive:!1},wc={capture:!0,passive:!1};function Fh(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function iC(e){var t=e.document.documentElement,n=_n(e).on("dragstart.drag",Js,wc);"onselectstart"in t?n.on("selectstart.drag",Js,wc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function oC(e,t){var n=e.document.documentElement,r=_n(e).on("dragstart.drag",null);t&&(r.on("click.drag",Js,wc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const id=e=>()=>e;function kg(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:c,dy:u,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:p}})}kg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mL(e){return!e.ctrlKey&&!e.button}function gL(){return this.parentNode}function yL(e,t){return t??{x:e.x,y:e.y}}function xL(){return navigator.maxTouchPoints||"ontouchstart"in this}function sC(){var e=mL,t=gL,n=yL,r=xL,i={},o=dp("start","drag","end"),s=0,a,c,u,p,d=0;function f(N){N.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",g,hL).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(N,j){if(!(p||!e.call(this,N,j))){var k=y(this,t.call(this,N,j),N,j,"mouse");k&&(_n(N.view).on("mousemove.drag",m,wc).on("mouseup.drag",b,wc),iC(N.view),Fh(N),u=!1,a=N.clientX,c=N.clientY,k("start",N))}}function m(N){if(Js(N),!u){var j=N.clientX-a,k=N.clientY-c;u=j*j+k*k>d}i.mouse("drag",N)}function b(N){_n(N.view).on("mousemove.drag mouseup.drag",null),oC(N.view,u),Js(N),i.mouse("end",N)}function S(N,j){if(e.call(this,N,j)){var k=N.changedTouches,_=t.call(this,N,j),R=k.length,M,H;for(M=0;M<R;++M)(H=y(this,_,N,j,k[M].identifier,k[M]))&&(Fh(N),H("start",N,k[M]))}}function g(N){var j=N.changedTouches,k=j.length,_,R;for(_=0;_<k;++_)(R=i[j[_].identifier])&&(Js(N),R("drag",N,j[_]))}function v(N){var j=N.changedTouches,k=j.length,_,R;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),_=0;_<k;++_)(R=i[j[_].identifier])&&(Fh(N),R("end",N,j[_]))}function y(N,j,k,_,R,M){var H=o.copy(),P=ar(M||k,j),T,V,L;if((L=n.call(N,new kg("beforestart",{sourceEvent:k,target:f,identifier:R,active:s,x:P[0],y:P[1],dx:0,dy:0,dispatch:H}),_))!=null)return T=L.x-P[0]||0,V=L.y-P[1]||0,function B(F,$,I){var A=P,E;switch(F){case"start":i[R]=B,E=s++;break;case"end":delete i[R],--s;case"drag":P=ar(I||$,j),E=s;break}H.call(F,N,new kg(F,{sourceEvent:$,subject:L,target:f,identifier:R,active:E,x:P[0]+T,y:P[1]+V,dx:P[0]-A[0],dy:P[1]-A[1],dispatch:H}),_)}}return f.filter=function(N){return arguments.length?(e=typeof N=="function"?N:id(!!N),f):e},f.container=function(N){return arguments.length?(t=typeof N=="function"?N:id(N),f):t},f.subject=function(N){return arguments.length?(n=typeof N=="function"?N:id(N),f):n},f.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:id(!!N),f):r},f.on=function(){var N=o.on.apply(o,arguments);return N===o?f:N},f.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,f):Math.sqrt(d)},f}function sx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function aC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Kc(){}var vc=.7,bf=1/vc,Zs="\\s*([+-]?\\d+)\\s*",bc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wL=/^#([0-9a-f]{3,8})$/,vL=new RegExp(`^rgb\\(${Zs},${Zs},${Zs}\\)$`),bL=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),SL=new RegExp(`^rgba\\(${Zs},${Zs},${Zs},${bc}\\)$`),kL=new RegExp(`^rgba\\(${Br},${Br},${Br},${bc}\\)$`),NL=new RegExp(`^hsl\\(${bc},${Br},${Br}\\)$`),CL=new RegExp(`^hsla\\(${bc},${Br},${Br},${bc}\\)$`),Q0={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};sx(Kc,Go,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:J0,formatHex:J0,formatHex8:EL,formatHsl:jL,formatRgb:Z0,toString:Z0});function J0(){return this.rgb().formatHex()}function EL(){return this.rgb().formatHex8()}function jL(){return lC(this).formatHsl()}function Z0(){return this.rgb().formatRgb()}function Go(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wL.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ev(t):n===3?new gn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?od(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?od(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=vL.exec(e))?new gn(t[1],t[2],t[3],1):(t=bL.exec(e))?new gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=SL.exec(e))?od(t[1],t[2],t[3],t[4]):(t=kL.exec(e))?od(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=NL.exec(e))?rv(t[1],t[2]/100,t[3]/100,1):(t=CL.exec(e))?rv(t[1],t[2]/100,t[3]/100,t[4]):Q0.hasOwnProperty(e)?ev(Q0[e]):e==="transparent"?new gn(NaN,NaN,NaN,0):null}function ev(e){return new gn(e>>16&255,e>>8&255,e&255,1)}function od(e,t,n,r){return r<=0&&(e=t=n=NaN),new gn(e,t,n,r)}function PL(e){return e instanceof Kc||(e=Go(e)),e?(e=e.rgb(),new gn(e.r,e.g,e.b,e.opacity)):new gn}function Ng(e,t,n,r){return arguments.length===1?PL(e):new gn(e,t,n,r??1)}function gn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sx(gn,Ng,aC(Kc,{brighter(e){return e=e==null?bf:Math.pow(bf,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vc:Math.pow(vc,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gn(zo(this.r),zo(this.g),zo(this.b),Sf(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:tv,formatHex:tv,formatHex8:_L,formatRgb:nv,toString:nv}));function tv(){return`#${Do(this.r)}${Do(this.g)}${Do(this.b)}`}function _L(){return`#${Do(this.r)}${Do(this.g)}${Do(this.b)}${Do((isNaN(this.opacity)?1:this.opacity)*255)}`}function nv(){const e=Sf(this.opacity);return`${e===1?"rgb(":"rgba("}${zo(this.r)}, ${zo(this.g)}, ${zo(this.b)}${e===1?")":`, ${e})`}`}function Sf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Do(e){return e=zo(e),(e<16?"0":"")+e.toString(16)}function rv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ur(e,t,n,r)}function lC(e){if(e instanceof ur)return new ur(e.h,e.s,e.l,e.opacity);if(e instanceof Kc||(e=Go(e)),!e)return new ur;if(e instanceof ur)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new ur(s,a,c,e.opacity)}function IL(e,t,n,r){return arguments.length===1?lC(e):new ur(e,t,n,r??1)}function ur(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sx(ur,IL,aC(Kc,{brighter(e){return e=e==null?bf:Math.pow(bf,e),new ur(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vc:Math.pow(vc,e),new ur(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new gn($h(e>=240?e-240:e+120,i,r),$h(e,i,r),$h(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ur(iv(this.h),sd(this.s),sd(this.l),Sf(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=Sf(this.opacity);return`${e===1?"hsl(":"hsla("}${iv(this.h)}, ${sd(this.s)*100}%, ${sd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iv(e){return e=(e||0)%360,e<0?e+360:e}function sd(e){return Math.max(0,Math.min(1,e||0))}function $h(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 ax=e=>()=>e;function AL(e,t){return function(n){return e+n*t}}function TL(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function RL(e){return(e=+e)==1?cC:function(t,n){return n-t?TL(t,n,e):ax(isNaN(t)?n:t)}}function cC(e,t){var n=t-e;return n?AL(e,n):ax(isNaN(e)?t:e)}const kf=function e(t){var n=RL(t);function r(i,o){var s=n((i=Ng(i)).r,(o=Ng(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),u=cC(i.opacity,o.opacity);return function(p){return i.r=s(p),i.g=a(p),i.b=c(p),i.opacity=u(p),i+""}}return r.gamma=e,r}(1);function LL(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function OL(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ML(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=ql(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function DL(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Rr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function FL(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ql(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Cg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zh=new RegExp(Cg.source,"g");function $L(e){return function(){return e}}function zL(e){return function(t){return e(t)+""}}function uC(e,t){var n=Cg.lastIndex=zh.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=Cg.exec(e))&&(i=zh.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Rr(r,i)})),n=zh.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?zL(c[0].x):$L(t):(t=c.length,function(u){for(var p=0,d;p<t;++p)a[(d=c[p]).i]=d.x(u);return a.join("")})}function ql(e,t){var n=typeof t,r;return t==null||n==="boolean"?ax(t):(n==="number"?Rr:n==="string"?(r=Go(t))?(t=r,kf):uC:t instanceof Go?kf:t instanceof Date?DL:OL(t)?LL:Array.isArray(t)?ML:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?FL:Rr)(e,t)}var ov=180/Math.PI,Eg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dC(e,t,n,r,i,o){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*ov,skewX:Math.atan(c)*ov,scaleX:s,scaleY:a}}var ad;function BL(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Eg:dC(t.a,t.b,t.c,t.d,t.e,t.f)}function HL(e){return e==null||(ad||(ad=document.createElementNS("http://www.w3.org/2000/svg","g")),ad.setAttribute("transform",e),!(e=ad.transform.baseVal.consolidate()))?Eg:(e=e.matrix,dC(e.a,e.b,e.c,e.d,e.e,e.f))}function fC(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,p,d,f,h,m){if(u!==d||p!==f){var b=h.push("translate(",null,t,null,n);m.push({i:b-4,x:Rr(u,d)},{i:b-2,x:Rr(p,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,p,d,f){u!==p?(u-p>180?p+=360:p-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Rr(u,p)})):p&&d.push(i(d)+"rotate("+p+r)}function a(u,p,d,f){u!==p?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Rr(u,p)}):p&&d.push(i(d)+"skewX("+p+r)}function c(u,p,d,f,h,m){if(u!==d||p!==f){var b=h.push(i(h)+"scale(",null,",",null,")");m.push({i:b-4,x:Rr(u,d)},{i:b-2,x:Rr(p,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,p){var d=[],f=[];return u=e(u),p=e(p),o(u.translateX,u.translateY,p.translateX,p.translateY,d,f),s(u.rotate,p.rotate,d,f),a(u.skewX,p.skewX,d,f),c(u.scaleX,u.scaleY,p.scaleX,p.scaleY,d,f),u=p=null,function(h){for(var m=-1,b=f.length,S;++m<b;)d[(S=f[m]).i]=S.x(h);return d.join("")}}}var UL=fC(BL,"px, ","px)","deg)"),VL=fC(HL,", ",")",")"),WL=1e-12;function sv(e){return((e=Math.exp(e))+1/e)/2}function KL(e){return((e=Math.exp(e))-1/e)/2}function YL(e){return((e=Math.exp(2*e))-1)/(e+1)}const $d=function e(t,n,r){function i(o,s){var a=o[0],c=o[1],u=o[2],p=s[0],d=s[1],f=s[2],h=p-a,m=d-c,b=h*h+m*m,S,g;if(b<WL)g=Math.log(f/u)/t,S=function(_){return[a+_*h,c+_*m,u*Math.exp(t*_*g)]};else{var v=Math.sqrt(b),y=(f*f-u*u+r*b)/(2*u*n*v),N=(f*f-u*u-r*b)/(2*f*n*v),j=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(N*N+1)-N);g=(k-j)/t,S=function(_){var R=_*g,M=sv(j),H=u/(n*v)*(M*YL(t*R+j)-KL(j));return[a+H*h,c+H*m,u*M/sv(t*R+j)]}}return S.duration=g*1e3*t/Math.SQRT2,S}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,c=a*a;return e(s,a,c)},i}(Math.SQRT2,2,4);var da=0,Ol=0,Sl=0,pC=1e3,Nf,Ml,Cf=0,Xo=0,pp=0,Sc=typeof performance=="object"&&performance.now?performance:Date,hC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lx(){return Xo||(hC(qL),Xo=Sc.now()+pp)}function qL(){Xo=0}function Ef(){this._call=this._time=this._next=null}Ef.prototype=mC.prototype={constructor:Ef,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lx():+n)+(t==null?0:+t),!this._next&&Ml!==this&&(Ml?Ml._next=this:Nf=this,Ml=this),this._call=e,this._time=n,jg()},stop:function(){this._call&&(this._call=null,this._time=1/0,jg())}};function mC(e,t,n){var r=new Ef;return r.restart(e,t,n),r}function GL(){lx(),++da;for(var e=Nf,t;e;)(t=Xo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--da}function av(){Xo=(Cf=Sc.now())+pp,da=Ol=0;try{GL()}finally{da=0,QL(),Xo=0}}function XL(){var e=Sc.now(),t=e-Cf;t>pC&&(pp-=t,Cf=e)}function QL(){for(var e,t=Nf,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Nf=n);Ml=e,jg(r)}function jg(e){if(!da){Ol&&(Ol=clearTimeout(Ol));var t=e-Xo;t>24?(e<1/0&&(Ol=setTimeout(av,e-Sc.now()-pp)),Sl&&(Sl=clearInterval(Sl))):(Sl||(Cf=Sc.now(),Sl=setInterval(XL,pC)),da=1,hC(av))}}function lv(e,t,n){var r=new Ef;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var JL=dp("start","end","cancel","interrupt"),ZL=[],gC=0,cv=1,Pg=2,zd=3,uv=4,_g=5,Bd=6;function hp(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;eO(e,n,{name:t,index:r,group:i,on:JL,tween:ZL,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:gC})}function cx(e,t){var n=xr(e,t);if(n.state>gC)throw new Error("too late; already scheduled");return n}function Yr(e,t){var n=xr(e,t);if(n.state>zd)throw new Error("too late; already running");return n}function xr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eO(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=mC(o,0,n.time);function o(u){n.state=cv,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var p,d,f,h;if(n.state!==cv)return c();for(p in r)if(h=r[p],h.name===n.name){if(h.state===zd)return lv(s);h.state===uv?(h.state=Bd,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[p]):+p<t&&(h.state=Bd,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[p])}if(lv(function(){n.state===zd&&(n.state=uv,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Pg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Pg){for(n.state=zd,i=new Array(f=n.tween.length),p=0,d=-1;p<f;++p)(h=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function a(u){for(var p=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=_g,1),d=-1,f=i.length;++d<f;)i[d].call(e,p);n.state===_g&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Bd,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Hd(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Pg&&r.state<_g,r.state=Bd,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function tO(e){return this.each(function(){Hd(this,e)})}function nO(e,t){var n,r;return function(){var i=Yr(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function rO(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Yr(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=a;break}c===u&&i.push(a)}o.tween=i}}function iO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=xr(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?nO:rO)(n,e,t))}function ux(e,t,n){var r=e._id;return e.each(function(){var i=Yr(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return xr(i,r).value[t]}}function yC(e,t){var n;return(typeof t=="number"?Rr:t instanceof Go?kf:(n=Go(t))?(t=n,kf):uC)(e,t)}function oO(e){return function(){this.removeAttribute(e)}}function sO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aO(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function lO(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function cO(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function uO(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function dO(e,t){var n=fp(e),r=n==="transform"?VL:yC;return this.attrTween(e,typeof t=="function"?(n.local?uO:cO)(n,r,ux(this,"attr."+e,t)):t==null?(n.local?sO:oO)(n):(n.local?lO:aO)(n,r,t))}function fO(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pO(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hO(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&pO(e,o)),n}return i._value=t,i}function mO(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&fO(e,o)),n}return i._value=t,i}function gO(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=fp(e);return this.tween(n,(r.local?hO:mO)(r,t))}function yO(e,t){return function(){cx(this,e).delay=+t.apply(this,arguments)}}function xO(e,t){return t=+t,function(){cx(this,e).delay=t}}function wO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yO:xO)(t,e)):xr(this.node(),t).delay}function vO(e,t){return function(){Yr(this,e).duration=+t.apply(this,arguments)}}function bO(e,t){return t=+t,function(){Yr(this,e).duration=t}}function SO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vO:bO)(t,e)):xr(this.node(),t).duration}function kO(e,t){if(typeof t!="function")throw new Error;return function(){Yr(this,e).ease=t}}function NO(e){var t=this._id;return arguments.length?this.each(kO(t,e)):xr(this.node(),t).ease}function CO(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yr(this,e).ease=n}}function EO(e){if(typeof e!="function")throw new Error;return this.each(CO(this._id,e))}function jO(e){typeof e!="function"&&(e=qN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,u=0;u<s;++u)(c=o[u])&&e.call(c,c.__data__,u,o)&&a.push(c);return new xi(r,this._parents,this._name,this._id)}function PO(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=t[a],u=n[a],p=c.length,d=s[a]=new Array(p),f,h=0;h<p;++h)(f=c[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new xi(s,this._parents,this._name,this._id)}function _O(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 IO(e,t,n){var r,i,o=_O(t)?cx:Yr;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function AO(e,t){var n=this._id;return arguments.length<2?xr(this.node(),n).on.on(e):this.each(IO(n,e,t))}function TO(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RO(){return this.on("end.remove",TO(this._id))}function LO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ix(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,u=o[s]=new Array(c),p,d,f=0;f<c;++f)(p=a[f])&&(d=e.call(p,p.__data__,f,a))&&("__data__"in p&&(d.__data__=p.__data__),u[f]=d,hp(u[f],t,n,f,u,xr(p,n)));return new xi(o,this._parents,t,n)}function OO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=YN(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],u=c.length,p,d=0;d<u;++d)if(p=c[d]){for(var f=e.call(p,p.__data__,d,c),h,m=xr(p,n),b=0,S=f.length;b<S;++b)(h=f[b])&&hp(h,t,n,b,f,m);o.push(f),s.push(p)}return new xi(o,s,t,n)}var MO=Wc.prototype.constructor;function DO(){return new MO(this._groups,this._parents)}function FO(e,t){var n,r,i;return function(){var o=ua(this,e),s=(this.style.removeProperty(e),ua(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function xC(e){return function(){this.style.removeProperty(e)}}function $O(e,t,n){var r,i=n+"",o;return function(){var s=ua(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function zO(e,t,n){var r,i,o;return function(){var s=ua(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ua(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function BO(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=Yr(this,e),u=c.on,p=c.value[o]==null?a||(a=xC(t)):void 0;(u!==n||i!==p)&&(r=(n=u).copy()).on(s,i=p),c.on=r}}function HO(e,t,n){var r=(e+="")=="transform"?UL:yC;return t==null?this.styleTween(e,FO(e,r)).on("end.style."+e,xC(e)):typeof t=="function"?this.styleTween(e,zO(e,r,ux(this,"style."+e,t))).each(BO(this._id,e)):this.styleTween(e,$O(e,r,t),n).on("end.style."+e,null)}function UO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function VO(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&UO(e,s,n)),r}return o._value=t,o}function WO(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,VO(e,t,n??""))}function KO(e){return function(){this.textContent=e}}function YO(e){return function(){var t=e(this);this.textContent=t??""}}function qO(e){return this.tween("text",typeof e=="function"?YO(ux(this,"text",e)):KO(e==null?"":e+""))}function GO(e){return function(t){this.textContent=e.call(this,t)}}function XO(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&GO(i)),t}return r._value=e,r}function QO(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,XO(e))}function JO(){for(var e=this._name,t=this._id,n=wC(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,u=0;u<a;++u)if(c=s[u]){var p=xr(c,t);hp(c,e,n,u,s,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new xi(r,this._parents,e,n)}function ZO(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var u=Yr(this,r),p=u.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),u.on=t}),i===0&&o()})}var eM=0;function xi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function wC(){return++eM}var ni=Wc.prototype;xi.prototype={constructor:xi,select:LO,selectAll:OO,selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:jO,merge:PO,selection:DO,transition:JO,call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:AO,attr:dO,attrTween:gO,style:HO,styleTween:WO,text:qO,textTween:QO,remove:RO,tween:iO,delay:wO,duration:SO,ease:NO,easeVarying:EO,end:ZO,[Symbol.iterator]:ni[Symbol.iterator]};function tM(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nM={time:null,delay:0,duration:250,ease:tM};function rM(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 iM(e){var t,n;e instanceof xi?(t=e._id,e=e._name):(t=wC(),(n=nM).time=lx(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,u=0;u<a;++u)(c=s[u])&&hp(c,e,t,u,s,n||rM(c,t));return new xi(r,this._parents,e,t)}Wc.prototype.interrupt=tO;Wc.prototype.transition=iM;const ld=e=>()=>e;function oM(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function di(e,t,n){this.k=e,this.x=t,this.y=n}di.prototype={constructor:di,scale:function(e){return e===1?this:new di(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new di(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 mp=new di(1,0,0);vC.prototype=di.prototype;function vC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return mp;return e.__zoom}function Bh(e){e.stopImmediatePropagation()}function kl(e){e.preventDefault(),e.stopImmediatePropagation()}function sM(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function aM(){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 dv(){return this.__zoom||mp}function lM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cM(){return navigator.maxTouchPoints||"ontouchstart"in this}function uM(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function bC(){var e=sM,t=aM,n=uM,r=lM,i=cM,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=$d,u=dp("start","zoom","end"),p,d,f,h=500,m=150,b=0,S=10;function g(L){L.property("__zoom",dv).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",H).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(L,B,F,$){var I=L.selection?L.selection():L;I.property("__zoom",dv),L!==I?j(L,B,F,$):I.interrupt().each(function(){k(this,arguments).event($).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},g.scaleBy=function(L,B,F,$){g.scaleTo(L,function(){var I=this.__zoom.k,A=typeof B=="function"?B.apply(this,arguments):B;return I*A},F,$)},g.scaleTo=function(L,B,F,$){g.transform(L,function(){var I=t.apply(this,arguments),A=this.__zoom,E=F==null?N(I):typeof F=="function"?F.apply(this,arguments):F,z=A.invert(E),U=typeof B=="function"?B.apply(this,arguments):B;return n(y(v(A,U),E,z),I,s)},F,$)},g.translateBy=function(L,B,F,$){g.transform(L,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof F=="function"?F.apply(this,arguments):F),t.apply(this,arguments),s)},null,$)},g.translateTo=function(L,B,F,$,I){g.transform(L,function(){var A=t.apply(this,arguments),E=this.__zoom,z=$==null?N(A):typeof $=="function"?$.apply(this,arguments):$;return n(mp.translate(z[0],z[1]).scale(E.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof F=="function"?-F.apply(this,arguments):-F),A,s)},$,I)};function v(L,B){return B=Math.max(o[0],Math.min(o[1],B)),B===L.k?L:new di(B,L.x,L.y)}function y(L,B,F){var $=B[0]-F[0]*L.k,I=B[1]-F[1]*L.k;return $===L.x&&I===L.y?L:new di(L.k,$,I)}function N(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function j(L,B,F,$){L.on("start.zoom",function(){k(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event($).end()}).tween("zoom",function(){var I=this,A=arguments,E=k(I,A).event($),z=t.apply(I,A),U=F==null?N(z):typeof F=="function"?F.apply(I,A):F,O=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),q=I.__zoom,Z=typeof B=="function"?B.apply(I,A):B,te=c(q.invert(U).concat(O/q.k),Z.invert(U).concat(O/Z.k));return function(ae){if(ae===1)ae=Z;else{var ee=te(ae),ue=O/ee[2];ae=new di(ue,U[0]-ee[0]*ue,U[1]-ee[1]*ue)}E.zoom(null,ae)}})}function k(L,B,F){return!F&&L.__zooming||new _(L,B)}function _(L,B){this.that=L,this.args=B,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,B),this.taps=0}_.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,B){return this.mouse&&L!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var B=_n(this.that).datum();u.call(L,this.that,new oM(L,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),B)}};function R(L,...B){if(!e.apply(this,arguments))return;var F=k(this,B).event(L),$=this.__zoom,I=Math.max(o[0],Math.min(o[1],$.k*Math.pow(2,r.apply(this,arguments)))),A=ar(L);if(F.wheel)(F.mouse[0][0]!==A[0]||F.mouse[0][1]!==A[1])&&(F.mouse[1]=$.invert(F.mouse[0]=A)),clearTimeout(F.wheel);else{if($.k===I)return;F.mouse=[A,$.invert(A)],Hd(this),F.start()}kl(L),F.wheel=setTimeout(E,m),F.zoom("mouse",n(y(v($,I),F.mouse[0],F.mouse[1]),F.extent,s));function E(){F.wheel=null,F.end()}}function M(L,...B){if(f||!e.apply(this,arguments))return;var F=L.currentTarget,$=k(this,B,!0).event(L),I=_n(L.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",O,!0),A=ar(L,F),E=L.clientX,z=L.clientY;iC(L.view),Bh(L),$.mouse=[A,this.__zoom.invert(A)],Hd(this),$.start();function U(q){if(kl(q),!$.moved){var Z=q.clientX-E,te=q.clientY-z;$.moved=Z*Z+te*te>b}$.event(q).zoom("mouse",n(y($.that.__zoom,$.mouse[0]=ar(q,F),$.mouse[1]),$.extent,s))}function O(q){I.on("mousemove.zoom mouseup.zoom",null),oC(q.view,$.moved),kl(q),$.event(q).end()}}function H(L,...B){if(e.apply(this,arguments)){var F=this.__zoom,$=ar(L.changedTouches?L.changedTouches[0]:L,this),I=F.invert($),A=F.k*(L.shiftKey?.5:2),E=n(y(v(F,A),$,I),t.apply(this,B),s);kl(L),a>0?_n(this).transition().duration(a).call(j,E,$,L):_n(this).call(g.transform,E,$,L)}}function P(L,...B){if(e.apply(this,arguments)){var F=L.touches,$=F.length,I=k(this,B,L.changedTouches.length===$).event(L),A,E,z,U;for(Bh(L),E=0;E<$;++E)z=F[E],U=ar(z,this),U=[U,this.__zoom.invert(U),z.identifier],I.touch0?!I.touch1&&I.touch0[2]!==U[2]&&(I.touch1=U,I.taps=0):(I.touch0=U,A=!0,I.taps=1+!!p);p&&(p=clearTimeout(p)),A&&(I.taps<2&&(d=U[0],p=setTimeout(function(){p=null},h)),Hd(this),I.start())}}function T(L,...B){if(this.__zooming){var F=k(this,B).event(L),$=L.changedTouches,I=$.length,A,E,z,U;for(kl(L),A=0;A<I;++A)E=$[A],z=ar(E,this),F.touch0&&F.touch0[2]===E.identifier?F.touch0[0]=z:F.touch1&&F.touch1[2]===E.identifier&&(F.touch1[0]=z);if(E=F.that.__zoom,F.touch1){var O=F.touch0[0],q=F.touch0[1],Z=F.touch1[0],te=F.touch1[1],ae=(ae=Z[0]-O[0])*ae+(ae=Z[1]-O[1])*ae,ee=(ee=te[0]-q[0])*ee+(ee=te[1]-q[1])*ee;E=v(E,Math.sqrt(ae/ee)),z=[(O[0]+Z[0])/2,(O[1]+Z[1])/2],U=[(q[0]+te[0])/2,(q[1]+te[1])/2]}else if(F.touch0)z=F.touch0[0],U=F.touch0[1];else return;F.zoom("touch",n(y(E,z,U),F.extent,s))}}function V(L,...B){if(this.__zooming){var F=k(this,B).event(L),$=L.changedTouches,I=$.length,A,E;for(Bh(L),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),A=0;A<I;++A)E=$[A],F.touch0&&F.touch0[2]===E.identifier?delete F.touch0:F.touch1&&F.touch1[2]===E.identifier&&delete F.touch1;if(F.touch1&&!F.touch0&&(F.touch0=F.touch1,delete F.touch1),F.touch0)F.touch0[1]=this.__zoom.invert(F.touch0[0]);else if(F.end(),F.taps===2&&(E=ar(E,this),Math.hypot(d[0]-E[0],d[1]-E[1])<S)){var z=_n(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return g.wheelDelta=function(L){return arguments.length?(r=typeof L=="function"?L:ld(+L),g):r},g.filter=function(L){return arguments.length?(e=typeof L=="function"?L:ld(!!L),g):e},g.touchable=function(L){return arguments.length?(i=typeof L=="function"?L:ld(!!L),g):i},g.extent=function(L){return arguments.length?(t=typeof L=="function"?L:ld([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),g):t},g.scaleExtent=function(L){return arguments.length?(o[0]=+L[0],o[1]=+L[1],g):[o[0],o[1]]},g.translateExtent=function(L){return arguments.length?(s[0][0]=+L[0][0],s[1][0]=+L[1][0],s[0][1]=+L[0][1],s[1][1]=+L[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(L){return arguments.length?(n=L,g):n},g.duration=function(L){return arguments.length?(a=+L,g):a},g.interpolate=function(L){return arguments.length?(c=L,g):c},g.on=function(){var L=u.on.apply(u,arguments);return L===u?g:L},g.clickDistance=function(L){return arguments.length?(b=(L=+L)*L,g):Math.sqrt(b)},g.tapDistance=function(L){return arguments.length?(S=+L,g):S},g}const Wr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},kc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],SC=["Enter"," ","Escape"],kC={"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 fa;(function(e){e.Strict="strict",e.Loose="loose"})(fa||(fa={}));var Bo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Bo||(Bo={}));var Nc;(function(e){e.Partial="partial",e.Full="full"})(Nc||(Nc={}));const NC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Fi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Fi||(Fi={}));var to;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(to||(to={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const fv={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function CC(e){return e===null?null:e?"valid":"invalid"}const EC=e=>"id"in e&&"source"in e&&"target"in e,dM=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),dx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Yc=(e,t=[0,0])=>{const{width:n,height:r}=Si(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},fM=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):dx(i)?i:t.nodeLookup.get(i.id));const a=s?jf(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return gp(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yp(n)},qc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=gp(n,jf(i)),r=!0)}),r?yp(n):{x:0,y:0,width:0,height:0}},fx=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const a={...Xc(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const u of e.values()){const{measured:p,selectable:d=!0,hidden:f=!1}=u;if(s&&!d||f)continue;const h=p.width??u.width??u.initialWidth??null,m=p.height??u.height??u.initialHeight??null,b=Cc(a,ha(u)),S=(h??0)*(m??0),g=o&&b>0;(!u.internals.handleBounds||g||b>=S||u.dragging)&&c.push(u)}return c},pM=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function hM(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function mM({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const a=hM(e,s),c=qc(a),u=px(c,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function jC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},p=s.origin??r;let d=s.extent||i;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",Wr.error005());else{const h=a.measured.width,m=a.measured.height;h&&m&&(d=[[c,u],[c+h,u+m]])}else a&&ma(s.extent)&&(d=[[s.extent[0][0]+c,s.extent[0][1]+u],[s.extent[1][0]+c,s.extent[1][1]+u]]);const f=ma(d)?Qo(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",Wr.error015())),{position:{x:f.x-c+(s.measured.width??0)*p[0],y:f.y-u+(s.measured.height??0)*p[1]},positionAbsolute:f}}async function gM({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=o.has(f.id),m=!h&&f.parentId&&s.find(b=>b.id===f.parentId);(h||m)&&s.push(f)}const a=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),p=pM(s,c);for(const f of c)a.has(f.id)&&!p.find(m=>m.id===f.id)&&p.push(f);if(!i)return{edges:p,nodes:s};const d=await i({nodes:s,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:s}:{edges:[],nodes:[]}:d}const pa=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qo=(e={x:0,y:0},t,n)=>({x:pa(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:pa(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function PC(e,t,n){const{width:r,height:i}=Si(n),{x:o,y:s}=n.internals.positionAbsolute;return Qo(e,[[o,s],[o+r,s+i]],t)}const pv=(e,t,n)=>e<t?pa(Math.abs(e-t),1,t)/t:e>n?-pa(Math.abs(e-n),1,t)/t:0,_C=(e,t,n=15,r=40)=>{const i=pv(e.x,r,t.width-r)*n,o=pv(e.y,r,t.height-r)*n;return[i,o]},gp=(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)}),Ig=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),yp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ha=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=dx(e)?e.internals.positionAbsolute:Yc(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},jf=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=dx(e)?e.internals.positionAbsolute:Yc(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},IC=(e,t)=>yp(gp(Ig(e),Ig(t))),Cc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},hv=e=>dr(e.width)&&dr(e.height)&&dr(e.x)&&dr(e.y),dr=e=>!isNaN(e)&&isFinite(e),yM=(e,t)=>{},Gc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xc=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return o?Gc(a,s):a},Pf=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ss(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function xM(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ss(e,n),i=Ss(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ss(e.top??e.y??0,n),i=Ss(e.bottom??e.y??0,n),o=Ss(e.left??e.x??0,t),s=Ss(e.right??e.x??0,t);return{top:r,right:s,bottom:i,left:o,x:o+s,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function wM(e,t,n,r,i,o){const{x:s,y:a}=Pf(e,[t,n,r]),{x:c,y:u}=Pf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=i-c,d=o-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(p),bottom:Math.floor(d)}}const px=(e,t,n,r,i,o)=>{const s=xM(o,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,u=Math.min(a,c),p=pa(u,r,i),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*p,m=n/2-f*p,b=wM(e,h,m,p,t,n),S={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:h-S.left+S.right,y:m-S.top+S.bottom,zoom:p}},Ec=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ma(e){return e!=null&&e!=="parent"}function Si(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 AC(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 TC(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const a=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function mv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function vM(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function bM(e){return{...kC,...e||{}}}function Gl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=fr(e),a=Xc({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:c,y:u}=n?Gc(a,t):a;return{xSnapped:c,ySnapped:u,...a}}const hx=e=>({width:e.offsetWidth,height:e.offsetHeight}),RC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},SM=["INPUT","SELECT","TEXTAREA"];function LC(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:SM.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const OC=e=>"clientX"in e,fr=(e,t)=>{var o,s;const n=OC(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},gv=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...hx(s)}})};function MC({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const c=e*.125+i*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+r*.125,p=Math.abs(c-e),d=Math.abs(u-t);return[c,u,p,d]}function cd(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yv({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case be.Left:return[t-cd(t-r,o),n];case be.Right:return[t+cd(r-t,o),n];case be.Top:return[t,n-cd(n-i,o)];case be.Bottom:return[t,n+cd(i-n,o)]}}function DC({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top,curvature:s=.25}){const[a,c]=yv({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,p]=yv({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,m]=MC({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:p});return[`M${e},${t} C${a},${c} ${u},${p} ${r},${i}`,d,f,h,m]}function FC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function kM({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const s=i&&n?r+1e3:r,a=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return s+a}function NM({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=gp(jf(e),jf(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Cc(s,yp(o))>0}const CM=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,EM=(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)),$C=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||CM;let i;return EC(e)?i={...e}:i={...e,id:r(e)},EM(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function zC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=FC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const xv={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},jM=({source:e,sourcePosition:t=be.Bottom,target:n})=>t===be.Left||t===be.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},wv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function PM({source:e,sourcePosition:t=be.Bottom,target:n,targetPosition:r=be.Top,center:i,offset:o,stepPosition:s}){const a=xv[t],c=xv[r],u={x:e.x+a.x*o,y:e.y+a.y*o},p={x:n.x+c.x*o,y:n.y+c.y*o},d=jM({source:u,sourcePosition:t,target:p}),f=d.x!==0?"x":"y",h=d[f];let m=[],b,S;const g={x:0,y:0},v={x:0,y:0},[,,y,N]=FC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*c[f]===-1){f==="x"?(b=i.x??u.x+(p.x-u.x)*s,S=i.y??(u.y+p.y)/2):(b=i.x??(u.x+p.x)/2,S=i.y??u.y+(p.y-u.y)*s);const R=[{x:b,y:u.y},{x:b,y:p.y}],M=[{x:u.x,y:S},{x:p.x,y:S}];a[f]===h?m=f==="x"?R:M:m=f==="x"?M:R}else{const R=[{x:u.x,y:p.y}],M=[{x:p.x,y:u.y}];if(f==="x"?m=a.x===h?M:R:m=a.y===h?R:M,t===r){const L=Math.abs(e[f]-n[f]);if(L<=o){const B=Math.min(o-1,o-L);a[f]===h?g[f]=(u[f]>e[f]?-1:1)*B:v[f]=(p[f]>n[f]?-1:1)*B}}if(t!==r){const L=f==="x"?"y":"x",B=a[f]===c[L],F=u[L]>p[L],$=u[L]<p[L];(a[f]===1&&(!B&&F||B&&$)||a[f]!==1&&(!B&&$||B&&F))&&(m=f==="x"?R:M)}const H={x:u.x+g.x,y:u.y+g.y},P={x:p.x+v.x,y:p.y+v.y},T=Math.max(Math.abs(H.x-m[0].x),Math.abs(P.x-m[0].x)),V=Math.max(Math.abs(H.y-m[0].y),Math.abs(P.y-m[0].y));T>=V?(b=(H.x+P.x)/2,S=m[0].y):(b=m[0].x,S=(H.y+P.y)/2)}const j={x:u.x+g.x,y:u.y+g.y},k={x:p.x+v.x,y:p.y+v.y};return[[e,...j.x!==m[0].x||j.y!==m[0].y?[j]:[],...m,...k.x!==m[m.length-1].x||k.y!==m[m.length-1].y?[k]:[],n],b,S,y,N]}function _M(e,t,n,r){const i=Math.min(wv(e,t)/2,wv(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*p}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${o},${s+i*c}Q ${o},${s} ${o+i*a},${s}`}function Ag({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top,borderRadius:s=5,centerX:a,centerY:c,offset:u=20,stepPosition:p=.5}){const[d,f,h,m,b]=PM({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:c},offset:u,stepPosition:p});let S=`M${d[0].x} ${d[0].y}`;for(let g=1;g<d.length-1;g++)S+=_M(d[g-1],d[g],d[g+1],s);return S+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[S,f,h,m,b]}function vv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function IM(e){var d;const{sourceNode:t,targetNode:n}=e;if(!vv(t)||!vv(n))return null;const r=t.internals.handleBounds||bv(t.handles),i=n.internals.handleBounds||bv(n.handles),o=Sv((r==null?void 0:r.source)??[],e.sourceHandle),s=Sv(e.connectionMode===fa.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(d=e.onError)==null||d.call(e,"008",Wr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||be.Bottom,c=(s==null?void 0:s.position)||be.Top,u=Jo(t,o,a),p=Jo(n,s,c);return{sourceX:u.x,sourceY:u.y,targetX:p.x,targetY:p.y,sourcePosition:a,targetPosition:c}}function bv(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Jo(e,t,n=be.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Si(e);if(r)return{x:i+s/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case be.Top:return{x:i+s/2,y:o};case be.Right:return{x:i+s,y:o+a/2};case be.Bottom:return{x:i+s/2,y:o+a};case be.Left:return{x:i,y:o+a/2}}}function Sv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Tg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function AM(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const u=Tg(c,t);o.has(u)||(s.push({id:u,color:c.color||n,...c}),o.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const BC=1e3,TM=10,mx={nodeOrigin:[0,0],nodeExtent:kc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},RM={...mx,checkEquality:!0};function gx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function LM(e,t,n){const r=gx(mx,n);for(const i of e.values())if(i.parentId)xx(i,e,t,r);else{const o=Yc(i,r.nodeOrigin),s=ma(i.extent)?i.extent:r.nodeExtent,a=Qo(o,s,Si(i));i.internals.positionAbsolute=a}}function OM(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const o={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(o):i.type==="target"&&r.push(o)}return{source:n,target:r}}function yx(e){return e==="manual"}function Rg(e,t,n,r={}){var p,d;const i=gx(RM,r),o={i:0},s=new Map(t),a=i!=null&&i.elevateNodesOnSelect&&!yx(i.zIndexMode)?BC:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let h=s.get(f.id);if(i.checkEquality&&f===(h==null?void 0:h.internals.userNode))t.set(f.id,h);else{const m=Yc(f,i.nodeOrigin),b=ma(f.extent)?f.extent:i.nodeExtent,S=Qo(m,b,Si(f));h={...i.defaults,...f,measured:{width:(p=f.measured)==null?void 0:p.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:S,handleBounds:OM(f,h),z:HC(f,a,i.zIndexMode),userNode:f}},t.set(f.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),f.parentId&&xx(h,t,n,r,o),u||(u=f.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function MM(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 xx(e,t,n,r,i){const{elevateNodesOnSelect:o,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=gx(mx,r),u=e.parentId,p=t.get(u);if(!p){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}MM(e,n),i&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++i.i,p.internals.z=p.internals.z+i.i*TM),i&&p.internals.rootParentIndex!==void 0&&(i.i=p.internals.rootParentIndex);const d=o&&!yx(c)?BC:0,{x:f,y:h,z:m}=DM(e,p,s,a,d,c),{positionAbsolute:b}=e.internals,S=f!==b.x||h!==b.y;(S||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:f,y:h}:b,z:m}})}function HC(e,t,n){const r=dr(e.zIndex)?e.zIndex:0;return yx(n)?r:r+(e.selected?t:0)}function DM(e,t,n,r,i,o){const{x:s,y:a}=t.internals.positionAbsolute,c=Si(e),u=Yc(e,n),p=ma(e.extent)?Qo(u,e.extent,c):u;let d=Qo({x:s+p.x,y:a+p.y},r,c);e.extent==="parent"&&(d=PC(d,c,t));const f=HC(e,i,o),h=t.internals.z??0;return{x:d.x,y:d.y,z:h>=f?h+1:f}}function wx(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const a of e){const c=t.get(a.parentId);if(!c)continue;const u=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??ha(c),p=IC(u,a.rect);o.set(a.parentId,{expandedRect:p,parent:c})}return o.size>0&&o.forEach(({expandedRect:a,parent:c},u)=>{var y;const p=c.internals.positionAbsolute,d=Si(c),f=c.origin??r,h=a.x<p.x?Math.round(Math.abs(p.x-a.x)):0,m=a.y<p.y?Math.round(Math.abs(p.y-a.y)):0,b=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),g=(b-d.width)*f[0],v=(S-d.height)*f[1];(h>0||m>0||g||v)&&(i.push({id:u,type:"position",position:{x:c.position.x-h+g,y:c.position.y-m+v}}),(y=n.get(u))==null||y.forEach(N=>{e.some(j=>j.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+h,y:N.position.y+m}})})),(d.width<a.width||d.height<a.height||h||m)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:b+(h?f[0]*h-g:0),height:S+(m?f[1]*m-v:0)}})}),i}function FM(e,t,n,r,i,o,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const u=[],p=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(p.transform),f=[];for(const h of e.values()){const m=t.get(h.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const b=hx(h.nodeElement),S=m.measured.width!==b.width||m.measured.height!==b.height;if(!!(b.width&&b.height&&(S||!m.internals.handleBounds||h.force))){const v=h.nodeElement.getBoundingClientRect(),y=ma(m.extent)?m.extent:o;let{positionAbsolute:N}=m.internals;m.parentId&&m.extent==="parent"?N=PC(N,b,t.get(m.parentId)):y&&(N=Qo(N,y,b));const j={...m,measured:b,internals:{...m.internals,positionAbsolute:N,handleBounds:{source:gv("source",h.nodeElement,v,d,m.id),target:gv("target",h.nodeElement,v,d,m.id)}}};t.set(m.id,j),m.parentId&&xx(j,t,n,{nodeOrigin:i,zIndexMode:s}),c=!0,S&&(u.push({id:m.id,type:"dimensions",dimensions:b}),m.expandParent&&m.parentId&&f.push({id:m.id,parentId:m.parentId,rect:ha(j,i)}))}}if(f.length>0){const h=wx(f,t,n,i);u.push(...h)}return{changes:u,updatedInternals:c}}async function $M({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function kv(e,t,n,r,i,o){let s=i;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${i}-${e}`;const c=r.get(s)||new Map;if(r.set(s,c.set(n,t)),o){s=`${i}-${e}-${o}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function UC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,c={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${o}-${a}`,p=`${o}-${a}--${i}-${s}`;kv("source",c,p,e,i,s),kv("target",c,u,e,o,a),t.set(r.id,r)}}function VC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:VC(n,t):!1}function Nv(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function zM(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!VC(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(o);a&&i.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function Hh({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,c;const i=[];for(const[u,p]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&i.push({...d,position:p.position,dragging:r})}if(!e)return[i[0],i];const o=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((c=t.get(e))==null?void 0:c.position)||o.position,dragging:r}:i[0],i]}function BM({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const o={x:n-i.distance.x,y:r-i.distance.y},s=Gc(o,t);return{x:s.x-o.x,y:s.y-o.y}}function HM({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,a=new Map,c=!1,u={x:0,y:0},p=null,d=!1,f=null,h=!1,m=!1,b=null;function S({noDragClassName:v,handleSelector:y,domNode:N,isSelectable:j,nodeId:k,nodeClickDistance:_=0}){f=_n(N);function R({x:T,y:V}){const{nodeLookup:L,nodeExtent:B,snapGrid:F,snapToGrid:$,nodeOrigin:I,onNodeDrag:A,onSelectionDrag:E,onError:z,updateNodePositions:U}=t();o={x:T,y:V};let O=!1;const q=a.size>1,Z=q&&B?Ig(qc(a)):null,te=q&&$?BM({dragItems:a,snapGrid:F,x:T,y:V}):null;for(const[ae,ee]of a){if(!L.has(ae))continue;let ue={x:T-ee.distance.x,y:V-ee.distance.y};$&&(ue=te?{x:Math.round(ue.x+te.x),y:Math.round(ue.y+te.y)}:Gc(ue,F));let Se=null;if(q&&B&&!ee.extent&&Z){const{positionAbsolute:ye}=ee.internals,$e=ye.x-Z.x+B[0][0],qe=ye.x+ee.measured.width-Z.x2+B[1][0],Me=ye.y-Z.y+B[0][1],ft=ye.y+ee.measured.height-Z.y2+B[1][1];Se=[[$e,Me],[qe,ft]]}const{position:xe,positionAbsolute:ge}=jC({nodeId:ae,nextPosition:ue,nodeLookup:L,nodeExtent:Se||B,nodeOrigin:I,onError:z});O=O||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=ge}if(m=m||O,!!O&&(U(a,!0),b&&(r||A||!k&&E))){const[ae,ee]=Hh({nodeId:k,dragItems:a,nodeLookup:L});r==null||r(b,a,ae,ee),A==null||A(b,ae,ee),k||E==null||E(b,ee)}}async function M(){if(!p)return;const{transform:T,panBy:V,autoPanSpeed:L,autoPanOnNodeDrag:B}=t();if(!B){c=!1,cancelAnimationFrame(s);return}const[F,$]=_C(u,p,L);(F!==0||$!==0)&&(o.x=(o.x??0)-F/T[2],o.y=(o.y??0)-$/T[2],await V({x:F,y:$})&&R(o)),s=requestAnimationFrame(M)}function H(T){var q;const{nodeLookup:V,multiSelectionActive:L,nodesDraggable:B,transform:F,snapGrid:$,snapToGrid:I,selectNodesOnDrag:A,onNodeDragStart:E,onSelectionDragStart:z,unselectNodesAndEdges:U}=t();d=!0,(!A||!j)&&!L&&k&&((q=V.get(k))!=null&&q.selected||U()),j&&A&&k&&(e==null||e(k));const O=Gl(T.sourceEvent,{transform:F,snapGrid:$,snapToGrid:I,containerBounds:p});if(o=O,a=zM(V,B,O,k),a.size>0&&(n||E||!k&&z)){const[Z,te]=Hh({nodeId:k,dragItems:a,nodeLookup:V});n==null||n(T.sourceEvent,a,Z,te),E==null||E(T.sourceEvent,Z,te),k||z==null||z(T.sourceEvent,te)}}const P=sC().clickDistance(_).on("start",T=>{const{domNode:V,nodeDragThreshold:L,transform:B,snapGrid:F,snapToGrid:$}=t();p=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,m=!1,b=T.sourceEvent,L===0&&H(T),o=Gl(T.sourceEvent,{transform:B,snapGrid:F,snapToGrid:$,containerBounds:p}),u=fr(T.sourceEvent,p)}).on("drag",T=>{const{autoPanOnNodeDrag:V,transform:L,snapGrid:B,snapToGrid:F,nodeDragThreshold:$,nodeLookup:I}=t(),A=Gl(T.sourceEvent,{transform:L,snapGrid:B,snapToGrid:F,containerBounds:p});if(b=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||k&&!I.has(k))&&(h=!0),!h){if(!c&&V&&d&&(c=!0,M()),!d){const E=fr(T.sourceEvent,p),z=E.x-u.x,U=E.y-u.y;Math.sqrt(z*z+U*U)>$&&H(T)}(o.x!==A.xSnapped||o.y!==A.ySnapped)&&a&&d&&(u=fr(T.sourceEvent,p),R(A))}}).on("end",T=>{if(!(!d||h)&&(c=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:L,onNodeDragStop:B,onSelectionDragStop:F}=t();if(m&&(L(a,!1),m=!1),i||B||!k&&F){const[$,I]=Hh({nodeId:k,dragItems:a,nodeLookup:V,dragging:!1});i==null||i(T.sourceEvent,a,$,I),B==null||B(T.sourceEvent,$,I),k||F==null||F(T.sourceEvent,I)}}}).filter(T=>{const V=T.target;return!T.button&&(!v||!Nv(V,`.${v}`,N))&&(!y||Nv(V,y,N))});f.call(P)}function g(){f==null||f.on(".drag",null)}return{update:S,destroy:g}}function UM(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Cc(i,ha(o))>0&&r.push(o);return r}const VM=250;function WM(e,t,n,r){var a,c;let i=[],o=1/0;const s=UM(e,n,t+VM);for(const u of s){const p=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:h}=Jo(u,d,d.position,!0),m=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));m>t||(m<o?(i=[{...d,x:f,y:h}],o=m):m===o&&i.push({...d,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(p=>p.type===u)??i[0]}return i[0]}function WC(e,t,n,r,i,o=!1){var u,p,d;const s=r.get(e);if(!s)return null;const a=i==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((p=s.internals.handleBounds)==null?void 0:p.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return c&&o?{...c,...Jo(s,c,c.position,!0)}:c}function KC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function KM(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const YC=()=>!0;function YM(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:c,lib:u,autoPanOnConnect:p,flowId:d,panBy:f,cancelConnection:h,onConnectStart:m,onConnect:b,onConnectEnd:S,isValidConnection:g=YC,onReconnectEnd:v,updateConnection:y,getTransform:N,getFromHandle:j,autoPanSpeed:k,dragThreshold:_=1,handleDomNode:R}){const M=RC(e.target);let H=0,P;const{x:T,y:V}=fr(e),L=KC(o,R),B=a==null?void 0:a.getBoundingClientRect();let F=!1;if(!B||!L)return;const $=WC(i,L,r,c,t);if(!$)return;let I=fr(e,B),A=!1,E=null,z=!1,U=null;function O(){if(!p||!B)return;const[xe,ge]=_C(I,B,k);f({x:xe,y:ge}),H=requestAnimationFrame(O)}const q={...$,nodeId:i,type:L,position:$.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:Jo(Z,q,be.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:Z,to:I,toHandle:null,toPosition:fv[q.position],toNode:null,pointer:I};function ee(){F=!0,y(ae),m==null||m(e,{nodeId:i,handleId:r,handleType:L})}_===0&&ee();function ue(xe){if(!F){const{x:ft,y:Ve}=fr(xe),at=ft-T,Nn=Ve-V;if(!(at*at+Nn*Nn>_*_))return;ee()}if(!j()||!q){Se(xe);return}const ge=N();I=fr(xe,B),P=WM(Xc(I,ge,!1,[1,1]),n,c,q),A||(O(),A=!0);const ye=qC(xe,{handle:P,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:g,doc:M,lib:u,flowId:d,nodeLookup:c});U=ye.handleDomNode,E=ye.connection,z=KM(!!P,ye.isValid);const $e=c.get(i),qe=$e?Jo($e,q,be.Left,!0):ae.from,Me={...ae,from:qe,isValid:z,to:ye.toHandle&&z?Pf({x:ye.toHandle.x,y:ye.toHandle.y},ge):I,toHandle:ye.toHandle,toPosition:z&&ye.toHandle?ye.toHandle.position:fv[q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:I};y(Me),ae=Me}function Se(xe){if(!("touches"in xe&&xe.touches.length>0)){if(F){(P||U)&&E&&z&&(b==null||b(E));const{inProgress:ge,...ye}=ae,$e={...ye,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(xe,$e),o&&(v==null||v(xe,$e))}h(),cancelAnimationFrame(H),A=!1,z=!1,E=null,U=null,M.removeEventListener("mousemove",ue),M.removeEventListener("mouseup",Se),M.removeEventListener("touchmove",ue),M.removeEventListener("touchend",Se)}}M.addEventListener("mousemove",ue),M.addEventListener("mouseup",Se),M.addEventListener("touchmove",ue),M.addEventListener("touchend",Se)}function qC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:c,isValidConnection:u=YC,nodeLookup:p}){const d=o==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:m}=fr(e),b=s.elementFromPoint(h,m),S=b!=null&&b.classList.contains(`${a}-flow__handle`)?b:f,g={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=KC(void 0,S),y=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),j=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!y||!v)return g;const _={source:d?y:r,sourceHandle:d?N:i,target:d?r:y,targetHandle:d?i:N};g.connection=_;const M=j&&k&&(n===fa.Strict?d&&v==="source"||!d&&v==="target":y!==r||N!==i);g.isValid=M&&u(_),g.toHandle=WC(y,v,N,p,n,!0)}return g}const Lg={onPointerDown:YM,isValid:qC};function qM({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=_n(e);function o({translateExtent:a,width:c,height:u,zoomStep:p=1,pannable:d=!0,zoomable:f=!0,inversePan:h=!1}){const m=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const N=n(),j=y.sourceEvent.ctrlKey&&Ec()?10:1,k=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,_=N[2]*Math.pow(2,k*j);t.scaleTo(_)};let b=[0,0];const S=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(b=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const N=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const j=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],k=[j[0]-b[0],j[1]-b[1]];b=j;const _=r()*Math.max(N[2],Math.log(N[2]))*(h?-1:1),R={x:N[0]-k[0]*_,y:N[1]-k[1]*_},M=[[0,0],[c,u]];t.setViewportConstrained({x:R.x,y:R.y,zoom:N[2]},M,a)},v=bC().on("start",S).on("zoom",d?g:null).on("zoom.wheel",f?m:null);i.call(v,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:ar}}const xp=e=>({x:e.x,y:e.y,zoom:e.k}),Uh=({x:e,y:t,zoom:n})=>mp.translate(e,t).scale(n),Bs=(e,t)=>e.target.closest(`.${t}`),GC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),GM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vh=(e,t=0,n=GM,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},XC=e=>{const t=e.ctrlKey&&Ec()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function XM({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:u}){return p=>{if(Bs(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&s){const S=ar(p),g=XC(p),v=d*Math.pow(2,g);r.scaleTo(n,v,S,p);return}const f=p.deltaMode===1?20:1;let h=i===Bo.Vertical?0:p.deltaX*f,m=i===Bo.Horizontal?0:p.deltaY*f;!Ec()&&p.shiftKey&&i!==Bo.Vertical&&(h=p.deltaY*f,m=0),r.translateBy(n,-(h/d)*o,-(m/d)*o,{internal:!0});const b=xp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(p,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(p,b))}}function QM({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",s=!t&&o&&!r.ctrlKey,a=Bs(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,i)}}function JM({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,a;if((o=r.sourceEvent)!=null&&o.internal)return;const i=xp(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function ZM({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&GC(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((a=o.sourceEvent)!=null&&a.internal)&&(i==null||i(o.sourceEvent,xp(o.transform)))}}function eD({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&GC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=xp(s.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,c)},n?150:0)}}}function tD({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:u,connectionInProgress:p}){return d=>{var S;const f=e||t,h=n&&d.ctrlKey,m=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Bs(d,`${u}-flow__node`)||Bs(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!i&&!o&&!n||s||p&&!m||Bs(d,a)&&m||Bs(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!f&&!i&&!h&&m||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&b}}function nD({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=bC().scaleExtent([t,n]).translateExtent(r),f=_n(e).call(d);v({x:i.x,y:i.y,zoom:pa(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),m=f.on("dblclick.zoom");d.wheelDelta(XC);function b(P,T){return f?new Promise(V=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ql:$d).transform(Vh(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>V(!0)),P)}):Promise.resolve(!1)}function S({noWheelClassName:P,noPanClassName:T,onPaneContextMenu:V,userSelectionActive:L,panOnScroll:B,panOnDrag:F,panOnScrollMode:$,panOnScrollSpeed:I,preventScrolling:A,zoomOnPinch:E,zoomOnScroll:z,zoomOnDoubleClick:U,zoomActivationKeyPressed:O,lib:q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:ee}){L&&!u.isZoomingOrPanning&&g();const ue=B&&!O&&!L;d.clickDistance(ee?1/0:!dr(ae)||ae<0?0:ae);const Se=ue?XM({zoomPanValues:u,noWheelClassName:P,d3Selection:f,d3Zoom:d,panOnScrollMode:$,panOnScrollSpeed:I,zoomOnPinch:E,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:a}):QM({noWheelClassName:P,preventScrolling:A,d3ZoomHandler:h});if(f.on("wheel.zoom",Se,{passive:!1}),!L){const ge=JM({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:s});d.on("start",ge);const ye=ZM({zoomPanValues:u,panOnDrag:F,onPaneContextMenu:!!V,onPanZoom:o,onTransformChange:Z});d.on("zoom",ye);const $e=eD({zoomPanValues:u,panOnDrag:F,panOnScroll:B,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:c});d.on("end",$e)}const xe=tD({zoomActivationKeyPressed:O,panOnDrag:F,zoomOnScroll:z,panOnScroll:B,zoomOnDoubleClick:U,zoomOnPinch:E,userSelectionActive:L,noPanClassName:T,noWheelClassName:P,lib:q,connectionInProgress:te});d.filter(xe),U?f.on("dblclick.zoom",m):f.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function v(P,T,V){const L=Uh(P),B=d==null?void 0:d.constrain()(L,T,V);return B&&await b(B),new Promise(F=>F(B))}async function y(P,T){const V=Uh(P);return await b(V,T),new Promise(L=>L(V))}function N(P){if(f){const T=Uh(P),V=f.property("__zoom");(V.k!==P.zoom||V.x!==P.x||V.y!==P.y)&&(d==null||d.transform(f,T,null,{sync:!0}))}}function j(){const P=f?vC(f.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function k(P,T){return f?new Promise(V=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ql:$d).scaleTo(Vh(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>V(!0)),P)}):Promise.resolve(!1)}function _(P,T){return f?new Promise(V=>{d==null||d.interpolate((T==null?void 0:T.interpolate)==="linear"?ql:$d).scaleBy(Vh(f,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>V(!0)),P)}):Promise.resolve(!1)}function R(P){d==null||d.scaleExtent(P)}function M(P){d==null||d.translateExtent(P)}function H(P){const T=!dr(P)||P<0?0:P;d==null||d.clickDistance(T)}return{update:S,destroy:g,setViewport:y,setViewportConstrained:v,getViewport:j,scaleTo:k,scaleBy:_,setScaleExtent:R,setTranslateExtent:M,syncViewport:N,setClickDistance:H}}var ga;(function(e){e.Line="line",e.Handle="handle"})(ga||(ga={}));function rD({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,a=n-r,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(c[0]=c[0]*-1),a&&o&&(c[1]=c[1]*-1),c}function Cv(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Ii(e,t){return Math.max(0,t-e)}function Ai(e,t){return Math.max(0,e-t)}function ud(e,t,n){return Math.max(0,t-e,e-n)}function Ev(e,t){return e?!t:t}function iD(e,t,n,r,i,o,s,a){let{affectsX:c,affectsY:u}=t;const{isHorizontal:p,isVertical:d}=t,f=p&&d,{xSnapped:h,ySnapped:m}=n,{minWidth:b,maxWidth:S,minHeight:g,maxHeight:v}=r,{x:y,y:N,width:j,height:k,aspectRatio:_}=e;let R=Math.floor(p?h-e.pointerX:0),M=Math.floor(d?m-e.pointerY:0);const H=j+(c?-R:R),P=k+(u?-M:M),T=-o[0]*j,V=-o[1]*k;let L=ud(H,b,S),B=ud(P,g,v);if(s){let I=0,A=0;c&&R<0?I=Ii(y+R+T,s[0][0]):!c&&R>0&&(I=Ai(y+H+T,s[1][0])),u&&M<0?A=Ii(N+M+V,s[0][1]):!u&&M>0&&(A=Ai(N+P+V,s[1][1])),L=Math.max(L,I),B=Math.max(B,A)}if(a){let I=0,A=0;c&&R>0?I=Ai(y+R,a[0][0]):!c&&R<0&&(I=Ii(y+H,a[1][0])),u&&M>0?A=Ai(N+M,a[0][1]):!u&&M<0&&(A=Ii(N+P,a[1][1])),L=Math.max(L,I),B=Math.max(B,A)}if(i){if(p){const I=ud(H/_,g,v)*_;if(L=Math.max(L,I),s){let A=0;!c&&!u||c&&!u&&f?A=Ai(N+V+H/_,s[1][1])*_:A=Ii(N+V+(c?R:-R)/_,s[0][1])*_,L=Math.max(L,A)}if(a){let A=0;!c&&!u||c&&!u&&f?A=Ii(N+H/_,a[1][1])*_:A=Ai(N+(c?R:-R)/_,a[0][1])*_,L=Math.max(L,A)}}if(d){const I=ud(P*_,b,S)/_;if(B=Math.max(B,I),s){let A=0;!c&&!u||u&&!c&&f?A=Ai(y+P*_+T,s[1][0])/_:A=Ii(y+(u?M:-M)*_+T,s[0][0])/_,B=Math.max(B,A)}if(a){let A=0;!c&&!u||u&&!c&&f?A=Ii(y+P*_,a[1][0])/_:A=Ai(y+(u?M:-M)*_,a[0][0])/_,B=Math.max(B,A)}}}M=M+(M<0?B:-B),R=R+(R<0?L:-L),i&&(f?H>P*_?M=(Ev(c,u)?-R:R)/_:R=(Ev(c,u)?-M:M)*_:p?(M=R/_,u=c):(R=M*_,c=u));const F=c?y+R:y,$=u?N+M:N;return{width:j+(c?-R:R),height:k+(u?-M:M),x:o[0]*R*(c?-1:1)+F,y:o[1]*M*(u?-1:1)+$}}const QC={width:0,height:0,x:0,y:0},oD={...QC,pointerX:0,pointerY:0,aspectRatio:1};function sD(e){return[[0,0],[e.measured.width,e.measured.height]]}function aD(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,c=n[1]*s;return[[r-a,i-c],[r+o-a,i+s-c]]}function lD({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=_n(e);let s={controlDirection:Cv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:p,keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:m,onResizeEnd:b,shouldResize:S}){let g={...QC},v={...oD};s={boundaries:p,resizeDirection:f,keepAspectRatio:d,controlDirection:Cv(u)};let y,N=null,j=[],k,_,R,M=!1;const H=sC().on("start",P=>{const{nodeLookup:T,transform:V,snapGrid:L,snapToGrid:B,nodeOrigin:F,paneDomNode:$}=n();if(y=T.get(t),!y)return;N=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:I,ySnapped:A}=Gl(P.sourceEvent,{transform:V,snapGrid:L,snapToGrid:B,containerBounds:N});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},v={...g,pointerX:I,pointerY:A,aspectRatio:g.width/g.height},k=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(k=T.get(y.parentId),_=k&&y.extent==="parent"?sD(k):void 0),j=[],R=void 0;for(const[E,z]of T)if(z.parentId===t&&(j.push({id:E,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const U=aD(z,y,z.origin??F);R?R=[[Math.min(U[0][0],R[0][0]),Math.min(U[0][1],R[0][1])],[Math.max(U[1][0],R[1][0]),Math.max(U[1][1],R[1][1])]]:R=U}h==null||h(P,{...g})}).on("drag",P=>{const{transform:T,snapGrid:V,snapToGrid:L,nodeOrigin:B}=n(),F=Gl(P.sourceEvent,{transform:T,snapGrid:V,snapToGrid:L,containerBounds:N}),$=[];if(!y)return;const{x:I,y:A,width:E,height:z}=g,U={},O=y.origin??B,{width:q,height:Z,x:te,y:ae}=iD(v,s.controlDirection,F,s.boundaries,s.keepAspectRatio,O,_,R),ee=q!==E,ue=Z!==z,Se=te!==I&&ee,xe=ae!==A&&ue;if(!Se&&!xe&&!ee&&!ue)return;if((Se||xe||O[0]===1||O[1]===1)&&(U.x=Se?te:g.x,U.y=xe?ae:g.y,g.x=U.x,g.y=U.y,j.length>0)){const qe=te-I,Me=ae-A;for(const ft of j)ft.position={x:ft.position.x-qe+O[0]*(q-E),y:ft.position.y-Me+O[1]*(Z-z)},$.push(ft)}if((ee||ue)&&(U.width=ee&&(!s.resizeDirection||s.resizeDirection==="horizontal")?q:g.width,U.height=ue&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:g.height,g.width=U.width,g.height=U.height),k&&y.expandParent){const qe=O[0]*(U.width??0);U.x&&U.x<qe&&(g.x=qe,v.x=v.x-(U.x-qe));const Me=O[1]*(U.height??0);U.y&&U.y<Me&&(g.y=Me,v.y=v.y-(U.y-Me))}const ge=rD({width:g.width,prevWidth:E,height:g.height,prevHeight:z,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ye={...g,direction:ge};(S==null?void 0:S(P,ye))!==!1&&(M=!0,m==null||m(P,ye),r(U,$))}).on("end",P=>{M&&(b==null||b(P,{...g}),i==null||i({...g}),M=!1)});o.call(H)}function c(){o.on(".drag",null)}return{update:a,destroy:c}}var JC={exports:{}},ZC={},eE={exports:{}},tE={};/**
42
+ * @license React
43
+ * use-sync-external-store-shim.production.js
44
+ *
45
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
46
+ *
47
+ * This source code is licensed under the MIT license found in the
48
+ * LICENSE file in the root directory of this source tree.
49
+ */var ya=w;function cD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uD=typeof Object.is=="function"?Object.is:cD,dD=ya.useState,fD=ya.useEffect,pD=ya.useLayoutEffect,hD=ya.useDebugValue;function mD(e,t){var n=t(),r=dD({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return pD(function(){i.value=n,i.getSnapshot=t,Wh(i)&&o({inst:i})},[e,n,t]),fD(function(){return Wh(i)&&o({inst:i}),e(function(){Wh(i)&&o({inst:i})})},[e]),hD(n),n}function Wh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uD(e,n)}catch{return!0}}function gD(e,t){return t()}var yD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gD:mD;tE.useSyncExternalStore=ya.useSyncExternalStore!==void 0?ya.useSyncExternalStore:yD;eE.exports=tE;var nE=eE.exports;/**
50
+ * @license React
51
+ * use-sync-external-store-shim/with-selector.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var wp=w,xD=nE;function wD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vD=typeof Object.is=="function"?Object.is:wD,bD=xD.useSyncExternalStore,SD=wp.useRef,kD=wp.useEffect,ND=wp.useMemo,CD=wp.useDebugValue;ZC.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=SD(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=ND(function(){function c(h){if(!u){if(u=!0,p=h,h=r(h),i!==void 0&&s.hasValue){var m=s.value;if(i(m,h))return d=m}return d=h}if(m=d,vD(p,h))return m;var b=r(h);return i!==void 0&&i(m,b)?(p=h,m):(p=h,d=b)}var u=!1,p,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,i]);var a=bD(e,o[0],o[1]);return kD(function(){s.hasValue=!0,s.value=a},[a]),CD(a),a};JC.exports=ZC;var ED=JC.exports;const jD=oo(ED),PD={},jv=e=>{let t;const n=new Set,r=(p,d)=>{const f=typeof p=="function"?p(t):p;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>u,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(PD?"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()}},u=t=e(r,i,c);return c},_D=e=>e?jv(e):jv,{useDebugValue:ID}=Ne,{useSyncExternalStoreWithSelector:AD}=jD,TD=e=>e;function rE(e,t=TD,n){const r=AD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ID(r),r}const Pv=(e,t)=>{const n=_D(e),r=(i,o=t)=>rE(n,i,o);return Object.assign(r,n),r},RD=(e,t)=>e?Pv(e,t):Pv;function ut(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const vp=w.createContext(null),LD=vp.Provider,iE=Wr.error001();function Be(e,t){const n=w.useContext(vp);if(n===null)throw new Error(iE);return rE(n,e,t)}function dt(){const e=w.useContext(vp);if(e===null)throw new Error(iE);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const _v={display:"none"},OD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oE="react-flow__node-desc",sE="react-flow__edge-desc",MD="react-flow__aria-live",DD=e=>e.ariaLiveMessage,FD=e=>e.ariaLabelConfig;function $D({rfId:e}){const t=Be(DD);return l.jsx("div",{id:`${MD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:OD,children:t})}function zD({rfId:e,disableKeyboardA11y:t}){const n=Be(FD);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${oE}-${e}`,style:_v,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${sE}-${e}`,style:_v,children:n["edge.a11yDescription.default"]}),!t&&l.jsx($D,{rfId:e})]})}const xa=w.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=`${e}`.split("-");return l.jsx("div",{className:It(["react-flow__panel",n,...s]),style:r,ref:o,...i,children:t})});xa.displayName="Panel";function BD({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:l.jsx(xa,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:l.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const HD=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},dd=e=>e.id;function UD(e,t){return ut(e.selectedNodes.map(dd),t.selectedNodes.map(dd))&&ut(e.selectedEdges.map(dd),t.selectedEdges.map(dd))}function VD({onSelectionChange:e}){const t=dt(),{selectedNodes:n,selectedEdges:r}=Be(HD,UD);return w.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const WD=e=>!!e.onSelectionChangeHandlers;function KD({onSelectionChange:e}){const t=Be(WD);return e||t?l.jsx(VD,{onSelectionChange:e}):null}const Og=typeof window<"u"?w.useLayoutEffect:w.useEffect,aE=[0,0],YD={x:0,y:0,zoom:1},qD=["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"],Iv=[...qD,"rfId"],GD=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}),Av={translateExtent:kc,nodeOrigin:aE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function XD(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c}=Be(GD,ut),u=dt();Og(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=Av,a()}),[]);const p=w.useRef(Av);return Og(()=>{for(const d of Iv){const f=e[d],h=p.current[d];f!==h&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?i(f):d==="translateExtent"?o(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:bM(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}p.current=e},Iv.map(d=>e[d])),null}function Tv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function QD(e){var r;const[t,n]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){n(e);return}const i=Tv(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=Tv())!=null&&r.matches?"dark":"light"}const Rv=typeof document<"u"?document:null;function jc(e=null,t={target:Rv,actInsideInputWithModifier:!0}){const[n,r]=w.useState(!1),i=w.useRef(!1),o=w.useRef(new Set([])),[s,a]=w.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
58
+ `).replace(`
59
+
60
+ `,`
61
+ +`).split(`
62
+ `)),p=u.reduce((d,f)=>d.concat(...f),[]);return[u,p]}return[[],[]]},[e]);return w.useEffect(()=>{const c=(t==null?void 0:t.target)??Rv,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=h=>{var S,g;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!u)&&LC(h))return!1;const b=Ov(h.code,a);if(o.current.add(h[b]),Lv(s,o.current,!1)){const v=((g=(S=h.composedPath)==null?void 0:S.call(h))==null?void 0:g[0])||h.target,y=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&h.preventDefault(),r(!0)}},d=h=>{const m=Ov(h.code,a);Lv(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[m]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Lv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Ov(e,t){return t.includes(e)?"code":"key"}const JD=()=>{const e=dt();return w.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),c=px(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:s}=e.getState();if(!s)return t;const{x:a,y:c}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-c},p=n.snapGrid??i,d=n.snapToGrid??o;return Xc(u,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=Pf(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function lE(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const c of s)ZD(c,a);n.push(a)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function ZD(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 cE(e,t){return lE(e,t)}function uE(e,t){return lE(e,t)}function To(e,t){return{id:e,type:"select",selected:t}}function Hs(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(To(o.id,s)))}return r}function Mv({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),c=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;c!==void 0&&c!==s&&n.push({id:s.id,item:s,type:"replace"}),c===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Dv(e){return{id:e.id,type:"remove"}}const Fv=e=>dM(e),eF=e=>EC(e);function dE(e){return w.forwardRef(e)}function $v(e){const[t,n]=w.useState(BigInt(0)),[r]=w.useState(()=>tF(()=>n(i=>i+BigInt(1))));return Og(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function tF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fE=w.createContext(null);function nF({children:e}){const t=dt(),n=w.useCallback(a=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:p,onNodesChange:d,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:m}=t.getState();let b=c;for(const g of a)b=typeof g=="function"?g(b):g;let S=Mv({items:b,lookup:f});for(const g of m.values())S=g(S);p&&u(b),S.length>0?d==null||d(S):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:v,setNodes:y}=t.getState();g&&y(v)})},[]),r=$v(n),i=w.useCallback(a=>{const{edges:c=[],setEdges:u,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:f}=t.getState();let h=c;for(const m of a)h=typeof m=="function"?m(h):m;p?u(h):d&&d(Mv({items:h,lookup:f}))},[]),o=$v(i),s=w.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return l.jsx(fE.Provider,{value:s,children:e})}function rF(){const e=w.useContext(fE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iF=e=>!!e.panZoom;function Qc(){const e=JD(),t=dt(),n=rF(),r=Be(iF),i=w.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},c=d=>{var g,v;const{nodeLookup:f,nodeOrigin:h}=t.getState(),m=Fv(d)?d:f.get(d.id),b=m.parentId?TC(m.position,m.measured,m.parentId,f,h):m.position,S={...m,position:b,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((v=m.measured)==null?void 0:v.height)??m.height};return ha(S)},u=(d,f,h={replace:!1})=>{s(m=>m.map(b=>{if(b.id===d){const S=typeof f=="function"?f(b):f;return h.replace&&Fv(S)?S:{...b,...S}}return b}))},p=(d,f,h={replace:!1})=>{a(m=>m.map(b=>{if(b.id===d){const S=typeof f=="function"?f(b):f;return h.replace&&eF(S)?S:{...b,...S}}return b}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:a,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:h}=t.getState(),[m,b,S]=h;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:m,y:b,zoom:S}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:h,edges:m,onNodesDelete:b,onEdgesDelete:S,triggerNodeChanges:g,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:N}=t.getState(),{nodes:j,edges:k}=await gM({nodesToRemove:d,edgesToRemove:f,nodes:h,edges:m,onBeforeDelete:N}),_=k.length>0,R=j.length>0;if(_){const M=k.map(Dv);S==null||S(k),v(M)}if(R){const M=j.map(Dv);b==null||b(j),g(M)}return(R||_)&&(y==null||y({nodes:j,edges:k})),{deletedNodes:j,deletedEdges:k}},getIntersectingNodes:(d,f=!0,h)=>{const m=hv(d),b=m?d:c(d),S=h!==void 0;return b?(h||t.getState().nodes).filter(g=>{const v=t.getState().nodeLookup.get(g.id);if(v&&!m&&(g.id===d.id||!v.internals.positionAbsolute))return!1;const y=ha(S?g:v),N=Cc(y,b);return f&&N>0||N>=y.width*y.height||N>=b.width*b.height}):[]},isNodeIntersecting:(d,f,h=!0)=>{const b=hv(d)?d:c(d);if(!b)return!1;const S=Cc(b,f);return h&&S>0||S>=f.width*f.height||S>=b.width*b.height},updateNode:u,updateNodeData:(d,f,h={replace:!1})=>{u(d,m=>{const b=typeof f=="function"?f(m):f;return h.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},h)},updateEdge:p,updateEdgeData:(d,f,h={replace:!1})=>{p(d,m=>{const b=typeof f=="function"?f(m):f;return h.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},h)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return fM(d,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:d,id:f,nodeId:h})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${h}-${d}${f?`-${f}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:h})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${h}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:m.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??vM();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return w.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const zv=e=>e.selected,oF=typeof window<"u"?window:void 0;function sF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=dt(),{deleteElements:r}=Qc(),i=jc(e,{actInsideInputWithModifier:!1}),o=jc(t,{target:oF});w.useEffect(()=>{if(i){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(zv),edges:s.filter(zv)}),n.setState({nodesSelectionActive:!1})}},[i]),w.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function aF(e){const t=dt();w.useEffect(()=>{const n=()=>{var i,o,s,a;if(!e.current||!(((o=(i=e.current).checkVisibility)==null?void 0:o.call(i))??!0))return!1;const r=hx(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",Wr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const bp={position:"absolute",width:"100%",height:"100%",top:0,left:0},lF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function cF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=Bo.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:u,minZoom:p,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:h=!0,children:m,noWheelClassName:b,noPanClassName:S,onViewportChange:g,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:N}){const j=dt(),k=w.useRef(null),{userSelectionActive:_,lib:R,connectionInProgress:M}=Be(lF,ut),H=jc(f),P=w.useRef();aF(k);const T=w.useCallback(V=>{g==null||g({x:V[0],y:V[1],zoom:V[2]}),v||j.setState({transform:V})},[g,v]);return w.useEffect(()=>{if(k.current){P.current=nD({domNode:k.current,minZoom:p,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:F=>j.setState($=>$.paneDragging===F?$:{paneDragging:F}),onPanZoomStart:(F,$)=>{const{onViewportChangeStart:I,onMoveStart:A}=j.getState();A==null||A(F,$),I==null||I($)},onPanZoom:(F,$)=>{const{onViewportChange:I,onMove:A}=j.getState();A==null||A(F,$),I==null||I($)},onPanZoomEnd:(F,$)=>{const{onViewportChangeEnd:I,onMoveEnd:A}=j.getState();A==null||A(F,$),I==null||I($)}});const{x:V,y:L,zoom:B}=P.current.getViewport();return j.setState({panZoom:P.current,transform:[V,L,B],domNode:k.current.closest(".react-flow")}),()=>{var F;(F=P.current)==null||F.destroy()}}},[]),w.useEffect(()=>{var V;(V=P.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:H,preventScrolling:h,noPanClassName:S,userSelectionActive:_,noWheelClassName:b,lib:R,onTransformChange:T,connectionInProgress:M,selectionOnDrag:N,paneClickDistance:y})},[e,t,n,r,i,o,s,a,H,h,S,_,b,R,T,M,N,y]),l.jsx("div",{className:"react-flow__renderer",ref:k,style:bp,children:m})}const uF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function dF(){const{userSelectionActive:e,userSelectionRect:t}=Be(uF,ut);return e&&t?l.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Kh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},fF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function pF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Nc.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:p,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:h,children:m}){const b=dt(),{userSelectionActive:S,elementsSelectable:g,dragging:v,connectionInProgress:y}=Be(fF,ut),N=g&&(e||S),j=w.useRef(null),k=w.useRef(),_=w.useRef(new Set),R=w.useRef(new Set),M=w.useRef(!1),H=I=>{if(M.current||y){M.current=!1;return}c==null||c(I),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},P=I=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){I.preventDefault();return}u==null||u(I)},T=p?I=>p(I):void 0,V=I=>{M.current&&(I.stopPropagation(),M.current=!1)},L=I=>{var Z,te;const{domNode:A}=b.getState();if(k.current=A==null?void 0:A.getBoundingClientRect(),!k.current)return;const E=I.target===j.current;if(!E&&!!I.target.closest(".nokey")||!e||!(o&&E||t)||I.button!==0||!I.isPrimary)return;(te=(Z=I.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,I.pointerId),M.current=!1;const{x:O,y:q}=fr(I.nativeEvent,k.current);b.setState({userSelectionRect:{width:0,height:0,startX:O,startY:q,x:O,y:q}}),E||(I.stopPropagation(),I.preventDefault())},B=I=>{const{userSelectionRect:A,transform:E,nodeLookup:z,edgeLookup:U,connectionLookup:O,triggerNodeChanges:q,triggerEdgeChanges:Z,defaultEdgeOptions:te,resetSelectedElements:ae}=b.getState();if(!k.current||!A)return;const{x:ee,y:ue}=fr(I.nativeEvent,k.current),{startX:Se,startY:xe}=A;if(!M.current){const Me=t?0:i;if(Math.hypot(ee-Se,ue-xe)<=Me)return;ae(),s==null||s(I)}M.current=!0;const ge={startX:Se,startY:xe,x:ee<Se?ee:Se,y:ue<xe?ue:xe,width:Math.abs(ee-Se),height:Math.abs(ue-xe)},ye=_.current,$e=R.current;_.current=new Set(fx(z,ge,E,n===Nc.Partial,!0).map(Me=>Me.id)),R.current=new Set;const qe=(te==null?void 0:te.selectable)??!0;for(const Me of _.current){const ft=O.get(Me);if(ft)for(const{edgeId:Ve}of ft.values()){const at=U.get(Ve);at&&(at.selectable??qe)&&R.current.add(Ve)}}if(!mv(ye,_.current)){const Me=Hs(z,_.current,!0);q(Me)}if(!mv($e,R.current)){const Me=Hs(U,R.current);Z(Me)}b.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})},F=I=>{var A,E;I.button===0&&((E=(A=I.target)==null?void 0:A.releasePointerCapture)==null||E.call(A,I.pointerId),!S&&I.target===j.current&&b.getState().userSelectionRect&&(H==null||H(I)),b.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(I),b.setState({nodesSelectionActive:_.current.size>0})))},$=r===!0||Array.isArray(r)&&r.includes(0);return l.jsxs("div",{className:It(["react-flow__pane",{draggable:$,dragging:v,selection:e}]),onClick:N?void 0:Kh(H,j),onContextMenu:Kh(P,j),onWheel:Kh(T,j),onPointerEnter:N?void 0:d,onPointerMove:N?B:f,onPointerUp:N?F:void 0,onPointerDownCapture:N?L:void 0,onClickCapture:N?V:void 0,onPointerLeave:h,ref:j,style:bp,children:[m,l.jsx(dF,{})]})}function Mg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:c}=t.getState(),u=a.get(e);if(!u){c==null||c("012",Wr.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):i([e])}function pE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const a=dt(),[c,u]=w.useState(!1),p=w.useRef();return w.useEffect(()=>{p.current=HM({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{Mg({id:d,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),w.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var d;(d=p.current)==null||d.destroy()}},[n,r,t,o,e,i,s]),c}const hF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function hE(){const e=dt();return w.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:c,nodeLookup:u,nodeOrigin:p}=e.getState(),d=new Map,f=hF(s),h=i?o[0]:5,m=i?o[1]:5,b=n.direction.x*h*n.factor,S=n.direction.y*m*n.factor;for(const[,g]of u){if(!f(g))continue;let v={x:g.internals.positionAbsolute.x+b,y:g.internals.positionAbsolute.y+S};i&&(v=Gc(v,o));const{position:y,positionAbsolute:N}=jC({nodeId:g.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:p,onError:a});g.position=y,g.internals.positionAbsolute=N,d.set(g.id,g)}c(d)},[])}const vx=w.createContext(null),mF=vx.Provider;vx.Consumer;const mE=()=>w.useContext(vx),gF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),yF=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:a,toHandle:c,isValid:u}=s,p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:p,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===fa.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!i,valid:p&&u}};function xF({type:e="source",position:t=be.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:c,className:u,onMouseDown:p,onTouchStart:d,...f},h){var B,F;const m=s||null,b=e==="target",S=dt(),g=mE(),{connectOnClick:v,noPanClassName:y,rfId:N}=Be(gF,ut),{connectingFrom:j,connectingTo:k,clickConnecting:_,isPossibleEndHandle:R,connectionInProcess:M,clickConnectionInProcess:H,valid:P}=Be(yF(g,m,e),ut);g||(F=(B=S.getState()).onError)==null||F.call(B,"010",Wr.error010());const T=$=>{const{defaultEdgeOptions:I,onConnect:A,hasDefaultEdges:E}=S.getState(),z={...I,...$};if(E){const{edges:U,setEdges:O}=S.getState();O($C(z,U))}A==null||A(z),a==null||a(z)},V=$=>{if(!g)return;const I=OC($.nativeEvent);if(i&&(I&&$.button===0||!I)){const A=S.getState();Lg.onPointerDown($.nativeEvent,{handleDomNode:$.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:b,handleId:m,nodeId:g,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:(...E)=>{var z,U;return(U=(z=S.getState()).onConnectEnd)==null?void 0:U.call(z,...E)},updateConnection:A.updateConnection,onConnect:T,isValidConnection:n||((...E)=>{var z,U;return((U=(z=S.getState()).isValidConnection)==null?void 0:U.call(z,...E))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}I?p==null||p($):d==null||d($)},L=$=>{const{onClickConnectStart:I,onClickConnectEnd:A,connectionClickStartHandle:E,connectionMode:z,isValidConnection:U,lib:O,rfId:q,nodeLookup:Z,connection:te}=S.getState();if(!g||!E&&!i)return;if(!E){I==null||I($.nativeEvent,{nodeId:g,handleId:m,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const ae=RC($.target),ee=n||U,{connection:ue,isValid:Se}=Lg.isValid($.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:z,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:ee,flowId:q,doc:ae,lib:O,nodeLookup:Z});Se&&ue&&T(ue);const xe=structuredClone(te);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,A==null||A($,xe),S.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${N}-${g}-${m}-${e}`,className:It(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!b,target:b,connectable:r,connectablestart:i,connectableend:o,clickconnecting:_,connectingfrom:j,connectingto:k,valid:P,connectionindicator:r&&(!M||R)&&(M||H?o:i)}]),onMouseDown:V,onTouchStart:V,onClick:v?L:void 0,ref:h,...f,children:c})}const wa=w.memo(dE(xF));function wF({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return l.jsxs(l.Fragment,{children:[e==null?void 0:e.label,l.jsx(wa,{type:"source",position:n,isConnectable:t})]})}function vF({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:r=be.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(wa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,l.jsx(wa,{type:"source",position:r,isConnectable:t})]})}function bF(){return null}function SF({data:e,isConnectable:t,targetPosition:n=be.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(wa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _f={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bv={input:wF,default:vF,output:SF,group:bF};function kF(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const NF=e=>{const{width:t,height:n,x:r,y:i}=qc(e.nodeLookup,{filter:o=>!!o.selected});return{width:dr(t)?t:null,height:dr(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function CF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=dt(),{width:i,height:o,transformString:s,userSelectionActive:a}=Be(NF,ut),c=hE(),u=w.useRef(null);w.useEffect(()=>{var h;n||(h=u.current)==null||h.focus({preventScroll:!0})},[n]);const p=!a&&i!==null&&o!==null;if(pE({nodeRef:u,disabled:!p}),!p)return null;const d=e?h=>{const m=r.getState().nodes.filter(b=>b.selected);e(h,m)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(_f,h.key)&&(h.preventDefault(),c({direction:_f[h.key],factor:h.shiftKey?4:1}))};return l.jsx("div",{className:It(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:l.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:i,height:o}})})}const Hv=typeof window<"u"?window:void 0,EF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:p,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:m,panActivationKeyCode:b,zoomActivationKeyCode:S,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:R,defaultViewport:M,translateExtent:H,minZoom:P,maxZoom:T,preventScrolling:V,onSelectionContextMenu:L,noWheelClassName:B,noPanClassName:F,disableKeyboardA11y:$,onViewportChange:I,isControlledViewport:A}){const{nodesSelectionActive:E,userSelectionActive:z}=Be(EF,ut),U=jc(u,{target:Hv}),O=jc(b,{target:Hv}),q=O||R,Z=O||N,te=p&&q!==!0,ae=U||z||te;return sF({deleteKeyCode:c,multiSelectionKeyCode:m}),l.jsx(cF,{onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:!U&&q,defaultViewport:M,translateExtent:H,minZoom:P,maxZoom:T,zoomActivationKeyCode:S,preventScrolling:V,noWheelClassName:B,noPanClassName:F,onViewportChange:I,isControlledViewport:A,paneClickDistance:a,selectionOnDrag:te,children:l.jsxs(pF,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:q,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:U,paneClickDistance:a,selectionOnDrag:te,children:[e,E&&l.jsx(CF,{onSelectionContextMenu:L,noPanClassName:F,disableKeyboardA11y:$})]})})}gE.displayName="FlowRenderer";const jF=w.memo(gE),PF=e=>t=>e?fx(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 _F(e){return Be(w.useCallback(PF(e),[e]),ut)}const IF=e=>e.updateNodeInternals;function AF(){const e=Be(IF),[t]=w.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return w.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function TF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=dt(),o=w.useRef(null),s=w.useRef(null),a=w.useRef(e.sourcePosition),c=w.useRef(e.targetPosition),u=w.useRef(t),p=n&&!!e.internals.handleBounds;return w.useEffect(()=>{o.current&&!e.hidden&&(!p||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[p,e.hidden]),w.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),w.useEffect(()=>{if(o.current){const d=u.current!==t,f=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(d||f||h)&&(u.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function RF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:c,nodesConnectable:u,nodesFocusable:p,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:m,rfId:b,nodeTypes:S,nodeClickDistance:g,onError:v}){const{node:y,internals:N,isParent:j}=Be(ee=>{const ue=ee.nodeLookup.get(e),Se=ee.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Se}},ut);let k=y.type||"default",_=(S==null?void 0:S[k])||Bv[k];_===void 0&&(v==null||v("003",Wr.error003(k)),k="default",_=(S==null?void 0:S.default)||Bv.default);const R=!!(y.draggable||a&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),H=!!(y.connectable||u&&typeof y.connectable>"u"),P=!!(y.focusable||p&&typeof y.focusable>"u"),T=dt(),V=AC(y),L=TF({node:y,nodeType:k,hasDimensions:V,resizeObserver:d}),B=pE({nodeRef:L,disabled:y.hidden||!R,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:g}),F=hE();if(y.hidden)return null;const $=Si(y),I=kF(y),A=M||R||t||n||r||i,E=n?ee=>n(ee,{...N.userNode}):void 0,z=r?ee=>r(ee,{...N.userNode}):void 0,U=i?ee=>i(ee,{...N.userNode}):void 0,O=o?ee=>o(ee,{...N.userNode}):void 0,q=s?ee=>s(ee,{...N.userNode}):void 0,Z=ee=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Se}=T.getState();M&&(!ue||!R||Se>0)&&Mg({id:e,store:T,nodeRef:L}),t&&t(ee,{...N.userNode})},te=ee=>{if(!(LC(ee.nativeEvent)||m)){if(SC.includes(ee.key)&&M){const ue=ee.key==="Escape";Mg({id:e,store:T,unselect:ue,nodeRef:L})}else if(R&&y.selected&&Object.prototype.hasOwnProperty.call(_f,ee.key)){ee.preventDefault();const{ariaLabelConfig:ue}=T.getState();T.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),F({direction:_f[ee.key],factor:ee.shiftKey?4:1})}}},ae=()=>{var $e;if(m||!(($e=L.current)!=null&&$e.matches(":focus-visible")))return;const{transform:ee,width:ue,height:Se,autoPanOnNodeFocus:xe,setCenter:ge}=T.getState();if(!xe)return;fx(new Map([[e,y]]),{x:0,y:0,width:ue,height:Se},ee,!0).length>0||ge(y.position.x+$.width/2,y.position.y+$.height/2,{zoom:ee[2]})};return l.jsx("div",{className:It(["react-flow__node",`react-flow__node-${k}`,{[h]:R},y.className,{selected:y.selected,selectable:M,parent:j,draggable:R,dragging:B}]),ref:L,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:V?"visible":"hidden",...y.style,...I},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:E,onMouseMove:z,onMouseLeave:U,onContextMenu:O,onClick:Z,onDoubleClick:q,onKeyDown:P?te:void 0,tabIndex:P?0:void 0,onFocus:P?ae:void 0,role:y.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${oE}-${b}`,"aria-label":y.ariaLabel,...y.domAttributes,children:l.jsx(mF,{value:e,children:l.jsx(_,{id:e,data:y.data,type:k,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:R,deletable:y.deletable??!0,isConnectable:H,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:B,dragHandle:y.dragHandle,zIndex:N.z,parentId:y.parentId,...$})})})}var LF=w.memo(RF);const OF=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function yE(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=Be(OF,ut),s=_F(e.onlyRenderVisibleElements),a=AF();return l.jsx("div",{className:"react-flow__nodes",style:bp,children:s.map(c=>l.jsx(LF,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},c))})}yE.displayName="NodeRenderer";const MF=w.memo(yE);function DF(e){return Be(w.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&NM({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ut)}const FF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return l.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},$F=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return l.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Uv={[to.Arrow]:FF,[to.ArrowClosed]:$F};function zF(e){const t=dt();return w.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Uv,e)?Uv[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Wr.error009(e)),null)},[e])}const BF=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=zF(t);return c?l.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:l.jsx(c,{color:n,strokeWidth:s})}):null},xE=({defaultColor:e,rfId:t})=>{const n=Be(o=>o.edges),r=Be(o=>o.defaultEdgeOptions),i=w.useMemo(()=>AM(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:i.map(o=>l.jsx(BF,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};xE.displayName="MarkerDefinitions";var HF=w.memo(xE);function wE({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:u,...p}){const[d,f]=w.useState({x:1,y:0,width:0,height:0}),h=It(["react-flow__edge-textwrapper",u]),m=w.useRef(null);return w.useEffect(()=>{if(m.current){const b=m.current.getBBox();f({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?l.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...p,children:[i&&l.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),l.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}wE.displayName="EdgeText";const UF=w.memo(wE);function Sp({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:u=20,...p}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...p,d:e,fill:"none",className:It(["react-flow__edge-path",p.className])}),u?l.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&dr(t)&&dr(n)?l.jsx(UF,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Vv({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===be.Left||e===be.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function vE({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top}){const[s,a]=Vv({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,u]=Vv({pos:o,x1:r,y1:i,x2:e,y2:t}),[p,d,f,h]=MC({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${a} ${c},${u} ${r},${i}`,p,d,f,h]}function bE(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s,targetPosition:a,label:c,labelStyle:u,labelShowBg:p,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:b,markerStart:S,interactionWidth:g})=>{const[v,y,N]=vE({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a}),j=e.isInternal?void 0:t;return l.jsx(Sp,{id:j,path:v,labelX:y,labelY:N,label:c,labelStyle:u,labelShowBg:p,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:b,markerStart:S,interactionWidth:g})})}const VF=bE({isInternal:!1}),SE=bE({isInternal:!0});VF.displayName="SimpleBezierEdge";SE.displayName="SimpleBezierEdgeInternal";function kE(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:d,style:f,sourcePosition:h=be.Bottom,targetPosition:m=be.Top,markerEnd:b,markerStart:S,pathOptions:g,interactionWidth:v})=>{const[y,N,j]=Ag({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),k=e.isInternal?void 0:t;return l.jsx(Sp,{id:k,path:y,labelX:N,labelY:j,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:d,style:f,markerEnd:b,markerStart:S,interactionWidth:v})})}const NE=kE({isInternal:!1}),CE=kE({isInternal:!0});NE.displayName="SmoothStepEdge";CE.displayName="SmoothStepEdgeInternal";function EE(e){return w.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return l.jsx(NE,{...n,id:r,pathOptions:w.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const WF=EE({isInternal:!1}),jE=EE({isInternal:!0});WF.displayName="StepEdge";jE.displayName="StepEdgeInternal";function PE(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:b})=>{const[S,g,v]=zC({sourceX:n,sourceY:r,targetX:i,targetY:o}),y=e.isInternal?void 0:t;return l.jsx(Sp,{id:y,path:S,labelX:g,labelY:v,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:p,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:b})})}const KF=PE({isInternal:!1}),_E=PE({isInternal:!0});KF.displayName="StraightEdge";_E.displayName="StraightEdgeInternal";function IE(e){return w.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=be.Bottom,targetPosition:a=be.Top,label:c,labelStyle:u,labelShowBg:p,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:b,markerStart:S,pathOptions:g,interactionWidth:v})=>{const[y,N,j]=DC({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a,curvature:g==null?void 0:g.curvature}),k=e.isInternal?void 0:t;return l.jsx(Sp,{id:k,path:y,labelX:N,labelY:j,label:c,labelStyle:u,labelShowBg:p,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:m,markerEnd:b,markerStart:S,interactionWidth:v})})}const YF=IE({isInternal:!1}),AE=IE({isInternal:!0});YF.displayName="BezierEdge";AE.displayName="BezierEdgeInternal";const Wv={default:AE,straight:_E,step:jE,smoothstep:CE,simplebezier:SE},Kv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},qF=(e,t,n)=>n===be.Left?e-t:n===be.Right?e+t:e,GF=(e,t,n)=>n===be.Top?e-t:n===be.Bottom?e+t:e,Yv="react-flow__edgeupdater";function qv({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a}){return l.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:It([Yv,`${Yv}-${a}`]),cx:qF(t,r,e),cy:GF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function XF({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:a,targetPosition:c,onReconnect:u,onReconnectStart:p,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){const m=dt(),b=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:k,domNode:_,connectionMode:R,connectionRadius:M,lib:H,onConnectStart:P,cancelConnection:T,nodeLookup:V,rfId:L,panBy:B,updateConnection:F}=m.getState(),$=j.type==="target",I=(z,U)=>{f(!1),d==null||d(z,n,j.type,U)},A=z=>u==null?void 0:u(n,z),E=(z,U)=>{f(!0),p==null||p(N,n,j.type),P==null||P(z,U)};Lg.onPointerDown(N.nativeEvent,{autoPanOnConnect:k,connectionMode:R,connectionRadius:M,domNode:_,handleId:j.id,nodeId:j.nodeId,nodeLookup:V,isTarget:$,edgeUpdaterType:j.type,lib:H,flowId:L,cancelConnection:T,panBy:B,isValidConnection:(...z)=>{var U,O;return((O=(U=m.getState()).isValidConnection)==null?void 0:O.call(U,...z))??!0},onConnect:A,onConnectStart:E,onConnectEnd:(...z)=>{var U,O;return(O=(U=m.getState()).onConnectEnd)==null?void 0:O.call(U,...z)},onReconnectEnd:I,updateConnection:F,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},S=N=>b(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=N=>b(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>h(!0),y=()=>h(!1);return l.jsxs(l.Fragment,{children:[(e===!0||e==="source")&&l.jsx(qv,{position:a,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&l.jsx(qv,{position:c,centerX:o,centerY:s,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function QF({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:u,reconnectRadius:p,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:m,edgeTypes:b,noPanClassName:S,onError:g,disableKeyboardA11y:v}){let y=Be(ge=>ge.edgeLookup.get(e));const N=Be(ge=>ge.defaultEdgeOptions);y=N?{...N,...y}:y;let j=y.type||"default",k=(b==null?void 0:b[j])||Wv[j];k===void 0&&(g==null||g("011",Wr.error011(j)),j="default",k=(b==null?void 0:b.default)||Wv.default);const _=!!(y.focusable||t&&typeof y.focusable>"u"),R=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),H=w.useRef(null),[P,T]=w.useState(!1),[V,L]=w.useState(!1),B=dt(),{zIndex:F,sourceX:$,sourceY:I,targetX:A,targetY:E,sourcePosition:z,targetPosition:U}=Be(w.useCallback(ge=>{const ye=ge.nodeLookup.get(y.source),$e=ge.nodeLookup.get(y.target);if(!ye||!$e)return{zIndex:y.zIndex,...Kv};const qe=IM({id:e,sourceNode:ye,targetNode:$e,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ge.connectionMode,onError:g});return{zIndex:kM({selected:y.selected,zIndex:y.zIndex,sourceNode:ye,targetNode:$e,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...qe||Kv}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ut),O=w.useMemo(()=>y.markerStart?`url('#${Tg(y.markerStart,m)}')`:void 0,[y.markerStart,m]),q=w.useMemo(()=>y.markerEnd?`url('#${Tg(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||$===null||I===null||A===null||E===null)return null;const Z=ge=>{var Me;const{addSelectedEdges:ye,unselectNodesAndEdges:$e,multiSelectionActive:qe}=B.getState();M&&(B.setState({nodesSelectionActive:!1}),y.selected&&qe?($e({nodes:[],edges:[y]}),(Me=H.current)==null||Me.blur()):ye([e])),i&&i(ge,y)},te=o?ge=>{o(ge,{...y})}:void 0,ae=s?ge=>{s(ge,{...y})}:void 0,ee=a?ge=>{a(ge,{...y})}:void 0,ue=c?ge=>{c(ge,{...y})}:void 0,Se=u?ge=>{u(ge,{...y})}:void 0,xe=ge=>{var ye;if(!v&&SC.includes(ge.key)&&M){const{unselectNodesAndEdges:$e,addSelectedEdges:qe}=B.getState();ge.key==="Escape"?((ye=H.current)==null||ye.blur(),$e({edges:[y]})):qe([e])}};return l.jsx("svg",{style:{zIndex:F},children:l.jsxs("g",{className:It(["react-flow__edge",`react-flow__edge-${j}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!M&&!i,updating:P,selectable:M}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:ee,onMouseMove:ue,onMouseLeave:Se,onKeyDown:_?xe:void 0,tabIndex:_?0:void 0,role:y.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":_?`${sE}-${m}`:void 0,ref:H,...y.domAttributes,children:[!V&&l.jsx(k,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:$,sourceY:I,targetX:A,targetY:E,sourcePosition:z,targetPosition:U,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:O,markerEnd:q,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),R&&l.jsx(XF,{edge:y,isReconnectable:R,reconnectRadius:p,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:$,sourceY:I,targetX:A,targetY:E,sourcePosition:z,targetPosition:U,setUpdateHover:T,setReconnecting:L})]})})}var JF=w.memo(QF);const ZF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function TE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:m,disableKeyboardA11y:b}){const{edgesFocusable:S,edgesReconnectable:g,elementsSelectable:v,onError:y}=Be(ZF,ut),N=DF(t);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(HF,{defaultColor:e,rfId:n}),N.map(j=>l.jsx(JF,{id:j,edgesFocusable:S,edgesReconnectable:g,elementsSelectable:v,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:u,onClick:p,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:b},j))]})}TE.displayName="EdgeRenderer";const e$=w.memo(TE),t$=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function n$({children:e}){const t=Be(t$);return l.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function r$(e){const t=Qc(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const i$=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function o$(e){const t=Be(i$),n=dt();return w.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function s$(e){return e.connection.inProgress?{...e.connection,to:Xc(e.connection.to,e.transform)}:{...e.connection}}function a$(e){return s$}function l$(e){const t=a$();return Be(t,ut)}const c$=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function u$({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:a,inProgress:c}=Be(c$,ut);return!(o&&i&&c)?null:l.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:It(["react-flow__connection",CC(a)]),children:l.jsx(RE,{style:t,type:n,CustomComponent:r,isValid:a})})})}const RE=({style:e,type:t=Fi.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:a,fromPosition:c,to:u,toNode:p,toHandle:d,toPosition:f,pointer:h}=l$();if(!i)return;if(n)return l.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:CC(r),toNode:p,toHandle:d,pointer:h});let m="";const b={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Fi.Bezier:[m]=DC(b);break;case Fi.SimpleBezier:[m]=vE(b);break;case Fi.Step:[m]=Ag({...b,borderRadius:0});break;case Fi.SmoothStep:[m]=Ag(b);break;default:[m]=zC(b)}return l.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};RE.displayName="ConnectionLine";const d$={};function Gv(e=d$){w.useRef(e),dt(),w.useEffect(()=>{},[e])}function f$(){dt(),w.useRef(!1),w.useEffect(()=>{},[])}function LE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:m,connectionLineStyle:b,connectionLineComponent:S,connectionLineContainerStyle:g,selectionKeyCode:v,selectionOnDrag:y,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:_,deleteKeyCode:R,onlyRenderVisibleElements:M,elementsSelectable:H,defaultViewport:P,translateExtent:T,minZoom:V,maxZoom:L,preventScrolling:B,defaultMarkerColor:F,zoomOnScroll:$,zoomOnPinch:I,panOnScroll:A,panOnScrollSpeed:E,panOnScrollMode:z,zoomOnDoubleClick:U,panOnDrag:O,onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:ee,onPaneContextMenu:ue,paneClickDistance:Se,nodeClickDistance:xe,onEdgeContextMenu:ge,onEdgeMouseEnter:ye,onEdgeMouseMove:$e,onEdgeMouseLeave:qe,reconnectRadius:Me,onReconnect:ft,onReconnectStart:Ve,onReconnectEnd:at,noDragClassName:Nn,noWheelClassName:vr,noPanClassName:br,disableKeyboardA11y:Sr,nodeExtent:uo,rfId:Gr,viewport:X,onViewportChange:se}){return Gv(e),Gv(t),f$(),r$(n),o$(X),l.jsx(jF,{onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ue,onPaneScroll:ee,paneClickDistance:Se,deleteKeyCode:R,selectionKeyCode:v,selectionOnDrag:y,selectionMode:N,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:_,elementsSelectable:H,zoomOnScroll:$,zoomOnPinch:I,zoomOnDoubleClick:U,panOnScroll:A,panOnScrollSpeed:E,panOnScrollMode:z,panOnDrag:O,defaultViewport:P,translateExtent:T,minZoom:V,maxZoom:L,onSelectionContextMenu:d,preventScrolling:B,noDragClassName:Nn,noWheelClassName:vr,noPanClassName:br,disableKeyboardA11y:Sr,onViewportChange:se,isControlledViewport:!!X,children:l.jsxs(n$,{children:[l.jsx(e$,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:ft,onReconnectStart:Ve,onReconnectEnd:at,onlyRenderVisibleElements:M,onEdgeContextMenu:ge,onEdgeMouseEnter:ye,onEdgeMouseMove:$e,onEdgeMouseLeave:qe,reconnectRadius:Me,defaultMarkerColor:F,noPanClassName:br,disableKeyboardA11y:Sr,rfId:Gr}),l.jsx(u$,{style:b,type:m,component:S,containerStyle:g}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(MF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:p,nodeClickDistance:xe,onlyRenderVisibleElements:M,noPanClassName:br,noDragClassName:Nn,disableKeyboardA11y:Sr,nodeExtent:uo,rfId:Gr}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}LE.displayName="GraphView";const p$=w.memo(LE),Xv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:c=.5,maxZoom:u=2,nodeOrigin:p,nodeExtent:d,zIndexMode:f="basic"}={})=>{const h=new Map,m=new Map,b=new Map,S=new Map,g=r??t??[],v=n??e??[],y=p??[0,0],N=d??kc;UC(b,S,g);const{nodesInitialized:j}=Rg(v,h,m,{nodeOrigin:y,nodeExtent:N,zIndexMode:f});let k=[0,0,1];if(s&&i&&o){const _=qc(h,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:R,y:M,zoom:H}=px(_,i,o,c,u,(a==null?void 0:a.padding)??.1);k=[R,M,H]}return{rfId:"1",width:i??0,height:o??0,transform:k,nodes:v,nodesInitialized:j,nodeLookup:h,parentLookup:m,edges:g,edgeLookup:S,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:kc,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fa.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...NC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:yM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:kC,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},h$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:u,nodeOrigin:p,nodeExtent:d,zIndexMode:f})=>RD((h,m)=>{async function b(){const{nodeLookup:S,panZoom:g,fitViewOptions:v,fitViewResolver:y,width:N,height:j,minZoom:k,maxZoom:_}=m();g&&(await mM({nodes:S,width:N,height:j,panZoom:g,minZoom:k,maxZoom:_},v),y==null||y.resolve(!0),h({fitViewResolver:null}))}return{...Xv({nodes:e,edges:t,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:u,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:S=>{const{nodeLookup:g,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:N,fitViewQueued:j,zIndexMode:k,nodesSelectionActive:_}=m(),{nodesInitialized:R,hasSelectedNodes:M}=Rg(S,g,v,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:k}),H=_&&M;j&&R?(b(),h({nodes:S,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:H})):h({nodes:S,nodesInitialized:R,nodesSelectionActive:H})},setEdges:S=>{const{connectionLookup:g,edgeLookup:v}=m();UC(g,v,S),h({edges:S})},setDefaultNodesAndEdges:(S,g)=>{if(S){const{setNodes:v}=m();v(S),h({hasDefaultNodes:!0})}if(g){const{setEdges:v}=m();v(g),h({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:g,nodeLookup:v,parentLookup:y,domNode:N,nodeOrigin:j,nodeExtent:k,debug:_,fitViewQueued:R,zIndexMode:M}=m(),{changes:H,updatedInternals:P}=FM(S,v,y,N,j,k,M);P&&(LM(v,y,{nodeOrigin:j,nodeExtent:k,zIndexMode:M}),R?(b(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(H==null?void 0:H.length)>0&&(_&&console.log("React Flow: trigger node changes",H),g==null||g(H)))},updateNodePositions:(S,g=!1)=>{const v=[];let y=[];const{nodeLookup:N,triggerNodeChanges:j,connection:k,updateConnection:_,onNodesChangeMiddlewareMap:R}=m();for(const[M,H]of S){const P=N.get(M),T=!!(P!=null&&P.expandParent&&(P!=null&&P.parentId)&&(H!=null&&H.position)),V={id:M,type:"position",position:T?{x:Math.max(0,H.position.x),y:Math.max(0,H.position.y)}:H.position,dragging:g};if(P&&k.inProgress&&k.fromNode.id===P.id){const L=Jo(P,k.fromHandle,be.Left,!0);_({...k,from:L})}T&&P.parentId&&v.push({id:M,parentId:P.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),y.push(V)}if(v.length>0){const{parentLookup:M,nodeOrigin:H}=m(),P=wx(v,N,M,H);y.push(...P)}for(const M of R.values())y=M(y);j(y)},triggerNodeChanges:S=>{const{onNodesChange:g,setNodes:v,nodes:y,hasDefaultNodes:N,debug:j}=m();if(S!=null&&S.length){if(N){const k=cE(S,y);v(k)}j&&console.log("React Flow: trigger node changes",S),g==null||g(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:g,setEdges:v,edges:y,hasDefaultEdges:N,debug:j}=m();if(S!=null&&S.length){if(N){const k=uE(S,y);v(k)}j&&console.log("React Flow: trigger edge changes",S),g==null||g(S)}},addSelectedNodes:S=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:y,triggerNodeChanges:N,triggerEdgeChanges:j}=m();if(g){const k=S.map(_=>To(_,!0));N(k);return}N(Hs(y,new Set([...S]),!0)),j(Hs(v))},addSelectedEdges:S=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:y,triggerNodeChanges:N,triggerEdgeChanges:j}=m();if(g){const k=S.map(_=>To(_,!0));j(k);return}j(Hs(v,new Set([...S]))),N(Hs(y,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:g}={})=>{const{edges:v,nodes:y,nodeLookup:N,triggerNodeChanges:j,triggerEdgeChanges:k}=m(),_=S||y,R=g||v,M=[];for(const P of _){if(!P.selected)continue;const T=N.get(P.id);T&&(T.selected=!1),M.push(To(P.id,!1))}const H=[];for(const P of R)P.selected&&H.push(To(P.id,!1));j(M),k(H)},setMinZoom:S=>{const{panZoom:g,maxZoom:v}=m();g==null||g.setScaleExtent([S,v]),h({minZoom:S})},setMaxZoom:S=>{const{panZoom:g,minZoom:v}=m();g==null||g.setScaleExtent([v,S]),h({maxZoom:S})},setTranslateExtent:S=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(S),h({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:g,triggerNodeChanges:v,triggerEdgeChanges:y,elementsSelectable:N}=m();if(!N)return;const j=g.reduce((_,R)=>R.selected?[..._,To(R.id,!1)]:_,[]),k=S.reduce((_,R)=>R.selected?[..._,To(R.id,!1)]:_,[]);v(j),y(k)},setNodeExtent:S=>{const{nodes:g,nodeLookup:v,parentLookup:y,nodeOrigin:N,elevateNodesOnSelect:j,nodeExtent:k,zIndexMode:_}=m();S[0][0]===k[0][0]&&S[0][1]===k[0][1]&&S[1][0]===k[1][0]&&S[1][1]===k[1][1]||(Rg(g,v,y,{nodeOrigin:N,nodeExtent:S,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:_}),h({nodeExtent:S}))},panBy:S=>{const{transform:g,width:v,height:y,panZoom:N,translateExtent:j}=m();return $M({delta:S,panZoom:N,transform:g,translateExtent:j,width:v,height:y})},setCenter:async(S,g,v)=>{const{width:y,height:N,maxZoom:j,panZoom:k}=m();if(!k)return Promise.resolve(!1);const _=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:j;return await k.setViewport({x:y/2-S*_,y:N/2-g*_,zoom:_},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...NC}})},updateConnection:S=>{h({connection:S})},reset:()=>h({...Xv()})}},Object.is);function OE({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:c,fitView:u,nodeOrigin:p,nodeExtent:d,zIndexMode:f,children:h}){const[m]=w.useState(()=>h$({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:f}));return l.jsx(LD,{value:m,children:l.jsx(nF,{children:h})})}function m$({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:p,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return w.useContext(vp)?l.jsx(l.Fragment,{children:e}):l.jsx(OE,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:a,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:p,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}const g$={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function y$({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:c,onInit:u,onMove:p,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:b,onClickConnectStart:S,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,onNodeDragStart:_,onNodeDrag:R,onNodeDragStop:M,onNodesDelete:H,onEdgesDelete:P,onDelete:T,onSelectionChange:V,onSelectionDragStart:L,onSelectionDrag:B,onSelectionDragStop:F,onSelectionContextMenu:$,onSelectionStart:I,onSelectionEnd:A,onBeforeDelete:E,connectionMode:z,connectionLineType:U=Fi.Bezier,connectionLineStyle:O,connectionLineComponent:q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:ee=!1,selectionMode:ue=Nc.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:xe=Ec()?"Meta":"Control",zoomActivationKeyCode:ge=Ec()?"Meta":"Control",snapToGrid:ye,snapGrid:$e,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Me,nodesDraggable:ft,autoPanOnNodeFocus:Ve,nodesConnectable:at,nodesFocusable:Nn,nodeOrigin:vr=aE,edgesFocusable:br,edgesReconnectable:Sr,elementsSelectable:uo=!0,defaultViewport:Gr=YD,minZoom:X=.5,maxZoom:se=2,translateExtent:ke=kc,preventScrolling:Ie=!0,nodeExtent:He,defaultMarkerColor:Wt="#b1b1b7",zoomOnScroll:Fn=!0,zoomOnPinch:cn=!0,panOnScroll:de=!1,panOnScrollSpeed:yt=.5,panOnScrollMode:Nt=Bo.Free,zoomOnDoubleClick:Ee=!0,panOnDrag:Kt=!0,onPaneClick:$n,onPaneMouseEnter:zn,onPaneMouseMove:is,onPaneMouseLeave:Zn,onPaneScroll:os,onPaneContextMenu:Xr,paneClickDistance:La=1,nodeClickDistance:Qr=0,children:fo,onReconnect:po,onReconnectStart:Lp,onReconnectEnd:Op,onEdgeContextMenu:ou,onEdgeDoubleClick:su,onEdgeMouseEnter:Oa,onEdgeMouseMove:Ma,onEdgeMouseLeave:ss,reconnectRadius:xt=10,onNodesChange:ho,onEdgesChange:Da,noDragClassName:as="nodrag",noWheelClassName:mo="nowheel",noPanClassName:Fa="nopan",fitView:$a,fitViewOptions:za,connectOnClick:Ni,attributionPosition:Mp,proOptions:ls,defaultEdgeOptions:au,elevateNodesOnSelect:lu=!0,elevateEdgesOnSelect:Jr=!1,disableKeyboardA11y:cs=!1,autoPanOnConnect:us,autoPanOnNodeDrag:Ba,autoPanSpeed:At,connectionRadius:go,isValidConnection:cu,onError:uu,style:er,id:Ha,nodeDragThreshold:ds,connectionDragThreshold:yo,viewport:fs,onViewportChange:ps,width:Xe,height:Ua,colorMode:pt="light",debug:Va,onScroll:Zr,ariaLabelConfig:kr,zIndexMode:xo="basic",...Wa},wo){const Ct=Ha||"1",hs=QD(pt),vo=w.useCallback(bo=>{bo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zr==null||Zr(bo)},[Zr]);return l.jsx("div",{"data-testid":"rf__wrapper",...Wa,onScroll:vo,style:{...er,...g$},ref:wo,className:It(["react-flow",i,hs]),id:Ha,role:"application",children:l.jsxs(m$,{nodes:e,edges:t,width:Xe,height:Ua,fitView:$a,fitViewOptions:za,minZoom:X,maxZoom:se,nodeOrigin:vr,nodeExtent:He,zIndexMode:xo,children:[l.jsx(XD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:b,onClickConnectStart:S,onClickConnectEnd:g,nodesDraggable:ft,autoPanOnNodeFocus:Ve,nodesConnectable:at,nodesFocusable:Nn,edgesFocusable:br,edgesReconnectable:Sr,elementsSelectable:uo,elevateNodesOnSelect:lu,elevateEdgesOnSelect:Jr,minZoom:X,maxZoom:se,nodeExtent:He,onNodesChange:ho,onEdgesChange:Da,snapToGrid:ye,snapGrid:$e,connectionMode:z,translateExtent:ke,connectOnClick:Ni,defaultEdgeOptions:au,fitView:$a,fitViewOptions:za,onNodesDelete:H,onEdgesDelete:P,onDelete:T,onNodeDragStart:_,onNodeDrag:R,onNodeDragStop:M,onSelectionDrag:B,onSelectionDragStart:L,onSelectionDragStop:F,onMove:p,onMoveStart:d,onMoveEnd:f,noPanClassName:Fa,nodeOrigin:vr,rfId:Ct,autoPanOnConnect:us,autoPanOnNodeDrag:Ba,autoPanSpeed:At,onError:uu,connectionRadius:go,isValidConnection:cu,selectNodesOnDrag:Me,nodeDragThreshold:ds,connectionDragThreshold:yo,onBeforeDelete:E,debug:Va,ariaLabelConfig:kr,zIndexMode:xo}),l.jsx(p$,{onInit:u,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:s,connectionLineType:U,connectionLineStyle:O,connectionLineComponent:q,connectionLineContainerStyle:Z,selectionKeyCode:ae,selectionOnDrag:ee,selectionMode:ue,deleteKeyCode:te,multiSelectionKeyCode:xe,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:qe,defaultViewport:Gr,translateExtent:ke,minZoom:X,maxZoom:se,preventScrolling:Ie,zoomOnScroll:Fn,zoomOnPinch:cn,zoomOnDoubleClick:Ee,panOnScroll:de,panOnScrollSpeed:yt,panOnScrollMode:Nt,panOnDrag:Kt,onPaneClick:$n,onPaneMouseEnter:zn,onPaneMouseMove:is,onPaneMouseLeave:Zn,onPaneScroll:os,onPaneContextMenu:Xr,paneClickDistance:La,nodeClickDistance:Qr,onSelectionContextMenu:$,onSelectionStart:I,onSelectionEnd:A,onReconnect:po,onReconnectStart:Lp,onReconnectEnd:Op,onEdgeContextMenu:ou,onEdgeDoubleClick:su,onEdgeMouseEnter:Oa,onEdgeMouseMove:Ma,onEdgeMouseLeave:ss,reconnectRadius:xt,defaultMarkerColor:Wt,noDragClassName:as,noWheelClassName:mo,noPanClassName:Fa,rfId:Ct,disableKeyboardA11y:cs,nodeExtent:He,viewport:fs,onViewportChange:ps}),l.jsx(KD,{onSelectionChange:V}),fo,l.jsx(BD,{proOptions:ls,position:Mp}),l.jsx(zD,{rfId:Ct,disableKeyboardA11y:cs})]})})}var x$=dE(y$);function w$(e){const[t,n]=w.useState(e),r=w.useCallback(i=>n(o=>cE(i,o)),[]);return[t,n,r]}function v$(e){const[t,n]=w.useState(e),r=w.useCallback(i=>n(o=>uE(i,o)),[]);return[t,n,r]}function b$({dimensions:e,lineWidth:t,variant:n,className:r}){return l.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:It(["react-flow__background-pattern",n,r])})}function S$({radius:e,className:t}){return l.jsx("circle",{cx:e,cy:e,r:e,className:It(["react-flow__background-pattern","dots",t])})}var Qi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qi||(Qi={}));const k$={[Qi.Dots]:1,[Qi.Lines]:1,[Qi.Cross]:6},N$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ME({id:e,variant:t=Qi.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:a,style:c,className:u,patternClassName:p}){const d=w.useRef(null),{transform:f,patternId:h}=Be(N$,ut),m=r||k$[t],b=t===Qi.Dots,S=t===Qi.Cross,g=Array.isArray(n)?n:[n,n],v=[g[0]*f[2]||1,g[1]*f[2]||1],y=m*f[2],N=Array.isArray(o)?o:[o,o],j=S?[y,y]:v,k=[N[0]*f[2]||1+j[0]/2,N[1]*f[2]||1+j[1]/2],_=`${h}${e||""}`;return l.jsxs("svg",{className:It(["react-flow__background",u]),style:{...c,...bp,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[l.jsx("pattern",{id:_,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:b?l.jsx(S$,{radius:y/2,className:p}):l.jsx(b$,{dimensions:j,lineWidth:i,variant:t,className:p})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}ME.displayName="Background";const C$=w.memo(ME);function E$(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function j$(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function P$(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function _$(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function I$(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function fd({children:e,className:t,...n}){return l.jsx("button",{type:"button",className:It(["react-flow__controls-button",t]),...n,children:e})}const A$=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function DE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:u,children:p,position:d="bottom-left",orientation:f="vertical","aria-label":h}){const m=dt(),{isInteractive:b,minZoomReached:S,maxZoomReached:g,ariaLabelConfig:v}=Be(A$,ut),{zoomIn:y,zoomOut:N,fitView:j}=Qc(),k=()=>{y(),o==null||o()},_=()=>{N(),s==null||s()},R=()=>{j(i),a==null||a()},M=()=>{m.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},H=f==="horizontal"?"horizontal":"vertical";return l.jsxs(xa,{className:It(["react-flow__controls",H,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(fd,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:g,children:l.jsx(E$,{})}),l.jsx(fd,{onClick:_,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:l.jsx(j$,{})})]}),n&&l.jsx(fd,{className:"react-flow__controls-fitview",onClick:R,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:l.jsx(P$,{})}),r&&l.jsx(fd,{className:"react-flow__controls-interactive",onClick:M,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:b?l.jsx(I$,{}):l.jsx(_$,{})}),p]})}DE.displayName="Controls";const T$=w.memo(DE);function R$({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:a,strokeWidth:c,className:u,borderRadius:p,shapeRendering:d,selected:f,onClick:h}){const{background:m,backgroundColor:b}=o||{},S=s||m||b;return l.jsx("rect",{className:It(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:p,ry:p,width:r,height:i,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:d,onClick:h?g=>h(g,e):void 0})}const L$=w.memo(R$),O$=e=>e.nodes.map(t=>t.id),Yh=e=>e instanceof Function?e:()=>e;function M$({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=L$,onClick:s}){const a=Be(O$,ut),c=Yh(t),u=Yh(e),p=Yh(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:a.map(f=>l.jsx(F$,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:d},f))})}function D$({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:c}){const{node:u,x:p,y:d,width:f,height:h}=Be(m=>{const b=m.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const S=b.internals.userNode,{x:g,y:v}=b.internals.positionAbsolute,{width:y,height:N}=Si(S);return{node:S,x:g,y:v,width:y,height:N}},ut);return!u||u.hidden||!AC(u)?null:l.jsx(a,{x:p,y:d,width:f,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:o,shapeRendering:s,onClick:c,id:u.id})}const F$=w.memo(D$);var $$=w.memo(M$);const z$=200,B$=150,H$=e=>!e.hidden,U$=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?IC(qc(e.nodeLookup,{filter:H$}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},V$="react-flow__minimap-desc";function FE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:c,maskColor:u,maskStrokeColor:p,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:m,pannable:b=!1,zoomable:S=!1,ariaLabel:g,inversePan:v,zoomStep:y=1,offsetScale:N=5}){const j=dt(),k=w.useRef(null),{boundingRect:_,viewBB:R,rfId:M,panZoom:H,translateExtent:P,flowWidth:T,flowHeight:V,ariaLabelConfig:L}=Be(U$,ut),B=(e==null?void 0:e.width)??z$,F=(e==null?void 0:e.height)??B$,$=_.width/B,I=_.height/F,A=Math.max($,I),E=A*B,z=A*F,U=N*A,O=_.x-(E-_.width)/2-U,q=_.y-(z-_.height)/2-U,Z=E+U*2,te=z+U*2,ae=`${V$}-${M}`,ee=w.useRef(0),ue=w.useRef();ee.current=A,w.useEffect(()=>{if(k.current&&H)return ue.current=qM({domNode:k.current,panZoom:H,getTransform:()=>j.getState().transform,getViewScale:()=>ee.current}),()=>{var ye;(ye=ue.current)==null||ye.destroy()}},[H]),w.useEffect(()=>{var ye;(ye=ue.current)==null||ye.update({translateExtent:P,width:T,height:V,inversePan:v,pannable:b,zoomStep:y,zoomable:S})},[b,S,v,y,P,T,V]);const Se=h?ye=>{var Me;const[$e,qe]=((Me=ue.current)==null?void 0:Me.pointer(ye))||[0,0];h(ye,{x:$e,y:qe})}:void 0,xe=m?w.useCallback((ye,$e)=>{const qe=j.getState().nodeLookup.get($e).internals.userNode;m(ye,qe)},[]):void 0,ge=g??L["minimap.ariaLabel"];return l.jsx(xa,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*A:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:It(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:B,height:F,viewBox:`${O} ${q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:k,onClick:Se,children:[ge&&l.jsx("title",{id:ae,children:ge}),l.jsx($$,{onClick:xe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:a}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-U},${q-U}h${Z+U*2}v${te+U*2}h${-Z-U*2}z
63
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}FE.displayName="MiniMap";const W$=w.memo(FE),K$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Y$={[ga.Line]:"right",[ga.Handle]:"bottom-right"};function q$({nodeId:e,position:t,variant:n=ga.Handle,className:r,style:i=void 0,children:o,color:s,minWidth:a=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:m,onResizeStart:b,onResize:S,onResizeEnd:g}){const v=mE(),y=typeof e=="string"?e:v,N=dt(),j=w.useRef(null),k=n===ga.Handle,_=Be(w.useCallback(K$(k&&h),[k,h]),ut),R=w.useRef(null),M=t??Y$[n];w.useEffect(()=>{if(!(!j.current||!y))return R.current||(R.current=lD({domNode:j.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:P,transform:T,snapGrid:V,snapToGrid:L,nodeOrigin:B,domNode:F}=N.getState();return{nodeLookup:P,transform:T,snapGrid:V,snapToGrid:L,nodeOrigin:B,paneDomNode:F}},onChange:(P,T)=>{const{triggerNodeChanges:V,nodeLookup:L,parentLookup:B,nodeOrigin:F}=N.getState(),$=[],I={x:P.x,y:P.y},A=L.get(y);if(A&&A.expandParent&&A.parentId){const E=A.origin??F,z=P.width??A.measured.width??0,U=P.height??A.measured.height??0,O={id:A.id,parentId:A.parentId,rect:{width:z,height:U,...TC({x:P.x??A.position.x,y:P.y??A.position.y},{width:z,height:U},A.parentId,L,E)}},q=wx([O],L,B,F);$.push(...q),I.x=P.x?Math.max(E[0]*z,P.x):void 0,I.y=P.y?Math.max(E[1]*U,P.y):void 0}if(I.x!==void 0&&I.y!==void 0){const E={id:y,type:"position",position:{...I}};$.push(E)}if(P.width!==void 0&&P.height!==void 0){const z={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};$.push(z)}for(const E of T){const z={...E,type:"position"};$.push(z)}V($)},onEnd:({width:P,height:T})=>{const V={id:y,type:"dimensions",resizing:!1,dimensions:{width:P,height:T}};N.getState().triggerNodeChanges([V])}})),R.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:c,maxWidth:u,maxHeight:p},keepAspectRatio:d,resizeDirection:f,onResizeStart:b,onResize:S,onResizeEnd:g,shouldResize:m}),()=>{var P;(P=R.current)==null||P.destroy()}},[M,a,c,u,p,d,b,S,g,m]);const H=M.split("-");return l.jsx("div",{className:It(["react-flow__resize-control","nodrag",...H,n,r]),ref:j,style:{...i,scale:_,...s&&{[k?"backgroundColor":"borderColor"]:s}},children:o})}w.memo(q$);function G$(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function If(e){if(e==null)return"null";if(typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>If(r)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${If(t[r])}`).join(",")}}`}function Qv(e){return If({id:e.id,type:e.type,position:e.position,data:e.data,parentId:e.parentId,extent:e.extent,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,hidden:e.hidden})}function Pc(e){const t=e.sourceHandle??"",n=e.targetHandle??"";return`${e.source}|${t}|${e.target}|${n}`}function Jv(e){return If({source:e.source,target:e.target,sourceHandle:e.sourceHandle??null,targetHandle:e.targetHandle??null,type:e.type,label:e.label,data:e.data,markerStart:e.markerStart,markerEnd:e.markerEnd,animated:e.animated,hidden:e.hidden,style:e.style})}function Zv(e,t){return!G$(t)||!("selected"in t)||t.selected===e.selected?e:{...e,selected:!!t.selected}}function eb(e,t=!1){const n=new Map;for(const r of e){const i=Pc(r);if(t&&n.has(i))throw new Error(`存在重复连线键: ${i}`);n.set(i,r)}return n}function X$(e,t,n,r){const i=new Map(e.map(v=>[v.id,v])),o=new Set(n.map(v=>v.id)),s=new Set,a=[],c=[],u=n.map(v=>{const y=i.get(v.id);return y?Qv(y)===Qv(v)?(s.add(v.id),y):(c.push(v.id),Zv(v,y)):(a.push(v.id),v)}),p=eb(t),d=eb(r,!0),f=new Set,h=[],m=[],b=r.map(v=>{const y=Pc(v),N=p.get(y);return N?Jv(N)===Jv(v)?(f.add(y),N):(m.push(y),Zv(v,N)):(h.push(y),v)}),S=e.filter(v=>!o.has(v.id)).map(v=>v.id),g=t.map(v=>Pc(v)).filter(v=>!d.has(v));return{nodes:u,edges:b,changes:{addedNodeIds:a,updatedNodeIds:c,removedNodeIds:S,addedEdgeKeys:h,updatedEdgeKeys:m,removedEdgeKeys:g},stats:{nodeAdded:a.length,nodeRemoved:S.length,nodeReused:s.size,edgeAdded:h.length,edgeRemoved:g.length,edgeReused:f.size,nextEdgeCount:d.size}}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function $E(e){return typeof e>"u"||e===null}function Q$(e){return typeof e=="object"&&e!==null}function J$(e){return Array.isArray(e)?e:$E(e)?[]:[e]}function Z$(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function e3(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function t3(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var n3=$E,r3=Q$,i3=J$,o3=e3,s3=t3,a3=Z$,Rt={isNothing:n3,isObject:r3,toArray:i3,repeat:o3,isNegativeZero:s3,extend:a3};function zE(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
64
+
65
+ `+e.mark.snippet),r+" "+n):r}function _c(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=zE(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}_c.prototype=Object.create(Error.prototype);_c.prototype.constructor=_c;_c.prototype.toString=function(t){return this.name+": "+zE(this,t)};var on=_c;function qh(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(o=" ... ",t=r-a+o.length),n-r>a&&(s=" ...",n=r+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+o.length}}function Gh(e,t){return Rt.repeat(" ",t-e.length)+e}function l3(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],o,s=-1;o=n.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var a="",c,u,p=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+p+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=qh(e.buffer,r[s-c],i[s-c],e.position-(r[s]-r[s-c]),d),a=Rt.repeat(" ",t.indent)+Gh((e.line-c+1).toString(),p)+" | "+u.str+`
66
+ `+a;for(u=qh(e.buffer,r[s],i[s],e.position,d),a+=Rt.repeat(" ",t.indent)+Gh((e.line+1).toString(),p)+" | "+u.str+`
67
+ `,a+=Rt.repeat("-",t.indent+p+3+u.pos)+`^
68
+ `,c=1;c<=t.linesAfter&&!(s+c>=i.length);c++)u=qh(e.buffer,r[s+c],i[s+c],e.position-(r[s]-r[s+c]),d),a+=Rt.repeat(" ",t.indent)+Gh((e.line+c+1).toString(),p)+" | "+u.str+`
69
+ `;return a.replace(/\n$/,"")}var c3=l3,u3=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],d3=["scalar","sequence","mapping"];function f3(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function p3(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(u3.indexOf(n)===-1)throw new on('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=f3(t.styleAliases||null),d3.indexOf(this.kind)===-1)throw new on('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ht=p3;function tb(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(o,s){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=s)}),n[i]=r}),n}function h3(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Dg(e){return this.extend(e)}Dg.prototype.extend=function(t){var n=[],r=[];if(t instanceof Ht)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new on("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof Ht))throw new on("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new on("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new on("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof Ht))throw new on("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Dg.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=tb(i,"implicit"),i.compiledExplicit=tb(i,"explicit"),i.compiledTypeMap=h3(i.compiledImplicit,i.compiledExplicit),i};var BE=Dg,HE=new Ht("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),UE=new Ht("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),VE=new Ht("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),WE=new BE({explicit:[HE,UE,VE]});function m3(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function g3(){return null}function y3(e){return e===null}var KE=new Ht("tag:yaml.org,2002:null",{kind:"scalar",resolve:m3,construct:g3,predicate:y3,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function x3(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function w3(e){return e==="true"||e==="True"||e==="TRUE"}function v3(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var YE=new Ht("tag:yaml.org,2002:bool",{kind:"scalar",resolve:x3,construct:w3,predicate:v3,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function b3(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function S3(e){return 48<=e&&e<=55}function k3(e){return 48<=e&&e<=57}function N3(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!b3(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!S3(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!k3(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function C3(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function E3(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Rt.isNegativeZero(e)}var qE=new Ht("tag:yaml.org,2002:int",{kind:"scalar",resolve:N3,construct:C3,predicate:E3,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),j3=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function P3(e){return!(e===null||!j3.test(e)||e[e.length-1]==="_")}function _3(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var I3=/^[-+]?[0-9]+e/;function A3(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Rt.isNegativeZero(e))return"-0.0";return n=e.toString(10),I3.test(n)?n.replace("e",".e"):n}function T3(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Rt.isNegativeZero(e))}var GE=new Ht("tag:yaml.org,2002:float",{kind:"scalar",resolve:P3,construct:_3,predicate:T3,represent:A3,defaultStyle:"lowercase"}),XE=WE.extend({implicit:[KE,YE,qE,GE]}),QE=XE,JE=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ZE=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function R3(e){return e===null?!1:JE.exec(e)!==null||ZE.exec(e)!==null}function L3(e){var t,n,r,i,o,s,a,c=0,u=null,p,d,f;if(t=JE.exec(e),t===null&&(t=ZE.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(p=+t[10],d=+(t[11]||0),u=(p*60+d)*6e4,t[9]==="-"&&(u=-u)),f=new Date(Date.UTC(n,r,i,o,s,a,c)),u&&f.setTime(f.getTime()-u),f}function O3(e){return e.toISOString()}var ej=new Ht("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:R3,construct:L3,instanceOf:Date,represent:O3});function M3(e){return e==="<<"||e===null}var tj=new Ht("tag:yaml.org,2002:merge",{kind:"scalar",resolve:M3}),bx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
70
+ \r`;function D3(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=bx;for(n=0;n<i;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function F3(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=bx,s=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function $3(e){var t="",n=0,r,i,o=e.length,s=bx;for(r=0;r<o;r++)r%3===0&&r&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[r];return i=o%3,i===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):i===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):i===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function z3(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var nj=new Ht("tag:yaml.org,2002:binary",{kind:"scalar",resolve:D3,construct:F3,predicate:z3,represent:$3}),B3=Object.prototype.hasOwnProperty,H3=Object.prototype.toString;function U3(e){if(e===null)return!0;var t=[],n,r,i,o,s,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],s=!1,H3.call(i)!=="[object Object]")return!1;for(o in i)if(B3.call(i,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function V3(e){return e!==null?e:[]}var rj=new Ht("tag:yaml.org,2002:omap",{kind:"sequence",resolve:U3,construct:V3}),W3=Object.prototype.toString;function K3(e){if(e===null)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],W3.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[t]=[i[0],r[i[0]]]}return!0}function Y3(e){if(e===null)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var ij=new Ht("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:K3,construct:Y3}),q3=Object.prototype.hasOwnProperty;function G3(e){if(e===null)return!0;var t,n=e;for(t in n)if(q3.call(n,t)&&n[t]!==null)return!1;return!0}function X3(e){return e!==null?e:{}}var oj=new Ht("tag:yaml.org,2002:set",{kind:"mapping",resolve:G3,construct:X3}),Sx=QE.extend({implicit:[ej,tj],explicit:[nj,rj,ij,oj]}),no=Object.prototype.hasOwnProperty,Af=1,sj=2,aj=3,Tf=4,Xh=1,Q3=2,nb=3,J3=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Z3=/[\x85\u2028\u2029]/,ez=/[,\[\]\{\}]/,lj=/^(?:!|!!|![a-z\-]+!)$/i,cj=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function rb(e){return Object.prototype.toString.call(e)}function Hr(e){return e===10||e===13}function Ho(e){return e===9||e===32}function yn(e){return e===9||e===32||e===10||e===13}function Us(e){return e===44||e===91||e===93||e===123||e===125}function tz(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function nz(e){return e===120?2:e===117?4:e===85?8:0}function rz(e){return 48<=e&&e<=57?e-48:-1}function ib(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
71
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function iz(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function uj(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var dj=new Array(256),fj=new Array(256);for(var ks=0;ks<256;ks++)dj[ks]=ib(ks)?1:0,fj[ks]=ib(ks);function oz(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Sx,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pj(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=c3(n),new on(t,n)}function ve(e,t){throw pj(e,t)}function Rf(e,t){e.onWarning&&e.onWarning.call(null,pj(e,t))}var ob={YAML:function(t,n,r){var i,o,s;t.version!==null&&ve(t,"duplication of %YAML directive"),r.length!==1&&ve(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&ve(t,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&ve(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Rf(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,o;r.length!==2&&ve(t,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],lj.test(i)||ve(t,"ill-formed tag handle (first argument) of the TAG directive"),no.call(t.tagMap,i)&&ve(t,'there is a previously declared suffix for "'+i+'" tag handle'),cj.test(o)||ve(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{ve(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o}};function Ji(e,t,n,r){var i,o,s,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)s=a.charCodeAt(i),s===9||32<=s&&s<=1114111||ve(e,"expected valid JSON character");else J3.test(a)&&ve(e,"the stream contains non-printable characters");e.result+=a}}function sb(e,t,n,r){var i,o,s,a;for(Rt.isObject(n)||ve(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,a=i.length;s<a;s+=1)o=i[s],no.call(t,o)||(uj(t,o,n[o]),r[o]=!0)}function Vs(e,t,n,r,i,o,s,a,c){var u,p;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,p=i.length;u<p;u+=1)Array.isArray(i[u])&&ve(e,"nested arrays are not supported inside keys"),typeof i=="object"&&rb(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&rb(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,p=o.length;u<p;u+=1)sb(e,t,o[u],n);else sb(e,t,o,n);else!e.json&&!no.call(n,i)&&no.call(t,i)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,ve(e,"duplicated mapping key")),uj(t,i,o),delete n[i];return t}function kx(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):ve(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _t(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Ho(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Hr(i))for(kx(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Rf(e,"deficient indentation"),r}function kp(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||yn(n)))}function Nx(e,t){t===1?e.result+=" ":t>1&&(e.result+=Rt.repeat(`
72
+ `,t-1))}function sz(e,t,n){var r,i,o,s,a,c,u,p,d=e.kind,f=e.result,h;if(h=e.input.charCodeAt(e.position),yn(h)||Us(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),yn(i)||n&&Us(i)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),yn(i)||n&&Us(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),yn(r))break}else{if(e.position===e.lineStart&&kp(e)||n&&Us(h))break;if(Hr(h))if(c=e.line,u=e.lineStart,p=e.lineIndent,_t(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=p;break}}a&&(Ji(e,o,s,!1),Nx(e,e.line-c),o=s=e.position,a=!1),Ho(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return Ji(e,o,s,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function az(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ji(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Hr(n)?(Ji(e,r,i,!0),Nx(e,_t(e,!1,t)),r=i=e.position):e.position===e.lineStart&&kp(e)?ve(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);ve(e,"unexpected end of the stream within a single quoted scalar")}function lz(e,t){var n,r,i,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ji(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ji(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Hr(a))_t(e,!1,t);else if(a<256&&dj[a])e.result+=fj[a],e.position++;else if((s=nz(a))>0){for(i=s,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(s=tz(a))>=0?o=(o<<4)+s:ve(e,"expected hexadecimal character");e.result+=iz(o),e.position++}else ve(e,"unknown escape sequence");n=r=e.position}else Hr(a)?(Ji(e,n,r,!0),Nx(e,_t(e,!1,t)),n=r=e.position):e.position===e.lineStart&&kp(e)?ve(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}ve(e,"unexpected end of the stream within a double quoted scalar")}function cz(e,t){var n=!0,r,i,o,s=e.tag,a,c=e.anchor,u,p,d,f,h,m=Object.create(null),b,S,g,v;if(v=e.input.charCodeAt(e.position),v===91)p=93,h=!1,a=[];else if(v===123)p=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),v=e.input.charCodeAt(++e.position);v!==0;){if(_t(e,!0,t),v=e.input.charCodeAt(e.position),v===p)return e.position++,e.tag=s,e.anchor=c,e.kind=h?"mapping":"sequence",e.result=a,!0;n?v===44&&ve(e,"expected the node content, but found ','"):ve(e,"missed comma between flow collection entries"),S=b=g=null,d=f=!1,v===63&&(u=e.input.charCodeAt(e.position+1),yn(u)&&(d=f=!0,e.position++,_t(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,va(e,t,Af,!1,!0),S=e.tag,b=e.result,_t(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),_t(e,!0,t),va(e,t,Af,!1,!0),g=e.result),h?Vs(e,a,m,S,b,g,r,i,o):d?a.push(Vs(e,null,m,S,b,g,r,i,o)):a.push(b),_t(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}ve(e,"unexpected end of the stream within a flow collection")}function uz(e,t){var n,r,i=Xh,o=!1,s=!1,a=t,c=0,u=!1,p,d;if(d=e.input.charCodeAt(e.position),d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Xh===i?i=d===43?nb:Q3:ve(e,"repeat of a chomping mode identifier");else if((p=rz(d))>=0)p===0?ve(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ve(e,"repeat of an indentation width identifier"):(a=t+p-1,s=!0);else break;if(Ho(d)){do d=e.input.charCodeAt(++e.position);while(Ho(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Hr(d)&&d!==0)}for(;d!==0;){for(kx(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Hr(d)){c++;continue}if(e.lineIndent<a){i===nb?e.result+=Rt.repeat(`
73
+ `,o?1+c:c):i===Xh&&o&&(e.result+=`
74
+ `);break}for(r?Ho(d)?(u=!0,e.result+=Rt.repeat(`
75
+ `,o?1+c:c)):u?(u=!1,e.result+=Rt.repeat(`
76
+ `,c+1)):c===0?o&&(e.result+=" "):e.result+=Rt.repeat(`
77
+ `,c):e.result+=Rt.repeat(`
78
+ `,o?1+c:c),o=!0,s=!0,c=0,n=e.position;!Hr(d)&&d!==0;)d=e.input.charCodeAt(++e.position);Ji(e,n,e.position,!1)}return!0}function ab(e,t){var n,r=e.tag,i=e.anchor,o=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ve(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!yn(s))));){if(a=!0,e.position++,_t(e,!0,-1)&&e.lineIndent<=t){o.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,va(e,t,aj,!1,!0),o.push(e.result),_t(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)ve(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function dz(e,t,n){var r,i,o,s,a,c,u=e.tag,p=e.anchor,d={},f=Object.create(null),h=null,m=null,b=null,S=!1,g=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!S&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ve(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&yn(r))v===63?(S&&(Vs(e,d,f,h,m,null,s,a,c),h=m=b=null),g=!0,S=!0,i=!0):S?(S=!1,i=!0):ve(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(s=e.line,a=e.lineStart,c=e.position,!va(e,n,sj,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);Ho(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),yn(v)||ve(e,"a whitespace character is expected after the key-value separator within a block mapping"),S&&(Vs(e,d,f,h,m,null,s,a,c),h=m=b=null),g=!0,S=!1,i=!1,h=e.tag,m=e.result;else if(g)ve(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=p,!0}else if(g)ve(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=p,!0}if((e.line===o||e.lineIndent>t)&&(S&&(s=e.line,a=e.lineStart,c=e.position),va(e,t,Tf,!0,i)&&(S?m=e.result:b=e.result),S||(Vs(e,d,f,h,m,b,s,a,c),h=m=b=null),_t(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&v!==0)ve(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return S&&Vs(e,d,f,h,m,null,s,a,c),g&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=d),g}function fz(e){var t,n=!1,r=!1,i,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&ve(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(r=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):ve(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!yn(s);)s===33&&(r?ve(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),lj.test(i)||ve(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),ez.test(o)&&ve(e,"tag suffix cannot contain flow indicator characters")}o&&!cj.test(o)&&ve(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{ve(e,"tag name is malformed: "+o)}return n?e.tag=o:no.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:ve(e,'undeclared tag handle "'+i+'"'),!0}function pz(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&ve(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!yn(n)&&!Us(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ve(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function hz(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!yn(r)&&!Us(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ve(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),no.call(e.anchorMap,n)||ve(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],_t(e,!0,-1),!0}function va(e,t,n,r,i){var o,s,a,c=1,u=!1,p=!1,d,f,h,m,b,S;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=Tf===n||aj===n,r&&_t(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;fz(e)||pz(e);)_t(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||i),(c===1||Tf===n)&&(Af===n||sj===n?b=t:b=t+1,S=e.position-e.lineStart,c===1?a&&(ab(e,S)||dz(e,S,b))||cz(e,b)?p=!0:(s&&uz(e,b)||az(e,b)||lz(e,b)?p=!0:hz(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&ve(e,"alias node should not have any properties")):sz(e,b,Af===n)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=a&&ab(e,S))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&ve(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(no.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,h=e.typeMap.multi[e.kind||"fallback"],d=0,f=h.length;d<f;d+=1)if(e.tag.slice(0,h[d].tag.length)===h[d].tag){m=h[d];break}m||ve(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&ve(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):ve(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function mz(e){var t=e.position,n,r,i,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(_t(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!yn(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&ve(e,"directive name must not be less than one character in length");s!==0;){for(;Ho(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Hr(s));break}if(Hr(s))break;for(n=e.position;s!==0&&!yn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}s!==0&&kx(e),no.call(ob,r)?ob[r](e,r,i):Rf(e,'unknown document directive "'+r+'"')}if(_t(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_t(e,!0,-1)):o&&ve(e,"directives end mark is expected"),va(e,e.lineIndent-1,Tf,!1,!0),_t(e,!0,-1),e.checkLineBreaks&&Z3.test(e.input.slice(t,e.position))&&Rf(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&kp(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_t(e,!0,-1));return}if(e.position<e.length-1)ve(e,"end of the stream or a document separator is expected");else return}function hj(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
79
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new oz(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,ve(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)mz(n);return n.documents}function gz(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=hj(e,n);if(typeof t!="function")return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function yz(e,t){var n=hj(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new on("expected a single document in the stream, but found more")}}var xz=gz,wz=yz,mj={loadAll:xz,load:wz},gj=Object.prototype.toString,yj=Object.prototype.hasOwnProperty,Cx=65279,vz=9,Ic=10,bz=13,Sz=32,kz=33,Nz=34,Fg=35,Cz=37,Ez=38,jz=39,Pz=42,xj=44,_z=45,Lf=58,Iz=61,Az=62,Tz=63,Rz=64,wj=91,vj=93,Lz=96,bj=123,Oz=124,Sj=125,en={};en[0]="\\0";en[7]="\\a";en[8]="\\b";en[9]="\\t";en[10]="\\n";en[11]="\\v";en[12]="\\f";en[13]="\\r";en[27]="\\e";en[34]='\\"';en[92]="\\\\";en[133]="\\N";en[160]="\\_";en[8232]="\\L";en[8233]="\\P";var Mz=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Dz=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Fz(e,t){var n,r,i,o,s,a,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)s=r[i],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&yj.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[s]=a;return n}function $z(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new on("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Rt.repeat("0",r-t.length)+t}var zz=1,Ac=2;function Bz(e){this.schema=e.schema||Sx,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Rt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Fz(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ac:zz,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function lb(e,t){for(var n=Rt.repeat(" ",t),r=0,i=-1,o="",s,a=e.length;r<a;)i=e.indexOf(`
80
+ `,r),i===-1?(s=e.slice(r),r=a):(s=e.slice(r,i+1),r=i+1),s.length&&s!==`
81
+ `&&(o+=n),o+=s;return o}function $g(e,t){return`
82
+ `+Rt.repeat(" ",e.indent*t)}function Hz(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Of(e){return e===Sz||e===vz}function Tc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Cx||65536<=e&&e<=1114111}function cb(e){return Tc(e)&&e!==Cx&&e!==bz&&e!==Ic}function ub(e,t,n){var r=cb(e),i=r&&!Of(e);return(n?r:r&&e!==xj&&e!==wj&&e!==vj&&e!==bj&&e!==Sj)&&e!==Fg&&!(t===Lf&&!i)||cb(t)&&!Of(t)&&e===Fg||t===Lf&&i}function Uz(e){return Tc(e)&&e!==Cx&&!Of(e)&&e!==_z&&e!==Tz&&e!==Lf&&e!==xj&&e!==wj&&e!==vj&&e!==bj&&e!==Sj&&e!==Fg&&e!==Ez&&e!==Pz&&e!==kz&&e!==Oz&&e!==Iz&&e!==Az&&e!==jz&&e!==Nz&&e!==Cz&&e!==Rz&&e!==Lz}function Vz(e){return!Of(e)&&e!==Lf}function Dl(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function kj(e){var t=/^\n* /;return t.test(e)}var Nj=1,zg=2,Cj=3,Ej=4,js=5;function Wz(e,t,n,r,i,o,s,a){var c,u=0,p=null,d=!1,f=!1,h=r!==-1,m=-1,b=Uz(Dl(e,0))&&Vz(Dl(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Dl(e,c),!Tc(u))return js;b=b&&ub(u,p,a),p=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Dl(e,c),u===Ic)d=!0,h&&(f=f||c-m-1>r&&e[m+1]!==" ",m=c);else if(!Tc(u))return js;b=b&&ub(u,p,a),p=u}f=f||h&&c-m-1>r&&e[m+1]!==" "}return!d&&!f?b&&!s&&!i(e)?Nj:o===Ac?js:zg:n>9&&kj(e)?js:s?o===Ac?js:zg:f?Ej:Cj}function Kz(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Ac?'""':"''";if(!e.noCompatMode&&(Mz.indexOf(t)!==-1||Dz.test(t)))return e.quotingType===Ac?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&n>=e.flowLevel;function c(u){return Hz(e,u)}switch(Wz(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!r,i)){case Nj:return t;case zg:return"'"+t.replace(/'/g,"''")+"'";case Cj:return"|"+db(t,e.indent)+fb(lb(t,o));case Ej:return">"+db(t,e.indent)+fb(lb(Yz(t,s),o));case js:return'"'+qz(t)+'"';default:throw new on("impossible error: invalid scalar style")}}()}function db(e,t){var n=kj(e)?String(t):"",r=e[e.length-1]===`
83
+ `,i=r&&(e[e.length-2]===`
84
+ `||e===`
85
+ `),o=i?"+":r?"":"-";return n+o+`
86
+ `}function fb(e){return e[e.length-1]===`
87
+ `?e.slice(0,-1):e}function Yz(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=e.indexOf(`
88
+ `);return u=u!==-1?u:e.length,n.lastIndex=u,pb(e.slice(0,u),t)}(),i=e[0]===`
89
+ `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],c=s[2];o=c[0]===" ",r+=a+(!i&&!o&&c!==""?`
90
+ `:"")+pb(c,t),i=o}return r}function pb(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,s=0,a=0,c="";r=n.exec(e);)a=r.index,a-i>t&&(o=s>i?s:a,c+=`
91
+ `+e.slice(i,o),i=o+1),s=a;return c+=`
92
+ `,e.length-i>t&&s>i?c+=e.slice(i,s)+`
93
+ `+e.slice(s+1):c+=e.slice(i),c.slice(1)}function qz(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Dl(e,i),r=en[n],!r&&Tc(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||$z(n);return t}function Gz(e,t,n){var r="",i=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(wi(e,t,a,!1,!1)||typeof a>"u"&&wi(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function hb(e,t,n,r){var i="",o=e.tag,s,a,c;for(s=0,a=n.length;s<a;s+=1)c=n[s],e.replacer&&(c=e.replacer.call(n,String(s),c)),(wi(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&wi(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=$g(e,t)),e.dump&&Ic===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function Xz(e,t,n){var r="",i=e.tag,o=Object.keys(n),s,a,c,u,p;for(s=0,a=o.length;s<a;s+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=o[s],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),wi(e,t,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),wi(e,t,u,!1,!1)&&(p+=e.dump,r+=p));e.tag=i,e.dump="{"+r+"}"}function Qz(e,t,n,r){var i="",o=e.tag,s=Object.keys(n),a,c,u,p,d,f;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new on("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)f="",(!r||i!=="")&&(f+=$g(e,t)),u=s[a],p=n[u],e.replacer&&(p=e.replacer.call(n,u,p)),wi(e,t+1,u,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Ic===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=$g(e,t)),wi(e,t+1,p,!0,d)&&(e.dump&&Ic===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,i+=f));e.tag=o,e.dump=i||"{}"}function mb(e,t,n){var r,i,o,s,a,c;for(i=n?e.explicitTypes:e.implicitTypes,o=0,s=i.length;o<s;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,gj.call(a.represent)==="[object Function]")r=a.represent(t,c);else if(yj.call(a.represent,c))r=a.represent[c](t,c);else throw new on("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function wi(e,t,n,r,i,o,s){e.tag=null,e.dump=n,mb(e,n,!1)||mb(e,n,!0);var a=gj.call(e.dump),c=r,u;r&&(r=e.flowLevel<0||e.flowLevel>t);var p=a==="[object Object]"||a==="[object Array]",d,f;if(p&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(p&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(Qz(e,t,e.dump,i),f&&(e.dump="&ref_"+d+e.dump)):(Xz(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?hb(e,t-1,e.dump,i):hb(e,t,e.dump,i),f&&(e.dump="&ref_"+d+e.dump)):(Gz(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Kz(e,e.dump,t,o,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new on("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Jz(e,t){var n=[],r=[],i,o;for(Bg(e,n,r),i=0,o=r.length;i<o;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(o)}function Bg(e,t,n){var r,i,o;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)Bg(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)Bg(e[r[i]],t,n)}function Zz(e,t){t=t||{};var n=new Bz(t);n.noRefs||Jz(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),wi(n,0,r,!0,!0)?n.dump+`
94
+ `:""}var e4=Zz,t4={dump:e4};function Ex(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var n4=Ht,r4=BE,i4=WE,o4=XE,s4=QE,a4=Sx,l4=mj.load,c4=mj.loadAll,u4=t4.dump,d4=on,f4={binary:nj,float:GE,map:VE,null:KE,pairs:ij,set:oj,timestamp:ej,bool:YE,int:qE,merge:tj,omap:rj,seq:UE,str:HE},p4=Ex("safeLoad","load"),h4=Ex("safeLoadAll","loadAll"),m4=Ex("safeDump","dump"),jj={Type:n4,Schema:r4,FAILSAFE_SCHEMA:i4,JSON_SCHEMA:o4,CORE_SCHEMA:s4,DEFAULT_SCHEMA:a4,load:l4,loadAll:c4,dump:u4,YAMLException:d4,types:f4,safeLoad:p4,safeLoadAll:h4,safeDump:m4};const Zo=["requirement","planning","code","test","normal"],Hg={普通:"normal",技术规划:"planning",代码执行:"code",测试回归:"test",需求拆解:"requirement"},g4=["agent","control","provide","condition","jump","condition_jump","start","end"];function y4(e){return g4.includes(e)?e:"agent"}function x4(e){const t=(e||"").toLowerCase();return t.startsWith("control_")?"control":t.startsWith("agent_")?"agent":t.startsWith("provide_")?"provide":(t.startsWith("tool_"),"agent")}function w4(e){var t;if(!(e!=null&&e.trim()))return{nodes:[],edges:[],instances:{}};try{const n=jj.load(e);if(!n||typeof n!="object")return{error:"flow.yaml 格式无效:根内容不是对象"};const r=n,i=r.instances&&typeof r.instances=="object"?r.instances:{},o=Array.isArray(r.edges)?r.edges:Array.isArray((t=r.flow)==null?void 0:t.edges)?r.flow.edges:[],s=r.ui&&typeof r.ui=="object"?r.ui:{},a=s.nodePositions&&typeof s.nodePositions=="object"?s.nodePositions:{},c=typeof s.description=="string"&&s.description.trim()?s.description.trim():void 0,u=new Set(Object.keys(i));for(const f of o)f!=null&&f.source&&u.add(String(f.source)),f!=null&&f.target&&u.add(String(f.target));const p=Array.from(u).map(f=>{const h=i[f],m=a[f]&&typeof a[f].x=="number"&&typeof a[f].y=="number"?{x:a[f].x,y:a[f].y}:{x:0,y:0},b=(h==null?void 0:h.definitionId)??f,S=x4(b),g=(h==null?void 0:h.label)!=null?String(h.label):f,v=(h==null?void 0:h.role)!=null?String(h.role).trim():"",y=Hg[v]||v,N=Zo.includes(y)?y:"normal",j=(h==null?void 0:h.model)!=null?String(h.model).trim():void 0,k=(h==null?void 0:h.body)!=null?String(h.body):"",_=(h==null?void 0:h.script)!=null?String(h.script):"";return{id:f,type:y4(S),position:m,data:{label:g,definitionId:b,schemaType:S,role:N,model:j||void 0,body:k,..._.trim()!==""?{script:_}:{}}}}),d=o.filter(f=>(f==null?void 0:f.source)&&(f==null?void 0:f.target)).map((f,h)=>({id:`e-${f.source}-${f.target}-${h}`,source:String(f.source),target:String(f.target),sourceHandle:f.sourceHandle??void 0,targetHandle:f.targetHandle??void 0,markerEnd:{type:to.ArrowClosed}}));return{nodes:p,edges:d,instances:i,description:c}}catch(n){const r=n instanceof Error?n.message:String(n);let i="";if(/bad indentation of a mapping entry|expected.*scalar|mapping values are not allowed/i.test(r)){const o=r.match(/\((\d+):/);i=`
95
+
96
+ 💡 提示:通常由 ${o?`第 ${o[1]} 行附近`:""}的 \`script\` / \`body\` / \`value\` 字段裸写命令字符串引起。
97
+ YAML 中含 \`: \`、\`"\`、\`'\` 等特殊字符的多行字符串必须使用 \`|\` 块标量。
98
+
99
+ ✅ 正确写法:
100
+ \`\`\`yaml
101
+ script: |
102
+ node -e "console.log('TODO: scripts/x.mjs')"
103
+ \`\`\`
104
+ ❌ 错误写法(当前文件):
105
+ \`\`\`yaml
106
+ script: node -e "console.log('TODO: scripts/x.mjs')"
107
+ \`\`\``}return{error:`flow.yaml 解析失败:${r}${i}`}}}function v4(e,t){var i,o,s,a,c,u,p,d;const n=f=>({type:(f==null?void 0:f.type)??"node",name:(f==null?void 0:f.name)??"",value:(f==null?void 0:f.value)??(f==null?void 0:f.default)??""}),r={};for(const f of e){const h=t[f.id]&&typeof t[f.id]=="object"?{...t[f.id]}:{},m=((i=f.data)==null?void 0:i.definitionId)||f.id,b=((o=f.data)==null?void 0:o.inputs)??[],S=((s=f.data)==null?void 0:s.outputs)??[],g=((a=f.data)==null?void 0:a.role)!=null?String(f.data.role).trim():"",v=h.role!=null?String(h.role).trim():"",y=Hg[g]||g,N=Hg[v]||v,j=Zo.includes(y)?y:Zo.includes(N)?N:"normal",k=Array.isArray(b)?b.map(n):Array.isArray(h.input)?h.input.map(B=>n(B)):[],_=Array.isArray(S)?S.map(n):Array.isArray(h.output)?h.output.map(B=>n(B)):[],R=((c=f.data)==null?void 0:c.label)!=null?String(f.data.label):h.label!=null?String(h.label):f.id,M=(u=f.data)==null?void 0:u.body,H=M!=null?String(M):h.body!=null?String(h.body):"";let P=((p=f.data)==null?void 0:p.model)!=null&&String(f.data.model).trim()!==""?String(f.data.model).trim():h.model!=null&&String(h.model).trim()!==""?String(h.model).trim():void 0;(P===""||P==="default")&&(P=void 0);const T={...h,definitionId:m,label:R,role:j,model:P,input:k,output:_};H.trim()===""?delete T.body:T.body=H;const V=(d=f.data)==null?void 0:d.script,L=V!=null?String(V):h.script!=null?String(h.script):"";L.trim()===""?delete T.script:T.script=L,delete T.temperature,delete T.maxTokens,delete T.description,r[f.id]=T}return r}function gb(e,t,n,r){const i=v4(e,n),o=t.map(u=>({source:u.source,target:u.target,sourceHandle:u.sourceHandle??null,targetHandle:u.targetHandle??null})),s={};for(const u of e){const p=u.position??{x:0,y:0};s[u.id]={x:p.x,y:p.y}}const a={nodePositions:s};(r==null?void 0:r.description)!=null&&String(r.description).trim()!==""&&(a.description=String(r.description).trim());const c={instances:i,edges:o,ui:a};return jj.dump(c,{lineWidth:-1})}function b4(e){var i,o;const t={inputNames:[],outputNames:[]},n=Array.isArray((i=e.data)==null?void 0:i.inputs)?e.data.inputs:[],r=Array.isArray((o=e.data)==null?void 0:o.outputs)?e.data.outputs:[];for(let s=0;s<n.length;s++){const a=n[s],c=(a&&a.name!=null?String(a.name).trim():"")||`input-${s}`;t.inputNames.push(c)}for(let s=0;s<r.length;s++){const a=r[s],c=(a&&a.name!=null?String(a.name).trim():"")||`output-${s}`;t.outputNames.push(c)}return t}function S4(e,t,n){var c,u,p;const r=new Set(e.map(d=>d.id)),i={};for(const d of e)i[d.id]=b4(d);const o=new Map,s=new Map;for(const d of t)d.target&&r.has(d.target)&&(o.has(d.target)||o.set(d.target,new Set),d.targetHandle&&o.get(d.target).add(d.targetHandle)),d.source&&r.has(d.source)&&(s.has(d.source)||s.set(d.source,new Set),d.sourceHandle&&s.get(d.source).add(d.sourceHandle));const a=[];for(const d of e){const f=((c=d.data)==null?void 0:c.definitionId)!=null?String(d.data.definitionId):"",h=i[d.id]||{inputNames:[],outputNames:[]},m=h.inputNames.length,b=h.outputNames.length;if(!(f==="control_start"||f.startsWith("provide_"))&&m>0)for(let v=0;v<m;v++){const y=`input-${v}`;if(!((u=o.get(d.id))==null?void 0:u.has(y))){const j=h.inputNames[v]||y;a.push({nodeId:d.id,suffix:n("flow:validation.inputSlotNoEdge",{slotName:j,handle:y}),key:`${d.id}-${y}-in`})}}if(!(f==="control_end")&&b>0)for(let v=0;v<b;v++){const y=`output-${v}`;if(!((p=s.get(d.id))==null?void 0:p.has(y))){const j=h.outputNames[v]||y;a.push({nodeId:d.id,suffix:n("flow:validation.outputSlotNoEdge",{slotName:j,handle:y}),key:`${d.id}-${y}-out`})}}}return a}function Ug(e){return{type:e.type||"node",name:e.name||"",default:e.value!==void 0&&e.value!==null?String(e.value):e.default!==void 0?String(e.default):""}}function k4(e){var i,o;const t=Array.isArray((i=e==null?void 0:e.data)==null?void 0:i.inputs)?e.data.inputs:[],n=Array.isArray((o=e==null?void 0:e.data)==null?void 0:o.outputs)?e.data.outputs:[],r=s=>s.map(a=>{const c=Ug(a);return{type:String(c.type||"node"),name:String(c.name??""),default:String(c.default??"")}});return{inputs:r(t),outputs:r(n)}}function Qh(e,t,n,r,i){var V,L,B,F,$,I,A,E,z,U,O;const o=((V=e.data)==null?void 0:V.definitionId)||String(e.id).replace(/-\d+$/,""),s=n.find(q=>q.id===o),a=t[e.id];let c=[],u=[],p=((L=e.data)==null?void 0:L.label)??e.id,d,f,h,m;const b=!!a;a&&(Array.isArray(a.input)&&(c=a.input.map(Ug)),Array.isArray(a.output)&&(u=a.output.map(Ug)),a.label&&(p=String(a.label)),a.role&&typeof a.role=="string"&&(d=a.role),a.model!=null&&(f=String(a.model).trim()),a.body!=null&&(h=String(a.body)),a.script!=null&&(m=String(a.script)));const S=d??(typeof((B=e.data)==null?void 0:B.role)=="string"?e.data.role:"普通"),g=f??((F=e.data)==null?void 0:F.model)??void 0,v=(s==null?void 0:s.description)!=null?String(s.description).trim():"",y=v!==""?v:void 0,N=h??(($=e.data)==null?void 0:$.body)??"",j=m!==void 0?m:((I=e.data)==null?void 0:I.script)!=null?String(e.data.script):"",k=String(e.id),_=(A=r==null?void 0:r[i])==null?void 0:A[k],R=(E=_==null?void 0:_.label)==null?void 0:E.label,M=_==null?void 0:_.body,H=_==null?void 0:_.description;b||(c.length===0&&((z=s==null?void 0:s.inputs)!=null&&z.length)&&(c=s.inputs.map(q=>({...q}))),u.length===0&&((U=s==null?void 0:s.outputs)!=null&&U.length)&&(u=s.outputs.map(q=>({...q}))));const P=(s==null?void 0:s.id)??o,T=P==="tool_nodejs"||String(j).trim()!=="";return{...e,type:"flowNode",data:{...e.data,label:R||p,definitionId:P,schemaType:((O=e.data)==null?void 0:O.schemaType)??e.type??"agent",role:S,model:g,body:M||N,script:j,inputs:c,outputs:u,description:H||y,originalLabel:p,originalBody:N,body:N,...T?{script:j}:{},inputs:c,outputs:u}}}function N4(e,t){const n=new Map(t.map(r=>[r.id,r]));return e.filter(r=>{var p,d,f,h;const i=n.get(r.source),o=n.get(r.target),s=((d=(p=i==null?void 0:i.data)==null?void 0:p.outputs)==null?void 0:d.length)??0,a=((h=(f=o==null?void 0:o.data)==null?void 0:f.inputs)==null?void 0:h.length)??0,c=r.sourceHandle?parseInt(String(r.sourceHandle).replace("output-",""),10):0,u=r.targetHandle?parseInt(String(r.targetHandle).replace("input-",""),10):0;return i&&o&&c>=0&&c<s&&u>=0&&u<a})}function Mf(e){switch(e){case"text":case"文本":return"#2196f3";case"file":case"文件":return"#4caf50";case"node":case"节点":return"#ff9800";case"bool":return"#9c27b0";default:return"#9e9e9e"}}function ri(e){const t=e.indexOf(" - ");return t>=0?e.slice(0,t).trim():e.trim()}function C4(e){var r;const t=(r=e==null?void 0:e.definitionId)==null?void 0:r.trim();if(t&&t!=="普通")return t;const n=((e==null?void 0:e.schemaType)??"agent").toLowerCase();return n&&n!=="普通"?n:"agent"}function E4({data:e,selected:t,id:n,deleteNode:r,onProvideExpand:i,modelLists:o,onModelChange:s}){const{t:a}=st(),c=(e==null?void 0:e.inputs)??[],u=(e==null?void 0:e.outputs)??[],p=((e==null?void 0:e.schemaType)??"agent").toLowerCase(),d=C4(e),f=(e==null?void 0:e.isRunMode)??!1,h=(e==null?void 0:e.isExecuting)??!1,m=(e==null?void 0:e.isDim)??!1,b=(e==null?void 0:e.nodeStatus)??null,S=(e==null?void 0:e.nodeElapsed)??null,g=(e==null?void 0:e.definitionId)||"",v=g.startsWith("provide_"),y=Array.isArray(o==null?void 0:o.cursor)?o.cursor:[],N=Array.isArray(o==null?void 0:o.opencode)?o.opencode:[],j=Array.isArray(o==null?void 0:o.claudeCode)?o.claudeCode:[],k=((e==null?void 0:e.model)??"").trim(),_=p==="agent"&&!g.startsWith("tool_nodejs"),R=new Set(y.map(ri)),M=new Set(N.map(ri)),H=new Set(j.map(ri)),P=k?k.startsWith("cursor:")||k.startsWith("opencode:")||k.startsWith("claude-code:")?k:H.has(k)?`claude-code:${k}`:M.has(k)?`opencode:${k}`:R.has(k)?`cursor:${k}`:k:"",T=k&&!P.startsWith("cursor:")&&!P.startsWith("opencode:")&&!P.startsWith("claude-code:")&&!R.has(k)&&!M.has(k)&&!H.has(k),V=k.startsWith("cursor:")?k.slice(7):k.startsWith("opencode:")?k.slice(9):k.startsWith("claude-code:")?k.slice(12):k,L=$=>{const I=$.target.value;s&&s(n,I)},B=$=>{$.stopPropagation(),r&&r(n)},F=$=>{$.stopPropagation(),i&&i()};return l.jsxs("div",{className:"af-flow-node"+(t?" af-flow-node--selected":"")+(h?" af-flow-node--executing":"")+(b==="success"?" af-flow-node--done":"")+(b==="failed"?" af-flow-node--failed":"")+(b==="running"&&!h?" af-flow-node--running-disk":"")+(m?" af-flow-node--dim":"")+" af-flow-node--"+p.replace(/[^a-z0-9_-]/g,""),"data-schema":p,children:[l.jsxs("div",{className:"af-flow-node__chrome",children:[l.jsx("span",{className:"af-flow-node__type",title:d,children:d}),n&&l.jsx("span",{className:"af-flow-node__id",title:n,children:n}),!f&&_&&l.jsxs("div",{className:"af-flow-node__model-wrap",children:[l.jsxs("select",{className:"af-flow-node__model",value:P,onChange:L,"aria-label":a("flow:node.model"),title:V||a("flow:node.defaultModel"),children:[l.jsx("option",{value:"",children:a("flow:node.defaultModel")}),T&&l.jsx("option",{value:k,children:k}),y.length>0&&l.jsx("optgroup",{label:"Cursor",children:y.map($=>l.jsx("option",{value:`cursor:${ri($)}`,children:ri($)},`c-${$}`))}),N.length>0&&l.jsx("optgroup",{label:"OpenCode",children:N.map($=>l.jsx("option",{value:`opencode:${ri($)}`,children:ri($)},`o-${$}`))}),j.length>0&&l.jsx("optgroup",{label:"Claude Code",children:j.map($=>l.jsx("option",{value:`claude-code:${ri($)}`,children:ri($)},`cc-${$}`))})]}),l.jsx("span",{className:"af-flow-node__model-arrow material-symbols-outlined",children:"expand_more"})]}),h&&l.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--executing",children:"EXECUTING"}),b==="running"&&!h&&l.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--running-disk",title:a("flow:node.diskRunning"),children:"RUNNING"}),b==="success"&&l.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--done",children:S!=null&&String(S).trim()!==""?S:"--"}),b==="failed"&&l.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--failed",children:"FAILED"}),!f&&v&&l.jsx("button",{type:"button",className:"af-flow-node__expand",onClick:F,"aria-label":a("flow:node.expandProvide"),title:a("flow:node.expandProvide"),children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})}),!f&&l.jsx("button",{type:"button",className:"af-flow-node__delete",onClick:B,"aria-label":a("flow:node.deleteNode"),title:a("flow:node.deleteNode"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-flow-node__body",children:[l.jsx("div",{className:"af-flow-node__ports af-flow-node__ports--in",children:c.map(($,I)=>{const A=a("flow:node.inputTooltip",{name:$.name||`#${I}`,type:$.type})+($.default!=null&&$.default!==""?a("flow:node.defaultSuffix",{value:$.default}):"");return l.jsx("div",{className:"af-flow-node__port-row",title:A,children:l.jsx(wa,{type:"target",position:be.Left,id:`input-${I}`,className:"af-flow-node__handle",style:{background:Mf($.type)},title:A})},`in-${I}`)})}),l.jsx("div",{className:"af-flow-node__title-wrap",children:l.jsx("span",{className:"af-flow-node__title",children:(e==null?void 0:e.label)??a("flow:node.fallbackLabel")})}),l.jsx("div",{className:"af-flow-node__ports af-flow-node__ports--out",children:u.map(($,I)=>{const A=a("flow:node.outputTooltip",{name:$.name||`#${I}`,type:$.type})+($.default!=null&&$.default!==""?a("flow:node.defaultSuffix",{value:$.default}):"");return l.jsx("div",{className:"af-flow-node__port-row",title:A,children:l.jsx(wa,{type:"source",position:be.Right,id:`output-${I}`,className:"af-flow-node__handle",style:{background:Mf($.type)},title:A})},`out-${I}`)})})]})]})}const Vg="flowNode";function j4(e){if(!e||!(e instanceof Element))return!1;if(e.closest('[contenteditable="true"]'))return!0;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function yb(e){return e.key==="?"||e.key==="/"&&e.shiftKey}function P4(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform||navigator.userAgent||"")}function _4({open:e,onClose:t,flowId:n,flowSource:r,onArchived:i}){const{t:o}=st(),s=w.useId(),a=w.useRef(null),[c,u]=w.useState(""),[p,d]=w.useState(!1),[f,h]=w.useState("");if(w.useEffect(()=>{if(!e)return;u(""),h(""),d(!1);const g=requestAnimationFrame(()=>{var v;return(v=a.current)==null?void 0:v.focus()});return()=>cancelAnimationFrame(g)},[e,n]),!e)return null;const m=c.trim(),b=m===n;async function S(g){if(g.preventDefault(),!(!b||p)){d(!0),h("");try{const v=await fetch("/api/flow/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:n,flowSource:r,confirmFlowId:m})}),y=await v.json().catch(()=>({}));if(!v.ok){h(typeof y.error=="string"?y.error:o("project:archiveModal.archiveFailed"));return}i()}catch(v){h(String((v==null?void 0:v.message)||v))}finally{d(!1)}}}return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&t()},children:l.jsxs("div",{ref:a,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":s,tabIndex:-1,onMouseDown:g=>g.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:s,className:"af-shortcuts-panel__title",children:o("project:archiveModal.title")}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":o("project:archiveModal.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:S,children:[l.jsx("p",{className:"af-new-pipeline-lead",children:o("project:archiveModal.lead",{flowId:n})}),l.jsxs("label",{className:"af-new-pipeline-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:o("project:archiveModal.confirmLabel")}),l.jsx("input",{type:"text",className:"af-new-pipeline-input",value:c,onChange:g=>u(g.target.value),placeholder:n,autoComplete:"off",spellCheck:!1,"aria-invalid":m.length>0&&!b})]}),f?l.jsx("p",{className:"af-err af-new-pipeline-err",children:f}):null,l.jsxs("div",{className:"af-new-pipeline-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:p,children:o("project:archiveModal.cancel")}),l.jsx("button",{type:"submit",className:"af-btn-primary",disabled:!b||p,children:o(p?"project:archiveModal.archiving":"project:archiveModal.confirmArchive")})]})]})]})})}function xb({open:e,title:t,message:n,confirmLabel:r,cancelLabel:i,destructive:o=!1,secondaryLabel:s,secondaryDestructive:a=!1,onSecondary:c,onConfirm:u,onCancel:p}){const{t:d}=st(),f=w.useId(),h=w.useRef(null);if(w.useEffect(()=>{if(!e)return;const g=requestAnimationFrame(()=>{var y;return(y=h.current)==null?void 0:y.focus()});function v(y){y.key==="Escape"&&p(),y.key==="Enter"&&u()}return window.addEventListener("keydown",v),()=>{cancelAnimationFrame(g),window.removeEventListener("keydown",v)}},[e,p,u]),!e)return null;const m=r??d("common:common.confirm","确定"),b=i??d("common:common.cancel","取消"),S=t??d("common:common.confirmTitle","请确认");return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&p()},children:l.jsxs("div",{ref:h,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":f,tabIndex:-1,onMouseDown:g=>g.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:f,className:"af-shortcuts-panel__title",children:S}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:p,"aria-label":b,children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-shortcuts-panel__body af-new-pipeline-form",children:[l.jsx("p",{className:"af-new-pipeline-lead",children:n}),l.jsxs("div",{className:"af-new-pipeline-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:p,children:b}),s&&c?l.jsx("button",{type:"button",className:a?"af-btn-secondary af-btn-destructive":"af-btn-secondary",onClick:c,children:s}):null,l.jsx("button",{type:"button",className:o?"af-btn-primary af-btn-destructive":"af-btn-primary",onClick:u,autoFocus:!0,children:m})]})]})]})})}function I4({open:e,onClose:t,flowId:n,flowSource:r,flowArchived:i=!1,onDeleted:o}){const{t:s}=st(),a=w.useId(),c=w.useRef(null),[u,p]=w.useState(""),[d,f]=w.useState(!1),[h,m]=w.useState("");if(w.useEffect(()=>{if(!e)return;p(""),m(""),f(!1);const v=requestAnimationFrame(()=>{var y;return(y=c.current)==null?void 0:y.focus()});return()=>cancelAnimationFrame(v)},[e,n]),!e)return null;const b=u.trim(),S=b===n;async function g(v){if(v.preventDefault(),!S||d)return;f(!0),m("");let y=null;try{const N=new AbortController;y=setTimeout(()=>N.abort(),15e3);const j=await fetch("/api/flow/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:n,flowSource:r,confirmFlowId:b,flowArchived:i}),signal:N.signal}),k=await j.json().catch(()=>({}));if(!j.ok){m(typeof k.error=="string"?k.error:s("project:deleteModal.deleteFailed"));return}try{for(let _=localStorage.length-1;_>=0;_--){const R=localStorage.key(_);R&&(R.startsWith(`af:composer-sessions:${n}:${r}`)||R.startsWith(`af:composer-active-session:${n}:${r}`))&&localStorage.removeItem(R)}}catch{}await o()}catch(N){if((N==null?void 0:N.name)==="AbortError"){m(s("project:deleteModal.deleteTimeout"));return}m(String((N==null?void 0:N.message)||N))}finally{y&&clearTimeout(y),f(!1)}}return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:v=>{v.target===v.currentTarget&&t()},children:l.jsxs("div",{ref:c,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":a,tabIndex:-1,onMouseDown:v=>v.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:a,className:"af-shortcuts-panel__title",children:s("project:deleteModal.title")}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":s("project:deleteModal.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:g,children:[l.jsx("p",{className:"af-new-pipeline-lead",children:s("project:deleteModal.lead",{flowId:n})}),l.jsxs("label",{className:"af-new-pipeline-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:s("project:deleteModal.confirmLabel")}),l.jsx("input",{type:"text",className:"af-new-pipeline-input",value:u,onChange:v=>p(v.target.value),placeholder:n,autoComplete:"off",spellCheck:!1,"aria-invalid":b.length>0&&!S})]}),h?l.jsx("p",{className:"af-err af-new-pipeline-err",children:h}):null,l.jsxs("div",{className:"af-new-pipeline-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:d,children:s("project:deleteModal.cancel")}),l.jsx("button",{type:"submit",className:"af-btn-primary af-btn-destructive",disabled:!S||d,children:s(d?"project:deleteModal.deleting":"project:deleteModal.confirmDelete")})]})]})]})})}function A4({children:e}){return l.jsx("kbd",{className:"af-kbd",children:e})}function jo({keys:e}){return l.jsx("span",{className:"af-shortcuts-keys",children:e.map((t,n)=>l.jsxs("span",{children:[n>0?l.jsx("span",{className:"af-shortcuts-keys__plus",children:"+"}):null,l.jsx(A4,{children:t})]},n))})}function T4({open:e,onClose:t}){const{t:n}=st(),r=w.useRef(null);if(w.useEffect(()=>{if(!e)return;const s=requestAnimationFrame(()=>{var a;return(a=r.current)==null?void 0:a.focus()});return()=>cancelAnimationFrame(s)},[e]),!e)return null;const o=P4()?"⌘":"Ctrl";return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:l.jsxs("div",{ref:r,className:"af-shortcuts-panel",role:"dialog","aria-modal":"true","aria-labelledby":"af-shortcuts-title",tabIndex:-1,onMouseDown:s=>s.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:"af-shortcuts-title",className:"af-shortcuts-panel__title",children:n("flow:shortcuts.title")}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":n("common:common.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-shortcuts-panel__body",children:[l.jsxs("section",{className:"af-shortcuts-section",children:[l.jsx("h3",{className:"af-shortcuts-cat",children:n("flow:shortcuts.general")}),l.jsxs("ul",{className:"af-shortcuts-list",children:[l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.saveDesc")}),l.jsx(jo,{keys:[o,"S"]})]}),l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.shortcutsLabel")}),l.jsx(jo,{keys:["?"]})]}),l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.jumpToNode")}),l.jsx(jo,{keys:[o,"K"]})]})]})]}),l.jsxs("section",{className:"af-shortcuts-section",children:[l.jsx("h3",{className:"af-shortcuts-cat",children:n("flow:shortcuts.canvas")}),l.jsxs("ul",{className:"af-shortcuts-list",children:[l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.selectTool")}),l.jsx(jo,{keys:["V"]})]}),l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.panTool")}),l.jsx(jo,{keys:["H"]})]}),l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.holdSpacePan")}),l.jsx(jo,{keys:["Space"]})]}),l.jsxs("li",{className:"af-shortcuts-row",children:[l.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.selectAll")}),l.jsx(jo,{keys:[o,"A"]})]})]})]})]})]})})}function R4(e,t){if(!t)return 1;const n=t.toLowerCase(),r=(e.id||"").toLowerCase(),i=(e.label||"").toLowerCase(),o=(e.definitionId||"").toLowerCase();return r===n?100:r.startsWith(n)?80:r.includes(n)?60:i.startsWith(n)?40:i.includes(n)?30:o.includes(n)?15:0}function L4({open:e,onClose:t,onJump:n,nodes:r}){const{t:i}=st(),[o,s]=w.useState(""),[a,c]=w.useState(0),u=w.useRef(null),p=w.useRef(null);w.useEffect(()=>{if(!e)return;s(""),c(0);const m=requestAnimationFrame(()=>{var b;return(b=u.current)==null?void 0:b.focus()});return()=>cancelAnimationFrame(m)},[e]);const d=w.useMemo(()=>{const m=(r||[]).map(g=>{var v,y,N;return{id:g.id,label:((v=g.data)==null?void 0:v.label)||"",definitionId:((y=g.data)==null?void 0:y.definitionId)||"",schemaType:((N=g.data)==null?void 0:N.schemaType)||""}}),b=o.trim(),S=m.map(g=>({e:g,s:R4(g,b)})).filter(g=>g.s>0);return S.sort((g,v)=>v.s-g.s||g.e.id.localeCompare(v.e.id)),S.slice(0,50).map(g=>g.e)},[r,o]);if(w.useEffect(()=>{a>=d.length&&c(0)},[d.length,a]),w.useEffect(()=>{var b;const m=(b=p.current)==null?void 0:b.querySelector(`[data-idx="${a}"]`);m&&m.scrollIntoView({block:"nearest"})},[a]),!e)return null;const f=m=>{const b=d[m];b&&(n(b.id),t())},h=m=>{if(m.key==="Escape"){m.preventDefault(),t();return}if(m.key==="ArrowDown"){m.preventDefault(),c(b=>Math.min(d.length-1,b+1));return}if(m.key==="ArrowUp"){m.preventDefault(),c(b=>Math.max(0,b-1));return}m.key==="Enter"&&(m.preventDefault(),f(a))};return l.jsx("div",{className:"af-jump-overlay",role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&t()},children:l.jsxs("div",{className:"af-jump-panel",role:"dialog","aria-modal":"true","aria-label":i("flow:jumpPalette.title"),onMouseDown:m=>m.stopPropagation(),children:[l.jsxs("div",{className:"af-jump-panel__input-wrap",children:[l.jsx("span",{className:"af-jump-panel__icon material-symbols-outlined","aria-hidden":!0,children:"search"}),l.jsx("input",{ref:u,type:"text",className:"af-jump-panel__input",placeholder:i("flow:jumpPalette.placeholder"),value:o,onChange:m=>{s(m.target.value),c(0)},onKeyDown:h,spellCheck:!1,autoComplete:"off"}),l.jsx("span",{className:"af-jump-panel__count",children:d.length})]}),d.length===0?l.jsx("div",{className:"af-jump-panel__empty",children:i("flow:jumpPalette.empty")}):l.jsx("ul",{ref:p,className:"af-jump-panel__list",role:"listbox",children:d.map((m,b)=>l.jsxs("li",{"data-idx":b,role:"option","aria-selected":b===a,className:"af-jump-panel__item"+(b===a?" af-jump-panel__item--active":""),onMouseEnter:()=>c(b),onMouseDown:S=>{S.preventDefault(),f(b)},children:[l.jsx("span",{className:"af-jump-panel__id",children:m.id}),m.label&&m.label!==m.id&&l.jsx("span",{className:"af-jump-panel__label",children:m.label}),m.definitionId&&l.jsx("span",{className:"af-jump-panel__tag",children:m.definitionId})]},m.id))}),l.jsxs("div",{className:"af-jump-panel__hint",children:[l.jsxs("span",{children:[l.jsx("kbd",{className:"af-kbd",children:"↑"}),l.jsx("kbd",{className:"af-kbd",children:"↓"})," ",i("flow:jumpPalette.hintNavigate")]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"af-kbd",children:"Enter"})," ",i("flow:jumpPalette.hintJump")]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"af-kbd",children:"Esc"})," ",i("flow:jumpPalette.hintClose")]})]})]})})}function O4({open:e,onClose:t,flowId:n,flowSource:r,flowArchived:i=!1,filePath:o,fileName:s,onSaved:a,onAiEdit:c}){const{t:u}=st(),p=w.useId(),d=w.useRef(null),f=w.useRef(null),[h,m]=w.useState(""),[b,S]=w.useState(""),[g,v]=w.useState(!1),[y,N]=w.useState(!1),[j,k]=w.useState(!1),[_,R]=w.useState(""),[M,H]=w.useState("");if(w.useEffect(()=>{if(!e||!o)return;m(""),S(""),R(""),H(""),v(!0),N(!1),k(!1);const F=new URLSearchParams({flowId:n,flowSource:r,archived:i?"1":"0",path:o});(async()=>{try{const I=await fetch(`/api/pipeline-file-content?${F}`),A=await I.json();if(!I.ok)throw new Error(A.error||"HTTP "+I.status);m(A.content||""),S(A.content||"")}catch(I){R(I.message||String(I))}finally{v(!1)}})();const $=requestAnimationFrame(()=>{var I;return(I=d.current)==null?void 0:I.focus()});return()=>cancelAnimationFrame($)},[e,o,n,r,i]),!e)return null;const P=h!==b;async function T(F){if(F.preventDefault(),!y){N(!0),R(""),H("");try{const $=new URLSearchParams({flowId:n,flowSource:r,archived:i?"1":"0",path:o}),I=await fetch(`/api/pipeline-file-save?${$}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})}),A=await I.json();if(!I.ok)throw new Error(A.error||"HTTP "+I.status);S(h),H(u("flow:fileEdit.saved")),a&&a()}catch($){R($.message||String($))}finally{N(!1)}}}async function V(){if(!(!c||j||!h)){k(!0),R("");try{const F=await c(h);typeof F=="string"&&F&&m(F)}catch(F){R(F.message||String(F))}finally{k(!1)}}}function L(){m(b),R(""),H("")}const B=h.length>1e5;return l.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:F=>{F.target===F.currentTarget&&t()},children:l.jsxs("div",{ref:d,className:"af-shortcuts-panel af-file-edit-panel",role:"dialog","aria-modal":"true","aria-labelledby":p,tabIndex:-1,onMouseDown:F=>F.stopPropagation(),children:[l.jsxs("div",{className:"af-shortcuts-panel__head",children:[l.jsx("h2",{id:p,className:"af-shortcuts-panel__title",children:s||o}),l.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":u("flow:fileEdit.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx("div",{className:"af-file-edit-body",children:g?l.jsx("div",{className:"af-file-edit-loading",children:u("flow:fileEdit.loading")}):_&&!h?l.jsx("div",{className:"af-file-edit-error",children:_}):l.jsxs(l.Fragment,{children:[B&&l.jsx("div",{className:"af-file-edit-warning",children:u("flow:fileEdit.largeFileWarning")}),l.jsx("textarea",{ref:f,className:"af-file-edit-textarea",value:h,onChange:F=>m(F.target.value),spellCheck:!1,placeholder:u("flow:fileEdit.placeholder")})]})}),(_||M)&&!g&&l.jsx("div",{className:`af-file-edit-status${M?" af-file-edit-status--success":""}`,children:M||_}),l.jsxs("div",{className:"af-file-edit-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary",onClick:L,disabled:!P||y||j,children:u("flow:fileEdit.reset")}),c&&l.jsx("button",{type:"button",className:"af-btn-secondary af-btn-ai",onClick:V,disabled:j||y||!h,children:u(j?"flow:fileEdit.aiRunning":"flow:fileEdit.aiEdit")}),l.jsx("button",{type:"button",className:"af-btn-primary",onClick:T,disabled:!P||y||j,children:u(y?"flow:fileEdit.saving":"flow:fileEdit.save")})]})]})})}const Pj=new Set(["workspaceRoot","flowName","runDir","flowDir"]),M4=["workspaceRoot","flowName","runDir","flowDir"];function D4(e,t){const n=e.slice(0,t),r=n.lastIndexOf("${");if(r<0)return null;const i=n.slice(r+2);return i.includes("}")?null:{atIndex:r,query:i}}function F4(e){const t=/\$\{([^}]*)\}/g,n=[];let r;for(;(r=t.exec(e))!==null;)n.push({start:r.index,end:r.index+r[0].length,key:r[1]});return n}function wb(e){const t=new Set;if(!Array.isArray(e))return t;for(const n of e){const r=(n==null?void 0:n.name)!=null?String(n.name).trim():"";r&&t.add(r)}return t}function _j(e,{inputNames:t,outputNames:n}){const r=e.trim();if(!r)return!1;if(r.startsWith("input.")){const i=r.slice(6).trim();return i!==""&&t.has(i)}if(r.startsWith("output.")){const i=r.slice(7).trim();return i!==""&&n.has(i)}if(Pj.has(r)||t.has(r)||n.has(r))return!0;if(!r.includes(".")){const i=`${r}.md`;if(t.has(i)||n.has(i))return!0}return!1}function Ij(e){return{inputNames:wb(e==null?void 0:e.inputs),outputNames:wb(e==null?void 0:e.outputs)}}function $4(e,t,n){const r=Ij(t),i=F4(e),o=[];for(const s of i)if(!_j(s.key,r)){const a=s.key.trim()===""?n("flow:placeholder.empty"):s.key.trim();o.push({start:s.start,end:s.end,message:n("flow:placeholder.invalidPlaceholder",{hint:a})})}return o}function z4(e,t){const n=Ij(t),r=/\$\{([^}]*)\}/g,i=[];let o=0,s;for(;(s=r.exec(e))!==null;){s.index>o&&i.push({kind:"plain",text:e.slice(o,s.index)});const a=s[0],c=_j(s[1],n);i.push({kind:c?"ph-valid":"ph-invalid",text:a}),o=s.index+a.length}return o<e.length&&i.push({kind:"plain",text:e.slice(o)}),i}function B4(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function H4(e){return e.map(t=>{const n=B4(t.text);return t.kind==="ph-invalid"?`<span class="af-body-ph-invalid">${n}</span>`:t.kind==="ph-valid"?`<span class="af-body-ph-valid">${n}</span>`:n}).join("")}function U4(e,t){const n=[];for(const r of(e==null?void 0:e.inputs)??[]){const i=(r==null?void 0:r.name)!=null?String(r.name).trim():"";if(!i)continue;const o=(r==null?void 0:r.type)!=null?String(r.type):"";n.push({section:"input",insert:`input.${i}`,label:i,subtitle:o?t("flow:placeholder.inputSubtitle",{type:o}):t("flow:placeholder.inputSubtitleNoType")})}for(const r of(e==null?void 0:e.outputs)??[]){const i=(r==null?void 0:r.name)!=null?String(r.name).trim():"";if(!i)continue;const o=(r==null?void 0:r.type)!=null?String(r.type):"";n.push({section:"output",insert:`output.${i}`,label:i,subtitle:o?t("flow:placeholder.outputSubtitle",{type:o}):t("flow:placeholder.outputSubtitleNoType")})}for(const r of M4)Pj.has(r)&&n.push({section:"runtime",insert:r,label:r,subtitle:t("flow:placeholder.runtimeConst")});return n}function V4(e,t){const n=t.toLowerCase();return n?e.filter(r=>[r.insert,r.label,r.subtitle??""].map(o=>String(o).toLowerCase()).some(o=>o.includes(n))):e}function W4(e,t){if(!e||t<0)return null;const n=Math.min(t,e.value.length),r=getComputedStyle(e),i=document.createElement("div");i.setAttribute("aria-hidden","true"),i.style.visibility="hidden",i.style.position="fixed",i.style.top="0",i.style.left="-99999px",i.style.whiteSpace="pre-wrap",i.style.wordWrap="break-word",i.style.overflow="hidden";const o=e.clientWidth;if(o<=0)return null;i.style.width=`${o}px`,i.style.font=r.font,i.style.lineHeight=r.lineHeight,i.style.padding=r.padding,i.style.border=r.border,i.style.boxSizing=r.boxSizing,i.style.letterSpacing=r.letterSpacing,i.style.textIndent=r.textIndent,i.style.tabSize=r.tabSize||"8",i.textContent=e.value.slice(0,n);const s=document.createElement("span");s.textContent="​",i.appendChild(s),document.body.appendChild(i);const a=s.getBoundingClientRect(),c=parseFloat(r.lineHeight),u=Number.isFinite(c)&&c>0?c:a.height||16;return document.body.removeChild(i),{top:a.top,left:a.left,bottom:a.bottom,height:u}}function pd({value:e,onChange:t,disabled:n,placeholder:r,rows:i=8,textareaClassName:o,ioSlots:s,variant:a="drawer"}){const{t:c}=st(),u=w.useId(),p=w.useRef(null),d=w.useRef(null),[f,h]=w.useState(0),[m,b]=w.useState(0),[S,g]=w.useState(null),v=w.useMemo(()=>$4(e,s,c),[e,s,c]),y=v.length>0,N=w.useMemo(()=>z4(e,s),[e,s]),j=w.useMemo(()=>H4(N),[N]),k=w.useMemo(()=>n?null:D4(e,f),[e,f,n]),_=w.useMemo(()=>{if(!k)return[];const T=U4(s,c);return V4(T,k.query)},[k,s,c]);w.useEffect(()=>{b(T=>{const V=Math.max(0,_.length-1);return Math.min(Math.max(0,T),V)})},[_.length]);const R=w.useCallback(()=>{const T=p.current;if(!T||!k||_.length===0){g(null);return}const V=W4(T,f);if(!V){g(null);return}const L=4,B=44,F=13.5*16,$=Math.min(_.length*B+8,F);let I=V.bottom+L;I+$>window.innerHeight-8&&(I=Math.max(8,V.top-$-L));const A=288;let E=V.left;E=Math.max(8,Math.min(E,window.innerWidth-A-8)),g({top:I,left:E})},[k,_.length,f]);w.useLayoutEffect(()=>{if(!k||_.length===0){g(null);return}const T=requestAnimationFrame(()=>R());return()=>cancelAnimationFrame(T)},[k,_.length,f,e,R]),w.useEffect(()=>{if(!k||_.length===0)return;const T=()=>R();return window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[k,_.length,R]);const M=w.useCallback(T=>{if(!k)return;const{atIndex:V}=k,L=e.slice(0,V)+"${"+T+"}"+e.slice(f);t(L);const B=V+T.length+3;queueMicrotask(()=>{const F=p.current;F&&(F.focus(),F.setSelectionRange(B,B)),h(B)})},[k,e,f,t]),H=w.useCallback(()=>{const T=p.current,V=d.current;!T||!V||(V.scrollTop=T.scrollTop,V.scrollLeft=T.scrollLeft,k&&_.length>0&&queueMicrotask(()=>R()))},[k,_.length,R]),P=w.useCallback(T=>{if(!n&&k&&_.length>0&&(T.key==="ArrowDown"||T.key==="ArrowUp"||T.key==="Enter")){if(T.key==="ArrowDown")T.preventDefault(),b(V=>(V+1)%_.length);else if(T.key==="ArrowUp")T.preventDefault(),b(V=>(V-1+_.length)%_.length);else if(T.key==="Enter"&&!T.shiftKey){T.preventDefault();const V=_[m];V&&M(V.insert)}}},[n,k,_,m,M]);return l.jsxs("div",{className:"af-body-prompt-editor"+(a==="expand"?" af-body-prompt-editor--expand":""),children:[l.jsxs("div",{className:"af-body-prompt-stack",children:[l.jsx("pre",{ref:d,className:"af-body-prompt-backdrop "+o,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:j+`
108
+ `}}),l.jsx("textarea",{ref:p,className:"af-body-prompt-textarea "+o,rows:i,value:e,disabled:n,placeholder:r,spellCheck:!1,"aria-invalid":y,"aria-describedby":y?u:void 0,onChange:T=>{t(T.target.value),h(T.target.selectionStart??T.target.value.length)},onSelect:T=>{const V=T.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??0)},onClick:T=>{const V=T.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??0)},onKeyUp:T=>{const V=T.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??V.value.length)},onKeyDown:P,onScroll:H})]}),k&&_.length>0&&S?ui.createPortal(l.jsx("ul",{className:"af-body-ph-menu af-body-ph-menu--pop af-composer-mention-menu",role:"listbox","aria-label":c("flow:nodeProps.placeholderSlots"),style:{position:"fixed",top:S.top,left:S.left,right:"auto",bottom:"auto",margin:0,zIndex:2e4},children:_.map((T,V)=>l.jsx("li",{role:"option","aria-selected":V===m,children:l.jsxs("button",{type:"button",className:"af-composer-mention-item"+(V===m?" af-composer-mention-item--active":""),onMouseDown:L=>L.preventDefault(),onMouseEnter:()=>b(V),onClick:()=>M(T.insert),children:[l.jsx("span",{className:"af-composer-mention-id",children:`\${${T.insert}}`}),T.subtitle?l.jsx("span",{className:"af-composer-mention-sub",children:T.subtitle}):null]})},`${T.section}-${T.insert}`))}),document.body):null,y?l.jsx("p",{id:u,className:"af-body-ph-issues",role:"status",children:v.map(T=>T.message).join(" · ")}):null]})}const K4=/^[a-zA-Z_][a-zA-Z0-9_-]*$/;function hd(e){const t=e.indexOf(" - ");return t>=0?e.slice(0,t).trim():e.trim()}function vb({kind:e,label:t,slots:n,onSlotsChange:r,disabled:i}){const{t:o}=st(),s=()=>r([...n,{type:"node",name:"",default:""}]),a=p=>r(n.filter((d,f)=>f!==p)),c=(p,d,f)=>{const h=n.map((m,b)=>b===p?{...m,[d]:f}:m);r(h)},u=e==="input"?"input":"output";return l.jsxs("div",{className:"af-node-props-field af-node-props-field--io",children:[l.jsxs("div",{className:"af-node-props-io-head",children:[l.jsx("span",{className:"af-node-props-label",children:t}),l.jsx("button",{type:"button",className:"af-btn-ghost af-node-props-io-add",onClick:s,disabled:i,"aria-label":o("flow:nodeProps.addPinAriaLabel",{label:t}),children:o("flow:nodeProps.addPin")})]}),l.jsx("p",{className:"af-node-props-io-hint",children:o("flow:nodeProps.handleHint",{prefix:u})}),n.length===0?l.jsx("p",{className:"af-node-props-io-empty",children:o(e==="input"?"flow:nodeProps.noInputPins":"flow:nodeProps.noOutputPins")}):null,n.length>0?l.jsxs("div",{className:"af-node-props-io-table",role:"group","aria-label":t,children:[l.jsxs("div",{className:"af-node-props-io-table-head","aria-hidden":!0,children:[l.jsx("span",{children:o("flow:nodeProps.handle")}),l.jsx("span",{children:o("flow:nodeProps.type")}),l.jsx("span",{children:o("flow:nodeProps.name")}),l.jsx("span",{children:o("flow:nodeProps.defaultValue")}),l.jsx("span",{})]}),n.map((p,d)=>l.jsxs("div",{className:"af-node-props-io-row",children:[l.jsxs("span",{className:"af-node-props-io-handle",title:`${u}-${d}`,children:[u,"-",d]}),l.jsx("select",{className:"af-node-props-input af-node-props-io-cell",value:p.type,onChange:f=>c(d,"type",f.target.value),disabled:i,"aria-label":o("flow:nodeProps.pinTypeAriaLabel",{label:t,index:d}),children:["node","text","file","bool"].map(f=>l.jsx("option",{value:f,children:f},f))}),l.jsx("input",{type:"text",className:"af-node-props-input af-node-props-io-cell",value:p.name,onChange:f=>c(d,"name",f.target.value),disabled:i,spellCheck:!1,autoComplete:"off","aria-label":o("flow:nodeProps.pinNameAriaLabel",{label:t,index:d})}),l.jsx("input",{type:"text",className:"af-node-props-input af-node-props-io-cell",value:p.default,onChange:f=>c(d,"default",f.target.value),disabled:i,spellCheck:!1,autoComplete:"off","aria-label":o("flow:nodeProps.pinDefaultAriaLabel",{label:t,index:d})}),l.jsx("button",{type:"button",className:"af-icon-btn af-node-props-io-remove",onClick:()=>a(d),disabled:i,"aria-label":o("flow:nodeProps.deletePinAriaLabel",{label:t,index:d}),title:o("flow:nodeProps.deletePin"),children:l.jsx("span",{className:"material-symbols-outlined",children:"delete"})})]},`${u}-${d}`))]}):null]})}function Y4({draft:e,setDraft:t,definitionId:n,systemPromptReadonly:r,modelLists:i,disabled:o,onIdBlur:s,onClose:a,onPublishToMarketplace:c,error:u,ioSlots:p}){const{t:d}=st(),[f,h]=w.useState(!1),[m,b]=w.useState(!1),[S,g]=w.useState({status:"idle",message:""}),v=w.useCallback(P=>{t(T=>T&&{...T,...P})},[t]),{cursorList:y,opencodeList:N,claudeCodeList:j,currentNotInLists:k}=w.useMemo(()=>{const P=Array.isArray(i==null?void 0:i.cursor)?i.cursor:[],T=Array.isArray(i==null?void 0:i.opencode)?i.opencode:[],V=Array.isArray(i==null?void 0:i.claudeCode)?i.claudeCode:[],L=new Set([...P,...T,...V].map(hd)),B=((e==null?void 0:e.model)??"").trim(),F=B.startsWith("cursor:")?B.slice(7):B.startsWith("opencode:")?B.slice(9):B.startsWith("claude-code:")?B.slice(12):B,$=B&&!L.has(F)?B:"";return{cursorList:P,opencodeList:T,claudeCodeList:V,currentNotInLists:$}},[i,e==null?void 0:e.model]);if(!e)return null;const _=String(e.script??""),R=n==="tool_nodejs"||_.trim()!=="",M=typeof c=="function"&&!o&&(e==null?void 0:e.newId),H=async()=>{if(M){g({status:"running",message:d("flow:nodeProps.publishRunning")});try{const P=await c(e,n);g({status:"success",message:P!=null&&P.definitionId?d("flow:nodeProps.publishSuccessWithId",{id:P.definitionId}):d("flow:nodeProps.publishSuccess")})}catch(P){g({status:"error",message:String((P==null?void 0:P.message)||P)})}}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-pipeline-drawer-head af-node-props-head",children:[l.jsx("h2",{className:"af-pipeline-drawer-title",children:d("flow:nodeProps.title")}),l.jsxs("div",{className:"af-node-props-head-actions",children:[l.jsxs("button",{type:"button",className:"af-btn-ghost af-node-props-market-btn",onClick:H,disabled:!M||S.status==="running",title:d("flow:nodeProps.publishToMarketplaceHint"),children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"inventory_2"}),S.status==="running"?d("flow:nodeProps.publishing"):d("flow:nodeProps.publishToMarketplace")]}),l.jsx("button",{type:"button",className:"af-btn-ghost af-node-props-close-secondary",onClick:a,children:d("common:common.close")})]})]}),l.jsxs("div",{className:"af-pipeline-drawer-body af-node-props-body",children:[u?l.jsx("p",{className:"af-err af-node-props-err",children:u}):null,S.message?l.jsx("p",{className:`af-node-props-market-status af-node-props-market-status--${S.status}`,children:S.message}):null,l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsx("span",{className:"af-node-props-label",children:d("flow:node.nodeType")}),l.jsx("div",{className:"af-pipeline-drawer-readonly af-node-props-readonly-mono",children:n})]}),l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsxs("span",{className:"af-node-props-label",children:[d("flow:node.displayName"),l.jsx("span",{className:"af-node-props-hint",children:d("flow:node.displayNameHint")})]}),l.jsx("input",{type:"text",className:"af-node-props-input",value:e.newId,onChange:P=>v({newId:P.target.value}),onBlur:s,disabled:o,spellCheck:!1,autoComplete:"off","aria-label":d("flow:nodeProps.instanceId")})]}),l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsxs("span",{className:"af-node-props-label",children:[d("flow:node.displayName"),"(LABEL)"]}),l.jsx("input",{type:"text",className:"af-node-props-input",value:e.label,onChange:P=>v({label:P.target.value}),disabled:o,spellCheck:!1})]}),l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsxs("span",{className:"af-node-props-label",children:[d("flow:node.role"),"(ROLE)"]}),l.jsx("select",{className:"af-node-props-select",value:Zo.includes(e.role)?e.role:d("flow:roles.normal"),onChange:P=>v({role:P.target.value}),disabled:o,children:Zo.map(P=>l.jsx("option",{value:P,children:P},P))})]}),l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsxs("span",{className:"af-node-props-label",children:[d("flow:node.model"),"(MODEL)"]}),l.jsx("span",{className:"af-node-props-sublabel",children:d("flow:node.modelHint")}),l.jsxs("select",{className:"af-node-props-select",value:(()=>{const P=(e.model||"").trim();return P?k||P:""})(),onChange:P=>v({model:P.target.value}),disabled:o,"aria-label":d("flow:nodeProps.modelAriaLabel"),children:[l.jsx("option",{value:"",children:d("flow:node.defaultModel")}),k?l.jsxs("option",{value:k,children:[k,d("flow:nodeProps.yamlValueNotInList")]}):null,y.length>0?l.jsx("optgroup",{label:"Cursor",children:y.map(P=>l.jsx("option",{value:hd(P),children:P},`c-${P}`))}):null,N.length>0?l.jsx("optgroup",{label:"OpenCode",children:N.map(P=>l.jsx("option",{value:hd(P),children:P},`o-${P}`))}):null,j.length>0?l.jsx("optgroup",{label:"Claude Code",children:j.map(P=>l.jsx("option",{value:`claude-code:${hd(P)}`,children:P},`cc-${P}`))}):null]})]}),l.jsx(vb,{kind:"input",label:d("flow:nodeProps.inputPins"),slots:Array.isArray(e.inputs)?e.inputs:[],onSlotsChange:P=>v({inputs:P}),disabled:o}),l.jsx(vb,{kind:"output",label:d("flow:nodeProps.outputPins"),slots:Array.isArray(e.outputs)?e.outputs:[],onSlotsChange:P=>v({outputs:P}),disabled:o}),R?l.jsxs("div",{className:"af-pipeline-drawer-field af-node-props-field af-node-props-field--prompt",children:[l.jsxs("div",{className:"af-node-props-prompt-head",children:[l.jsxs("span",{className:"af-node-props-label",children:[d("flow:node.directCommand"),"(script)",l.jsx("span",{className:"af-node-props-hint",children:d("flow:node.scriptHint")})]}),l.jsx("button",{type:"button",className:"af-icon-btn af-node-props-expand",onClick:()=>b(!0),"aria-label":d("flow:nodeProps.expandEditScript"),title:d("flow:nodeProps.expand"),disabled:o,children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),l.jsx(pd,{value:_,onChange:P=>v({script:P}),disabled:o,placeholder:d("flow:nodeProps.scriptPlaceholder"),rows:6,textareaClassName:"af-pipeline-drawer-textarea af-node-props-body-textarea af-node-props-script-textarea",ioSlots:p,variant:"drawer"})]}):null,l.jsxs("div",{className:"af-pipeline-drawer-field af-node-props-field af-node-props-field--prompt",children:[l.jsxs("div",{className:"af-node-props-prompt-head",children:[l.jsx("span",{className:"af-node-props-label",children:d("flow:node.userPrompt")}),l.jsx("button",{type:"button",className:"af-icon-btn af-node-props-expand",onClick:()=>h(!0),"aria-label":d("flow:nodeProps.expandEdit"),title:d("flow:nodeProps.expand"),disabled:o,children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),l.jsx(pd,{value:e.body,onChange:P=>v({body:P}),disabled:o,placeholder:d("flow:nodeProps.bodyPlaceholder"),rows:8,textareaClassName:"af-pipeline-drawer-textarea af-node-props-body-textarea",ioSlots:p,variant:"drawer"})]}),l.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[l.jsx("span",{className:"af-node-props-label",children:d("flow:node.systemDescription")}),l.jsx("textarea",{className:"af-pipeline-drawer-textarea af-node-props-system-readonly",rows:4,readOnly:!0,value:r||d("flow:nodeProps.noDescription"),spellCheck:!1})]})]}),m?l.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true","aria-label":d("flow:nodeProps.editScript"),onMouseDown:P=>{P.target===P.currentTarget&&b(!1)},children:l.jsxs("div",{className:"af-node-props-expand-panel",children:[l.jsxs("div",{className:"af-node-props-expand-head",children:[l.jsx("span",{className:"af-node-props-expand-title",children:d("flow:node.directCommand")}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>b(!1),"aria-label":d("flow:nodeProps.collapse"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx(pd,{value:_,onChange:P=>v({script:P}),disabled:o,placeholder:d("flow:nodeProps.scriptPlaceholderExpand"),rows:16,textareaClassName:"af-node-props-expand-textarea",ioSlots:p,variant:"expand"})]})}):null,f?l.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true","aria-label":d("flow:nodeProps.editUserPrompt"),onMouseDown:P=>{P.target===P.currentTarget&&h(!1)},children:l.jsxs("div",{className:"af-node-props-expand-panel",children:[l.jsxs("div",{className:"af-node-props-expand-head",children:[l.jsx("span",{className:"af-node-props-expand-title",children:d("flow:node.body")}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>h(!1),"aria-label":d("flow:nodeProps.collapse"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx(pd,{value:e.body,onChange:P=>v({body:P}),disabled:o,placeholder:d("flow:nodeProps.bodyPlaceholderExpand"),rows:16,textareaClassName:"af-node-props-expand-textarea",ioSlots:p,variant:"expand"})]})}):null]})}function q4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const G4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q4={};function bb(e,t){return(Q4.jsx?X4:G4).test(e)}const J4=/[ \t\n\f\r]/g;function Z4(e){return typeof e=="object"?e.type==="text"?Sb(e.value):!1:Sb(e)}function Sb(e){return e.replace(J4,"")===""}class Jc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Jc.prototype.normal={};Jc.prototype.property={};Jc.prototype.space=void 0;function Aj(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jc(n,r,t)}function Wg(e){return e.toLowerCase()}class kn{constructor(t,n){this.attribute=n,this.property=t}}kn.prototype.attribute="";kn.prototype.booleanish=!1;kn.prototype.boolean=!1;kn.prototype.commaOrSpaceSeparated=!1;kn.prototype.commaSeparated=!1;kn.prototype.defined=!1;kn.prototype.mustUseProperty=!1;kn.prototype.number=!1;kn.prototype.overloadedBoolean=!1;kn.prototype.property="";kn.prototype.spaceSeparated=!1;kn.prototype.space=void 0;let e5=0;const Te=rs(),jt=rs(),Kg=rs(),ie=rs(),et=rs(),ea=rs(),En=rs();function rs(){return 2**++e5}const Yg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:jt,commaOrSpaceSeparated:En,commaSeparated:ea,number:ie,overloadedBoolean:Kg,spaceSeparated:et},Symbol.toStringTag,{value:"Module"})),Jh=Object.keys(Yg);class jx extends kn{constructor(t,n,r,i){let o=-1;if(super(t,n),kb(this,"space",i),typeof r=="number")for(;++o<Jh.length;){const s=Jh[o];kb(this,Jh[o],(r&Yg[s])===Yg[s])}}}jx.prototype.defined=!0;function kb(e,t,n){n&&(e[t]=n)}function ja(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new jx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Wg(r)]=r,n[Wg(o.attribute)]=r}return new Jc(t,n,e.space)}const Tj=ja({properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:et,ariaCurrent:null,ariaDescribedBy:et,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:et,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:et,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:et,ariaLevel:ie,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:et,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:et,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:jt,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rj(e,t){return t in e?e[t]:t}function Lj(e,t){return Rj(e,t.toLowerCase())}const t5=ja({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ea,acceptCharset:et,accessKey:et,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:et,autoFocus:Te,autoPlay:Te,blocking:et,capture:null,charSet:null,checked:Te,cite:null,className:et,cols:ie,colSpan:null,content:null,contentEditable:jt,controls:Te,controlsList:et,coords:ie|ea,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:Kg,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:et,height:ie,hidden:Kg,high:ie,href:null,hrefLang:null,htmlFor:et,httpEquiv:et,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:et,itemRef:et,itemScope:Te,itemType:et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:ie,pattern:null,ping:et,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:et,required:Te,reversed:Te,rows:ie,rowSpan:ie,sandbox:et,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:jt,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:et,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:Lj}),n5=ja({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:En,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ea,g2:ea,glyphName:ea,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:En,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:En,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:En,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:En,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rj}),Oj=ja({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Mj=ja({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lj}),Dj=ja({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),r5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},i5=/[A-Z]/g,Nb=/-[a-z]/g,o5=/^data[-\w.:]+$/i;function s5(e,t){const n=Wg(t);let r=t,i=kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&o5.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nb,l5);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nb.test(o)){let s=o.replace(i5,a5);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=jx}return new i(r,t)}function a5(e){return"-"+e.toLowerCase()}function l5(e){return e.charAt(1).toUpperCase()}const c5=Aj([Tj,t5,Oj,Mj,Dj],"html"),Px=Aj([Tj,n5,Oj,Mj,Dj],"svg");function u5(e){return e.join(" ").trim()}var _x={},Cb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,d5=/\n/g,f5=/^\s*/,p5=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,h5=/^:\s*/,m5=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,g5=/^[;\s]*/,y5=/^\s+|\s+$/g,x5=`
109
+ `,Eb="/",jb="*",Ro="",w5="comment",v5="declaration";function b5(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var b=m.match(d5);b&&(n+=b.length);var S=m.lastIndexOf(x5);r=~S?m.length-S:r+m.length}function o(){var m={line:n,column:r};return function(b){return b.position=new s(m),u(),b}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function c(m){var b=m.exec(e);if(b){var S=b[0];return i(S),e=e.slice(S.length),b}}function u(){c(f5)}function p(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=o();if(!(Eb!=e.charAt(0)||jb!=e.charAt(1))){for(var b=2;Ro!=e.charAt(b)&&(jb!=e.charAt(b)||Eb!=e.charAt(b+1));)++b;if(b+=2,Ro===e.charAt(b-1))return a("End of comment missing");var S=e.slice(2,b-2);return r+=2,i(S),e=e.slice(b),r+=2,m({type:w5,comment:S})}}function f(){var m=o(),b=c(p5);if(b){if(d(),!c(h5))return a("property missing ':'");var S=c(m5),g=m({type:v5,property:Pb(b[0].replace(Cb,Ro)),value:S?Pb(S[0].replace(Cb,Ro)):Ro});return c(g5),g}}function h(){var m=[];p(m);for(var b;b=f();)b!==!1&&(m.push(b),p(m));return m}return u(),h()}function Pb(e){return e?e.replace(y5,Ro):Ro}var S5=b5,k5=tc&&tc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_x,"__esModule",{value:!0});_x.default=C5;const N5=k5(S5);function C5(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,N5.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.camelCase=void 0;var E5=/^--[a-zA-Z0-9_-]+$/,j5=/-([a-z])/g,P5=/^[^-]+$/,_5=/^-(webkit|moz|ms|o|khtml)-/,I5=/^-(ms)-/,A5=function(e){return!e||P5.test(e)||E5.test(e)},T5=function(e,t){return t.toUpperCase()},_b=function(e,t){return"".concat(t,"-")},R5=function(e,t){return t===void 0&&(t={}),A5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(I5,_b):e=e.replace(_5,_b),e.replace(j5,T5))};Np.camelCase=R5;var L5=tc&&tc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},O5=L5(_x),M5=Np;function qg(e,t){var n={};return!e||typeof e!="string"||(0,O5.default)(e,function(r,i){r&&i&&(n[(0,M5.camelCase)(r,t)]=i)}),n}qg.default=qg;var D5=qg;const F5=oo(D5),Fj=$j("end"),Ix=$j("start");function $j(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $5(e){const t=Ix(e),n=Fj(e);if(t&&n)return{start:t,end:n}}function Xl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ib(e.position):"start"in e||"end"in e?Ib(e):"line"in e||"column"in e?Gg(e):""}function Gg(e){return Ab(e&&e.line)+":"+Ab(e&&e.column)}function Ib(e){return Gg(e&&e.start)+"-"+Gg(e&&e.end)}function Ab(e){return e&&typeof e=="number"?e:1}class tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Xl(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const Ax={}.hasOwnProperty,z5=new Map,B5=/[A-Z]/g,H5=new Set(["table","tbody","thead","tfoot","tr"]),U5=new Set(["td","th"]),zj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=J5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Q5(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Px:c5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Bj(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Bj(e,t,n){if(t.type==="element")return W5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return K5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q5(e,t,n);if(t.type==="mdxjsEsm")return Y5(e,t);if(t.type==="root")return G5(e,t,n);if(t.type==="text")return X5(e,t)}function W5(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Px,e.schema=i),e.ancestors.push(t);const o=Uj(e,t.tagName,!1),s=Z5(e,t);let a=Rx(e,t);return H5.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Z4(c):!0})),Hj(e,s,o,t),Tx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function K5(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Rc(e,t.position)}function Y5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rc(e,t.position)}function q5(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Px,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Uj(e,t.name,!0),s=eB(e,t),a=Rx(e,t);return Hj(e,s,o,t),Tx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G5(e,t,n){const r={};return Tx(r,Rx(e,t)),e.create(t,e.Fragment,r,n)}function X5(e,t){return t.value}function Hj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Tx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Q5(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function J5(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),c=Ix(r);return t(i,o,s,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Z5(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ax.call(t.properties,i)){const o=tB(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&U5.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function eB(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Rc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Rx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:z5;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const a=Bj(e,o,s);a!==void 0&&n.push(a)}return n}function tB(e,t,n){const r=s5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?q4(n):u5(n)),r.property==="style"){let i=typeof n=="object"?n:nB(e,String(n));return e.stylePropertyNameCase==="css"&&(i=rB(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?r5[r.property]||r.property:r.attribute,n]}}function nB(e,t){try{return F5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=zj+"#cannot-parse-style-attribute",i}}function Uj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=bb(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=bb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Ax.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rc(e)}function Rc(e,t){const n=new tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=zj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function rB(e){const t={};let n;for(n in e)Ax.call(e,n)&&(t[iB(n)]=e[n]);return t}function iB(e){let t=e.replace(B5,oB);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oB(e){return"-"+e.toLowerCase()}const Zh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},sB={};function aB(e,t){const n=sB,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vj(e,r,i)}function Vj(e,t,n){if(lB(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tb(e.children,t,n)}return Array.isArray(e)?Tb(e,t,n):""}function Tb(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Vj(e[i],t,n);return r.join("")}function lB(e){return!!(e&&typeof e=="object")}const Rb=document.createElement("i");function Lx(e){const t="&"+e+";";Rb.innerHTML=t;const n=Rb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Kr(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Yn(e,t){return e.length>0?(Kr(e,e.length,0,t),e):t}const Lb={}.hasOwnProperty;function cB(e){const t={};let n=-1;for(;++n<e.length;)uB(t,e[n]);return t}function uB(e,t){let n;for(n in t){const i=(Lb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Lb.call(i,s)||(i[s]=[]);const a=o[s];dB(i[s],Array.isArray(a)?a:a?[a]:[])}}}function dB(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Kr(e,0,0,r)}function Wj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ta(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dr=co(/[A-Za-z]/),An=co(/[\dA-Za-z]/),fB=co(/[#-'*+\--9=?A-Z^-~]/);function Xg(e){return e!==null&&(e<32||e===127)}const Qg=co(/\d/),pB=co(/[\dA-Fa-f]/),hB=co(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const mB=co(new RegExp("\\p{P}|\\p{S}","u")),gB=co(/\s/);function co(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pa(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&An(e.charCodeAt(n+1))&&An(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function nt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(c){return Ge(c)?(e.enter(n),a(c)):t(c)}function a(c){return Ge(c)&&o++<i?(e.consume(c),a):(e.exit(n),t(c))}}const yB={tokenize:xB};function xB(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),nt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const wB={tokenize:vB},Ob={tokenize:bB};function vB(e){const t=this,n=[];let r=0,i,o,s;return a;function a(y){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,c,u)(y)}return u(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const N=t.events.length;let j=N,k;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){k=t.events[j][1].end;break}g(r);let _=N;for(;_<t.events.length;)t.events[_][1].end={...k},_++;return Kr(t.events,j+1,0,t.events.slice(N)),t.events.length=_,u(y)}return a(y)}function u(y){if(r===n.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ob,p,d)(y)}function p(y){return i&&v(),g(r),f(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(y)}function f(y){return t.containerState={},e.attempt(Ob,h,m)(y)}function h(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function m(y){if(y===null){i&&v(),g(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(y)}function b(y){if(y===null){S(e.exit("chunkFlow"),!0),g(0),e.consume(y);return}return Ce(y)?(e.consume(y),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(y),b)}function S(y,N){const j=t.sliceStream(y);if(N&&j.push(null),y.previous=o,o&&(o.next=y),o=y,i.defineSkip(y.start),i.write(j),t.parser.lazy[y.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const _=t.events.length;let R=_,M,H;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(M){H=t.events[R][1].end;break}M=!0}for(g(r),k=_;k<t.events.length;)t.events[k][1].end={...H},k++;Kr(t.events,R+1,0,t.events.slice(_)),t.events.length=k}}function g(y){let N=n.length;for(;N-- >y;){const j=n[N];t.containerState=j[1],j[0].exit.call(t,e)}n.length=y}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function bB(e,t,n){return nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Mb(e){if(e===null||Sn(e)||gB(e))return 1;if(mB(e))return 2}function Ox(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Jg={name:"attention",resolveAll:SB,tokenize:kB};function SB(e,t){let n=-1,r,i,o,s,a,c,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};Db(d,-c),Db(f,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Yn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Yn(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Yn(u,Ox(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Yn(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Yn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kr(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kB(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Mb(r);let o;return s;function s(c){return o=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===o)return e.consume(c),a;const u=e.exit("attentionSequence"),p=Mb(c),d=!p||p===2&&i||n.includes(c),f=!i||i===2&&p||n.includes(r);return u._open=!!(o===42?d:d&&(i||!f)),u._close=!!(o===42?f:f&&(p||!d)),t(c)}}function Db(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NB={name:"autolink",tokenize:CB};function CB(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return Dr(h)?(e.consume(h),s):h===64?n(h):u(h)}function s(h){return h===43||h===45||h===46||An(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,c):(h===43||h===45||h===46||An(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function c(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Xg(h)?n(h):(e.consume(h),c)}function u(h){return h===64?(e.consume(h),p):fB(h)?(e.consume(h),u):n(h)}function p(h){return An(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,p):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||An(h))&&r++<63){const m=h===45?f:d;return e.consume(h),m}return n(h)}}const Cp={partial:!0,tokenize:EB};function EB(e,t,n){return r;function r(o){return Ge(o)?nt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ce(o)?t(o):n(o)}}const Kj={continuation:{tokenize:PB},exit:_B,name:"blockQuote",tokenize:jB};function jB(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Ge(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function PB(e,t,n){const r=this;return i;function i(s){return Ge(s)?nt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Kj,t,n)(s)}}function _B(e){e.exit("blockQuote")}const Yj={name:"characterEscape",tokenize:IB};function IB(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return hB(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const qj={name:"characterReference",tokenize:AB};function AB(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=An,p(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=pB,p):(e.enter("characterReferenceValue"),o=7,s=Qg,p(d))}function p(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return s===An&&!Lx(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),p):n(d)}}const Fb={partial:!0,tokenize:RB},$b={concrete:!0,name:"codeFenced",tokenize:TB};function TB(e,t,n){const r=this,i={partial:!0,tokenize:j};let o=0,s=0,a;return c;function c(k){return u(k)}function u(k){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(k)}function p(k){return k===a?(s++,e.consume(k),p):s<3?n(k):(e.exit("codeFencedFenceSequence"),Ge(k)?nt(e,d,"whitespace")(k):d(k))}function d(k){return k===null||Ce(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Fb,b,N)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||Ce(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):Ge(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nt(e,h,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),f)}function h(k){return k===null||Ce(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||Ce(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?n(k):(e.consume(k),m)}function b(k){return e.attempt(i,N,S)(k)}function S(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return o>0&&Ge(k)?nt(e,v,"linePrefix",o+1)(k):v(k)}function v(k){return k===null||Ce(k)?e.check(Fb,b,N)(k):(e.enter("codeFlowValue"),y(k))}function y(k){return k===null||Ce(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),y)}function N(k){return e.exit("codeFenced"),t(k)}function j(k,_,R){let M=0;return H;function H(B){return k.enter("lineEnding"),k.consume(B),k.exit("lineEnding"),P}function P(B){return k.enter("codeFencedFence"),Ge(B)?nt(k,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B)}function T(B){return B===a?(k.enter("codeFencedFenceSequence"),V(B)):R(B)}function V(B){return B===a?(M++,k.consume(B),V):M>=s?(k.exit("codeFencedFenceSequence"),Ge(B)?nt(k,L,"whitespace")(B):L(B)):R(B)}function L(B){return B===null||Ce(B)?(k.exit("codeFencedFence"),_(B)):R(B)}}}function RB(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const em={name:"codeIndented",tokenize:OB},LB={partial:!0,tokenize:MB};function OB(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),nt(e,o,"linePrefix",5)(u)}function o(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):Ce(u)?e.attempt(LB,s,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||Ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),t(u)}}function MB(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):nt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Ce(s)?i(s):n(s)}}const DB={name:"codeText",previous:$B,resolve:FB,tokenize:zB};function FB(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $B(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zB(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(o=e.enter("codeTextSequence"),i=0,p(d)):Ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Ce(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function p(d){return d===96?(e.consume(d),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",u(d))}}class BB{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Nl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Nl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Nl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nl(this.left,n.reverse())}}}function Nl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Gj(e){const t={};let n=-1,r,i,o,s,a,c,u;const p=new BB(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,HB(p,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=p.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},a=p.slice(i,n),a.unshift(r),p.splice(i,n-i+1,a))}}return Kr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function HB(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,c=[],u={};let p,d,f=-1,h=n,m=0,b=0;const S=[b];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(p=r.sliceStream(h),h.next||p.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(p),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(b=f+1,S.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),f=S.length;f--;){const g=a.slice(S[f],S[f+1]),v=o.pop();c.push([v,v+g.length-1]),e.splice(v,2,g)}for(c.reverse(),f=-1;++f<c.length;)u[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return u}const UB={resolve:WB,tokenize:KB},VB={partial:!0,tokenize:YB};function WB(e){return Gj(e),e}function KB(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ce(a)?e.check(VB,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function YB(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),nt(e,o,"linePrefix")}function o(s){if(s===null||Ce(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Xj(e,t,n,r,i,o,s,a,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),f):g===null||g===32||g===41||Xg(g)?n(g):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(g))}function f(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),f(g)):g===null||g===60||Ce(g)?n(g):(e.consume(g),g===92?m:h)}function m(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function b(g){return!p&&(g===null||g===41||Sn(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):p<u&&g===40?(e.consume(g),p++,b):g===41?(e.consume(g),p--,b):g===null||g===32||g===40||Xg(g)?n(g):(e.consume(g),g===92?S:b)}function S(g){return g===40||g===41||g===92?(e.consume(g),b):b(g)}}function Qj(e,t,n,r,i,o){const s=this;let a=0,c;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),p}function p(h){return a>999||h===null||h===91||h===93&&!c||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Ce(h)||a++>999?(e.exit("chunkString"),p(h)):(e.consume(h),c||(c=!Ge(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function Jj(e,t,n,r,i,o){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,c):n(f)}function c(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),u(f))}function u(f){return f===s?(e.exit(o),c(s)):f===null?n(f):Ce(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),nt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===s||f===null||Ce(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:p)}function d(f){return f===s||f===92?(e.consume(f),p):p(f)}}function Ql(e,t){let n;return r;function r(i){return Ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ge(i)?nt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qB={name:"definition",tokenize:XB},GB={partial:!0,tokenize:QB};function XB(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return Qj.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ta(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return Sn(h)?Ql(e,u)(h):u(h)}function u(h){return Xj(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function p(h){return e.attempt(GB,d,d)(h)}function d(h){return Ge(h)?nt(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Ce(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function QB(e,t,n){return r;function r(a){return Sn(a)?Ql(e,i)(a):n(a)}function i(a){return Jj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ge(a)?nt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ce(a)?t(a):n(a)}}const JB={name:"hardBreakEscape",tokenize:ZB};function ZB(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const eH={name:"headingAtx",resolve:tH,tokenize:nH};function tH(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function nH(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Sn(p)?(e.exit("atxHeadingSequence"),a(p)):n(p)}function a(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Ce(p)?(e.exit("atxHeading"),t(p)):Ge(p)?nt(e,a,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),a(p))}function u(p){return p===null||p===35||Sn(p)?(e.exit("atxHeadingText"),a(p)):(e.consume(p),u)}}const rH=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zb=["pre","script","style","textarea"],iH={concrete:!0,name:"htmlFlow",resolveTo:aH,tokenize:lH},oH={partial:!0,tokenize:uH},sH={partial:!0,tokenize:cH};function aH(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lH(e,t,n){const r=this;let i,o,s,a,c;return u;function u(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),o=!0,b):O===63?(e.consume(O),i=3,r.interrupt?t:E):Dr(O)?(e.consume(O),s=String.fromCharCode(O),S):n(O)}function f(O){return O===45?(e.consume(O),i=2,h):O===91?(e.consume(O),i=5,a=0,m):Dr(O)?(e.consume(O),i=4,r.interrupt?t:E):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:E):n(O)}function m(O){const q="CDATA[";return O===q.charCodeAt(a++)?(e.consume(O),a===q.length?r.interrupt?t:T:m):n(O)}function b(O){return Dr(O)?(e.consume(O),s=String.fromCharCode(O),S):n(O)}function S(O){if(O===null||O===47||O===62||Sn(O)){const q=O===47,Z=s.toLowerCase();return!q&&!o&&zb.includes(Z)?(i=1,r.interrupt?t(O):T(O)):rH.includes(s.toLowerCase())?(i=6,q?(e.consume(O),g):r.interrupt?t(O):T(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?v(O):y(O))}return O===45||An(O)?(e.consume(O),s+=String.fromCharCode(O),S):n(O)}function g(O){return O===62?(e.consume(O),r.interrupt?t:T):n(O)}function v(O){return Ge(O)?(e.consume(O),v):H(O)}function y(O){return O===47?(e.consume(O),H):O===58||O===95||Dr(O)?(e.consume(O),N):Ge(O)?(e.consume(O),y):H(O)}function N(O){return O===45||O===46||O===58||O===95||An(O)?(e.consume(O),N):j(O)}function j(O){return O===61?(e.consume(O),k):Ge(O)?(e.consume(O),j):y(O)}function k(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,_):Ge(O)?(e.consume(O),k):R(O)}function _(O){return O===c?(e.consume(O),c=null,M):O===null||Ce(O)?n(O):(e.consume(O),_)}function R(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Sn(O)?j(O):(e.consume(O),R)}function M(O){return O===47||O===62||Ge(O)?y(O):n(O)}function H(O){return O===62?(e.consume(O),P):n(O)}function P(O){return O===null||Ce(O)?T(O):Ge(O)?(e.consume(O),P):n(O)}function T(O){return O===45&&i===2?(e.consume(O),F):O===60&&i===1?(e.consume(O),$):O===62&&i===4?(e.consume(O),z):O===63&&i===3?(e.consume(O),E):O===93&&i===5?(e.consume(O),A):Ce(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(oH,U,V)(O)):O===null||Ce(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),T)}function V(O){return e.check(sH,L,U)(O)}function L(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),B}function B(O){return O===null||Ce(O)?V(O):(e.enter("htmlFlowData"),T(O))}function F(O){return O===45?(e.consume(O),E):T(O)}function $(O){return O===47?(e.consume(O),s="",I):T(O)}function I(O){if(O===62){const q=s.toLowerCase();return zb.includes(q)?(e.consume(O),z):T(O)}return Dr(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),I):T(O)}function A(O){return O===93?(e.consume(O),E):T(O)}function E(O){return O===62?(e.consume(O),z):O===45&&i===2?(e.consume(O),E):T(O)}function z(O){return O===null||Ce(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),z)}function U(O){return e.exit("htmlFlow"),t(O)}}function cH(e,t,n){const r=this;return i;function i(s){return Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function uH(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cp,t,n)}}const dH={name:"htmlText",tokenize:fH};function fH(e,t,n){const r=this;let i,o,s;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),u):E===47?(e.consume(E),j):E===63?(e.consume(E),y):Dr(E)?(e.consume(E),R):n(E)}function u(E){return E===45?(e.consume(E),p):E===91?(e.consume(E),o=0,m):Dr(E)?(e.consume(E),v):n(E)}function p(E){return E===45?(e.consume(E),h):n(E)}function d(E){return E===null?n(E):E===45?(e.consume(E),f):Ce(E)?(s=d,$(E)):(e.consume(E),d)}function f(E){return E===45?(e.consume(E),h):d(E)}function h(E){return E===62?F(E):E===45?f(E):d(E)}function m(E){const z="CDATA[";return E===z.charCodeAt(o++)?(e.consume(E),o===z.length?b:m):n(E)}function b(E){return E===null?n(E):E===93?(e.consume(E),S):Ce(E)?(s=b,$(E)):(e.consume(E),b)}function S(E){return E===93?(e.consume(E),g):b(E)}function g(E){return E===62?F(E):E===93?(e.consume(E),g):b(E)}function v(E){return E===null||E===62?F(E):Ce(E)?(s=v,$(E)):(e.consume(E),v)}function y(E){return E===null?n(E):E===63?(e.consume(E),N):Ce(E)?(s=y,$(E)):(e.consume(E),y)}function N(E){return E===62?F(E):y(E)}function j(E){return Dr(E)?(e.consume(E),k):n(E)}function k(E){return E===45||An(E)?(e.consume(E),k):_(E)}function _(E){return Ce(E)?(s=_,$(E)):Ge(E)?(e.consume(E),_):F(E)}function R(E){return E===45||An(E)?(e.consume(E),R):E===47||E===62||Sn(E)?M(E):n(E)}function M(E){return E===47?(e.consume(E),F):E===58||E===95||Dr(E)?(e.consume(E),H):Ce(E)?(s=M,$(E)):Ge(E)?(e.consume(E),M):F(E)}function H(E){return E===45||E===46||E===58||E===95||An(E)?(e.consume(E),H):P(E)}function P(E){return E===61?(e.consume(E),T):Ce(E)?(s=P,$(E)):Ge(E)?(e.consume(E),P):M(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,V):Ce(E)?(s=T,$(E)):Ge(E)?(e.consume(E),T):(e.consume(E),L)}function V(E){return E===i?(e.consume(E),i=void 0,B):E===null?n(E):Ce(E)?(s=V,$(E)):(e.consume(E),V)}function L(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Sn(E)?M(E):(e.consume(E),L)}function B(E){return E===47||E===62||Sn(E)?M(E):n(E)}function F(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function $(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),I}function I(E){return Ge(E)?nt(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):A(E)}function A(E){return e.enter("htmlTextData"),s(E)}}const Mx={name:"labelEnd",resolveAll:gH,resolveTo:yH,tokenize:xH},pH={tokenize:wH},hH={tokenize:vH},mH={tokenize:bH};function gH(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Kr(e,0,e.length,n),e}function yH(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",c,t],["enter",u,t]],a=Yn(a,e.slice(o+1,o+r+3)),a=Yn(a,[["enter",p,t]]),a=Yn(a,Ox(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Yn(a,[["exit",p,t],e[s-2],e[s-1],["exit",u,t]]),a=Yn(a,e.slice(s+1)),a=Yn(a,[["exit",c,t]]),Kr(e,o,e.length,a),e}function xH(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(f){return o?o._inactive?d(f):(s=r.parser.defined.includes(ta(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(pH,p,s?p:d)(f):f===91?e.attempt(hH,p,s?u:d)(f):s?p(f):d(f)}function u(f){return e.attempt(mH,p,d)(f)}function p(f){return t(f)}function d(f){return o._balanced=!0,n(f)}}function wH(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Sn(d)?Ql(e,o)(d):o(d)}function o(d){return d===41?p(d):Xj(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Sn(d)?Ql(e,c)(d):p(d)}function a(d){return n(d)}function c(d){return d===34||d===39||d===40?Jj(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function u(d){return Sn(d)?Ql(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function vH(e,t,n){const r=this;return i;function i(a){return Qj.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ta(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function bH(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const SH={name:"labelStartImage",resolveAll:Mx.resolveAll,tokenize:kH};function kH(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const NH={name:"labelStartLink",resolveAll:Mx.resolveAll,tokenize:CH};function CH(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const tm={name:"lineEnding",tokenize:EH};function EH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),nt(e,t,"linePrefix")}}const Ud={name:"thematicBreak",tokenize:jH};function jH(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ge(u)?nt(e,a,"whitespace")(u):a(u))}}const pn={continuation:{tokenize:AH},exit:RH,name:"list",tokenize:IH},PH={partial:!0,tokenize:LH},_H={partial:!0,tokenize:TH};function IH(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Qg(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ud,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return Qg(h)&&++s<10?(e.consume(h),c):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Cp,r.interrupt?n:p,e.attempt(PH,f,d))}function p(h){return r.containerState.initialBlankLine=!0,o++,f(h)}function d(h){return Ge(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function AH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cp,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ge(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_H,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,nt(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function TH(e,t,n){const r=this;return nt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function RH(e){e.exit(this.containerState.type)}function LH(e,t,n){const r=this;return nt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ge(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Bb={name:"setextUnderline",resolveTo:OH,tokenize:MH};function OH(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function MH(e,t,n){const r=this;let i;return o;function o(u){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Ge(u)?nt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const DH={tokenize:FH};function FH(e){const t=this,n=e.attempt(Cp,r,e.attempt(this.parser.constructs.flowInitial,i,nt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(UB,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $H={resolveAll:eP()},zH=Zj("string"),BH=Zj("text");function Zj(e){return{resolveAll:eP(e==="text"?HH:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(p){return u(p)?o(p):a(p)}function a(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return u(p)?(n.exit("data"),o(p)):(n.consume(p),c)}function u(p){if(p===null)return!0;const d=i[p];let f=-1;if(d)for(;++f<d.length;){const h=d[f];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function eP(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function HH(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,c;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)c=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const UH={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:Kj},VH={91:qB},WH={[-2]:em,[-1]:em,32:em},KH={35:eH,42:Ud,45:[Bb,Ud],60:iH,61:Bb,95:Ud,96:$b,126:$b},YH={38:qj,92:Yj},qH={[-5]:tm,[-4]:tm,[-3]:tm,33:SH,38:qj,42:Jg,60:[NB,dH],91:NH,92:[JB,Yj],93:Mx,95:Jg,96:DB},GH={null:[Jg,$H]},XH={null:[42,95]},QH={null:[]},JH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XH,contentInitial:VH,disable:QH,document:UH,flow:KH,flowInitial:WH,insideSpan:GH,string:YH,text:qH},Symbol.toStringTag,{value:"Module"}));function ZH(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const c={attempt:_(j),check:_(k),consume:v,enter:y,exit:N,interrupt:_(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:h,write:d};let p=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function d(P){return s=Yn(s,P),S(),s[s.length-1]!==null?[]:(R(t,0),u.events=Ox(o,u.events,u),u.events)}function f(P,T){return t8(h(P),T)}function h(P){return e8(s,P)}function m(){const{_bufferIndex:P,_index:T,line:V,column:L,offset:B}=r;return{_bufferIndex:P,_index:T,line:V,column:L,offset:B}}function b(P){i[P.line]=P.column,H()}function S(){let P;for(;r._index<s.length;){const T=s[r._index];if(typeof T=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<T.length;)g(T.charCodeAt(r._bufferIndex));else g(T)}}function g(P){p=p(P)}function v(P){Ce(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,H()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=P}function y(P,T){const V=T||{};return V.type=P,V.start=m(),u.events.push(["enter",V,u]),a.push(V),V}function N(P){const T=a.pop();return T.end=m(),u.events.push(["exit",T,u]),T}function j(P,T){R(P,T.from)}function k(P,T){T.restore()}function _(P,T){return V;function V(L,B,F){let $,I,A,E;return Array.isArray(L)?U(L):"tokenize"in L?U([L]):z(L);function z(te){return ae;function ae(ee){const ue=ee!==null&&te[ee],Se=ee!==null&&te.null,xe=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return U(xe)(ee)}}function U(te){return $=te,I=0,te.length===0?F:O(te[I])}function O(te){return ae;function ae(ee){return E=M(),A=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call(T?Object.assign(Object.create(u),T):u,c,q,Z)(ee)}}function q(te){return P(A,E),B}function Z(te){return E.restore(),++I<$.length?O($[I]):F}}}function R(P,T){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&Kr(u.events,T,u.events.length-T,P.resolve(u.events.slice(T),u)),P.resolveTo&&(u.events=P.resolveTo(u.events,u))}function M(){const P=m(),T=u.previous,V=u.currentConstruct,L=u.events.length,B=Array.from(a);return{from:L,restore:F};function F(){r=P,u.previous=T,u.currentConstruct=V,u.events.length=L,a=B,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function e8(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function t8(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
110
+ `;break}case-3:{s=`\r
111
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function n8(e){const r={constructs:cB([JH,...(e||{}).extensions||[]]),content:i(yB),defined:[],document:i(wB),flow:i(DH),lazy:{},string:i(zH),text:i(BH)};return r;function i(o){return s;function s(a){return ZH(r,o,a)}}}function r8(e){for(;!Gj(e););return e}const Hb=/[\0\t\n\r]/g;function i8(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const c=[];let u,p,d,f,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Hb.lastIndex=d,u=Hb.exec(o),f=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(f),!u){t=o.slice(d);break}if(h===10&&d===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<f&&(c.push(o.slice(d,f)),e+=f-d),h){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const o8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s8(e){return e.replace(o8,a8)}function a8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Wj(n.slice(o?2:1),o?16:10)}return Lx(n)||e}const tP={}.hasOwnProperty;function l8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),c8(n)(r8(n8(n).document().write(i8()(e,t,!0))))}function c8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(at),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(qe),blockQuote:o(Se),characterEscape:M,characterReference:M,codeFenced:o(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(xe,s),codeText:o(ge,s),codeTextData:M,data:M,codeFlowValue:M,definition:o(ye),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o($e),hardBreakEscape:o(Me),hardBreakTrailing:o(Me),htmlFlow:o(ft,s),htmlFlowData:M,htmlText:o(ft,s),htmlTextData:M,image:o(Ve),label:s,link:o(at),listItem:o(vr),listItemValue:f,listOrdered:o(Nn,d),listUnordered:o(Nn),paragraph:o(br),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(qe),strong:o(Sr),thematicBreak:o(Gr)},exit:{atxHeading:c(),atxHeadingSequence:j,autolink:c(),autolinkEmail:ue,autolinkProtocol:ee,blockQuote:c(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:H,codeIndented:c(g),codeText:c(B),codeTextData:H,data:H,definition:c(),definitionDestinationString:N,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(V),htmlFlowData:H,htmlText:c(L),htmlTextData:H,image:c($),label:A,labelText:I,lineEnding:P,link:c(F),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:q,resourceDestinationString:E,resourceTitleString:z,resource:U,setextHeading:c(R),setextHeadingLineSequence:_,setextHeadingText:k,strong:c(),thematicBreak:c()}};nP(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(X){let se={type:"root",children:[]};const ke={stack:[se],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:p,data:n},Ie=[];let He=-1;for(;++He<X.length;)if(X[He][1].type==="listOrdered"||X[He][1].type==="listUnordered")if(X[He][0]==="enter")Ie.push(He);else{const Wt=Ie.pop();He=i(X,Wt,He)}for(He=-1;++He<X.length;){const Wt=t[X[He][0]];tP.call(Wt,X[He][1].type)&&Wt[X[He][1].type].call(Object.assign({sliceSerialize:X[He][2].sliceSerialize},ke),X[He][1])}if(ke.tokenStack.length>0){const Wt=ke.tokenStack[ke.tokenStack.length-1];(Wt[1]||Ub).call(ke,void 0,Wt[0])}for(se.position={start:Ti(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Ti(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)se=t.transforms[He](se)||se;return se}function i(X,se,ke){let Ie=se-1,He=-1,Wt=!1,Fn,cn,de,yt;for(;++Ie<=ke;){const Nt=X[Ie];switch(Nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Nt[0]==="enter"?He++:He--,yt=void 0;break}case"lineEndingBlank":{Nt[0]==="enter"&&(Fn&&!yt&&!He&&!de&&(de=Ie),yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yt=void 0}if(!He&&Nt[0]==="enter"&&Nt[1].type==="listItemPrefix"||He===-1&&Nt[0]==="exit"&&(Nt[1].type==="listUnordered"||Nt[1].type==="listOrdered")){if(Fn){let Ee=Ie;for(cn=void 0;Ee--;){const Kt=X[Ee];if(Kt[1].type==="lineEnding"||Kt[1].type==="lineEndingBlank"){if(Kt[0]==="exit")continue;cn&&(X[cn][1].type="lineEndingBlank",Wt=!0),Kt[1].type="lineEnding",cn=Ee}else if(!(Kt[1].type==="linePrefix"||Kt[1].type==="blockQuotePrefix"||Kt[1].type==="blockQuotePrefixWhitespace"||Kt[1].type==="blockQuoteMarker"||Kt[1].type==="listItemIndent"))break}de&&(!cn||de<cn)&&(Fn._spread=!0),Fn.end=Object.assign({},cn?X[cn][1].start:Nt[1].end),X.splice(cn||Ie,0,["exit",Fn,Nt[2]]),Ie++,ke++}if(Nt[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},Nt[1].start),end:void 0};Fn=Ee,X.splice(Ie,0,["enter",Ee,Nt[2]]),Ie++,ke++,de=void 0,yt=!0}}}return X[se][1]._spread=Wt,ke}function o(X,se){return ke;function ke(Ie){a.call(this,X(Ie),Ie),se&&se.call(this,Ie)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(X,se,ke){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([se,ke||void 0]),X.position={start:Ti(se.start),end:void 0}}function c(X){return se;function se(ke){X&&X.call(this,ke),u.call(this,ke)}}function u(X,se){const ke=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==X.type&&(se?se.call(this,X,Ie[0]):(Ie[1]||Ub).call(this,X,Ie[0]));else throw new Error("Cannot close `"+X.type+"` ("+Xl({start:X.start,end:X.end})+"): it’s not open");ke.position.end=Ti(X.end)}function p(){return aB(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(X){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function h(){const X=this.resume(),se=this.stack[this.stack.length-1];se.lang=X}function m(){const X=this.resume(),se=this.stack[this.stack.length-1];se.meta=X}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const X=this.resume(),se=this.stack[this.stack.length-1];se.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const X=this.resume(),se=this.stack[this.stack.length-1];se.value=X.replace(/(\r?\n|\r)$/g,"")}function v(X){const se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=se,ke.identifier=ta(this.sliceSerialize(X)).toLowerCase()}function y(){const X=this.resume(),se=this.stack[this.stack.length-1];se.title=X}function N(){const X=this.resume(),se=this.stack[this.stack.length-1];se.url=X}function j(X){const se=this.stack[this.stack.length-1];if(!se.depth){const ke=this.sliceSerialize(X).length;se.depth=ke}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(X){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function M(X){const ke=this.stack[this.stack.length-1].children;let Ie=ke[ke.length-1];(!Ie||Ie.type!=="text")&&(Ie=uo(),Ie.position={start:Ti(X.start),end:void 0},ke.push(Ie)),this.stack.push(Ie)}function H(X){const se=this.stack.pop();se.value+=this.sliceSerialize(X),se.position.end=Ti(X.end)}function P(X){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=se.children[se.children.length-1];ke.position.end=Ti(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(M.call(this,X),H.call(this,X))}function T(){this.data.atHardBreak=!0}function V(){const X=this.resume(),se=this.stack[this.stack.length-1];se.value=X}function L(){const X=this.resume(),se=this.stack[this.stack.length-1];se.value=X}function B(){const X=this.resume(),se=this.stack[this.stack.length-1];se.value=X}function F(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=se,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function $(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=se,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function I(X){const se=this.sliceSerialize(X),ke=this.stack[this.stack.length-2];ke.label=s8(se),ke.identifier=ta(se).toLowerCase()}function A(){const X=this.stack[this.stack.length-1],se=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Ie=X.children;ke.children=Ie}else ke.alt=se}function E(){const X=this.resume(),se=this.stack[this.stack.length-1];se.url=X}function z(){const X=this.resume(),se=this.stack[this.stack.length-1];se.title=X}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function q(X){const se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=se,ke.identifier=ta(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function Z(X){this.data.characterReferenceType=X.type}function te(X){const se=this.sliceSerialize(X),ke=this.data.characterReferenceType;let Ie;ke?(Ie=Wj(se,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=Lx(se);const He=this.stack[this.stack.length-1];He.value+=Ie}function ae(X){const se=this.stack.pop();se.position.end=Ti(X.end)}function ee(X){H.call(this,X);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(X)}function ue(X){H.call(this,X);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(X)}function Se(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function ge(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function ft(){return{type:"html",value:""}}function Ve(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function Nn(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function vr(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function br(){return{type:"paragraph",children:[]}}function Sr(){return{type:"strong",children:[]}}function uo(){return{type:"text",value:""}}function Gr(){return{type:"thematicBreak"}}}function Ti(e){return{line:e.line,column:e.column,offset:e.offset}}function nP(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?nP(e,r):u8(e,r)}}function u8(e,t){let n;for(n in t)if(tP.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ub(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xl({start:t.start,end:t.end})+") is still open")}function d8(e){const t=this;t.parser=n;function n(r){return l8(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function f8(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function p8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
112
+ `}]}function h8(e,t){const n=t.value?t.value+`
113
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function m8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Pa(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function x8(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rP(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function v8(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rP(e,t);const i={src:Pa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function b8(e,t){const n={src:Pa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function S8(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function k8(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rP(e,t);const i={href:Pa(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function N8(e,t){const n={href:Pa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function C8(e,t,n){const r=e.all(t),i=n?E8(n):iP(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const p=r[a];(i||a!==0||p.type!=="element"||p.tagName!=="p")&&s.push({type:"text",value:`
114
+ `}),p.type==="element"&&p.tagName==="p"&&!i?s.push(...p.children):s.push(p)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
115
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function E8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=iP(n[r])}return t}function iP(e){const t=e.spread;return t??e.children.length>1}function j8(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function P8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function I8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A8(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ix(t.children[1]),c=Fj(t.children[t.children.length-1]);a&&c&&(s.position={start:a,end:c}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function T8(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<a;){const d=t.children[c],f={},h=s?s[c]:void 0;h&&(f.align=h);let m={type:"element",tagName:o,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function R8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Vb=9,Wb=32;function L8(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Kb(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Kb(t.slice(i),i>0,!1)),o.join("")}function Kb(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Vb||o===Wb;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Vb||o===Wb;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function O8(e,t){const n={type:"text",value:L8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function M8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const D8={blockquote:f8,break:p8,code:h8,delete:m8,emphasis:g8,footnoteReference:y8,heading:x8,html:w8,imageReference:v8,image:b8,inlineCode:S8,linkReference:k8,link:N8,listItem:C8,list:j8,paragraph:P8,root:_8,strong:I8,table:A8,tableCell:R8,tableRow:T8,text:O8,thematicBreak:M8,toml:md,yaml:md,definition:md,footnoteDefinition:md};function md(){}const oP=-1,Ep=0,Jl=1,Df=2,Dx=3,Fx=4,$x=5,zx=6,sP=7,aP=8,Yb=typeof self=="object"?self:globalThis,F8=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Ep:case oP:return n(s,i);case Jl:{const a=n([],i);for(const c of s)a.push(r(c));return a}case Df:{const a=n({},i);for(const[c,u]of s)a[r(c)]=r(u);return a}case Dx:return n(new Date(s),i);case Fx:{const{source:a,flags:c}=s;return n(new RegExp(a,c),i)}case $x:{const a=n(new Map,i);for(const[c,u]of s)a.set(r(c),r(u));return a}case zx:{const a=n(new Set,i);for(const c of s)a.add(r(c));return a}case sP:{const{name:a,message:c}=s;return n(new Yb[a](c),i)}case aP:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new Yb[o](s),i)};return r},qb=e=>F8(new Map,e)(0),Ns="",{toString:$8}={},{keys:z8}=Object,Cl=e=>{const t=typeof e;if(t!=="object"||!e)return[Ep,t];const n=$8.call(e).slice(8,-1);switch(n){case"Array":return[Jl,Ns];case"Object":return[Df,Ns];case"Date":return[Dx,Ns];case"RegExp":return[Fx,Ns];case"Map":return[$x,Ns];case"Set":return[zx,Ns];case"DataView":return[Jl,n]}return n.includes("Array")?[Jl,n]:n.includes("Error")?[sP,n]:[Df,n]},gd=([e,t])=>e===Ep&&(t==="function"||t==="symbol"),B8=(e,t,n,r)=>{const i=(s,a)=>{const c=r.push(s)-1;return n.set(a,c),c},o=s=>{if(n.has(s))return n.get(s);let[a,c]=Cl(s);switch(a){case Ep:{let p=s;switch(c){case"bigint":a=aP,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([oP],s)}return i([a,p],s)}case Jl:{if(c){let f=s;return c==="DataView"?f=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(s)),i([c,[...f]],s)}const p=[],d=i([a,p],s);for(const f of s)p.push(o(f));return d}case Df:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],d=i([a,p],s);for(const f of z8(s))(e||!gd(Cl(s[f])))&&p.push([o(f),o(s[f])]);return d}case Dx:return i([a,s.toISOString()],s);case Fx:{const{source:p,flags:d}=s;return i([a,{source:p,flags:d}],s)}case $x:{const p=[],d=i([a,p],s);for(const[f,h]of s)(e||!(gd(Cl(f))||gd(Cl(h))))&&p.push([o(f),o(h)]);return d}case zx:{const p=[],d=i([a,p],s);for(const f of s)(e||!gd(Cl(f)))&&p.push(o(f));return d}}const{message:u}=s;return i([a,{name:c,message:u}],s)};return o},Gb=(e,{json:t,lossy:n}={})=>{const r=[];return B8(!(t||n),!!t,new Map,r)(e),r},Ff=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?qb(Gb(e,t)):structuredClone(e):(e,t)=>qb(Gb(e,t));function H8(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function U8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function V8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||H8,r=e.options.footnoteBackLabel||U8,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const p=e.all(u),d=String(u.identifier).toUpperCase(),f=Pa(d.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,h);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...m)}else p.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(p,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ff(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
116
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
117
+ `}]}}const lP=function(e){if(e==null)return q8;if(typeof e=="function")return jp(e);if(typeof e=="object")return Array.isArray(e)?W8(e):K8(e);if(typeof e=="string")return Y8(e);throw new Error("Expected function, string, or object as test")};function W8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lP(e[n]);return jp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function K8(e){const t=e;return jp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Y8(e){return jp(t);function t(n){return n&&n.type===e}}function jp(e){return t;function t(n,r,i){return!!(G8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function q8(){return!0}function G8(e){return e!==null&&typeof e=="object"&&"type"in e}const cP=[],X8=!0,Xb=!1,Q8="skip";function J8(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=lP(i),s=r?-1:1;a(e,void 0,[])();function a(c,u,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(c.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=cP,m,b,S;if((!t||o(c,u,p[p.length-1]||void 0))&&(h=Z8(n(c,p)),h[0]===Xb))return h;if("children"in c&&c.children){const g=c;if(g.children&&h[0]!==Q8)for(b=(r?g.children.length:-1)+s,S=p.concat(g);b>-1&&b<g.children.length;){const v=g.children[b];if(m=a(v,b,S)(),m[0]===Xb)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function Z8(e){return Array.isArray(e)?e:typeof e=="number"?[X8,e]:e==null?cP:[e]}function uP(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),J8(e,o,a,i);function a(c,u){const p=u[u.length-1],d=p?p.children.indexOf(c):void 0;return s(c,d,p)}}const Zg={}.hasOwnProperty,e6={};function t6(e,t){const n=t||e6,r=new Map,i=new Map,o=new Map,s={...D8,...n.handlers},a={all:u,applyData:r6,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:c,options:n,patch:n6,wrap:o6};return uP(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:i,f=String(p.identifier).toUpperCase();d.has(f)||d.set(f,p)}}),a;function c(p,d){const f=p.type,h=a.handlers[f];if(Zg.call(a.handlers,f)&&h)return h(a,p,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in p){const{children:b,...S}=p,g=Ff(S);return g.children=a.all(p),g}return Ff(p)}return(a.options.unknownHandler||i6)(a,p,d)}function u(p){const d=[];if("children"in p){const f=p.children;let h=-1;for(;++h<f.length;){const m=a.one(f[h],p);if(m){if(h&&f[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Qb(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=Qb(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function n6(e,t){e.position&&(t.position=$5(e))}function r6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Ff(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function i6(e,t){const n=t.data||{},r="value"in t&&!(Zg.call(n,"hProperties")||Zg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function o6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
118
+ `});++r<e.length;)r&&n.push({type:"text",value:`
119
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
120
+ `}),n}function Qb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Jb(e,t){const n=t6(e,t),r=n.one(e,void 0),i=V8(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
121
+ `},i),o}function s6(e,t){return e&&"run"in e?async function(n,r){const i=Jb(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Jb(n,{file:r,...e||t})}}function Zb(e){if(e)throw e}var Vd=Object.prototype.hasOwnProperty,dP=Object.prototype.toString,e1=Object.defineProperty,t1=Object.getOwnPropertyDescriptor,n1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):dP.call(t)==="[object Array]"},r1=function(t){if(!t||dP.call(t)!=="[object Object]")return!1;var n=Vd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Vd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Vd.call(t,i)},i1=function(t,n){e1&&n.name==="__proto__"?e1(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},o1=function(t,n){if(n==="__proto__")if(Vd.call(t,n)){if(t1)return t1(t,n).value}else return;return t[n]},a6=function e(){var t,n,r,i,o,s,a=arguments[0],c=1,u=arguments.length,p=!1;for(typeof a=="boolean"&&(p=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=o1(a,n),i=o1(t,n),a!==i&&(p&&i&&(r1(i)||(o=n1(i)))?(o?(o=!1,s=r&&n1(r)?r:[]):s=r&&r1(r)?r:{},i1(a,{name:n,newValue:e(p,s,i)})):typeof i<"u"&&i1(a,{name:n,newValue:i}));return a};const nm=oo(a6);function ey(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function l6(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(c,...u){const p=e[++o];let d=-1;if(c){s(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,p?c6(p,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function c6(e,t){let n;return r;function r(...s){const a=e.length>s.length;let c;a&&s.push(i);try{c=e.apply(this,s)}catch(u){const p=u;if(a&&n)throw p;return i(p)}a||(c&&c.then&&typeof c.then=="function"?c.then(o,i):c instanceof Error?i(c):o(c))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Tr={basename:u6,dirname:d6,extname:f6,join:p6,sep:"/"};function u6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zc(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function d6(e){if(Zc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function f6(e){Zc(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function p6(...e){let t=-1,n;for(;++t<e.length;)Zc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":h6(n)}function h6(e){Zc(e);const t=e.codePointAt(0)===47;let n=m6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function m6(e,t){let n="",r=0,i=-1,o=0,s=-1,a,c;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Zc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const g6={cwd:y6};function y6(){return"/"}function ty(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function x6(e){if(typeof e=="string")e=new URL(e);else if(!ty(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return w6(e)}function w6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const rm=["history","path","basename","stem","extname","dirname"];class fP{constructor(t){let n;t?ty(t)?n={path:t}:typeof t=="string"||v6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":g6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rm.length;){const o=rm[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)rm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Tr.basename(this.path):void 0}set basename(t){om(t,"basename"),im(t,"basename"),this.path=Tr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tr.dirname(this.path):void 0}set dirname(t){s1(this.basename,"dirname"),this.path=Tr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tr.extname(this.path):void 0}set extname(t){if(im(t,"extname"),s1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Tr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ty(t)&&(t=x6(t)),om(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tr.basename(this.path,this.extname):void 0}set stem(t){om(t,"stem"),im(t,"stem"),this.path=Tr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function im(e,t){if(e&&e.includes(Tr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tr.sep+"`")}function om(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function s1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function v6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b6=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},S6={}.hasOwnProperty;class Bx extends b6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=l6()}copy(){const t=new Bx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(nm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lm("data",this.frozen),this.namespace[t]=n,this):S6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=yd(t),r=this.parser||this.Parser;return sm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),sm("process",this.parser||this.Parser),am("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=yd(t),c=r.parse(a);r.run(c,a,function(p,d,f){if(p||!d||!f)return u(p);const h=d,m=r.stringify(h,f);C6(m)?f.value=m:f.result=m,u(p,f)});function u(p,d){p||!d?s(p):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),sm("processSync",this.parser||this.Parser),am("processSync",this.compiler||this.Compiler),this.process(t,i),l1("processSync","process",n),r;function i(o,s){n=!0,Zb(o),r=s}}run(t,n,r){a1(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const c=yd(n);i.run(t,c,u);function u(p,d,f){const h=d||t;p?a(p):s?s(h):r(void 0,h,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),l1("runSync","run",r),i;function o(s,a){Zb(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=yd(n),i=this.compiler||this.Compiler;return am("stringify",i),a1(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(lm("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...d]=u;c(p,d)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=nm(!0,i.settings,u.settings))}function a(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const d=u[p];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,p){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===u){f=d;break}if(f===-1)r.push([u,...p]);else if(p.length>0){let[h,...m]=p;const b=r[f][1];ey(b)&&ey(h)&&(h=nm(!0,b,h)),r[f]=[u,h,...m]}}}}const k6=new Bx().freeze();function sm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function am(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function a1(e){if(!ey(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function l1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yd(e){return N6(e)?e:new fP(e)}function N6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function C6(e){return typeof e=="string"||E6(e)}function E6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const j6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",c1=[],u1={allowDangerousHtml:!0},P6=/^(https?|ircs?|mailto|xmpp)$/i,_6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function pP(e){const t=I6(e),n=A6(e);return T6(t.runSync(t.parse(n),n),e)}function I6(e){const t=e.rehypePlugins||c1,n=e.remarkPlugins||c1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...u1}:u1;return k6().use(d8).use(n).use(s6,r).use(t)}function A6(e){const t=e.children||"",n=new fP;return typeof t=="string"&&(n.value=t),n}function T6(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||R6;for(const p of _6)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+j6+p.id,void 0);return uP(e,u),V5(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(p,d,f){if(p.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let h;for(h in Zh)if(Object.hasOwn(Zh,h)&&Object.hasOwn(p.properties,h)){const m=p.properties[h],b=Zh[h];(b===null||b.includes(p.tagName))&&(p.properties[h]=c(String(m||""),h,p))}}if(p.type==="element"){let h=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(p,d,f)),h&&f&&typeof d=="number")return a&&p.children?f.children.splice(d,1,...p.children):f.children.splice(d,1),d}}}function R6(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||P6.test(e.slice(0,t))?e:""}function Hx(e){var n;if(e.displayKind==="image"||e.encoding==="base64"&&((n=e.mimeType)!=null&&n.startsWith("image/")))return"image";if(e.displayKind==="json"||e.mimeType==="application/json")return"json";if(e.displayKind==="markdown"||e.mimeType==="text/markdown")return"markdown";if(e.displayKind==="text")return"text";const t=(e.content||"").trim();if(t&&(t.startsWith("{")||t.startsWith("[")))try{return JSON.parse(t),"json"}catch{}return"text"}function L6(e){const t=Hx(e);if(t==="image"){const n=(e.mimeType||"image/png").split("/")[1];return n?n.toUpperCase():"IMAGE"}return t==="json"?"JSON":t==="markdown"?"MD":null}function hP(e){try{return JSON.stringify(JSON.parse(e.trim()),null,2)}catch{return e}}function d1({text:e}){const{t}=st(),n=e||"";return n.trim()?l.jsx("div",{className:"af-run-ctx-md",children:l.jsx(pP,{children:n})}):l.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.empty")})}function f1({o:e}){var r;const{t}=st(),n=Hx(e);if(n==="image"||e.encoding==="base64"&&((r=e.mimeType)!=null&&r.startsWith("image/"))){const o=`data:${e.mimeType||"image/png"};base64,${e.content||""}`;return l.jsxs("div",{className:"af-run-ctx-media",children:[l.jsx("img",{className:"af-run-ctx-img",src:o,alt:e.slot||"output",loading:"lazy"}),e.truncated?l.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.imageTruncated")}):null]})}if(n==="json")return l.jsx("pre",{className:"af-run-ctx-pre",children:hP(e.content||"")});if(n==="markdown"){const i=e.content||"";return i.trim()?l.jsx("div",{className:"af-run-ctx-md",children:l.jsx(pP,{children:i})}):l.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.empty")})}return l.jsx("pre",{className:"af-run-ctx-pre",children:e.content!=null&&e.content!==""?e.content:t("flow:runContext.empty")})}function p1(e){return L6(e)}function h1(e){var r;if(!e)return null;const t=Hx(e);if(t==="image"||e.encoding==="base64"&&((r=e.mimeType)!=null&&r.startsWith("image/")))return null;const n=e.content;return n==null||n===""?null:t==="json"?hP(String(n)):String(n)}function m1({text:e,title:t,copiedLabel:n}){const[r,i]=w.useState(!1);if(!e)return null;const o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1400)}catch{}};return l.jsx("button",{type:"button",className:"af-icon-btn af-run-ctx-copy-btn",onClick:o,title:r?n:t,"aria-label":r?n:t,children:l.jsx("span",{className:"material-symbols-outlined",children:r?"check":"content_copy"})})}const g1=2e4,mP="af:run-node-ctx-width";function Wd(){return typeof window>"u"?416:Math.min(26*16,window.innerWidth-32)}function Bi(e){const n=Math.max(280,Math.min(Math.floor(window.innerWidth*.92),1200));return Number.isFinite(e)?Math.min(Math.max(Math.round(e),200),n):Bi(Wd())}function O6(){try{const e=localStorage.getItem(mP);if(e==null)return Bi(Wd());const t=parseInt(e,10);return Number.isFinite(t)?Bi(t):Bi(Wd())}catch{return Bi(Wd())}}async function y1(e,t,n,r){const i=new URLSearchParams({flowId:e,instanceId:t});n&&String(n).trim()&&i.set("runId",String(n).trim());const o=await fetch(`/api/node-exec-context?${i.toString()}`,{signal:r}),s=await o.text();let a;try{a=JSON.parse(s)}catch{throw new Error(s.startsWith("<!")||s.startsWith("<html")?"apiConnectError":"invalidJson")}if(!o.ok)throw new Error(a.error||"HTTP "+o.status);return a}function M6(e,t){const n=`flow:runContext.${t}`,r=e(n);return r!==n?r:t}function D6({instanceId:e,flowId:t,runId:n,nodeStatus:r,onClose:i}){const{t:o}=st(),[s,a]=w.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 960px)").matches),[c,u]=w.useState(O6),p=w.useRef({active:!1,pointerId:-1,startX:0,startW:416}),[d,f]=w.useState(!0),[h,m]=w.useState(""),[b,S]=w.useState([]),[g,v]=w.useState(null),[y,N]=w.useState(null),j=w.useRef(null),k=w.useRef(null),_=w.useRef(0),R=w.useRef(0);w.useLayoutEffect(()=>{const I=window.matchMedia("(max-width: 960px)"),A=()=>a(I.matches);return I.addEventListener("change",A),()=>I.removeEventListener("change",A)},[]),w.useEffect(()=>{function I(){u(A=>Bi(A))}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const M=w.useCallback(()=>{u(I=>{const A=Bi(I);try{localStorage.setItem(mP,String(A))}catch{}return A})},[]),H=w.useCallback(I=>{if(s||I.button!==0)return;I.preventDefault();const A=I.currentTarget;p.current={active:!0,pointerId:I.pointerId,startX:I.clientX,startW:c},A.setPointerCapture(I.pointerId)},[s,c]),P=w.useCallback(I=>{const A=p.current;if(!A.active||I.pointerId!==A.pointerId)return;const E=A.startX-I.clientX;u(Bi(A.startW+E))},[]),T=w.useCallback(I=>{const A=p.current;if(!(!A.active||I.pointerId!==A.pointerId)){A.active=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}M()}},[M]),V=w.useCallback(()=>{const I=p.current;I.active&&(I.active=!1,M())},[M]),L=w.useCallback(I=>{const A=Array.isArray(I)?I:[];S(A),v(E=>E&&A.some(z=>z.execId===E)?E:A.length>0?A[A.length-1].execId:null)},[]),B=w.useCallback(()=>{if(!e||!t)return;const I=++_.current,A=new AbortController,E=window.setTimeout(()=>A.abort(),g1);(async()=>{try{const z=await y1(t,e,n,A.signal);if(I!==_.current)return;L(Array.isArray(z.rounds)?z.rounds:[])}catch{}finally{window.clearTimeout(E)}})()},[e,t,n,L]);w.useEffect(()=>{if(!e||!t){f(!1),m(""),S([]);return}const I=++R.current;f(!0),m(""),S([]),v(null);const A=new AbortController,E=window.setTimeout(()=>A.abort(),g1);return(async()=>{try{const z=await y1(t,e,n,A.signal);if(I!==R.current)return;L(Array.isArray(z.rounds)?z.rounds:[])}catch(z){if(I!==R.current)return;const U=(z==null?void 0:z.name)==="AbortError"?"requestTimeout":z.message||String(z);m(U)}finally{window.clearTimeout(E),I===R.current&&f(!1)}})(),()=>{A.abort(),R.current++,_.current++}},[e,t,n,L]),w.useEffect(()=>{r&&B()},[r,B]),w.useEffect(()=>{clearInterval(k.current);const I=b.length>0?b[b.length-1]:null;return(r==="running"&&b.length===0||!!(I&&I.status==="running"))&&e&&t&&(k.current=setInterval(()=>B(),2e3)),()=>clearInterval(k.current)},[b,e,t,n,r,B]),w.useEffect(()=>{j.current&&(j.current.scrollTop=0)},[g]);const F=b.find(I=>I.execId===g),$=s?void 0:{width:`${c}px`};return l.jsxs("aside",{className:"af-run-ctx-panel",style:$,"aria-label":o("flow:runContext.title"),children:[s?null:l.jsx("div",{className:"af-run-ctx-resize",role:"separator","aria-orientation":"vertical","aria-label":o("flow:runContext.resizeHandle"),onPointerDown:H,onPointerMove:P,onPointerUp:T,onPointerCancel:T,onLostPointerCapture:V}),l.jsxs("div",{className:"af-run-ctx-panel__main",children:[l.jsxs("div",{className:"af-run-ctx-head",children:[l.jsx("h2",{className:"af-run-ctx-title",title:e,children:e}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:i,"aria-label":o("common:common.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),d&&l.jsx("div",{className:"af-run-ctx-placeholder",children:o("common:common.loading")}),h&&l.jsx("div",{className:"af-run-ctx-error",children:M6(o,h)}),!d&&!h&&b.length===0&&l.jsx("div",{className:"af-run-ctx-placeholder",children:o(r==="running"?"flow:runContext.executingNoArtifacts":"flow:runContext.noData")}),b.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-run-ctx-rounds af-run-ctx-rounds--select af-run-ctx-round--"+$6((F==null?void 0:F.status)||""),children:[l.jsx("span",{className:"af-run-ctx-round-dot","aria-hidden":!0}),l.jsx("select",{className:"af-run-ctx-round-select",value:String(g??""),onChange:I=>{const A=I.target.value;v(A==="latest"?"latest":Number(A))},children:[...b].reverse().map(I=>{const A=I.execId==="latest"?o("flow:runContext.latest"):`#${I.execId}`,E=z6(o,I.status),z=I.finishedAt?` · ${F6(I.finishedAt)}`:"";return l.jsx("option",{value:String(I.execId),children:`${A} · ${E}${z}`},I.execId)})})]}),F&&l.jsxs("div",{className:"af-run-ctx-body",ref:j,children:[F.inputs&&F.inputs.length>0&&l.jsxs("section",{className:"af-run-ctx-section",children:[l.jsxs("h3",{className:"af-run-ctx-section-title",children:[l.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"input"}),"Inputs"]}),F.inputs.map((I,A)=>l.jsxs("div",{className:"af-run-ctx-output-slot",children:[l.jsx("div",{className:"af-run-ctx-slot-head",children:l.jsx("div",{className:"af-run-ctx-slot-name",children:I.slot})}),l.jsx("pre",{className:"af-run-ctx-slot-text",children:I.value})]},`${I.slot}-${A}`))]}),F.prompt!=null&&l.jsxs("section",{className:"af-run-ctx-section",children:[l.jsxs("h3",{className:"af-run-ctx-section-title",children:[l.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"description"}),"Prompt",l.jsx("button",{type:"button",className:"af-icon-btn af-run-ctx-section-expand",onClick:()=>N("prompt"),title:o("flow:nodeProps.expand"),children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),l.jsx(d1,{text:F.prompt})]}),F.outputs&&F.outputs.length>0&&l.jsxs("section",{className:"af-run-ctx-section",children:[l.jsxs("h3",{className:"af-run-ctx-section-title",children:[l.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"output"}),"Outputs",l.jsx("button",{type:"button",className:"af-icon-btn af-run-ctx-section-expand",onClick:()=>N("output"),title:o("flow:nodeProps.expand"),children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),F.outputs.map((I,A)=>{const E=p1(I),z=h1(I);return l.jsxs("div",{className:"af-run-ctx-output-slot",children:[l.jsxs("div",{className:"af-run-ctx-slot-head",children:[l.jsx("div",{className:"af-run-ctx-slot-name",children:I.slot}),E?l.jsx("span",{className:"af-run-ctx-format-badge",title:o("flow:runContext.detectedContentType"),children:E}):null,l.jsx(m1,{text:z,title:o("common:common.copy"),copiedLabel:o("common:common.copied")})]}),l.jsx(f1,{o:I})]},`${I.slot}-${A}`)})]}),!F.prompt&&(!F.outputs||F.outputs.length===0)&&l.jsx("div",{className:"af-run-ctx-placeholder",children:o("flow:runContext.roundNoContent")})]})]})]}),y&&F&&l.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true",onClick:I=>{I.target===I.currentTarget&&N(null)},children:l.jsxs("div",{className:"af-node-props-expand-panel",children:[l.jsxs("div",{className:"af-node-props-expand-head",children:[l.jsx("span",{className:"af-node-props-expand-title",children:y==="prompt"?"Prompt":"Outputs"}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>N(null),"aria-label":o("common:common.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-node-props-expand-body af-run-ctx-expand-body",children:[y==="prompt"&&F.prompt!=null&&l.jsx(d1,{text:F.prompt}),y==="output"&&F.outputs&&F.outputs.map((I,A)=>{const E=p1(I),z=h1(I);return l.jsxs("div",{className:"af-run-ctx-output-slot",style:{marginBottom:"1rem"},children:[l.jsxs("div",{className:"af-run-ctx-slot-head",children:[l.jsx("div",{className:"af-run-ctx-slot-name",children:I.slot}),E?l.jsx("span",{className:"af-run-ctx-format-badge",children:E}):null,l.jsx(m1,{text:z,title:o("common:common.copy"),copiedLabel:o("common:common.copied")})]}),l.jsx(f1,{o:I})]},`${I.slot}-${A}`)})]})]})})]})}function F6(e){try{const t=new Date(e);if(isNaN(t.getTime()))return e;const n=r=>String(r).padStart(2,"0");return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}catch{return e}}function $6(e){const t=String(e||"").toLowerCase();return t==="success"||t==="completed"||t==="done"?"success":t==="failed"||t==="error"?"failed":t==="running"||t==="executing"?"running":t==="cache_not_met"?"cache":t?"unknown":"pending"}function z6(e,t){const n=String(t||"").toLowerCase();return n?n==="success"||n==="completed"||n==="done"?e("flow:runContext.statusSuccess",{defaultValue:"成功"}):n==="failed"||n==="error"?e("flow:runContext.statusFailed",{defaultValue:"失败"}):n==="running"||n==="executing"?e("flow:runContext.statusRunning",{defaultValue:"运行中"}):n==="cache_not_met"?e("flow:runContext.statusCacheMiss",{defaultValue:"缓存失效"}):t:e("flow:runContext.statusPending",{defaultValue:"等待"})}function B6({flowId:e,flowSource:t,flowArchived:n,provideNodes:r,edges:i,nodes:o,onCliInputsChange:s,onBackToEdit:a}){const{t:c}=st(),[u,p]=w.useState({}),[d,f]=w.useState(null),[h,m]=w.useState({}),[b,S]=w.useState(!0),[g,v]=w.useState(!1),[y,N]=w.useState(""),[j,k]=w.useState(!1),[_,R]=w.useState(null),M=w.useRef(null),H=w.useRef(!0),P=w.useRef({});w.useMemo(()=>{var E,z,U;const A={};for(const O of r){const q=(U=(z=(E=O.data)==null?void 0:E.outputs)==null?void 0:z[0])==null?void 0:U.default;q!=null&&q!==""&&(A[O.id]=String(q))}return P.current=A,A},[r]);const T=w.useMemo(()=>{var E;const A={};for(const z of o){if(!((E=z.data)!=null&&E.inputs))continue;const U=z.data.inputs;for(let O=0;O<U.length;O++){const q=U[O];if(!(q!=null&&q.name))continue;const Z=i.find(ae=>ae.target===z.id&&ae.targetHandle===`input-${O}`);if(!(Z!=null&&Z.source))continue;r.find(ae=>ae.id===Z.source)&&(A[Z.source]=q.name)}}return A},[o,i,r]);w.useEffect(()=>(H.current=!0,()=>{H.current=!1}),[]),w.useEffect(()=>{if(!e){S(!1);return}S(!0);const A=new URLSearchParams({flowId:e,flowSource:t||"user"});n&&A.set("archived","1"),fetch(`/api/flow/run-config?${A.toString()}`).then(E=>{if(!E.ok)throw new Error(`HTTP ${E.status}`);return E.json()}).then(E=>{var U;if(!H.current)return;p(E.presets||{}),f(E.activePreset||null);const z=E.activePreset&&((U=E.presets)!=null&&U[E.activePreset])?E.presets[E.activePreset]:{};m({...P.current,...z}),S(!1)}).catch(()=>{H.current&&(m(P.current),S(!1))})},[e,t,n]),w.useEffect(()=>{var E;if(!s)return;const A={};for(const[z,U]of Object.entries(h)){const O=T[z];if(!O)continue;const q=r.find(te=>te.id===z);if(!q)continue;(((E=q.data)==null?void 0:E.definitionId)||"").startsWith("provide_file")?A[O]={type:"file",path:U}:A[O]={type:"str",value:U}}s(A)},[h,T,r,s]);const V=w.useCallback((A,E)=>{m(z=>({...z,[A]:E}))},[]),L=w.useCallback(A=>{A!==d&&(f(A),A&&u[A]?m({...P.current,...u[A]}):m(P.current))},[d,u]),B=w.useCallback(async()=>{if(y.trim()){v(!0);try{const A={...u,[y.trim()]:h},E={flowId:e,flowSource:t,archived:n,presets:A,activePreset:y.trim()};(await fetch("/api/flow/run-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)})).ok&&(p(A),f(y.trim()),N(""),k(!1))}finally{v(!1)}}},[e,t,n,u,h,y]),F=w.useCallback(async()=>{if(d){v(!0);try{const A={...u};delete A[d];const E=Object.keys(A)[0]||null;(await fetch("/api/flow/run-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:e,flowSource:t,archived:n,presets:A,activePreset:E})})).ok&&(p(A),f(E),E&&A[E]?m({...P.current,...A[E]}):m(P.current))}finally{v(!1)}}},[e,t,n,u,d]),$=w.useCallback(async()=>{if(d){v(!0);try{const A={...u,[d]:h};(await fetch("/api/flow/run-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:e,flowSource:t,archived:n,presets:A,activePreset:d})})).ok&&p(A)}finally{v(!1)}}},[e,t,n,u,d,h]),I=Object.keys(u);return I.length>0,b?l.jsx("aside",{className:"af-run-config-panel",children:l.jsx("div",{className:"af-run-config-loading",children:c("common.loading")})}):l.jsxs("aside",{className:"af-run-config-panel",children:[l.jsxs("div",{className:"af-run-config-preset",children:[l.jsx("label",{className:"af-run-config-preset-label",children:c("flow:runConfig.preset")}),l.jsxs("div",{className:"af-run-config-preset-row",children:[l.jsxs("select",{className:"af-run-config-preset-select",value:d||"",onChange:A=>L(A.target.value||null),disabled:g,children:[l.jsx("option",{value:"",children:c("flow:runConfig.default")}),I.map(A=>l.jsx("option",{value:A,children:A},A))]}),l.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--new",onClick:()=>k(!0),disabled:g,title:c("flow:runConfig.newPreset"),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"add"})}),d&&l.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--save",onClick:$,disabled:g,title:c("flow:runConfig.savePreset"),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"save"})}),d&&l.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--delete",onClick:F,disabled:g,title:c("flow:runConfig.deletePreset"),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"delete"})})]})]}),j&&l.jsxs("div",{className:"af-run-config-save-dialog",children:[l.jsx("input",{type:"text",className:"af-run-config-save-input",placeholder:c("flow:runConfig.presetNamePlaceholder"),value:y,onChange:A=>N(A.target.value),disabled:g}),l.jsxs("div",{className:"af-run-config-save-actions",children:[l.jsx("button",{type:"button",className:"af-btn-primary",onClick:B,disabled:g||!y.trim(),children:c(g?"common.saving":"common.save")}),l.jsx("button",{type:"button",className:"af-btn-outline",onClick:()=>{k(!1),N("")},disabled:g,children:c("common.cancel")})]})]}),l.jsxs("div",{className:"af-run-config-inputs",children:[l.jsx("div",{className:"af-run-config-inputs-header",children:c("flow:runConfig.inputParams")}),r.length===0?l.jsx("div",{className:"af-run-config-empty",children:c("flow:runConfig.noProvideNodes")}):l.jsx("div",{className:"af-run-config-input-list",children:r.map(A=>{var Z,te;const z=(((Z=A.data)==null?void 0:Z.definitionId)||"").startsWith("provide_file"),U=((te=A.data)==null?void 0:te.label)||A.id,O=A.id,q=h[O]||"";return l.jsxs("div",{className:"af-run-config-input-item",children:[l.jsxs("div",{className:"af-run-config-input-head",children:[l.jsx("span",{className:"af-run-config-input-icon material-symbols-outlined"+(z?" af-run-config-input-icon--file":""),"aria-hidden":!0,children:z?"description":"text_fields"}),l.jsx("span",{className:"af-run-config-input-label",children:U}),l.jsx("button",{type:"button",className:"af-run-config-input-expand",onClick:()=>R({instanceId:O,label:U,content:q}),"aria-label":c("flow:runConfig.expandInput"),title:c("flow:runConfig.expandInput"),children:l.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),l.jsx("div",{className:"af-run-config-input-id",children:O}),l.jsx("input",{type:"text",className:"af-run-config-input-field",value:q,onChange:ae=>V(O,ae.target.value),placeholder:c(z?"flow:runConfig.filePathPlaceholder":"flow:runConfig.stringValuePlaceholder")})]},O)})})]}),_&&ui.createPortal(l.jsx("div",{className:"af-provide-edit-overlay",children:l.jsxs("div",{className:"af-provide-edit-modal",role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"af-provide-edit-modal__head",children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit_document"}),l.jsx("span",{className:"af-provide-edit-modal__title",children:_.label}),l.jsx("button",{type:"button",className:"af-provide-edit-modal__close",onClick:()=>R(null),"aria-label":c("common:close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx("div",{className:"af-provide-edit-modal__body",children:l.jsx("textarea",{ref:M,className:"af-provide-edit-modal__textarea",defaultValue:_.content,autoFocus:!0})}),l.jsxs("div",{className:"af-provide-edit-modal__foot",children:[l.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn af-provide-edit-modal__btn--save",onClick:()=>{!_||!M.current||(V(_.instanceId,M.current.value),R(null))},children:[l.jsx("span",{className:"material-symbols-outlined",children:"save"}),c("flow:provideEdit.save")]}),l.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn",onClick:()=>R(null),children:[l.jsx("span",{className:"material-symbols-outlined",children:"close"}),c("flow:provideEdit.cancel")]})]})]})}),document.body)]})}const gP={ai:["planner-system","planner-user","planner-response","agent-step-prompt","repair-prompt","ai-thinking","ai-assistant","ai-result","ai-tool"],flow:["composer-start","classify","plan","phase-plan","phase-complete","phase-auto-continue","composer-done"],step:["step-start","step-progress","step-done","validation"],output:["natural","status"],error:["error"]},H6={"planner-system":"#9ecaff","planner-user":"#9ecaff","planner-response":"#7c4dff","agent-step-prompt":"#7c4dff","repair-prompt":"#ff6b6b","ai-thinking":"#a8b9d4","ai-assistant":"#e8deff","ai-result":"#00e475","ai-tool":"#9ecaff","composer-start":"#00e475","composer-done":"#00e475","step-start":"#e8deff","step-done":"#e8deff","step-progress":"#e8deff",natural:"#a8a8a8",status:"#a8a8a8",error:"#ff6b6b","phase-plan":"#00e475","phase-complete":"#00e475"};function U6(e){return!e||e<1024?`${e||0} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function V6(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?e:`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`}function W6(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?e:`${t.getMonth()+1}/${t.getDate()} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function x1(e,t){if(e==="natural"&&t&&typeof t=="object"){const n=t.kind;if(n==="thinking"||n==="assistant"||n==="result"||n==="tool")return"ai";if(n==="error")return"error"}for(const[n,r]of Object.entries(gP))if(r.includes(e))return n;return"other"}function K6({event:e,defaultExpanded:t}){const[n,r]=w.useState(!!t),i=H6[e.tag]||"#a8a8a8",o=e.payload,s=o&&typeof o=="object",a=s?typeof o.text=="string"?o.text:"":String(o||""),c=s?o.meta:null,u=w.useMemo(()=>a?a.slice(0,140).replace(/\s+/g," "):s?Object.keys(o).filter(h=>h!=="text"&&h!=="meta").slice(0,3).map(h=>{const m=o[h];return m==null?`${h}:null`:typeof m=="object"?`${h}:{…}`:`${h}:${String(m).slice(0,30)}`}).join(" "):"",[o,a,s]),p=w.useCallback(d=>{d.stopPropagation();const f=s?JSON.stringify(o,null,2):String(o);try{navigator.clipboard.writeText(f)}catch{}},[o,s]);return l.jsxs("div",{style:{borderLeft:`3px solid ${i}`,background:n?"#1c1b1b":"#131313",marginBottom:4,borderRadius:4,cursor:"pointer",transition:"background 120ms"},onClick:()=>r(d=>!d),children:[l.jsxs("div",{style:{padding:"6px 10px",display:"flex",alignItems:"center",gap:10,fontSize:12},children:[l.jsx("span",{style:{color:"#9a9a9a",fontFamily:"monospace",flexShrink:0},children:V6(e.ts)}),l.jsx("span",{style:{color:i,fontWeight:600,fontFamily:"monospace",flexShrink:0,padding:"1px 6px",background:"rgba(255,255,255,0.04)",borderRadius:3},children:e.tag}),l.jsx("span",{style:{color:"#c5c2c1",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"monospace"},children:u}),n&&l.jsx("button",{type:"button",onClick:p,style:{background:"rgba(124,77,255,0.15)",color:"#e8deff",border:"none",borderRadius:3,padding:"2px 8px",fontSize:11,cursor:"pointer"},children:"Copy"})]}),n&&l.jsxs("div",{style:{padding:"0 10px 10px 10px",borderTop:"1px solid rgba(255,255,255,0.04)"},children:[c&&Object.keys(c).length>0&&l.jsx("div",{style:{marginTop:8,padding:8,background:"#0e0e0e",borderRadius:4,fontSize:11,fontFamily:"monospace",color:"#9ecaff",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:JSON.stringify(c,null,2)}),a?l.jsx("pre",{style:{marginTop:8,padding:10,background:"#0e0e0e",borderRadius:4,fontSize:12,color:"#e5e2e1",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:600,overflowY:"auto",margin:"8px 0 0 0",fontFamily:"ui-monospace, SF Mono, Menlo, monospace"},children:a}):s?l.jsx("pre",{style:{marginTop:8,padding:10,background:"#0e0e0e",borderRadius:4,fontSize:12,color:"#e5e2e1",whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:400,overflowY:"auto",margin:"8px 0 0 0",fontFamily:"ui-monospace, SF Mono, Menlo, monospace"},children:JSON.stringify(o,null,2)}):null]})]})}function Y6({open:e,onClose:t,flowId:n}){var R;const[r,i]=w.useState([]),[o,s]=w.useState(!1),[a,c]=w.useState(null),[u,p]=w.useState(null),[d,f]=w.useState(!1),[h,m]=w.useState(!0),[b,S]=w.useState({ai:!0,flow:!0,step:!0,output:!0,error:!0}),[g,v]=w.useState(""),y=w.useRef(null),N=w.useCallback(async()=>{s(!0);try{const M=h&&n?`?flowId=${encodeURIComponent(n)}`:"",P=await(await fetch(`/api/composer-logs${M}`)).json();i(Array.isArray(P.sessions)?P.sessions:[])}catch{i([])}finally{s(!1)}},[n,h]),j=w.useCallback(async M=>{if(!M){p(null);return}f(!0);try{const P=await(await fetch(`/api/composer-logs/${encodeURIComponent(M)}`)).json();p(P)}catch{p(null)}finally{f(!1)}},[]);w.useEffect(()=>{e&&N()},[e,N]),w.useEffect(()=>{if(!(!e||!a))return j(a),y.current=setInterval(()=>j(a),2e3),()=>{y.current&&clearInterval(y.current),y.current=null}},[e,a,j]);const k=w.useMemo(()=>{const M=(u==null?void 0:u.events)||[],H=g.trim().toLowerCase();return M.filter(P=>{const T=x1(P.tag,P.payload);return!b[T]&&T!=="other"?!1:H?[P.tag,JSON.stringify(P.payload||"")].join(" ").toLowerCase().includes(H):!0})},[u,b,g]),_=w.useMemo(()=>{const M=(u==null?void 0:u.events)||[],H={};for(const P of M){const T=x1(P.tag,P.payload);H[T]=(H[T]||0)+1}return H},[u]);return e?l.jsxs("div",{style:{position:"fixed",top:0,right:0,bottom:0,width:"min(1100px, 80vw)",background:"#131313",borderLeft:"1px solid rgba(255,255,255,0.08)",display:"flex",flexDirection:"column",zIndex:9999,boxShadow:"-8px 0 32px rgba(0,0,0,0.5)",color:"#e5e2e1",fontFamily:"Inter, system-ui, sans-serif"},children:[l.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:12,flexShrink:0,background:"#1c1b1b"},children:[l.jsx("span",{style:{fontWeight:600,fontSize:14},children:"Composer Logs"}),l.jsx("span",{style:{fontSize:11,color:"#9a9a9a"},children:n?`flowId: ${n}`:"no flow selected"}),l.jsxs("label",{style:{fontSize:11,color:"#9a9a9a",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[l.jsx("input",{type:"checkbox",checked:h,onChange:M=>m(M.target.checked),disabled:!n}),"仅显示当前 flow"]}),l.jsx("button",{type:"button",onClick:N,style:{background:"rgba(124,77,255,0.15)",color:"#e8deff",border:"none",borderRadius:4,padding:"4px 10px",fontSize:12,cursor:"pointer"},children:"Refresh"}),l.jsx("span",{style:{flex:1}}),l.jsx("button",{type:"button",onClick:t,style:{background:"transparent",color:"#e5e2e1",border:"1px solid rgba(255,255,255,0.12)",borderRadius:4,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"Close"})]}),l.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden",minHeight:0},children:[l.jsxs("div",{style:{width:280,borderRight:"1px solid rgba(255,255,255,0.06)",overflowY:"auto",background:"#0e0e0e",flexShrink:0},children:[o&&l.jsx("div",{style:{padding:12,fontSize:12,color:"#9a9a9a"},children:"Loading…"}),!o&&r.length===0&&l.jsx("div",{style:{padding:12,fontSize:12,color:"#9a9a9a"},children:h&&n?"no sessions for this flow":"no sessions"}),r.map(M=>{const H=a===M.sessionId;return l.jsxs("div",{onClick:()=>c(M.sessionId),style:{padding:"10px 12px",borderBottom:"1px solid rgba(255,255,255,0.04)",cursor:"pointer",background:H?"rgba(124,77,255,0.18)":"transparent",borderLeft:H?"3px solid #7c4dff":"3px solid transparent"},children:[l.jsx("div",{style:{fontSize:12,fontWeight:600,color:"#e5e2e1"},children:W6(M.mtime)}),l.jsx("div",{style:{fontSize:11,color:"#9ecaff",marginTop:2,fontFamily:"monospace"},children:M.flowId||"(no flow)"}),M.promptPreview&&l.jsx("div",{style:{fontSize:11,color:"#9a9a9a",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:M.promptPreview}),l.jsxs("div",{style:{fontSize:10,color:"#6a6a6a",marginTop:4},children:[U6(M.size)," · ",M.model||"default"]})]},M.sessionId)})]}),l.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[l.jsxs("div",{style:{padding:"10px 16px",borderBottom:"1px solid rgba(255,255,255,0.06)",display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",flexShrink:0,background:"#1c1b1b"},children:[Object.keys(gP).map(M=>l.jsxs("button",{type:"button",onClick:()=>S(H=>({...H,[M]:!H[M]})),style:{background:b[M]?"rgba(124,77,255,0.25)":"transparent",color:b[M]?"#e8deff":"#6a6a6a",border:`1px solid ${b[M]?"rgba(124,77,255,0.4)":"rgba(255,255,255,0.08)"}`,borderRadius:999,padding:"3px 12px",fontSize:11,cursor:"pointer",fontFamily:"monospace",textTransform:"uppercase"},children:[M," ",_[M]!=null?`(${_[M]})`:""]},M)),l.jsx("input",{type:"text",placeholder:"search…",value:g,onChange:M=>v(M.target.value),style:{marginLeft:8,flex:1,minWidth:120,background:"#0e0e0e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:4,color:"#e5e2e1",padding:"4px 8px",fontSize:12}})]}),l.jsxs("div",{style:{flex:1,overflowY:"auto",padding:12,minHeight:0},children:[!a&&l.jsx("div",{style:{color:"#9a9a9a",fontSize:12,padding:20,textAlign:"center"},children:"Select a session on the left to view events"}),d&&!u&&l.jsx("div",{style:{color:"#9a9a9a",fontSize:12,padding:20},children:"Loading…"}),u&&k.length===0&&l.jsxs("div",{style:{color:"#9a9a9a",fontSize:12,padding:20},children:["No events match current filter (",((R=u.events)==null?void 0:R.length)||0," total)"]}),k.map((M,H)=>l.jsx(K6,{event:M,defaultExpanded:M.tag==="error"},`${M.ts}_${H}`))]})]})]})]}):null}const q6="0.1.27";function w1(e){const t=Math.max(0,Number(e)||0),n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function cm(e,t){return t==="running"?w1(e):e==null||!Number.isFinite(e)||e<=0?"--":w1(e)}const yP=w.createContext({modelLists:{cursor:[],opencode:[]},onModelChange:()=>{}});function G6(e){const{setNodes:t}=Qc(),{modelLists:n,onModelChange:r}=w.useContext(yP),i=w.useCallback(s=>{t(a=>a.filter(c=>c.id!==s))},[t]),o=w.useCallback(()=>{var u,p,d,f,h,m,b,S;const s=((u=e.data)==null?void 0:u.definitionId)||"",a=((p=e.data)==null?void 0:p.label)||e.id,c=((h=(f=(d=e.data)==null?void 0:d.outputs)==null?void 0:f[0])==null?void 0:h.value)||((S=(b=(m=e.data)==null?void 0:m.outputs)==null?void 0:b[0])==null?void 0:S.default)||"";window.__provideEditContent={instanceId:e.id,label:a,definitionId:s,content:c},window.dispatchEvent(new CustomEvent("provide-expand"))},[e.id,e.data]);return l.jsx(E4,{...e,deleteNode:i,onProvideExpand:o,modelLists:n,onModelChange:r})}const X6={[Vg]:G6},xd=["CONTROL","TOOL","PROVIDE","AGENT"],Q6=1200,v1="af-flow-node--sync-flash",b1="af-flow-edge--sync-flash";function S1(e,t){const n=String(e||"").trim();return n?n.split(/\s+/).includes(t)?n:`${n} ${t}`:t}function k1(e,t){const n=String(e||"").trim();return n?n.split(/\s+/).filter(r=>r&&r!==t).join(" "):""}function xP(e){const t=((e==null?void 0:e.id)??"").trim();return/^control/i.test(t)?"CONTROL":/^tool/i.test(t)?"TOOL":/^provide/i.test(t)?"PROVIDE":"AGENT"}function N1(e){const t=xP(e);return t==="CONTROL"?"control":t==="PROVIDE"?"provide":t==="TOOL"?"tool":"agent"}function wd(e){return(Array.isArray(e)?e:[]).map(n=>{const r=String((n==null?void 0:n.name)||(n==null?void 0:n.id)||"").trim(),i=String((n==null?void 0:n.type)||"").trim();return!r&&!i?"":i?`${r||"-"}: ${i}`:r}).filter(Boolean)}function J6(e){return e==="CONTROL"?"account_tree":e==="TOOL"?"build":e==="PROVIDE"?"database":"smart_toy"}function Z6(e,t){return t?[e==null?void 0:e.id,e==null?void 0:e.label,e==null?void 0:e.description].filter(Boolean).some(r=>String(r).toLowerCase().includes(t)):!0}function C1(e){if(!e)return"";const t=e.lastIndexOf("/");if(t===-1)return e;const n=e.slice(0,t),r=n.indexOf("/.agentflow/");return r!==-1&&n.slice(0,r)||n}const e9=/@([a-zA-Z_][a-zA-Z0-9_]*)/g;function t9(e){const t=new Set,n=[];let r;const i=new RegExp(e9.source,"g");for(;(r=i.exec(e))!==null;){const o=r[1];t.has(o)||(t.add(o),n.push(o))}return n}function E1(e,t){const n=e.slice(0,t),r=n.lastIndexOf("@");if(r<0)return null;const i=n.slice(r+1);return/[\s\n]/.test(i)?null:{atIndex:r,query:i}}function si(e){const t=String(e||"").indexOf(" - ");return t>=0?e.slice(0,t).trim():String(e||"").trim()}function vd(e,t,n,r){const i=(e||"").trim();if(!i)return"";if(i.startsWith("opencode:")||i.startsWith("claude-code:"))return i;const o=Array.isArray(t)?t:[],s=Array.isArray(n)?n:[],a=Array.isArray(r)?r:[],c=o.map(si),u=s.map(si);return a.map(si).includes(i)&&!c.includes(i)&&!u.includes(i)?`claude-code:${i}`:u.includes(i)&&!c.includes(i)?`opencode:${i}`:i}function n9(e){if(e==null)return"";const t=String(e).trim();return t?t.length<=26?t:`${t.slice(0,12)}…${t.slice(-10)}`:""}function um(e){if(!Array.isArray(e)||e.length===0)return 0;let t=0;for(const n of e){const r=/^(?:对话|Conversation|Chat)\s*(\d+)\s*$/.exec(String((n==null?void 0:n.label)??"").trim());r&&(t=Math.max(t,parseInt(r[1],10)))}return t}function r9({steps:e}){const{t}=st();return!e||e.length===0?null:l.jsx("div",{className:"af-composer-steps-track",role:"list","aria-label":t("flow:composer.stepsAriaLabel"),children:e.map(n=>{const r=String(n.description||n.type||"").trim(),i=n.model||n.executorModel,o=[`${n.index+1}. ${r||"—"}`,n.nodeRole?t("flow:composer.stepRoleLabel",{role:n.nodeRole}):"",n.instanceId?t("flow:composer.stepInstanceLabel",{instanceId:n.instanceId}):"",i?`${t("flow:palette.model")}:${i}`:""].filter(Boolean).join(`
122
+ `),s=n.status||"pending";return l.jsxs("div",{className:"af-composer-step-chip"+(s==="done"?" af-composer-step-chip--done":"")+(s==="running"?" af-composer-step-chip--running":"")+(s==="error"?" af-composer-step-chip--error":"")+(s==="pending"?" af-composer-step-chip--pending":""),role:"listitem",title:o,children:[l.jsx("span",{className:"af-composer-step-chip-idx",children:n.index+1}),l.jsx("span",{className:"af-composer-step-chip-main",children:n.nodeRole||i?l.jsxs("span",{className:"af-composer-step-chip-meta",children:[n.nodeRole?l.jsx("span",{className:"af-composer-step-chip-role",children:n.nodeRole}):null,i?l.jsx("span",{className:"af-composer-step-chip-model",children:n9(i)}):null]}):null})]},n.index)})})}function i9(e,t){const n=e.trim(),r=t.trim();return r?n?!!(n===r||n.endsWith(r)||r.length>=8&&n.includes(r)):!1:!0}function o9(e){const t=[];for(const n of e){if(!n||typeof n.text!="string"||!n.text.trim())continue;const i=typeof n.kind=="string"&&n.kind?n.kind:"assistant",o=t[t.length-1];o&&o.kind===i?o.text+=i==="error"||i==="result"?`
123
+ ${n.text}`:n.text:t.push({kind:i,text:n.text})}return t}function s9(e,t){return e==="thinking"?t("flow:composer.thinking"):e==="result"?t("flow:composer.result"):e==="assistant"?t("flow:composer.reply"):e==="error"?t("flow:composer.error"):String(e)}function a9(e){return e==="thinking"?"af-composer-ai-block af-composer-ai-block--thinking":e==="result"?"af-composer-ai-block af-composer-ai-block--result":e==="assistant"?"af-composer-ai-block af-composer-ai-block--reply":e==="error"?"af-composer-ai-block af-composer-ai-block--error":"af-composer-ai-block af-composer-ai-block--reply"}function j1({thread:e,liveSegments:t,running:n,className:r="",autoScroll:i=!0}){const{t:o}=st(),s=w.useRef(null),a=["af-composer-ai-stack","af-composer-ai-stack--in-panel","af-composer-thread-stack",r].filter(Boolean).join(" ");return w.useEffect(()=>{if(!i||!s.current)return;const c=s.current;requestAnimationFrame(()=>{c.scrollTop=c.scrollHeight})},[e,t,i]),l.jsxs("div",{ref:s,className:a,children:[e.map((c,u)=>c.type==="user"?l.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--user-msg",children:[l.jsx("div",{className:"af-composer-ai-block-label",children:o("flow:composer.yourQuestion")}),l.jsx("div",{className:"af-composer-ai-block-body",children:c.text})]},`composer-u-${u}-${c.text.slice(0,48)}`):l.jsx("div",{className:"af-composer-thread-assistant",children:l.jsx(P1,{segments:c.segments,running:!1})},`composer-a-${u}`)),l.jsx("div",{className:"af-composer-thread-assistant",children:l.jsx(P1,{segments:t,running:n})})]})}function P1({segments:e,running:t=!1}){const{t:n}=st(),r=e.filter(d=>d.kind==="assistant").map(d=>d.text).join(""),i=e.filter(d=>d.kind==="result").map(d=>d.text).join(""),o=i9(r,i),s=e.filter(d=>d.kind==="error").map(d=>d.text).join(`
124
+ `),a=e.filter(d=>d.kind!=="error"),c=o?a.filter(d=>d.kind!=="result"):a,u=o9(c),p=!!(u.length>0||s);return l.jsxs(l.Fragment,{children:[u.map((d,f)=>l.jsxs("section",{className:a9(d.kind),children:[l.jsx("div",{className:"af-composer-ai-block-label",children:s9(d.kind,n)}),l.jsx("div",{className:"af-composer-ai-block-body",children:d.text})]},`${d.kind}-${f}`)),t&&!p?l.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--reply af-composer-ai-block--pending",children:[l.jsx("div",{className:"af-composer-ai-block-label",children:n("flow:composer.reply")}),l.jsx("div",{className:"af-composer-ai-block-body",children:n("flow:composer.waiting")})]}):null,s?l.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--error",children:[l.jsx("div",{className:"af-composer-ai-block-label",children:n("flow:composer.error")}),l.jsx("div",{className:"af-composer-ai-block-body",children:s})]}):null]})}function l9({fitViewEpoch:e}){const{fitView:t}=Qc(),n=w.useRef(t);return n.current=t,w.useEffect(()=>{if(e>0){const r=requestAnimationFrame(()=>n.current({padding:.2,duration:200}));return()=>cancelAnimationFrame(r)}},[e]),null}const Kd=1500,_1=500,c9=262144,u9=2e3;function dm(e){return typeof e!="string"?"":e.length<=u9?e:`[log line truncated, ${e.length} chars]`}const d9=Kd;function f9(e){const t=e.match(/^\[([^\]]+)\]\s+\[([^\]]+)\]\s+([\s\S]*)$/);if(!t)return null;const[,n,r,i]=t;if(r==="cli")try{const o=JSON.parse(i);return o&&o.event==="node-start"?{ts:n,type:"node-start",text:`节点 ${o.instanceId||""}${o.label?` · ${o.label}`:""} 开始`}:o&&o.event==="node-done"?{ts:n,type:"node-done",text:`节点 ${o.instanceId||""} 完成${o.elapsed?` (${o.elapsed})`:""}`}:o&&o.event==="node-failed"?{ts:n,type:"node-failed",text:`节点 ${o.instanceId||""} 失败${o.error?`: ${o.error}`:""}`}:o&&o.event==="apply-start"?{ts:n,type:"info",text:`[apply-start] uuid=${o.uuid||""}`}:{ts:n,type:"info",text:dm(i)}}catch{return{ts:n,type:"info",text:dm(i)}}return{ts:n,type:"log",text:dm(`[${r}] ${i}`)}}function I1(e){if(!e)return[];const t=[],n=e.split(`
125
+ `);for(let r=n.length-1;r>=0&&t.length<d9;r--){const i=n[r];if(!i)continue;const o=f9(i);o&&t.push(o)}return t.reverse(),t}function p9(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i],s=t[i];if(!s)return!1;if(o!==s&&(o.status!==s.status||(o.elapsed??null)!==(s.elapsed??null)))return!1}return!0}function h9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function m9({fitViewEpoch:e,canvasTool:t,nodes:n,edges:r,onNodesChange:i,onEdgesChange:o,onConnect:s,onNodesDelete:a,onNodeClick:c,onEdgeClick:u,onFlowInit:p,onDrop:d,onDragOver:f,hideMinimapAndControls:h,bottomSlot:m}){const{t:b}=st(),S=!i,g=S||t==="pan"?!0:[1,2],v=S?!1:t==="select",y="af-flow-canvas"+(S?" af-flow-canvas--run-mode":"")+(t==="pan"?" af-flow-canvas--tool-pan":" af-flow-canvas--tool-select"),N=w.useCallback(()=>{},[]),j=w.useMemo(()=>{const k=new Map(n.map(P=>[P.id,P])),_=new Set(n.filter(P=>P.selected).map(P=>P.id)),R=_.size>0,M=(P,T)=>{const V=/^#([0-9a-f]{6})$/i.exec(P);if(!V)return P;const L=parseInt(V[1],16);return`rgba(${L>>16&255}, ${L>>8&255}, ${L&255}, ${T})`},H="#ff5169";return r.map(P=>{var ae,ee,ue,Se;const T=k.get(P.source),V=k.get(P.target),L=/^output-(\d+)$/.exec(P.sourceHandle||""),B=/^input-(\d+)$/.exec(P.targetHandle||""),F=T&&L?(ee=(ae=T.data)==null?void 0:ae.outputs)==null?void 0:ee[parseInt(L[1],10)]:null,$=V&&B?(Se=(ue=V.data)==null?void 0:ue.inputs)==null?void 0:Se[parseInt(B[1],10)]:null,I=F!=null&&F.type?Mf(F.type):null,A=$!=null&&$.type?Mf($.type):null,E=I&&A&&I!==A,z=R&&(_.has(P.source)||_.has(P.target)),U=P.style||{};if(E){const xe=P.selected?.95:z?.85:.78,ge=M(H,xe);return{...P,className:((P.className||"")+" af-flow-edge--type-mismatch"+(z?" af-flow-edge--adjacent":"")).trim(),style:{...U,stroke:ge,strokeWidth:z?2.75:2.5,strokeDasharray:"6 4"},markerEnd:P.markerEnd&&typeof P.markerEnd=="object"?{...P.markerEnd,color:ge}:{type:to.ArrowClosed,color:ge}}}const O=I||A;if(!O)return z?{...P,className:((P.className||"")+" af-flow-edge--adjacent").trim(),style:{...U,strokeWidth:2.5}}:P;const q=z||P.selected?.7:.38,Z=M(O,q),te=z?2.5:U.strokeWidth??2;return{...P,className:((P.className||"")+(z?" af-flow-edge--adjacent":"")).trim(),style:{...U,stroke:Z,strokeWidth:te},markerEnd:P.markerEnd&&typeof P.markerEnd=="object"?{...P.markerEnd,color:Z}:{type:to.ArrowClosed,color:Z}}})},[n,r]);return l.jsxs(x$,{className:y,nodes:n,edges:j,onNodesChange:i||N,onEdgesChange:o||N,onConnect:S?void 0:s,onNodesDelete:S?void 0:a,onNodeClick:c,onEdgeClick:S?void 0:u,onInit:p,onDrop:S?void 0:d,onDragOver:S?void 0:f,nodeTypes:X6,selectionOnDrag:v,panOnDrag:g,nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S,edgesFocusable:!S,panActivationKeyCode:"Space",proOptions:{hideAttribution:!0},fitView:!1,minZoom:.1,maxZoom:4,defaultEdgeOptions:{style:{stroke:"rgba(205, 189, 255, 0.45)",strokeWidth:2}},connectionLineStyle:{stroke:"rgba(205, 189, 255, 0.65)",strokeWidth:2},children:[l.jsx(C$,{gap:20,size:1,color:"rgba(28, 27, 27, 0.9)"}),l.jsx(xa,{position:"bottom-center",className:"af-flow-bottom-unified-panel"+(h?" af-flow-bottom-unified-panel--solo":""),children:l.jsxs("div",{className:"af-flow-bottom-unified-row"+(h?" af-flow-bottom-unified-row--solo":""),children:[h?null:l.jsx("div",{className:"af-flow-bottom-unified__side af-flow-bottom-unified__side--minimap",children:l.jsx(W$,{zoomable:!0,pannable:!0,position:"bottom-left",className:"af-flow-bottom-minimap",style:{width:152,height:104},maskColor:"rgba(14, 14, 14, 0.85)",nodeColor:k=>{var R;const _=(((R=k.data)==null?void 0:R.schemaType)??"agent").toLowerCase();return _==="control"?"rgba(237, 108, 2, 0.85)":_==="provide"?"rgba(0, 228, 117, 0.35)":_==="tool"?"rgba(124, 77, 255, 0.75)":"rgba(158, 202, 255, 0.5)"}})}),l.jsx("div",{className:"af-flow-bottom-unified__center",children:m}),h?null:l.jsx("div",{className:"af-flow-bottom-unified__side af-flow-bottom-unified__side--zoom",children:l.jsx(T$,{position:"bottom-right",showInteractive:!1,className:"af-flow-bottom-controls"})})]})}),!h&&l.jsx(xa,{position:"bottom-left",className:"af-pin-legend",children:[{type:"node",color:"#ff9800"},{type:"text",color:"#2196f3"},{type:"file",color:"#4caf50"},{type:"bool",color:"#9c27b0"}].map(({type:k,color:_})=>l.jsxs("span",{className:"af-pin-legend__item",children:[l.jsx("span",{className:"af-pin-legend__dot",style:{background:_}}),l.jsx("span",{className:"af-pin-legend__label",children:k})]},k))}),l.jsx(l9,{fitViewEpoch:e}),!S&&n.length===0?l.jsxs("div",{className:"af-flow-empty-hint",children:[l.jsx("span",{className:"af-flow-empty-hint-icon material-symbols-outlined",children:"account_tree"}),l.jsx("p",{className:"af-flow-empty-hint-text",children:b("flow:emptyCanvas.composerHint")}),l.jsx("p",{className:"af-flow-empty-hint-sub",dangerouslySetInnerHTML:{__html:b("flow:emptyCanvas.composerSub")}})]}):null]})}function fm(e){const t=e.source??"user",n=e.archived?"1":"0";return`${e.id}\0${t}\0${n}`}function A1(e){if(!window.location.pathname.startsWith("/flow"))return;if(!e){window.history.replaceState({},"","/flow");return}const t=new URLSearchParams({flowId:e.id,flowSource:e.source??"user"});e.archived&&t.set("flowArchived","1"),window.history.replaceState({},"","/flow?"+t.toString())}function g9(e){return e==="builtin"?"workspace":e??"user"}function Po(e,t){return t(e==="builtin"?"flow:settings.builtin":e==="workspace"?"flow:palette.workspace":"flow:palette.userDir")}const wP="af:run-console-height",Zl=230,El={enabled:!1,cron:"",timezone:"Asia/Shanghai",preset:"",overlapPolicy:"skip",misfirePolicy:"skip",nextRunAt:null},bd={};function Yd(e){if(!Number.isFinite(e))return Zl;const t=Math.max(240,Math.floor(window.innerHeight*.88));return Math.min(Math.max(Math.round(e),96),t)}function y9(){try{const e=localStorage.getItem(wP);if(e==null)return Zl;const t=parseInt(e,10);return Number.isFinite(t)?Yd(t):Zl}catch{return Zl}}function x9(){var Iw,Aw;const{t:e}=st(),{navigate:t,path:n}=Ea(),[r,i]=w.useState([]),[o,s]=w.useState(""),[a,c]=w.useState(null),[u,p]=w.useState(0),[d,f]=w.useState(""),[h,m]=w.useState(""),[b,S]=w.useState(""),[g,v]=w.useState(""),[y,N]=w.useState(!1),[j,k]=w.useState(""),[_,R]=w.useState(!1),[M,H]=w.useState(""),[P,T]=w.useState(!1),[V,L]=w.useState(!1),[B,F]=w.useState(!1),[$,I]=w.useState(null),[A,E]=w.useState(!1),[z,U]=w.useState(!1),O=w.useRef(!1),[q,Z]=w.useState([]),[te,ae]=w.useState(""),[ee,ue]=w.useState([]),[Se,xe]=w.useState(!1),[ge,ye]=w.useState(""),[$e,qe]=w.useState(""),[Me,ft]=w.useState(null),[Ve,at]=w.useState(null),[Nn,vr]=w.useState([]),[br,Sr]=w.useState(""),[uo,Gr]=w.useState(!1),[X,se]=w.useState(!1),[ke,Ie]=w.useState({files:[]}),[He,Wt]=w.useState(!1),[Fn,cn]=w.useState(!0);w.useEffect(()=>{let x=!1;const C=()=>{fetch("/api/flows",{method:"HEAD"}).then(W=>{x||cn(W.ok)}).catch(()=>{x||cn(!1)})};C();const D=window.setInterval(C,5e3);return()=>{x=!0,window.clearInterval(D)}},[]),w.useEffect(()=>{let x=!1;return fetch("/api/dev-info").then(C=>C.json()).then(C=>{x||Op(!!(C!=null&&C.isDev))}).catch(()=>{}),()=>{x=!0}},[]);const[de,yt]=w.useState("edit"),[Nt,Ee]=w.useState([]),Kt=w.useRef(0),[$n,zn]=w.useState(new Set),[is,Zn]=w.useState({}),[os,Xr]=w.useState(null),[La,Qr]=w.useState(0),[fo,po]=w.useState(!1),[Lp,Op]=w.useState(!1),[ou,su]=w.useState(!1),[Oa,Ma]=w.useState(y9),ss=w.useRef({active:!1,pointerId:-1,startY:0,startH:Zl}),[xt,ho]=w.useState(null),[Da,as]=w.useState(null),[mo,Fa]=w.useState({}),$a=w.useRef(mo);w.useEffect(()=>{$a.current=mo},[mo]);const[za,Ni]=w.useState(!1),[Mp,ls]=w.useState(!1),[au,lu]=w.useState({}),[Jr,cs]=w.useState({}),[us,Ba]=w.useState(null),[At,go]=w.useState(El),[cu,uu]=w.useState(!1),[er,Ha]=w.useState(!1),[ds,yo]=w.useState(""),[fs,ps]=w.useState(""),[Xe,Ua]=w.useState(bd),[pt,Va]=w.useState(null),Zr=w.useRef(0),kr=w.useRef(null),xo=w.useRef(null),Wa=w.useRef(!0),wo=w.useRef(!1),[Ct,hs]=w.useState(null),[vo,bo]=w.useState(null),[tw,Ka]=w.useState(!1),[du,fu]=w.useState(""),[Dp,pu]=w.useState(!1),r_=w.useRef(null),[ei,Fp]=w.useState(null),[nw,Ya]=w.useState(!1),[ms,rw]=w.useState(null),[gs,hu]=w.useState(null),$p=w.useRef(null),[Bn,qa]=w.useState(""),[mu,Ga]=w.useState(0),[Xa,Qa]=w.useState(0),[i_,zp]=w.useState("pan"),[gu,Ja]=w.useState(!1),[Bp,iw]=w.useState(!1),Hp=w.useRef(null),Up=w.useRef(null),Za=w.useRef(null),[o_,s_]=w.useState(0),[Le,Vp]=w.useState(null),[a_,yu]=w.useState(""),[_e,l_]=w.useState({cursor:[],opencode:[],claudeCode:[]}),[So,ow]=w.useState(""),[Wp,NG]=w.useState(""),xu=w.useCallback(x=>{if(!x)return null;const C=x.id,D=x.source??"user",W=x.archived?"archived":"";return{sessionsKey:`af:composer-sessions:${C}:${D}${W?":"+W:""}`,activeKey:`af:composer-active-session:${C}:${D}${W?":"+W:""}`}},[]),sw=w.useCallback(x=>{const C=xu(x);if(!C)return{sessions:[],activeSessionId:null};try{const D=localStorage.getItem(C.sessionsKey);if(!D)return{sessions:[],activeSessionId:null};const W=JSON.parse(D);if(!Array.isArray(W))return{sessions:[],activeSessionId:null};const K=W.filter(G=>G&&typeof G.id=="string").map(G=>({...G,running:!1,statusLine:G.running?e("flow:composer.pageRefreshReset"):G.statusLine,steps:[]}));let Y=null;try{Y=localStorage.getItem(C.activeKey),Y&&!K.some(G=>G.id===Y)&&(Y=null)}catch{Y=null}return{sessions:K,activeSessionId:Y}}catch{return{sessions:[],activeSessionId:null}}},[xu]),wu=w.useCallback((x,C,D)=>{const W=xu(x);if(W)try{localStorage.setItem(W.sessionsKey,JSON.stringify(C)),D?localStorage.setItem(W.activeKey,D):localStorage.removeItem(W.activeKey)}catch{}},[xu]),ko=w.useRef(0),vu=w.useRef({sessions:[],activeSessionId:null,flowKey:null}),[Hn,Nr]=w.useState([]),[Yt,Ci]=w.useState(null),bu=w.useMemo(()=>{if(!a)return null;const x=a.id,C=a.source??"user",D=a.archived?"archived":"";return`${x}:${C}${D?":"+D:""}`},[a]),Kp=w.useRef(!1);w.useEffect(()=>{if(!bu){Nr([]),Ci(null),vu.current={sessions:[],activeSessionId:null,flowKey:null};return}const x=vu.current;if(x.flowKey===bu)return;x.flowKey=bu,Kp.current&&x.sessions.length>0&&wu(a,x.sessions,x.activeSessionId);const{sessions:C,activeSessionId:D}=sw(a);if(C.length===0){const W=`session-1-${Date.now()}`,K={id:W,label:e("flow:composer.conversationLabel",{n:1}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null};x.sessions=[K],x.activeSessionId=W,Nr([K]),Ci(W)}else{const W=C[C.length-1];if(W&&(!W.thread||W.thread.length===0))ko.current=um(C),x.sessions=C,x.activeSessionId=W.id,Nr(C),Ci(W.id);else{const Y=um(C)+1;ko.current=Y;const G=`session-${Y}-${Date.now()}`,J={id:G,label:e("flow:composer.conversationLabel",{n:Y}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null},oe=[...C,J];x.sessions=oe,x.activeSessionId=G,Nr(oe),Ci(G)}}Kp.current=!0},[bu,a,sw,wu]);const bt=w.useMemo(()=>Hn.find(x=>x.id===Yt)||null,[Hn,Yt]),Et=(bt==null?void 0:bt.running)??!1,el=(bt==null?void 0:bt.statusLine)??"",tl=(bt==null?void 0:bt.segments)??[],nl=(bt==null?void 0:bt.thread)??[],aw=(bt==null?void 0:bt.steps)??[];bt==null||bt.outputDismissed;const Ae=(bt==null?void 0:bt.phaseContext)??null,lw=w.useRef([]),[Yp,Su]=w.useState(!1),ku=w.useRef(null),cw=w.useRef(null);w.useEffect(()=>{const x=cw.current;x&&requestAnimationFrame(()=>{x.scrollTop=x.scrollHeight})},[nl,tl]);const qp=w.useRef(null),Gp=w.useRef(!1),c_=w.useRef(null),uw=w.useCallback(x=>{const C=++ko.current,D=`session-${C}-${Date.now()}`,W={id:D,label:x||e("flow:composer.conversationLabel",{n:C}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null};return Nr(K=>[...K,W]),Ci(D),D},[]);w.useEffect(()=>{!a||!Kp.current||(vu.current.sessions=Hn,vu.current.activeSessionId=Yt,wu(a,Hn,Yt))},[Hn,Yt,a,wu]),w.useEffect(()=>{ko.current=Math.max(ko.current,um(Hn))},[Hn]);const u_=w.useCallback(x=>{var C;qp.current===x&&((C=ku.current)==null||C.abort()),Nr(D=>{const W=D.filter(Y=>Y.id!==x);if(D.some((Y,G)=>Y.id===x&&D.findIndex(J=>J.id===Yt)===G)||Yt===x){const Y=W;Y.length>0?Ci(Y[Y.length-1].id):setTimeout(()=>{ko.current=0;const G=++ko.current,J=`session-${G}-${Date.now()}`,oe={id:J,label:e("flow:composer.conversationLabel",{n:G}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null};Nr(re=>[...re,oe]),Ci(J)},0)}return W})},[Yt]),un=w.useCallback(x=>{Nr(C=>{const D=C.findIndex(Y=>Y.id===Yt);if(D<0)return C;const W={...C[D]};x(W);const K=[...C];return K[D]=W,K})},[Yt]),dw=w.useCallback(x=>{un(C=>{C.running=x})},[un]),Cr=w.useCallback(x=>{un(C=>{C.statusLine=x})},[un]),Er=w.useCallback(x=>{un(C=>{typeof x=="function"?C.segments=x(C.segments):C.segments=x})},[un]),fw=w.useCallback(x=>{un(C=>{typeof x=="function"?C.thread=x(C.thread):C.thread=x})},[un]),rl=w.useCallback(x=>{un(C=>{typeof x=="function"?C.steps=x(C.steps):C.steps=x})},[un]),pw=w.useCallback(x=>{un(C=>{C.outputDismissed=x})},[un]),il=w.useCallback(x=>{un(C=>{C.phaseContext=typeof x=="function"?x(C.phaseContext):x})},[un]),hw=w.useCallback(x=>{Ci(x),Nr(C=>{const D=C.findIndex(K=>K.id===x);if(D<0||!C[D].outputDismissed)return C;const W=[...C];return W[D]={...C[D],outputDismissed:!1},W})},[]);w.useEffect(()=>{lw.current=tl},[tl]);const ti=w.useRef({}),mw=w.useRef(!1),ol=w.useRef(null),Ei=w.useRef(null),sl=w.useRef(!1),Xp=w.useRef(0),Nu=w.useRef(""),[ze,We,d_]=w$([]),[St,Ot,f_]=v$([]),Cu=w.useRef(ze),Eu=w.useRef(St),tr=w.useMemo(()=>ze.filter(x=>{var C;return(((C=x.data)==null?void 0:C.definitionId)||"").startsWith("provide_")}),[ze]),ys=w.useMemo(()=>{var C;const x={};for(const D of ze){if(!((C=D.data)!=null&&C.inputs))continue;const W=D.data.inputs;for(let K=0;K<W.length;K++){const Y=W[K];if(!(Y!=null&&Y.name))continue;const G=St.find(oe=>oe.target===D.id&&oe.targetHandle===`input-${K}`);if(!(G!=null&&G.source))continue;tr.find(oe=>oe.id===G.source)&&(x[G.source]=Y.name)}}return x},[ze,St,tr]),al=w.useMemo(()=>{if(de==="edit"||$n.size===0)return null;const x=new Set($n);for(const C of St)$n.has(C.source)&&x.add(C.target),$n.has(C.target)&&x.add(C.source);return x},[de,$n,St]),p_=w.useMemo(()=>de==="edit"?ze:ze.map(x=>{var C,D;return{...x,draggable:!1,connectable:!1,data:{...x.data,isRunMode:!0,isExecuting:$n.has(x.id),nodeStatus:((C=is[x.id])==null?void 0:C.status)??null,nodeElapsed:((D=is[x.id])==null?void 0:D.elapsed)??null,isDim:al?!al.has(x.id):!1}}}),[de,ze,$n,is,al]),h_=w.useMemo(()=>al?St.map(x=>{const C=$n.has(x.source)||$n.has(x.target),D=x.className?x.className.replace(/\s?af-flow-edge--(dim|focus)\b/g,""):"",W=C?"af-flow-edge--focus":"af-flow-edge--dim";return{...x,className:(D?D+" ":"")+W}}):St,[St,$n,al]);w.useEffect(()=>{if(!a){cs({}),Ba(null),go(El),Ua(bd),Va(null),yo(""),ps("");return}const x=new URLSearchParams({flowId:a.id,flowSource:a.source||"user"});a.archived&&x.set("archived","1"),fetch(`/api/flow/run-config?${x.toString()}`).then(C=>C.json()).then(C=>{cs(C.presets||{}),Ba(C.activePreset||null)}).catch(()=>{cs({}),Ba(null)})},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived]);const ji=w.useCallback(x=>{Zr.current+=1,go(x)},[]),ju=w.useCallback(async(x,C={})=>{if(!x)return;const D=!!C.quiet,W=!!C.force,K=Zr.current;D||(uu(!0),yo(""),ps(""));const Y=new URLSearchParams({flowId:x.id,flowSource:x.source||"user"});x.archived&&Y.set("archived","1");try{const G=await fetch(`/api/flow/schedule?${Y.toString()}`),J=await G.json().catch(()=>({}));if(!G.ok)throw new Error(J.error||`HTTP ${G.status}`);if(!W&&Zr.current!==K)return;go({...El,...J.schedule||{}}),Ua(J.state&&typeof J.state=="object"?J.state:bd),Va(J.status||null)}catch(G){if(!W&&Zr.current!==K)return;go(El),Ua(bd),Va(null),yo(String(G.message||G))}finally{uu(!1)}},[]);w.useEffect(()=>{if(!a)return;let x=!1;return(async()=>{await ju(a)})(),()=>{x=!0}},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived,ju]),w.useEffect(()=>{var D,W,K,Y;if(!us||!Jr[us]||tr.length===0)return;const x=Jr[us],C={};for(const G of tr){const J=ys[G.id];if(!J)continue;const oe=((D=G.data)==null?void 0:D.definitionId)||"",re=x[G.id]??((Y=(K=(W=G.data)==null?void 0:W.outputs)==null?void 0:K[0])==null?void 0:Y.default)??"";oe.startsWith("provide_file")?C[J]={type:"file",path:re}:C[J]={type:"str",value:re}}Object.keys(C).length>0&&Fa(C)},[us,Jr,tr,ys]);const m_=w.useCallback(()=>{if(!gs||!$p.current)return;const x=$p.current.value;We(C=>C.map(D=>{var W,K;return D.id!==gs.instanceId?D:{...D,data:{...D.data,outputs:((K=(W=D.data)==null?void 0:W.outputs)==null?void 0:K.map((Y,G)=>G===0?{...Y,default:x}:Y))||[{type:"text",name:"value",default:x}]}}})),hu(null)},[gs,We]),Pe=w.useMemo(()=>{const x=ze.filter(C=>C.selected);return x.length===1?x[0]:null},[ze]),jr=w.useMemo(()=>a?S4(ze,St,e):[],[a,ze,St,e]),g_=w.useMemo(()=>jr.map(x=>x.key).join("|"),[jr]),gw=w.useMemo(()=>jr.some(x=>String((x==null?void 0:x.level)||"warning").toLowerCase()==="error"),[jr]);w.useLayoutEffect(()=>{E(jr.length>0&&!gw)},[g_,a==null?void 0:a.id,a==null?void 0:a.source,jr.length,gw]),Za.current=Pe,w.useEffect(()=>{Cu.current=ze},[ze]),w.useEffect(()=>{Eu.current=St},[St]),w.useEffect(()=>()=>{Ei.current!=null&&(clearTimeout(Ei.current),Ei.current=null)},[]);const Qp=w.useMemo(()=>{var C;if(!Pe)return null;const x=(C=Pe.data)==null?void 0:C.definitionId;return q.find(D=>D.id===x)??null},[Pe,q]),Jp=w.useMemo(()=>{const x={CONTROL:[],TOOL:[],PROVIDE:[],AGENT:[]};for(const C of q){const D=xP(C);x[D].push(C)}for(const C of xd)x[C].sort((D,W)=>D.id.localeCompare(W.id));return x},[q]),Pu=w.useMemo(()=>{const x=te.trim().toLowerCase();if(!x)return Jp;const C={CONTROL:[],TOOL:[],PROVIDE:[],AGENT:[]};for(const D of xd)C[D]=Jp[D].filter(W=>Z6(W,x));return C},[Jp,te]),y_=w.useMemo(()=>xd.reduce((x,C)=>x+Pu[C].length,0),[Pu]),_u=w.useMemo(()=>q.filter(x=>{const C=String(x.id??""),D=String(x.source??"");return C.startsWith("marketplace:")||D==="marketplace"||D==="collection"}),[q]),yw=w.useMemo(()=>{const x=new Set;for(const C of _u){const D=String(C.id??"");if(D&&(x.add(D),D.startsWith("marketplace:"))){const W=D.slice(12),[K]=W.split("@");K&&x.add(`marketplace:${K}`)}}return x},[_u]),Iu=w.useCallback(async()=>{s("");try{const x=await fetch("/api/flows");if(!x.ok)throw new Error("HTTP "+x.status);i(await x.json())}catch(x){s(String(x.message||x))}},[]);w.useEffect(()=>{Iu()},[Iu]),w.useEffect(()=>{if(n!=="/flow")return;const x=new URLSearchParams(window.location.search);x.get("new")==="1"&&!x.get("flowId")&&t("/projects?new=1")},[n,t]),w.useEffect(()=>{let x=!1;const C=()=>{fetch("/api/model-lists").then(W=>W.json()).then(W=>{x||l_({cursor:Array.isArray(W.cursor)?W.cursor.map(String):[],opencode:Array.isArray(W.opencode)?W.opencode.map(String):[],claudeCode:Array.isArray(W.claudeCode)?W.claudeCode.map(String):[]})}).catch(()=>{})};C();const D=setTimeout(C,4e3);return()=>{x=!0,clearTimeout(D)}},[]);const xw=w.useCallback(async x=>{const C=x.source??"user",D=!!x.archived,W=new URLSearchParams({flowId:x.id,flowSource:C});D&&W.set("archived","1");const K=new URLSearchParams({flowId:x.id,flowSource:C});D&&K.set("archived","1");const[Y,G]=await Promise.all([fetch("/api/flow?"+W.toString()),fetch("/api/nodes?"+K.toString())]),J=await Y.json();if(!Y.ok||J.error)throw new Error(J.error||e("flow:nodePropsError.loadFlowFailed"));const oe=await G.json();if(!G.ok)throw new Error(e("flow:nodePropsError.loadNodesFailed"));const re=Array.isArray(oe)?oe:Array.isArray(oe==null?void 0:oe.nodes)?oe.nodes:[],me=!Array.isArray(oe)&&(oe==null?void 0:oe.pipelineTranslations)||{},Q=w4(J.flowYaml||"");if(Q.error)throw new Error(Q.error);const ce={...Q.instances||{}},le=Q.nodes.map(Ke=>Qh(Ke,ce,re,me,x.id)),we=N4(Q.edges,le);return{flowSource:C,paletteList:re,instances:ce,flowDescriptionText:Q.description??"",nodes:le,edges:we}},[]),Cn=w.useCallback(async(x,C={})=>{const D=!!C.preserveComposer,W=D&&!!C.incrementalSync;sl.current=!1,Xp.current+=1,c(x),m(""),D||(S(""),ae(""),at(null),f(""),k(""),H(""),qa(""),fw([]),Er([]),rl([]),pw(!1),il(null),zp("pan")),W||(ti.current={},We([]),Ot([])),A1(x);try{const K=await xw(x);if(Z(K.paletteList),ti.current=K.instances,f(K.flowDescriptionText),k(x.id||""),W){const Y=Cu.current,G=Eu.current;try{const J=X$(Y,G,K.nodes,K.edges),oe=new Set([...J.changes.addedNodeIds,...J.changes.updatedNodeIds]),re=new Set([...J.changes.addedEdgeKeys,...J.changes.updatedEdgeKeys]),me=oe.size>0?J.nodes.map(ce=>oe.has(ce.id)?{...ce,className:S1(ce.className,v1)}:ce):J.nodes,Q=re.size>0?J.edges.map(ce=>re.has(Pc(ce))?{...ce,className:S1(ce.className,b1)}:ce):J.edges;We(me),Ot(Q),Ei.current!=null&&(clearTimeout(Ei.current),Ei.current=null),(oe.size>0||re.size>0)&&(Ei.current=window.setTimeout(()=>{Ei.current=null,oe.size>0&&We(ce=>ce.map(le=>{if(!oe.has(le.id))return le;const we=k1(le.className,v1);return we===String(le.className||"")?le:{...le,className:we}})),re.size>0&&Ot(ce=>ce.map(le=>{if(!re.has(Pc(le)))return le;const we=k1(le.className,b1);return we===String(le.className||"")?le:{...le,className:we}}))},Q6))}catch{We(K.nodes),Ot(K.edges)}}else We(K.nodes),Ot(K.edges),p(Y=>Y+1);rd(x.id,K.flowSource),s_(Y=>Y+1);try{Nu.current=gb(K.nodes,K.edges,K.instances,{description:K.flowDescriptionText})}catch{Nu.current=""}sl.current=!0}catch(K){m(String(K.message||K))}},[xw,We,Ot]),Au=w.useCallback(async()=>{if(!(a!=null&&a.id))return;const x=a.source??"user",C=new URLSearchParams({flowId:a.id,flowSource:x});a.archived&&C.set("archived","1");const D=await fetch("/api/nodes?"+C.toString()),W=await D.json();if(!D.ok)throw new Error((W==null?void 0:W.error)||e("flow:nodePropsError.loadNodesFailed"));const K=Array.isArray(W)?W:Array.isArray(W==null?void 0:W.nodes)?W.nodes:[];Z(K)},[a,e]),Zp=w.useCallback(async()=>{xe(!0),ye("");try{const x=await fetch("/api/marketplace/nodes"),C=await x.json().catch(()=>({}));if(!x.ok)throw new Error((C==null?void 0:C.error)||"Failed to load marketplace nodes");ue(Array.isArray(C==null?void 0:C.nodes)?C.nodes:[])}catch(x){ye(String(x.message||x)),ue([])}finally{xe(!1)}},[]);w.useEffect(()=>{a&&Zp()},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived,Zp]);const x_=w.useCallback(async x=>{if(!a||!x)return;const C=x.definitionId||`marketplace:${x.id}${x.version?`@${x.version}`:""}`;if(C){qe(C),ye("");try{const D=await fetch("/api/marketplace/install-node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source||"user",archived:!!a.archived,nodeSpec:C})}),W=await D.json().catch(()=>({}));if(!D.ok||(W==null?void 0:W.ok)===!1)throw new Error((W==null?void 0:W.error)||"Failed to install marketplace node");await Au()}catch(D){ye(String(D.message||D))}finally{qe("")}}},[a,Au]),w_=w.useCallback(async(x,C)=>{const D={packageId:(x==null?void 0:x.newId)||(x==null?void 0:x.id)||(x==null?void 0:x.label),label:(x==null?void 0:x.label)||(x==null?void 0:x.newId)||(x==null?void 0:x.id),version:"1.0.0",definitionId:C,body:(x==null?void 0:x.body)||"",script:(x==null?void 0:x.script)||"",inputs:Array.isArray(x==null?void 0:x.inputs)?x.inputs:[],outputs:Array.isArray(x==null?void 0:x.outputs)?x.outputs:[],flowId:a==null?void 0:a.id,flowSource:(a==null?void 0:a.source)||"user"},W=await fetch("/api/marketplace/publish-node-from-instance",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)}),K=await W.json();if(!W.ok||(K==null?void 0:K.ok)===!1)throw new Error((K==null?void 0:K.error)||"Publish failed");return await Au(),K},[Au,a]),ww=w.useCallback(async()=>{var W;if(!a||O.current)return;const x=a.id,C=a.source??"user",D=((W=Za.current)==null?void 0:W.id)??null;O.current=!0,U(!0);try{await Cn({id:x,source:C,archived:a.archived},{preserveComposer:!0,incrementalSync:!0}),D&&We(K=>K.map(Y=>({...Y,selected:Y.id===D})))}finally{O.current=!1,U(!1)}},[a,a==null?void 0:a.archived,Cn,We]);w.useEffect(()=>{if(mw.current||r.length===0)return;const x=new URLSearchParams(window.location.search),C=x.get("flowId");if(!C)return;const D=x.get("flowSource")??"user",W=x.get("flowArchived")==="1",K=r.find(Y=>Y.id===C&&(Y.source??"user")===D&&!!Y.archived===W);K&&(mw.current=!0,Cn(K))},[r,Cn]);const Tu=w.useRef(0);w.useEffect(()=>{if(!a)return;const x=a.id,C=a.source??"user",D=!!a.archived;Tu.current=0;let W=!1;const K=async()=>{var J;if(W)return;const G=new URLSearchParams({flowId:x,flowSource:C,v:String(Tu.current)});D&&G.set("archived","1");try{const oe=await fetch("/api/flow-editor-sync-poll?"+G.toString());if(!oe.ok||W)return;const re=await oe.json();if(W)return;if(re.changed){Tu.current=re.version;const me=((J=Za.current)==null?void 0:J.id)??null;await Cn({id:x,source:C,archived:D},{preserveComposer:!0,incrementalSync:!0}),me&&We(Q=>Q.map(ce=>({...ce,selected:ce.id===me})))}else Tu.current=re.version}catch{}},Y=window.setInterval(K,2e3);return K(),()=>{W=!0,window.clearInterval(Y)}},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived,Cn,We]);const v_=w.useMemo(()=>b?b.startsWith(e("flow:status.saveFailed"))?" af-palette-tip--error":b===e("flow:status.saved")?" af-palette-tip--success":" af-palette-tip--info":"",[b]);w.useEffect(()=>{if(!b)return;b===e("flow:status.saved")||b.startsWith(e("flow:status.runInTerminal"));const x=b.startsWith(e("flow:status.runInTerminal"))?5200:2800,C=window.setTimeout(()=>S(""),x);return()=>clearTimeout(C)},[b,e]),w.useEffect(()=>{v("")},[a==null?void 0:a.id,a==null?void 0:a.source]),w.useEffect(()=>{const x=()=>{window.__provideEditContent&&(hu(window.__provideEditContent),window.__provideEditContent=null)};return window.addEventListener("provide-expand",x),()=>window.removeEventListener("provide-expand",x)},[]),w.useEffect(()=>{var J,oe,re,me,Q,ce;if(!Pe){Vp(null);return}const x=ti.current[Pe.id]||{},{inputs:C,outputs:D}=k4(Pe),W=String(((J=Pe.data)==null?void 0:J.definitionId)??Pe.id??""),K=((oe=Pe.data)==null?void 0:oe.script)!=null?String(Pe.data.script):void 0,Y=x.script!=null?String(x.script):void 0,G=W==="tool_nodejs"||K&&K.trim()!==""||Y&&Y.trim()!==""?String(K??Y??""):"";Vp({id:Pe.id,newId:Pe.id,label:String(((re=Pe.data)==null?void 0:re.label)??Pe.id),role:((me=Pe.data)==null?void 0:me.role)??"普通",model:String(((Q=Pe.data)==null?void 0:Q.model)??x.model??""),body:String(((ce=Pe.data)==null?void 0:ce.body)??x.body??""),script:G,inputs:C,outputs:D})},[Pe==null?void 0:Pe.id,o_]),w.useEffect(()=>{a&&(Pe||(Up.current=null,at(x=>x==="node"?null:x)))},[a,Pe==null?void 0:Pe.id]);const Ru=w.useCallback(()=>{Up.current=null,at(x=>x==="settings"||x==="history"?x:"node")},[]),b_=w.useCallback((x,C)=>{if(!(x.metaKey||x.ctrlKey||x.shiftKey)){if(de!=="edit"){as((C==null?void 0:C.id)??null);return}Ru()}},[Ru,de]),S_=w.useCallback((x,C)=>{if(de!=="edit")return;const D=x.metaKey||x.ctrlKey||x.shiftKey;Ot(W=>W.map(K=>K.id===C.id?{...K,selected:!K.selected||!D}:D?K:{...K,selected:!1})),D||We(W=>W.map(K=>({...K,selected:!1})))},[de,Ot,We]),k_=w.useCallback(x=>Ot(C=>{const D=C.filter(W=>!(W.target===x.target&&W.targetHandle===x.targetHandle));return $C({...x,markerEnd:{type:to.ArrowClosed}},D)}),[Ot]),N_=w.useCallback(x=>{for(const C of x)delete ti.current[C.id]},[]),C_=w.useCallback(x=>{ol.current=x},[]),E_=w.useCallback(x=>{We(D=>D.map(W=>({...W,selected:W.id===x}))),Ot(D=>D.map(W=>({...W,selected:!1}))),Ru();const C=()=>{var oe,re,me;const D=ol.current;if(!(D!=null&&D.getNode))return;const W=D.getNode(x);if(!W)return;const K=(oe=D.getInternalNode)==null?void 0:oe.call(D,x),Y=((re=K==null?void 0:K.measured)==null?void 0:re.width)??(K==null?void 0:K.width)??W.width??200,G=((me=K==null?void 0:K.measured)==null?void 0:me.height)??(K==null?void 0:K.height)??W.height??88,{zoom:J}=D.getViewport();D.setCenter(W.position.x+Y/2,W.position.y+G/2,{zoom:J,duration:220})};requestAnimationFrame(()=>requestAnimationFrame(C))},[We,Ot,Ru]),j_=w.useCallback(x=>{We(D=>D.map(W=>({...W,selected:W.id===x}))),Ot(D=>D.map(W=>({...W,selected:!1})));const C=()=>{var re,me,Q;const D=ol.current;if(!(D!=null&&D.getNode))return;const W=D.getNode(x);if(!W)return;const K=(re=D.getInternalNode)==null?void 0:re.call(D,x),Y=((me=K==null?void 0:K.measured)==null?void 0:me.width)??(K==null?void 0:K.width)??W.width??200,G=((Q=K==null?void 0:K.measured)==null?void 0:Q.height)??(K==null?void 0:K.height)??W.height??88,{zoom:J}=D.getViewport(),oe=Math.max(J,1);D.setCenter(W.position.x+Y/2,W.position.y+G/2,{zoom:oe,duration:260})};requestAnimationFrame(()=>requestAnimationFrame(C))},[We,Ot]),vw=w.useCallback(x=>{if(!a||!x)return;let C={x:180,y:160};const D=ol.current,W=document.querySelector(".af-pipeline-flow .react-flow");if(D&&W){const oe=W.getBoundingClientRect();C=D.screenToFlowPosition({x:oe.left+oe.width*.45,y:oe.top+oe.height*.38})}const K=`node-${Date.now()}`,Y=N1(x),G={id:K,type:Vg,position:C,data:{label:x.label??x.id,definitionId:x.id,schemaType:Y,inputs:Array.isArray(x.inputs)?x.inputs.map(oe=>({...oe})):[],outputs:Array.isArray(x.outputs)?x.outputs.map(oe=>({...oe})):[]}},J=Qh(G,ti.current,q);We(oe=>[...oe,J])},[a,q,We]),P_=w.useCallback(x=>{x.preventDefault(),x.dataTransfer.dropEffect="move"},[]),__=w.useCallback(x=>{if(x.preventDefault(),!a)return;const C=x.dataTransfer.getData("application/agentflow-node");if(!C)return;const D=q.find(re=>re.id===C);if(!D)return;const W=ol.current;if(!W)return;const K=W.screenToFlowPosition({x:x.clientX,y:x.clientY}),Y=`node-${Date.now()}`,G=N1(D),J={id:Y,type:Vg,position:K,data:{label:D.label??D.id,definitionId:D.id,schemaType:G,inputs:Array.isArray(D.inputs)?D.inputs.map(re=>({...re})):[],outputs:Array.isArray(D.outputs)?D.outputs.map(re=>({...re})):[]}},oe=Qh(J,ti.current,q);We(re=>[...re,oe])},[a,q,We]),Pr=w.useCallback(async(x,C)=>{if(!a)return;const D=gb(x,C,ti.current,{description:d});if(D!==Nu.current){S(e("flow:status.saving"));try{const W=g9(a.source),K=await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:W,flowYaml:D,...a.archived?{flowArchived:!0}:{}})}),Y=await K.json();if(!K.ok||!Y.success)throw new Error(Y.error||e("flow:status.saveFailed"));if(Nu.current=D,S(e("flow:status.saved")),a.source==="builtin"&&W==="workspace"){const G={id:a.id,source:"workspace",path:void 0};c(G),A1(G),rd(a.id,"workspace")}}catch(W){S(e("flow:status.saveFailed")+": "+(W.message||W))}}},[a,d]);w.useEffect(()=>{if(!a||!sl.current||de!=="edit"||a.archived)return;const x=Xp.current,C=setTimeout(()=>{x===Xp.current&&sl.current&&Pr(Cu.current,Eu.current)},400);return()=>clearTimeout(C)},[ze,St,d,de,a,Pr]);const Lu=w.useCallback(async x=>{if(!a||a.archived)return;const C=a.source??"user";if(!(C!=="user"&&C!=="workspace")&&C!==x){N(!0),v("");try{const D=await fetch("/api/flow/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,fromSource:C,toSource:x})}),W=await D.json().catch(()=>({}));if(!D.ok)throw new Error(typeof W.error=="string"?W.error:e("flow:composer.requestFailed"));const K=W.flowSource==="workspace"||W.flowSource==="user"?W.flowSource:x;let Y={id:a.id,source:K,archived:a.archived};try{const G=await fetch("/api/flows");if(G.ok){const J=await G.json(),oe=Array.isArray(J)?J.find(re=>re.id===a.id&&(re.source??"user")===K&&!!re.archived==!!a.archived):null;oe&&(Y=oe)}}catch{}await Cn(Y,{preserveComposer:!0}),rd(a.id,K)}catch(D){v(String(D.message||D))}finally{N(!1)}}},[a,Cn]),eh=w.useCallback(async()=>{if(a){Ha(!0),yo(""),ps("");try{const x=await fetch("/api/flow/schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source||"user",archived:!!a.archived,schedule:At})}),C=await x.json().catch(()=>({}));if(!x.ok||!C.success)throw new Error(C.error||"Failed to save schedule");go({...El,...C.schedule||{}}),ps(e("flow:schedule.saved")),await ju(a,{quiet:!0,force:!0})}catch(x){yo(String(x.message||x))}finally{Ha(!1)}}},[a,At,ju,e]),I_=w.useCallback(async()=>{a&&(await Pr(Cu.current,Eu.current),!a.archived&&a.source!=="builtin"&&await eh())},[a,Pr,eh]),Ou=w.useCallback(async()=>{if(!a||!j.trim())return;const x=j.trim();if(x===a.id){H("");return}R(!0),H("");try{const C=await fetch("/api/flow/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",newFlowId:x})}),D=await C.json().catch(()=>({}));if(!C.ok)throw new Error(typeof D.error=="string"?D.error:e("flow:composer.requestFailed"));let W={id:D.flowId,source:D.flowSource??a.source,archived:a.archived};try{const K=await fetch("/api/flows");if(K.ok){const Y=await K.json(),G=Array.isArray(Y)?Y.find(J=>J.id===D.flowId&&(J.source??"user")===(D.flowSource??a.source)):null;G&&(W=G)}}catch{}await Cn(W,{preserveComposer:!0}),rd(D.flowId,D.flowSource??a.source)}catch(C){H(String(C.message||C))}finally{R(!1)}},[a,j,Cn]),bw=w.useCallback(x=>{navigator.clipboard.writeText(x).then(()=>{T(!0),setTimeout(()=>T(!1),2e3)}).catch(()=>{})},[]),th=w.useCallback(()=>{Pr(ze,St)},[Pr,ze,St]),A_=w.useCallback((x,C)=>{const D=C.trim()===""||C==="default"?void 0:C.trim(),W=ze.map(K=>K.id===x?{...K,data:{...K.data,model:D}}:K);We(W),Pr(W,St)},[ze,St,We,Pr]),Mu=w.useCallback(()=>{var le;if(!Le||!a||!Pe)return!1;const x=Pe.id,C=Le.newId.trim();if(yu(""),!K4.test(C))return yu(e("flow:nodePropsError.invalidInstanceId")),!1;if(ze.some(we=>we.id===C&&we.id!==x))return yu(e("flow:nodePropsError.duplicateInstanceId")),!1;const D=Le.role.trim(),W=Zo.includes(D)?D:"普通",K=Le.model.trim(),Y=we=>(Array.isArray(we)?we:[]).map(Ke=>({type:String((Ke==null?void 0:Ke.type)??"节点").trim()||"节点",name:String((Ke==null?void 0:Ke.name)??""),default:String((Ke==null?void 0:Ke.default)??"")})),G=Y(Le.inputs),J=Y(Le.outputs),oe=String(((le=Pe.data)==null?void 0:le.definitionId)??C),re={...Pe.data,label:Le.label.trim()||C,role:W,model:K===""||K==="default"?void 0:K,body:Le.body,inputs:G,outputs:J},me=String(Le.script??"").trim();oe==="tool_nodejs"||me!==""?re.script=String(Le.script??""):delete re.script;let Q,ce=St;if(C!==x){const we={...ti.current},Ke={...we[x]||{}};delete we[x],we[C]=Ke,ti.current=we,Q=ze.map(Ye=>Ye.id!==x?Ye:{...Ye,id:C,selected:!0,data:re}),ce=St.map((Ye,sh)=>({...Ye,source:Ye.source===x?C:Ye.source,target:Ye.target===x?C:Ye.target,id:`e-${Ye.source===x?C:Ye.source}-${Ye.target===x?C:Ye.target}-${sh}`}))}else Q=ze.map(we=>we.id===x?{...we,data:re}:we);return We(Q),Ot(ce),Pr(Q,ce),!0},[Le,a,Pe,ze,St,We,Ot,Pr]),nh=w.useCallback(()=>{var we;if(!Le||!a||!Pe)return!1;const x=Pe.id,C=Le.role.trim(),D=Zo.includes(C)?C:"普通",W=Le.model.trim(),K=Ke=>(Array.isArray(Ke)?Ke:[]).map(Ye=>({type:String((Ye==null?void 0:Ye.type)??"节点").trim()||"节点",name:String((Ye==null?void 0:Ye.name)??""),default:String((Ye==null?void 0:Ye.default)??"")})),Y=K(Le.inputs),G=K(Le.outputs),J=String(((we=Pe.data)==null?void 0:we.definitionId)??x),oe=Le.label.trim()||x,re=W===""||W==="default"?void 0:W,me={...Pe.data,label:oe,role:D,model:re,body:Le.body,inputs:Y,outputs:G},Q=String(Le.script??"").trim();J==="tool_nodejs"||Q!==""?me.script=String(Le.script??""):delete me.script;const ce=Pe.data||{};return(ce.label!==me.label||ce.role!==me.role||ce.model!==me.model||ce.body!==me.body||(ce.script??void 0)!==(me.script??void 0)||JSON.stringify(ce.inputs||[])!==JSON.stringify(Y)||JSON.stringify(ce.outputs||[])!==JSON.stringify(G))&&We(Ke=>Ke.map(Ye=>Ye.id===x?{...Ye,data:me}:Ye)),!0},[Le,a,Pe,We]),Sw=w.useRef(nh);w.useEffect(()=>{Sw.current=nh},[nh]),w.useEffect(()=>{if(!Le||!a||!sl.current||de!=="edit")return;const x=setTimeout(()=>{Sw.current()},400);return()=>clearTimeout(x)},[Le,a,de]);const T_=w.useCallback(()=>{if(!(!Le||!Pe)){if(Le.newId.trim()===Pe.id){yu("");return}Mu()}},[Le,Pe,Mu]);w.useEffect(()=>{const x=C=>{if(de!=="edit")return;const D=j4(C.target);if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){if(Ve==="node"&&Pe&&Le){C.preventDefault(),C.stopPropagation(),Mu()||th();return}if(D)return;C.preventDefault(),C.stopPropagation(),th();return}if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="k"){C.preventDefault(),C.stopPropagation(),iw(W=>!W);return}if(!Bp){if(gu){if(C.key==="Escape"){C.preventDefault(),Ja(!1);return}if(yb(C)&&!C.metaKey&&!C.ctrlKey&&!C.altKey){C.preventDefault(),Ja(!1);return}(C.key==="v"||C.key==="V"||C.key==="h"||C.key==="H")&&!C.metaKey&&!C.ctrlKey&&!C.altKey&&C.preventDefault();return}if(!D){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="a"){C.preventDefault(),C.stopPropagation(),We(W=>W.map(K=>({...K,selected:!0}))),Ot(W=>W.map(K=>({...K,selected:!1})));return}if(yb(C)&&!C.metaKey&&!C.ctrlKey&&!C.altKey){C.preventDefault(),Ja(W=>!W);return}if((C.key==="v"||C.key==="V")&&!C.metaKey&&!C.ctrlKey&&!C.altKey){C.preventDefault(),zp("select");return}if((C.key==="h"||C.key==="H")&&!C.metaKey&&!C.ctrlKey&&!C.altKey){C.preventDefault(),zp("pan");return}}}};return window.addEventListener("keydown",x,!0),()=>window.removeEventListener("keydown",x,!0)},[th,gu,Bp,Ve,Pe,Le,Mu,de]),w.useEffect(()=>{if(de!=="running"||os==null)return;let x=Math.floor((Date.now()-os)/1e3);const C=setInterval(()=>{const D=Date.now()-os,W=Math.floor(D/1e3);W!==x&&(x=W,Qr(D))},500);return()=>clearInterval(C)},[de,os]),w.useEffect(()=>{const x=xo.current;!x||!x.parentElement||Wa.current&&(wo.current=!0,x.scrollIntoView({behavior:"auto",block:"end"}),requestAnimationFrame(()=>{wo.current=!1}))},[Nt]),w.useEffect(()=>{const x=xo.current;if(!x)return;const C=x.parentElement;if(!C)return;const D=()=>{if(wo.current)return;const W=C.scrollHeight-C.scrollTop-C.clientHeight;Wa.current=W<40};return C.addEventListener("scroll",D,{passive:!0}),()=>C.removeEventListener("scroll",D)},[fo,de]),w.useEffect(()=>{if(de==="edit"||!fo)return;Wa.current=!0;const x=xo.current;x&&(wo.current=!0,x.scrollIntoView({behavior:"auto",block:"end"}),requestAnimationFrame(()=>{wo.current=!1}))},[de,fo]),w.useEffect(()=>{Nt.length>Kd+_1&&Ee(x=>x.length>Kd+_1?x.slice(-Kd):x)},[Nt]);const R_=w.useCallback(x=>{if(x.button!==0)return;x.preventDefault();const C=x.currentTarget;ss.current={active:!0,pointerId:x.pointerId,startY:x.clientY,startH:Oa},C.setPointerCapture(x.pointerId)},[Oa]),L_=w.useCallback(x=>{const C=ss.current;if(!C.active||x.pointerId!==C.pointerId)return;const D=C.startY-x.clientY;Ma(Yd(C.startH+D))},[]),Du=w.useCallback(()=>{Ma(x=>{const C=Yd(x);try{localStorage.setItem(wP,String(C))}catch{}return C})},[]),kw=w.useCallback(x=>{const C=ss.current;if(!(!C.active||x.pointerId!==C.pointerId)){C.active=!1;try{x.currentTarget.releasePointerCapture(x.pointerId)}catch{}Du()}},[Du]),O_=w.useCallback(()=>{const x=ss.current;x.active&&(x.active=!1,Du())},[Du]);w.useEffect(()=>{function x(){Ma(C=>Yd(C))}return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const _r=w.useCallback(async(x={})=>{if(!a)return;const C=x.runUuid!=null&&String(x.runUuid).trim()?String(x.runUuid).trim():null,D=x.cliInputsOverride??$a.current,W=!!x.prepareOnly;if(yt(W?"ready":"running"),Ee(W?[]:[{ts:new Date().toISOString(),type:"info",text:C?e("flow:run.connectingApiResume",{uuid:C}):e("flow:run.connectingApi")}]),zn(new Set),Zn({}),po(!W),at(null),C||ho(null),W)return;if(!C){const Y=Date.now();Xr(Y),Qr(0)}const K=new AbortController;kr.current=K;try{const Y=await fetch("/api/flow/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,...C?{uuid:C}:{},cliInputs:D}),signal:K.signal});if(!Y.ok){const Q=await Y.json().catch(()=>({error:e("flow:composer.requestFailed")}));Ee(ce=>[...ce,{ts:new Date().toISOString(),type:"error",text:Q.error||e("flow:composer.requestFailed")}]),yt("error");return}if(Ee(Q=>[...Q,{ts:new Date().toISOString(),type:"info",text:e("flow:run.connectedReceiving")}]),!Y.body){Ee(Q=>[...Q,{ts:new Date().toISOString(),type:"error",text:e("flow:run.noBody")}]),yt("error");return}const G=Y.body.getReader(),J=new TextDecoder;let oe="";const re=Q=>{const ce=Q.ts||new Date().toISOString();if(Q.type==="event")if(Q.event==="node-start")zn(le=>new Set(le).add(Q.instanceId)),Zn(le=>({...le,[Q.instanceId]:{status:"running",startMs:Date.now()}})),Ee(le=>[...le,{ts:ce,type:"node-start",text:Q.label?e("flow:run.nodeStartWithLabel",{instanceId:Q.instanceId,label:Q.label}):e("flow:run.nodeStart",{instanceId:Q.instanceId})}]);else if(Q.event==="node-done"){zn(we=>{const Ke=new Set(we);return Ke.delete(Q.instanceId),Ke});const le=Q.elapsed??null;Zn(we=>({...we,[Q.instanceId]:{status:"success",elapsed:le}})),Ee(we=>[...we,{ts:ce,type:"node-done",text:le?e("flow:run.nodeDoneWithElapsed",{instanceId:Q.instanceId,elapsed:le}):e("flow:run.nodeDone",{instanceId:Q.instanceId})}])}else if(Q.event==="node-failed")zn(le=>{const we=new Set(le);return we.delete(Q.instanceId),we}),Zn(le=>({...le,[Q.instanceId]:{status:"failed",elapsed:Q.elapsed??null}})),Ee(le=>[...le,{ts:ce,type:"node-failed",text:e("flow:run.nodeFailed",{instanceId:Q.instanceId})}]);else if(Q.event==="apply-start"){if(Q.uuid&&ho(String(Q.uuid)),typeof Q.runStartTime=="number"&&Q.runStartTime>0)Xr(Q.runStartTime),Qr(Math.max(0,Date.now()-Q.runStartTime));else if(typeof Q.totalExecutedMs=="number"&&Q.totalExecutedMs>0){const le=Date.now()-Q.totalExecutedMs;Xr(le),Qr(Q.totalExecutedMs)}Ee(le=>[...le,{ts:ce,type:"info",text:e("flow:run.pipelineStart",{uuid:Q.uuid||"?"})}])}else Q.event==="apply-done"?Ee(le=>[...le,{ts:ce,type:"info",text:Q.totalElapsed?e("flow:run.pipelineDoneWithElapsed",{elapsed:Q.totalElapsed}):e("flow:run.pipelineDone")}]):Q.event==="apply-paused"?Ee(le=>[...le,{ts:ce,type:"warn",text:e("flow:run.pipelinePaused",{nodes:(Q.pendingNodes||[]).join(", ")})}]):Ee(le=>[...le,{ts:ce,type:"event",text:`[${Q.event}] ${JSON.stringify(Q)}`}]);else Q.type==="user-check-content"?(hs({instanceId:Q.instanceId,execId:Q.execId??1,inputPath:Q.inputPath,outputPath:Q.outputPath,content:Q.content||""}),bo(Q.content||""),Ka(!1),fu(""),pu(!1),Ee(le=>[...le,{ts:ce,type:"user-check",text:e("flow:run.userCheckContent",{instanceId:Q.instanceId})}])):Q.type==="user-ask-prompt"?(Fp({instanceId:Q.instanceId,execId:Q.execId??1,question:Q.question||"",options:Array.isArray(Q.options)?Q.options:[]}),Ya(!1),Ee(le=>[...le,{ts:ce,type:"user-ask",text:e("flow:run.userAskPrompt",{instanceId:Q.instanceId,defaultValue:`等待用户选择 (${Q.instanceId})`})}])):Q.type==="tool-print-content"?rw({instanceId:Q.instanceId,execId:Q.execId??1,content:Q.content||"",createdAt:Date.now()}):Q.type==="log"?Ee(le=>[...le,{ts:ce,type:"log",text:Q.text!=null?String(Q.text):""}]):Q.type==="error"?Ee(le=>[...le,{ts:ce,type:"error",text:Q.message||e("flow:run.unknownError")}]):Q.type==="done"?Ee(le=>[...le,{ts:ce,type:"done",text:e("flow:run.executionEnd",{exitCode:Q.exitCode??"?"})}]):Ee(le=>[...le,{ts:ce,type:"log",text:JSON.stringify(Q)}])},me=Q=>{if(Q.trim())try{re(JSON.parse(Q))}catch{Ee(ce=>[...ce,{ts:new Date().toISOString(),type:"log",text:Q}])}};for(;;){const{done:Q,value:ce}=await G.read();oe+=J.decode(ce??new Uint8Array,{stream:!Q});const le=oe.split(`
126
+ `);oe=le.pop()??"";for(const we of le)me(we);if(Q)break}oe.trim()&&me(oe),yt("done")}catch(Y){Y.name==="AbortError"?(Ee(G=>[...G,{ts:new Date().toISOString(),type:"warn",text:e("flow:run.executionStopped")}]),yt("stopped")):(Ee(G=>[...G,{ts:new Date().toISOString(),type:"error",text:Y.message||e("flow:run.unknownError")}]),yt("error"))}finally{kr.current=null,zn(new Set)}},[a]),[M_,rh]=w.useState(!1),D_=w.useCallback(()=>{rh(!0)},[]),F_=w.useCallback(async()=>{if(rh(!1),kr.current&&(kr.current.abort(),kr.current=null),a)try{await fetch("/api/flow/run/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id})})}catch{}yt("stopped"),zn(new Set)},[a]),No=w.useCallback(()=>{yt("edit"),zn(new Set),Zn({}),as(null),ho(null)},[]),[$_,Fu]=w.useState(!1),z_=w.useCallback(async()=>{if(Fu(!1),kr.current&&(kr.current.abort(),kr.current=null),a)try{await fetch("/api/flow/run/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id})})}catch{}No()},[a,No]),B_=w.useCallback(()=>{Fu(!1),t("/projects")},[t]),H_=w.useCallback(x=>{const C=x.runId!=null&&String(x.runId).trim()?String(x.runId).trim():null,D=x.flowId!=null&&String(x.flowId).trim()?String(x.flowId).trim():(a==null?void 0:a.id)!=null?String(a.id):null;ho(C);const W=x.status||"unknown";let K="stopped";W==="success"?K="done":W==="failed"?K="error":W==="running"?K="running":K="stopped",yt(K);const Y=typeof x.at=="number"?x.at:null;if(K==="running"&&Y!=null?(Xr(Y),Qr(Math.max(0,Date.now()-Y))):Y!=null&&typeof x.endedAt=="number"&&x.endedAt>Y?(Xr(null),Qr(x.endedAt-Y)):(Xr(null),Qr(Math.max(0,x.durationMs??0))),Ee([]),zn(new Set),Zn({}),as(null),at(null),po(!1),C&&D){const G=new URLSearchParams({flowId:D,runId:C});fetch(`/api/run-node-statuses?${G}`).then(J=>J.json()).then(J=>{const oe=J.statuses&&typeof J.statuses=="object"?J.statuses:{},re={};for(const[me,Q]of Object.entries(oe))Q&&typeof Q=="object"&&typeof Q.status=="string"&&(re[me]={status:Q.status,...Q.elapsed!=null&&String(Q.elapsed).trim()!==""?{elapsed:String(Q.elapsed)}:{}});Zn(re)}).catch(()=>{})}},[a==null?void 0:a.id]);w.useEffect(()=>{if(!(a!=null&&a.id)||de!=="edit")return;let x=!1;return(async()=>{try{const C=await fetch("/api/pipeline-recent-runs"),D=await C.json();if(x||!C.ok)return;const K=(Array.isArray(D.runs)?D.runs:[]).find(J=>J.flowId===a.id&&J.status==="running");if(!K||x)return;const Y=K.runId||null;ho(Y),yt("running"),po(!0),Xr(K.at||Date.now()),Kt.current=0;const G=[{ts:new Date().toISOString(),type:"info",text:`[resume] 检测到活跃 run ${Y},已恢复运行视图`}];if(Y){const J=new URLSearchParams({flowId:a.id,runId:Y}),re=await(await fetch(`/api/run-node-statuses?${J}`)).json();if(x)return;const me=re.statuses&&typeof re.statuses=="object"?re.statuses:{},Q={},ce=new Set;for(const[le,we]of Object.entries(me))we&&typeof we=="object"&&typeof we.status=="string"&&(Q[le]={status:we.status,...we.elapsed!=null&&String(we.elapsed).trim()!==""?{elapsed:String(we.elapsed)}:{}},we.status==="running"&&ce.add(le));Zn(Q),zn(ce);try{const le=new URLSearchParams({flowId:a.id,runId:Y,sinceBytes:"0",tailBytes:"262144"}),we=await fetch(`/api/run-log?${le}`);if(we.ok){const Ke=await we.json();if(!x){Kt.current=Number(Ke.bytes||0);const Ye=I1(typeof Ke.text=="string"?Ke.text:"");Ee([...Ye,...G]);return}}}catch{}}Ee(G)}catch{}})(),()=>{x=!0}},[a==null?void 0:a.id]),w.useEffect(()=>{if(de==="edit"||!(a!=null&&a.id)||!xt)return;let x=!1,C=null;const D=async()=>{try{const W=new URLSearchParams({flowId:a.id,runId:xt}),K=await fetch(`/api/run-node-statuses?${W}`);if(!K.ok)return;const Y=await K.json();if(x)return;const G=Y.statuses&&typeof Y.statuses=="object"?Y.statuses:{},J={},oe=new Set;for(const[re,me]of Object.entries(G))me&&typeof me=="object"&&typeof me.status=="string"&&(J[re]={status:me.status,...me.elapsed!=null&&String(me.elapsed).trim()!==""?{elapsed:String(me.elapsed)}:{}},me.status==="running"&&oe.add(re));Zn(re=>p9(re,J)?re:J),zn(re=>h9(re,oe)?re:oe);try{const re=new URLSearchParams({flowId:a.id,runId:xt,sinceBytes:String(Kt.current||0),tailBytes:String(c9)}),me=await fetch(`/api/run-log?${re}`);if(me.ok){const Q=await me.json();if(x)return;const ce=Number(Q.bytes||0),le=typeof Q.text=="string"?Q.text:"";if(le){const we=I1(le);we.length>0&&Ee(Ke=>[...Ke,...we])}Kt.current=ce}}catch{}try{const re=await fetch("/api/pipeline-recent-runs");if(!re.ok)return;const me=await re.json();if(x)return;const ce=(Array.isArray(me.runs)?me.runs:[]).find(le=>le.flowId===a.id&&le.runId===xt);if(ce&&ce.status){const le=ce.status;le==="running"?yt(we=>we==="running"?we:"running"):le==="success"?yt("done"):le==="failed"?yt("error"):(le==="stopped"||le==="interrupted")&&yt("stopped")}}catch{}}catch{}};return D(),C=window.setInterval(D,2500),()=>{x=!0,C&&window.clearInterval(C)}},[de,a==null?void 0:a.id,xt]),w.useEffect(()=>{if(Ve!=="history"||!a)return;let x=!1;return(async()=>{Gr(!0),Sr("");try{const C=await fetch("/api/pipeline-recent-runs"),D=await C.json();if(!C.ok)throw new Error(D.error||"HTTP "+C.status);x||vr(Array.isArray(D.runs)?D.runs:[])}catch(C){x||(Sr(String(C.message||C)),vr([]))}finally{x||Gr(!1)}})(),()=>{x=!0}},[Ve,a]),w.useEffect(()=>{if(!a){Ie({files:[]});return}let x=!1;return(async()=>{Wt(!0);try{const C=new URLSearchParams({flowId:a.id,flowSource:a.source||"user",archived:a.archived?"1":"0"}),D=await fetch(`/api/pipeline-files?${C}`),W=await D.json();if(!D.ok)throw new Error(W.error||"HTTP "+D.status);x||Ie({files:Array.isArray(W.files)?W.files:[],path:W.path,error:W.error})}catch(C){x||Ie({files:[],error:C.message||String(C)})}finally{x||Wt(!1)}})(),()=>{x=!0}},[a]);const ll=w.useMemo(()=>a?Nn.filter(x=>x&&x.flowId===a.id).sort((x,C)=>C.at-x.at):[],[Nn,a]),nn=w.useMemo(()=>{let x=0,C=0,D=0,W=0,K=0;for(const Y of ll){const G=Y.status||"unknown";G==="success"?x+=1:G==="failed"?C+=1:G==="running"?D+=1:G==="stopped"?W+=1:G==="interrupted"&&(K+=1)}return{success:x,failed:C,running:D,stopped:W,interrupted:K}},[ll]),cl=w.useMemo(()=>a?E1(Bn,mu):null,[a,Bn,mu]),nr=w.useMemo(()=>{if(!cl||!a)return[];const x=cl.query.toLowerCase(),C=K=>x?K.some(Y=>Y&&String(Y).toLowerCase().includes(x)):!0,D=ze.map(K=>{var re,me;const Y=K.id,G=String(((re=K.data)==null?void 0:re.label)??Y),J=(me=K.data)!=null&&me.definitionId?String(K.data.definitionId):"",oe=[G!==Y?G:"",J&&J!==Y?J:""].filter(Boolean);return{id:Y,label:G,defId:J,subs:oe}}).filter(({id:K,label:Y,defId:G})=>C([K,Y,G])).sort((K,Y)=>K.id.localeCompare(Y.id)).slice(0,18).map(({id:K,label:Y,defId:G})=>{const J=[Y!==K?Y:null,G||null].filter(Boolean).join(" · ")||void 0;return{kind:"instance",id:K,title:K,subtitle:J}}),W=q.filter(K=>K&&K.id&&C([K.id,K.label,K.description])).sort((K,Y)=>K.id.localeCompare(Y.id)).slice(0,22).map(K=>({kind:"definition",id:K.id,title:K.id,subtitle:K.label&&K.label!==K.id?String(K.label):String(K.type||"")}));return[...D,...W]},[cl,ze,q,a]),ul=w.useMemo(()=>{const x=nr.filter(D=>D.kind==="instance"),C=nr.filter(D=>D.kind==="definition");return{instances:x,definitions:C}},[nr]);w.useEffect(()=>{Qa(x=>{const C=Math.max(0,nr.length-1);return Math.min(Math.max(0,x),C)})},[nr]);const Nw=w.useMemo(()=>t9(Bn),[Bn]),Cw=w.useMemo(()=>ze.filter(x=>x.selected),[ze]),$u=w.useMemo(()=>{const x=[],C=new Set;for(const K of Cw)C.add(K.id),x.push({node:K,kind:"canvas"});const D=new Map(ze.map(K=>[K.id,K])),W=new Map(q.map(K=>[K.id,K]));for(const K of Nw){if(C.has(K))continue;const Y=D.get(K);if(Y){C.add(K),x.push({node:Y,kind:"mention"});continue}const G=W.get(K);G&&(C.add(K),x.push({definition:G,kind:"definition"}))}return x},[Cw,Nw,ze,q]),dn=w.useMemo(()=>{const x=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],C=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],D=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[],W=C.map(re=>`opencode:${si(re)}`),K=D.map(re=>`claude-code:${si(re)}`),Y=new Set([...x,...C,...D].map(si).concat(W).concat(K)),G=(So||"").trim(),J=vd(So,x,C,D),oe=J&&!Y.has(J)&&!Y.has(G)?G:"";return{cursorList:x,opencodeList:C,claudeCodeList:D,currentNotInLists:oe}},[_e,So]);w.useEffect(()=>{const x=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],C=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],D=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[];ow(W=>{const K=vd(W,x,C,D);return K===W?W:K})},[_e.cursor,_e.opencode,_e.claudeCode]);const Co=w.useCallback(async(x,C={})=>{var Tw;if(!a||Gp.current)return;const D=C.phaseContextSnapshot,W=(typeof x=="string"?x:Bn).trim();if(!W)return;const K=lw.current;Gp.current=!0,dw(!0),Cr(e("flow:composer.connecting")),at(lt=>lt!=="composer"?"composer":lt);const Y=[...nl];if(K.length>0&&Y.push({type:"assistant",segments:[...K]}),fw([...Y,{type:"user",text:W}]),Y.filter(lt=>lt.type==="user").length===0){const lt=W.replace(/\s+/g," ").slice(0,30)+(W.length>30?"…":"");Nr(Un=>Un.map(qt=>qt.id===Yt?{...qt,label:lt}:qt))}const G=Y.map(lt=>lt.type==="user"?{role:"user",text:lt.text}:{role:"assistant",text:(lt.segments||[]).filter(qt=>qt.kind==="assistant"||qt.kind==="result").map(qt=>qt.text).join(`
127
+ `)}).filter(lt=>lt.text),J=D??Ae;qa(""),Er([]),rl([]),pw(!1);const oe=new AbortController;ku.current=oe,qp.current=Yt;let re=null;const me=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],Q=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],ce=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[],le=vd(So,me,Q,ce),we=$u.filter(lt=>lt.kind!=="definition"&&lt.node).map(lt=>lt.node.id),Ke=a;let Ye=!1,sh=!1;try{re=setTimeout(()=>oe.abort(),12e4);const lt={prompt:W,model:le,flowId:a.id,flowSource:a.source??"user",...a.archived?{flowArchived:!0}:{},contextInstanceIds:we,thread:G};J&&J.nextPhase&&!J.isLastPhase&&(lt.phaseContext={phaseIndex:J.nextPhase.index,phases:J.phases,userPromptOriginal:J.userPromptOriginal||W}),Wp&&(lt.phaseRole=Wp);const Un=await fetch("/api/composer-agent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(lt),signal:oe.signal});if(re&&(clearTimeout(re),re=null),!Un.ok){let fl=Un.statusText||e("flow:composer.requestFailed");try{const pl=await Un.json();pl&&pl.error&&(fl=String(pl.error))}catch{}Cr(fl),Er([{kind:"error",text:fl}]);return}const qt=(Tw=Un.body)==null?void 0:Tw.getReader();if(!qt){Cr(e("flow:composer.cannotReadStream"));return}const xs=new TextDecoder;let Eo="";for(;;){const{done:fl,value:pl}=await qt.read();if(fl)break;for(Eo+=xs.decode(pl,{stream:!0});;){const ah=Eo.indexOf(`
128
+ `);if(ah<0)break;const Rw=Eo.slice(0,ah).trim();if(Eo=Eo.slice(ah+1),!Rw)continue;let he;try{he=JSON.parse(Rw)}catch{continue}if(he.type==="status"&&typeof he.line=="string"&&Cr(he.line),he.type==="natural"&&typeof he.text=="string"&&he.text){const Ze=typeof he.kind=="string"&&he.kind?he.kind:"assistant";Er(Je=>[...Je,{kind:Ze,text:he.text}])}if(he.type==="error"&&he.message){sh=!0;const Ze=he.code?` [${he.code}]`:"",Je=String(he.message)+Ze;Cr(Je),Er(fn=>[...fn,{kind:"error",text:Je}])}if(he.type==="plan"&&Array.isArray(he.steps)){rl(he.steps.map(Je=>({...Je,status:"pending"})));const Ze=he.steps.map((Je,fn)=>`${fn+1}. ${Je.description||Je.type}`).join(`
129
+ `);Er(Je=>[...Je,{kind:"assistant",text:e("flow:composer.taskPlan",{count:he.steps.length,summary:Ze})}])}if(he.type==="step-start"){const Ze=he.index??0,Je=he.total??0,fn=he.tier?` [${he.tier}]`:"",G_=he.model?` (${he.model})`:"";Cr(e("flow:composer.step",{current:Ze+1,total:Je,description:(he.description||"")+fn+G_})),rl(X_=>X_.map(ws=>ws.index===Ze?{...ws,status:"running",model:he.model,tier:he.tier,nodeRole:he.nodeRole??ws.nodeRole,instanceId:he.instanceId??ws.instanceId,instanceLabel:he.instanceLabel??ws.instanceLabel}:ws))}if(he.type==="step-progress"){const Ze=he.index??0,Je=he.total??0;Cr(e("flow:composer.step",{current:Ze+1,total:Je,description:he.description||""}))}if(he.type==="step-done"){const Ze=he.index??0;rl(Je=>Je.map(fn=>fn.index===Ze?{...fn,status:he.success?"done":"error"}:fn))}if(he.type==="phase-plan"&&Array.isArray(he.phases)){il(Je=>({...Je||{},phases:he.phases,currentPhase:he.currentPhase??0,phaseTotal:he.phaseTotal??he.phases.length,phaseName:he.phaseName||"",isLastPhase:!1,nextPhase:null,userPromptOriginal:(Je==null?void 0:Je.userPromptOriginal)||W}));const Ze=he.phases.map((Je,fn)=>`${fn+1}. ${Je.label}`).join(" → ");Er(Je=>[...Je,{kind:"assistant",text:e("flow:composer.phaseGeneration",{count:he.phases.length,labels:Ze,current:he.phaseName||""})}])}he.type==="phase-complete"&&(il(Ze=>{var fn;return{...Ze||{},phases:he.phases||(Ze==null?void 0:Ze.phases)||[],currentPhase:he.phaseIndex??0,phaseTotal:he.phaseTotal??((fn=he.phases)==null?void 0:fn.length)??0,phaseName:he.phaseName||"",isLastPhase:!!he.isLastPhase,nextPhase:he.nextPhase||null,userPromptOriginal:he.userPromptOriginal||(Ze==null?void 0:Ze.userPromptOriginal)||W}}),!he.isLastPhase&&he.nextPhase&&Er(Ze=>[...Ze,{kind:"assistant",text:e("flow:composer.phaseComplete",{phaseName:he.phaseName||e("flow:composer.nextPhase"),nextPhase:he.nextPhase.label})}])),he.type==="done"&&(Ye=!0,Cr(Ze=>Ze||e("flow:composer.done")))}}}catch(lt){const Un=lt;if(Un.name==="AbortError"){const qt=e(re?"flow:composer.connectTimeout":"flow:composer.aborted");Cr(qt),Er(xs=>[...xs,{kind:"error",text:qt}])}else{const qt=Un.code||Un.name||"UNKNOWN",xs=`${Un.message||String(lt)} [${qt}]`;Cr(xs),Er(Eo=>[...Eo,{kind:"error",text:xs}])}}finally{Gp.current=!1,dw(!1),ku.current=null,qp.current=null,re&&clearTimeout(re),Ye&&Ke&&Cn({id:Ke.id,source:Ke.source??"user",archived:Ke.archived},{preserveComposer:!0,incrementalSync:!0})}},[a,Bn,So,_e,$u,Cn,nl,Yt,Ae,Wp]);c_.current=Co;const Ew=w.useCallback(()=>{!Ae||Ae.isLastPhase||(il(null),Co(e("flow:composer.skipRemainingPhases")))},[Ae,Co]),jw=w.useCallback(()=>{if(!Ae||Ae.isLastPhase||!Ae.nextPhase)return;const x=String(Ae.nextPhase.label||"").trim()||e("flow:composer.nextPhase");Co(e("flow:composer.continuePhase",{label:x}),{phaseContextSnapshot:Ae})},[Ae,Co]);w.useEffect(()=>{if(!Yp)return;const x=C=>{C.key==="Escape"&&Su(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[Yp]),w.useEffect(()=>{de!=="edit"&&Su(!1)},[de]),w.useLayoutEffect(()=>{const x=Hp.current;if(!x)return;if(!a){x.style.height="";return}x.style.height="0px";const C=getComputedStyle(x),D=parseFloat(C.lineHeight),W=(parseFloat(C.paddingTop)||0)+(parseFloat(C.paddingBottom)||0),K=Number.isFinite(D)&&D>0?D:13*1.45,Y=W+K*2,G=W+K*10,J=Math.min(Math.max(x.scrollHeight,Y),G);x.style.height=`${J}px`},[Bn,a]);const ih=w.useCallback(x=>{const C=Bn,D=mu,W=E1(C,D);if(!W)return;const K=C.slice(0,W.atIndex)+`@${x} `+C.slice(D);qa(K);const Y=W.atIndex+x.length+2;queueMicrotask(()=>{const G=Hp.current;G&&(G.focus(),G.setSelectionRange(Y,Y)),Ga(Y)})},[Bn,mu]),oh=w.useCallback(x=>{qa(C=>{const D=`@${x}`,W=C.indexOf(D);return W<0?C:C.slice(0,W)+C.slice(W+D.length)})},[]),Pw=w.useCallback(x=>{x.kind==="canvas"?We(C=>C.map(D=>D.id===x.node.id?{...D,selected:!1}:D)):x.kind==="mention"?oh(x.node.id):oh(x.definition.id)},[We,oh]),U_=w.useCallback(()=>{at(x=>x==="history"?null:"history")},[]),V_=w.useCallback(()=>{at(x=>x==="settings"?null:"settings")},[]),W_=w.useCallback(()=>{at(x=>x==="composer"?null:"composer")},[]),dl=w.useCallback(()=>{at(x=>(x==="node"&&Za.current&&(Up.current=Za.current.id),null))},[]),_w=w.useCallback(()=>{Ja(x=>!x)},[]),K_=a?fm(a):"",Y_=()=>{if(!a)return null;const x=er||a.archived||a.source==="builtin",C=pt!=null&&pt.running?e("flow:schedule.running"):At.enabled?e("flow:schedule.waiting"):e("flow:schedule.disabled"),D=pt!=null&&pt.running?"running":At.enabled?"waiting":"disabled",W=ee.slice(0,12),K=a.archived||a.source==="builtin";return l.jsxs("section",{className:"af-pipeline-settings-page","aria-label":e("flow:settings.title"),children:[l.jsxs("aside",{className:"af-pipeline-settings-nav","aria-label":e("flow:settings.sectionNav"),children:[l.jsx("div",{className:"af-pipeline-settings-nav-title",children:e("flow:settings.title")}),l.jsxs("a",{href:"#pipeline-basic",className:"af-pipeline-settings-nav-item af-pipeline-settings-nav-item--active",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"badge"}),e("flow:settings.basicInfo")]}),l.jsxs("a",{href:"#pipeline-storage",className:"af-pipeline-settings-nav-item",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"folder_open"}),e("flow:settings.storageAndPath")]}),l.jsxs("a",{href:"#pipeline-marketplace",className:"af-pipeline-settings-nav-item",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"deployed_code"}),e("flow:settings.nodeMarketplace")]}),l.jsxs("a",{href:"#pipeline-schedule",className:"af-pipeline-settings-nav-item",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"schedule"}),e("flow:schedule.title")]}),l.jsxs("a",{href:"#pipeline-metadata",className:"af-pipeline-settings-nav-item",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"dataset"}),e("flow:pipeline.metadata")]}),l.jsxs("button",{type:"button",className:"af-pipeline-settings-nav-link",onClick:()=>t("/settings"),children:[e("flow:settings.globalSettings"),l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"open_in_new"})]})]}),l.jsxs("main",{className:"af-pipeline-settings-main",children:[l.jsxs("div",{className:"af-pipeline-settings-main-head",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"af-pipeline-settings-title",children:e("flow:settings.title")}),l.jsx("p",{className:"af-pipeline-settings-subtitle",children:e("flow:settings.subtitle")})]}),l.jsxs("button",{type:"button",className:"af-btn-secondary",onClick:dl,children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"arrow_back"}),e("flow:settings.backToCanvas")]})]}),l.jsxs("section",{id:"pipeline-basic",className:"af-pipeline-settings-section",children:[l.jsxs("div",{className:"af-pipeline-settings-section-head",children:[l.jsx("span",{className:"af-pipeline-settings-section-index",children:"1."}),l.jsx("h2",{children:e("flow:settings.basicInfo")})]}),l.jsxs("div",{className:"af-pipeline-settings-grid af-pipeline-settings-grid--two",children:[l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.pipelineId")}),(a.source==="user"||a.source==="workspace")&&!a.archived?l.jsxs("div",{className:"af-pipeline-rename-row",children:[l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:j,onChange:Y=>{k(Y.target.value),H("")},onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),Ou())},onBlur:()=>{j.trim()&&j.trim()!==a.id&&Ou()},placeholder:a.id,disabled:_,spellCheck:!1}),l.jsx("span",{className:"af-pipeline-drawer-badge",children:Po(a.source??"user",e)})]}):l.jsxs("div",{className:"af-pipeline-drawer-readonly",children:[a.id,l.jsx("span",{className:"af-pipeline-drawer-badge",children:Po(a.source??"user",e)}),a.archived?l.jsx("span",{className:"af-pipeline-drawer-badge af-pipeline-drawer-badge--muted",children:e("flow:settings.archived")}):null]}),M?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:M}):null]}),l.jsxs("div",{className:"af-pipeline-settings-kv-block",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:settings.owner")}),l.jsxs("div",{className:"af-pipeline-drawer-readonly",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"person"}),a.owner||"bigo"]})]})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.introduction")}),l.jsx("textarea",{className:"af-pipeline-drawer-textarea af-pipeline-settings-textarea",value:d,onChange:Y=>f(Y.target.value),placeholder:e("flow:pipeline.introductionPlaceholder"),rows:4,spellCheck:!1})]})]}),l.jsxs("section",{id:"pipeline-storage",className:"af-pipeline-settings-section",children:[l.jsxs("div",{className:"af-pipeline-settings-section-head",children:[l.jsx("span",{className:"af-pipeline-settings-section-index",children:"2."}),l.jsx("h2",{children:e("flow:settings.storageAndPath")})]}),typeof a.path=="string"&&a.path?l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.diskPath")}),l.jsxs("div",{className:"af-pipeline-drawer-readonly af-pipeline-drawer-readonly--mono af-pipeline-path-row",children:[l.jsx("span",{className:"af-pipeline-path-text",children:a.path}),l.jsx("button",{type:"button",className:"af-icon-btn af-pipeline-copy-btn",onClick:()=>bw(a.path),title:e("flow:settings.copyPath"),children:l.jsx("span",{className:"material-symbols-outlined",children:P?"check":"content_copy"})})]})]}):null,a.source==="user"||a.source==="workspace"?a.archived?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.archivedNote")}):l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.storageLocation")}),l.jsx("div",{className:"af-pipeline-move-actions",children:a.source==="user"?l.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>Lu("workspace"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToWorkspace")}):l.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>Lu("user"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToUserDir")})}),g?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:g}):null]}):l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.builtinNote")})]}),l.jsxs("section",{id:"pipeline-marketplace",className:"af-pipeline-settings-section",children:[l.jsxs("div",{className:"af-pipeline-settings-section-head",children:[l.jsx("span",{className:"af-pipeline-settings-section-index",children:"3."}),l.jsx("h2",{children:e("flow:settings.nodeMarketplace")})]}),l.jsxs("div",{className:"af-pipeline-market-row",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"af-pipeline-market-count",children:[ee.length," ",e("flow:settings.marketNodesUnit")]}),l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.marketplaceHint")})]}),l.jsxs("button",{type:"button",className:"af-btn-secondary",onClick:Zp,disabled:Se,children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"refresh"}),e(Se?"common:common.loading":"common:common.refresh")]})]}),ge?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:ge}):null,Se?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):W.length>0?l.jsx("div",{className:"af-pipeline-market-list",children:W.map(Y=>{const G=Y.definitionId||`marketplace:${Y.id}${Y.version?`@${Y.version}`:""}`,J=yw.has(G)||yw.has(`marketplace:${Y.id}`),oe=_u.find(ce=>String(ce.id)===G||String(ce.id)===`marketplace:${Y.id}`),re=$e===G,me=wd(Y.inputs||Y.input),Q=wd(Y.outputs||Y.output);return l.jsxs("div",{className:"af-pipeline-market-item",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:J?"check_circle":"extension"}),l.jsxs("div",{className:"af-pipeline-market-main",children:[l.jsxs("div",{className:"af-pipeline-market-title-row",children:[l.jsx("strong",{children:Y.displayName||Y.label||Y.id}),l.jsx("span",{children:Y.version?`v${Y.version}`:G})]}),l.jsx("p",{className:"af-pipeline-market-purpose",children:Y.description||e("flow:settings.marketplaceNoDescription")}),l.jsxs("div",{className:"af-pipeline-market-io",children:[l.jsxs("div",{children:[l.jsx("span",{className:"af-pipeline-market-io-label",children:"Inputs"}),l.jsx("div",{className:"af-pipeline-market-chips",children:me.length>0?me.map(ce=>l.jsx("span",{className:"af-pipeline-market-chip",children:ce},`in-${G}-${ce}`)):l.jsx("span",{className:"af-pipeline-market-chip af-pipeline-market-chip--muted",children:e("flow:settings.noInputs")})})]}),l.jsxs("div",{children:[l.jsx("span",{className:"af-pipeline-market-io-label",children:"Outputs"}),l.jsx("div",{className:"af-pipeline-market-chips",children:Q.length>0?Q.map(ce=>l.jsx("span",{className:"af-pipeline-market-chip",children:ce},`out-${G}-${ce}`)):l.jsx("span",{className:"af-pipeline-market-chip af-pipeline-market-chip--muted",children:e("flow:settings.noOutputs")})})]})]})]}),l.jsxs("div",{className:"af-pipeline-market-actions",children:[l.jsx("button",{type:"button",className:"af-btn-secondary af-pipeline-market-action",onClick:()=>ft(Y),children:e("flow:settings.previewNode")}),l.jsx("button",{type:"button",className:J?"af-btn-secondary af-pipeline-market-action":"af-btn-primary af-pipeline-market-action",disabled:K||re,onClick:()=>{J&&oe?(vw(oe),at(null)):x_(Y)},children:e(re?"flow:settings.installingNode":J?"flow:settings.addInstalledNode":"flow:settings.installNode")})]})]},G)})}):l.jsx("div",{className:"af-pipeline-settings-empty",children:e("flow:settings.marketplaceEmpty")})]}),l.jsxs("section",{id:"pipeline-schedule",className:"af-pipeline-settings-section",children:[l.jsxs("div",{className:"af-pipeline-settings-section-head",children:[l.jsx("span",{className:"af-pipeline-settings-section-index",children:"4."}),l.jsx("h2",{children:e("flow:schedule.title")})]}),cu?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-pipeline-settings-schedule-grid",children:[l.jsxs("label",{className:"af-new-pipeline-radio af-pipeline-settings-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!At.enabled,disabled:x,onChange:Y=>ji(G=>({...G,enabled:Y.target.checked}))}),l.jsx("span",{children:e("flow:schedule.enabled")})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.cron")}),l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:At.cron||"",disabled:x,onChange:Y=>ji(G=>({...G,cron:Y.target.value})),placeholder:"0 9 * * *",spellCheck:!1})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.timezone")}),l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:At.timezone||"",disabled:x,onChange:Y=>ji(G=>({...G,timezone:Y.target.value})),placeholder:"Asia/Shanghai",spellCheck:!1})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.preset")}),l.jsxs("select",{className:"af-pipeline-flow-select",value:At.preset||"",disabled:x,onChange:Y=>ji(G=>({...G,preset:Y.target.value})),children:[l.jsx("option",{value:"",children:e("flow:schedule.defaultPreset")}),Object.keys(Jr).map(Y=>l.jsx("option",{value:Y,children:Y},Y))]})]})]}),l.jsxs("div",{className:"af-pipeline-settings-schedule-status",children:[l.jsx("span",{className:`af-pipeline-settings-status-dot af-pipeline-settings-status-dot--${D}`}),l.jsx("span",{children:At.nextRunAt?e("flow:schedule.nextRun",{time:new Date(At.nextRunAt).toLocaleString()}):e("flow:schedule.noNextRun")}),l.jsxs("span",{children:[e("flow:schedule.runtime"),":",C]})]}),l.jsxs("dl",{className:"af-pipeline-meta-dl af-pipeline-settings-dl",children:[Xe.lastTriggeredAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastTriggeredAt")}),l.jsx("dd",{children:new Date(Xe.lastTriggeredAt).toLocaleString()})]}):null,Xe.lastSkippedAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastSkippedAt")}),l.jsxs("dd",{children:[new Date(Xe.lastSkippedAt).toLocaleString(),Xe.lastSkipReason?` · ${Xe.lastSkipReason}`:""]})]}):null,Xe.lastRunUuid?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastRun")}),l.jsx("dd",{children:Xe.lastRunUuid})]}):null,Xe.lastExitCode!=null?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastExit")}),l.jsx("dd",{children:String(Xe.lastExitCode)})]}):null,Xe.lastFinishedAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastFinishedAt")}),l.jsx("dd",{children:new Date(Xe.lastFinishedAt).toLocaleString()})]}):null]}),pt!=null&&pt.lastError||Xe.lastError?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:(pt==null?void 0:pt.lastError)||Xe.lastError}):null,a.archived||a.source==="builtin"?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.readonlyNote")}):null,ds?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:ds}):null,fs?l.jsx("p",{className:"af-pipeline-drawer-muted",children:fs}):null]})]}),l.jsxs("section",{id:"pipeline-metadata",className:"af-pipeline-settings-section",children:[l.jsxs("div",{className:"af-pipeline-settings-section-head",children:[l.jsx("span",{className:"af-pipeline-settings-section-index",children:"5."}),l.jsx("h2",{children:e("flow:pipeline.metadata")})]}),l.jsxs("dl",{className:"af-pipeline-meta-dl af-pipeline-settings-dl",children:[l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:pipeline.nodeCount")}),l.jsxs("dd",{children:[ze.length," ",e("flow:pipeline.nodesUnit")]})]}),l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:settings.marketplaceNodes")}),l.jsx("dd",{children:_u.length})]}),l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:settings.source")}),l.jsx("dd",{children:Po(a.source??"user",e)})]})]})]})]}),l.jsxs("aside",{className:"af-pipeline-settings-side","aria-label":e("flow:settings.overview"),children:[l.jsxs("section",{className:"af-pipeline-settings-side-card",children:[l.jsxs("div",{className:"af-pipeline-settings-overview-head",children:[l.jsx("span",{className:"af-pipeline-settings-overview-icon material-symbols-outlined","aria-hidden":!0,children:"account_tree"}),l.jsxs("div",{children:[l.jsx("h2",{children:a.id}),l.jsx("span",{className:`af-pipeline-settings-status af-pipeline-settings-status--${D}`,children:C})]})]}),l.jsxs("dl",{className:"af-pipeline-settings-side-dl",children:[l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:pipeline.nodeCount")}),l.jsx("dd",{children:ze.length})]}),l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.owner")}),l.jsx("dd",{children:a.owner||"bigo"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.source")}),l.jsx("dd",{children:Po(a.source??"user",e)})]})]})]}),l.jsxs("section",{className:"af-pipeline-settings-side-card",children:[l.jsx("h2",{children:e("flow:settings.quickActions")}),l.jsxs("button",{type:"button",className:"af-btn-primary af-pipeline-settings-side-action",onClick:()=>void I_(),disabled:er,children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"save"}),e(er?"flow:settings.savingChanges":"flow:settings.saveChanges")]}),l.jsxs("button",{type:"button",className:"af-btn-secondary af-pipeline-settings-side-action",onClick:dl,children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"arrow_back"}),e("flow:settings.backToCanvas")]})]}),l.jsxs("section",{className:"af-pipeline-settings-side-card",children:[l.jsx("h2",{children:e("flow:settings.help")}),l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.helpText")}),l.jsx("button",{type:"button",className:"af-pipeline-drawer-link",onClick:()=>t("/settings"),children:e("flow:settings.globalSettings")})]})]})]})},q_=()=>{const x=Me;if(!x)return null;const C=x.definitionId||`marketplace:${x.id}${x.version?`@${x.version}`:""}`,D=x.displayName||x.label||x.id,W=wd(x.inputs||x.input),K=wd(x.outputs||x.output);return ui.createPortal(l.jsx("div",{className:"af-market-preview-overlay",role:"dialog","aria-modal":"true","aria-label":e("flow:settings.nodePreviewTitle"),onMouseDown:Y=>{Y.target===Y.currentTarget&&ft(null)},children:l.jsxs("div",{className:"af-market-preview-dialog",children:[l.jsxs("div",{className:"af-market-preview-head",children:[l.jsxs("div",{children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:settings.nodePreviewTitle")}),l.jsx("h2",{children:D})]}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>ft(null),"aria-label":e("flow:settings.closePreview"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-market-preview-body",children:[l.jsx("section",{className:"af-market-preview-visual","aria-label":e("flow:settings.nodeStylePreview"),children:l.jsxs("div",{className:"af-market-preview-node",children:[l.jsx("div",{className:"af-market-preview-node-ports af-market-preview-node-ports--left",children:(W.length>0?W:[""]).slice(0,4).map((Y,G)=>l.jsx("span",{title:Y},`preview-in-${G}`))}),l.jsxs("div",{className:"af-market-preview-node-main",children:[l.jsx("span",{className:"af-market-preview-node-icon material-symbols-outlined","aria-hidden":!0,children:"extension"}),l.jsx("strong",{children:D}),l.jsx("span",{children:C})]}),l.jsx("div",{className:"af-market-preview-node-ports af-market-preview-node-ports--right",children:(K.length>0?K:[""]).slice(0,4).map((Y,G)=>l.jsx("span",{title:Y},`preview-out-${G}`))})]})}),l.jsxs("section",{className:"af-market-preview-section",children:[l.jsx("h3",{children:e("flow:settings.nodeFunction")}),l.jsx("p",{children:x.description||e("flow:settings.marketplaceNoDescription")})]}),l.jsxs("div",{className:"af-market-preview-io-grid",children:[l.jsxs("section",{className:"af-market-preview-section",children:[l.jsx("h3",{children:"Inputs"}),l.jsx("div",{className:"af-pipeline-market-chips af-market-preview-chips",children:W.length>0?W.map(Y=>l.jsx("span",{className:"af-pipeline-market-chip",children:Y},`preview-input-${Y}`)):l.jsx("span",{className:"af-pipeline-market-chip af-pipeline-market-chip--muted",children:e("flow:settings.noInputs")})})]}),l.jsxs("section",{className:"af-market-preview-section",children:[l.jsx("h3",{children:"Outputs"}),l.jsx("div",{className:"af-pipeline-market-chips af-market-preview-chips",children:K.length>0?K.map(Y=>l.jsx("span",{className:"af-pipeline-market-chip",children:Y},`preview-output-${Y}`)):l.jsx("span",{className:"af-pipeline-market-chip af-pipeline-market-chip--muted",children:e("flow:settings.noOutputs")})})]})]}),l.jsxs("section",{className:"af-market-preview-section",children:[l.jsx("h3",{children:e("flow:settings.nodePackageInfo")}),l.jsxs("dl",{className:"af-market-preview-dl",children:[l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.definitionId")}),l.jsx("dd",{children:C})]}),l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.version")}),l.jsx("dd",{children:x.version||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.packagePath")}),l.jsx("dd",{children:x.packageDir||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:e("flow:settings.packagedFiles")}),l.jsx("dd",{children:Array.isArray(x.packagedFiles)&&x.packagedFiles.length>0?x.packagedFiles.map(Y=>Y.to||Y).join(", "):"-"})]})]})]})]})]})}),document.body)};return l.jsx(OE,{children:l.jsxs(yP.Provider,{value:{modelLists:_e,onModelChange:A_},children:[l.jsxs("div",{className:"af-pipeline-page"+(de!=="edit"?" af-pipeline-page--run-mode":""),children:[l.jsxs("header",{className:"af-pipeline-top",children:[l.jsxs("div",{className:"af-pipeline-top-left",children:[l.jsx("button",{type:"button",className:"af-icon-btn af-pipeline-back",onClick:()=>{de==="running"?Fu(!0):de!=="edit"?No():t("/projects")},"aria-label":e(de!=="edit"?"flow:topbar.backToEdit":"flow:topbar.backToProjects"),title:e(de!=="edit"?"flow:topbar.backToEdit":"flow:topbar.backToProjects"),children:l.jsx("span",{className:"material-symbols-outlined",children:"arrow_back"})}),l.jsxs("div",{className:"af-pipeline-brand",children:[l.jsx("span",{className:"af-pipeline-brand-name",children:"PIPELINE"}),l.jsxs("span",{className:"af-pipeline-brand-ver",children:["V",q6,"-STABLE"]})]}),l.jsxs("div",{className:"af-pipeline-flow-pick",children:[l.jsx("label",{className:"af-visually-hidden",htmlFor:"af-flow-select",children:e("flow:topbar.currentPipeline")}),l.jsx("select",{id:"af-flow-select",className:"af-pipeline-flow-select",value:K_,onChange:x=>{const C=x.target.value;if(!C)return;const D=C.split("\0"),W=D[0],K=D[1]||"user",Y=D[2]==="1",G=r.find(J=>J.id===W&&(J.source??"user")===K&&!!J.archived===Y);G&&Cn(G)},disabled:r.length===0,children:r.length===0?l.jsx("option",{value:"",children:e("flow:palette.loading")}):l.jsxs(l.Fragment,{children:[a?null:l.jsx("option",{value:"",children:e("flow:pipeline.selectPipeline")}),r.map(x=>l.jsxs("option",{value:fm(x),children:[x.id," (",Po(x.source??"user",e),")",x.archived?` · ${e("flow:palette.archived")}`:""]},fm(x)))]})})]})]}),l.jsxs("div",{className:"af-pipeline-top-right af-flow-toolbar-actions",children:[Lp&&l.jsx("button",{type:"button",className:"af-icon-btn"+(ou?" af-icon-btn--active":""),"aria-label":"Composer Logs (dev)",title:"Composer Logs (dev)",onClick:()=>su(x=>!x),children:l.jsx("span",{className:"material-symbols-outlined",children:"description"})}),de==="running"&&l.jsxs("div",{className:"af-run-timer",children:[l.jsx("span",{className:"af-run-timer__dot"}),l.jsx("span",{className:"af-run-timer__label",children:"RUNTIME"}),l.jsx("span",{className:"af-run-timer__value",children:cm(La,"running")})]}),de==="stopped"&&l.jsxs("div",{className:"af-run-timer af-run-timer--stopped",children:[l.jsx("span",{className:"af-run-timer__label",children:"PAUSED"}),l.jsx("span",{className:"af-run-timer__value",children:cm(La,"stopped")})]}),(de==="done"||de==="error")&&l.jsxs("div",{className:"af-run-timer"+(de==="error"?" af-run-timer--error":" af-run-timer--done"),children:[l.jsx("span",{className:"af-run-timer__label",children:de==="error"?"FAILED":"COMPLETED"}),l.jsx("span",{className:"af-run-timer__value",children:cm(La,de)})]}),de!=="edit"&&l.jsx("button",{type:"button",className:"af-icon-btn"+(fo?" af-icon-btn--active":""),"aria-label":e("flow:topbar.executionLog"),title:e("flow:topbar.executionLog"),onClick:()=>po(x=>!x),children:l.jsx("span",{className:"material-symbols-outlined",children:"terminal"})}),de==="edit"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"af-icon-btn"+(Ve==="history"?" af-icon-btn--active":""),"aria-label":e("flow:topbar.history"),title:e("flow:topbar.history"),disabled:!a,onClick:U_,children:l.jsx("span",{className:"material-symbols-outlined",children:"history"})}),l.jsx("button",{type:"button",className:"af-icon-btn"+(Ve==="settings"?" af-icon-btn--active":""),onClick:V_,"aria-label":e("flow:topbar.pipelineSettings"),title:e("flow:topbar.pipelineSettings"),disabled:!a,children:l.jsx("span",{className:"material-symbols-outlined",children:"settings"})}),l.jsx("button",{type:"button",className:"af-composer-topbar-btn"+(Ve==="composer"?" af-composer-topbar-btn--active":"")+(Et?" af-composer-topbar-btn--running":""),onClick:W_,"aria-label":"AI Composer",title:"AI Composer",disabled:!a,children:"AI"}),l.jsx("button",{type:"button",className:"af-icon-btn af-shortcuts-trigger"+(gu?" af-icon-btn--active":""),onClick:_w,"aria-label":e("flow:topbar.shortcutsLabel"),title:e("flow:topbar.shortcutsTitle"),disabled:!a,children:l.jsx("span",{className:"af-shortcuts-trigger__mark","aria-hidden":!0,children:"?"})}),l.jsx("button",{type:"button",className:"af-icon-btn af-icon-btn--danger","aria-label":e("flow:topbar.deletePipeline"),title:e("flow:topbar.deletePipeline"),disabled:!a||a.source==="builtin"||a.source!=="user"&&a.source!=="workspace",onClick:()=>F(!0),children:l.jsx("span",{className:"material-symbols-outlined",children:"delete_forever"})}),l.jsx("button",{type:"button",className:"af-btn-pipeline-archive",disabled:!a||a.source==="builtin"||a.archived||a.source!=="user"&&a.source!=="workspace",onClick:()=>L(!0),children:"Archive"})]}),de==="running"?l.jsxs("button",{type:"button",className:"af-btn-run-stop",onClick:D_,title:e("flow:run.pauseRun"),children:[l.jsx("span",{className:"material-symbols-outlined",children:"pause"}),"Pause"]}):de==="ready"?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void _r(),title:e("flow:topbar.startRun"),children:e("flow:topbar.startRun")}),l.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:No,children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):de==="stopped"?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void _r({runUuid:xt}),title:xt?e("flow:topbar.resumeTitle",{uuid:xt}):e("flow:topbar.resumeTitleNoUuid"),children:"Resume"}),l.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:No,children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):de==="done"||de==="error"?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void _r(),title:e("flow:topbar.rerunTitle"),children:"Run"}),l.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:No,children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):l.jsxs("div",{className:"af-run-btn-group",children:[l.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg af-run-btn-main",disabled:!a,onClick:()=>void _r(),children:"Run"}),l.jsx("button",{type:"button",className:"af-run-btn-dropdown",disabled:!a,onClick:()=>Ni(x=>!x),"aria-label":e("flow:topbar.runOptions"),"aria-expanded":za,children:l.jsx("span",{className:"material-symbols-outlined",children:"arrow_drop_down"})}),za&&a&&l.jsxs("div",{className:"af-run-dropdown-menu",children:[l.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{var C,D,W,K,Y;Ni(!1);const x={};for(const G of tr){const J=ys[G.id];J&&(x[J]=((C=mo[J])==null?void 0:C.value)??((D=mo[J])==null?void 0:D.path)??((Y=(K=(W=G.data)==null?void 0:W.outputs)==null?void 0:K[0])==null?void 0:Y.default)??"")}lu(x),ls(!0)},children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit_note"}),e("flow:topbar.runWithParams")]}),l.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{Ni(!1),_r({prepareOnly:!0})},children:[l.jsx("span",{className:"material-symbols-outlined",children:"tune"}),e("flow:topbar.editRun")]}),l.jsx("div",{className:"af-run-dropdown-divider"}),l.jsxs("div",{className:"af-run-dropdown-section",children:[l.jsx("span",{className:"af-run-dropdown-section-label",children:e("flow:topbar.runWithPreset")}),l.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{Ni(!1),_r()},children:[l.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:runPreset.default")]}),Object.keys(Jr).map(x=>l.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{var W;Ni(!1);const C=Jr[x]||{},D={};for(const K of tr){const Y=ys[K.id];if(!Y)continue;const G=((W=K.data)==null?void 0:W.definitionId)||"",J=C[K.id]??"";G.startsWith("provide_file")?D[Y]={type:"file",path:J}:D[Y]={type:"str",value:J}}_r({cliInputsOverride:D})},children:[l.jsx("span",{className:"material-symbols-outlined",children:"bookmark"}),x]},x))]})]})]})]})]}),l.jsxs("div",{className:"af-pipeline-body"+(de!=="edit"?" af-pipeline-body--run-mode":""),children:[de==="edit"&&Ve!=="settings"?l.jsxs("aside",{className:"af-node-palette af-flow-left-panel",id:"af-node-palette","aria-label":e("flow:palette2.nodePalette"),children:[l.jsxs("div",{className:`af-palette-workspace${X?" af-palette-workspace--expanded":""}`,children:[l.jsxs("button",{type:"button",className:"af-palette-workspace-head",onClick:()=>se(x=>!x),"aria-expanded":X,children:[l.jsx("span",{className:"af-palette-workspace-icon material-symbols-outlined","aria-hidden":!0,children:"folder_open"}),l.jsx("span",{className:"af-palette-workspace-label",children:e("flow:palette.workspace")}),l.jsx("span",{className:"af-palette-workspace-chevron material-symbols-outlined","aria-hidden":!0,children:X?"expand_less":"expand_more"})]}),l.jsx("div",{className:"af-palette-workspace-path",title:a!=null&&a.path?C1(a.path):"",children:a!=null&&a.path?C1(a.path):e("flow:palette2.noPipelineSelected")}),X&&l.jsx("div",{className:"af-palette-workspace-tree",children:He?l.jsx("div",{className:"af-palette-workspace-loading",children:e("flow:palette.loading")}):ke.error?l.jsx("div",{className:"af-palette-workspace-empty",children:ke.error}):a?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-palette-workspace-group",children:[l.jsxs("div",{className:"af-palette-workspace-group-head",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"folder"}),l.jsx("span",{children:a.id}),l.jsxs("span",{className:"af-palette-workspace-count",children:["(",ke.files.length,")"]})]}),ke.files.length>0?l.jsx("ul",{className:"af-palette-workspace-list",children:ke.files.filter(x=>x.type==="file").map(x=>l.jsxs("li",{className:"af-palette-workspace-item af-palette-workspace-item--clickable",title:x.path,onClick:()=>I({filePath:x.path,fileName:x.name}),children:[l.jsx("span",{className:"material-symbols-outlined af-palette-workspace-item-icon","aria-hidden":!0,children:x.icon}),l.jsx("span",{className:"af-palette-workspace-item-label",children:x.name}),x.size!=null&&l.jsx("span",{className:"af-palette-workspace-item-size",children:x.size<1024?`${x.size}B`:x.size<1024*1024?`${(x.size/1024).toFixed(1)}KB`:`${(x.size/1024/1024).toFixed(1)}MB`})]},x.path))}):ke.files.filter(x=>x.type==="directory").length===0?l.jsx("div",{className:"af-palette-workspace-empty",children:"暂无文件"}):null]}),ke.files.filter(x=>{var C;return x.type==="directory"&&((C=x.children)==null?void 0:C.length)>0}).map(x=>l.jsxs("div",{className:"af-palette-workspace-group af-palette-workspace-group--sub",children:[l.jsxs("div",{className:"af-palette-workspace-group-head",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:x.icon}),l.jsxs("span",{children:[x.name,"/"]}),l.jsxs("span",{className:"af-palette-workspace-count",children:["(",x.children.length,")"]})]}),l.jsx("ul",{className:"af-palette-workspace-list",children:x.children.map(C=>l.jsxs("li",{className:`af-palette-workspace-item${C.type==="file"?" af-palette-workspace-item--clickable":""}`,title:C.path,onClick:C.type==="file"?()=>I({filePath:C.path,fileName:C.name}):void 0,children:[l.jsx("span",{className:"material-symbols-outlined af-palette-workspace-item-icon","aria-hidden":!0,children:C.icon}),l.jsx("span",{className:"af-palette-workspace-item-label",children:C.name}),C.type==="file"&&C.size!=null&&l.jsx("span",{className:"af-palette-workspace-item-size",children:C.size<1024?`${C.size}B`:C.size<1024*1024?`${(C.size/1024).toFixed(1)}KB`:`${(C.size/1024/1024).toFixed(1)}MB`})]},C.path))})]},x.path))]}):l.jsx("div",{className:"af-palette-workspace-empty",children:e("flow:palette2.noPipelineSelected")})})]}),l.jsxs("div",{className:"af-node-palette-head",children:[l.jsx("h2",{className:"af-node-palette-title",children:"Node Palette"}),l.jsxs("label",{className:"af-palette-search-wrap",children:[l.jsx("span",{className:"af-visually-hidden",children:e("flow:palette.searchNodes")}),l.jsx("span",{className:"af-palette-search-icon material-symbols-outlined","aria-hidden":!0,children:"search"}),l.jsx("input",{type:"search",className:"af-palette-search-input",value:te,onChange:x=>ae(x.target.value),placeholder:e("flow:palette.searchNodes")+"…","aria-label":e("flow:palette.searchNodes")})]})]}),o?l.jsx("p",{className:"af-err af-palette-list-err",children:o}):null,l.jsxs("div",{className:"af-node-palette-scroll",children:[xd.filter(x=>Pu[x].length>0).map(x=>l.jsxs("section",{className:`af-palette-section af-flow-palette-section--${x}`,children:[l.jsx("h3",{className:"af-palette-cat",children:x}),l.jsx("div",{className:"af-palette-cards",children:Pu[x].map(C=>l.jsxs("button",{type:"button",className:"af-palette-card",onClick:()=>vw(C),draggable:!!a,onDragStart:D=>{D.dataTransfer.setData("application/agentflow-node",C.id),D.dataTransfer.effectAllowed="move"},disabled:!a,title:C.description||C.id,children:[l.jsx("span",{className:"af-palette-card-icon","aria-hidden":!0,children:l.jsx("span",{className:"material-symbols-outlined",children:J6(x)})}),l.jsx("span",{className:"af-palette-card-label",children:C.id})]},C.id))})]},x)),a&&q.length===0?l.jsx("p",{className:"af-palette-empty",children:e("flow:palette.noComponents")}):null,a&&q.length>0&&te.trim()&&y_===0?l.jsx("p",{className:"af-palette-empty",children:e("flow:palette.noMatch")}):null,a?null:l.jsx("p",{className:"af-palette-empty",children:e("flow:palette.selectPipeline")})]}),l.jsxs("footer",{className:"af-palette-engine",children:[l.jsxs("div",{className:"af-palette-engine-head",children:[l.jsx("span",{className:"af-palette-engine-dot"+(Fn?"":" af-palette-engine-dot--offline"),"aria-hidden":!0}),l.jsx("span",{className:"af-palette-engine-label",children:e(Fn?"common:engine.online":"common:engine.offline")})]}),b?l.jsx("div",{className:"af-palette-tip"+v_,role:"status","aria-live":"polite",children:b}):null]})]}):de!=="edit"&&a?l.jsx(B6,{flowId:a.id,flowSource:a.source||"user",flowArchived:a.archived,provideNodes:tr,edges:St,nodes:ze,onCliInputsChange:Fa,onBackToEdit:No}):null,l.jsxs("div",{className:"af-pipeline-main-stack",children:[l.jsxs("div",{className:"af-pipeline-canvas-col",children:[h?l.jsx("div",{className:"af-banner af-banner--err af-pipeline-banner",children:h}):null,a&&jr.length>0&&!A?l.jsxs("div",{className:"af-banner af-banner--warn af-flow-slot-warnings",role:"region","aria-label":e("flow:validation.flowWarningAriaLabel"),children:[l.jsxs("div",{className:"af-flow-slot-warnings-head",children:[l.jsx("div",{className:"af-flow-slot-warnings-title",children:e("flow:palette.validationWarnings")}),l.jsxs("div",{className:"af-flow-slot-warnings-head-actions",children:[l.jsx("button",{type:"button",className:"af-icon-btn",disabled:z,"aria-label":e("flow:validation.reloadFromServer"),title:e("flow:validation.reloadFromServerShort"),onClick:()=>void ww(),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"refresh"})}),l.jsx("button",{type:"button",className:"af-icon-btn","aria-label":e("flow:validation.closeBanner"),title:e("common:common.close"),onClick:()=>E(!0),children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"close"})})]})]}),l.jsx("ul",{className:"af-flow-slot-warnings-list",children:jr.map(x=>l.jsxs("li",{children:[e("flow:validation.nodePrefix"),' "',l.jsx("a",{href:"#",className:"af-flow-slot-warning-node-link","aria-label":e("flow:validation.focusNodeAriaLabel",{nodeId:x.nodeId}),onClick:C=>{C.preventDefault(),E_(x.nodeId)},children:x.nodeId}),'"',x.suffix]},x.key))})]}):null,a&&jr.length>0&&A?l.jsxs("div",{className:"af-banner af-banner--warn af-flow-slot-warnings af-flow-slot-warnings--collapsed",role:"status","aria-live":"polite",children:[l.jsx("span",{className:"af-flow-slot-warnings-collapsed-text",children:e("flow:validation.slotWarningCount",{count:jr.length})}),l.jsxs("button",{type:"button",className:"af-flow-slot-warnings-kbd-hint",onClick:_w,title:e("flow:validation.shortcutHint"),children:[l.jsx("kbd",{children:"?"})," ",e("flow:validation.shortcutHintLabel")]}),l.jsxs("div",{className:"af-flow-slot-warnings-collapsed-actions",children:[l.jsx("button",{type:"button",className:"af-flow-slot-warnings-collapsed-btn",onClick:()=>E(!1),children:e("flow:validation.show")}),l.jsx("button",{type:"button",className:"af-flow-slot-warnings-collapsed-btn",disabled:z,onClick:()=>void ww(),children:e("common:common.refresh")})]})]}):null,Ve==="settings"&&a&&de==="edit"?Y_():l.jsx("div",{className:"af-react-flow-wrap af-pipeline-flow",children:a?l.jsx(m9,{fitViewEpoch:u,canvasTool:i_,nodes:p_,edges:h_,onNodesChange:de!=="edit"?void 0:d_,onEdgesChange:de!=="edit"?void 0:f_,onConnect:de!=="edit"?void 0:k_,onNodesDelete:de!=="edit"?void 0:N_,onNodeClick:b_,onEdgeClick:S_,onFlowInit:C_,onDrop:__,onDragOver:P_,hideMinimapAndControls:!!(a&&Ve),bottomSlot:de==="edit"?l.jsx("div",{className:"af-bottom-composer-stack af-flow-bottom-composer",children:l.jsxs("div",{className:"af-pipeline-composer-inner",children:[l.jsx("div",{className:"af-composer-selected","aria-label":e("flow:composer.selectedNodesAriaLabel"),children:$u.length===0?l.jsx("span",{className:"af-composer-selected-empty",children:e("flow:composer.selectedNodesEmpty")}):$u.map((x,C)=>{var oe,re;if(x.kind==="definition"){const me=x.definition,Q=String(me.label??me.id),ce=[me.id,me.description?String(me.description).slice(0,120):""].filter(Boolean).join(" — ");return l.jsxs("div",{className:"af-composer-node-chip af-composer-node-chip--definition",title:ce,children:[l.jsx("span",{className:"af-composer-node-chip-label",children:Q}),l.jsx("button",{type:"button",className:"af-composer-node-chip-dismiss",onClick:()=>Pw(x),"aria-label":e("flow:composer.removeFromInput",{id:me.id}),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]},`def-${me.id}`)}const D=x.node,W=x.kind,K=String(((oe=D.data)==null?void 0:oe.label)??D.id),Y=(re=D.data)!=null&&re.definitionId?String(D.data.definitionId):"",G=Y&&Y!==K?`${K} · ${D.id} · ${Y}`:`${K} · ${D.id}`,J=W==="canvas"?e("flow:composer.deselectNode",{id:D.id}):e("flow:composer.removeFromInput",{id:D.id});return l.jsxs("div",{className:"af-composer-node-chip"+(W==="mention"?" af-composer-node-chip--mention":""),title:G,children:[l.jsx("span",{className:"af-composer-node-chip-label",children:K}),l.jsx("button",{type:"button",className:"af-composer-node-chip-dismiss",onClick:()=>Pw(x),"aria-label":J,children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]},D.id)})}),l.jsxs("div",{className:"af-composer-card af-composer-card--input-only",children:[l.jsxs("div",{className:"af-composer-input-wrap",children:[l.jsx("textarea",{ref:Hp,className:"af-composer-textarea",placeholder:e("flow:composer.inputPlaceholder"),disabled:!a,value:Bn,rows:2,onChange:x=>{qa(x.target.value),Ga(x.target.selectionStart??x.target.value.length)},onSelect:x=>{const C=x.target;C instanceof HTMLTextAreaElement&&Ga(C.selectionStart??0)},onKeyDown:x=>{if((x.metaKey||x.ctrlKey)&&x.key==="Enter"){x.preventDefault(),Co();return}if(cl&&nr.length>0&&(x.key==="ArrowDown"||x.key==="ArrowUp"||x.key==="Enter")){if(x.key==="ArrowDown")x.preventDefault(),Qa(C=>(C+1)%nr.length);else if(x.key==="ArrowUp")x.preventDefault(),Qa(C=>(C-1+nr.length)%nr.length);else if(x.key==="Enter"){x.preventDefault();const C=nr[Xa];C&&ih(C.id)}}},onKeyUp:x=>{const C=x.target;C instanceof HTMLTextAreaElement&&Ga(C.selectionStart??C.value.length)},onClick:x=>{const C=x.target;C instanceof HTMLTextAreaElement&&Ga(C.selectionStart??0)},"aria-label":e("flow:composer.inputAriaLabel"),autoComplete:"off",spellCheck:!1}),cl&&a&&nr.length>0?l.jsxs("ul",{className:"af-composer-mention-menu",role:"listbox","aria-label":e("flow:composer.mentionAriaLabel"),children:[ul.instances.length>0?l.jsx("li",{className:"af-composer-mention-section",role:"presentation",children:l.jsx("div",{className:"af-composer-mention-section-title",children:"Instances"})}):null,ul.instances.map((x,C)=>{const D=C;return l.jsx("li",{role:"option","aria-selected":D===Xa,children:l.jsxs("button",{type:"button",className:"af-composer-mention-item"+(D===Xa?" af-composer-mention-item--active":""),onMouseDown:W=>W.preventDefault(),onMouseEnter:()=>Qa(D),onClick:()=>ih(x.id),children:[l.jsx("span",{className:"af-composer-mention-id",children:x.title}),x.subtitle?l.jsx("span",{className:"af-composer-mention-sub",children:x.subtitle}):null]})},`i-${x.id}`)}),ul.definitions.length>0?l.jsx("li",{className:"af-composer-mention-section",role:"presentation",children:l.jsx("div",{className:"af-composer-mention-section-title",children:"Node"})}):null,ul.definitions.map((x,C)=>{const D=ul.instances.length+C;return l.jsx("li",{role:"option","aria-selected":D===Xa,children:l.jsxs("button",{type:"button",className:"af-composer-mention-item"+(D===Xa?" af-composer-mention-item--active":""),onMouseDown:W=>W.preventDefault(),onMouseEnter:()=>Qa(D),onClick:()=>ih(x.id),children:[l.jsx("span",{className:"af-composer-mention-id",children:x.title}),x.subtitle?l.jsx("span",{className:"af-composer-mention-sub",children:x.subtitle}):null]})},`d-${x.id}`)})]}):null]}),l.jsxs("div",{className:"af-composer-toolbar",children:[Hn.length>0&&l.jsx("label",{className:"af-composer-session-field",children:l.jsxs("select",{className:"af-composer-session-select",value:Yt||"",onChange:x=>{x.target.value==="__new__"?uw():hw(x.target.value)},disabled:Et,"aria-label":e("flow:composer.switchConversation"),children:[Hn.map(x=>l.jsxs("option",{value:x.id,children:[x.label,x.running?" ⏳":""]},x.id)),l.jsxs("option",{value:"__new__",children:["+ ",e("flow:composer.newConversation")]})]})}),l.jsxs("label",{className:"af-composer-model-field",children:[l.jsx("span",{className:"af-visually-hidden",children:e("flow:composer.modelLabel")}),l.jsxs("select",{className:"af-composer-model-select",value:(So||"").trim()?dn.currentNotInLists?dn.currentNotInLists:vd(So,dn.cursorList,dn.opencodeList,dn.claudeCodeList):"",onChange:x=>ow(x.target.value),disabled:!a||Et,"aria-label":e("flow:composer.modelAriaLabel"),children:[l.jsx("option",{value:"",children:e("flow:composer.modelDefault")}),dn.currentNotInLists?l.jsxs("option",{value:dn.currentNotInLists,children:[dn.currentNotInLists,e("flow:composer.modelNotInList")]}):null,dn.cursorList.length>0?l.jsx("optgroup",{label:"Cursor",children:dn.cursorList.map(x=>l.jsx("option",{value:si(x),children:x},`composer-c-${x}`))}):null,dn.opencodeList.length>0?l.jsx("optgroup",{label:"OpenCode",children:dn.opencodeList.map(x=>l.jsx("option",{value:`opencode:${si(x)}`,children:x},`composer-o-${x}`))}):null,dn.claudeCodeList.length>0?l.jsx("optgroup",{label:"Claude Code",children:dn.claudeCodeList.map(x=>l.jsx("option",{value:`claude-code:${si(x)}`,children:x},`composer-cc-${x}`))}):null]})]}),l.jsx("button",{type:"button",className:"af-composer-send"+(a&&Bn.trim()&&!Et?" af-composer-send--active":"")+(Et?" af-composer-send--stop":""),disabled:!a||!Et&&!Bn.trim(),"aria-label":e(Et?"flow:composer.stopGeneration":"flow:composer.send"),title:Et?e("flow:composer.stopGeneration"):void 0,onClick:()=>{var x;if(Et){(x=ku.current)==null||x.abort();return}Co()},children:l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:Et?"stop":"arrow_upward"})})]})]}),Yp?ui.createPortal(l.jsx("div",{className:"af-node-props-expand-overlay af-composer-thread-dialog-overlay",role:"dialog","aria-modal":"true","aria-label":e("flow:composer.conversationOutput"),onMouseDown:x=>{x.target===x.currentTarget&&Su(!1)},children:l.jsxs("div",{className:"af-node-props-expand-panel af-composer-thread-dialog-panel",children:[l.jsxs("div",{className:"af-node-props-expand-head af-composer-thread-dialog-head",children:[l.jsxs("div",{className:"af-composer-thread-dialog-head-main",children:[l.jsx("span",{className:"af-node-props-expand-title",children:e("flow:nodeProps.conversationOutput")}),l.jsx("div",{className:"af-composer-thread-dialog-status"+(Et?" af-composer-thread-dialog-status--running":""),role:"status","aria-live":"polite",title:el||void 0,children:Et&&!el?e("flow:composer.executing"):el||e("flow:composer.ready")})]}),l.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>Su(!1),"aria-label":e("flow:composer.collapseAriaLabel"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),aw.length>1&&!(Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1)?l.jsx("div",{className:"af-composer-steps-track-wrap",children:l.jsx(r9,{steps:aw})}):null,Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1?l.jsx("div",{className:"af-composer-phase-bar","aria-label":e("flow:composer.phaseProgress"),children:Ae.phases.map((x,C)=>{const D=x.status||(C<(Ae.currentPhase??0)?"done":C===(Ae.currentPhase??0)?Et?"running":Ae.nextPhase||Ae.isLastPhase?"done":"running":"pending");return l.jsxs("div",{className:"af-composer-phase-item"+(D==="done"?" af-composer-phase-item--done":"")+(D==="running"?" af-composer-phase-item--running":"")+(D==="pending"?" af-composer-phase-item--pending":""),title:`${x.label}${x.description?":"+x.description:""}`,children:[l.jsx("span",{className:"af-composer-phase-dot","aria-hidden":!0,children:D==="done"?l.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.85rem"},children:"check"}):l.jsx("span",{children:C+1})}),l.jsx("span",{className:"af-composer-phase-label",children:x.label})]},x.name||C)})}):null,l.jsx("div",{className:"af-composer-thread-dialog-scroll",children:l.jsx(j1,{thread:nl,liveSegments:tl,running:Et})}),Ae&&!Ae.isLastPhase&&Ae.nextPhase&&!Et?l.jsxs("div",{className:"af-composer-phase-review af-composer-phase-review--minimal","aria-label":e("flow:composer.phaseReviewLabel"),children:[l.jsx("span",{className:"af-composer-phase-auto-hint",children:e("flow:composer.phaseReviewHint",{nextPhase:Ae.nextPhase.label})}),l.jsxs("div",{className:"af-composer-phase-review-buttons",children:[l.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--continue",onClick:jw,children:e("flow:composer.phaseReviewContinue",{label:Ae.nextPhase.label})}),l.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--skip",onClick:Ew,children:e("flow:composer.phaseReviewSkip")})]})]}):null]})}),document.body):null]})}):null}):l.jsx("div",{className:"af-placeholder af-pipeline-placeholder",children:e("flow:pipeline.selectPipeline")})})]}),de!=="edit"&&fo&&l.jsxs("div",{className:"af-run-console",style:{height:Oa},children:[l.jsx("div",{className:"af-run-console__resize",role:"separator","aria-orientation":"horizontal","aria-label":e("flow:run.resizeConsole"),onPointerDown:R_,onPointerMove:L_,onPointerUp:kw,onPointerCancel:kw,onLostPointerCapture:O_}),l.jsxs("div",{className:"af-run-console__head",children:[l.jsxs("span",{className:"af-run-console__title",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"terminal"}),"EXECUTION CONSOLE"]}),l.jsxs("div",{className:"af-run-console__head-right",children:[de==="running"&&l.jsx("span",{className:"af-run-console__live-badge",children:"LIVE"}),l.jsx("button",{type:"button",className:"af-icon-btn af-run-console__close",onClick:()=>po(!1),"aria-label":e("flow:run.closeLog"),children:l.jsx("span",{className:"material-symbols-outlined",children:"expand_more"})})]})]}),l.jsxs("div",{className:"af-run-console__body",children:[Nt.map((x,C)=>l.jsxs("div",{className:"af-run-console__line"+(x.type==="error"?" af-run-console__line--error":"")+(x.type==="warn"?" af-run-console__line--warn":"")+(x.type==="node-start"?" af-run-console__line--start":"")+(x.type==="node-done"?" af-run-console__line--done":"")+(x.type==="node-failed"?" af-run-console__line--error":"")+(x.type==="done"?" af-run-console__line--done":""),children:[l.jsxs("span",{className:"af-run-console__ts",children:["[",x.ts?new Date(x.ts).toLocaleTimeString():"--:--:--","]"]}),l.jsx("span",{className:"af-run-console__text",children:x.text!=null?String(x.text):""})]},C)),l.jsx("div",{ref:xo})]})]})]}),de!=="edit"&&Da&&a?l.jsx(D6,{instanceId:Da,flowId:a.id,runId:xt,nodeStatus:((Iw=is[Da])==null?void 0:Iw.status)??null,onClose:()=>as(null)}):null,Ve&&Ve!=="settings"&&a&&de==="edit"?l.jsx("aside",{className:"af-pipeline-drawer"+(Ve==="node"?" af-pipeline-drawer--wide":"")+(Ve==="composer"?" af-pipeline-drawer--wide":""),"aria-label":Ve==="settings"?e("flow:settings.title"):Ve==="history"?e("flow:history.title"):Ve==="composer"?"AI Composer":e("flow:nodeProps.title"),children:Ve==="composer"?l.jsxs("div",{className:"af-composer-sidebar",children:[l.jsxs("div",{className:"af-pipeline-drawer-head",children:[l.jsx("h2",{className:"af-pipeline-drawer-title",children:"AI Composer"}),l.jsx("button",{type:"button",className:"af-pipeline-drawer-close af-icon-btn",onClick:dl,"aria-label":e("flow:composer.closeSidebar"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),Hn.length>0&&l.jsxs("div",{className:"af-composer-session-tabs",children:[Hn.map(x=>l.jsxs("button",{type:"button",ref:C=>{C&&x.id===Yt&&C.scrollIntoView({block:"nearest",inline:"nearest"})},className:["af-composer-session-tab",x.id===Yt?"af-composer-session-tab--active":"",x.running?"af-composer-session-tab--running":""].filter(Boolean).join(" "),onClick:()=>hw(x.id),title:x.label,children:[l.jsx("span",{className:"af-composer-session-label",children:x.label}),(Hn.length>1||x.running)&&l.jsx("span",{className:"af-composer-session-close",onClick:C=>{C.stopPropagation(),u_(x.id)},title:x.running?e("flow:composer.endConversation"):e("flow:composer.closeConversation"),children:l.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.75rem"},children:"close"})})]},x.id)),l.jsx("button",{type:"button",className:"af-composer-session-add",onClick:()=>uw(),title:e("flow:composer.newConversation"),children:l.jsx("span",{className:"material-symbols-outlined",children:"add"})})]}),l.jsx("div",{className:"af-composer-sidebar-status"+(Et?" af-composer-sidebar-status--running":""),role:"status","aria-live":"polite",children:Et&&!el?e("flow:composer.executing"):el||e("flow:composer.ready")}),Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1?l.jsx("div",{className:"af-composer-phase-bar","aria-label":e("flow:composer.phaseProgress"),children:Ae.phases.map((x,C)=>{const D=x.status||(C<(Ae.currentPhase??0)?"done":C===(Ae.currentPhase??0)?Et?"running":Ae.isLastPhase&&C===Ae.phases.length-1||Ae.nextPhase?"done":"running":"pending");return l.jsxs("div",{className:"af-composer-phase-item"+(D==="done"?" af-composer-phase-item--done":"")+(D==="running"?" af-composer-phase-item--running":"")+(D==="pending"?" af-composer-phase-item--pending":""),title:`${x.label}${x.description?":"+x.description:""}`,children:[l.jsx("span",{className:"af-composer-phase-dot","aria-hidden":!0,children:D==="done"?l.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.85rem"},children:"check"}):l.jsx("span",{children:C+1})}),l.jsx("span",{className:"af-composer-phase-label",children:x.label})]},x.name||C)})}):null,l.jsx("div",{className:"af-composer-sidebar-thread",ref:cw,children:l.jsx(j1,{thread:nl,liveSegments:tl,running:Et})}),Ae&&!Ae.isLastPhase&&Ae.nextPhase&&!Et?l.jsxs("div",{className:"af-composer-phase-review af-composer-phase-review--minimal","aria-label":e("flow:composer.phaseReviewLabel"),children:[l.jsx("span",{className:"af-composer-phase-auto-hint",children:e("flow:composer.phaseReviewHint",{nextPhase:Ae.nextPhase.label})}),l.jsxs("div",{className:"af-composer-phase-review-buttons",children:[l.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--continue",onClick:jw,children:e("flow:composer.phaseReviewContinue",{label:Ae.nextPhase.label})}),l.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--skip",onClick:Ew,children:e("flow:composer.phaseReviewSkip")})]})]}):null]}):Ve==="node"&&Pe?Le?l.jsx(Y4,{draft:Le,setDraft:Vp,definitionId:String(((Aw=Pe.data)==null?void 0:Aw.definitionId)??Pe.id),systemPromptReadonly:String((Qp==null?void 0:Qp.description)??""),modelLists:_e,disabled:!a,onIdBlur:T_,onClose:dl,onPublishToMarketplace:w_,error:a_,ioSlots:{inputs:Array.isArray(Le==null?void 0:Le.inputs)?Le.inputs:[],outputs:Array.isArray(Le==null?void 0:Le.outputs)?Le.outputs:[]}}):l.jsx("div",{className:"af-pipeline-drawer-body",children:l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:pipeline.loadingProps")})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-pipeline-drawer-head",children:[l.jsx("h2",{className:"af-pipeline-drawer-title",children:e(Ve==="settings"?"flow:settings.title":"flow:history.title")}),l.jsx("button",{type:"button",className:"af-pipeline-drawer-close af-icon-btn",onClick:dl,"aria-label":e("flow:composer.closeSidebar"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx("div",{className:"af-pipeline-drawer-body",children:Ve==="settings"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.pipelineId")}),(a.source==="user"||a.source==="workspace")&&!a.archived?l.jsxs("div",{className:"af-pipeline-rename-row",children:[l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:j,onChange:x=>{k(x.target.value),H("")},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Ou())},onBlur:()=>{j.trim()&&j.trim()!==a.id&&Ou()},placeholder:a.id,disabled:_,spellCheck:!1}),l.jsx("span",{className:"af-pipeline-drawer-badge",children:Po(a.source??"user",e)})]}):l.jsxs("div",{className:"af-pipeline-drawer-readonly",children:[a.id,l.jsx("span",{className:"af-pipeline-drawer-badge",children:Po(a.source??"user",e)}),a.archived?l.jsx("span",{className:"af-pipeline-drawer-badge af-pipeline-drawer-badge--muted",children:e("flow:settings.archived")}):null]}),M?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:M}):null]}),typeof a.path=="string"&&a.path?l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.diskPath")}),l.jsxs("div",{className:"af-pipeline-drawer-readonly af-pipeline-drawer-readonly--mono af-pipeline-path-row",children:[l.jsx("span",{className:"af-pipeline-path-text",children:a.path}),l.jsx("button",{type:"button",className:"af-icon-btn af-pipeline-copy-btn",onClick:()=>bw(a.path),title:e("flow:settings.copyPath"),children:l.jsx("span",{className:"material-symbols-outlined",children:P?"check":"content_copy"})})]})]}):null,a.source==="user"||a.source==="workspace"?a.archived?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.archivedNote")}):l.jsxs("div",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.storageLocation")}),l.jsx("div",{className:"af-pipeline-move-actions",children:a.source==="user"?l.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>Lu("workspace"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToWorkspace")}):l.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>Lu("user"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToUserDir")})}),g?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:g}):null]}):l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.builtinNote")}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.introduction")}),l.jsx("textarea",{className:"af-pipeline-drawer-textarea",value:d,onChange:x=>f(x.target.value),placeholder:e("flow:pipeline.introductionPlaceholder"),rows:5,spellCheck:!1})]}),l.jsxs("div",{className:"af-pipeline-meta-card",children:[l.jsx("h3",{className:"af-pipeline-meta-title",children:e("flow:schedule.title")}),cu?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"af-new-pipeline-radio",children:[l.jsx("input",{type:"checkbox",checked:!!At.enabled,disabled:er||a.archived||a.source==="builtin",onChange:x=>ji(C=>({...C,enabled:x.target.checked}))}),l.jsx("span",{children:e("flow:schedule.enabled")})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.cron")}),l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:At.cron||"",disabled:er||a.archived||a.source==="builtin",onChange:x=>ji(C=>({...C,cron:x.target.value})),placeholder:"0 9 * * *",spellCheck:!1})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.timezone")}),l.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:At.timezone||"",disabled:er||a.archived||a.source==="builtin",onChange:x=>ji(C=>({...C,timezone:x.target.value})),placeholder:"Asia/Shanghai",spellCheck:!1})]}),l.jsxs("label",{className:"af-pipeline-drawer-field",children:[l.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.preset")}),l.jsxs("select",{className:"af-pipeline-flow-select",value:At.preset||"",disabled:er||a.archived||a.source==="builtin",onChange:x=>ji(C=>({...C,preset:x.target.value})),children:[l.jsx("option",{value:"",children:e("flow:schedule.defaultPreset")}),Object.keys(Jr).map(x=>l.jsx("option",{value:x,children:x},x))]})]}),l.jsx("div",{className:"af-pipeline-drawer-readonly",children:l.jsx("span",{children:e("flow:schedule.overlapSkip")})}),At.nextRunAt?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.nextRun",{time:new Date(At.nextRunAt).toLocaleString()})}):l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.noNextRun")}),l.jsxs("dl",{className:"af-pipeline-meta-dl",children:[l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.runtime")}),l.jsx("dd",{children:pt!=null&&pt.running?e("flow:schedule.running"):At.enabled?e("flow:schedule.waiting"):e("flow:schedule.disabled")})]}),Xe.lastTriggeredAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastTriggeredAt")}),l.jsx("dd",{children:new Date(Xe.lastTriggeredAt).toLocaleString()})]}):null,Xe.lastSkippedAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastSkippedAt")}),l.jsxs("dd",{children:[new Date(Xe.lastSkippedAt).toLocaleString(),Xe.lastSkipReason?` · ${Xe.lastSkipReason}`:""]})]}):null,Xe.lastRunUuid?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastRun")}),l.jsx("dd",{children:Xe.lastRunUuid})]}):null,Xe.lastExitCode!=null?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastExit")}),l.jsx("dd",{children:String(Xe.lastExitCode)})]}):null,Xe.lastFinishedAt?l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:schedule.lastFinishedAt")}),l.jsx("dd",{children:new Date(Xe.lastFinishedAt).toLocaleString()})]}):null]}),pt!=null&&pt.lastError||Xe.lastError?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:(pt==null?void 0:pt.lastError)||Xe.lastError}):null,a.archived||a.source==="builtin"?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.readonlyNote")}):null,ds?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:ds}):null,fs?l.jsx("p",{className:"af-pipeline-drawer-muted",children:fs}):null,l.jsx("button",{type:"button",className:"af-btn-secondary",disabled:er||a.archived||a.source==="builtin",onClick:eh,children:e(er?"flow:schedule.saving":"flow:schedule.save")})]})]}),l.jsxs("div",{className:"af-pipeline-meta-card",children:[l.jsx("h3",{className:"af-pipeline-meta-title",children:e("flow:pipeline.metadata")}),l.jsx("dl",{className:"af-pipeline-meta-dl",children:l.jsxs("div",{className:"af-pipeline-meta-row",children:[l.jsx("dt",{children:e("flow:pipeline.nodeCount")}),l.jsxs("dd",{children:[ze.length," ",e("flow:pipeline.nodesUnit")]})]})})]}),l.jsx("button",{type:"button",className:"af-pipeline-drawer-link",onClick:()=>t("/settings"),children:e("flow:settings.globalSettings")})]}):l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"af-pipeline-drawer-lead",children:[e("flow:settings.currentPipeline"),l.jsx("strong",{children:a.id})]}),uo?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):br?l.jsx("p",{className:"af-err af-pipeline-drawer-err",children:br}):ll.length===0?l.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:pipeline.noRuns")}):l.jsxs(l.Fragment,{children:[nn.success+nn.failed+nn.running+nn.stopped+nn.interrupted>0?l.jsxs("div",{className:"af-exec-history-summary","aria-label":e("flow:history.summary"),children:[nn.success>0?l.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--success",children:e("flow:history.successCount",{count:nn.success})}):null,nn.failed>0?l.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--failed",children:e("flow:history.failedCount",{count:nn.failed})}):null,nn.stopped>0?l.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--stopped",children:e("flow:history.stoppedCount",{count:nn.stopped})}):null,nn.interrupted>0?l.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--interrupted",children:e("flow:history.interruptedCount",{count:nn.interrupted})}):null,nn.running>0?l.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--running",children:e("flow:history.runningCount",{count:nn.running})}):null]}):null,l.jsx("ul",{className:"af-exec-history-list",children:ll.map((x,C)=>{const D=x.status||"unknown",W=D==="success"?"af-exec-history-card--success":D==="failed"?"af-exec-history-card--failed":D==="stopped"?"af-exec-history-card--stopped":D==="interrupted"?"af-exec-history-card--interrupted":D==="running"?"af-exec-history-card--running":"af-exec-history-card--unknown",K=e(D==="success"?"flow:history.success":D==="failed"?"flow:history.failed":D==="stopped"?"flow:history.stopped":D==="interrupted"?"flow:history.interrupted":D==="running"?"flow:history.running":"flow:history.unknown"),Y=D==="success"?"check_circle":D==="failed"?"error":D==="stopped"?"stop_circle":D==="interrupted"?"sync_disabled":D==="running"?"progress_activity":"help",G=x.runId||`${x.at}-${C}`,J=x.runId!=null&&x.runId.length>=6?e("flow:history.runLabel",{id:x.runId.length>8?x.runId.slice(-8):x.runId}):e("flow:history.runLabel",{id:ll.length-C});return l.jsx("li",{className:"af-exec-history-list-item",children:l.jsxs("button",{type:"button",className:`af-exec-history-card ${W}`,onClick:()=>H_(x),title:e("flow:history.enterRunView"),children:[l.jsxs("div",{className:"af-exec-history-card-top",children:[l.jsx("span",{className:"af-exec-history-card-title",children:J}),l.jsx("span",{className:"af-exec-history-card-time",children:xg(x.at,e)})]}),l.jsxs("div",{className:"af-exec-history-card-bottom",children:[l.jsxs("span",{className:"af-exec-history-card-status",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:Y}),K]}),l.jsxs("span",{className:"af-exec-history-card-duration",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"timer"}),GA(x.durationMs,e)]})]})]})},`${a.id}-${G}`)})})]})]})})]})}):null]}),l.jsx(xb,{open:M_,title:e("flow:run.pauseTitle",{defaultValue:"暂停运行"}),message:e("flow:run.pauseConfirm"),confirmLabel:e("flow:run.pauseConfirmOk",{defaultValue:"暂停"}),onConfirm:F_,onCancel:()=>rh(!1)}),l.jsx(xb,{open:$_,title:e("flow:run.backPromptTitle",{defaultValue:"返回项目列表"}),message:e("flow:run.backPromptMessage",{defaultValue:"流水线仍在运行,请选择处理方式:后台继续运行并退出,或停止后返回编辑。"}),confirmLabel:e("flow:run.backBackground",{defaultValue:"后台运行并退出"}),secondaryLabel:e("flow:run.backStopEdit",{defaultValue:"停止并进入编辑"}),secondaryDestructive:!0,onConfirm:B_,onSecondary:z_,onCancel:()=>Fu(!1)}),l.jsx(T4,{open:gu,onClose:()=>Ja(!1)}),q_(),l.jsx(L4,{open:Bp,onClose:()=>iw(!1),onJump:j_,nodes:ze}),l.jsx(Y6,{open:ou,onClose:()=>su(!1),flowId:(a==null?void 0:a.id)??""}),l.jsx(_4,{open:V,onClose:()=>L(!1),flowId:(a==null?void 0:a.id)??"",flowSource:(a==null?void 0:a.source)??"user",onArchived:async()=>{L(!1),await Iu(),t("/projects?tab=archived")}}),l.jsx(I4,{open:B&&!!(a!=null&&a.id),onClose:()=>F(!1),flowId:(a==null?void 0:a.id)??"",flowSource:(a==null?void 0:a.source)??"user",flowArchived:!!(a!=null&&a.archived),onDeleted:async()=>{F(!1),c(null),We([]),Ot([]),il(null),await Iu(),t("/projects")}}),l.jsx(O4,{open:!!$,onClose:()=>I(null),flowId:(a==null?void 0:a.id)??"",flowSource:(a==null?void 0:a.source)??"user",flowArchived:!!(a!=null&&a.archived),filePath:($==null?void 0:$.filePath)??"",fileName:($==null?void 0:$.fileName)??"",onSaved:()=>{Ie(x=>({...x}))}})]}),Ct&&de!=="edit"&&ui.createPortal(l.jsx("div",{className:"af-user-check-modal-overlay",children:l.jsxs("div",{className:"af-user-check-modal",role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"af-user-check-modal__head",children:[l.jsxs("span",{className:"af-user-check-modal__title",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"fact_check"}),e("flow:userCheck.title",{instanceId:Ct.instanceId})]}),l.jsx("div",{className:"af-user-check-modal__actions",children:tw?l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--save",onClick:async()=>{if(!Ct||!a||!xt)return;const x=vo||Ct.content;try{(await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",action:"save-user-check-content",runUuid:xt,instanceId:Ct.instanceId,content:x})})).ok?(hs(D=>D&&{...D,content:x}),Ka(!1),Ee(D=>[...D,{ts:new Date().toISOString(),type:"info",text:e("flow:userCheck.contentSaved")}])):Ee(D=>[...D,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}catch{Ee(C=>[...C,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}},children:[l.jsx("span",{className:"material-symbols-outlined",children:"save"}),e("flow:userCheck.save")]}),l.jsxs("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>{bo(Ct.content),Ka(!1)},children:[l.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:userCheck.cancel")]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>Ka(!0),children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit"}),e("flow:userCheck.edit")]}),l.jsx("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>hs(null),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]})})]}),l.jsx("div",{className:"af-user-check-modal__body",children:tw?l.jsx("textarea",{ref:r_,className:"af-user-check-modal__textarea",value:vo||Ct.content,onChange:x=>bo(x.target.value)}):l.jsx("div",{className:"af-user-check-modal__preview",children:l.jsx("pre",{children:vo||Ct.content})})}),l.jsxs("div",{className:"af-user-check-modal__ai-bar",children:[l.jsx("input",{type:"text",className:"af-user-check-modal__ai-input",placeholder:e("flow:userCheck.aiEditPlaceholder"),value:du,onChange:x=>fu(x.target.value),disabled:Dp}),l.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--ai",disabled:Dp||!du.trim(),onClick:()=>{!Ct||!a||!xt||!du.trim()||(pu(!0),Ee(x=>[...x,{ts:new Date().toISOString(),type:"info",text:e("flow:userCheck.aiEditStarted")}]),fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",action:"ai-edit-user-check-content",runUuid:xt,instanceId:Ct.instanceId,content:vo||Ct.content,prompt:du})}).then(x=>x.json()).then(x=>{pu(!1),x.ok&&x.content?(bo(x.content),Ka(!0),fu(""),Ee(C=>[...C,{ts:new Date().toISOString(),type:"info",text:e("flow:userCheck.aiEditDone")}])):Ee(C=>[...C,{ts:new Date().toISOString(),type:"error",text:x.error||e("flow:userCheck.aiEditFailed")}])}).catch(()=>{pu(!1),Ee(x=>[...x,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.aiEditFailed")}])}))},children:[Dp?l.jsx("span",{className:"material-symbols-outlined af-spin",children:"sync"}):l.jsx("span",{className:"material-symbols-outlined",children:"auto_fix_high"}),e("flow:userCheck.aiEditBtn")]})]}),l.jsxs("div",{className:"af-user-check-modal__foot",children:[l.jsx("span",{className:"af-user-check-modal__hint",children:e("flow:userCheck.hint")}),l.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--continue",onClick:async()=>{if(!Ct||!a||!xt)return;const x=vo||Ct.content;try{(await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",action:"save-user-check-content",runUuid:xt,instanceId:Ct.instanceId,content:x})})).ok?(await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",action:"confirm-user-check",runUuid:xt,instanceId:Ct.instanceId,execId:Ct.execId})}),hs(null),fu(""),_r({runUuid:xt})):Ee(D=>[...D,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}catch{Ee(C=>[...C,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}},children:[l.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:userCheck.continue")]})]})]})}),document.body),ei&&de!=="edit"&&ui.createPortal(l.jsx("div",{className:"af-user-ask-modal-overlay",children:l.jsxs("div",{className:"af-user-ask-modal",role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"af-user-ask-modal__head",children:[l.jsxs("span",{className:"af-user-ask-modal__title",children:[l.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"help"}),e("flow:userAsk.title",{instanceId:ei.instanceId})]}),l.jsx("div",{className:"af-user-ask-modal__actions",children:l.jsx("button",{type:"button",className:"af-user-ask-modal__btn",onClick:()=>Fp(null),"aria-label":e("flow:userAsk.close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})})]}),l.jsxs("div",{className:"af-user-ask-modal__body",children:[ei.question.trim()?l.jsx("div",{className:"af-user-ask-modal__question",children:l.jsx("pre",{children:ei.question})}):null,ei.options.length===0?l.jsx("div",{className:"af-user-ask-modal__empty",children:e("flow:userAsk.noOptions")}):l.jsx("div",{className:"af-user-ask-modal__options",children:ei.options.map(x=>l.jsxs("button",{type:"button",className:"af-user-ask-option",disabled:nw,onClick:async()=>{if(!(!ei||!a||!xt)){Ya(!0);try{(await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",action:"confirm-user-ask",runUuid:xt,instanceId:ei.instanceId,execId:ei.execId,branch:x.name,selectedIndex:x.index,selectedLabel:x.label})})).ok?(Fp(null),Ya(!1),_r({runUuid:xt})):(Ya(!1),Ee(D=>[...D,{ts:new Date().toISOString(),type:"error",text:e("flow:userAsk.submitFailed")}]))}catch{Ya(!1),Ee(C=>[...C,{ts:new Date().toISOString(),type:"error",text:e("flow:userAsk.submitFailed")}])}}},children:[l.jsxs("span",{className:"af-user-ask-option__index",children:["[",x.index,"]"]}),l.jsx("span",{className:"af-user-ask-option__label",children:x.label})]},x.name))})]}),l.jsx("div",{className:"af-user-ask-modal__foot",children:l.jsx("span",{className:"af-user-ask-modal__hint",children:e(nw?"flow:userAsk.submitting":"flow:userAsk.hint")})})]})}),document.body),ms&&de!=="edit"&&l.jsxs("div",{className:"af-tool-print-toast",role:"status","aria-live":"polite",children:[l.jsxs("div",{className:"af-tool-print-toast__head",children:[l.jsx("span",{className:"material-symbols-outlined",children:"print"}),l.jsx("span",{className:"af-tool-print-toast__title",children:e("flow:toolPrint.title",{instanceId:ms.instanceId})}),l.jsx("button",{type:"button",className:"af-tool-print-toast__close",onClick:()=>rw(null),"aria-label":e("common:close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsxs("div",{className:"af-tool-print-toast__body",children:[l.jsx("pre",{children:ms.content.length>500?ms.content.slice(0,500):ms.content}),ms.content.length>500&&l.jsx("span",{className:"af-tool-print-toast__more",children:e("flow:toolPrint.truncated")})]})]}),gs&&l.jsx("div",{className:"af-provide-edit-overlay",children:l.jsxs("div",{className:"af-provide-edit-modal",role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"af-provide-edit-modal__head",children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit_document"}),l.jsx("span",{className:"af-provide-edit-modal__title",children:gs.label}),l.jsx("button",{type:"button",className:"af-provide-edit-modal__close",onClick:()=>hu(null),"aria-label":e("common:close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx("div",{className:"af-provide-edit-modal__body",children:l.jsx("textarea",{ref:$p,className:"af-provide-edit-modal__textarea",defaultValue:gs.content,autoFocus:!0})}),l.jsxs("div",{className:"af-provide-edit-modal__foot",children:[l.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn af-provide-edit-modal__btn--save",onClick:m_,children:[l.jsx("span",{className:"material-symbols-outlined",children:"save"}),e("flow:provideEdit.save")]}),l.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn",onClick:()=>hu(null),children:[l.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:provideEdit.cancel")]})]})]})}),Mp&&l.jsx("div",{className:"af-run-params-overlay",children:l.jsxs("div",{className:"af-run-params-modal",role:"dialog","aria-modal":"true",children:[l.jsxs("div",{className:"af-run-params-modal__head",children:[l.jsx("span",{className:"material-symbols-outlined",children:"edit_note"}),l.jsx("span",{className:"af-run-params-modal__title",children:e("flow:runParams.title")}),l.jsx("button",{type:"button",className:"af-run-params-modal__close",onClick:()=>ls(!1),"aria-label":e("common:close"),children:l.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),l.jsx("div",{className:"af-run-params-modal__body",children:tr.length===0?l.jsx("div",{className:"af-run-params-empty",children:e("flow:runParams.noParams")}):l.jsx("div",{className:"af-run-params-list",children:tr.map(x=>{var G,J;const C=ys[x.id];if(!C)return null;const W=(((G=x.data)==null?void 0:G.definitionId)||"").startsWith("provide_file"),K=((J=x.data)==null?void 0:J.label)||x.id,Y=au[C]??"";return l.jsxs("div",{className:"af-run-params-item",children:[l.jsxs("div",{className:"af-run-params-item__head",children:[l.jsx("span",{className:"af-run-params-item__icon material-symbols-outlined"+(W?" af-run-params-item__icon--file":""),children:W?"description":"text_fields"}),l.jsx("span",{className:"af-run-params-item__label",children:K}),l.jsx("span",{className:"af-run-params-item__slot",children:C})]}),l.jsx("input",{type:"text",className:"af-run-params-item__input",value:Y,onChange:oe=>lu(re=>({...re,[C]:oe.target.value})),placeholder:e(W?"flow:runConfig.filePathPlaceholder":"flow:runConfig.stringValuePlaceholder")})]},x.id)})})}),l.jsxs("div",{className:"af-run-params-modal__foot",children:[l.jsxs("button",{type:"button",className:"af-run-params-modal__btn af-run-params-modal__btn--run",onClick:()=>{var C;const x={};for(const D of tr){const W=ys[D.id];if(!W)continue;const K=((C=D.data)==null?void 0:C.definitionId)||"",Y=au[W]??"";K.startsWith("provide_file")?x[W]={type:"file",path:Y}:x[W]={type:"str",value:Y}}ls(!1),Ni(!1),_r({cliInputsOverride:x})},children:[l.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:runParams.run")]}),l.jsxs("button",{type:"button",className:"af-run-params-modal__btn",onClick:()=>ls(!1),children:[l.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:runParams.cancel")]})]})]})})]})})}const je=e=>typeof e=="string",jl=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},T1=e=>e==null?"":""+e,w9=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},v9=/###/g,R1=e=>e&&e.indexOf("###")>-1?e.replace(v9,"."):e,L1=e=>!e||je(e),ec=(e,t,n)=>{const r=je(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(L1(e))return{};const o=R1(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return L1(e)?{}:{obj:e,k:R1(r[i])}},O1=(e,t,n)=>{const{obj:r,k:i}=ec(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=ec(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=ec(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},b9=(e,t,n,r)=>{const{obj:i,k:o}=ec(e,t,Object);i[o]=i[o]||[],i[o].push(n)},$f=(e,t)=>{const{obj:n,k:r}=ec(e,t);if(n)return n[r]},S9=(e,t,n)=>{const r=$f(e,n);return r!==void 0?r:$f(t,n)},vP=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?je(e[r])||e[r]instanceof String||je(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):vP(e[r],t[r],n):e[r]=t[r]);return e},Cs=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var k9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const N9=e=>je(e)?e.replace(/[&<>"'\/]/g,t=>k9[t]):e;class C9{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const E9=[" ",",","?","!",";"],j9=new C9(20),P9=(e,t,n)=>{t=t||"",n=n||"";const r=E9.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=j9.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},ny=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let s,a="";for(let c=o;c<r.length;++c)if(c!==o&&(a+=n),a+=r[c],s=i[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&c<r.length-1)continue;o+=c-o+1;break}i=s}return i},zf=e=>e&&e.replace("_","-"),_9={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Bf{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||_9,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(je(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Bf(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Bf(this.logger,t)}}var Fr=new Bf;class Pp{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a.apply(a,[t,...r])})}}class M1 extends Pp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):je(r)&&o?a.push(...r.split(o)):a.push(r)));const c=$f(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!s||!je(r)?c:ny(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),O1(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(je(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let c=$f(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?vP(c,r,o):c={...c,...r},O1(this.data,a,c),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var bP={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const D1={};class Hf extends Pp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),w9(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!P9(t,r,i);if(s&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:je(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:je(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],u=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(p){const N=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${N}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${N}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||s,m=d&&d.exactUsedKey||s,b=Object.prototype.toString.apply(f),S=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!je(f)&&typeof f!="boolean"&&typeof f!="number";if(v&&f&&y&&S.indexOf(b)<0&&!(je(g)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=N,d.usedParams=this.getUsedParamsDetails(n),d):N}if(o){const N=Array.isArray(f),j=N?[]:{},k=N?m:h;for(const _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){const R=`${k}${o}${_}`;j[_]=this.translate(R,{...n,joinArrays:!1,ns:a}),j[_]===R&&(j[_]=f[_])}f=j}}else if(v&&je(g)&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,n,r));else{let N=!1,j=!1;const k=n.count!==void 0&&!je(n.count),_=Hf.hasDefaultValue(n),R=k?this.pluralResolver.getSuffix(u,n.count,n):"",M=n.ordinal&&k?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",H=k&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),P=H&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${M}`]||n.defaultValue;!this.isValidLookup(f)&&_&&(N=!0,f=P),this.isValidLookup(f)||(j=!0,f=s);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:f,L=_&&P!==f&&this.options.updateMissing;if(j||N||L){if(this.logger.log(L?"updateKey":"missingKey",u,c,s,L?P:f),o){const I=this.resolve(s,{...n,keySeparator:!1});I&&I.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let I=0;I<F.length;I++)B.push(F[I]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(n.lng||this.language):B.push(n.lng||this.language);const $=(I,A,E)=>{const z=_&&E!==f?E:V;this.options.missingKeyHandler?this.options.missingKeyHandler(I,c,A,z,L,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(I,c,A,z,L,n),this.emit("missingKey",I,c,A,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?B.forEach(I=>{const A=this.pluralResolver.getSuffixes(I,n);H&&n[`defaultValue${this.options.pluralSeparator}zero`]&&A.indexOf(`${this.options.pluralSeparator}zero`)<0&&A.push(`${this.options.pluralSeparator}zero`),A.forEach(E=>{$([I],s+E,n[`defaultValue${E}`]||P)})}):$(B,s,P))}f=this.extendTranslation(f,t,n,d,r),j&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${s}`),(j||N)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${s}`:s,N?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=je(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(u){const f=t.match(this.interpolator.nestingRegexp);p=f&&f.length}let d=r.replace&&!je(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;p<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return o&&o[0]===h[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):s.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=je(a)?[a]:a;return t!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(t=bP.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return je(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),p=u.key;i=p;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!je(n.count),h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(je(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(S=>{this.isValidLookup(r)||(a=S,!D1[`${b[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(D1[`${b[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${b.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(g=>{if(this.isValidLookup(r))return;s=g;const v=[p];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,p,g,S,n);else{let N;f&&(N=this.pluralResolver.getSuffix(g,n.count,n));const j=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(p+N),n.ordinal&&N.indexOf(k)===0&&v.push(p+N.replace(k,this.options.pluralSeparator)),h&&v.push(p+j)),m){const _=`${p}${this.options.contextSeparator}${n.context}`;v.push(_),f&&(v.push(_+N),n.ordinal&&N.indexOf(k)===0&&v.push(_+N.replace(k,this.options.pluralSeparator)),h&&v.push(_+j))}}let y;for(;y=v.pop();)this.isValidLookup(r)||(o=y,r=this.getResource(g,S,y,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!je(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const pm=e=>e.charAt(0).toUpperCase()+e.slice(1);class F1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fr.create("languageUtils")}getScriptPartFromCode(t){if(t=zf(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=zf(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(je(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(t)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pm(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pm(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=pm(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),je(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return je(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):je(t)&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let I9=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A9={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const T9=["v1","v2","v3"],R9=["v4"],$1={zero:0,one:1,two:2,few:3,many:4,other:5},L9=()=>{const e={};return I9.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:A9[t.fc]}})}),e};class O9{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Fr.create("pluralResolver"),(!this.options.compatibilityJSON||R9.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=L9(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=zf(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}catch{if(!t.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(c,n)}return this.pluralRulesCache[o]=s,s}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>$1[i]-$1[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!T9.includes(this.options.compatibilityJSON)}}const z1=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=S9(e,t,n);return!o&&i&&je(n)&&(o=ny(e,n,r),o===void 0&&(o=ny(t,n,r))),o},hm=e=>e.replace(/\$/g,"$$$$");class M9{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:p,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:b,nestingOptionsSeparator:S,maxReplaces:g,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:N9,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Cs(o):s||"{{",this.suffix=a?Cs(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=p?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=f?Cs(f):h||Cs("$t("),this.nestingSuffix=m?Cs(m):b||Cs(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,s,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const g=z1(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...i,...n,interpolationkey:h}):g}const m=h.split(this.formatSeparator),b=m.shift().trim(),S=m.join(this.formatSeparator).trim();return this.format(z1(n,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:b})};this.resetRegExp();const p=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>hm(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?hm(this.escape(h)):hm(h)}].forEach(h=>{for(a=0;o=h.regex.exec(t);){const m=o[1].trim();if(s=u(m),s===void 0)if(typeof p=="function"){const S=p(t,o,i);s=je(S)?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))s="";else if(d){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s="";else!je(s)&&!this.useRawValueToEscape&&(s=T1(s));const b=h.safeValue(s);if(t=t.replace(o[0],b),d?(h.regex.lastIndex+=s.length,h.regex.lastIndex-=o[0].length):h.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,s;const a=(c,u)=>{const p=this.nestingOptionsSeparator;if(c.indexOf(p)<0)return c;const d=c.split(new RegExp(`${p}[ ]*{`));let f=`{${d[1]}`;c=d[0],f=this.interpolate(f,s);const h=f.match(/'/g),m=f.match(/"/g);(h&&h.length%2===0&&!m||m.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${p}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,c};for(;i=this.nestingRegexp.exec(t);){let c=[];s={...r},s=s.replace&&!je(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const p=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=p.shift(),c=p,u=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&!je(o))return o;je(o)||(o=T1(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=c.reduce((p,d)=>this.format(p,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const D9=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(s){const[a,...c]=s.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),p=a.trim();n[p]||(n[p]=u),u==="false"&&(n[p]=!1),u==="true"&&(n[p]=!0),isNaN(u)||(n[p]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Es=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let a=t[s];return a||(a=e(zf(r),i),t[s]=a),a(n)}};class F9{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fr.create("formatter"),this.options=t,this.formats={number:Es((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:Es((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:Es((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:Es((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:Es((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Es(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(a=>a.indexOf(")")>-1)){const a=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,c)=>{const{formatName:u,formatOptions:p}=D9(c);if(this.formats[u]){let d=a;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](a,h,{...p,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const $9=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class z9 extends Pp{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Fr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},c={};return t.forEach(u=>{let p=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,p=!1,s[f]===void 0&&(s[f]=!0),o[f]===void 0&&(o[f]=!0),c[d]===void 0&&(c[d]=!0)))}),p||(a[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{b9(c.loaded,[o],s),$9(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const p=c.loaded[u];p.length&&p.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const a=(u,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&p&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,p)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(p=>a(null,p)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();je(t)&&(t=this.languageUtils.toResolveHierarchy(t)),je(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let p;u.length===5?p=u(t,n,r,i,c):p=u(t,n,r,i),p&&typeof p.then=="function"?p.then(d=>a(null,d)).catch(a):a(null,p)}catch(p){a(p)}else u(t,n,r,i,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const B1=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),je(e[1])&&(t.defaultValue=e[1]),je(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),H1=e=>(je(e.ns)&&(e.ns=[e.ns]),je(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),je(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Sd=()=>{},B9=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Lc extends Pp{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=H1(t),this.services={},this.logger=Fr,this.modules={external:[]},B9(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(je(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=B1();this.options={...i,...this.options,...H1(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Fr.init(o(this.modules.logger),this.options):Fr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:typeof Intl<"u"&&(p=F9);const d=new F1(this.options);this.store=new M1(this.options.resources,this.options);const f=this.services;f.logger=Fr,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new O9(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(p),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new M9(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new z9(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var m=arguments.length,b=new Array(m>1?m-1:0),S=1;S<m;S++)b[S-1]=arguments[S];t.emit(h,...b)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Hf(this.services,this.options),this.translator.on("*",function(h){for(var m=arguments.length,b=new Array(m>1?m-1:0),S=1;S<m;S++)b[S-1]=arguments[S];t.emit(h,...b)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Sd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return t.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return t.store[p](...arguments),t}});const c=jl(),u=()=>{const p=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sd;const i=je(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>s(c)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const i=jl();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Sd),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&bP.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=jl();this.emit("languageChanging",t);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},s=(c,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=je(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,p=>{s(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,r){var i=this;const o=function(s,a){let c;if(typeof a!="object"){for(var u=arguments.length,p=new Array(u>2?u-2:0),d=2;d<u;d++)p[d-2]=arguments[d];c=i.options.overloadTranslationOptionHandler([s,a].concat(p))}else c={...a};c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||o.keyPrefix);const f=i.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(s)?h=s.map(m=>`${c.keyPrefix}${f}${m}`):h=c.keyPrefix?`${c.keyPrefix}${f}${s}`:s,i.t(h,c)};return je(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=jl();return this.options.ns?(je(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=jl();je(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new F1(B1());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Lc(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sd;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Lc(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new M1(this.store.data,i),o.services.resourceStore=o.store),o.translator=new Hf(o.services,i),o.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),p=1;p<c;p++)u[p-1]=arguments[p];o.emit(a,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Vt=Lc.createInstance();Vt.createInstance=Lc.createInstance;Vt.createInstance;Vt.dir;Vt.init;Vt.loadResources;Vt.reloadResources;Vt.use;Vt.changeLanguage;Vt.getFixedT;Vt.t;Vt.exists;Vt.setDefaultNamespace;Vt.hasLoadedNamespace;Vt.loadNamespaces;Vt.loadLanguages;function H9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function U9(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function V9(e){var t=U9(e,"string");return Oc(t)=="symbol"?t:t+""}function W9(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V9(r.key),r)}}function K9(e,t,n){return t&&W9(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var SP=[],Y9=SP.forEach,q9=SP.slice;function G9(e){return Y9.call(q9.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var U1=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,X9=function(t,n,r){var i=r||{};i.path=i.path||"/";var o=encodeURIComponent(n),s="".concat(t,"=").concat(o);if(i.maxAge>0){var a=i.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(i.domain){if(!U1.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(i.domain)}if(i.path){if(!U1.test(i.path))throw new TypeError("option path is invalid");s+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite){var c=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},V1={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=X9(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i<r.length;i++){for(var o=r[i];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(n)===0)return o.substring(n.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},Q9={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=V1.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&V1.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},J9={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),s=0;s<o.length;s++){var a=o[s].indexOf("=");if(a>0){var c=o[s].substring(0,a);c===t.lookupQuerystring&&(n=o[s].substring(a+1))}}}return n}},Pl=null,W1=function(){if(Pl!==null)return Pl;try{Pl=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Pl=!1}return Pl},Z9={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&W1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&W1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},_l=null,K1=function(){if(_l!==null)return _l;try{_l=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{_l=!1}return _l},eU={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&K1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&K1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},tU={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},nU={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},rU={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},iU={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},kP=!1;try{document.cookie,kP=!0}catch{}var NP=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];kP||NP.splice(1,1);function oU(){return{order:NP,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var CP=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};H9(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return K9(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=G9(r,this.options||{},oU()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(o){return o.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Q9),this.addDetector(J9),this.addDetector(Z9),this.addDetector(eU),this.addDetector(tU),this.addDetector(nU),this.addDetector(rU),this.addDetector(iU)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var s=r.detectors[o].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(i=i.concat(s))}}),i=i.map(function(o){return r.options.convertDetectedLanguage(o)}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}])}();CP.type="languageDetector";const sU={name:"AgentFlow",tagline:"AI Workflow Orchestration"},aU={projects:"Projects",flowEditor:"Flow Editor",settings:"Settings",back:"Back"},lU={loading:"Loading...",saving:"Saving...",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",create:"Create",close:"Close",confirm:"Confirm",copy:"Copy",copied:"Copied!",refresh:"Refresh",search:"Search",filter:"Filter",success:"Success",error:"Error",warning:"Warning",info:"Info",done:"Done",pending:"Pending",running:"Running",notFound:"Not found",required:"Required",optional:"Optional"},cU={success:"Success",failed:"Failed",pending:"Pending",running:"Running",skipped:"Skipped"},uU={agent:"Agent",control:"Control",tool:"Tool",start:"Start",end:"End"},dU={online:"Engine Online",offline:"Engine Offline",connecting:"Connecting…"},fU={hub:"AgentFlow Hub",docs:"Documentation",github:"GitHub Repository"},pU={app:sU,nav:aU,common:lU,status:cU,nodeTypes:uU,engine:dU,links:fU},hU="Flow Editor",mU="Nodes",gU="Edges",yU="Properties",xU={label:"Node Label",type:"Node Type",model:"Model",body:"Body",inputs:"Inputs",outputs:"Outputs",addInput:"Add Input",addOutput:"Add Output",remove:"Remove Node",duplicate:"Duplicate Node",nodeType:"Node Type",displayName:"Display Name",displayNameHint:"(letters, numbers, underscores, hyphens, do not start with a number)",role:"Role",modelHint:"From ~/agentflow/model-lists.json; UI service runs agentflow update-model-lists in background on startup",defaultModel:"Default",userPrompt:"User Prompt (USER PROMPT / body)",systemDescription:"System Description (read-only, from node definition)",directCommand:"Direct Command (script)",scriptHint:"(tool_nodejs: skips AI when script exists, executed by pipeline)",diskRunning:"Disk record shows running",deleteNode:"Delete node",inputTooltip:"Input {{name}} | Type: {{type}}",outputTooltip:"Output {{name}} | Type: {{type}}",defaultSuffix:" | Default: {{value}}",fallbackLabel:"Node",expandProvide:"Edit content"},wU={title:"Node Properties",noInputPins:"No input pins",noOutputPins:"No output pins",type:"Type",name:"Name",defaultValue:"Default / value",conversationOutput:"Conversation & Output",addPin:"Add Pin",addPinAriaLabel:"Add {{label}}",handleHint:"Matches Handle index on canvas ({{prefix}}-0, {{prefix}}-1…). After adding/removing/reordering, existing connections may break — check validation after saving.",handle:"Handle",pinTypeAriaLabel:"{{label}} {{index}} type",pinNameAriaLabel:"{{label}} {{index}} name",pinDefaultAriaLabel:"{{label}} {{index}} default",deletePinAriaLabel:"Delete {{label}} {{index}}",deletePin:"Delete this pin",instanceId:"Instance ID",yamlValueNotInList:"(YAML value, not in current list)",inputPins:"Input Pins (INPUT)",outputPins:"Output Pins (OUTPUT)",expand:"Expand",collapse:"Collapse",expandEditScript:"Expand edit script",expandEdit:"Expand edit",editScript:"Edit script",editUserPrompt:"Edit user prompt",scriptPlaceholder:"instances.*.script — full shell command; supports ${workspaceRoot}, ${flowDir}, ${runDir} and slot names (don't quote placeholders)",scriptPlaceholderExpand:"instances.*.script — full shell command; don't quote ${workspaceRoot}, ${flowDir} placeholders",bodyPlaceholder:"instances.*.body — supports multiline and ${variables}; type ${ to pick a slot",bodyPlaceholderExpand:"instances.*.body — supports multiline and ${variables}",noDescription:"(No description in current node definition)",modelAriaLabel:"Model",placeholderSlots:"Placeholders: input/output slots",publishToMarketplace:"Publish Node",publishToMarketplaceHint:"Publish the current node to the workspace local marketplace",publishing:"Publishing…",publishRunning:"Publishing to local marketplace…",publishSuccess:"Node published to local marketplace",publishSuccessWithId:"Node published: {{id}}"},vU={run:"Run Flow",stop:"Stop",resume:"Resume",validate:"Validate",export:"Export",import:"Import"},bU={nodeList:"Node List",runHistory:"Run History",validation:"Validation Results"},SU={workspace:"Workspace",loading:"Loading...",archived:"Archived",noPipelines:"No pipelines",more:"more",moreFlows:"more flows",noRuns:"No run records",searchNodes:"Search nodes",noComponents:"No components available (check node library directory)",noMatch:"No matching nodes, adjust search terms",selectPipeline:"Select a pipeline from above to load components and canvas",validationWarnings:"Validation warnings (consistent with agentflow validate slot checks)",output:"Output",model:"Model",userDir:"User Directory",toggleRecentActivity:"Toggle recent opened or recent runs"},kU={selectPipeline:"Please select a pipeline from the dropdown above",loadingProps:"Loading node properties...",pipelineId:"Pipeline ID",diskPath:"Disk Path",storageLocation:"Storage Location",introduction:"Introduction",introductionPlaceholder:"Briefly describe this pipeline (saved as flow.yaml ui.description)",metadata:"Metadata",nodeCount:"Node Count",nodesUnit:"nodes",loading:"Loading...",noRuns:"No run records (run records are generated in the workspace after terminal execution)"},NU={saving:"Saving...",saved:"Saved",saveFailed:"Save failed",runInTerminal:"Please use terminal to run"},CU={requirement:"Requirement Analysis",planning:"Technical Planning",code:"Code Execution",test:"Test Regression",normal:"Normal"},EU={phase:"Phase",allPhasesComplete:"All phases completed",currentPhaseComplete:"Current phase completed, waiting for confirmation..."},jU={node:"Node",text:"Text",file:"File",bool:"Boolean"},PU={title:"Node Execution Context",resizeHandle:"Drag to resize node context width",apiConnectError:"Cannot connect to API (please open the page with agentflow ui, or configure /api proxy for Vite dev)",invalidJson:"Response is not valid JSON",requestTimeout:"Request timed out, please retry or check agentflow ui",executingNoArtifacts:"Executing, artifacts not yet written to workspace…",noData:"No data (this run has not reached this node or produced artifacts)",latest:"Latest",detectedContentType:"Detected content type",roundNoContent:"No content in this round",empty:"(empty)",imageTruncated:"Image truncated (exceeds size limit)",statusSuccess:"Success",statusFailed:"Failed",statusRunning:"Running",statusCacheMiss:"Cache miss",statusPending:"Pending"},_U={title:"Keyboard Shortcuts",general:"General",saveDesc:"Save; when node properties sidebar is open, submit node first then save flow",shortcutsLabel:"Keyboard Shortcuts",jumpToNode:"Jump to node by ID",canvas:"Canvas",selectTool:"Select Tool",panTool:"Pan Tool",holdSpacePan:"Hold Space to temporarily pan",selectAll:"Select all nodes"},IU={title:"Jump to node",placeholder:"Type node ID or label…",empty:"No matching nodes",hintNavigate:"navigate",hintJump:"jump",hintClose:"close"},AU={title:"Start Building Your Flow",text:"Describe your workflow in the AI input box below, or drag nodes from the left panel to the canvas",composerHint:"Build AgentFlow with AI Composer",composerSub:"Drag nodes from the left panel, or describe your workflow in the <strong>input box below</strong>.<br/>Press <kbd>?</kbd> to view shortcuts."},TU={mainNav:"Main Navigation"},RU={flowWarningAriaLabel:"Flow validation warnings",reloadFromServer:"Reload flow from server and refresh validation",reloadFromServerShort:"Reload from server",closeBanner:"Close validation warning banner",nodePrefix:"Node",focusNodeAriaLabel:"Select and focus node {{nodeId}} on canvas",slotWarningCount:"Slot validation: {{count}} warnings (hidden)",show:"Show",shortcutHint:"Press ? to view keyboard shortcuts",shortcutHintLabel:"shortcuts",inputSlotNoEdge:' input slot "{{slotName}}" ({{handle}}) has no edge connection',outputSlotNoEdge:' output slot "{{slotName}}" ({{handle}}) has no edge connection'},LU={title:"AI Assistant",placeholder:"Ask AI to help with this node...",thinking:"Thinking",reply:"Reply",result:"Result",error:"Error",waiting:"Waiting for response...",yourQuestion:"Your question",send:"Send",expand:"Expand conversation",collapse:"Collapse",connecting:"Connecting…",requestFailed:"Request failed",cannotReadStream:"Cannot read response stream",connectTimeout:"Connection timeout (120s), please confirm UI service is running and retry. [CONNECT_TIMEOUT]",aborted:"Aborted",executing:"Executing…",ready:"Ready",done:"Done",inputPlaceholder:"Type your question (⌘/Ctrl+Enter to send)",inputAriaLabel:"Question input",mentionAriaLabel:"Mention: instances and node types",modelLabel:"Model",modelAriaLabel:"Conversation model",modelDefault:"Default",modelNotInList:"(not in current list)",stopGeneration:"Stop generation",conversationOutput:"Conversation & Output",collapseAriaLabel:"Collapse",closeSidebar:"Close sidebar",endConversation:"End conversation (will stop generation)",closeConversation:"Close conversation",newConversation:"New conversation",switchConversation:"Switch conversation",selectedNodesAriaLabel:"Selected nodes list",selectedNodesEmpty:"Select nodes on canvas, or use @ in the input to pick Instances or Node types",removeFromInput:"Remove @{{id}} from input",deselectNode:"Deselect {{id}}",taskPlan:`📋 Task Plan ({{count}} steps):
130
+ {{summary}}`,step:"Step {{current}}/{{total}}: {{description}}",phaseGeneration:`Phased generation ({{count}} phases): {{labels}}
131
+ Current: {{current}}`,phaseComplete:"{{phaseName}} completed. Next phase: {{nextPhase}}",nextPhase:"Next phase",continuePhase:"Continue {{label}}",skipRemainingPhases:"Please complete all remaining steps at once (skip phased confirmation)",phaseProgress:"Phase progress",phaseReviewLabel:"Phase options",phaseReviewHint:'This phase is complete. Review the canvas, then continue to "{{nextPhase}}".',phaseReviewContinue:"Continue: {{label}}",phaseReviewSkip:"Skip — finish remaining in one pass",stepsAriaLabel:"Task steps progress",phasesAriaLabel:"Generation phases progress",phaseNumber:"Phase {{index}}",stepRoleLabel:"Role: {{role}}",stepInstanceLabel:"Instance: {{instanceId}}",pageRefreshReset:"Reset after page refresh",conversationLabel:"Conversation {{n}}"},OU={currentPipeline:"Current Pipeline",backToEdit:"Back to edit",backToProjects:"Back to projects",executionLog:"Execution log",history:"History",pipelineSettings:"Pipeline settings",shortcutsLabel:"Shortcuts",shortcutsTitle:"Shortcuts (?)",deletePipeline:"Delete pipeline",resumeTitle:"Resume in same run directory (uuid={{uuid}})",resumeTitleNoUuid:"No apply-start received, will start a new run",rerunTitle:"Start a new run from scratch",runOptions:"Run options",runWithParams:"Run with params",runWithPreset:"Run with preset",editRun:"Edit run parameters",startRun:"Start run",stopRun:"Stop background run"},MU={nodePalette:"Node Palette",noPipelineSelected:"No pipeline selected",moreRuns:"+{{count}} more",moreFlows:"+{{count}} more flows",runId:"Run ID: {{id}}"},DU={connectingApi:"Connecting to /api/flow/run…",connectingApiResume:"Connecting to /api/flow/run (resuming run uuid={{uuid}})…",connectedReceiving:"Connected to execution stream, receiving NDJSON output…",noBody:"Response has no body (cannot stream), please check browser and agentflow ui version",nodeStart:"▶ Starting: {{instanceId}}",nodeStartWithLabel:"▶ Starting: {{instanceId}} ({{label}})",nodeDone:"✓ Done: {{instanceId}}",nodeDoneWithElapsed:"✓ Done: {{instanceId}} ({{elapsed}})",nodeFailed:"✗ Failed: {{instanceId}}",pipelineStart:"Pipeline started (uuid={{uuid}})",pipelineDone:"Pipeline completed",pipelineDoneWithElapsed:"Pipeline completed ({{elapsed}})",pipelinePaused:"Pipeline paused: waiting for user input ({{nodes}})",unknownError:"Unknown error",executionEnd:"Execution ended (exit code: {{exitCode}})",executionStopped:"Execution paused",pauseRun:"Pause run (can resume later)",pauseConfirm:"Pause the current run? You can resume from the interrupted node later.",pauseTitle:"Pause run",pauseConfirmOk:"Pause",backPromptTitle:"Back to projects",backPromptMessage:"Pipeline still running. Keep it in the background and exit, or stop it and return to edit mode?",backBackground:"Run in background & exit",backStopEdit:"Stop & enter edit",resizeConsole:"Drag to resize execution log height",closeLog:"Close log",userCheckContent:"Waiting for user to confirm content for node {{instanceId}}",userAskPrompt:"Waiting for user to choose branch for node {{instanceId}}"},FU={close:"Close",loading:"Loading…",placeholder:"File content",largeFileWarning:"Large file, editor performance may be affected",reset:"Reset",aiEdit:"AI Edit",aiRunning:"AI processing…",save:"Save",saving:"Saving…",saved:"Saved"},$U={title:"Pipeline Settings",subtitle:"Manage basic information, storage, node marketplace, scheduled runs, and metadata.",sectionNav:"Settings sections",basicInfo:"Basic Info",storageAndPath:"Storage & Path",nodeMarketplace:"Node Marketplace",overview:"Pipeline Overview",owner:"Owner",source:"Source",marketplaceNodes:"Marketplace nodes",marketNodesUnit:"market nodes",marketplaceHint:"Local marketplace nodes can be added to this pipeline; installed nodes can then be placed on the canvas.",marketplaceEmpty:"No local marketplace nodes are installed in this workspace yet. Publish one from the node properties panel.",addNodeFromMarket:"Back to canvas",quickActions:"Quick Actions",saveChanges:"Save changes",savingChanges:"Saving…",installNode:"Add to pipeline",installingNode:"Adding…",addInstalledNode:"Add to canvas",previewNode:"Preview",nodePreviewTitle:"Node preview",nodeStylePreview:"Node style preview",closePreview:"Close preview",nodeFunction:"Node purpose",nodePackageInfo:"Package info",definitionId:"Definition ID",version:"Version",packagePath:"Package path",packagedFiles:"Packaged files",marketplaceNoDescription:"No node purpose has been provided.",noInputs:"No inputs",noOutputs:"No outputs",backToCanvas:"Back to canvas",help:"Help",helpText:"Publish nodes from the node properties panel; installed collections sync into the local node marketplace.",archived:"Archived",archivedNote:"This pipeline is in the archive directory (_archived) and cannot be moved between user directory and workspace.",builtinNote:"Built-in templates are read-only; first save will write to workspace .workspace/agentflow/pipelines (pipelines), .workspace/agentflow/nodes (custom nodes), etc.",moveBusy:"Moving…",moveToWorkspace:"Move to workspace",moveToUserDir:"Move to user directory",globalSettings:"Global settings",currentPipeline:"Current pipeline:",builtin:"Built-in",rename:"Rename",renameBusy:"Renaming…",renameSuccess:"Renamed",copyPath:"Copy path",pathCopied:"Copied"},zU={title:"Scheduled Run",enabled:"Enable scheduled trigger",cron:"Cron expression",timezone:"Timezone",preset:"Run preset",defaultPreset:"Default inputs",overlapSkip:"Overlap policy: skip this trigger while the pipeline is running",nextRun:"Next estimated trigger: {{time}}",noNextRun:"No next trigger is configured",runtime:"Scheduler state",running:"Running",waiting:"Waiting",disabled:"Disabled",lastTriggeredAt:"Last triggered",lastSkippedAt:"Last skipped",lastRun:"Last run",lastExit:"Last exit code",lastFinishedAt:"Last finished",readonlyNote:"Built-in or archived pipelines cannot save schedule settings.",save:"Save schedule",saving:"Saving…",saved:"Schedule saved"},BU={title:"Execution History",summary:"Execution results summary",successCount:"{{count}} succeeded",failedCount:"{{count}} failed",stoppedCount:"{{count}} stopped",interruptedCount:"{{count}} interrupted",runningCount:"{{count}} running",success:"Success",failed:"Failed",stopped:"Stopped",interrupted:"Interrupted",running:"Running",unknown:"Unknown",runLabel:"Run #{{id}}",enterRunView:"Enter run view with canvas and log"},HU={invalidInstanceId:"Invalid Instance ID: only letters, numbers, underscores, and hyphens allowed, must not start with a number.",duplicateInstanceId:"This Instance ID already exists, please choose another.",loadFlowFailed:"Failed to load flow",loadNodesFailed:"Failed to load node library"},UU={invalidPlaceholder:"Invalid placeholder: {{hint}}",empty:"(empty)",inputSubtitle:"Input · {{type}}",inputSubtitleNoType:"Input",outputSubtitle:"Output · {{type}}",outputSubtitleNoType:"Output",runtimeConst:"Runtime constant"},VU={justNow:"Just now",minutesAgo:"{{n}} min ago",hoursAgo:"{{n}} hr ago",yesterday:"Yesterday",daysAgo:"{{n}} days ago",milliseconds:"{{n}} ms",seconds:"{{n}} s"},WU={title:"User Confirmation ({{instanceId}})",edit:"Edit",save:"Save",cancel:"Cancel",aiEditPlaceholder:"Enter AI edit instruction, e.g., remove item 2, merge first two items…",aiEditBtn:"AI Edit",aiEditStarted:"AI is modifying content…",aiEditDone:"AI modification complete",aiEditFailed:"AI modification failed",contentSaved:"Content saved",saveFailed:"Save failed",close:"Close",continue:"Continue Execution",hint:"Edit or use AI to modify, then save. Click 'Continue Execution' to resume the flow"},KU={title:"User Choice ({{instanceId}})",hint:"Pick an option below to continue the flow",submitting:"Submitting…",submitFailed:"Submit failed",close:"Close",noOptions:"No options configured on this node. Add items to the output slots in the editor first."},YU={title:"Print Output: {{instanceId}}",truncated:"...content truncated"},qU={save:"Save",cancel:"Cancel"},GU={title:"Run with Params",noParams:"No input params in this flow",run:"Run",cancel:"Cancel"},XU={title:"Run with Preset",noPresets:"No presets available",default:"Default run",run:"Run",cancel:"Cancel"},QU={preset:"Preset",default:"Default",newPreset:"New preset",deletePreset:"Delete preset",presetNamePlaceholder:"Preset name",inputParams:"Input Parameters",noProvideNodes:"No provide nodes in this flow",filePathPlaceholder:"File path…",stringValuePlaceholder:"Value…",presetSaved:"Preset saved",presetDeleted:"Preset Deleted",savePreset:"Save current preset",expandInput:"Edit content"},JU={title:hU,nodes:mU,edges:gU,properties:yU,node:xU,nodeProps:wU,actions:vU,panel:bU,palette:SU,pipeline:kU,status:NU,roles:CU,phases:EU,types:jU,runContext:PU,shortcuts:_U,jumpPalette:IU,emptyCanvas:AU,sidebar:TU,validation:RU,composer:LU,topbar:OU,palette2:MU,run:DU,fileEdit:FU,settings:$U,schedule:zU,history:BU,nodePropsError:HU,placeholder:UU,time:VU,userCheck:WU,userAsk:KU,toolPrint:YU,provideEdit:qU,runParams:GU,runPreset:XU,runConfig:QU},ZU="Settings",eV={engine:"Engine Settings",preferences:"Global Preferences"},tV={title:"Workspace",currentPath:"Current Workspace Root",placeholder:"Loading...",copyPath:"Copy path",description:"Pipelines and node lists are resolved relative to this directory (passed when starting the UI)."},nV={title:"Cursor CLI",status:{cached:"Cached",notCached:"Not cached"},modelPreviewLabel:"Cursor model id list",modelList:{cached:"Model list cached",empty:"No model list",count:"{{count}} items",fetchedAt:"Updated {{time}}",never:"Never fetched",refresh:"Refresh List",fetching:"Fetching..."}},rV={modelPreviewLabel:"OpenCode model id list",title:"OpenCode CLI",status:{ready:"Ready",notFound:"Not found"},provider:"Plan / Provider ID",providerPlaceholder:"e.g., bailian-coding-plan",saving:"Saving and updating list...",description:"Corresponds to CLI opencode models <provider> parameter; written to user directory config and triggers model-lists.json refresh after typing stops."},iV={title:"Claude Code CLI",status:{ready:"Ready",notFound:"Not found"},modelPreviewLabel:"Claude Code model id list",description:"Built-in model list (Claude Code CLI has no models subcommand); refresh probes the claude binary in PATH. Run 'claude /login' first."},oV={title:"Environment Variables",note:"Local machine, this browser only",key:"Key",value:"Value",add:"Add",delete:"Delete {{key}}",newKey:"New env key",newValue:"Value (be careful with secrets)"},sV={title:"System Status",normal:"Service normal",abnormal:"Some interfaces abnormal",cursorModels:"Cursor Models",opencodeModels:"OpenCode Models",claudeCodeModels:"Claude Code Models"},aV={title:"Shortcuts",projects:"Projects & Pipelines",flowEditor:"Node Canvas"},lV={title:"Language",description:"Select your preferred language for the interface",options:{zh:"中文",en:"English",ja:"日本語"}},cV={title:"Onboarding Tour",description:"Restart the product tour to learn about AgentFlow's core features.",reset:"Reset Tour",resetSuccess:"Reset complete. Tour will start automatically on next visit."},uV={title:ZU,crumb:eV,workspace:tV,cursor:nV,opencode:rV,claudeCode:iV,env:oV,system:sV,shortcuts:aV,language:lV,onboarding:cV},dV={thinking:"Thinking",result:"Result",reply:"Reply",error:"Error"},fV={input:"Ask AI to help edit this node...",waiting:"Waiting for response...",selectedEmpty:"Select a node on the canvas, or use @ in the input to select instances or node types",textarea:"Describe your workflow or ask AI to help (⌘/Ctrl+Enter to send)"},pV={send:"Send",stop:"Stop",expand:"Expand",collapse:"Collapse",clear:"Clear"},hV={conversation:"Chat",conversationWithNumber:"Chat {{num}}",default:"Default"},mV={endSession:"End chat (will stop generation)",closeSession:"Close chat",newSession:"New chat",expandComposer:"Expand chat and output"},gV={hint:"Use the bottom input box for AI chat, with @node mentions, model selection, and more"},yV={aiLabels:dV,placeholders:fV,actions:pV,labels:hV,tooltips:mV,rightPanel:gV},xV="Projects",wV="All",vV="Archived",bV="Active Projects",SV="Archived Pipelines",kV="Create New Project",NV="New Pipeline",CV="SEARCH PIPELINES...",EV="Loading pipelines...",jV="Filter result: {{count}} items (matching title, description, path and tags)",PV="Archived pipelines can still be opened and edited; files are located in the _archived subdirectory of each pipelines directory.",_V="Manage your distributed node architectures and monitoring pipelines. Drag flow.yaml or .zip into this page to import shared flows.",IV="No archived projects.",AV="No active pipelines; archived items are in the Archived tab.",TV="Failed to load pipeline list.",RV="No pipelines in current workspace.",LV="Run {{code1}} in the repository root and ensure the workspace contains {{code2}} or pipelines in the user directory; or click New Pipeline to create one.",OV='No pipelines found matching "{{query}}". Try different keywords or clear the search.',MV="Recent Activity",DV="No recent activity",FV="No recent activity matching the keyword",$V="Recent Run",zV="Recent Open",BV={builtin:"Built-in",workspace:"Workspace",user:"User"},HV="Open to edit this pipeline in the node canvas.",UV={eyebrow:"AgentFlow Hub",title:"Browse community flows",desc:"Discover and install ready-made pipelines shared by the community.",cta:"Explore Hub",cliHint:"Or install via CLI: agentflow download <slug>"},VV={title:"Create New Pipeline",lead:"Enter a pipeline name (English identifier); description is optional and will be saved in flow's ui.description.",nameLabel:"Name (required)",namePlaceholder:"e.g., my_feature_flow",nameHint:"Must start with a letter, only letters, numbers, underscores _ and hyphens - allowed",descLabel:"Description (optional)",descPlaceholder:"Briefly describe the purpose of this pipeline...",locationLabel:"Save Location",userDir:"User Directory (~/agentflow/pipelines)",workspaceDir:"Current Workspace (.workspace/agentflow/pipelines)",createFailed:"Creation failed",creating:"Creating...",createAndOpen:"Create and Open",cancel:"Cancel",close:"Close"},WV={title:"Import Pipeline",lead:'File "{{filename}}" selected. Please confirm the pipeline name and save location; ZIP will preserve scripts and other files in the directory.',nameLabel:"Name (required)",namePlaceholder:"e.g., my_shared_flow",nameHint:"Must start with a letter, only letters, numbers, underscores _ and hyphens - allowed",locationLabel:"Save Location",userDir:"User Directory (~/agentflow/pipelines)",workspaceDir:"Current Workspace (.workspace/agentflow/pipelines)",changeFile:"Change File...",importFailed:"Import failed",importing:"Importing...",importAndOpen:"Import and Open",cancel:"Cancel",close:"Close"},KV={title:"Delete Pipeline",lead:'This will permanently delete the pipeline directory from disk (including flow.yaml, scripts, etc.) and cannot be undone. Please enter the pipeline ID "{{flowId}}" below to confirm.',confirmLabel:"Confirm Pipeline Name",deleteFailed:"Delete failed",deleteTimeout:"Delete request timed out, please retry (check UI service logs in terminal)",delete:"Delete",deleting:"Deleting...",confirmDelete:"Confirm Delete",cancel:"Cancel",close:"Close"},YV={title:"Archive Pipeline",lead:'After archiving, the pipeline will be moved to the "Archived" list and can still be opened and edited from there. Please enter the pipeline ID "{{flowId}}" below to confirm.',confirmLabel:"Confirm Pipeline Name",archiveFailed:"Archive failed",archive:"Archive",archiving:"Archiving...",confirmArchive:"Confirm Archive",cancel:"Cancel",close:"Close"},qV={title:xV,all:wV,archived:vV,activeProjects:bV,archivedPipelines:SV,createNew:kV,newPipeline:NV,searchPipelines:CV,loadingPipelines:EV,filterResult:jV,archivedHint:PV,activeHint:_V,noArchived:IV,noActive:AV,loadFailed:TV,noPipelines:RV,emptyHint:LV,noMatch:OV,recentActivity:MV,noRecentActivity:DV,noMatchRecent:FV,recentRun:$V,recentOpen:zV,sourceBadge:BV,defaultCardDesc:HV,hubCard:UV,newPipelineModal:VV,importModal:WV,deleteModal:KV,archiveModal:YV},GV="Back",XV="Next",QV="Skip",JV="Done",ZV="Start Creating",e7={intro:`Welcome to AgentFlow! This is a visual workflow orchestration tool.
132
+
133
+ Click the button below to create your first pipeline.`,hubIntro:`Don't want to start from scratch?
134
+
135
+ Browse ready-made pipelines on AgentFlow Hub — community-shared flows you can install and run in one click.`},t7={intro:`Now you're in the flow editor.
136
+
137
+ Describe your requirements in natural language in the input box below, and AI will generate the flow graph.
138
+
139
+ The left node panel allows you to freely drag, delete, and adjust connections.`,introEmpty:`The canvas is empty. Start creating your flow!
140
+
141
+ Describe your requirements in natural language in the input box below, and AI will generate the flow graph.
142
+
143
+ The left node panel allows you to freely drag, delete, and adjust connections.`},n7={guideTitle:"First-time Creation Guide",guideDesc:"After entering the name and description, AI will automatically generate the flow graph. You can freely adjust nodes and connections in the editor.",nameHintGuide:"e.g., MyFirstFlow (starts with a letter, supports numbers and underscores)",descPlaceholderGuide:"e.g., Implement user login functionality with registration, verification, and authorization",descHintGuide:"More detailed description leads to more accurate AI-generated flow",createGuide:"Create & Start Editing",typeNode:"Node reference type",typeStr:"String type",typeFile:"File path type",typeBool:"Boolean type"},r7={back:GV,next:XV,skip:QV,done:JV,startCreate:ZV,projects:e7,flow:t7,newPipeline:n7},i7={name:"AgentFlow",tagline:"AI 工作流编排"},o7={projects:"项目",flowEditor:"流程编辑器",settings:"设置",back:"返回"},s7={loading:"加载中…",saving:"保存中…",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",create:"创建",close:"关闭",confirm:"确认",copy:"复制",copied:"已复制!",refresh:"刷新",search:"搜索",filter:"筛选",success:"成功",error:"错误",warning:"警告",info:"信息",done:"完成",pending:"待处理",running:"运行中",notFound:"未找到",required:"必填",optional:"可选"},a7={success:"成功",failed:"失败",pending:"等待",running:"运行中",skipped:"跳过"},l7={agent:"Agent 节点",control:"控制节点",tool:"工具节点",start:"开始",end:"结束"},c7={online:"引擎在线",offline:"引擎离线",connecting:"连接中…"},u7={hub:"AgentFlow Hub",docs:"文档",github:"GitHub 仓库"},d7={app:i7,nav:o7,common:s7,status:a7,nodeTypes:l7,engine:c7,links:u7},f7="流程编辑器",p7="节点",h7="连线",m7="属性",g7={label:"节点标签",type:"节点类型",model:"模型",body:"内容",inputs:"输入",outputs:"输出",addInput:"添加输入",addOutput:"添加输出",remove:"删除节点",duplicate:"复制节点",nodeType:"节点类型",displayName:"显示名称",displayNameHint:"(字母、数字、下划线、短横线,勿以数字开头)",role:"角色",modelHint:"来自 ~/agentflow/model-lists.json;UI 服务启动时会后台执行 agentflow update-model-lists",defaultModel:"默认",userPrompt:"用户提示(USER PROMPT / body)",systemDescription:"系统说明(只读,来自节点定义)",directCommand:"直接执行命令",scriptHint:"(tool_nodejs:有 script 时跳过 AI,由流水线执行)",diskRunning:"磁盘记录为执行中",deleteNode:"删除节点",inputTooltip:"输入 {{name}} | 类型: {{type}}",outputTooltip:"输出 {{name}} | 类型: {{type}}",defaultSuffix:" | 默认: {{value}}",fallbackLabel:"节点",expandProvide:"编辑内容"},y7={title:"节点属性",noInputPins:"当前无输入引脚",noOutputPins:"当前无输出引脚",type:"类型",name:"名称",defaultValue:"默认值 / value",conversationOutput:"对话与输出",addPin:"添加引脚",addPinAriaLabel:"添加{{label}}",handleHint:"与画布上 Handle 序号一致({{prefix}}-0、{{prefix}}-1…)。增删或调整顺序后,原有连线可能失效,保存后请留意校验提示。",handle:"Handle",pinTypeAriaLabel:"{{label}} {{index}} 类型",pinNameAriaLabel:"{{label}} {{index}} 名称",pinDefaultAriaLabel:"{{label}} {{index}} 默认值",deletePinAriaLabel:"删除 {{label}} {{index}}",deletePin:"删除此引脚",instanceId:"实例 ID",yamlValueNotInList:"(YAML 中的值,不在当前列表)",inputPins:"输入引脚(INPUT)",outputPins:"输出引脚(OUTPUT)",expand:"展开",collapse:"收起",expandEditScript:"展开编辑 script",expandEdit:"展开编辑",editScript:"编辑 script",editUserPrompt:"编辑用户提示",scriptPlaceholder:"instances.*.script,完整 shell 命令;支持 ${workspaceRoot}、${flowDir}、${runDir} 与各槽位名(勿对占位符再包双引号)",scriptPlaceholderExpand:"instances.*.script,完整 shell 命令;勿对 ${workspaceRoot}、${flowDir} 等占位符再包双引号",bodyPlaceholder:"instances.*.body,支持多行与 ${变量};输入 ${ 选择槽位",bodyPlaceholderExpand:"instances.*.body,支持多行与 ${变量}",noDescription:"(当前节点定义无 description)",modelAriaLabel:"模型",placeholderSlots:"占位符:输入输出槽位",publishToMarketplace:"发布节点",publishToMarketplaceHint:"将当前节点发布到 Workspace 本地节点市场",publishing:"发布中…",publishRunning:"正在发布到本地节点市场…",publishSuccess:"节点已发布到本地节点市场",publishSuccessWithId:"节点已发布:{{id}}"},x7={run:"运行流程",stop:"停止",resume:"继续",validate:"校验",export:"导出",import:"导入"},w7={nodeList:"节点列表",runHistory:"运行历史",validation:"校验结果"},v7={workspace:"工作区",loading:"加载中…",archived:"已归档",noPipelines:"暂无流水线",more:"更多",moreFlows:"更多流程",noRuns:"暂无运行记录",searchNodes:"搜索节点",noComponents:"暂无可用组件(检查节点库目录)",noMatch:"无匹配节点,请调整搜索词",selectPipeline:"从上方选择一条流水线以加载组件与画布",validationWarnings:"校验警告(与 agentflow validate 槽位检查一致)",output:"输出",model:"模型",userDir:"用户目录",toggleRecentActivity:"展开或收起最近打开或最近运行"},b7={selectPipeline:"请从顶部下拉选择一条流水线",loadingProps:"加载节点属性…",pipelineId:"流水线 ID",diskPath:"磁盘路径",storageLocation:"存储位置",introduction:"介绍",introductionPlaceholder:"简要描述这条流水线的用途(写入 flow.yaml 的 ui.description)",metadata:"元数据",nodeCount:"节点数",nodesUnit:"个节点",loading:"加载中…",noRuns:"暂无运行记录(终端执行后会在工作区生成运行目录)"},S7={saving:"保存中…",saved:"已保存",saveFailed:"保存失败",runInTerminal:"运行请使用终端"},k7={requirement:"需求拆解",planning:"技术规划",code:"代码执行",test:"测试回归",normal:"普通"},N7={phase:"阶段",allPhasesComplete:"所有阶段完成",currentPhaseComplete:"当前阶段完成,等待确认继续…"},C7={node:"节点",text:"文本",file:"文件",bool:"布尔"},E7={title:"节点执行上下文",resizeHandle:"拖动调整节点上下文宽度",apiConnectError:"无法连接 API(请使用 agentflow ui 打开页面,或为 Vite 开发配置 /api 代理)",invalidJson:"响应不是有效 JSON",requestTimeout:"请求超时,请稍后重试或检查 agentflow ui",executingNoArtifacts:"执行中,产物尚未写入工作区…",noData:"暂无数据(本 run 尚未执行到该节点或未产生产物)",latest:"最新",detectedContentType:"检测到的内容类型",roundNoContent:"该轮次暂无内容",empty:"(空)",imageTruncated:"图像已截断(超过大小上限)",statusSuccess:"成功",statusFailed:"失败",statusRunning:"运行中",statusCacheMiss:"缓存失效",statusPending:"等待"},j7={title:"快捷键",general:"常规",saveDesc:"保存;节点属性侧栏打开时先提交节点再保存 flow",shortcutsLabel:"快捷键",jumpToNode:"按 ID 跳转到节点",canvas:"画布",selectTool:"选择工具",panTool:"平移工具",holdSpacePan:"按住空格临时平移",selectAll:"全选所有节点"},P7={title:"跳转到节点",placeholder:"输入节点 ID 或名称…",empty:"未匹配到节点",hintNavigate:"切换",hintJump:"跳转",hintClose:"关闭"},_7={title:"开始构建你的流程",text:"在下方 AI 输入框中描述你的流程,或从左侧面板拖拽节点到画布",composerHint:"使用 AI Composer 构建 AgentFlow",composerSub:"从左侧拖入节点,或在<strong>下方输入框</strong>中用自然语言描述工作流。<br/>按 <kbd>?</kbd> 查看快捷键。"},I7={mainNav:"主导航"},A7={flowWarningAriaLabel:"流程校验警告",reloadFromServer:"从服务器重新加载流程并刷新校验",reloadFromServerShort:"从服务器重新加载",closeBanner:"关闭校验警告横幅",nodePrefix:"节点",focusNodeAriaLabel:"在画布中选中并定位节点 {{nodeId}}",slotWarningCount:"槽位校验 {{count}} 条(已隐藏)",show:"显示",shortcutHint:"按 ? 查看快捷键",shortcutHintLabel:"快捷键",inputSlotNoEdge:' 的 input 槽位 "{{slotName}}"({{handle}})无对应 edge 连接',outputSlotNoEdge:' 的 output 槽位 "{{slotName}}"({{handle}})无对应 edge 连接'},T7={title:"AI 助手",placeholder:"让 AI 协助编辑此节点…",thinking:"思考",reply:"回复",result:"结果",error:"错误",waiting:"等待响应…",yourQuestion:"您的问题",send:"发送",expand:"展开对话",collapse:"收起",connecting:"连接中…",requestFailed:"请求失败",cannotReadStream:"无法读取响应流",connectTimeout:"连接超时(120s),请确认 UI 服务正在运行并重试。[CONNECT_TIMEOUT]",aborted:"已中止",executing:"执行中…",ready:"就绪",done:"完成",inputPlaceholder:"在此输入问题(⌘/Ctrl+Enter 发送)",inputAriaLabel:"问题输入",mentionAriaLabel:"提及:实例与节点类型",modelLabel:"模型",modelAriaLabel:"对话模型",modelDefault:"默认",modelNotInList:"(不在当前列表)",stopGeneration:"停止生成",conversationOutput:"对话与输出",collapseAriaLabel:"收起",closeSidebar:"关闭侧栏",endConversation:"结束对话(将停止生成)",closeConversation:"关闭对话",newConversation:"新建对话",switchConversation:"切换对话",selectedNodesAriaLabel:"已选节点列表",selectedNodesEmpty:"在画布上选择节点,或在输入框用 @ 选择实例(Instances)或节点类型(Node)",removeFromInput:"从输入中移除 @{{id}}",deselectNode:"取消选中 {{id}}",taskPlan:`📋 任务规划({{count}} 步):
144
+ {{summary}}`,step:"步骤 {{current}}/{{total}}: {{description}}",phaseGeneration:`分阶段生成({{count}} 阶段):{{labels}}
145
+ 当前:{{current}}`,phaseComplete:"{{phaseName}}已完成。下一阶段:{{nextPhase}}",nextPhase:"下一阶段",continuePhase:"继续{{label}}",skipRemainingPhases:"请一次性完成剩余所有步骤(跳过分阶段确认)",phaseProgress:"分阶段进度",phaseReviewLabel:"分阶段选项",phaseReviewHint:"当前阶段完成,请在画布上检查结果,确认无误后进入「{{nextPhase}}」",phaseReviewContinue:"继续:{{label}}",phaseReviewSkip:"跳过,一次性完成剩余",stepsAriaLabel:"任务步骤进度",phasesAriaLabel:"生成阶段进度",phaseNumber:"第 {{index}} 阶段",stepRoleLabel:"角色:{{role}}",stepInstanceLabel:"实例:{{instanceId}}",pageRefreshReset:"页面刷新后重置",conversationLabel:"对话 {{n}}"},R7={currentPipeline:"当前流水线",backToEdit:"返回编辑",backToProjects:"返回项目",executionLog:"执行日志",history:"历史",pipelineSettings:"流水线设置",shortcutsLabel:"快捷键",shortcutsTitle:"快捷键 (?)",deletePipeline:"删除流水线",resumeTitle:"在同一 run 目录继续执行(uuid={{uuid}})",resumeTitleNoUuid:"尚未收到 apply-start,将发起新的 run",rerunTitle:"从头开始新的运行",runOptions:"运行选项",runWithParams:"带参数运行",runWithPreset:"指定预设运行",editRun:"编辑运行参数",startRun:"开始执行",stopRun:"停止后台运行"},L7={nodePalette:"节点调色板",noPipelineSelected:"未选择流水线",moreRuns:"+{{count}} 更多",moreFlows:"+{{count}} 更多流程",runId:"运行 ID: {{id}}"},O7={connectingApi:"正在连接 /api/flow/run…",connectingApiResume:"正在连接 /api/flow/run(恢复 run uuid={{uuid}})…",connectedReceiving:"已连接执行流,正在接收 NDJSON 输出…",noBody:"响应无 body(无法流式读取),请检查浏览器与 agentflow ui 版本",nodeStart:"▶ 开始执行: {{instanceId}}",nodeStartWithLabel:"▶ 开始执行: {{instanceId}} ({{label}})",nodeDone:"✓ 完成: {{instanceId}}",nodeDoneWithElapsed:"✓ 完成: {{instanceId}} ({{elapsed}})",nodeFailed:"✗ 失败: {{instanceId}}",pipelineStart:"流水线开始执行 (uuid={{uuid}})",pipelineDone:"流水线执行完成",pipelineDoneWithElapsed:"流水线执行完成 ({{elapsed}})",pipelinePaused:"流水线暂停: 等待用户输入 ({{nodes}})",unknownError:"未知错误",executionEnd:"执行结束 (exit code: {{exitCode}})",executionStopped:"执行已暂停",pauseRun:"暂停运行(可稍后恢复)",pauseConfirm:"确认暂停当前 run?之后可从中断节点恢复。",pauseTitle:"暂停运行",pauseConfirmOk:"暂停",backPromptTitle:"返回项目列表",backPromptMessage:"流水线仍在运行,请选择处理方式:后台继续运行并退出,或停止后返回编辑。",backBackground:"后台运行并退出",backStopEdit:"停止并进入编辑",resizeConsole:"拖动调整执行日志高度",closeLog:"关闭日志",userCheckContent:"等待用户确认节点 {{instanceId}} 的内容",userAskPrompt:"等待用户选择节点 {{instanceId}} 的分支"},M7={close:"关闭",loading:"加载中…",placeholder:"文件内容",largeFileWarning:"文件较大,编辑器性能可能受影响",reset:"重置",aiEdit:"AI 修改",aiRunning:"AI 处理中…",save:"保存",saving:"保存中…",saved:"已保存"},D7={title:"流水线设置",subtitle:"管理流水线的基础信息、存储位置、节点市场、定时任务与元数据。",sectionNav:"设置分区",basicInfo:"基础信息",storageAndPath:"存储与路径",nodeMarketplace:"节点市场配置",overview:"流水线概览",owner:"所有者",source:"来源",marketplaceNodes:"市场节点",marketNodesUnit:"个市场节点",marketplaceHint:"本地市场中的节点可加入当前流水线;已加入后可直接添加到画布。",marketplaceEmpty:"当前工作区还没有安装本地市场节点。可在节点属性面板发布节点。",addNodeFromMarket:"返回画布添加节点",quickActions:"快捷操作",saveChanges:"保存更改",savingChanges:"保存中…",installNode:"加入流水线",installingNode:"加入中…",addInstalledNode:"添加到画布",previewNode:"预览",nodePreviewTitle:"节点预览",nodeStylePreview:"节点样式预览",closePreview:"关闭预览",nodeFunction:"节点用途",nodePackageInfo:"包信息",definitionId:"Definition ID",version:"版本",packagePath:"包路径",packagedFiles:"打包文件",marketplaceNoDescription:"暂无节点用途说明。",noInputs:"无输入",noOutputs:"无输出",backToCanvas:"返回画布",help:"帮助中心",helpText:"节点发布入口在节点属性面板;合集安装后会同步进入本地节点市场。",archived:"已归档",archivedNote:"此流水线位于归档目录(_archived),无法在用户目录与工作区之间移动。",builtinNote:"内置模板只读;首次保存将写入工作区 .workspace/agentflow/pipelines(流水线)、.workspace/agentflow/nodes(自定义节点)等;旧 .cursor/agentflow/ 下文件仍可读。",moveBusy:"移动中…",moveToWorkspace:"移动到工作区",moveToUserDir:"移动到用户目录",globalSettings:"全局设置",currentPipeline:"当前流水线:",builtin:"内置",rename:"重命名",renameBusy:"重命名中…",renameSuccess:"已重命名",copyPath:"复制路径",pathCopied:"已复制"},F7={title:"定时执行",enabled:"启用定时触发",cron:"Cron 表达式",timezone:"时区",preset:"运行参数预设",defaultPreset:"默认参数",overlapSkip:"重叠策略:运行中则跳过本次触发",nextRun:"下一次预计触发:{{time}}",noNextRun:"未设置下一次触发时间",runtime:"调度状态",running:"运行中",waiting:"等待触发",disabled:"未启用",lastTriggeredAt:"最近触发",lastSkippedAt:"最近跳过",lastRun:"最近 Run",lastExit:"最近退出码",lastFinishedAt:"最近结束",readonlyNote:"内置或归档流水线不可保存定时配置。",save:"保存定时配置",saving:"保存中…",saved:"定时配置已保存"},$7={title:"执行历史",summary:"执行结果汇总",successCount:"{{count}} 成功",failedCount:"{{count}} 失败",stoppedCount:"{{count}} 已停止",interruptedCount:"{{count}} 已中断",runningCount:"{{count}} 进行中",success:"成功",failed:"失败",stopped:"已停止",interrupted:"已中断",running:"进行中",unknown:"未知",runLabel:"运行 #{{id}}",enterRunView:"进入该次运行的画布与日志态"},z7={invalidInstanceId:"实例 ID 格式无效:仅允许英文字母、数字、下划线、短横线,且不能以数字开头。",duplicateInstanceId:"该实例 ID 已存在,请换一个。",loadFlowFailed:"读取 flow 失败",loadNodesFailed:"读取节点库失败"},B7={invalidPlaceholder:"无效占位符: {{hint}}",empty:"(空)",inputSubtitle:"输入 · {{type}}",inputSubtitleNoType:"输入",outputSubtitle:"输出 · {{type}}",outputSubtitleNoType:"输出",runtimeConst:"运行时常量"},H7={justNow:"刚刚",minutesAgo:"{{n}} 分钟前",hoursAgo:"{{n}} 小时前",yesterday:"昨天",daysAgo:"{{n}} 天前",milliseconds:"{{n}} 毫秒",seconds:"{{n}} 秒"},U7={title:"用户确认 ({{instanceId}})",edit:"编辑",save:"保存",cancel:"取消",aiEditPlaceholder:"输入 AI 修改指令,如:删除第二项、合并前两项…",aiEditBtn:"AI 修改",aiEditStarted:"AI 正在修改内容…",aiEditDone:"AI 修改完成",aiEditFailed:"AI 修改失败",contentSaved:"内容已保存",saveFailed:"保存失败",close:"关闭",continue:"继续执行",hint:"编辑或使用 AI 修改后点击保存,然后点击「继续执行」恢复流程"},V7={title:"用户选择 ({{instanceId}})",hint:"请从下方选项中选择一项以继续流程",submitting:"提交中…",submitFailed:"提交失败",close:"关闭",noOptions:"该节点未配置选项,请先在编辑器中为 output 槽位添加条目。"},W7={title:"Print 输出: {{instanceId}}",truncated:"...内容已截断"},K7={save:"保存",cancel:"取消"},Y7={title:"带参数运行",noParams:"此流程无输入参数",run:"运行",cancel:"取消"},q7={title:"指定预设运行",noPresets:"无可用预设",default:"默认运行",run:"运行",cancel:"取消"},G7={preset:"预设",default:"默认",newPreset:"新建预设",deletePreset:"删除预设",presetNamePlaceholder:"预设名称",inputParams:"输入参数",noProvideNodes:"此流程无 provide 节点",filePathPlaceholder:"文件路径…",stringValuePlaceholder:"值…",presetSaved:"预设已保存",presetDeleted:"预设已删除",savePreset:"保存当前预设",expandInput:"编辑内容"},X7={title:f7,nodes:p7,edges:h7,properties:m7,node:g7,nodeProps:y7,actions:x7,panel:w7,palette:v7,pipeline:b7,status:S7,roles:k7,phases:N7,types:C7,runContext:E7,shortcuts:j7,jumpPalette:P7,emptyCanvas:_7,sidebar:I7,validation:A7,composer:T7,topbar:R7,palette2:L7,run:O7,fileEdit:M7,settings:D7,schedule:F7,history:$7,nodePropsError:z7,placeholder:B7,time:H7,userCheck:U7,userAsk:V7,toolPrint:W7,provideEdit:K7,runParams:Y7,runPreset:q7,runConfig:G7},Q7="设置",J7={engine:"引擎设置",preferences:"全局首选项"},Z7={title:"工作区",currentPath:"当前工作区根目录",placeholder:"加载中…",copyPath:"复制路径",description:"流水线与节点清单将相对于此目录解析(由启动 UI 时传入)。"},eW={title:"Cursor CLI",status:{cached:"已缓存",notCached:"未缓存"},modelPreviewLabel:"Cursor 模型名称列表",modelList:{cached:"模型清单已缓存",empty:"暂无模型列表",count:"{{count}} 条",fetchedAt:"更新 {{time}}",never:"尚未拉取",refresh:"刷新清单",fetching:"拉取中…"}},tW={modelPreviewLabel:"OpenCode 模型名称列表",title:"OpenCode CLI",status:{ready:"就绪",notFound:"未找到"},provider:"方案 / Provider 标识",providerPlaceholder:"例如 bailian-coding-plan",saving:"正在保存并更新清单…",description:"对应 CLI opencode models <provider> 的参数;停止输入后会写入用户目录 config 并刷新 model-lists.json。"},nW={title:"Claude Code CLI",status:{ready:"就绪",notFound:"未找到"},modelPreviewLabel:"Claude Code 模型名称列表",description:"内置模型列表(Claude Code CLI 无 models 子命令);刷新将探测 claude 二进制是否在 PATH 中。首次使用请先执行 claude /login。"},rW={title:"环境变量",note:"仅本机、本浏览器",key:"键",value:"值",add:"添加",delete:"删除 {{key}}",newKey:"新环境变量键",newValue:"值(密钥请谨慎)"},iW={title:"系统状态",normal:"服务正常",abnormal:"部分接口异常",cursorModels:"Cursor 模型",opencodeModels:"OpenCode 模型",claudeCodeModels:"Claude Code 模型"},oW={title:"快捷入口",projects:"项目与流水线",flowEditor:"节点画布"},sW={title:"语言",description:"选择界面显示语言",options:{zh:"中文",en:"English",ja:"日本語"}},aW={title:"新手引导",description:"重新启动产品引导流程,了解 AgentFlow 的核心功能。",reset:"重置引导",resetSuccess:"已重置,下次访问将自动启动引导"},lW={title:Q7,crumb:J7,workspace:Z7,cursor:eW,opencode:tW,claudeCode:nW,env:rW,system:iW,shortcuts:oW,language:sW,onboarding:aW},cW={thinking:"思考",result:"结果",reply:"回复",error:"错误"},uW={input:"让 AI 协助编辑此节点…",waiting:"等待响应…",selectedEmpty:"在画布上选择节点,或在输入框用 @ 选择实例(Instances)或节点类型(Node)",textarea:"描述你的流程或让 AI 协助编辑(⌘/Ctrl+Enter 发送)"},dW={send:"发送",stop:"停止",expand:"展开",collapse:"收起",clear:"清空"},fW={conversation:"对话",conversationWithNumber:"对话 {{num}}",default:"默认"},pW={endSession:"结束对话(将停止生成)",closeSession:"关闭对话",newSession:"新建对话",expandComposer:"展开对话与输出"},hW={hint:"使用底部输入框进行 AI 对话,支持 @节点、选择模型等功能"},mW={aiLabels:cW,placeholders:uW,actions:dW,labels:fW,tooltips:pW,rightPanel:hW},gW="项目",yW="全部",xW="已归档",wW="活跃项目",vW="已归档流水线",bW="创建新项目",SW="新建流水线",kW="搜索流水线…",NW="加载流水线列表…",CW="筛选结果:{{count}} 条(匹配标题、描述、路径与标签)",EW="已归档的流水线仍可打开与编辑;文件位于各 pipelines 目录下的 _archived。",jW="管理分布式节点架构与监控流水线。可将 flow.yaml 或 .zip 拖入本页导入分享流程。",PW="暂无归档项目。",_W="暂无未归档流水线;已归档项在 Archived 标签中查看。",IW="未能加载流水线列表。",AW="当前工作区暂无流水线。",TW="在仓库根目录执行 {{code1}} 并确认工作区包含 {{code2}} 或用户目录下的流水线;亦可点击 New Pipeline 新建。",RW="未找到与「{{query}}」匹配的流水线。可尝试其他关键词,或点击清除搜索。",LW="最近打开或最近运行",OW="暂无打开或运行记录",MW="暂无与关键词匹配的最近记录",DW="最近运行",FW="最近打开",$W={builtin:"内置",workspace:"工作区",user:"用户"},zW="打开以在节点画布中编辑此流水线。",BW={eyebrow:"AgentFlow Hub",title:"浏览社区流程",desc:"发现并一键安装社区分享的现成流水线。",cta:"前往 Hub",cliHint:"或通过 CLI 安装:agentflow download <slug>"},HW={title:"新建空流水线",lead:"请先填写流水线名称(英文标识);介绍可选,将保存在 flow 的 ui.description。",nameLabel:"名称(必填)",namePlaceholder:"例如 my_feature_flow",nameHint:"须以英文字母开头,仅可使用字母、数字、下划线 _ 与连字符 -",descLabel:"介绍(可选)",descPlaceholder:"简要说明此流水线的用途…",locationLabel:"保存位置",userDir:"用户目录(~/agentflow/pipelines)",workspaceDir:"当前工作区(.workspace/agentflow/pipelines)",createFailed:"创建失败",creating:"创建中…",createAndOpen:"创建并打开",cancel:"取消",close:"关闭"},UW={title:"导入流水线",lead:"已选择文件「{{filename}}」。请确认流水线名称与保存位置;ZIP 将保留目录内脚本等文件。",nameLabel:"名称(必填)",namePlaceholder:"例如 my_shared_flow",nameHint:"须以英文字母开头,仅可使用字母、数字、下划线 _ 与连字符 -",locationLabel:"保存位置",userDir:"用户目录(~/agentflow/pipelines)",workspaceDir:"当前工作区(.workspace/agentflow/pipelines)",changeFile:"更换文件…",importFailed:"导入失败",importing:"导入中…",importAndOpen:"导入并打开",cancel:"取消",close:"关闭"},VW={title:"删除流水线",lead:"将永久删除磁盘上的流水线目录(含 flow.yaml、脚本等),无法撤销。请在下方输入流水线 ID「{{flowId}}」以确认。",confirmLabel:"确认流水线名称",deleteFailed:"删除失败",deleteTimeout:"删除请求超时,请重试(可先检查终端中的 UI 服务日志)",delete:"删除",deleting:"删除中…",confirmDelete:"确认删除",cancel:"取消",close:"关闭"},WW={title:"归档流水线",lead:"归档后流水线将移入「Archived」列表,仍可从该列表打开与编辑。请在下方输入流水线 ID「{{flowId}}」以确认。",confirmLabel:"确认流水线名称",archiveFailed:"归档失败",archive:"归档",archiving:"归档中…",confirmArchive:"确认归档",cancel:"取消",close:"关闭"},KW={title:gW,all:yW,archived:xW,activeProjects:wW,archivedPipelines:vW,createNew:bW,newPipeline:SW,searchPipelines:kW,loadingPipelines:NW,filterResult:CW,archivedHint:EW,activeHint:jW,noArchived:PW,noActive:_W,loadFailed:IW,noPipelines:AW,emptyHint:TW,noMatch:RW,recentActivity:LW,noRecentActivity:OW,noMatchRecent:MW,recentRun:DW,recentOpen:FW,sourceBadge:$W,defaultCardDesc:zW,hubCard:BW,newPipelineModal:HW,importModal:UW,deleteModal:VW,archiveModal:WW},YW="返回",qW="下一步",GW="跳过",XW="完成",QW="开始创建",JW={intro:`欢迎使用 AgentFlow!这是一个可视化流程编排工具。
146
+
147
+ 点击下方按钮开始创建你的第一个流水线。`,hubIntro:`不想从零开始?
148
+
149
+ 在 AgentFlow Hub 浏览社区分享的现成流水线,一键安装即可运行。`},ZW={intro:`现在进入流程编辑器。
150
+
151
+ 在下方输入框用自然语言描述你的需求,AI 会自动生成流程图。
152
+
153
+ 左侧节点面板可以自由拖拽、删除和调整连接。`,introEmpty:`画布为空,开始创建你的流程吧!
154
+
155
+ 在下方输入框用自然语言描述需求,AI 会自动生成流程图。
156
+
157
+ 左侧节点面板可以自由拖拽、删除和调整连接。`},eK={guideTitle:"首次创建提示",guideDesc:"输入名称和描述后,AI 会自动生成流程图。你可以在编辑器中自由调整节点和连接。",nameHintGuide:"例如:MyFirstFlow(字母开头,支持数字和下划线)",descPlaceholderGuide:"例如:实现用户登录功能,包含注册、验证、授权",descHintGuide:"描述越详细,AI 生成的流程越准确",createGuide:"创建并开始编辑",typeNode:"节点引用类型",typeStr:"字符串类型",typeFile:"文件路径类型",typeBool:"布尔值类型"},tK={back:YW,next:qW,skip:GW,done:XW,startCreate:QW,projects:JW,flow:ZW,newPipeline:eK},nK={en:{common:pU,flow:JU,settings:uV,composer:yV,project:qV,onboarding:r7},zh:{common:d7,flow:X7,settings:lW,composer:mW,project:KW,onboarding:tK}};Vt.use(CP).use(DA).init({resources:nK,fallbackLng:"en",debug:!1,ns:["common","flow","settings","composer","project","onboarding"],defaultNS:"common",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],lookupLocalStorage:"agentflow-lang",caches:["localStorage"]}});const rK=[{code:"zh",name:"中文",flag:"🇨🇳"},{code:"en",name:"English",flag:"🇬🇧"}];function iK(e){return Vt.changeLanguage(e)}const EP="agentflow-settings-env-v1",ry="agentflow-settings-opencode-plan-v1";function mm(e){if(!e||typeof e!="object")return{cursor:[],opencode:[],claudeCode:[],cursorFetchedAt:null,opencodeFetchedAt:null,claudeCodeFetchedAt:null};const t=e;return{cursor:Array.isArray(t.cursor)?t.cursor.map(String):[],opencode:Array.isArray(t.opencode)?t.opencode.map(String):[],claudeCode:Array.isArray(t.claudeCode)?t.claudeCode.map(String):[],cursorFetchedAt:t.cursorFetchedAt??null,opencodeFetchedAt:t.opencodeFetchedAt??null,claudeCodeFetchedAt:t.claudeCodeFetchedAt??null}}function jP(){return`e_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function oK(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const r=String(n.key??"").trim(),i=String(n.value??""),o=String(n.id??"").trim()||jP();!r&&!i||t.push({id:o,key:r,value:i})}return t}function sK(){try{const e=localStorage.getItem(EP);return e?oK(JSON.parse(e)):[]}catch{return[]}}function Y1(){try{return localStorage.getItem(ry)??""}catch{return""}}function aK(e){return e?e.length<=6?"•".repeat(e.length):`${"•".repeat(Math.min(20,e.length-4))}${e.slice(-4)}`:""}function lK(e,t="zh"){if(!e)return"";const n=Date.parse(e);if(Number.isNaN(n))return String(e);try{const r=t==="en"?"en-US":t==="ja"?"ja-JP":"zh-CN";return new Intl.DateTimeFormat(r,{dateStyle:"short",timeStyle:"medium"}).format(new Date(n))}catch{return String(e)}}function cK(){const{t:e,i18n:t}=st(["common","settings"]),n=t.language||"zh",[r,i]=w.useState(""),[o,s]=w.useState(""),[a,c]=w.useState({cursor:[],opencode:[],claudeCode:[],cursorFetchedAt:null,opencodeFetchedAt:null,claudeCodeFetchedAt:null}),[u,p]=w.useState(""),[d,f]=w.useState(!1),[h,m]=w.useState(!1),[b,S]=w.useState(""),[g,v]=w.useState(()=>sK()),[y,N]=w.useState(""),[j,k]=w.useState(""),[_,R]=w.useState(""),M=w.useRef(null),H=w.useRef(!1),P=w.useCallback(async()=>{s("");try{const U=await fetch("/api/ui-context");if(!U.ok)throw new Error("HTTP "+U.status);const O=await U.json();i(typeof O.workspaceRoot=="string"?O.workspaceRoot:"")}catch(U){s(String(U.message||U)),i("")}},[]),T=w.useCallback(async()=>{p(""),f(!0);try{const U=await fetch("/api/model-lists");if(!U.ok)throw new Error("HTTP "+U.status);const O=await U.json();c(mm(O))}catch(U){p(String(U.message||U))}finally{f(!1)}},[]),V=w.useCallback(async()=>{p(""),f(!0);try{const U=await fetch("/api/update-model-lists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({opencodeProvider:_.trim()})}),O=await U.json().catch(()=>({}));if(!U.ok)throw new Error(typeof O.error=="string"?O.error:"HTTP "+U.status);c(mm(O.modelLists))}catch(U){p(String(U.message||U))}finally{f(!1)}},[_]);w.useEffect(()=>{P(),T(),(async()=>{try{const U=await fetch("/api/agentflow-config");if(U.ok){const O=await U.json(),q=typeof O.opencodeProvider=="string"?O.opencodeProvider:"";R(q),M.current=q;try{localStorage.setItem(ry,q)}catch{}}else{const O=Y1();R(O),M.current=O}}catch{const U=Y1();R(U),M.current=U}finally{H.current=!0}})()},[P,T]),w.useEffect(()=>{try{localStorage.setItem(EP,JSON.stringify(g))}catch{}},[g]),w.useEffect(()=>{if(!H.current)return;const U=_.trim();if(U===M.current)return;const O=setTimeout(()=>{(async()=>{m(!0),S("");try{const q=await fetch("/api/agentflow-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({opencodeProvider:U})}),Z=await q.json().catch(()=>({}));if(!q.ok)throw new Error(typeof Z.error=="string"?Z.error:"HTTP "+q.status);M.current=U;try{localStorage.setItem(ry,U)}catch{}Z.modelLists&&c(mm(Z.modelLists))}catch(q){S(String(q.message||q))}finally{m(!1)}})()},450);return()=>clearTimeout(O)},[_]);const L=a.cursor.length>0,B=a.opencode.length>0,F=a.claudeCode.length>0,$=w.useCallback(()=>{var U;r&&((U=navigator.clipboard)==null||U.writeText(r))},[r]),I=w.useCallback(()=>{const U=y.trim(),O=j;U&&(v(q=>[...q,{id:jP(),key:U,value:O}]),N(""),k(""))},[y,j]),A=w.useCallback(U=>{v(O=>O.filter(q=>q.id!==U))},[]),E=w.useCallback(U=>{const O=U.target.value;iK(O)},[]),z=U=>{const O=lK(U,n);return O?e("settings:cursor.modelList.fetchedAt",{time:O}):e("settings:cursor.modelList.never")};return l.jsxs("div",{className:"af-settings-page",children:[l.jsx("header",{className:"af-settings-top",children:l.jsxs("div",{className:"af-settings-crumb","aria-label":e("settings:title"),children:[l.jsx("span",{className:"af-settings-crumb-muted",children:e("settings:crumb.engine")}),l.jsx("span",{className:"af-settings-crumb-sep","aria-hidden":!0,children:"/"}),l.jsx("span",{className:"af-settings-crumb-active",children:e("settings:crumb.preferences")})]})}),l.jsx("div",{className:"af-settings-body",children:l.jsxs("div",{className:"af-settings-inner",children:[l.jsxs("header",{className:"af-settings-hero",children:[l.jsxs("h1",{className:"af-settings-h1",children:[e("common:app.name")," ",e("settings:title")]}),l.jsx("p",{className:"af-settings-lead",children:e("settings:workspace.description")}),o?l.jsx("p",{className:"af-err af-settings-api-hint",children:o}):null,u?l.jsx("p",{className:"af-err af-settings-api-hint",children:u}):null]}),l.jsxs("div",{className:"af-settings-layout",children:[l.jsxs("div",{className:"af-settings-bento",children:[l.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--low af-set-workspace",children:[l.jsxs("div",{className:"af-set-card-inner",children:[l.jsxs("div",{className:"af-set-card-head",children:[l.jsx("span",{className:"material-symbols-outlined af-set-icon af-set-icon--secondary",children:"folder_managed"}),l.jsx("h2",{className:"af-set-h2",children:e("settings:workspace.title")})]}),l.jsx("label",{className:"af-set-label",htmlFor:"af-workspace-path",children:e("settings:workspace.currentPath")}),l.jsxs("div",{className:"af-set-input-wrap",children:[l.jsx("input",{id:"af-workspace-path",className:"af-set-input af-set-input--mono",type:"text",readOnly:!0,value:r,placeholder:e("common:loading")}),l.jsx("button",{type:"button",className:"af-set-input-suffix",onClick:$,"aria-label":e("settings:workspace.copyPath"),disabled:!r,children:l.jsx("span",{className:"material-symbols-outlined",children:"content_copy"})})]}),l.jsx("p",{className:"af-set-hint",children:e("settings:workspace.description")})]}),l.jsx("div",{className:"af-set-watermark","aria-hidden":!0,children:l.jsx("span",{className:"material-symbols-outlined",children:"account_tree"})})]}),l.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[l.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[l.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:"Cursor CLI"}),l.jsx("span",{className:"af-set-badge"+(L?" af-set-badge--ok":" af-set-badge--muted"),children:e(L?"settings:cursor.status.cached":"settings:cursor.status.notCached")})]}),l.jsxs("div",{className:"af-set-cli-block",children:[l.jsx("div",{className:"af-set-cli-icon",children:l.jsx("span",{className:"material-symbols-outlined af-set-icon--tertiary",children:L?"check_circle":"hourglass_empty"})}),l.jsxs("div",{children:[l.jsx("p",{className:"af-set-cli-title",children:e(L?"settings:cursor.modelList.cached":"settings:cursor.modelList.empty")}),l.jsx("p",{className:"af-set-cli-mono",children:L?e("settings:cursor.modelList.count",{count:a.cursor.length})+" · "+z(a.cursorFetchedAt):e("settings:cursor.modelList.refresh")})]})]}),L?l.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:cursor.modelPreviewLabel"),children:a.cursor.join(`
158
+ `)}):null,l.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),l.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[l.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[l.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:"OpenCode"}),l.jsx("span",{className:"af-set-badge"+(B?" af-set-badge--ok":" af-set-badge--err"),children:e(B?"settings:opencode.status.ready":"settings:opencode.status.notFound")})]}),l.jsx("p",{className:"af-set-p",children:e("settings:opencode.description")}),l.jsxs("div",{children:[l.jsx("label",{className:"af-set-label-sm",htmlFor:"af-opencode-plan",children:e("settings:opencode.provider")}),l.jsx("input",{id:"af-opencode-plan",className:"af-set-input af-set-input--sm af-set-input--mono",type:"text",value:_,onChange:U=>R(U.target.value),placeholder:e("settings:opencode.providerPlaceholder"),autoComplete:"off"}),h?l.jsx("p",{className:"af-set-hint af-set-hint--inline","aria-live":"polite",children:e("settings:opencode.saving")}):null,b?l.jsx("p",{className:"af-err af-set-hint af-set-hint--inline",role:"alert",children:b}):null]}),B?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"af-set-cli-mono af-set-cli-mono--block",children:e("settings:cursor.modelList.count",{count:a.opencode.length})+" · "+z(a.opencodeFetchedAt)}),l.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:opencode.modelPreviewLabel"),children:a.opencode.join(`
159
+ `)})]}):null,l.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),l.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[l.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[l.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:e("settings:claudeCode.title")}),l.jsx("span",{className:"af-set-badge"+(F?" af-set-badge--ok":" af-set-badge--err"),children:e(F?"settings:claudeCode.status.ready":"settings:claudeCode.status.notFound")})]}),l.jsxs("div",{className:"af-set-cli-block",children:[l.jsx("div",{className:"af-set-cli-icon",children:l.jsx("span",{className:"material-symbols-outlined af-set-icon--tertiary",children:F?"check_circle":"hourglass_empty"})}),l.jsxs("div",{children:[l.jsx("p",{className:"af-set-cli-title",children:e(F?"settings:cursor.modelList.cached":"settings:cursor.modelList.empty")}),l.jsx("p",{className:"af-set-cli-mono",children:F?e("settings:cursor.modelList.count",{count:a.claudeCode.length})+" · "+z(a.claudeCodeFetchedAt):e("settings:cursor.modelList.refresh")})]})]}),l.jsx("p",{className:"af-set-p",children:e("settings:claudeCode.description")}),F?l.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:claudeCode.modelPreviewLabel"),children:a.claudeCode.join(`
160
+ `)}):null,l.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),l.jsxs("section",{className:"af-set-card af-set-card--wide af-set-card--low af-set-env",children:[l.jsxs("div",{className:"af-set-env-head",children:[l.jsxs("div",{className:"af-set-card-head",children:[l.jsx("div",{className:"af-set-env-icon-wrap",children:l.jsx("span",{className:"material-symbols-outlined af-set-icon--primary",children:"variables"})}),l.jsx("h2",{className:"af-set-h2",children:e("settings:env.title")})]}),l.jsx("span",{className:"af-set-env-note",children:e("settings:env.note")})]}),l.jsxs("div",{className:"af-set-env-rows",children:[g.map(U=>l.jsxs("div",{className:"af-set-env-row",children:[l.jsxs("div",{className:"af-set-env-cell",children:[l.jsx("span",{className:"af-set-env-k",children:e("settings:env.key")}),l.jsx("code",{className:"af-set-code-key",children:U.key||"—"})]}),l.jsxs("div",{className:"af-set-env-cell af-set-env-cell--grow",children:[l.jsx("span",{className:"af-set-env-k",children:e("settings:env.value")}),l.jsx("code",{className:"af-set-code-val",children:aK(U.value)})]}),l.jsx("div",{className:"af-set-env-actions",children:l.jsx("button",{type:"button",className:"af-set-env-del","aria-label":e("settings:env.delete",{key:U.key}),onClick:()=>A(U.id),children:l.jsx("span",{className:"material-symbols-outlined",children:"delete_outline"})})})]},U.id)),l.jsxs("div",{className:"af-set-env-row af-set-env-row--draft",children:[l.jsx("div",{className:"af-set-env-cell",children:l.jsx("input",{className:"af-set-input af-set-input--dashed af-set-input--mono",placeholder:"KEY_NAME",value:y,onChange:U=>N(U.target.value),"aria-label":e("settings:env.newKey")})}),l.jsx("div",{className:"af-set-env-cell af-set-env-cell--grow",children:l.jsx("input",{className:"af-set-input af-set-input--dashed af-set-input--mono",type:"password",placeholder:e("settings:env.newValue"),value:j,onChange:U=>k(U.target.value),"aria-label":e("settings:env.newValue")})}),l.jsx("div",{className:"af-set-env-actions",children:l.jsxs("button",{type:"button",className:"af-set-btn-add",onClick:I,disabled:!y.trim(),children:[l.jsx("span",{className:"material-symbols-outlined",children:"add"}),e("settings:env.add")]})})]})]})]})]}),l.jsxs("aside",{className:"af-settings-rail","aria-label":e("settings:title"),children:[l.jsxs("div",{className:"af-set-rail-card af-set-rail-card--accent",children:[l.jsxs("div",{className:"af-set-rail-inner",children:[l.jsx("h3",{className:"af-set-rail-h3",children:e("settings:system.title")}),l.jsxs("div",{className:"af-set-health-line",children:[l.jsx("span",{className:"af-set-pulse-dot","aria-hidden":!0}),l.jsx("span",{className:"af-set-health-label",children:e(!o&&!u?"settings:system.normal":"settings:system.abnormal")})]}),l.jsxs("div",{className:"af-set-meter",children:[l.jsxs("div",{className:"af-set-meter-row",children:[l.jsx("span",{children:e("settings:system.cursorModels")}),l.jsx("span",{children:a.cursor.length})]}),l.jsx("div",{className:"af-set-meter-bar",children:l.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.cursor.length>0?12+a.cursor.length*3:4)}%`}})})]}),l.jsxs("div",{className:"af-set-meter",children:[l.jsxs("div",{className:"af-set-meter-row",children:[l.jsx("span",{children:e("settings:system.opencodeModels")}),l.jsx("span",{children:a.opencode.length})]}),l.jsx("div",{className:"af-set-meter-bar",children:l.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.opencode.length>0?12+a.opencode.length*3:4)}%`}})})]}),l.jsxs("div",{className:"af-set-meter",children:[l.jsxs("div",{className:"af-set-meter-row",children:[l.jsx("span",{children:e("settings:system.claudeCodeModels")}),l.jsx("span",{children:a.claudeCode.length})]}),l.jsx("div",{className:"af-set-meter-bar",children:l.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.claudeCode.length>0?12+a.claudeCode.length*3:4)}%`}})})]})]}),l.jsx("div",{className:"af-set-rail-watermark","aria-hidden":!0,children:l.jsx("span",{className:"material-symbols-outlined",children:"vital_signs"})})]}),l.jsxs("div",{className:"af-set-rail-card",children:[l.jsx("h3",{className:"af-set-rail-h3 af-set-rail-h3--sm",children:e("settings:language.title")}),l.jsxs("div",{className:"af-set-language-selector",children:[l.jsx("select",{className:"af-set-input af-set-input--sm",value:n,onChange:E,"aria-label":e("settings:language.description"),children:rK.map(U=>l.jsxs("option",{value:U.code,children:[U.flag," ",U.name]},U.code))}),l.jsx("p",{className:"af-set-hint",children:e("settings:language.description")})]})]})]})]})]})})]})}function PP(e){return t=>typeof t===e}var uK=PP("function"),dK=e=>e===null,q1=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",G1=e=>!fK(e)&&!dK(e)&&(uK(e)||typeof e=="object"),fK=PP("undefined");function pK(e,t,n){return vK(n,e,t)?!0:(bK(n,e,t),e.constructor!==t.constructor?!1:Array.isArray(e)&&Array.isArray(t)?hK(e,t,n):e instanceof Map&&t instanceof Map?yK(e,t,n):e instanceof Set&&t instanceof Set?wK(e,t):e instanceof WeakMap||e instanceof WeakSet?!1:ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)?mK(e,t):q1(e)&&q1(t)?e.source===t.source&&e.flags===t.flags:e instanceof Error&&t instanceof Error?gK(e,t,n):e.valueOf!==Object.prototype.valueOf?e.valueOf()===t.valueOf():e.toString!==Object.prototype.toString?e.toString()===t.toString():xK(e,t,n))}function eu(e,t,n){return e===t||Number.isNaN(e)&&Number.isNaN(t)?!0:!e||!G1(e)||!t||!G1(t)?!1:pK(e,t,n)}function hK(e,t,n){const{length:r}=e;if(r!==t.length)return!1;for(let i=r;i--!==0;)if(!eu(e[i],t[i],n))return!1;return!0}function mK(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let i=e.byteLength;for(;i--;)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function gK(e,t,n){return e.message===t.message&&e.name===t.name&&eu(e.cause,t.cause,n)}function yK(e,t,n){if(e.size!==t.size)return!1;for(const r of e.entries())if(!t.has(r[0]))return!1;for(const r of e.entries())if(!eu(r[1],t.get(r[0]),n))return!1;return!0}function xK(e,t,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let i=r.length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(let i=r.length;i--!==0;){const o=r[i];if(!(o==="_owner"&&e.$$typeof)&&!eu(e[o],t[o],n))return!1}return!0}function wK(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function vK(e,t,n){var r;return((r=e.get(t))==null?void 0:r.has(n))??!1}function bK(e,t,n){let r=e.get(t);r||(r=new WeakSet,e.set(t,r)),r.add(n)}function Ux(e,t){return eu(e,t,new WeakMap)}function gm(){var e;return!!(typeof window<"u"&&((e=window==null?void 0:window.document)!=null&&e.createElement))}function SK(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)}function kK(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}function NK(){const e=w.useRef(!0);return e.current?(e.current=!1,!0):e.current}function CK(e,t){const n=NK();w.useEffect(()=>{if(!n)return e()},t)}function _P(e){const t=w.useRef(void 0);return w.useEffect(()=>{t.current=e}),t.current}function EK(e,t){const n=w.useRef(t);return Ux(t,n.current)||(n.current=t),w.useMemo(e,n.current)}function jK(e){w.useEffect(()=>{e()},[])}function PK(e=0){const[t,n]=w.useState({height:gm()?window.innerHeight:0,width:gm()?window.innerWidth:0}),r=w.useRef(0),i=w.useRef(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n({width:window.innerWidth,height:window.innerHeight})},e)});return w.useEffect(()=>{if(!gm())return()=>{};const o=i.current;return n({height:window.innerHeight,width:window.innerWidth}),kK(window,"resize",o),()=>{SK(window,"resize",o)}},[]),t}var _K=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","URL","WeakMap","WeakSet"],IK=["bigint","boolean","null","number","string","symbol","undefined"];function tu(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(AK(t))return t}function wr(e){return t=>tu(t)===e}function AK(e){return _K.includes(e)}function _a(e){return t=>typeof t===e}function TK(e){return IK.includes(e)}var RK=["innerHTML","ownerDocument","style","attributes","nodeValue"],nu=e=>Array.isArray(e),LK=e=>tu(e)==="AsyncGeneratorFunction",OK=wr("AsyncFunction"),MK=_a("bigint"),DK=e=>e===!0||e===!1,FK=wr("Date"),$K=wr("Error"),ro=_a("function"),zK=wr("GeneratorFunction"),BK=e=>typeof e=="number"&&Number.isInteger(e),iy=wr("Map"),IP=e=>Number.isNaN(e),Vx=e=>e===null,AP=wr("Function"),HK=wr("Promise"),UK=wr("RegExp"),oy=wr("Set"),ru=_a("string"),VK=_a("symbol"),Wx=_a("undefined"),WK=wr("WeakMap"),KK=wr("WeakSet"),Kx=e=>Vx(e)||Wx(e),TP=e=>!Wx(e),YK=e=>_a("number")(e)&&!IP(e),qK=e=>ru(e)&&e.trim().length>0,GK=e=>{if(!ru(e)||e.length===0)return!1;const t=e.trim();return t.length>0&&Number.isFinite(Number(t))},_p=e=>!Kx(e)&&(ro(e)||typeof e=="object"),RP=e=>{if(tu(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})},XK=e=>Vx(e)||TK(typeof e),QK=e=>tu(e)==="URL",LP=e=>!Kx(e)&&ro(e[Symbol.iterator]),JK=e=>LP(e)&&ro(e.next)&&ro(e.throw),ZK=e=>ro(e)&&/^class\s/.test(e.toString()),eY=(e,t)=>!nu(e)||!ro(t)?!1:e.every(n=>t(n)),tY=e=>_p(e)&&!RP(e)&&e.nodeType===1&&ru(e.nodeName)&&RK.every(t=>t in e),nY=e=>ru(e)&&e.length===0||nu(e)&&e.length===0||_p(e)&&!iy(e)&&!oy(e)&&Object.keys(e).length===0||oy(e)&&e.size===0||iy(e)&&e.size===0,rY=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype,iY=(e,t)=>nu(e)?e.indexOf(t)>-1:!1,oY=(e,t,n)=>{if(!_p(e)||!t)return!1;const r=e[t];return ro(n)?n(r):TP(r)};function Re(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(nu(e))return"Array";if(AP(e))return"Function";const t=tu(e);return t||"Object"}Re.array=nu;Re.arrayOf=eY;Re.asyncGeneratorFunction=LK;Re.asyncFunction=OK;Re.bigint=MK;Re.boolean=DK;Re.class=ZK;Re.date=FK;Re.defined=TP;Re.domElement=tY;Re.empty=nY;Re.error=$K;Re.function=ro;Re.generator=JK;Re.generatorFunction=zK;Re.instanceOf=rY;Re.integer=BK;Re.iterable=LP;Re.map=iy;Re.nan=IP;Re.null=Vx;Re.nullOrUndefined=Kx;Re.nonEmptyString=qK;Re.number=YK;Re.numericString=GK;Re.object=_p;Re.oneOf=iY;Re.plainFunction=AP;Re.plainObject=RP;Re.primitive=XK;Re.promise=HK;Re.propertyOf=oY;Re.regexp=UK;Re.set=oy;Re.string=ru;Re.symbol=VK;Re.undefined=Wx;Re.url=QK;Re.weakMap=WK;Re.weakSet=KK;var Jt=Re;/* v8 ignore next -- @preserve */var sY=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},aY=function(e,t){return e+Mc(t)},Mc=function(e){return e===null||typeof e=="boolean"||typeof e>"u"?"":typeof e=="number"?e.toString():typeof e=="string"?e:Array.isArray(e)?e.reduce(aY,""):sY(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?Mc(e.props.children):""};Mc.default=Mc;var lY=Mc;const ym=oo(lY);var OP={exports:{}};(function(e){const t=Object.getPrototypeOf({});function n(){return function(o){return typeof o=="object"&&o!==null&&!(o instanceof RegExp)&&!(o instanceof Date)}}function r(i){function o(j){return j!=="constructor"&&j!=="prototype"&&j!=="__proto__"}function s(j){let k=0;const _=j.length,R=new Array(_);for(k;k<_;++k)R[k]=g(j[k]);return R}function a(j){const k={};if(f&&Object.getPrototypeOf(j)!==t)return f(j);const _=d(j);let R,M,H;for(R=0,M=_.length;R<M;++R)o(H=_[R])&&(k[H]=g(j[H]));return k}function c(j,k){const _=j.length,R=k.length;let M=0;const H=new Array(_+R);for(M;M<_;++M)H[M]=g(j[M]);for(M=0;M<R;++M)H[M+_]=g(k[M]);return H}const u=Object.prototype.propertyIsEnumerable;function p(j){const k=Object.keys(j),_=Object.getOwnPropertySymbols(j);for(let R=0,M=_.length;R<M;++R)u.call(j,_[R])&&k.push(_[R]);return k}const d=i!=null&&i.symbols?p:Object.keys,f=typeof(i==null?void 0:i.cloneProtoObject)=="function"?i.cloneProtoObject:void 0,h=typeof(i==null?void 0:i.isMergeableObject)=="function"?i.isMergeableObject:n(),m=(i==null?void 0:i.onlyDefinedProperties)===!0;function b(j){return typeof j!="object"||j===null}const S=i&&typeof i.mergeArray=="function"?i.mergeArray({clone:g,deepmerge:y,getKeys:d,isMergeableObject:h}):c;function g(j){return h(j)?Array.isArray(j)?s(j):a(j):j}function v(j,k){const _={},R=d(j),M=d(k);let H,P,T;for(H=0,P=R.length;H<P;++H)o(T=R[H])&&M.indexOf(T)===-1&&(_[T]=g(j[T]));for(H=0,P=M.length;H<P;++H)if(o(T=M[H]))if(T in j)R.indexOf(T)!==-1&&(f&&h(k[T])&&Object.getPrototypeOf(k[T])!==t?_[T]=f(k[T]):_[T]=y(j[T],k[T]));else{if(m&&typeof k[T]>"u")continue;_[T]=g(k[T])}return _}function y(j,k){if(m&&typeof k>"u")return g(j);const _=Array.isArray(k),R=Array.isArray(j);return b(k)?k:h(j)?_&&R?S(j,k):_!==R?g(k):v(j,k):g(k)}function N(){switch(arguments.length){case 0:return{};case 1:return g(arguments[0]);case 2:return y(arguments[0],arguments[1])}let j;for(let k=0,_=arguments.length;k<_;++k)j=y(j,arguments[k]);return j}return i!=null&&i.all?N:y}e.exports=r,e.exports.default=r,e.exports.deepmerge=r,Object.defineProperty(e.exports,"isMergeableObject",{get:n})})(OP);var cY=OP.exports;const uY=oo(cY);var dY=new Error("Element already at target scroll position"),fY=new Error("Scroll cancelled"),pY=Math.min,X1=Date.now,hY={left:Q1("scrollLeft"),top:Q1("scrollTop")};function Q1(e){return function(n,r,i,o){i=i||{},typeof i=="function"&&(o=i,i={}),typeof o!="function"&&(o=gY);var s=X1(),a=n[e],c=i.ease||mY,u=isNaN(i.duration)?350:+i.duration,p=!1;return a===r?o(dY,n[e]):requestAnimationFrame(f),d;function d(){p=!0}function f(h){if(p)return o(fY,n[e]);var m=X1(),b=pY(1,(m-s)/u),S=c(b);n[e]=S*(r-a)+a,b<1?requestAnimationFrame(f):requestAnimationFrame(function(){o(null,n[e])})}}}function mY(e){return .5*(1-Math.cos(Math.PI*e))}function gY(){}const yY=oo(hY);var MP={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(tc,function(){function t(r){var i=getComputedStyle(r,null).getPropertyValue("overflow");return i.indexOf("scroll")>-1||i.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var i=r.parentNode;i.parentNode;){if(t(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}return n})})(MP);var xY=MP.exports;const DP=oo(xY),wY=["top","right","bottom","left"],J1=["start","end"],Z1=wY.reduce((e,t)=>e.concat(t,t+"-"+J1[0],t+"-"+J1[1]),[]),ba=Math.min,Uo=Math.max,Uf=Math.round,kd=Math.floor,Ur=e=>({x:e,y:e}),vY={left:"right",right:"left",bottom:"top",top:"bottom"};function sy(e,t,n){return Uo(e,ba(t,n))}function Ia(e,t){return typeof e=="function"?e(t):e}function vi(e){return e.split("-")[0]}function Vr(e){return e.split("-")[1]}function FP(e){return e==="x"?"y":"x"}function Yx(e){return e==="y"?"height":"width"}function Hi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qx(e){return FP(Hi(e))}function $P(e,t,n){n===void 0&&(n=!1);const r=Vr(e),i=qx(e),o=Yx(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Wf(s)),[s,Wf(s)]}function bY(e){const t=Wf(e);return[Vf(e),t,Vf(t)]}function Vf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const eS=["left","right"],tS=["right","left"],SY=["top","bottom"],kY=["bottom","top"];function NY(e,t,n){switch(e){case"top":case"bottom":return n?t?tS:eS:t?eS:tS;case"left":case"right":return t?SY:kY;default:return[]}}function CY(e,t,n,r){const i=Vr(e);let o=NY(vi(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Vf)))),o}function Wf(e){const t=vi(e);return vY[t]+e.slice(t.length)}function EY(e){return{top:0,right:0,bottom:0,left:0,...e}}function zP(e){return typeof e!="number"?EY(e):{top:e,right:e,bottom:e,left:e}}function Kf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nS(e,t,n){let{reference:r,floating:i}=e;const o=Hi(t),s=qx(t),a=Yx(s),c=vi(t),u=o==="y",p=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(c){case"top":h={x:p,y:r.y-i.height};break;case"bottom":h={x:p,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Vr(t)){case"start":h[s]-=f*(n&&u?-1:1);break;case"end":h[s]+=f*(n&&u?-1:1);break}return h}async function jY(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Ia(t,e),m=zP(h),S=a[f?d==="floating"?"reference":"floating":d],g=Kf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:p,strategy:c})),v=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),N=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},j=Kf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:c}):v);return{top:(g.top-j.top+m.top)/N.y,bottom:(j.bottom-g.bottom+m.bottom)/N.y,left:(g.left-j.left+m.left)/N.x,right:(j.right-g.right+m.right)/N.x}}const PY=50,_Y=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:jY},c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:d}=nS(u,r,c),f=r,h=0;const m={};for(let b=0;b<o.length;b++){const S=o[b];if(!S)continue;const{name:g,fn:v}=S,{x:y,y:N,data:j,reset:k}=await v({x:p,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});p=y??p,d=N??d,m[g]={...m[g],...j},k&&h<PY&&(h++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:p,y:d}=nS(u,f,c)),b=-1)}return{x:p,y:d,placement:f,strategy:i,middlewareData:m}},IY=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=t,{element:u,padding:p=0}=Ia(e,t)||{};if(u==null)return{};const d=zP(p),f={x:n,y:r},h=qx(i),m=Yx(h),b=await s.getDimensions(u),S=h==="y",g=S?"top":"left",v=S?"bottom":"right",y=S?"clientHeight":"clientWidth",N=o.reference[m]+o.reference[h]-f[h]-o.floating[m],j=f[h]-o.reference[h],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let _=k?k[y]:0;(!_||!await(s.isElement==null?void 0:s.isElement(k)))&&(_=a.floating[y]||o.floating[m]);const R=N/2-j/2,M=_/2-b[m]/2-1,H=ba(d[g],M),P=ba(d[v],M),T=H,V=_-b[m]-P,L=_/2-b[m]/2+R,B=sy(T,L,V),F=!c.arrow&&Vr(i)!=null&&L!==B&&o.reference[m]/2-(L<T?H:P)-b[m]/2<0,$=F?L<T?L-T:L-V:0;return{[h]:f[h]+$,data:{[h]:B,centerOffset:L-B-$,...F&&{alignmentOffset:$}},reset:F}}});function AY(e,t,n){return(e?[...n.filter(i=>Vr(i)===e),...n.filter(i=>Vr(i)!==e)]:n.filter(i=>vi(i)===i)).filter(i=>e?Vr(i)===e||(t?Vf(i)!==i:!1):!0)}const TY=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:o,middlewareData:s,placement:a,platform:c,elements:u}=t,{crossAxis:p=!1,alignment:d,allowedPlacements:f=Z1,autoAlignment:h=!0,...m}=Ia(e,t),b=d!==void 0||f===Z1?AY(d||null,h,f):f,S=await c.detectOverflow(t,m),g=((n=s.autoPlacement)==null?void 0:n.index)||0,v=b[g];if(v==null)return{};const y=$P(v,o,await(c.isRTL==null?void 0:c.isRTL(u.floating)));if(a!==v)return{reset:{placement:b[0]}};const N=[S[vi(v)],S[y[0]],S[y[1]]],j=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:v,overflows:N}],k=b[g+1];if(k)return{data:{index:g+1,overflows:j},reset:{placement:k}};const _=j.map(H=>{const P=Vr(H.placement);return[H.placement,P&&p?H.overflows.slice(0,2).reduce((T,V)=>T+V,0):H.overflows[0],H.overflows]}).sort((H,P)=>H[1]-P[1]),M=((i=_.filter(H=>H[2].slice(0,Vr(H[0])?2:3).every(P=>P<=0))[0])==null?void 0:i[0])||_[0][0];return M!==a?{data:{index:g+1,overflows:j},reset:{placement:M}}:{}}}},RY=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...S}=Ia(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=vi(i),v=Hi(a),y=vi(a)===a,N=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=f||(y||!b?[Wf(a)]:bY(a)),k=m!=="none";!f&&k&&j.push(...CY(a,b,m,N));const _=[a,...j],R=await c.detectOverflow(t,S),M=[];let H=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&M.push(R[g]),d){const L=$P(i,s,N);M.push(R[L[0]],R[L[1]])}if(H=[...H,{placement:i,overflows:M}],!M.every(L=>L<=0)){var P,T;const L=(((P=o.flip)==null?void 0:P.index)||0)+1,B=_[L];if(B&&(!(d==="alignment"?v!==Hi(B):!1)||H.every(I=>Hi(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:L,overflows:H},reset:{placement:B}};let F=(T=H.filter($=>$.overflows[0]<=0).sort(($,I)=>$.overflows[1]-I.overflows[1])[0])==null?void 0:T.placement;if(!F)switch(h){case"bestFit":{var V;const $=(V=H.filter(I=>{if(k){const A=Hi(I.placement);return A===v||A==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(A=>A>0).reduce((A,E)=>A+E,0)]).sort((I,A)=>I[1]-A[1])[0])==null?void 0:V[0];$&&(F=$);break}case"initialPlacement":F=a;break}if(i!==F)return{reset:{placement:F}}}return{}}}},LY=new Set(["left","top"]);async function OY(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=vi(n),a=Vr(n),c=Hi(n)==="y",u=LY.has(s)?-1:1,p=o&&c?-1:1,d=Ia(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*p,y:f*u}:{x:f*u,y:h*p}}const MY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,c=await OY(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},DY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...u}=Ia(e,t),p={x:n,y:r},d=await o.detectOverflow(t,u),f=Hi(vi(i)),h=FP(f);let m=p[h],b=p[f];if(s){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+d[g],N=m-d[v];m=sy(y,m,N)}if(a){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=b+d[g],N=b-d[v];b=sy(y,b,N)}const S=c.fn({...t,[h]:m,[f]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[h]:s,[f]:a}}}}}};function Ip(){return typeof window<"u"}function Aa(e){return BP(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qr(e){var t;return(t=(BP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BP(e){return Ip()?e instanceof Node||e instanceof Rn(e).Node:!1}function gr(e){return Ip()?e instanceof Element||e instanceof Rn(e).Element:!1}function ki(e){return Ip()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function rS(e){return!Ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function iu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=yr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function FY(e){return/^(table|td|th)$/.test(Aa(e))}function Ap(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const $Y=/transform|translate|scale|rotate|perspective|filter/,zY=/paint|layout|strict|content/,_o=e=>!!e&&e!=="none";let xm;function Gx(e){const t=gr(e)?yr(e):e;return _o(t.transform)||_o(t.translate)||_o(t.scale)||_o(t.rotate)||_o(t.perspective)||!Xx()&&(_o(t.backdropFilter)||_o(t.filter))||$Y.test(t.willChange||"")||zY.test(t.contain||"")}function BY(e){let t=io(e);for(;ki(t)&&!Sa(t);){if(Gx(t))return t;if(Ap(t))return null;t=io(t)}return null}function Xx(){return xm==null&&(xm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xm}function Sa(e){return/^(html|body|#document)$/.test(Aa(e))}function yr(e){return Rn(e).getComputedStyle(e)}function Tp(e){return gr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function io(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rS(e)&&e.host||qr(e);return rS(t)?t.host:t}function HP(e){const t=io(e);return Sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:ki(t)&&iu(t)?t:HP(t)}function Dc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=HP(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Rn(i);if(o){const a=ay(s);return t.concat(s,s.visualViewport||[],iu(i)?i:[],a&&n?Dc(a):[])}else return t.concat(i,Dc(i,[],n))}function ay(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function UP(e){const t=yr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ki(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Uf(n)!==o||Uf(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Qx(e){return gr(e)?e:e.contextElement}function na(e){const t=Qx(e);if(!ki(t))return Ur(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=UP(t);let s=(o?Uf(n.width):n.width)/r,a=(o?Uf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const HY=Ur(0);function VP(e){const t=Rn(e);return!Xx()||!t.visualViewport?HY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UY(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rn(e)?!1:t}function es(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Qx(e);let s=Ur(1);t&&(r?gr(r)&&(s=na(r)):s=na(e));const a=UY(o,n,r)?VP(o):Ur(0);let c=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,p=i.width/s.x,d=i.height/s.y;if(o){const f=Rn(o),h=r&&gr(r)?Rn(r):r;let m=f,b=ay(m);for(;b&&r&&h!==m;){const S=na(b),g=b.getBoundingClientRect(),v=yr(b),y=g.left+(b.clientLeft+parseFloat(v.paddingLeft))*S.x,N=g.top+(b.clientTop+parseFloat(v.paddingTop))*S.y;c*=S.x,u*=S.y,p*=S.x,d*=S.y,c+=y,u+=N,m=Rn(b),b=ay(m)}}return Kf({width:p,height:d,x:c,y:u})}function Rp(e,t){const n=Tp(e).scrollLeft;return t?t.left+n:es(qr(e)).left+n}function WP(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Rp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function VY(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=qr(r),a=t?Ap(t.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},u=Ur(1);const p=Ur(0),d=ki(r);if((d||!d&&!o)&&((Aa(r)!=="body"||iu(s))&&(c=Tp(r)),d)){const h=es(r);u=na(r),p.x=h.x+r.clientLeft,p.y=h.y+r.clientTop}const f=s&&!d&&!o?WP(s,c):Ur(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+p.x+f.x,y:n.y*u.y-c.scrollTop*u.y+p.y+f.y}}function WY(e){return Array.from(e.getClientRects())}function KY(e){const t=qr(e),n=Tp(e),r=e.ownerDocument.body,i=Uo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Uo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Rp(e);const a=-n.scrollTop;return yr(r).direction==="rtl"&&(s+=Uo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const iS=25;function YY(e,t){const n=Rn(e),r=qr(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const p=Xx();(!p||p&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}const u=Rp(r);if(u<=0){const p=r.ownerDocument,d=p.body,f=getComputedStyle(d),h=p.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=iS&&(o-=m)}else u<=iS&&(o+=u);return{width:o,height:s,x:a,y:c}}function qY(e,t){const n=es(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ki(e)?na(e):Ur(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,c=i*o.x,u=r*o.y;return{width:s,height:a,x:c,y:u}}function oS(e,t,n){let r;if(t==="viewport")r=YY(e,n);else if(t==="document")r=KY(qr(e));else if(gr(t))r=qY(t,n);else{const i=VP(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kf(r)}function KP(e,t){const n=io(e);return n===t||!gr(n)||Sa(n)?!1:yr(n).position==="fixed"||KP(n,t)}function GY(e,t){const n=t.get(e);if(n)return n;let r=Dc(e,[],!1).filter(a=>gr(a)&&Aa(a)!=="body"),i=null;const o=yr(e).position==="fixed";let s=o?io(e):e;for(;gr(s)&&!Sa(s);){const a=yr(s),c=Gx(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||iu(s)&&!c&&KP(e,s))?r=r.filter(p=>p!==s):i=a,s=io(s)}return t.set(e,r),r}function XY(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Ap(t)?[]:GY(t,this._c):[].concat(n),r],a=oS(t,s[0],i);let c=a.top,u=a.right,p=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const h=oS(t,s[f],i);c=Uo(h.top,c),u=ba(h.right,u),p=ba(h.bottom,p),d=Uo(h.left,d)}return{width:u-d,height:p-c,x:d,y:c}}function QY(e){const{width:t,height:n}=UP(e);return{width:t,height:n}}function JY(e,t,n){const r=ki(t),i=qr(t),o=n==="fixed",s=es(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=Ur(0);function u(){c.x=Rp(i)}if(r||!r&&!o)if((Aa(t)!=="body"||iu(i))&&(a=Tp(t)),r){const h=es(t,!0,o,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else i&&u();o&&!r&&i&&u();const p=i&&!r&&!o?WP(i,a):Ur(0),d=s.left+a.scrollLeft-c.x-p.x,f=s.top+a.scrollTop-c.y-p.y;return{x:d,y:f,width:s.width,height:s.height}}function wm(e){return yr(e).position==="static"}function sS(e,t){if(!ki(e)||yr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qr(e)===n&&(n=n.ownerDocument.body),n}function YP(e,t){const n=Rn(e);if(Ap(e))return n;if(!ki(e)){let i=io(e);for(;i&&!Sa(i);){if(gr(i)&&!wm(i))return i;i=io(i)}return n}let r=sS(e,t);for(;r&&FY(r)&&wm(r);)r=sS(r,t);return r&&Sa(r)&&wm(r)&&!Gx(r)?n:r||BY(e)||n}const ZY=async function(e){const t=this.getOffsetParent||YP,n=this.getDimensions,r=await n(e.floating);return{reference:JY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eq(e){return yr(e).direction==="rtl"}const tq={convertOffsetParentRelativeRectToViewportRelativeRect:VY,getDocumentElement:qr,getClippingRect:XY,getOffsetParent:YP,getElementRects:ZY,getClientRects:WY,getDimensions:QY,getScale:na,isElement:gr,isRTL:eq};function qP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nq(e,t){let n=null,r;const i=qr(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const u=e.getBoundingClientRect(),{left:p,top:d,width:f,height:h}=u;if(a||t(),!f||!h)return;const m=kd(d),b=kd(i.clientWidth-(p+f)),S=kd(i.clientHeight-(d+h)),g=kd(p),y={rootMargin:-m+"px "+-b+"px "+-S+"px "+-g+"px",threshold:Uo(0,ba(1,c))||1};let N=!0;function j(k){const _=k[0].intersectionRatio;if(_!==c){if(!N)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!qP(u,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(j,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,y)}n.observe(e)}return s(!0),o}function aS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Qx(e),p=i||o?[...u?Dc(u):[],...t?Dc(t):[]]:[];p.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const d=u&&a?nq(u,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),u&&!c&&h.observe(u),t&&h.observe(t));let m,b=c?es(e):null;c&&S();function S(){const g=es(e);b&&!qP(b,g)&&n(),b=g,m=requestAnimationFrame(S)}return n(),()=>{var g;p.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const rq=MY,iq=TY,oq=DY,sq=RY,lS=IY,aq=(e,t,n)=>{const r=new Map,i={platform:tq,...n},o={...i.platform,_c:r};return _Y(e,t,{...i,platform:o})};var lq=typeof document<"u",cq=function(){},qd=lq?w.useLayoutEffect:cq;function Yf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Yf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function GP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cS(e,t){const n=GP(e);return Math.round(t*n)/n}function vm(e){const t=w.useRef(e);return qd(()=>{t.current=e}),t}function uS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[p,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=w.useState(r);Yf(f,r)||h(r);const[m,b]=w.useState(null),[S,g]=w.useState(null),v=w.useCallback(I=>{I!==k.current&&(k.current=I,b(I))},[]),y=w.useCallback(I=>{I!==_.current&&(_.current=I,g(I))},[]),N=o||m,j=s||S,k=w.useRef(null),_=w.useRef(null),R=w.useRef(p),M=c!=null,H=vm(c),P=vm(i),T=vm(u),V=w.useCallback(()=>{if(!k.current||!_.current)return;const I={placement:t,strategy:n,middleware:f};P.current&&(I.platform=P.current),aq(k.current,_.current,I).then(A=>{const E={...A,isPositioned:T.current!==!1};L.current&&!Yf(R.current,E)&&(R.current=E,ui.flushSync(()=>{d(E)}))})},[f,t,n,P,T]);qd(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const L=w.useRef(!1);qd(()=>(L.current=!0,()=>{L.current=!1}),[]),qd(()=>{if(N&&(k.current=N),j&&(_.current=j),N&&j){if(H.current)return H.current(N,j,V);V()}},[N,j,V,H,M]);const B=w.useMemo(()=>({reference:k,floating:_,setReference:v,setFloating:y}),[v,y]),F=w.useMemo(()=>({reference:N,floating:j}),[N,j]),$=w.useMemo(()=>{const I={position:n,left:0,top:0};if(!F.floating)return I;const A=cS(F.floating,p.x),E=cS(F.floating,p.y);return a?{...I,transform:"translate("+A+"px, "+E+"px)",...GP(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:E}},[n,a,F.floating,p.x,p.y]);return w.useMemo(()=>({...p,update:V,refs:B,elements:F,floatingStyles:$}),[p,V,B,F,$])}const uq=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lS({element:r.current,padding:i}).fn(n):{}:r?lS({element:r,padding:i}).fn(n):{}}}},dS=(e,t)=>{const n=rq(e);return{name:n.name,fn:n.fn,options:[e,t]}},dq=(e,t)=>{const n=oq(e);return{name:n.name,fn:n.fn,options:[e,t]}},fq=(e,t)=>{const n=sq(e);return{name:n.name,fn:n.fn,options:[e,t]}},pq=(e,t)=>{const n=iq(e);return{name:n.name,fn:n.fn,options:[e,t]}},hq=(e,t)=>{const n=uq(e);return{name:n.name,fn:n.fn,options:[e,t]}},mq={arrowBase:32,arrowColor:"#ffffff",arrowSize:16,arrowSpacing:12,backgroundColor:"#ffffff",beaconSize:36,beaconTrigger:"click",beforeTimeout:5e3,blockTargetInteraction:!1,buttons:["back","close","primary"],closeButtonAction:"close",disableFocusTrap:!1,dismissKeyAction:"close",hideOverlay:!1,loaderDelay:300,offset:10,overlayClickAction:"close",overlayColor:"#00000080",primaryColor:"#000000",scrollDuration:300,scrollOffset:20,showProgress:!1,skipBeacon:!1,skipScroll:!1,spotlightPadding:10,spotlightRadius:4,targetWaitTimeout:1e3,textColor:"#000000",width:380,zIndex:100},gq={beaconOptions:{offset:-18}},XP={back:"Back",close:"Close",last:"Last",next:"Next",nextWithProgress:"Next ({current} of {total})",open:"Open the dialog",skip:"Skip"},yq={isFixed:!1,locale:XP,placement:"bottom"},xq={continuous:!1,debug:!1,run:!1,scrollToFirstStep:!1,steps:[]},Fe={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update",COMPLETE:"complete"},Mt={TOUR_START:"tour:start",STEP_BEFORE_HOOK:"step:before_hook",STEP_BEFORE:"step:before",SCROLL_START:"scroll:start",SCROLL_END:"scroll:end",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",STEP_AFTER_HOOK:"step:after_hook",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found",ERROR:"error"},fe={INIT:"init",READY:"ready",BEACON_BEFORE:"beacon_before",BEACON:"beacon",TOOLTIP_BEFORE:"tooltip_before",TOOLTIP:"tooltip",COMPLETE:"complete"},Lr={BUTTON_BACK:"button_back",BUTTON_CLOSE:"button_close",BUTTON_PRIMARY:"button_primary",BUTTON_SKIP:"button_skip",KEYBOARD:"keyboard",OVERLAY:"overlay"},Oe={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"},wq="react-joyride-portal";function vq(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function Ws(...e){return uY({all:!0,isMergeableObject:t=>!(!Jt.plainObject(t)||w.isValidElement(t))})(...e)}function QP(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function ai(e,t={}){const{defaultValue:n,step:r,steps:i}=t;let o=ym(e);if(o)(o.includes("{current}")||o.includes("{total}"))&&r&&i&&(o=o.replace("{current}",r.toString()).replace("{total}",i.toString()));else if(w.isValidElement(e)&&!Object.values(e.props).length&&QP(e.type)==="function")try{o=ai(e.type({}),t)}catch{o=ym(n)}else o=ym(n);return o}function Ft(e,t,n,...r){if(!e)return;const i=new Date,o=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}.${String(i.getMilliseconds()).padStart(3,"0")}`;console.log(`${t} %c${n}%c ${o}`,"font-weight: bold","color: gray; font-weight: normal",...r)}function bq(e,t){const n=vq(t);return{...e,...n}}function Fc(){}function Sq(e){return Object.keys(e)}function qf(e,...t){if(!Jt.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function fS(e,...t){if(!Jt.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function ly(e,t,n){const r=o=>o.replace("{current}",String(t)).replace("{total}",String(n));if(QP(e)==="string")return r(e);if(!w.isValidElement(e))return e;const{children:i}=e.props;if(Jt.string(i)&&i.includes("{current}"))return w.cloneElement(e,{children:r(i)});if(Array.isArray(i))return w.cloneElement(e,{children:i.map(o=>typeof o=="string"?r(o):ly(o,t,n))});if(Jt.function(e.type)&&!Object.values(e.props).length)try{return ly(e.type({}),t,n)}catch{return e}return e}function pS(e){return Sq(e).sort().reduce((t,n)=>(t[n]=e[n],t),{})}function Jx(){var e;return!!(typeof window<"u"&&((e=window.document)!=null&&e.createElement))}function hS(e){let t=0,n=0,r=e;for(;r;)t+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{left:n,top:t}}function Zx(e){return e?e.getBoundingClientRect():null}function kq(e=!1){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((o,s)=>o-s),i=Math.floor(r.length/2);return r.length%2===0?(r[i-1]+r[i])/2:r[i]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function qn(e){if(!e)return null;if(typeof e=="function")try{return e()}catch{return null}if(typeof e=="object"&&"current"in e)return e.current;if(typeof e=="string")try{return document.querySelector(e)}catch{return null}return e}function Nq(e,t,n){const r=Zx(e),i=Ta(e),o=i?!i.isSameNode(xn()):!1,s=n??Ra(e);let a=0,c=(r==null?void 0:r.top)??0;return o&&s?c=(r==null?void 0:r.top)??0:i instanceof HTMLElement&&(a=i.scrollTop,!o&&!s&&(c+=a),i.isSameNode(xn())||(c+=xn().scrollTop)),Math.floor(c-t)}function Ta(e,t){if(!e)return xn();const n=DP(e);if(n){if(n.isSameNode(xn()))return t?document:xn();if(!(n.scrollHeight>n.offsetHeight))return xn()}return n}function Cq(e){const t=e.getBoundingClientRect(),n=xn(),r=t.top+t.height/2,i=window.innerHeight/2;return Math.max(0,n.scrollTop+r-i)}function Eq(e,t){if(!e)return 0;const n=DP(e)??xn(),r=parseFloat(getComputedStyle(e).scrollMarginTop)||0,i=Zx(n),o=n.scrollTop??0,{offsetTop:s=0,scrollTop:a=0}=n;let c=e.getBoundingClientRect().top+a;if(s&&(JP(e)||jq(e))){const p=e.getBoundingClientRect(),d=p.top-((i==null?void 0:i.top)??0),f=d+p.height,h=n.clientHeight,m=h*.2;d>=m&&f<=h-m?c=o:c=d+o}const u=Math.floor(c-t-r);return u<0?0:u}function jq(e){return e.offsetParent!==document.body}function JP(e){if(!e)return!1;const t=Ta(e);return t?!t.isSameNode(xn()):!1}function Ra(e,t="fixed"){if(!e||!(e instanceof Element))return!1;const{nodeName:n}=e;return n==="BODY"||n==="HTML"?!1:getComputedStyle(e).position===t?!0:e.parentNode?Ra(e.parentNode,t):!1}function Nd(e){if(!e)return!1;let t=e;for(;t&&t!==document.body;){if(t instanceof HTMLElement){const{display:n,visibility:r}=getComputedStyle(t);if(n==="none"||r==="hidden")return!1}t=t.parentElement??null}return!0}function mS(e){const{isFirstStep:t,scrollToFirstStep:n,step:r,target:i,targetLifecycle:o}=e;if(r.skipScroll||t&&!n&&o!==fe.TOOLTIP||r.placement==="center")return!1;const s=i!=null&&i.isConnected?Ta(i):xn(),a=s?!s.isSameNode(xn()):!1;return(r.isFixed||Ra(i))&&!a?!1:s.scrollHeight>s.clientHeight}function xn(){return document.scrollingElement??document.documentElement}function gS(e,t){const{duration:n,element:r}=t;let i=()=>{};const o=new Promise(s=>{const{scrollTop:a}=r,c=e>a?e-a:a-e;i=yY.top(r,e,{duration:c<100?50:n},()=>{s()})});return{cancel:i,promise:o}}function Pq(e){const t=e.replace(/^#?([\da-f])([\da-f])([\da-f])$/i,(r,i,o,s)=>i+i+o+o+s+s),n=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})/i.exec(t);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:[]}const ZP={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555555",cursor:"pointer",fontSize:16,lineHeight:1,padding:0,WebkitAppearance:"none"},Cd={...ZP,borderRadius:4,padding:8};function _q(e,t){const{styles:n}=e,r=Ws(n??{},t.styles??{});let{width:i}=t;Jx()&&(i=typeof i=="number"&&window.innerWidth<i?window.innerWidth-30:i);const o={bottom:0,left:0,overflow:"hidden",position:"absolute",right:0,top:0,zIndex:t.zIndex};return Ws({arrow:{alignItems:"center",color:t.arrowColor,display:"inline-flex",justifyContent:"center",position:"absolute"},beaconWrapper:{...ZP,display:"inline-flex",borderRadius:"50%",position:"relative"},beacon:{height:t.beaconSize,width:t.beaconSize},beaconInner:{animation:"joyride-beacon-inner 1.2s infinite ease-in-out",backgroundColor:t.primaryColor,borderRadius:"50%",display:"block",height:"50%",left:"50%",opacity:.7,position:"absolute",top:"50%",transform:"translate(-50%, -50%)",width:"50%"},beaconOuter:{animation:"joyride-beacon-outer 1.2s infinite ease-in-out",backgroundColor:`rgba(${Pq(t.primaryColor).join(",")}, 0.2)`,border:`2px solid ${t.primaryColor}`,borderRadius:"50%",boxSizing:"border-box",display:"block",height:"100%",left:0,opacity:.9,position:"absolute",top:0,transformOrigin:"center",width:"100%"},buttonBack:{...Cd,color:t.primaryColor,marginLeft:"auto",marginRight:5},buttonClose:{...Cd,color:t.textColor,height:12,padding:8,position:"absolute",right:0,top:0,width:12},buttonPrimary:{...Cd,backgroundColor:t.primaryColor,color:t.backgroundColor},buttonSkip:{...Cd,color:t.textColor,fontSize:14},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:"100%",transition:"opacity 0.3s"},loader:{alignItems:"center",display:"flex",height:48,inset:0,justifyContent:"center",pointerEvents:"none",position:"fixed",width:48,zIndex:t.zIndex+1},overlay:{...o,backgroundColor:t.overlayColor},spotlight:{},tooltip:{backgroundColor:t.backgroundColor,borderRadius:5,boxSizing:"border-box",color:t.textColor,fontSize:16,maxWidth:"100%",padding:12,position:"relative",width:i},tooltipContainer:{lineHeight:1.4,textAlign:"center"},tooltipTitle:{fontSize:18,margin:0},tooltipContent:{paddingBottom:12,paddingTop:12},tooltipFooter:{alignItems:"center",display:"flex",justifyContent:"flex-end"},tooltipFooterSpacer:{flex:1}},r)}const Iq=["after","arrowBase","arrowColor","arrowSize","arrowSpacing","backgroundColor","beaconSize","beaconTrigger","before","beforeTimeout","buttons","closeButtonAction","skipBeacon","dismissKeyAction","disableFocusTrap","hideOverlay","skipScroll","blockTargetInteraction","loaderDelay","offset","overlayClickAction","overlayColor","primaryColor","scrollDuration","scrollOffset","showProgress","spotlightPadding","spotlightRadius","targetWaitTimeout","textColor","width","zIndex"];function ew(e,t){if(!t)return null;const n=Ws(yq,fS(e,"arrowComponent","beaconComponent","floatingOptions","loaderComponent","locale","styles","tooltipComponent"),t),r=Ws(mq,e.options??{},fS(t,...Iq)),i=_q(e,{...n,...r}),o=Ws(gq,e.floatingOptions??{},n.floatingOptions??{});return{...n,...r,locale:Ws(XP,e.locale??{},n.locale||{}),floatingOptions:o,spotlightPadding:Aq(r.spotlightPadding),styles:i}}function Aq(e){return typeof e=="number"?{top:e,right:e,bottom:e,left:e}:{top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0,left:(e==null?void 0:e.left)??0}}function Tq(e,t,n){const{action:r}=t,i=n&&[Fe.PREV,Fe.NEXT].includes(r);return e.skipBeacon||e.placement==="center"||i}function e_(e,t=!1){return Jt.plainObject(e)?e.target?!0:(Ft(t,"tour","target is missing from the step"),!1):(Ft(t,"tour","step must be an object"),!1)}function t_(e,t=!1){return Jt.array(e)?e.every(n=>e_(n,t)):(Ft(t,"tour","steps must be an array"),!1)}var Rq=class{constructor(e){wt(this,"beaconPosition",null);wt(this,"debug");wt(this,"eventListeners",new Map);wt(this,"listeners",new Set);wt(this,"props");wt(this,"snapshot");wt(this,"state");wt(this,"steps");wt(this,"tooltipPosition",null);wt(this,"cleanupPositionData",()=>{this.beaconPosition=null,this.tooltipPosition=null});wt(this,"getPositionData",e=>e==="beacon"?this.beaconPosition:this.tooltipPosition);wt(this,"getServerSnapshot",()=>this.snapshot);wt(this,"getSnapshot",()=>this.snapshot);wt(this,"getEventState",()=>qf(this.snapshot,"positioned"));wt(this,"getState",()=>qf(this.snapshot,"positioned"));wt(this,"setPositionData",(e,t)=>{var r,i,o;((r=e==="beacon"?this.beaconPosition:this.tooltipPosition)==null?void 0:r.placement)!==t.placement&&Ft(this.debug,`step:${this.state.index}`,"positioned",`${e} ${t.placement}`),e==="beacon"?this.beaconPosition=t:this.tooltipPosition=t,(this.state.lifecycle===fe.BEACON_BEFORE||this.state.lifecycle===fe.TOOLTIP_BEFORE)&&!this.state.positioned&&this.updateState({positioned:!0});const n=(o=(i=this.getStep())==null?void 0:i.floatingOptions)==null?void 0:o.onPosition;n&&n(t)});wt(this,"setSteps",e=>{this.steps=e,this.updateState({size:e.length})});wt(this,"dispatch",(e,t)=>{const n=this.eventListeners.get(e.type);if(n)for(const r of n)try{r(e,t)}catch{}});wt(this,"on",(e,t)=>{let n=this.eventListeners.get(e);return n||(n=new Set,this.eventListeners.set(e,n)),n.add(t),()=>{n.delete(t)}});wt(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));wt(this,"updateState",(e,t=!1)=>{const{controlled:n,index:r}=this.state,i=this.snapshot,o=n&&!t&&e.index!==void 0?r:e.index??r,s={action:e.action??this.state.action,controlled:n,index:o,lifecycle:e.lifecycle??this.state.lifecycle,origin:e.origin??null,positioned:e.positioned??this.state.positioned,scrolling:e.scrolling??this.state.scrolling,size:e.size??this.state.size,status:e.status??this.state.status,waiting:e.waiting??this.state.waiting},a=this.applyTransitions(s);if(this.state=a,!Ux(i,a)){this.snapshot=Object.freeze({...a});for(const c of this.listeners)c(this.snapshot)}});const{initialStepIndex:t,stepIndex:n,steps:r=[]}=e??{},i=Jt.number(n);let o=0;this.debug=(e==null?void 0:e.debug)??!1,i?(o=n,Jt.number(t)&&Ft(this.debug,"tour","initialStepIndex is ignored in controlled mode")):Jt.number(t)&&(t>=0&&t<r.length?o=t:r.length>0&&Ft(this.debug,"tour","initialStepIndex is out of bounds")),this.props=e??{steps:[]},this.steps=r,this.state={action:Fe.INIT,controlled:i,index:o,lifecycle:fe.INIT,origin:null,positioned:!1,scrolling:!1,size:r.length,status:r.length?Oe.READY:Oe.IDLE,waiting:!1},this.snapshot=Object.freeze({...this.state})}applyTransitions(e){return e.status===Oe.WAITING&&e.size>0?{...e,status:Oe.RUNNING}:e}getStep(e){return ew(this.props,this.steps[e??this.state.index])}};function Lq(e){return new Rq(e)}function yS(e,t){return Math.min(Math.max(e,0),t)}function Oq(e,t,n){const r=w.useRef(t),i=w.useRef(n);return r.current=t,i.current=n,w.useMemo(()=>{const o=()=>e.current.getSnapshot();return{close:(S=null)=>{const{index:g,status:v}=o();v===Oe.RUNNING&&e.current.updateState({action:Fe.CLOSE,index:g+1,origin:S,lifecycle:fe.COMPLETE,positioned:!1,scrolling:!1,waiting:!1})},go:S=>{const{controlled:g,size:v,status:y}=o();if(g){Ft(r.current,"tour","go() is not supported in controlled mode");return}y===Oe.RUNNING&&e.current.updateState({action:Fe.GO,index:S,lifecycle:fe.COMPLETE,positioned:!1,scrolling:!1,status:S<v?y:Oe.FINISHED,waiting:!1})},info:()=>qf(e.current.getSnapshot(),"positioned"),next:S=>{const{index:g,size:v,status:y}=o();y===Oe.RUNNING&&e.current.updateState({action:Fe.NEXT,index:yS(g+1,v),lifecycle:fe.COMPLETE,origin:S,positioned:!1,scrolling:!1,waiting:!1})},open:()=>{const{status:S}=o();S===Oe.RUNNING&&e.current.updateState({action:Fe.UPDATE,lifecycle:fe.TOOLTIP_BEFORE,positioned:!1,scrolling:!1,waiting:!1})},prev:S=>{const{index:g,size:v,status:y}=o();y===Oe.RUNNING&&e.current.updateState({action:Fe.PREV,index:yS(g-1,v),lifecycle:fe.COMPLETE,origin:S,positioned:!1,scrolling:!1,waiting:!1})},reset:(S=!1)=>{const{controlled:g}=o();if(g){Ft(r.current,"tour","reset() is not supported in controlled mode");return}i.current(),e.current.updateState({action:Fe.RESET,index:0,lifecycle:fe.INIT,positioned:!1,scrolling:!1,status:S?Oe.RUNNING:Oe.READY,waiting:!1})},skip:S=>{const{status:g}=o();g===Oe.RUNNING&&e.current.updateState({action:Fe.SKIP,lifecycle:fe.COMPLETE,origin:S,positioned:!1,scrolling:!1,status:Oe.SKIPPED,waiting:!1})},start:S=>{const{index:g,size:v}=o();i.current(),e.current.updateState({action:Fe.START,index:Jt.number(S)?S:g,lifecycle:fe.INIT,positioned:!1,scrolling:!1,status:v?Oe.RUNNING:Oe.WAITING,waiting:!1},!0)},stop:(S=!1)=>{const{index:g,status:v}=o();[Oe.FINISHED,Oe.SKIPPED].includes(v)||e.current.updateState({action:Fe.STOP,index:g+(S?1:0),lifecycle:fe.COMPLETE,positioned:!1,scrolling:!1,status:Oe.PAUSED,waiting:!1})}}},[e])}const Mq=new Set(["origin","positioned"]);function Dq(e,t){const n=w.useRef(null);w.useEffect(()=>{if(!t)return;const r=e.current.getSnapshot();return Ft(!0,"tour","init",r),n.current=r,e.current.subscribe(i=>{const o=n.current;if(n.current=i,!o)return;const s={};let a=!1;for(const c of Object.keys(i))i[c]!==o[c]&&!Mq.has(c)&&(s[c]={from:o[c],to:i[c]},(c==="status"||c==="size")&&(a=!0));Object.keys(s).length&&(!a&&i.index>=i.size||Ft(!0,a?"tour":`step:${i.index}`,"state",s))})},[t,e])}function Fq(e,t,n){const r=w.useRef(e),i=w.useRef(t);return r.current=e,i.current=t,w.useCallback((o,s,a)=>{var u;const c={...n.current.getEventState(),error:null,scroll:null,step:s,type:o,...a};(u=r.current)==null||u.call(r,c,i.current),n.current.dispatch(c,i.current)},[n])}function Oi(e,t){return{hasChanged(n){return e[n]!==t[n]},hasChangedTo(n,r){const i=e[n],o=t[n];return Array.isArray(r)?r.includes(i)&&!r.includes(o):i===r&&o!==r},previous:t}}function $q(e){const{addFailure:t,controls:n,emitEvent:r,previousState:i,props:o,state:s,step:a,store:c}=e,{action:u,index:p,lifecycle:d,positioned:f,scrolling:h,size:m,status:b}=s,S=_P(a)??null,g=w.useRef(null),v=w.useRef(o),y=w.useRef(s),N=w.useRef(i),j=w.useRef(a),k=w.useRef(S),_=w.useRef(n),R=w.useRef(null),M=w.useRef(null),H=w.useRef(null);v.current=o,y.current=s,N.current=i,j.current=a,k.current=S,_.current=n;const P=()=>{R.current&&(clearInterval(R.current),R.current=null),M.current=null,H.current&&(H.current.cancel(),H.current=null)};w.useEffect(()=>{if(!N.current)return;const{hasChangedTo:T}=Oi(y.current,N.current);(T("action",[Fe.NEXT,Fe.PREV,Fe.SKIP,Fe.CLOSE])||g.current===Fe.CLOSE&&u===Fe.START)&&(g.current=u)},[u]),w.useEffect(()=>{if(!N.current)return()=>{P()};const{hasChanged:T}=Oi(y.current,N.current),V=j.current;if(T("index")&&P(),b!==Oe.RUNNING||!V||d!==fe.INIT)return()=>{P()};const{hasChangedTo:L}=Oi(y.current,N.current);L("status",Oe.RUNNING)&&[Oe.IDLE,Oe.READY,Oe.PAUSED].includes(N.current.status)&&r(Mt.TOUR_START,V),c.current.cleanupPositionData();const{debug:B}=v.current;if(V.before&&!H.current){Ft(B,`step:${p}`,"before()",V),H.current={cancel:()=>{}},c.current.updateState({waiting:!0}),r(Mt.STEP_BEFORE_HOOK,V,{action:g.current??y.current.action});const F=()=>{H.current=null,c.current.updateState({action:g.current??y.current.action,waiting:!1,lifecycle:fe.READY})},$=new AbortController,I=V.beforeTimeout;H.current={cancel:()=>$.abort()};const A=I?setTimeout(()=>{$.signal.aborted||(Ft(B,`step:${p}`,"before()","timed out",`${I}ms`),$.abort(),t(V,"before_hook"),r(Mt.ERROR,V,{error:new Error("Step before hook timed out")}),F())},I):null;V.before({...c.current.getState(),action:g.current??c.current.getState().action,step:V}).then(()=>{$.signal.aborted||(A&&clearTimeout(A),F())}).catch(E=>{$.signal.aborted||(A&&clearTimeout(A),t(V,"before_hook"),r(Mt.ERROR,V,{error:E instanceof Error?E:new Error(String(E))}),F())})}else if(!H.current){R.current&&M.current!==V.target&&P();const F=qn(V.target);if(F&&Nd(F))P(),c.current.updateState({action:g.current??Fe.UPDATE,lifecycle:fe.READY,waiting:!1});else if(V.targetWaitTimeout===0)c.current.updateState({action:g.current??Fe.UPDATE,lifecycle:fe.READY,waiting:!1});else if(!R.current){const{targetWaitTimeout:$}=V,I=Date.now();M.current=V.target,Ft(B,`step:${p}`,"polling","started",`${$}ms`),c.current.updateState({waiting:!0}),R.current=setInterval(()=>{const A=qn(V.target),E=Date.now()-I,z=E>=$;(A&&Nd(A)||z)&&(Ft(B,`step:${p}`,"polling",A&&Nd(A)?"found":"timed out",`${E}ms`),P(),c.current.updateState({action:g.current??Fe.UPDATE,lifecycle:fe.READY,waiting:!1}))},100)}}return()=>{P()}},[t,r,p,d,b,c]),w.useEffect(()=>{if(!N.current)return;const{hasChanged:T,hasChangedTo:V,previous:L}=Oi(y.current,N.current),B=j.current;if(!B)return;const F=qn(B.target),$=!!F;if($&&Nd(F)){if(V("lifecycle",fe.READY)&&L.lifecycle===fe.INIT&&r(Mt.STEP_BEFORE,B,{action:g.current??y.current.action}),V("lifecycle",fe.READY)){const I=y.current,A=Tq(B,I,v.current.continuous)?fe.TOOLTIP:fe.BEACON,E=qn(B.scrollTarget??B.spotlightTarget??B.target),z=mS({isFirstStep:I.index===0,scrollToFirstStep:v.current.scrollToFirstStep,step:B,target:E,targetLifecycle:A}),U=A===fe.TOOLTIP?fe.TOOLTIP_BEFORE:fe.BEACON_BEFORE;Ft(v.current.debug,`step:${p}`,"scroll",z?"needed":"skipped"),c.current.updateState({action:Fe.UPDATE,lifecycle:U,scrolling:z})}}else if(y.current.status===Oe.RUNNING&&d!==fe.INIT&&d!==fe.COMPLETE&&T("lifecycle")){Ft(v.current.debug,`step:${p}`,$?"Target not visible":"Target not mounted",B),t(B,"target_not_found"),r(Mt.TARGET_NOT_FOUND,B);const I=y.current;I.controlled||c.current.updateState({action:Fe.UPDATE,index:I.index+(I.action===Fe.PREV?-1:1),lifecycle:fe.INIT})}},[t,r,p,d,c]),w.useEffect(()=>{if(!N.current)return;const{hasChangedTo:T,previous:V}=Oi(y.current,N.current),L=j.current,B=k.current;if(L&&T("lifecycle",fe.TOOLTIP_BEFORE)&&V.lifecycle===fe.BEACON){const I=qn(L.scrollTarget??L.spotlightTarget??L.target);if(mS({isFirstStep:y.current.index===0,scrollToFirstStep:v.current.scrollToFirstStep,step:L,target:I,targetLifecycle:fe.TOOLTIP})){c.current.updateState({scrolling:!0,positioned:!1});return}}const F=d===fe.BEACON_BEFORE||d===fe.TOOLTIP_BEFORE;if(L&&F&&!h){const I=d===fe.TOOLTIP_BEFORE?fe.TOOLTIP:fe.BEACON;c.current.updateState({action:Fe.UPDATE,lifecycle:I})}L&&T("lifecycle",fe.BEACON)&&r(Mt.BEACON,L),L&&T("lifecycle",fe.TOOLTIP)&&r(Mt.TOOLTIP,L);const $=y.current;if(($.status===Oe.RUNNING||$.controlled&&$.status===Oe.PAUSED&&L)&&B&&T("lifecycle",fe.COMPLETE)&&V.lifecycle===fe.TOOLTIP&&(r(Mt.STEP_AFTER,B,{action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle}),B.after)){r(Mt.STEP_AFTER_HOOK,B,{action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle});try{B.after({...c.current.getState(),action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle,step:B})}catch{}}},[r,d,f,h,c]),w.useEffect(()=>{if(!N.current)return;const{hasChangedTo:T,previous:V}=Oi(y.current,N.current),L=j.current,B=k.current;m&&!L&&d===fe.INIT&&c.current.updateState({action:Fe.UPDATE,lifecycle:fe.COMPLETE,status:Oe.FINISHED}),!y.current.controlled&&b===Oe.RUNNING&&T("lifecycle",fe.COMPLETE)&&p<m&&c.current.updateState({action:Fe.UPDATE,lifecycle:fe.INIT}),T("lifecycle",fe.COMPLETE)&&p>=m&&c.current.updateState({action:Fe.UPDATE,lifecycle:fe.COMPLETE,status:Oe.FINISHED});const F=L??B??ew(v.current,v.current.steps[p-1]);if(F&&T("status",[Oe.FINISHED,Oe.SKIPPED])){let $;L?$=p:B?$=V.index??p:$=p-1,r(Mt.TOUR_END,F,{index:$}),y.current.controlled||_.current.reset(),g.current=null}L&&T("action",Fe.STOP)&&(g.current=null,r(Mt.TOUR_STATUS,L)),L&&T("action",Fe.RESET)&&(r(Mt.TOUR_STATUS,L),g.current=null)},[u,r,p,d,m,b,c])}function zq({controls:e,emitEvent:t,props:n,state:r,store:i}){const{debug:o,initialStepIndex:s,run:a,stepIndex:c,steps:u}=n,p=w.useRef(void 0),d=w.useRef(r),f=w.useRef(e);d.current=r,f.current=e,w.useEffect(()=>{const h=p.current;if(p.current=n,!h||n===h)return;const{hasChanged:m}=Oi(n,h);if(Ux(h.steps,u)||(t_(u,o)?i.current.setSteps(u):(Ft(o,"tour","Steps are not valid",u),t(Mt.ERROR,u[0]??{target:"",content:""},{error:new Error("Steps are not valid")}))),m("run"))a?i.current.getState().size&&f.current.start(c??s):f.current.stop();else if(Jt.number(c)&&m("stepIndex")){const b=Jt.number(h.stepIndex)&&h.stepIndex<c?Fe.NEXT:Fe.PREV;[Oe.FINISHED,Oe.SKIPPED].includes(d.current.status)||i.current.updateState({action:b,index:c,lifecycle:fe.INIT,positioned:!1},!0)}},[o,t,s,n,a,c,u,i])}function Bq(e,t){var a,c,u,p;const{beaconPosition:n,lifecycle:r,scrollOffset:i,step:o}=t;if(o.scrollTarget||o.spotlightTarget)return Math.max(0,e);let s=e-o.spotlightPadding.top;if(r===fe.BEACON_BEFORE&&(n!=null&&n.placement)){const d=Hq(n);["bottom"].includes(n.placement)||(s+=Math.floor(d-i))}else if(r===fe.TOOLTIP_BEFORE){const{placement:d}=o;if(d==="top"){const f=((a=document.querySelector(".react-joyride__floater"))==null?void 0:a.getBoundingClientRect().height)??0,h=(c=o.floatingOptions)!=null&&c.hideArrow?0:o.arrowSize,m=o.offset+o.spotlightPadding.top+h;s-=f+m}else if(d==="left"||d==="right"){const f=((u=document.querySelector(".react-joyride__floater"))==null?void 0:u.getBoundingClientRect().height)??0,h=((p=qn(o.target))==null?void 0:p.getBoundingClientRect().height)??0,m=i+o.spotlightPadding.top+h/2-f/2;m<i&&(s-=i-m)}}return Math.max(0,s)}function Hq(e){var n;const t=(n=e.middlewareData)==null?void 0:n.offset;return t?["left","right"].some(r=>e.placement.startsWith(r))?t.x:t.y:0}function Uq({emitEvent:e,previousState:t,props:n,state:r,step:i,store:o}){const{index:s,lifecycle:a,positioned:c,scrolling:u,status:p}=r,d=w.useRef(null),f=w.useRef(r),h=w.useRef(t),m=w.useRef(n),b=w.useRef(i);f.current=r,h.current=t,m.current=n,b.current=i,w.useEffect(()=>()=>{var S;(S=d.current)==null||S.call(d)},[]),w.useEffect(()=>{var j;if(!h.current||!b.current)return;const{hasChangedTo:S}=Oi(f.current,h.current),g=b.current,{debug:v}=m.current,{scrollDuration:y}=g,N=a===fe.BEACON_BEFORE||a===fe.TOOLTIP_BEFORE;if(p===Oe.RUNNING&&N&&u&&S("positioned",!0)){const k=qn(g.scrollTarget??g.spotlightTarget??g.target),_=o.current.getPositionData("beacon"),R=Ta(k),M=R?!R.isSameNode(xn()):!1;(j=d.current)==null||j.call(d),(async()=>{if(M&&!Ra(R)){const $=xn(),I=Cq(R),A={initial:$.scrollTop,target:I,element:$,duration:y};e(Mt.SCROLL_START,g,{scroll:A});const{cancel:E,promise:z}=gS(I,{element:$,duration:y});d.current=E,await z,e(Mt.SCROLL_END,g,{scroll:A})}const P=Math.floor(Eq(k,g.scrollOffset))||0,T=M?P:Bq(P,{beaconPosition:_,lifecycle:a,scrollOffset:g.scrollOffset,step:g});Ft(v,`step:${s}`,"scroll",M?"custom":"document",`${P} → ${T}`);const V=R,L={initial:V.scrollTop,target:T,element:V,duration:y};e(Mt.SCROLL_START,g,{scroll:L});const{cancel:B,promise:F}=gS(T,{element:V,duration:y});d.current=B,await F,e(Mt.SCROLL_END,g,{scroll:L}),o.current.updateState({scrolling:!1})})().catch(()=>{o.current.updateState({scrolling:!1})})}},[e,s,a,c,u,p,o])}function Vq(e){const t=EK(()=>bq(xq,e),[e]),{debug:n,initialStepIndex:r,onEvent:i,run:o,stepIndex:s,steps:a}=t,c=w.useRef(Lq(t)),u=nE.useSyncExternalStore(c.current.subscribe,c.current.getSnapshot,c.current.getServerSnapshot),[p,d]=w.useState([]),f=w.useCallback((j,k)=>{d(_=>[..._,{reason:k,step:j}])},[]),h=w.useCallback(()=>{d([])},[]);Dq(c,n);const m=Oq(c,n,h),b=Fq(i,m,c),{index:S,size:g,status:v}=u,y=_P(u),N=w.useMemo(()=>ew(t,a[S]),[S,t,a]);return jK(()=>{o&&g&&t_(a,n)&&m.start(s??r)}),CK(()=>{o&&g&&v===Oe.IDLE&&c.current.updateState({status:Oe.READY})},[o,g,v]),zq({controls:m,emitEvent:b,props:t,state:u,store:c}),$q({addFailure:f,controls:m,emitEvent:b,previousState:y,props:t,state:u,step:N,store:c}),Uq({emitEvent:b,previousState:y,props:t,state:u,step:N,store:c}),{controls:m,failures:p,mergedProps:t,state:u,step:N,store:c}}function Wq(e){const[t,n]=w.useState(null);return w.useEffect(()=>{let r=null,i=!1;if(e)if(Jt.domElement(e))r=e,i=!0;else{const o=document.querySelector(e);o&&(r=o)}else{const o=document.createElement("div");o.id=wq,document.body.appendChild(o),r=o}return n(r),()=>{!r||i||r.parentNode===document.body&&document.body.removeChild(r)}},[e]),t}const Kq={animation:"joyride-loader-spin 1s linear infinite",border:"5px solid rgba(0, 0, 0, 0.1)",borderRadius:"50%",borderTopColor:"#555"};function Yq({nonce:e,step:t}){const{loaderComponent:n}=t,r=!!n;if(w.useEffect(()=>{if(r||document.getElementById("joyride-loader-animation"))return Fc;const c=document.createElement("style");return c.id="joyride-loader-animation",e&&c.setAttribute("nonce",e),c.appendChild(document.createTextNode(`
161
+ @keyframes joyride-loader-spin {
162
+ to { transform: rotate(360deg); }
163
+ }
164
+ `)),document.head.appendChild(c),()=>{const u=document.getElementById("joyride-loader-animation");u!=null&&u.parentNode&&u.parentNode.removeChild(u)}},[r,e]),n===null)return null;const{height:i,width:o,...s}=t.styles.loader;let a;if(n){const c=n;a=Ne.createElement(c,{step:t})}else a=Ne.createElement("div",{style:{...Kq,height:i,width:o,borderTopColor:t.primaryColor}});return Ne.createElement("div",{className:"react-joyride__loader","data-testid":"loader",style:s},a)}const qq={height:0,isFixed:!1,left:0,top:0,width:0};function Il(e,t){const n=qn(e);if(!n)return qq;const r=Zx(n),i=Ra(n),o=Nq(n,t.top,i);return{height:Math.round(((r==null?void 0:r.height)??0)+t.top+t.bottom),isFixed:i,left:Math.round(((r==null?void 0:r.left)??0)-t.left),top:o,width:Math.round(((r==null?void 0:r.width)??0)+t.left+t.right)}}function Gq(e,t,n){const[r,i]=w.useState(()=>Il(e,t)),o=w.useRef(void 0),s=w.useRef(null),a=w.useRef(n),c=w.useRef(null),u=w.useCallback(()=>{clearTimeout(o.current),o.current=window.setTimeout(()=>{i(d=>{const f=Il(e,t);return d.top===f.top&&d.left===f.left&&d.width===f.width&&d.height===f.height&&d.isFixed===f.isFixed?d:f})},100)},[e,t]);w.useEffect(()=>{let d=null;const f=m=>{s.current=Ta(m,!0),s.current&&s.current.addEventListener("scroll",u,{passive:!0}),window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),typeof ResizeObserver<"u"&&(c.current=new ResizeObserver(u),c.current.observe(m)),i(Il(e,t))},h=qn(e);return h?f(h):(d=new MutationObserver(()=>{const m=qn(e);m&&(d==null||d.disconnect(),d=null,f(m))}),d.observe(document.body,{childList:!0,subtree:!0})),()=>{var m;d==null||d.disconnect(),s.current&&s.current.removeEventListener("scroll",u),window.removeEventListener("scroll",u),window.removeEventListener("resize",u),(m=c.current)==null||m.disconnect(),clearTimeout(o.current)}},[e,t,u]),w.useEffect(()=>{a.current&&!n&&i(Il(e,t)),a.current=n},[n,e,t]);let p=r;return a.current&&!n&&(p=Il(e,t)),p}function Xq(e,t,n){let r=`M0 0H${e}V${t}H0Z`;return n&&(r+=` ${n}`),r}function xS(e,t,n,r,i){if(n<=0||r<=0)return"";const o=Math.max(0,Math.min(i,n/2,r/2));let s=`M${e+o} ${t}`;return s+=`H${e+n-o}`,s+=`A${o} ${o} 0 0 1 ${e+n} ${t+o}`,s+=`V${t+r-o}`,s+=`A${o} ${o} 0 0 1 ${e+n-o} ${t+r}`,s+=`H${e+o}`,s+=`A${o} ${o} 0 0 1 ${e} ${t+r-o}`,s+=`V${t+o}`,s+=`A${o} ${o} 0 0 1 ${e+o} ${t}Z`,s}const Qq=[fe.BEACON_BEFORE,fe.BEACON];function Jq(e){var F,$;const{blockTargetInteraction:t,continuous:n,hideOverlay:r,lifecycle:i,onClickOverlay:o,overlayClickAction:s,placement:a,portalElement:c,scrolling:u,spotlightPadding:p,spotlightRadius:d,spotlightTarget:f,styles:h,target:m,waiting:b}=e,S=PK(),g=Gq(f??m,p,u||b),v=w.useRef(null),y=(i===fe.TOOLTIP||i===fe.TOOLTIP_BEFORE)&&a!=="center",[N,j]=w.useState(!1),k=c?(F=v.current)==null?void 0:F.offsetParent:null,_=(k==null?void 0:k.clientWidth)??S.width,R=(k==null?void 0:k.clientHeight)??kq()??S.height,M=(($=h.overlay)==null?void 0:$.backgroundColor)??"rgba(0, 0, 0, 0.5)",H=w.useMemo(()=>{const{backgroundColor:I,mixBlendMode:A,...E}=h.overlay;return{height:R,pointerEvents:"none",...E}},[R,h.overlay]),P=y&&!u&&!b;w.useEffect(()=>{P?requestAnimationFrame(()=>j(!0)):j(!1)},[P]);const T=n&&Qq.includes(i),V=!n&&i!==fe.TOOLTIP;if(r||!b&&(T||V))return null;let L="";if(P)if(c&&k){const I=qn(f??m);if(I){const A=hS(I),E=hS(k);L=xS(A.left-E.left-p.left,A.top-E.top-p.top,I.offsetWidth+p.left+p.right,I.offsetHeight+p.top+p.bottom,d)}}else L=xS(g.left,g.top,g.width,g.height,d);const B=Xq(_,R,L);return Ne.createElement("div",{ref:v,"aria-hidden":"true",className:"react-joyride__overlay","data-testid":"overlay",style:H},Ne.createElement("svg",{className:"react-joyride__spotlight","data-testid":"spotlight",style:{height:R,left:0,position:g.isFixed?"fixed":"absolute",top:0,width:_}},Ne.createElement("path",{d:B,fill:M,fillRule:"evenodd",onClick:o,style:{cursor:s?"pointer":"default",pointerEvents:"auto"}}),L&&Ne.createElement("path",{d:L,fill:M,style:{opacity:N?0:1,pointerEvents:t?"auto":"none",transition:"opacity 0.2s"}}),L&&Object.keys(h.spotlight).length>0&&Ne.createElement("path",{d:L,fill:"none",style:{pointerEvents:"none"},...h.spotlight})))}function n_(e){const{children:t,element:n}=e;return n?ui.createPortal(t,n):null}const Zq='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), area[href], [tabindex]:not([tabindex="-1"]), [contenteditable]';function eG(e,t){const n=w.useRef(null);w.useEffect(()=>{if(!e)return Fc;n.current=document.activeElement;const r=o=>{if(o.key!=="Tab")return;const s=[...e.querySelectorAll(Zq)],{shiftKey:a}=o;if(!s.length)return;o.preventDefault();let c=document.activeElement?s.indexOf(document.activeElement):0;c===-1||!a&&c+1===s.length?c=0:a&&c===0?c=s.length-1:c+=a?-1:1,s[c].focus()};e.addEventListener("keydown",r,!1);let i;{const o=e.querySelector(t);o&&(i=setTimeout(()=>{o.focus({preventScroll:!0})},100))}return()=>{var o;e.removeEventListener("keydown",r),i!==void 0&&clearTimeout(i),(o=n.current)==null||o.focus({preventScroll:!0})}},[e,t])}function fi(e,t,n){const[r]=e.split("-");switch(r){case"top":case"bottom":return{width:t,height:n};case"left":case"right":return{width:n,height:t};default:return null}}function tG(e,t,n){const[r]=e.split("-");switch(r){case"top":return{points:`0,0 ${t/2},${n} ${t},0`,...fi(e,t,n)};case"bottom":return{points:`${t},${n} ${t/2},0 0,${n}`,...fi(e,t,n)};case"left":return{points:`0,0 ${n},${t/2} 0,${t}`,...fi(e,t,n)};case"right":return{points:`${n},${t} ${n},0 0,${t/2}`,...fi(e,t,n)};default:return null}}function nG(e,t,n,r){if(!t)return{};const[i]=e.split("-");switch(i){case"top":return{bottom:-n,left:t.x??0,...fi(e,r,n)};case"bottom":return{top:-n,left:t.x??0,...fi(e,r,n)};case"left":return{right:-n,top:t.y??0,...fi(e,r,n)};case"right":return{left:-n,top:t.y??0,...fi(e,r,n)};default:return{}}}function rG({arrowComponent:e,arrowRef:t,base:n,placement:r,position:i,size:o,styles:s}){const a=e;let c=null;if(a){if(!fi(r,n,o))return null;c=Ne.createElement("span",{style:{flexShrink:0}},Ne.createElement(a,{base:n,placement:r,size:o}))}else{const u=tG(r,n,o);if(!u)return null;c=Ne.createElement("svg",{height:u.height,width:u.width,xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("polygon",{fill:"currentColor",points:u.points}))}return Ne.createElement("span",{ref:t,className:"react-joyride__arrow","data-testid":"arrow",style:{...s,...nG(r,i,o,n),...i?{}:{visibility:"hidden"}}},c)}function iG(e){const{beaconComponent:t,continuous:n,index:r,isLastStep:i,locale:o,nonce:s,onInteract:a,shouldFocus:c,size:u,step:p,styles:d}=e,f=w.useRef(null),h=!!t;w.useEffect(()=>{if(h||document.getElementById("joyride-beacon-animation"))return Fc;const S=document.createElement("style");S.id="joyride-beacon-animation",s&&S.setAttribute("nonce",s),S.appendChild(document.createTextNode(`
165
+ @keyframes joyride-beacon-inner {
166
+ 20% {
167
+ opacity: 0.9;
168
+ }
169
+
170
+ 90% {
171
+ opacity: 0.7;
172
+ }
173
+ }
174
+
175
+ @keyframes joyride-beacon-outer {
176
+ 0% {
177
+ transform: scale(1);
178
+ }
179
+
180
+ 45% {
181
+ opacity: 0.7;
182
+ transform: scale(0.75);
183
+ }
184
+
185
+ 100% {
186
+ opacity: 0.9;
187
+ transform: scale(1);
188
+ }
189
+ }
190
+ `)),document.head.appendChild(S);const g=setTimeout(()=>{Jt.domElement(f.current)&&c&&f.current.focus()},0);return()=>{clearTimeout(g);const v=document.getElementById("joyride-beacon-animation");v!=null&&v.parentNode&&v.parentNode.removeChild(v)}},[h,s,c]);const m=ai(o.open);let b;if(t){const S=t;b=Ne.createElement(S,{continuous:n,index:r,isLastStep:i,size:u,step:p})}else b=Ne.createElement("span",{style:d.beacon},Ne.createElement("span",{style:d.beaconOuter}),Ne.createElement("span",{style:d.beaconInner}));return Ne.createElement("button",{ref:f,"aria-label":m,className:"react-joyride__beacon","data-testid":"button-beacon",onClick:a,onMouseEnter:a,style:d.beaconWrapper,title:m,type:"button"},b)}function oG({styles:e,...t}){const{color:n,height:r,width:i,...o}=e;return Ne.createElement("button",{style:o,type:"button",...t},Ne.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof i=="number"?`${i}px`:i,xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("g",null,Ne.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}function sG(e){const{backProps:t,closeProps:n,index:r,isLastStep:i,primaryProps:o,skipProps:s,step:a,tooltipProps:c}=e,{buttons:u,content:p,styles:d,title:f}=a,h={};u.includes("primary")&&(h.primary=Ne.createElement("button",{"data-testid":"button-primary",style:d.buttonPrimary,type:"button",...o})),u.includes("skip")&&!i&&(h.skip=Ne.createElement("button",{"aria-live":"off","data-testid":"button-skip",style:d.buttonSkip,type:"button",...s})),u.includes("back")&&r>0&&(h.back=Ne.createElement("button",{"data-testid":"button-back",style:d.buttonBack,type:"button",...t})),h.close=u.includes("close")&&Ne.createElement(oG,{"data-testid":"button-close",styles:d.buttonClose,...n});const m=f?{"aria-labelledby":"joyride-tooltip-title","aria-describedby":"joyride-tooltip-content"}:{"aria-label":ai(p),"aria-describedby":"joyride-tooltip-content"};return Ne.createElement("div",{key:"JoyrideTooltip",className:"react-joyride__tooltip","data-joyride-step":r,...a.id&&{"data-joyride-id":a.id},style:d.tooltip,...c,...m},Ne.createElement("div",{style:d.tooltipContainer},f&&Ne.createElement("h4",{id:"joyride-tooltip-title",style:d.tooltipTitle},f),Ne.createElement("div",{id:"joyride-tooltip-content",style:d.tooltipContent},p)),u.some(b=>b==="back"||b==="primary"||b==="skip")&&Ne.createElement("div",{style:d.tooltipFooter},Ne.createElement("div",{style:d.tooltipFooterSpacer},h.skip),h.back,h.primary),h.close)}function aG(e){const{continuous:t,controls:n,index:r,isLastStep:i,size:o,step:s}=e,a=g=>{g.preventDefault(),n.prev(Lr.BUTTON_BACK)},c=g=>{g.preventDefault(),s.closeButtonAction==="skip"?n.skip(Lr.BUTTON_CLOSE):n.close(Lr.BUTTON_CLOSE)},u=g=>{if(g.preventDefault(),!t){n.close(Lr.BUTTON_PRIMARY);return}n.next(Lr.BUTTON_PRIMARY)},p=g=>{g.preventDefault(),n.skip(Lr.BUTTON_SKIP)},d=()=>{const{back:g,close:v,last:y,next:N,nextWithProgress:j,skip:k}=s.locale,_=ai(g),R=ai(v),M=ai(y),H=ai(N),P=ai(k);let T=v,V=R;if(t){if(T=N,V=H,s.showProgress&&!i){const L=ai(j,{step:r+1,steps:o});T=ly(j,r+1,o),V=L}i&&(T=y,V=M)}return{backProps:{"aria-label":_,children:g,"data-action":"back",onClick:a,role:"button",title:_},closeProps:{"aria-label":R,children:v,"data-action":"close",onClick:c,role:"button",title:R},primaryProps:{"aria-label":V,children:T,"data-action":"primary",onClick:u,role:"button",title:V},skipProps:{"aria-label":P,children:k,"data-action":"skip",onClick:p,role:"button",title:P},tooltipProps:{"aria-modal":!0,role:"alertdialog"}}},{arrowComponent:f,beaconComponent:h,tooltipComponent:m,...b}=s;let S;if(m){const g=m;S=Ne.createElement(g,{...d(),continuous:t,controls:n,index:r,isLastStep:i,size:o,step:b})}else S=Ne.createElement(sG,{...d(),continuous:t,controls:n,index:r,isLastStep:i,size:o,step:b});return S}function lG(e){if(e.startsWith("left"))return["top","bottom"];if(e.startsWith("right"))return["bottom","top"]}function cG(e,t,n){var r,i;return e?[pq()]:((r=t.floatingOptions)==null?void 0:r.flipOptions)===!1?[]:[fq({crossAxis:!1,fallbackPlacements:lG(n),padding:20,...(i=t.floatingOptions)==null?void 0:i.flipOptions})]}function uG(e){var A,E,z,U,O;const{continuous:t,controls:n,index:r,lifecycle:i,nonce:o,open:s,portalElement:a,setPositionData:c,setTooltipRef:u,shouldScroll:p,size:d,step:f,target:h,updateState:m}=e,b=w.useRef(null),S=w.useRef({}),g=w.useRef({}),v=f.placement==="center",y=f.placement==="auto",N=w.useMemo(()=>({getBoundingClientRect:()=>({x:window.innerWidth/2,y:window.innerHeight/2,top:window.innerHeight/2,left:window.innerWidth/2,bottom:window.innerHeight/2,right:window.innerWidth/2,width:0,height:0})}),[]),j=w.useMemo(()=>JP(h)?Ta(h):void 0,[h]),k=w.useMemo(()=>Ra(h),[h]),_=w.useMemo(()=>j?{boundary:j,rootBoundary:"viewport"}:{},[j]),R=v||y?"bottom":f.placement,M=v?"fixed":((A=f.floatingOptions)==null?void 0:A.strategy)??(f.isFixed||k?"fixed":"absolute"),H=w.useMemo(()=>{var q,Z,te,ae;return v?[{name:"center",fn:({rects:ee})=>({x:(window.innerWidth-ee.floating.width)/2,y:(window.innerHeight-ee.floating.height)/2})}]:[dS(({placement:ee})=>{var xe;let ue="right";ee.startsWith("top")?ue="top":ee.startsWith("bottom")?ue="bottom":ee.startsWith("left")&&(ue="left");const Se=f.spotlightTarget?0:f.spotlightPadding[ue];return f.offset+Se+((xe=f.floatingOptions)!=null&&xe.hideArrow?0:f.arrowSize)},[f.offset,f.spotlightPadding,f.spotlightTarget,f.arrowSize,(q=f.floatingOptions)==null?void 0:q.hideArrow]),...cG(y,f,R),dq({padding:10,..._,...(Z=f.floatingOptions)==null?void 0:Z.shiftOptions}),...(te=f.floatingOptions)!=null&&te.hideArrow?[]:[hq({element:b,padding:f.arrowSpacing},[f.arrowSpacing,f.arrowBase])],...((ae=f.floatingOptions)==null?void 0:ae.middleware)??[]]},[v,f,y,R,_]),P=uS({...v?{elements:{reference:N}}:{},placement:R,strategy:M,middleware:H}),T=uS({strategy:M,placement:f.beaconPlacement??(y||v?"bottom":f.placement),middleware:w.useMemo(()=>{var q,Z;return[dS(((Z=(q=f.floatingOptions)==null?void 0:q.beaconOptions)==null?void 0:Z.offset)??-18)]},[(z=(E=f.floatingOptions)==null?void 0:E.beaconOptions)==null?void 0:z.offset]),whileElementsMounted:aS});g.current=P.middlewareData,S.current=T.middlewareData,w.useEffect(()=>{var te;const{floating:q,reference:Z}=P.elements;if(!(!Z||!q||i!==fe.TOOLTIP))return aS(Z,q,P.update,(te=f.floatingOptions)==null?void 0:te.autoUpdate)},[i,P.update,(U=f.floatingOptions)==null?void 0:U.autoUpdate,f.target,P.elements]),w.useEffect(()=>{!v&&h&&P.refs.setReference(h),h&&T.refs.setReference(h)},[T.refs,v,h,P.refs]),w.useEffect(()=>{P.isPositioned&&c("tooltip",{placement:P.placement,x:P.x??0,y:P.y??0,middlewareData:g.current})},[c,P.isPositioned,P.placement,P.x,P.y]),w.useEffect(()=>{T.isPositioned&&c("beacon",{placement:T.placement,x:T.x??0,y:T.y??0,middlewareData:S.current})},[c,T.isPositioned,T.placement,T.x,T.y]);const V=f.zIndex+100,L=w.useCallback(q=>{q.type==="mouseenter"&&f.beaconTrigger!=="hover"||m({lifecycle:fe.TOOLTIP_BEFORE,positioned:!1})},[f.beaconTrigger,m]),B=w.useCallback(q=>{q&&(P.refs.setFloating(q),u(q))},[P.refs,u]),{arrow:F,floater:$}=f.styles;let I=null;if(i===fe.TOOLTIP||i===fe.TOOLTIP_BEFORE){const q=pS({...$,...P.floatingStyles,zIndex:V,opacity:s&&P.isPositioned?1:0,...!s&&{transition:"none"}});I=Ne.createElement("div",{ref:B,className:"react-joyride__floater","data-testid":"floater",id:`react-joyride-step-${r}`,style:q},Ne.createElement(aG,{continuous:t,controls:n,index:r,isLastStep:r+1===d,size:d,step:f}),!v&&!((O=f.floatingOptions)!=null&&O.hideArrow)&&Ne.createElement(rG,{arrowComponent:f.arrowComponent,arrowRef:b,base:f.arrowBase,placement:P.placement,position:P.middlewareData.arrow,size:f.arrowSize,styles:F}))}else(i===fe.BEACON||i===fe.BEACON_BEFORE)&&(I=Ne.createElement("div",{ref:T.refs.setFloating,className:"react-joyride__floater","data-testid":"floater-beacon",id:`react-joyride-step-${r}-beacon`,style:pS({...T.floatingStyles,zIndex:V})},Ne.createElement(iG,{beaconComponent:f.beaconComponent,continuous:t,index:r,isLastStep:r+1===d,locale:f.locale,nonce:o,onInteract:L,shouldFocus:p,size:d,step:f,styles:f.styles})));return Ne.createElement(n_,{element:a},I)}function dG(e){const{continuous:t,controls:n,index:r,lifecycle:i,nonce:o,portalElement:s,setPositionData:a,shouldScroll:c,size:u,step:p,updateState:d}=e,[f,h]=w.useState(null);eG(p.disableFocusTrap?null:f,"[data-action=primary]");const m=qn(p.target),b=i===fe.TOOLTIP;return!e_(p)||!Jt.domElement(m)?null:Ne.createElement(uG,{key:`JoyrideStep-${r}`,continuous:t,controls:n,index:r,lifecycle:i,nonce:o,open:b,portalElement:s,setPositionData:a,setTooltipRef:h,shouldScroll:c,size:u,step:p,target:m,updateState:d})}function fG({controls:e,mergedProps:t,state:n,step:r,store:i}){const{continuous:o,debug:s,nonce:a,portalElement:c,scrollToFirstStep:u}=t,p=Wq(c),{index:d,lifecycle:f,status:h}=n,m=h===Oe.RUNNING,[b,S]=w.useState(!1),g=w.useRef(null),v=(r==null?void 0:r.loaderDelay)??0;w.useEffect(()=>(n.waiting?v===0?S(!0):g.current=setTimeout(()=>{S(!0)},v):S(!1),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[v,n.waiting]),w.useEffect(()=>{if(!m)return;const j=k=>{!r||f!==fe.TOOLTIP||k.key==="Escape"&&r.dismissKeyAction&&(r.dismissKeyAction==="next"?e.next(Lr.KEYBOARD):e.close(Lr.KEYBOARD))};return document.body.addEventListener("keydown",j,{passive:!0}),()=>{document.body.removeEventListener("keydown",j)}},[e,m,f,r]);const y=w.useCallback(()=>{(r==null?void 0:r.overlayClickAction)==="close"?e.close(Lr.OVERLAY):(r==null?void 0:r.overlayClickAction)==="next"&&e.next(Lr.OVERLAY)},[e,r==null?void 0:r.overlayClickAction]);if(!r||!m)return null;const N=n.action===Fe.START&&!r.skipBeacon&&r.placement!=="center";return Ne.createElement(Ne.Fragment,null,f!==fe.INIT&&Ne.createElement(dG,{...n,continuous:o,controls:e,debug:s,nonce:a,portalElement:p,setPositionData:i.current.setPositionData,shouldScroll:!r.skipScroll&&(d!==0||u),step:r,updateState:i.current.updateState}),Ne.createElement(n_,{element:p},Ne.createElement(Ne.Fragment,null,b&&Ne.createElement(Yq,{nonce:a,step:r}),!N&&Ne.createElement(Jq,{...r,continuous:o,lifecycle:f,onClickOverlay:y,portalElement:c?p:null,scrolling:n.scrolling,waiting:n.waiting}))))}function pG(e){const{controls:t,failures:n,mergedProps:r,state:i,step:o,store:s}=Vq(e);return{controls:t,failures:n,on:w.useCallback((a,c)=>s.current.on(a,c),[s]),state:w.useMemo(()=>qf(i,"positioned"),[i]),step:o,Tour:Jx()?Ne.createElement(fG,{controls:t,mergedProps:r,state:i,step:o,store:s}):null}}function hG(e){const{Tour:t}=pG(e);return t}function mG(e){return Jx()?Ne.createElement(hG,e):null}function gG(e){return[{target:"body",content:e("onboarding:projects.intro"),disableBeacon:!0,placement:"center"},{target:".af-hub-card",content:e("onboarding:projects.hubIntro"),disableBeacon:!0,placement:"left"}]}function yG(e){return[{target:"body",content:e("onboarding:flow.intro"),disableBeacon:!0,placement:"center"}]}function xG(e){return[{target:"body",content:e("onboarding:flow.introEmpty"),disableBeacon:!0,placement:"center"}]}const bm="af:onboarding";function wG({page:e,hasNodes:t=!1}){const{t:n}=st(),[r,i]=w.useState(!1),[o,s]=w.useState([]),a=w.useRef(null),c=w.useMemo(()=>e==="projects"?gG(n):t?yG(n):xG(n),[e,t,n]);return w.useEffect(()=>{const u=localStorage.getItem(bm);console.log("[Onboarding] localStorage:",u);const p=u?JSON.parse(u):{};if(console.log("[Onboarding] progress:",p,"page:",e),p.completed||p[e]){console.log("[Onboarding] skipped - already done"),i(!1),s([]);return}console.log("[Onboarding] starting with steps:",c),s(c),i(!0)},[e,t,c]),w.useEffect(()=>{if(!r)return;const u=p=>{var m;const d=p.target.closest("button");if(!d||!d.closest(".react-joyride__tooltip"))return;const h=(m=d.textContent)==null?void 0:m.trim();if(h===n("onboarding:done")||h===n("onboarding:startCreate")||h===n("onboarding:skip")){const b=localStorage.getItem(bm)||"{}",S=JSON.parse(b);h===n("onboarding:skip")?(S.projects=!0,S.flow=!0,S.completed=!0):S[e]=!0,localStorage.setItem(bm,JSON.stringify(S)),s([]),i(!1),e==="projects"&&(h===n("onboarding:done")||h===n("onboarding:startCreate"))&&(localStorage.setItem("af:newPipelineGuide","true"),setTimeout(()=>{const g=document.querySelector(".af-create-btn");g&&g.click()},500))}};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[r,e,n]),!r||o.length===0?null:l.jsx(mG,{ref:a,steps:o,run:r,continuous:!0,showSkipButton:!0,showProgress:o.length>1,styles:{options:{primaryColor:"#7c4dff",textColor:"#ffffff",backgroundColor:"#1a1a1a",arrowColor:"#1a1a1a",overlayColor:"rgba(0, 0, 0, 0.4)",zIndex:1e4},tooltip:{borderRadius:"1.5rem",padding:"1.5rem"},buttonNext:{borderRadius:"9999px",padding:"0.625rem 1.5rem"},buttonSkip:{borderRadius:"9999px",color:"#9ecaff"},buttonClose:{display:"none"}},locale:{back:n("onboarding:back"),next:n("onboarding:next"),skip:n("onboarding:skip"),last:n(e==="projects"?"onboarding:startCreate":"onboarding:done")},floaterProps:{disableAnimation:!0},scrollToFirstStep:!0})}function vG(){const{navigate:e,path:t}=Ea(),[n,r]=w.useState([]),[i,o]=w.useState(!1);if(w.useEffect(()=>{let p=!1;const d=async()=>{try{const h=await fetch("/api/pipeline-recent-runs");if(!h.ok)return;const m=await h.json();if(p)return;const b=Array.isArray(m.runs)?m.runs:[];r(b.filter(S=>S&&S.status==="running"))}catch{}};d();const f=window.setInterval(d,3e3);return()=>{p=!0,window.clearInterval(f)}},[]),n.length===0)return null;const s=p=>{const d=new URLSearchParams({flowId:p.flowId,flowSource:p.flowSource||"workspace"});e(`/flow?${d.toString()}`),o(!1)},a=t==="/flow"?new URLSearchParams(window.location.search):null,c=(a==null?void 0:a.get("flowId"))||"",u=n.length===1;return l.jsxs("div",{className:"af-run-indicator",role:"status","aria-live":"polite",children:[i&&!u&&l.jsx("div",{className:"af-run-indicator__menu",onMouseLeave:()=>o(!1),children:n.map(p=>l.jsxs("button",{type:"button",className:"af-run-indicator__item"+(p.flowId===c?" af-run-indicator__item--current":""),onClick:()=>s(p),title:`${p.flowId} · ${p.runId}`,children:[l.jsx("span",{className:"af-run-indicator__dot"}),l.jsx("span",{className:"af-run-indicator__flow",children:p.flowId}),l.jsx("span",{className:"af-run-indicator__run",children:p.runId.slice(0,12)})]},`${p.flowId}:${p.runId}`))}),l.jsxs("button",{type:"button",className:"af-run-indicator__btn",onClick:()=>u?s(n[0]):o(p=>!p),title:u?`${n[0].flowId} 运行中,点击跳转`:`${n.length} 个 pipeline 运行中`,children:[l.jsx("span",{className:"af-run-indicator__pulse"}),l.jsx("span",{className:"af-run-indicator__label",children:u?n[0].flowId:`${n.length} running`})]})]})}function bG(){const{path:e}=Ea();return e==="/projects"||e==="/"?l.jsx(q0,{}):e==="/flow"?l.jsx(x9,{}):e==="/settings"?l.jsx(cK,{}):l.jsx(q0,{})}function SG(){const{path:e}=Ea(),t=e==="/flow";return l.jsxs("div",{className:"af-app",children:[e!=="/settings"?l.jsx(wG,{page:t?"flow":"projects"}):null,t?null:l.jsx(VA,{}),l.jsx("div",{className:t?"af-main af-main--pipeline":"af-main",children:l.jsx(bG,{})}),l.jsx(vG,{})]})}function kG(){return l.jsx(CA,{children:l.jsx(SG,{})})}const wS=document.querySelector('link[rel="icon"]');wS&&(wS.href=ON);Sm.createRoot(document.getElementById("root")).render(l.jsx(Ne.StrictMode,{children:l.jsx(kG,{})}));