@fieldwangai/agentflow 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/apply.mjs +18 -1
- package/bin/lib/catalog-flows.mjs +65 -0
- package/bin/lib/composer-skill-router.mjs +117 -0
- package/bin/lib/help.mjs +8 -0
- package/bin/lib/locales/en.json +21 -1
- package/bin/lib/locales/zh.json +21 -1
- package/bin/lib/main.mjs +56 -3
- package/bin/lib/marketplace.mjs +542 -0
- package/bin/lib/paths.mjs +7 -0
- package/bin/lib/scheduler.mjs +246 -0
- package/bin/lib/ui-server.mjs +117 -55
- package/bin/pipeline/build-node-prompt.mjs +43 -2
- package/bin/pipeline/get-ready-nodes.mjs +2 -2
- package/bin/pipeline/get-resolved-values.mjs +6 -0
- package/bin/pipeline/parse-flow.mjs +15 -5
- package/bin/pipeline/pre-process-node.mjs +336 -1
- package/builtin/nodes/control_cancelled.md +20 -0
- package/builtin/nodes/control_deadline.md +32 -0
- package/builtin/nodes/control_delay.md +20 -0
- package/builtin/nodes/control_interval_loop.md +53 -0
- package/builtin/nodes/control_wait_until.md +23 -0
- package/builtin/web-ui/dist/assets/index-BeUBxIj1.js +190 -0
- package/builtin/web-ui/dist/assets/index-BzhdjOzb.css +1 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +1 -1
- package/builtin/web-ui/dist/assets/index-CZkUPcXE.css +0 -1
- package/builtin/web-ui/dist/assets/index-D4949pHe.js +0 -190
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
var __=Object.defineProperty;var I_=(e,t,n)=>t in e?__(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pt=(e,t,n)=>I_(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 zl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tS={exports:{}},Af={},nS={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 Nc=Symbol.for("react.element"),A_=Symbol.for("react.portal"),T_=Symbol.for("react.fragment"),R_=Symbol.for("react.strict_mode"),L_=Symbol.for("react.profiler"),O_=Symbol.for("react.provider"),M_=Symbol.for("react.context"),D_=Symbol.for("react.forward_ref"),F_=Symbol.for("react.suspense"),$_=Symbol.for("react.memo"),z_=Symbol.for("react.lazy"),mw=Symbol.iterator;function B_(e){return e===null||typeof e!="object"?null:(e=mw&&e[mw]||e["@@iterator"],typeof e=="function"?e:null)}var rS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iS=Object.assign,oS={};function ma(e,t,n){this.props=e,this.context=t,this.refs=oS,this.updater=n||rS}ma.prototype.isReactComponent={};ma.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")};ma.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sS(){}sS.prototype=ma.prototype;function Yg(e,t,n){this.props=e,this.context=t,this.refs=oS,this.updater=n||rS}var qg=Yg.prototype=new sS;qg.constructor=Yg;iS(qg,ma.prototype);qg.isPureReactComponent=!0;var gw=Array.isArray,aS=Object.prototype.hasOwnProperty,Gg={current:null},lS={key:!0,ref:!0,__self:!0,__source:!0};function cS(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)aS.call(t,r)&&!lS.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Nc,type:e,key:o,ref:s,props:i,_owner:Gg.current}}function H_(e,t){return{$$typeof:Nc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Xg(e){return typeof e=="object"&&e!==null&&e.$$typeof===Nc}function U_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var yw=/\/+/g;function Wp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U_(""+e.key):t.toString(36)}function ld(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 Nc:case A_:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Wp(s,0):r,gw(i)?(n="",e!=null&&(n=e.replace(yw,"$&/")+"/"),ld(i,t,n,"",function(u){return u})):i!=null&&(Xg(i)&&(i=H_(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(yw,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",gw(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Wp(o,a);s+=ld(o,t,n,l,i)}else if(l=B_(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Wp(o,a++),s+=ld(o,t,n,l,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 ku(e,t,n){if(e==null)return e;var r=[],i=0;return ld(e,r,"","",function(o){return t.call(n,o,i++)}),r}function V_(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},cd={transition:null},W_={ReactCurrentDispatcher:an,ReactCurrentBatchConfig:cd,ReactCurrentOwner:Gg};function uS(){throw Error("act(...) is not supported in production builds of React.")}De.Children={map:ku,forEach:function(e,t,n){ku(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ku(e,function(){t++}),t},toArray:function(e){return ku(e,function(t){return t})||[]},only:function(e){if(!Xg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};De.Component=ma;De.Fragment=T_;De.Profiler=L_;De.PureComponent=Yg;De.StrictMode=R_;De.Suspense=F_;De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W_;De.act=uS;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=iS({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=Gg.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)aS.call(t,l)&&!lS.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Nc,type:e.type,key:i,ref:o,props:r,_owner:s}};De.createContext=function(e){return e={$$typeof:M_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:O_,_context:e},e.Consumer=e};De.createElement=cS;De.createFactory=function(e){var t=cS.bind(null,e);return t.type=e,t};De.createRef=function(){return{current:null}};De.forwardRef=function(e){return{$$typeof:D_,render:e}};De.isValidElement=Xg;De.lazy=function(e){return{$$typeof:z_,_payload:{_status:-1,_result:e},_init:V_}};De.memo=function(e,t){return{$$typeof:$_,type:e,compare:t===void 0?null:t}};De.startTransition=function(e){var t=cd.transition;cd.transition={};try{e()}finally{cd.transition=t}};De.unstable_act=uS;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";nS.exports=De;var x=nS.exports;const ke=ro(x);/**
|
|
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 K_=x,Y_=Symbol.for("react.element"),q_=Symbol.for("react.fragment"),G_=Object.prototype.hasOwnProperty,X_=K_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q_={key:!0,ref:!0,__self:!0,__source:!0};function dS(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)G_.call(t,r)&&!Q_.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:Y_,type:e,key:o,ref:s,props:i,_owner:X_.current}}Af.Fragment=q_;Af.jsx=dS;Af.jsxs=dS;tS.exports=Af;var c=tS.exports,sm={},fS={exports:{}},Mn={},pS={exports:{}},hS={};/**
|
|
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){var C=_.length;_.push(I);e:for(;0<C;){var F=C-1>>>1,U=_[F];if(0<i(U,I))_[F]=I,_[C]=U,C=F;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var I=_[0],C=_.pop();if(C!==I){_[0]=C;e:for(var F=0,U=_.length,O=U>>>1;F<O;){var q=2*(F+1)-1,ee=_[q],ne=q+1,ae=_[ne];if(0>i(ee,C))ne<U&&0>i(ae,ee)?(_[F]=ae,_[ne]=C,F=ne):(_[F]=ee,_[q]=C,F=q);else if(ne<U&&0>i(ae,C))_[F]=ae,_[ne]=C,F=ne;else break e}}return I}function i(_,I){var C=_.sortIndex-I.sortIndex;return C!==0?C:_.id-I.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 l=[],u=[],f=1,d=null,p=3,h=!1,m=!1,v=!1,k=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,w=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(_){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=_)r(u),I.sortIndex=I.expirationTime,t(l,I);else break;I=n(u)}}function N(_){if(v=!1,y(_),!m)if(n(l)!==null)m=!0,D(E);else{var I=n(u);I!==null&&$(N,I.startTime-_)}}function E(_,I){m=!1,v&&(v=!1,g(T),T=-1),h=!0;var C=p;try{for(y(I),d=n(l);d!==null&&(!(d.expirationTime>I)||_&&!A());){var F=d.callback;if(typeof F=="function"){d.callback=null,p=d.priorityLevel;var U=F(d.expirationTime<=I);I=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),y(I)}else r(l);d=n(l)}if(d!==null)var O=!0;else{var q=n(u);q!==null&&$(N,q.startTime-I),O=!1}return O}finally{d=null,p=C,h=!1}}var S=!1,P=null,T=-1,M=5,B=-1;function A(){return!(e.unstable_now()-B<M)}function R(){if(P!==null){var _=e.unstable_now();B=_;var I=!0;try{I=P(!0,_)}finally{I?V():(S=!1,P=null)}}else S=!1}var V;if(typeof w=="function")V=function(){w(R)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,H=L.port2;L.port1.onmessage=R,V=function(){H.postMessage(null)}}else V=function(){k(R,0)};function D(_){P=_,S||(S=!0,V())}function $(_,I){T=k(function(){_(e.unstable_now())},I)}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(_){_.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,D(E))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var C=p;p=I;try{return _()}finally{p=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var C=p;p=_;try{return I()}finally{p=C}},e.unstable_scheduleCallback=function(_,I,C){var F=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?F+C:F):C=F,_){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=C+U,_={id:f++,callback:I,priorityLevel:_,startTime:C,expirationTime:U,sortIndex:-1},C>F?(_.sortIndex=C,t(u,_),n(l)===null&&_===n(u)&&(v?(g(T),T=-1):v=!0,$(N,C-F))):(_.sortIndex=U,t(l,_),m||h||(m=!0,D(E))),_},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(_){var I=p;return function(){var C=p;p=I;try{return _.apply(this,arguments)}finally{p=C}}}})(hS);pS.exports=hS;var J_=pS.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 Z_=x,Ln=J_;function re(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 mS=new Set,Bl={};function qo(e,t){Gs(e,t),Gs(e+"Capture",t)}function Gs(e,t){for(Bl[e]=t,e=0;e<t.length;e++)mS.add(t[e])}var ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=Object.prototype.hasOwnProperty,eI=/^[: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]*$/,xw={},ww={};function tI(e){return am.call(ww,e)?!0:am.call(xw,e)?!1:eI.test(e)?ww[e]=!0:(xw[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 rI(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 Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ht[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];Ht[t]=new ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ht[e]=new ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ht[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){Ht[e]=new ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ht[e]=new ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ht[e]=new ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ht[e]=new ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ht[e]=new ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qg=/[\-:]([a-z])/g;function Jg(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(Qg,Jg);Ht[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(Qg,Jg);Ht[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(Qg,Jg);Ht[t]=new ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ht[e]=new ln(e,1,!1,e.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ht[e]=new ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zg(e,t,n,r){var i=Ht.hasOwnProperty(t)?Ht[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rI(t,n,i,r)&&(n=null),r||i===null?tI(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 hi=Z_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Nu=Symbol.for("react.element"),vs=Symbol.for("react.portal"),bs=Symbol.for("react.fragment"),ey=Symbol.for("react.strict_mode"),lm=Symbol.for("react.profiler"),gS=Symbol.for("react.provider"),yS=Symbol.for("react.context"),ty=Symbol.for("react.forward_ref"),cm=Symbol.for("react.suspense"),um=Symbol.for("react.suspense_list"),ny=Symbol.for("react.memo"),Ii=Symbol.for("react.lazy"),xS=Symbol.for("react.offscreen"),vw=Symbol.iterator;function Za(e){return e===null||typeof e!="object"?null:(e=vw&&e[vw]||e["@@iterator"],typeof e=="function"?e:null)}var dt=Object.assign,Kp;function gl(e){if(Kp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kp=t&&t[1]||""}return`
|
|
34
|
-
`+Kp+e}var Yp=!1;function qp(e,t){if(!e||Yp)return"";Yp=!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 l=`
|
|
37
|
-
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Yp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gl(e):""}function iI(e){switch(e.tag){case 5:return gl(e.type);case 16:return gl("Lazy");case 13:return gl("Suspense");case 19:return gl("SuspenseList");case 0:case 2:case 15:return e=qp(e.type,!1),e;case 11:return e=qp(e.type.render,!1),e;case 1:return e=qp(e.type,!0),e;default:return""}}function dm(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 bs:return"Fragment";case vs:return"Portal";case lm:return"Profiler";case ey:return"StrictMode";case cm:return"Suspense";case um:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yS:return(e.displayName||"Context")+".Consumer";case gS:return(e._context.displayName||"Context")+".Provider";case ty:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ny:return t=e.displayName||null,t!==null?t:dm(e.type)||"Memo";case Ii:t=e._payload,e=e._init;try{return dm(e(t))}catch{}}return null}function oI(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 dm(t);case 8:return t===ey?"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 Qi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sI(e){var t=wS(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 Cu(e){e._valueTracker||(e._valueTracker=sI(e))}function vS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ad(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 fm(e,t){var n=t.checked;return dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qi(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 bS(e,t){t=t.checked,t!=null&&Zg(e,"checked",t,!1)}function pm(e,t){bS(e,t);var n=Qi(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")?hm(e,t.type,n):t.hasOwnProperty("defaultValue")&&hm(e,t.type,Qi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sw(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 hm(e,t,n){(t!=="number"||Ad(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yl=Array.isArray;function Fs(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=""+Qi(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 mm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function kw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(yl(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Qi(n)}}function SS(e,t){var n=Qi(t.value),r=Qi(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 Nw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kS(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 gm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?kS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Eu,NS=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(Eu=Eu||document.createElement("div"),Eu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Eu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kl={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},aI=["Webkit","ms","Moz","O"];Object.keys(kl).forEach(function(e){aI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kl[t]=kl[e]})});function CS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kl.hasOwnProperty(e)&&kl[e]?(""+t).trim():t+"px"}function ES(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=CS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var lI=dt({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 ym(e,t){if(t){if(lI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function xm(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 wm=null;function ry(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vm=null,$s=null,zs=null;function Cw(e){if(e=jc(e)){if(typeof vm!="function")throw Error(re(280));var t=e.stateNode;t&&(t=Mf(t),vm(e.stateNode,e.type,t))}}function jS(e){$s?zs?zs.push(e):zs=[e]:$s=e}function PS(){if($s){var e=$s,t=zs;if(zs=$s=null,Cw(e),t)for(e=0;e<t.length;e++)Cw(t[e])}}function _S(e,t){return e(t)}function IS(){}var Gp=!1;function AS(e,t,n){if(Gp)return e(t,n);Gp=!0;try{return _S(e,t,n)}finally{Gp=!1,($s!==null||zs!==null)&&(IS(),PS())}}function Ul(e,t){var n=e.stateNode;if(n===null)return null;var r=Mf(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(re(231,t,typeof n));return n}var bm=!1;if(ai)try{var el={};Object.defineProperty(el,"passive",{get:function(){bm=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{bm=!1}function cI(e,t,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var Nl=!1,Td=null,Rd=!1,Sm=null,uI={onError:function(e){Nl=!0,Td=e}};function dI(e,t,n,r,i,o,s,a,l){Nl=!1,Td=null,cI.apply(uI,arguments)}function fI(e,t,n,r,i,o,s,a,l){if(dI.apply(this,arguments),Nl){if(Nl){var u=Td;Nl=!1,Td=null}else throw Error(re(198));Rd||(Rd=!0,Sm=u)}}function Go(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 TS(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 Ew(e){if(Go(e)!==e)throw Error(re(188))}function pI(e){var t=e.alternate;if(!t){if(t=Go(e),t===null)throw Error(re(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 Ew(i),e;if(o===r)return Ew(i),t;o=o.sibling}throw Error(re(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(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function RS(e){return e=pI(e),e!==null?LS(e):null}function LS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=LS(e);if(t!==null)return t;e=e.sibling}return null}var OS=Ln.unstable_scheduleCallback,jw=Ln.unstable_cancelCallback,hI=Ln.unstable_shouldYield,mI=Ln.unstable_requestPaint,wt=Ln.unstable_now,gI=Ln.unstable_getCurrentPriorityLevel,iy=Ln.unstable_ImmediatePriority,MS=Ln.unstable_UserBlockingPriority,Ld=Ln.unstable_NormalPriority,yI=Ln.unstable_LowPriority,DS=Ln.unstable_IdlePriority,Tf=null,Fr=null;function xI(e){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(Tf,e,void 0,(e.current.flags&128)===128)}catch{}}var fr=Math.clz32?Math.clz32:bI,wI=Math.log,vI=Math.LN2;function bI(e){return e>>>=0,e===0?32:31-(wI(e)/vI|0)|0}var ju=64,Pu=4194304;function xl(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 Od(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=xl(a):(o&=s,o!==0&&(r=xl(o)))}else s=n&~i,s!==0?r=xl(s):o!==0&&(r=xl(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-fr(t),i=1<<n,r|=e[n],t&=~i;return r}function SI(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 kI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-fr(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=SI(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function km(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function FS(){var e=ju;return ju<<=1,!(ju&4194240)&&(ju=64),e}function Xp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fr(t),e[t]=n}function NI(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-fr(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function oy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-fr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qe=0;function $S(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zS,sy,BS,HS,US,Nm=!1,_u=[],zi=null,Bi=null,Hi=null,Vl=new Map,Wl=new Map,Ri=[],CI="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 Pw(e,t){switch(e){case"focusin":case"focusout":zi=null;break;case"dragenter":case"dragleave":Bi=null;break;case"mouseover":case"mouseout":Hi=null;break;case"pointerover":case"pointerout":Vl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(t.pointerId)}}function tl(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=jc(t),t!==null&&sy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function EI(e,t,n,r,i){switch(t){case"focusin":return zi=tl(zi,e,t,n,r,i),!0;case"dragenter":return Bi=tl(Bi,e,t,n,r,i),!0;case"mouseover":return Hi=tl(Hi,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Vl.set(o,tl(Vl.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Wl.set(o,tl(Wl.get(o)||null,e,t,n,r,i)),!0}return!1}function VS(e){var t=jo(e.target);if(t!==null){var n=Go(t);if(n!==null){if(t=n.tag,t===13){if(t=TS(n),t!==null){e.blockedOn=t,US(e.priority,function(){BS(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 ud(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wm=r,n.target.dispatchEvent(r),wm=null}else return t=jc(n),t!==null&&sy(t),e.blockedOn=n,!1;t.shift()}return!0}function _w(e,t,n){ud(e)&&n.delete(t)}function jI(){Nm=!1,zi!==null&&ud(zi)&&(zi=null),Bi!==null&&ud(Bi)&&(Bi=null),Hi!==null&&ud(Hi)&&(Hi=null),Vl.forEach(_w),Wl.forEach(_w)}function nl(e,t){e.blockedOn===t&&(e.blockedOn=null,Nm||(Nm=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,jI)))}function Kl(e){function t(i){return nl(i,e)}if(0<_u.length){nl(_u[0],e);for(var n=1;n<_u.length;n++){var r=_u[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zi!==null&&nl(zi,e),Bi!==null&&nl(Bi,e),Hi!==null&&nl(Hi,e),Vl.forEach(t),Wl.forEach(t),n=0;n<Ri.length;n++)r=Ri[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ri.length&&(n=Ri[0],n.blockedOn===null);)VS(n),n.blockedOn===null&&Ri.shift()}var Bs=hi.ReactCurrentBatchConfig,Md=!0;function PI(e,t,n,r){var i=qe,o=Bs.transition;Bs.transition=null;try{qe=1,ay(e,t,n,r)}finally{qe=i,Bs.transition=o}}function _I(e,t,n,r){var i=qe,o=Bs.transition;Bs.transition=null;try{qe=4,ay(e,t,n,r)}finally{qe=i,Bs.transition=o}}function ay(e,t,n,r){if(Md){var i=Cm(e,t,n,r);if(i===null)sh(e,t,r,Dd,n),Pw(e,r);else if(EI(i,e,t,n,r))r.stopPropagation();else if(Pw(e,r),t&4&&-1<CI.indexOf(e)){for(;i!==null;){var o=jc(i);if(o!==null&&zS(o),o=Cm(e,t,n,r),o===null&&sh(e,t,r,Dd,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else sh(e,t,r,null,n)}}var Dd=null;function Cm(e,t,n,r){if(Dd=null,e=ry(r),e=jo(e),e!==null)if(t=Go(e),t===null)e=null;else if(n=t.tag,n===13){if(e=TS(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 Dd=e,null}function WS(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(gI()){case iy:return 1;case MS:return 4;case Ld:case yI:return 16;case DS:return 536870912;default:return 16}default:return 16}}var Mi=null,ly=null,dd=null;function KS(){if(dd)return dd;var e,t=ly,n=t.length,r,i="value"in Mi?Mi.value:Mi.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 dd=i.slice(e,1<r?1-r:void 0)}function fd(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 Iu(){return!0}function Iw(){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)?Iu:Iw,this.isPropagationStopped=Iw,this}return dt(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=Iu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Iu)},persist:function(){},isPersistent:Iu}),t}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cy=Dn(ga),Ec=dt({},ga,{view:0,detail:0}),II=Dn(Ec),Qp,Jp,rl,Rf=dt({},Ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uy,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!==rl&&(rl&&e.type==="mousemove"?(Qp=e.screenX-rl.screenX,Jp=e.screenY-rl.screenY):Jp=Qp=0,rl=e),Qp)},movementY:function(e){return"movementY"in e?e.movementY:Jp}}),Aw=Dn(Rf),AI=dt({},Rf,{dataTransfer:0}),TI=Dn(AI),RI=dt({},Ec,{relatedTarget:0}),Zp=Dn(RI),LI=dt({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),OI=Dn(LI),MI=dt({},ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DI=Dn(MI),FI=dt({},ga,{data:0}),Tw=Dn(FI),$I={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zI={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"},BI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BI[e])?!!t[e]:!1}function uy(){return HI}var UI=dt({},Ec,{key:function(e){if(e.key){var t=$I[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uy,charCode:function(e){return e.type==="keypress"?fd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VI=Dn(UI),WI=dt({},Rf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rw=Dn(WI),KI=dt({},Ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uy}),YI=Dn(KI),qI=dt({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),GI=Dn(qI),XI=dt({},Rf,{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}),QI=Dn(XI),JI=[9,13,27,32],dy=ai&&"CompositionEvent"in window,Cl=null;ai&&"documentMode"in document&&(Cl=document.documentMode);var ZI=ai&&"TextEvent"in window&&!Cl,YS=ai&&(!dy||Cl&&8<Cl&&11>=Cl),Lw=" ",Ow=!1;function qS(e,t){switch(e){case"keyup":return JI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ss=!1;function e2(e,t){switch(e){case"compositionend":return GS(t);case"keypress":return t.which!==32?null:(Ow=!0,Lw);case"textInput":return e=t.data,e===Lw&&Ow?null:e;default:return null}}function t2(e,t){if(Ss)return e==="compositionend"||!dy&&qS(e,t)?(e=KS(),dd=ly=Mi=null,Ss=!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 YS&&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 Mw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!n2[e.type]:t==="textarea"}function XS(e,t,n,r){jS(r),t=Fd(t,"onChange"),0<t.length&&(n=new cy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var El=null,Yl=null;function r2(e){ak(e,0)}function Lf(e){var t=Cs(e);if(vS(t))return e}function i2(e,t){if(e==="change")return t}var QS=!1;if(ai){var eh;if(ai){var th="oninput"in document;if(!th){var Dw=document.createElement("div");Dw.setAttribute("oninput","return;"),th=typeof Dw.oninput=="function"}eh=th}else eh=!1;QS=eh&&(!document.documentMode||9<document.documentMode)}function Fw(){El&&(El.detachEvent("onpropertychange",JS),Yl=El=null)}function JS(e){if(e.propertyName==="value"&&Lf(Yl)){var t=[];XS(t,Yl,e,ry(e)),AS(r2,t)}}function o2(e,t,n){e==="focusin"?(Fw(),El=t,Yl=n,El.attachEvent("onpropertychange",JS)):e==="focusout"&&Fw()}function s2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lf(Yl)}function a2(e,t){if(e==="click")return Lf(t)}function l2(e,t){if(e==="input"||e==="change")return Lf(t)}function c2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hr=typeof Object.is=="function"?Object.is:c2;function ql(e,t){if(hr(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(!am.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function $w(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zw(e,t){var n=$w(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=$w(n)}}function ZS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ZS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ek(){for(var e=window,t=Ad();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ad(e.document)}return t}function fy(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 u2(e){var t=ek(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ZS(n.ownerDocument.documentElement,n)){if(r!==null&&fy(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=zw(n,o);var s=zw(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 d2=ai&&"documentMode"in document&&11>=document.documentMode,ks=null,Em=null,jl=null,jm=!1;function Bw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jm||ks==null||ks!==Ad(r)||(r=ks,"selectionStart"in r&&fy(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}),jl&&ql(jl,r)||(jl=r,r=Fd(Em,"onSelect"),0<r.length&&(t=new cy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ks)))}function Au(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ns={animationend:Au("Animation","AnimationEnd"),animationiteration:Au("Animation","AnimationIteration"),animationstart:Au("Animation","AnimationStart"),transitionend:Au("Transition","TransitionEnd")},nh={},tk={};ai&&(tk=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function Of(e){if(nh[e])return nh[e];if(!Ns[e])return e;var t=Ns[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tk)return nh[e]=t[n];return e}var nk=Of("animationend"),rk=Of("animationiteration"),ik=Of("animationstart"),ok=Of("transitionend"),sk=new Map,Hw="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 io(e,t){sk.set(e,t),qo(t,[e])}for(var rh=0;rh<Hw.length;rh++){var ih=Hw[rh],f2=ih.toLowerCase(),p2=ih[0].toUpperCase()+ih.slice(1);io(f2,"on"+p2)}io(nk,"onAnimationEnd");io(rk,"onAnimationIteration");io(ik,"onAnimationStart");io("dblclick","onDoubleClick");io("focusin","onFocus");io("focusout","onBlur");io(ok,"onTransitionEnd");Gs("onMouseEnter",["mouseout","mouseover"]);Gs("onMouseLeave",["mouseout","mouseover"]);Gs("onPointerEnter",["pointerout","pointerover"]);Gs("onPointerLeave",["pointerout","pointerover"]);qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="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(" "),h2=new Set("cancel close invalid load scroll toggle".split(" ").concat(wl));function Uw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,fI(r,t,void 0,e),e.currentTarget=null}function ak(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],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;Uw(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;Uw(i,a,u),o=l}}}if(Rd)throw e=Sm,Rd=!1,Sm=null,e}function et(e,t){var n=t[Tm];n===void 0&&(n=t[Tm]=new Set);var r=e+"__bubble";n.has(r)||(lk(t,e,2,!1),n.add(r))}function oh(e,t,n){var r=0;t&&(r|=4),lk(n,e,r,t)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function Gl(e){if(!e[Tu]){e[Tu]=!0,mS.forEach(function(n){n!=="selectionchange"&&(h2.has(n)||oh(n,!1,e),oh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tu]||(t[Tu]=!0,oh("selectionchange",!1,t))}}function lk(e,t,n,r){switch(WS(t)){case 1:var i=PI;break;case 4:i=_I;break;default:i=ay}n=i.bind(null,t,n,e),i=void 0,!bm||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 sh(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 l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=jo(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}AS(function(){var u=o,f=ry(n),d=[];e:{var p=sk.get(e);if(p!==void 0){var h=cy,m=e;switch(e){case"keypress":if(fd(n)===0)break e;case"keydown":case"keyup":h=VI;break;case"focusin":m="focus",h=Zp;break;case"focusout":m="blur",h=Zp;break;case"beforeblur":case"afterblur":h=Zp;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=Aw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=TI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=YI;break;case nk:case rk:case ik:h=OI;break;case ok:h=GI;break;case"scroll":h=II;break;case"wheel":h=QI;break;case"copy":case"cut":case"paste":h=DI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Rw}var v=(t&4)!==0,k=!v&&e==="scroll",g=v?p!==null?p+"Capture":null:p;v=[];for(var w=u,y;w!==null;){y=w;var N=y.stateNode;if(y.tag===5&&N!==null&&(y=N,g!==null&&(N=Ul(w,g),N!=null&&v.push(Xl(w,N,y)))),k)break;w=w.return}0<v.length&&(p=new h(p,m,null,n,f),d.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==wm&&(m=n.relatedTarget||n.fromElement)&&(jo(m)||m[li]))break e;if((h||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?jo(m):null,m!==null&&(k=Go(m),m!==k||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(v=Aw,N="onMouseLeave",g="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rw,N="onPointerLeave",g="onPointerEnter",w="pointer"),k=h==null?p:Cs(h),y=m==null?p:Cs(m),p=new v(N,w+"leave",h,n,f),p.target=k,p.relatedTarget=y,N=null,jo(f)===u&&(v=new v(g,w+"enter",m,n,f),v.target=y,v.relatedTarget=k,N=v),k=N,h&&m)t:{for(v=h,g=m,w=0,y=v;y;y=fs(y))w++;for(y=0,N=g;N;N=fs(N))y++;for(;0<w-y;)v=fs(v),w--;for(;0<y-w;)g=fs(g),y--;for(;w--;){if(v===g||g!==null&&v===g.alternate)break t;v=fs(v),g=fs(g)}v=null}else v=null;h!==null&&Vw(d,p,h,v,!1),m!==null&&k!==null&&Vw(d,k,m,v,!0)}}e:{if(p=u?Cs(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var E=i2;else if(Mw(p))if(QS)E=l2;else{E=s2;var S=o2}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=a2);if(E&&(E=E(e,u))){XS(d,E,n,f);break e}S&&S(e,p,u),e==="focusout"&&(S=p._wrapperState)&&S.controlled&&p.type==="number"&&hm(p,"number",p.value)}switch(S=u?Cs(u):window,e){case"focusin":(Mw(S)||S.contentEditable==="true")&&(ks=S,Em=u,jl=null);break;case"focusout":jl=Em=ks=null;break;case"mousedown":jm=!0;break;case"contextmenu":case"mouseup":case"dragend":jm=!1,Bw(d,n,f);break;case"selectionchange":if(d2)break;case"keydown":case"keyup":Bw(d,n,f)}var P;if(dy)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Ss?qS(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(YS&&n.locale!=="ko"&&(Ss||T!=="onCompositionStart"?T==="onCompositionEnd"&&Ss&&(P=KS()):(Mi=f,ly="value"in Mi?Mi.value:Mi.textContent,Ss=!0)),S=Fd(u,T),0<S.length&&(T=new Tw(T,e,null,n,f),d.push({event:T,listeners:S}),P?T.data=P:(P=GS(n),P!==null&&(T.data=P)))),(P=ZI?e2(e,n):t2(e,n))&&(u=Fd(u,"onBeforeInput"),0<u.length&&(f=new Tw("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=P))}ak(d,t)})}function Xl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Ul(e,n),o!=null&&r.unshift(Xl(e,o,i)),o=Ul(e,t),o!=null&&r.push(Xl(e,o,i))),e=e.return}return r}function fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Vw(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Ul(n,o),l!=null&&s.unshift(Xl(n,l,a))):i||(l=Ul(n,o),l!=null&&s.push(Xl(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var m2=/\r\n?/g,g2=/\u0000|\uFFFD/g;function Ww(e){return(typeof e=="string"?e:""+e).replace(m2,`
|
|
38
|
-
`).replace(g2,"")}function Ru(e,t,n){if(t=Ww(t),Ww(e)!==t&&n)throw Error(re(425))}function $d(){}var Pm=null,_m=null;function Im(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 Am=typeof setTimeout=="function"?setTimeout:void 0,y2=typeof clearTimeout=="function"?clearTimeout:void 0,Kw=typeof Promise=="function"?Promise:void 0,x2=typeof queueMicrotask=="function"?queueMicrotask:typeof Kw<"u"?function(e){return Kw.resolve(null).then(e).catch(w2)}:Am;function w2(e){setTimeout(function(){throw e})}function ah(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),Kl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Kl(t)}function Ui(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 Yw(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 ya=Math.random().toString(36).slice(2),Lr="__reactFiber$"+ya,Ql="__reactProps$"+ya,li="__reactContainer$"+ya,Tm="__reactEvents$"+ya,v2="__reactListeners$"+ya,b2="__reactHandles$"+ya;function jo(e){var t=e[Lr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[li]||n[Lr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yw(e);e!==null;){if(n=e[Lr])return n;e=Yw(e)}return t}e=n,n=e.parentNode}return null}function jc(e){return e=e[Lr]||e[li],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function Mf(e){return e[Ql]||null}var Rm=[],Es=-1;function oo(e){return{current:e}}function nt(e){0>Es||(e.current=Rm[Es],Rm[Es]=null,Es--)}function Je(e,t){Es++,Rm[Es]=e.current,e.current=t}var Ji={},Jt=oo(Ji),wn=oo(!1),Do=Ji;function Xs(e,t){var n=e.type.contextTypes;if(!n)return Ji;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 zd(){nt(wn),nt(Jt)}function qw(e,t,n){if(Jt.current!==Ji)throw Error(re(168));Je(Jt,t),Je(wn,n)}function ck(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(re(108,oI(e)||"Unknown",i));return dt({},n,r)}function Bd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ji,Do=Jt.current,Je(Jt,e),Je(wn,wn.current),!0}function Gw(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=ck(e,t,Do),r.__reactInternalMemoizedMergedChildContext=e,nt(wn),nt(Jt),Je(Jt,e)):nt(wn),Je(wn,n)}var Zr=null,Df=!1,lh=!1;function uk(e){Zr===null?Zr=[e]:Zr.push(e)}function S2(e){Df=!0,uk(e)}function so(){if(!lh&&Zr!==null){lh=!0;var e=0,t=qe;try{var n=Zr;for(qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Zr=null,Df=!1}catch(i){throw Zr!==null&&(Zr=Zr.slice(e+1)),OS(iy,so),i}finally{qe=t,lh=!1}}return null}var js=[],Ps=0,Hd=null,Ud=0,Vn=[],Wn=0,Fo=null,ni=1,ri="";function ko(e,t){js[Ps++]=Ud,js[Ps++]=Hd,Hd=e,Ud=t}function dk(e,t,n){Vn[Wn++]=ni,Vn[Wn++]=ri,Vn[Wn++]=Fo,Fo=e;var r=ni;e=ri;var i=32-fr(r)-1;r&=~(1<<i),n+=1;var o=32-fr(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ni=1<<32-fr(t)+i|n<<i|r,ri=o+e}else ni=1<<o|n<<i|r,ri=e}function py(e){e.return!==null&&(ko(e,1),dk(e,1,0))}function hy(e){for(;e===Hd;)Hd=js[--Ps],js[Ps]=null,Ud=js[--Ps],js[Ps]=null;for(;e===Fo;)Fo=Vn[--Wn],Vn[Wn]=null,ri=Vn[--Wn],Vn[Wn]=null,ni=Vn[--Wn],Vn[Wn]=null}var Tn=null,In=null,ot=!1,ar=null;function fk(e,t){var n=qn(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 Xw(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=Ui(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=Fo!==null?{id:ni,overflow:ri}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Tn=e,In=null,!0):!1;default:return!1}}function Lm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Om(e){if(ot){var t=In;if(t){var n=t;if(!Xw(e,t)){if(Lm(e))throw Error(re(418));t=Ui(n.nextSibling);var r=Tn;t&&Xw(e,t)?fk(r,n):(e.flags=e.flags&-4097|2,ot=!1,Tn=e)}}else{if(Lm(e))throw Error(re(418));e.flags=e.flags&-4097|2,ot=!1,Tn=e}}}function Qw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Tn=e}function Lu(e){if(e!==Tn)return!1;if(!ot)return Qw(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Im(e.type,e.memoizedProps)),t&&(t=In)){if(Lm(e))throw pk(),Error(re(418));for(;t;)fk(e,t),t=Ui(t.nextSibling)}if(Qw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){In=Ui(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}In=null}}else In=Tn?Ui(e.stateNode.nextSibling):null;return!0}function pk(){for(var e=In;e;)e=Ui(e.nextSibling)}function Qs(){In=Tn=null,ot=!1}function my(e){ar===null?ar=[e]:ar.push(e)}var k2=hi.ReactCurrentBatchConfig;function il(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(re(309));var r=n.stateNode}if(!r)throw Error(re(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(re(284));if(!n._owner)throw Error(re(290,e))}return e}function Ou(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Jw(e){var t=e._init;return t(e._payload)}function hk(e){function t(g,w){if(e){var y=g.deletions;y===null?(g.deletions=[w],g.flags|=16):y.push(w)}}function n(g,w){if(!e)return null;for(;w!==null;)t(g,w),w=w.sibling;return null}function r(g,w){for(g=new Map;w!==null;)w.key!==null?g.set(w.key,w):g.set(w.index,w),w=w.sibling;return g}function i(g,w){return g=Yi(g,w),g.index=0,g.sibling=null,g}function o(g,w,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<w?(g.flags|=2,w):y):(g.flags|=2,w)):(g.flags|=1048576,w)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,w,y,N){return w===null||w.tag!==6?(w=mh(y,g.mode,N),w.return=g,w):(w=i(w,y),w.return=g,w)}function l(g,w,y,N){var E=y.type;return E===bs?f(g,w,y.props.children,N,y.key):w!==null&&(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&Jw(E)===w.type)?(N=i(w,y.props),N.ref=il(g,w,y),N.return=g,N):(N=wd(y.type,y.key,y.props,null,g.mode,N),N.ref=il(g,w,y),N.return=g,N)}function u(g,w,y,N){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=gh(y,g.mode,N),w.return=g,w):(w=i(w,y.children||[]),w.return=g,w)}function f(g,w,y,N,E){return w===null||w.tag!==7?(w=To(y,g.mode,N,E),w.return=g,w):(w=i(w,y),w.return=g,w)}function d(g,w,y){if(typeof w=="string"&&w!==""||typeof w=="number")return w=mh(""+w,g.mode,y),w.return=g,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Nu:return y=wd(w.type,w.key,w.props,null,g.mode,y),y.ref=il(g,null,w),y.return=g,y;case vs:return w=gh(w,g.mode,y),w.return=g,w;case Ii:var N=w._init;return d(g,N(w._payload),y)}if(yl(w)||Za(w))return w=To(w,g.mode,y,null),w.return=g,w;Ou(g,w)}return null}function p(g,w,y,N){var E=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:a(g,w,""+y,N);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Nu:return y.key===E?l(g,w,y,N):null;case vs:return y.key===E?u(g,w,y,N):null;case Ii:return E=y._init,p(g,w,E(y._payload),N)}if(yl(y)||Za(y))return E!==null?null:f(g,w,y,N,null);Ou(g,y)}return null}function h(g,w,y,N,E){if(typeof N=="string"&&N!==""||typeof N=="number")return g=g.get(y)||null,a(w,g,""+N,E);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Nu:return g=g.get(N.key===null?y:N.key)||null,l(w,g,N,E);case vs:return g=g.get(N.key===null?y:N.key)||null,u(w,g,N,E);case Ii:var S=N._init;return h(g,w,y,S(N._payload),E)}if(yl(N)||Za(N))return g=g.get(y)||null,f(w,g,N,E,null);Ou(w,N)}return null}function m(g,w,y,N){for(var E=null,S=null,P=w,T=w=0,M=null;P!==null&&T<y.length;T++){P.index>T?(M=P,P=null):M=P.sibling;var B=p(g,P,y[T],N);if(B===null){P===null&&(P=M);break}e&&P&&B.alternate===null&&t(g,P),w=o(B,w,T),S===null?E=B:S.sibling=B,S=B,P=M}if(T===y.length)return n(g,P),ot&&ko(g,T),E;if(P===null){for(;T<y.length;T++)P=d(g,y[T],N),P!==null&&(w=o(P,w,T),S===null?E=P:S.sibling=P,S=P);return ot&&ko(g,T),E}for(P=r(g,P);T<y.length;T++)M=h(P,g,T,y[T],N),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?T:M.key),w=o(M,w,T),S===null?E=M:S.sibling=M,S=M);return e&&P.forEach(function(A){return t(g,A)}),ot&&ko(g,T),E}function v(g,w,y,N){var E=Za(y);if(typeof E!="function")throw Error(re(150));if(y=E.call(y),y==null)throw Error(re(151));for(var S=E=null,P=w,T=w=0,M=null,B=y.next();P!==null&&!B.done;T++,B=y.next()){P.index>T?(M=P,P=null):M=P.sibling;var A=p(g,P,B.value,N);if(A===null){P===null&&(P=M);break}e&&P&&A.alternate===null&&t(g,P),w=o(A,w,T),S===null?E=A:S.sibling=A,S=A,P=M}if(B.done)return n(g,P),ot&&ko(g,T),E;if(P===null){for(;!B.done;T++,B=y.next())B=d(g,B.value,N),B!==null&&(w=o(B,w,T),S===null?E=B:S.sibling=B,S=B);return ot&&ko(g,T),E}for(P=r(g,P);!B.done;T++,B=y.next())B=h(P,g,T,B.value,N),B!==null&&(e&&B.alternate!==null&&P.delete(B.key===null?T:B.key),w=o(B,w,T),S===null?E=B:S.sibling=B,S=B);return e&&P.forEach(function(R){return t(g,R)}),ot&&ko(g,T),E}function k(g,w,y,N){if(typeof y=="object"&&y!==null&&y.type===bs&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Nu:e:{for(var E=y.key,S=w;S!==null;){if(S.key===E){if(E=y.type,E===bs){if(S.tag===7){n(g,S.sibling),w=i(S,y.props.children),w.return=g,g=w;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&Jw(E)===S.type){n(g,S.sibling),w=i(S,y.props),w.ref=il(g,S,y),w.return=g,g=w;break e}n(g,S);break}else t(g,S);S=S.sibling}y.type===bs?(w=To(y.props.children,g.mode,N,y.key),w.return=g,g=w):(N=wd(y.type,y.key,y.props,null,g.mode,N),N.ref=il(g,w,y),N.return=g,g=N)}return s(g);case vs:e:{for(S=y.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(g,w.sibling),w=i(w,y.children||[]),w.return=g,g=w;break e}else{n(g,w);break}else t(g,w);w=w.sibling}w=gh(y,g.mode,N),w.return=g,g=w}return s(g);case Ii:return S=y._init,k(g,w,S(y._payload),N)}if(yl(y))return m(g,w,y,N);if(Za(y))return v(g,w,y,N);Ou(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,w!==null&&w.tag===6?(n(g,w.sibling),w=i(w,y),w.return=g,g=w):(n(g,w),w=mh(y,g.mode,N),w.return=g,g=w),s(g)):n(g,w)}return k}var Js=hk(!0),mk=hk(!1),Vd=oo(null),Wd=null,_s=null,gy=null;function yy(){gy=_s=Wd=null}function xy(e){var t=Vd.current;nt(Vd),e._currentValue=t}function Mm(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 Hs(e,t){Wd=e,gy=_s=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mn=!0),e.firstContext=null)}function Xn(e){var t=e._currentValue;if(gy!==e)if(e={context:e,memoizedValue:t,next:null},_s===null){if(Wd===null)throw Error(re(308));_s=e,Wd.dependencies={lanes:0,firstContext:e}}else _s=_s.next=e;return t}var Po=null;function wy(e){Po===null?Po=[e]:Po.push(e)}function gk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,wy(t)):(n.next=i.next,i.next=n),t.interleaved=n,ci(e,r)}function ci(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 Ai=!1;function vy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yk(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 si(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Be&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ci(e,n)}return i=r.interleaved,i===null?(t.next=t,wy(r)):(t.next=i.next,i.next=t),r.interleaved=t,ci(e,n)}function pd(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,oy(e,n)}}function Zw(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 Kd(e,t,n,r){var i=e.updateQueue;Ai=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,f=u=l=null,a=o;do{var p=a.lane,h=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(p=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,p=typeof m=="function"?m.call(h,d,p):m,p==null)break e;d=dt({},d,p);break e;case 2:Ai=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=h,l=d):f=f.next=h,s|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,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);zo|=s,e.lanes=s,e.memoizedState=d}}function e0(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(re(191,i));i.call(r)}}}var Pc={},$r=oo(Pc),Jl=oo(Pc),Zl=oo(Pc);function _o(e){if(e===Pc)throw Error(re(174));return e}function by(e,t){switch(Je(Zl,t),Je(Jl,e),Je($r,Pc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gm(t,e)}nt($r),Je($r,t)}function Zs(){nt($r),nt(Jl),nt(Zl)}function xk(e){_o(Zl.current);var t=_o($r.current),n=gm(t,e.type);t!==n&&(Je(Jl,e),Je($r,n))}function Sy(e){Jl.current===e&&(nt($r),nt(Jl))}var ct=oo(0);function Yd(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 ch=[];function ky(){for(var e=0;e<ch.length;e++)ch[e]._workInProgressVersionPrimary=null;ch.length=0}var hd=hi.ReactCurrentDispatcher,uh=hi.ReactCurrentBatchConfig,$o=0,ut=null,Et=null,Lt=null,qd=!1,Pl=!1,ec=0,N2=0;function qt(){throw Error(re(321))}function Ny(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function Cy(e,t,n,r,i,o){if($o=o,ut=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,hd.current=e===null||e.memoizedState===null?P2:_2,e=n(r,i),Pl){o=0;do{if(Pl=!1,ec=0,25<=o)throw Error(re(301));o+=1,Lt=Et=null,t.updateQueue=null,hd.current=I2,e=n(r,i)}while(Pl)}if(hd.current=Gd,t=Et!==null&&Et.next!==null,$o=0,Lt=Et=ut=null,qd=!1,t)throw Error(re(300));return e}function Ey(){var e=ec!==0;return ec=0,e}function Ir(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ut.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Qn(){if(Et===null){var e=ut.alternate;e=e!==null?e.memoizedState:null}else e=Et.next;var t=Lt===null?ut.memoizedState:Lt.next;if(t!==null)Lt=t,Et=e;else{if(e===null)throw Error(re(310));Et=e,e={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},Lt===null?ut.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function tc(e,t){return typeof t=="function"?t(e):t}function dh(e){var t=Qn(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=Et,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,l=null,u=o;do{var f=u.lane;if(($o&f)===f)l!==null&&(l=l.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:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,ut.lanes|=f,zo|=f}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,hr(r,t.memoizedState)||(mn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,ut.lanes|=o,zo|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fh(e){var t=Qn(),n=t.queue;if(n===null)throw Error(re(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);hr(o,t.memoizedState)||(mn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function wk(){}function vk(e,t){var n=ut,r=Qn(),i=t(),o=!hr(r.memoizedState,i);if(o&&(r.memoizedState=i,mn=!0),r=r.queue,jy(kk.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Lt!==null&&Lt.memoizedState.tag&1){if(n.flags|=2048,nc(9,Sk.bind(null,n,r,i,t),void 0,null),Mt===null)throw Error(re(349));$o&30||bk(n,t,i)}return i}function bk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sk(e,t,n,r){t.value=n,t.getSnapshot=r,Nk(t)&&Ck(e)}function kk(e,t,n){return n(function(){Nk(t)&&Ck(e)})}function Nk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hr(e,n)}catch{return!0}}function Ck(e){var t=ci(e,1);t!==null&&pr(t,e,1,-1)}function t0(e){var t=Ir();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tc,lastRenderedState:e},t.queue=e,e=e.dispatch=j2.bind(null,ut,e),[t.memoizedState,e]}function nc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.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 Ek(){return Qn().memoizedState}function md(e,t,n,r){var i=Ir();ut.flags|=e,i.memoizedState=nc(1|t,n,void 0,r===void 0?null:r)}function Ff(e,t,n,r){var i=Qn();r=r===void 0?null:r;var o=void 0;if(Et!==null){var s=Et.memoizedState;if(o=s.destroy,r!==null&&Ny(r,s.deps)){i.memoizedState=nc(t,n,o,r);return}}ut.flags|=e,i.memoizedState=nc(1|t,n,o,r)}function n0(e,t){return md(8390656,8,e,t)}function jy(e,t){return Ff(2048,8,e,t)}function jk(e,t){return Ff(4,2,e,t)}function Pk(e,t){return Ff(4,4,e,t)}function _k(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 Ik(e,t,n){return n=n!=null?n.concat([e]):null,Ff(4,4,_k.bind(null,t,e),n)}function Py(){}function Ak(e,t){var n=Qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ny(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Tk(e,t){var n=Qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ny(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Rk(e,t,n){return $o&21?(hr(n,t)||(n=FS(),ut.lanes|=n,zo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,mn=!0),e.memoizedState=n)}function C2(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=uh.transition;uh.transition={};try{e(!1),t()}finally{qe=n,uh.transition=r}}function Lk(){return Qn().memoizedState}function E2(e,t,n){var r=Ki(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ok(e))Mk(t,n);else if(n=gk(e,t,n,r),n!==null){var i=sn();pr(n,e,r,i),Dk(n,t,r)}}function j2(e,t,n){var r=Ki(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ok(e))Mk(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,hr(a,s)){var l=t.interleaved;l===null?(i.next=i,wy(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=gk(e,t,i,r),n!==null&&(i=sn(),pr(n,e,r,i),Dk(n,t,r))}}function Ok(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function Mk(e,t){Pl=qd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dk(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,oy(e,n)}}var Gd={readContext:Xn,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},P2={readContext:Xn,useCallback:function(e,t){return Ir().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:n0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,md(4194308,4,_k.bind(null,t,e),n)},useLayoutEffect:function(e,t){return md(4194308,4,e,t)},useInsertionEffect:function(e,t){return md(4,2,e,t)},useMemo:function(e,t){var n=Ir();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ir();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=E2.bind(null,ut,e),[r.memoizedState,e]},useRef:function(e){var t=Ir();return e={current:e},t.memoizedState=e},useState:t0,useDebugValue:Py,useDeferredValue:function(e){return Ir().memoizedState=e},useTransition:function(){var e=t0(!1),t=e[0];return e=C2.bind(null,e[1]),Ir().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ut,i=Ir();if(ot){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Mt===null)throw Error(re(349));$o&30||bk(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,n0(kk.bind(null,r,o,e),[e]),r.flags|=2048,nc(9,Sk.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ir(),t=Mt.identifierPrefix;if(ot){var n=ri,r=ni;n=(r&~(1<<32-fr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ec++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=N2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_2={readContext:Xn,useCallback:Ak,useContext:Xn,useEffect:jy,useImperativeHandle:Ik,useInsertionEffect:jk,useLayoutEffect:Pk,useMemo:Tk,useReducer:dh,useRef:Ek,useState:function(){return dh(tc)},useDebugValue:Py,useDeferredValue:function(e){var t=Qn();return Rk(t,Et.memoizedState,e)},useTransition:function(){var e=dh(tc)[0],t=Qn().memoizedState;return[e,t]},useMutableSource:wk,useSyncExternalStore:vk,useId:Lk,unstable_isNewReconciler:!1},I2={readContext:Xn,useCallback:Ak,useContext:Xn,useEffect:jy,useImperativeHandle:Ik,useInsertionEffect:jk,useLayoutEffect:Pk,useMemo:Tk,useReducer:fh,useRef:Ek,useState:function(){return fh(tc)},useDebugValue:Py,useDeferredValue:function(e){var t=Qn();return Et===null?t.memoizedState=e:Rk(t,Et.memoizedState,e)},useTransition:function(){var e=fh(tc)[0],t=Qn().memoizedState;return[e,t]},useMutableSource:wk,useSyncExternalStore:vk,useId:Lk,unstable_isNewReconciler:!1};function ir(e,t){if(e&&e.defaultProps){t=dt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Dm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $f={isMounted:function(e){return(e=e._reactInternals)?Go(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=sn(),i=Ki(e),o=si(r,i);o.payload=t,n!=null&&(o.callback=n),t=Vi(e,o,i),t!==null&&(pr(t,e,i,r),pd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=sn(),i=Ki(e),o=si(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Vi(e,o,i),t!==null&&(pr(t,e,i,r),pd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=sn(),r=Ki(e),i=si(n,r);i.tag=2,t!=null&&(i.callback=t),t=Vi(e,i,r),t!==null&&(pr(t,e,r,n),pd(t,e,r))}};function r0(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?!ql(n,r)||!ql(i,o):!0}function Fk(e,t,n){var r=!1,i=Ji,o=t.contextType;return typeof o=="object"&&o!==null?o=Xn(o):(i=vn(t)?Do:Jt.current,r=t.contextTypes,o=(r=r!=null)?Xs(e,i):Ji),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=$f,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function i0(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&&$f.enqueueReplaceState(t,t.state,null)}function Fm(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},vy(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Xn(o):(o=vn(t)?Do:Jt.current,i.context=Xs(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Dm(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&&$f.enqueueReplaceState(i,i.state,null),Kd(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ea(e,t){try{var n="",r=t;do n+=iI(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 ph(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $m(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var A2=typeof WeakMap=="function"?WeakMap:Map;function $k(e,t,n){n=si(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Qd||(Qd=!0,Gm=r),$m(e,t)},n}function zk(e,t,n){n=si(-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(){$m(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){$m(e,t),typeof r!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function o0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new A2;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=W2.bind(null,e,t,n),t.then(e,e))}function s0(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 a0(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=si(-1,1),t.tag=2,Vi(n,t,1))),n.lanes|=1),e)}var T2=hi.ReactCurrentOwner,mn=!1;function rn(e,t,n,r){t.child=e===null?mk(t,null,n,r):Js(t,e.child,n,r)}function l0(e,t,n,r,i){n=n.render;var o=t.ref;return Hs(t,i),r=Cy(e,t,n,r,o,i),n=Ey(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&n&&py(t),t.flags|=1,rn(e,t,r,i),t.child)}function c0(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!My(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Bk(e,t,o,r,i)):(e=wd(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:ql,n(s,r)&&e.ref===t.ref)return ui(e,t,i)}return t.flags|=1,e=Yi(o,r),e.ref=t.ref,e.return=t,t.child=e}function Bk(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(ql(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,ui(e,t,i)}return zm(e,t,n,r,i)}function Hk(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},Je(As,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,Je(As,jn),jn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Je(As,jn),jn|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Je(As,jn),jn|=r;return rn(e,t,i,n),t.child}function Uk(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zm(e,t,n,r,i){var o=vn(n)?Do:Jt.current;return o=Xs(t,o),Hs(t,i),n=Cy(e,t,n,r,o,i),r=Ey(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&r&&py(t),t.flags|=1,rn(e,t,n,i),t.child)}function u0(e,t,n,r,i){if(vn(n)){var o=!0;Bd(t)}else o=!1;if(Hs(t,i),t.stateNode===null)gd(e,t),Fk(t,n,r),Fm(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Xn(u):(u=vn(n)?Do:Jt.current,u=Xs(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&i0(t,s,r,u),Ai=!1;var p=t.memoizedState;s.state=p,Kd(t,r,s,i),l=t.memoizedState,a!==r||p!==l||wn.current||Ai?(typeof f=="function"&&(Dm(t,n,f,r),l=t.memoizedState),(a=Ai||r0(t,n,a,r,p,l,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=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,yk(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ir(t.type,a),s.props=u,d=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Xn(l):(l=vn(n)?Do:Jt.current,l=Xs(t,l));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||p!==l)&&i0(t,s,r,l),Ai=!1,p=t.memoizedState,s.state=p,Kd(t,r,s,i);var m=t.memoizedState;a!==d||p!==m||wn.current||Ai?(typeof h=="function"&&(Dm(t,n,h,r),m=t.memoizedState),(u=Ai||r0(t,n,u,r,p,m,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Bm(e,t,n,r,o,i)}function Bm(e,t,n,r,i,o){Uk(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Gw(t,n,!1),ui(e,t,o);r=t.stateNode,T2.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Js(t,e.child,null,o),t.child=Js(t,null,a,o)):rn(e,t,a,o),t.memoizedState=r.state,i&&Gw(t,n,!0),t.child}function Vk(e){var t=e.stateNode;t.pendingContext?qw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qw(e,t.context,!1),by(e,t.containerInfo)}function d0(e,t,n,r,i){return Qs(),my(i),t.flags|=256,rn(e,t,n,r),t.child}var Hm={dehydrated:null,treeContext:null,retryLane:0};function Um(e){return{baseLanes:e,cachePool:null,transitions:null}}function Wk(e,t,n){var r=t.pendingProps,i=ct.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),Je(ct,i&1),e===null)return Om(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=Hf(s,r,0,null),e=To(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Um(n),t.memoizedState=Hm,e):_y(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return R2(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Yi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Yi(a,o):(o=To(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?Um(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Hm,r}return o=e.child,e=o.sibling,r=Yi(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 _y(e,t){return t=Hf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mu(e,t,n,r){return r!==null&&my(r),Js(t,e.child,null,n),e=_y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function R2(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=ph(Error(re(422))),Mu(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Hf({mode:"visible",children:r.children},i,0,null),o=To(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Js(t,e.child,null,s),t.child.memoizedState=Um(s),t.memoizedState=Hm,o);if(!(t.mode&1))return Mu(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(re(419)),r=ph(o,r,void 0),Mu(e,t,s,r)}if(a=(s&e.childLanes)!==0,mn||a){if(r=Mt,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,ci(e,i),pr(r,e,i,-1))}return Oy(),r=ph(Error(re(421))),Mu(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=K2.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,In=Ui(i.nextSibling),Tn=t,ot=!0,ar=null,e!==null&&(Vn[Wn++]=ni,Vn[Wn++]=ri,Vn[Wn++]=Fo,ni=e.id,ri=e.overflow,Fo=t),t=_y(t,r.children),t.flags|=4096,t)}function f0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Mm(e.return,t,n)}function hh(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 Kk(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(rn(e,t,r.children,n),r=ct.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&&f0(e,n,t);else if(e.tag===19)f0(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(Je(ct,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&&Yd(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hh(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&&Yd(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hh(t,!0,n,null,o);break;case"together":hh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ui(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),zo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function L2(e,t,n){switch(t.tag){case 3:Vk(t),Qs();break;case 5:xk(t);break;case 1:vn(t.type)&&Bd(t);break;case 4:by(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Je(Vd,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Je(ct,ct.current&1),t.flags|=128,null):n&t.child.childLanes?Wk(e,t,n):(Je(ct,ct.current&1),e=ui(e,t,n),e!==null?e.sibling:null);Je(ct,ct.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kk(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(ct,ct.current),r)break;return null;case 22:case 23:return t.lanes=0,Hk(e,t,n)}return ui(e,t,n)}var Yk,Vm,qk,Gk;Yk=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}};Vm=function(){};qk=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_o($r.current);var o=null;switch(n){case"input":i=fm(e,i),r=fm(e,r),o=[];break;case"select":i=dt({},i,{value:void 0}),r=dt({},r,{value:void 0}),o=[];break;case"textarea":i=mm(e,i),r=mm(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=$d)}ym(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"&&(Bl.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&et("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};Gk=function(e,t,n,r){n!==r&&(t.flags|=4)};function ol(e,t){if(!ot)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 Gt(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 O2(e,t,n){var r=t.pendingProps;switch(hy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return vn(t.type)&&zd(),Gt(t),null;case 3:return r=t.stateNode,Zs(),nt(wn),nt(Jt),ky(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Lu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ar!==null&&(Jm(ar),ar=null))),Vm(e,t),Gt(t),null;case 5:Sy(t);var i=_o(Zl.current);if(n=t.type,e!==null&&t.stateNode!=null)qk(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(re(166));return Gt(t),null}if(e=_o($r.current),Lu(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Lr]=t,r[Ql]=o,e=(t.mode&1)!==0,n){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(i=0;i<wl.length;i++)et(wl[i],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":bw(r,o),et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},et("invalid",r);break;case"textarea":kw(r,o),et("invalid",r)}ym(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&&Ru(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Ru(r.textContent,a,e),i=["children",""+a]):Bl.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&et("scroll",r)}switch(n){case"input":Cu(r),Sw(r,o,!0);break;case"textarea":Cu(r),Nw(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=$d)}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=kS(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[Lr]=t,e[Ql]=r,Yk(e,t,!1,!1),t.stateNode=e;e:{switch(s=xm(n,r),n){case"dialog":et("cancel",e),et("close",e),i=r;break;case"iframe":case"object":case"embed":et("load",e),i=r;break;case"video":case"audio":for(i=0;i<wl.length;i++)et(wl[i],e);i=r;break;case"source":et("error",e),i=r;break;case"img":case"image":case"link":et("error",e),et("load",e),i=r;break;case"details":et("toggle",e),i=r;break;case"input":bw(e,r),i=fm(e,r),et("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dt({},r,{value:void 0}),et("invalid",e);break;case"textarea":kw(e,r),i=mm(e,r),et("invalid",e);break;default:i=r}ym(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?ES(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&NS(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Hl(e,l):typeof l=="number"&&Hl(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Bl.hasOwnProperty(o)?l!=null&&o==="onScroll"&&et("scroll",e):l!=null&&Zg(e,o,l,s))}switch(n){case"input":Cu(e),Sw(e,r,!1);break;case"textarea":Cu(e),Nw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Qi(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Fs(e,!!r.multiple,o,!1):r.defaultValue!=null&&Fs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=$d)}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 Gt(t),null;case 6:if(e&&t.stateNode!=null)Gk(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=_o(Zl.current),_o($r.current),Lu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Lr]=t,(o=r.nodeValue!==n)&&(e=Tn,e!==null))switch(e.tag){case 3:Ru(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ru(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lr]=t,t.stateNode=r}return Gt(t),null;case 13:if(nt(ct),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&In!==null&&t.mode&1&&!(t.flags&128))pk(),Qs(),t.flags|=98560,o=!1;else if(o=Lu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(re(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(re(317));o[Lr]=t}else Qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gt(t),o=!1}else ar!==null&&(Jm(ar),ar=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||ct.current&1?Pt===0&&(Pt=3):Oy())),t.updateQueue!==null&&(t.flags|=4),Gt(t),null);case 4:return Zs(),Vm(e,t),e===null&&Gl(t.stateNode.containerInfo),Gt(t),null;case 10:return xy(t.type._context),Gt(t),null;case 17:return vn(t.type)&&zd(),Gt(t),null;case 19:if(nt(ct),o=t.memoizedState,o===null)return Gt(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)ol(o,!1);else{if(Pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Yd(e),s!==null){for(t.flags|=128,ol(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 Je(ct,ct.current&1|2),t.child}e=e.sibling}o.tail!==null&&wt()>ta&&(t.flags|=128,r=!0,ol(o,!1),t.lanes=4194304)}else{if(!r)if(e=Yd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ol(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ot)return Gt(t),null}else 2*wt()-o.renderingStartTime>ta&&n!==1073741824&&(t.flags|=128,r=!0,ol(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=wt(),t.sibling=null,n=ct.current,Je(ct,r?n&1|2:n&1),t):(Gt(t),null);case 22:case 23:return Ly(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jn&1073741824&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function M2(e,t){switch(hy(t),t.tag){case 1:return vn(t.type)&&zd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zs(),nt(wn),nt(Jt),ky(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sy(t),null;case 13:if(nt(ct),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(ct),null;case 4:return Zs(),null;case 10:return xy(t.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var Du=!1,Xt=!1,D2=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Is(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ht(e,t,r)}else n.current=null}function Wm(e,t,n){try{n()}catch(r){ht(e,t,r)}}var p0=!1;function F2(e,t){if(Pm=Md,e=ek(),fy(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,l=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===i&&(a=s),p===o&&++f===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_m={focusedElem:e,selectionRange:n},Md=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;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 v=m.memoizedProps,k=m.memoizedState,g=t.stateNode,w=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:ir(t.type,v),k);g.__reactInternalSnapshotBeforeUpdate=w}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(re(163))}}catch(N){ht(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return m=p0,p0=!1,m}function _l(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&&Wm(t,n,o)}i=i.next}while(i!==r)}}function zf(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 Km(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 Xk(e){var t=e.alternate;t!==null&&(e.alternate=null,Xk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lr],delete t[Ql],delete t[Tm],delete t[v2],delete t[b2])),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 Qk(e){return e.tag===5||e.tag===3||e.tag===4}function h0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qk(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 Ym(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=$d));else if(r!==4&&(e=e.child,e!==null))for(Ym(e,t,n),e=e.sibling;e!==null;)Ym(e,t,n),e=e.sibling}function qm(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(qm(e,t,n),e=e.sibling;e!==null;)qm(e,t,n),e=e.sibling}var $t=null,or=!1;function Ci(e,t,n){for(n=n.child;n!==null;)Jk(e,t,n),n=n.sibling}function Jk(e,t,n){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Tf,n)}catch{}switch(n.tag){case 5:Xt||Is(n,t);case 6:var r=$t,i=or;$t=null,Ci(e,t,n),$t=r,or=i,$t!==null&&(or?(e=$t,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$t.removeChild(n.stateNode));break;case 18:$t!==null&&(or?(e=$t,n=n.stateNode,e.nodeType===8?ah(e.parentNode,n):e.nodeType===1&&ah(e,n),Kl(e)):ah($t,n.stateNode));break;case 4:r=$t,i=or,$t=n.stateNode.containerInfo,or=!0,Ci(e,t,n),$t=r,or=i;break;case 0:case 11:case 14:case 15:if(!Xt&&(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)&&Wm(n,t,s),i=i.next}while(i!==r)}Ci(e,t,n);break;case 1:if(!Xt&&(Is(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ht(n,t,a)}Ci(e,t,n);break;case 21:Ci(e,t,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,Ci(e,t,n),Xt=r):Ci(e,t,n);break;default:Ci(e,t,n)}}function m0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new D2),t.forEach(function(r){var i=Y2.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function nr(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:$t=a.stateNode,or=!1;break e;case 3:$t=a.stateNode.containerInfo,or=!0;break e;case 4:$t=a.stateNode.containerInfo,or=!0;break e}a=a.return}if($t===null)throw Error(re(160));Jk(o,s,i),$t=null,or=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){ht(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Zk(t,e),t=t.sibling}function Zk(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nr(t,e),_r(e),r&4){try{_l(3,e,e.return),zf(3,e)}catch(v){ht(e,e.return,v)}try{_l(5,e,e.return)}catch(v){ht(e,e.return,v)}}break;case 1:nr(t,e),_r(e),r&512&&n!==null&&Is(n,n.return);break;case 5:if(nr(t,e),_r(e),r&512&&n!==null&&Is(n,n.return),e.flags&32){var i=e.stateNode;try{Hl(i,"")}catch(v){ht(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&bS(i,o),xm(a,s);var u=xm(a,o);for(s=0;s<l.length;s+=2){var f=l[s],d=l[s+1];f==="style"?ES(i,d):f==="dangerouslySetInnerHTML"?NS(i,d):f==="children"?Hl(i,d):Zg(i,f,d,u)}switch(a){case"input":pm(i,o);break;case"textarea":SS(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Fs(i,!!o.multiple,h,!1):p!==!!o.multiple&&(o.defaultValue!=null?Fs(i,!!o.multiple,o.defaultValue,!0):Fs(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ql]=o}catch(v){ht(e,e.return,v)}}break;case 6:if(nr(t,e),_r(e),r&4){if(e.stateNode===null)throw Error(re(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){ht(e,e.return,v)}}break;case 3:if(nr(t,e),_r(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(v){ht(e,e.return,v)}break;case 4:nr(t,e),_r(e);break;case 13:nr(t,e),_r(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Ty=wt())),r&4&&m0(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Xt=(u=Xt)||f,nr(t,e),Xt=u):nr(t,e),_r(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(fe=e,f=e.child;f!==null;){for(d=fe=f;fe!==null;){switch(p=fe,h=p.child,p.tag){case 0:case 11:case 14:case 15:_l(4,p,p.return);break;case 1:Is(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){ht(r,n,v)}}break;case 5:Is(p,p.return);break;case 22:if(p.memoizedState!==null){y0(d);continue}}h!==null?(h.return=p,fe=h):y0(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=CS("display",s))}catch(v){ht(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){ht(e,e.return,v)}}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;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:nr(t,e),_r(e),r&4&&m0(e);break;case 21:break;default:nr(t,e),_r(e)}}function _r(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qk(n)){var r=n;break e}n=n.return}throw Error(re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Hl(i,""),r.flags&=-33);var o=h0(e);qm(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=h0(e);Ym(e,a,s);break;default:throw Error(re(161))}}catch(l){ht(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $2(e,t,n){fe=e,eN(e)}function eN(e,t,n){for(var r=(e.mode&1)!==0;fe!==null;){var i=fe,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Du;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Xt;a=Du;var u=Xt;if(Du=s,(Xt=l)&&!u)for(fe=i;fe!==null;)s=fe,l=s.child,s.tag===22&&s.memoizedState!==null?x0(i):l!==null?(l.return=s,fe=l):x0(i);for(;o!==null;)fe=o,eN(o),o=o.sibling;fe=i,Du=a,Xt=u}g0(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,fe=o):g0(e)}}function g0(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xt||zf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ir(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&e0(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}e0(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.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 f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Kl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}Xt||t.flags&512&&Km(t)}catch(p){ht(t,t.return,p)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function y0(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function x0(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zf(4,t)}catch(l){ht(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){ht(t,i,l)}}var o=t.return;try{Km(t)}catch(l){ht(t,o,l)}break;case 5:var s=t.return;try{Km(t)}catch(l){ht(t,s,l)}}}catch(l){ht(t,t.return,l)}if(t===e){fe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,fe=a;break}fe=t.return}}var z2=Math.ceil,Xd=hi.ReactCurrentDispatcher,Iy=hi.ReactCurrentOwner,Gn=hi.ReactCurrentBatchConfig,Be=0,Mt=null,St=null,zt=0,jn=0,As=oo(0),Pt=0,rc=null,zo=0,Bf=0,Ay=0,Il=null,hn=null,Ty=0,ta=1/0,Jr=null,Qd=!1,Gm=null,Wi=null,Fu=!1,Di=null,Jd=0,Al=0,Xm=null,yd=-1,xd=0;function sn(){return Be&6?wt():yd!==-1?yd:yd=wt()}function Ki(e){return e.mode&1?Be&2&&zt!==0?zt&-zt:k2.transition!==null?(xd===0&&(xd=FS()),xd):(e=qe,e!==0||(e=window.event,e=e===void 0?16:WS(e.type)),e):1}function pr(e,t,n,r){if(50<Al)throw Al=0,Xm=null,Error(re(185));Cc(e,n,r),(!(Be&2)||e!==Mt)&&(e===Mt&&(!(Be&2)&&(Bf|=n),Pt===4&&Li(e,zt)),bn(e,r),n===1&&Be===0&&!(t.mode&1)&&(ta=wt()+500,Df&&so()))}function bn(e,t){var n=e.callbackNode;kI(e,t);var r=Od(e,e===Mt?zt:0);if(r===0)n!==null&&jw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&jw(n),t===1)e.tag===0?S2(w0.bind(null,e)):uk(w0.bind(null,e)),x2(function(){!(Be&6)&&so()}),n=null;else{switch($S(r)){case 1:n=iy;break;case 4:n=MS;break;case 16:n=Ld;break;case 536870912:n=DS;break;default:n=Ld}n=lN(n,tN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tN(e,t){if(yd=-1,xd=0,Be&6)throw Error(re(327));var n=e.callbackNode;if(Us()&&e.callbackNode!==n)return null;var r=Od(e,e===Mt?zt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Zd(e,r);else{t=r;var i=Be;Be|=2;var o=rN();(Mt!==e||zt!==t)&&(Jr=null,ta=wt()+500,Ao(e,t));do try{U2();break}catch(a){nN(e,a)}while(!0);yy(),Xd.current=o,Be=i,St!==null?t=0:(Mt=null,zt=0,t=Pt)}if(t!==0){if(t===2&&(i=km(e),i!==0&&(r=i,t=Qm(e,i))),t===1)throw n=rc,Ao(e,0),Li(e,r),bn(e,wt()),n;if(t===6)Li(e,r);else{if(i=e.current.alternate,!(r&30)&&!B2(i)&&(t=Zd(e,r),t===2&&(o=km(e),o!==0&&(r=o,t=Qm(e,o))),t===1))throw n=rc,Ao(e,0),Li(e,r),bn(e,wt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:No(e,hn,Jr);break;case 3:if(Li(e,r),(r&130023424)===r&&(t=Ty+500-wt(),10<t)){if(Od(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){sn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Am(No.bind(null,e,hn,Jr),t);break}No(e,hn,Jr);break;case 4:if(Li(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-fr(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*z2(r/1960))-r,10<r){e.timeoutHandle=Am(No.bind(null,e,hn,Jr),r);break}No(e,hn,Jr);break;case 5:No(e,hn,Jr);break;default:throw Error(re(329))}}}return bn(e,wt()),e.callbackNode===n?tN.bind(null,e):null}function Qm(e,t){var n=Il;return e.current.memoizedState.isDehydrated&&(Ao(e,t).flags|=256),e=Zd(e,t),e!==2&&(t=hn,hn=n,t!==null&&Jm(t)),e}function Jm(e){hn===null?hn=e:hn.push.apply(hn,e)}function B2(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(!hr(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 Li(e,t){for(t&=~Ay,t&=~Bf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-fr(t),r=1<<n;e[n]=-1,t&=~r}}function w0(e){if(Be&6)throw Error(re(327));Us();var t=Od(e,0);if(!(t&1))return bn(e,wt()),null;var n=Zd(e,t);if(e.tag!==0&&n===2){var r=km(e);r!==0&&(t=r,n=Qm(e,r))}if(n===1)throw n=rc,Ao(e,0),Li(e,t),bn(e,wt()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,No(e,hn,Jr),bn(e,wt()),null}function Ry(e,t){var n=Be;Be|=1;try{return e(t)}finally{Be=n,Be===0&&(ta=wt()+500,Df&&so())}}function Bo(e){Di!==null&&Di.tag===0&&!(Be&6)&&Us();var t=Be;Be|=1;var n=Gn.transition,r=qe;try{if(Gn.transition=null,qe=1,e)return e()}finally{qe=r,Gn.transition=n,Be=t,!(Be&6)&&so()}}function Ly(){jn=As.current,nt(As)}function Ao(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,y2(n)),St!==null)for(n=St.return;n!==null;){var r=n;switch(hy(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zd();break;case 3:Zs(),nt(wn),nt(Jt),ky();break;case 5:Sy(r);break;case 4:Zs();break;case 13:nt(ct);break;case 19:nt(ct);break;case 10:xy(r.type._context);break;case 22:case 23:Ly()}n=n.return}if(Mt=e,St=e=Yi(e.current,null),zt=jn=t,Pt=0,rc=null,Ay=Bf=zo=0,hn=Il=null,Po!==null){for(t=0;t<Po.length;t++)if(n=Po[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}Po=null}return e}function nN(e,t){do{var n=St;try{if(yy(),hd.current=Gd,qd){for(var r=ut.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}qd=!1}if($o=0,Lt=Et=ut=null,Pl=!1,ec=0,Iy.current=null,n===null||n.return===null){Pt=1,rc=t,St=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=zt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=a,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=s0(s);if(h!==null){h.flags&=-257,a0(h,s,a,o,t),h.mode&1&&o0(o,u,t),t=h,l=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){o0(o,u,t),Oy();break e}l=Error(re(426))}}else if(ot&&a.mode&1){var k=s0(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),a0(k,s,a,o,t),my(ea(l,a));break e}}o=l=ea(l,a),Pt!==4&&(Pt=2),Il===null?Il=[o]:Il.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=$k(o,l,t);Zw(o,g);break e;case 1:a=l;var w=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof w.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Wi===null||!Wi.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var N=zk(o,a,t);Zw(o,N);break e}}o=o.return}while(o!==null)}oN(n)}catch(E){t=E,St===n&&n!==null&&(St=n=n.return);continue}break}while(!0)}function rN(){var e=Xd.current;return Xd.current=Gd,e===null?Gd:e}function Oy(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Mt===null||!(zo&268435455)&&!(Bf&268435455)||Li(Mt,zt)}function Zd(e,t){var n=Be;Be|=2;var r=rN();(Mt!==e||zt!==t)&&(Jr=null,Ao(e,t));do try{H2();break}catch(i){nN(e,i)}while(!0);if(yy(),Be=n,Xd.current=r,St!==null)throw Error(re(261));return Mt=null,zt=0,Pt}function H2(){for(;St!==null;)iN(St)}function U2(){for(;St!==null&&!hI();)iN(St)}function iN(e){var t=aN(e.alternate,e,jn);e.memoizedProps=e.pendingProps,t===null?oN(e):St=t,Iy.current=null}function oN(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=M2(n,t),n!==null){n.flags&=32767,St=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,St=null;return}}else if(n=O2(n,t,jn),n!==null){St=n;return}if(t=t.sibling,t!==null){St=t;return}St=t=e}while(t!==null);Pt===0&&(Pt=5)}function No(e,t,n){var r=qe,i=Gn.transition;try{Gn.transition=null,qe=1,V2(e,t,n,r)}finally{Gn.transition=i,qe=r}return null}function V2(e,t,n,r){do Us();while(Di!==null);if(Be&6)throw Error(re(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(re(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(NI(e,o),e===Mt&&(St=Mt=null,zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fu||(Fu=!0,lN(Ld,function(){return Us(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Gn.transition,Gn.transition=null;var s=qe;qe=1;var a=Be;Be|=4,Iy.current=null,F2(e,n),Zk(n,e),u2(_m),Md=!!Pm,_m=Pm=null,e.current=n,$2(n),mI(),Be=a,qe=s,Gn.transition=o}else e.current=n;if(Fu&&(Fu=!1,Di=e,Jd=i),o=e.pendingLanes,o===0&&(Wi=null),xI(n.stateNode),bn(e,wt()),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(Qd)throw Qd=!1,e=Gm,Gm=null,e;return Jd&1&&e.tag!==0&&Us(),o=e.pendingLanes,o&1?e===Xm?Al++:(Al=0,Xm=e):Al=0,so(),null}function Us(){if(Di!==null){var e=$S(Jd),t=Gn.transition,n=qe;try{if(Gn.transition=null,qe=16>e?16:e,Di===null)var r=!1;else{if(e=Di,Di=null,Jd=0,Be&6)throw Error(re(331));var i=Be;for(Be|=4,fe=e.current;fe!==null;){var o=fe,s=o.child;if(fe.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(fe=u;fe!==null;){var f=fe;switch(f.tag){case 0:case 11:case 15:_l(8,f,o)}var d=f.child;if(d!==null)d.return=f,fe=d;else for(;fe!==null;){f=fe;var p=f.sibling,h=f.return;if(Xk(f),f===u){fe=null;break}if(p!==null){p.return=h,fe=p;break}fe=h}}}var m=o.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var k=v.sibling;v.sibling=null,v=k}while(v!==null)}}fe=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,fe=s;else e:for(;fe!==null;){if(o=fe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:_l(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,fe=g;break e}fe=o.return}}var w=e.current;for(fe=w;fe!==null;){s=fe;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,fe=y;else e:for(s=w;fe!==null;){if(a=fe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:zf(9,a)}}catch(E){ht(a,a.return,E)}if(a===s){fe=null;break e}var N=a.sibling;if(N!==null){N.return=a.return,fe=N;break e}fe=a.return}}if(Be=i,so(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(Tf,e)}catch{}r=!0}return r}finally{qe=n,Gn.transition=t}}return!1}function v0(e,t,n){t=ea(n,t),t=$k(e,t,1),e=Vi(e,t,1),t=sn(),e!==null&&(Cc(e,1,t),bn(e,t))}function ht(e,t,n){if(e.tag===3)v0(e,e,n);else for(;t!==null;){if(t.tag===3){v0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wi===null||!Wi.has(r))){e=ea(n,e),e=zk(t,e,1),t=Vi(t,e,1),e=sn(),t!==null&&(Cc(t,1,e),bn(t,e));break}}t=t.return}}function W2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=sn(),e.pingedLanes|=e.suspendedLanes&n,Mt===e&&(zt&n)===n&&(Pt===4||Pt===3&&(zt&130023424)===zt&&500>wt()-Ty?Ao(e,0):Ay|=n),bn(e,t)}function sN(e,t){t===0&&(e.mode&1?(t=Pu,Pu<<=1,!(Pu&130023424)&&(Pu=4194304)):t=1);var n=sn();e=ci(e,t),e!==null&&(Cc(e,t,n),bn(e,n))}function K2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sN(e,n)}function Y2(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(re(314))}r!==null&&r.delete(t),sN(e,n)}var aN;aN=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,L2(e,t,n);mn=!!(e.flags&131072)}else mn=!1,ot&&t.flags&1048576&&dk(t,Ud,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;gd(e,t),e=t.pendingProps;var i=Xs(t,Jt.current);Hs(t,n),i=Cy(null,t,r,e,i,n);var o=Ey();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,Bd(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,vy(t),i.updater=$f,t.stateNode=i,i._reactInternals=t,Fm(t,r,e,n),t=Bm(null,t,r,!0,o,n)):(t.tag=0,ot&&o&&py(t),rn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(gd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=G2(r),e=ir(r,e),i){case 0:t=zm(null,t,r,e,n);break e;case 1:t=u0(null,t,r,e,n);break e;case 11:t=l0(null,t,r,e,n);break e;case 14:t=c0(null,t,r,ir(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),zm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),u0(e,t,r,i,n);case 3:e:{if(Vk(t),e===null)throw Error(re(387));r=t.pendingProps,o=t.memoizedState,i=o.element,yk(e,t),Kd(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=ea(Error(re(423)),t),t=d0(e,t,r,n,i);break e}else if(r!==i){i=ea(Error(re(424)),t),t=d0(e,t,r,n,i);break e}else for(In=Ui(t.stateNode.containerInfo.firstChild),Tn=t,ot=!0,ar=null,n=mk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qs(),r===i){t=ui(e,t,n);break e}rn(e,t,r,n)}t=t.child}return t;case 5:return xk(t),e===null&&Om(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Im(r,i)?s=null:o!==null&&Im(r,o)&&(t.flags|=32),Uk(e,t),rn(e,t,s,n),t.child;case 6:return e===null&&Om(t),null;case 13:return Wk(e,t,n);case 4:return by(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Js(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:ir(r,i),l0(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,Je(Vd,r._currentValue),r._currentValue=s,o!==null)if(hr(o.value,s)){if(o.children===i.children&&!wn.current){t=ui(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 l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=si(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Mm(o.return,n,t),a.lanes|=n;break}l=l.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(re(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Mm(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,Hs(t,n),i=Xn(i),r=r(i),t.flags|=1,rn(e,t,r,n),t.child;case 14:return r=t.type,i=ir(r,t.pendingProps),i=ir(r.type,i),c0(e,t,r,i,n);case 15:return Bk(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),gd(e,t),t.tag=1,vn(r)?(e=!0,Bd(t)):e=!1,Hs(t,n),Fk(t,r,i),Fm(t,r,i,n),Bm(null,t,r,!0,e,n);case 19:return Kk(e,t,n);case 22:return Hk(e,t,n)}throw Error(re(156,t.tag))};function lN(e,t){return OS(e,t)}function q2(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 qn(e,t,n,r){return new q2(e,t,n,r)}function My(e){return e=e.prototype,!(!e||!e.isReactComponent)}function G2(e){if(typeof e=="function")return My(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ty)return 11;if(e===ny)return 14}return 2}function Yi(e,t){var n=e.alternate;return n===null?(n=qn(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 wd(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")My(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case bs:return To(n.children,i,o,t);case ey:s=8,i|=8;break;case lm:return e=qn(12,n,t,i|2),e.elementType=lm,e.lanes=o,e;case cm:return e=qn(13,n,t,i),e.elementType=cm,e.lanes=o,e;case um:return e=qn(19,n,t,i),e.elementType=um,e.lanes=o,e;case xS:return Hf(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gS:s=10;break e;case yS:s=9;break e;case ty:s=11;break e;case ny:s=14;break e;case Ii:s=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=qn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function To(e,t,n,r){return e=qn(7,e,r,t),e.lanes=n,e}function Hf(e,t,n,r){return e=qn(22,e,r,t),e.elementType=xS,e.lanes=n,e.stateNode={isHidden:!1},e}function mh(e,t,n){return e=qn(6,e,null,t),e.lanes=n,e}function gh(e,t,n){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function X2(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=Xp(0),this.expirationTimes=Xp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Dy(e,t,n,r,i,o,s,a,l){return e=new X2(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=qn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vy(o),e}function Q2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function cN(e){if(!e)return Ji;e=e._reactInternals;e:{if(Go(e)!==e||e.tag!==1)throw Error(re(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(re(171))}if(e.tag===1){var n=e.type;if(vn(n))return ck(e,n,t)}return t}function uN(e,t,n,r,i,o,s,a,l){return e=Dy(n,r,!0,e,i,o,s,a,l),e.context=cN(null),n=e.current,r=sn(),i=Ki(n),o=si(r,i),o.callback=t??null,Vi(n,o,i),e.current.lanes=i,Cc(e,i,r),bn(e,r),e}function Uf(e,t,n,r){var i=t.current,o=sn(),s=Ki(i);return n=cN(n),t.context===null?t.context=n:t.pendingContext=n,t=si(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vi(i,t,s),e!==null&&(pr(e,i,s,o),pd(e,i,s)),s}function ef(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 b0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fy(e,t){b0(e,t),(e=e.alternate)&&b0(e,t)}function J2(){return null}var dN=typeof reportError=="function"?reportError:function(e){console.error(e)};function $y(e){this._internalRoot=e}Vf.prototype.render=$y.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));Uf(e,t,null,null)};Vf.prototype.unmount=$y.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bo(function(){Uf(null,e,null,null)}),t[li]=null}};function Vf(e){this._internalRoot=e}Vf.prototype.unstable_scheduleHydration=function(e){if(e){var t=HS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ri.length&&t!==0&&t<Ri[n].priority;n++);Ri.splice(n,0,e),n===0&&VS(e)}};function zy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function S0(){}function Z2(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=ef(s);o.call(u)}}var s=uN(t,r,e,0,null,!1,!1,"",S0);return e._reactRootContainer=s,e[li]=s.current,Gl(e.nodeType===8?e.parentNode:e),Bo(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=ef(l);a.call(u)}}var l=Dy(e,0,!1,null,null,!1,!1,"",S0);return e._reactRootContainer=l,e[li]=l.current,Gl(e.nodeType===8?e.parentNode:e),Bo(function(){Uf(t,l,n,r)}),l}function Kf(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=ef(s);a.call(l)}}Uf(t,s,e,i)}else s=Z2(n,t,e,i,r);return ef(s)}zS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xl(t.pendingLanes);n!==0&&(oy(t,n|1),bn(t,wt()),!(Be&6)&&(ta=wt()+500,so()))}break;case 13:Bo(function(){var r=ci(e,1);if(r!==null){var i=sn();pr(r,e,1,i)}}),Fy(e,1)}};sy=function(e){if(e.tag===13){var t=ci(e,134217728);if(t!==null){var n=sn();pr(t,e,134217728,n)}Fy(e,134217728)}};BS=function(e){if(e.tag===13){var t=Ki(e),n=ci(e,t);if(n!==null){var r=sn();pr(n,e,t,r)}Fy(e,t)}};HS=function(){return qe};US=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}};vm=function(e,t,n){switch(t){case"input":if(pm(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=Mf(r);if(!i)throw Error(re(90));vS(r),pm(r,i)}}}break;case"textarea":SS(e,n);break;case"select":t=n.value,t!=null&&Fs(e,!!n.multiple,t,!1)}};_S=Ry;IS=Bo;var eA={usingClientEntryPoint:!1,Events:[jc,Cs,Mf,jS,PS,Ry]},sl={findFiberByHostInstance:jo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tA={bundleType:sl.bundleType,version:sl.version,rendererPackageName:sl.rendererPackageName,rendererConfig:sl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:hi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=RS(e),e===null?null:e.stateNode},findFiberByHostInstance:sl.findFiberByHostInstance||J2,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 $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{Tf=$u.inject(tA),Fr=$u}catch{}}Mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eA;Mn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zy(t))throw Error(re(200));return Q2(e,t,null,n)};Mn.createRoot=function(e,t){if(!zy(e))throw Error(re(299));var n=!1,r="",i=dN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Dy(e,1,!1,null,null,n,!1,r,i),e[li]=t.current,Gl(e.nodeType===8?e.parentNode:e),new $y(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(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=RS(t),e=e===null?null:e.stateNode,e};Mn.flushSync=function(e){return Bo(e)};Mn.hydrate=function(e,t,n){if(!Wf(t))throw Error(re(200));return Kf(null,e,t,!0,n)};Mn.hydrateRoot=function(e,t,n){if(!zy(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=dN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uN(t,null,e,1,n??null,i,!1,o,s),e[li]=t.current,Gl(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 Vf(t)};Mn.render=function(e,t,n){if(!Wf(t))throw Error(re(200));return Kf(null,e,t,!1,n)};Mn.unmountComponentAtNode=function(e){if(!Wf(e))throw Error(re(40));return e._reactRootContainer?(Bo(function(){Kf(null,null,e,!1,function(){e._reactRootContainer=null,e[li]=null})}),!0):!1};Mn.unstable_batchedUpdates=Ry;Mn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wf(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return Kf(e,t,n,!1,r)};Mn.version="18.3.1-next-f1338f8080-20240426";function fN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fN)}catch(e){console.error(e)}}fN(),fS.exports=Mn;var qi=fS.exports,k0=qi;sm.createRoot=k0.createRoot,sm.hydrateRoot=k0.hydrateRoot;const pN=x.createContext(null);function Zm(e){let t=e||"/";return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t||"/"}function nA(){const e=Zm(window.location.pathname);return e==="/"?(window.history.replaceState({},"","/projects"),"/projects"):e}function rA({children:e}){const[t,n]=x.useState(nA);x.useEffect(()=>{const o=()=>n(Zm(window.location.pathname));return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[]);const r=x.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 l=Zm(a.pathname),u=a.search||"";window.history.pushState({},"",l+u),n(l)},[]),i=x.useMemo(()=>({path:t,navigate:r}),[t,r]);return c.jsx(pN.Provider,{value:i,children:e})}function xa(){const e=x.useContext(pN);if(!e)throw new Error("useRoute must be used within RouteProvider");return e}function iA(){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 N0={};function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&N0[t[0]]||(typeof t[0]=="string"&&(N0[t[0]]=new Date),iA(...t))}const hN=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function C0(e,t,n){e.loadNamespaces(t,hN(e,n))}function E0(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,hN(e,r))}function oA(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,l)=>{const u=t.services.backendConnector.state[`${a}|${l}`];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 sA(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(eg("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}}):oA(e,t,n)}const aA=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,lA={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},cA=e=>lA[e],uA=e=>e.replace(aA,cA);let tg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uA};function dA(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tg={...tg,...e}}function fA(){return tg}let mN;function pA(e){mN=e}function hA(){return mN}const mA={type:"3rdParty",init(e){dA(e.options.react),pA(e)}},gA=x.createContext();class yA{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const xA=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=e},[e,t]),n.current};function rt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=x.useContext(gA)||{},o=n||r||hA();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new yA),!o){eg("You will need to pass in an i18next instance by using initReactI18next");const y=(E,S)=>typeof S=="string"?S:S&&typeof S=="object"&&typeof S.defaultValue=="string"?S.defaultValue:Array.isArray(E)?E[E.length-1]:E,N=[y,{},!1];return N.t=y,N.i18n={},N.ready=!1,N}o.options.react&&o.options.react.wait!==void 0&&eg("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...fA(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=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 f=(o.isInitialized||o.initializedStoreOnce)&&u.every(y=>sA(y,o,s));function d(){return o.getFixedT(t.lng||null,s.nsMode==="fallback"?u:u[0],l)}const[p,h]=x.useState(d);let m=u.join();t.lng&&(m=`${t.lng}${m}`);const v=xA(m),k=x.useRef(!0);x.useEffect(()=>{const{bindI18n:y,bindI18nStore:N}=s;k.current=!0,!f&&!a&&(t.lng?E0(o,t.lng,u,()=>{k.current&&h(d)}):C0(o,u,()=>{k.current&&h(d)})),f&&v&&v!==m&&k.current&&h(d);function E(){k.current&&h(d)}return y&&o&&o.on(y,E),N&&o&&o.store.on(N,E),()=>{k.current=!1,y&&o&&y.split(" ").forEach(S=>o.off(S,E)),N&&o&&N.split(" ").forEach(S=>o.store.off(S,E))}},[o,m]);const g=x.useRef(!0);x.useEffect(()=>{k.current&&!g.current&&h(d),g.current=!1},[o,l]);const w=[p,o,f];if(w.t=p,w.i18n=o,w.ready=f,f||!f&&!a)return w;throw new Promise(y=>{t.lng?E0(o,t.lng,u,()=>y()):C0(o,u,()=>y())})}const gN="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",wA=[{to:"/projects",label:"Projects",icon:"folder_open"},{to:"/settings",label:"Settings",icon:"settings"}],vA=[{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 bA(e,t){return t==="/projects"?e==="/projects"||e==="/":e===t||e.startsWith(t+"/")}function SA(){const{path:e,navigate:t}=xa(),{t:n}=rt();return c.jsxs("aside",{className:"af-sidebar","aria-label":n("flow:sidebar.mainNav"),children:[c.jsxs("div",{className:"af-brand",children:[c.jsx("div",{className:"af-brand-mark","aria-hidden":!0,children:c.jsx("img",{src:gN,alt:"",width:"36",height:"36",decoding:"async"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"af-brand-title",children:"Agentflow"}),c.jsx("p",{className:"af-brand-tag",children:"Orchestration Engine"})]})]}),c.jsx("nav",{className:"af-nav",children:wA.map(r=>c.jsxs("button",{type:"button",className:"af-nav-link"+(bA(e,r.to)?" af-nav-link--active":""),onClick:()=>t(r.to),children:[c.jsx("span",{className:"material-symbols-outlined",children:r.icon}),c.jsx("span",{children:r.label})]},r.to))}),c.jsx("div",{className:"af-sidebar-footer",children:vA.map(r=>{const i=n(r.labelKey);return c.jsx("a",{className:"af-sidebar-ext",href:r.href,target:"_blank",rel:"noopener noreferrer","aria-label":i,title:i,children:c.jsx("span",{className:"material-symbols-outlined",children:r.icon})},r.href)})})]})}const yN="agentflow.pipelineRecent",kA=50,NA=15;function CA(e){try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function xN(){if(typeof localStorage>"u")return[];const e=localStorage.getItem(yN);return e?CA(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 zu(e,t){if(typeof localStorage>"u")return;const n=Date.now(),r=xN(),o=[{flowId:e,flowSource:t,kind:"opened",at:n},...r.filter(s=>!(s.flowId===e&&s.flowSource===t))].slice(0,kA);try{localStorage.setItem(yN,JSON.stringify(o))}catch{}}function EA(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 ng(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),l=new Date,u=new Date(l);if(u.setDate(u.getDate()-1),a.toDateString()===u.toDateString())return t("flow:time.yesterday");const f=Math.floor(s/24);return f<7?t("flow:time.daysAgo",{n:f}):`${a.getMonth()+1}/${a.getDate()}`}function jA(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 PA(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:EA(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,NA)}var Pn=Uint8Array,Ts=Uint16Array,_A=Int32Array,wN=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]),vN=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]),IA=new Pn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bN=function(e,t){for(var n=new Ts(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new _A(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}},SN=bN(wN,2),kN=SN.b,AA=SN.r;kN[28]=258,AA[258]=28;var TA=bN(vN,0),RA=TA.b,rg=new Ts(32768);for(var tt=0;tt<32768;++tt){var Ei=(tt&43690)>>1|(tt&21845)<<1;Ei=(Ei&52428)>>2|(Ei&13107)<<2,Ei=(Ei&61680)>>4|(Ei&3855)<<4,rg[tt]=((Ei&65280)>>8|(Ei&255)<<8)>>1}var Tl=function(e,t,n){for(var r=e.length,i=0,o=new Ts(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Ts(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Ts(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],f=t-e[i],d=s[e[i]-1]++<<f,p=d|(1<<f)-1;d<=p;++d)a[rg[d]>>l]=u}else for(a=new Ts(r),i=0;i<r;++i)e[i]&&(a[i]=rg[s[e[i]-1]++]>>15-e[i]);return a},_c=new Pn(288);for(var tt=0;tt<144;++tt)_c[tt]=8;for(var tt=144;tt<256;++tt)_c[tt]=9;for(var tt=256;tt<280;++tt)_c[tt]=7;for(var tt=280;tt<288;++tt)_c[tt]=8;var NN=new Pn(32);for(var tt=0;tt<32;++tt)NN[tt]=5;var LA=Tl(_c,9,1),OA=Tl(NN,5,1),yh=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},rr=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},xh=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},MA=function(e){return(e+7)/8|0},By=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))},DA=["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"],Un=function(e,t,n){var r=new Error(t||DA[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Un),!n)throw r;return r},FA=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,l=t.i;s&&(n=new Pn(i*3));var u=function(ye){var ge=n.length;if(ye>ge){var xe=new Pn(Math.max(ge*2,ye));xe.set(n),n=xe}},f=t.f||0,d=t.p||0,p=t.b||0,h=t.l,m=t.d,v=t.m,k=t.n,g=i*8;do{if(!h){f=rr(e,d,1);var w=rr(e,d+1,3);if(d+=3,w)if(w==1)h=LA,m=OA,v=9,k=5;else if(w==2){var S=rr(e,d,31)+257,P=rr(e,d+10,15)+4,T=S+rr(e,d+5,31)+1;d+=14;for(var M=new Pn(T),B=new Pn(19),A=0;A<P;++A)B[IA[A]]=rr(e,d+A*3,7);d+=P*3;for(var R=yh(B),V=(1<<R)-1,L=Tl(B,R,1),A=0;A<T;){var H=L[rr(e,d,V)];d+=H&15;var y=H>>4;if(y<16)M[A++]=y;else{var D=0,$=0;for(y==16?($=3+rr(e,d,3),d+=2,D=M[A-1]):y==17?($=3+rr(e,d,7),d+=3):y==18&&($=11+rr(e,d,127),d+=7);$--;)M[A++]=D}}var _=M.subarray(0,S),I=M.subarray(S);v=yh(_),k=yh(I),h=Tl(_,v,1),m=Tl(I,k,1)}else Un(1);else{var y=MA(d)+4,N=e[y-4]|e[y-3]<<8,E=y+N;if(E>i){l&&Un(0);break}a&&u(p+N),n.set(e.subarray(y,E),p),t.b=p+=N,t.p=d=E*8,t.f=f;continue}if(d>g){l&&Un(0);break}}a&&u(p+131072);for(var C=(1<<v)-1,F=(1<<k)-1,U=d;;U=d){var D=h[xh(e,d)&C],O=D>>4;if(d+=D&15,d>g){l&&Un(0);break}if(D||Un(2),O<256)n[p++]=O;else if(O==256){U=d,h=null;break}else{var q=O-254;if(O>264){var A=O-257,ee=wN[A];q=rr(e,d,(1<<ee)-1)+kN[A],d+=ee}var ne=m[xh(e,d)&F],ae=ne>>4;ne||Un(3),d+=ne&15;var I=RA[ae];if(ae>3){var ee=vN[ae];I+=xh(e,d)&(1<<ee)-1,d+=ee}if(d>g){l&&Un(0);break}a&&u(p+131072);var J=p+q;if(p<I){var le=o-I,Se=Math.min(I,J);for(le+p<0&&Un(3);p<Se;++p)n[p]=r[le+p]}for(;p<J;++p)n[p]=n[p-I]}}t.l=h,t.p=U,t.b=p,t.f=f,h&&(f=1,t.m=v,t.d=m,t.n=k)}while(!f);return p!=n.length&&s?By(n,0,p):n.subarray(0,p)},$A=new Pn(0),Or=function(e,t){return e[t]|e[t+1]<<8},lr=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},wh=function(e,t){return lr(e,t)+lr(e,t+4)*4294967296};function zA(e,t){return FA(e,{i:2},t&&t.out,t&&t.dictionary)}var ig=typeof TextDecoder<"u"&&new TextDecoder,BA=0;try{ig.decode($A,{stream:!0}),BA=1}catch{}var HA=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:By(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 UA(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(ig)return ig.decode(e);var i=HA(e),o=i.s,n=i.r;return n.length&&Un(8),o}}var VA=function(e,t){return t+30+Or(e,t+26)+Or(e,t+28)},WA=function(e,t,n){var r=Or(e,t+28),i=UA(e.subarray(t+46,t+46+r),!(Or(e,t+8)&2048)),o=t+46+r,s=lr(e,t+20),a=n&&s==4294967295?KA(e,o):[s,lr(e,t+24),lr(e,t+42)],l=a[0],u=a[1],f=a[2];return[Or(e,t+10),l,u,i,o+Or(e,t+30)+Or(e,t+32),f]},KA=function(e,t){for(;Or(e,t)!=1;t+=4+Or(e,t+2));return[wh(e,t+12),wh(e,t+4),wh(e,t+20)]};function YA(e,t){for(var n={},r=e.length-22;lr(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Un(13);var i=Or(e,r+8);if(!i)return{};var o=lr(e,r+16),s=o==4294967295||i==65535;if(s){var a=lr(e,r-12);s=lr(e,a)==101075792,s&&(i=lr(e,a+32),o=lr(e,a+48))}for(var l=0;l<i;++l){var u=WA(e,o,s),f=u[0],d=u[1],p=u[2],h=u[3],m=u[4],v=u[5],k=VA(e,v);o=m,f?f==8?n[h]=zA(e.subarray(k,k+d),{out:new Pn(p)}):Un(14,"unknown compression type "+f):n[h]=By(e,k,k+d)}return n}const qA=8*1024*1024,GA=500;function XA(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 QA(e){return e?e.split("/").some(n=>n==="__MACOSX"||n.startsWith("._")):!0}function JA(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 ZA=/^[a-zA-Z][a-zA-Z0-9_-]*$/;async function eT(e){try{const t=new Uint8Array(await e.arrayBuffer()),n=YA(t),r=new Map;let i=0,o=0;for(const[l,u]of Object.entries(n)){if(l.endsWith("/"))continue;const f=XA(l);if(!f||QA(f))continue;const d=(u==null?void 0:u.length)??0;if(i+=d,i>qA||(o+=1,o>GA))return null;r.set(f,d)}if(r.size===0)return null;const s=new Set;for(const l of r.keys()){const u=JA(l);u!==null&&s.add(u)}if(s.size!==1)return null;const[a]=[...s];if(a==="")return null;for(const l of r.keys())if(!(l===a||l.startsWith(`${a}/`)))return null;return ZA.test(a)?a:null}catch{return null}}const vh=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tT({file:e,onClose:t,onImported:n}){const{t:r}=rt(),i=x.useId(),o=x.useRef(null),s=x.useRef(null),[a,l]=x.useState(""),[u,f]=x.useState("user"),[d,p]=x.useState(!1),[h,m]=x.useState(""),[v,k]=x.useState(null),g=v??e;x.useEffect(()=>{const E=requestAnimationFrame(()=>{var S;return(S=o.current)==null?void 0:S.focus()});return()=>cancelAnimationFrame(E)},[]),x.useEffect(()=>{let E=!1;return(async()=>{const S=g.name||"",P=S.toLowerCase();let T="";if(P.endsWith(".zip")){if(T=await eT(g)||"",!T){const M=S.replace(/\.zip$/i,"");vh.test(M)&&(T=M)}}else if(P.endsWith(".yaml")||P.endsWith(".yml")){const M=S.replace(/\.ya?ml$/i,"");vh.test(M)&&(T=M)}E||l(T)})(),()=>{E=!0}},[g]);const w=a.trim(),y=w.length>0&&vh.test(w);async function N(E){if(E.preventDefault(),!(!y||d)){p(!0),m("");try{const S=new FormData;S.set("flowId",w),S.set("targetSpace",u),S.set("file",g,g.name);const P=await fetch("/api/flows/import",{method:"POST",body:S}),T=await P.json().catch(()=>({}));if(!P.ok){m(typeof T.error=="string"?T.error:r("project:importModal.importFailed"));return}n({id:T.flowId,source:T.flowSource??"user"})}catch(S){m(String((S==null?void 0:S.message)||S))}finally{p(!1)}}}return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:c.jsxs("div",{ref:o,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onMouseDown:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:i,className:"af-shortcuts-panel__title",children:r("project:importModal.title")}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":r("project:importModal.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:N,children:[c.jsx("p",{className:"af-new-pipeline-lead",children:r("project:importModal.lead",{filename:g.name})}),c.jsx("input",{ref:s,type:"file",className:"af-import-file-input",accept:".yaml,.yml,.zip,application/zip","aria-hidden":!0,tabIndex:-1,onChange:E=>{var P;const S=(P=E.target.files)==null?void 0:P[0];S&&k(S),E.target.value=""}}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:importModal.nameLabel")}),c.jsx("input",{className:"af-new-pipeline-input",type:"text",name:"importFlowId",autoComplete:"off",spellCheck:!1,placeholder:r("project:importModal.namePlaceholder"),value:a,onChange:E=>l(E.target.value),"aria-invalid":w.length>0&&!y}),c.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-hint",children:r("project:importModal.nameHint")})]}),c.jsxs("fieldset",{className:"af-new-pipeline-fieldset",children:[c.jsx("legend",{className:"af-pipeline-drawer-label",children:r("project:importModal.locationLabel")}),c.jsxs("label",{className:"af-new-pipeline-radio",children:[c.jsx("input",{type:"radio",name:"importTargetSpace",value:"user",checked:u==="user",onChange:()=>f("user")}),c.jsx("span",{children:r("project:importModal.userDir")})]}),c.jsxs("label",{className:"af-new-pipeline-radio",children:[c.jsx("input",{type:"radio",name:"importTargetSpace",value:"workspace",checked:u==="workspace",onChange:()=>f("workspace")}),c.jsx("span",{children:r("project:importModal.workspaceDir")})]})]}),c.jsx("div",{className:"af-import-repick",children:c.jsx("button",{type:"button",className:"af-btn-secondary af-import-repick-btn",onClick:()=>{var E;return(E=s.current)==null?void 0:E.click()},children:r("project:importModal.changeFile")})}),h?c.jsx("p",{className:"af-err af-new-pipeline-err",children:h}):null,c.jsxs("div",{className:"af-new-pipeline-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:d,children:r("project:importModal.cancel")}),c.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_-]*$/,j0="af:newPipelineGuide";function rT({open:e,onClose:t,onCreated:n}){const{t:r}=rt(),i=x.useId(),o=x.useRef(null),[s,a]=x.useState(""),[l,u]=x.useState(""),[f,d]=x.useState("user"),[p,h]=x.useState(!1),[m,v]=x.useState(""),[k,g]=x.useState(!1);x.useEffect(()=>{if(!e)return;a(""),u(""),d("user"),v(""),h(!1),localStorage.getItem(j0)==="true"&&g(!0);const P=requestAnimationFrame(()=>{var T;return(T=o.current)==null?void 0:T.focus()});return()=>cancelAnimationFrame(P)},[e]);const w=()=>{localStorage.removeItem(j0),g(!1)};if(!e)return null;const y=s.trim(),N=y.length>0&&nT.test(y);async function E(S){if(S.preventDefault(),!(!N||p)){h(!0),v(""),w();try{const P=await fetch("/api/flows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:y,description:l.trim(),targetSpace:f})}),T=await P.json().catch(()=>({}));if(!P.ok){v(typeof T.error=="string"?T.error:r("project:newPipelineModal.createFailed"));return}n({id:T.flowId,source:T.flowSource??"user"})}catch(P){v(String((P==null?void 0:P.message)||P))}finally{h(!1)}}}return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:S=>{S.target===S.currentTarget&&(w(),t())},children:c.jsxs("div",{ref:o,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onMouseDown:S=>S.stopPropagation(),children:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:i,className:"af-shortcuts-panel__title",children:r("project:newPipelineModal.title")}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:()=>{w(),t()},"aria-label":r("project:newPipelineModal.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),k?c.jsx("div",{className:"af-new-pipeline-guide",children:c.jsxs("div",{className:"af-new-pipeline-guide-content",children:[c.jsx("span",{className:"material-symbols-outlined af-new-pipeline-guide-icon",children:"lightbulb"}),c.jsxs("div",{className:"af-new-pipeline-guide-text",children:[c.jsx("p",{children:c.jsx("strong",{children:r("onboarding:newPipeline.guideTitle")})}),c.jsx("p",{children:r("onboarding:newPipeline.guideDesc")})]}),c.jsx("button",{type:"button",className:"af-new-pipeline-guide-close",onClick:w,children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]})}):null,c.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:E,children:[c.jsx("p",{className:"af-new-pipeline-lead",children:r("project:newPipelineModal.lead")}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.nameLabel")}),c.jsx("input",{className:"af-new-pipeline-input",type:"text",name:"pipelineName",autoComplete:"off",spellCheck:!1,placeholder:r("project:newPipelineModal.namePlaceholder"),value:s,onChange:S=>a(S.target.value),"aria-invalid":y.length>0&&!N}),c.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-hint",children:r(k?"onboarding:newPipeline.nameHintGuide":"project:newPipelineModal.nameHint")})]}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.descLabel")}),c.jsx("textarea",{className:"af-pipeline-drawer-textarea af-new-pipeline-textarea",name:"pipelineDescription",rows:3,placeholder:r(k?"onboarding:newPipeline.descPlaceholderGuide":"project:newPipelineModal.descPlaceholder"),value:l,onChange:S=>u(S.target.value)}),k?c.jsx("span",{className:"af-pipeline-drawer-muted af-new-pipeline-guide-hint",children:r("onboarding:newPipeline.descHintGuide")}):null]}),c.jsxs("fieldset",{className:"af-new-pipeline-fieldset",children:[c.jsx("legend",{className:"af-pipeline-drawer-label",children:r("project:newPipelineModal.locationLabel")}),c.jsxs("label",{className:"af-new-pipeline-radio",children:[c.jsx("input",{type:"radio",name:"targetSpace",value:"user",checked:f==="user",onChange:()=>d("user")}),c.jsx("span",{children:r("project:newPipelineModal.userDir")})]}),c.jsxs("label",{className:"af-new-pipeline-radio",children:[c.jsx("input",{type:"radio",name:"targetSpace",value:"workspace",checked:f==="workspace",onChange:()=>d("workspace")}),c.jsx("span",{children:r("project:newPipelineModal.workspaceDir")})]})]}),m?c.jsx("p",{className:"af-err af-new-pipeline-err",children:m}):null,c.jsxs("div",{className:"af-new-pipeline-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:()=>{w(),t()},disabled:p,children:r("project:newPipelineModal.cancel")}),c.jsx("button",{type:"submit",className:"af-btn-primary",disabled:!N||p,children:r(p?"project:newPipelineModal.creating":k?"onboarding:newPipeline.createGuide":"project:newPipelineModal.createAndOpen")})]})]})]})})}function P0(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 iT(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 og(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 CN(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 oT="project:defaultCardDesc";function EN(e,t){const n=e.description!=null?String(e.description).trim():"";return n!==""?n:t(oT)}function sT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ps({children:e,className:t="",query:n}){const r=n.trim(),i=String(e);if(!r)return c.jsx("span",{className:t,children:i});const o=new RegExp(`(${sT(r)})`,"gi"),s=i.split(o);return c.jsx("span",{className:t,children:s.map((a,l)=>l%2===1?c.jsx("mark",{className:"af-search-hit",children:a},l):c.jsx("span",{children:a},l))})}function aT(e,t,n){const r=[String(e.id),EN(e,n),CN(e),og(e.source,n).label];return e.archived&&r.push(n("project:archived")),r.join(`
|
|
41
|
-
`).toLowerCase()}function lT(e,t,n){return t?aT(e,t,n).includes(t):!0}function cT(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 _0(){const{t:e}=rt(),{navigate:t,path:n}=xa(),[r,i]=x.useState("all"),[o,s]=x.useState([]),[a,l]=x.useState([]),[u,f]=x.useState(""),[d,p]=x.useState(!1),[h,m]=x.useState(!1),[v,k]=x.useState(null),[g,w]=x.useState(!1),[y,N]=x.useState(""),[E,S]=x.useState(!0),P=x.useRef(0),T=x.useRef(0),M=x.useCallback(async()=>{const F=++T.current;f("");try{const U=await fetch("/api/flows");if(F!==T.current)return;if(!U.ok)throw new Error("HTTP "+U.status);const O=await U.json();if(F!==T.current)return;s(Array.isArray(O)?O:[])}catch(U){if(F!==T.current)return;s([]),f(String(U.message||U))}try{const U=await fetch("/api/pipeline-recent-runs");if(F!==T.current)return;if(U.ok){const O=await U.json();if(F!==T.current)return;l(Array.isArray(O.runs)?O.runs:[])}else l([])}catch{if(F!==T.current)return;l([])}p(!0)},[]);x.useEffect(()=>{p(!1),M()},[M]),x.useEffect(()=>{if(n!=="/projects"&&n!=="/")return;const F=new URLSearchParams(window.location.search);let U=!1;if(F.get("tab")==="archived"&&(i("archived"),F.delete("tab"),U=!0),F.get("new")==="1"&&(m(!0),F.delete("new"),U=!0),U){const O=F.toString();window.history.replaceState({},"",O?`/projects?${O}`:"/projects")}},[n]);const B=x.useMemo(()=>PA(a,xN(),o),[a,o,n]),A=x.useMemo(()=>B.filter(F=>cT(y,F)),[B,y]),R=y.trim().toLowerCase(),V=x.useMemo(()=>r==="archived"?o.filter(F=>F.archived):o.filter(F=>!F.archived),[o,r]),L=x.useMemo(()=>V.filter(F=>lT(F,R,e)),[V,R,e]),H=F=>{const U=F.source??"user",O=new URLSearchParams({flowId:F.id,flowSource:U});F.archived&&O.set("flowArchived","1"),t(`/flow?${O.toString()}`)},D=F=>{t(`/flow?flowId=${encodeURIComponent(F.flowId)}&flowSource=${encodeURIComponent(F.flowSource)}`)},$=x.useCallback(F=>{var U,O;F.preventDefault(),F.stopPropagation(),(O=(U=F.dataTransfer)==null?void 0:U.types)!=null&&O.includes("Files")&&(P.current+=1,w(!0))},[]),_=x.useCallback(F=>{F.preventDefault(),F.stopPropagation(),P.current-=1,P.current<=0&&(P.current=0,w(!1))},[]),I=x.useCallback(F=>{F.preventDefault(),F.stopPropagation()},[]),C=x.useCallback(F=>{var q,ee;F.preventDefault(),F.stopPropagation(),P.current=0,w(!1);const U=(ee=(q=F.dataTransfer)==null?void 0:q.files)==null?void 0:ee[0];if(!U)return;const O=U.name.toLowerCase();!O.endsWith(".yaml")&&!O.endsWith(".yml")&&!O.endsWith(".zip")||k(U)},[]);return c.jsxs("div",{className:"af-projects"+(g?" af-projects--drop-target":""),onDragEnter:$,onDragLeave:_,onDragOver:I,onDrop:C,children:[c.jsxs("header",{className:"af-projects-top",children:[c.jsxs("div",{className:"af-projects-tabs",children:[c.jsx("button",{type:"button",className:r==="all"?"af-tab af-tab--active":"af-tab",onClick:()=>i("all"),children:e("project:all")}),c.jsx("button",{type:"button",className:r==="archived"?"af-tab af-tab--active":"af-tab",onClick:()=>i("archived"),children:e("project:archived")})]}),c.jsxs("div",{className:"af-projects-top-right",children:[c.jsxs("div",{className:"af-search-wrap",children:[c.jsx("span",{className:"material-symbols-outlined af-search-icon",children:"search"}),c.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:F=>N(F.target.value),onKeyDown:F=>{F.key==="Escape"&&(N(""),F.currentTarget.blur())}}),y.trim()?c.jsx("button",{type:"button",className:"af-search-clear","aria-label":"Clear search",onClick:()=>N(""),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"close"})}):null]}),c.jsx("button",{type:"button",className:"af-icon-btn"+(E?" af-icon-btn--active":""),"aria-label":e("flow:palette.toggleRecentActivity"),"aria-expanded":E,"aria-controls":"af-recent-activity-panel",onClick:()=>S(F=>!F),children:c.jsx("span",{className:"material-symbols-outlined",children:"notifications"})}),c.jsx("button",{type:"button",className:"af-btn-primary af-create-btn",onClick:()=>m(!0),children:e("project:createNew")})]})]}),c.jsxs("div",{className:"af-projects-body",children:[c.jsxs("section",{className:"af-projects-main",children:[c.jsxs("header",{className:"af-projects-section-head",children:[c.jsx("h2",{className:"af-projects-h2",children:e(r==="archived"?"project:archivedPipelines":"project:activeProjects")}),c.jsx("p",{className:"af-projects-sub",children:R?e("project:filterResult",{count:L.length}):e(r==="archived"?"project:archivedHint":"project:activeHint")}),u?c.jsx("p",{className:"af-err af-projects-api-hint",children:u}):null]}),c.jsxs("div",{className:"af-project-grid",children:[L.length>0?L.map(F=>c.jsx("button",{type:"button",className:"af-project-card",onClick:()=>H(F),children:c.jsxs("div",{className:"af-project-card-body",children:[c.jsx("span",{className:P0(og(F.source,e).tone),children:c.jsx(ps,{query:y,children:og(F.source,e).label})}),F.archived?c.jsx("span",{className:P0("muted"),children:c.jsx(ps,{query:y,children:e("project:archived")})}):null,c.jsx("h3",{className:"af-project-title",children:c.jsx(ps,{query:y,children:F.id})}),c.jsx("p",{className:"af-project-desc",children:c.jsx(ps,{query:y,children:EN(F,e)})}),c.jsxs("div",{className:"af-project-path",children:[c.jsx("span",{className:"material-symbols-outlined af-path-icon",children:"database"}),c.jsx("span",{className:"af-path-text",children:c.jsx(ps,{query:y,children:CN(F)})})]})]})},`${F.id}:${F.source??"user"}:${F.archived?"a":""}`)):d?V.length===0?c.jsxs("div",{className:"af-projects-empty-block",children:[c.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"?c.jsx("p",{className:"af-projects-empty-hint",children:e("project:emptyHint",{code1:"agentflow ui",code2:".agentflow/pipelines"})}):null]}):c.jsx("div",{className:"af-projects-empty-block",children:c.jsx("p",{className:"af-projects-empty",children:e("project:noMatch",{query:y.trim()})})}):c.jsx("div",{className:"af-projects-empty-block",children:c.jsx("p",{className:"af-projects-empty",children:e("project:loadingPipelines")})}),c.jsxs("button",{type:"button",className:"af-project-add",onClick:()=>m(!0),children:[c.jsx("span",{className:"material-symbols-outlined af-project-add-icon",children:"add_circle"}),c.jsx("span",{className:"af-project-add-label",children:e("project:newPipeline")})]}),c.jsxs("a",{className:"af-hub-card",href:"https://agentflow-hub.com",target:"_blank",rel:"noopener noreferrer",children:[c.jsx("div",{className:"af-hub-card__glow","aria-hidden":!0}),c.jsxs("span",{className:"af-hub-card__eyebrow",children:[c.jsx("span",{className:"material-symbols-outlined af-hub-card__eyebrow-icon",children:"hub"}),e("project:hubCard.eyebrow")]}),c.jsx("h3",{className:"af-hub-card__title",children:e("project:hubCard.title")}),c.jsx("p",{className:"af-hub-card__desc",children:e("project:hubCard.desc")}),c.jsxs("span",{className:"af-hub-card__cta",children:[e("project:hubCard.cta"),c.jsx("span",{className:"material-symbols-outlined af-hub-card__cta-icon",children:"arrow_outward"})]}),c.jsx("code",{className:"af-hub-card__cli",children:e("project:hubCard.cliHint")})]})]})]}),c.jsxs("aside",{id:"af-recent-activity-panel",className:"af-activity"+(E?"":" af-activity--hidden"),"aria-hidden":!E,"aria-label":e("project:recentActivity"),children:[c.jsxs("h2",{className:"af-activity-title",children:[c.jsx("span",{className:"af-activity-bullet"}),e("project:recentActivity")]}),c.jsx("div",{className:"af-activity-list",children:A.length===0?c.jsx("p",{className:"af-activity-empty",children:B.length===0?e("project:noRecentActivity"):e("project:noMatchRecent")}):A.map(F=>c.jsxs("button",{type:"button",className:"af-activity-row af-activity-row--action",onClick:()=>D(F),children:[c.jsxs("div",{className:"af-activity-row-top",children:[c.jsx("h4",{className:"af-activity-name",children:c.jsx(ps,{query:y,children:F.flowId})}),c.jsx("span",{className:"af-activity-time",children:ng(F.at,e)})]}),c.jsxs("div",{className:"af-activity-meta",children:[c.jsx("span",{className:iT(F.kind),children:F.kind==="executed"?"play_arrow":"visibility"}),c.jsxs("p",{className:"af-activity-text",children:[F.kind==="executed"?e("project:recentRun"):e("project:recentOpen")," · ",ng(F.at,e)]})]})]},`${F.kind}-${F.flowId}-${F.flowSource}-${F.at}`))})]})]}),c.jsx(rT,{open:h,onClose:()=>m(!1),onCreated:async F=>{m(!1),await M();const U=F.source??"user";t(`/flow?flowId=${encodeURIComponent(F.id)}&flowSource=${encodeURIComponent(U)}`)}}),v?c.jsx(tT,{file:v,onClose:()=>k(null),onImported:async F=>{k(null),await M();const U=F.source??"user";t(`/flow?flowId=${encodeURIComponent(F.id)}&flowSource=${encodeURIComponent(U)}`)}},`${v.name}-${v.size}-${v.lastModified}`):null]})}function Nt(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=Nt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var uT={value:()=>{}};function Yf(){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 vd(n)}function vd(e){this._=e}function dT(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}})}vd.prototype=Yf.prototype={constructor:vd,on:function(e,t){var n=this._,r=dT(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=fT(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]=I0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=I0(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 vd(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 fT(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function I0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=uT,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 A0={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 qf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),A0.hasOwnProperty(t)?{space:A0[t],local:e}:e}function pT(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 hT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jN(e){var t=qf(e);return(t.local?hT:pT)(t)}function mT(){}function Hy(e){return e==null?mT:function(){return this.querySelector(e)}}function gT(e){typeof e!="function"&&(e=Hy(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),l,u,f=0;f<s;++f)(l=o[f])&&(u=e.call(l,l.__data__,f,o))&&("__data__"in l&&(u.__data__=l.__data__),a[f]=u);return new On(r,this._parents)}function yT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xT(){return[]}function PN(e){return e==null?xT:function(){return this.querySelectorAll(e)}}function wT(e){return function(){return yT(e.apply(this,arguments))}}function vT(e){typeof e=="function"?e=wT(e):e=PN(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),i.push(l));return new On(r,i)}function _N(e){return function(){return this.matches(e)}}function IN(e){return function(t){return t.matches(e)}}var bT=Array.prototype.find;function ST(e){return function(){return bT.call(this.children,e)}}function kT(){return this.firstElementChild}function NT(e){return this.select(e==null?kT:ST(typeof e=="function"?e:IN(e)))}var CT=Array.prototype.filter;function ET(){return Array.from(this.children)}function jT(e){return function(){return CT.call(this.children,e)}}function PT(e){return this.selectAll(e==null?ET:jT(typeof e=="function"?e:IN(e)))}function _T(e){typeof e!="function"&&(e=_N(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]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new On(r,this._parents)}function AN(e){return new Array(e.length)}function IT(){return new On(this._enter||this._groups.map(AN),this._parents)}function tf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}tf.prototype={constructor:tf,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 AT(e){return function(){return e}}function TT(e,t,n,r,i,o){for(var s=0,a,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new tf(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function RT(e,t,n,r,i,o,s){var a,l,u=new Map,f=t.length,d=o.length,p=new Array(f),h;for(a=0;a<f;++a)(l=t[a])&&(p[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?i[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,o[a],a,o)+"",(l=u.get(h))?(r[a]=l,l.__data__=o[a],u.delete(h)):n[a]=new tf(e,o[a]);for(a=0;a<f;++a)(l=t[a])&&u.get(p[a])===l&&(i[a]=l)}function LT(e){return e.__data__}function OT(e,t){if(!arguments.length)return Array.from(this,LT);var n=t?RT:TT,r=this._parents,i=this._groups;typeof e!="function"&&(e=AT(e));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var f=r[u],d=i[u],p=d.length,h=MT(e.call(f,f&&f.__data__,u,r)),m=h.length,v=a[u]=new Array(m),k=s[u]=new Array(m),g=l[u]=new Array(p);n(f,d,v,k,g,h,t);for(var w=0,y=0,N,E;w<m;++w)if(N=v[w]){for(w>=y&&(y=w+1);!(E=k[y])&&++y<m;);N._next=E||null}}return s=new On(s,r),s._enter=a,s._exit=l,s}function MT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DT(){return new On(this._exit||this._groups.map(AN),this._parents)}function FT(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 $T(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),l=0;l<s;++l)for(var u=n[l],f=r[l],d=u.length,p=a[l]=new Array(d),h,m=0;m<d;++m)(h=u[m]||f[m])&&(p[m]=h);for(;l<i;++l)a[l]=n[l];return new On(a,this._parents)}function zT(){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 BT(e){e||(e=HT);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}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,l=i[o]=new Array(a),u,f=0;f<a;++f)(u=s[f])&&(l[f]=u);l.sort(t)}return new On(i,this._parents).order()}function HT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function UT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VT(){return Array.from(this)}function WT(){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 KT(){let e=0;for(const t of this)++e;return e}function YT(){return!this.node()}function qT(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 GT(e){return function(){this.removeAttribute(e)}}function XT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QT(e,t){return function(){this.setAttribute(e,t)}}function JT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ZT(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function eR(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 tR(e,t){var n=qf(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?XT:GT:typeof t=="function"?n.local?eR:ZT:n.local?JT:QT)(n,t))}function TN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nR(e){return function(){this.style.removeProperty(e)}}function rR(e,t,n){return function(){this.style.setProperty(e,t,n)}}function iR(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oR(e,t,n){return arguments.length>1?this.each((t==null?nR:typeof t=="function"?iR:rR)(e,t,n??"")):na(this.node(),e)}function na(e,t){return e.style.getPropertyValue(t)||TN(e).getComputedStyle(e,null).getPropertyValue(t)}function sR(e){return function(){delete this[e]}}function aR(e,t){return function(){this[e]=t}}function lR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cR(e,t){return arguments.length>1?this.each((t==null?sR:typeof t=="function"?lR:aR)(e,t)):this.node()[e]}function RN(e){return e.trim().split(/^|\s+/)}function Uy(e){return e.classList||new LN(e)}function LN(e){this._node=e,this._names=RN(e.getAttribute("class")||"")}LN.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 ON(e,t){for(var n=Uy(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function MN(e,t){for(var n=Uy(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uR(e){return function(){ON(this,e)}}function dR(e){return function(){MN(this,e)}}function fR(e,t){return function(){(t.apply(this,arguments)?ON:MN)(this,e)}}function pR(e,t){var n=RN(e+"");if(arguments.length<2){for(var r=Uy(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?fR:t?uR:dR)(n,t))}function hR(){this.textContent=""}function mR(e){return function(){this.textContent=e}}function gR(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yR(e){return arguments.length?this.each(e==null?hR:(typeof e=="function"?gR:mR)(e)):this.node().textContent}function xR(){this.innerHTML=""}function wR(e){return function(){this.innerHTML=e}}function vR(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bR(e){return arguments.length?this.each(e==null?xR:(typeof e=="function"?vR:wR)(e)):this.node().innerHTML}function SR(){this.nextSibling&&this.parentNode.appendChild(this)}function kR(){return this.each(SR)}function NR(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function CR(){return this.each(NR)}function ER(e){var t=typeof e=="function"?e:jN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function jR(){return null}function PR(e,t){var n=typeof e=="function"?e:jN(e),r=t==null?jR:typeof t=="function"?t:Hy(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _R(){var e=this.parentNode;e&&e.removeChild(this)}function IR(){return this.each(_R)}function AR(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TR(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function RR(e){return this.select(e?TR:AR)}function LR(e){return arguments.length?this.property("__data__",e):this.node().__data__}function OR(e){return function(t){e.call(this,t,this.__data__)}}function MR(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 DR(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 FR(e,t,n){return function(){var r=this.__on,i,o=OR(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 $R(e,t,n){var r=MR(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,f;l<u;++l)for(i=0,f=a[l];i<o;++i)if((s=r[i]).type===f.type&&s.name===f.name)return f.value}return}for(a=t?FR:DR,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function DN(e,t,n){var r=TN(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 zR(e,t){return function(){return DN(this,e,t)}}function BR(e,t){return function(){return DN(this,e,t.apply(this,arguments))}}function HR(e,t){return this.each((typeof t=="function"?BR:zR)(e,t))}function*UR(){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 FN=[null];function On(e,t){this._groups=e,this._parents=t}function Ic(){return new On([[document.documentElement]],FN)}function VR(){return this}On.prototype=Ic.prototype={constructor:On,select:gT,selectAll:vT,selectChild:NT,selectChildren:PT,filter:_T,data:OT,enter:IT,exit:DT,join:FT,merge:$T,selection:VR,order:zT,sort:BT,call:UT,nodes:VT,node:WT,size:KT,empty:YT,each:qT,attr:tR,style:oR,property:cR,classed:pR,text:yR,html:bR,raise:kR,lower:CR,append:ER,insert:PR,remove:IR,clone:RR,datum:LR,on:$R,dispatch:HR,[Symbol.iterator]:UR};function _n(e){return typeof e=="string"?new On([[document.querySelector(e)]],[document.documentElement]):new On([[e]],FN)}function WR(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=WR(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 KR={passive:!1},ic={capture:!0,passive:!1};function bh(e){e.stopImmediatePropagation()}function Vs(e){e.preventDefault(),e.stopImmediatePropagation()}function $N(e){var t=e.document.documentElement,n=_n(e).on("dragstart.drag",Vs,ic);"onselectstart"in t?n.on("selectstart.drag",Vs,ic):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function zN(e,t){var n=e.document.documentElement,r=_n(e).on("dragstart.drag",null);t&&(r.on("click.drag",Vs,ic),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 Bu=e=>()=>e;function ag(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:f}){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:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:f}})}ag.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function YR(e){return!e.ctrlKey&&!e.button}function qR(){return this.parentNode}function GR(e,t){return t??{x:e.x,y:e.y}}function XR(){return navigator.maxTouchPoints||"ontouchstart"in this}function BN(){var e=YR,t=qR,n=GR,r=XR,i={},o=Yf("start","drag","end"),s=0,a,l,u,f,d=0;function p(N){N.on("mousedown.drag",h).filter(r).on("touchstart.drag",k).on("touchmove.drag",g,KR).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(N,E){if(!(f||!e.call(this,N,E))){var S=y(this,t.call(this,N,E),N,E,"mouse");S&&(_n(N.view).on("mousemove.drag",m,ic).on("mouseup.drag",v,ic),$N(N.view),bh(N),u=!1,a=N.clientX,l=N.clientY,S("start",N))}}function m(N){if(Vs(N),!u){var E=N.clientX-a,S=N.clientY-l;u=E*E+S*S>d}i.mouse("drag",N)}function v(N){_n(N.view).on("mousemove.drag mouseup.drag",null),zN(N.view,u),Vs(N),i.mouse("end",N)}function k(N,E){if(e.call(this,N,E)){var S=N.changedTouches,P=t.call(this,N,E),T=S.length,M,B;for(M=0;M<T;++M)(B=y(this,P,N,E,S[M].identifier,S[M]))&&(bh(N),B("start",N,S[M]))}}function g(N){var E=N.changedTouches,S=E.length,P,T;for(P=0;P<S;++P)(T=i[E[P].identifier])&&(Vs(N),T("drag",N,E[P]))}function w(N){var E=N.changedTouches,S=E.length,P,T;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),P=0;P<S;++P)(T=i[E[P].identifier])&&(bh(N),T("end",N,E[P]))}function y(N,E,S,P,T,M){var B=o.copy(),A=sr(M||S,E),R,V,L;if((L=n.call(N,new ag("beforestart",{sourceEvent:S,target:p,identifier:T,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:B}),P))!=null)return R=L.x-A[0]||0,V=L.y-A[1]||0,function H(D,$,_){var I=A,C;switch(D){case"start":i[T]=H,C=s++;break;case"end":delete i[T],--s;case"drag":A=sr(_||$,E),C=s;break}B.call(D,N,new ag(D,{sourceEvent:$,subject:L,target:p,identifier:T,active:C,x:A[0]+R,y:A[1]+V,dx:A[0]-I[0],dy:A[1]-I[1],dispatch:B}),P)}}return p.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Bu(!!N),p):e},p.container=function(N){return arguments.length?(t=typeof N=="function"?N:Bu(N),p):t},p.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Bu(N),p):n},p.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:Bu(!!N),p):r},p.on=function(){var N=o.on.apply(o,arguments);return N===o?p:N},p.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,p):Math.sqrt(d)},p}function Vy(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function HN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ac(){}var oc=.7,nf=1/oc,Ws="\\s*([+-]?\\d+)\\s*",sc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",QR=/^#([0-9a-f]{3,8})$/,JR=new RegExp(`^rgb\\(${Ws},${Ws},${Ws}\\)$`),ZR=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),eL=new RegExp(`^rgba\\(${Ws},${Ws},${Ws},${sc}\\)$`),tL=new RegExp(`^rgba\\(${zr},${zr},${zr},${sc}\\)$`),nL=new RegExp(`^hsl\\(${sc},${zr},${zr}\\)$`),rL=new RegExp(`^hsla\\(${sc},${zr},${zr},${sc}\\)$`),T0={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};Vy(Ac,Ho,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:R0,formatHex:R0,formatHex8:iL,formatHsl:oL,formatRgb:L0,toString:L0});function R0(){return this.rgb().formatHex()}function iL(){return this.rgb().formatHex8()}function oL(){return UN(this).formatHsl()}function L0(){return this.rgb().formatRgb()}function Ho(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=QR.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?O0(t):n===3?new gn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hu(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=JR.exec(e))?new gn(t[1],t[2],t[3],1):(t=ZR.exec(e))?new gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eL.exec(e))?Hu(t[1],t[2],t[3],t[4]):(t=tL.exec(e))?Hu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nL.exec(e))?F0(t[1],t[2]/100,t[3]/100,1):(t=rL.exec(e))?F0(t[1],t[2]/100,t[3]/100,t[4]):T0.hasOwnProperty(e)?O0(T0[e]):e==="transparent"?new gn(NaN,NaN,NaN,0):null}function O0(e){return new gn(e>>16&255,e>>8&255,e&255,1)}function Hu(e,t,n,r){return r<=0&&(e=t=n=NaN),new gn(e,t,n,r)}function sL(e){return e instanceof Ac||(e=Ho(e)),e?(e=e.rgb(),new gn(e.r,e.g,e.b,e.opacity)):new gn}function lg(e,t,n,r){return arguments.length===1?sL(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}Vy(gn,lg,HN(Ac,{brighter(e){return e=e==null?nf:Math.pow(nf,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oc:Math.pow(oc,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gn(Ro(this.r),Ro(this.g),Ro(this.b),rf(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:M0,formatHex:M0,formatHex8:aL,formatRgb:D0,toString:D0}));function M0(){return`#${Io(this.r)}${Io(this.g)}${Io(this.b)}`}function aL(){return`#${Io(this.r)}${Io(this.g)}${Io(this.b)}${Io((isNaN(this.opacity)?1:this.opacity)*255)}`}function D0(){const e=rf(this.opacity);return`${e===1?"rgb(":"rgba("}${Ro(this.r)}, ${Ro(this.g)}, ${Ro(this.b)}${e===1?")":`, ${e})`}`}function rf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Io(e){return e=Ro(e),(e<16?"0":"")+e.toString(16)}function F0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cr(e,t,n,r)}function UN(e){if(e instanceof cr)return new cr(e.h,e.s,e.l,e.opacity);if(e instanceof Ac||(e=Ho(e)),!e)return new cr;if(e instanceof cr)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,l=(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/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new cr(s,a,l,e.opacity)}function lL(e,t,n,r){return arguments.length===1?UN(e):new cr(e,t,n,r??1)}function cr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vy(cr,lL,HN(Ac,{brighter(e){return e=e==null?nf:Math.pow(nf,e),new cr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oc:Math.pow(oc,e),new cr(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(Sh(e>=240?e-240:e+120,i,r),Sh(e,i,r),Sh(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new cr($0(this.h),Uu(this.s),Uu(this.l),rf(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=rf(this.opacity);return`${e===1?"hsl(":"hsla("}${$0(this.h)}, ${Uu(this.s)*100}%, ${Uu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $0(e){return e=(e||0)%360,e<0?e+360:e}function Uu(e){return Math.max(0,Math.min(1,e||0))}function Sh(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 Wy=e=>()=>e;function cL(e,t){return function(n){return e+n*t}}function uL(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 dL(e){return(e=+e)==1?VN:function(t,n){return n-t?uL(t,n,e):Wy(isNaN(t)?n:t)}}function VN(e,t){var n=t-e;return n?cL(e,n):Wy(isNaN(e)?t:e)}const of=function e(t){var n=dL(t);function r(i,o){var s=n((i=lg(i)).r,(o=lg(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=VN(i.opacity,o.opacity);return function(f){return i.r=s(f),i.g=a(f),i.b=l(f),i.opacity=u(f),i+""}}return r.gamma=e,r}(1);function fL(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 pL(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hL(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]=Rl(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 mL(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Tr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gL(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]=Rl(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,kh=new RegExp(cg.source,"g");function yL(e){return function(){return e}}function xL(e){return function(t){return e(t)+""}}function WN(e,t){var n=cg.lastIndex=kh.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=cg.exec(e))&&(i=kh.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,l.push({i:s,x:Tr(r,i)})),n=kh.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?xL(l[0].x):yL(t):(t=l.length,function(u){for(var f=0,d;f<t;++f)a[(d=l[f]).i]=d.x(u);return a.join("")})}function Rl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Wy(t):(n==="number"?Tr:n==="string"?(r=Ho(t))?(t=r,of):WN:t instanceof Ho?of:t instanceof Date?mL:pL(t)?fL:Array.isArray(t)?hL:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gL:Tr)(e,t)}var z0=180/Math.PI,ug={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function KN(e,t,n,r,i,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*z0,skewX:Math.atan(l)*z0,scaleX:s,scaleY:a}}var Vu;function wL(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ug:KN(t.a,t.b,t.c,t.d,t.e,t.f)}function vL(e){return e==null||(Vu||(Vu=document.createElementNS("http://www.w3.org/2000/svg","g")),Vu.setAttribute("transform",e),!(e=Vu.transform.baseVal.consolidate()))?ug:(e=e.matrix,KN(e.a,e.b,e.c,e.d,e.e,e.f))}function YN(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,f,d,p,h,m){if(u!==d||f!==p){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:Tr(u,d)},{i:v-2,x:Tr(f,p)})}else(d||p)&&h.push("translate("+d+t+p+n)}function s(u,f,d,p){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),p.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Tr(u,f)})):f&&d.push(i(d)+"rotate("+f+r)}function a(u,f,d,p){u!==f?p.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Tr(u,f)}):f&&d.push(i(d)+"skewX("+f+r)}function l(u,f,d,p,h,m){if(u!==d||f!==p){var v=h.push(i(h)+"scale(",null,",",null,")");m.push({i:v-4,x:Tr(u,d)},{i:v-2,x:Tr(f,p)})}else(d!==1||p!==1)&&h.push(i(h)+"scale("+d+","+p+")")}return function(u,f){var d=[],p=[];return u=e(u),f=e(f),o(u.translateX,u.translateY,f.translateX,f.translateY,d,p),s(u.rotate,f.rotate,d,p),a(u.skewX,f.skewX,d,p),l(u.scaleX,u.scaleY,f.scaleX,f.scaleY,d,p),u=f=null,function(h){for(var m=-1,v=p.length,k;++m<v;)d[(k=p[m]).i]=k.x(h);return d.join("")}}}var bL=YN(wL,"px, ","px)","deg)"),SL=YN(vL,", ",")",")"),kL=1e-12;function B0(e){return((e=Math.exp(e))+1/e)/2}function NL(e){return((e=Math.exp(e))-1/e)/2}function CL(e){return((e=Math.exp(2*e))-1)/(e+1)}const bd=function e(t,n,r){function i(o,s){var a=o[0],l=o[1],u=o[2],f=s[0],d=s[1],p=s[2],h=f-a,m=d-l,v=h*h+m*m,k,g;if(v<kL)g=Math.log(p/u)/t,k=function(P){return[a+P*h,l+P*m,u*Math.exp(t*P*g)]};else{var w=Math.sqrt(v),y=(p*p-u*u+r*v)/(2*u*n*w),N=(p*p-u*u-r*v)/(2*p*n*w),E=Math.log(Math.sqrt(y*y+1)-y),S=Math.log(Math.sqrt(N*N+1)-N);g=(S-E)/t,k=function(P){var T=P*g,M=B0(E),B=u/(n*w)*(M*CL(t*T+E)-NL(E));return[a+B*h,l+B*m,u*M/B0(t*T+E)]}}return k.duration=g*1e3*t/Math.SQRT2,k}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var ra=0,vl=0,al=0,qN=1e3,sf,bl,af=0,Uo=0,Gf=0,ac=typeof performance=="object"&&performance.now?performance:Date,GN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ky(){return Uo||(GN(EL),Uo=ac.now()+Gf)}function EL(){Uo=0}function lf(){this._call=this._time=this._next=null}lf.prototype=XN.prototype={constructor:lf,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ky():+n)+(t==null?0:+t),!this._next&&bl!==this&&(bl?bl._next=this:sf=this,bl=this),this._call=e,this._time=n,dg()},stop:function(){this._call&&(this._call=null,this._time=1/0,dg())}};function XN(e,t,n){var r=new lf;return r.restart(e,t,n),r}function jL(){Ky(),++ra;for(var e=sf,t;e;)(t=Uo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ra}function H0(){Uo=(af=ac.now())+Gf,ra=vl=0;try{jL()}finally{ra=0,_L(),Uo=0}}function PL(){var e=ac.now(),t=e-af;t>qN&&(Gf-=t,af=e)}function _L(){for(var e,t=sf,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:sf=n);bl=e,dg(r)}function dg(e){if(!ra){vl&&(vl=clearTimeout(vl));var t=e-Uo;t>24?(e<1/0&&(vl=setTimeout(H0,e-ac.now()-Gf)),al&&(al=clearInterval(al))):(al||(af=ac.now(),al=setInterval(PL,qN)),ra=1,GN(H0))}}function U0(e,t,n){var r=new lf;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var IL=Yf("start","end","cancel","interrupt"),AL=[],QN=0,V0=1,fg=2,Sd=3,W0=4,pg=5,kd=6;function Xf(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;TL(e,n,{name:t,index:r,group:i,on:IL,tween:AL,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:QN})}function Yy(e,t){var n=yr(e,t);if(n.state>QN)throw new Error("too late; already scheduled");return n}function Kr(e,t){var n=yr(e,t);if(n.state>Sd)throw new Error("too late; already running");return n}function yr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function TL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=XN(o,0,n.time);function o(u){n.state=V0,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,d,p,h;if(n.state!==V0)return l();for(f in r)if(h=r[f],h.name===n.name){if(h.state===Sd)return U0(s);h.state===W0?(h.state=kd,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[f]):+f<t&&(h.state=kd,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[f])}if(U0(function(){n.state===Sd&&(n.state=W0,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=fg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===fg){for(n.state=Sd,i=new Array(p=n.tween.length),f=0,d=-1;f<p;++f)(h=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function a(u){for(var f=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=pg,1),d=-1,p=i.length;++d<p;)i[d].call(e,f);n.state===pg&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=kd,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Nd(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>fg&&r.state<pg,r.state=kd,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function RL(e){return this.each(function(){Nd(this,e)})}function LL(e,t){var n,r;return function(){var i=Kr(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 OL(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Kr(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}o.tween=i}}function ML(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=yr(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?LL:OL)(n,e,t))}function qy(e,t,n){var r=e._id;return e.each(function(){var i=Kr(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return yr(i,r).value[t]}}function JN(e,t){var n;return(typeof t=="number"?Tr:t instanceof Ho?of:(n=Ho(t))?(t=n,of):WN)(e,t)}function DL(e){return function(){this.removeAttribute(e)}}function FL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $L(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 zL(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 BL(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function HL(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function UL(e,t){var n=qf(e),r=n==="transform"?SL:JN;return this.attrTween(e,typeof t=="function"?(n.local?HL:BL)(n,r,qy(this,"attr."+e,t)):t==null?(n.local?FL:DL)(n):(n.local?zL:$L)(n,r,t))}function VL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function WL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function KL(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&WL(e,o)),n}return i._value=t,i}function YL(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&VL(e,o)),n}return i._value=t,i}function qL(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=qf(e);return this.tween(n,(r.local?KL:YL)(r,t))}function GL(e,t){return function(){Yy(this,e).delay=+t.apply(this,arguments)}}function XL(e,t){return t=+t,function(){Yy(this,e).delay=t}}function QL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GL:XL)(t,e)):yr(this.node(),t).delay}function JL(e,t){return function(){Kr(this,e).duration=+t.apply(this,arguments)}}function ZL(e,t){return t=+t,function(){Kr(this,e).duration=t}}function eO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?JL:ZL)(t,e)):yr(this.node(),t).duration}function tO(e,t){if(typeof t!="function")throw new Error;return function(){Kr(this,e).ease=t}}function nO(e){var t=this._id;return arguments.length?this.each(tO(t,e)):yr(this.node(),t).ease}function rO(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Kr(this,e).ease=n}}function iO(e){if(typeof e!="function")throw new Error;return this.each(rO(this._id,e))}function oO(e){typeof e!="function"&&(e=_N(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]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new di(r,this._parents,this._name,this._id)}function sO(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 l=t[a],u=n[a],f=l.length,d=s[a]=new Array(f),p,h=0;h<f;++h)(p=l[h]||u[h])&&(d[h]=p);for(;a<r;++a)s[a]=t[a];return new di(s,this._parents,this._name,this._id)}function aO(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 lO(e,t,n){var r,i,o=aO(t)?Yy:Kr;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function cO(e,t){var n=this._id;return arguments.length<2?yr(this.node(),n).on.on(e):this.each(lO(n,e,t))}function uO(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function dO(){return this.on("end.remove",uO(this._id))}function fO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hy(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,u=o[s]=new Array(l),f,d,p=0;p<l;++p)(f=a[p])&&(d=e.call(f,f.__data__,p,a))&&("__data__"in f&&(d.__data__=f.__data__),u[p]=d,Xf(u[p],t,n,p,u,yr(f,n)));return new di(o,this._parents,t,n)}function pO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=PN(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],u=l.length,f,d=0;d<u;++d)if(f=l[d]){for(var p=e.call(f,f.__data__,d,l),h,m=yr(f,n),v=0,k=p.length;v<k;++v)(h=p[v])&&Xf(h,t,n,v,p,m);o.push(p),s.push(f)}return new di(o,s,t,n)}var hO=Ic.prototype.constructor;function mO(){return new hO(this._groups,this._parents)}function gO(e,t){var n,r,i;return function(){var o=na(this,e),s=(this.style.removeProperty(e),na(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function ZN(e){return function(){this.style.removeProperty(e)}}function yO(e,t,n){var r,i=n+"",o;return function(){var s=na(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function xO(e,t,n){var r,i,o;return function(){var s=na(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),na(this,e))),s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a))}}function wO(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=Kr(this,e),u=l.on,f=l.value[o]==null?a||(a=ZN(t)):void 0;(u!==n||i!==f)&&(r=(n=u).copy()).on(s,i=f),l.on=r}}function vO(e,t,n){var r=(e+="")=="transform"?bL:JN;return t==null?this.styleTween(e,gO(e,r)).on("end.style."+e,ZN(e)):typeof t=="function"?this.styleTween(e,xO(e,r,qy(this,"style."+e,t))).each(wO(this._id,e)):this.styleTween(e,yO(e,r,t),n).on("end.style."+e,null)}function bO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function SO(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&bO(e,s,n)),r}return o._value=t,o}function kO(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,SO(e,t,n??""))}function NO(e){return function(){this.textContent=e}}function CO(e){return function(){var t=e(this);this.textContent=t??""}}function EO(e){return this.tween("text",typeof e=="function"?CO(qy(this,"text",e)):NO(e==null?"":e+""))}function jO(e){return function(t){this.textContent=e.call(this,t)}}function PO(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&jO(i)),t}return r._value=e,r}function _O(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,PO(e))}function IO(){for(var e=this._name,t=this._id,n=eC(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var f=yr(l,t);Xf(l,e,n,u,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new di(r,this._parents,e,n)}function AO(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};n.each(function(){var u=Kr(this,r),f=u.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&o()})}var TO=0;function di(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function eC(){return++TO}var Xr=Ic.prototype;di.prototype={constructor:di,select:fO,selectAll:pO,selectChild:Xr.selectChild,selectChildren:Xr.selectChildren,filter:oO,merge:sO,selection:mO,transition:IO,call:Xr.call,nodes:Xr.nodes,node:Xr.node,size:Xr.size,empty:Xr.empty,each:Xr.each,on:cO,attr:UL,attrTween:qL,style:vO,styleTween:kO,text:EO,textTween:_O,remove:dO,tween:ML,delay:QL,duration:eO,ease:nO,easeVarying:iO,end:AO,[Symbol.iterator]:Xr[Symbol.iterator]};function RO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LO={time:null,delay:0,duration:250,ease:RO};function OO(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 MO(e){var t,n;e instanceof di?(t=e._id,e=e._name):(t=eC(),(n=LO).time=Ky(),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,l,u=0;u<a;++u)(l=s[u])&&Xf(l,e,t,u,s,n||OO(l,t));return new di(r,this._parents,e,t)}Ic.prototype.interrupt=RL;Ic.prototype.transition=MO;const Wu=e=>()=>e;function DO(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 ii(e,t,n){this.k=e,this.x=t,this.y=n}ii.prototype={constructor:ii,scale:function(e){return e===1?this:new ii(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ii(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 Qf=new ii(1,0,0);tC.prototype=ii.prototype;function tC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qf;return e.__zoom}function Nh(e){e.stopImmediatePropagation()}function ll(e){e.preventDefault(),e.stopImmediatePropagation()}function FO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $O(){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 K0(){return this.__zoom||Qf}function zO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function BO(){return navigator.maxTouchPoints||"ontouchstart"in this}function HO(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 nC(){var e=FO,t=$O,n=HO,r=zO,i=BO,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=bd,u=Yf("start","zoom","end"),f,d,p,h=500,m=150,v=0,k=10;function g(L){L.property("__zoom",K0).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(L,H,D,$){var _=L.selection?L.selection():L;_.property("__zoom",K0),L!==_?E(L,H,D,$):_.interrupt().each(function(){S(this,arguments).event($).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},g.scaleBy=function(L,H,D,$){g.scaleTo(L,function(){var _=this.__zoom.k,I=typeof H=="function"?H.apply(this,arguments):H;return _*I},D,$)},g.scaleTo=function(L,H,D,$){g.transform(L,function(){var _=t.apply(this,arguments),I=this.__zoom,C=D==null?N(_):typeof D=="function"?D.apply(this,arguments):D,F=I.invert(C),U=typeof H=="function"?H.apply(this,arguments):H;return n(y(w(I,U),C,F),_,s)},D,$)},g.translateBy=function(L,H,D,$){g.transform(L,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,$)},g.translateTo=function(L,H,D,$,_){g.transform(L,function(){var I=t.apply(this,arguments),C=this.__zoom,F=$==null?N(I):typeof $=="function"?$.apply(this,arguments):$;return n(Qf.translate(F[0],F[1]).scale(C.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof D=="function"?-D.apply(this,arguments):-D),I,s)},$,_)};function w(L,H){return H=Math.max(o[0],Math.min(o[1],H)),H===L.k?L:new ii(H,L.x,L.y)}function y(L,H,D){var $=H[0]-D[0]*L.k,_=H[1]-D[1]*L.k;return $===L.x&&_===L.y?L:new ii(L.k,$,_)}function N(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function E(L,H,D,$){L.on("start.zoom",function(){S(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event($).end()}).tween("zoom",function(){var _=this,I=arguments,C=S(_,I).event($),F=t.apply(_,I),U=D==null?N(F):typeof D=="function"?D.apply(_,I):D,O=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),q=_.__zoom,ee=typeof H=="function"?H.apply(_,I):H,ne=l(q.invert(U).concat(O/q.k),ee.invert(U).concat(O/ee.k));return function(ae){if(ae===1)ae=ee;else{var J=ne(ae),le=O/J[2];ae=new ii(le,U[0]-J[0]*le,U[1]-J[1]*le)}C.zoom(null,ae)}})}function S(L,H,D){return!D&&L.__zooming||new P(L,H)}function P(L,H){this.that=L,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,H),this.taps=0}P.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,H){return this.mouse&&L!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var H=_n(this.that).datum();u.call(L,this.that,new DO(L,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),H)}};function T(L,...H){if(!e.apply(this,arguments))return;var D=S(this,H).event(L),$=this.__zoom,_=Math.max(o[0],Math.min(o[1],$.k*Math.pow(2,r.apply(this,arguments)))),I=sr(L);if(D.wheel)(D.mouse[0][0]!==I[0]||D.mouse[0][1]!==I[1])&&(D.mouse[1]=$.invert(D.mouse[0]=I)),clearTimeout(D.wheel);else{if($.k===_)return;D.mouse=[I,$.invert(I)],Nd(this),D.start()}ll(L),D.wheel=setTimeout(C,m),D.zoom("mouse",n(y(w($,_),D.mouse[0],D.mouse[1]),D.extent,s));function C(){D.wheel=null,D.end()}}function M(L,...H){if(p||!e.apply(this,arguments))return;var D=L.currentTarget,$=S(this,H,!0).event(L),_=_n(L.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",O,!0),I=sr(L,D),C=L.clientX,F=L.clientY;$N(L.view),Nh(L),$.mouse=[I,this.__zoom.invert(I)],Nd(this),$.start();function U(q){if(ll(q),!$.moved){var ee=q.clientX-C,ne=q.clientY-F;$.moved=ee*ee+ne*ne>v}$.event(q).zoom("mouse",n(y($.that.__zoom,$.mouse[0]=sr(q,D),$.mouse[1]),$.extent,s))}function O(q){_.on("mousemove.zoom mouseup.zoom",null),zN(q.view,$.moved),ll(q),$.event(q).end()}}function B(L,...H){if(e.apply(this,arguments)){var D=this.__zoom,$=sr(L.changedTouches?L.changedTouches[0]:L,this),_=D.invert($),I=D.k*(L.shiftKey?.5:2),C=n(y(w(D,I),$,_),t.apply(this,H),s);ll(L),a>0?_n(this).transition().duration(a).call(E,C,$,L):_n(this).call(g.transform,C,$,L)}}function A(L,...H){if(e.apply(this,arguments)){var D=L.touches,$=D.length,_=S(this,H,L.changedTouches.length===$).event(L),I,C,F,U;for(Nh(L),C=0;C<$;++C)F=D[C],U=sr(F,this),U=[U,this.__zoom.invert(U),F.identifier],_.touch0?!_.touch1&&_.touch0[2]!==U[2]&&(_.touch1=U,_.taps=0):(_.touch0=U,I=!0,_.taps=1+!!f);f&&(f=clearTimeout(f)),I&&(_.taps<2&&(d=U[0],f=setTimeout(function(){f=null},h)),Nd(this),_.start())}}function R(L,...H){if(this.__zooming){var D=S(this,H).event(L),$=L.changedTouches,_=$.length,I,C,F,U;for(ll(L),I=0;I<_;++I)C=$[I],F=sr(C,this),D.touch0&&D.touch0[2]===C.identifier?D.touch0[0]=F:D.touch1&&D.touch1[2]===C.identifier&&(D.touch1[0]=F);if(C=D.that.__zoom,D.touch1){var O=D.touch0[0],q=D.touch0[1],ee=D.touch1[0],ne=D.touch1[1],ae=(ae=ee[0]-O[0])*ae+(ae=ee[1]-O[1])*ae,J=(J=ne[0]-q[0])*J+(J=ne[1]-q[1])*J;C=w(C,Math.sqrt(ae/J)),F=[(O[0]+ee[0])/2,(O[1]+ee[1])/2],U=[(q[0]+ne[0])/2,(q[1]+ne[1])/2]}else if(D.touch0)F=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(y(C,F,U),D.extent,s))}}function V(L,...H){if(this.__zooming){var D=S(this,H).event(L),$=L.changedTouches,_=$.length,I,C;for(Nh(L),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),I=0;I<_;++I)C=$[I],D.touch0&&D.touch0[2]===C.identifier?delete D.touch0:D.touch1&&D.touch1[2]===C.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(C=sr(C,this),Math.hypot(d[0]-C[0],d[1]-C[1])<k)){var F=_n(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return g.wheelDelta=function(L){return arguments.length?(r=typeof L=="function"?L:Wu(+L),g):r},g.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Wu(!!L),g):e},g.touchable=function(L){return arguments.length?(i=typeof L=="function"?L:Wu(!!L),g):i},g.extent=function(L){return arguments.length?(t=typeof L=="function"?L:Wu([[+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?(l=L,g):l},g.on=function(){var L=u.on.apply(u,arguments);return L===u?g:L},g.clickDistance=function(L){return arguments.length?(v=(L=+L)*L,g):Math.sqrt(v)},g.tapDistance=function(L){return arguments.length?(k=+L,g):k},g}const Vr={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."},lc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rC=["Enter"," ","Escape"],iC={"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 ia;(function(e){e.Strict="strict",e.Loose="loose"})(ia||(ia={}));var Lo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Lo||(Lo={}));var cc;(function(e){e.Partial="partial",e.Full="full"})(cc||(cc={}));const oC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Oi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Oi||(Oi={}));var Zi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Zi||(Zi={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const Y0={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function sC(e){return e===null?null:e?"valid":"invalid"}const aC=e=>"id"in e&&"source"in e&&"target"in e,UO=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gy=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Tc=(e,t=[0,0])=>{const{width:n,height:r}=mi(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},VO=(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):Gy(i)?i:t.nodeLookup.get(i.id));const a=s?cf(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jf(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zf(n)},Rc=(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=Jf(n,cf(i)),r=!0)}),r?Zf(n):{x:0,y:0,width:0,height:0}},Xy=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const a={...Oc(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const u of e.values()){const{measured:f,selectable:d=!0,hidden:p=!1}=u;if(s&&!d||p)continue;const h=f.width??u.width??u.initialWidth??null,m=f.height??u.height??u.initialHeight??null,v=uc(a,sa(u)),k=(h??0)*(m??0),g=o&&v>0;(!u.internals.handleBounds||g||v>=k||u.dragging)&&l.push(u)}return l},WO=(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 KO(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 YO({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!0);const a=KO(e,s),l=Rc(a),u=Qy(l,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 lC({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:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},f=s.origin??r;let d=s.extent||i;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",Vr.error005());else{const h=a.measured.width,m=a.measured.height;h&&m&&(d=[[l,u],[l+h,u+m]])}else a&&aa(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const p=aa(d)?Vo(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(o==null||o("015",Vr.error015())),{position:{x:p.x-l+(s.measured.width??0)*f[0],y:p.y-u+(s.measured.height??0)*f[1]},positionAbsolute:p}}async function qO({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(p=>p.id)),s=[];for(const p of n){if(p.deletable===!1)continue;const h=o.has(p.id),m=!h&&p.parentId&&s.find(v=>v.id===p.parentId);(h||m)&&s.push(p)}const a=new Set(t.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),f=WO(s,l);for(const p of l)a.has(p.id)&&!f.find(m=>m.id===p.id)&&f.push(p);if(!i)return{edges:f,nodes:s};const d=await i({nodes:s,edges:f});return typeof d=="boolean"?d?{edges:f,nodes:s}:{edges:[],nodes:[]}:d}const oa=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vo=(e={x:0,y:0},t,n)=>({x:oa(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:oa(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function cC(e,t,n){const{width:r,height:i}=mi(n),{x:o,y:s}=n.internals.positionAbsolute;return Vo(e,[[o,s],[o+r,s+i]],t)}const q0=(e,t,n)=>e<t?oa(Math.abs(e-t),1,t)/t:e>n?-oa(Math.abs(e-n),1,t)/t:0,uC=(e,t,n=15,r=40)=>{const i=q0(e.x,r,t.width-r)*n,o=q0(e.y,r,t.height-r)*n;return[i,o]},Jf=(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)}),hg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),sa=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Gy(e)?e.internals.positionAbsolute:Tc(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}},cf=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Gy(e)?e.internals.positionAbsolute:Tc(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)}},dC=(e,t)=>Zf(Jf(hg(e),hg(t))),uc=(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)},G0=e=>ur(e.width)&&ur(e.height)&&ur(e.x)&&ur(e.y),ur=e=>!isNaN(e)&&isFinite(e),GO=(e,t)=>{},Lc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Oc=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return o?Lc(a,s):a},uf=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function hs(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 XO(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=hs(e,n),i=hs(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=hs(e.top??e.y??0,n),i=hs(e.bottom??e.y??0,n),o=hs(e.left??e.x??0,t),s=hs(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 QO(e,t,n,r,i,o){const{x:s,y:a}=uf(e,[t,n,r]),{x:l,y:u}=uf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=i-l,d=o-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(f),bottom:Math.floor(d)}}const Qy=(e,t,n,r,i,o)=>{const s=XO(o,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),f=oa(u,r,i),d=e.x+e.width/2,p=e.y+e.height/2,h=t/2-d*f,m=n/2-p*f,v=QO(e,h,m,f,t,n),k={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-k.left+k.right,y:m-k.top+k.bottom,zoom:f}},dc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function aa(e){return e!=null&&e!=="parent"}function mi(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 fC(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 pC(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 X0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function JO(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function ZO(e){return{...iC,...e||{}}}function Ll(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=dr(e),a=Oc({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:l,y:u}=n?Lc(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Jy=e=>({width:e.offsetWidth,height:e.offsetHeight}),hC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},eM=["INPUT","SELECT","TEXTAREA"];function mC(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:eM.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const gC=e=>"clientX"in e,dr=(e,t)=>{var o,s;const n=gC(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)}},Q0=(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,...Jy(s)}})};function yC({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+r*.125,f=Math.abs(l-e),d=Math.abs(u-t);return[l,u,f,d]}function Ku(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function J0({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case be.Left:return[t-Ku(t-r,o),n];case be.Right:return[t+Ku(r-t,o),n];case be.Top:return[t,n-Ku(n-i,o)];case be.Bottom:return[t,n+Ku(i-n,o)]}}function xC({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top,curvature:s=.25}){const[a,l]=J0({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,f]=J0({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,p,h,m]=yC({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:f});return[`M${e},${t} C${a},${l} ${u},${f} ${r},${i}`,d,p,h,m]}function wC({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 tM({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=Jf(cf(e),cf(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 uc(s,Zf(o))>0}const rM=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,iM=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),vC=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||rM;let i;return aC(e)?i={...e}:i={...e,id:r(e)},iM(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function bC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=wC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const Z0={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},oM=({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},ev=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sM({source:e,sourcePosition:t=be.Bottom,target:n,targetPosition:r=be.Top,center:i,offset:o,stepPosition:s}){const a=Z0[t],l=Z0[r],u={x:e.x+a.x*o,y:e.y+a.y*o},f={x:n.x+l.x*o,y:n.y+l.y*o},d=oM({source:u,sourcePosition:t,target:f}),p=d.x!==0?"x":"y",h=d[p];let m=[],v,k;const g={x:0,y:0},w={x:0,y:0},[,,y,N]=wC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[p]*l[p]===-1){p==="x"?(v=i.x??u.x+(f.x-u.x)*s,k=i.y??(u.y+f.y)/2):(v=i.x??(u.x+f.x)/2,k=i.y??u.y+(f.y-u.y)*s);const T=[{x:v,y:u.y},{x:v,y:f.y}],M=[{x:u.x,y:k},{x:f.x,y:k}];a[p]===h?m=p==="x"?T:M:m=p==="x"?M:T}else{const T=[{x:u.x,y:f.y}],M=[{x:f.x,y:u.y}];if(p==="x"?m=a.x===h?M:T:m=a.y===h?T:M,t===r){const L=Math.abs(e[p]-n[p]);if(L<=o){const H=Math.min(o-1,o-L);a[p]===h?g[p]=(u[p]>e[p]?-1:1)*H:w[p]=(f[p]>n[p]?-1:1)*H}}if(t!==r){const L=p==="x"?"y":"x",H=a[p]===l[L],D=u[L]>f[L],$=u[L]<f[L];(a[p]===1&&(!H&&D||H&&$)||a[p]!==1&&(!H&&$||H&&D))&&(m=p==="x"?T:M)}const B={x:u.x+g.x,y:u.y+g.y},A={x:f.x+w.x,y:f.y+w.y},R=Math.max(Math.abs(B.x-m[0].x),Math.abs(A.x-m[0].x)),V=Math.max(Math.abs(B.y-m[0].y),Math.abs(A.y-m[0].y));R>=V?(v=(B.x+A.x)/2,k=m[0].y):(v=m[0].x,k=(B.y+A.y)/2)}const E={x:u.x+g.x,y:u.y+g.y},S={x:f.x+w.x,y:f.y+w.y};return[[e,...E.x!==m[0].x||E.y!==m[0].y?[E]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],v,k,y,N]}function aM(e,t,n,r){const i=Math.min(ev(e,t)/2,ev(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,f=e.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*f}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function mg({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:f=.5}){const[d,p,h,m,v]=sM({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:u,stepPosition:f});let k=`M${d[0].x} ${d[0].y}`;for(let g=1;g<d.length-1;g++)k+=aM(d[g-1],d[g],d[g+1],s);return k+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[k,p,h,m,v]}function tv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function lM(e){var d;const{sourceNode:t,targetNode:n}=e;if(!tv(t)||!tv(n))return null;const r=t.internals.handleBounds||nv(t.handles),i=n.internals.handleBounds||nv(n.handles),o=rv((r==null?void 0:r.source)??[],e.sourceHandle),s=rv(e.connectionMode===ia.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",Vr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||be.Bottom,l=(s==null?void 0:s.position)||be.Top,u=Wo(t,o,a),f=Wo(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:f.x,targetY:f.y,sourcePosition:a,targetPosition:l}}function nv(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 Wo(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??mi(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 rv(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function gg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function cM(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(l=>{if(l&&typeof l=="object"){const u=gg(l,t);o.has(u)||(s.push({id:u,color:l.color||n,...l}),o.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const SC=1e3,uM=10,Zy={nodeOrigin:[0,0],nodeExtent:lc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},dM={...Zy,checkEquality:!0};function ex(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function fM(e,t,n){const r=ex(Zy,n);for(const i of e.values())if(i.parentId)nx(i,e,t,r);else{const o=Tc(i,r.nodeOrigin),s=aa(i.extent)?i.extent:r.nodeExtent,a=Vo(o,s,mi(i));i.internals.positionAbsolute=a}}function pM(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 tx(e){return e==="manual"}function yg(e,t,n,r={}){var f,d;const i=ex(dM,r),o={i:0},s=new Map(t),a=i!=null&&i.elevateNodesOnSelect&&!tx(i.zIndexMode)?SC:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const p of e){let h=s.get(p.id);if(i.checkEquality&&p===(h==null?void 0:h.internals.userNode))t.set(p.id,h);else{const m=Tc(p,i.nodeOrigin),v=aa(p.extent)?p.extent:i.nodeExtent,k=Vo(m,v,mi(p));h={...i.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:k,handleBounds:pM(p,h),z:kC(p,a,i.zIndexMode),userNode:p}},t.set(p.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),p.parentId&&nx(h,t,n,r,o),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function hM(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 nx(e,t,n,r,i){const{elevateNodesOnSelect:o,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=ex(Zy,r),u=e.parentId,f=t.get(u);if(!f){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}hM(e,n),i&&!f.parentId&&f.internals.rootParentIndex===void 0&&l==="auto"&&(f.internals.rootParentIndex=++i.i,f.internals.z=f.internals.z+i.i*uM),i&&f.internals.rootParentIndex!==void 0&&(i.i=f.internals.rootParentIndex);const d=o&&!tx(l)?SC:0,{x:p,y:h,z:m}=mM(e,f,s,a,d,l),{positionAbsolute:v}=e.internals,k=p!==v.x||h!==v.y;(k||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:p,y:h}:v,z:m}})}function kC(e,t,n){const r=ur(e.zIndex)?e.zIndex:0;return tx(n)?r:r+(e.selected?t:0)}function mM(e,t,n,r,i,o){const{x:s,y:a}=t.internals.positionAbsolute,l=mi(e),u=Tc(e,n),f=aa(e.extent)?Vo(u,e.extent,l):u;let d=Vo({x:s+f.x,y:a+f.y},r,l);e.extent==="parent"&&(d=cC(d,l,t));const p=kC(e,i,o),h=t.internals.z??0;return{x:d.x,y:d.y,z:h>=p?h+1:p}}function rx(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??sa(l),f=dC(u,a.rect);o.set(a.parentId,{expandedRect:f,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},u)=>{var y;const f=l.internals.positionAbsolute,d=mi(l),p=l.origin??r,h=a.x<f.x?Math.round(Math.abs(f.x-a.x)):0,m=a.y<f.y?Math.round(Math.abs(f.y-a.y)):0,v=Math.max(d.width,Math.round(a.width)),k=Math.max(d.height,Math.round(a.height)),g=(v-d.width)*p[0],w=(k-d.height)*p[1];(h>0||m>0||g||w)&&(i.push({id:u,type:"position",position:{x:l.position.x-h+g,y:l.position.y-m+w}}),(y=n.get(u))==null||y.forEach(N=>{e.some(E=>E.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:v+(h?p[0]*h-g:0),height:k+(m?p[1]*m-w:0)}})}),i}function gM(e,t,n,r,i,o,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],f=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(f.transform),p=[];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}}),l=!0;continue}const v=Jy(h.nodeElement),k=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(k||!m.internals.handleBounds||h.force))){const w=h.nodeElement.getBoundingClientRect(),y=aa(m.extent)?m.extent:o;let{positionAbsolute:N}=m.internals;m.parentId&&m.extent==="parent"?N=cC(N,v,t.get(m.parentId)):y&&(N=Vo(N,y,v));const E={...m,measured:v,internals:{...m.internals,positionAbsolute:N,handleBounds:{source:Q0("source",h.nodeElement,w,d,m.id),target:Q0("target",h.nodeElement,w,d,m.id)}}};t.set(m.id,E),m.parentId&&nx(E,t,n,{nodeOrigin:i,zIndexMode:s}),l=!0,k&&(u.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&p.push({id:m.id,parentId:m.parentId,rect:sa(E,i)}))}}if(p.length>0){const h=rx(p,t,n,i);u.push(...h)}return{changes:u,updatedInternals:l}}async function yM({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 iv(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 l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),o){s=`${i}-${e}-${o}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function NC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${o}-${a}`,f=`${o}-${a}--${i}-${s}`;iv("source",l,f,e,i,s),iv("target",l,u,e,o,a),t.set(r.id,r)}}function CC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:CC(n,t):!1}function ov(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 xM(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!CC(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 Ch({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const i=[];for(const[u,f]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&i.push({...d,position:f.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:((l=t.get(e))==null?void 0:l.position)||o.position,dragging:r}:i[0],i]}function wM({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=Lc(o,t);return{x:s.x-o.x,y:s.y-o.y}}function vM({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},f=null,d=!1,p=null,h=!1,m=!1,v=null;function k({noDragClassName:w,handleSelector:y,domNode:N,isSelectable:E,nodeId:S,nodeClickDistance:P=0}){p=_n(N);function T({x:R,y:V}){const{nodeLookup:L,nodeExtent:H,snapGrid:D,snapToGrid:$,nodeOrigin:_,onNodeDrag:I,onSelectionDrag:C,onError:F,updateNodePositions:U}=t();o={x:R,y:V};let O=!1;const q=a.size>1,ee=q&&H?hg(Rc(a)):null,ne=q&&$?wM({dragItems:a,snapGrid:D,x:R,y:V}):null;for(const[ae,J]of a){if(!L.has(ae))continue;let le={x:R-J.distance.x,y:V-J.distance.y};$&&(le=ne?{x:Math.round(le.x+ne.x),y:Math.round(le.y+ne.y)}:Lc(le,D));let Se=null;if(q&&H&&!J.extent&&ee){const{positionAbsolute:xe}=J.internals,$e=xe.x-ee.x+H[0][0],Ke=xe.x+J.measured.width-ee.x2+H[1][0],Le=xe.y-ee.y+H[0][1],mt=xe.y+J.measured.height-ee.y2+H[1][1];Se=[[$e,Le],[Ke,mt]]}const{position:ye,positionAbsolute:ge}=lC({nodeId:ae,nextPosition:le,nodeLookup:L,nodeExtent:Se||H,nodeOrigin:_,onError:F});O=O||J.position.x!==ye.x||J.position.y!==ye.y,J.position=ye,J.internals.positionAbsolute=ge}if(m=m||O,!!O&&(U(a,!0),v&&(r||I||!S&&C))){const[ae,J]=Ch({nodeId:S,dragItems:a,nodeLookup:L});r==null||r(v,a,ae,J),I==null||I(v,ae,J),S||C==null||C(v,J)}}async function M(){if(!f)return;const{transform:R,panBy:V,autoPanSpeed:L,autoPanOnNodeDrag:H}=t();if(!H){l=!1,cancelAnimationFrame(s);return}const[D,$]=uC(u,f,L);(D!==0||$!==0)&&(o.x=(o.x??0)-D/R[2],o.y=(o.y??0)-$/R[2],await V({x:D,y:$})&&T(o)),s=requestAnimationFrame(M)}function B(R){var q;const{nodeLookup:V,multiSelectionActive:L,nodesDraggable:H,transform:D,snapGrid:$,snapToGrid:_,selectNodesOnDrag:I,onNodeDragStart:C,onSelectionDragStart:F,unselectNodesAndEdges:U}=t();d=!0,(!I||!E)&&!L&&S&&((q=V.get(S))!=null&&q.selected||U()),E&&I&&S&&(e==null||e(S));const O=Ll(R.sourceEvent,{transform:D,snapGrid:$,snapToGrid:_,containerBounds:f});if(o=O,a=xM(V,H,O,S),a.size>0&&(n||C||!S&&F)){const[ee,ne]=Ch({nodeId:S,dragItems:a,nodeLookup:V});n==null||n(R.sourceEvent,a,ee,ne),C==null||C(R.sourceEvent,ee,ne),S||F==null||F(R.sourceEvent,ne)}}const A=BN().clickDistance(P).on("start",R=>{const{domNode:V,nodeDragThreshold:L,transform:H,snapGrid:D,snapToGrid:$}=t();f=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,m=!1,v=R.sourceEvent,L===0&&B(R),o=Ll(R.sourceEvent,{transform:H,snapGrid:D,snapToGrid:$,containerBounds:f}),u=dr(R.sourceEvent,f)}).on("drag",R=>{const{autoPanOnNodeDrag:V,transform:L,snapGrid:H,snapToGrid:D,nodeDragThreshold:$,nodeLookup:_}=t(),I=Ll(R.sourceEvent,{transform:L,snapGrid:H,snapToGrid:D,containerBounds:f});if(v=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||S&&!_.has(S))&&(h=!0),!h){if(!l&&V&&d&&(l=!0,M()),!d){const C=dr(R.sourceEvent,f),F=C.x-u.x,U=C.y-u.y;Math.sqrt(F*F+U*U)>$&&B(R)}(o.x!==I.xSnapped||o.y!==I.ySnapped)&&a&&d&&(u=dr(R.sourceEvent,f),T(I))}}).on("end",R=>{if(!(!d||h)&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:L,onNodeDragStop:H,onSelectionDragStop:D}=t();if(m&&(L(a,!1),m=!1),i||H||!S&&D){const[$,_]=Ch({nodeId:S,dragItems:a,nodeLookup:V,dragging:!1});i==null||i(R.sourceEvent,a,$,_),H==null||H(R.sourceEvent,$,_),S||D==null||D(R.sourceEvent,_)}}}).filter(R=>{const V=R.target;return!R.button&&(!w||!ov(V,`.${w}`,N))&&(!y||ov(V,y,N))});p.call(A)}function g(){p==null||p.on(".drag",null)}return{update:k,destroy:g}}function bM(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())uc(i,sa(o))>0&&r.push(o);return r}const SM=250;function kM(e,t,n,r){var a,l;let i=[],o=1/0;const s=bM(e,n,t+SM);for(const u of s){const f=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of f){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:h}=Wo(u,d,d.position,!0),m=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(h-e.y,2));m>t||(m<o?(i=[{...d,x:p,y:h}],o=m):m===o&&i.push({...d,x:p,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(f=>f.type===u)??i[0]}return i[0]}function EC(e,t,n,r,i,o=!1){var u,f,d;const s=r.get(e);if(!s)return null;const a=i==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],l=(n?a==null?void 0:a.find(p=>p.id===n):a==null?void 0:a[0])??null;return l&&o?{...l,...Wo(s,l,l.position,!0)}:l}function jC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function NM(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const PC=()=>!0;function CM(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:f,flowId:d,panBy:p,cancelConnection:h,onConnectStart:m,onConnect:v,onConnectEnd:k,isValidConnection:g=PC,onReconnectEnd:w,updateConnection:y,getTransform:N,getFromHandle:E,autoPanSpeed:S,dragThreshold:P=1,handleDomNode:T}){const M=hC(e.target);let B=0,A;const{x:R,y:V}=dr(e),L=jC(o,T),H=a==null?void 0:a.getBoundingClientRect();let D=!1;if(!H||!L)return;const $=EC(i,L,r,l,t);if(!$)return;let _=dr(e,H),I=!1,C=null,F=!1,U=null;function O(){if(!f||!H)return;const[ye,ge]=uC(_,H,S);p({x:ye,y:ge}),B=requestAnimationFrame(O)}const q={...$,nodeId:i,type:L,position:$.position},ee=l.get(i);let ae={inProgress:!0,isValid:null,from:Wo(ee,q,be.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:ee,to:_,toHandle:null,toPosition:Y0[q.position],toNode:null,pointer:_};function J(){D=!0,y(ae),m==null||m(e,{nodeId:i,handleId:r,handleType:L})}P===0&&J();function le(ye){if(!D){const{x:mt,y:_t}=dr(ye),Dt=mt-R,Fn=_t-V;if(!(Dt*Dt+Fn*Fn>P*P))return;J()}if(!E()||!q){Se(ye);return}const ge=N();_=dr(ye,H),A=kM(Oc(_,ge,!1,[1,1]),n,l,q),I||(O(),I=!0);const xe=_C(ye,{handle:A,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:g,doc:M,lib:u,flowId:d,nodeLookup:l});U=xe.handleDomNode,C=xe.connection,F=NM(!!A,xe.isValid);const $e=l.get(i),Ke=$e?Wo($e,q,be.Left,!0):ae.from,Le={...ae,from:Ke,isValid:F,to:xe.toHandle&&F?uf({x:xe.toHandle.x,y:xe.toHandle.y},ge):_,toHandle:xe.toHandle,toPosition:F&&xe.toHandle?xe.toHandle.position:Y0[q.position],toNode:xe.toHandle?l.get(xe.toHandle.nodeId):null,pointer:_};y(Le),ae=Le}function Se(ye){if(!("touches"in ye&&ye.touches.length>0)){if(D){(A||U)&&C&&F&&(v==null||v(C));const{inProgress:ge,...xe}=ae,$e={...xe,toPosition:ae.toHandle?ae.toPosition:null};k==null||k(ye,$e),o&&(w==null||w(ye,$e))}h(),cancelAnimationFrame(B),I=!1,F=!1,C=null,U=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",Se),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",Se)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",Se),M.addEventListener("touchmove",le),M.addEventListener("touchend",Se)}function _C(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:l,isValidConnection:u=PC,nodeLookup:f}){const d=o==="target",p=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:m}=dr(e),v=s.elementFromPoint(h,m),k=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:p,g={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const w=jC(void 0,k),y=k.getAttribute("data-nodeid"),N=k.getAttribute("data-handleid"),E=k.classList.contains("connectable"),S=k.classList.contains("connectableend");if(!y||!w)return g;const P={source:d?y:r,sourceHandle:d?N:i,target:d?r:y,targetHandle:d?i:N};g.connection=P;const M=E&&S&&(n===ia.Strict?d&&w==="source"||!d&&w==="target":y!==r||N!==i);g.isValid=M&&u(P),g.toHandle=EC(y,w,N,f,n,!0)}return g}const xg={onPointerDown:CM,isValid:_C};function EM({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=_n(e);function o({translateExtent:a,width:l,height:u,zoomStep:f=1,pannable:d=!0,zoomable:p=!0,inversePan:h=!1}){const m=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const N=n(),E=y.sourceEvent.ctrlKey&&dc()?10:1,S=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*f,P=N[2]*Math.pow(2,S*E);t.scaleTo(P)};let v=[0,0];const k=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(v=[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 E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],S=[E[0]-v[0],E[1]-v[1]];v=E;const P=r()*Math.max(N[2],Math.log(N[2]))*(h?-1:1),T={x:N[0]-S[0]*P,y:N[1]-S[1]*P},M=[[0,0],[l,u]];t.setViewportConstrained({x:T.x,y:T.y,zoom:N[2]},M,a)},w=nC().on("start",k).on("zoom",d?g:null).on("zoom.wheel",p?m:null);i.call(w,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:sr}}const ep=e=>({x:e.x,y:e.y,zoom:e.k}),Eh=({x:e,y:t,zoom:n})=>Qf.translate(e,t).scale(n),Rs=(e,t)=>e.target.closest(`.${t}`),IC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,jh=(e,t=0,n=jM,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},AC=e=>{const t=e.ctrlKey&&dc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function PM({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return f=>{if(Rs(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(f.ctrlKey&&s){const k=sr(f),g=AC(f),w=d*Math.pow(2,g);r.scaleTo(n,w,k,f);return}const p=f.deltaMode===1?20:1;let h=i===Lo.Vertical?0:f.deltaX*p,m=i===Lo.Horizontal?0:f.deltaY*p;!dc()&&f.shiftKey&&i!==Lo.Vertical&&(h=f.deltaY*p,m=0),r.translateBy(n,-(h/d)*o,-(m/d)*o,{internal:!0});const v=ep(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(f,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(f,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(f,v))}}function _M({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",s=!t&&o&&!r.ctrlKey,a=Rs(r,e);if(r.ctrlKey&&o&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,i)}}function IM({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,a;if((o=r.sourceEvent)!=null&&o.internal)return;const i=ep(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 AM({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&IC(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,ep(o.transform)))}}function TM({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&&IC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=ep(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,l)},n?150:0)}}}function RM({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:f}){return d=>{var k;const p=e||t,h=n&&d.ctrlKey,m=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Rs(d,`${u}-flow__node`)||Rs(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!i&&!o&&!n||s||f&&!m||Rs(d,a)&&m||Rs(d,l)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type==="touchstart"&&((k=d.touches)==null?void 0:k.length)>1)return d.preventDefault(),!1;if(!p&&!i&&!h&&m||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&v}}function LM({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),d=nC().scaleExtent([t,n]).translateExtent(r),p=_n(e).call(d);w({x:i.x,y:i.y,zoom:oa(i.zoom,t,n)},[[0,0],[f.width,f.height]],r);const h=p.on("wheel.zoom"),m=p.on("dblclick.zoom");d.wheelDelta(AC);function v(A,R){return p?new Promise(V=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?Rl:bd).transform(jh(p,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>V(!0)),A)}):Promise.resolve(!1)}function k({noWheelClassName:A,noPanClassName:R,onPaneContextMenu:V,userSelectionActive:L,panOnScroll:H,panOnDrag:D,panOnScrollMode:$,panOnScrollSpeed:_,preventScrolling:I,zoomOnPinch:C,zoomOnScroll:F,zoomOnDoubleClick:U,zoomActivationKeyPressed:O,lib:q,onTransformChange:ee,connectionInProgress:ne,paneClickDistance:ae,selectionOnDrag:J}){L&&!u.isZoomingOrPanning&&g();const le=H&&!O&&!L;d.clickDistance(J?1/0:!ur(ae)||ae<0?0:ae);const Se=le?PM({zoomPanValues:u,noWheelClassName:A,d3Selection:p,d3Zoom:d,panOnScrollMode:$,panOnScrollSpeed:_,zoomOnPinch:C,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:a}):_M({noWheelClassName:A,preventScrolling:I,d3ZoomHandler:h});if(p.on("wheel.zoom",Se,{passive:!1}),!L){const ge=IM({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});d.on("start",ge);const xe=AM({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!V,onPanZoom:o,onTransformChange:ee});d.on("zoom",xe);const $e=TM({zoomPanValues:u,panOnDrag:D,panOnScroll:H,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:l});d.on("end",$e)}const ye=RM({zoomActivationKeyPressed:O,panOnDrag:D,zoomOnScroll:F,panOnScroll:H,zoomOnDoubleClick:U,zoomOnPinch:C,userSelectionActive:L,noPanClassName:R,noWheelClassName:A,lib:q,connectionInProgress:ne});d.filter(ye),U?p.on("dblclick.zoom",m):p.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function w(A,R,V){const L=Eh(A),H=d==null?void 0:d.constrain()(L,R,V);return H&&await v(H),new Promise(D=>D(H))}async function y(A,R){const V=Eh(A);return await v(V,R),new Promise(L=>L(V))}function N(A){if(p){const R=Eh(A),V=p.property("__zoom");(V.k!==A.zoom||V.x!==A.x||V.y!==A.y)&&(d==null||d.transform(p,R,null,{sync:!0}))}}function E(){const A=p?tC(p.node()):{x:0,y:0,k:1};return{x:A.x,y:A.y,zoom:A.k}}function S(A,R){return p?new Promise(V=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?Rl:bd).scaleTo(jh(p,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>V(!0)),A)}):Promise.resolve(!1)}function P(A,R){return p?new Promise(V=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?Rl:bd).scaleBy(jh(p,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>V(!0)),A)}):Promise.resolve(!1)}function T(A){d==null||d.scaleExtent(A)}function M(A){d==null||d.translateExtent(A)}function B(A){const R=!ur(A)||A<0?0:A;d==null||d.clickDistance(R)}return{update:k,destroy:g,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:S,scaleBy:P,setScaleExtent:T,setTranslateExtent:M,syncViewport:N,setClickDistance:B}}var la;(function(e){e.Line="line",e.Handle="handle"})(la||(la={}));function OM({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function sv(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 ji(e,t){return Math.max(0,t-e)}function Pi(e,t){return Math.max(0,e-t)}function Yu(e,t,n){return Math.max(0,t-e,e-n)}function av(e,t){return e?!t:t}function MM(e,t,n,r,i,o,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:f,isVertical:d}=t,p=f&&d,{xSnapped:h,ySnapped:m}=n,{minWidth:v,maxWidth:k,minHeight:g,maxHeight:w}=r,{x:y,y:N,width:E,height:S,aspectRatio:P}=e;let T=Math.floor(f?h-e.pointerX:0),M=Math.floor(d?m-e.pointerY:0);const B=E+(l?-T:T),A=S+(u?-M:M),R=-o[0]*E,V=-o[1]*S;let L=Yu(B,v,k),H=Yu(A,g,w);if(s){let _=0,I=0;l&&T<0?_=ji(y+T+R,s[0][0]):!l&&T>0&&(_=Pi(y+B+R,s[1][0])),u&&M<0?I=ji(N+M+V,s[0][1]):!u&&M>0&&(I=Pi(N+A+V,s[1][1])),L=Math.max(L,_),H=Math.max(H,I)}if(a){let _=0,I=0;l&&T>0?_=Pi(y+T,a[0][0]):!l&&T<0&&(_=ji(y+B,a[1][0])),u&&M>0?I=Pi(N+M,a[0][1]):!u&&M<0&&(I=ji(N+A,a[1][1])),L=Math.max(L,_),H=Math.max(H,I)}if(i){if(f){const _=Yu(B/P,g,w)*P;if(L=Math.max(L,_),s){let I=0;!l&&!u||l&&!u&&p?I=Pi(N+V+B/P,s[1][1])*P:I=ji(N+V+(l?T:-T)/P,s[0][1])*P,L=Math.max(L,I)}if(a){let I=0;!l&&!u||l&&!u&&p?I=ji(N+B/P,a[1][1])*P:I=Pi(N+(l?T:-T)/P,a[0][1])*P,L=Math.max(L,I)}}if(d){const _=Yu(A*P,v,k)/P;if(H=Math.max(H,_),s){let I=0;!l&&!u||u&&!l&&p?I=Pi(y+A*P+R,s[1][0])/P:I=ji(y+(u?M:-M)*P+R,s[0][0])/P,H=Math.max(H,I)}if(a){let I=0;!l&&!u||u&&!l&&p?I=ji(y+A*P,a[1][0])/P:I=Pi(y+(u?M:-M)*P,a[0][0])/P,H=Math.max(H,I)}}}M=M+(M<0?H:-H),T=T+(T<0?L:-L),i&&(p?B>A*P?M=(av(l,u)?-T:T)/P:T=(av(l,u)?-M:M)*P:f?(M=T/P,u=l):(T=M*P,l=u));const D=l?y+T:y,$=u?N+M:N;return{width:E+(l?-T:T),height:S+(u?-M:M),x:o[0]*T*(l?-1:1)+D,y:o[1]*M*(u?-1:1)+$}}const TC={width:0,height:0,x:0,y:0},DM={...TC,pointerX:0,pointerY:0,aspectRatio:1};function FM(e){return[[0,0],[e.measured.width,e.measured.height]]}function $M(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,l=n[1]*s;return[[r-a,i-l],[r+o-a,i+s-l]]}function zM({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=_n(e);let s={controlDirection:sv("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:f,keepAspectRatio:d,resizeDirection:p,onResizeStart:h,onResize:m,onResizeEnd:v,shouldResize:k}){let g={...TC},w={...DM};s={boundaries:f,resizeDirection:p,keepAspectRatio:d,controlDirection:sv(u)};let y,N=null,E=[],S,P,T,M=!1;const B=BN().on("start",A=>{const{nodeLookup:R,transform:V,snapGrid:L,snapToGrid:H,nodeOrigin:D,paneDomNode:$}=n();if(y=R.get(t),!y)return;N=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:I}=Ll(A.sourceEvent,{transform:V,snapGrid:L,snapToGrid:H,containerBounds:N});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...g,pointerX:_,pointerY:I,aspectRatio:g.width/g.height},S=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(S=R.get(y.parentId),P=S&&y.extent==="parent"?FM(S):void 0),E=[],T=void 0;for(const[C,F]of R)if(F.parentId===t&&(E.push({id:C,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const U=$M(F,y,F.origin??D);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}h==null||h(A,{...g})}).on("drag",A=>{const{transform:R,snapGrid:V,snapToGrid:L,nodeOrigin:H}=n(),D=Ll(A.sourceEvent,{transform:R,snapGrid:V,snapToGrid:L,containerBounds:N}),$=[];if(!y)return;const{x:_,y:I,width:C,height:F}=g,U={},O=y.origin??H,{width:q,height:ee,x:ne,y:ae}=MM(w,s.controlDirection,D,s.boundaries,s.keepAspectRatio,O,P,T),J=q!==C,le=ee!==F,Se=ne!==_&&J,ye=ae!==I&≤if(!Se&&!ye&&!J&&!le)return;if((Se||ye||O[0]===1||O[1]===1)&&(U.x=Se?ne:g.x,U.y=ye?ae:g.y,g.x=U.x,g.y=U.y,E.length>0)){const Ke=ne-_,Le=ae-I;for(const mt of E)mt.position={x:mt.position.x-Ke+O[0]*(q-C),y:mt.position.y-Le+O[1]*(ee-F)},$.push(mt)}if((J||le)&&(U.width=J&&(!s.resizeDirection||s.resizeDirection==="horizontal")?q:g.width,U.height=le&&(!s.resizeDirection||s.resizeDirection==="vertical")?ee:g.height,g.width=U.width,g.height=U.height),S&&y.expandParent){const Ke=O[0]*(U.width??0);U.x&&U.x<Ke&&(g.x=Ke,w.x=w.x-(U.x-Ke));const Le=O[1]*(U.height??0);U.y&&U.y<Le&&(g.y=Le,w.y=w.y-(U.y-Le))}const ge=OM({width:g.width,prevWidth:C,height:g.height,prevHeight:F,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),xe={...g,direction:ge};(k==null?void 0:k(A,xe))!==!1&&(M=!0,m==null||m(A,xe),r(U,$))}).on("end",A=>{M&&(v==null||v(A,{...g}),i==null||i({...g}),M=!1)});o.call(B)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var RC={exports:{}},LC={},OC={exports:{}},MC={};/**
|
|
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 ca=x;function BM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HM=typeof Object.is=="function"?Object.is:BM,UM=ca.useState,VM=ca.useEffect,WM=ca.useLayoutEffect,KM=ca.useDebugValue;function YM(e,t){var n=t(),r=UM({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return WM(function(){i.value=n,i.getSnapshot=t,Ph(i)&&o({inst:i})},[e,n,t]),VM(function(){return Ph(i)&&o({inst:i}),e(function(){Ph(i)&&o({inst:i})})},[e]),KM(n),n}function Ph(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HM(e,n)}catch{return!0}}function qM(e,t){return t()}var GM=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qM:YM;MC.useSyncExternalStore=ca.useSyncExternalStore!==void 0?ca.useSyncExternalStore:GM;OC.exports=MC;var DC=OC.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 tp=x,XM=DC;function QM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var JM=typeof Object.is=="function"?Object.is:QM,ZM=XM.useSyncExternalStore,eD=tp.useRef,tD=tp.useEffect,nD=tp.useMemo,rD=tp.useDebugValue;LC.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=eD(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=nD(function(){function l(h){if(!u){if(u=!0,f=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,JM(f,h))return m;var v=r(h);return i!==void 0&&i(m,v)?(f=h,m):(f=h,d=v)}var u=!1,f,d,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=ZM(e,o[0],o[1]);return tD(function(){s.hasValue=!0,s.value=a},[a]),rD(a),a};RC.exports=LC;var iD=RC.exports;const oD=ro(iD),sD={},lv=e=>{let t;const n=new Set,r=(f,d)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(sD?"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,l);return l},aD=e=>e?lv(e):lv,{useDebugValue:lD}=ke,{useSyncExternalStoreWithSelector:cD}=oD,uD=e=>e;function FC(e,t=uD,n){const r=cD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lD(r),r}const cv=(e,t)=>{const n=aD(e),r=(i,o=t)=>FC(n,i,o);return Object.assign(r,n),r},dD=(e,t)=>e?cv(e,t):cv;function st(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 np=x.createContext(null),fD=np.Provider,$C=Vr.error001();function ze(e,t){const n=x.useContext(np);if(n===null)throw new Error($C);return FC(n,e,t)}function at(){const e=x.useContext(np);if(e===null)throw new Error($C);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const uv={display:"none"},pD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},zC="react-flow__node-desc",BC="react-flow__edge-desc",hD="react-flow__aria-live",mD=e=>e.ariaLiveMessage,gD=e=>e.ariaLabelConfig;function yD({rfId:e}){const t=ze(mD);return c.jsx("div",{id:`${hD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:pD,children:t})}function xD({rfId:e,disableKeyboardA11y:t}){const n=ze(gD);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${zC}-${e}`,style:uv,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${BC}-${e}`,style:uv,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(yD,{rfId:e})]})}const ua=x.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=`${e}`.split("-");return c.jsx("div",{className:Nt(["react-flow__panel",n,...s]),style:r,ref:o,...i,children:t})});ua.displayName="Panel";function wD({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(ua,{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:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vD=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}},qu=e=>e.id;function bD(e,t){return st(e.selectedNodes.map(qu),t.selectedNodes.map(qu))&&st(e.selectedEdges.map(qu),t.selectedEdges.map(qu))}function SD({onSelectionChange:e}){const t=at(),{selectedNodes:n,selectedEdges:r}=ze(vD,bD);return x.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const kD=e=>!!e.onSelectionChangeHandlers;function ND({onSelectionChange:e}){const t=ze(kD);return e||t?c.jsx(SD,{onSelectionChange:e}):null}const wg=typeof window<"u"?x.useLayoutEffect:x.useEffect,HC=[0,0],CD={x:0,y:0,zoom:1},ED=["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"],dv=[...ED,"rfId"],jD=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}),fv={translateExtent:lc,nodeOrigin:HC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function PD(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ze(jD,st),u=at();wg(()=>(l(e.defaultNodes,e.defaultEdges),()=>{f.current=fv,a()}),[]);const f=x.useRef(fv);return wg(()=>{for(const d of dv){const p=e[d],h=f.current[d];p!==h&&(typeof e[d]>"u"||(d==="nodes"?t(p):d==="edges"?n(p):d==="minZoom"?r(p):d==="maxZoom"?i(p):d==="translateExtent"?o(p):d==="nodeExtent"?s(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:ZO(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}f.current=e},dv.map(d=>e[d])),null}function pv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _D(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const i=pv(),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=pv())!=null&&r.matches?"dark":"light"}const hv=typeof document<"u"?document:null;function fc(e=null,t={target:hv,actInsideInputWithModifier:!0}){const[n,r]=x.useState(!1),i=x.useRef(!1),o=x.useRef(new Set([])),[s,a]=x.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
|
-
`)),f=u.reduce((d,p)=>d.concat(...p),[]);return[u,f]}return[[],[]]},[e]);return x.useEffect(()=>{const l=(t==null?void 0:t.target)??hv,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=h=>{var k,g;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!u)&&mC(h))return!1;const v=gv(h.code,a);if(o.current.add(h[v]),mv(s,o.current,!1)){const w=((g=(k=h.composedPath)==null?void 0:k.call(h))==null?void 0:g[0])||h.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&h.preventDefault(),r(!0)}},d=h=>{const m=gv(h.code,a);mv(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[m]),h.key==="Meta"&&o.current.clear(),i.current=!1},p=()=>{o.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",f),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",f),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),n}function mv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function gv(e,t){return t.includes(e)?"code":"key"}const ID=()=>{const e=at();return x.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(),l=Qy(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{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:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},f=n.snapGrid??i,d=n.snapToGrid??o;return Oc(u,r,d,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=uf(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function UC(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 l of s)AD(l,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 AD(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 VC(e,t){return UC(e,t)}function WC(e,t){return UC(e,t)}function Co(e,t){return{id:e,type:"select",selected:t}}function Ls(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(Co(o.id,s)))}return r}function yv({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),l=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===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 xv(e){return{id:e.id,type:"remove"}}const wv=e=>UO(e),TD=e=>aC(e);function KC(e){return x.forwardRef(e)}function vv(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>RD(()=>n(i=>i+BigInt(1))));return wg(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function RD(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const YC=x.createContext(null);function LD({children:e}){const t=at(),n=x.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:f,onNodesChange:d,nodeLookup:p,fitViewQueued:h,onNodesChangeMiddlewareMap:m}=t.getState();let v=l;for(const g of a)v=typeof g=="function"?g(v):g;let k=yv({items:v,lookup:p});for(const g of m.values())k=g(k);f&&u(v),k.length>0?d==null||d(k):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:w,setNodes:y}=t.getState();g&&y(w)})},[]),r=vv(n),i=x.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:f,onEdgesChange:d,edgeLookup:p}=t.getState();let h=l;for(const m of a)h=typeof m=="function"?m(h):m;f?u(h):d&&d(yv({items:h,lookup:p}))},[]),o=vv(i),s=x.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return c.jsx(YC.Provider,{value:s,children:e})}function OD(){const e=x.useContext(YC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const MD=e=>!!e.panZoom;function Mc(){const e=ID(),t=at(),n=OD(),r=ze(MD),i=x.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},l=d=>{var g,w;const{nodeLookup:p,nodeOrigin:h}=t.getState(),m=wv(d)?d:p.get(d.id),v=m.parentId?pC(m.position,m.measured,m.parentId,p,h):m.position,k={...m,position:v,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((w=m.measured)==null?void 0:w.height)??m.height};return sa(k)},u=(d,p,h={replace:!1})=>{s(m=>m.map(v=>{if(v.id===d){const k=typeof p=="function"?p(v):p;return h.replace&&wv(k)?k:{...v,...k}}return v}))},f=(d,p,h={replace:!1})=>{a(m=>m.map(v=>{if(v.id===d){const k=typeof p=="function"?p(v):p;return h.replace&&TD(k)?k:{...v,...k}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=o(d))==null?void 0:p.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(p=>({...p}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:a,addNodes:d=>{const p=Array.isArray(d)?d:[d];n.nodeQueue.push(h=>[...h,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];n.edgeQueue.push(h=>[...h,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:h}=t.getState(),[m,v,k]=h;return{nodes:d.map(g=>({...g})),edges:p.map(g=>({...g})),viewport:{x:m,y:v,zoom:k}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:h,edges:m,onNodesDelete:v,onEdgesDelete:k,triggerNodeChanges:g,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:N}=t.getState(),{nodes:E,edges:S}=await qO({nodesToRemove:d,edgesToRemove:p,nodes:h,edges:m,onBeforeDelete:N}),P=S.length>0,T=E.length>0;if(P){const M=S.map(xv);k==null||k(S),w(M)}if(T){const M=E.map(xv);v==null||v(E),g(M)}return(T||P)&&(y==null||y({nodes:E,edges:S})),{deletedNodes:E,deletedEdges:S}},getIntersectingNodes:(d,p=!0,h)=>{const m=G0(d),v=m?d:l(d),k=h!==void 0;return v?(h||t.getState().nodes).filter(g=>{const w=t.getState().nodeLookup.get(g.id);if(w&&!m&&(g.id===d.id||!w.internals.positionAbsolute))return!1;const y=sa(k?g:w),N=uc(y,v);return p&&N>0||N>=y.width*y.height||N>=v.width*v.height}):[]},isNodeIntersecting:(d,p,h=!0)=>{const v=G0(d)?d:l(d);if(!v)return!1;const k=uc(v,p);return h&&k>0||k>=p.width*p.height||k>=v.width*v.height},updateNode:u,updateNodeData:(d,p,h={replace:!1})=>{u(d,m=>{const v=typeof p=="function"?p(m):p;return h.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},h)},updateEdge:f,updateEdgeData:(d,p,h={replace:!1})=>{f(d,m=>{const v=typeof p=="function"?p(m):p;return h.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},h)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:h}=t.getState();return VO(d,{nodeLookup:p,nodeOrigin:h})},getHandleConnections:({type:d,id:p,nodeId:h})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${h}-${d}${p?`-${p}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:h})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${h}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:m.values())??[])},fitView:async d=>{const p=t.getState().fitViewResolver??JO();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),n.nodeQueue.push(h=>[...h]),p.promise}}},[]);return x.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const bv=e=>e.selected,DD=typeof window<"u"?window:void 0;function FD({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=at(),{deleteElements:r}=Mc(),i=fc(e,{actInsideInputWithModifier:!1}),o=fc(t,{target:DD});x.useEffect(()=>{if(i){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(bv),edges:s.filter(bv)}),n.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function $D(e){const t=at();x.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=Jy(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",Vr.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 rp={position:"absolute",width:"100%",height:"100%",top:0,left:0},zD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function BD({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=Lo.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:f,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:h=!0,children:m,noWheelClassName:v,noPanClassName:k,onViewportChange:g,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:N}){const E=at(),S=x.useRef(null),{userSelectionActive:P,lib:T,connectionInProgress:M}=ze(zD,st),B=fc(p),A=x.useRef();$D(S);const R=x.useCallback(V=>{g==null||g({x:V[0],y:V[1],zoom:V[2]}),w||E.setState({transform:V})},[g,w]);return x.useEffect(()=>{if(S.current){A.current=LM({domNode:S.current,minZoom:f,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:D=>E.setState($=>$.paneDragging===D?$:{paneDragging:D}),onPanZoomStart:(D,$)=>{const{onViewportChangeStart:_,onMoveStart:I}=E.getState();I==null||I(D,$),_==null||_($)},onPanZoom:(D,$)=>{const{onViewportChange:_,onMove:I}=E.getState();I==null||I(D,$),_==null||_($)},onPanZoomEnd:(D,$)=>{const{onViewportChangeEnd:_,onMoveEnd:I}=E.getState();I==null||I(D,$),_==null||_($)}});const{x:V,y:L,zoom:H}=A.current.getViewport();return E.setState({panZoom:A.current,transform:[V,L,H],domNode:S.current.closest(".react-flow")}),()=>{var D;(D=A.current)==null||D.destroy()}}},[]),x.useEffect(()=>{var V;(V=A.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:B,preventScrolling:h,noPanClassName:k,userSelectionActive:P,noWheelClassName:v,lib:T,onTransformChange:R,connectionInProgress:M,selectionOnDrag:N,paneClickDistance:y})},[e,t,n,r,i,o,s,a,B,h,k,P,v,T,R,M,N,y]),c.jsx("div",{className:"react-flow__renderer",ref:S,style:rp,children:m})}const HD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function UD(){const{userSelectionActive:e,userSelectionRect:t}=ze(HD,st);return e&&t?c.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 _h=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},VD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function WD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=cc.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:h,children:m}){const v=at(),{userSelectionActive:k,elementsSelectable:g,dragging:w,connectionInProgress:y}=ze(VD,st),N=g&&(e||k),E=x.useRef(null),S=x.useRef(),P=x.useRef(new Set),T=x.useRef(new Set),M=x.useRef(!1),B=_=>{if(M.current||y){M.current=!1;return}l==null||l(_),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},A=_=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){_.preventDefault();return}u==null||u(_)},R=f?_=>f(_):void 0,V=_=>{M.current&&(_.stopPropagation(),M.current=!1)},L=_=>{var ee,ne;const{domNode:I}=v.getState();if(S.current=I==null?void 0:I.getBoundingClientRect(),!S.current)return;const C=_.target===E.current;if(!C&&!!_.target.closest(".nokey")||!e||!(o&&C||t)||_.button!==0||!_.isPrimary)return;(ne=(ee=_.target)==null?void 0:ee.setPointerCapture)==null||ne.call(ee,_.pointerId),M.current=!1;const{x:O,y:q}=dr(_.nativeEvent,S.current);v.setState({userSelectionRect:{width:0,height:0,startX:O,startY:q,x:O,y:q}}),C||(_.stopPropagation(),_.preventDefault())},H=_=>{const{userSelectionRect:I,transform:C,nodeLookup:F,edgeLookup:U,connectionLookup:O,triggerNodeChanges:q,triggerEdgeChanges:ee,defaultEdgeOptions:ne,resetSelectedElements:ae}=v.getState();if(!S.current||!I)return;const{x:J,y:le}=dr(_.nativeEvent,S.current),{startX:Se,startY:ye}=I;if(!M.current){const Le=t?0:i;if(Math.hypot(J-Se,le-ye)<=Le)return;ae(),s==null||s(_)}M.current=!0;const ge={startX:Se,startY:ye,x:J<Se?J:Se,y:le<ye?le:ye,width:Math.abs(J-Se),height:Math.abs(le-ye)},xe=P.current,$e=T.current;P.current=new Set(Xy(F,ge,C,n===cc.Partial,!0).map(Le=>Le.id)),T.current=new Set;const Ke=(ne==null?void 0:ne.selectable)??!0;for(const Le of P.current){const mt=O.get(Le);if(mt)for(const{edgeId:_t}of mt.values()){const Dt=U.get(_t);Dt&&(Dt.selectable??Ke)&&T.current.add(_t)}}if(!X0(xe,P.current)){const Le=Ls(F,P.current,!0);q(Le)}if(!X0($e,T.current)){const Le=Ls(U,T.current);ee(Le)}v.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})},D=_=>{var I,C;_.button===0&&((C=(I=_.target)==null?void 0:I.releasePointerCapture)==null||C.call(I,_.pointerId),!k&&_.target===E.current&&v.getState().userSelectionRect&&(B==null||B(_)),v.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(_),v.setState({nodesSelectionActive:P.current.size>0})))},$=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:Nt(["react-flow__pane",{draggable:$,dragging:w,selection:e}]),onClick:N?void 0:_h(B,E),onContextMenu:_h(A,E),onWheel:_h(R,E),onPointerEnter:N?void 0:d,onPointerMove:N?H:p,onPointerUp:N?D:void 0,onPointerDownCapture:N?L:void 0,onClickCapture:N?V:void 0,onPointerLeave:h,ref:E,style:rp,children:[m,c.jsx(UD,{})]})}function vg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",Vr.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):i([e])}function qC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const a=at(),[l,u]=x.useState(!1),f=x.useRef();return x.useEffect(()=>{f.current=vM({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{vg({id:d,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),x.useEffect(()=>{if(!(t||!e.current||!f.current))return f.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var d;(d=f.current)==null||d.destroy()}},[n,r,t,o,e,i,s]),l}const KD=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function GC(){const e=at();return x.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:f}=e.getState(),d=new Map,p=KD(s),h=i?o[0]:5,m=i?o[1]:5,v=n.direction.x*h*n.factor,k=n.direction.y*m*n.factor;for(const[,g]of u){if(!p(g))continue;let w={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+k};i&&(w=Lc(w,o));const{position:y,positionAbsolute:N}=lC({nodeId:g.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:f,onError:a});g.position=y,g.internals.positionAbsolute=N,d.set(g.id,g)}l(d)},[])}const ix=x.createContext(null),YD=ix.Provider;ix.Consumer;const XC=()=>x.useContext(ix),qD=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),GD=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:a,toHandle:l,isValid:u}=s,f=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===ia.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:f&&u}};function XD({type:e="source",position:t=be.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:f,onTouchStart:d,...p},h){var H,D;const m=s||null,v=e==="target",k=at(),g=XC(),{connectOnClick:w,noPanClassName:y,rfId:N}=ze(qD,st),{connectingFrom:E,connectingTo:S,clickConnecting:P,isPossibleEndHandle:T,connectionInProcess:M,clickConnectionInProcess:B,valid:A}=ze(GD(g,m,e),st);g||(D=(H=k.getState()).onError)==null||D.call(H,"010",Vr.error010());const R=$=>{const{defaultEdgeOptions:_,onConnect:I,hasDefaultEdges:C}=k.getState(),F={..._,...$};if(C){const{edges:U,setEdges:O}=k.getState();O(vC(F,U))}I==null||I(F),a==null||a(F)},V=$=>{if(!g)return;const _=gC($.nativeEvent);if(i&&(_&&$.button===0||!_)){const I=k.getState();xg.onPointerDown($.nativeEvent,{handleDomNode:$.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:v,handleId:m,nodeId:g,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...C)=>{var F,U;return(U=(F=k.getState()).onConnectEnd)==null?void 0:U.call(F,...C)},updateConnection:I.updateConnection,onConnect:R,isValidConnection:n||((...C)=>{var F,U;return((U=(F=k.getState()).isValidConnection)==null?void 0:U.call(F,...C))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}_?f==null||f($):d==null||d($)},L=$=>{const{onClickConnectStart:_,onClickConnectEnd:I,connectionClickStartHandle:C,connectionMode:F,isValidConnection:U,lib:O,rfId:q,nodeLookup:ee,connection:ne}=k.getState();if(!g||!C&&!i)return;if(!C){_==null||_($.nativeEvent,{nodeId:g,handleId:m,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const ae=hC($.target),J=n||U,{connection:le,isValid:Se}=xg.isValid($.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:F,fromNodeId:C.nodeId,fromHandleId:C.id||null,fromType:C.type,isValidConnection:J,flowId:q,doc:ae,lib:O,nodeLookup:ee});Se&&le&&R(le);const ye=structuredClone(ne);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,I==null||I($,ye),k.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${N}-${g}-${m}-${e}`,className:Nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:o,clickconnecting:P,connectingfrom:E,connectingto:S,valid:A,connectionindicator:r&&(!M||T)&&(M||B?o:i)}]),onMouseDown:V,onTouchStart:V,onClick:w?L:void 0,ref:h,...p,children:l})}const da=x.memo(KC(XD));function QD({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(da,{type:"source",position:n,isConnectable:t})]})}function JD({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:r=be.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(da,{type:"source",position:r,isConnectable:t})]})}function ZD(){return null}function eF({data:e,isConnectable:t,targetPosition:n=be.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const df={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Sv={input:QD,default:JD,output:eF,group:ZD};function tF(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}=Rc(e.nodeLookup,{filter:o=>!!o.selected});return{width:ur(t)?t:null,height:ur(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 rF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=at(),{width:i,height:o,transformString:s,userSelectionActive:a}=ze(nF,st),l=GC(),u=x.useRef(null);x.useEffect(()=>{var h;n||(h=u.current)==null||h.focus({preventScroll:!0})},[n]);const f=!a&&i!==null&&o!==null;if(qC({nodeRef:u,disabled:!f}),!f)return null;const d=e?h=>{const m=r.getState().nodes.filter(v=>v.selected);e(h,m)}:void 0,p=h=>{Object.prototype.hasOwnProperty.call(df,h.key)&&(h.preventDefault(),l({direction:df[h.key],factor:h.shiftKey?4:1}))};return c.jsx("div",{className:Nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:c.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:i,height:o}})})}const kv=typeof window<"u"?window:void 0,iF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function QC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:f,selectionMode:d,onSelectionStart:p,onSelectionEnd:h,multiSelectionKeyCode:m,panActivationKeyCode:v,zoomActivationKeyCode:k,elementsSelectable:g,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:N,panOnScrollSpeed:E,panOnScrollMode:S,zoomOnDoubleClick:P,panOnDrag:T,defaultViewport:M,translateExtent:B,minZoom:A,maxZoom:R,preventScrolling:V,onSelectionContextMenu:L,noWheelClassName:H,noPanClassName:D,disableKeyboardA11y:$,onViewportChange:_,isControlledViewport:I}){const{nodesSelectionActive:C,userSelectionActive:F}=ze(iF,st),U=fc(u,{target:kv}),O=fc(v,{target:kv}),q=O||T,ee=O||N,ne=f&&q!==!0,ae=U||F||ne;return FD({deleteKeyCode:l,multiSelectionKeyCode:m}),c.jsx(BD,{onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:ee,panOnScrollSpeed:E,panOnScrollMode:S,zoomOnDoubleClick:P,panOnDrag:!U&&q,defaultViewport:M,translateExtent:B,minZoom:A,maxZoom:R,zoomActivationKeyCode:k,preventScrolling:V,noWheelClassName:H,noPanClassName:D,onViewportChange:_,isControlledViewport:I,paneClickDistance:a,selectionOnDrag:ne,children:c.jsxs(WD,{onSelectionStart:p,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:ne,children:[e,C&&c.jsx(rF,{onSelectionContextMenu:L,noPanClassName:D,disableKeyboardA11y:$})]})})}QC.displayName="FlowRenderer";const oF=x.memo(QC),sF=e=>t=>e?Xy(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 aF(e){return ze(x.useCallback(sF(e),[e]),st)}const lF=e=>e.updateNodeInternals;function cF(){const e=ze(lF),[t]=x.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 x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function uF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=at(),o=x.useRef(null),s=x.useRef(null),a=x.useRef(e.sourcePosition),l=x.useRef(e.targetPosition),u=x.useRef(t),f=n&&!!e.internals.handleBounds;return x.useEffect(()=>{o.current&&!e.hidden&&(!f||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[f,e.hidden]),x.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),x.useEffect(()=>{if(o.current){const d=u.current!==t,p=a.current!==e.sourcePosition,h=l.current!==e.targetPosition;(d||p||h)&&(u.current=t,a.current=e.sourcePosition,l.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 dF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:f,resizeObserver:d,noDragClassName:p,noPanClassName:h,disableKeyboardA11y:m,rfId:v,nodeTypes:k,nodeClickDistance:g,onError:w}){const{node:y,internals:N,isParent:E}=ze(J=>{const le=J.nodeLookup.get(e),Se=J.parentLookup.has(e);return{node:le,internals:le.internals,isParent:Se}},st);let S=y.type||"default",P=(k==null?void 0:k[S])||Sv[S];P===void 0&&(w==null||w("003",Vr.error003(S)),S="default",P=(k==null?void 0:k.default)||Sv.default);const T=!!(y.draggable||a&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),B=!!(y.connectable||u&&typeof y.connectable>"u"),A=!!(y.focusable||f&&typeof y.focusable>"u"),R=at(),V=fC(y),L=uF({node:y,nodeType:S,hasDimensions:V,resizeObserver:d}),H=qC({nodeRef:L,disabled:y.hidden||!T,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:g}),D=GC();if(y.hidden)return null;const $=mi(y),_=tF(y),I=M||T||t||n||r||i,C=n?J=>n(J,{...N.userNode}):void 0,F=r?J=>r(J,{...N.userNode}):void 0,U=i?J=>i(J,{...N.userNode}):void 0,O=o?J=>o(J,{...N.userNode}):void 0,q=s?J=>s(J,{...N.userNode}):void 0,ee=J=>{const{selectNodesOnDrag:le,nodeDragThreshold:Se}=R.getState();M&&(!le||!T||Se>0)&&vg({id:e,store:R,nodeRef:L}),t&&t(J,{...N.userNode})},ne=J=>{if(!(mC(J.nativeEvent)||m)){if(rC.includes(J.key)&&M){const le=J.key==="Escape";vg({id:e,store:R,unselect:le,nodeRef:L})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(df,J.key)){J.preventDefault();const{ariaLabelConfig:le}=R.getState();R.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),D({direction:df[J.key],factor:J.shiftKey?4:1})}}},ae=()=>{var $e;if(m||!(($e=L.current)!=null&&$e.matches(":focus-visible")))return;const{transform:J,width:le,height:Se,autoPanOnNodeFocus:ye,setCenter:ge}=R.getState();if(!ye)return;Xy(new Map([[e,y]]),{x:0,y:0,width:le,height:Se},J,!0).length>0||ge(y.position.x+$.width/2,y.position.y+$.height/2,{zoom:J[2]})};return c.jsx("div",{className:Nt(["react-flow__node",`react-flow__node-${S}`,{[h]:T},y.className,{selected:y.selected,selectable:M,parent:E,draggable:T,dragging:H}]),ref:L,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:V?"visible":"hidden",...y.style,..._},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:C,onMouseMove:F,onMouseLeave:U,onContextMenu:O,onClick:ee,onDoubleClick:q,onKeyDown:A?ne:void 0,tabIndex:A?0:void 0,onFocus:A?ae:void 0,role:y.ariaRole??(A?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${zC}-${v}`,"aria-label":y.ariaLabel,...y.domAttributes,children:c.jsx(YD,{value:e,children:c.jsx(P,{id:e,data:y.data,type:S,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:T,deletable:y.deletable??!0,isConnectable:B,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:H,dragHandle:y.dragHandle,zIndex:N.z,parentId:y.parentId,...$})})})}var fF=x.memo(dF);const pF=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function JC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=ze(pF,st),s=aF(e.onlyRenderVisibleElements),a=cF();return c.jsx("div",{className:"react-flow__nodes",style:rp,children:s.map(l=>c.jsx(fF,{id:l,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},l))})}JC.displayName="NodeRenderer";const hF=x.memo(JC);function mF(e){return ze(x.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]),st)}const gF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},yF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Nv={[Zi.Arrow]:gF,[Zi.ArrowClosed]:yF};function xF(e){const t=at();return x.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Nv,e)?Nv[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Vr.error009(e)),null)},[e])}const wF=({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 l=xF(t);return l?c.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:c.jsx(l,{color:n,strokeWidth:s})}):null},ZC=({defaultColor:e,rfId:t})=>{const n=ze(o=>o.edges),r=ze(o=>o.defaultEdgeOptions),i=x.useMemo(()=>cM(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?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:i.map(o=>c.jsx(wF,{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};ZC.displayName="MarkerDefinitions";var vF=x.memo(ZC);function eE({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...f}){const[d,p]=x.useState({x:1,y:0,width:0,height:0}),h=Nt(["react-flow__edge-textwrapper",u]),m=x.useRef(null);return x.useEffect(()=>{if(m.current){const v=m.current.getBBox();p({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...f,children:[i&&c.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}),c.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}eE.displayName="EdgeText";const bF=x.memo(eE);function ip({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...f}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...f,d:e,fill:"none",className:Nt(["react-flow__edge-path",f.className])}),u?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ur(t)&&ur(n)?c.jsx(bF,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Cv({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 tE({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:i,targetPosition:o=be.Top}){const[s,a]=Cv({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=Cv({pos:o,x1:r,y1:i,x2:e,y2:t}),[f,d,p,h]=yC({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${i}`,f,d,p,h]}function nE(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:k,interactionWidth:g})=>{const[w,y,N]=tE({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a}),E=e.isInternal?void 0:t;return c.jsx(ip,{id:E,path:w,labelX:y,labelY:N,label:l,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:k,interactionWidth:g})})}const SF=nE({isInternal:!1}),rE=nE({isInternal:!0});SF.displayName="SimpleBezierEdge";rE.displayName="SimpleBezierEdgeInternal";function iE(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:p,sourcePosition:h=be.Bottom,targetPosition:m=be.Top,markerEnd:v,markerStart:k,pathOptions:g,interactionWidth:w})=>{const[y,N,E]=mg({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}),S=e.isInternal?void 0:t;return c.jsx(ip,{id:S,path:y,labelX:N,labelY:E,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:p,markerEnd:v,markerStart:k,interactionWidth:w})})}const oE=iE({isInternal:!1}),sE=iE({isInternal:!0});oE.displayName="SmoothStepEdge";sE.displayName="SmoothStepEdgeInternal";function aE(e){return x.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return c.jsx(oE,{...n,id:r,pathOptions:x.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const kF=aE({isInternal:!1}),lE=aE({isInternal:!0});kF.displayName="StepEdge";lE.displayName="StepEdgeInternal";function cE(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:m,interactionWidth:v})=>{const[k,g,w]=bC({sourceX:n,sourceY:r,targetX:i,targetY:o}),y=e.isInternal?void 0:t;return c.jsx(ip,{id:y,path:k,labelX:g,labelY:w,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:m,interactionWidth:v})})}const NF=cE({isInternal:!1}),uE=cE({isInternal:!0});NF.displayName="StraightEdge";uE.displayName="StraightEdgeInternal";function dE(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=be.Bottom,targetPosition:a=be.Top,label:l,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:k,pathOptions:g,interactionWidth:w})=>{const[y,N,E]=xC({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a,curvature:g==null?void 0:g.curvature}),S=e.isInternal?void 0:t;return c.jsx(ip,{id:S,path:y,labelX:N,labelY:E,label:l,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:k,interactionWidth:w})})}const CF=dE({isInternal:!1}),fE=dE({isInternal:!0});CF.displayName="BezierEdge";fE.displayName="BezierEdgeInternal";const Ev={default:fE,straight:uE,step:lE,smoothstep:sE,simplebezier:rE},jv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},EF=(e,t,n)=>n===be.Left?e-t:n===be.Right?e+t:e,jF=(e,t,n)=>n===be.Top?e-t:n===be.Bottom?e+t:e,Pv="react-flow__edgeupdater";function _v({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a}){return c.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Nt([Pv,`${Pv}-${a}`]),cx:EF(t,r,e),cy:jF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function PF({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:f,onReconnectEnd:d,setReconnecting:p,setUpdateHover:h}){const m=at(),v=(N,E)=>{if(N.button!==0)return;const{autoPanOnConnect:S,domNode:P,connectionMode:T,connectionRadius:M,lib:B,onConnectStart:A,cancelConnection:R,nodeLookup:V,rfId:L,panBy:H,updateConnection:D}=m.getState(),$=E.type==="target",_=(F,U)=>{p(!1),d==null||d(F,n,E.type,U)},I=F=>u==null?void 0:u(n,F),C=(F,U)=>{p(!0),f==null||f(N,n,E.type),A==null||A(F,U)};xg.onPointerDown(N.nativeEvent,{autoPanOnConnect:S,connectionMode:T,connectionRadius:M,domNode:P,handleId:E.id,nodeId:E.nodeId,nodeLookup:V,isTarget:$,edgeUpdaterType:E.type,lib:B,flowId:L,cancelConnection:R,panBy:H,isValidConnection:(...F)=>{var U,O;return((O=(U=m.getState()).isValidConnection)==null?void 0:O.call(U,...F))??!0},onConnect:I,onConnectStart:C,onConnectEnd:(...F)=>{var U,O;return(O=(U=m.getState()).onConnectEnd)==null?void 0:O.call(U,...F)},onReconnectEnd:_,updateConnection:D,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},k=N=>v(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=N=>v(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>h(!0),y=()=>h(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(_v,{position:a,centerX:r,centerY:i,radius:t,onMouseDown:k,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&c.jsx(_v,{position:l,centerX:o,centerY:s,radius:t,onMouseDown:g,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function _F({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,rfId:m,edgeTypes:v,noPanClassName:k,onError:g,disableKeyboardA11y:w}){let y=ze(ge=>ge.edgeLookup.get(e));const N=ze(ge=>ge.defaultEdgeOptions);y=N?{...N,...y}:y;let E=y.type||"default",S=(v==null?void 0:v[E])||Ev[E];S===void 0&&(g==null||g("011",Vr.error011(E)),E="default",S=(v==null?void 0:v.default)||Ev.default);const P=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),B=x.useRef(null),[A,R]=x.useState(!1),[V,L]=x.useState(!1),H=at(),{zIndex:D,sourceX:$,sourceY:_,targetX:I,targetY:C,sourcePosition:F,targetPosition:U}=ze(x.useCallback(ge=>{const xe=ge.nodeLookup.get(y.source),$e=ge.nodeLookup.get(y.target);if(!xe||!$e)return{zIndex:y.zIndex,...jv};const Ke=lM({id:e,sourceNode:xe,targetNode:$e,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ge.connectionMode,onError:g});return{zIndex:tM({selected:y.selected,zIndex:y.zIndex,sourceNode:xe,targetNode:$e,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Ke||jv}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),st),O=x.useMemo(()=>y.markerStart?`url('#${gg(y.markerStart,m)}')`:void 0,[y.markerStart,m]),q=x.useMemo(()=>y.markerEnd?`url('#${gg(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||$===null||_===null||I===null||C===null)return null;const ee=ge=>{var Le;const{addSelectedEdges:xe,unselectNodesAndEdges:$e,multiSelectionActive:Ke}=H.getState();M&&(H.setState({nodesSelectionActive:!1}),y.selected&&Ke?($e({nodes:[],edges:[y]}),(Le=B.current)==null||Le.blur()):xe([e])),i&&i(ge,y)},ne=o?ge=>{o(ge,{...y})}:void 0,ae=s?ge=>{s(ge,{...y})}:void 0,J=a?ge=>{a(ge,{...y})}:void 0,le=l?ge=>{l(ge,{...y})}:void 0,Se=u?ge=>{u(ge,{...y})}:void 0,ye=ge=>{var xe;if(!w&&rC.includes(ge.key)&&M){const{unselectNodesAndEdges:$e,addSelectedEdges:Ke}=H.getState();ge.key==="Escape"?((xe=B.current)==null||xe.blur(),$e({edges:[y]})):Ke([e])}};return c.jsx("svg",{style:{zIndex:D},children:c.jsxs("g",{className:Nt(["react-flow__edge",`react-flow__edge-${E}`,y.className,k,{selected:y.selected,animated:y.animated,inactive:!M&&!i,updating:A,selectable:M}]),onClick:ee,onDoubleClick:ne,onContextMenu:ae,onMouseEnter:J,onMouseMove:le,onMouseLeave:Se,onKeyDown:P?ye:void 0,tabIndex:P?0:void 0,role:y.ariaRole??(P?"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":P?`${BC}-${m}`:void 0,ref:B,...y.domAttributes,children:[!V&&c.jsx(S,{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:_,targetX:I,targetY:C,sourcePosition:F,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}),T&&c.jsx(PF,{edge:y,isReconnectable:T,reconnectRadius:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,sourceX:$,sourceY:_,targetX:I,targetY:C,sourcePosition:F,targetPosition:U,setUpdateHover:R,setReconnecting:L})]})})}var IF=x.memo(_F);const AF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:f,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:h,onReconnectEnd:m,disableKeyboardA11y:v}){const{edgesFocusable:k,edgesReconnectable:g,elementsSelectable:w,onError:y}=ze(AF,st),N=mF(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(vF,{defaultColor:e,rfId:n}),N.map(E=>c.jsx(IF,{id:E,edgesFocusable:k,edgesReconnectable:g,elementsSelectable:w,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:f,reconnectRadius:d,onDoubleClick:p,onReconnectStart:h,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},E))]})}pE.displayName="EdgeRenderer";const TF=x.memo(pE),RF=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LF({children:e}){const t=ze(RF);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function OF(e){const t=Mc(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const MF=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function DF(e){const t=ze(MF),n=at();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function FF(e){return e.connection.inProgress?{...e.connection,to:Oc(e.connection.to,e.transform)}:{...e.connection}}function $F(e){return FF}function zF(e){const t=$F();return ze(t,st)}const BF=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function HF({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:a,inProgress:l}=ze(BF,st);return!(o&&i&&l)?null:c.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:Nt(["react-flow__connection",sC(a)]),children:c.jsx(hE,{style:t,type:n,CustomComponent:r,isValid:a})})})}const hE=({style:e,type:t=Oi.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:f,toHandle:d,toPosition:p,pointer:h}=zF();if(!i)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:sC(r),toNode:f,toHandle:d,pointer:h});let m="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(t){case Oi.Bezier:[m]=xC(v);break;case Oi.SimpleBezier:[m]=tE(v);break;case Oi.Step:[m]=mg({...v,borderRadius:0});break;case Oi.SmoothStep:[m]=mg(v);break;default:[m]=bC(v)}return c.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};hE.displayName="ConnectionLine";const UF={};function Iv(e=UF){x.useRef(e),at(),x.useEffect(()=>{},[e])}function VF(){at(),x.useRef(!1),x.useEffect(()=>{},[])}function mE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:f,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:h,connectionLineType:m,connectionLineStyle:v,connectionLineComponent:k,connectionLineContainerStyle:g,selectionKeyCode:w,selectionOnDrag:y,selectionMode:N,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:P,deleteKeyCode:T,onlyRenderVisibleElements:M,elementsSelectable:B,defaultViewport:A,translateExtent:R,minZoom:V,maxZoom:L,preventScrolling:H,defaultMarkerColor:D,zoomOnScroll:$,zoomOnPinch:_,panOnScroll:I,panOnScrollSpeed:C,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:O,onPaneClick:q,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneScroll:J,onPaneContextMenu:le,paneClickDistance:Se,nodeClickDistance:ye,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:$e,onEdgeMouseLeave:Ke,reconnectRadius:Le,onReconnect:mt,onReconnectStart:_t,onReconnectEnd:Dt,noDragClassName:Fn,noWheelClassName:wr,noPanClassName:vr,disableKeyboardA11y:br,nodeExtent:he,rfId:gt,viewport:G,onViewportChange:Q}){return Iv(e),Iv(t),VF(),OF(n),DF(G),c.jsx(oF,{onPaneClick:q,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneContextMenu:le,onPaneScroll:J,paneClickDistance:Se,deleteKeyCode:T,selectionKeyCode:w,selectionOnDrag:y,selectionMode:N,onSelectionStart:p,onSelectionEnd:h,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:P,elementsSelectable:B,zoomOnScroll:$,zoomOnPinch:_,zoomOnDoubleClick:U,panOnScroll:I,panOnScrollSpeed:C,panOnScrollMode:F,panOnDrag:O,defaultViewport:A,translateExtent:R,minZoom:V,maxZoom:L,onSelectionContextMenu:d,preventScrolling:H,noDragClassName:Fn,noWheelClassName:wr,noPanClassName:vr,disableKeyboardA11y:br,onViewportChange:Q,isControlledViewport:!!G,children:c.jsxs(LF,{children:[c.jsx(TF,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:mt,onReconnectStart:_t,onReconnectEnd:Dt,onlyRenderVisibleElements:M,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:$e,onEdgeMouseLeave:Ke,reconnectRadius:Le,defaultMarkerColor:D,noPanClassName:vr,disableKeyboardA11y:br,rfId:gt}),c.jsx(HF,{style:v,type:m,component:k,containerStyle:g}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(hF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:f,nodeClickDistance:ye,onlyRenderVisibleElements:M,noPanClassName:vr,noDragClassName:Fn,disableKeyboardA11y:br,nodeExtent:he,rfId:gt}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}mE.displayName="GraphView";const WF=x.memo(mE),Av=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:f,nodeExtent:d,zIndexMode:p="basic"}={})=>{const h=new Map,m=new Map,v=new Map,k=new Map,g=r??t??[],w=n??e??[],y=f??[0,0],N=d??lc;NC(v,k,g);const{nodesInitialized:E}=yg(w,h,m,{nodeOrigin:y,nodeExtent:N,zIndexMode:p});let S=[0,0,1];if(s&&i&&o){const P=Rc(h,{filter:A=>!!((A.width||A.initialWidth)&&(A.height||A.initialHeight))}),{x:T,y:M,zoom:B}=Qy(P,i,o,l,u,(a==null?void 0:a.padding)??.1);S=[T,M,B]}return{rfId:"1",width:i??0,height:o??0,transform:S,nodes:w,nodesInitialized:E,nodeLookup:h,parentLookup:m,edges:g,edgeLookup:k,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:lc,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ia.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:{...oC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:GO,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:iC,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},KF=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:p})=>dD((h,m)=>{async function v(){const{nodeLookup:k,panZoom:g,fitViewOptions:w,fitViewResolver:y,width:N,height:E,minZoom:S,maxZoom:P}=m();g&&(await YO({nodes:k,width:N,height:E,panZoom:g,minZoom:S,maxZoom:P},w),y==null||y.resolve(!0),h({fitViewResolver:null}))}return{...Av({nodes:e,edges:t,width:i,height:o,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:f,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:p}),setNodes:k=>{const{nodeLookup:g,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:N,fitViewQueued:E,zIndexMode:S,nodesSelectionActive:P}=m(),{nodesInitialized:T,hasSelectedNodes:M}=yg(k,g,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:S}),B=P&&M;E&&T?(v(),h({nodes:k,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):h({nodes:k,nodesInitialized:T,nodesSelectionActive:B})},setEdges:k=>{const{connectionLookup:g,edgeLookup:w}=m();NC(g,w,k),h({edges:k})},setDefaultNodesAndEdges:(k,g)=>{if(k){const{setNodes:w}=m();w(k),h({hasDefaultNodes:!0})}if(g){const{setEdges:w}=m();w(g),h({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:g,nodeLookup:w,parentLookup:y,domNode:N,nodeOrigin:E,nodeExtent:S,debug:P,fitViewQueued:T,zIndexMode:M}=m(),{changes:B,updatedInternals:A}=gM(k,w,y,N,E,S,M);A&&(fM(w,y,{nodeOrigin:E,nodeExtent:S,zIndexMode:M}),T?(v(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(B==null?void 0:B.length)>0&&(P&&console.log("React Flow: trigger node changes",B),g==null||g(B)))},updateNodePositions:(k,g=!1)=>{const w=[];let y=[];const{nodeLookup:N,triggerNodeChanges:E,connection:S,updateConnection:P,onNodesChangeMiddlewareMap:T}=m();for(const[M,B]of k){const A=N.get(M),R=!!(A!=null&&A.expandParent&&(A!=null&&A.parentId)&&(B!=null&&B.position)),V={id:M,type:"position",position:R?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:g};if(A&&S.inProgress&&S.fromNode.id===A.id){const L=Wo(A,S.fromHandle,be.Left,!0);P({...S,from:L})}R&&A.parentId&&w.push({id:M,parentId:A.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),y.push(V)}if(w.length>0){const{parentLookup:M,nodeOrigin:B}=m(),A=rx(w,N,M,B);y.push(...A)}for(const M of T.values())y=M(y);E(y)},triggerNodeChanges:k=>{const{onNodesChange:g,setNodes:w,nodes:y,hasDefaultNodes:N,debug:E}=m();if(k!=null&&k.length){if(N){const S=VC(k,y);w(S)}E&&console.log("React Flow: trigger node changes",k),g==null||g(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:g,setEdges:w,edges:y,hasDefaultEdges:N,debug:E}=m();if(k!=null&&k.length){if(N){const S=WC(k,y);w(S)}E&&console.log("React Flow: trigger edge changes",k),g==null||g(k)}},addSelectedNodes:k=>{const{multiSelectionActive:g,edgeLookup:w,nodeLookup:y,triggerNodeChanges:N,triggerEdgeChanges:E}=m();if(g){const S=k.map(P=>Co(P,!0));N(S);return}N(Ls(y,new Set([...k]),!0)),E(Ls(w))},addSelectedEdges:k=>{const{multiSelectionActive:g,edgeLookup:w,nodeLookup:y,triggerNodeChanges:N,triggerEdgeChanges:E}=m();if(g){const S=k.map(P=>Co(P,!0));E(S);return}E(Ls(w,new Set([...k]))),N(Ls(y,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:g}={})=>{const{edges:w,nodes:y,nodeLookup:N,triggerNodeChanges:E,triggerEdgeChanges:S}=m(),P=k||y,T=g||w,M=[];for(const A of P){if(!A.selected)continue;const R=N.get(A.id);R&&(R.selected=!1),M.push(Co(A.id,!1))}const B=[];for(const A of T)A.selected&&B.push(Co(A.id,!1));E(M),S(B)},setMinZoom:k=>{const{panZoom:g,maxZoom:w}=m();g==null||g.setScaleExtent([k,w]),h({minZoom:k})},setMaxZoom:k=>{const{panZoom:g,minZoom:w}=m();g==null||g.setScaleExtent([w,k]),h({maxZoom:k})},setTranslateExtent:k=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(k),h({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:g,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:N}=m();if(!N)return;const E=g.reduce((P,T)=>T.selected?[...P,Co(T.id,!1)]:P,[]),S=k.reduce((P,T)=>T.selected?[...P,Co(T.id,!1)]:P,[]);w(E),y(S)},setNodeExtent:k=>{const{nodes:g,nodeLookup:w,parentLookup:y,nodeOrigin:N,elevateNodesOnSelect:E,nodeExtent:S,zIndexMode:P}=m();k[0][0]===S[0][0]&&k[0][1]===S[0][1]&&k[1][0]===S[1][0]&&k[1][1]===S[1][1]||(yg(g,w,y,{nodeOrigin:N,nodeExtent:k,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:P}),h({nodeExtent:k}))},panBy:k=>{const{transform:g,width:w,height:y,panZoom:N,translateExtent:E}=m();return yM({delta:k,panZoom:N,transform:g,translateExtent:E,width:w,height:y})},setCenter:async(k,g,w)=>{const{width:y,height:N,maxZoom:E,panZoom:S}=m();if(!S)return Promise.resolve(!1);const P=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await S.setViewport({x:y/2-k*P,y:N/2-g*P,zoom:P},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...oC}})},updateConnection:k=>{h({connection:k})},reset:()=>h({...Av()})}},Object.is);function gE({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:f,nodeExtent:d,zIndexMode:p,children:h}){const[m]=x.useState(()=>KF({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:f,nodeExtent:d,zIndexMode:p}));return c.jsx(fD,{value:m,children:c.jsx(LD,{children:h})})}function YF({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:f,nodeOrigin:d,nodeExtent:p,zIndexMode:h}){return x.useContext(np)?c.jsx(c.Fragment,{children:e}):c.jsx(gE,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:f,nodeOrigin:d,nodeExtent:p,zIndexMode:h,children:e})}const qF={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function GF({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:f,onMoveStart:d,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:k,onClickConnectEnd:g,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:N,onNodeContextMenu:E,onNodeDoubleClick:S,onNodeDragStart:P,onNodeDrag:T,onNodeDragStop:M,onNodesDelete:B,onEdgesDelete:A,onDelete:R,onSelectionChange:V,onSelectionDragStart:L,onSelectionDrag:H,onSelectionDragStop:D,onSelectionContextMenu:$,onSelectionStart:_,onSelectionEnd:I,onBeforeDelete:C,connectionMode:F,connectionLineType:U=Oi.Bezier,connectionLineStyle:O,connectionLineComponent:q,connectionLineContainerStyle:ee,deleteKeyCode:ne="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:J=!1,selectionMode:le=cc.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:ye=dc()?"Meta":"Control",zoomActivationKeyCode:ge=dc()?"Meta":"Control",snapToGrid:xe,snapGrid:$e,onlyRenderVisibleElements:Ke=!1,selectNodesOnDrag:Le,nodesDraggable:mt,autoPanOnNodeFocus:_t,nodesConnectable:Dt,nodesFocusable:Fn,nodeOrigin:wr=HC,edgesFocusable:vr,edgesReconnectable:br,elementsSelectable:he=!0,defaultViewport:gt=CD,minZoom:G=.5,maxZoom:Q=2,translateExtent:Ne=lc,preventScrolling:Ce=!0,nodeExtent:Ie,defaultMarkerColor:It="#b1b1b7",zoomOnScroll:Ct=!0,zoomOnPinch:Vt=!0,panOnScroll:tn=!1,panOnScrollSpeed:Jn=.5,panOnScrollMode:lt=Lo.Free,zoomOnDoubleClick:cn=!0,panOnDrag:Ft=!0,onPaneClick:gp,onPaneMouseEnter:yp,onPaneMouseMove:Vc,onPaneMouseLeave:Wc,onPaneScroll:Ea,onPaneContextMenu:ja,paneClickDistance:Qo=1,nodeClickDistance:ft=0,children:lo,onReconnect:Pa,onReconnectStart:Jo,onReconnectEnd:co,onEdgeContextMenu:Kc,onEdgeDoubleClick:Yc,onEdgeMouseEnter:qc,onEdgeMouseMove:yi,onEdgeMouseLeave:xp,reconnectRadius:Zo=10,onNodesChange:Gc,onEdgesChange:Xc,noDragClassName:xi="nodrag",noWheelClassName:_a="nowheel",noPanClassName:uo="nopan",fitView:es,fitViewOptions:$n,connectOnClick:Sr,attributionPosition:wp,proOptions:Qc,defaultEdgeOptions:wi,elevateNodesOnSelect:Jc=!0,elevateEdgesOnSelect:Zc=!1,disableKeyboardA11y:vi=!1,autoPanOnConnect:eu,autoPanOnNodeDrag:ts,autoPanSpeed:Wt,connectionRadius:Ia,isValidConnection:Zn,onError:Aa,style:kr,id:fo,nodeDragThreshold:Ta,connectionDragThreshold:po,viewport:At,onViewportChange:ns,width:ho,height:rs,colorMode:tu="light",debug:mo,onScroll:qr,ariaLabelConfig:is,zIndexMode:os="basic",...ss},vp){const Nn=fo||"1",Ra=_D(tu),nu=x.useCallback(bi=>{bi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),qr==null||qr(bi)},[qr]);return c.jsx("div",{"data-testid":"rf__wrapper",...ss,onScroll:nu,style:{...kr,...qF},ref:vp,className:Nt(["react-flow",i,Ra]),id:fo,role:"application",children:c.jsxs(YF,{nodes:e,edges:t,width:ho,height:rs,fitView:es,fitViewOptions:$n,minZoom:G,maxZoom:Q,nodeOrigin:wr,nodeExtent:Ie,zIndexMode:os,children:[c.jsx(PD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:k,onClickConnectEnd:g,nodesDraggable:mt,autoPanOnNodeFocus:_t,nodesConnectable:Dt,nodesFocusable:Fn,edgesFocusable:vr,edgesReconnectable:br,elementsSelectable:he,elevateNodesOnSelect:Jc,elevateEdgesOnSelect:Zc,minZoom:G,maxZoom:Q,nodeExtent:Ie,onNodesChange:Gc,onEdgesChange:Xc,snapToGrid:xe,snapGrid:$e,connectionMode:F,translateExtent:Ne,connectOnClick:Sr,defaultEdgeOptions:wi,fitView:es,fitViewOptions:$n,onNodesDelete:B,onEdgesDelete:A,onDelete:R,onNodeDragStart:P,onNodeDrag:T,onNodeDragStop:M,onSelectionDrag:H,onSelectionDragStart:L,onSelectionDragStop:D,onMove:f,onMoveStart:d,onMoveEnd:p,noPanClassName:uo,nodeOrigin:wr,rfId:Nn,autoPanOnConnect:eu,autoPanOnNodeDrag:ts,autoPanSpeed:Wt,onError:Aa,connectionRadius:Ia,isValidConnection:Zn,selectNodesOnDrag:Le,nodeDragThreshold:Ta,connectionDragThreshold:po,onBeforeDelete:C,debug:mo,ariaLabelConfig:is,zIndexMode:os}),c.jsx(WF,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:N,onNodeContextMenu:E,onNodeDoubleClick:S,nodeTypes:o,edgeTypes:s,connectionLineType:U,connectionLineStyle:O,connectionLineComponent:q,connectionLineContainerStyle:ee,selectionKeyCode:ae,selectionOnDrag:J,selectionMode:le,deleteKeyCode:ne,multiSelectionKeyCode:ye,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ke,defaultViewport:gt,translateExtent:Ne,minZoom:G,maxZoom:Q,preventScrolling:Ce,zoomOnScroll:Ct,zoomOnPinch:Vt,zoomOnDoubleClick:cn,panOnScroll:tn,panOnScrollSpeed:Jn,panOnScrollMode:lt,panOnDrag:Ft,onPaneClick:gp,onPaneMouseEnter:yp,onPaneMouseMove:Vc,onPaneMouseLeave:Wc,onPaneScroll:Ea,onPaneContextMenu:ja,paneClickDistance:Qo,nodeClickDistance:ft,onSelectionContextMenu:$,onSelectionStart:_,onSelectionEnd:I,onReconnect:Pa,onReconnectStart:Jo,onReconnectEnd:co,onEdgeContextMenu:Kc,onEdgeDoubleClick:Yc,onEdgeMouseEnter:qc,onEdgeMouseMove:yi,onEdgeMouseLeave:xp,reconnectRadius:Zo,defaultMarkerColor:It,noDragClassName:xi,noWheelClassName:_a,noPanClassName:uo,rfId:Nn,disableKeyboardA11y:vi,nodeExtent:Ie,viewport:At,onViewportChange:ns}),c.jsx(ND,{onSelectionChange:V}),lo,c.jsx(wD,{proOptions:Qc,position:wp}),c.jsx(xD,{rfId:Nn,disableKeyboardA11y:vi})]})})}var XF=KC(GF);function QF(e){const[t,n]=x.useState(e),r=x.useCallback(i=>n(o=>VC(i,o)),[]);return[t,n,r]}function JF(e){const[t,n]=x.useState(e),r=x.useCallback(i=>n(o=>WC(i,o)),[]);return[t,n,r]}function ZF({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nt(["react-flow__background-pattern",n,r])})}function e$({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:Nt(["react-flow__background-pattern","dots",t])})}var Gi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Gi||(Gi={}));const t$={[Gi.Dots]:1,[Gi.Lines]:1,[Gi.Cross]:6},n$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function yE({id:e,variant:t=Gi.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:a,style:l,className:u,patternClassName:f}){const d=x.useRef(null),{transform:p,patternId:h}=ze(n$,st),m=r||t$[t],v=t===Gi.Dots,k=t===Gi.Cross,g=Array.isArray(n)?n:[n,n],w=[g[0]*p[2]||1,g[1]*p[2]||1],y=m*p[2],N=Array.isArray(o)?o:[o,o],E=k?[y,y]:w,S=[N[0]*p[2]||1+E[0]/2,N[1]*p[2]||1+E[1]/2],P=`${h}${e||""}`;return c.jsxs("svg",{className:Nt(["react-flow__background",u]),style:{...l,...rp,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[c.jsx("pattern",{id:P,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?c.jsx(e$,{radius:y/2,className:f}):c.jsx(ZF,{dimensions:E,lineWidth:i,variant:t,className:f})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}yE.displayName="Background";const r$=x.memo(yE);function i$(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function o$(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function s$(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.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 a$(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.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 l$(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.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 Gu({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:Nt(["react-flow__controls-button",t]),...n,children:e})}const c$=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function xE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:f,position:d="bottom-left",orientation:p="vertical","aria-label":h}){const m=at(),{isInteractive:v,minZoomReached:k,maxZoomReached:g,ariaLabelConfig:w}=ze(c$,st),{zoomIn:y,zoomOut:N,fitView:E}=Mc(),S=()=>{y(),o==null||o()},P=()=>{N(),s==null||s()},T=()=>{E(i),a==null||a()},M=()=>{m.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},B=p==="horizontal"?"horizontal":"vertical";return c.jsxs(ua,{className:Nt(["react-flow__controls",B,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??w["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Gu,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:g,children:c.jsx(i$,{})}),c.jsx(Gu,{onClick:P,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:k,children:c.jsx(o$,{})})]}),n&&c.jsx(Gu,{className:"react-flow__controls-fitview",onClick:T,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:c.jsx(s$,{})}),r&&c.jsx(Gu,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:v?c.jsx(l$,{}):c.jsx(a$,{})}),f]})}xE.displayName="Controls";const u$=x.memo(xE);function d$({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:f,shapeRendering:d,selected:p,onClick:h}){const{background:m,backgroundColor:v}=o||{},k=s||m||v;return c.jsx("rect",{className:Nt(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:k,stroke:a,strokeWidth:l},shapeRendering:d,onClick:h?g=>h(g,e):void 0})}const f$=x.memo(d$),p$=e=>e.nodes.map(t=>t.id),Ih=e=>e instanceof Function?e:()=>e;function h$({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=f$,onClick:s}){const a=ze(p$,st),l=Ih(t),u=Ih(e),f=Ih(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:a.map(p=>c.jsx(g$,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:d},p))})}function m$({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:f,y:d,width:p,height:h}=ze(m=>{const v=m.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const k=v.internals.userNode,{x:g,y:w}=v.internals.positionAbsolute,{width:y,height:N}=mi(k);return{node:k,x:g,y:w,width:y,height:N}},st);return!u||u.hidden||!fC(u)?null:c.jsx(a,{x:f,y:d,width:p,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:o,shapeRendering:s,onClick:l,id:u.id})}const g$=x.memo(m$);var y$=x.memo(h$);const x$=200,w$=150,v$=e=>!e.hidden,b$=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?dC(Rc(e.nodeLookup,{filter:v$}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},S$="react-flow__minimap-desc";function wE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:f,maskStrokeWidth:d,position:p="bottom-right",onClick:h,onNodeClick:m,pannable:v=!1,zoomable:k=!1,ariaLabel:g,inversePan:w,zoomStep:y=1,offsetScale:N=5}){const E=at(),S=x.useRef(null),{boundingRect:P,viewBB:T,rfId:M,panZoom:B,translateExtent:A,flowWidth:R,flowHeight:V,ariaLabelConfig:L}=ze(b$,st),H=(e==null?void 0:e.width)??x$,D=(e==null?void 0:e.height)??w$,$=P.width/H,_=P.height/D,I=Math.max($,_),C=I*H,F=I*D,U=N*I,O=P.x-(C-P.width)/2-U,q=P.y-(F-P.height)/2-U,ee=C+U*2,ne=F+U*2,ae=`${S$}-${M}`,J=x.useRef(0),le=x.useRef();J.current=I,x.useEffect(()=>{if(S.current&&B)return le.current=EM({domNode:S.current,panZoom:B,getTransform:()=>E.getState().transform,getViewScale:()=>J.current}),()=>{var xe;(xe=le.current)==null||xe.destroy()}},[B]),x.useEffect(()=>{var xe;(xe=le.current)==null||xe.update({translateExtent:A,width:R,height:V,inversePan:w,pannable:v,zoomStep:y,zoomable:k})},[v,k,w,y,A,R,V]);const Se=h?xe=>{var Le;const[$e,Ke]=((Le=le.current)==null?void 0:Le.pointer(xe))||[0,0];h(xe,{x:$e,y:Ke})}:void 0,ye=m?x.useCallback((xe,$e)=>{const Ke=E.getState().nodeLookup.get($e).internals.userNode;m(xe,Ke)},[]):void 0,ge=g??L["minimap.ariaLabel"];return c.jsx(ua,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I: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:Nt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:H,height:D,viewBox:`${O} ${q} ${ee} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:S,onClick:Se,children:[ge&&c.jsx("title",{id:ae,children:ge}),c.jsx(y$,{onClick:ye,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:a}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-U},${q-U}h${ee+U*2}v${ne+U*2}h${-ee-U*2}z
|
|
63
|
-
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wE.displayName="MiniMap";const k$=x.memo(wE),N$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,C$={[la.Line]:"right",[la.Handle]:"bottom-right"};function E$({nodeId:e,position:t,variant:n=la.Handle,className:r,style:i=void 0,children:o,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:h=!0,shouldResize:m,onResizeStart:v,onResize:k,onResizeEnd:g}){const w=XC(),y=typeof e=="string"?e:w,N=at(),E=x.useRef(null),S=n===la.Handle,P=ze(x.useCallback(N$(S&&h),[S,h]),st),T=x.useRef(null),M=t??C$[n];x.useEffect(()=>{if(!(!E.current||!y))return T.current||(T.current=zM({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:A,transform:R,snapGrid:V,snapToGrid:L,nodeOrigin:H,domNode:D}=N.getState();return{nodeLookup:A,transform:R,snapGrid:V,snapToGrid:L,nodeOrigin:H,paneDomNode:D}},onChange:(A,R)=>{const{triggerNodeChanges:V,nodeLookup:L,parentLookup:H,nodeOrigin:D}=N.getState(),$=[],_={x:A.x,y:A.y},I=L.get(y);if(I&&I.expandParent&&I.parentId){const C=I.origin??D,F=A.width??I.measured.width??0,U=A.height??I.measured.height??0,O={id:I.id,parentId:I.parentId,rect:{width:F,height:U,...pC({x:A.x??I.position.x,y:A.y??I.position.y},{width:F,height:U},I.parentId,L,C)}},q=rx([O],L,H,D);$.push(...q),_.x=A.x?Math.max(C[0]*F,A.x):void 0,_.y=A.y?Math.max(C[1]*U,A.y):void 0}if(_.x!==void 0&&_.y!==void 0){const C={id:y,type:"position",position:{..._}};$.push(C)}if(A.width!==void 0&&A.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:A.width,height:A.height}};$.push(F)}for(const C of R){const F={...C,type:"position"};$.push(F)}V($)},onEnd:({width:A,height:R})=>{const V={id:y,type:"dimensions",resizing:!1,dimensions:{width:A,height:R}};N.getState().triggerNodeChanges([V])}})),T.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:f},keepAspectRatio:d,resizeDirection:p,onResizeStart:v,onResize:k,onResizeEnd:g,shouldResize:m}),()=>{var A;(A=T.current)==null||A.destroy()}},[M,a,l,u,f,d,v,k,g,m]);const B=M.split("-");return c.jsx("div",{className:Nt(["react-flow__resize-control","nodrag",...B,n,r]),ref:E,style:{...i,scale:P,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:o})}x.memo(E$);function j$(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function ff(e){if(e==null)return"null";if(typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>ff(r)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${ff(t[r])}`).join(",")}}`}function Tv(e){return ff({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 Rv(e){return ff({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 Lv(e,t){return!j$(t)||!("selected"in t)||t.selected===e.selected?e:{...e,selected:!!t.selected}}function Ov(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 P$(e,t,n,r){const i=new Map(e.map(w=>[w.id,w])),o=new Set(n.map(w=>w.id)),s=new Set,a=[],l=[],u=n.map(w=>{const y=i.get(w.id);return y?Tv(y)===Tv(w)?(s.add(w.id),y):(l.push(w.id),Lv(w,y)):(a.push(w.id),w)}),f=Ov(t),d=Ov(r,!0),p=new Set,h=[],m=[],v=r.map(w=>{const y=pc(w),N=f.get(y);return N?Rv(N)===Rv(w)?(p.add(y),N):(m.push(y),Lv(w,N)):(h.push(y),w)}),k=e.filter(w=>!o.has(w.id)).map(w=>w.id),g=t.map(w=>pc(w)).filter(w=>!d.has(w));return{nodes:u,edges:v,changes:{addedNodeIds:a,updatedNodeIds:l,removedNodeIds:k,addedEdgeKeys:h,updatedEdgeKeys:m,removedEdgeKeys:g},stats:{nodeAdded:a.length,nodeRemoved:k.length,nodeReused:s.size,edgeAdded:h.length,edgeRemoved:g.length,edgeReused:p.size,nextEdgeCount:d.size}}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function vE(e){return typeof e>"u"||e===null}function _$(e){return typeof e=="object"&&e!==null}function I$(e){return Array.isArray(e)?e:vE(e)?[]:[e]}function A$(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 T$(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function R$(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var L$=vE,O$=_$,M$=I$,D$=T$,F$=R$,$$=A$,jt={isNothing:L$,isObject:O$,toArray:M$,repeat:D$,isNegativeZero:F$,extend:$$};function bE(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 hc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=bE(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}hc.prototype=Object.create(Error.prototype);hc.prototype.constructor=hc;hc.prototype.toString=function(t){return this.name+": "+bE(this,t)};var on=hc;function Ah(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 Th(e,t){return jt.repeat(" ",t-e.length)+e}function z$(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="",l,u,f=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=Ah(e.buffer,r[s-l],i[s-l],e.position-(r[s]-r[s-l]),d),a=jt.repeat(" ",t.indent)+Th((e.line-l+1).toString(),f)+" | "+u.str+`
|
|
66
|
-
`+a;for(u=Ah(e.buffer,r[s],i[s],e.position,d),a+=jt.repeat(" ",t.indent)+Th((e.line+1).toString(),f)+" | "+u.str+`
|
|
67
|
-
`,a+=jt.repeat("-",t.indent+f+3+u.pos)+`^
|
|
68
|
-
`,l=1;l<=t.linesAfter&&!(s+l>=i.length);l++)u=Ah(e.buffer,r[s+l],i[s+l],e.position-(r[s]-r[s+l]),d),a+=jt.repeat(" ",t.indent)+Th((e.line+l+1).toString(),f)+" | "+u.str+`
|
|
69
|
-
`;return a.replace(/\n$/,"")}var B$=z$,H$=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],U$=["scalar","sequence","mapping"];function V$(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function W$(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(H$.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=V$(t.styleAliases||null),U$.indexOf(this.kind)===-1)throw new on('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Bt=W$;function Mv(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 K$(){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 bg(e){return this.extend(e)}bg.prototype.extend=function(t){var n=[],r=[];if(t instanceof Bt)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 Bt))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 Bt))throw new on("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(bg.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Mv(i,"implicit"),i.compiledExplicit=Mv(i,"explicit"),i.compiledTypeMap=K$(i.compiledImplicit,i.compiledExplicit),i};var SE=bg,kE=new Bt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),NE=new Bt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),CE=new Bt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),EE=new SE({explicit:[kE,NE,CE]});function Y$(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function q$(){return null}function G$(e){return e===null}var jE=new Bt("tag:yaml.org,2002:null",{kind:"scalar",resolve:Y$,construct:q$,predicate:G$,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function X$(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 Q$(e){return e==="true"||e==="True"||e==="TRUE"}function J$(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var PE=new Bt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X$,construct:Q$,predicate:J$,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 Z$(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function e3(e){return 48<=e&&e<=55}function t3(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(!Z$(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!e3(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!t3(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function r3(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 i3(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!jt.isNegativeZero(e)}var _E=new Bt("tag:yaml.org,2002:int",{kind:"scalar",resolve:n3,construct:r3,predicate:i3,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"]}}),o3=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function s3(e){return!(e===null||!o3.test(e)||e[e.length-1]==="_")}function a3(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 l3=/^[-+]?[0-9]+e/;function c3(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(jt.isNegativeZero(e))return"-0.0";return n=e.toString(10),l3.test(n)?n.replace("e",".e"):n}function u3(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||jt.isNegativeZero(e))}var IE=new Bt("tag:yaml.org,2002:float",{kind:"scalar",resolve:s3,construct:a3,predicate:u3,represent:c3,defaultStyle:"lowercase"}),AE=EE.extend({implicit:[jE,PE,_E,IE]}),TE=AE,RE=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),LE=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 d3(e){return e===null?!1:RE.exec(e)!==null||LE.exec(e)!==null}function f3(e){var t,n,r,i,o,s,a,l=0,u=null,f,d,p;if(t=RE.exec(e),t===null&&(t=LE.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(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(f=+t[10],d=+(t[11]||0),u=(f*60+d)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(n,r,i,o,s,a,l)),u&&p.setTime(p.getTime()-u),p}function p3(e){return e.toISOString()}var OE=new Bt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:d3,construct:f3,instanceOf:Date,represent:p3});function h3(e){return e==="<<"||e===null}var ME=new Bt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:h3}),ox=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
70
|
-
\r`;function m3(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=ox;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 g3(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=ox,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 y3(e){var t="",n=0,r,i,o=e.length,s=ox;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 x3(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var DE=new Bt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:m3,construct:g3,predicate:x3,represent:y3}),w3=Object.prototype.hasOwnProperty,v3=Object.prototype.toString;function b3(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,v3.call(i)!=="[object Object]")return!1;for(o in i)if(w3.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 S3(e){return e!==null?e:[]}var FE=new Bt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:b3,construct:S3}),k3=Object.prototype.toString;function N3(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],k3.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[t]=[i[0],r[i[0]]]}return!0}function C3(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 $E=new Bt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:N3,construct:C3}),E3=Object.prototype.hasOwnProperty;function j3(e){if(e===null)return!0;var t,n=e;for(t in n)if(E3.call(n,t)&&n[t]!==null)return!1;return!0}function P3(e){return e!==null?e:{}}var zE=new Bt("tag:yaml.org,2002:set",{kind:"mapping",resolve:j3,construct:P3}),sx=TE.extend({implicit:[OE,ME],explicit:[DE,FE,$E,zE]}),eo=Object.prototype.hasOwnProperty,pf=1,BE=2,HE=3,hf=4,Rh=1,_3=2,Dv=3,I3=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,A3=/[\x85\u2028\u2029]/,T3=/[,\[\]\{\}]/,UE=/^(?:!|!!|![a-z\-]+!)$/i,VE=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Fv(e){return Object.prototype.toString.call(e)}function Br(e){return e===10||e===13}function Oo(e){return e===9||e===32}function yn(e){return e===9||e===32||e===10||e===13}function Os(e){return e===44||e===91||e===93||e===123||e===125}function R3(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function L3(e){return e===120?2:e===117?4:e===85?8:0}function O3(e){return 48<=e&&e<=57?e-48:-1}function $v(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 M3(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function WE(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var KE=new Array(256),YE=new Array(256);for(var ms=0;ms<256;ms++)KE[ms]=$v(ms)?1:0,YE[ms]=$v(ms);function D3(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 qE(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=B$(n),new on(t,n)}function ve(e,t){throw qE(e,t)}function mf(e,t){e.onWarning&&e.onWarning.call(null,qE(e,t))}var zv={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&&mf(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],UE.test(i)||ve(t,"ill-formed tag handle (first argument) of the TAG directive"),eo.call(t.tagMap,i)&&ve(t,'there is a previously declared suffix for "'+i+'" tag handle'),VE.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 Xi(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 I3.test(a)&&ve(e,"the stream contains non-printable characters");e.result+=a}}function Bv(e,t,n,r){var i,o,s,a;for(jt.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],eo.call(t,o)||(WE(t,o,n[o]),r[o]=!0)}function Ms(e,t,n,r,i,o,s,a,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&ve(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Fv(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Fv(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,f=o.length;u<f;u+=1)Bv(e,t,o[u],n);else Bv(e,t,o,n);else!e.json&&!eo.call(n,i)&&eo.call(t,i)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,ve(e,"duplicated mapping key")),WE(t,i,o),delete n[i];return t}function ax(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 kt(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Oo(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(Br(i))for(ax(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&&mf(e,"deficient indentation"),r}function op(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 lx(e,t){t===1?e.result+=" ":t>1&&(e.result+=jt.repeat(`
|
|
72
|
-
`,t-1))}function F3(e,t,n){var r,i,o,s,a,l,u,f,d=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),yn(h)||Os(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&&Os(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&&Os(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),yn(r))break}else{if(e.position===e.lineStart&&op(e)||n&&Os(h))break;if(Br(h))if(l=e.line,u=e.lineStart,f=e.lineIndent,kt(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=f;break}}a&&(Xi(e,o,s,!1),lx(e,e.line-l),o=s=e.position,a=!1),Oo(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return Xi(e,o,s,!1),e.result?!0:(e.kind=d,e.result=p,!1)}function $3(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(Xi(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 Br(n)?(Xi(e,r,i,!0),lx(e,kt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&op(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 z3(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 Xi(e,n,e.position,!0),e.position++,!0;if(a===92){if(Xi(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Br(a))kt(e,!1,t);else if(a<256&&KE[a])e.result+=YE[a],e.position++;else if((s=L3(a))>0){for(i=s,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(s=R3(a))>=0?o=(o<<4)+s:ve(e,"expected hexadecimal character");e.result+=M3(o),e.position++}else ve(e,"unknown escape sequence");n=r=e.position}else Br(a)?(Xi(e,n,r,!0),lx(e,kt(e,!1,t)),n=r=e.position):e.position===e.lineStart&&op(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 B3(e,t){var n=!0,r,i,o,s=e.tag,a,l=e.anchor,u,f,d,p,h,m=Object.create(null),v,k,g,w;if(w=e.input.charCodeAt(e.position),w===91)f=93,h=!1,a=[];else if(w===123)f=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),w=e.input.charCodeAt(++e.position);w!==0;){if(kt(e,!0,t),w=e.input.charCodeAt(e.position),w===f)return e.position++,e.tag=s,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?w===44&&ve(e,"expected the node content, but found ','"):ve(e,"missed comma between flow collection entries"),k=v=g=null,d=p=!1,w===63&&(u=e.input.charCodeAt(e.position+1),yn(u)&&(d=p=!0,e.position++,kt(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,fa(e,t,pf,!1,!0),k=e.tag,v=e.result,kt(e,!0,t),w=e.input.charCodeAt(e.position),(p||e.line===r)&&w===58&&(d=!0,w=e.input.charCodeAt(++e.position),kt(e,!0,t),fa(e,t,pf,!1,!0),g=e.result),h?Ms(e,a,m,k,v,g,r,i,o):d?a.push(Ms(e,null,m,k,v,g,r,i,o)):a.push(v),kt(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(n=!0,w=e.input.charCodeAt(++e.position)):n=!1}ve(e,"unexpected end of the stream within a flow collection")}function H3(e,t){var n,r,i=Rh,o=!1,s=!1,a=t,l=0,u=!1,f,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)Rh===i?i=d===43?Dv:_3:ve(e,"repeat of a chomping mode identifier");else if((f=O3(d))>=0)f===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+f-1,s=!0);else break;if(Oo(d)){do d=e.input.charCodeAt(++e.position);while(Oo(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Br(d)&&d!==0)}for(;d!==0;){for(ax(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),Br(d)){l++;continue}if(e.lineIndent<a){i===Dv?e.result+=jt.repeat(`
|
|
73
|
-
`,o?1+l:l):i===Rh&&o&&(e.result+=`
|
|
74
|
-
`);break}for(r?Oo(d)?(u=!0,e.result+=jt.repeat(`
|
|
75
|
-
`,o?1+l:l)):u?(u=!1,e.result+=jt.repeat(`
|
|
76
|
-
`,l+1)):l===0?o&&(e.result+=" "):e.result+=jt.repeat(`
|
|
77
|
-
`,l):e.result+=jt.repeat(`
|
|
78
|
-
`,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!Br(d)&&d!==0;)d=e.input.charCodeAt(++e.position);Xi(e,n,e.position,!1)}return!0}function Hv(e,t){var n,r=e.tag,i=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ve(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!yn(s))));){if(a=!0,e.position++,kt(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,fa(e,t,HE,!1,!0),o.push(e.result),kt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==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 U3(e,t,n){var r,i,o,s,a,l,u=e.tag,f=e.anchor,d={},p=Object.create(null),h=null,m=null,v=null,k=!1,g=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),w=e.input.charCodeAt(e.position);w!==0;){if(!k&&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,(w===63||w===58)&&yn(r))w===63?(k&&(Ms(e,d,p,h,m,null,s,a,l),h=m=v=null),g=!0,k=!0,i=!0):k?(k=!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,w=r;else{if(s=e.line,a=e.lineStart,l=e.position,!fa(e,n,BE,!1,!0))break;if(e.line===o){for(w=e.input.charCodeAt(e.position);Oo(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),yn(w)||ve(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Ms(e,d,p,h,m,null,s,a,l),h=m=v=null),g=!0,k=!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=f,!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=f,!0}if((e.line===o||e.lineIndent>t)&&(k&&(s=e.line,a=e.lineStart,l=e.position),fa(e,t,hf,!0,i)&&(k?m=e.result:v=e.result),k||(Ms(e,d,p,h,m,v,s,a,l),h=m=v=null),kt(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&w!==0)ve(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Ms(e,d,p,h,m,null,s,a,l),g&&(e.tag=u,e.anchor=f,e.kind="mapping",e.result=d),g}function V3(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),UE.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),T3.test(o)&&ve(e,"tag suffix cannot contain flow indicator characters")}o&&!VE.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:eo.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 W3(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)&&!Os(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 K3(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)&&!Os(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),eo.call(e.anchorMap,n)||ve(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],kt(e,!0,-1),!0}function fa(e,t,n,r,i){var o,s,a,l=1,u=!1,f=!1,d,p,h,m,v,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=hf===n||HE===n,r&&kt(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;V3(e)||W3(e);)kt(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||i),(l===1||hf===n)&&(pf===n||BE===n?v=t:v=t+1,k=e.position-e.lineStart,l===1?a&&(Hv(e,k)||U3(e,k,v))||B3(e,v)?f=!0:(s&&H3(e,v)||$3(e,v)||z3(e,v)?f=!0:K3(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&ve(e,"alias node should not have any properties")):F3(e,v,pf===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&Hv(e,k))),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,p=e.implicitTypes.length;d<p;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(eo.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,p=h.length;d<p;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||f}function Y3(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&&(kt(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(;Oo(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Br(s));break}if(Br(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&&ax(e),eo.call(zv,r)?zv[r](e,r,i):mf(e,'unknown document directive "'+r+'"')}if(kt(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,kt(e,!0,-1)):o&&ve(e,"directives end mark is expected"),fa(e,e.lineIndent-1,hf,!1,!0),kt(e,!0,-1),e.checkLineBreaks&&A3.test(e.input.slice(t,e.position))&&mf(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&op(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,kt(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 GE(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 D3(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;)Y3(n);return n.documents}function q3(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=GE(e,n);if(typeof t!="function")return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function G3(e,t){var n=GE(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 X3=q3,Q3=G3,XE={loadAll:X3,load:Q3},QE=Object.prototype.toString,JE=Object.prototype.hasOwnProperty,cx=65279,J3=9,mc=10,Z3=13,ez=32,tz=33,nz=34,Sg=35,rz=37,iz=38,oz=39,sz=42,ZE=44,az=45,gf=58,lz=61,cz=62,uz=63,dz=64,ej=91,tj=93,fz=96,nj=123,pz=124,rj=125,Zt={};Zt[0]="\\0";Zt[7]="\\a";Zt[8]="\\b";Zt[9]="\\t";Zt[10]="\\n";Zt[11]="\\v";Zt[12]="\\f";Zt[13]="\\r";Zt[27]="\\e";Zt[34]='\\"';Zt[92]="\\\\";Zt[133]="\\N";Zt[160]="\\_";Zt[8232]="\\L";Zt[8233]="\\P";var hz=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],mz=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function gz(e,t){var n,r,i,o,s,a,l;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)),l=e.compiledTypeMap.fallback[s],l&&JE.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function yz(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+jt.repeat("0",r-t.length)+t}var xz=1,gc=2;function wz(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=jt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=gz(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==='"'?gc:xz,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 Uv(e,t){for(var n=jt.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 kg(e,t){return`
|
|
82
|
-
`+jt.repeat(" ",e.indent*t)}function vz(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 yf(e){return e===ez||e===J3}function yc(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 Vv(e){return yc(e)&&e!==cx&&e!==Z3&&e!==mc}function Wv(e,t,n){var r=Vv(e),i=r&&!yf(e);return(n?r:r&&e!==ZE&&e!==ej&&e!==tj&&e!==nj&&e!==rj)&&e!==Sg&&!(t===gf&&!i)||Vv(t)&&!yf(t)&&e===Sg||t===gf&&i}function bz(e){return yc(e)&&e!==cx&&!yf(e)&&e!==az&&e!==uz&&e!==gf&&e!==ZE&&e!==ej&&e!==tj&&e!==nj&&e!==rj&&e!==Sg&&e!==iz&&e!==sz&&e!==tz&&e!==pz&&e!==lz&&e!==cz&&e!==oz&&e!==nz&&e!==rz&&e!==dz&&e!==fz}function Sz(e){return!yf(e)&&e!==gf}function Sl(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 ij(e){var t=/^\n* /;return t.test(e)}var oj=1,Ng=2,sj=3,aj=4,ws=5;function kz(e,t,n,r,i,o,s,a){var l,u=0,f=null,d=!1,p=!1,h=r!==-1,m=-1,v=bz(Sl(e,0))&&Sz(Sl(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Sl(e,l),!yc(u))return ws;v=v&&Wv(u,f,a),f=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Sl(e,l),u===mc)d=!0,h&&(p=p||l-m-1>r&&e[m+1]!==" ",m=l);else if(!yc(u))return ws;v=v&&Wv(u,f,a),f=u}p=p||h&&l-m-1>r&&e[m+1]!==" "}return!d&&!p?v&&!s&&!i(e)?oj:o===gc?ws:Ng:n>9&&ij(e)?ws:s?o===gc?ws:Ng:p?aj:sj}function Nz(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===gc?'""':"''";if(!e.noCompatMode&&(hz.indexOf(t)!==-1||mz.test(t)))return e.quotingType===gc?'"'+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 l(u){return vz(e,u)}switch(kz(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!r,i)){case oj:return t;case Ng:return"'"+t.replace(/'/g,"''")+"'";case sj:return"|"+Kv(t,e.indent)+Yv(Uv(t,o));case aj:return">"+Kv(t,e.indent)+Yv(Uv(Cz(t,s),o));case ws:return'"'+Ez(t)+'"';default:throw new on("impossible error: invalid scalar style")}}()}function Kv(e,t){var n=ij(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 Yv(e){return e[e.length-1]===`
|
|
87
|
-
`?e.slice(0,-1):e}function Cz(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,qv(e.slice(0,u),t)}(),i=e[0]===`
|
|
89
|
-
`||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",r+=a+(!i&&!o&&l!==""?`
|
|
90
|
-
`:"")+qv(l,t),i=o}return r}function qv(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,s=0,a=0,l="";r=n.exec(e);)a=r.index,a-i>t&&(o=s>i?s:a,l+=`
|
|
91
|
-
`+e.slice(i,o),i=o+1),s=a;return l+=`
|
|
92
|
-
`,e.length-i>t&&s>i?l+=e.slice(i,s)+`
|
|
93
|
-
`+e.slice(s+1):l+=e.slice(i),l.slice(1)}function Ez(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Sl(e,i),r=Zt[n],!r&&yc(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||yz(n);return t}function jz(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)),(fi(e,t,a,!1,!1)||typeof a>"u"&&fi(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Gv(e,t,n,r){var i="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(fi(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&fi(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=kg(e,t)),e.dump&&mc===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function Pz(e,t,n){var r="",i=e.tag,o=Object.keys(n),s,a,l,u,f;for(s=0,a=o.length;s<a;s+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),fi(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),fi(e,t,u,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function _z(e,t,n,r){var i="",o=e.tag,s=Object.keys(n),a,l,u,f,d,p;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,l=s.length;a<l;a+=1)p="",(!r||i!=="")&&(p+=kg(e,t)),u=s[a],f=n[u],e.replacer&&(f=e.replacer.call(n,u,f)),fi(e,t+1,u,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&mc===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,d&&(p+=kg(e,t)),fi(e,t+1,f,!0,d)&&(e.dump&&mc===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=o,e.dump=i||"{}"}function Xv(e,t,n){var r,i,o,s,a,l;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(l=e.styleMap[a.tag]||a.defaultStyle,QE.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(JE.call(a.represent,l))r=a.represent[l](t,l);else throw new on("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function fi(e,t,n,r,i,o,s){e.tag=null,e.dump=n,Xv(e,n,!1)||Xv(e,n,!0);var a=QE.call(e.dump),l=r,u;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",d,p;if(f&&(d=e.duplicates.indexOf(n),p=d!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(i=!1),p&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(f&&p&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(_z(e,t,e.dump,i),p&&(e.dump="&ref_"+d+e.dump)):(Pz(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Gv(e,t-1,e.dump,i):Gv(e,t,e.dump,i),p&&(e.dump="&ref_"+d+e.dump)):(jz(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Nz(e,e.dump,t,o,l);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 Iz(e,t){var n=[],r=[],i,o;for(Cg(e,n,r),i=0,o=r.length;i<o;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(o)}function Cg(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)Cg(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)Cg(e[r[i]],t,n)}function Az(e,t){t=t||{};var n=new wz(t);n.noRefs||Iz(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),fi(n,0,r,!0,!0)?n.dump+`
|
|
94
|
-
`:""}var Tz=Az,Rz={dump:Tz};function ux(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 Lz=Bt,Oz=SE,Mz=EE,Dz=AE,Fz=TE,$z=sx,zz=XE.load,Bz=XE.loadAll,Hz=Rz.dump,Uz=on,Vz={binary:DE,float:IE,map:CE,null:jE,pairs:$E,set:zE,timestamp:OE,bool:PE,int:_E,merge:ME,omap:FE,seq:NE,str:kE},Wz=ux("safeLoad","load"),Kz=ux("safeLoadAll","loadAll"),Yz=ux("safeDump","dump"),lj={Type:Lz,Schema:Oz,FAILSAFE_SCHEMA:Mz,JSON_SCHEMA:Dz,CORE_SCHEMA:Fz,DEFAULT_SCHEMA:$z,load:zz,loadAll:Bz,dump:Hz,YAMLException:Uz,types:Vz,safeLoad:Wz,safeLoadAll:Kz,safeDump:Yz};const Ko=["requirement","planning","code","test","normal"],Eg={普通:"normal",技术规划:"planning",代码执行:"code",测试回归:"test",需求拆解:"requirement"},qz=["agent","control","provide","condition","jump","condition_jump","start","end"];function Gz(e){return qz.includes(e)?e:"agent"}function Xz(e){const t=(e||"").toLowerCase();return t.startsWith("control_")?"control":t.startsWith("agent_")?"agent":t.startsWith("provide_")?"provide":(t.startsWith("tool_"),"agent")}function Qz(e){var t;if(!(e!=null&&e.trim()))return{nodes:[],edges:[],instances:{}};try{const n=lj.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:{},l=typeof s.description=="string"&&s.description.trim()?s.description.trim():void 0,u=new Set(Object.keys(i));for(const p of o)p!=null&&p.source&&u.add(String(p.source)),p!=null&&p.target&&u.add(String(p.target));const f=Array.from(u).map(p=>{const h=i[p],m=a[p]&&typeof a[p].x=="number"&&typeof a[p].y=="number"?{x:a[p].x,y:a[p].y}:{x:0,y:0},v=(h==null?void 0:h.definitionId)??p,k=Xz(v),g=(h==null?void 0:h.label)!=null?String(h.label):p,w=(h==null?void 0:h.role)!=null?String(h.role).trim():"",y=Eg[w]||w,N=Ko.includes(y)?y:"normal",E=(h==null?void 0:h.model)!=null?String(h.model).trim():void 0,S=(h==null?void 0:h.body)!=null?String(h.body):"",P=(h==null?void 0:h.script)!=null?String(h.script):"";return{id:p,type:Gz(k),position:m,data:{label:g,definitionId:v,schemaType:k,role:N,model:E||void 0,body:S,...P.trim()!==""?{script:P}:{}}}}),d=o.filter(p=>(p==null?void 0:p.source)&&(p==null?void 0:p.target)).map((p,h)=>({id:`e-${p.source}-${p.target}-${h}`,source:String(p.source),target:String(p.target),sourceHandle:p.sourceHandle??void 0,targetHandle:p.targetHandle??void 0,markerEnd:{type:Zi.ArrowClosed}}));return{nodes:f,edges:d,instances:i,description:l}}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 Jz(e,t){var i,o,s,a,l,u,f,d;const n=p=>({type:(p==null?void 0:p.type)??"node",name:(p==null?void 0:p.name)??"",value:(p==null?void 0:p.value)??(p==null?void 0:p.default)??""}),r={};for(const p of e){const h=t[p.id]&&typeof t[p.id]=="object"?{...t[p.id]}:{},m=((i=p.data)==null?void 0:i.definitionId)||p.id,v=((o=p.data)==null?void 0:o.inputs)??[],k=((s=p.data)==null?void 0:s.outputs)??[],g=((a=p.data)==null?void 0:a.role)!=null?String(p.data.role).trim():"",w=h.role!=null?String(h.role).trim():"",y=Eg[g]||g,N=Eg[w]||w,E=Ko.includes(y)?y:Ko.includes(N)?N:"normal",S=Array.isArray(v)?v.map(n):Array.isArray(h.input)?h.input.map(H=>n(H)):[],P=Array.isArray(k)?k.map(n):Array.isArray(h.output)?h.output.map(H=>n(H)):[],T=((l=p.data)==null?void 0:l.label)!=null?String(p.data.label):h.label!=null?String(h.label):p.id,M=(u=p.data)==null?void 0:u.body,B=M!=null?String(M):h.body!=null?String(h.body):"";let A=((f=p.data)==null?void 0:f.model)!=null&&String(p.data.model).trim()!==""?String(p.data.model).trim():h.model!=null&&String(h.model).trim()!==""?String(h.model).trim():void 0;(A===""||A==="default")&&(A=void 0);const R={...h,definitionId:m,label:T,role:E,model:A,input:S,output:P};B.trim()===""?delete R.body:R.body=B;const V=(d=p.data)==null?void 0:d.script,L=V!=null?String(V):h.script!=null?String(h.script):"";L.trim()===""?delete R.script:R.script=L,delete R.temperature,delete R.maxTokens,delete R.description,r[p.id]=R}return r}function Qv(e,t,n,r){const i=Jz(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 f=u.position??{x:0,y:0};s[u.id]={x:f.x,y:f.y}}const a={nodePositions:s};(r==null?void 0:r.description)!=null&&String(r.description).trim()!==""&&(a.description=String(r.description).trim());const l={instances:i,edges:o,ui:a};return lj.dump(l,{lineWidth:-1})}function Zz(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],l=(a&&a.name!=null?String(a.name).trim():"")||`input-${s}`;t.inputNames.push(l)}for(let s=0;s<r.length;s++){const a=r[s],l=(a&&a.name!=null?String(a.name).trim():"")||`output-${s}`;t.outputNames.push(l)}return t}function e4(e,t,n){var l,u,f;const r=new Set(e.map(d=>d.id)),i={};for(const d of e)i[d.id]=Zz(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 p=((l=d.data)==null?void 0:l.definitionId)!=null?String(d.data.definitionId):"",h=i[d.id]||{inputNames:[],outputNames:[]},m=h.inputNames.length,v=h.outputNames.length;if(!(p==="control_start"||p.startsWith("provide_"))&&m>0)for(let w=0;w<m;w++){const y=`input-${w}`;if(!((u=o.get(d.id))==null?void 0:u.has(y))){const E=h.inputNames[w]||y;a.push({nodeId:d.id,suffix:n("flow:validation.inputSlotNoEdge",{slotName:E,handle:y}),key:`${d.id}-${y}-in`})}}if(!(p==="control_end")&&v>0)for(let w=0;w<v;w++){const y=`output-${w}`;if(!((f=s.get(d.id))==null?void 0:f.has(y))){const E=h.outputNames[w]||y;a.push({nodeId:d.id,suffix:n("flow:validation.outputSlotNoEdge",{slotName:E,handle:y}),key:`${d.id}-${y}-out`})}}}return a}function jg(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 t4(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 l=jg(a);return{type:String(l.type||"node"),name:String(l.name??""),default:String(l.default??"")}});return{inputs:r(t),outputs:r(n)}}function Lh(e,t,n,r,i){var V,L,H,D,$,_,I,C,F,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 l=[],u=[],f=((L=e.data)==null?void 0:L.label)??e.id,d,p,h,m;const v=!!a;a&&(Array.isArray(a.input)&&(l=a.input.map(jg)),Array.isArray(a.output)&&(u=a.output.map(jg)),a.label&&(f=String(a.label)),a.role&&typeof a.role=="string"&&(d=a.role),a.model!=null&&(p=String(a.model).trim()),a.body!=null&&(h=String(a.body)),a.script!=null&&(m=String(a.script)));const k=d??(typeof((H=e.data)==null?void 0:H.role)=="string"?e.data.role:"普通"),g=p??((D=e.data)==null?void 0:D.model)??void 0,w=(s==null?void 0:s.description)!=null?String(s.description).trim():"",y=w!==""?w:void 0,N=h??(($=e.data)==null?void 0:$.body)??"",E=m!==void 0?m:((_=e.data)==null?void 0:_.script)!=null?String(e.data.script):"",S=String(e.id),P=(I=r==null?void 0:r[i])==null?void 0:I[S],T=(C=P==null?void 0:P.label)==null?void 0:C.label,M=P==null?void 0:P.body,B=P==null?void 0:P.description;v||(l.length===0&&((F=s==null?void 0:s.inputs)!=null&&F.length)&&(l=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 A=(s==null?void 0:s.id)??o,R=A==="tool_nodejs"||String(E).trim()!=="";return{...e,type:"flowNode",data:{...e.data,label:T||f,definitionId:A,schemaType:((O=e.data)==null?void 0:O.schemaType)??e.type??"agent",role:k,model:g,body:M||N,script:E,inputs:l,outputs:u,description:B||y,originalLabel:f,originalBody:N,body:N,...R?{script:E}:{},inputs:l,outputs:u}}}function n4(e,t){const n=new Map(t.map(r=>[r.id,r]));return e.filter(r=>{var f,d,p,h;const i=n.get(r.source),o=n.get(r.target),s=((d=(f=i==null?void 0:i.data)==null?void 0:f.outputs)==null?void 0:d.length)??0,a=((h=(p=o==null?void 0:o.data)==null?void 0:p.inputs)==null?void 0:h.length)??0,l=r.sourceHandle?parseInt(String(r.sourceHandle).replace("output-",""),10):0,u=r.targetHandle?parseInt(String(r.targetHandle).replace("input-",""),10):0;return i&&o&&l>=0&&l<s&&u>=0&&u<a})}function xf(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 Qr(e){const t=e.indexOf(" - ");return t>=0?e.slice(0,t).trim():e.trim()}function r4(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 i4({data:e,selected:t,id:n,deleteNode:r,onProvideExpand:i,modelLists:o,onModelChange:s}){const{t:a}=rt(),l=(e==null?void 0:e.inputs)??[],u=(e==null?void 0:e.outputs)??[],f=((e==null?void 0:e.schemaType)??"agent").toLowerCase(),d=r4(e),p=(e==null?void 0:e.isRunMode)??!1,h=(e==null?void 0:e.isExecuting)??!1,m=(e==null?void 0:e.isDim)??!1,v=(e==null?void 0:e.nodeStatus)??null,k=(e==null?void 0:e.nodeElapsed)??null,g=(e==null?void 0:e.definitionId)||"",w=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:[],E=Array.isArray(o==null?void 0:o.claudeCode)?o.claudeCode:[],S=((e==null?void 0:e.model)??"").trim(),P=f==="agent"&&!g.startsWith("tool_nodejs"),T=new Set(y.map(Qr)),M=new Set(N.map(Qr)),B=new Set(E.map(Qr)),A=S?S.startsWith("cursor:")||S.startsWith("opencode:")||S.startsWith("claude-code:")?S:B.has(S)?`claude-code:${S}`:M.has(S)?`opencode:${S}`:T.has(S)?`cursor:${S}`:S:"",R=S&&!A.startsWith("cursor:")&&!A.startsWith("opencode:")&&!A.startsWith("claude-code:")&&!T.has(S)&&!M.has(S)&&!B.has(S),V=S.startsWith("cursor:")?S.slice(7):S.startsWith("opencode:")?S.slice(9):S.startsWith("claude-code:")?S.slice(12):S,L=$=>{const _=$.target.value;s&&s(n,_)},H=$=>{$.stopPropagation(),r&&r(n)},D=$=>{$.stopPropagation(),i&&i()};return c.jsxs("div",{className:"af-flow-node"+(t?" af-flow-node--selected":"")+(h?" af-flow-node--executing":"")+(v==="success"?" af-flow-node--done":"")+(v==="failed"?" af-flow-node--failed":"")+(v==="running"&&!h?" af-flow-node--running-disk":"")+(m?" af-flow-node--dim":"")+" af-flow-node--"+f.replace(/[^a-z0-9_-]/g,""),"data-schema":f,children:[c.jsxs("div",{className:"af-flow-node__chrome",children:[c.jsx("span",{className:"af-flow-node__type",title:d,children:d}),n&&c.jsx("span",{className:"af-flow-node__id",title:n,children:n}),!p&&P&&c.jsxs("div",{className:"af-flow-node__model-wrap",children:[c.jsxs("select",{className:"af-flow-node__model",value:A,onChange:L,"aria-label":a("flow:node.model"),title:V||a("flow:node.defaultModel"),children:[c.jsx("option",{value:"",children:a("flow:node.defaultModel")}),R&&c.jsx("option",{value:S,children:S}),y.length>0&&c.jsx("optgroup",{label:"Cursor",children:y.map($=>c.jsx("option",{value:`cursor:${Qr($)}`,children:Qr($)},`c-${$}`))}),N.length>0&&c.jsx("optgroup",{label:"OpenCode",children:N.map($=>c.jsx("option",{value:`opencode:${Qr($)}`,children:Qr($)},`o-${$}`))}),E.length>0&&c.jsx("optgroup",{label:"Claude Code",children:E.map($=>c.jsx("option",{value:`claude-code:${Qr($)}`,children:Qr($)},`cc-${$}`))})]}),c.jsx("span",{className:"af-flow-node__model-arrow material-symbols-outlined",children:"expand_more"})]}),h&&c.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--executing",children:"EXECUTING"}),v==="running"&&!h&&c.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--running-disk",title:a("flow:node.diskRunning"),children:"RUNNING"}),v==="success"&&c.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--done",children:k!=null&&String(k).trim()!==""?k:"--"}),v==="failed"&&c.jsx("span",{className:"af-flow-node__status-badge af-flow-node__status-badge--failed",children:"FAILED"}),!p&&w&&c.jsx("button",{type:"button",className:"af-flow-node__expand",onClick:D,"aria-label":a("flow:node.expandProvide"),title:a("flow:node.expandProvide"),children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})}),!p&&c.jsx("button",{type:"button",className:"af-flow-node__delete",onClick:H,"aria-label":a("flow:node.deleteNode"),title:a("flow:node.deleteNode"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("div",{className:"af-flow-node__body",children:[c.jsx("div",{className:"af-flow-node__ports af-flow-node__ports--in",children:l.map(($,_)=>{const I=a("flow:node.inputTooltip",{name:$.name||`#${_}`,type:$.type})+($.default!=null&&$.default!==""?a("flow:node.defaultSuffix",{value:$.default}):"");return c.jsx("div",{className:"af-flow-node__port-row",title:I,children:c.jsx(da,{type:"target",position:be.Left,id:`input-${_}`,className:"af-flow-node__handle",style:{background:xf($.type)},title:I})},`in-${_}`)})}),c.jsx("div",{className:"af-flow-node__title-wrap",children:c.jsx("span",{className:"af-flow-node__title",children:(e==null?void 0:e.label)??a("flow:node.fallbackLabel")})}),c.jsx("div",{className:"af-flow-node__ports af-flow-node__ports--out",children:u.map(($,_)=>{const I=a("flow:node.outputTooltip",{name:$.name||`#${_}`,type:$.type})+($.default!=null&&$.default!==""?a("flow:node.defaultSuffix",{value:$.default}):"");return c.jsx("div",{className:"af-flow-node__port-row",title:I,children:c.jsx(da,{type:"source",position:be.Right,id:`output-${_}`,className:"af-flow-node__handle",style:{background:xf($.type)},title:I})},`out-${_}`)})})]})]})}const Pg="flowNode";function o4(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 Jv(e){return e.key==="?"||e.key==="/"&&e.shiftKey}function s4(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform||navigator.userAgent||"")}function a4({open:e,onClose:t,flowId:n,flowSource:r,onArchived:i}){const{t:o}=rt(),s=x.useId(),a=x.useRef(null),[l,u]=x.useState(""),[f,d]=x.useState(!1),[p,h]=x.useState("");if(x.useEffect(()=>{if(!e)return;u(""),h(""),d(!1);const g=requestAnimationFrame(()=>{var w;return(w=a.current)==null?void 0:w.focus()});return()=>cancelAnimationFrame(g)},[e,n]),!e)return null;const m=l.trim(),v=m===n;async function k(g){if(g.preventDefault(),!(!v||f)){d(!0),h("");try{const w=await fetch("/api/flow/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:n,flowSource:r,confirmFlowId:m})}),y=await w.json().catch(()=>({}));if(!w.ok){h(typeof y.error=="string"?y.error:o("project:archiveModal.archiveFailed"));return}i()}catch(w){h(String((w==null?void 0:w.message)||w))}finally{d(!1)}}}return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&t()},children:c.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:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:s,className:"af-shortcuts-panel__title",children:o("project:archiveModal.title")}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":o("project:archiveModal.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:k,children:[c.jsx("p",{className:"af-new-pipeline-lead",children:o("project:archiveModal.lead",{flowId:n})}),c.jsxs("label",{className:"af-new-pipeline-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:o("project:archiveModal.confirmLabel")}),c.jsx("input",{type:"text",className:"af-new-pipeline-input",value:l,onChange:g=>u(g.target.value),placeholder:n,autoComplete:"off",spellCheck:!1,"aria-invalid":m.length>0&&!v})]}),p?c.jsx("p",{className:"af-err af-new-pipeline-err",children:p}):null,c.jsxs("div",{className:"af-new-pipeline-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:f,children:o("project:archiveModal.cancel")}),c.jsx("button",{type:"submit",className:"af-btn-primary",disabled:!v||f,children:o(f?"project:archiveModal.archiving":"project:archiveModal.confirmArchive")})]})]})]})})}function Zv({open:e,title:t,message:n,confirmLabel:r,cancelLabel:i,destructive:o=!1,secondaryLabel:s,secondaryDestructive:a=!1,onSecondary:l,onConfirm:u,onCancel:f}){const{t:d}=rt(),p=x.useId(),h=x.useRef(null);if(x.useEffect(()=>{if(!e)return;const g=requestAnimationFrame(()=>{var y;return(y=h.current)==null?void 0:y.focus()});function w(y){y.key==="Escape"&&f(),y.key==="Enter"&&u()}return window.addEventListener("keydown",w),()=>{cancelAnimationFrame(g),window.removeEventListener("keydown",w)}},[e,f,u]),!e)return null;const m=r??d("common:common.confirm","确定"),v=i??d("common:common.cancel","取消"),k=t??d("common:common.confirmTitle","请确认");return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&f()},children:c.jsxs("div",{ref:h,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":p,tabIndex:-1,onMouseDown:g=>g.stopPropagation(),children:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:p,className:"af-shortcuts-panel__title",children:k}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:f,"aria-label":v,children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("div",{className:"af-shortcuts-panel__body af-new-pipeline-form",children:[c.jsx("p",{className:"af-new-pipeline-lead",children:n}),c.jsxs("div",{className:"af-new-pipeline-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:f,children:v}),s&&l?c.jsx("button",{type:"button",className:a?"af-btn-secondary af-btn-destructive":"af-btn-secondary",onClick:l,children:s}):null,c.jsx("button",{type:"button",className:o?"af-btn-primary af-btn-destructive":"af-btn-primary",onClick:u,autoFocus:!0,children:m})]})]})]})})}function l4({open:e,onClose:t,flowId:n,flowSource:r,flowArchived:i=!1,onDeleted:o}){const{t:s}=rt(),a=x.useId(),l=x.useRef(null),[u,f]=x.useState(""),[d,p]=x.useState(!1),[h,m]=x.useState("");if(x.useEffect(()=>{if(!e)return;f(""),m(""),p(!1);const w=requestAnimationFrame(()=>{var y;return(y=l.current)==null?void 0:y.focus()});return()=>cancelAnimationFrame(w)},[e,n]),!e)return null;const v=u.trim(),k=v===n;async function g(w){if(w.preventDefault(),!k||d)return;p(!0),m("");let y=null;try{const N=new AbortController;y=setTimeout(()=>N.abort(),15e3);const E=await fetch("/api/flow/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:n,flowSource:r,confirmFlowId:v,flowArchived:i}),signal:N.signal}),S=await E.json().catch(()=>({}));if(!E.ok){m(typeof S.error=="string"?S.error:s("project:deleteModal.deleteFailed"));return}try{for(let P=localStorage.length-1;P>=0;P--){const T=localStorage.key(P);T&&(T.startsWith(`af:composer-sessions:${n}:${r}`)||T.startsWith(`af:composer-active-session:${n}:${r}`))&&localStorage.removeItem(T)}}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),p(!1)}}return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:w=>{w.target===w.currentTarget&&t()},children:c.jsxs("div",{ref:l,className:"af-shortcuts-panel af-new-pipeline-panel",role:"dialog","aria-modal":"true","aria-labelledby":a,tabIndex:-1,onMouseDown:w=>w.stopPropagation(),children:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:a,className:"af-shortcuts-panel__title",children:s("project:deleteModal.title")}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":s("project:deleteModal.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("form",{className:"af-shortcuts-panel__body af-new-pipeline-form",onSubmit:g,children:[c.jsx("p",{className:"af-new-pipeline-lead",children:s("project:deleteModal.lead",{flowId:n})}),c.jsxs("label",{className:"af-new-pipeline-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:s("project:deleteModal.confirmLabel")}),c.jsx("input",{type:"text",className:"af-new-pipeline-input",value:u,onChange:w=>f(w.target.value),placeholder:n,autoComplete:"off",spellCheck:!1,"aria-invalid":v.length>0&&!k})]}),h?c.jsx("p",{className:"af-err af-new-pipeline-err",children:h}):null,c.jsxs("div",{className:"af-new-pipeline-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:t,disabled:d,children:s("project:deleteModal.cancel")}),c.jsx("button",{type:"submit",className:"af-btn-primary af-btn-destructive",disabled:!k||d,children:s(d?"project:deleteModal.deleting":"project:deleteModal.confirmDelete")})]})]})]})})}function c4({children:e}){return c.jsx("kbd",{className:"af-kbd",children:e})}function bo({keys:e}){return c.jsx("span",{className:"af-shortcuts-keys",children:e.map((t,n)=>c.jsxs("span",{children:[n>0?c.jsx("span",{className:"af-shortcuts-keys__plus",children:"+"}):null,c.jsx(c4,{children:t})]},n))})}function u4({open:e,onClose:t}){const{t:n}=rt(),r=x.useRef(null);if(x.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=s4()?"⌘":"Ctrl";return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:s=>{s.target===s.currentTarget&&t()},children:c.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:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:"af-shortcuts-title",className:"af-shortcuts-panel__title",children:n("flow:shortcuts.title")}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":n("common:common.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("div",{className:"af-shortcuts-panel__body",children:[c.jsxs("section",{className:"af-shortcuts-section",children:[c.jsx("h3",{className:"af-shortcuts-cat",children:n("flow:shortcuts.general")}),c.jsxs("ul",{className:"af-shortcuts-list",children:[c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.saveDesc")}),c.jsx(bo,{keys:[o,"S"]})]}),c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.shortcutsLabel")}),c.jsx(bo,{keys:["?"]})]}),c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.jumpToNode")}),c.jsx(bo,{keys:[o,"K"]})]})]})]}),c.jsxs("section",{className:"af-shortcuts-section",children:[c.jsx("h3",{className:"af-shortcuts-cat",children:n("flow:shortcuts.canvas")}),c.jsxs("ul",{className:"af-shortcuts-list",children:[c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.selectTool")}),c.jsx(bo,{keys:["V"]})]}),c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.panTool")}),c.jsx(bo,{keys:["H"]})]}),c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.holdSpacePan")}),c.jsx(bo,{keys:["Space"]})]}),c.jsxs("li",{className:"af-shortcuts-row",children:[c.jsx("span",{className:"af-shortcuts-row__label",children:n("flow:shortcuts.selectAll")}),c.jsx(bo,{keys:[o,"A"]})]})]})]})]})]})})}function d4(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 f4({open:e,onClose:t,onJump:n,nodes:r}){const{t:i}=rt(),[o,s]=x.useState(""),[a,l]=x.useState(0),u=x.useRef(null),f=x.useRef(null);x.useEffect(()=>{if(!e)return;s(""),l(0);const m=requestAnimationFrame(()=>{var v;return(v=u.current)==null?void 0:v.focus()});return()=>cancelAnimationFrame(m)},[e]);const d=x.useMemo(()=>{const m=(r||[]).map(g=>{var w,y,N;return{id:g.id,label:((w=g.data)==null?void 0:w.label)||"",definitionId:((y=g.data)==null?void 0:y.definitionId)||"",schemaType:((N=g.data)==null?void 0:N.schemaType)||""}}),v=o.trim(),k=m.map(g=>({e:g,s:d4(g,v)})).filter(g=>g.s>0);return k.sort((g,w)=>w.s-g.s||g.e.id.localeCompare(w.e.id)),k.slice(0,50).map(g=>g.e)},[r,o]);if(x.useEffect(()=>{a>=d.length&&l(0)},[d.length,a]),x.useEffect(()=>{var v;const m=(v=f.current)==null?void 0:v.querySelector(`[data-idx="${a}"]`);m&&m.scrollIntoView({block:"nearest"})},[a]),!e)return null;const p=m=>{const v=d[m];v&&(n(v.id),t())},h=m=>{if(m.key==="Escape"){m.preventDefault(),t();return}if(m.key==="ArrowDown"){m.preventDefault(),l(v=>Math.min(d.length-1,v+1));return}if(m.key==="ArrowUp"){m.preventDefault(),l(v=>Math.max(0,v-1));return}m.key==="Enter"&&(m.preventDefault(),p(a))};return c.jsx("div",{className:"af-jump-overlay",role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&t()},children:c.jsxs("div",{className:"af-jump-panel",role:"dialog","aria-modal":"true","aria-label":i("flow:jumpPalette.title"),onMouseDown:m=>m.stopPropagation(),children:[c.jsxs("div",{className:"af-jump-panel__input-wrap",children:[c.jsx("span",{className:"af-jump-panel__icon material-symbols-outlined","aria-hidden":!0,children:"search"}),c.jsx("input",{ref:u,type:"text",className:"af-jump-panel__input",placeholder:i("flow:jumpPalette.placeholder"),value:o,onChange:m=>{s(m.target.value),l(0)},onKeyDown:h,spellCheck:!1,autoComplete:"off"}),c.jsx("span",{className:"af-jump-panel__count",children:d.length})]}),d.length===0?c.jsx("div",{className:"af-jump-panel__empty",children:i("flow:jumpPalette.empty")}):c.jsx("ul",{ref:f,className:"af-jump-panel__list",role:"listbox",children:d.map((m,v)=>c.jsxs("li",{"data-idx":v,role:"option","aria-selected":v===a,className:"af-jump-panel__item"+(v===a?" af-jump-panel__item--active":""),onMouseEnter:()=>l(v),onMouseDown:k=>{k.preventDefault(),p(v)},children:[c.jsx("span",{className:"af-jump-panel__id",children:m.id}),m.label&&m.label!==m.id&&c.jsx("span",{className:"af-jump-panel__label",children:m.label}),m.definitionId&&c.jsx("span",{className:"af-jump-panel__tag",children:m.definitionId})]},m.id))}),c.jsxs("div",{className:"af-jump-panel__hint",children:[c.jsxs("span",{children:[c.jsx("kbd",{className:"af-kbd",children:"↑"}),c.jsx("kbd",{className:"af-kbd",children:"↓"})," ",i("flow:jumpPalette.hintNavigate")]}),c.jsxs("span",{children:[c.jsx("kbd",{className:"af-kbd",children:"Enter"})," ",i("flow:jumpPalette.hintJump")]}),c.jsxs("span",{children:[c.jsx("kbd",{className:"af-kbd",children:"Esc"})," ",i("flow:jumpPalette.hintClose")]})]})]})})}function p4({open:e,onClose:t,flowId:n,flowSource:r,flowArchived:i=!1,filePath:o,fileName:s,onSaved:a,onAiEdit:l}){const{t:u}=rt(),f=x.useId(),d=x.useRef(null),p=x.useRef(null),[h,m]=x.useState(""),[v,k]=x.useState(""),[g,w]=x.useState(!1),[y,N]=x.useState(!1),[E,S]=x.useState(!1),[P,T]=x.useState(""),[M,B]=x.useState("");if(x.useEffect(()=>{if(!e||!o)return;m(""),k(""),T(""),B(""),w(!0),N(!1),S(!1);const D=new URLSearchParams({flowId:n,flowSource:r,archived:i?"1":"0",path:o});(async()=>{try{const _=await fetch(`/api/pipeline-file-content?${D}`),I=await _.json();if(!_.ok)throw new Error(I.error||"HTTP "+_.status);m(I.content||""),k(I.content||"")}catch(_){T(_.message||String(_))}finally{w(!1)}})();const $=requestAnimationFrame(()=>{var _;return(_=d.current)==null?void 0:_.focus()});return()=>cancelAnimationFrame($)},[e,o,n,r,i]),!e)return null;const A=h!==v;async function R(D){if(D.preventDefault(),!y){N(!0),T(""),B("");try{const $=new URLSearchParams({flowId:n,flowSource:r,archived:i?"1":"0",path:o}),_=await fetch(`/api/pipeline-file-save?${$}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})}),I=await _.json();if(!_.ok)throw new Error(I.error||"HTTP "+_.status);k(h),B(u("flow:fileEdit.saved")),a&&a()}catch($){T($.message||String($))}finally{N(!1)}}}async function V(){if(!(!l||E||!h)){S(!0),T("");try{const D=await l(h);typeof D=="string"&&D&&m(D)}catch(D){T(D.message||String(D))}finally{S(!1)}}}function L(){m(v),T(""),B("")}const H=h.length>1e5;return c.jsx("div",{className:"af-shortcuts-overlay",role:"presentation",onMouseDown:D=>{D.target===D.currentTarget&&t()},children:c.jsxs("div",{ref:d,className:"af-shortcuts-panel af-file-edit-panel",role:"dialog","aria-modal":"true","aria-labelledby":f,tabIndex:-1,onMouseDown:D=>D.stopPropagation(),children:[c.jsxs("div",{className:"af-shortcuts-panel__head",children:[c.jsx("h2",{id:f,className:"af-shortcuts-panel__title",children:s||o}),c.jsx("button",{type:"button",className:"af-shortcuts-panel__close af-icon-btn",onClick:t,"aria-label":u("flow:fileEdit.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx("div",{className:"af-file-edit-body",children:g?c.jsx("div",{className:"af-file-edit-loading",children:u("flow:fileEdit.loading")}):P&&!h?c.jsx("div",{className:"af-file-edit-error",children:P}):c.jsxs(c.Fragment,{children:[H&&c.jsx("div",{className:"af-file-edit-warning",children:u("flow:fileEdit.largeFileWarning")}),c.jsx("textarea",{ref:p,className:"af-file-edit-textarea",value:h,onChange:D=>m(D.target.value),spellCheck:!1,placeholder:u("flow:fileEdit.placeholder")})]})}),(P||M)&&!g&&c.jsx("div",{className:`af-file-edit-status${M?" af-file-edit-status--success":""}`,children:M||P}),c.jsxs("div",{className:"af-file-edit-actions",children:[c.jsx("button",{type:"button",className:"af-btn-secondary",onClick:L,disabled:!A||y||E,children:u("flow:fileEdit.reset")}),l&&c.jsx("button",{type:"button",className:"af-btn-secondary af-btn-ai",onClick:V,disabled:E||y||!h,children:u(E?"flow:fileEdit.aiRunning":"flow:fileEdit.aiEdit")}),c.jsx("button",{type:"button",className:"af-btn-primary",onClick:R,disabled:!A||y||E,children:u(y?"flow:fileEdit.saving":"flow:fileEdit.save")})]})]})})}const cj=new Set(["workspaceRoot","flowName","runDir","flowDir"]),h4=["workspaceRoot","flowName","runDir","flowDir"];function m4(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 g4(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 eb(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 uj(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(cj.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 dj(e){return{inputNames:eb(e==null?void 0:e.inputs),outputNames:eb(e==null?void 0:e.outputs)}}function y4(e,t,n){const r=dj(t),i=g4(e),o=[];for(const s of i)if(!uj(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 x4(e,t){const n=dj(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],l=uj(s[1],n);i.push({kind:l?"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 w4(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function v4(e){return e.map(t=>{const n=w4(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 b4(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 h4)cj.has(r)&&n.push({section:"runtime",insert:r,label:r,subtitle:t("flow:placeholder.runtimeConst")});return n}function S4(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 k4(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(),l=parseFloat(r.lineHeight),u=Number.isFinite(l)&&l>0?l:a.height||16;return document.body.removeChild(i),{top:a.top,left:a.left,bottom:a.bottom,height:u}}function Xu({value:e,onChange:t,disabled:n,placeholder:r,rows:i=8,textareaClassName:o,ioSlots:s,variant:a="drawer"}){const{t:l}=rt(),u=x.useId(),f=x.useRef(null),d=x.useRef(null),[p,h]=x.useState(0),[m,v]=x.useState(0),[k,g]=x.useState(null),w=x.useMemo(()=>y4(e,s,l),[e,s,l]),y=w.length>0,N=x.useMemo(()=>x4(e,s),[e,s]),E=x.useMemo(()=>v4(N),[N]),S=x.useMemo(()=>n?null:m4(e,p),[e,p,n]),P=x.useMemo(()=>{if(!S)return[];const R=b4(s,l);return S4(R,S.query)},[S,s,l]);x.useEffect(()=>{v(R=>{const V=Math.max(0,P.length-1);return Math.min(Math.max(0,R),V)})},[P.length]);const T=x.useCallback(()=>{const R=f.current;if(!R||!S||P.length===0){g(null);return}const V=k4(R,p);if(!V){g(null);return}const L=4,H=44,D=13.5*16,$=Math.min(P.length*H+8,D);let _=V.bottom+L;_+$>window.innerHeight-8&&(_=Math.max(8,V.top-$-L));const I=288;let C=V.left;C=Math.max(8,Math.min(C,window.innerWidth-I-8)),g({top:_,left:C})},[S,P.length,p]);x.useLayoutEffect(()=>{if(!S||P.length===0){g(null);return}const R=requestAnimationFrame(()=>T());return()=>cancelAnimationFrame(R)},[S,P.length,p,e,T]),x.useEffect(()=>{if(!S||P.length===0)return;const R=()=>T();return window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[S,P.length,T]);const M=x.useCallback(R=>{if(!S)return;const{atIndex:V}=S,L=e.slice(0,V)+"${"+R+"}"+e.slice(p);t(L);const H=V+R.length+3;queueMicrotask(()=>{const D=f.current;D&&(D.focus(),D.setSelectionRange(H,H)),h(H)})},[S,e,p,t]),B=x.useCallback(()=>{const R=f.current,V=d.current;!R||!V||(V.scrollTop=R.scrollTop,V.scrollLeft=R.scrollLeft,S&&P.length>0&&queueMicrotask(()=>T()))},[S,P.length,T]),A=x.useCallback(R=>{if(!n&&S&&P.length>0&&(R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="Enter")){if(R.key==="ArrowDown")R.preventDefault(),v(V=>(V+1)%P.length);else if(R.key==="ArrowUp")R.preventDefault(),v(V=>(V-1+P.length)%P.length);else if(R.key==="Enter"&&!R.shiftKey){R.preventDefault();const V=P[m];V&&M(V.insert)}}},[n,S,P,m,M]);return c.jsxs("div",{className:"af-body-prompt-editor"+(a==="expand"?" af-body-prompt-editor--expand":""),children:[c.jsxs("div",{className:"af-body-prompt-stack",children:[c.jsx("pre",{ref:d,className:"af-body-prompt-backdrop "+o,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:E+`
|
|
108
|
-
`}}),c.jsx("textarea",{ref:f,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:R=>{t(R.target.value),h(R.target.selectionStart??R.target.value.length)},onSelect:R=>{const V=R.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??0)},onClick:R=>{const V=R.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??0)},onKeyUp:R=>{const V=R.target;V instanceof HTMLTextAreaElement&&h(V.selectionStart??V.value.length)},onKeyDown:A,onScroll:B})]}),S&&P.length>0&&k?qi.createPortal(c.jsx("ul",{className:"af-body-ph-menu af-body-ph-menu--pop af-composer-mention-menu",role:"listbox","aria-label":l("flow:nodeProps.placeholderSlots"),style:{position:"fixed",top:k.top,left:k.left,right:"auto",bottom:"auto",margin:0,zIndex:2e4},children:P.map((R,V)=>c.jsx("li",{role:"option","aria-selected":V===m,children:c.jsxs("button",{type:"button",className:"af-composer-mention-item"+(V===m?" af-composer-mention-item--active":""),onMouseDown:L=>L.preventDefault(),onMouseEnter:()=>v(V),onClick:()=>M(R.insert),children:[c.jsx("span",{className:"af-composer-mention-id",children:`\${${R.insert}}`}),R.subtitle?c.jsx("span",{className:"af-composer-mention-sub",children:R.subtitle}):null]})},`${R.section}-${R.insert}`))}),document.body):null,y?c.jsx("p",{id:u,className:"af-body-ph-issues",role:"status",children:w.map(R=>R.message).join(" · ")}):null]})}const N4=/^[a-zA-Z_][a-zA-Z0-9_-]*$/;function Qu(e){const t=e.indexOf(" - ");return t>=0?e.slice(0,t).trim():e.trim()}function tb({kind:e,label:t,slots:n,onSlotsChange:r,disabled:i}){const{t:o}=rt(),s=()=>r([...n,{type:"node",name:"",default:""}]),a=f=>r(n.filter((d,p)=>p!==f)),l=(f,d,p)=>{const h=n.map((m,v)=>v===f?{...m,[d]:p}:m);r(h)},u=e==="input"?"input":"output";return c.jsxs("div",{className:"af-node-props-field af-node-props-field--io",children:[c.jsxs("div",{className:"af-node-props-io-head",children:[c.jsx("span",{className:"af-node-props-label",children:t}),c.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")})]}),c.jsx("p",{className:"af-node-props-io-hint",children:o("flow:nodeProps.handleHint",{prefix:u})}),n.length===0?c.jsx("p",{className:"af-node-props-io-empty",children:o(e==="input"?"flow:nodeProps.noInputPins":"flow:nodeProps.noOutputPins")}):null,n.length>0?c.jsxs("div",{className:"af-node-props-io-table",role:"group","aria-label":t,children:[c.jsxs("div",{className:"af-node-props-io-table-head","aria-hidden":!0,children:[c.jsx("span",{children:o("flow:nodeProps.handle")}),c.jsx("span",{children:o("flow:nodeProps.type")}),c.jsx("span",{children:o("flow:nodeProps.name")}),c.jsx("span",{children:o("flow:nodeProps.defaultValue")}),c.jsx("span",{})]}),n.map((f,d)=>c.jsxs("div",{className:"af-node-props-io-row",children:[c.jsxs("span",{className:"af-node-props-io-handle",title:`${u}-${d}`,children:[u,"-",d]}),c.jsx("select",{className:"af-node-props-input af-node-props-io-cell",value:f.type,onChange:p=>l(d,"type",p.target.value),disabled:i,"aria-label":o("flow:nodeProps.pinTypeAriaLabel",{label:t,index:d}),children:["node","text","file","bool"].map(p=>c.jsx("option",{value:p,children:p},p))}),c.jsx("input",{type:"text",className:"af-node-props-input af-node-props-io-cell",value:f.name,onChange:p=>l(d,"name",p.target.value),disabled:i,spellCheck:!1,autoComplete:"off","aria-label":o("flow:nodeProps.pinNameAriaLabel",{label:t,index:d})}),c.jsx("input",{type:"text",className:"af-node-props-input af-node-props-io-cell",value:f.default,onChange:p=>l(d,"default",p.target.value),disabled:i,spellCheck:!1,autoComplete:"off","aria-label":o("flow:nodeProps.pinDefaultAriaLabel",{label:t,index:d})}),c.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:c.jsx("span",{className:"material-symbols-outlined",children:"delete"})})]},`${u}-${d}`))]}):null]})}function C4({draft:e,setDraft:t,definitionId:n,systemPromptReadonly:r,modelLists:i,disabled:o,onIdBlur:s,onClose:a,error:l,ioSlots:u}){const{t:f}=rt(),[d,p]=x.useState(!1),[h,m]=x.useState(!1),v=x.useCallback(S=>{t(P=>P&&{...P,...S})},[t]),{cursorList:k,opencodeList:g,claudeCodeList:w,currentNotInLists:y}=x.useMemo(()=>{const S=Array.isArray(i==null?void 0:i.cursor)?i.cursor:[],P=Array.isArray(i==null?void 0:i.opencode)?i.opencode:[],T=Array.isArray(i==null?void 0:i.claudeCode)?i.claudeCode:[],M=new Set([...S,...P,...T].map(Qu)),B=((e==null?void 0:e.model)??"").trim(),A=B.startsWith("cursor:")?B.slice(7):B.startsWith("opencode:")?B.slice(9):B.startsWith("claude-code:")?B.slice(12):B,R=B&&!M.has(A)?B:"";return{cursorList:S,opencodeList:P,claudeCodeList:T,currentNotInLists:R}},[i,e==null?void 0:e.model]);if(!e)return null;const N=String(e.script??""),E=n==="tool_nodejs"||N.trim()!=="";return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"af-pipeline-drawer-head af-node-props-head",children:[c.jsx("h2",{className:"af-pipeline-drawer-title",children:f("flow:nodeProps.title")}),c.jsx("div",{className:"af-node-props-head-actions",children:c.jsx("button",{type:"button",className:"af-btn-ghost af-node-props-close-secondary",onClick:a,children:f("common:common.close")})})]}),c.jsxs("div",{className:"af-pipeline-drawer-body af-node-props-body",children:[l?c.jsx("p",{className:"af-err af-node-props-err",children:l}):null,c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsx("span",{className:"af-node-props-label",children:f("flow:node.nodeType")}),c.jsx("div",{className:"af-pipeline-drawer-readonly af-node-props-readonly-mono",children:n})]}),c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsxs("span",{className:"af-node-props-label",children:[f("flow:node.displayName"),c.jsx("span",{className:"af-node-props-hint",children:f("flow:node.displayNameHint")})]}),c.jsx("input",{type:"text",className:"af-node-props-input",value:e.newId,onChange:S=>v({newId:S.target.value}),onBlur:s,disabled:o,spellCheck:!1,autoComplete:"off","aria-label":f("flow:nodeProps.instanceId")})]}),c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsxs("span",{className:"af-node-props-label",children:[f("flow:node.displayName"),"(LABEL)"]}),c.jsx("input",{type:"text",className:"af-node-props-input",value:e.label,onChange:S=>v({label:S.target.value}),disabled:o,spellCheck:!1})]}),c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsxs("span",{className:"af-node-props-label",children:[f("flow:node.role"),"(ROLE)"]}),c.jsx("select",{className:"af-node-props-select",value:Ko.includes(e.role)?e.role:f("flow:roles.normal"),onChange:S=>v({role:S.target.value}),disabled:o,children:Ko.map(S=>c.jsx("option",{value:S,children:S},S))})]}),c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsxs("span",{className:"af-node-props-label",children:[f("flow:node.model"),"(MODEL)"]}),c.jsx("span",{className:"af-node-props-sublabel",children:f("flow:node.modelHint")}),c.jsxs("select",{className:"af-node-props-select",value:(()=>{const S=(e.model||"").trim();return S?y||S:""})(),onChange:S=>v({model:S.target.value}),disabled:o,"aria-label":f("flow:nodeProps.modelAriaLabel"),children:[c.jsx("option",{value:"",children:f("flow:node.defaultModel")}),y?c.jsxs("option",{value:y,children:[y,f("flow:nodeProps.yamlValueNotInList")]}):null,k.length>0?c.jsx("optgroup",{label:"Cursor",children:k.map(S=>c.jsx("option",{value:Qu(S),children:S},`c-${S}`))}):null,g.length>0?c.jsx("optgroup",{label:"OpenCode",children:g.map(S=>c.jsx("option",{value:Qu(S),children:S},`o-${S}`))}):null,w.length>0?c.jsx("optgroup",{label:"Claude Code",children:w.map(S=>c.jsx("option",{value:`claude-code:${Qu(S)}`,children:S},`cc-${S}`))}):null]})]}),c.jsx(tb,{kind:"input",label:f("flow:nodeProps.inputPins"),slots:Array.isArray(e.inputs)?e.inputs:[],onSlotsChange:S=>v({inputs:S}),disabled:o}),c.jsx(tb,{kind:"output",label:f("flow:nodeProps.outputPins"),slots:Array.isArray(e.outputs)?e.outputs:[],onSlotsChange:S=>v({outputs:S}),disabled:o}),E?c.jsxs("div",{className:"af-pipeline-drawer-field af-node-props-field af-node-props-field--prompt",children:[c.jsxs("div",{className:"af-node-props-prompt-head",children:[c.jsxs("span",{className:"af-node-props-label",children:[f("flow:node.directCommand"),"(script)",c.jsx("span",{className:"af-node-props-hint",children:f("flow:node.scriptHint")})]}),c.jsx("button",{type:"button",className:"af-icon-btn af-node-props-expand",onClick:()=>m(!0),"aria-label":f("flow:nodeProps.expandEditScript"),title:f("flow:nodeProps.expand"),disabled:o,children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),c.jsx(Xu,{value:N,onChange:S=>v({script:S}),disabled:o,placeholder:f("flow:nodeProps.scriptPlaceholder"),rows:6,textareaClassName:"af-pipeline-drawer-textarea af-node-props-body-textarea af-node-props-script-textarea",ioSlots:u,variant:"drawer"})]}):null,c.jsxs("div",{className:"af-pipeline-drawer-field af-node-props-field af-node-props-field--prompt",children:[c.jsxs("div",{className:"af-node-props-prompt-head",children:[c.jsx("span",{className:"af-node-props-label",children:f("flow:node.userPrompt")}),c.jsx("button",{type:"button",className:"af-icon-btn af-node-props-expand",onClick:()=>p(!0),"aria-label":f("flow:nodeProps.expandEdit"),title:f("flow:nodeProps.expand"),disabled:o,children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),c.jsx(Xu,{value:e.body,onChange:S=>v({body:S}),disabled:o,placeholder:f("flow:nodeProps.bodyPlaceholder"),rows:8,textareaClassName:"af-pipeline-drawer-textarea af-node-props-body-textarea",ioSlots:u,variant:"drawer"})]}),c.jsxs("label",{className:"af-pipeline-drawer-field af-node-props-field",children:[c.jsx("span",{className:"af-node-props-label",children:f("flow:node.systemDescription")}),c.jsx("textarea",{className:"af-pipeline-drawer-textarea af-node-props-system-readonly",rows:4,readOnly:!0,value:r||f("flow:nodeProps.noDescription"),spellCheck:!1})]})]}),h?c.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true","aria-label":f("flow:nodeProps.editScript"),onMouseDown:S=>{S.target===S.currentTarget&&m(!1)},children:c.jsxs("div",{className:"af-node-props-expand-panel",children:[c.jsxs("div",{className:"af-node-props-expand-head",children:[c.jsx("span",{className:"af-node-props-expand-title",children:f("flow:node.directCommand")}),c.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>m(!1),"aria-label":f("flow:nodeProps.collapse"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx(Xu,{value:N,onChange:S=>v({script:S}),disabled:o,placeholder:f("flow:nodeProps.scriptPlaceholderExpand"),rows:16,textareaClassName:"af-node-props-expand-textarea",ioSlots:u,variant:"expand"})]})}):null,d?c.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true","aria-label":f("flow:nodeProps.editUserPrompt"),onMouseDown:S=>{S.target===S.currentTarget&&p(!1)},children:c.jsxs("div",{className:"af-node-props-expand-panel",children:[c.jsxs("div",{className:"af-node-props-expand-head",children:[c.jsx("span",{className:"af-node-props-expand-title",children:f("flow:node.body")}),c.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>p(!1),"aria-label":f("flow:nodeProps.collapse"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx(Xu,{value:e.body,onChange:S=>v({body:S}),disabled:o,placeholder:f("flow:nodeProps.bodyPlaceholderExpand"),rows:16,textareaClassName:"af-node-props-expand-textarea",ioSlots:u,variant:"expand"})]})}):null]})}function E4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const j4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_4={};function nb(e,t){return(_4.jsx?P4:j4).test(e)}const I4=/[ \t\n\f\r]/g;function A4(e){return typeof e=="object"?e.type==="text"?rb(e.value):!1:rb(e)}function rb(e){return e.replace(I4,"")===""}class Dc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Dc.prototype.normal={};Dc.prototype.property={};Dc.prototype.space=void 0;function fj(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Dc(n,r,t)}function _g(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 T4=0;const Te=Xo(),bt=Xo(),Ig=Xo(),ie=Xo(),Qe=Xo(),Ks=Xo(),En=Xo();function Xo(){return 2**++T4}const Ag=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:bt,commaOrSpaceSeparated:En,commaSeparated:Ks,number:ie,overloadedBoolean:Ig,spaceSeparated:Qe},Symbol.toStringTag,{value:"Module"})),Oh=Object.keys(Ag);class dx extends kn{constructor(t,n,r,i){let o=-1;if(super(t,n),ib(this,"space",i),typeof r=="number")for(;++o<Oh.length;){const s=Oh[o];ib(this,Oh[o],(r&Ag[s])===Ag[s])}}}dx.prototype.defined=!0;function ib(e,t,n){n&&(e[t]=n)}function wa(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new dx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[_g(r)]=r,n[_g(o.attribute)]=r}return new Dc(t,n,e.space)}const pj=wa({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:Qe,ariaCurrent:null,ariaDescribedBy:Qe,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:Qe,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:Qe,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qe,ariaLevel:ie,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:Qe,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:Qe,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:bt,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 hj(e,t){return t in e?e[t]:t}function mj(e,t){return hj(e,t.toLowerCase())}const R4=wa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:Qe,accessKey:Qe,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Qe,autoFocus:Te,autoPlay:Te,blocking:Qe,capture:null,charSet:null,checked:Te,cite:null,className:Qe,cols:ie,colSpan:null,content:null,contentEditable:bt,controls:Te,controlsList:Qe,coords:ie|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:Ig,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Qe,height:ie,hidden:Ig,high:ie,href:null,hrefLang:null,htmlFor:Qe,httpEquiv:Qe,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Qe,itemRef:Qe,itemScope:Te,itemType:Qe,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:Qe,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Qe,required:Te,reversed:Te,rows:ie,rowSpan:ie,sandbox:Qe,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:bt,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:bt,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qe,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:bt,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:mj}),L4=wa({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:Qe,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:Ks,g2:Ks,glyphName:Ks,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:Qe,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:hj}),gj=wa({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()}}),yj=wa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mj}),xj=wa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),O4={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"},M4=/[A-Z]/g,ob=/-[a-z]/g,D4=/^data[-\w.:]+$/i;function F4(e,t){const n=_g(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"&&D4.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ob,z4);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ob.test(o)){let s=o.replace(M4,$4);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=dx}return new i(r,t)}function $4(e){return"-"+e.toLowerCase()}function z4(e){return e.charAt(1).toUpperCase()}const B4=fj([pj,R4,gj,yj,xj],"html"),fx=fj([pj,L4,gj,yj,xj],"svg");function H4(e){return e.join(" ").trim()}var px={},sb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,U4=/\n/g,V4=/^\s*/,W4=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,K4=/^:\s*/,Y4=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,q4=/^[;\s]*/,G4=/^\s+|\s+$/g,X4=`
|
|
109
|
-
`,ab="/",lb="*",Eo="",Q4="comment",J4="declaration";function Z4(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 v=m.match(U4);v&&(n+=v.length);var k=m.lastIndexOf(X4);r=~k?m.length-k:r+m.length}function o(){var m={line:n,column:r};return function(v){return v.position=new s(m),u(),v}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(m){var v=m.exec(e);if(v){var k=v[0];return i(k),e=e.slice(k.length),v}}function u(){l(V4)}function f(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=o();if(!(ab!=e.charAt(0)||lb!=e.charAt(1))){for(var v=2;Eo!=e.charAt(v)&&(lb!=e.charAt(v)||ab!=e.charAt(v+1));)++v;if(v+=2,Eo===e.charAt(v-1))return a("End of comment missing");var k=e.slice(2,v-2);return r+=2,i(k),e=e.slice(v),r+=2,m({type:Q4,comment:k})}}function p(){var m=o(),v=l(W4);if(v){if(d(),!l(K4))return a("property missing ':'");var k=l(Y4),g=m({type:J4,property:cb(v[0].replace(sb,Eo)),value:k?cb(k[0].replace(sb,Eo)):Eo});return l(q4),g}}function h(){var m=[];f(m);for(var v;v=p();)v!==!1&&(m.push(v),f(m));return m}return u(),h()}function cb(e){return e?e.replace(G4,Eo):Eo}var e5=Z4,t5=zl&&zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(px,"__esModule",{value:!0});px.default=r5;const n5=t5(e5);function r5(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 sp={};Object.defineProperty(sp,"__esModule",{value:!0});sp.camelCase=void 0;var i5=/^--[a-zA-Z0-9_-]+$/,o5=/-([a-z])/g,s5=/^[^-]+$/,a5=/^-(webkit|moz|ms|o|khtml)-/,l5=/^-(ms)-/,c5=function(e){return!e||s5.test(e)||i5.test(e)},u5=function(e,t){return t.toUpperCase()},ub=function(e,t){return"".concat(t,"-")},d5=function(e,t){return t===void 0&&(t={}),c5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(l5,ub):e=e.replace(a5,ub),e.replace(o5,u5))};sp.camelCase=d5;var f5=zl&&zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},p5=f5(px),h5=sp;function Tg(e,t){var n={};return!e||typeof e!="string"||(0,p5.default)(e,function(r,i){r&&i&&(n[(0,h5.camelCase)(r,t)]=i)}),n}Tg.default=Tg;var m5=Tg;const g5=ro(m5),wj=vj("end"),hx=vj("start");function vj(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 y5(e){const t=hx(e),n=wj(e);if(t&&n)return{start:t,end:n}}function Ol(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?db(e.position):"start"in e||"end"in e?db(e):"line"in e||"column"in e?Rg(e):""}function Rg(e){return fb(e&&e.line)+":"+fb(e&&e.column)}function db(e){return Rg(e&&e.start)+"-"+Rg(e&&e.end)}function fb(e){return e&&typeof e=="number"?e:1}class en 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 l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.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=Ol(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}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const mx={}.hasOwnProperty,x5=new Map,w5=/[A-Z]/g,v5=new Set(["table","tbody","thead","tfoot","tr"]),b5=new Set(["td","th"]),bj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S5(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=I5(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=_5(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"?fx:B4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Sj(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Sj(e,t,n){if(t.type==="element")return k5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return N5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return E5(e,t,n);if(t.type==="mdxjsEsm")return C5(e,t);if(t.type==="root")return j5(e,t,n);if(t.type==="text")return P5(e,t)}function k5(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fx,e.schema=i),e.ancestors.push(t);const o=Nj(e,t.tagName,!1),s=A5(e,t);let a=yx(e,t);return v5.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!A4(l):!0})),kj(e,s,o,t),gx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function N5(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)}xc(e,t.position)}function C5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xc(e,t.position)}function E5(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fx,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Nj(e,t.name,!0),s=T5(e,t),a=yx(e,t);return kj(e,s,o,t),gx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function j5(e,t,n){const r={};return gx(r,yx(e,t)),e.create(t,e.Fragment,r,n)}function P5(e,t){return t.value}function kj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _5(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 I5(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=hx(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function A5(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&mx.call(t.properties,i)){const o=R5(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&b5.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 T5(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 xc(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 xc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function yx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:x5;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=Sj(e,o,s);a!==void 0&&n.push(a)}return n}function R5(e,t,n){const r=F4(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?E4(n):H4(n)),r.property==="style"){let i=typeof n=="object"?n:L5(e,String(n));return e.stylePropertyNameCase==="css"&&(i=O5(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?O4[r.property]||r.property:r.attribute,n]}}function L5(e,t){try{return g5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new en("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=bj+"#cannot-parse-style-attribute",i}}function Nj(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=nb(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=nb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return mx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xc(e)}function xc(e,t){const n=new en("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=bj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function O5(e){const t={};let n;for(n in e)mx.call(e,n)&&(t[M5(n)]=e[n]);return t}function M5(e){let t=e.replace(w5,D5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function D5(e){return"-"+e.toLowerCase()}const Mh={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"]},F5={};function $5(e,t){const n=F5,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cj(e,r,i)}function Cj(e,t,n){if(z5(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 pb(e.children,t,n)}return Array.isArray(e)?pb(e,t,n):""}function pb(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Cj(e[i],t,n);return r.join("")}function z5(e){return!!(e&&typeof e=="object")}const hb=document.createElement("i");function xx(e){const t="&"+e+";";hb.innerHTML=t;const n=hb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wr(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 Kn(e,t){return e.length>0?(Wr(e,e.length,0,t),e):t}const mb={}.hasOwnProperty;function B5(e){const t={};let n=-1;for(;++n<e.length;)H5(t,e[n]);return t}function H5(e,t){let n;for(n in t){const i=(mb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){mb.call(i,s)||(i[s]=[]);const a=o[s];U5(i[s],Array.isArray(a)?a:a?[a]:[])}}}function U5(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Wr(e,0,0,r)}function Ej(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 Ys(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mr=ao(/[A-Za-z]/),An=ao(/[\dA-Za-z]/),V5=ao(/[#-'*+\--9=?A-Z^-~]/);function Lg(e){return e!==null&&(e<32||e===127)}const Og=ao(/\d/),W5=ao(/[\dA-Fa-f]/),K5=ao(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const Y5=ao(new RegExp("\\p{P}|\\p{S}","u")),q5=ao(/\s/);function ao(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function va(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 Ze(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ye(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ye(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const G5={tokenize:X5};function X5(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"),Ze(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ee(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Q5={tokenize:J5},gb={tokenize:Z5};function J5(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,l,u)(y)}return u(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const N=t.events.length;let E=N,S;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){S=t.events[E][1].end;break}g(r);let P=N;for(;P<t.events.length;)t.events[P][1].end={...S},P++;return Wr(t.events,E+1,0,t.events.slice(N)),t.events.length=P,u(y)}return a(y)}function u(y){if(r===n.length){if(!i)return p(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gb,f,d)(y)}function f(y){return i&&w(),g(r),p(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(y)}function p(y){return t.containerState={},e.attempt(gb,h,m)(y)}function h(y){return r++,n.push([t.currentConstruct,t.containerState]),p(y)}function m(y){if(y===null){i&&w(),g(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(y)}function v(y){if(y===null){k(e.exit("chunkFlow"),!0),g(0),e.consume(y);return}return Ee(y)?(e.consume(y),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(y),v)}function k(y,N){const E=t.sliceStream(y);if(N&&E.push(null),y.previous=o,o&&(o.next=y),o=y,i.defineSkip(y.start),i.write(E),t.parser.lazy[y.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const P=t.events.length;let T=P,M,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(M){B=t.events[T][1].end;break}M=!0}for(g(r),S=P;S<t.events.length;)t.events[S][1].end={...B},S++;Wr(t.events,T+1,0,t.events.slice(P)),t.events.length=S}}function g(y){let N=n.length;for(;N-- >y;){const E=n[N];t.containerState=E[1],E[0].exit.call(t,e)}n.length=y}function w(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Z5(e,t,n){return Ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yb(e){if(e===null||Sn(e)||q5(e))return 1;if(Y5(e))return 2}function wx(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 Mg={name:"attention",resolveAll:eB,tokenize:tB};function eB(e,t){let n=-1,r,i,o,s,a,l,u,f;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;l=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},p={...e[n][1].start};xb(d,-l),xb(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>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=Kn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Kn(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Kn(u,wx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Kn(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Kn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Wr(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function tB(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yb(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=yb(l),d=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?d:d&&(i||!p)),u._close=!!(o===42?p:p&&(f||!d)),t(l)}}function xb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nB={name:"autolink",tokenize:rB};function rB(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 Mr(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,l):(h===43||h===45||h===46||An(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function l(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||Lg(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),f):V5(h)?(e.consume(h),u):n(h)}function f(h){return An(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||An(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const ap={partial:!0,tokenize:iB};function iB(e,t,n){return r;function r(o){return Ye(o)?Ze(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ee(o)?t(o):n(o)}}const jj={continuation:{tokenize:sB},exit:aB,name:"blockQuote",tokenize:oB};function oB(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 Ye(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function sB(e,t,n){const r=this;return i;function i(s){return Ye(s)?Ze(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(jj,t,n)(s)}}function aB(e){e.exit("blockQuote")}const Pj={name:"characterEscape",tokenize:lB};function lB(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 K5(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const _j={name:"characterReference",tokenize:cB};function cB(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"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=An,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=W5,f):(e.enter("characterReferenceValue"),o=7,s=Og,f(d))}function f(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===An&&!xx(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),f):n(d)}}const wb={partial:!0,tokenize:dB},vb={concrete:!0,name:"codeFenced",tokenize:uB};function uB(e,t,n){const r=this,i={partial:!0,tokenize:E};let o=0,s=0,a;return l;function l(S){return u(S)}function u(S){const P=r.events[r.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===a?(s++,e.consume(S),f):s<3?n(S):(e.exit("codeFencedFenceSequence"),Ye(S)?Ze(e,d,"whitespace")(S):d(S))}function d(S){return S===null||Ee(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(wb,v,N)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):Ye(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ze(e,h,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),p)}function h(S){return S===null||Ee(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||Ee(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===a?n(S):(e.consume(S),m)}function v(S){return e.attempt(i,N,k)(S)}function k(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g}function g(S){return o>0&&Ye(S)?Ze(e,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||Ee(S)?e.check(wb,v,N)(S):(e.enter("codeFlowValue"),y(S))}function y(S){return S===null||Ee(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),y)}function N(S){return e.exit("codeFenced"),t(S)}function E(S,P,T){let M=0;return B;function B(H){return S.enter("lineEnding"),S.consume(H),S.exit("lineEnding"),A}function A(H){return S.enter("codeFencedFence"),Ye(H)?Ze(S,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):R(H)}function R(H){return H===a?(S.enter("codeFencedFenceSequence"),V(H)):T(H)}function V(H){return H===a?(M++,S.consume(H),V):M>=s?(S.exit("codeFencedFenceSequence"),Ye(H)?Ze(S,L,"whitespace")(H):L(H)):T(H)}function L(H){return H===null||Ee(H)?(S.exit("codeFencedFence"),P(H)):T(H)}}}function dB(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 Dh={name:"codeIndented",tokenize:pB},fB={partial:!0,tokenize:hB};function pB(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ze(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Ee(u)?e.attempt(fB,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||Ee(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function hB(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ze(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):Ee(s)?i(s):n(s)}}const mB={name:"codeText",previous:yB,resolve:gB,tokenize:xB};function gB(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 yB(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xB(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"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,f(d)):Ee(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Ee(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",u(d))}}class wB{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&&cl(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),cl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cl(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);cl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cl(this.left,n.reverse())}}}function cl(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 Ij(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new wB(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,vB(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.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={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return Wr(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function vB(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,l=[],u={};let f,d,p=-1,h=n,m=0,v=0;const k=[v];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(v=p+1,k.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):k.pop(),p=k.length;p--;){const g=a.slice(k[p],k[p+1]),w=o.pop();l.push([w,w+g.length-1]),e.splice(w,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const bB={resolve:kB,tokenize:NB},SB={partial:!0,tokenize:CB};function kB(e){return Ij(e),e}function NB(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):Ee(a)?e.check(SB,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 CB(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ze(e,o,"linePrefix")}function o(s){if(s===null||Ee(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 Aj(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||Lg(g)?n(g):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(g))}function p(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),p(g)):g===null||g===60||Ee(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 v(g){return!f&&(g===null||g===41||Sn(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):f<u&&g===40?(e.consume(g),f++,v):g===41?(e.consume(g),f--,v):g===null||g===32||g===40||Lg(g)?n(g):(e.consume(g),g===92?k:v)}function k(g){return g===40||g===41||g===92?(e.consume(g),v):v(g)}}function Tj(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!l||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):Ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Ee(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),l||(l=!Ye(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function Rj(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===s?(e.exit(o),l(s)):p===null?n(p):Ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ze(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===s||p===null||Ee(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:f)}function d(p){return p===s||p===92?(e.consume(p),f):f(p)}}function Ml(e,t){let n;return r;function r(i){return Ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ye(i)?Ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const EB={name:"definition",tokenize:PB},jB={partial:!0,tokenize:_B};function PB(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return Tj.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Ys(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Sn(h)?Ml(e,u)(h):u(h)}function u(h){return Aj(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(jB,d,d)(h)}function d(h){return Ye(h)?Ze(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Ee(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function _B(e,t,n){return r;function r(a){return Sn(a)?Ml(e,i)(a):n(a)}function i(a){return Rj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ye(a)?Ze(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ee(a)?t(a):n(a)}}const IB={name:"hardBreakEscape",tokenize:AB};function AB(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ee(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const TB={name:"headingAtx",resolve:RB,tokenize:LB};function RB(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"},Wr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function LB(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Sn(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||Ee(f)?(e.exit("atxHeading"),t(f)):Ye(f)?Ze(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Sn(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const OB=["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"],bb=["pre","script","style","textarea"],MB={concrete:!0,name:"htmlFlow",resolveTo:$B,tokenize:zB},DB={partial:!0,tokenize:HB},FB={partial:!0,tokenize:BB};function $B(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 zB(e,t,n){const r=this;let i,o,s,a,l;return u;function u(O){return f(O)}function f(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),o=!0,v):O===63?(e.consume(O),i=3,r.interrupt?t:C):Mr(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function p(O){return O===45?(e.consume(O),i=2,h):O===91?(e.consume(O),i=5,a=0,m):Mr(O)?(e.consume(O),i=4,r.interrupt?t:C):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:C):n(O)}function m(O){const q="CDATA[";return O===q.charCodeAt(a++)?(e.consume(O),a===q.length?r.interrupt?t:R:m):n(O)}function v(O){return Mr(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Sn(O)){const q=O===47,ee=s.toLowerCase();return!q&&!o&&bb.includes(ee)?(i=1,r.interrupt?t(O):R(O)):OB.includes(s.toLowerCase())?(i=6,q?(e.consume(O),g):r.interrupt?t(O):R(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?w(O):y(O))}return O===45||An(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function g(O){return O===62?(e.consume(O),r.interrupt?t:R):n(O)}function w(O){return Ye(O)?(e.consume(O),w):B(O)}function y(O){return O===47?(e.consume(O),B):O===58||O===95||Mr(O)?(e.consume(O),N):Ye(O)?(e.consume(O),y):B(O)}function N(O){return O===45||O===46||O===58||O===95||An(O)?(e.consume(O),N):E(O)}function E(O){return O===61?(e.consume(O),S):Ye(O)?(e.consume(O),E):y(O)}function S(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,P):Ye(O)?(e.consume(O),S):T(O)}function P(O){return O===l?(e.consume(O),l=null,M):O===null||Ee(O)?n(O):(e.consume(O),P)}function T(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Sn(O)?E(O):(e.consume(O),T)}function M(O){return O===47||O===62||Ye(O)?y(O):n(O)}function B(O){return O===62?(e.consume(O),A):n(O)}function A(O){return O===null||Ee(O)?R(O):Ye(O)?(e.consume(O),A):n(O)}function R(O){return O===45&&i===2?(e.consume(O),D):O===60&&i===1?(e.consume(O),$):O===62&&i===4?(e.consume(O),F):O===63&&i===3?(e.consume(O),C):O===93&&i===5?(e.consume(O),I):Ee(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(DB,U,V)(O)):O===null||Ee(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),R)}function V(O){return e.check(FB,L,U)(O)}function L(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),H}function H(O){return O===null||Ee(O)?V(O):(e.enter("htmlFlowData"),R(O))}function D(O){return O===45?(e.consume(O),C):R(O)}function $(O){return O===47?(e.consume(O),s="",_):R(O)}function _(O){if(O===62){const q=s.toLowerCase();return bb.includes(q)?(e.consume(O),F):R(O)}return Mr(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),_):R(O)}function I(O){return O===93?(e.consume(O),C):R(O)}function C(O){return O===62?(e.consume(O),F):O===45&&i===2?(e.consume(O),C):R(O)}function F(O){return O===null||Ee(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),F)}function U(O){return e.exit("htmlFlow"),t(O)}}function BB(e,t,n){const r=this;return i;function i(s){return Ee(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 HB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ap,t,n)}}const UB={name:"htmlText",tokenize:VB};function VB(e,t,n){const r=this;let i,o,s;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),E):C===63?(e.consume(C),y):Mr(C)?(e.consume(C),T):n(C)}function u(C){return C===45?(e.consume(C),f):C===91?(e.consume(C),o=0,m):Mr(C)?(e.consume(C),w):n(C)}function f(C){return C===45?(e.consume(C),h):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),p):Ee(C)?(s=d,$(C)):(e.consume(C),d)}function p(C){return C===45?(e.consume(C),h):d(C)}function h(C){return C===62?D(C):C===45?p(C):d(C)}function m(C){const F="CDATA[";return C===F.charCodeAt(o++)?(e.consume(C),o===F.length?v:m):n(C)}function v(C){return C===null?n(C):C===93?(e.consume(C),k):Ee(C)?(s=v,$(C)):(e.consume(C),v)}function k(C){return C===93?(e.consume(C),g):v(C)}function g(C){return C===62?D(C):C===93?(e.consume(C),g):v(C)}function w(C){return C===null||C===62?D(C):Ee(C)?(s=w,$(C)):(e.consume(C),w)}function y(C){return C===null?n(C):C===63?(e.consume(C),N):Ee(C)?(s=y,$(C)):(e.consume(C),y)}function N(C){return C===62?D(C):y(C)}function E(C){return Mr(C)?(e.consume(C),S):n(C)}function S(C){return C===45||An(C)?(e.consume(C),S):P(C)}function P(C){return Ee(C)?(s=P,$(C)):Ye(C)?(e.consume(C),P):D(C)}function T(C){return C===45||An(C)?(e.consume(C),T):C===47||C===62||Sn(C)?M(C):n(C)}function M(C){return C===47?(e.consume(C),D):C===58||C===95||Mr(C)?(e.consume(C),B):Ee(C)?(s=M,$(C)):Ye(C)?(e.consume(C),M):D(C)}function B(C){return C===45||C===46||C===58||C===95||An(C)?(e.consume(C),B):A(C)}function A(C){return C===61?(e.consume(C),R):Ee(C)?(s=A,$(C)):Ye(C)?(e.consume(C),A):M(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,V):Ee(C)?(s=R,$(C)):Ye(C)?(e.consume(C),R):(e.consume(C),L)}function V(C){return C===i?(e.consume(C),i=void 0,H):C===null?n(C):Ee(C)?(s=V,$(C)):(e.consume(C),V)}function L(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Sn(C)?M(C):(e.consume(C),L)}function H(C){return C===47||C===62||Sn(C)?M(C):n(C)}function D(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function $(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),_}function _(C){return Ye(C)?Ze(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):I(C)}function I(C){return e.enter("htmlTextData"),s(C)}}const vx={name:"labelEnd",resolveAll:qB,resolveTo:GB,tokenize:XB},WB={tokenize:QB},KB={tokenize:JB},YB={tokenize:ZB};function qB(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&&Wr(e,0,e.length,n),e}function GB(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 l={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}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Kn(a,e.slice(o+1,o+r+3)),a=Kn(a,[["enter",f,t]]),a=Kn(a,wx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Kn(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=Kn(a,e.slice(s+1)),a=Kn(a,[["exit",l,t]]),Wr(e,o,e.length,a),e}function XB(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(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(Ys(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(WB,f,s?f:d)(p):p===91?e.attempt(KB,f,s?u:d)(p):s?f(p):d(p)}function u(p){return e.attempt(YB,f,d)(p)}function f(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function QB(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)?Ml(e,o)(d):o(d)}function o(d){return d===41?f(d):Aj(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Sn(d)?Ml(e,l)(d):f(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Rj(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return Sn(d)?Ml(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function JB(e,t,n){const r=this;return i;function i(a){return Tj.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Ys(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function ZB(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 eH={name:"labelStartImage",resolveAll:vx.resolveAll,tokenize:tH};function tH(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:vx.resolveAll,tokenize:rH};function rH(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 Fh={name:"lineEnding",tokenize:iH};function iH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ze(e,t,"linePrefix")}}const Cd={name:"thematicBreak",tokenize:oH};function oH(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"),l(u)):r>=3&&(u===null||Ee(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Ye(u)?Ze(e,a,"whitespace")(u):a(u))}}const pn={continuation:{tokenize:cH},exit:dH,name:"list",tokenize:lH},sH={partial:!0,tokenize:fH},aH={partial:!0,tokenize:uH};function lH(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:Og(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(Cd,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Og(h)&&++s<10?(e.consume(h),l):(!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(ap,r.interrupt?n:f,e.attempt(sH,p,d))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return Ye(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function cH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ap,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ze(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ye(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(aH,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ze(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function uH(e,t,n){const r=this;return Ze(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 dH(e){e.exit(this.containerState.type)}function fH(e,t,n){const r=this;return Ze(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!Ye(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Sb={name:"setextUnderline",resolveTo:pH,tokenize:hH};function pH(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 hH(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][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"),Ye(u)?Ze(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const mH={tokenize:gH};function gH(e){const t=this,n=e.attempt(ap,r,e.attempt(this.parser.constructs.flowInitial,i,Ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bB,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 yH={resolveAll:Oj()},xH=Lj("string"),wH=Lj("text");function Lj(e){return{resolveAll:Oj(e==="text"?vH: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(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Oj(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 vH(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,l;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)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||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 bH={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:jj},SH={91:EB},kH={[-2]:Dh,[-1]:Dh,32:Dh},NH={35:TB,42:Cd,45:[Sb,Cd],60:MB,61:Sb,95:Cd,96:vb,126:vb},CH={38:_j,92:Pj},EH={[-5]:Fh,[-4]:Fh,[-3]:Fh,33:eH,38:_j,42:Mg,60:[nB,UB],91:nH,92:[IB,Pj],93:vx,95:Mg,96:mB},jH={null:[Mg,yH]},PH={null:[42,95]},_H={null:[]},IH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PH,contentInitial:SH,disable:_H,document:bH,flow:NH,flowInitial:kH,insideSpan:jH,string:CH,text:EH},Symbol.toStringTag,{value:"Module"}));function AH(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 l={attempt:P(E),check:P(S),consume:w,enter:y,exit:N,interrupt:P(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function d(A){return s=Kn(s,A),k(),s[s.length-1]!==null?[]:(T(t,0),u.events=wx(o,u.events,u),u.events)}function p(A,R){return RH(h(A),R)}function h(A){return TH(s,A)}function m(){const{_bufferIndex:A,_index:R,line:V,column:L,offset:H}=r;return{_bufferIndex:A,_index:R,line:V,column:L,offset:H}}function v(A){i[A.line]=A.column,B()}function k(){let A;for(;r._index<s.length;){const R=s[r._index];if(typeof R=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<R.length;)g(R.charCodeAt(r._bufferIndex));else g(R)}}function g(A){f=f(A)}function w(A){Ee(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,B()):A!==-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=A}function y(A,R){const V=R||{};return V.type=A,V.start=m(),u.events.push(["enter",V,u]),a.push(V),V}function N(A){const R=a.pop();return R.end=m(),u.events.push(["exit",R,u]),R}function E(A,R){T(A,R.from)}function S(A,R){R.restore()}function P(A,R){return V;function V(L,H,D){let $,_,I,C;return Array.isArray(L)?U(L):"tokenize"in L?U([L]):F(L);function F(ne){return ae;function ae(J){const le=J!==null&&ne[J],Se=J!==null&&ne.null,ye=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return U(ye)(J)}}function U(ne){return $=ne,_=0,ne.length===0?D:O(ne[_])}function O(ne){return ae;function ae(J){return C=M(),I=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?ee():ne.tokenize.call(R?Object.assign(Object.create(u),R):u,l,q,ee)(J)}}function q(ne){return A(I,C),H}function ee(ne){return C.restore(),++_<$.length?O($[_]):D}}}function T(A,R){A.resolveAll&&!o.includes(A)&&o.push(A),A.resolve&&Wr(u.events,R,u.events.length-R,A.resolve(u.events.slice(R),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function M(){const A=m(),R=u.previous,V=u.currentConstruct,L=u.events.length,H=Array.from(a);return{from:L,restore:D};function D(){r=A,u.previous=R,u.currentConstruct=V,u.events.length=L,a=H,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TH(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 RH(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 LH(e){const r={constructs:B5([IH,...(e||{}).extensions||[]]),content:i(G5),defined:[],document:i(Q5),flow:i(mH),lazy:{},string:i(xH),text:i(wH)};return r;function i(o){return s;function s(a){return AH(r,o,a)}}}function OH(e){for(;!Ij(e););return e}const kb=/[\0\t\n\r]/g;function MH(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,d,p,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(kb.lastIndex=d,u=kb.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){t=o.slice(d);break}if(h===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(o.slice(d,p)),e+=p-d),h){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const DH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FH(e){return e.replace(DH,$H)}function $H(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Ej(n.slice(o?2:1),o?16:10)}return xx(n)||e}const Mj={}.hasOwnProperty;function zH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),BH(n)(OH(LH(n).document().write(MH()(e,t,!0))))}function BH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Dt),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(Ke),blockQuote:o(Se),characterEscape:M,characterReference:M,codeFenced:o(ye),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ye,s),codeText:o(ge,s),codeTextData:M,data:M,codeFlowValue:M,definition:o(xe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o($e),hardBreakEscape:o(Le),hardBreakTrailing:o(Le),htmlFlow:o(mt,s),htmlFlowData:M,htmlText:o(mt,s),htmlTextData:M,image:o(_t),label:s,link:o(Dt),listItem:o(wr),listItemValue:p,listOrdered:o(Fn,d),listUnordered:o(Fn),paragraph:o(vr),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ke),strong:o(br),thematicBreak:o(gt)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:le,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:ne,characterReference:ae,codeFenced:l(k),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:B,codeIndented:l(g),codeText:l(H),codeTextData:B,data:B,definition:l(),definitionDestinationString:N,definitionLabelString:w,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(V),htmlFlowData:B,htmlText:l(L),htmlTextData:B,image:l($),label:I,labelText:_,lineEnding:A,link:l(D),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:q,resourceDestinationString:C,resourceTitleString:F,resource:U,setextHeading:l(T),setextHeadingLineSequence:P,setextHeadingText:S,strong:l(),thematicBreak:l()}};Dj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let Q={type:"root",children:[]};const Ne={stack:[Q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},Ce=[];let Ie=-1;for(;++Ie<G.length;)if(G[Ie][1].type==="listOrdered"||G[Ie][1].type==="listUnordered")if(G[Ie][0]==="enter")Ce.push(Ie);else{const It=Ce.pop();Ie=i(G,It,Ie)}for(Ie=-1;++Ie<G.length;){const It=t[G[Ie][0]];Mj.call(It,G[Ie][1].type)&&It[G[Ie][1].type].call(Object.assign({sliceSerialize:G[Ie][2].sliceSerialize},Ne),G[Ie][1])}if(Ne.tokenStack.length>0){const It=Ne.tokenStack[Ne.tokenStack.length-1];(It[1]||Nb).call(Ne,void 0,It[0])}for(Q.position={start:_i(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:_i(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)Q=t.transforms[Ie](Q)||Q;return Q}function i(G,Q,Ne){let Ce=Q-1,Ie=-1,It=!1,Ct,Vt,tn,Jn;for(;++Ce<=Ne;){const lt=G[Ce];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?Ie++:Ie--,Jn=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Ct&&!Jn&&!Ie&&!tn&&(tn=Ce),Jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jn=void 0}if(!Ie&<[0]==="enter"&<[1].type==="listItemPrefix"||Ie===-1&<[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(Ct){let cn=Ce;for(Vt=void 0;cn--;){const Ft=G[cn];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Vt&&(G[Vt][1].type="lineEndingBlank",It=!0),Ft[1].type="lineEnding",Vt=cn}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}tn&&(!Vt||tn<Vt)&&(Ct._spread=!0),Ct.end=Object.assign({},Vt?G[Vt][1].start:lt[1].end),G.splice(Vt||Ce,0,["exit",Ct,lt[2]]),Ce++,Ne++}if(lt[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};Ct=cn,G.splice(Ce,0,["enter",cn,lt[2]]),Ce++,Ne++,tn=void 0,Jn=!0}}}return G[Q][1]._spread=It,Ne}function o(G,Q){return Ne;function Ne(Ce){a.call(this,G(Ce),Ce),Q&&Q.call(this,Ce)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(G,Q,Ne){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([Q,Ne||void 0]),G.position={start:_i(Q.start),end:void 0}}function l(G){return Q;function Q(Ne){G&&G.call(this,Ne),u.call(this,Ne)}}function u(G,Q){const Ne=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==G.type&&(Q?Q.call(this,G,Ce[0]):(Ce[1]||Nb).call(this,G,Ce[0]));else throw new Error("Cannot close `"+G.type+"` ("+Ol({start:G.start,end:G.end})+"): it’s not open");Ne.position.end=_i(G.end)}function f(){return $5(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(G){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function h(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=G}function m(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=G}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.value=G.replace(/(\r?\n|\r)$/g,"")}function w(G){const Q=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Q,Ne.identifier=Ys(this.sliceSerialize(G)).toLowerCase()}function y(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.title=G}function N(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.url=G}function E(G){const Q=this.stack[this.stack.length-1];if(!Q.depth){const Ne=this.sliceSerialize(G).length;Q.depth=Ne}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function P(G){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function M(G){const Ne=this.stack[this.stack.length-1].children;let Ce=Ne[Ne.length-1];(!Ce||Ce.type!=="text")&&(Ce=he(),Ce.position={start:_i(G.start),end:void 0},Ne.push(Ce)),this.stack.push(Ce)}function B(G){const Q=this.stack.pop();Q.value+=this.sliceSerialize(G),Q.position.end=_i(G.end)}function A(G){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=Q.children[Q.children.length-1];Ne.position.end=_i(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(M.call(this,G),B.call(this,G))}function R(){this.data.atHardBreak=!0}function V(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.value=G}function L(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.value=G}function H(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.value=G}function D(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=Q,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function $(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=Q,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function _(G){const Q=this.sliceSerialize(G),Ne=this.stack[this.stack.length-2];Ne.label=FH(Q),Ne.identifier=Ys(Q).toLowerCase()}function I(){const G=this.stack[this.stack.length-1],Q=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Ce=G.children;Ne.children=Ce}else Ne.alt=Q}function C(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.url=G}function F(){const G=this.resume(),Q=this.stack[this.stack.length-1];Q.title=G}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function q(G){const Q=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Q,Ne.identifier=Ys(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function ee(G){this.data.characterReferenceType=G.type}function ne(G){const Q=this.sliceSerialize(G),Ne=this.data.characterReferenceType;let Ce;Ne?(Ce=Ej(Q,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=xx(Q);const Ie=this.stack[this.stack.length-1];Ie.value+=Ce}function ae(G){const Q=this.stack.pop();Q.position.end=_i(G.end)}function J(G){B.call(this,G);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(G)}function le(G){B.call(this,G);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(G)}function Se(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function ge(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Le(){return{type:"break"}}function mt(){return{type:"html",value:""}}function _t(){return{type:"image",title:null,url:"",alt:null}}function Dt(){return{type:"link",title:null,url:"",children:[]}}function Fn(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function wr(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function vr(){return{type:"paragraph",children:[]}}function br(){return{type:"strong",children:[]}}function he(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function _i(e){return{line:e.line,column:e.column,offset:e.offset}}function Dj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Dj(e,r):HH(e,r)}}function HH(e,t){let n;for(n in t)if(Mj.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 Nb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ol({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is still open")}function UH(e){const t=this;t.parser=n;function n(r){return zH(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VH(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 WH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
112
|
-
`}]}function KH(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 YH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=va(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 l={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,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function XH(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 QH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Fj(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 JH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Fj(e,t);const i={src:va(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 ZH(e,t){const n={src:va(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 e6(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 t6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Fj(e,t);const i={href:va(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 n6(e,t){const n={href:va(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 r6(e,t,n){const r=e.all(t),i=n?i6(n):$j(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(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 f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
114
|
-
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.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 i6(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=$j(n[r])}return t}function $j(e){const t=e.spread;return t??e.children.length>1}function o6(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 s6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function l6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c6(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=hx(t.children[1]),l=wj(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),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 u6(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 l=-1;const u=[];for(;++l<a;){const d=t.children[l],p={},h=s?s[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:o,properties:p,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function d6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cb=9,Eb=32;function f6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(jb(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(jb(t.slice(i),i>0,!1)),o.join("")}function jb(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Cb||o===Eb;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Cb||o===Eb;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function p6(e,t){const n={type:"text",value:f6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function h6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const m6={blockquote:VH,break:WH,code:KH,delete:YH,emphasis:qH,footnoteReference:GH,heading:XH,html:QH,imageReference:JH,image:ZH,inlineCode:e6,linkReference:t6,link:n6,listItem:r6,list:o6,paragraph:s6,root:a6,strong:l6,table:c6,tableCell:d6,tableRow:u6,text:p6,thematicBreak:h6,toml:Ju,yaml:Ju,definition:Ju,footnoteDefinition:Ju};function Ju(){}const zj=-1,lp=0,Dl=1,wf=2,bx=3,Sx=4,kx=5,Nx=6,Bj=7,Hj=8,Pb=typeof self=="object"?self:globalThis,g6=(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 lp:case zj:return n(s,i);case Dl:{const a=n([],i);for(const l of s)a.push(r(l));return a}case wf:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case bx:return n(new Date(s),i);case Sx:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case kx:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case Nx:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Bj:{const{name:a,message:l}=s;return n(new Pb[a](l),i)}case Hj: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 Pb[o](s),i)};return r},_b=e=>g6(new Map,e)(0),gs="",{toString:y6}={},{keys:x6}=Object,ul=e=>{const t=typeof e;if(t!=="object"||!e)return[lp,t];const n=y6.call(e).slice(8,-1);switch(n){case"Array":return[Dl,gs];case"Object":return[wf,gs];case"Date":return[bx,gs];case"RegExp":return[Sx,gs];case"Map":return[kx,gs];case"Set":return[Nx,gs];case"DataView":return[Dl,n]}return n.includes("Array")?[Dl,n]:n.includes("Error")?[Bj,n]:[wf,n]},Zu=([e,t])=>e===lp&&(t==="function"||t==="symbol"),w6=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=ul(s);switch(a){case lp:{let f=s;switch(l){case"bigint":a=Hj,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([zj],s)}return i([a,f],s)}case Dl:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),i([l,[...p]],s)}const f=[],d=i([a,f],s);for(const p of s)f.push(o(p));return d}case wf:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],d=i([a,f],s);for(const p of x6(s))(e||!Zu(ul(s[p])))&&f.push([o(p),o(s[p])]);return d}case bx:return i([a,s.toISOString()],s);case Sx:{const{source:f,flags:d}=s;return i([a,{source:f,flags:d}],s)}case kx:{const f=[],d=i([a,f],s);for(const[p,h]of s)(e||!(Zu(ul(p))||Zu(ul(h))))&&f.push([o(p),o(h)]);return d}case Nx:{const f=[],d=i([a,f],s);for(const p of s)(e||!Zu(ul(p)))&&f.push(o(p));return d}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},Ib=(e,{json:t,lossy:n}={})=>{const r=[];return w6(!(t||n),!!t,new Map,r)(e),r},vf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_b(Ib(e,t)):structuredClone(e):(e,t)=>_b(Ib(e,t));function v6(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 b6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||v6,r=e.options.footnoteBackLabel||b6,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),d=String(u.identifier).toUpperCase(),p=va(d.toLowerCase());let h=0;const m=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++h<=v;){m.length>0&&m.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,h);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const k=f[f.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const w=k.children[k.children.length-1];w&&w.type==="text"?w.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...m)}else f.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!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:{...vf(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 Uj=function(e){if(e==null)return E6;if(typeof e=="function")return cp(e);if(typeof e=="object")return Array.isArray(e)?k6(e):N6(e);if(typeof e=="string")return C6(e);throw new Error("Expected function, string, or object as test")};function k6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Uj(e[n]);return cp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function N6(e){const t=e;return cp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function C6(e){return cp(t);function t(n){return n&&n.type===e}}function cp(e){return t;function t(n,r,i){return!!(j6(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function E6(){return!0}function j6(e){return e!==null&&typeof e=="object"&&"type"in e}const Vj=[],P6=!0,Ab=!1,_6="skip";function I6(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Uj(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=Vj,m,v,k;if((!t||o(l,u,f[f.length-1]||void 0))&&(h=A6(n(l,f)),h[0]===Ab))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==_6)for(v=(r?g.children.length:-1)+s,k=f.concat(g);v>-1&&v<g.children.length;){const w=g.children[v];if(m=a(w,v,k)(),m[0]===Ab)return m;v=typeof m[1]=="number"?m[1]:v+s}}return h}}}function A6(e){return Array.isArray(e)?e:typeof e=="number"?[P6,e]:e==null?Vj:[e]}function Wj(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),I6(e,o,a,i);function a(l,u){const f=u[u.length-1],d=f?f.children.indexOf(l):void 0;return s(l,d,f)}}const Dg={}.hasOwnProperty,T6={};function R6(e,t){const n=t||T6,r=new Map,i=new Map,o=new Map,s={...m6,...n.handlers},a={all:u,applyData:O6,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:L6,wrap:D6};return Wj(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();d.has(p)||d.set(p,f)}}),a;function l(f,d){const p=f.type,h=a.handlers[p];if(Dg.call(a.handlers,p)&&h)return h(a,f,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:v,...k}=f,g=vf(k);return g.children=a.all(f),g}return vf(f)}return(a.options.unknownHandler||M6)(a,f,d)}function u(f){const d=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],f);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Tb(m.value)),!Array.isArray(m)&&m.type==="element")){const v=m.children[0];v&&v.type==="text"&&(v.value=Tb(v.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function L6(e,t){e.position&&(t.position=y5(e))}function O6(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,vf(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function M6(e,t){const n=t.data||{},r="value"in t&&!(Dg.call(n,"hProperties")||Dg.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 D6(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 Tb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Rb(e,t){const n=R6(e,t),r=n.one(e,void 0),i=S6(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 F6(e,t){return e&&"run"in e?async function(n,r){const i=Rb(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Rb(n,{file:r,...e||t})}}function Lb(e){if(e)throw e}var Ed=Object.prototype.hasOwnProperty,Kj=Object.prototype.toString,Ob=Object.defineProperty,Mb=Object.getOwnPropertyDescriptor,Db=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Kj.call(t)==="[object Array]"},Fb=function(t){if(!t||Kj.call(t)!=="[object Object]")return!1;var n=Ed.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ed.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ed.call(t,i)},$b=function(t,n){Ob&&n.name==="__proto__"?Ob(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},zb=function(t,n){if(n==="__proto__")if(Ed.call(t,n)){if(Mb)return Mb(t,n).value}else return;return t[n]},$6=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=zb(a,n),i=zb(t,n),a!==i&&(f&&i&&(Fb(i)||(o=Db(i)))?(o?(o=!1,s=r&&Db(r)?r:[]):s=r&&Fb(r)?r:{},$b(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&$b(a,{name:n,newValue:i}));return a};const $h=ro($6);function Fg(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 z6(){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(l,...u){const f=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,f?B6(f,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 B6(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ar={basename:H6,dirname:U6,extname:V6,join:W6,sep:"/"};function H6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fc(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 U6(e){if(Fc(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 V6(e){Fc(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 W6(...e){let t=-1,n;for(;++t<e.length;)Fc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":K6(n)}function K6(e){Fc(e);const t=e.codePointAt(0)===47;let n=Y6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Y6(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;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(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),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 Fc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const q6={cwd:G6};function G6(){return"/"}function $g(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(!$g(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 Q6(e)}function Q6(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 zh=["history","path","basename","stem","extname","dirname"];class Yj{constructor(t){let n;t?$g(t)?n={path:t}:typeof t=="string"||J6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":q6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zh.length;){const o=zh[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)zh.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ar.basename(this.path):void 0}set basename(t){Hh(t,"basename"),Bh(t,"basename"),this.path=Ar.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ar.dirname(this.path):void 0}set dirname(t){Bb(this.basename,"dirname"),this.path=Ar.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ar.extname(this.path):void 0}set extname(t){if(Bh(t,"extname"),Bb(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=Ar.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){$g(t)&&(t=X6(t)),Hh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ar.basename(this.path,this.extname):void 0}set stem(t){Hh(t,"stem"),Bh(t,"stem"),this.path=Ar.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 en(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 Bh(e,t){if(e&&e.includes(Ar.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ar.sep+"`")}function Hh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Bb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function J6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Z6=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},e8={}.hasOwnProperty;class Cx extends Z6{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=z6()}copy(){const t=new Cx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($h(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Wh("data",this.frozen),this.namespace[t]=n,this):e8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wh("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=ed(t),r=this.parser||this.Parser;return Uh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Uh("process",this.parser||this.Parser),Vh("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=ed(t),l=r.parse(a);r.run(l,a,function(f,d,p){if(f||!d||!p)return u(f);const h=d,m=r.stringify(h,p);r8(m)?p.value=m:p.result=m,u(f,p)});function u(f,d){f||!d?s(f):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Uh("processSync",this.parser||this.Parser),Vh("processSync",this.compiler||this.Compiler),this.process(t,i),Ub("processSync","process",n),r;function i(o,s){n=!0,Lb(o),r=s}}run(t,n,r){Hb(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 l=ed(n);i.run(t,l,u);function u(f,d,p){const h=d||t;f?a(f):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ub("runSync","run",r),i;function o(s,a){Lb(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=ed(n),i=this.compiler||this.Compiler;return Vh("stringify",i),Hb(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Wh("use",this.frozen),t!=null)if(typeof t=="function")l(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")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...d]=u;l(f,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=$h(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===u){p=d;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[h,...m]=f;const v=r[p][1];Fg(v)&&Fg(h)&&(h=$h(!0,v,h)),r[p]=[u,h,...m]}}}}const t8=new Cx().freeze();function Uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wh(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 Hb(e){if(!Fg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ub(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return n8(e)?e:new Yj(e)}function n8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function r8(e){return typeof e=="string"||i8(e)}function i8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vb=[],Wb={allowDangerousHtml:!0},s8=/^(https?|ircs?|mailto|xmpp)$/i,a8=[{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 qj(e){const t=l8(e),n=c8(e);return u8(t.runSync(t.parse(n),n),e)}function l8(e){const t=e.rehypePlugins||Vb,n=e.remarkPlugins||Vb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Wb}:Wb;return t8().use(UH).use(n).use(F6,r).use(t)}function c8(e){const t=e.children||"",n=new Yj;return typeof t=="string"&&(n.value=t),n}function u8(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||d8;for(const f of a8)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+o8+f.id,void 0);return Wj(e,u),S5(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return s?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let h;for(h in Mh)if(Object.hasOwn(Mh,h)&&Object.hasOwn(f.properties,h)){const m=f.properties[h],v=Mh[h];(v===null||v.includes(f.tagName))&&(f.properties[h]=l(String(m||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(f,d,p)),h&&p&&typeof d=="number")return a&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function d8(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||s8.test(e.slice(0,t))?e:""}function Ex(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 f8(e){const t=Ex(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 Gj(e){try{return JSON.stringify(JSON.parse(e.trim()),null,2)}catch{return e}}function Kb({text:e}){const{t}=rt(),n=e||"";return n.trim()?c.jsx("div",{className:"af-run-ctx-md",children:c.jsx(qj,{children:n})}):c.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.empty")})}function Yb({o:e}){var r;const{t}=rt(),n=Ex(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 c.jsxs("div",{className:"af-run-ctx-media",children:[c.jsx("img",{className:"af-run-ctx-img",src:o,alt:e.slot||"output",loading:"lazy"}),e.truncated?c.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.imageTruncated")}):null]})}if(n==="json")return c.jsx("pre",{className:"af-run-ctx-pre",children:Gj(e.content||"")});if(n==="markdown"){const i=e.content||"";return i.trim()?c.jsx("div",{className:"af-run-ctx-md",children:c.jsx(qj,{children:i})}):c.jsx("div",{className:"af-run-ctx-hint",children:t("flow:runContext.empty")})}return c.jsx("pre",{className:"af-run-ctx-pre",children:e.content!=null&&e.content!==""?e.content:t("flow:runContext.empty")})}function qb(e){return f8(e)}function Gb(e){var r;if(!e)return null;const t=Ex(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"?Gj(String(n)):String(n)}function Xb({text:e,title:t,copiedLabel:n}){const[r,i]=x.useState(!1);if(!e)return null;const o=async()=>{try{await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1400)}catch{}};return c.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:c.jsx("span",{className:"material-symbols-outlined",children:r?"check":"content_copy"})})}const Qb=2e4,Xj="af:run-node-ctx-width";function jd(){return typeof window>"u"?416:Math.min(26*16,window.innerWidth-32)}function Fi(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):Fi(jd())}function p8(){try{const e=localStorage.getItem(Xj);if(e==null)return Fi(jd());const t=parseInt(e,10);return Number.isFinite(t)?Fi(t):Fi(jd())}catch{return Fi(jd())}}async function Jb(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 h8(e,t){const n=`flow:runContext.${t}`,r=e(n);return r!==n?r:t}function m8({instanceId:e,flowId:t,runId:n,nodeStatus:r,onClose:i}){const{t:o}=rt(),[s,a]=x.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 960px)").matches),[l,u]=x.useState(p8),f=x.useRef({active:!1,pointerId:-1,startX:0,startW:416}),[d,p]=x.useState(!0),[h,m]=x.useState(""),[v,k]=x.useState([]),[g,w]=x.useState(null),[y,N]=x.useState(null),E=x.useRef(null),S=x.useRef(null),P=x.useRef(0),T=x.useRef(0);x.useLayoutEffect(()=>{const _=window.matchMedia("(max-width: 960px)"),I=()=>a(_.matches);return _.addEventListener("change",I),()=>_.removeEventListener("change",I)},[]),x.useEffect(()=>{function _(){u(I=>Fi(I))}return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const M=x.useCallback(()=>{u(_=>{const I=Fi(_);try{localStorage.setItem(Xj,String(I))}catch{}return I})},[]),B=x.useCallback(_=>{if(s||_.button!==0)return;_.preventDefault();const I=_.currentTarget;f.current={active:!0,pointerId:_.pointerId,startX:_.clientX,startW:l},I.setPointerCapture(_.pointerId)},[s,l]),A=x.useCallback(_=>{const I=f.current;if(!I.active||_.pointerId!==I.pointerId)return;const C=I.startX-_.clientX;u(Fi(I.startW+C))},[]),R=x.useCallback(_=>{const I=f.current;if(!(!I.active||_.pointerId!==I.pointerId)){I.active=!1;try{_.currentTarget.releasePointerCapture(_.pointerId)}catch{}M()}},[M]),V=x.useCallback(()=>{const _=f.current;_.active&&(_.active=!1,M())},[M]),L=x.useCallback(_=>{const I=Array.isArray(_)?_:[];k(I),w(C=>C&&I.some(F=>F.execId===C)?C:I.length>0?I[I.length-1].execId:null)},[]),H=x.useCallback(()=>{if(!e||!t)return;const _=++P.current,I=new AbortController,C=window.setTimeout(()=>I.abort(),Qb);(async()=>{try{const F=await Jb(t,e,n,I.signal);if(_!==P.current)return;L(Array.isArray(F.rounds)?F.rounds:[])}catch{}finally{window.clearTimeout(C)}})()},[e,t,n,L]);x.useEffect(()=>{if(!e||!t){p(!1),m(""),k([]);return}const _=++T.current;p(!0),m(""),k([]),w(null);const I=new AbortController,C=window.setTimeout(()=>I.abort(),Qb);return(async()=>{try{const F=await Jb(t,e,n,I.signal);if(_!==T.current)return;L(Array.isArray(F.rounds)?F.rounds:[])}catch(F){if(_!==T.current)return;const U=(F==null?void 0:F.name)==="AbortError"?"requestTimeout":F.message||String(F);m(U)}finally{window.clearTimeout(C),_===T.current&&p(!1)}})(),()=>{I.abort(),T.current++,P.current++}},[e,t,n,L]),x.useEffect(()=>{r&&H()},[r,H]),x.useEffect(()=>{clearInterval(S.current);const _=v.length>0?v[v.length-1]:null;return(r==="running"&&v.length===0||!!(_&&_.status==="running"))&&e&&t&&(S.current=setInterval(()=>H(),2e3)),()=>clearInterval(S.current)},[v,e,t,n,r,H]),x.useEffect(()=>{E.current&&(E.current.scrollTop=0)},[g]);const D=v.find(_=>_.execId===g),$=s?void 0:{width:`${l}px`};return c.jsxs("aside",{className:"af-run-ctx-panel",style:$,"aria-label":o("flow:runContext.title"),children:[s?null:c.jsx("div",{className:"af-run-ctx-resize",role:"separator","aria-orientation":"vertical","aria-label":o("flow:runContext.resizeHandle"),onPointerDown:B,onPointerMove:A,onPointerUp:R,onPointerCancel:R,onLostPointerCapture:V}),c.jsxs("div",{className:"af-run-ctx-panel__main",children:[c.jsxs("div",{className:"af-run-ctx-head",children:[c.jsx("h2",{className:"af-run-ctx-title",title:e,children:e}),c.jsx("button",{type:"button",className:"af-icon-btn",onClick:i,"aria-label":o("common:common.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),d&&c.jsx("div",{className:"af-run-ctx-placeholder",children:o("common:common.loading")}),h&&c.jsx("div",{className:"af-run-ctx-error",children:h8(o,h)}),!d&&!h&&v.length===0&&c.jsx("div",{className:"af-run-ctx-placeholder",children:o(r==="running"?"flow:runContext.executingNoArtifacts":"flow:runContext.noData")}),v.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"af-run-ctx-rounds af-run-ctx-rounds--select af-run-ctx-round--"+y8((D==null?void 0:D.status)||""),children:[c.jsx("span",{className:"af-run-ctx-round-dot","aria-hidden":!0}),c.jsx("select",{className:"af-run-ctx-round-select",value:String(g??""),onChange:_=>{const I=_.target.value;w(I==="latest"?"latest":Number(I))},children:[...v].reverse().map(_=>{const I=_.execId==="latest"?o("flow:runContext.latest"):`#${_.execId}`,C=x8(o,_.status),F=_.finishedAt?` · ${g8(_.finishedAt)}`:"";return c.jsx("option",{value:String(_.execId),children:`${I} · ${C}${F}`},_.execId)})})]}),D&&c.jsxs("div",{className:"af-run-ctx-body",ref:E,children:[D.inputs&&D.inputs.length>0&&c.jsxs("section",{className:"af-run-ctx-section",children:[c.jsxs("h3",{className:"af-run-ctx-section-title",children:[c.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"input"}),"Inputs"]}),D.inputs.map((_,I)=>c.jsxs("div",{className:"af-run-ctx-output-slot",children:[c.jsx("div",{className:"af-run-ctx-slot-head",children:c.jsx("div",{className:"af-run-ctx-slot-name",children:_.slot})}),c.jsx("pre",{className:"af-run-ctx-slot-text",children:_.value})]},`${_.slot}-${I}`))]}),D.prompt!=null&&c.jsxs("section",{className:"af-run-ctx-section",children:[c.jsxs("h3",{className:"af-run-ctx-section-title",children:[c.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"description"}),"Prompt",c.jsx("button",{type:"button",className:"af-icon-btn af-run-ctx-section-expand",onClick:()=>N("prompt"),title:o("flow:nodeProps.expand"),children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),c.jsx(Kb,{text:D.prompt})]}),D.outputs&&D.outputs.length>0&&c.jsxs("section",{className:"af-run-ctx-section",children:[c.jsxs("h3",{className:"af-run-ctx-section-title",children:[c.jsx("span",{className:"material-symbols-outlined af-run-ctx-section-icon","aria-hidden":!0,children:"output"}),"Outputs",c.jsx("button",{type:"button",className:"af-icon-btn af-run-ctx-section-expand",onClick:()=>N("output"),title:o("flow:nodeProps.expand"),children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),D.outputs.map((_,I)=>{const C=qb(_),F=Gb(_);return c.jsxs("div",{className:"af-run-ctx-output-slot",children:[c.jsxs("div",{className:"af-run-ctx-slot-head",children:[c.jsx("div",{className:"af-run-ctx-slot-name",children:_.slot}),C?c.jsx("span",{className:"af-run-ctx-format-badge",title:o("flow:runContext.detectedContentType"),children:C}):null,c.jsx(Xb,{text:F,title:o("common:common.copy"),copiedLabel:o("common:common.copied")})]}),c.jsx(Yb,{o:_})]},`${_.slot}-${I}`)})]}),!D.prompt&&(!D.outputs||D.outputs.length===0)&&c.jsx("div",{className:"af-run-ctx-placeholder",children:o("flow:runContext.roundNoContent")})]})]})]}),y&&D&&c.jsx("div",{className:"af-node-props-expand-overlay",role:"dialog","aria-modal":"true",onClick:_=>{_.target===_.currentTarget&&N(null)},children:c.jsxs("div",{className:"af-node-props-expand-panel",children:[c.jsxs("div",{className:"af-node-props-expand-head",children:[c.jsx("span",{className:"af-node-props-expand-title",children:y==="prompt"?"Prompt":"Outputs"}),c.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>N(null),"aria-label":o("common:common.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("div",{className:"af-node-props-expand-body af-run-ctx-expand-body",children:[y==="prompt"&&D.prompt!=null&&c.jsx(Kb,{text:D.prompt}),y==="output"&&D.outputs&&D.outputs.map((_,I)=>{const C=qb(_),F=Gb(_);return c.jsxs("div",{className:"af-run-ctx-output-slot",style:{marginBottom:"1rem"},children:[c.jsxs("div",{className:"af-run-ctx-slot-head",children:[c.jsx("div",{className:"af-run-ctx-slot-name",children:_.slot}),C?c.jsx("span",{className:"af-run-ctx-format-badge",children:C}):null,c.jsx(Xb,{text:F,title:o("common:common.copy"),copiedLabel:o("common:common.copied")})]}),c.jsx(Yb,{o:_})]},`${_.slot}-${I}`)})]})]})})]})}function g8(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 y8(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 x8(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 w8({flowId:e,flowSource:t,flowArchived:n,provideNodes:r,edges:i,nodes:o,onCliInputsChange:s,onBackToEdit:a}){const{t:l}=rt(),[u,f]=x.useState({}),[d,p]=x.useState(null),[h,m]=x.useState({}),[v,k]=x.useState(!0),[g,w]=x.useState(!1),[y,N]=x.useState(""),[E,S]=x.useState(!1),[P,T]=x.useState(null),M=x.useRef(null),B=x.useRef(!0),A=x.useRef({});x.useMemo(()=>{var C,F,U;const I={};for(const O of r){const q=(U=(F=(C=O.data)==null?void 0:C.outputs)==null?void 0:F[0])==null?void 0:U.default;q!=null&&q!==""&&(I[O.id]=String(q))}return A.current=I,I},[r]);const R=x.useMemo(()=>{var C;const I={};for(const F of o){if(!((C=F.data)!=null&&C.inputs))continue;const U=F.data.inputs;for(let O=0;O<U.length;O++){const q=U[O];if(!(q!=null&&q.name))continue;const ee=i.find(ae=>ae.target===F.id&&ae.targetHandle===`input-${O}`);if(!(ee!=null&&ee.source))continue;r.find(ae=>ae.id===ee.source)&&(I[ee.source]=q.name)}}return I},[o,i,r]);x.useEffect(()=>(B.current=!0,()=>{B.current=!1}),[]),x.useEffect(()=>{if(!e){k(!1);return}k(!0);const I=new URLSearchParams({flowId:e,flowSource:t||"user"});n&&I.set("archived","1"),fetch(`/api/flow/run-config?${I.toString()}`).then(C=>{if(!C.ok)throw new Error(`HTTP ${C.status}`);return C.json()}).then(C=>{var U;if(!B.current)return;f(C.presets||{}),p(C.activePreset||null);const F=C.activePreset&&((U=C.presets)!=null&&U[C.activePreset])?C.presets[C.activePreset]:{};m({...A.current,...F}),k(!1)}).catch(()=>{B.current&&(m(A.current),k(!1))})},[e,t,n]),x.useEffect(()=>{var C;if(!s)return;const I={};for(const[F,U]of Object.entries(h)){const O=R[F];if(!O)continue;const q=r.find(ne=>ne.id===F);if(!q)continue;(((C=q.data)==null?void 0:C.definitionId)||"").startsWith("provide_file")?I[O]={type:"file",path:U}:I[O]={type:"str",value:U}}s(I)},[h,R,r,s]);const V=x.useCallback((I,C)=>{m(F=>({...F,[I]:C}))},[]),L=x.useCallback(I=>{I!==d&&(p(I),I&&u[I]?m({...A.current,...u[I]}):m(A.current))},[d,u]),H=x.useCallback(async()=>{if(y.trim()){w(!0);try{const I={...u,[y.trim()]:h},C={flowId:e,flowSource:t,archived:n,presets:I,activePreset:y.trim()};(await fetch("/api/flow/run-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)})).ok&&(f(I),p(y.trim()),N(""),S(!1))}finally{w(!1)}}},[e,t,n,u,h,y]),D=x.useCallback(async()=>{if(d){w(!0);try{const I={...u};delete I[d];const C=Object.keys(I)[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:I,activePreset:C})})).ok&&(f(I),p(C),C&&I[C]?m({...A.current,...I[C]}):m(A.current))}finally{w(!1)}}},[e,t,n,u,d]),$=x.useCallback(async()=>{if(d){w(!0);try{const I={...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:I,activePreset:d})})).ok&&f(I)}finally{w(!1)}}},[e,t,n,u,d,h]),_=Object.keys(u);return _.length>0,v?c.jsx("aside",{className:"af-run-config-panel",children:c.jsx("div",{className:"af-run-config-loading",children:l("common.loading")})}):c.jsxs("aside",{className:"af-run-config-panel",children:[c.jsxs("div",{className:"af-run-config-preset",children:[c.jsx("label",{className:"af-run-config-preset-label",children:l("flow:runConfig.preset")}),c.jsxs("div",{className:"af-run-config-preset-row",children:[c.jsxs("select",{className:"af-run-config-preset-select",value:d||"",onChange:I=>L(I.target.value||null),disabled:g,children:[c.jsx("option",{value:"",children:l("flow:runConfig.default")}),_.map(I=>c.jsx("option",{value:I,children:I},I))]}),c.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--new",onClick:()=>S(!0),disabled:g,title:l("flow:runConfig.newPreset"),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"add"})}),d&&c.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--save",onClick:$,disabled:g,title:l("flow:runConfig.savePreset"),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"save"})}),d&&c.jsx("button",{type:"button",className:"af-run-config-preset-btn af-run-config-preset-btn--delete",onClick:D,disabled:g,title:l("flow:runConfig.deletePreset"),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"delete"})})]})]}),E&&c.jsxs("div",{className:"af-run-config-save-dialog",children:[c.jsx("input",{type:"text",className:"af-run-config-save-input",placeholder:l("flow:runConfig.presetNamePlaceholder"),value:y,onChange:I=>N(I.target.value),disabled:g}),c.jsxs("div",{className:"af-run-config-save-actions",children:[c.jsx("button",{type:"button",className:"af-btn-primary",onClick:H,disabled:g||!y.trim(),children:l(g?"common.saving":"common.save")}),c.jsx("button",{type:"button",className:"af-btn-outline",onClick:()=>{S(!1),N("")},disabled:g,children:l("common.cancel")})]})]}),c.jsxs("div",{className:"af-run-config-inputs",children:[c.jsx("div",{className:"af-run-config-inputs-header",children:l("flow:runConfig.inputParams")}),r.length===0?c.jsx("div",{className:"af-run-config-empty",children:l("flow:runConfig.noProvideNodes")}):c.jsx("div",{className:"af-run-config-input-list",children:r.map(I=>{var ee,ne;const F=(((ee=I.data)==null?void 0:ee.definitionId)||"").startsWith("provide_file"),U=((ne=I.data)==null?void 0:ne.label)||I.id,O=I.id,q=h[O]||"";return c.jsxs("div",{className:"af-run-config-input-item",children:[c.jsxs("div",{className:"af-run-config-input-head",children:[c.jsx("span",{className:"af-run-config-input-icon material-symbols-outlined"+(F?" af-run-config-input-icon--file":""),"aria-hidden":!0,children:F?"description":"text_fields"}),c.jsx("span",{className:"af-run-config-input-label",children:U}),c.jsx("button",{type:"button",className:"af-run-config-input-expand",onClick:()=>T({instanceId:O,label:U,content:q}),"aria-label":l("flow:runConfig.expandInput"),title:l("flow:runConfig.expandInput"),children:c.jsx("span",{className:"material-symbols-outlined",children:"open_in_full"})})]}),c.jsx("div",{className:"af-run-config-input-id",children:O}),c.jsx("input",{type:"text",className:"af-run-config-input-field",value:q,onChange:ae=>V(O,ae.target.value),placeholder:l(F?"flow:runConfig.filePathPlaceholder":"flow:runConfig.stringValuePlaceholder")})]},O)})})]}),P&&qi.createPortal(c.jsx("div",{className:"af-provide-edit-overlay",children:c.jsxs("div",{className:"af-provide-edit-modal",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"af-provide-edit-modal__head",children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit_document"}),c.jsx("span",{className:"af-provide-edit-modal__title",children:P.label}),c.jsx("button",{type:"button",className:"af-provide-edit-modal__close",onClick:()=>T(null),"aria-label":l("common:close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx("div",{className:"af-provide-edit-modal__body",children:c.jsx("textarea",{ref:M,className:"af-provide-edit-modal__textarea",defaultValue:P.content,autoFocus:!0})}),c.jsxs("div",{className:"af-provide-edit-modal__foot",children:[c.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn af-provide-edit-modal__btn--save",onClick:()=>{!P||!M.current||(V(P.instanceId,M.current.value),T(null))},children:[c.jsx("span",{className:"material-symbols-outlined",children:"save"}),l("flow:provideEdit.save")]}),c.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn",onClick:()=>T(null),children:[c.jsx("span",{className:"material-symbols-outlined",children:"close"}),l("flow:provideEdit.cancel")]})]})]})}),document.body)]})}const Qj={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"]},v8={"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 b8(e){return!e||e<1024?`${e||0} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function S8(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 k8(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 Zb(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(Qj))if(r.includes(e))return n;return"other"}function N8({event:e,defaultExpanded:t}){const[n,r]=x.useState(!!t),i=v8[e.tag]||"#a8a8a8",o=e.payload,s=o&&typeof o=="object",a=s?typeof o.text=="string"?o.text:"":String(o||""),l=s?o.meta:null,u=x.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]),f=x.useCallback(d=>{d.stopPropagation();const p=s?JSON.stringify(o,null,2):String(o);try{navigator.clipboard.writeText(p)}catch{}},[o,s]);return c.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:[c.jsxs("div",{style:{padding:"6px 10px",display:"flex",alignItems:"center",gap:10,fontSize:12},children:[c.jsx("span",{style:{color:"#9a9a9a",fontFamily:"monospace",flexShrink:0},children:S8(e.ts)}),c.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}),c.jsx("span",{style:{color:"#c5c2c1",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"monospace"},children:u}),n&&c.jsx("button",{type:"button",onClick:f,style:{background:"rgba(124,77,255,0.15)",color:"#e8deff",border:"none",borderRadius:3,padding:"2px 8px",fontSize:11,cursor:"pointer"},children:"Copy"})]}),n&&c.jsxs("div",{style:{padding:"0 10px 10px 10px",borderTop:"1px solid rgba(255,255,255,0.04)"},children:[l&&Object.keys(l).length>0&&c.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(l,null,2)}),a?c.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?c.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 C8({open:e,onClose:t,flowId:n}){var T;const[r,i]=x.useState([]),[o,s]=x.useState(!1),[a,l]=x.useState(null),[u,f]=x.useState(null),[d,p]=x.useState(!1),[h,m]=x.useState(!0),[v,k]=x.useState({ai:!0,flow:!0,step:!0,output:!0,error:!0}),[g,w]=x.useState(""),y=x.useRef(null),N=x.useCallback(async()=>{s(!0);try{const M=h&&n?`?flowId=${encodeURIComponent(n)}`:"",A=await(await fetch(`/api/composer-logs${M}`)).json();i(Array.isArray(A.sessions)?A.sessions:[])}catch{i([])}finally{s(!1)}},[n,h]),E=x.useCallback(async M=>{if(!M){f(null);return}p(!0);try{const A=await(await fetch(`/api/composer-logs/${encodeURIComponent(M)}`)).json();f(A)}catch{f(null)}finally{p(!1)}},[]);x.useEffect(()=>{e&&N()},[e,N]),x.useEffect(()=>{if(!(!e||!a))return E(a),y.current=setInterval(()=>E(a),2e3),()=>{y.current&&clearInterval(y.current),y.current=null}},[e,a,E]);const S=x.useMemo(()=>{const M=(u==null?void 0:u.events)||[],B=g.trim().toLowerCase();return M.filter(A=>{const R=Zb(A.tag,A.payload);return!v[R]&&R!=="other"?!1:B?[A.tag,JSON.stringify(A.payload||"")].join(" ").toLowerCase().includes(B):!0})},[u,v,g]),P=x.useMemo(()=>{const M=(u==null?void 0:u.events)||[],B={};for(const A of M){const R=Zb(A.tag,A.payload);B[R]=(B[R]||0)+1}return B},[u]);return e?c.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:[c.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:[c.jsx("span",{style:{fontWeight:600,fontSize:14},children:"Composer Logs"}),c.jsx("span",{style:{fontSize:11,color:"#9a9a9a"},children:n?`flowId: ${n}`:"no flow selected"}),c.jsxs("label",{style:{fontSize:11,color:"#9a9a9a",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[c.jsx("input",{type:"checkbox",checked:h,onChange:M=>m(M.target.checked),disabled:!n}),"仅显示当前 flow"]}),c.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"}),c.jsx("span",{style:{flex:1}}),c.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"})]}),c.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden",minHeight:0},children:[c.jsxs("div",{style:{width:280,borderRight:"1px solid rgba(255,255,255,0.06)",overflowY:"auto",background:"#0e0e0e",flexShrink:0},children:[o&&c.jsx("div",{style:{padding:12,fontSize:12,color:"#9a9a9a"},children:"Loading…"}),!o&&r.length===0&&c.jsx("div",{style:{padding:12,fontSize:12,color:"#9a9a9a"},children:h&&n?"no sessions for this flow":"no sessions"}),r.map(M=>{const B=a===M.sessionId;return c.jsxs("div",{onClick:()=>l(M.sessionId),style:{padding:"10px 12px",borderBottom:"1px solid rgba(255,255,255,0.04)",cursor:"pointer",background:B?"rgba(124,77,255,0.18)":"transparent",borderLeft:B?"3px solid #7c4dff":"3px solid transparent"},children:[c.jsx("div",{style:{fontSize:12,fontWeight:600,color:"#e5e2e1"},children:k8(M.mtime)}),c.jsx("div",{style:{fontSize:11,color:"#9ecaff",marginTop:2,fontFamily:"monospace"},children:M.flowId||"(no flow)"}),M.promptPreview&&c.jsx("div",{style:{fontSize:11,color:"#9a9a9a",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:M.promptPreview}),c.jsxs("div",{style:{fontSize:10,color:"#6a6a6a",marginTop:4},children:[b8(M.size)," · ",M.model||"default"]})]},M.sessionId)})]}),c.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[c.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(Qj).map(M=>c.jsxs("button",{type:"button",onClick:()=>k(B=>({...B,[M]:!B[M]})),style:{background:v[M]?"rgba(124,77,255,0.25)":"transparent",color:v[M]?"#e8deff":"#6a6a6a",border:`1px solid ${v[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," ",P[M]!=null?`(${P[M]})`:""]},M)),c.jsx("input",{type:"text",placeholder:"search…",value:g,onChange:M=>w(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}})]}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:12,minHeight:0},children:[!a&&c.jsx("div",{style:{color:"#9a9a9a",fontSize:12,padding:20,textAlign:"center"},children:"Select a session on the left to view events"}),d&&!u&&c.jsx("div",{style:{color:"#9a9a9a",fontSize:12,padding:20},children:"Loading…"}),u&&S.length===0&&c.jsxs("div",{style:{color:"#9a9a9a",fontSize:12,padding:20},children:["No events match current filter (",((T=u.events)==null?void 0:T.length)||0," total)"]}),S.map((M,B)=>c.jsx(N8,{event:M,defaultExpanded:M.tag==="error"},`${M.ts}_${B}`))]})]})]})]}):null}const E8="0.1.26";function e1(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 Kh(e,t){return t==="running"?e1(e):e==null||!Number.isFinite(e)||e<=0?"--":e1(e)}const Jj=x.createContext({modelLists:{cursor:[],opencode:[]},onModelChange:()=>{}});function j8(e){const{setNodes:t}=Mc(),{modelLists:n,onModelChange:r}=x.useContext(Jj),i=x.useCallback(s=>{t(a=>a.filter(l=>l.id!==s))},[t]),o=x.useCallback(()=>{var u,f,d,p,h,m,v,k;const s=((u=e.data)==null?void 0:u.definitionId)||"",a=((f=e.data)==null?void 0:f.label)||e.id,l=((h=(p=(d=e.data)==null?void 0:d.outputs)==null?void 0:p[0])==null?void 0:h.value)||((k=(v=(m=e.data)==null?void 0:m.outputs)==null?void 0:v[0])==null?void 0:k.default)||"";window.__provideEditContent={instanceId:e.id,label:a,definitionId:s,content:l},window.dispatchEvent(new CustomEvent("provide-expand"))},[e.id,e.data]);return c.jsx(i4,{...e,deleteNode:i,onProvideExpand:o,modelLists:n,onModelChange:r})}const P8={[Pg]:j8},td=["CONTROL","TOOL","PROVIDE","AGENT"],_8=1200,t1="af-flow-node--sync-flash",n1="af-flow-edge--sync-flash";function r1(e,t){const n=String(e||"").trim();return n?n.split(/\s+/).includes(t)?n:`${n} ${t}`:t}function i1(e,t){const n=String(e||"").trim();return n?n.split(/\s+/).filter(r=>r&&r!==t).join(" "):""}function Zj(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 o1(e){const t=Zj(e);return t==="CONTROL"?"control":t==="PROVIDE"?"provide":t==="TOOL"?"tool":"agent"}function I8(e){return e==="CONTROL"?"account_tree":e==="TOOL"?"build":e==="PROVIDE"?"database":"smart_toy"}function A8(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 s1(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 T8=/@([a-zA-Z_][a-zA-Z0-9_]*)/g;function R8(e){const t=new Set,n=[];let r;const i=new RegExp(T8.source,"g");for(;(r=i.exec(e))!==null;){const o=r[1];t.has(o)||(t.add(o),n.push(o))}return n}function a1(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 ei(e){const t=String(e||"").indexOf(" - ");return t>=0?e.slice(0,t).trim():String(e||"").trim()}function nd(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:[],l=o.map(ei),u=s.map(ei);return a.map(ei).includes(i)&&!l.includes(i)&&!u.includes(i)?`claude-code:${i}`:u.includes(i)&&!l.includes(i)?`opencode:${i}`:i}function L8(e){if(e==null)return"";const t=String(e).trim();return t?t.length<=26?t:`${t.slice(0,12)}…${t.slice(-10)}`:""}function Yh(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 O8({steps:e}){const{t}=rt();return!e||e.length===0?null:c.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 c.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:[c.jsx("span",{className:"af-composer-step-chip-idx",children:n.index+1}),c.jsx("span",{className:"af-composer-step-chip-main",children:n.nodeRole||i?c.jsxs("span",{className:"af-composer-step-chip-meta",children:[n.nodeRole?c.jsx("span",{className:"af-composer-step-chip-role",children:n.nodeRole}):null,i?c.jsx("span",{className:"af-composer-step-chip-model",children:L8(i)}):null]}):null})]},n.index)})})}function M8(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 D8(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 F8(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 $8(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 l1({thread:e,liveSegments:t,running:n,className:r="",autoScroll:i=!0}){const{t:o}=rt(),s=x.useRef(null),a=["af-composer-ai-stack","af-composer-ai-stack--in-panel","af-composer-thread-stack",r].filter(Boolean).join(" ");return x.useEffect(()=>{if(!i||!s.current)return;const l=s.current;requestAnimationFrame(()=>{l.scrollTop=l.scrollHeight})},[e,t,i]),c.jsxs("div",{ref:s,className:a,children:[e.map((l,u)=>l.type==="user"?c.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--user-msg",children:[c.jsx("div",{className:"af-composer-ai-block-label",children:o("flow:composer.yourQuestion")}),c.jsx("div",{className:"af-composer-ai-block-body",children:l.text})]},`composer-u-${u}-${l.text.slice(0,48)}`):c.jsx("div",{className:"af-composer-thread-assistant",children:c.jsx(c1,{segments:l.segments,running:!1})},`composer-a-${u}`)),c.jsx("div",{className:"af-composer-thread-assistant",children:c.jsx(c1,{segments:t,running:n})})]})}function c1({segments:e,running:t=!1}){const{t:n}=rt(),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=M8(r,i),s=e.filter(d=>d.kind==="error").map(d=>d.text).join(`
|
|
124
|
-
`),a=e.filter(d=>d.kind!=="error"),l=o?a.filter(d=>d.kind!=="result"):a,u=D8(l),f=!!(u.length>0||s);return c.jsxs(c.Fragment,{children:[u.map((d,p)=>c.jsxs("section",{className:$8(d.kind),children:[c.jsx("div",{className:"af-composer-ai-block-label",children:F8(d.kind,n)}),c.jsx("div",{className:"af-composer-ai-block-body",children:d.text})]},`${d.kind}-${p}`)),t&&!f?c.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--reply af-composer-ai-block--pending",children:[c.jsx("div",{className:"af-composer-ai-block-label",children:n("flow:composer.reply")}),c.jsx("div",{className:"af-composer-ai-block-body",children:n("flow:composer.waiting")})]}):null,s?c.jsxs("section",{className:"af-composer-ai-block af-composer-ai-block--error",children:[c.jsx("div",{className:"af-composer-ai-block-label",children:n("flow:composer.error")}),c.jsx("div",{className:"af-composer-ai-block-body",children:s})]}):null]})}function z8({fitViewEpoch:e}){const{fitView:t}=Mc(),n=x.useRef(t);return n.current=t,x.useEffect(()=>{if(e>0){const r=requestAnimationFrame(()=>n.current({padding:.2,duration:200}));return()=>cancelAnimationFrame(r)}},[e]),null}const Pd=1500,u1=500,B8=262144,H8=2e3;function qh(e){return typeof e!="string"?"":e.length<=H8?e:`[log line truncated, ${e.length} chars]`}const U8=Pd;function V8(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:qh(i)}}catch{return{ts:n,type:"info",text:qh(i)}}return{ts:n,type:"log",text:qh(`[${r}] ${i}`)}}function d1(e){if(!e)return[];const t=[],n=e.split(`
|
|
125
|
-
`);for(let r=n.length-1;r>=0&&t.length<U8;r--){const i=n[r];if(!i)continue;const o=V8(i);o&&t.push(o)}return t.reverse(),t}function W8(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 K8(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 Y8({fitViewEpoch:e,canvasTool:t,nodes:n,edges:r,onNodesChange:i,onEdgesChange:o,onConnect:s,onNodesDelete:a,onNodeClick:l,onEdgeClick:u,onFlowInit:f,onDrop:d,onDragOver:p,hideMinimapAndControls:h,bottomSlot:m}){const{t:v}=rt(),k=!i,g=k||t==="pan"?!0:[1,2],w=k?!1:t==="select",y="af-flow-canvas"+(k?" af-flow-canvas--run-mode":"")+(t==="pan"?" af-flow-canvas--tool-pan":" af-flow-canvas--tool-select"),N=x.useCallback(()=>{},[]),E=x.useMemo(()=>{const S=new Map(n.map(A=>[A.id,A])),P=new Set(n.filter(A=>A.selected).map(A=>A.id)),T=P.size>0,M=(A,R)=>{const V=/^#([0-9a-f]{6})$/i.exec(A);if(!V)return A;const L=parseInt(V[1],16);return`rgba(${L>>16&255}, ${L>>8&255}, ${L&255}, ${R})`},B="#ff5169";return r.map(A=>{var ae,J,le,Se;const R=S.get(A.source),V=S.get(A.target),L=/^output-(\d+)$/.exec(A.sourceHandle||""),H=/^input-(\d+)$/.exec(A.targetHandle||""),D=R&&L?(J=(ae=R.data)==null?void 0:ae.outputs)==null?void 0:J[parseInt(L[1],10)]:null,$=V&&H?(Se=(le=V.data)==null?void 0:le.inputs)==null?void 0:Se[parseInt(H[1],10)]:null,_=D!=null&&D.type?xf(D.type):null,I=$!=null&&$.type?xf($.type):null,C=_&&I&&_!==I,F=T&&(P.has(A.source)||P.has(A.target)),U=A.style||{};if(C){const ye=A.selected?.95:F?.85:.78,ge=M(B,ye);return{...A,className:((A.className||"")+" af-flow-edge--type-mismatch"+(F?" af-flow-edge--adjacent":"")).trim(),style:{...U,stroke:ge,strokeWidth:F?2.75:2.5,strokeDasharray:"6 4"},markerEnd:A.markerEnd&&typeof A.markerEnd=="object"?{...A.markerEnd,color:ge}:{type:Zi.ArrowClosed,color:ge}}}const O=_||I;if(!O)return F?{...A,className:((A.className||"")+" af-flow-edge--adjacent").trim(),style:{...U,strokeWidth:2.5}}:A;const q=F||A.selected?.7:.38,ee=M(O,q),ne=F?2.5:U.strokeWidth??2;return{...A,className:((A.className||"")+(F?" af-flow-edge--adjacent":"")).trim(),style:{...U,stroke:ee,strokeWidth:ne},markerEnd:A.markerEnd&&typeof A.markerEnd=="object"?{...A.markerEnd,color:ee}:{type:Zi.ArrowClosed,color:ee}}})},[n,r]);return c.jsxs(XF,{className:y,nodes:n,edges:E,onNodesChange:i||N,onEdgesChange:o||N,onConnect:k?void 0:s,onNodesDelete:k?void 0:a,onNodeClick:l,onEdgeClick:k?void 0:u,onInit:f,onDrop:k?void 0:d,onDragOver:k?void 0:p,nodeTypes:P8,selectionOnDrag:w,panOnDrag:g,nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k,edgesFocusable:!k,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:[c.jsx(r$,{gap:20,size:1,color:"rgba(28, 27, 27, 0.9)"}),c.jsx(ua,{position:"bottom-center",className:"af-flow-bottom-unified-panel"+(h?" af-flow-bottom-unified-panel--solo":""),children:c.jsxs("div",{className:"af-flow-bottom-unified-row"+(h?" af-flow-bottom-unified-row--solo":""),children:[h?null:c.jsx("div",{className:"af-flow-bottom-unified__side af-flow-bottom-unified__side--minimap",children:c.jsx(k$,{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:S=>{var T;const P=(((T=S.data)==null?void 0:T.schemaType)??"agent").toLowerCase();return P==="control"?"rgba(237, 108, 2, 0.85)":P==="provide"?"rgba(0, 228, 117, 0.35)":P==="tool"?"rgba(124, 77, 255, 0.75)":"rgba(158, 202, 255, 0.5)"}})}),c.jsx("div",{className:"af-flow-bottom-unified__center",children:m}),h?null:c.jsx("div",{className:"af-flow-bottom-unified__side af-flow-bottom-unified__side--zoom",children:c.jsx(u$,{position:"bottom-right",showInteractive:!1,className:"af-flow-bottom-controls"})})]})}),!h&&c.jsx(ua,{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:S,color:P})=>c.jsxs("span",{className:"af-pin-legend__item",children:[c.jsx("span",{className:"af-pin-legend__dot",style:{background:P}}),c.jsx("span",{className:"af-pin-legend__label",children:S})]},S))}),c.jsx(z8,{fitViewEpoch:e}),!k&&n.length===0?c.jsxs("div",{className:"af-flow-empty-hint",children:[c.jsx("span",{className:"af-flow-empty-hint-icon material-symbols-outlined",children:"account_tree"}),c.jsx("p",{className:"af-flow-empty-hint-text",children:v("flow:emptyCanvas.composerHint")}),c.jsx("p",{className:"af-flow-empty-hint-sub",dangerouslySetInnerHTML:{__html:v("flow:emptyCanvas.composerSub")}})]}):null]})}function Gh(e){const t=e.source??"user",n=e.archived?"1":"0";return`${e.id}\0${t}\0${n}`}function f1(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 q8(e){return e==="builtin"?"workspace":e??"user"}function Xh(e,t){return t(e==="builtin"?"flow:settings.builtin":e==="workspace"?"flow:palette.workspace":"flow:palette.userDir")}const eP="af:run-console-height",Fl=230,dl={enabled:!1,cron:"",timezone:"Asia/Shanghai",preset:"",overlapPolicy:"skip",misfirePolicy:"skip",nextRunAt:null},rd={};function _d(e){if(!Number.isFinite(e))return Fl;const t=Math.max(240,Math.floor(window.innerHeight*.88));return Math.min(Math.max(Math.round(e),96),t)}function G8(){try{const e=localStorage.getItem(eP);if(e==null)return Fl;const t=parseInt(e,10);return Number.isFinite(t)?_d(t):Fl}catch{return Fl}}function X8(){var dw,fw;const{t:e}=rt(),{navigate:t,path:n}=xa(),[r,i]=x.useState([]),[o,s]=x.useState(""),[a,l]=x.useState(null),[u,f]=x.useState(0),[d,p]=x.useState(""),[h,m]=x.useState(""),[v,k]=x.useState(""),[g,w]=x.useState(""),[y,N]=x.useState(!1),[E,S]=x.useState(""),[P,T]=x.useState(!1),[M,B]=x.useState(""),[A,R]=x.useState(!1),[V,L]=x.useState(!1),[H,D]=x.useState(!1),[$,_]=x.useState(null),[I,C]=x.useState(!1),[F,U]=x.useState(!1),O=x.useRef(!1),[q,ee]=x.useState([]),[ne,ae]=x.useState(""),[J,le]=x.useState(null),[Se,ye]=x.useState([]),[ge,xe]=x.useState(""),[$e,Ke]=x.useState(!1),[Le,mt]=x.useState(!1),[_t,Dt]=x.useState({files:[]}),[Fn,wr]=x.useState(!1),[vr,br]=x.useState(!0);x.useEffect(()=>{let b=!1;const j=()=>{fetch("/api/flows",{method:"HEAD"}).then(W=>{b||br(W.ok)}).catch(()=>{b||br(!1)})};j();const z=window.setInterval(j,5e3);return()=>{b=!0,window.clearInterval(z)}},[]),x.useEffect(()=>{let b=!1;return fetch("/api/dev-info").then(j=>j.json()).then(j=>{b||yp(!!(j!=null&&j.isDev))}).catch(()=>{}),()=>{b=!0}},[]);const[he,gt]=x.useState("edit"),[G,Q]=x.useState([]),Ne=x.useRef(0),[Ce,Ie]=x.useState(new Set),[It,Ct]=x.useState({}),[Vt,tn]=x.useState(null),[Jn,lt]=x.useState(0),[cn,Ft]=x.useState(!1),[gp,yp]=x.useState(!1),[Vc,Wc]=x.useState(!1),[Ea,ja]=x.useState(G8),Qo=x.useRef({active:!1,pointerId:-1,startY:0,startH:Fl}),[ft,lo]=x.useState(null),[Pa,Jo]=x.useState(null),[co,Kc]=x.useState({}),Yc=x.useRef(co);x.useEffect(()=>{Yc.current=co},[co]);const[qc,yi]=x.useState(!1),[xp,Zo]=x.useState(!1),[Gc,Xc]=x.useState({}),[xi,_a]=x.useState({}),[uo,es]=x.useState(null),[$n,Sr]=x.useState(dl),[wp,Qc]=x.useState(!1),[wi,Jc]=x.useState(!1),[Zc,vi]=x.useState(""),[eu,ts]=x.useState(""),[Wt,Ia]=x.useState(rd),[Zn,Aa]=x.useState(null),kr=x.useRef(null),fo=x.useRef(null),Ta=x.useRef(!0),po=x.useRef(!1),[At,ns]=x.useState(null),[ho,rs]=x.useState(null),[tu,mo]=x.useState(!1),[qr,is]=x.useState(""),[os,ss]=x.useState(!1),vp=x.useRef(null),[Nn,Ra]=x.useState(null),[nu,bi]=x.useState(!1),[as,$x]=x.useState(null),[ls,ru]=x.useState(null),bp=x.useRef(null),[zn,La]=x.useState(""),[iu,Oa]=x.useState(0),[Ma,Da]=x.useState(0),[FP,Sp]=x.useState("pan"),[ou,Fa]=x.useState(!1),[kp,zx]=x.useState(!1),Np=x.useRef(null),Cp=x.useRef(null),$a=x.useRef(null),[$P,zP]=x.useState(0),[Oe,Ep]=x.useState(null),[BP,su]=x.useState(""),[_e,HP]=x.useState({cursor:[],opencode:[],claudeCode:[]}),[go,Bx]=x.useState(""),[jp,nG]=x.useState(""),au=x.useCallback(b=>{if(!b)return null;const j=b.id,z=b.source??"user",W=b.archived?"archived":"";return{sessionsKey:`af:composer-sessions:${j}:${z}${W?":"+W:""}`,activeKey:`af:composer-active-session:${j}:${z}${W?":"+W:""}`}},[]),Hx=x.useCallback(b=>{const j=au(b);if(!j)return{sessions:[],activeSessionId:null};try{const z=localStorage.getItem(j.sessionsKey);if(!z)return{sessions:[],activeSessionId:null};const W=JSON.parse(z);if(!Array.isArray(W))return{sessions:[],activeSessionId:null};const K=W.filter(Z=>Z&&typeof Z.id=="string").map(Z=>({...Z,running:!1,statusLine:Z.running?e("flow:composer.pageRefreshReset"):Z.statusLine,steps:[]}));let Y=null;try{Y=localStorage.getItem(j.activeKey),Y&&!K.some(Z=>Z.id===Y)&&(Y=null)}catch{Y=null}return{sessions:K,activeSessionId:Y}}catch{return{sessions:[],activeSessionId:null}}},[au]),lu=x.useCallback((b,j,z)=>{const W=au(b);if(W)try{localStorage.setItem(W.sessionsKey,JSON.stringify(j)),z?localStorage.setItem(W.activeKey,z):localStorage.removeItem(W.activeKey)}catch{}},[au]),yo=x.useRef(0),cu=x.useRef({sessions:[],activeSessionId:null,flowKey:null}),[Bn,Nr]=x.useState([]),[Kt,Si]=x.useState(null),uu=x.useMemo(()=>{if(!a)return null;const b=a.id,j=a.source??"user",z=a.archived?"archived":"";return`${b}:${j}${z?":"+z:""}`},[a]),Pp=x.useRef(!1);x.useEffect(()=>{if(!uu){Nr([]),Si(null),cu.current={sessions:[],activeSessionId:null,flowKey:null};return}const b=cu.current;if(b.flowKey===uu)return;b.flowKey=uu,Pp.current&&b.sessions.length>0&&lu(a,b.sessions,b.activeSessionId);const{sessions:j,activeSessionId:z}=Hx(a);if(j.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};b.sessions=[K],b.activeSessionId=W,Nr([K]),Si(W)}else{const W=j[j.length-1];if(W&&(!W.thread||W.thread.length===0))yo.current=Yh(j),b.sessions=j,b.activeSessionId=W.id,Nr(j),Si(W.id);else{const Y=Yh(j)+1;yo.current=Y;const Z=`session-${Y}-${Date.now()}`,te={id:Z,label:e("flow:composer.conversationLabel",{n:Y}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null},se=[...j,te];b.sessions=se,b.activeSessionId=Z,Nr(se),Si(Z)}}Pp.current=!0},[uu,a,Hx,lu]);const yt=x.useMemo(()=>Bn.find(b=>b.id===Kt)||null,[Bn,Kt]),vt=(yt==null?void 0:yt.running)??!1,za=(yt==null?void 0:yt.statusLine)??"",Ba=(yt==null?void 0:yt.segments)??[],Ha=(yt==null?void 0:yt.thread)??[],Ux=(yt==null?void 0:yt.steps)??[];yt==null||yt.outputDismissed;const Ae=(yt==null?void 0:yt.phaseContext)??null,Vx=x.useRef([]),[_p,du]=x.useState(!1),fu=x.useRef(null),Wx=x.useRef(null);x.useEffect(()=>{const b=Wx.current;b&&requestAnimationFrame(()=>{b.scrollTop=b.scrollHeight})},[Ha,Ba]);const Ip=x.useRef(null),Ap=x.useRef(!1),UP=x.useRef(null),Kx=x.useCallback(b=>{const j=++yo.current,z=`session-${j}-${Date.now()}`,W={id:z,label:b||e("flow:composer.conversationLabel",{n:j}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null};return Nr(K=>[...K,W]),Si(z),z},[]);x.useEffect(()=>{!a||!Pp.current||(cu.current.sessions=Bn,cu.current.activeSessionId=Kt,lu(a,Bn,Kt))},[Bn,Kt,a,lu]),x.useEffect(()=>{yo.current=Math.max(yo.current,Yh(Bn))},[Bn]);const VP=x.useCallback(b=>{var j;Ip.current===b&&((j=fu.current)==null||j.abort()),Nr(z=>{const W=z.filter(Y=>Y.id!==b);if(z.some((Y,Z)=>Y.id===b&&z.findIndex(te=>te.id===Kt)===Z)||Kt===b){const Y=W;Y.length>0?Si(Y[Y.length-1].id):setTimeout(()=>{yo.current=0;const Z=++yo.current,te=`session-${Z}-${Date.now()}`,se={id:te,label:e("flow:composer.conversationLabel",{n:Z}),thread:[],segments:[],running:!1,statusLine:"",steps:[],outputDismissed:!1,createdAt:Date.now(),phaseContext:null};Nr(oe=>[...oe,se]),Si(te)},0)}return W})},[Kt]),un=x.useCallback(b=>{Nr(j=>{const z=j.findIndex(Y=>Y.id===Kt);if(z<0)return j;const W={...j[z]};b(W);const K=[...j];return K[z]=W,K})},[Kt]),Yx=x.useCallback(b=>{un(j=>{j.running=b})},[un]),Cr=x.useCallback(b=>{un(j=>{j.statusLine=b})},[un]),Er=x.useCallback(b=>{un(j=>{typeof b=="function"?j.segments=b(j.segments):j.segments=b})},[un]),qx=x.useCallback(b=>{un(j=>{typeof b=="function"?j.thread=b(j.thread):j.thread=b})},[un]),Ua=x.useCallback(b=>{un(j=>{typeof b=="function"?j.steps=b(j.steps):j.steps=b})},[un]),Gx=x.useCallback(b=>{un(j=>{j.outputDismissed=b})},[un]),Va=x.useCallback(b=>{un(j=>{j.phaseContext=typeof b=="function"?b(j.phaseContext):b})},[un]),Xx=x.useCallback(b=>{Si(b),Nr(j=>{const z=j.findIndex(K=>K.id===b);if(z<0||!j[z].outputDismissed)return j;const W=[...j];return W[z]={...j[z],outputDismissed:!1},W})},[]);x.useEffect(()=>{Vx.current=Ba},[Ba]);const Gr=x.useRef({}),Qx=x.useRef(!1),Wa=x.useRef(null),ki=x.useRef(null),Ka=x.useRef(!1),Tp=x.useRef(0),pu=x.useRef(""),[He,Ue,WP]=QF([]),[xt,Tt,KP]=JF([]),Rp=x.useRef(He),Lp=x.useRef(xt),er=x.useMemo(()=>He.filter(b=>{var j;return(((j=b.data)==null?void 0:j.definitionId)||"").startsWith("provide_")}),[He]),cs=x.useMemo(()=>{var j;const b={};for(const z of He){if(!((j=z.data)!=null&&j.inputs))continue;const W=z.data.inputs;for(let K=0;K<W.length;K++){const Y=W[K];if(!(Y!=null&&Y.name))continue;const Z=xt.find(se=>se.target===z.id&&se.targetHandle===`input-${K}`);if(!(Z!=null&&Z.source))continue;er.find(se=>se.id===Z.source)&&(b[Z.source]=Y.name)}}return b},[He,xt,er]),Ya=x.useMemo(()=>{if(he==="edit"||Ce.size===0)return null;const b=new Set(Ce);for(const j of xt)Ce.has(j.source)&&b.add(j.target),Ce.has(j.target)&&b.add(j.source);return b},[he,Ce,xt]),YP=x.useMemo(()=>he==="edit"?He:He.map(b=>{var j,z;return{...b,draggable:!1,connectable:!1,data:{...b.data,isRunMode:!0,isExecuting:Ce.has(b.id),nodeStatus:((j=It[b.id])==null?void 0:j.status)??null,nodeElapsed:((z=It[b.id])==null?void 0:z.elapsed)??null,isDim:Ya?!Ya.has(b.id):!1}}}),[he,He,Ce,It,Ya]),qP=x.useMemo(()=>Ya?xt.map(b=>{const j=Ce.has(b.source)||Ce.has(b.target),z=b.className?b.className.replace(/\s?af-flow-edge--(dim|focus)\b/g,""):"",W=j?"af-flow-edge--focus":"af-flow-edge--dim";return{...b,className:(z?z+" ":"")+W}}):xt,[xt,Ce,Ya]);x.useEffect(()=>{if(!a){_a({}),es(null),Sr(dl),Ia(rd),Aa(null),vi(""),ts("");return}const b=new URLSearchParams({flowId:a.id,flowSource:a.source||"user"});a.archived&&b.set("archived","1"),fetch(`/api/flow/run-config?${b.toString()}`).then(j=>j.json()).then(j=>{_a(j.presets||{}),es(j.activePreset||null)}).catch(()=>{_a({}),es(null)})},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived]);const hu=x.useCallback(async(b,j={})=>{if(!b)return;!!j.quiet||(Qc(!0),vi(""),ts(""));const W=new URLSearchParams({flowId:b.id,flowSource:b.source||"user"});b.archived&&W.set("archived","1");try{const K=await fetch(`/api/flow/schedule?${W.toString()}`),Y=await K.json().catch(()=>({}));if(!K.ok)throw new Error(Y.error||`HTTP ${K.status}`);Sr({...dl,...Y.schedule||{}}),Ia(Y.state&&typeof Y.state=="object"?Y.state:rd),Aa(Y.status||null)}catch(K){Sr(dl),Ia(rd),Aa(null),vi(String(K.message||K))}finally{Qc(!1)}},[]);x.useEffect(()=>{if(!a)return;let b=!1;return(async()=>{await hu(a)})(),()=>{b=!0}},[a==null?void 0:a.id,a==null?void 0:a.source,a==null?void 0:a.archived,hu]),x.useEffect(()=>{var z,W,K,Y;if(!uo||!xi[uo]||er.length===0)return;const b=xi[uo],j={};for(const Z of er){const te=cs[Z.id];if(!te)continue;const se=((z=Z.data)==null?void 0:z.definitionId)||"",oe=b[Z.id]??((Y=(K=(W=Z.data)==null?void 0:W.outputs)==null?void 0:K[0])==null?void 0:Y.default)??"";se.startsWith("provide_file")?j[te]={type:"file",path:oe}:j[te]={type:"str",value:oe}}Object.keys(j).length>0&&Kc(j)},[uo,xi,er,cs]);const GP=x.useCallback(()=>{if(!ls||!bp.current)return;const b=bp.current.value;Ue(j=>j.map(z=>{var W,K;return z.id!==ls.instanceId?z:{...z,data:{...z.data,outputs:((K=(W=z.data)==null?void 0:W.outputs)==null?void 0:K.map((Y,Z)=>Z===0?{...Y,default:b}:Y))||[{type:"text",name:"value",default:b}]}}})),ru(null)},[ls,Ue]),Pe=x.useMemo(()=>{const b=He.filter(j=>j.selected);return b.length===1?b[0]:null},[He]),jr=x.useMemo(()=>a?e4(He,xt,e):[],[a,He,xt,e]),XP=x.useMemo(()=>jr.map(b=>b.key).join("|"),[jr]),Jx=x.useMemo(()=>jr.some(b=>String((b==null?void 0:b.level)||"warning").toLowerCase()==="error"),[jr]);x.useLayoutEffect(()=>{C(jr.length>0&&!Jx)},[XP,a==null?void 0:a.id,a==null?void 0:a.source,jr.length,Jx]),$a.current=Pe,x.useEffect(()=>{Rp.current=He},[He]),x.useEffect(()=>{Lp.current=xt},[xt]),x.useEffect(()=>()=>{ki.current!=null&&(clearTimeout(ki.current),ki.current=null)},[]);const Op=x.useMemo(()=>{var j;if(!Pe)return null;const b=(j=Pe.data)==null?void 0:j.definitionId;return q.find(z=>z.id===b)??null},[Pe,q]),Mp=x.useMemo(()=>{const b={CONTROL:[],TOOL:[],PROVIDE:[],AGENT:[]};for(const j of q){const z=Zj(j);b[z].push(j)}for(const j of td)b[j].sort((z,W)=>z.id.localeCompare(W.id));return b},[q]),mu=x.useMemo(()=>{const b=ne.trim().toLowerCase();if(!b)return Mp;const j={CONTROL:[],TOOL:[],PROVIDE:[],AGENT:[]};for(const z of td)j[z]=Mp[z].filter(W=>A8(W,b));return j},[Mp,ne]),QP=x.useMemo(()=>td.reduce((b,j)=>b+mu[j].length,0),[mu]),gu=x.useCallback(async()=>{s("");try{const b=await fetch("/api/flows");if(!b.ok)throw new Error("HTTP "+b.status);i(await b.json())}catch(b){s(String(b.message||b))}},[]);x.useEffect(()=>{gu()},[gu]),x.useEffect(()=>{if(n!=="/flow")return;const b=new URLSearchParams(window.location.search);b.get("new")==="1"&&!b.get("flowId")&&t("/projects?new=1")},[n,t]),x.useEffect(()=>{let b=!1;const j=()=>{fetch("/api/model-lists").then(W=>W.json()).then(W=>{b||HP({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(()=>{})};j();const z=setTimeout(j,4e3);return()=>{b=!0,clearTimeout(z)}},[]);const Zx=x.useCallback(async b=>{const j=b.source??"user",z=!!b.archived,W=new URLSearchParams({flowId:b.id,flowSource:j});z&&W.set("archived","1");const K=new URLSearchParams({flowId:b.id,flowSource:j});z&&K.set("archived","1");const[Y,Z]=await Promise.all([fetch("/api/flow?"+W.toString()),fetch("/api/nodes?"+K.toString())]),te=await Y.json();if(!Y.ok||te.error)throw new Error(te.error||e("flow:nodePropsError.loadFlowFailed"));const se=await Z.json();if(!Z.ok)throw new Error(e("flow:nodePropsError.loadNodesFailed"));const oe=Array.isArray(se)?se:Array.isArray(se==null?void 0:se.nodes)?se.nodes:[],me=!Array.isArray(se)&&(se==null?void 0:se.pipelineTranslations)||{},X=Qz(te.flowYaml||"");if(X.error)throw new Error(X.error);const ue={...X.instances||{}},ce=X.nodes.map(Ve=>Lh(Ve,ue,oe,me,b.id)),we=n4(X.edges,ce);return{flowSource:j,paletteList:oe,instances:ue,flowDescriptionText:X.description??"",nodes:ce,edges:we}},[]),Cn=x.useCallback(async(b,j={})=>{const z=!!j.preserveComposer,W=z&&!!j.incrementalSync;Ka.current=!1,Tp.current+=1,l(b),m(""),z||(k(""),ae(""),le(null),p(""),S(""),B(""),La(""),qx([]),Er([]),Ua([]),Gx(!1),Va(null),Sp("pan")),W||(Gr.current={},Ue([]),Tt([])),f1(b);try{const K=await Zx(b);if(ee(K.paletteList),Gr.current=K.instances,p(K.flowDescriptionText),S(b.id||""),W){const Y=Rp.current,Z=Lp.current;try{const te=P$(Y,Z,K.nodes,K.edges),se=new Set([...te.changes.addedNodeIds,...te.changes.updatedNodeIds]),oe=new Set([...te.changes.addedEdgeKeys,...te.changes.updatedEdgeKeys]),me=se.size>0?te.nodes.map(ue=>se.has(ue.id)?{...ue,className:r1(ue.className,t1)}:ue):te.nodes,X=oe.size>0?te.edges.map(ue=>oe.has(pc(ue))?{...ue,className:r1(ue.className,n1)}:ue):te.edges;Ue(me),Tt(X),ki.current!=null&&(clearTimeout(ki.current),ki.current=null),(se.size>0||oe.size>0)&&(ki.current=window.setTimeout(()=>{ki.current=null,se.size>0&&Ue(ue=>ue.map(ce=>{if(!se.has(ce.id))return ce;const we=i1(ce.className,t1);return we===String(ce.className||"")?ce:{...ce,className:we}})),oe.size>0&&Tt(ue=>ue.map(ce=>{if(!oe.has(pc(ce)))return ce;const we=i1(ce.className,n1);return we===String(ce.className||"")?ce:{...ce,className:we}}))},_8))}catch{Ue(K.nodes),Tt(K.edges)}}else Ue(K.nodes),Tt(K.edges),f(Y=>Y+1);zu(b.id,K.flowSource),zP(Y=>Y+1);try{pu.current=Qv(K.nodes,K.edges,K.instances,{description:K.flowDescriptionText})}catch{pu.current=""}Ka.current=!0}catch(K){m(String(K.message||K))}},[Zx,Ue,Tt]),ew=x.useCallback(async()=>{var W;if(!a||O.current)return;const b=a.id,j=a.source??"user",z=((W=$a.current)==null?void 0:W.id)??null;O.current=!0,U(!0);try{await Cn({id:b,source:j,archived:a.archived},{preserveComposer:!0,incrementalSync:!0}),z&&Ue(K=>K.map(Y=>({...Y,selected:Y.id===z})))}finally{O.current=!1,U(!1)}},[a,a==null?void 0:a.archived,Cn,Ue]);x.useEffect(()=>{if(Qx.current||r.length===0)return;const b=new URLSearchParams(window.location.search),j=b.get("flowId");if(!j)return;const z=b.get("flowSource")??"user",W=b.get("flowArchived")==="1",K=r.find(Y=>Y.id===j&&(Y.source??"user")===z&&!!Y.archived===W);K&&(Qx.current=!0,Cn(K))},[r,Cn]);const yu=x.useRef(0);x.useEffect(()=>{if(!a)return;const b=a.id,j=a.source??"user",z=!!a.archived;yu.current=0;let W=!1;const K=async()=>{var te;if(W)return;const Z=new URLSearchParams({flowId:b,flowSource:j,v:String(yu.current)});z&&Z.set("archived","1");try{const se=await fetch("/api/flow-editor-sync-poll?"+Z.toString());if(!se.ok||W)return;const oe=await se.json();if(W)return;if(oe.changed){yu.current=oe.version;const me=((te=$a.current)==null?void 0:te.id)??null;await Cn({id:b,source:j,archived:z},{preserveComposer:!0,incrementalSync:!0}),me&&Ue(X=>X.map(ue=>({...ue,selected:ue.id===me})))}else yu.current=oe.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,Ue]);const JP=x.useMemo(()=>v?v.startsWith(e("flow:status.saveFailed"))?" af-palette-tip--error":v===e("flow:status.saved")?" af-palette-tip--success":" af-palette-tip--info":"",[v]);x.useEffect(()=>{if(!v)return;v===e("flow:status.saved")||v.startsWith(e("flow:status.runInTerminal"));const b=v.startsWith(e("flow:status.runInTerminal"))?5200:2800,j=window.setTimeout(()=>k(""),b);return()=>clearTimeout(j)},[v,e]),x.useEffect(()=>{w("")},[a==null?void 0:a.id,a==null?void 0:a.source]),x.useEffect(()=>{const b=()=>{window.__provideEditContent&&(ru(window.__provideEditContent),window.__provideEditContent=null)};return window.addEventListener("provide-expand",b),()=>window.removeEventListener("provide-expand",b)},[]),x.useEffect(()=>{var te,se,oe,me,X,ue;if(!Pe){Ep(null);return}const b=Gr.current[Pe.id]||{},{inputs:j,outputs:z}=t4(Pe),W=String(((te=Pe.data)==null?void 0:te.definitionId)??Pe.id??""),K=((se=Pe.data)==null?void 0:se.script)!=null?String(Pe.data.script):void 0,Y=b.script!=null?String(b.script):void 0,Z=W==="tool_nodejs"||K&&K.trim()!==""||Y&&Y.trim()!==""?String(K??Y??""):"";Ep({id:Pe.id,newId:Pe.id,label:String(((oe=Pe.data)==null?void 0:oe.label)??Pe.id),role:((me=Pe.data)==null?void 0:me.role)??"普通",model:String(((X=Pe.data)==null?void 0:X.model)??b.model??""),body:String(((ue=Pe.data)==null?void 0:ue.body)??b.body??""),script:Z,inputs:j,outputs:z})},[Pe==null?void 0:Pe.id,$P]),x.useEffect(()=>{a&&(Pe||(Cp.current=null,le(b=>b==="node"?null:b)))},[a,Pe==null?void 0:Pe.id]);const xu=x.useCallback(()=>{Cp.current=null,le(b=>b==="settings"||b==="history"?b:"node")},[]),ZP=x.useCallback((b,j)=>{if(!(b.metaKey||b.ctrlKey||b.shiftKey)){if(he!=="edit"){Jo((j==null?void 0:j.id)??null);return}xu()}},[xu,he]),e_=x.useCallback((b,j)=>{if(he!=="edit")return;const z=b.metaKey||b.ctrlKey||b.shiftKey;Tt(W=>W.map(K=>K.id===j.id?{...K,selected:!K.selected||!z}:z?K:{...K,selected:!1})),z||Ue(W=>W.map(K=>({...K,selected:!1})))},[he,Tt,Ue]),t_=x.useCallback(b=>Tt(j=>{const z=j.filter(W=>!(W.target===b.target&&W.targetHandle===b.targetHandle));return vC({...b,markerEnd:{type:Zi.ArrowClosed}},z)}),[Tt]),n_=x.useCallback(b=>{for(const j of b)delete Gr.current[j.id]},[]),r_=x.useCallback(b=>{Wa.current=b},[]),i_=x.useCallback(b=>{Ue(z=>z.map(W=>({...W,selected:W.id===b}))),Tt(z=>z.map(W=>({...W,selected:!1}))),xu();const j=()=>{var se,oe,me;const z=Wa.current;if(!(z!=null&&z.getNode))return;const W=z.getNode(b);if(!W)return;const K=(se=z.getInternalNode)==null?void 0:se.call(z,b),Y=((oe=K==null?void 0:K.measured)==null?void 0:oe.width)??(K==null?void 0:K.width)??W.width??200,Z=((me=K==null?void 0:K.measured)==null?void 0:me.height)??(K==null?void 0:K.height)??W.height??88,{zoom:te}=z.getViewport();z.setCenter(W.position.x+Y/2,W.position.y+Z/2,{zoom:te,duration:220})};requestAnimationFrame(()=>requestAnimationFrame(j))},[Ue,Tt,xu]),o_=x.useCallback(b=>{Ue(z=>z.map(W=>({...W,selected:W.id===b}))),Tt(z=>z.map(W=>({...W,selected:!1})));const j=()=>{var oe,me,X;const z=Wa.current;if(!(z!=null&&z.getNode))return;const W=z.getNode(b);if(!W)return;const K=(oe=z.getInternalNode)==null?void 0:oe.call(z,b),Y=((me=K==null?void 0:K.measured)==null?void 0:me.width)??(K==null?void 0:K.width)??W.width??200,Z=((X=K==null?void 0:K.measured)==null?void 0:X.height)??(K==null?void 0:K.height)??W.height??88,{zoom:te}=z.getViewport(),se=Math.max(te,1);z.setCenter(W.position.x+Y/2,W.position.y+Z/2,{zoom:se,duration:260})};requestAnimationFrame(()=>requestAnimationFrame(j))},[Ue,Tt]),s_=x.useCallback(b=>{if(!a||!b)return;let j={x:180,y:160};const z=Wa.current,W=document.querySelector(".af-pipeline-flow .react-flow");if(z&&W){const se=W.getBoundingClientRect();j=z.screenToFlowPosition({x:se.left+se.width*.45,y:se.top+se.height*.38})}const K=`node-${Date.now()}`,Y=o1(b),Z={id:K,type:Pg,position:j,data:{label:b.label??b.id,definitionId:b.id,schemaType:Y,inputs:Array.isArray(b.inputs)?b.inputs.map(se=>({...se})):[],outputs:Array.isArray(b.outputs)?b.outputs.map(se=>({...se})):[]}},te=Lh(Z,Gr.current,q);Ue(se=>[...se,te])},[a,q,Ue]),a_=x.useCallback(b=>{b.preventDefault(),b.dataTransfer.dropEffect="move"},[]),l_=x.useCallback(b=>{if(b.preventDefault(),!a)return;const j=b.dataTransfer.getData("application/agentflow-node");if(!j)return;const z=q.find(oe=>oe.id===j);if(!z)return;const W=Wa.current;if(!W)return;const K=W.screenToFlowPosition({x:b.clientX,y:b.clientY}),Y=`node-${Date.now()}`,Z=o1(z),te={id:Y,type:Pg,position:K,data:{label:z.label??z.id,definitionId:z.id,schemaType:Z,inputs:Array.isArray(z.inputs)?z.inputs.map(oe=>({...oe})):[],outputs:Array.isArray(z.outputs)?z.outputs.map(oe=>({...oe})):[]}},se=Lh(te,Gr.current,q);Ue(oe=>[...oe,se])},[a,q,Ue]),Ni=x.useCallback(async(b,j)=>{if(!a)return;const z=Qv(b,j,Gr.current,{description:d});if(z!==pu.current){k(e("flow:status.saving"));try{const W=q8(a.source),K=await fetch("/api/flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:W,flowYaml:z,...a.archived?{flowArchived:!0}:{}})}),Y=await K.json();if(!K.ok||!Y.success)throw new Error(Y.error||e("flow:status.saveFailed"));if(pu.current=z,k(e("flow:status.saved")),a.source==="builtin"&&W==="workspace"){const Z={id:a.id,source:"workspace",path:void 0};l(Z),f1(Z),zu(a.id,"workspace")}}catch(W){k(e("flow:status.saveFailed")+": "+(W.message||W))}}},[a,d]);x.useEffect(()=>{if(!a||!Ka.current||he!=="edit"||a.archived)return;const b=Tp.current,j=setTimeout(()=>{b===Tp.current&&Ka.current&&Ni(Rp.current,Lp.current)},400);return()=>clearTimeout(j)},[He,xt,d,he,a,Ni]);const tw=x.useCallback(async b=>{if(!a||a.archived)return;const j=a.source??"user";if(!(j!=="user"&&j!=="workspace")&&j!==b){N(!0),w("");try{const z=await fetch("/api/flow/move",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,fromSource:j,toSource:b})}),W=await z.json().catch(()=>({}));if(!z.ok)throw new Error(typeof W.error=="string"?W.error:e("flow:composer.requestFailed"));const K=W.flowSource==="workspace"||W.flowSource==="user"?W.flowSource:b;let Y={id:a.id,source:K,archived:a.archived};try{const Z=await fetch("/api/flows");if(Z.ok){const te=await Z.json(),se=Array.isArray(te)?te.find(oe=>oe.id===a.id&&(oe.source??"user")===K&&!!oe.archived==!!a.archived):null;se&&(Y=se)}}catch{}await Cn(Y,{preserveComposer:!0}),zu(a.id,K)}catch(z){w(String(z.message||z))}finally{N(!1)}}},[a,Cn]),c_=x.useCallback(async()=>{if(a){Jc(!0),vi(""),ts("");try{const b=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:$n})}),j=await b.json().catch(()=>({}));if(!b.ok||!j.success)throw new Error(j.error||"Failed to save schedule");Sr({...dl,...j.schedule||{}}),ts(e("flow:schedule.saved")),await hu(a,{quiet:!0})}catch(b){vi(String(b.message||b))}finally{Jc(!1)}}},[a,$n,hu,e]),nw=x.useCallback(async()=>{if(!a||!E.trim())return;const b=E.trim();if(b===a.id){B("");return}T(!0),B("");try{const j=await fetch("/api/flow/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:a.id,flowSource:a.source??"user",newFlowId:b})}),z=await j.json().catch(()=>({}));if(!j.ok)throw new Error(typeof z.error=="string"?z.error:e("flow:composer.requestFailed"));let W={id:z.flowId,source:z.flowSource??a.source,archived:a.archived};try{const K=await fetch("/api/flows");if(K.ok){const Y=await K.json(),Z=Array.isArray(Y)?Y.find(te=>te.id===z.flowId&&(te.source??"user")===(z.flowSource??a.source)):null;Z&&(W=Z)}}catch{}await Cn(W,{preserveComposer:!0}),zu(z.flowId,z.flowSource??a.source)}catch(j){B(String(j.message||j))}finally{T(!1)}},[a,E,Cn]),u_=x.useCallback(b=>{navigator.clipboard.writeText(b).then(()=>{R(!0),setTimeout(()=>R(!1),2e3)}).catch(()=>{})},[]),Dp=x.useCallback(()=>{Ni(He,xt)},[Ni,He,xt]),d_=x.useCallback((b,j)=>{const z=j.trim()===""||j==="default"?void 0:j.trim(),W=He.map(K=>K.id===b?{...K,data:{...K.data,model:z}}:K);Ue(W),Ni(W,xt)},[He,xt,Ue,Ni]),wu=x.useCallback(()=>{var ce;if(!Oe||!a||!Pe)return!1;const b=Pe.id,j=Oe.newId.trim();if(su(""),!N4.test(j))return su(e("flow:nodePropsError.invalidInstanceId")),!1;if(He.some(we=>we.id===j&&we.id!==b))return su(e("flow:nodePropsError.duplicateInstanceId")),!1;const z=Oe.role.trim(),W=Ko.includes(z)?z:"普通",K=Oe.model.trim(),Y=we=>(Array.isArray(we)?we:[]).map(Ve=>({type:String((Ve==null?void 0:Ve.type)??"节点").trim()||"节点",name:String((Ve==null?void 0:Ve.name)??""),default:String((Ve==null?void 0:Ve.default)??"")})),Z=Y(Oe.inputs),te=Y(Oe.outputs),se=String(((ce=Pe.data)==null?void 0:ce.definitionId)??j),oe={...Pe.data,label:Oe.label.trim()||j,role:W,model:K===""||K==="default"?void 0:K,body:Oe.body,inputs:Z,outputs:te},me=String(Oe.script??"").trim();se==="tool_nodejs"||me!==""?oe.script=String(Oe.script??""):delete oe.script;let X,ue=xt;if(j!==b){const we={...Gr.current},Ve={...we[b]||{}};delete we[b],we[j]=Ve,Gr.current=we,X=He.map(We=>We.id!==b?We:{...We,id:j,selected:!0,data:oe}),ue=xt.map((We,Up)=>({...We,source:We.source===b?j:We.source,target:We.target===b?j:We.target,id:`e-${We.source===b?j:We.source}-${We.target===b?j:We.target}-${Up}`}))}else X=He.map(we=>we.id===b?{...we,data:oe}:we);return Ue(X),Tt(ue),Ni(X,ue),!0},[Oe,a,Pe,He,xt,Ue,Tt,Ni]),Fp=x.useCallback(()=>{var we;if(!Oe||!a||!Pe)return!1;const b=Pe.id,j=Oe.role.trim(),z=Ko.includes(j)?j:"普通",W=Oe.model.trim(),K=Ve=>(Array.isArray(Ve)?Ve:[]).map(We=>({type:String((We==null?void 0:We.type)??"节点").trim()||"节点",name:String((We==null?void 0:We.name)??""),default:String((We==null?void 0:We.default)??"")})),Y=K(Oe.inputs),Z=K(Oe.outputs),te=String(((we=Pe.data)==null?void 0:we.definitionId)??b),se=Oe.label.trim()||b,oe=W===""||W==="default"?void 0:W,me={...Pe.data,label:se,role:z,model:oe,body:Oe.body,inputs:Y,outputs:Z},X=String(Oe.script??"").trim();te==="tool_nodejs"||X!==""?me.script=String(Oe.script??""):delete me.script;const ue=Pe.data||{};return(ue.label!==me.label||ue.role!==me.role||ue.model!==me.model||ue.body!==me.body||(ue.script??void 0)!==(me.script??void 0)||JSON.stringify(ue.inputs||[])!==JSON.stringify(Y)||JSON.stringify(ue.outputs||[])!==JSON.stringify(Z))&&Ue(Ve=>Ve.map(We=>We.id===b?{...We,data:me}:We)),!0},[Oe,a,Pe,Ue]),rw=x.useRef(Fp);x.useEffect(()=>{rw.current=Fp},[Fp]),x.useEffect(()=>{if(!Oe||!a||!Ka.current||he!=="edit")return;const b=setTimeout(()=>{rw.current()},400);return()=>clearTimeout(b)},[Oe,a,he]);const f_=x.useCallback(()=>{if(!(!Oe||!Pe)){if(Oe.newId.trim()===Pe.id){su("");return}wu()}},[Oe,Pe,wu]);x.useEffect(()=>{const b=j=>{if(he!=="edit")return;const z=o4(j.target);if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="s"){if(J==="node"&&Pe&&Oe){j.preventDefault(),j.stopPropagation(),wu()||Dp();return}if(z)return;j.preventDefault(),j.stopPropagation(),Dp();return}if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="k"){j.preventDefault(),j.stopPropagation(),zx(W=>!W);return}if(!kp){if(ou){if(j.key==="Escape"){j.preventDefault(),Fa(!1);return}if(Jv(j)&&!j.metaKey&&!j.ctrlKey&&!j.altKey){j.preventDefault(),Fa(!1);return}(j.key==="v"||j.key==="V"||j.key==="h"||j.key==="H")&&!j.metaKey&&!j.ctrlKey&&!j.altKey&&j.preventDefault();return}if(!z){if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="a"){j.preventDefault(),j.stopPropagation(),Ue(W=>W.map(K=>({...K,selected:!0}))),Tt(W=>W.map(K=>({...K,selected:!1})));return}if(Jv(j)&&!j.metaKey&&!j.ctrlKey&&!j.altKey){j.preventDefault(),Fa(W=>!W);return}if((j.key==="v"||j.key==="V")&&!j.metaKey&&!j.ctrlKey&&!j.altKey){j.preventDefault(),Sp("select");return}if((j.key==="h"||j.key==="H")&&!j.metaKey&&!j.ctrlKey&&!j.altKey){j.preventDefault(),Sp("pan");return}}}};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[Dp,ou,kp,J,Pe,Oe,wu,he]),x.useEffect(()=>{if(he!=="running"||Vt==null)return;let b=Math.floor((Date.now()-Vt)/1e3);const j=setInterval(()=>{const z=Date.now()-Vt,W=Math.floor(z/1e3);W!==b&&(b=W,lt(z))},500);return()=>clearInterval(j)},[he,Vt]),x.useEffect(()=>{const b=fo.current;!b||!b.parentElement||Ta.current&&(po.current=!0,b.scrollIntoView({behavior:"auto",block:"end"}),requestAnimationFrame(()=>{po.current=!1}))},[G]),x.useEffect(()=>{const b=fo.current;if(!b)return;const j=b.parentElement;if(!j)return;const z=()=>{if(po.current)return;const W=j.scrollHeight-j.scrollTop-j.clientHeight;Ta.current=W<40};return j.addEventListener("scroll",z,{passive:!0}),()=>j.removeEventListener("scroll",z)},[cn,he]),x.useEffect(()=>{if(he==="edit"||!cn)return;Ta.current=!0;const b=fo.current;b&&(po.current=!0,b.scrollIntoView({behavior:"auto",block:"end"}),requestAnimationFrame(()=>{po.current=!1}))},[he,cn]),x.useEffect(()=>{G.length>Pd+u1&&Q(b=>b.length>Pd+u1?b.slice(-Pd):b)},[G]);const p_=x.useCallback(b=>{if(b.button!==0)return;b.preventDefault();const j=b.currentTarget;Qo.current={active:!0,pointerId:b.pointerId,startY:b.clientY,startH:Ea},j.setPointerCapture(b.pointerId)},[Ea]),h_=x.useCallback(b=>{const j=Qo.current;if(!j.active||b.pointerId!==j.pointerId)return;const z=j.startY-b.clientY;ja(_d(j.startH+z))},[]),vu=x.useCallback(()=>{ja(b=>{const j=_d(b);try{localStorage.setItem(eP,String(j))}catch{}return j})},[]),iw=x.useCallback(b=>{const j=Qo.current;if(!(!j.active||b.pointerId!==j.pointerId)){j.active=!1;try{b.currentTarget.releasePointerCapture(b.pointerId)}catch{}vu()}},[vu]),m_=x.useCallback(()=>{const b=Qo.current;b.active&&(b.active=!1,vu())},[vu]);x.useEffect(()=>{function b(){ja(j=>_d(j))}return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const Pr=x.useCallback(async(b={})=>{if(!a)return;const j=b.runUuid!=null&&String(b.runUuid).trim()?String(b.runUuid).trim():null,z=b.cliInputsOverride??Yc.current,W=!!b.prepareOnly;if(gt(W?"ready":"running"),Q(W?[]:[{ts:new Date().toISOString(),type:"info",text:j?e("flow:run.connectingApiResume",{uuid:j}):e("flow:run.connectingApi")}]),Ie(new Set),Ct({}),Ft(!W),le(null),j||lo(null),W)return;if(!j){const Y=Date.now();tn(Y),lt(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,...j?{uuid:j}:{},cliInputs:z}),signal:K.signal});if(!Y.ok){const X=await Y.json().catch(()=>({error:e("flow:composer.requestFailed")}));Q(ue=>[...ue,{ts:new Date().toISOString(),type:"error",text:X.error||e("flow:composer.requestFailed")}]),gt("error");return}if(Q(X=>[...X,{ts:new Date().toISOString(),type:"info",text:e("flow:run.connectedReceiving")}]),!Y.body){Q(X=>[...X,{ts:new Date().toISOString(),type:"error",text:e("flow:run.noBody")}]),gt("error");return}const Z=Y.body.getReader(),te=new TextDecoder;let se="";const oe=X=>{const ue=X.ts||new Date().toISOString();if(X.type==="event")if(X.event==="node-start")Ie(ce=>new Set(ce).add(X.instanceId)),Ct(ce=>({...ce,[X.instanceId]:{status:"running",startMs:Date.now()}})),Q(ce=>[...ce,{ts:ue,type:"node-start",text:X.label?e("flow:run.nodeStartWithLabel",{instanceId:X.instanceId,label:X.label}):e("flow:run.nodeStart",{instanceId:X.instanceId})}]);else if(X.event==="node-done"){Ie(we=>{const Ve=new Set(we);return Ve.delete(X.instanceId),Ve});const ce=X.elapsed??null;Ct(we=>({...we,[X.instanceId]:{status:"success",elapsed:ce}})),Q(we=>[...we,{ts:ue,type:"node-done",text:ce?e("flow:run.nodeDoneWithElapsed",{instanceId:X.instanceId,elapsed:ce}):e("flow:run.nodeDone",{instanceId:X.instanceId})}])}else if(X.event==="node-failed")Ie(ce=>{const we=new Set(ce);return we.delete(X.instanceId),we}),Ct(ce=>({...ce,[X.instanceId]:{status:"failed",elapsed:X.elapsed??null}})),Q(ce=>[...ce,{ts:ue,type:"node-failed",text:e("flow:run.nodeFailed",{instanceId:X.instanceId})}]);else if(X.event==="apply-start"){if(X.uuid&&lo(String(X.uuid)),typeof X.runStartTime=="number"&&X.runStartTime>0)tn(X.runStartTime),lt(Math.max(0,Date.now()-X.runStartTime));else if(typeof X.totalExecutedMs=="number"&&X.totalExecutedMs>0){const ce=Date.now()-X.totalExecutedMs;tn(ce),lt(X.totalExecutedMs)}Q(ce=>[...ce,{ts:ue,type:"info",text:e("flow:run.pipelineStart",{uuid:X.uuid||"?"})}])}else X.event==="apply-done"?Q(ce=>[...ce,{ts:ue,type:"info",text:X.totalElapsed?e("flow:run.pipelineDoneWithElapsed",{elapsed:X.totalElapsed}):e("flow:run.pipelineDone")}]):X.event==="apply-paused"?Q(ce=>[...ce,{ts:ue,type:"warn",text:e("flow:run.pipelinePaused",{nodes:(X.pendingNodes||[]).join(", ")})}]):Q(ce=>[...ce,{ts:ue,type:"event",text:`[${X.event}] ${JSON.stringify(X)}`}]);else X.type==="user-check-content"?(ns({instanceId:X.instanceId,execId:X.execId??1,inputPath:X.inputPath,outputPath:X.outputPath,content:X.content||""}),rs(X.content||""),mo(!1),is(""),ss(!1),Q(ce=>[...ce,{ts:ue,type:"user-check",text:e("flow:run.userCheckContent",{instanceId:X.instanceId})}])):X.type==="user-ask-prompt"?(Ra({instanceId:X.instanceId,execId:X.execId??1,question:X.question||"",options:Array.isArray(X.options)?X.options:[]}),bi(!1),Q(ce=>[...ce,{ts:ue,type:"user-ask",text:e("flow:run.userAskPrompt",{instanceId:X.instanceId,defaultValue:`等待用户选择 (${X.instanceId})`})}])):X.type==="tool-print-content"?$x({instanceId:X.instanceId,execId:X.execId??1,content:X.content||"",createdAt:Date.now()}):X.type==="log"?Q(ce=>[...ce,{ts:ue,type:"log",text:X.text!=null?String(X.text):""}]):X.type==="error"?Q(ce=>[...ce,{ts:ue,type:"error",text:X.message||e("flow:run.unknownError")}]):X.type==="done"?Q(ce=>[...ce,{ts:ue,type:"done",text:e("flow:run.executionEnd",{exitCode:X.exitCode??"?"})}]):Q(ce=>[...ce,{ts:ue,type:"log",text:JSON.stringify(X)}])},me=X=>{if(X.trim())try{oe(JSON.parse(X))}catch{Q(ue=>[...ue,{ts:new Date().toISOString(),type:"log",text:X}])}};for(;;){const{done:X,value:ue}=await Z.read();se+=te.decode(ue??new Uint8Array,{stream:!X});const ce=se.split(`
|
|
126
|
-
`);se=ce.pop()??"";for(const we of ce)me(we);if(X)break}se.trim()&&me(se),gt("done")}catch(Y){Y.name==="AbortError"?(Q(Z=>[...Z,{ts:new Date().toISOString(),type:"warn",text:e("flow:run.executionStopped")}]),gt("stopped")):(Q(Z=>[...Z,{ts:new Date().toISOString(),type:"error",text:Y.message||e("flow:run.unknownError")}]),gt("error"))}finally{kr.current=null,Ie(new Set)}},[a]),[g_,$p]=x.useState(!1),y_=x.useCallback(()=>{$p(!0)},[]),x_=x.useCallback(async()=>{if($p(!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{}gt("stopped"),Ie(new Set)},[a]),xo=x.useCallback(()=>{gt("edit"),Ie(new Set),Ct({}),Jo(null),lo(null)},[]),[w_,bu]=x.useState(!1),v_=x.useCallback(async()=>{if(bu(!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{}xo()},[a,xo]),b_=x.useCallback(()=>{bu(!1),t("/projects")},[t]),S_=x.useCallback(b=>{const j=b.runId!=null&&String(b.runId).trim()?String(b.runId).trim():null,z=b.flowId!=null&&String(b.flowId).trim()?String(b.flowId).trim():(a==null?void 0:a.id)!=null?String(a.id):null;lo(j);const W=b.status||"unknown";let K="stopped";W==="success"?K="done":W==="failed"?K="error":W==="running"?K="running":K="stopped",gt(K);const Y=typeof b.at=="number"?b.at:null;if(K==="running"&&Y!=null?(tn(Y),lt(Math.max(0,Date.now()-Y))):Y!=null&&typeof b.endedAt=="number"&&b.endedAt>Y?(tn(null),lt(b.endedAt-Y)):(tn(null),lt(Math.max(0,b.durationMs??0))),Q([]),Ie(new Set),Ct({}),Jo(null),le(null),Ft(!1),j&&z){const Z=new URLSearchParams({flowId:z,runId:j});fetch(`/api/run-node-statuses?${Z}`).then(te=>te.json()).then(te=>{const se=te.statuses&&typeof te.statuses=="object"?te.statuses:{},oe={};for(const[me,X]of Object.entries(se))X&&typeof X=="object"&&typeof X.status=="string"&&(oe[me]={status:X.status,...X.elapsed!=null&&String(X.elapsed).trim()!==""?{elapsed:String(X.elapsed)}:{}});Ct(oe)}).catch(()=>{})}},[a==null?void 0:a.id]);x.useEffect(()=>{if(!(a!=null&&a.id)||he!=="edit")return;let b=!1;return(async()=>{try{const j=await fetch("/api/pipeline-recent-runs"),z=await j.json();if(b||!j.ok)return;const K=(Array.isArray(z.runs)?z.runs:[]).find(te=>te.flowId===a.id&&te.status==="running");if(!K||b)return;const Y=K.runId||null;lo(Y),gt("running"),Ft(!0),tn(K.at||Date.now()),Ne.current=0;const Z=[{ts:new Date().toISOString(),type:"info",text:`[resume] 检测到活跃 run ${Y},已恢复运行视图`}];if(Y){const te=new URLSearchParams({flowId:a.id,runId:Y}),oe=await(await fetch(`/api/run-node-statuses?${te}`)).json();if(b)return;const me=oe.statuses&&typeof oe.statuses=="object"?oe.statuses:{},X={},ue=new Set;for(const[ce,we]of Object.entries(me))we&&typeof we=="object"&&typeof we.status=="string"&&(X[ce]={status:we.status,...we.elapsed!=null&&String(we.elapsed).trim()!==""?{elapsed:String(we.elapsed)}:{}},we.status==="running"&&ue.add(ce));Ct(X),Ie(ue);try{const ce=new URLSearchParams({flowId:a.id,runId:Y,sinceBytes:"0",tailBytes:"262144"}),we=await fetch(`/api/run-log?${ce}`);if(we.ok){const Ve=await we.json();if(!b){Ne.current=Number(Ve.bytes||0);const We=d1(typeof Ve.text=="string"?Ve.text:"");Q([...We,...Z]);return}}}catch{}}Q(Z)}catch{}})(),()=>{b=!0}},[a==null?void 0:a.id]),x.useEffect(()=>{if(he==="edit"||!(a!=null&&a.id)||!ft)return;let b=!1,j=null;const z=async()=>{try{const W=new URLSearchParams({flowId:a.id,runId:ft}),K=await fetch(`/api/run-node-statuses?${W}`);if(!K.ok)return;const Y=await K.json();if(b)return;const Z=Y.statuses&&typeof Y.statuses=="object"?Y.statuses:{},te={},se=new Set;for(const[oe,me]of Object.entries(Z))me&&typeof me=="object"&&typeof me.status=="string"&&(te[oe]={status:me.status,...me.elapsed!=null&&String(me.elapsed).trim()!==""?{elapsed:String(me.elapsed)}:{}},me.status==="running"&&se.add(oe));Ct(oe=>W8(oe,te)?oe:te),Ie(oe=>K8(oe,se)?oe:se);try{const oe=new URLSearchParams({flowId:a.id,runId:ft,sinceBytes:String(Ne.current||0),tailBytes:String(B8)}),me=await fetch(`/api/run-log?${oe}`);if(me.ok){const X=await me.json();if(b)return;const ue=Number(X.bytes||0),ce=typeof X.text=="string"?X.text:"";if(ce){const we=d1(ce);we.length>0&&Q(Ve=>[...Ve,...we])}Ne.current=ue}}catch{}try{const oe=await fetch("/api/pipeline-recent-runs");if(!oe.ok)return;const me=await oe.json();if(b)return;const ue=(Array.isArray(me.runs)?me.runs:[]).find(ce=>ce.flowId===a.id&&ce.runId===ft);if(ue&&ue.status){const ce=ue.status;ce==="running"?gt(we=>we==="running"?we:"running"):ce==="success"?gt("done"):ce==="failed"?gt("error"):(ce==="stopped"||ce==="interrupted")&>("stopped")}}catch{}}catch{}};return z(),j=window.setInterval(z,2500),()=>{b=!0,j&&window.clearInterval(j)}},[he,a==null?void 0:a.id,ft]),x.useEffect(()=>{if(J!=="history"||!a)return;let b=!1;return(async()=>{Ke(!0),xe("");try{const j=await fetch("/api/pipeline-recent-runs"),z=await j.json();if(!j.ok)throw new Error(z.error||"HTTP "+j.status);b||ye(Array.isArray(z.runs)?z.runs:[])}catch(j){b||(xe(String(j.message||j)),ye([]))}finally{b||Ke(!1)}})(),()=>{b=!0}},[J,a]),x.useEffect(()=>{if(!a){Dt({files:[]});return}let b=!1;return(async()=>{wr(!0);try{const j=new URLSearchParams({flowId:a.id,flowSource:a.source||"user",archived:a.archived?"1":"0"}),z=await fetch(`/api/pipeline-files?${j}`),W=await z.json();if(!z.ok)throw new Error(W.error||"HTTP "+z.status);b||Dt({files:Array.isArray(W.files)?W.files:[],path:W.path,error:W.error})}catch(j){b||Dt({files:[],error:j.message||String(j)})}finally{b||wr(!1)}})(),()=>{b=!0}},[a]);const qa=x.useMemo(()=>a?Se.filter(b=>b&&b.flowId===a.id).sort((b,j)=>j.at-b.at):[],[Se,a]),nn=x.useMemo(()=>{let b=0,j=0,z=0,W=0,K=0;for(const Y of qa){const Z=Y.status||"unknown";Z==="success"?b+=1:Z==="failed"?j+=1:Z==="running"?z+=1:Z==="stopped"?W+=1:Z==="interrupted"&&(K+=1)}return{success:b,failed:j,running:z,stopped:W,interrupted:K}},[qa]),Ga=x.useMemo(()=>a?a1(zn,iu):null,[a,zn,iu]),tr=x.useMemo(()=>{if(!Ga||!a)return[];const b=Ga.query.toLowerCase(),j=K=>b?K.some(Y=>Y&&String(Y).toLowerCase().includes(b)):!0,z=He.map(K=>{var oe,me;const Y=K.id,Z=String(((oe=K.data)==null?void 0:oe.label)??Y),te=(me=K.data)!=null&&me.definitionId?String(K.data.definitionId):"",se=[Z!==Y?Z:"",te&&te!==Y?te:""].filter(Boolean);return{id:Y,label:Z,defId:te,subs:se}}).filter(({id:K,label:Y,defId:Z})=>j([K,Y,Z])).sort((K,Y)=>K.id.localeCompare(Y.id)).slice(0,18).map(({id:K,label:Y,defId:Z})=>{const te=[Y!==K?Y:null,Z||null].filter(Boolean).join(" · ")||void 0;return{kind:"instance",id:K,title:K,subtitle:te}}),W=q.filter(K=>K&&K.id&&j([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[...z,...W]},[Ga,He,q,a]),Xa=x.useMemo(()=>{const b=tr.filter(z=>z.kind==="instance"),j=tr.filter(z=>z.kind==="definition");return{instances:b,definitions:j}},[tr]);x.useEffect(()=>{Da(b=>{const j=Math.max(0,tr.length-1);return Math.min(Math.max(0,b),j)})},[tr]);const ow=x.useMemo(()=>R8(zn),[zn]),sw=x.useMemo(()=>He.filter(b=>b.selected),[He]),Su=x.useMemo(()=>{const b=[],j=new Set;for(const K of sw)j.add(K.id),b.push({node:K,kind:"canvas"});const z=new Map(He.map(K=>[K.id,K])),W=new Map(q.map(K=>[K.id,K]));for(const K of ow){if(j.has(K))continue;const Y=z.get(K);if(Y){j.add(K),b.push({node:Y,kind:"mention"});continue}const Z=W.get(K);Z&&(j.add(K),b.push({definition:Z,kind:"definition"}))}return b},[sw,ow,He,q]),dn=x.useMemo(()=>{const b=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],j=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],z=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[],W=j.map(oe=>`opencode:${ei(oe)}`),K=z.map(oe=>`claude-code:${ei(oe)}`),Y=new Set([...b,...j,...z].map(ei).concat(W).concat(K)),Z=(go||"").trim(),te=nd(go,b,j,z),se=te&&!Y.has(te)&&!Y.has(Z)?Z:"";return{cursorList:b,opencodeList:j,claudeCodeList:z,currentNotInLists:se}},[_e,go]);x.useEffect(()=>{const b=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],j=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],z=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[];Bx(W=>{const K=nd(W,b,j,z);return K===W?W:K})},[_e.cursor,_e.opencode,_e.claudeCode]);const wo=x.useCallback(async(b,j={})=>{var pw;if(!a||Ap.current)return;const z=j.phaseContextSnapshot,W=(typeof b=="string"?b:zn).trim();if(!W)return;const K=Vx.current;Ap.current=!0,Yx(!0),Cr(e("flow:composer.connecting")),le(it=>it!=="composer"?"composer":it);const Y=[...Ha];if(K.length>0&&Y.push({type:"assistant",segments:[...K]}),qx([...Y,{type:"user",text:W}]),Y.filter(it=>it.type==="user").length===0){const it=W.replace(/\s+/g," ").slice(0,30)+(W.length>30?"…":"");Nr(Hn=>Hn.map(Yt=>Yt.id===Kt?{...Yt,label:it}:Yt))}const Z=Y.map(it=>it.type==="user"?{role:"user",text:it.text}:{role:"assistant",text:(it.segments||[]).filter(Yt=>Yt.kind==="assistant"||Yt.kind==="result").map(Yt=>Yt.text).join(`
|
|
127
|
-
`)}).filter(it=>it.text),te=z??Ae;La(""),Er([]),Ua([]),Gx(!1);const se=new AbortController;fu.current=se,Ip.current=Kt;let oe=null;const me=Array.isArray(_e==null?void 0:_e.cursor)?_e.cursor:[],X=Array.isArray(_e==null?void 0:_e.opencode)?_e.opencode:[],ue=Array.isArray(_e==null?void 0:_e.claudeCode)?_e.claudeCode:[],ce=nd(go,me,X,ue),we=Su.filter(it=>it.kind!=="definition"&&it.node).map(it=>it.node.id),Ve=a;let We=!1,Up=!1;try{oe=setTimeout(()=>se.abort(),12e4);const it={prompt:W,model:ce,flowId:a.id,flowSource:a.source??"user",...a.archived?{flowArchived:!0}:{},contextInstanceIds:we,thread:Z};te&&te.nextPhase&&!te.isLastPhase&&(it.phaseContext={phaseIndex:te.nextPhase.index,phases:te.phases,userPromptOriginal:te.userPromptOriginal||W}),jp&&(it.phaseRole=jp);const Hn=await fetch("/api/composer-agent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(it),signal:se.signal});if(oe&&(clearTimeout(oe),oe=null),!Hn.ok){let Qa=Hn.statusText||e("flow:composer.requestFailed");try{const Ja=await Hn.json();Ja&&Ja.error&&(Qa=String(Ja.error))}catch{}Cr(Qa),Er([{kind:"error",text:Qa}]);return}const Yt=(pw=Hn.body)==null?void 0:pw.getReader();if(!Yt){Cr(e("flow:composer.cannotReadStream"));return}const us=new TextDecoder;let vo="";for(;;){const{done:Qa,value:Ja}=await Yt.read();if(Qa)break;for(vo+=us.decode(Ja,{stream:!0});;){const Vp=vo.indexOf(`
|
|
128
|
-
`);if(Vp<0)break;const hw=vo.slice(0,Vp).trim();if(vo=vo.slice(Vp+1),!hw)continue;let pe;try{pe=JSON.parse(hw)}catch{continue}if(pe.type==="status"&&typeof pe.line=="string"&&Cr(pe.line),pe.type==="natural"&&typeof pe.text=="string"&&pe.text){const Xe=typeof pe.kind=="string"&&pe.kind?pe.kind:"assistant";Er(Ge=>[...Ge,{kind:Xe,text:pe.text}])}if(pe.type==="error"&&pe.message){Up=!0;const Xe=pe.code?` [${pe.code}]`:"",Ge=String(pe.message)+Xe;Cr(Ge),Er(fn=>[...fn,{kind:"error",text:Ge}])}if(pe.type==="plan"&&Array.isArray(pe.steps)){Ua(pe.steps.map(Ge=>({...Ge,status:"pending"})));const Xe=pe.steps.map((Ge,fn)=>`${fn+1}. ${Ge.description||Ge.type}`).join(`
|
|
129
|
-
`);Er(Ge=>[...Ge,{kind:"assistant",text:e("flow:composer.taskPlan",{count:pe.steps.length,summary:Xe})}])}if(pe.type==="step-start"){const Xe=pe.index??0,Ge=pe.total??0,fn=pe.tier?` [${pe.tier}]`:"",j_=pe.model?` (${pe.model})`:"";Cr(e("flow:composer.step",{current:Xe+1,total:Ge,description:(pe.description||"")+fn+j_})),Ua(P_=>P_.map(ds=>ds.index===Xe?{...ds,status:"running",model:pe.model,tier:pe.tier,nodeRole:pe.nodeRole??ds.nodeRole,instanceId:pe.instanceId??ds.instanceId,instanceLabel:pe.instanceLabel??ds.instanceLabel}:ds))}if(pe.type==="step-progress"){const Xe=pe.index??0,Ge=pe.total??0;Cr(e("flow:composer.step",{current:Xe+1,total:Ge,description:pe.description||""}))}if(pe.type==="step-done"){const Xe=pe.index??0;Ua(Ge=>Ge.map(fn=>fn.index===Xe?{...fn,status:pe.success?"done":"error"}:fn))}if(pe.type==="phase-plan"&&Array.isArray(pe.phases)){Va(Ge=>({...Ge||{},phases:pe.phases,currentPhase:pe.currentPhase??0,phaseTotal:pe.phaseTotal??pe.phases.length,phaseName:pe.phaseName||"",isLastPhase:!1,nextPhase:null,userPromptOriginal:(Ge==null?void 0:Ge.userPromptOriginal)||W}));const Xe=pe.phases.map((Ge,fn)=>`${fn+1}. ${Ge.label}`).join(" → ");Er(Ge=>[...Ge,{kind:"assistant",text:e("flow:composer.phaseGeneration",{count:pe.phases.length,labels:Xe,current:pe.phaseName||""})}])}pe.type==="phase-complete"&&(Va(Xe=>{var fn;return{...Xe||{},phases:pe.phases||(Xe==null?void 0:Xe.phases)||[],currentPhase:pe.phaseIndex??0,phaseTotal:pe.phaseTotal??((fn=pe.phases)==null?void 0:fn.length)??0,phaseName:pe.phaseName||"",isLastPhase:!!pe.isLastPhase,nextPhase:pe.nextPhase||null,userPromptOriginal:pe.userPromptOriginal||(Xe==null?void 0:Xe.userPromptOriginal)||W}}),!pe.isLastPhase&&pe.nextPhase&&Er(Xe=>[...Xe,{kind:"assistant",text:e("flow:composer.phaseComplete",{phaseName:pe.phaseName||e("flow:composer.nextPhase"),nextPhase:pe.nextPhase.label})}])),pe.type==="done"&&(We=!0,Cr(Xe=>Xe||e("flow:composer.done")))}}}catch(it){const Hn=it;if(Hn.name==="AbortError"){const Yt=e(oe?"flow:composer.connectTimeout":"flow:composer.aborted");Cr(Yt),Er(us=>[...us,{kind:"error",text:Yt}])}else{const Yt=Hn.code||Hn.name||"UNKNOWN",us=`${Hn.message||String(it)} [${Yt}]`;Cr(us),Er(vo=>[...vo,{kind:"error",text:us}])}}finally{Ap.current=!1,Yx(!1),fu.current=null,Ip.current=null,oe&&clearTimeout(oe),We&&Ve&&Cn({id:Ve.id,source:Ve.source??"user",archived:Ve.archived},{preserveComposer:!0,incrementalSync:!0})}},[a,zn,go,_e,Su,Cn,Ha,Kt,Ae,jp]);UP.current=wo;const aw=x.useCallback(()=>{!Ae||Ae.isLastPhase||(Va(null),wo(e("flow:composer.skipRemainingPhases")))},[Ae,wo]),lw=x.useCallback(()=>{if(!Ae||Ae.isLastPhase||!Ae.nextPhase)return;const b=String(Ae.nextPhase.label||"").trim()||e("flow:composer.nextPhase");wo(e("flow:composer.continuePhase",{label:b}),{phaseContextSnapshot:Ae})},[Ae,wo]);x.useEffect(()=>{if(!_p)return;const b=j=>{j.key==="Escape"&&du(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[_p]),x.useEffect(()=>{he!=="edit"&&du(!1)},[he]),x.useLayoutEffect(()=>{const b=Np.current;if(!b)return;if(!a){b.style.height="";return}b.style.height="0px";const j=getComputedStyle(b),z=parseFloat(j.lineHeight),W=(parseFloat(j.paddingTop)||0)+(parseFloat(j.paddingBottom)||0),K=Number.isFinite(z)&&z>0?z:13*1.45,Y=W+K*2,Z=W+K*10,te=Math.min(Math.max(b.scrollHeight,Y),Z);b.style.height=`${te}px`},[zn,a]);const zp=x.useCallback(b=>{const j=zn,z=iu,W=a1(j,z);if(!W)return;const K=j.slice(0,W.atIndex)+`@${b} `+j.slice(z);La(K);const Y=W.atIndex+b.length+2;queueMicrotask(()=>{const Z=Np.current;Z&&(Z.focus(),Z.setSelectionRange(Y,Y)),Oa(Y)})},[zn,iu]),Bp=x.useCallback(b=>{La(j=>{const z=`@${b}`,W=j.indexOf(z);return W<0?j:j.slice(0,W)+j.slice(W+z.length)})},[]),cw=x.useCallback(b=>{b.kind==="canvas"?Ue(j=>j.map(z=>z.id===b.node.id?{...z,selected:!1}:z)):b.kind==="mention"?Bp(b.node.id):Bp(b.definition.id)},[Ue,Bp]),k_=x.useCallback(()=>{le(b=>b==="history"?null:"history")},[]),N_=x.useCallback(()=>{le(b=>b==="settings"?null:"settings")},[]),C_=x.useCallback(()=>{le(b=>b==="composer"?null:"composer")},[]),Hp=x.useCallback(()=>{le(b=>(b==="node"&&$a.current&&(Cp.current=$a.current.id),null))},[]),uw=x.useCallback(()=>{Fa(b=>!b)},[]),E_=a?Gh(a):"";return c.jsx(gE,{children:c.jsxs(Jj.Provider,{value:{modelLists:_e,onModelChange:d_},children:[c.jsxs("div",{className:"af-pipeline-page"+(he!=="edit"?" af-pipeline-page--run-mode":""),children:[c.jsxs("header",{className:"af-pipeline-top",children:[c.jsxs("div",{className:"af-pipeline-top-left",children:[c.jsx("button",{type:"button",className:"af-icon-btn af-pipeline-back",onClick:()=>{he==="running"?bu(!0):he!=="edit"?xo():t("/projects")},"aria-label":e(he!=="edit"?"flow:topbar.backToEdit":"flow:topbar.backToProjects"),title:e(he!=="edit"?"flow:topbar.backToEdit":"flow:topbar.backToProjects"),children:c.jsx("span",{className:"material-symbols-outlined",children:"arrow_back"})}),c.jsxs("div",{className:"af-pipeline-brand",children:[c.jsx("span",{className:"af-pipeline-brand-name",children:"PIPELINE"}),c.jsxs("span",{className:"af-pipeline-brand-ver",children:["V",E8,"-STABLE"]})]}),c.jsxs("div",{className:"af-pipeline-flow-pick",children:[c.jsx("label",{className:"af-visually-hidden",htmlFor:"af-flow-select",children:e("flow:topbar.currentPipeline")}),c.jsx("select",{id:"af-flow-select",className:"af-pipeline-flow-select",value:E_,onChange:b=>{const j=b.target.value;if(!j)return;const z=j.split("\0"),W=z[0],K=z[1]||"user",Y=z[2]==="1",Z=r.find(te=>te.id===W&&(te.source??"user")===K&&!!te.archived===Y);Z&&Cn(Z)},disabled:r.length===0,children:r.length===0?c.jsx("option",{value:"",children:e("flow:palette.loading")}):c.jsxs(c.Fragment,{children:[a?null:c.jsx("option",{value:"",children:e("flow:pipeline.selectPipeline")}),r.map(b=>c.jsxs("option",{value:Gh(b),children:[b.id," (",Xh(b.source??"user",e),")",b.archived?` · ${e("flow:palette.archived")}`:""]},Gh(b)))]})})]})]}),c.jsxs("div",{className:"af-pipeline-top-right af-flow-toolbar-actions",children:[gp&&c.jsx("button",{type:"button",className:"af-icon-btn"+(Vc?" af-icon-btn--active":""),"aria-label":"Composer Logs (dev)",title:"Composer Logs (dev)",onClick:()=>Wc(b=>!b),children:c.jsx("span",{className:"material-symbols-outlined",children:"description"})}),he==="running"&&c.jsxs("div",{className:"af-run-timer",children:[c.jsx("span",{className:"af-run-timer__dot"}),c.jsx("span",{className:"af-run-timer__label",children:"RUNTIME"}),c.jsx("span",{className:"af-run-timer__value",children:Kh(Jn,"running")})]}),he==="stopped"&&c.jsxs("div",{className:"af-run-timer af-run-timer--stopped",children:[c.jsx("span",{className:"af-run-timer__label",children:"PAUSED"}),c.jsx("span",{className:"af-run-timer__value",children:Kh(Jn,"stopped")})]}),(he==="done"||he==="error")&&c.jsxs("div",{className:"af-run-timer"+(he==="error"?" af-run-timer--error":" af-run-timer--done"),children:[c.jsx("span",{className:"af-run-timer__label",children:he==="error"?"FAILED":"COMPLETED"}),c.jsx("span",{className:"af-run-timer__value",children:Kh(Jn,he)})]}),he!=="edit"&&c.jsx("button",{type:"button",className:"af-icon-btn"+(cn?" af-icon-btn--active":""),"aria-label":e("flow:topbar.executionLog"),title:e("flow:topbar.executionLog"),onClick:()=>Ft(b=>!b),children:c.jsx("span",{className:"material-symbols-outlined",children:"terminal"})}),he==="edit"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"af-icon-btn"+(J==="history"?" af-icon-btn--active":""),"aria-label":e("flow:topbar.history"),title:e("flow:topbar.history"),disabled:!a,onClick:k_,children:c.jsx("span",{className:"material-symbols-outlined",children:"history"})}),c.jsx("button",{type:"button",className:"af-icon-btn"+(J==="settings"?" af-icon-btn--active":""),onClick:N_,"aria-label":e("flow:topbar.pipelineSettings"),title:e("flow:topbar.pipelineSettings"),disabled:!a,children:c.jsx("span",{className:"material-symbols-outlined",children:"settings"})}),c.jsx("button",{type:"button",className:"af-composer-topbar-btn"+(J==="composer"?" af-composer-topbar-btn--active":"")+(vt?" af-composer-topbar-btn--running":""),onClick:C_,"aria-label":"AI Composer",title:"AI Composer",disabled:!a,children:"AI"}),c.jsx("button",{type:"button",className:"af-icon-btn af-shortcuts-trigger"+(ou?" af-icon-btn--active":""),onClick:uw,"aria-label":e("flow:topbar.shortcutsLabel"),title:e("flow:topbar.shortcutsTitle"),disabled:!a,children:c.jsx("span",{className:"af-shortcuts-trigger__mark","aria-hidden":!0,children:"?"})}),c.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:()=>D(!0),children:c.jsx("span",{className:"material-symbols-outlined",children:"delete_forever"})}),c.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"})]}),he==="running"?c.jsxs("button",{type:"button",className:"af-btn-run-stop",onClick:y_,title:e("flow:run.pauseRun"),children:[c.jsx("span",{className:"material-symbols-outlined",children:"pause"}),"Pause"]}):he==="ready"?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void Pr(),title:e("flow:topbar.startRun"),children:e("flow:topbar.startRun")}),c.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:xo,children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):he==="stopped"?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void Pr({runUuid:ft}),title:ft?e("flow:topbar.resumeTitle",{uuid:ft}):e("flow:topbar.resumeTitleNoUuid"),children:"Resume"}),c.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:xo,children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):he==="done"||he==="error"?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg",disabled:!a,onClick:()=>void Pr(),title:e("flow:topbar.rerunTitle"),children:"Run"}),c.jsxs("button",{type:"button",className:"af-btn-pipeline-save",onClick:xo,children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit"}),"Edit"]})]}):c.jsxs("div",{className:"af-run-btn-group",children:[c.jsx("button",{type:"button",className:"af-btn-primary af-btn-primary--lg af-run-btn-main",disabled:!a,onClick:()=>void Pr(),children:"Run"}),c.jsx("button",{type:"button",className:"af-run-btn-dropdown",disabled:!a,onClick:()=>yi(b=>!b),"aria-label":e("flow:topbar.runOptions"),"aria-expanded":qc,children:c.jsx("span",{className:"material-symbols-outlined",children:"arrow_drop_down"})}),qc&&a&&c.jsxs("div",{className:"af-run-dropdown-menu",children:[c.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{var j,z,W,K,Y;yi(!1);const b={};for(const Z of er){const te=cs[Z.id];te&&(b[te]=((j=co[te])==null?void 0:j.value)??((z=co[te])==null?void 0:z.path)??((Y=(K=(W=Z.data)==null?void 0:W.outputs)==null?void 0:K[0])==null?void 0:Y.default)??"")}Xc(b),Zo(!0)},children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit_note"}),e("flow:topbar.runWithParams")]}),c.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{yi(!1),Pr({prepareOnly:!0})},children:[c.jsx("span",{className:"material-symbols-outlined",children:"tune"}),e("flow:topbar.editRun")]}),c.jsx("div",{className:"af-run-dropdown-divider"}),c.jsxs("div",{className:"af-run-dropdown-section",children:[c.jsx("span",{className:"af-run-dropdown-section-label",children:e("flow:topbar.runWithPreset")}),c.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{yi(!1),Pr()},children:[c.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:runPreset.default")]}),Object.keys(xi).map(b=>c.jsxs("button",{type:"button",className:"af-run-dropdown-item",onClick:()=>{var W;yi(!1);const j=xi[b]||{},z={};for(const K of er){const Y=cs[K.id];if(!Y)continue;const Z=((W=K.data)==null?void 0:W.definitionId)||"",te=j[K.id]??"";Z.startsWith("provide_file")?z[Y]={type:"file",path:te}:z[Y]={type:"str",value:te}}Pr({cliInputsOverride:z})},children:[c.jsx("span",{className:"material-symbols-outlined",children:"bookmark"}),b]},b))]})]})]})]})]}),c.jsxs("div",{className:"af-pipeline-body"+(he!=="edit"?" af-pipeline-body--run-mode":""),children:[he==="edit"?c.jsxs("aside",{className:"af-node-palette af-flow-left-panel",id:"af-node-palette","aria-label":e("flow:palette2.nodePalette"),children:[c.jsxs("div",{className:`af-palette-workspace${Le?" af-palette-workspace--expanded":""}`,children:[c.jsxs("button",{type:"button",className:"af-palette-workspace-head",onClick:()=>mt(b=>!b),"aria-expanded":Le,children:[c.jsx("span",{className:"af-palette-workspace-icon material-symbols-outlined","aria-hidden":!0,children:"folder_open"}),c.jsx("span",{className:"af-palette-workspace-label",children:e("flow:palette.workspace")}),c.jsx("span",{className:"af-palette-workspace-chevron material-symbols-outlined","aria-hidden":!0,children:Le?"expand_less":"expand_more"})]}),c.jsx("div",{className:"af-palette-workspace-path",title:a!=null&&a.path?s1(a.path):"",children:a!=null&&a.path?s1(a.path):e("flow:palette2.noPipelineSelected")}),Le&&c.jsx("div",{className:"af-palette-workspace-tree",children:Fn?c.jsx("div",{className:"af-palette-workspace-loading",children:e("flow:palette.loading")}):_t.error?c.jsx("div",{className:"af-palette-workspace-empty",children:_t.error}):a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"af-palette-workspace-group",children:[c.jsxs("div",{className:"af-palette-workspace-group-head",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"folder"}),c.jsx("span",{children:a.id}),c.jsxs("span",{className:"af-palette-workspace-count",children:["(",_t.files.length,")"]})]}),_t.files.length>0?c.jsx("ul",{className:"af-palette-workspace-list",children:_t.files.filter(b=>b.type==="file").map(b=>c.jsxs("li",{className:"af-palette-workspace-item af-palette-workspace-item--clickable",title:b.path,onClick:()=>_({filePath:b.path,fileName:b.name}),children:[c.jsx("span",{className:"material-symbols-outlined af-palette-workspace-item-icon","aria-hidden":!0,children:b.icon}),c.jsx("span",{className:"af-palette-workspace-item-label",children:b.name}),b.size!=null&&c.jsx("span",{className:"af-palette-workspace-item-size",children:b.size<1024?`${b.size}B`:b.size<1024*1024?`${(b.size/1024).toFixed(1)}KB`:`${(b.size/1024/1024).toFixed(1)}MB`})]},b.path))}):_t.files.filter(b=>b.type==="directory").length===0?c.jsx("div",{className:"af-palette-workspace-empty",children:"暂无文件"}):null]}),_t.files.filter(b=>{var j;return b.type==="directory"&&((j=b.children)==null?void 0:j.length)>0}).map(b=>c.jsxs("div",{className:"af-palette-workspace-group af-palette-workspace-group--sub",children:[c.jsxs("div",{className:"af-palette-workspace-group-head",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:b.icon}),c.jsxs("span",{children:[b.name,"/"]}),c.jsxs("span",{className:"af-palette-workspace-count",children:["(",b.children.length,")"]})]}),c.jsx("ul",{className:"af-palette-workspace-list",children:b.children.map(j=>c.jsxs("li",{className:`af-palette-workspace-item${j.type==="file"?" af-palette-workspace-item--clickable":""}`,title:j.path,onClick:j.type==="file"?()=>_({filePath:j.path,fileName:j.name}):void 0,children:[c.jsx("span",{className:"material-symbols-outlined af-palette-workspace-item-icon","aria-hidden":!0,children:j.icon}),c.jsx("span",{className:"af-palette-workspace-item-label",children:j.name}),j.type==="file"&&j.size!=null&&c.jsx("span",{className:"af-palette-workspace-item-size",children:j.size<1024?`${j.size}B`:j.size<1024*1024?`${(j.size/1024).toFixed(1)}KB`:`${(j.size/1024/1024).toFixed(1)}MB`})]},j.path))})]},b.path))]}):c.jsx("div",{className:"af-palette-workspace-empty",children:e("flow:palette2.noPipelineSelected")})})]}),c.jsxs("div",{className:"af-node-palette-head",children:[c.jsx("h2",{className:"af-node-palette-title",children:"Node Palette"}),c.jsxs("label",{className:"af-palette-search-wrap",children:[c.jsx("span",{className:"af-visually-hidden",children:e("flow:palette.searchNodes")}),c.jsx("span",{className:"af-palette-search-icon material-symbols-outlined","aria-hidden":!0,children:"search"}),c.jsx("input",{type:"search",className:"af-palette-search-input",value:ne,onChange:b=>ae(b.target.value),placeholder:e("flow:palette.searchNodes")+"…","aria-label":e("flow:palette.searchNodes")})]})]}),o?c.jsx("p",{className:"af-err af-palette-list-err",children:o}):null,c.jsxs("div",{className:"af-node-palette-scroll",children:[td.filter(b=>mu[b].length>0).map(b=>c.jsxs("section",{className:`af-palette-section af-flow-palette-section--${b}`,children:[c.jsx("h3",{className:"af-palette-cat",children:b}),c.jsx("div",{className:"af-palette-cards",children:mu[b].map(j=>c.jsxs("button",{type:"button",className:"af-palette-card",onClick:()=>s_(j),draggable:!!a,onDragStart:z=>{z.dataTransfer.setData("application/agentflow-node",j.id),z.dataTransfer.effectAllowed="move"},disabled:!a,title:j.description||j.id,children:[c.jsx("span",{className:"af-palette-card-icon","aria-hidden":!0,children:c.jsx("span",{className:"material-symbols-outlined",children:I8(b)})}),c.jsx("span",{className:"af-palette-card-label",children:j.id})]},j.id))})]},b)),a&&q.length===0?c.jsx("p",{className:"af-palette-empty",children:e("flow:palette.noComponents")}):null,a&&q.length>0&&ne.trim()&&QP===0?c.jsx("p",{className:"af-palette-empty",children:e("flow:palette.noMatch")}):null,a?null:c.jsx("p",{className:"af-palette-empty",children:e("flow:palette.selectPipeline")})]}),c.jsxs("footer",{className:"af-palette-engine",children:[c.jsxs("div",{className:"af-palette-engine-head",children:[c.jsx("span",{className:"af-palette-engine-dot"+(vr?"":" af-palette-engine-dot--offline"),"aria-hidden":!0}),c.jsx("span",{className:"af-palette-engine-label",children:e(vr?"common:engine.online":"common:engine.offline")})]}),v?c.jsx("div",{className:"af-palette-tip"+JP,role:"status","aria-live":"polite",children:v}):null]})]}):a?c.jsx(w8,{flowId:a.id,flowSource:a.source||"user",flowArchived:a.archived,provideNodes:er,edges:xt,nodes:He,onCliInputsChange:Kc,onBackToEdit:xo}):null,c.jsxs("div",{className:"af-pipeline-main-stack",children:[c.jsxs("div",{className:"af-pipeline-canvas-col",children:[h?c.jsx("div",{className:"af-banner af-banner--err af-pipeline-banner",children:h}):null,a&&jr.length>0&&!I?c.jsxs("div",{className:"af-banner af-banner--warn af-flow-slot-warnings",role:"region","aria-label":e("flow:validation.flowWarningAriaLabel"),children:[c.jsxs("div",{className:"af-flow-slot-warnings-head",children:[c.jsx("div",{className:"af-flow-slot-warnings-title",children:e("flow:palette.validationWarnings")}),c.jsxs("div",{className:"af-flow-slot-warnings-head-actions",children:[c.jsx("button",{type:"button",className:"af-icon-btn",disabled:F,"aria-label":e("flow:validation.reloadFromServer"),title:e("flow:validation.reloadFromServerShort"),onClick:()=>void ew(),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"refresh"})}),c.jsx("button",{type:"button",className:"af-icon-btn","aria-label":e("flow:validation.closeBanner"),title:e("common:common.close"),onClick:()=>C(!0),children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"close"})})]})]}),c.jsx("ul",{className:"af-flow-slot-warnings-list",children:jr.map(b=>c.jsxs("li",{children:[e("flow:validation.nodePrefix"),' "',c.jsx("a",{href:"#",className:"af-flow-slot-warning-node-link","aria-label":e("flow:validation.focusNodeAriaLabel",{nodeId:b.nodeId}),onClick:j=>{j.preventDefault(),i_(b.nodeId)},children:b.nodeId}),'"',b.suffix]},b.key))})]}):null,a&&jr.length>0&&I?c.jsxs("div",{className:"af-banner af-banner--warn af-flow-slot-warnings af-flow-slot-warnings--collapsed",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"af-flow-slot-warnings-collapsed-text",children:e("flow:validation.slotWarningCount",{count:jr.length})}),c.jsxs("button",{type:"button",className:"af-flow-slot-warnings-kbd-hint",onClick:uw,title:e("flow:validation.shortcutHint"),children:[c.jsx("kbd",{children:"?"})," ",e("flow:validation.shortcutHintLabel")]}),c.jsxs("div",{className:"af-flow-slot-warnings-collapsed-actions",children:[c.jsx("button",{type:"button",className:"af-flow-slot-warnings-collapsed-btn",onClick:()=>C(!1),children:e("flow:validation.show")}),c.jsx("button",{type:"button",className:"af-flow-slot-warnings-collapsed-btn",disabled:F,onClick:()=>void ew(),children:e("common:common.refresh")})]})]}):null,c.jsx("div",{className:"af-react-flow-wrap af-pipeline-flow",children:a?c.jsx(Y8,{fitViewEpoch:u,canvasTool:FP,nodes:YP,edges:qP,onNodesChange:he!=="edit"?void 0:WP,onEdgesChange:he!=="edit"?void 0:KP,onConnect:he!=="edit"?void 0:t_,onNodesDelete:he!=="edit"?void 0:n_,onNodeClick:ZP,onEdgeClick:e_,onFlowInit:r_,onDrop:l_,onDragOver:a_,hideMinimapAndControls:!!(a&&J),bottomSlot:he==="edit"?c.jsx("div",{className:"af-bottom-composer-stack af-flow-bottom-composer",children:c.jsxs("div",{className:"af-pipeline-composer-inner",children:[c.jsx("div",{className:"af-composer-selected","aria-label":e("flow:composer.selectedNodesAriaLabel"),children:Su.length===0?c.jsx("span",{className:"af-composer-selected-empty",children:e("flow:composer.selectedNodesEmpty")}):Su.map((b,j)=>{var se,oe;if(b.kind==="definition"){const me=b.definition,X=String(me.label??me.id),ue=[me.id,me.description?String(me.description).slice(0,120):""].filter(Boolean).join(" — ");return c.jsxs("div",{className:"af-composer-node-chip af-composer-node-chip--definition",title:ue,children:[c.jsx("span",{className:"af-composer-node-chip-label",children:X}),c.jsx("button",{type:"button",className:"af-composer-node-chip-dismiss",onClick:()=>cw(b),"aria-label":e("flow:composer.removeFromInput",{id:me.id}),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]},`def-${me.id}`)}const z=b.node,W=b.kind,K=String(((se=z.data)==null?void 0:se.label)??z.id),Y=(oe=z.data)!=null&&oe.definitionId?String(z.data.definitionId):"",Z=Y&&Y!==K?`${K} · ${z.id} · ${Y}`:`${K} · ${z.id}`,te=W==="canvas"?e("flow:composer.deselectNode",{id:z.id}):e("flow:composer.removeFromInput",{id:z.id});return c.jsxs("div",{className:"af-composer-node-chip"+(W==="mention"?" af-composer-node-chip--mention":""),title:Z,children:[c.jsx("span",{className:"af-composer-node-chip-label",children:K}),c.jsx("button",{type:"button",className:"af-composer-node-chip-dismiss",onClick:()=>cw(b),"aria-label":te,children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]},z.id)})}),c.jsxs("div",{className:"af-composer-card af-composer-card--input-only",children:[c.jsxs("div",{className:"af-composer-input-wrap",children:[c.jsx("textarea",{ref:Np,className:"af-composer-textarea",placeholder:e("flow:composer.inputPlaceholder"),disabled:!a,value:zn,rows:2,onChange:b=>{La(b.target.value),Oa(b.target.selectionStart??b.target.value.length)},onSelect:b=>{const j=b.target;j instanceof HTMLTextAreaElement&&Oa(j.selectionStart??0)},onKeyDown:b=>{if((b.metaKey||b.ctrlKey)&&b.key==="Enter"){b.preventDefault(),wo();return}if(Ga&&tr.length>0&&(b.key==="ArrowDown"||b.key==="ArrowUp"||b.key==="Enter")){if(b.key==="ArrowDown")b.preventDefault(),Da(j=>(j+1)%tr.length);else if(b.key==="ArrowUp")b.preventDefault(),Da(j=>(j-1+tr.length)%tr.length);else if(b.key==="Enter"){b.preventDefault();const j=tr[Ma];j&&zp(j.id)}}},onKeyUp:b=>{const j=b.target;j instanceof HTMLTextAreaElement&&Oa(j.selectionStart??j.value.length)},onClick:b=>{const j=b.target;j instanceof HTMLTextAreaElement&&Oa(j.selectionStart??0)},"aria-label":e("flow:composer.inputAriaLabel"),autoComplete:"off",spellCheck:!1}),Ga&&a&&tr.length>0?c.jsxs("ul",{className:"af-composer-mention-menu",role:"listbox","aria-label":e("flow:composer.mentionAriaLabel"),children:[Xa.instances.length>0?c.jsx("li",{className:"af-composer-mention-section",role:"presentation",children:c.jsx("div",{className:"af-composer-mention-section-title",children:"Instances"})}):null,Xa.instances.map((b,j)=>{const z=j;return c.jsx("li",{role:"option","aria-selected":z===Ma,children:c.jsxs("button",{type:"button",className:"af-composer-mention-item"+(z===Ma?" af-composer-mention-item--active":""),onMouseDown:W=>W.preventDefault(),onMouseEnter:()=>Da(z),onClick:()=>zp(b.id),children:[c.jsx("span",{className:"af-composer-mention-id",children:b.title}),b.subtitle?c.jsx("span",{className:"af-composer-mention-sub",children:b.subtitle}):null]})},`i-${b.id}`)}),Xa.definitions.length>0?c.jsx("li",{className:"af-composer-mention-section",role:"presentation",children:c.jsx("div",{className:"af-composer-mention-section-title",children:"Node"})}):null,Xa.definitions.map((b,j)=>{const z=Xa.instances.length+j;return c.jsx("li",{role:"option","aria-selected":z===Ma,children:c.jsxs("button",{type:"button",className:"af-composer-mention-item"+(z===Ma?" af-composer-mention-item--active":""),onMouseDown:W=>W.preventDefault(),onMouseEnter:()=>Da(z),onClick:()=>zp(b.id),children:[c.jsx("span",{className:"af-composer-mention-id",children:b.title}),b.subtitle?c.jsx("span",{className:"af-composer-mention-sub",children:b.subtitle}):null]})},`d-${b.id}`)})]}):null]}),c.jsxs("div",{className:"af-composer-toolbar",children:[Bn.length>0&&c.jsx("label",{className:"af-composer-session-field",children:c.jsxs("select",{className:"af-composer-session-select",value:Kt||"",onChange:b=>{b.target.value==="__new__"?Kx():Xx(b.target.value)},disabled:vt,"aria-label":e("flow:composer.switchConversation"),children:[Bn.map(b=>c.jsxs("option",{value:b.id,children:[b.label,b.running?" ⏳":""]},b.id)),c.jsxs("option",{value:"__new__",children:["+ ",e("flow:composer.newConversation")]})]})}),c.jsxs("label",{className:"af-composer-model-field",children:[c.jsx("span",{className:"af-visually-hidden",children:e("flow:composer.modelLabel")}),c.jsxs("select",{className:"af-composer-model-select",value:(go||"").trim()?dn.currentNotInLists?dn.currentNotInLists:nd(go,dn.cursorList,dn.opencodeList,dn.claudeCodeList):"",onChange:b=>Bx(b.target.value),disabled:!a||vt,"aria-label":e("flow:composer.modelAriaLabel"),children:[c.jsx("option",{value:"",children:e("flow:composer.modelDefault")}),dn.currentNotInLists?c.jsxs("option",{value:dn.currentNotInLists,children:[dn.currentNotInLists,e("flow:composer.modelNotInList")]}):null,dn.cursorList.length>0?c.jsx("optgroup",{label:"Cursor",children:dn.cursorList.map(b=>c.jsx("option",{value:ei(b),children:b},`composer-c-${b}`))}):null,dn.opencodeList.length>0?c.jsx("optgroup",{label:"OpenCode",children:dn.opencodeList.map(b=>c.jsx("option",{value:`opencode:${ei(b)}`,children:b},`composer-o-${b}`))}):null,dn.claudeCodeList.length>0?c.jsx("optgroup",{label:"Claude Code",children:dn.claudeCodeList.map(b=>c.jsx("option",{value:`claude-code:${ei(b)}`,children:b},`composer-cc-${b}`))}):null]})]}),c.jsx("button",{type:"button",className:"af-composer-send"+(a&&zn.trim()&&!vt?" af-composer-send--active":"")+(vt?" af-composer-send--stop":""),disabled:!a||!vt&&!zn.trim(),"aria-label":e(vt?"flow:composer.stopGeneration":"flow:composer.send"),title:vt?e("flow:composer.stopGeneration"):void 0,onClick:()=>{var b;if(vt){(b=fu.current)==null||b.abort();return}wo()},children:c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:vt?"stop":"arrow_upward"})})]})]}),_p?qi.createPortal(c.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:b=>{b.target===b.currentTarget&&du(!1)},children:c.jsxs("div",{className:"af-node-props-expand-panel af-composer-thread-dialog-panel",children:[c.jsxs("div",{className:"af-node-props-expand-head af-composer-thread-dialog-head",children:[c.jsxs("div",{className:"af-composer-thread-dialog-head-main",children:[c.jsx("span",{className:"af-node-props-expand-title",children:e("flow:nodeProps.conversationOutput")}),c.jsx("div",{className:"af-composer-thread-dialog-status"+(vt?" af-composer-thread-dialog-status--running":""),role:"status","aria-live":"polite",title:za||void 0,children:vt&&!za?e("flow:composer.executing"):za||e("flow:composer.ready")})]}),c.jsx("button",{type:"button",className:"af-icon-btn",onClick:()=>du(!1),"aria-label":e("flow:composer.collapseAriaLabel"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),Ux.length>1&&!(Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1)?c.jsx("div",{className:"af-composer-steps-track-wrap",children:c.jsx(O8,{steps:Ux})}):null,Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1?c.jsx("div",{className:"af-composer-phase-bar","aria-label":e("flow:composer.phaseProgress"),children:Ae.phases.map((b,j)=>{const z=b.status||(j<(Ae.currentPhase??0)?"done":j===(Ae.currentPhase??0)?vt?"running":Ae.nextPhase||Ae.isLastPhase?"done":"running":"pending");return c.jsxs("div",{className:"af-composer-phase-item"+(z==="done"?" af-composer-phase-item--done":"")+(z==="running"?" af-composer-phase-item--running":"")+(z==="pending"?" af-composer-phase-item--pending":""),title:`${b.label}${b.description?":"+b.description:""}`,children:[c.jsx("span",{className:"af-composer-phase-dot","aria-hidden":!0,children:z==="done"?c.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.85rem"},children:"check"}):c.jsx("span",{children:j+1})}),c.jsx("span",{className:"af-composer-phase-label",children:b.label})]},b.name||j)})}):null,c.jsx("div",{className:"af-composer-thread-dialog-scroll",children:c.jsx(l1,{thread:Ha,liveSegments:Ba,running:vt})}),Ae&&!Ae.isLastPhase&&Ae.nextPhase&&!vt?c.jsxs("div",{className:"af-composer-phase-review af-composer-phase-review--minimal","aria-label":e("flow:composer.phaseReviewLabel"),children:[c.jsx("span",{className:"af-composer-phase-auto-hint",children:e("flow:composer.phaseReviewHint",{nextPhase:Ae.nextPhase.label})}),c.jsxs("div",{className:"af-composer-phase-review-buttons",children:[c.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--continue",onClick:lw,children:e("flow:composer.phaseReviewContinue",{label:Ae.nextPhase.label})}),c.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--skip",onClick:aw,children:e("flow:composer.phaseReviewSkip")})]})]}):null]})}),document.body):null]})}):null}):c.jsx("div",{className:"af-placeholder af-pipeline-placeholder",children:e("flow:pipeline.selectPipeline")})})]}),he!=="edit"&&cn&&c.jsxs("div",{className:"af-run-console",style:{height:Ea},children:[c.jsx("div",{className:"af-run-console__resize",role:"separator","aria-orientation":"horizontal","aria-label":e("flow:run.resizeConsole"),onPointerDown:p_,onPointerMove:h_,onPointerUp:iw,onPointerCancel:iw,onLostPointerCapture:m_}),c.jsxs("div",{className:"af-run-console__head",children:[c.jsxs("span",{className:"af-run-console__title",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"terminal"}),"EXECUTION CONSOLE"]}),c.jsxs("div",{className:"af-run-console__head-right",children:[he==="running"&&c.jsx("span",{className:"af-run-console__live-badge",children:"LIVE"}),c.jsx("button",{type:"button",className:"af-icon-btn af-run-console__close",onClick:()=>Ft(!1),"aria-label":e("flow:run.closeLog"),children:c.jsx("span",{className:"material-symbols-outlined",children:"expand_more"})})]})]}),c.jsxs("div",{className:"af-run-console__body",children:[G.map((b,j)=>c.jsxs("div",{className:"af-run-console__line"+(b.type==="error"?" af-run-console__line--error":"")+(b.type==="warn"?" af-run-console__line--warn":"")+(b.type==="node-start"?" af-run-console__line--start":"")+(b.type==="node-done"?" af-run-console__line--done":"")+(b.type==="node-failed"?" af-run-console__line--error":"")+(b.type==="done"?" af-run-console__line--done":""),children:[c.jsxs("span",{className:"af-run-console__ts",children:["[",b.ts?new Date(b.ts).toLocaleTimeString():"--:--:--","]"]}),c.jsx("span",{className:"af-run-console__text",children:b.text!=null?String(b.text):""})]},j)),c.jsx("div",{ref:fo})]})]})]}),he!=="edit"&&Pa&&a?c.jsx(m8,{instanceId:Pa,flowId:a.id,runId:ft,nodeStatus:((dw=It[Pa])==null?void 0:dw.status)??null,onClose:()=>Jo(null)}):null,J&&a&&he==="edit"?c.jsx("aside",{className:"af-pipeline-drawer"+(J==="node"?" af-pipeline-drawer--wide":"")+(J==="composer"?" af-pipeline-drawer--wide":""),"aria-label":J==="settings"?e("flow:settings.title"):J==="history"?e("flow:history.title"):J==="composer"?"AI Composer":e("flow:nodeProps.title"),children:J==="composer"?c.jsxs("div",{className:"af-composer-sidebar",children:[c.jsxs("div",{className:"af-pipeline-drawer-head",children:[c.jsx("h2",{className:"af-pipeline-drawer-title",children:"AI Composer"}),c.jsx("button",{type:"button",className:"af-pipeline-drawer-close af-icon-btn",onClick:Hp,"aria-label":e("flow:composer.closeSidebar"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),Bn.length>0&&c.jsxs("div",{className:"af-composer-session-tabs",children:[Bn.map(b=>c.jsxs("button",{type:"button",ref:j=>{j&&b.id===Kt&&j.scrollIntoView({block:"nearest",inline:"nearest"})},className:["af-composer-session-tab",b.id===Kt?"af-composer-session-tab--active":"",b.running?"af-composer-session-tab--running":""].filter(Boolean).join(" "),onClick:()=>Xx(b.id),title:b.label,children:[c.jsx("span",{className:"af-composer-session-label",children:b.label}),(Bn.length>1||b.running)&&c.jsx("span",{className:"af-composer-session-close",onClick:j=>{j.stopPropagation(),VP(b.id)},title:b.running?e("flow:composer.endConversation"):e("flow:composer.closeConversation"),children:c.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.75rem"},children:"close"})})]},b.id)),c.jsx("button",{type:"button",className:"af-composer-session-add",onClick:()=>Kx(),title:e("flow:composer.newConversation"),children:c.jsx("span",{className:"material-symbols-outlined",children:"add"})})]}),c.jsx("div",{className:"af-composer-sidebar-status"+(vt?" af-composer-sidebar-status--running":""),role:"status","aria-live":"polite",children:vt&&!za?e("flow:composer.executing"):za||e("flow:composer.ready")}),Ae&&Array.isArray(Ae.phases)&&Ae.phases.length>1?c.jsx("div",{className:"af-composer-phase-bar","aria-label":e("flow:composer.phaseProgress"),children:Ae.phases.map((b,j)=>{const z=b.status||(j<(Ae.currentPhase??0)?"done":j===(Ae.currentPhase??0)?vt?"running":Ae.isLastPhase&&j===Ae.phases.length-1||Ae.nextPhase?"done":"running":"pending");return c.jsxs("div",{className:"af-composer-phase-item"+(z==="done"?" af-composer-phase-item--done":"")+(z==="running"?" af-composer-phase-item--running":"")+(z==="pending"?" af-composer-phase-item--pending":""),title:`${b.label}${b.description?":"+b.description:""}`,children:[c.jsx("span",{className:"af-composer-phase-dot","aria-hidden":!0,children:z==="done"?c.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"0.85rem"},children:"check"}):c.jsx("span",{children:j+1})}),c.jsx("span",{className:"af-composer-phase-label",children:b.label})]},b.name||j)})}):null,c.jsx("div",{className:"af-composer-sidebar-thread",ref:Wx,children:c.jsx(l1,{thread:Ha,liveSegments:Ba,running:vt})}),Ae&&!Ae.isLastPhase&&Ae.nextPhase&&!vt?c.jsxs("div",{className:"af-composer-phase-review af-composer-phase-review--minimal","aria-label":e("flow:composer.phaseReviewLabel"),children:[c.jsx("span",{className:"af-composer-phase-auto-hint",children:e("flow:composer.phaseReviewHint",{nextPhase:Ae.nextPhase.label})}),c.jsxs("div",{className:"af-composer-phase-review-buttons",children:[c.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--continue",onClick:lw,children:e("flow:composer.phaseReviewContinue",{label:Ae.nextPhase.label})}),c.jsx("button",{type:"button",className:"af-composer-phase-btn af-composer-phase-btn--skip",onClick:aw,children:e("flow:composer.phaseReviewSkip")})]})]}):null]}):J==="node"&&Pe?Oe?c.jsx(C4,{draft:Oe,setDraft:Ep,definitionId:String(((fw=Pe.data)==null?void 0:fw.definitionId)??Pe.id),systemPromptReadonly:String((Op==null?void 0:Op.description)??""),modelLists:_e,disabled:!a,onIdBlur:f_,onClose:Hp,error:BP,ioSlots:{inputs:Array.isArray(Oe==null?void 0:Oe.inputs)?Oe.inputs:[],outputs:Array.isArray(Oe==null?void 0:Oe.outputs)?Oe.outputs:[]}}):c.jsx("div",{className:"af-pipeline-drawer-body",children:c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:pipeline.loadingProps")})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"af-pipeline-drawer-head",children:[c.jsx("h2",{className:"af-pipeline-drawer-title",children:e(J==="settings"?"flow:settings.title":"flow:history.title")}),c.jsx("button",{type:"button",className:"af-pipeline-drawer-close af-icon-btn",onClick:Hp,"aria-label":e("flow:composer.closeSidebar"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx("div",{className:"af-pipeline-drawer-body",children:J==="settings"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.pipelineId")}),(a.source==="user"||a.source==="workspace")&&!a.archived?c.jsxs("div",{className:"af-pipeline-rename-row",children:[c.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:E,onChange:b=>{S(b.target.value),B("")},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),nw())},onBlur:()=>{E.trim()&&E.trim()!==a.id&&nw()},placeholder:a.id,disabled:P,spellCheck:!1}),c.jsx("span",{className:"af-pipeline-drawer-badge",children:Xh(a.source??"user",e)})]}):c.jsxs("div",{className:"af-pipeline-drawer-readonly",children:[a.id,c.jsx("span",{className:"af-pipeline-drawer-badge",children:Xh(a.source??"user",e)}),a.archived?c.jsx("span",{className:"af-pipeline-drawer-badge af-pipeline-drawer-badge--muted",children:e("flow:settings.archived")}):null]}),M?c.jsx("p",{className:"af-err af-pipeline-drawer-err",children:M}):null]}),typeof a.path=="string"&&a.path?c.jsxs("div",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.diskPath")}),c.jsxs("div",{className:"af-pipeline-drawer-readonly af-pipeline-drawer-readonly--mono af-pipeline-path-row",children:[c.jsx("span",{className:"af-pipeline-path-text",children:a.path}),c.jsx("button",{type:"button",className:"af-icon-btn af-pipeline-copy-btn",onClick:()=>u_(a.path),title:e("flow:settings.copyPath"),children:c.jsx("span",{className:"material-symbols-outlined",children:A?"check":"content_copy"})})]})]}):null,a.source==="user"||a.source==="workspace"?a.archived?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.archivedNote")}):c.jsxs("div",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.storageLocation")}),c.jsx("div",{className:"af-pipeline-move-actions",children:a.source==="user"?c.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>tw("workspace"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToWorkspace")}):c.jsx("button",{type:"button",className:"af-btn-secondary",disabled:y,onClick:()=>tw("user"),children:e(y?"flow:settings.moveBusy":"flow:settings.moveToUserDir")})}),g?c.jsx("p",{className:"af-err af-pipeline-drawer-err",children:g}):null]}):c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:settings.builtinNote")}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:pipeline.introduction")}),c.jsx("textarea",{className:"af-pipeline-drawer-textarea",value:d,onChange:b=>p(b.target.value),placeholder:e("flow:pipeline.introductionPlaceholder"),rows:5,spellCheck:!1})]}),c.jsxs("div",{className:"af-pipeline-meta-card",children:[c.jsx("h3",{className:"af-pipeline-meta-title",children:e("flow:schedule.title")}),wp?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"af-new-pipeline-radio",children:[c.jsx("input",{type:"checkbox",checked:!!$n.enabled,disabled:wi||a.archived||a.source==="builtin",onChange:b=>Sr(j=>({...j,enabled:b.target.checked}))}),c.jsx("span",{children:e("flow:schedule.enabled")})]}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.cron")}),c.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:$n.cron||"",disabled:wi||a.archived||a.source==="builtin",onChange:b=>Sr(j=>({...j,cron:b.target.value})),placeholder:"0 9 * * *",spellCheck:!1})]}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.timezone")}),c.jsx("input",{type:"text",className:"af-pipeline-rename-input",value:$n.timezone||"",disabled:wi||a.archived||a.source==="builtin",onChange:b=>Sr(j=>({...j,timezone:b.target.value})),placeholder:"Asia/Shanghai",spellCheck:!1})]}),c.jsxs("label",{className:"af-pipeline-drawer-field",children:[c.jsx("span",{className:"af-pipeline-drawer-label",children:e("flow:schedule.preset")}),c.jsxs("select",{className:"af-pipeline-flow-select",value:$n.preset||"",disabled:wi||a.archived||a.source==="builtin",onChange:b=>Sr(j=>({...j,preset:b.target.value})),children:[c.jsx("option",{value:"",children:e("flow:schedule.defaultPreset")}),Object.keys(xi).map(b=>c.jsx("option",{value:b,children:b},b))]})]}),c.jsx("div",{className:"af-pipeline-drawer-readonly",children:c.jsx("span",{children:e("flow:schedule.overlapSkip")})}),$n.nextRunAt?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.nextRun",{time:new Date($n.nextRunAt).toLocaleString()})}):c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.noNextRun")}),c.jsxs("dl",{className:"af-pipeline-meta-dl",children:[c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.runtime")}),c.jsx("dd",{children:Zn!=null&&Zn.running?e("flow:schedule.running"):$n.enabled?e("flow:schedule.waiting"):e("flow:schedule.disabled")})]}),Wt.lastTriggeredAt?c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.lastTriggeredAt")}),c.jsx("dd",{children:new Date(Wt.lastTriggeredAt).toLocaleString()})]}):null,Wt.lastSkippedAt?c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.lastSkippedAt")}),c.jsxs("dd",{children:[new Date(Wt.lastSkippedAt).toLocaleString(),Wt.lastSkipReason?` · ${Wt.lastSkipReason}`:""]})]}):null,Wt.lastRunUuid?c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.lastRun")}),c.jsx("dd",{children:Wt.lastRunUuid})]}):null,Wt.lastExitCode!=null?c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.lastExit")}),c.jsx("dd",{children:String(Wt.lastExitCode)})]}):null,Wt.lastFinishedAt?c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:schedule.lastFinishedAt")}),c.jsx("dd",{children:new Date(Wt.lastFinishedAt).toLocaleString()})]}):null]}),Zn!=null&&Zn.lastError||Wt.lastError?c.jsx("p",{className:"af-err af-pipeline-drawer-err",children:(Zn==null?void 0:Zn.lastError)||Wt.lastError}):null,a.archived||a.source==="builtin"?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:schedule.readonlyNote")}):null,Zc?c.jsx("p",{className:"af-err af-pipeline-drawer-err",children:Zc}):null,eu?c.jsx("p",{className:"af-pipeline-drawer-muted",children:eu}):null,c.jsx("button",{type:"button",className:"af-btn-secondary",disabled:wi||a.archived||a.source==="builtin",onClick:c_,children:e(wi?"flow:schedule.saving":"flow:schedule.save")})]})]}),c.jsxs("div",{className:"af-pipeline-meta-card",children:[c.jsx("h3",{className:"af-pipeline-meta-title",children:e("flow:pipeline.metadata")}),c.jsx("dl",{className:"af-pipeline-meta-dl",children:c.jsxs("div",{className:"af-pipeline-meta-row",children:[c.jsx("dt",{children:e("flow:pipeline.nodeCount")}),c.jsxs("dd",{children:[He.length," ",e("flow:pipeline.nodesUnit")]})]})})]}),c.jsx("button",{type:"button",className:"af-pipeline-drawer-link",onClick:()=>t("/settings"),children:e("flow:settings.globalSettings")})]}):c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"af-pipeline-drawer-lead",children:[e("flow:settings.currentPipeline"),c.jsx("strong",{children:a.id})]}),$e?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("common:common.loading")}):ge?c.jsx("p",{className:"af-err af-pipeline-drawer-err",children:ge}):qa.length===0?c.jsx("p",{className:"af-pipeline-drawer-muted",children:e("flow:pipeline.noRuns")}):c.jsxs(c.Fragment,{children:[nn.success+nn.failed+nn.running+nn.stopped+nn.interrupted>0?c.jsxs("div",{className:"af-exec-history-summary","aria-label":e("flow:history.summary"),children:[nn.success>0?c.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--success",children:e("flow:history.successCount",{count:nn.success})}):null,nn.failed>0?c.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--failed",children:e("flow:history.failedCount",{count:nn.failed})}):null,nn.stopped>0?c.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--stopped",children:e("flow:history.stoppedCount",{count:nn.stopped})}):null,nn.interrupted>0?c.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--interrupted",children:e("flow:history.interruptedCount",{count:nn.interrupted})}):null,nn.running>0?c.jsx("span",{className:"af-exec-history-pill af-exec-history-pill--running",children:e("flow:history.runningCount",{count:nn.running})}):null]}):null,c.jsx("ul",{className:"af-exec-history-list",children:qa.map((b,j)=>{const z=b.status||"unknown",W=z==="success"?"af-exec-history-card--success":z==="failed"?"af-exec-history-card--failed":z==="stopped"?"af-exec-history-card--stopped":z==="interrupted"?"af-exec-history-card--interrupted":z==="running"?"af-exec-history-card--running":"af-exec-history-card--unknown",K=e(z==="success"?"flow:history.success":z==="failed"?"flow:history.failed":z==="stopped"?"flow:history.stopped":z==="interrupted"?"flow:history.interrupted":z==="running"?"flow:history.running":"flow:history.unknown"),Y=z==="success"?"check_circle":z==="failed"?"error":z==="stopped"?"stop_circle":z==="interrupted"?"sync_disabled":z==="running"?"progress_activity":"help",Z=b.runId||`${b.at}-${j}`,te=b.runId!=null&&b.runId.length>=6?e("flow:history.runLabel",{id:b.runId.length>8?b.runId.slice(-8):b.runId}):e("flow:history.runLabel",{id:qa.length-j});return c.jsx("li",{className:"af-exec-history-list-item",children:c.jsxs("button",{type:"button",className:`af-exec-history-card ${W}`,onClick:()=>S_(b),title:e("flow:history.enterRunView"),children:[c.jsxs("div",{className:"af-exec-history-card-top",children:[c.jsx("span",{className:"af-exec-history-card-title",children:te}),c.jsx("span",{className:"af-exec-history-card-time",children:ng(b.at,e)})]}),c.jsxs("div",{className:"af-exec-history-card-bottom",children:[c.jsxs("span",{className:"af-exec-history-card-status",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:Y}),K]}),c.jsxs("span",{className:"af-exec-history-card-duration",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"timer"}),jA(b.durationMs,e)]})]})]})},`${a.id}-${Z}`)})})]})]})})]})}):null]}),c.jsx(Zv,{open:g_,title:e("flow:run.pauseTitle",{defaultValue:"暂停运行"}),message:e("flow:run.pauseConfirm"),confirmLabel:e("flow:run.pauseConfirmOk",{defaultValue:"暂停"}),onConfirm:x_,onCancel:()=>$p(!1)}),c.jsx(Zv,{open:w_,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:v_,onCancel:()=>bu(!1)}),c.jsx(u4,{open:ou,onClose:()=>Fa(!1)}),c.jsx(f4,{open:kp,onClose:()=>zx(!1),onJump:o_,nodes:He}),c.jsx(C8,{open:Vc,onClose:()=>Wc(!1),flowId:(a==null?void 0:a.id)??""}),c.jsx(a4,{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 gu(),t("/projects?tab=archived")}}),c.jsx(l4,{open:H&&!!(a!=null&&a.id),onClose:()=>D(!1),flowId:(a==null?void 0:a.id)??"",flowSource:(a==null?void 0:a.source)??"user",flowArchived:!!(a!=null&&a.archived),onDeleted:async()=>{D(!1),l(null),Ue([]),Tt([]),Va(null),await gu(),t("/projects")}}),c.jsx(p4,{open:!!$,onClose:()=>_(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:()=>{Dt(b=>({...b}))}})]}),At&&he!=="edit"&&qi.createPortal(c.jsx("div",{className:"af-user-check-modal-overlay",children:c.jsxs("div",{className:"af-user-check-modal",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"af-user-check-modal__head",children:[c.jsxs("span",{className:"af-user-check-modal__title",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"fact_check"}),e("flow:userCheck.title",{instanceId:At.instanceId})]}),c.jsx("div",{className:"af-user-check-modal__actions",children:tu?c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--save",onClick:async()=>{if(!At||!a||!ft)return;const b=ho||At.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:ft,instanceId:At.instanceId,content:b})})).ok?(ns(z=>z&&{...z,content:b}),mo(!1),Q(z=>[...z,{ts:new Date().toISOString(),type:"info",text:e("flow:userCheck.contentSaved")}])):Q(z=>[...z,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}catch{Q(j=>[...j,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}},children:[c.jsx("span",{className:"material-symbols-outlined",children:"save"}),e("flow:userCheck.save")]}),c.jsxs("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>{rs(At.content),mo(!1)},children:[c.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:userCheck.cancel")]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>mo(!0),children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit"}),e("flow:userCheck.edit")]}),c.jsx("button",{type:"button",className:"af-user-check-modal__btn",onClick:()=>ns(null),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]})})]}),c.jsx("div",{className:"af-user-check-modal__body",children:tu?c.jsx("textarea",{ref:vp,className:"af-user-check-modal__textarea",value:ho||At.content,onChange:b=>rs(b.target.value)}):c.jsx("div",{className:"af-user-check-modal__preview",children:c.jsx("pre",{children:ho||At.content})})}),c.jsxs("div",{className:"af-user-check-modal__ai-bar",children:[c.jsx("input",{type:"text",className:"af-user-check-modal__ai-input",placeholder:e("flow:userCheck.aiEditPlaceholder"),value:qr,onChange:b=>is(b.target.value),disabled:os}),c.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--ai",disabled:os||!qr.trim(),onClick:()=>{!At||!a||!ft||!qr.trim()||(ss(!0),Q(b=>[...b,{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:ft,instanceId:At.instanceId,content:ho||At.content,prompt:qr})}).then(b=>b.json()).then(b=>{ss(!1),b.ok&&b.content?(rs(b.content),mo(!0),is(""),Q(j=>[...j,{ts:new Date().toISOString(),type:"info",text:e("flow:userCheck.aiEditDone")}])):Q(j=>[...j,{ts:new Date().toISOString(),type:"error",text:b.error||e("flow:userCheck.aiEditFailed")}])}).catch(()=>{ss(!1),Q(b=>[...b,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.aiEditFailed")}])}))},children:[os?c.jsx("span",{className:"material-symbols-outlined af-spin",children:"sync"}):c.jsx("span",{className:"material-symbols-outlined",children:"auto_fix_high"}),e("flow:userCheck.aiEditBtn")]})]}),c.jsxs("div",{className:"af-user-check-modal__foot",children:[c.jsx("span",{className:"af-user-check-modal__hint",children:e("flow:userCheck.hint")}),c.jsxs("button",{type:"button",className:"af-user-check-modal__btn af-user-check-modal__btn--continue",onClick:async()=>{if(!At||!a||!ft)return;const b=ho||At.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:ft,instanceId:At.instanceId,content:b})})).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:ft,instanceId:At.instanceId,execId:At.execId})}),ns(null),is(""),Pr({runUuid:ft})):Q(z=>[...z,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}catch{Q(j=>[...j,{ts:new Date().toISOString(),type:"error",text:e("flow:userCheck.saveFailed")}])}},children:[c.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:userCheck.continue")]})]})]})}),document.body),Nn&&he!=="edit"&&qi.createPortal(c.jsx("div",{className:"af-user-ask-modal-overlay",children:c.jsxs("div",{className:"af-user-ask-modal",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"af-user-ask-modal__head",children:[c.jsxs("span",{className:"af-user-ask-modal__title",children:[c.jsx("span",{className:"material-symbols-outlined","aria-hidden":!0,children:"help"}),e("flow:userAsk.title",{instanceId:Nn.instanceId})]}),c.jsx("div",{className:"af-user-ask-modal__actions",children:c.jsx("button",{type:"button",className:"af-user-ask-modal__btn",onClick:()=>Ra(null),"aria-label":e("flow:userAsk.close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})})]}),c.jsxs("div",{className:"af-user-ask-modal__body",children:[Nn.question.trim()?c.jsx("div",{className:"af-user-ask-modal__question",children:c.jsx("pre",{children:Nn.question})}):null,Nn.options.length===0?c.jsx("div",{className:"af-user-ask-modal__empty",children:e("flow:userAsk.noOptions")}):c.jsx("div",{className:"af-user-ask-modal__options",children:Nn.options.map(b=>c.jsxs("button",{type:"button",className:"af-user-ask-option",disabled:nu,onClick:async()=>{if(!(!Nn||!a||!ft)){bi(!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:ft,instanceId:Nn.instanceId,execId:Nn.execId,branch:b.name,selectedIndex:b.index,selectedLabel:b.label})})).ok?(Ra(null),bi(!1),Pr({runUuid:ft})):(bi(!1),Q(z=>[...z,{ts:new Date().toISOString(),type:"error",text:e("flow:userAsk.submitFailed")}]))}catch{bi(!1),Q(j=>[...j,{ts:new Date().toISOString(),type:"error",text:e("flow:userAsk.submitFailed")}])}}},children:[c.jsxs("span",{className:"af-user-ask-option__index",children:["[",b.index,"]"]}),c.jsx("span",{className:"af-user-ask-option__label",children:b.label})]},b.name))})]}),c.jsx("div",{className:"af-user-ask-modal__foot",children:c.jsx("span",{className:"af-user-ask-modal__hint",children:e(nu?"flow:userAsk.submitting":"flow:userAsk.hint")})})]})}),document.body),as&&he!=="edit"&&c.jsxs("div",{className:"af-tool-print-toast",role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"af-tool-print-toast__head",children:[c.jsx("span",{className:"material-symbols-outlined",children:"print"}),c.jsx("span",{className:"af-tool-print-toast__title",children:e("flow:toolPrint.title",{instanceId:as.instanceId})}),c.jsx("button",{type:"button",className:"af-tool-print-toast__close",onClick:()=>$x(null),"aria-label":e("common:close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsxs("div",{className:"af-tool-print-toast__body",children:[c.jsx("pre",{children:as.content.length>500?as.content.slice(0,500):as.content}),as.content.length>500&&c.jsx("span",{className:"af-tool-print-toast__more",children:e("flow:toolPrint.truncated")})]})]}),ls&&c.jsx("div",{className:"af-provide-edit-overlay",children:c.jsxs("div",{className:"af-provide-edit-modal",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"af-provide-edit-modal__head",children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit_document"}),c.jsx("span",{className:"af-provide-edit-modal__title",children:ls.label}),c.jsx("button",{type:"button",className:"af-provide-edit-modal__close",onClick:()=>ru(null),"aria-label":e("common:close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx("div",{className:"af-provide-edit-modal__body",children:c.jsx("textarea",{ref:bp,className:"af-provide-edit-modal__textarea",defaultValue:ls.content,autoFocus:!0})}),c.jsxs("div",{className:"af-provide-edit-modal__foot",children:[c.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn af-provide-edit-modal__btn--save",onClick:GP,children:[c.jsx("span",{className:"material-symbols-outlined",children:"save"}),e("flow:provideEdit.save")]}),c.jsxs("button",{type:"button",className:"af-provide-edit-modal__btn",onClick:()=>ru(null),children:[c.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:provideEdit.cancel")]})]})]})}),xp&&c.jsx("div",{className:"af-run-params-overlay",children:c.jsxs("div",{className:"af-run-params-modal",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"af-run-params-modal__head",children:[c.jsx("span",{className:"material-symbols-outlined",children:"edit_note"}),c.jsx("span",{className:"af-run-params-modal__title",children:e("flow:runParams.title")}),c.jsx("button",{type:"button",className:"af-run-params-modal__close",onClick:()=>Zo(!1),"aria-label":e("common:close"),children:c.jsx("span",{className:"material-symbols-outlined",children:"close"})})]}),c.jsx("div",{className:"af-run-params-modal__body",children:er.length===0?c.jsx("div",{className:"af-run-params-empty",children:e("flow:runParams.noParams")}):c.jsx("div",{className:"af-run-params-list",children:er.map(b=>{var Z,te;const j=cs[b.id];if(!j)return null;const W=(((Z=b.data)==null?void 0:Z.definitionId)||"").startsWith("provide_file"),K=((te=b.data)==null?void 0:te.label)||b.id,Y=Gc[j]??"";return c.jsxs("div",{className:"af-run-params-item",children:[c.jsxs("div",{className:"af-run-params-item__head",children:[c.jsx("span",{className:"af-run-params-item__icon material-symbols-outlined"+(W?" af-run-params-item__icon--file":""),children:W?"description":"text_fields"}),c.jsx("span",{className:"af-run-params-item__label",children:K}),c.jsx("span",{className:"af-run-params-item__slot",children:j})]}),c.jsx("input",{type:"text",className:"af-run-params-item__input",value:Y,onChange:se=>Xc(oe=>({...oe,[j]:se.target.value})),placeholder:e(W?"flow:runConfig.filePathPlaceholder":"flow:runConfig.stringValuePlaceholder")})]},b.id)})})}),c.jsxs("div",{className:"af-run-params-modal__foot",children:[c.jsxs("button",{type:"button",className:"af-run-params-modal__btn af-run-params-modal__btn--run",onClick:()=>{var j;const b={};for(const z of er){const W=cs[z.id];if(!W)continue;const K=((j=z.data)==null?void 0:j.definitionId)||"",Y=Gc[W]??"";K.startsWith("provide_file")?b[W]={type:"file",path:Y}:b[W]={type:"str",value:Y}}Zo(!1),yi(!1),Pr({cliInputsOverride:b})},children:[c.jsx("span",{className:"material-symbols-outlined",children:"play_arrow"}),e("flow:runParams.run")]}),c.jsxs("button",{type:"button",className:"af-run-params-modal__btn",onClick:()=>Zo(!1),children:[c.jsx("span",{className:"material-symbols-outlined",children:"close"}),e("flow:runParams.cancel")]})]})]})})]})})}const je=e=>typeof e=="string",fl=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},p1=e=>e==null?"":""+e,Q8=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},J8=/###/g,h1=e=>e&&e.indexOf("###")>-1?e.replace(J8,"."):e,m1=e=>!e||je(e),$l=(e,t,n)=>{const r=je(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(m1(e))return{};const o=h1(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return m1(e)?{}:{obj:e,k:h1(r[i])}},g1=(e,t,n)=>{const{obj:r,k:i}=$l(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=$l(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=$l(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},Z8=(e,t,n,r)=>{const{obj:i,k:o}=$l(e,t,Object);i[o]=i[o]||[],i[o].push(n)},bf=(e,t)=>{const{obj:n,k:r}=$l(e,t);if(n)return n[r]},e9=(e,t,n)=>{const r=bf(e,n);return r!==void 0?r:bf(t,n)},tP=(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]):tP(e[r],t[r],n):e[r]=t[r]);return e},ys=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var t9={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const n9=e=>je(e)?e.replace(/[&<>"'\/]/g,t=>t9[t]):e;class r9{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 i9=[" ",",","?","!",";"],o9=new r9(20),s9=(e,t,n)=>{t=t||"",n=n||"";const r=i9.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=o9.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},zg=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 l=o;l<r.length;++l)if(l!==o&&(a+=n),a+=r[l],s=i[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=s}return i},Sf=e=>e&&e.replace("_","-"),a9={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 kf{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||a9,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 kf(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new kf(this.logger,t)}}var Dr=new kf;class up{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,l]=s;for(let u=0;u<l;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[a,l]=s;for(let u=0;u<l;u++)a.apply(a,[t,...r])})}}class y1 extends up{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 l=bf(this.data,a);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),l||!s||!je(r)?l:zg(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),g1(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 l=bf(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?tP(l,r,o):l={...l,...r},g1(this.data,a,l),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 nP={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 x1={};class Nf extends up{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Q8(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Dr.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&&!s9(t,r,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.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),l=a[a.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const N=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${N}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${N}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let p=d&&d.res;const h=d&&d.usedKey||s,m=d&&d.exactUsedKey||s,v=Object.prototype.toString.apply(p),k=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!je(p)&&typeof p!="boolean"&&typeof p!="number";if(w&&p&&y&&k.indexOf(v)<0&&!(je(g)&&Array.isArray(p))){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,p,{...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(p),E=N?[]:{},S=N?m:h;for(const P in p)if(Object.prototype.hasOwnProperty.call(p,P)){const T=`${S}${o}${P}`;E[P]=this.translate(T,{...n,joinArrays:!1,ns:a}),E[P]===T&&(E[P]=p[P])}p=E}}else if(w&&je(g)&&Array.isArray(p))p=p.join(g),p&&(p=this.extendTranslation(p,t,n,r));else{let N=!1,E=!1;const S=n.count!==void 0&&!je(n.count),P=Nf.hasDefaultValue(n),T=S?this.pluralResolver.getSuffix(u,n.count,n):"",M=n.ordinal&&S?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",B=S&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),A=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${T}`]||n[`defaultValue${M}`]||n.defaultValue;!this.isValidLookup(p)&&P&&(N=!0,p=A),this.isValidLookup(p)||(E=!0,p=s);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:p,L=P&&A!==p&&this.options.updateMissing;if(E||N||L){if(this.logger.log(L?"updateKey":"missingKey",u,l,s,L?A:p),o){const _=this.resolve(s,{...n,keySeparator:!1});_&&_.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 H=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let _=0;_<D.length;_++)H.push(D[_]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const $=(_,I,C)=>{const F=P&&C!==p?C:V;this.options.missingKeyHandler?this.options.missingKeyHandler(_,l,I,F,L,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(_,l,I,F,L,n),this.emit("missingKey",_,l,I,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(_=>{const I=this.pluralResolver.getSuffixes(_,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(C=>{$([_],s+C,n[`defaultValue${C}`]||A)})}):$(H,s,A))}p=this.extendTranslation(p,t,n,d,r),E&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${s}`),(E||N)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,N?p:void 0):p=this.options.parseMissingKeyHandler(p))}return i?(d.res=p,d.usedParams=this.getUsedParamsDetails(n),d):p}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 f;if(u){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.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 p=t.match(this.interpolator.nestingRegexp),h=p&&p.length;f<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 p=arguments.length,h=new Array(p),m=0;m<p;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,l=je(a)?[a]:a;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=nP.handle(l,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(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),f=u.key;i=f;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const p=n.count!==void 0&&!je(n.count),h=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(je(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(k=>{this.isValidLookup(r)||(a=k,!x1[`${v[0]}-${k}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(x1[`${v[0]}-${k}`]=!0,this.logger.warn(`key "${i}" for languages "${v.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!!!")),v.forEach(g=>{if(this.isValidLookup(r))return;s=g;const w=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,f,g,k,n);else{let N;p&&(N=this.pluralResolver.getSuffix(g,n.count,n));const E=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(w.push(f+N),n.ordinal&&N.indexOf(S)===0&&w.push(f+N.replace(S,this.options.pluralSeparator)),h&&w.push(f+E)),m){const P=`${f}${this.options.contextSeparator}${n.context}`;w.push(P),p&&(w.push(P+N),n.ordinal&&N.indexOf(S)===0&&w.push(P+N.replace(S,this.options.pluralSeparator)),h&&w.push(P+E))}}let y;for(;y=w.pop();)this.isValidLookup(r)||(o=y,r=this.getResource(g,k,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 Qh=e=>e.charAt(0).toUpperCase()+e.slice(1);class w1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Dr.create("languageUtils")}getScriptPartFromCode(t){if(t=Sf(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=Sf(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]=Qh(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]=Qh(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Qh(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 l9=[{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}],c9={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 u9=["v1","v2","v3"],d9=["v4"],v1={zero:0,one:1,two:2,few:3,many:4,other:5},f9=()=>{const e={};return l9.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:c9[t.fc]}})}),e};class p9{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Dr.create("pluralResolver"),(!this.options.compatibilityJSON||d9.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=f9(),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=Sf(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 l=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(l,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)=>v1[i]-v1[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!u9.includes(this.options.compatibilityJSON)}}const b1=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=e9(e,t,n);return!o&&i&&je(n)&&(o=zg(e,n,r),o===void 0&&(o=zg(t,n,r))),o},Jh=e=>e.replace(/\$/g,"$$$$");class h9{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Dr.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:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:d,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:v,nestingOptionsSeparator:k,maxReplaces:g,alwaysFormat:w}=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?ys(o):s||"{{",this.suffix=a?ys(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?ys(p):h||ys("$t("),this.nestingSuffix=m?ys(m):v||ys(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=g||1e3,this.alwaysFormat=w!==void 0?w:!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 l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const g=b1(n,l,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),v=m.shift().trim(),k=m.join(this.formatSeparator).trim();return this.format(b1(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),k,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const f=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=>Jh(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?Jh(this.escape(h)):Jh(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 f=="function"){const k=f(t,o,i);s=je(k)?k:""}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=p1(s));const v=h.safeValue(s);if(t=t.replace(o[0],v),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=(l,u)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const d=l.split(new RegExp(`${f}[ ]*{`));let p=`{${d[1]}`;l=d[0],p=this.interpolate(p,s);const h=p.match(/'/g),m=p.match(/"/g);(h&&h.length%2===0&&!m||m.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${f}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];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 f=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=f.shift(),l=f,u=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&!je(o))return o;je(o)||(o=p1(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((f,d)=>this.format(f,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const m9=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,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=a.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},xs=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(Sf(r),i),t[s]=a),a(n)}};class g9{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Dr.create("formatter"),this.options=t,this.formats={number:xs((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:xs((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:xs((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:xs((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:xs((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()]=xs(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(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,l)=>{const{formatName:u,formatOptions:f}=m9(l);if(this.formats[u]){let d=a;try{const p=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=p.locale||p.lng||i.locale||i.lng||r;d=this.formats[u](a,h,{...f,...i,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const y9=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class x9 extends up{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=Dr.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={},l={};return t.forEach(u=>{let f=!0;n.forEach(d=>{const p=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,f=!1,s[p]===void 0&&(s[p]=!0),o[p]===void 0&&(o[p]=!0),l[d]===void 0&&(l[d]=!0)))}),f||(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(l)}}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(l=>{Z8(l.loaded,[o],s),y9(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const f=l.loaded[u];f.length&&f.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.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,f)=>{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&&f&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,f)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(f=>a(null,f)).catch(a):a(null,u)}catch(u){a(u)}return}return l(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 l={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(t,n,r,i,l):f=u(t,n,r,i),f&&typeof f.then=="function"?f.then(d=>a(null,d)).catch(a):a(null,f)}catch(f){a(f)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const S1=()=>({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}}),k1=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),id=()=>{},w9=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class wc extends up{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=k1(t),this.services={},this.logger=Dr,this.modules={external:[]},w9(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=S1();this.options={...i,...this.options,...k1(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=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?Dr.init(o(this.modules.logger),this.options):Dr.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=g9);const d=new w1(this.options);this.store=new y1(this.options.resources,this.options);const p=this.services;p.logger=Dr,p.resourceStore=this.store,p.languageUtils=d,p.pluralResolver=new p9(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=o(f),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new h9(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new x9(o(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(h){for(var m=arguments.length,v=new Array(m>1?m-1:0),k=1;k<m;k++)v[k-1]=arguments[k];t.emit(h,...v)}),this.modules.languageDetector&&(p.languageDetector=o(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=o(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Nf(this.services,this.options),this.translator.on("*",function(h){for(var m=arguments.length,v=new Array(m>1?m-1:0),k=1;k<m;k++)v[k-1]=arguments[k];t.emit(h,...v)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=id),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=function(){return t.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return t.store[f](...arguments),t}});const l=fl(),u=()=>{const f=(d,p)=>{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),l.resolve(p),r(d,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:id;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(l=>s(l)),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=fl();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=id),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"&&nP.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=fl();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,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(l,function(){return r.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=je(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);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,f=>{s(f,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 l;if(typeof a!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),d=2;d<u;d++)f[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([s,a].concat(f))}else l={...a};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const p=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(s)?h=s.map(m=>`${l.keyPrefix}${p}${m}`):h=l.keyPrefix?`${l.keyPrefix}${p}${s}`:s,i.t(h,l)};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,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];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=fl();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=fl();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 w1(S1());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 wc(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:id;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new wc(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 y1(this.store.data,i),o.services.resourceStore=o.store),o.translator=new Nf(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),f=1;f<l;f++)u[f-1]=arguments[f];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 Ut=wc.createInstance();Ut.createInstance=wc.createInstance;Ut.createInstance;Ut.dir;Ut.init;Ut.loadResources;Ut.reloadResources;Ut.use;Ut.changeLanguage;Ut.getFixedT;Ut.t;Ut.exists;Ut.setDefaultNamespace;Ut.hasLoadedNamespace;Ut.loadNamespaces;Ut.loadLanguages;function v9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vc(e){"@babel/helpers - typeof";return vc=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},vc(e)}function b9(e,t){if(vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function S9(e){var t=b9(e,"string");return vc(t)=="symbol"?t:t+""}function k9(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,S9(r.key),r)}}function N9(e,t,n){return t&&k9(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var rP=[],C9=rP.forEach,E9=rP.slice;function j9(e){return C9.call(E9.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var N1=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,P9=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(!N1.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(i.domain)}if(i.path){if(!N1.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 l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){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},C1={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=P9(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)}},_9={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=C1.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&C1.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},I9={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 l=o[s].substring(0,a);l===t.lookupQuerystring&&(n=o[s].substring(a+1))}}}return n}},pl=null,E1=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},A9={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&E1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&E1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},hl=null,j1=function(){if(hl!==null)return hl;try{hl=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{hl=!1}return hl},T9={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&j1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&j1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},R9={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}},L9={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}},O9={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}},M9={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]}},iP=!1;try{document.cookie,iP=!0}catch{}var oP=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];iP||oP.splice(1,1);function D9(){return{order:oP,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var sP=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v9(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return N9(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=j9(r,this.options||{},D9()),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(_9),this.addDetector(I9),this.addDetector(A9),this.addDetector(T9),this.addDetector(R9),this.addDetector(L9),this.addDetector(O9),this.addDetector(M9)}},{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)}))}}])}();sP.type="languageDetector";const F9={name:"AgentFlow",tagline:"AI Workflow Orchestration"},$9={projects:"Projects",flowEditor:"Flow Editor",settings:"Settings",back:"Back"},z9={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"},B9={success:"Success",failed:"Failed",pending:"Pending",running:"Running",skipped:"Skipped"},H9={agent:"Agent",control:"Control",tool:"Tool",start:"Start",end:"End"},U9={online:"Engine Online",offline:"Engine Offline",connecting:"Connecting…"},V9={hub:"AgentFlow Hub",docs:"Documentation",github:"GitHub Repository"},W9={app:F9,nav:$9,common:z9,status:B9,nodeTypes:H9,engine:U9,links:V9},K9="Flow Editor",Y9="Nodes",q9="Edges",G9="Properties",X9={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"},Q9={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"},J9={run:"Run Flow",stop:"Stop",resume:"Resume",validate:"Validate",export:"Export",import:"Import"},Z9={nodeList:"Node List",runHistory:"Run History",validation:"Validation Results"},eU={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"},tU={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"},rU={requirement:"Requirement Analysis",planning:"Technical Planning",code:"Code Execution",test:"Test Regression",normal:"Normal"},iU={phase:"Phase",allPhasesComplete:"All phases completed",currentPhaseComplete:"Current phase completed, waiting for confirmation..."},oU={node:"Node",text:"Text",file:"File",bool:"Boolean"},sU={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"},aU={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"},lU={title:"Jump to node",placeholder:"Type node ID or label…",empty:"No matching nodes",hintNavigate:"navigate",hintJump:"jump",hintClose:"close"},cU={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."},uU={mainNav:"Main Navigation"},dU={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'},fU={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}}"},pU={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"},hU={nodePalette:"Node Palette",noPipelineSelected:"No pipeline selected",moreRuns:"+{{count}} more",moreFlows:"+{{count}} more flows",runId:"Run ID: {{id}}"},mU={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}}"},gU={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"},yU={title:"Pipeline Settings",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"},xU={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"},wU={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"},vU={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"},bU={invalidPlaceholder:"Invalid placeholder: {{hint}}",empty:"(empty)",inputSubtitle:"Input · {{type}}",inputSubtitleNoType:"Input",outputSubtitle:"Output · {{type}}",outputSubtitleNoType:"Output",runtimeConst:"Runtime constant"},SU={justNow:"Just now",minutesAgo:"{{n}} min ago",hoursAgo:"{{n}} hr ago",yesterday:"Yesterday",daysAgo:"{{n}} days ago",milliseconds:"{{n}} ms",seconds:"{{n}} s"},kU={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"},NU={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."},CU={title:"Print Output: {{instanceId}}",truncated:"...content truncated"},EU={save:"Save",cancel:"Cancel"},jU={title:"Run with Params",noParams:"No input params in this flow",run:"Run",cancel:"Cancel"},PU={title:"Run with Preset",noPresets:"No presets available",default:"Default run",run:"Run",cancel:"Cancel"},_U={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"},IU={title:K9,nodes:Y9,edges:q9,properties:G9,node:X9,nodeProps:Q9,actions:J9,panel:Z9,palette:eU,pipeline:tU,status:nU,roles:rU,phases:iU,types:oU,runContext:sU,shortcuts:aU,jumpPalette:lU,emptyCanvas:cU,sidebar:uU,validation:dU,composer:fU,topbar:pU,palette2:hU,run:mU,fileEdit:gU,settings:yU,schedule:xU,history:wU,nodePropsError:vU,placeholder:bU,time:SU,userCheck:kU,userAsk:NU,toolPrint:CU,provideEdit:EU,runParams:jU,runPreset:PU,runConfig:_U},AU="Settings",TU={engine:"Engine Settings",preferences:"Global Preferences"},RU={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)."},LU={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..."}},OU={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."},MU={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."},DU={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)"},FU={title:"System Status",normal:"Service normal",abnormal:"Some interfaces abnormal",cursorModels:"Cursor Models",opencodeModels:"OpenCode Models",claudeCodeModels:"Claude Code Models"},$U={title:"Shortcuts",projects:"Projects & Pipelines",flowEditor:"Node Canvas"},zU={title:"Language",description:"Select your preferred language for the interface",options:{zh:"中文",en:"English",ja:"日本語"}},BU={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."},HU={title:AU,crumb:TU,workspace:RU,cursor:LU,opencode:OU,claudeCode:MU,env:DU,system:FU,shortcuts:$U,language:zU,onboarding:BU},UU={thinking:"Thinking",result:"Result",reply:"Reply",error:"Error"},VU={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)"},WU={send:"Send",stop:"Stop",expand:"Expand",collapse:"Collapse",clear:"Clear"},KU={conversation:"Chat",conversationWithNumber:"Chat {{num}}",default:"Default"},YU={endSession:"End chat (will stop generation)",closeSession:"Close chat",newSession:"New chat",expandComposer:"Expand chat and output"},qU={hint:"Use the bottom input box for AI chat, with @node mentions, model selection, and more"},GU={aiLabels:UU,placeholders:VU,actions:WU,labels:KU,tooltips:YU,rightPanel:qU},XU="Projects",QU="All",JU="Archived",ZU="Active Projects",eV="Archived Pipelines",tV="Create New Project",nV="New Pipeline",rV="SEARCH PIPELINES...",iV="Loading pipelines...",oV="Filter result: {{count}} items (matching title, description, path and tags)",sV="Archived pipelines can still be opened and edited; files are located in the _archived subdirectory of each pipelines directory.",aV="Manage your distributed node architectures and monitoring pipelines. Drag flow.yaml or .zip into this page to import shared flows.",lV="No archived projects.",cV="No active pipelines; archived items are in the Archived tab.",uV="Failed to load pipeline list.",dV="No pipelines in current workspace.",fV="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.",pV='No pipelines found matching "{{query}}". Try different keywords or clear the search.',hV="Recent Activity",mV="No recent activity",gV="No recent activity matching the keyword",yV="Recent Run",xV="Recent Open",wV={builtin:"Built-in",workspace:"Workspace",user:"User"},vV="Open to edit this pipeline in the node canvas.",bV={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>"},SV={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"},kV={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"},NV={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"},CV={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"},EV={title:XU,all:QU,archived:JU,activeProjects:ZU,archivedPipelines:eV,createNew:tV,newPipeline:nV,searchPipelines:rV,loadingPipelines:iV,filterResult:oV,archivedHint:sV,activeHint:aV,noArchived:lV,noActive:cV,loadFailed:uV,noPipelines:dV,emptyHint:fV,noMatch:pV,recentActivity:hV,noRecentActivity:mV,noMatchRecent:gV,recentRun:yV,recentOpen:xV,sourceBadge:wV,defaultCardDesc:vV,hubCard:bV,newPipelineModal:SV,importModal:kV,deleteModal:NV,archiveModal:CV},jV="Back",PV="Next",_V="Skip",IV="Done",AV="Start Creating",TV={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.`},RV={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.`},LV={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"},OV={back:jV,next:PV,skip:_V,done:IV,startCreate:AV,projects:TV,flow:RV,newPipeline:LV},MV={name:"AgentFlow",tagline:"AI 工作流编排"},DV={projects:"项目",flowEditor:"流程编辑器",settings:"设置",back:"返回"},FV={loading:"加载中…",saving:"保存中…",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",create:"创建",close:"关闭",confirm:"确认",copy:"复制",copied:"已复制!",refresh:"刷新",search:"搜索",filter:"筛选",success:"成功",error:"错误",warning:"警告",info:"信息",done:"完成",pending:"待处理",running:"运行中",notFound:"未找到",required:"必填",optional:"可选"},$V={success:"成功",failed:"失败",pending:"等待",running:"运行中",skipped:"跳过"},zV={agent:"Agent 节点",control:"控制节点",tool:"工具节点",start:"开始",end:"结束"},BV={online:"引擎在线",offline:"引擎离线",connecting:"连接中…"},HV={hub:"AgentFlow Hub",docs:"文档",github:"GitHub 仓库"},UV={app:MV,nav:DV,common:FV,status:$V,nodeTypes:zV,engine:BV,links:HV},VV="流程编辑器",WV="节点",KV="连线",YV="属性",qV={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:"编辑内容"},GV={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:"占位符:输入输出槽位"},XV={run:"运行流程",stop:"停止",resume:"继续",validate:"校验",export:"导出",import:"导入"},QV={nodeList:"节点列表",runHistory:"运行历史",validation:"校验结果"},JV={workspace:"工作区",loading:"加载中…",archived:"已归档",noPipelines:"暂无流水线",more:"更多",moreFlows:"更多流程",noRuns:"暂无运行记录",searchNodes:"搜索节点",noComponents:"暂无可用组件(检查节点库目录)",noMatch:"无匹配节点,请调整搜索词",selectPipeline:"从上方选择一条流水线以加载组件与画布",validationWarnings:"校验警告(与 agentflow validate 槽位检查一致)",output:"输出",model:"模型",userDir:"用户目录",toggleRecentActivity:"展开或收起最近打开或最近运行"},ZV={selectPipeline:"请从顶部下拉选择一条流水线",loadingProps:"加载节点属性…",pipelineId:"流水线 ID",diskPath:"磁盘路径",storageLocation:"存储位置",introduction:"介绍",introductionPlaceholder:"简要描述这条流水线的用途(写入 flow.yaml 的 ui.description)",metadata:"元数据",nodeCount:"节点数",nodesUnit:"个节点",loading:"加载中…",noRuns:"暂无运行记录(终端执行后会在工作区生成运行目录)"},e7={saving:"保存中…",saved:"已保存",saveFailed:"保存失败",runInTerminal:"运行请使用终端"},t7={requirement:"需求拆解",planning:"技术规划",code:"代码执行",test:"测试回归",normal:"普通"},n7={phase:"阶段",allPhasesComplete:"所有阶段完成",currentPhaseComplete:"当前阶段完成,等待确认继续…"},r7={node:"节点",text:"文本",file:"文件",bool:"布尔"},i7={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:"等待"},o7={title:"快捷键",general:"常规",saveDesc:"保存;节点属性侧栏打开时先提交节点再保存 flow",shortcutsLabel:"快捷键",jumpToNode:"按 ID 跳转到节点",canvas:"画布",selectTool:"选择工具",panTool:"平移工具",holdSpacePan:"按住空格临时平移",selectAll:"全选所有节点"},s7={title:"跳转到节点",placeholder:"输入节点 ID 或名称…",empty:"未匹配到节点",hintNavigate:"切换",hintJump:"跳转",hintClose:"关闭"},a7={title:"开始构建你的流程",text:"在下方 AI 输入框中描述你的流程,或从左侧面板拖拽节点到画布",composerHint:"使用 AI Composer 构建 AgentFlow",composerSub:"从左侧拖入节点,或在<strong>下方输入框</strong>中用自然语言描述工作流。<br/>按 <kbd>?</kbd> 查看快捷键。"},l7={mainNav:"主导航"},c7={flowWarningAriaLabel:"流程校验警告",reloadFromServer:"从服务器重新加载流程并刷新校验",reloadFromServerShort:"从服务器重新加载",closeBanner:"关闭校验警告横幅",nodePrefix:"节点",focusNodeAriaLabel:"在画布中选中并定位节点 {{nodeId}}",slotWarningCount:"槽位校验 {{count}} 条(已隐藏)",show:"显示",shortcutHint:"按 ? 查看快捷键",shortcutHintLabel:"快捷键",inputSlotNoEdge:' 的 input 槽位 "{{slotName}}"({{handle}})无对应 edge 连接',outputSlotNoEdge:' 的 output 槽位 "{{slotName}}"({{handle}})无对应 edge 连接'},u7={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}}"},d7={currentPipeline:"当前流水线",backToEdit:"返回编辑",backToProjects:"返回项目",executionLog:"执行日志",history:"历史",pipelineSettings:"流水线设置",shortcutsLabel:"快捷键",shortcutsTitle:"快捷键 (?)",deletePipeline:"删除流水线",resumeTitle:"在同一 run 目录继续执行(uuid={{uuid}})",resumeTitleNoUuid:"尚未收到 apply-start,将发起新的 run",rerunTitle:"从头开始新的运行",runOptions:"运行选项",runWithParams:"带参数运行",runWithPreset:"指定预设运行",editRun:"编辑运行参数",startRun:"开始执行",stopRun:"停止后台运行"},f7={nodePalette:"节点调色板",noPipelineSelected:"未选择流水线",moreRuns:"+{{count}} 更多",moreFlows:"+{{count}} 更多流程",runId:"运行 ID: {{id}}"},p7={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}} 的分支"},h7={close:"关闭",loading:"加载中…",placeholder:"文件内容",largeFileWarning:"文件较大,编辑器性能可能受影响",reset:"重置",aiEdit:"AI 修改",aiRunning:"AI 处理中…",save:"保存",saving:"保存中…",saved:"已保存"},m7={title:"流水线设置",archived:"已归档",archivedNote:"此流水线位于归档目录(_archived),无法在用户目录与工作区之间移动。",builtinNote:"内置模板只读;首次保存将写入工作区 .workspace/agentflow/pipelines(流水线)、.workspace/agentflow/nodes(自定义节点)等;旧 .cursor/agentflow/ 下文件仍可读。",moveBusy:"移动中…",moveToWorkspace:"移动到工作区",moveToUserDir:"移动到用户目录",globalSettings:"全局设置",currentPipeline:"当前流水线:",builtin:"内置",rename:"重命名",renameBusy:"重命名中…",renameSuccess:"已重命名",copyPath:"复制路径",pathCopied:"已复制"},g7={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:"定时配置已保存"},y7={title:"执行历史",summary:"执行结果汇总",successCount:"{{count}} 成功",failedCount:"{{count}} 失败",stoppedCount:"{{count}} 已停止",interruptedCount:"{{count}} 已中断",runningCount:"{{count}} 进行中",success:"成功",failed:"失败",stopped:"已停止",interrupted:"已中断",running:"进行中",unknown:"未知",runLabel:"运行 #{{id}}",enterRunView:"进入该次运行的画布与日志态"},x7={invalidInstanceId:"实例 ID 格式无效:仅允许英文字母、数字、下划线、短横线,且不能以数字开头。",duplicateInstanceId:"该实例 ID 已存在,请换一个。",loadFlowFailed:"读取 flow 失败",loadNodesFailed:"读取节点库失败"},w7={invalidPlaceholder:"无效占位符: {{hint}}",empty:"(空)",inputSubtitle:"输入 · {{type}}",inputSubtitleNoType:"输入",outputSubtitle:"输出 · {{type}}",outputSubtitleNoType:"输出",runtimeConst:"运行时常量"},v7={justNow:"刚刚",minutesAgo:"{{n}} 分钟前",hoursAgo:"{{n}} 小时前",yesterday:"昨天",daysAgo:"{{n}} 天前",milliseconds:"{{n}} 毫秒",seconds:"{{n}} 秒"},b7={title:"用户确认 ({{instanceId}})",edit:"编辑",save:"保存",cancel:"取消",aiEditPlaceholder:"输入 AI 修改指令,如:删除第二项、合并前两项…",aiEditBtn:"AI 修改",aiEditStarted:"AI 正在修改内容…",aiEditDone:"AI 修改完成",aiEditFailed:"AI 修改失败",contentSaved:"内容已保存",saveFailed:"保存失败",close:"关闭",continue:"继续执行",hint:"编辑或使用 AI 修改后点击保存,然后点击「继续执行」恢复流程"},S7={title:"用户选择 ({{instanceId}})",hint:"请从下方选项中选择一项以继续流程",submitting:"提交中…",submitFailed:"提交失败",close:"关闭",noOptions:"该节点未配置选项,请先在编辑器中为 output 槽位添加条目。"},k7={title:"Print 输出: {{instanceId}}",truncated:"...内容已截断"},N7={save:"保存",cancel:"取消"},C7={title:"带参数运行",noParams:"此流程无输入参数",run:"运行",cancel:"取消"},E7={title:"指定预设运行",noPresets:"无可用预设",default:"默认运行",run:"运行",cancel:"取消"},j7={preset:"预设",default:"默认",newPreset:"新建预设",deletePreset:"删除预设",presetNamePlaceholder:"预设名称",inputParams:"输入参数",noProvideNodes:"此流程无 provide 节点",filePathPlaceholder:"文件路径…",stringValuePlaceholder:"值…",presetSaved:"预设已保存",presetDeleted:"预设已删除",savePreset:"保存当前预设",expandInput:"编辑内容"},P7={title:VV,nodes:WV,edges:KV,properties:YV,node:qV,nodeProps:GV,actions:XV,panel:QV,palette:JV,pipeline:ZV,status:e7,roles:t7,phases:n7,types:r7,runContext:i7,shortcuts:o7,jumpPalette:s7,emptyCanvas:a7,sidebar:l7,validation:c7,composer:u7,topbar:d7,palette2:f7,run:p7,fileEdit:h7,settings:m7,schedule:g7,history:y7,nodePropsError:x7,placeholder:w7,time:v7,userCheck:b7,userAsk:S7,toolPrint:k7,provideEdit:N7,runParams:C7,runPreset:E7,runConfig:j7},_7="设置",I7={engine:"引擎设置",preferences:"全局首选项"},A7={title:"工作区",currentPath:"当前工作区根目录",placeholder:"加载中…",copyPath:"复制路径",description:"流水线与节点清单将相对于此目录解析(由启动 UI 时传入)。"},T7={title:"Cursor CLI",status:{cached:"已缓存",notCached:"未缓存"},modelPreviewLabel:"Cursor 模型名称列表",modelList:{cached:"模型清单已缓存",empty:"暂无模型列表",count:"{{count}} 条",fetchedAt:"更新 {{time}}",never:"尚未拉取",refresh:"刷新清单",fetching:"拉取中…"}},R7={modelPreviewLabel:"OpenCode 模型名称列表",title:"OpenCode CLI",status:{ready:"就绪",notFound:"未找到"},provider:"方案 / Provider 标识",providerPlaceholder:"例如 bailian-coding-plan",saving:"正在保存并更新清单…",description:"对应 CLI opencode models <provider> 的参数;停止输入后会写入用户目录 config 并刷新 model-lists.json。"},L7={title:"Claude Code CLI",status:{ready:"就绪",notFound:"未找到"},modelPreviewLabel:"Claude Code 模型名称列表",description:"内置模型列表(Claude Code CLI 无 models 子命令);刷新将探测 claude 二进制是否在 PATH 中。首次使用请先执行 claude /login。"},O7={title:"环境变量",note:"仅本机、本浏览器",key:"键",value:"值",add:"添加",delete:"删除 {{key}}",newKey:"新环境变量键",newValue:"值(密钥请谨慎)"},M7={title:"系统状态",normal:"服务正常",abnormal:"部分接口异常",cursorModels:"Cursor 模型",opencodeModels:"OpenCode 模型",claudeCodeModels:"Claude Code 模型"},D7={title:"快捷入口",projects:"项目与流水线",flowEditor:"节点画布"},F7={title:"语言",description:"选择界面显示语言",options:{zh:"中文",en:"English",ja:"日本語"}},$7={title:"新手引导",description:"重新启动产品引导流程,了解 AgentFlow 的核心功能。",reset:"重置引导",resetSuccess:"已重置,下次访问将自动启动引导"},z7={title:_7,crumb:I7,workspace:A7,cursor:T7,opencode:R7,claudeCode:L7,env:O7,system:M7,shortcuts:D7,language:F7,onboarding:$7},B7={thinking:"思考",result:"结果",reply:"回复",error:"错误"},H7={input:"让 AI 协助编辑此节点…",waiting:"等待响应…",selectedEmpty:"在画布上选择节点,或在输入框用 @ 选择实例(Instances)或节点类型(Node)",textarea:"描述你的流程或让 AI 协助编辑(⌘/Ctrl+Enter 发送)"},U7={send:"发送",stop:"停止",expand:"展开",collapse:"收起",clear:"清空"},V7={conversation:"对话",conversationWithNumber:"对话 {{num}}",default:"默认"},W7={endSession:"结束对话(将停止生成)",closeSession:"关闭对话",newSession:"新建对话",expandComposer:"展开对话与输出"},K7={hint:"使用底部输入框进行 AI 对话,支持 @节点、选择模型等功能"},Y7={aiLabels:B7,placeholders:H7,actions:U7,labels:V7,tooltips:W7,rightPanel:K7},q7="项目",G7="全部",X7="已归档",Q7="活跃项目",J7="已归档流水线",Z7="创建新项目",eW="新建流水线",tW="搜索流水线…",nW="加载流水线列表…",rW="筛选结果:{{count}} 条(匹配标题、描述、路径与标签)",iW="已归档的流水线仍可打开与编辑;文件位于各 pipelines 目录下的 _archived。",oW="管理分布式节点架构与监控流水线。可将 flow.yaml 或 .zip 拖入本页导入分享流程。",sW="暂无归档项目。",aW="暂无未归档流水线;已归档项在 Archived 标签中查看。",lW="未能加载流水线列表。",cW="当前工作区暂无流水线。",uW="在仓库根目录执行 {{code1}} 并确认工作区包含 {{code2}} 或用户目录下的流水线;亦可点击 New Pipeline 新建。",dW="未找到与「{{query}}」匹配的流水线。可尝试其他关键词,或点击清除搜索。",fW="最近打开或最近运行",pW="暂无打开或运行记录",hW="暂无与关键词匹配的最近记录",mW="最近运行",gW="最近打开",yW={builtin:"内置",workspace:"工作区",user:"用户"},xW="打开以在节点画布中编辑此流水线。",wW={eyebrow:"AgentFlow Hub",title:"浏览社区流程",desc:"发现并一键安装社区分享的现成流水线。",cta:"前往 Hub",cliHint:"或通过 CLI 安装:agentflow download <slug>"},vW={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:"关闭"},bW={title:"导入流水线",lead:"已选择文件「{{filename}}」。请确认流水线名称与保存位置;ZIP 将保留目录内脚本等文件。",nameLabel:"名称(必填)",namePlaceholder:"例如 my_shared_flow",nameHint:"须以英文字母开头,仅可使用字母、数字、下划线 _ 与连字符 -",locationLabel:"保存位置",userDir:"用户目录(~/agentflow/pipelines)",workspaceDir:"当前工作区(.workspace/agentflow/pipelines)",changeFile:"更换文件…",importFailed:"导入失败",importing:"导入中…",importAndOpen:"导入并打开",cancel:"取消",close:"关闭"},SW={title:"删除流水线",lead:"将永久删除磁盘上的流水线目录(含 flow.yaml、脚本等),无法撤销。请在下方输入流水线 ID「{{flowId}}」以确认。",confirmLabel:"确认流水线名称",deleteFailed:"删除失败",deleteTimeout:"删除请求超时,请重试(可先检查终端中的 UI 服务日志)",delete:"删除",deleting:"删除中…",confirmDelete:"确认删除",cancel:"取消",close:"关闭"},kW={title:"归档流水线",lead:"归档后流水线将移入「Archived」列表,仍可从该列表打开与编辑。请在下方输入流水线 ID「{{flowId}}」以确认。",confirmLabel:"确认流水线名称",archiveFailed:"归档失败",archive:"归档",archiving:"归档中…",confirmArchive:"确认归档",cancel:"取消",close:"关闭"},NW={title:q7,all:G7,archived:X7,activeProjects:Q7,archivedPipelines:J7,createNew:Z7,newPipeline:eW,searchPipelines:tW,loadingPipelines:nW,filterResult:rW,archivedHint:iW,activeHint:oW,noArchived:sW,noActive:aW,loadFailed:lW,noPipelines:cW,emptyHint:uW,noMatch:dW,recentActivity:fW,noRecentActivity:pW,noMatchRecent:hW,recentRun:mW,recentOpen:gW,sourceBadge:yW,defaultCardDesc:xW,hubCard:wW,newPipelineModal:vW,importModal:bW,deleteModal:SW,archiveModal:kW},CW="返回",EW="下一步",jW="跳过",PW="完成",_W="开始创建",IW={intro:`欢迎使用 AgentFlow!这是一个可视化流程编排工具。
|
|
146
|
-
|
|
147
|
-
点击下方按钮开始创建你的第一个流水线。`,hubIntro:`不想从零开始?
|
|
148
|
-
|
|
149
|
-
在 AgentFlow Hub 浏览社区分享的现成流水线,一键安装即可运行。`},AW={intro:`现在进入流程编辑器。
|
|
150
|
-
|
|
151
|
-
在下方输入框用自然语言描述你的需求,AI 会自动生成流程图。
|
|
152
|
-
|
|
153
|
-
左侧节点面板可以自由拖拽、删除和调整连接。`,introEmpty:`画布为空,开始创建你的流程吧!
|
|
154
|
-
|
|
155
|
-
在下方输入框用自然语言描述需求,AI 会自动生成流程图。
|
|
156
|
-
|
|
157
|
-
左侧节点面板可以自由拖拽、删除和调整连接。`},TW={guideTitle:"首次创建提示",guideDesc:"输入名称和描述后,AI 会自动生成流程图。你可以在编辑器中自由调整节点和连接。",nameHintGuide:"例如:MyFirstFlow(字母开头,支持数字和下划线)",descPlaceholderGuide:"例如:实现用户登录功能,包含注册、验证、授权",descHintGuide:"描述越详细,AI 生成的流程越准确",createGuide:"创建并开始编辑",typeNode:"节点引用类型",typeStr:"字符串类型",typeFile:"文件路径类型",typeBool:"布尔值类型"},RW={back:CW,next:EW,skip:jW,done:PW,startCreate:_W,projects:IW,flow:AW,newPipeline:TW},LW={en:{common:W9,flow:IU,settings:HU,composer:GU,project:EV,onboarding:OV},zh:{common:UV,flow:P7,settings:z7,composer:Y7,project:NW,onboarding:RW}};Ut.use(sP).use(mA).init({resources:LW,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 OW=[{code:"zh",name:"中文",flag:"🇨🇳"},{code:"en",name:"English",flag:"🇬🇧"}];function MW(e){return Ut.changeLanguage(e)}const aP="agentflow-settings-env-v1",Bg="agentflow-settings-opencode-plan-v1";function Zh(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 lP(){return`e_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function DW(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()||lP();!r&&!i||t.push({id:o,key:r,value:i})}return t}function FW(){try{const e=localStorage.getItem(aP);return e?DW(JSON.parse(e)):[]}catch{return[]}}function P1(){try{return localStorage.getItem(Bg)??""}catch{return""}}function $W(e){return e?e.length<=6?"•".repeat(e.length):`${"•".repeat(Math.min(20,e.length-4))}${e.slice(-4)}`:""}function zW(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 BW(){const{t:e,i18n:t}=rt(["common","settings"]),n=t.language||"zh",[r,i]=x.useState(""),[o,s]=x.useState(""),[a,l]=x.useState({cursor:[],opencode:[],claudeCode:[],cursorFetchedAt:null,opencodeFetchedAt:null,claudeCodeFetchedAt:null}),[u,f]=x.useState(""),[d,p]=x.useState(!1),[h,m]=x.useState(!1),[v,k]=x.useState(""),[g,w]=x.useState(()=>FW()),[y,N]=x.useState(""),[E,S]=x.useState(""),[P,T]=x.useState(""),M=x.useRef(null),B=x.useRef(!1),A=x.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("")}},[]),R=x.useCallback(async()=>{f(""),p(!0);try{const U=await fetch("/api/model-lists");if(!U.ok)throw new Error("HTTP "+U.status);const O=await U.json();l(Zh(O))}catch(U){f(String(U.message||U))}finally{p(!1)}},[]),V=x.useCallback(async()=>{f(""),p(!0);try{const U=await fetch("/api/update-model-lists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({opencodeProvider:P.trim()})}),O=await U.json().catch(()=>({}));if(!U.ok)throw new Error(typeof O.error=="string"?O.error:"HTTP "+U.status);l(Zh(O.modelLists))}catch(U){f(String(U.message||U))}finally{p(!1)}},[P]);x.useEffect(()=>{A(),R(),(async()=>{try{const U=await fetch("/api/agentflow-config");if(U.ok){const O=await U.json(),q=typeof O.opencodeProvider=="string"?O.opencodeProvider:"";T(q),M.current=q;try{localStorage.setItem(Bg,q)}catch{}}else{const O=P1();T(O),M.current=O}}catch{const U=P1();T(U),M.current=U}finally{B.current=!0}})()},[A,R]),x.useEffect(()=>{try{localStorage.setItem(aP,JSON.stringify(g))}catch{}},[g]),x.useEffect(()=>{if(!B.current)return;const U=P.trim();if(U===M.current)return;const O=setTimeout(()=>{(async()=>{m(!0),k("");try{const q=await fetch("/api/agentflow-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({opencodeProvider:U})}),ee=await q.json().catch(()=>({}));if(!q.ok)throw new Error(typeof ee.error=="string"?ee.error:"HTTP "+q.status);M.current=U;try{localStorage.setItem(Bg,U)}catch{}ee.modelLists&&l(Zh(ee.modelLists))}catch(q){k(String(q.message||q))}finally{m(!1)}})()},450);return()=>clearTimeout(O)},[P]);const L=a.cursor.length>0,H=a.opencode.length>0,D=a.claudeCode.length>0,$=x.useCallback(()=>{var U;r&&((U=navigator.clipboard)==null||U.writeText(r))},[r]),_=x.useCallback(()=>{const U=y.trim(),O=E;U&&(w(q=>[...q,{id:lP(),key:U,value:O}]),N(""),S(""))},[y,E]),I=x.useCallback(U=>{w(O=>O.filter(q=>q.id!==U))},[]),C=x.useCallback(U=>{const O=U.target.value;MW(O)},[]),F=U=>{const O=zW(U,n);return O?e("settings:cursor.modelList.fetchedAt",{time:O}):e("settings:cursor.modelList.never")};return c.jsxs("div",{className:"af-settings-page",children:[c.jsx("header",{className:"af-settings-top",children:c.jsxs("div",{className:"af-settings-crumb","aria-label":e("settings:title"),children:[c.jsx("span",{className:"af-settings-crumb-muted",children:e("settings:crumb.engine")}),c.jsx("span",{className:"af-settings-crumb-sep","aria-hidden":!0,children:"/"}),c.jsx("span",{className:"af-settings-crumb-active",children:e("settings:crumb.preferences")})]})}),c.jsx("div",{className:"af-settings-body",children:c.jsxs("div",{className:"af-settings-inner",children:[c.jsxs("header",{className:"af-settings-hero",children:[c.jsxs("h1",{className:"af-settings-h1",children:[e("common:app.name")," ",e("settings:title")]}),c.jsx("p",{className:"af-settings-lead",children:e("settings:workspace.description")}),o?c.jsx("p",{className:"af-err af-settings-api-hint",children:o}):null,u?c.jsx("p",{className:"af-err af-settings-api-hint",children:u}):null]}),c.jsxs("div",{className:"af-settings-layout",children:[c.jsxs("div",{className:"af-settings-bento",children:[c.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--low af-set-workspace",children:[c.jsxs("div",{className:"af-set-card-inner",children:[c.jsxs("div",{className:"af-set-card-head",children:[c.jsx("span",{className:"material-symbols-outlined af-set-icon af-set-icon--secondary",children:"folder_managed"}),c.jsx("h2",{className:"af-set-h2",children:e("settings:workspace.title")})]}),c.jsx("label",{className:"af-set-label",htmlFor:"af-workspace-path",children:e("settings:workspace.currentPath")}),c.jsxs("div",{className:"af-set-input-wrap",children:[c.jsx("input",{id:"af-workspace-path",className:"af-set-input af-set-input--mono",type:"text",readOnly:!0,value:r,placeholder:e("common:loading")}),c.jsx("button",{type:"button",className:"af-set-input-suffix",onClick:$,"aria-label":e("settings:workspace.copyPath"),disabled:!r,children:c.jsx("span",{className:"material-symbols-outlined",children:"content_copy"})})]}),c.jsx("p",{className:"af-set-hint",children:e("settings:workspace.description")})]}),c.jsx("div",{className:"af-set-watermark","aria-hidden":!0,children:c.jsx("span",{className:"material-symbols-outlined",children:"account_tree"})})]}),c.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[c.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[c.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:"Cursor CLI"}),c.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")})]}),c.jsxs("div",{className:"af-set-cli-block",children:[c.jsx("div",{className:"af-set-cli-icon",children:c.jsx("span",{className:"material-symbols-outlined af-set-icon--tertiary",children:L?"check_circle":"hourglass_empty"})}),c.jsxs("div",{children:[c.jsx("p",{className:"af-set-cli-title",children:e(L?"settings:cursor.modelList.cached":"settings:cursor.modelList.empty")}),c.jsx("p",{className:"af-set-cli-mono",children:L?e("settings:cursor.modelList.count",{count:a.cursor.length})+" · "+F(a.cursorFetchedAt):e("settings:cursor.modelList.refresh")})]})]}),L?c.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:cursor.modelPreviewLabel"),children:a.cursor.join(`
|
|
158
|
-
`)}):null,c.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),c.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[c.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[c.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:"OpenCode"}),c.jsx("span",{className:"af-set-badge"+(H?" af-set-badge--ok":" af-set-badge--err"),children:e(H?"settings:opencode.status.ready":"settings:opencode.status.notFound")})]}),c.jsx("p",{className:"af-set-p",children:e("settings:opencode.description")}),c.jsxs("div",{children:[c.jsx("label",{className:"af-set-label-sm",htmlFor:"af-opencode-plan",children:e("settings:opencode.provider")}),c.jsx("input",{id:"af-opencode-plan",className:"af-set-input af-set-input--sm af-set-input--mono",type:"text",value:P,onChange:U=>T(U.target.value),placeholder:e("settings:opencode.providerPlaceholder"),autoComplete:"off"}),h?c.jsx("p",{className:"af-set-hint af-set-hint--inline","aria-live":"polite",children:e("settings:opencode.saving")}):null,v?c.jsx("p",{className:"af-err af-set-hint af-set-hint--inline",role:"alert",children:v}):null]}),H?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"af-set-cli-mono af-set-cli-mono--block",children:e("settings:cursor.modelList.count",{count:a.opencode.length})+" · "+F(a.opencodeFetchedAt)}),c.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:opencode.modelPreviewLabel"),children:a.opencode.join(`
|
|
159
|
-
`)})]}):null,c.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),c.jsxs("section",{className:"af-set-card af-set-card--narrow af-set-card--high",children:[c.jsxs("div",{className:"af-set-card-head af-set-card-head--spread",children:[c.jsx("h2",{className:"af-set-h2 af-set-h2--caps",children:e("settings:claudeCode.title")}),c.jsx("span",{className:"af-set-badge"+(D?" af-set-badge--ok":" af-set-badge--err"),children:e(D?"settings:claudeCode.status.ready":"settings:claudeCode.status.notFound")})]}),c.jsxs("div",{className:"af-set-cli-block",children:[c.jsx("div",{className:"af-set-cli-icon",children:c.jsx("span",{className:"material-symbols-outlined af-set-icon--tertiary",children:D?"check_circle":"hourglass_empty"})}),c.jsxs("div",{children:[c.jsx("p",{className:"af-set-cli-title",children:e(D?"settings:cursor.modelList.cached":"settings:cursor.modelList.empty")}),c.jsx("p",{className:"af-set-cli-mono",children:D?e("settings:cursor.modelList.count",{count:a.claudeCode.length})+" · "+F(a.claudeCodeFetchedAt):e("settings:cursor.modelList.refresh")})]})]}),c.jsx("p",{className:"af-set-p",children:e("settings:claudeCode.description")}),D?c.jsx("pre",{className:"af-set-model-preview","aria-label":e("settings:claudeCode.modelPreviewLabel"),children:a.claudeCode.join(`
|
|
160
|
-
`)}):null,c.jsx("button",{type:"button",className:"af-set-btn-outline",onClick:()=>V(),disabled:d,children:e(d?"settings:cursor.modelList.fetching":"settings:cursor.modelList.refresh")})]}),c.jsxs("section",{className:"af-set-card af-set-card--wide af-set-card--low af-set-env",children:[c.jsxs("div",{className:"af-set-env-head",children:[c.jsxs("div",{className:"af-set-card-head",children:[c.jsx("div",{className:"af-set-env-icon-wrap",children:c.jsx("span",{className:"material-symbols-outlined af-set-icon--primary",children:"variables"})}),c.jsx("h2",{className:"af-set-h2",children:e("settings:env.title")})]}),c.jsx("span",{className:"af-set-env-note",children:e("settings:env.note")})]}),c.jsxs("div",{className:"af-set-env-rows",children:[g.map(U=>c.jsxs("div",{className:"af-set-env-row",children:[c.jsxs("div",{className:"af-set-env-cell",children:[c.jsx("span",{className:"af-set-env-k",children:e("settings:env.key")}),c.jsx("code",{className:"af-set-code-key",children:U.key||"—"})]}),c.jsxs("div",{className:"af-set-env-cell af-set-env-cell--grow",children:[c.jsx("span",{className:"af-set-env-k",children:e("settings:env.value")}),c.jsx("code",{className:"af-set-code-val",children:$W(U.value)})]}),c.jsx("div",{className:"af-set-env-actions",children:c.jsx("button",{type:"button",className:"af-set-env-del","aria-label":e("settings:env.delete",{key:U.key}),onClick:()=>I(U.id),children:c.jsx("span",{className:"material-symbols-outlined",children:"delete_outline"})})})]},U.id)),c.jsxs("div",{className:"af-set-env-row af-set-env-row--draft",children:[c.jsx("div",{className:"af-set-env-cell",children:c.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")})}),c.jsx("div",{className:"af-set-env-cell af-set-env-cell--grow",children:c.jsx("input",{className:"af-set-input af-set-input--dashed af-set-input--mono",type:"password",placeholder:e("settings:env.newValue"),value:E,onChange:U=>S(U.target.value),"aria-label":e("settings:env.newValue")})}),c.jsx("div",{className:"af-set-env-actions",children:c.jsxs("button",{type:"button",className:"af-set-btn-add",onClick:_,disabled:!y.trim(),children:[c.jsx("span",{className:"material-symbols-outlined",children:"add"}),e("settings:env.add")]})})]})]})]})]}),c.jsxs("aside",{className:"af-settings-rail","aria-label":e("settings:title"),children:[c.jsxs("div",{className:"af-set-rail-card af-set-rail-card--accent",children:[c.jsxs("div",{className:"af-set-rail-inner",children:[c.jsx("h3",{className:"af-set-rail-h3",children:e("settings:system.title")}),c.jsxs("div",{className:"af-set-health-line",children:[c.jsx("span",{className:"af-set-pulse-dot","aria-hidden":!0}),c.jsx("span",{className:"af-set-health-label",children:e(!o&&!u?"settings:system.normal":"settings:system.abnormal")})]}),c.jsxs("div",{className:"af-set-meter",children:[c.jsxs("div",{className:"af-set-meter-row",children:[c.jsx("span",{children:e("settings:system.cursorModels")}),c.jsx("span",{children:a.cursor.length})]}),c.jsx("div",{className:"af-set-meter-bar",children:c.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.cursor.length>0?12+a.cursor.length*3:4)}%`}})})]}),c.jsxs("div",{className:"af-set-meter",children:[c.jsxs("div",{className:"af-set-meter-row",children:[c.jsx("span",{children:e("settings:system.opencodeModels")}),c.jsx("span",{children:a.opencode.length})]}),c.jsx("div",{className:"af-set-meter-bar",children:c.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.opencode.length>0?12+a.opencode.length*3:4)}%`}})})]}),c.jsxs("div",{className:"af-set-meter",children:[c.jsxs("div",{className:"af-set-meter-row",children:[c.jsx("span",{children:e("settings:system.claudeCodeModels")}),c.jsx("span",{children:a.claudeCode.length})]}),c.jsx("div",{className:"af-set-meter-bar",children:c.jsx("div",{className:"af-set-meter-fill",style:{width:`${Math.min(100,a.claudeCode.length>0?12+a.claudeCode.length*3:4)}%`}})})]})]}),c.jsx("div",{className:"af-set-rail-watermark","aria-hidden":!0,children:c.jsx("span",{className:"material-symbols-outlined",children:"vital_signs"})})]}),c.jsxs("div",{className:"af-set-rail-card",children:[c.jsx("h3",{className:"af-set-rail-h3 af-set-rail-h3--sm",children:e("settings:language.title")}),c.jsxs("div",{className:"af-set-language-selector",children:[c.jsx("select",{className:"af-set-input af-set-input--sm",value:n,onChange:C,"aria-label":e("settings:language.description"),children:OW.map(U=>c.jsxs("option",{value:U.code,children:[U.flag," ",U.name]},U.code))}),c.jsx("p",{className:"af-set-hint",children:e("settings:language.description")})]})]})]})]})]})})]})}function cP(e){return t=>typeof t===e}var HW=cP("function"),UW=e=>e===null,_1=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",I1=e=>!VW(e)&&!UW(e)&&(HW(e)||typeof e=="object"),VW=cP("undefined");function WW(e,t,n){return JW(n,e,t)?!0:(ZW(n,e,t),e.constructor!==t.constructor?!1:Array.isArray(e)&&Array.isArray(t)?KW(e,t,n):e instanceof Map&&t instanceof Map?GW(e,t,n):e instanceof Set&&t instanceof Set?QW(e,t):e instanceof WeakMap||e instanceof WeakSet?!1:ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)?YW(e,t):_1(e)&&_1(t)?e.source===t.source&&e.flags===t.flags:e instanceof Error&&t instanceof Error?qW(e,t,n):e.valueOf!==Object.prototype.valueOf?e.valueOf()===t.valueOf():e.toString!==Object.prototype.toString?e.toString()===t.toString():XW(e,t,n))}function $c(e,t,n){return e===t||Number.isNaN(e)&&Number.isNaN(t)?!0:!e||!I1(e)||!t||!I1(t)?!1:WW(e,t,n)}function KW(e,t,n){const{length:r}=e;if(r!==t.length)return!1;for(let i=r;i--!==0;)if(!$c(e[i],t[i],n))return!1;return!0}function YW(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 qW(e,t,n){return e.message===t.message&&e.name===t.name&&$c(e.cause,t.cause,n)}function GW(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(!$c(r[1],t.get(r[0]),n))return!1;return!0}function XW(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)&&!$c(e[o],t[o],n))return!1}return!0}function QW(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 JW(e,t,n){var r;return((r=e.get(t))==null?void 0:r.has(n))??!1}function ZW(e,t,n){let r=e.get(t);r||(r=new WeakSet,e.set(t,r)),r.add(n)}function jx(e,t){return $c(e,t,new WeakMap)}function em(){var e;return!!(typeof window<"u"&&((e=window==null?void 0:window.document)!=null&&e.createElement))}function eK(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)}function tK(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}function nK(){const e=x.useRef(!0);return e.current?(e.current=!1,!0):e.current}function rK(e,t){const n=nK();x.useEffect(()=>{if(!n)return e()},t)}function uP(e){const t=x.useRef(void 0);return x.useEffect(()=>{t.current=e}),t.current}function iK(e,t){const n=x.useRef(t);return jx(t,n.current)||(n.current=t),x.useMemo(e,n.current)}function oK(e){x.useEffect(()=>{e()},[])}function sK(e=0){const[t,n]=x.useState({height:em()?window.innerHeight:0,width:em()?window.innerWidth:0}),r=x.useRef(0),i=x.useRef(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n({width:window.innerWidth,height:window.innerHeight})},e)});return x.useEffect(()=>{if(!em())return()=>{};const o=i.current;return n({height:window.innerHeight,width:window.innerWidth}),tK(window,"resize",o),()=>{eK(window,"resize",o)}},[]),t}var aK=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","URL","WeakMap","WeakSet"],lK=["bigint","boolean","null","number","string","symbol","undefined"];function zc(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(cK(t))return t}function xr(e){return t=>zc(t)===e}function cK(e){return aK.includes(e)}function ba(e){return t=>typeof t===e}function uK(e){return lK.includes(e)}var dK=["innerHTML","ownerDocument","style","attributes","nodeValue"],Bc=e=>Array.isArray(e),fK=e=>zc(e)==="AsyncGeneratorFunction",pK=xr("AsyncFunction"),hK=ba("bigint"),mK=e=>e===!0||e===!1,gK=xr("Date"),yK=xr("Error"),to=ba("function"),xK=xr("GeneratorFunction"),wK=e=>typeof e=="number"&&Number.isInteger(e),Hg=xr("Map"),dP=e=>Number.isNaN(e),Px=e=>e===null,fP=xr("Function"),vK=xr("Promise"),bK=xr("RegExp"),Ug=xr("Set"),Hc=ba("string"),SK=ba("symbol"),_x=ba("undefined"),kK=xr("WeakMap"),NK=xr("WeakSet"),Ix=e=>Px(e)||_x(e),pP=e=>!_x(e),CK=e=>ba("number")(e)&&!dP(e),EK=e=>Hc(e)&&e.trim().length>0,jK=e=>{if(!Hc(e)||e.length===0)return!1;const t=e.trim();return t.length>0&&Number.isFinite(Number(t))},dp=e=>!Ix(e)&&(to(e)||typeof e=="object"),hP=e=>{if(zc(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})},PK=e=>Px(e)||uK(typeof e),_K=e=>zc(e)==="URL",mP=e=>!Ix(e)&&to(e[Symbol.iterator]),IK=e=>mP(e)&&to(e.next)&&to(e.throw),AK=e=>to(e)&&/^class\s/.test(e.toString()),TK=(e,t)=>!Bc(e)||!to(t)?!1:e.every(n=>t(n)),RK=e=>dp(e)&&!hP(e)&&e.nodeType===1&&Hc(e.nodeName)&&dK.every(t=>t in e),LK=e=>Hc(e)&&e.length===0||Bc(e)&&e.length===0||dp(e)&&!Hg(e)&&!Ug(e)&&Object.keys(e).length===0||Ug(e)&&e.size===0||Hg(e)&&e.size===0,OK=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype,MK=(e,t)=>Bc(e)?e.indexOf(t)>-1:!1,DK=(e,t,n)=>{if(!dp(e)||!t)return!1;const r=e[t];return to(n)?n(r):pP(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(Bc(e))return"Array";if(fP(e))return"Function";const t=zc(e);return t||"Object"}Re.array=Bc;Re.arrayOf=TK;Re.asyncGeneratorFunction=fK;Re.asyncFunction=pK;Re.bigint=hK;Re.boolean=mK;Re.class=AK;Re.date=gK;Re.defined=pP;Re.domElement=RK;Re.empty=LK;Re.error=yK;Re.function=to;Re.generator=IK;Re.generatorFunction=xK;Re.instanceOf=OK;Re.integer=wK;Re.iterable=mP;Re.map=Hg;Re.nan=dP;Re.null=Px;Re.nullOrUndefined=Ix;Re.nonEmptyString=EK;Re.number=CK;Re.numericString=jK;Re.object=dp;Re.oneOf=MK;Re.plainFunction=fP;Re.plainObject=hP;Re.primitive=PK;Re.promise=vK;Re.propertyOf=DK;Re.regexp=bK;Re.set=Ug;Re.string=Hc;Re.symbol=SK;Re.undefined=_x;Re.url=_K;Re.weakMap=kK;Re.weakSet=NK;var Qt=Re;/* v8 ignore next -- @preserve */var FK=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},$K=function(e,t){return e+bc(t)},bc=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($K,""):FK(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?bc(e.props.children):""};bc.default=bc;var zK=bc;const tm=ro(zK);var gP={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(E){return E!=="constructor"&&E!=="prototype"&&E!=="__proto__"}function s(E){let S=0;const P=E.length,T=new Array(P);for(S;S<P;++S)T[S]=g(E[S]);return T}function a(E){const S={};if(p&&Object.getPrototypeOf(E)!==t)return p(E);const P=d(E);let T,M,B;for(T=0,M=P.length;T<M;++T)o(B=P[T])&&(S[B]=g(E[B]));return S}function l(E,S){const P=E.length,T=S.length;let M=0;const B=new Array(P+T);for(M;M<P;++M)B[M]=g(E[M]);for(M=0;M<T;++M)B[M+P]=g(S[M]);return B}const u=Object.prototype.propertyIsEnumerable;function f(E){const S=Object.keys(E),P=Object.getOwnPropertySymbols(E);for(let T=0,M=P.length;T<M;++T)u.call(E,P[T])&&S.push(P[T]);return S}const d=i!=null&&i.symbols?f:Object.keys,p=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 v(E){return typeof E!="object"||E===null}const k=i&&typeof i.mergeArray=="function"?i.mergeArray({clone:g,deepmerge:y,getKeys:d,isMergeableObject:h}):l;function g(E){return h(E)?Array.isArray(E)?s(E):a(E):E}function w(E,S){const P={},T=d(E),M=d(S);let B,A,R;for(B=0,A=T.length;B<A;++B)o(R=T[B])&&M.indexOf(R)===-1&&(P[R]=g(E[R]));for(B=0,A=M.length;B<A;++B)if(o(R=M[B]))if(R in E)T.indexOf(R)!==-1&&(p&&h(S[R])&&Object.getPrototypeOf(S[R])!==t?P[R]=p(S[R]):P[R]=y(E[R],S[R]));else{if(m&&typeof S[R]>"u")continue;P[R]=g(S[R])}return P}function y(E,S){if(m&&typeof S>"u")return g(E);const P=Array.isArray(S),T=Array.isArray(E);return v(S)?S:h(E)?P&&T?k(E,S):P!==T?g(S):w(E,S):g(S)}function N(){switch(arguments.length){case 0:return{};case 1:return g(arguments[0]);case 2:return y(arguments[0],arguments[1])}let E;for(let S=0,P=arguments.length;S<P;++S)E=y(E,arguments[S]);return E}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})})(gP);var BK=gP.exports;const HK=ro(BK);var UK=new Error("Element already at target scroll position"),VK=new Error("Scroll cancelled"),WK=Math.min,A1=Date.now,KK={left:T1("scrollLeft"),top:T1("scrollTop")};function T1(e){return function(n,r,i,o){i=i||{},typeof i=="function"&&(o=i,i={}),typeof o!="function"&&(o=qK);var s=A1(),a=n[e],l=i.ease||YK,u=isNaN(i.duration)?350:+i.duration,f=!1;return a===r?o(UK,n[e]):requestAnimationFrame(p),d;function d(){f=!0}function p(h){if(f)return o(VK,n[e]);var m=A1(),v=WK(1,(m-s)/u),k=l(v);n[e]=k*(r-a)+a,v<1?requestAnimationFrame(p):requestAnimationFrame(function(){o(null,n[e])})}}}function YK(e){return .5*(1-Math.cos(Math.PI*e))}function qK(){}const GK=ro(KK);var yP={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(zl,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})})(yP);var XK=yP.exports;const xP=ro(XK),QK=["top","right","bottom","left"],R1=["start","end"],L1=QK.reduce((e,t)=>e.concat(t,t+"-"+R1[0],t+"-"+R1[1]),[]),pa=Math.min,Mo=Math.max,Cf=Math.round,od=Math.floor,Hr=e=>({x:e,y:e}),JK={left:"right",right:"left",bottom:"top",top:"bottom"};function Vg(e,t,n){return Mo(e,pa(t,n))}function Sa(e,t){return typeof e=="function"?e(t):e}function pi(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function wP(e){return e==="x"?"y":"x"}function Ax(e){return e==="y"?"height":"width"}function $i(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tx(e){return wP($i(e))}function vP(e,t,n){n===void 0&&(n=!1);const r=Ur(e),i=Tx(e),o=Ax(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=jf(s)),[s,jf(s)]}function ZK(e){const t=jf(e);return[Ef(e),t,Ef(t)]}function Ef(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const O1=["left","right"],M1=["right","left"],eY=["top","bottom"],tY=["bottom","top"];function nY(e,t,n){switch(e){case"top":case"bottom":return n?t?M1:O1:t?O1:M1;case"left":case"right":return t?eY:tY;default:return[]}}function rY(e,t,n,r){const i=Ur(e);let o=nY(pi(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Ef)))),o}function jf(e){const t=pi(e);return JK[t]+e.slice(t.length)}function iY(e){return{top:0,right:0,bottom:0,left:0,...e}}function bP(e){return typeof e!="number"?iY(e):{top:e,right:e,bottom:e,left:e}}function Pf(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 D1(e,t,n){let{reference:r,floating:i}=e;const o=$i(t),s=Tx(t),a=Ax(s),l=pi(t),u=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,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(Ur(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}async function oY(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Sa(t,e),m=bP(h),k=a[p?d==="floating"?"reference":"floating":d],g=Pf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=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},E=Pf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:l}):w);return{top:(g.top-E.top+m.top)/N.y,bottom:(E.bottom-g.bottom+m.bottom)/N.y,left:(g.left-E.left+m.left)/N.x,right:(E.right-g.right+m.right)/N.x}}const sY=50,aY=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:oY},l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=D1(u,r,l),p=r,h=0;const m={};for(let v=0;v<o.length;v++){const k=o[v];if(!k)continue;const{name:g,fn:w}=k,{x:y,y:N,data:E,reset:S}=await w({x:f,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,d=N??d,m[g]={...m[g],...E},S&&h<sY&&(h++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(u=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:f,y:d}=D1(u,p,l)),v=-1)}return{x:f,y:d,placement:p,strategy:i,middlewareData:m}},lY=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Sa(e,t)||{};if(u==null)return{};const d=bP(f),p={x:n,y:r},h=Tx(i),m=Ax(h),v=await s.getDimensions(u),k=h==="y",g=k?"top":"left",w=k?"bottom":"right",y=k?"clientHeight":"clientWidth",N=o.reference[m]+o.reference[h]-p[h]-o.floating[m],E=p[h]-o.reference[h],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=S?S[y]:0;(!P||!await(s.isElement==null?void 0:s.isElement(S)))&&(P=a.floating[y]||o.floating[m]);const T=N/2-E/2,M=P/2-v[m]/2-1,B=pa(d[g],M),A=pa(d[w],M),R=B,V=P-v[m]-A,L=P/2-v[m]/2+T,H=Vg(R,L,V),D=!l.arrow&&Ur(i)!=null&&L!==H&&o.reference[m]/2-(L<R?B:A)-v[m]/2<0,$=D?L<R?L-R:L-V:0;return{[h]:p[h]+$,data:{[h]:H,centerOffset:L-H-$,...D&&{alignmentOffset:$}},reset:D}}});function cY(e,t,n){return(e?[...n.filter(i=>Ur(i)===e),...n.filter(i=>Ur(i)!==e)]:n.filter(i=>pi(i)===i)).filter(i=>e?Ur(i)===e||(t?Ef(i)!==i:!1):!0)}const uY=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:l,elements:u}=t,{crossAxis:f=!1,alignment:d,allowedPlacements:p=L1,autoAlignment:h=!0,...m}=Sa(e,t),v=d!==void 0||p===L1?cY(d||null,h,p):p,k=await l.detectOverflow(t,m),g=((n=s.autoPlacement)==null?void 0:n.index)||0,w=v[g];if(w==null)return{};const y=vP(w,o,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(a!==w)return{reset:{placement:v[0]}};const N=[k[pi(w)],k[y[0]],k[y[1]]],E=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:w,overflows:N}],S=v[g+1];if(S)return{data:{index:g+1,overflows:E},reset:{placement:S}};const P=E.map(B=>{const A=Ur(B.placement);return[B.placement,A&&f?B.overflows.slice(0,2).reduce((R,V)=>R+V,0):B.overflows[0],B.overflows]}).sort((B,A)=>B[1]-A[1]),M=((i=P.filter(B=>B[2].slice(0,Ur(B[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||P[0][0];return M!==a?{data:{index:g+1,overflows:E},reset:{placement:M}}:{}}}},dY=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:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...k}=Sa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=pi(i),w=$i(a),y=pi(a)===a,N=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(y||!v?[jf(a)]:ZK(a)),S=m!=="none";!p&&S&&E.push(...rY(a,v,m,N));const P=[a,...E],T=await l.detectOverflow(t,k),M=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&M.push(T[g]),d){const L=vP(i,s,N);M.push(T[L[0]],T[L[1]])}if(B=[...B,{placement:i,overflows:M}],!M.every(L=>L<=0)){var A,R;const L=(((A=o.flip)==null?void 0:A.index)||0)+1,H=P[L];if(H&&(!(d==="alignment"?w!==$i(H):!1)||B.every(_=>$i(_.placement)===w?_.overflows[0]>0:!0)))return{data:{index:L,overflows:B},reset:{placement:H}};let D=(R=B.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:R.placement;if(!D)switch(h){case"bestFit":{var V;const $=(V=B.filter(_=>{if(S){const I=$i(_.placement);return I===w||I==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(I=>I>0).reduce((I,C)=>I+C,0)]).sort((_,I)=>_[1]-I[1])[0])==null?void 0:V[0];$&&(D=$);break}case"initialPlacement":D=a;break}if(i!==D)return{reset:{placement:D}}}return{}}}},fY=new Set(["left","top"]);async function pY(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=pi(n),a=Ur(n),l=$i(n)==="y",u=fY.has(s)?-1:1,f=o&&l?-1:1,d=Sa(t,e);let{mainAxis:p,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),l?{x:h*f,y:p*u}:{x:p*u,y:h*f}}const hY=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,l=await pY(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},mY=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:l={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...u}=Sa(e,t),f={x:n,y:r},d=await o.detectOverflow(t,u),p=$i(pi(i)),h=wP(p);let m=f[h],v=f[p];if(s){const g=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=m+d[g],N=m-d[w];m=Vg(y,m,N)}if(a){const g=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=v+d[g],N=v-d[w];v=Vg(y,v,N)}const k=l.fn({...t,[h]:m,[p]:v});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[h]:s,[p]:a}}}}}};function fp(){return typeof window<"u"}function ka(e){return SP(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yr(e){var t;return(t=(SP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function SP(e){return fp()?e instanceof Node||e instanceof Rn(e).Node:!1}function mr(e){return fp()?e instanceof Element||e instanceof Rn(e).Element:!1}function gi(e){return fp()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function F1(e){return!fp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function Uc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function gY(e){return/^(table|td|th)$/.test(ka(e))}function pp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yY=/transform|translate|scale|rotate|perspective|filter/,xY=/paint|layout|strict|content/,So=e=>!!e&&e!=="none";let nm;function Rx(e){const t=mr(e)?gr(e):e;return So(t.transform)||So(t.translate)||So(t.scale)||So(t.rotate)||So(t.perspective)||!Lx()&&(So(t.backdropFilter)||So(t.filter))||yY.test(t.willChange||"")||xY.test(t.contain||"")}function wY(e){let t=no(e);for(;gi(t)&&!ha(t);){if(Rx(t))return t;if(pp(t))return null;t=no(t)}return null}function Lx(){return nm==null&&(nm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),nm}function ha(e){return/^(html|body|#document)$/.test(ka(e))}function gr(e){return Rn(e).getComputedStyle(e)}function hp(e){return mr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(ka(e)==="html")return e;const t=e.assignedSlot||e.parentNode||F1(e)&&e.host||Yr(e);return F1(t)?t.host:t}function kP(e){const t=no(e);return ha(t)?e.ownerDocument?e.ownerDocument.body:e.body:gi(t)&&Uc(t)?t:kP(t)}function Sc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=kP(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Rn(i);if(o){const a=Wg(s);return t.concat(s,s.visualViewport||[],Uc(i)?i:[],a&&n?Sc(a):[])}else return t.concat(i,Sc(i,[],n))}function Wg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NP(e){const t=gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=gi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Cf(n)!==o||Cf(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Ox(e){return mr(e)?e:e.contextElement}function qs(e){const t=Ox(e);if(!gi(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=NP(t);let s=(o?Cf(n.width):n.width)/r,a=(o?Cf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const vY=Hr(0);function CP(e){const t=Rn(e);return!Lx()||!t.visualViewport?vY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bY(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rn(e)?!1:t}function Yo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ox(e);let s=Hr(1);t&&(r?mr(r)&&(s=qs(r)):s=qs(e));const a=bY(o,n,r)?CP(o):Hr(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(o){const p=Rn(o),h=r&&mr(r)?Rn(r):r;let m=p,v=Wg(m);for(;v&&r&&h!==m;){const k=qs(v),g=v.getBoundingClientRect(),w=gr(v),y=g.left+(v.clientLeft+parseFloat(w.paddingLeft))*k.x,N=g.top+(v.clientTop+parseFloat(w.paddingTop))*k.y;l*=k.x,u*=k.y,f*=k.x,d*=k.y,l+=y,u+=N,m=Rn(v),v=Wg(m)}}return Pf({width:f,height:d,x:l,y:u})}function mp(e,t){const n=hp(e).scrollLeft;return t?t.left+n:Yo(Yr(e)).left+n}function EP(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function SY(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Yr(r),a=t?pp(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Hr(1);const f=Hr(0),d=gi(r);if((d||!d&&!o)&&((ka(r)!=="body"||Uc(s))&&(l=hp(r)),d)){const h=Yo(r);u=qs(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=s&&!d&&!o?EP(s,l):Hr(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function kY(e){return Array.from(e.getClientRects())}function NY(e){const t=Yr(e),n=hp(e),r=e.ownerDocument.body,i=Mo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Mo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mp(e);const a=-n.scrollTop;return gr(r).direction==="rtl"&&(s+=Mo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const $1=25;function CY(e,t){const n=Rn(e),r=Yr(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=Lx();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=mp(r);if(u<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=$1&&(o-=m)}else u<=$1&&(o+=u);return{width:o,height:s,x:a,y:l}}function EY(e,t){const n=Yo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=gi(e)?qs(e):Hr(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function z1(e,t,n){let r;if(t==="viewport")r=CY(e,n);else if(t==="document")r=NY(Yr(e));else if(mr(t))r=EY(t,n);else{const i=CP(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Pf(r)}function jP(e,t){const n=no(e);return n===t||!mr(n)||ha(n)?!1:gr(n).position==="fixed"||jP(n,t)}function jY(e,t){const n=t.get(e);if(n)return n;let r=Sc(e,[],!1).filter(a=>mr(a)&&ka(a)!=="body"),i=null;const o=gr(e).position==="fixed";let s=o?no(e):e;for(;mr(s)&&!ha(s);){const a=gr(s),l=Rx(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Uc(s)&&!l&&jP(e,s))?r=r.filter(f=>f!==s):i=a,s=no(s)}return t.set(e,r),r}function PY(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?pp(t)?[]:jY(t,this._c):[].concat(n),r],a=z1(t,s[0],i);let l=a.top,u=a.right,f=a.bottom,d=a.left;for(let p=1;p<s.length;p++){const h=z1(t,s[p],i);l=Mo(h.top,l),u=pa(h.right,u),f=pa(h.bottom,f),d=Mo(h.left,d)}return{width:u-d,height:f-l,x:d,y:l}}function _Y(e){const{width:t,height:n}=NP(e);return{width:t,height:n}}function IY(e,t,n){const r=gi(t),i=Yr(t),o=n==="fixed",s=Yo(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Hr(0);function u(){l.x=mp(i)}if(r||!r&&!o)if((ka(t)!=="body"||Uc(i))&&(a=hp(t)),r){const h=Yo(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?EP(i,a):Hr(0),d=s.left+a.scrollLeft-l.x-f.x,p=s.top+a.scrollTop-l.y-f.y;return{x:d,y:p,width:s.width,height:s.height}}function rm(e){return gr(e).position==="static"}function B1(e,t){if(!gi(e)||gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yr(e)===n&&(n=n.ownerDocument.body),n}function PP(e,t){const n=Rn(e);if(pp(e))return n;if(!gi(e)){let i=no(e);for(;i&&!ha(i);){if(mr(i)&&!rm(i))return i;i=no(i)}return n}let r=B1(e,t);for(;r&&gY(r)&&rm(r);)r=B1(r,t);return r&&ha(r)&&rm(r)&&!Rx(r)?n:r||wY(e)||n}const AY=async function(e){const t=this.getOffsetParent||PP,n=this.getDimensions,r=await n(e.floating);return{reference:IY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function TY(e){return gr(e).direction==="rtl"}const RY={convertOffsetParentRelativeRectToViewportRelativeRect:SY,getDocumentElement:Yr,getClippingRect:PY,getOffsetParent:PP,getElementRects:AY,getClientRects:kY,getDimensions:_Y,getScale:qs,isElement:mr,isRTL:TY};function _P(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LY(e,t){let n=null,r;const i=Yr(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:d,width:p,height:h}=u;if(a||t(),!p||!h)return;const m=od(d),v=od(i.clientWidth-(f+p)),k=od(i.clientHeight-(d+h)),g=od(f),y={rootMargin:-m+"px "+-v+"px "+-k+"px "+-g+"px",threshold:Mo(0,pa(1,l))||1};let N=!0;function E(S){const P=S[0].intersectionRatio;if(P!==l){if(!N)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!_P(u,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(E,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(e)}return s(!0),o}function H1(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:l=!1}=r,u=Ox(e),f=i||o?[...u?Sc(u):[],...t?Sc(t):[]]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const d=u&&a?LY(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(g=>{let[w]=g;w&&w.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let m,v=l?Yo(e):null;l&&k();function k(){const g=Yo(e);v&&!_P(v,g)&&n(),v=g,m=requestAnimationFrame(k)}return n(),()=>{var g;f.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const OY=hY,MY=uY,DY=mY,FY=dY,U1=lY,$Y=(e,t,n)=>{const r=new Map,i={platform:RY,...n},o={...i.platform,_c:r};return aY(e,t,{...i,platform:o})};var zY=typeof document<"u",BY=function(){},Id=zY?x.useLayoutEffect:BY;function _f(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(!_f(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)&&!_f(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function IP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V1(e,t){const n=IP(e);return Math.round(t*n)/n}function im(e){const t=x.useRef(e);return Id(()=>{t.current=e}),t}function W1(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:l,open:u}=e,[f,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=x.useState(r);_f(p,r)||h(r);const[m,v]=x.useState(null),[k,g]=x.useState(null),w=x.useCallback(_=>{_!==S.current&&(S.current=_,v(_))},[]),y=x.useCallback(_=>{_!==P.current&&(P.current=_,g(_))},[]),N=o||m,E=s||k,S=x.useRef(null),P=x.useRef(null),T=x.useRef(f),M=l!=null,B=im(l),A=im(i),R=im(u),V=x.useCallback(()=>{if(!S.current||!P.current)return;const _={placement:t,strategy:n,middleware:p};A.current&&(_.platform=A.current),$Y(S.current,P.current,_).then(I=>{const C={...I,isPositioned:R.current!==!1};L.current&&!_f(T.current,C)&&(T.current=C,qi.flushSync(()=>{d(C)}))})},[p,t,n,A,R]);Id(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[u]);const L=x.useRef(!1);Id(()=>(L.current=!0,()=>{L.current=!1}),[]),Id(()=>{if(N&&(S.current=N),E&&(P.current=E),N&&E){if(B.current)return B.current(N,E,V);V()}},[N,E,V,B,M]);const H=x.useMemo(()=>({reference:S,floating:P,setReference:w,setFloating:y}),[w,y]),D=x.useMemo(()=>({reference:N,floating:E}),[N,E]),$=x.useMemo(()=>{const _={position:n,left:0,top:0};if(!D.floating)return _;const I=V1(D.floating,f.x),C=V1(D.floating,f.y);return a?{..._,transform:"translate("+I+"px, "+C+"px)",...IP(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:C}},[n,a,D.floating,f.x,f.y]);return x.useMemo(()=>({...f,update:V,refs:H,elements:D,floatingStyles:$}),[f,V,H,D,$])}const HY=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?U1({element:r.current,padding:i}).fn(n):{}:r?U1({element:r,padding:i}).fn(n):{}}}},K1=(e,t)=>{const n=OY(e);return{name:n.name,fn:n.fn,options:[e,t]}},UY=(e,t)=>{const n=DY(e);return{name:n.name,fn:n.fn,options:[e,t]}},VY=(e,t)=>{const n=FY(e);return{name:n.name,fn:n.fn,options:[e,t]}},WY=(e,t)=>{const n=MY(e);return{name:n.name,fn:n.fn,options:[e,t]}},KY=(e,t)=>{const n=HY(e);return{name:n.name,fn:n.fn,options:[e,t]}},YY={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},qY={beaconOptions:{offset:-18}},AP={back:"Back",close:"Close",last:"Last",next:"Next",nextWithProgress:"Next ({current} of {total})",open:"Open the dialog",skip:"Skip"},GY={isFixed:!1,locale:AP,placement:"bottom"},XY={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"},Rt={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"},de={INIT:"init",READY:"ready",BEACON_BEFORE:"beacon_before",BEACON:"beacon",TOOLTIP_BEFORE:"tooltip_before",TOOLTIP:"tooltip",COMPLETE:"complete"},Rr={BUTTON_BACK:"button_back",BUTTON_CLOSE:"button_close",BUTTON_PRIMARY:"button_primary",BUTTON_SKIP:"button_skip",KEYBOARD:"keyboard",OVERLAY:"overlay"},Me={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"},QY="react-joyride-portal";function JY(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function Ds(...e){return HK({all:!0,isMergeableObject:t=>!(!Qt.plainObject(t)||x.isValidElement(t))})(...e)}function TP(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function ti(e,t={}){const{defaultValue:n,step:r,steps:i}=t;let o=tm(e);if(o)(o.includes("{current}")||o.includes("{total}"))&&r&&i&&(o=o.replace("{current}",r.toString()).replace("{total}",i.toString()));else if(x.isValidElement(e)&&!Object.values(e.props).length&&TP(e.type)==="function")try{o=ti(e.type({}),t)}catch{o=tm(n)}else o=tm(n);return o}function Ot(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 ZY(e,t){const n=JY(t);return{...e,...n}}function kc(){}function eq(e){return Object.keys(e)}function If(e,...t){if(!Qt.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 Y1(e,...t){if(!Qt.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 Kg(e,t,n){const r=o=>o.replace("{current}",String(t)).replace("{total}",String(n));if(TP(e)==="string")return r(e);if(!x.isValidElement(e))return e;const{children:i}=e.props;if(Qt.string(i)&&i.includes("{current}"))return x.cloneElement(e,{children:r(i)});if(Array.isArray(i))return x.cloneElement(e,{children:i.map(o=>typeof o=="string"?r(o):Kg(o,t,n))});if(Qt.function(e.type)&&!Object.values(e.props).length)try{return Kg(e.type({}),t,n)}catch{return e}return e}function q1(e){return eq(e).sort().reduce((t,n)=>(t[n]=e[n],t),{})}function Mx(){var e;return!!(typeof window<"u"&&((e=window.document)!=null&&e.createElement))}function G1(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 Dx(e){return e?e.getBoundingClientRect():null}function tq(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 Yn(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=Dx(e),i=Na(e),o=i?!i.isSameNode(xn()):!1,s=n??Ca(e);let a=0,l=(r==null?void 0:r.top)??0;return o&&s?l=(r==null?void 0:r.top)??0:i instanceof HTMLElement&&(a=i.scrollTop,!o&&!s&&(l+=a),i.isSameNode(xn())||(l+=xn().scrollTop)),Math.floor(l-t)}function Na(e,t){if(!e)return xn();const n=xP(e);if(n){if(n.isSameNode(xn()))return t?document:xn();if(!(n.scrollHeight>n.offsetHeight))return xn()}return n}function rq(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 iq(e,t){if(!e)return 0;const n=xP(e)??xn(),r=parseFloat(getComputedStyle(e).scrollMarginTop)||0,i=Dx(n),o=n.scrollTop??0,{offsetTop:s=0,scrollTop:a=0}=n;let l=e.getBoundingClientRect().top+a;if(s&&(RP(e)||oq(e))){const f=e.getBoundingClientRect(),d=f.top-((i==null?void 0:i.top)??0),p=d+f.height,h=n.clientHeight,m=h*.2;d>=m&&p<=h-m?l=o:l=d+o}const u=Math.floor(l-t-r);return u<0?0:u}function oq(e){return e.offsetParent!==document.body}function RP(e){if(!e)return!1;const t=Na(e);return t?!t.isSameNode(xn()):!1}function Ca(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?Ca(e.parentNode,t):!1}function sd(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 X1(e){const{isFirstStep:t,scrollToFirstStep:n,step:r,target:i,targetLifecycle:o}=e;if(r.skipScroll||t&&!n&&o!==de.TOOLTIP||r.placement==="center")return!1;const s=i!=null&&i.isConnected?Na(i):xn(),a=s?!s.isSameNode(xn()):!1;return(r.isFixed||Ca(i))&&!a?!1:s.scrollHeight>s.clientHeight}function xn(){return document.scrollingElement??document.documentElement}function Q1(e,t){const{duration:n,element:r}=t;let i=()=>{};const o=new Promise(s=>{const{scrollTop:a}=r,l=e>a?e-a:a-e;i=GK.top(r,e,{duration:l<100?50:n},()=>{s()})});return{cancel:i,promise:o}}function sq(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 LP={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555555",cursor:"pointer",fontSize:16,lineHeight:1,padding:0,WebkitAppearance:"none"},ad={...LP,borderRadius:4,padding:8};function aq(e,t){const{styles:n}=e,r=Ds(n??{},t.styles??{});let{width:i}=t;Mx()&&(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 Ds({arrow:{alignItems:"center",color:t.arrowColor,display:"inline-flex",justifyContent:"center",position:"absolute"},beaconWrapper:{...LP,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(${sq(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:{...ad,color:t.primaryColor,marginLeft:"auto",marginRight:5},buttonClose:{...ad,color:t.textColor,height:12,padding:8,position:"absolute",right:0,top:0,width:12},buttonPrimary:{...ad,backgroundColor:t.primaryColor,color:t.backgroundColor},buttonSkip:{...ad,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 lq=["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 Fx(e,t){if(!t)return null;const n=Ds(GY,Y1(e,"arrowComponent","beaconComponent","floatingOptions","loaderComponent","locale","styles","tooltipComponent"),t),r=Ds(YY,e.options??{},Y1(t,...lq)),i=aq(e,{...n,...r}),o=Ds(qY,e.floatingOptions??{},n.floatingOptions??{});return{...n,...r,locale:Ds(AP,e.locale??{},n.locale||{}),floatingOptions:o,spotlightPadding:cq(r.spotlightPadding),styles:i}}function cq(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 uq(e,t,n){const{action:r}=t,i=n&&[Fe.PREV,Fe.NEXT].includes(r);return e.skipBeacon||e.placement==="center"||i}function OP(e,t=!1){return Qt.plainObject(e)?e.target?!0:(Ot(t,"tour","target is missing from the step"),!1):(Ot(t,"tour","step must be an object"),!1)}function MP(e,t=!1){return Qt.array(e)?e.every(n=>OP(n,t)):(Ot(t,"tour","steps must be an array"),!1)}var dq=class{constructor(e){pt(this,"beaconPosition",null);pt(this,"debug");pt(this,"eventListeners",new Map);pt(this,"listeners",new Set);pt(this,"props");pt(this,"snapshot");pt(this,"state");pt(this,"steps");pt(this,"tooltipPosition",null);pt(this,"cleanupPositionData",()=>{this.beaconPosition=null,this.tooltipPosition=null});pt(this,"getPositionData",e=>e==="beacon"?this.beaconPosition:this.tooltipPosition);pt(this,"getServerSnapshot",()=>this.snapshot);pt(this,"getSnapshot",()=>this.snapshot);pt(this,"getEventState",()=>If(this.snapshot,"positioned"));pt(this,"getState",()=>If(this.snapshot,"positioned"));pt(this,"setPositionData",(e,t)=>{var r,i,o;((r=e==="beacon"?this.beaconPosition:this.tooltipPosition)==null?void 0:r.placement)!==t.placement&&Ot(this.debug,`step:${this.state.index}`,"positioned",`${e} ${t.placement}`),e==="beacon"?this.beaconPosition=t:this.tooltipPosition=t,(this.state.lifecycle===de.BEACON_BEFORE||this.state.lifecycle===de.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)});pt(this,"setSteps",e=>{this.steps=e,this.updateState({size:e.length})});pt(this,"dispatch",(e,t)=>{const n=this.eventListeners.get(e.type);if(n)for(const r of n)try{r(e,t)}catch{}});pt(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)}});pt(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));pt(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,!jx(i,a)){this.snapshot=Object.freeze({...a});for(const l of this.listeners)l(this.snapshot)}});const{initialStepIndex:t,stepIndex:n,steps:r=[]}=e??{},i=Qt.number(n);let o=0;this.debug=(e==null?void 0:e.debug)??!1,i?(o=n,Qt.number(t)&&Ot(this.debug,"tour","initialStepIndex is ignored in controlled mode")):Qt.number(t)&&(t>=0&&t<r.length?o=t:r.length>0&&Ot(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:de.INIT,origin:null,positioned:!1,scrolling:!1,size:r.length,status:r.length?Me.READY:Me.IDLE,waiting:!1},this.snapshot=Object.freeze({...this.state})}applyTransitions(e){return e.status===Me.WAITING&&e.size>0?{...e,status:Me.RUNNING}:e}getStep(e){return Fx(this.props,this.steps[e??this.state.index])}};function fq(e){return new dq(e)}function J1(e,t){return Math.min(Math.max(e,0),t)}function pq(e,t,n){const r=x.useRef(t),i=x.useRef(n);return r.current=t,i.current=n,x.useMemo(()=>{const o=()=>e.current.getSnapshot();return{close:(k=null)=>{const{index:g,status:w}=o();w===Me.RUNNING&&e.current.updateState({action:Fe.CLOSE,index:g+1,origin:k,lifecycle:de.COMPLETE,positioned:!1,scrolling:!1,waiting:!1})},go:k=>{const{controlled:g,size:w,status:y}=o();if(g){Ot(r.current,"tour","go() is not supported in controlled mode");return}y===Me.RUNNING&&e.current.updateState({action:Fe.GO,index:k,lifecycle:de.COMPLETE,positioned:!1,scrolling:!1,status:k<w?y:Me.FINISHED,waiting:!1})},info:()=>If(e.current.getSnapshot(),"positioned"),next:k=>{const{index:g,size:w,status:y}=o();y===Me.RUNNING&&e.current.updateState({action:Fe.NEXT,index:J1(g+1,w),lifecycle:de.COMPLETE,origin:k,positioned:!1,scrolling:!1,waiting:!1})},open:()=>{const{status:k}=o();k===Me.RUNNING&&e.current.updateState({action:Fe.UPDATE,lifecycle:de.TOOLTIP_BEFORE,positioned:!1,scrolling:!1,waiting:!1})},prev:k=>{const{index:g,size:w,status:y}=o();y===Me.RUNNING&&e.current.updateState({action:Fe.PREV,index:J1(g-1,w),lifecycle:de.COMPLETE,origin:k,positioned:!1,scrolling:!1,waiting:!1})},reset:(k=!1)=>{const{controlled:g}=o();if(g){Ot(r.current,"tour","reset() is not supported in controlled mode");return}i.current(),e.current.updateState({action:Fe.RESET,index:0,lifecycle:de.INIT,positioned:!1,scrolling:!1,status:k?Me.RUNNING:Me.READY,waiting:!1})},skip:k=>{const{status:g}=o();g===Me.RUNNING&&e.current.updateState({action:Fe.SKIP,lifecycle:de.COMPLETE,origin:k,positioned:!1,scrolling:!1,status:Me.SKIPPED,waiting:!1})},start:k=>{const{index:g,size:w}=o();i.current(),e.current.updateState({action:Fe.START,index:Qt.number(k)?k:g,lifecycle:de.INIT,positioned:!1,scrolling:!1,status:w?Me.RUNNING:Me.WAITING,waiting:!1},!0)},stop:(k=!1)=>{const{index:g,status:w}=o();[Me.FINISHED,Me.SKIPPED].includes(w)||e.current.updateState({action:Fe.STOP,index:g+(k?1:0),lifecycle:de.COMPLETE,positioned:!1,scrolling:!1,status:Me.PAUSED,waiting:!1})}}},[e])}const hq=new Set(["origin","positioned"]);function mq(e,t){const n=x.useRef(null);x.useEffect(()=>{if(!t)return;const r=e.current.getSnapshot();return Ot(!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 l of Object.keys(i))i[l]!==o[l]&&!hq.has(l)&&(s[l]={from:o[l],to:i[l]},(l==="status"||l==="size")&&(a=!0));Object.keys(s).length&&(!a&&i.index>=i.size||Ot(!0,a?"tour":`step:${i.index}`,"state",s))})},[t,e])}function gq(e,t,n){const r=x.useRef(e),i=x.useRef(t);return r.current=e,i.current=t,x.useCallback((o,s,a)=>{var u;const l={...n.current.getEventState(),error:null,scroll:null,step:s,type:o,...a};(u=r.current)==null||u.call(r,l,i.current),n.current.dispatch(l,i.current)},[n])}function Ti(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 yq(e){const{addFailure:t,controls:n,emitEvent:r,previousState:i,props:o,state:s,step:a,store:l}=e,{action:u,index:f,lifecycle:d,positioned:p,scrolling:h,size:m,status:v}=s,k=uP(a)??null,g=x.useRef(null),w=x.useRef(o),y=x.useRef(s),N=x.useRef(i),E=x.useRef(a),S=x.useRef(k),P=x.useRef(n),T=x.useRef(null),M=x.useRef(null),B=x.useRef(null);w.current=o,y.current=s,N.current=i,E.current=a,S.current=k,P.current=n;const A=()=>{T.current&&(clearInterval(T.current),T.current=null),M.current=null,B.current&&(B.current.cancel(),B.current=null)};x.useEffect(()=>{if(!N.current)return;const{hasChangedTo:R}=Ti(y.current,N.current);(R("action",[Fe.NEXT,Fe.PREV,Fe.SKIP,Fe.CLOSE])||g.current===Fe.CLOSE&&u===Fe.START)&&(g.current=u)},[u]),x.useEffect(()=>{if(!N.current)return()=>{A()};const{hasChanged:R}=Ti(y.current,N.current),V=E.current;if(R("index")&&A(),v!==Me.RUNNING||!V||d!==de.INIT)return()=>{A()};const{hasChangedTo:L}=Ti(y.current,N.current);L("status",Me.RUNNING)&&[Me.IDLE,Me.READY,Me.PAUSED].includes(N.current.status)&&r(Rt.TOUR_START,V),l.current.cleanupPositionData();const{debug:H}=w.current;if(V.before&&!B.current){Ot(H,`step:${f}`,"before()",V),B.current={cancel:()=>{}},l.current.updateState({waiting:!0}),r(Rt.STEP_BEFORE_HOOK,V,{action:g.current??y.current.action});const D=()=>{B.current=null,l.current.updateState({action:g.current??y.current.action,waiting:!1,lifecycle:de.READY})},$=new AbortController,_=V.beforeTimeout;B.current={cancel:()=>$.abort()};const I=_?setTimeout(()=>{$.signal.aborted||(Ot(H,`step:${f}`,"before()","timed out",`${_}ms`),$.abort(),t(V,"before_hook"),r(Rt.ERROR,V,{error:new Error("Step before hook timed out")}),D())},_):null;V.before({...l.current.getState(),action:g.current??l.current.getState().action,step:V}).then(()=>{$.signal.aborted||(I&&clearTimeout(I),D())}).catch(C=>{$.signal.aborted||(I&&clearTimeout(I),t(V,"before_hook"),r(Rt.ERROR,V,{error:C instanceof Error?C:new Error(String(C))}),D())})}else if(!B.current){T.current&&M.current!==V.target&&A();const D=Yn(V.target);if(D&&sd(D))A(),l.current.updateState({action:g.current??Fe.UPDATE,lifecycle:de.READY,waiting:!1});else if(V.targetWaitTimeout===0)l.current.updateState({action:g.current??Fe.UPDATE,lifecycle:de.READY,waiting:!1});else if(!T.current){const{targetWaitTimeout:$}=V,_=Date.now();M.current=V.target,Ot(H,`step:${f}`,"polling","started",`${$}ms`),l.current.updateState({waiting:!0}),T.current=setInterval(()=>{const I=Yn(V.target),C=Date.now()-_,F=C>=$;(I&&sd(I)||F)&&(Ot(H,`step:${f}`,"polling",I&&sd(I)?"found":"timed out",`${C}ms`),A(),l.current.updateState({action:g.current??Fe.UPDATE,lifecycle:de.READY,waiting:!1}))},100)}}return()=>{A()}},[t,r,f,d,v,l]),x.useEffect(()=>{if(!N.current)return;const{hasChanged:R,hasChangedTo:V,previous:L}=Ti(y.current,N.current),H=E.current;if(!H)return;const D=Yn(H.target),$=!!D;if($&&sd(D)){if(V("lifecycle",de.READY)&&L.lifecycle===de.INIT&&r(Rt.STEP_BEFORE,H,{action:g.current??y.current.action}),V("lifecycle",de.READY)){const _=y.current,I=uq(H,_,w.current.continuous)?de.TOOLTIP:de.BEACON,C=Yn(H.scrollTarget??H.spotlightTarget??H.target),F=X1({isFirstStep:_.index===0,scrollToFirstStep:w.current.scrollToFirstStep,step:H,target:C,targetLifecycle:I}),U=I===de.TOOLTIP?de.TOOLTIP_BEFORE:de.BEACON_BEFORE;Ot(w.current.debug,`step:${f}`,"scroll",F?"needed":"skipped"),l.current.updateState({action:Fe.UPDATE,lifecycle:U,scrolling:F})}}else if(y.current.status===Me.RUNNING&&d!==de.INIT&&d!==de.COMPLETE&&R("lifecycle")){Ot(w.current.debug,`step:${f}`,$?"Target not visible":"Target not mounted",H),t(H,"target_not_found"),r(Rt.TARGET_NOT_FOUND,H);const _=y.current;_.controlled||l.current.updateState({action:Fe.UPDATE,index:_.index+(_.action===Fe.PREV?-1:1),lifecycle:de.INIT})}},[t,r,f,d,l]),x.useEffect(()=>{if(!N.current)return;const{hasChangedTo:R,previous:V}=Ti(y.current,N.current),L=E.current,H=S.current;if(L&&R("lifecycle",de.TOOLTIP_BEFORE)&&V.lifecycle===de.BEACON){const _=Yn(L.scrollTarget??L.spotlightTarget??L.target);if(X1({isFirstStep:y.current.index===0,scrollToFirstStep:w.current.scrollToFirstStep,step:L,target:_,targetLifecycle:de.TOOLTIP})){l.current.updateState({scrolling:!0,positioned:!1});return}}const D=d===de.BEACON_BEFORE||d===de.TOOLTIP_BEFORE;if(L&&D&&!h){const _=d===de.TOOLTIP_BEFORE?de.TOOLTIP:de.BEACON;l.current.updateState({action:Fe.UPDATE,lifecycle:_})}L&&R("lifecycle",de.BEACON)&&r(Rt.BEACON,L),L&&R("lifecycle",de.TOOLTIP)&&r(Rt.TOOLTIP,L);const $=y.current;if(($.status===Me.RUNNING||$.controlled&&$.status===Me.PAUSED&&L)&&H&&R("lifecycle",de.COMPLETE)&&V.lifecycle===de.TOOLTIP&&(r(Rt.STEP_AFTER,H,{action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle}),H.after)){r(Rt.STEP_AFTER_HOOK,H,{action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle});try{H.after({...l.current.getState(),action:g.current??Fe.UPDATE,index:V.index??$.index,lifecycle:$.lifecycle,step:H})}catch{}}},[r,d,p,h,l]),x.useEffect(()=>{if(!N.current)return;const{hasChangedTo:R,previous:V}=Ti(y.current,N.current),L=E.current,H=S.current;m&&!L&&d===de.INIT&&l.current.updateState({action:Fe.UPDATE,lifecycle:de.COMPLETE,status:Me.FINISHED}),!y.current.controlled&&v===Me.RUNNING&&R("lifecycle",de.COMPLETE)&&f<m&&l.current.updateState({action:Fe.UPDATE,lifecycle:de.INIT}),R("lifecycle",de.COMPLETE)&&f>=m&&l.current.updateState({action:Fe.UPDATE,lifecycle:de.COMPLETE,status:Me.FINISHED});const D=L??H??Fx(w.current,w.current.steps[f-1]);if(D&&R("status",[Me.FINISHED,Me.SKIPPED])){let $;L?$=f:H?$=V.index??f:$=f-1,r(Rt.TOUR_END,D,{index:$}),y.current.controlled||P.current.reset(),g.current=null}L&&R("action",Fe.STOP)&&(g.current=null,r(Rt.TOUR_STATUS,L)),L&&R("action",Fe.RESET)&&(r(Rt.TOUR_STATUS,L),g.current=null)},[u,r,f,d,m,v,l])}function xq({controls:e,emitEvent:t,props:n,state:r,store:i}){const{debug:o,initialStepIndex:s,run:a,stepIndex:l,steps:u}=n,f=x.useRef(void 0),d=x.useRef(r),p=x.useRef(e);d.current=r,p.current=e,x.useEffect(()=>{const h=f.current;if(f.current=n,!h||n===h)return;const{hasChanged:m}=Ti(n,h);if(jx(h.steps,u)||(MP(u,o)?i.current.setSteps(u):(Ot(o,"tour","Steps are not valid",u),t(Rt.ERROR,u[0]??{target:"",content:""},{error:new Error("Steps are not valid")}))),m("run"))a?i.current.getState().size&&p.current.start(l??s):p.current.stop();else if(Qt.number(l)&&m("stepIndex")){const v=Qt.number(h.stepIndex)&&h.stepIndex<l?Fe.NEXT:Fe.PREV;[Me.FINISHED,Me.SKIPPED].includes(d.current.status)||i.current.updateState({action:v,index:l,lifecycle:de.INIT,positioned:!1},!0)}},[o,t,s,n,a,l,u,i])}function wq(e,t){var a,l,u,f;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===de.BEACON_BEFORE&&(n!=null&&n.placement)){const d=vq(n);["bottom"].includes(n.placement)||(s+=Math.floor(d-i))}else if(r===de.TOOLTIP_BEFORE){const{placement:d}=o;if(d==="top"){const p=((a=document.querySelector(".react-joyride__floater"))==null?void 0:a.getBoundingClientRect().height)??0,h=(l=o.floatingOptions)!=null&&l.hideArrow?0:o.arrowSize,m=o.offset+o.spotlightPadding.top+h;s-=p+m}else if(d==="left"||d==="right"){const p=((u=document.querySelector(".react-joyride__floater"))==null?void 0:u.getBoundingClientRect().height)??0,h=((f=Yn(o.target))==null?void 0:f.getBoundingClientRect().height)??0,m=i+o.spotlightPadding.top+h/2-p/2;m<i&&(s-=i-m)}}return Math.max(0,s)}function vq(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 bq({emitEvent:e,previousState:t,props:n,state:r,step:i,store:o}){const{index:s,lifecycle:a,positioned:l,scrolling:u,status:f}=r,d=x.useRef(null),p=x.useRef(r),h=x.useRef(t),m=x.useRef(n),v=x.useRef(i);p.current=r,h.current=t,m.current=n,v.current=i,x.useEffect(()=>()=>{var k;(k=d.current)==null||k.call(d)},[]),x.useEffect(()=>{var E;if(!h.current||!v.current)return;const{hasChangedTo:k}=Ti(p.current,h.current),g=v.current,{debug:w}=m.current,{scrollDuration:y}=g,N=a===de.BEACON_BEFORE||a===de.TOOLTIP_BEFORE;if(f===Me.RUNNING&&N&&u&&k("positioned",!0)){const S=Yn(g.scrollTarget??g.spotlightTarget??g.target),P=o.current.getPositionData("beacon"),T=Na(S),M=T?!T.isSameNode(xn()):!1;(E=d.current)==null||E.call(d),(async()=>{if(M&&!Ca(T)){const $=xn(),_=rq(T),I={initial:$.scrollTop,target:_,element:$,duration:y};e(Rt.SCROLL_START,g,{scroll:I});const{cancel:C,promise:F}=Q1(_,{element:$,duration:y});d.current=C,await F,e(Rt.SCROLL_END,g,{scroll:I})}const A=Math.floor(iq(S,g.scrollOffset))||0,R=M?A:wq(A,{beaconPosition:P,lifecycle:a,scrollOffset:g.scrollOffset,step:g});Ot(w,`step:${s}`,"scroll",M?"custom":"document",`${A} → ${R}`);const V=T,L={initial:V.scrollTop,target:R,element:V,duration:y};e(Rt.SCROLL_START,g,{scroll:L});const{cancel:H,promise:D}=Q1(R,{element:V,duration:y});d.current=H,await D,e(Rt.SCROLL_END,g,{scroll:L}),o.current.updateState({scrolling:!1})})().catch(()=>{o.current.updateState({scrolling:!1})})}},[e,s,a,l,u,f,o])}function Sq(e){const t=iK(()=>ZY(XY,e),[e]),{debug:n,initialStepIndex:r,onEvent:i,run:o,stepIndex:s,steps:a}=t,l=x.useRef(fq(t)),u=DC.useSyncExternalStore(l.current.subscribe,l.current.getSnapshot,l.current.getServerSnapshot),[f,d]=x.useState([]),p=x.useCallback((E,S)=>{d(P=>[...P,{reason:S,step:E}])},[]),h=x.useCallback(()=>{d([])},[]);mq(l,n);const m=pq(l,n,h),v=gq(i,m,l),{index:k,size:g,status:w}=u,y=uP(u),N=x.useMemo(()=>Fx(t,a[k]),[k,t,a]);return oK(()=>{o&&g&&MP(a,n)&&m.start(s??r)}),rK(()=>{o&&g&&w===Me.IDLE&&l.current.updateState({status:Me.READY})},[o,g,w]),xq({controls:m,emitEvent:v,props:t,state:u,store:l}),yq({addFailure:p,controls:m,emitEvent:v,previousState:y,props:t,state:u,step:N,store:l}),bq({emitEvent:v,previousState:y,props:t,state:u,step:N,store:l}),{controls:m,failures:f,mergedProps:t,state:u,step:N,store:l}}function kq(e){const[t,n]=x.useState(null);return x.useEffect(()=>{let r=null,i=!1;if(e)if(Qt.domElement(e))r=e,i=!0;else{const o=document.querySelector(e);o&&(r=o)}else{const o=document.createElement("div");o.id=QY,document.body.appendChild(o),r=o}return n(r),()=>{!r||i||r.parentNode===document.body&&document.body.removeChild(r)}},[e]),t}const Nq={animation:"joyride-loader-spin 1s linear infinite",border:"5px solid rgba(0, 0, 0, 0.1)",borderRadius:"50%",borderTopColor:"#555"};function Cq({nonce:e,step:t}){const{loaderComponent:n}=t,r=!!n;if(x.useEffect(()=>{if(r||document.getElementById("joyride-loader-animation"))return kc;const l=document.createElement("style");return l.id="joyride-loader-animation",e&&l.setAttribute("nonce",e),l.appendChild(document.createTextNode(`
|
|
161
|
-
@keyframes joyride-loader-spin {
|
|
162
|
-
to { transform: rotate(360deg); }
|
|
163
|
-
}
|
|
164
|
-
`)),document.head.appendChild(l),()=>{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 l=n;a=ke.createElement(l,{step:t})}else a=ke.createElement("div",{style:{...Nq,height:i,width:o,borderTopColor:t.primaryColor}});return ke.createElement("div",{className:"react-joyride__loader","data-testid":"loader",style:s},a)}const Eq={height:0,isFixed:!1,left:0,top:0,width:0};function ml(e,t){const n=Yn(e);if(!n)return Eq;const r=Dx(n),i=Ca(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 jq(e,t,n){const[r,i]=x.useState(()=>ml(e,t)),o=x.useRef(void 0),s=x.useRef(null),a=x.useRef(n),l=x.useRef(null),u=x.useCallback(()=>{clearTimeout(o.current),o.current=window.setTimeout(()=>{i(d=>{const p=ml(e,t);return d.top===p.top&&d.left===p.left&&d.width===p.width&&d.height===p.height&&d.isFixed===p.isFixed?d:p})},100)},[e,t]);x.useEffect(()=>{let d=null;const p=m=>{s.current=Na(m,!0),s.current&&s.current.addEventListener("scroll",u,{passive:!0}),window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),typeof ResizeObserver<"u"&&(l.current=new ResizeObserver(u),l.current.observe(m)),i(ml(e,t))},h=Yn(e);return h?p(h):(d=new MutationObserver(()=>{const m=Yn(e);m&&(d==null||d.disconnect(),d=null,p(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=l.current)==null||m.disconnect(),clearTimeout(o.current)}},[e,t,u]),x.useEffect(()=>{a.current&&!n&&i(ml(e,t)),a.current=n},[n,e,t]);let f=r;return a.current&&!n&&(f=ml(e,t)),f}function Pq(e,t,n){let r=`M0 0H${e}V${t}H0Z`;return n&&(r+=` ${n}`),r}function Z1(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 _q=[de.BEACON_BEFORE,de.BEACON];function Iq(e){var D,$;const{blockTargetInteraction:t,continuous:n,hideOverlay:r,lifecycle:i,onClickOverlay:o,overlayClickAction:s,placement:a,portalElement:l,scrolling:u,spotlightPadding:f,spotlightRadius:d,spotlightTarget:p,styles:h,target:m,waiting:v}=e,k=sK(),g=jq(p??m,f,u||v),w=x.useRef(null),y=(i===de.TOOLTIP||i===de.TOOLTIP_BEFORE)&&a!=="center",[N,E]=x.useState(!1),S=l?(D=w.current)==null?void 0:D.offsetParent:null,P=(S==null?void 0:S.clientWidth)??k.width,T=(S==null?void 0:S.clientHeight)??tq()??k.height,M=(($=h.overlay)==null?void 0:$.backgroundColor)??"rgba(0, 0, 0, 0.5)",B=x.useMemo(()=>{const{backgroundColor:_,mixBlendMode:I,...C}=h.overlay;return{height:T,pointerEvents:"none",...C}},[T,h.overlay]),A=y&&!u&&!v;x.useEffect(()=>{A?requestAnimationFrame(()=>E(!0)):E(!1)},[A]);const R=n&&_q.includes(i),V=!n&&i!==de.TOOLTIP;if(r||!v&&(R||V))return null;let L="";if(A)if(l&&S){const _=Yn(p??m);if(_){const I=G1(_),C=G1(S);L=Z1(I.left-C.left-f.left,I.top-C.top-f.top,_.offsetWidth+f.left+f.right,_.offsetHeight+f.top+f.bottom,d)}}else L=Z1(g.left,g.top,g.width,g.height,d);const H=Pq(P,T,L);return ke.createElement("div",{ref:w,"aria-hidden":"true",className:"react-joyride__overlay","data-testid":"overlay",style:B},ke.createElement("svg",{className:"react-joyride__spotlight","data-testid":"spotlight",style:{height:T,left:0,position:g.isFixed?"fixed":"absolute",top:0,width:P}},ke.createElement("path",{d:H,fill:M,fillRule:"evenodd",onClick:o,style:{cursor:s?"pointer":"default",pointerEvents:"auto"}}),L&&ke.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&&ke.createElement("path",{d:L,fill:"none",style:{pointerEvents:"none"},...h.spotlight})))}function DP(e){const{children:t,element:n}=e;return n?qi.createPortal(t,n):null}const Aq='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), area[href], [tabindex]:not([tabindex="-1"]), [contenteditable]';function Tq(e,t){const n=x.useRef(null);x.useEffect(()=>{if(!e)return kc;n.current=document.activeElement;const r=o=>{if(o.key!=="Tab")return;const s=[...e.querySelectorAll(Aq)],{shiftKey:a}=o;if(!s.length)return;o.preventDefault();let l=document.activeElement?s.indexOf(document.activeElement):0;l===-1||!a&&l+1===s.length?l=0:a&&l===0?l=s.length-1:l+=a?-1:1,s[l].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 oi(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 Rq(e,t,n){const[r]=e.split("-");switch(r){case"top":return{points:`0,0 ${t/2},${n} ${t},0`,...oi(e,t,n)};case"bottom":return{points:`${t},${n} ${t/2},0 0,${n}`,...oi(e,t,n)};case"left":return{points:`0,0 ${n},${t/2} 0,${t}`,...oi(e,t,n)};case"right":return{points:`${n},${t} ${n},0 0,${t/2}`,...oi(e,t,n)};default:return null}}function Lq(e,t,n,r){if(!t)return{};const[i]=e.split("-");switch(i){case"top":return{bottom:-n,left:t.x??0,...oi(e,r,n)};case"bottom":return{top:-n,left:t.x??0,...oi(e,r,n)};case"left":return{right:-n,top:t.y??0,...oi(e,r,n)};case"right":return{left:-n,top:t.y??0,...oi(e,r,n)};default:return{}}}function Oq({arrowComponent:e,arrowRef:t,base:n,placement:r,position:i,size:o,styles:s}){const a=e;let l=null;if(a){if(!oi(r,n,o))return null;l=ke.createElement("span",{style:{flexShrink:0}},ke.createElement(a,{base:n,placement:r,size:o}))}else{const u=Rq(r,n,o);if(!u)return null;l=ke.createElement("svg",{height:u.height,width:u.width,xmlns:"http://www.w3.org/2000/svg"},ke.createElement("polygon",{fill:"currentColor",points:u.points}))}return ke.createElement("span",{ref:t,className:"react-joyride__arrow","data-testid":"arrow",style:{...s,...Lq(r,i,o,n),...i?{}:{visibility:"hidden"}}},l)}function Mq(e){const{beaconComponent:t,continuous:n,index:r,isLastStep:i,locale:o,nonce:s,onInteract:a,shouldFocus:l,size:u,step:f,styles:d}=e,p=x.useRef(null),h=!!t;x.useEffect(()=>{if(h||document.getElementById("joyride-beacon-animation"))return kc;const k=document.createElement("style");k.id="joyride-beacon-animation",s&&k.setAttribute("nonce",s),k.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(k);const g=setTimeout(()=>{Qt.domElement(p.current)&&l&&p.current.focus()},0);return()=>{clearTimeout(g);const w=document.getElementById("joyride-beacon-animation");w!=null&&w.parentNode&&w.parentNode.removeChild(w)}},[h,s,l]);const m=ti(o.open);let v;if(t){const k=t;v=ke.createElement(k,{continuous:n,index:r,isLastStep:i,size:u,step:f})}else v=ke.createElement("span",{style:d.beacon},ke.createElement("span",{style:d.beaconOuter}),ke.createElement("span",{style:d.beaconInner}));return ke.createElement("button",{ref:p,"aria-label":m,className:"react-joyride__beacon","data-testid":"button-beacon",onClick:a,onMouseEnter:a,style:d.beaconWrapper,title:m,type:"button"},v)}function Dq({styles:e,...t}){const{color:n,height:r,width:i,...o}=e;return ke.createElement("button",{style:o,type:"button",...t},ke.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"},ke.createElement("g",null,ke.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 Fq(e){const{backProps:t,closeProps:n,index:r,isLastStep:i,primaryProps:o,skipProps:s,step:a,tooltipProps:l}=e,{buttons:u,content:f,styles:d,title:p}=a,h={};u.includes("primary")&&(h.primary=ke.createElement("button",{"data-testid":"button-primary",style:d.buttonPrimary,type:"button",...o})),u.includes("skip")&&!i&&(h.skip=ke.createElement("button",{"aria-live":"off","data-testid":"button-skip",style:d.buttonSkip,type:"button",...s})),u.includes("back")&&r>0&&(h.back=ke.createElement("button",{"data-testid":"button-back",style:d.buttonBack,type:"button",...t})),h.close=u.includes("close")&&ke.createElement(Dq,{"data-testid":"button-close",styles:d.buttonClose,...n});const m=p?{"aria-labelledby":"joyride-tooltip-title","aria-describedby":"joyride-tooltip-content"}:{"aria-label":ti(f),"aria-describedby":"joyride-tooltip-content"};return ke.createElement("div",{key:"JoyrideTooltip",className:"react-joyride__tooltip","data-joyride-step":r,...a.id&&{"data-joyride-id":a.id},style:d.tooltip,...l,...m},ke.createElement("div",{style:d.tooltipContainer},p&&ke.createElement("h4",{id:"joyride-tooltip-title",style:d.tooltipTitle},p),ke.createElement("div",{id:"joyride-tooltip-content",style:d.tooltipContent},f)),u.some(v=>v==="back"||v==="primary"||v==="skip")&&ke.createElement("div",{style:d.tooltipFooter},ke.createElement("div",{style:d.tooltipFooterSpacer},h.skip),h.back,h.primary),h.close)}function $q(e){const{continuous:t,controls:n,index:r,isLastStep:i,size:o,step:s}=e,a=g=>{g.preventDefault(),n.prev(Rr.BUTTON_BACK)},l=g=>{g.preventDefault(),s.closeButtonAction==="skip"?n.skip(Rr.BUTTON_CLOSE):n.close(Rr.BUTTON_CLOSE)},u=g=>{if(g.preventDefault(),!t){n.close(Rr.BUTTON_PRIMARY);return}n.next(Rr.BUTTON_PRIMARY)},f=g=>{g.preventDefault(),n.skip(Rr.BUTTON_SKIP)},d=()=>{const{back:g,close:w,last:y,next:N,nextWithProgress:E,skip:S}=s.locale,P=ti(g),T=ti(w),M=ti(y),B=ti(N),A=ti(S);let R=w,V=T;if(t){if(R=N,V=B,s.showProgress&&!i){const L=ti(E,{step:r+1,steps:o});R=Kg(E,r+1,o),V=L}i&&(R=y,V=M)}return{backProps:{"aria-label":P,children:g,"data-action":"back",onClick:a,role:"button",title:P},closeProps:{"aria-label":T,children:w,"data-action":"close",onClick:l,role:"button",title:T},primaryProps:{"aria-label":V,children:R,"data-action":"primary",onClick:u,role:"button",title:V},skipProps:{"aria-label":A,children:S,"data-action":"skip",onClick:f,role:"button",title:A},tooltipProps:{"aria-modal":!0,role:"alertdialog"}}},{arrowComponent:p,beaconComponent:h,tooltipComponent:m,...v}=s;let k;if(m){const g=m;k=ke.createElement(g,{...d(),continuous:t,controls:n,index:r,isLastStep:i,size:o,step:v})}else k=ke.createElement(Fq,{...d(),continuous:t,controls:n,index:r,isLastStep:i,size:o,step:v});return k}function zq(e){if(e.startsWith("left"))return["top","bottom"];if(e.startsWith("right"))return["bottom","top"]}function Bq(e,t,n){var r,i;return e?[WY()]:((r=t.floatingOptions)==null?void 0:r.flipOptions)===!1?[]:[VY({crossAxis:!1,fallbackPlacements:zq(n),padding:20,...(i=t.floatingOptions)==null?void 0:i.flipOptions})]}function Hq(e){var I,C,F,U,O;const{continuous:t,controls:n,index:r,lifecycle:i,nonce:o,open:s,portalElement:a,setPositionData:l,setTooltipRef:u,shouldScroll:f,size:d,step:p,target:h,updateState:m}=e,v=x.useRef(null),k=x.useRef({}),g=x.useRef({}),w=p.placement==="center",y=p.placement==="auto",N=x.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})}),[]),E=x.useMemo(()=>RP(h)?Na(h):void 0,[h]),S=x.useMemo(()=>Ca(h),[h]),P=x.useMemo(()=>E?{boundary:E,rootBoundary:"viewport"}:{},[E]),T=w||y?"bottom":p.placement,M=w?"fixed":((I=p.floatingOptions)==null?void 0:I.strategy)??(p.isFixed||S?"fixed":"absolute"),B=x.useMemo(()=>{var q,ee,ne,ae;return w?[{name:"center",fn:({rects:J})=>({x:(window.innerWidth-J.floating.width)/2,y:(window.innerHeight-J.floating.height)/2})}]:[K1(({placement:J})=>{var ye;let le="right";J.startsWith("top")?le="top":J.startsWith("bottom")?le="bottom":J.startsWith("left")&&(le="left");const Se=p.spotlightTarget?0:p.spotlightPadding[le];return p.offset+Se+((ye=p.floatingOptions)!=null&&ye.hideArrow?0:p.arrowSize)},[p.offset,p.spotlightPadding,p.spotlightTarget,p.arrowSize,(q=p.floatingOptions)==null?void 0:q.hideArrow]),...Bq(y,p,T),UY({padding:10,...P,...(ee=p.floatingOptions)==null?void 0:ee.shiftOptions}),...(ne=p.floatingOptions)!=null&&ne.hideArrow?[]:[KY({element:v,padding:p.arrowSpacing},[p.arrowSpacing,p.arrowBase])],...((ae=p.floatingOptions)==null?void 0:ae.middleware)??[]]},[w,p,y,T,P]),A=W1({...w?{elements:{reference:N}}:{},placement:T,strategy:M,middleware:B}),R=W1({strategy:M,placement:p.beaconPlacement??(y||w?"bottom":p.placement),middleware:x.useMemo(()=>{var q,ee;return[K1(((ee=(q=p.floatingOptions)==null?void 0:q.beaconOptions)==null?void 0:ee.offset)??-18)]},[(F=(C=p.floatingOptions)==null?void 0:C.beaconOptions)==null?void 0:F.offset]),whileElementsMounted:H1});g.current=A.middlewareData,k.current=R.middlewareData,x.useEffect(()=>{var ne;const{floating:q,reference:ee}=A.elements;if(!(!ee||!q||i!==de.TOOLTIP))return H1(ee,q,A.update,(ne=p.floatingOptions)==null?void 0:ne.autoUpdate)},[i,A.update,(U=p.floatingOptions)==null?void 0:U.autoUpdate,p.target,A.elements]),x.useEffect(()=>{!w&&h&&A.refs.setReference(h),h&&R.refs.setReference(h)},[R.refs,w,h,A.refs]),x.useEffect(()=>{A.isPositioned&&l("tooltip",{placement:A.placement,x:A.x??0,y:A.y??0,middlewareData:g.current})},[l,A.isPositioned,A.placement,A.x,A.y]),x.useEffect(()=>{R.isPositioned&&l("beacon",{placement:R.placement,x:R.x??0,y:R.y??0,middlewareData:k.current})},[l,R.isPositioned,R.placement,R.x,R.y]);const V=p.zIndex+100,L=x.useCallback(q=>{q.type==="mouseenter"&&p.beaconTrigger!=="hover"||m({lifecycle:de.TOOLTIP_BEFORE,positioned:!1})},[p.beaconTrigger,m]),H=x.useCallback(q=>{q&&(A.refs.setFloating(q),u(q))},[A.refs,u]),{arrow:D,floater:$}=p.styles;let _=null;if(i===de.TOOLTIP||i===de.TOOLTIP_BEFORE){const q=q1({...$,...A.floatingStyles,zIndex:V,opacity:s&&A.isPositioned?1:0,...!s&&{transition:"none"}});_=ke.createElement("div",{ref:H,className:"react-joyride__floater","data-testid":"floater",id:`react-joyride-step-${r}`,style:q},ke.createElement($q,{continuous:t,controls:n,index:r,isLastStep:r+1===d,size:d,step:p}),!w&&!((O=p.floatingOptions)!=null&&O.hideArrow)&&ke.createElement(Oq,{arrowComponent:p.arrowComponent,arrowRef:v,base:p.arrowBase,placement:A.placement,position:A.middlewareData.arrow,size:p.arrowSize,styles:D}))}else(i===de.BEACON||i===de.BEACON_BEFORE)&&(_=ke.createElement("div",{ref:R.refs.setFloating,className:"react-joyride__floater","data-testid":"floater-beacon",id:`react-joyride-step-${r}-beacon`,style:q1({...R.floatingStyles,zIndex:V})},ke.createElement(Mq,{beaconComponent:p.beaconComponent,continuous:t,index:r,isLastStep:r+1===d,locale:p.locale,nonce:o,onInteract:L,shouldFocus:f,size:d,step:p,styles:p.styles})));return ke.createElement(DP,{element:a},_)}function Uq(e){const{continuous:t,controls:n,index:r,lifecycle:i,nonce:o,portalElement:s,setPositionData:a,shouldScroll:l,size:u,step:f,updateState:d}=e,[p,h]=x.useState(null);Tq(f.disableFocusTrap?null:p,"[data-action=primary]");const m=Yn(f.target),v=i===de.TOOLTIP;return!OP(f)||!Qt.domElement(m)?null:ke.createElement(Hq,{key:`JoyrideStep-${r}`,continuous:t,controls:n,index:r,lifecycle:i,nonce:o,open:v,portalElement:s,setPositionData:a,setTooltipRef:h,shouldScroll:l,size:u,step:f,target:m,updateState:d})}function Vq({controls:e,mergedProps:t,state:n,step:r,store:i}){const{continuous:o,debug:s,nonce:a,portalElement:l,scrollToFirstStep:u}=t,f=kq(l),{index:d,lifecycle:p,status:h}=n,m=h===Me.RUNNING,[v,k]=x.useState(!1),g=x.useRef(null),w=(r==null?void 0:r.loaderDelay)??0;x.useEffect(()=>(n.waiting?w===0?k(!0):g.current=setTimeout(()=>{k(!0)},w):k(!1),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[w,n.waiting]),x.useEffect(()=>{if(!m)return;const E=S=>{!r||p!==de.TOOLTIP||S.key==="Escape"&&r.dismissKeyAction&&(r.dismissKeyAction==="next"?e.next(Rr.KEYBOARD):e.close(Rr.KEYBOARD))};return document.body.addEventListener("keydown",E,{passive:!0}),()=>{document.body.removeEventListener("keydown",E)}},[e,m,p,r]);const y=x.useCallback(()=>{(r==null?void 0:r.overlayClickAction)==="close"?e.close(Rr.OVERLAY):(r==null?void 0:r.overlayClickAction)==="next"&&e.next(Rr.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 ke.createElement(ke.Fragment,null,p!==de.INIT&&ke.createElement(Uq,{...n,continuous:o,controls:e,debug:s,nonce:a,portalElement:f,setPositionData:i.current.setPositionData,shouldScroll:!r.skipScroll&&(d!==0||u),step:r,updateState:i.current.updateState}),ke.createElement(DP,{element:f},ke.createElement(ke.Fragment,null,v&&ke.createElement(Cq,{nonce:a,step:r}),!N&&ke.createElement(Iq,{...r,continuous:o,lifecycle:p,onClickOverlay:y,portalElement:l?f:null,scrolling:n.scrolling,waiting:n.waiting}))))}function Wq(e){const{controls:t,failures:n,mergedProps:r,state:i,step:o,store:s}=Sq(e);return{controls:t,failures:n,on:x.useCallback((a,l)=>s.current.on(a,l),[s]),state:x.useMemo(()=>If(i,"positioned"),[i]),step:o,Tour:Mx()?ke.createElement(Vq,{controls:t,mergedProps:r,state:i,step:o,store:s}):null}}function Kq(e){const{Tour:t}=Wq(e);return t}function Yq(e){return Mx()?ke.createElement(Kq,e):null}function qq(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 Gq(e){return[{target:"body",content:e("onboarding:flow.intro"),disableBeacon:!0,placement:"center"}]}function Xq(e){return[{target:"body",content:e("onboarding:flow.introEmpty"),disableBeacon:!0,placement:"center"}]}const om="af:onboarding";function Qq({page:e,hasNodes:t=!1}){const{t:n}=rt(),[r,i]=x.useState(!1),[o,s]=x.useState([]),a=x.useRef(null),l=x.useMemo(()=>e==="projects"?qq(n):t?Gq(n):Xq(n),[e,t,n]);return x.useEffect(()=>{const u=localStorage.getItem(om);console.log("[Onboarding] localStorage:",u);const f=u?JSON.parse(u):{};if(console.log("[Onboarding] progress:",f,"page:",e),f.completed||f[e]){console.log("[Onboarding] skipped - already done"),i(!1),s([]);return}console.log("[Onboarding] starting with steps:",l),s(l),i(!0)},[e,t,l]),x.useEffect(()=>{if(!r)return;const u=f=>{var m;const d=f.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 v=localStorage.getItem(om)||"{}",k=JSON.parse(v);h===n("onboarding:skip")?(k.projects=!0,k.flow=!0,k.completed=!0):k[e]=!0,localStorage.setItem(om,JSON.stringify(k)),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:c.jsx(Yq,{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 Jq(){const{navigate:e,path:t}=xa(),[n,r]=x.useState([]),[i,o]=x.useState(!1);if(x.useEffect(()=>{let f=!1;const d=async()=>{try{const h=await fetch("/api/pipeline-recent-runs");if(!h.ok)return;const m=await h.json();if(f)return;const v=Array.isArray(m.runs)?m.runs:[];r(v.filter(k=>k&&k.status==="running"))}catch{}};d();const p=window.setInterval(d,3e3);return()=>{f=!0,window.clearInterval(p)}},[]),n.length===0)return null;const s=f=>{const d=new URLSearchParams({flowId:f.flowId,flowSource:f.flowSource||"workspace"});e(`/flow?${d.toString()}`),o(!1)},a=t==="/flow"?new URLSearchParams(window.location.search):null,l=(a==null?void 0:a.get("flowId"))||"",u=n.length===1;return c.jsxs("div",{className:"af-run-indicator",role:"status","aria-live":"polite",children:[i&&!u&&c.jsx("div",{className:"af-run-indicator__menu",onMouseLeave:()=>o(!1),children:n.map(f=>c.jsxs("button",{type:"button",className:"af-run-indicator__item"+(f.flowId===l?" af-run-indicator__item--current":""),onClick:()=>s(f),title:`${f.flowId} · ${f.runId}`,children:[c.jsx("span",{className:"af-run-indicator__dot"}),c.jsx("span",{className:"af-run-indicator__flow",children:f.flowId}),c.jsx("span",{className:"af-run-indicator__run",children:f.runId.slice(0,12)})]},`${f.flowId}:${f.runId}`))}),c.jsxs("button",{type:"button",className:"af-run-indicator__btn",onClick:()=>u?s(n[0]):o(f=>!f),title:u?`${n[0].flowId} 运行中,点击跳转`:`${n.length} 个 pipeline 运行中`,children:[c.jsx("span",{className:"af-run-indicator__pulse"}),c.jsx("span",{className:"af-run-indicator__label",children:u?n[0].flowId:`${n.length} running`})]})]})}function Zq(){const{path:e}=xa();return e==="/projects"||e==="/"?c.jsx(_0,{}):e==="/flow"?c.jsx(X8,{}):e==="/settings"?c.jsx(BW,{}):c.jsx(_0,{})}function eG(){const{path:e}=xa(),t=e==="/flow";return c.jsxs("div",{className:"af-app",children:[e!=="/settings"?c.jsx(Qq,{page:t?"flow":"projects"}):null,t?null:c.jsx(SA,{}),c.jsx("div",{className:t?"af-main af-main--pipeline":"af-main",children:c.jsx(Zq,{})}),c.jsx(Jq,{})]})}function tG(){return c.jsx(rA,{children:c.jsx(eG,{})})}const eS=document.querySelector('link[rel="icon"]');eS&&(eS.href=gN);sm.createRoot(document.getElementById("root")).render(c.jsx(ke.StrictMode,{children:c.jsx(tG,{})}));
|