@agentic-surfaces/server 0.1.29 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,298 +0,0 @@
1
- var xS=Object.defineProperty;var bS=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>bS(e,typeof t!="symbol"?t+"":t,n);function kS(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(i,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rf={exports:{}},ho={},Lf={exports:{}},Oe={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Qg;function SS(){if(Qg)return Oe;Qg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),d=Symbol.iterator;function g($){return $===null||typeof $!="object"?null:($=d&&$[d]||$["@@iterator"],typeof $=="function"?$:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function b($,U,W){this.props=$,this.context=U,this.refs=w,this.updater=W||v}b.prototype.isReactComponent={},b.prototype.setState=function($,U){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,U,"setState")},b.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function S(){}S.prototype=b.prototype;function _($,U,W){this.props=$,this.context=U,this.refs=w,this.updater=W||v}var E=_.prototype=new S;E.constructor=_,x(E,b.prototype),E.isPureReactComponent=!0;var T=Array.isArray,A=Object.prototype.hasOwnProperty,R={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function C($,U,W){var K,J={},re=null,oe=null;if(U!=null)for(K in U.ref!==void 0&&(oe=U.ref),U.key!==void 0&&(re=""+U.key),U)A.call(U,K)&&!M.hasOwnProperty(K)&&(J[K]=U[K]);var ee=arguments.length-2;if(ee===1)J.children=W;else if(1<ee){for(var se=Array(ee),de=0;de<ee;de++)se[de]=arguments[de+2];J.children=se}if($&&$.defaultProps)for(K in ee=$.defaultProps,ee)J[K]===void 0&&(J[K]=ee[K]);return{$$typeof:e,type:$,key:re,ref:oe,props:J,_owner:R.current}}function P($,U){return{$$typeof:e,type:$.type,key:U,ref:$.ref,props:$.props,_owner:$._owner}}function j($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function L($){var U={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(W){return U[W]})}var D=/\/+/g;function X($,U){return typeof $=="object"&&$!==null&&$.key!=null?L(""+$.key):U.toString(36)}function z($,U,W,K,J){var re=typeof $;(re==="undefined"||re==="boolean")&&($=null);var oe=!1;if($===null)oe=!0;else switch(re){case"string":case"number":oe=!0;break;case"object":switch($.$$typeof){case e:case t:oe=!0}}if(oe)return oe=$,J=J(oe),$=K===""?"."+X(oe,0):K,T(J)?(W="",$!=null&&(W=$.replace(D,"$&/")+"/"),z(J,U,W,"",function(de){return de})):J!=null&&(j(J)&&(J=P(J,W+(!J.key||oe&&oe.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+$)),U.push(J)),1;if(oe=0,K=K===""?".":K+":",T($))for(var ee=0;ee<$.length;ee++){re=$[ee];var se=K+X(re,ee);oe+=z(re,U,W,se,J)}else if(se=g($),typeof se=="function")for($=se.call($),ee=0;!(re=$.next()).done;)re=re.value,se=K+X(re,ee++),oe+=z(re,U,W,se,J);else if(re==="object")throw U=String($),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return oe}function G($,U,W){if($==null)return $;var K=[],J=0;return z($,K,"","",function(re){return U.call(W,re,J++)}),K}function Y($){if($._status===-1){var U=$._result;U=U(),U.then(function(W){($._status===0||$._status===-1)&&($._status=1,$._result=W)},function(W){($._status===0||$._status===-1)&&($._status=2,$._result=W)}),$._status===-1&&($._status=0,$._result=U)}if($._status===1)return $._result.default;throw $._result}var Z={current:null},H={transition:null},B={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:H,ReactCurrentOwner:R};function V(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:G,forEach:function($,U,W){G($,function(){U.apply(this,arguments)},W)},count:function($){var U=0;return G($,function(){U++}),U},toArray:function($){return G($,function(U){return U})||[]},only:function($){if(!j($))throw Error("React.Children.only expected to receive a single React element child.");return $}},Oe.Component=b,Oe.Fragment=n,Oe.Profiler=o,Oe.PureComponent=_,Oe.StrictMode=i,Oe.Suspense=f,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,Oe.act=V,Oe.cloneElement=function($,U,W){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var K=x({},$.props),J=$.key,re=$.ref,oe=$._owner;if(U!=null){if(U.ref!==void 0&&(re=U.ref,oe=R.current),U.key!==void 0&&(J=""+U.key),$.type&&$.type.defaultProps)var ee=$.type.defaultProps;for(se in U)A.call(U,se)&&!M.hasOwnProperty(se)&&(K[se]=U[se]===void 0&&ee!==void 0?ee[se]:U[se])}var se=arguments.length-2;if(se===1)K.children=W;else if(1<se){ee=Array(se);for(var de=0;de<se;de++)ee[de]=arguments[de+2];K.children=ee}return{$$typeof:e,type:$.type,key:J,ref:re,props:K,_owner:oe}},Oe.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:a,_context:$},$.Consumer=$},Oe.createElement=C,Oe.createFactory=function($){var U=C.bind(null,$);return U.type=$,U},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function($){return{$$typeof:c,render:$}},Oe.isValidElement=j,Oe.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:Y}},Oe.memo=function($,U){return{$$typeof:h,type:$,compare:U===void 0?null:U}},Oe.startTransition=function($){var U=H.transition;H.transition={};try{$()}finally{H.transition=U}},Oe.unstable_act=V,Oe.useCallback=function($,U){return Z.current.useCallback($,U)},Oe.useContext=function($){return Z.current.useContext($)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function($){return Z.current.useDeferredValue($)},Oe.useEffect=function($,U){return Z.current.useEffect($,U)},Oe.useId=function(){return Z.current.useId()},Oe.useImperativeHandle=function($,U,W){return Z.current.useImperativeHandle($,U,W)},Oe.useInsertionEffect=function($,U){return Z.current.useInsertionEffect($,U)},Oe.useLayoutEffect=function($,U){return Z.current.useLayoutEffect($,U)},Oe.useMemo=function($,U){return Z.current.useMemo($,U)},Oe.useReducer=function($,U,W){return Z.current.useReducer($,U,W)},Oe.useRef=function($){return Z.current.useRef($)},Oe.useState=function($){return Z.current.useState($)},Oe.useSyncExternalStore=function($,U,W){return Z.current.useSyncExternalStore($,U,W)},Oe.useTransition=function(){return Z.current.useTransition()},Oe.version="18.3.1",Oe}var Jg;function Fo(){return Jg||(Jg=1,Lf.exports=SS()),Lf.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Zg;function ES(){if(Zg)return ho;Zg=1;var e=Fo(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,h){var m,d={},g=null,v=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(v=f.ref);for(m in f)i.call(f,m)&&!a.hasOwnProperty(m)&&(d[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)d[m]===void 0&&(d[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:v,props:d,_owner:o.current}}return ho.Fragment=n,ho.jsx=l,ho.jsxs=l,ho}var ey;function NS(){return ey||(ey=1,Rf.exports=ES()),Rf.exports}var N=NS(),O=Fo();const Rh=pu(O),Lh=kS({__proto__:null,default:Rh},[O]);var pl={},jf={exports:{}},At={},Df={exports:{}},$f={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var ty;function _S(){return ty||(ty=1,(function(e){function t(H,B){var V=H.length;H.push(B);e:for(;0<V;){var $=V-1>>>1,U=H[$];if(0<o(U,B))H[$]=B,H[V]=U,V=$;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var B=H[0],V=H.pop();if(V!==B){H[0]=V;e:for(var $=0,U=H.length,W=U>>>1;$<W;){var K=2*($+1)-1,J=H[K],re=K+1,oe=H[re];if(0>o(J,V))re<U&&0>o(oe,J)?(H[$]=oe,H[re]=V,$=re):(H[$]=J,H[K]=V,$=K);else if(re<U&&0>o(oe,V))H[$]=oe,H[re]=V,$=re;else break e}}return B}function o(H,B){var V=H.sortIndex-B.sortIndex;return V!==0?V:H.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],m=1,d=null,g=3,v=!1,x=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(H){for(var B=n(h);B!==null;){if(B.callback===null)i(h);else if(B.startTime<=H)i(h),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(h)}}function T(H){if(w=!1,E(H),!x)if(n(f)!==null)x=!0,Y(A);else{var B=n(h);B!==null&&Z(T,B.startTime-H)}}function A(H,B){x=!1,w&&(w=!1,S(C),C=-1),v=!0;var V=g;try{for(E(B),d=n(f);d!==null&&(!(d.expirationTime>B)||H&&!L());){var $=d.callback;if(typeof $=="function"){d.callback=null,g=d.priorityLevel;var U=$(d.expirationTime<=B);B=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(f)&&i(f),E(B)}else i(f);d=n(f)}if(d!==null)var W=!0;else{var K=n(h);K!==null&&Z(T,K.startTime-B),W=!1}return W}finally{d=null,g=V,v=!1}}var R=!1,M=null,C=-1,P=5,j=-1;function L(){return!(e.unstable_now()-j<P)}function D(){if(M!==null){var H=e.unstable_now();j=H;var B=!0;try{B=M(!0,H)}finally{B?X():(R=!1,M=null)}}else R=!1}var X;if(typeof _=="function")X=function(){_(D)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,G=z.port2;z.port1.onmessage=D,X=function(){G.postMessage(null)}}else X=function(){b(D,0)};function Y(H){M=H,R||(R=!0,X())}function Z(H,B){C=b(function(){H(e.unstable_now())},B)}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(H){H.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,Y(A))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var B=3;break;default:B=g}var V=g;g=B;try{return H()}finally{g=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,B){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=g;g=H;try{return B()}finally{g=V}},e.unstable_scheduleCallback=function(H,B,V){var $=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?$+V:$):V=$,H){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=V+U,H={id:m++,callback:B,priorityLevel:H,startTime:V,expirationTime:U,sortIndex:-1},V>$?(H.sortIndex=V,t(h,H),n(f)===null&&H===n(h)&&(w?(S(C),C=-1):w=!0,Z(T,V-$))):(H.sortIndex=U,t(f,H),x||v||(x=!0,Y(A))),H},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(H){var B=g;return function(){var V=g;g=B;try{return H.apply(this,arguments)}finally{g=V}}}})($f)),$f}var ny;function CS(){return ny||(ny=1,Df.exports=_S()),Df.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 ry;function TS(){if(ry)return At;ry=1;var e=Fo(),t=CS();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},d={};function g(r){return f.call(d,r)?!0:f.call(m,r)?!1:h.test(r)?d[r]=!0:(m[r]=!0,!1)}function v(r,s,u,p){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,s,u,p){if(s===null||typeof s>"u"||v(r,s,u,p))return!0;if(p)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(r,s,u,p,y,k,I){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=k,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){b[r]=new w(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];b[s]=new w(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){b[r]=new w(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){b[r]=new w(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){b[r]=new w(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){b[r]=new w(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){b[r]=new w(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){b[r]=new w(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){b[r]=new w(r,5,!1,r.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function _(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(S,_);b[s]=new w(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(S,_);b[s]=new w(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(S,_);b[s]=new w(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,s,u,p){var y=b.hasOwnProperty(s)?b[s]:null;(y!==null?y.type!==0:p||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(x(s,u,y,p)&&(u=null),p||y===null?g(s)&&(u===null?r.removeAttribute(s):r.setAttribute(s,""+u)):y.mustUseProperty?r[y.propertyName]=u===null?y.type===3?!1:"":u:(s=y.attributeName,p=y.attributeNamespace,u===null?r.removeAttribute(s):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,p?r.setAttributeNS(p,s,u):r.setAttribute(s,u))))}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),R=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),L=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),H=Symbol.iterator;function B(r){return r===null||typeof r!="object"?null:(r=H&&r[H]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,$;function U(r){if($===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);$=s&&s[1]||""}return`
34
- `+$+r}var W=!1;function K(r,s){if(!r||W)return"";W=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(ie){var p=ie}Reflect.construct(r,[],s)}else{try{s.call()}catch(ie){p=ie}r.call(s.prototype)}else{try{throw Error()}catch(ie){p=ie}r()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var y=ie.stack.split(`
35
- `),k=p.stack.split(`
36
- `),I=y.length-1,F=k.length-1;1<=I&&0<=F&&y[I]!==k[F];)F--;for(;1<=I&&0<=F;I--,F--)if(y[I]!==k[F]){if(I!==1||F!==1)do if(I--,F--,0>F||y[I]!==k[F]){var q=`
37
- `+y[I].replace(" at new "," at ");return r.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",r.displayName)),q}while(1<=I&&0<=F);break}}}finally{W=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?U(r):""}function J(r){switch(r.tag){case 5:return U(r.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return r=K(r.type,!1),r;case 11:return r=K(r.type.render,!1),r;case 1:return r=K(r.type,!0),r;default:return""}}function re(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case M:return"Fragment";case R:return"Portal";case P:return"Profiler";case C:return"StrictMode";case X:return"Suspense";case z:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case L:return(r.displayName||"Context")+".Consumer";case j:return(r._context.displayName||"Context")+".Provider";case D:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case G:return s=r.displayName||null,s!==null?s:re(r.type)||"Memo";case Y:s=r._payload,r=r._init;try{return re(r(s))}catch{}}return null}function oe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(s);case 8:return s===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ee(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function se(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function de(r){var s=se(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),p=""+r[s];if(!r.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,k=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(I){p=""+I,k.call(this,I)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(I){p=""+I},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function xe(r){r._valueTracker||(r._valueTracker=de(r))}function he(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return r&&(p=se(r)?r.checked?"true":"false":r.value),r=p,r!==u?(s.setValue(r),!0):!1}function fe(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Se(r,s){var u=s.checked;return V({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Pe(r,s){var u=s.defaultValue==null?"":s.defaultValue,p=s.checked!=null?s.checked:s.defaultChecked;u=ee(s.value!=null?s.value:u),r._wrapperState={initialChecked:p,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Ae(r,s){s=s.checked,s!=null&&E(r,"checked",s,!1)}function Fe(r,s){Ae(r,s);var u=ee(s.value),p=s.type;if(u!=null)p==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(p==="submit"||p==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Nt(r,s.type,u):s.hasOwnProperty("defaultValue")&&Nt(r,s.type,ee(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function wt(r,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var p=s.type;if(!(p!=="submit"&&p!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,u||s===r.value||(r.value=s),r.defaultValue=s}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Nt(r,s,u){(s!=="number"||fe(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var ht=Array.isArray;function pt(r,s,u,p){if(r=r.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=s.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+ee(u),s=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}s!==null||r[y].disabled||(s=r[y])}s!==null&&(s.selected=!0)}}function jn(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function bn(r,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(ht(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:ee(u)}}function kn(r,s){var u=ee(s.value),p=ee(s.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),s.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),p!=null&&(r.defaultValue=""+p)}function _t(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Ht(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lt(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Ht(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var qt,Xo=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,p,y){MSApp.execUnsafeLocalFunction(function(){return r(s,u,p,y)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(qt=qt||document.createElement("div"),qt.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=qt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Dn(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var Rr={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},Bu=["Webkit","ms","Moz","O"];Object.keys(Rr).forEach(function(r){Bu.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Rr[s]=Rr[r]})});function Qo(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Rr.hasOwnProperty(r)&&Rr[r]?(""+s).trim():s+"px"}function Jo(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var p=u.indexOf("--")===0,y=Qo(u,s[u],p);u==="float"&&(u="cssFloat"),p?r.setProperty(u,y):r[u]=y}}var Vu=V({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 Ss(r,s){if(s){if(Vu[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Es(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ns=null;function _s(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Cs=null,nr=null,rr=null;function Zo(r){if(r=Qs(r)){if(typeof Cs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Ia(s),Cs(r.stateNode,r.type,s))}}function ea(r){nr?rr?rr.push(r):rr=[r]:nr=r}function ta(){if(nr){var r=nr,s=rr;if(rr=nr=null,Zo(r),s)for(r=0;r<s.length;r++)Zo(s[r])}}function na(r,s){return r(s)}function ra(){}var Ts=!1;function ia(r,s,u){if(Ts)return r(s,u);Ts=!0;try{return na(r,s,u)}finally{Ts=!1,(nr!==null||rr!==null)&&(ra(),ta())}}function Lr(r,s){var u=r.stateNode;if(u===null)return null;var p=Ia(u);if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var Is=!1;if(c)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){Is=!0}}),window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{Is=!1}function Wu(r,s,u,p,y,k,I,F,q){var ie=Array.prototype.slice.call(arguments,3);try{s.apply(u,ie)}catch(le){this.onError(le)}}var Dr=!1,pi=null,mi=!1,Os=null,Uu={onError:function(r){Dr=!0,pi=r}};function Hu(r,s,u,p,y,k,I,F,q){Dr=!1,pi=null,Wu.apply(Uu,arguments)}function qu(r,s,u,p,y,k,I,F,q){if(Hu.apply(this,arguments),Dr){if(Dr){var ie=pi;Dr=!1,pi=null}else throw Error(n(198));mi||(mi=!0,Os=ie)}}function Sn(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function Ps(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function As(r){if(Sn(r)!==r)throw Error(n(188))}function Yu(r){var s=r.alternate;if(!s){if(s=Sn(r),s===null)throw Error(n(188));return s!==r?null:r}for(var u=r,p=s;;){var y=u.return;if(y===null)break;var k=y.alternate;if(k===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===k.child){for(k=y.child;k;){if(k===u)return As(y),r;if(k===p)return As(y),s;k=k.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=k;else{for(var I=!1,F=y.child;F;){if(F===u){I=!0,u=y,p=k;break}if(F===p){I=!0,p=y,u=k;break}F=F.sibling}if(!I){for(F=k.child;F;){if(F===u){I=!0,u=k,p=y;break}if(F===p){I=!0,p=k,u=y;break}F=F.sibling}if(!I)throw Error(n(189))}}if(u.alternate!==p)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:s}function sa(r){return r=Yu(r),r!==null?oa(r):null}function oa(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=oa(r);if(s!==null)return s;r=r.sibling}return null}var aa=t.unstable_scheduleCallback,la=t.unstable_cancelCallback,Ku=t.unstable_shouldYield,ua=t.unstable_requestPaint,Ye=t.unstable_now,Gu=t.unstable_getCurrentPriorityLevel,Ms=t.unstable_ImmediatePriority,ca=t.unstable_UserBlockingPriority,gi=t.unstable_NormalPriority,Xu=t.unstable_LowPriority,fa=t.unstable_IdlePriority,yi=null,jt=null;function Qu(r){if(jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(yi,r,void 0,(r.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:ec,Ju=Math.log,Zu=Math.LN2;function ec(r){return r>>>=0,r===0?32:31-(Ju(r)/Zu|0)|0}var vi=64,wi=4194304;function $r(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function $n(r,s){var u=r.pendingLanes;if(u===0)return 0;var p=0,y=r.suspendedLanes,k=r.pingedLanes,I=u&268435455;if(I!==0){var F=I&~y;F!==0?p=$r(F):(k&=I,k!==0&&(p=$r(k)))}else I=u&~y,I!==0?p=$r(I):k!==0&&(p=$r(k));if(p===0)return 0;if(s!==0&&s!==p&&(s&y)===0&&(y=p&-p,k=s&-s,y>=k||y===16&&(k&4194240)!==0))return s;if((p&4)!==0&&(p|=u&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=p;0<s;)u=31-Dt(s),y=1<<u,p|=r[u],s&=~y;return p}function tc(r,s){switch(r){case 1:case 2:case 4:return s+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 s+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 da(r,s){for(var u=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,k=r.pendingLanes;0<k;){var I=31-Dt(k),F=1<<I,q=y[I];q===-1?((F&u)===0||(F&p)!==0)&&(y[I]=tc(F,s)):q<=s&&(r.expiredLanes|=F),k&=~F}}function Rs(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function ha(){var r=vi;return vi<<=1,(vi&4194240)===0&&(vi=64),r}function zr(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function Fr(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Dt(s),r[s]=u}function nc(r,s){var u=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var p=r.eventTimes;for(r=r.expirationTimes;0<u;){var y=31-Dt(u),k=1<<y;s[y]=0,p[y]=-1,r[y]=-1,u&=~k}}function xi(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var p=31-Dt(u),y=1<<p;y&s|r[p]&s&&(r[p]|=s),u&=~y}}var De=0;function Ip(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Op,rc,Pp,Ap,Mp,ic=!1,pa=[],ir=null,sr=null,or=null,Ls=new Map,js=new Map,ar=[],Vb="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 Rp(r,s){switch(r){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ls.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(s.pointerId)}}function Ds(r,s,u,p,y,k){return r===null||r.nativeEvent!==k?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:k,targetContainers:[y]},s!==null&&(s=Qs(s),s!==null&&rc(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),r)}function Wb(r,s,u,p,y){switch(s){case"focusin":return ir=Ds(ir,r,s,u,p,y),!0;case"dragenter":return sr=Ds(sr,r,s,u,p,y),!0;case"mouseover":return or=Ds(or,r,s,u,p,y),!0;case"pointerover":var k=y.pointerId;return Ls.set(k,Ds(Ls.get(k)||null,r,s,u,p,y)),!0;case"gotpointercapture":return k=y.pointerId,js.set(k,Ds(js.get(k)||null,r,s,u,p,y)),!0}return!1}function Lp(r){var s=Br(r.target);if(s!==null){var u=Sn(s);if(u!==null){if(s=u.tag,s===13){if(s=Ps(u),s!==null){r.blockedOn=s,Mp(r.priority,function(){Pp(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ma(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=oc(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);Ns=p,u.target.dispatchEvent(p),Ns=null}else return s=Qs(u),s!==null&&rc(s),r.blockedOn=u,!1;s.shift()}return!0}function jp(r,s,u){ma(r)&&u.delete(s)}function Ub(){ic=!1,ir!==null&&ma(ir)&&(ir=null),sr!==null&&ma(sr)&&(sr=null),or!==null&&ma(or)&&(or=null),Ls.forEach(jp),js.forEach(jp)}function $s(r,s){r.blockedOn===s&&(r.blockedOn=null,ic||(ic=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ub)))}function zs(r){function s(y){return $s(y,r)}if(0<pa.length){$s(pa[0],r);for(var u=1;u<pa.length;u++){var p=pa[u];p.blockedOn===r&&(p.blockedOn=null)}}for(ir!==null&&$s(ir,r),sr!==null&&$s(sr,r),or!==null&&$s(or,r),Ls.forEach(s),js.forEach(s),u=0;u<ar.length;u++)p=ar[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<ar.length&&(u=ar[0],u.blockedOn===null);)Lp(u),u.blockedOn===null&&ar.shift()}var bi=T.ReactCurrentBatchConfig,ga=!0;function Hb(r,s,u,p){var y=De,k=bi.transition;bi.transition=null;try{De=1,sc(r,s,u,p)}finally{De=y,bi.transition=k}}function qb(r,s,u,p){var y=De,k=bi.transition;bi.transition=null;try{De=4,sc(r,s,u,p)}finally{De=y,bi.transition=k}}function sc(r,s,u,p){if(ga){var y=oc(r,s,u,p);if(y===null)Sc(r,s,p,ya,u),Rp(r,p);else if(Wb(y,r,s,u,p))p.stopPropagation();else if(Rp(r,p),s&4&&-1<Vb.indexOf(r)){for(;y!==null;){var k=Qs(y);if(k!==null&&Op(k),k=oc(r,s,u,p),k===null&&Sc(r,s,p,ya,u),k===y)break;y=k}y!==null&&p.stopPropagation()}else Sc(r,s,p,null,u)}}var ya=null;function oc(r,s,u,p){if(ya=null,r=_s(p),r=Br(r),r!==null)if(s=Sn(r),s===null)r=null;else if(u=s.tag,u===13){if(r=Ps(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return ya=r,null}function Dp(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gu()){case Ms:return 1;case ca:return 4;case gi:case Xu:return 16;case fa:return 536870912;default:return 16}default:return 16}}var lr=null,ac=null,va=null;function $p(){if(va)return va;var r,s=ac,u=s.length,p,y="value"in lr?lr.value:lr.textContent,k=y.length;for(r=0;r<u&&s[r]===y[r];r++);var I=u-r;for(p=1;p<=I&&s[u-p]===y[k-p];p++);return va=y.slice(r,1<p?1-p:void 0)}function wa(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function xa(){return!0}function zp(){return!1}function $t(r){function s(u,p,y,k,I){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var F in r)r.hasOwnProperty(F)&&(u=r[F],this[F]=u?u(k):k[F]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?xa:zp,this.isPropagationStopped=zp,this}return V(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=xa)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=xa)},persist:function(){},isPersistent:xa}),s}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lc=$t(ki),Fs=V({},ki,{view:0,detail:0}),Yb=$t(Fs),uc,cc,Bs,ba=V({},Fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bs&&(Bs&&r.type==="mousemove"?(uc=r.screenX-Bs.screenX,cc=r.screenY-Bs.screenY):cc=uc=0,Bs=r),uc)},movementY:function(r){return"movementY"in r?r.movementY:cc}}),Fp=$t(ba),Kb=V({},ba,{dataTransfer:0}),Gb=$t(Kb),Xb=V({},Fs,{relatedTarget:0}),fc=$t(Xb),Qb=V({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),Jb=$t(Qb),Zb=V({},ki,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ek=$t(Zb),tk=V({},ki,{data:0}),Bp=$t(tk),nk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rk={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"},ik={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sk(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=ik[r])?!!s[r]:!1}function dc(){return sk}var ok=V({},Fs,{key:function(r){if(r.key){var s=nk[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=wa(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?rk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dc,charCode:function(r){return r.type==="keypress"?wa(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?wa(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ak=$t(ok),lk=V({},ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vp=$t(lk),uk=V({},Fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dc}),ck=$t(uk),fk=V({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),dk=$t(fk),hk=V({},ba,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),pk=$t(hk),mk=[9,13,27,32],hc=c&&"CompositionEvent"in window,Vs=null;c&&"documentMode"in document&&(Vs=document.documentMode);var gk=c&&"TextEvent"in window&&!Vs,Wp=c&&(!hc||Vs&&8<Vs&&11>=Vs),Up=" ",Hp=!1;function qp(r,s){switch(r){case"keyup":return mk.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Si=!1;function yk(r,s){switch(r){case"compositionend":return Yp(s);case"keypress":return s.which!==32?null:(Hp=!0,Up);case"textInput":return r=s.data,r===Up&&Hp?null:r;default:return null}}function vk(r,s){if(Si)return r==="compositionend"||!hc&&qp(r,s)?(r=$p(),va=ac=lr=null,Si=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Wp&&s.locale!=="ko"?null:s.data;default:return null}}var wk={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 Kp(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!wk[r.type]:s==="textarea"}function Gp(r,s,u,p){ea(p),s=_a(s,"onChange"),0<s.length&&(u=new lc("onChange","change",null,u,p),r.push({event:u,listeners:s}))}var Ws=null,Us=null;function xk(r){hm(r,0)}function ka(r){var s=Ti(r);if(he(s))return r}function bk(r,s){if(r==="change")return s}var Xp=!1;if(c){var pc;if(c){var mc="oninput"in document;if(!mc){var Qp=document.createElement("div");Qp.setAttribute("oninput","return;"),mc=typeof Qp.oninput=="function"}pc=mc}else pc=!1;Xp=pc&&(!document.documentMode||9<document.documentMode)}function Jp(){Ws&&(Ws.detachEvent("onpropertychange",Zp),Us=Ws=null)}function Zp(r){if(r.propertyName==="value"&&ka(Us)){var s=[];Gp(s,Us,r,_s(r)),ia(xk,s)}}function kk(r,s,u){r==="focusin"?(Jp(),Ws=s,Us=u,Ws.attachEvent("onpropertychange",Zp)):r==="focusout"&&Jp()}function Sk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ka(Us)}function Ek(r,s){if(r==="click")return ka(s)}function Nk(r,s){if(r==="input"||r==="change")return ka(s)}function _k(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var sn=typeof Object.is=="function"?Object.is:_k;function Hs(r,s){if(sn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!f.call(s,y)||!sn(r[y],s[y]))return!1}return!0}function em(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function tm(r,s){var u=em(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=s&&p>=s)return{node:u,offset:s-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=em(u)}}function nm(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?nm(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function rm(){for(var r=window,s=fe();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=fe(r.document)}return s}function gc(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function Ck(r){var s=rm(),u=r.focusedElem,p=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&nm(u.ownerDocument.documentElement,u)){if(p!==null&&gc(u)){if(s=p.start,r=p.end,r===void 0&&(r=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(r,u.value.length);else if(r=(s=u.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var y=u.textContent.length,k=Math.min(p.start,y);p=p.end===void 0?k:Math.min(p.end,y),!r.extend&&k>p&&(y=p,p=k,k=y),y=tm(u,k);var I=tm(u,p);y&&I&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==I.node||r.focusOffset!==I.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),r.removeAllRanges(),k>p?(r.addRange(s),r.extend(I.node,I.offset)):(s.setEnd(I.node,I.offset),r.addRange(s)))}}for(s=[],r=u;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)r=s[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var Tk=c&&"documentMode"in document&&11>=document.documentMode,Ei=null,yc=null,qs=null,vc=!1;function im(r,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;vc||Ei==null||Ei!==fe(p)||(p=Ei,"selectionStart"in p&&gc(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),qs&&Hs(qs,p)||(qs=p,p=_a(yc,"onSelect"),0<p.length&&(s=new lc("onSelect","select",null,s,u),r.push({event:s,listeners:p}),s.target=Ei)))}function Sa(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Ni={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},wc={},sm={};c&&(sm=document.createElement("div").style,"AnimationEvent"in window||(delete Ni.animationend.animation,delete Ni.animationiteration.animation,delete Ni.animationstart.animation),"TransitionEvent"in window||delete Ni.transitionend.transition);function Ea(r){if(wc[r])return wc[r];if(!Ni[r])return r;var s=Ni[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in sm)return wc[r]=s[u];return r}var om=Ea("animationend"),am=Ea("animationiteration"),lm=Ea("animationstart"),um=Ea("transitionend"),cm=new Map,fm="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 ur(r,s){cm.set(r,s),a(s,[r])}for(var xc=0;xc<fm.length;xc++){var bc=fm[xc],Ik=bc.toLowerCase(),Ok=bc[0].toUpperCase()+bc.slice(1);ur(Ik,"on"+Ok)}ur(om,"onAnimationEnd"),ur(am,"onAnimationIteration"),ur(lm,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(um,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),Pk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ys));function dm(r,s,u){var p=r.type||"unknown-event";r.currentTarget=u,qu(p,s,void 0,r),r.currentTarget=null}function hm(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],y=p.event;p=p.listeners;e:{var k=void 0;if(s)for(var I=p.length-1;0<=I;I--){var F=p[I],q=F.instance,ie=F.currentTarget;if(F=F.listener,q!==k&&y.isPropagationStopped())break e;dm(y,F,ie),k=q}else for(I=0;I<p.length;I++){if(F=p[I],q=F.instance,ie=F.currentTarget,F=F.listener,q!==k&&y.isPropagationStopped())break e;dm(y,F,ie),k=q}}}if(mi)throw r=Os,mi=!1,Os=null,r}function Be(r,s){var u=s[Ic];u===void 0&&(u=s[Ic]=new Set);var p=r+"__bubble";u.has(p)||(pm(s,r,2,!1),u.add(p))}function kc(r,s,u){var p=0;s&&(p|=4),pm(u,r,p,s)}var Na="_reactListening"+Math.random().toString(36).slice(2);function Ks(r){if(!r[Na]){r[Na]=!0,i.forEach(function(u){u!=="selectionchange"&&(Pk.has(u)||kc(u,!1,r),kc(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Na]||(s[Na]=!0,kc("selectionchange",!1,s))}}function pm(r,s,u,p){switch(Dp(s)){case 1:var y=Hb;break;case 4:y=qb;break;default:y=sc}u=y.bind(null,s,u,r),y=void 0,!Is||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(s,u,{capture:!0,passive:y}):r.addEventListener(s,u,!0):y!==void 0?r.addEventListener(s,u,{passive:y}):r.addEventListener(s,u,!1)}function Sc(r,s,u,p,y){var k=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var I=p.tag;if(I===3||I===4){var F=p.stateNode.containerInfo;if(F===y||F.nodeType===8&&F.parentNode===y)break;if(I===4)for(I=p.return;I!==null;){var q=I.tag;if((q===3||q===4)&&(q=I.stateNode.containerInfo,q===y||q.nodeType===8&&q.parentNode===y))return;I=I.return}for(;F!==null;){if(I=Br(F),I===null)return;if(q=I.tag,q===5||q===6){p=k=I;continue e}F=F.parentNode}}p=p.return}ia(function(){var ie=k,le=_s(u),ue=[];e:{var ae=cm.get(r);if(ae!==void 0){var pe=lc,ve=r;switch(r){case"keypress":if(wa(u)===0)break e;case"keydown":case"keyup":pe=ak;break;case"focusin":ve="focus",pe=fc;break;case"focusout":ve="blur",pe=fc;break;case"beforeblur":case"afterblur":pe=fc;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Fp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Gb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=ck;break;case om:case am:case lm:pe=Jb;break;case um:pe=dk;break;case"scroll":pe=Yb;break;case"wheel":pe=pk;break;case"copy":case"cut":case"paste":pe=ek;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Vp}var we=(s&4)!==0,Qe=!we&&r==="scroll",te=we?ae!==null?ae+"Capture":null:ae;we=[];for(var Q=ie,ne;Q!==null;){ne=Q;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Lr(Q,te),ce!=null&&we.push(Gs(Q,ce,ne)))),Qe)break;Q=Q.return}0<we.length&&(ae=new pe(ae,ve,null,u,le),ue.push({event:ae,listeners:we}))}}if((s&7)===0){e:{if(ae=r==="mouseover"||r==="pointerover",pe=r==="mouseout"||r==="pointerout",ae&&u!==Ns&&(ve=u.relatedTarget||u.fromElement)&&(Br(ve)||ve[zn]))break e;if((pe||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,pe?(ve=u.relatedTarget||u.toElement,pe=ie,ve=ve?Br(ve):null,ve!==null&&(Qe=Sn(ve),ve!==Qe||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(pe=null,ve=ie),pe!==ve)){if(we=Fp,ce="onMouseLeave",te="onMouseEnter",Q="mouse",(r==="pointerout"||r==="pointerover")&&(we=Vp,ce="onPointerLeave",te="onPointerEnter",Q="pointer"),Qe=pe==null?ae:Ti(pe),ne=ve==null?ae:Ti(ve),ae=new we(ce,Q+"leave",pe,u,le),ae.target=Qe,ae.relatedTarget=ne,ce=null,Br(le)===ie&&(we=new we(te,Q+"enter",ve,u,le),we.target=ne,we.relatedTarget=Qe,ce=we),Qe=ce,pe&&ve)t:{for(we=pe,te=ve,Q=0,ne=we;ne;ne=_i(ne))Q++;for(ne=0,ce=te;ce;ce=_i(ce))ne++;for(;0<Q-ne;)we=_i(we),Q--;for(;0<ne-Q;)te=_i(te),ne--;for(;Q--;){if(we===te||te!==null&&we===te.alternate)break t;we=_i(we),te=_i(te)}we=null}else we=null;pe!==null&&mm(ue,ae,pe,we,!1),ve!==null&&Qe!==null&&mm(ue,Qe,ve,we,!0)}}e:{if(ae=ie?Ti(ie):window,pe=ae.nodeName&&ae.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ae.type==="file")var be=bk;else if(Kp(ae))if(Xp)be=Nk;else{be=Sk;var Ee=kk}else(pe=ae.nodeName)&&pe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(be=Ek);if(be&&(be=be(r,ie))){Gp(ue,be,u,le);break e}Ee&&Ee(r,ae,ie),r==="focusout"&&(Ee=ae._wrapperState)&&Ee.controlled&&ae.type==="number"&&Nt(ae,"number",ae.value)}switch(Ee=ie?Ti(ie):window,r){case"focusin":(Kp(Ee)||Ee.contentEditable==="true")&&(Ei=Ee,yc=ie,qs=null);break;case"focusout":qs=yc=Ei=null;break;case"mousedown":vc=!0;break;case"contextmenu":case"mouseup":case"dragend":vc=!1,im(ue,u,le);break;case"selectionchange":if(Tk)break;case"keydown":case"keyup":im(ue,u,le)}var Ne;if(hc)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Si?qp(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(Wp&&u.locale!=="ko"&&(Si||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Si&&(Ne=$p()):(lr=le,ac="value"in lr?lr.value:lr.textContent,Si=!0)),Ee=_a(ie,Ce),0<Ee.length&&(Ce=new Bp(Ce,r,null,u,le),ue.push({event:Ce,listeners:Ee}),Ne?Ce.data=Ne:(Ne=Yp(u),Ne!==null&&(Ce.data=Ne)))),(Ne=gk?yk(r,u):vk(r,u))&&(ie=_a(ie,"onBeforeInput"),0<ie.length&&(le=new Bp("onBeforeInput","beforeinput",null,u,le),ue.push({event:le,listeners:ie}),le.data=Ne))}hm(ue,s)})}function Gs(r,s,u){return{instance:r,listener:s,currentTarget:u}}function _a(r,s){for(var u=s+"Capture",p=[];r!==null;){var y=r,k=y.stateNode;y.tag===5&&k!==null&&(y=k,k=Lr(r,u),k!=null&&p.unshift(Gs(r,k,y)),k=Lr(r,s),k!=null&&p.push(Gs(r,k,y))),r=r.return}return p}function _i(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function mm(r,s,u,p,y){for(var k=s._reactName,I=[];u!==null&&u!==p;){var F=u,q=F.alternate,ie=F.stateNode;if(q!==null&&q===p)break;F.tag===5&&ie!==null&&(F=ie,y?(q=Lr(u,k),q!=null&&I.unshift(Gs(u,q,F))):y||(q=Lr(u,k),q!=null&&I.push(Gs(u,q,F)))),u=u.return}I.length!==0&&r.push({event:s,listeners:I})}var Ak=/\r\n?/g,Mk=/\u0000|\uFFFD/g;function gm(r){return(typeof r=="string"?r:""+r).replace(Ak,`
38
- `).replace(Mk,"")}function Ca(r,s,u){if(s=gm(s),gm(r)!==s&&u)throw Error(n(425))}function Ta(){}var Ec=null,Nc=null;function _c(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Cc=typeof setTimeout=="function"?setTimeout:void 0,Rk=typeof clearTimeout=="function"?clearTimeout:void 0,ym=typeof Promise=="function"?Promise:void 0,Lk=typeof queueMicrotask=="function"?queueMicrotask:typeof ym<"u"?function(r){return ym.resolve(null).then(r).catch(jk)}:Cc;function jk(r){setTimeout(function(){throw r})}function Tc(r,s){var u=s,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(p===0){r.removeChild(y),zs(s);return}p--}else u!=="$"&&u!=="$?"&&u!=="$!"||p++;u=y}while(u);zs(s)}function cr(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function vm(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return r;s--}else u==="/$"&&s++}r=r.previousSibling}return null}var Ci=Math.random().toString(36).slice(2),En="__reactFiber$"+Ci,Xs="__reactProps$"+Ci,zn="__reactContainer$"+Ci,Ic="__reactEvents$"+Ci,Dk="__reactListeners$"+Ci,$k="__reactHandles$"+Ci;function Br(r){var s=r[En];if(s)return s;for(var u=r.parentNode;u;){if(s=u[zn]||u[En]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=vm(r);r!==null;){if(u=r[En])return u;r=vm(r)}return s}r=u,u=r.parentNode}return null}function Qs(r){return r=r[En]||r[zn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ti(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Ia(r){return r[Xs]||null}var Oc=[],Ii=-1;function fr(r){return{current:r}}function Ve(r){0>Ii||(r.current=Oc[Ii],Oc[Ii]=null,Ii--)}function $e(r,s){Ii++,Oc[Ii]=r.current,r.current=s}var dr={},mt=fr(dr),Ct=fr(!1),Vr=dr;function Oi(r,s){var u=r.type.contextTypes;if(!u)return dr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var y={},k;for(k in u)y[k]=s[k];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Oa(){Ve(Ct),Ve(mt)}function wm(r,s,u){if(mt.current!==dr)throw Error(n(168));$e(mt,s),$e(Ct,u)}function xm(r,s,u){var p=r.stateNode;if(s=s.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var y in p)if(!(y in s))throw Error(n(108,oe(r)||"Unknown",y));return V({},u,p)}function Pa(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||dr,Vr=mt.current,$e(mt,r),$e(Ct,Ct.current),!0}function bm(r,s,u){var p=r.stateNode;if(!p)throw Error(n(169));u?(r=xm(r,s,Vr),p.__reactInternalMemoizedMergedChildContext=r,Ve(Ct),Ve(mt),$e(mt,r)):Ve(Ct),$e(Ct,u)}var Fn=null,Aa=!1,Pc=!1;function km(r){Fn===null?Fn=[r]:Fn.push(r)}function zk(r){Aa=!0,km(r)}function hr(){if(!Pc&&Fn!==null){Pc=!0;var r=0,s=De;try{var u=Fn;for(De=1;r<u.length;r++){var p=u[r];do p=p(!0);while(p!==null)}Fn=null,Aa=!1}catch(y){throw Fn!==null&&(Fn=Fn.slice(r+1)),aa(Ms,hr),y}finally{De=s,Pc=!1}}return null}var Pi=[],Ai=0,Ma=null,Ra=0,Yt=[],Kt=0,Wr=null,Bn=1,Vn="";function Ur(r,s){Pi[Ai++]=Ra,Pi[Ai++]=Ma,Ma=r,Ra=s}function Sm(r,s,u){Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Wr,Wr=r;var p=Bn;r=Vn;var y=32-Dt(p)-1;p&=~(1<<y),u+=1;var k=32-Dt(s)+y;if(30<k){var I=y-y%5;k=(p&(1<<I)-1).toString(32),p>>=I,y-=I,Bn=1<<32-Dt(s)+y|u<<y|p,Vn=k+r}else Bn=1<<k|u<<y|p,Vn=r}function Ac(r){r.return!==null&&(Ur(r,1),Sm(r,1,0))}function Mc(r){for(;r===Ma;)Ma=Pi[--Ai],Pi[Ai]=null,Ra=Pi[--Ai],Pi[Ai]=null;for(;r===Wr;)Wr=Yt[--Kt],Yt[Kt]=null,Vn=Yt[--Kt],Yt[Kt]=null,Bn=Yt[--Kt],Yt[Kt]=null}var zt=null,Ft=null,Ue=!1,on=null;function Em(r,s){var u=Jt(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=r,s=r.deletions,s===null?(r.deletions=[u],r.flags|=16):s.push(u)}function Nm(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,zt=r,Ft=cr(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,zt=r,Ft=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=Wr!==null?{id:Bn,overflow:Vn}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=Jt(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,zt=r,Ft=null,!0):!1;default:return!1}}function Rc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Lc(r){if(Ue){var s=Ft;if(s){var u=s;if(!Nm(r,s)){if(Rc(r))throw Error(n(418));s=cr(u.nextSibling);var p=zt;s&&Nm(r,s)?Em(p,u):(r.flags=r.flags&-4097|2,Ue=!1,zt=r)}}else{if(Rc(r))throw Error(n(418));r.flags=r.flags&-4097|2,Ue=!1,zt=r}}}function _m(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;zt=r}function La(r){if(r!==zt)return!1;if(!Ue)return _m(r),Ue=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!_c(r.type,r.memoizedProps)),s&&(s=Ft)){if(Rc(r))throw Cm(),Error(n(418));for(;s;)Em(r,s),s=cr(s.nextSibling)}if(_m(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){Ft=cr(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Ft=null}}else Ft=zt?cr(r.stateNode.nextSibling):null;return!0}function Cm(){for(var r=Ft;r;)r=cr(r.nextSibling)}function Mi(){Ft=zt=null,Ue=!1}function jc(r){on===null?on=[r]:on.push(r)}var Fk=T.ReactCurrentBatchConfig;function Js(r,s,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var p=u.stateNode}if(!p)throw Error(n(147,r));var y=p,k=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===k?s.ref:(s=function(I){var F=y.refs;I===null?delete F[k]:F[k]=I},s._stringRef=k,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function ja(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Tm(r){var s=r._init;return s(r._payload)}function Im(r){function s(te,Q){if(r){var ne=te.deletions;ne===null?(te.deletions=[Q],te.flags|=16):ne.push(Q)}}function u(te,Q){if(!r)return null;for(;Q!==null;)s(te,Q),Q=Q.sibling;return null}function p(te,Q){for(te=new Map;Q!==null;)Q.key!==null?te.set(Q.key,Q):te.set(Q.index,Q),Q=Q.sibling;return te}function y(te,Q){return te=br(te,Q),te.index=0,te.sibling=null,te}function k(te,Q,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<Q?(te.flags|=2,Q):ne):(te.flags|=2,Q)):(te.flags|=1048576,Q)}function I(te){return r&&te.alternate===null&&(te.flags|=2),te}function F(te,Q,ne,ce){return Q===null||Q.tag!==6?(Q=Tf(ne,te.mode,ce),Q.return=te,Q):(Q=y(Q,ne),Q.return=te,Q)}function q(te,Q,ne,ce){var be=ne.type;return be===M?le(te,Q,ne.props.children,ce,ne.key):Q!==null&&(Q.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===Q.type)?(ce=y(Q,ne.props),ce.ref=Js(te,Q,ne),ce.return=te,ce):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,Q,ne),ce.return=te,ce)}function ie(te,Q,ne,ce){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=If(ne,te.mode,ce),Q.return=te,Q):(Q=y(Q,ne.children||[]),Q.return=te,Q)}function le(te,Q,ne,ce,be){return Q===null||Q.tag!==7?(Q=Jr(ne,te.mode,ce,be),Q.return=te,Q):(Q=y(Q,ne),Q.return=te,Q)}function ue(te,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=Tf(""+Q,te.mode,ne),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:return ne=ol(Q.type,Q.key,Q.props,null,te.mode,ne),ne.ref=Js(te,null,Q),ne.return=te,ne;case R:return Q=If(Q,te.mode,ne),Q.return=te,Q;case Y:var ce=Q._init;return ue(te,ce(Q._payload),ne)}if(ht(Q)||B(Q))return Q=Jr(Q,te.mode,ne,null),Q.return=te,Q;ja(te,Q)}return null}function ae(te,Q,ne,ce){var be=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:F(te,Q,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===be?q(te,Q,ne,ce):null;case R:return ne.key===be?ie(te,Q,ne,ce):null;case Y:return be=ne._init,ae(te,Q,be(ne._payload),ce)}if(ht(ne)||B(ne))return be!==null?null:le(te,Q,ne,ce,null);ja(te,ne)}return null}function pe(te,Q,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,F(Q,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case A:return te=te.get(ce.key===null?ne:ce.key)||null,q(Q,te,ce,be);case R:return te=te.get(ce.key===null?ne:ce.key)||null,ie(Q,te,ce,be);case Y:var Ee=ce._init;return pe(te,Q,ne,Ee(ce._payload),be)}if(ht(ce)||B(ce))return te=te.get(ne)||null,le(Q,te,ce,be,null);ja(Q,ce)}return null}function ve(te,Q,ne,ce){for(var be=null,Ee=null,Ne=Q,Ce=Q=0,ut=null;Ne!==null&&Ce<ne.length;Ce++){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var Le=ae(te,Ne,ne[Ce],ce);if(Le===null){Ne===null&&(Ne=ut);break}r&&Ne&&Le.alternate===null&&s(te,Ne),Q=k(Le,Q,Ce),Ee===null?be=Le:Ee.sibling=Le,Ee=Le,Ne=ut}if(Ce===ne.length)return u(te,Ne),Ue&&Ur(te,Ce),be;if(Ne===null){for(;Ce<ne.length;Ce++)Ne=ue(te,ne[Ce],ce),Ne!==null&&(Q=k(Ne,Q,Ce),Ee===null?be=Ne:Ee.sibling=Ne,Ee=Ne);return Ue&&Ur(te,Ce),be}for(Ne=p(te,Ne);Ce<ne.length;Ce++)ut=pe(Ne,te,Ce,ne[Ce],ce),ut!==null&&(r&&ut.alternate!==null&&Ne.delete(ut.key===null?Ce:ut.key),Q=k(ut,Q,Ce),Ee===null?be=ut:Ee.sibling=ut,Ee=ut);return r&&Ne.forEach(function(kr){return s(te,kr)}),Ue&&Ur(te,Ce),be}function we(te,Q,ne,ce){var be=B(ne);if(typeof be!="function")throw Error(n(150));if(ne=be.call(ne),ne==null)throw Error(n(151));for(var Ee=be=null,Ne=Q,Ce=Q=0,ut=null,Le=ne.next();Ne!==null&&!Le.done;Ce++,Le=ne.next()){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var kr=ae(te,Ne,Le.value,ce);if(kr===null){Ne===null&&(Ne=ut);break}r&&Ne&&kr.alternate===null&&s(te,Ne),Q=k(kr,Q,Ce),Ee===null?be=kr:Ee.sibling=kr,Ee=kr,Ne=ut}if(Le.done)return u(te,Ne),Ue&&Ur(te,Ce),be;if(Ne===null){for(;!Le.done;Ce++,Le=ne.next())Le=ue(te,Le.value,ce),Le!==null&&(Q=k(Le,Q,Ce),Ee===null?be=Le:Ee.sibling=Le,Ee=Le);return Ue&&Ur(te,Ce),be}for(Ne=p(te,Ne);!Le.done;Ce++,Le=ne.next())Le=pe(Ne,te,Ce,Le.value,ce),Le!==null&&(r&&Le.alternate!==null&&Ne.delete(Le.key===null?Ce:Le.key),Q=k(Le,Q,Ce),Ee===null?be=Le:Ee.sibling=Le,Ee=Le);return r&&Ne.forEach(function(wS){return s(te,wS)}),Ue&&Ur(te,Ce),be}function Qe(te,Q,ne,ce){if(typeof ne=="object"&&ne!==null&&ne.type===M&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var be=ne.key,Ee=Q;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===M){if(Ee.tag===7){u(te,Ee.sibling),Q=y(Ee,ne.props.children),Q.return=te,te=Q;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===Ee.type){u(te,Ee.sibling),Q=y(Ee,ne.props),Q.ref=Js(te,Ee,ne),Q.return=te,te=Q;break e}u(te,Ee);break}else s(te,Ee);Ee=Ee.sibling}ne.type===M?(Q=Jr(ne.props.children,te.mode,ce,ne.key),Q.return=te,te=Q):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,Q,ne),ce.return=te,te=ce)}return I(te);case R:e:{for(Ee=ne.key;Q!==null;){if(Q.key===Ee)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){u(te,Q.sibling),Q=y(Q,ne.children||[]),Q.return=te,te=Q;break e}else{u(te,Q);break}else s(te,Q);Q=Q.sibling}Q=If(ne,te.mode,ce),Q.return=te,te=Q}return I(te);case Y:return Ee=ne._init,Qe(te,Q,Ee(ne._payload),ce)}if(ht(ne))return ve(te,Q,ne,ce);if(B(ne))return we(te,Q,ne,ce);ja(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,Q!==null&&Q.tag===6?(u(te,Q.sibling),Q=y(Q,ne),Q.return=te,te=Q):(u(te,Q),Q=Tf(ne,te.mode,ce),Q.return=te,te=Q),I(te)):u(te,Q)}return Qe}var Ri=Im(!0),Om=Im(!1),Da=fr(null),$a=null,Li=null,Dc=null;function $c(){Dc=Li=$a=null}function zc(r){var s=Da.current;Ve(Da),r._currentValue=s}function Fc(r,s,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),r===u)break;r=r.return}}function ji(r,s){$a=r,Dc=Li=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(It=!0),r.firstContext=null)}function Gt(r){var s=r._currentValue;if(Dc!==r)if(r={context:r,memoizedValue:s,next:null},Li===null){if($a===null)throw Error(n(308));Li=r,$a.dependencies={lanes:0,firstContext:r}}else Li=Li.next=r;return s}var Hr=null;function Bc(r){Hr===null?Hr=[r]:Hr.push(r)}function Pm(r,s,u,p){var y=s.interleaved;return y===null?(u.next=u,Bc(s)):(u.next=y.next,y.next=u),s.interleaved=u,Wn(r,p)}function Wn(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var pr=!1;function Vc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Am(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Un(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function mr(r,s,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Re&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,Wn(r,u)}return y=p.interleaved,y===null?(s.next=s,Bc(p)):(s.next=y.next,y.next=s),p.interleaved=s,Wn(r,u)}function za(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,xi(r,u)}}function Mm(r,s){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var I={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?y=k=I:k=k.next=I,u=u.next}while(u!==null);k===null?y=k=s:k=k.next=s}else y=k=s;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:k,shared:p.shared,effects:p.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function Fa(r,s,u,p){var y=r.updateQueue;pr=!1;var k=y.firstBaseUpdate,I=y.lastBaseUpdate,F=y.shared.pending;if(F!==null){y.shared.pending=null;var q=F,ie=q.next;q.next=null,I===null?k=ie:I.next=ie,I=q;var le=r.alternate;le!==null&&(le=le.updateQueue,F=le.lastBaseUpdate,F!==I&&(F===null?le.firstBaseUpdate=ie:F.next=ie,le.lastBaseUpdate=q))}if(k!==null){var ue=y.baseState;I=0,le=ie=q=null,F=k;do{var ae=F.lane,pe=F.eventTime;if((p&ae)===ae){le!==null&&(le=le.next={eventTime:pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var ve=r,we=F;switch(ae=s,pe=u,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ue=ve.call(pe,ue,ae);break e}ue=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,ae=typeof ve=="function"?ve.call(pe,ue,ae):ve,ae==null)break e;ue=V({},ue,ae);break e;case 2:pr=!0}}F.callback!==null&&F.lane!==0&&(r.flags|=64,ae=y.effects,ae===null?y.effects=[F]:ae.push(F))}else pe={eventTime:pe,lane:ae,tag:F.tag,payload:F.payload,callback:F.callback,next:null},le===null?(ie=le=pe,q=ue):le=le.next=pe,I|=ae;if(F=F.next,F===null){if(F=y.shared.pending,F===null)break;ae=F,F=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);if(le===null&&(q=ue),y.baseState=q,y.firstBaseUpdate=ie,y.lastBaseUpdate=le,s=y.shared.interleaved,s!==null){y=s;do I|=y.lane,y=y.next;while(y!==s)}else k===null&&(y.shared.lanes=0);Kr|=I,r.lanes=I,r.memoizedState=ue}}function Rm(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var p=r[s],y=p.callback;if(y!==null){if(p.callback=null,p=u,typeof y!="function")throw Error(n(191,y));y.call(p)}}}var Zs={},Nn=fr(Zs),eo=fr(Zs),to=fr(Zs);function qr(r){if(r===Zs)throw Error(n(174));return r}function Wc(r,s){switch($e(to,s),$e(eo,r),$e(Nn,Zs),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Lt(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Lt(s,r)}Ve(Nn),$e(Nn,s)}function Di(){Ve(Nn),Ve(eo),Ve(to)}function Lm(r){qr(to.current);var s=qr(Nn.current),u=Lt(s,r.type);s!==u&&($e(eo,r),$e(Nn,u))}function Uc(r){eo.current===r&&(Ve(Nn),Ve(eo))}var Ke=fr(0);function Ba(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Hc=[];function qc(){for(var r=0;r<Hc.length;r++)Hc[r]._workInProgressVersionPrimary=null;Hc.length=0}var Va=T.ReactCurrentDispatcher,Yc=T.ReactCurrentBatchConfig,Yr=0,Ge=null,it=null,at=null,Wa=!1,no=!1,ro=0,Bk=0;function gt(){throw Error(n(321))}function Kc(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!sn(r[u],s[u]))return!1;return!0}function Gc(r,s,u,p,y,k){if(Yr=k,Ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Va.current=r===null||r.memoizedState===null?Hk:qk,r=u(p,y),no){k=0;do{if(no=!1,ro=0,25<=k)throw Error(n(301));k+=1,at=it=null,s.updateQueue=null,Va.current=Yk,r=u(p,y)}while(no)}if(Va.current=qa,s=it!==null&&it.next!==null,Yr=0,at=it=Ge=null,Wa=!1,s)throw Error(n(300));return r}function Xc(){var r=ro!==0;return ro=0,r}function _n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ge.memoizedState=at=r:at=at.next=r,at}function Xt(){if(it===null){var r=Ge.alternate;r=r!==null?r.memoizedState:null}else r=it.next;var s=at===null?Ge.memoizedState:at.next;if(s!==null)at=s,it=r;else{if(r===null)throw Error(n(310));it=r,r={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},at===null?Ge.memoizedState=at=r:at=at.next=r}return at}function io(r,s){return typeof s=="function"?s(r):s}function Qc(r){var s=Xt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=it,y=p.baseQueue,k=u.pending;if(k!==null){if(y!==null){var I=y.next;y.next=k.next,k.next=I}p.baseQueue=y=k,u.pending=null}if(y!==null){k=y.next,p=p.baseState;var F=I=null,q=null,ie=k;do{var le=ie.lane;if((Yr&le)===le)q!==null&&(q=q.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),p=ie.hasEagerState?ie.eagerState:r(p,ie.action);else{var ue={lane:le,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};q===null?(F=q=ue,I=p):q=q.next=ue,Ge.lanes|=le,Kr|=le}ie=ie.next}while(ie!==null&&ie!==k);q===null?I=p:q.next=F,sn(p,s.memoizedState)||(It=!0),s.memoizedState=p,s.baseState=I,s.baseQueue=q,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do k=y.lane,Ge.lanes|=k,Kr|=k,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function Jc(r){var s=Xt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,k=s.memoizedState;if(y!==null){u.pending=null;var I=y=y.next;do k=r(k,I.action),I=I.next;while(I!==y);sn(k,s.memoizedState)||(It=!0),s.memoizedState=k,s.baseQueue===null&&(s.baseState=k),u.lastRenderedState=k}return[k,p]}function jm(){}function Dm(r,s){var u=Ge,p=Xt(),y=s(),k=!sn(p.memoizedState,y);if(k&&(p.memoizedState=y,It=!0),p=p.queue,Zc(Fm.bind(null,u,p,r),[r]),p.getSnapshot!==s||k||at!==null&&at.memoizedState.tag&1){if(u.flags|=2048,so(9,zm.bind(null,u,p,y,s),void 0,null),lt===null)throw Error(n(349));(Yr&30)!==0||$m(u,s,y)}return y}function $m(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=Ge.updateQueue,s===null?(s={lastEffect:null,stores:null},Ge.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function zm(r,s,u,p){s.value=u,s.getSnapshot=p,Bm(s)&&Vm(r)}function Fm(r,s,u){return u(function(){Bm(s)&&Vm(r)})}function Bm(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!sn(r,u)}catch{return!0}}function Vm(r){var s=Wn(r,1);s!==null&&cn(s,r,1,-1)}function Wm(r){var s=_n();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:r},s.queue=r,r=r.dispatch=Uk.bind(null,Ge,r),[s.memoizedState,r]}function so(r,s,u,p){return r={tag:r,create:s,destroy:u,deps:p,next:null},s=Ge.updateQueue,s===null?(s={lastEffect:null,stores:null},Ge.updateQueue=s,s.lastEffect=r.next=r):(u=s.lastEffect,u===null?s.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,s.lastEffect=r)),r}function Um(){return Xt().memoizedState}function Ua(r,s,u,p){var y=_n();Ge.flags|=r,y.memoizedState=so(1|s,u,void 0,p===void 0?null:p)}function Ha(r,s,u,p){var y=Xt();p=p===void 0?null:p;var k=void 0;if(it!==null){var I=it.memoizedState;if(k=I.destroy,p!==null&&Kc(p,I.deps)){y.memoizedState=so(s,u,k,p);return}}Ge.flags|=r,y.memoizedState=so(1|s,u,k,p)}function Hm(r,s){return Ua(8390656,8,r,s)}function Zc(r,s){return Ha(2048,8,r,s)}function qm(r,s){return Ha(4,2,r,s)}function Ym(r,s){return Ha(4,4,r,s)}function Km(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Gm(r,s,u){return u=u!=null?u.concat([r]):null,Ha(4,4,Km.bind(null,s,r),u)}function ef(){}function Xm(r,s){var u=Xt();s=s===void 0?null:s;var p=u.memoizedState;return p!==null&&s!==null&&Kc(s,p[1])?p[0]:(u.memoizedState=[r,s],r)}function Qm(r,s){var u=Xt();s=s===void 0?null:s;var p=u.memoizedState;return p!==null&&s!==null&&Kc(s,p[1])?p[0]:(r=r(),u.memoizedState=[r,s],r)}function Jm(r,s,u){return(Yr&21)===0?(r.baseState&&(r.baseState=!1,It=!0),r.memoizedState=u):(sn(u,s)||(u=ha(),Ge.lanes|=u,Kr|=u,r.baseState=!0),s)}function Vk(r,s){var u=De;De=u!==0&&4>u?u:4,r(!0);var p=Yc.transition;Yc.transition={};try{r(!1),s()}finally{De=u,Yc.transition=p}}function Zm(){return Xt().memoizedState}function Wk(r,s,u){var p=wr(r);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},eg(r))tg(s,u);else if(u=Pm(r,s,u,p),u!==null){var y=bt();cn(u,r,p,y),ng(u,s,p)}}function Uk(r,s,u){var p=wr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(eg(r))tg(s,y);else{var k=r.alternate;if(r.lanes===0&&(k===null||k.lanes===0)&&(k=s.lastRenderedReducer,k!==null))try{var I=s.lastRenderedState,F=k(I,u);if(y.hasEagerState=!0,y.eagerState=F,sn(F,I)){var q=s.interleaved;q===null?(y.next=y,Bc(s)):(y.next=q.next,q.next=y),s.interleaved=y;return}}catch{}finally{}u=Pm(r,s,y,p),u!==null&&(y=bt(),cn(u,r,p,y),ng(u,s,p))}}function eg(r){var s=r.alternate;return r===Ge||s!==null&&s===Ge}function tg(r,s){no=Wa=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function ng(r,s,u){if((u&4194240)!==0){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,xi(r,u)}}var qa={readContext:Gt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},Hk={readContext:Gt,useCallback:function(r,s){return _n().memoizedState=[r,s===void 0?null:s],r},useContext:Gt,useEffect:Hm,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,Ua(4194308,4,Km.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Ua(4194308,4,r,s)},useInsertionEffect:function(r,s){return Ua(4,2,r,s)},useMemo:function(r,s){var u=_n();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var p=_n();return s=u!==void 0?u(s):s,p.memoizedState=p.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},p.queue=r,r=r.dispatch=Wk.bind(null,Ge,r),[p.memoizedState,r]},useRef:function(r){var s=_n();return r={current:r},s.memoizedState=r},useState:Wm,useDebugValue:ef,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=Wm(!1),s=r[0];return r=Vk.bind(null,r[1]),_n().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var p=Ge,y=_n();if(Ue){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),lt===null)throw Error(n(349));(Yr&30)!==0||$m(p,s,u)}y.memoizedState=u;var k={value:u,getSnapshot:s};return y.queue=k,Hm(Fm.bind(null,p,k,r),[r]),p.flags|=2048,so(9,zm.bind(null,p,k,u,s),void 0,null),u},useId:function(){var r=_n(),s=lt.identifierPrefix;if(Ue){var u=Vn,p=Bn;u=(p&~(1<<32-Dt(p)-1)).toString(32)+u,s=":"+s+"R"+u,u=ro++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=Bk++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},qk={readContext:Gt,useCallback:Xm,useContext:Gt,useEffect:Zc,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Ym,useMemo:Qm,useReducer:Qc,useRef:Um,useState:function(){return Qc(io)},useDebugValue:ef,useDeferredValue:function(r){var s=Xt();return Jm(s,it.memoizedState,r)},useTransition:function(){var r=Qc(io)[0],s=Xt().memoizedState;return[r,s]},useMutableSource:jm,useSyncExternalStore:Dm,useId:Zm,unstable_isNewReconciler:!1},Yk={readContext:Gt,useCallback:Xm,useContext:Gt,useEffect:Zc,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Ym,useMemo:Qm,useReducer:Jc,useRef:Um,useState:function(){return Jc(io)},useDebugValue:ef,useDeferredValue:function(r){var s=Xt();return it===null?s.memoizedState=r:Jm(s,it.memoizedState,r)},useTransition:function(){var r=Jc(io)[0],s=Xt().memoizedState;return[r,s]},useMutableSource:jm,useSyncExternalStore:Dm,useId:Zm,unstable_isNewReconciler:!1};function an(r,s){if(r&&r.defaultProps){s=V({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function tf(r,s,u,p){s=r.memoizedState,u=u(p,s),u=u==null?s:V({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Ya={isMounted:function(r){return(r=r._reactInternals)?Sn(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var p=bt(),y=wr(r),k=Un(p,y);k.payload=s,u!=null&&(k.callback=u),s=mr(r,k,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=bt(),y=wr(r),k=Un(p,y);k.tag=1,k.payload=s,u!=null&&(k.callback=u),s=mr(r,k,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=bt(),p=wr(r),y=Un(u,p);y.tag=2,s!=null&&(y.callback=s),s=mr(r,y,p),s!==null&&(cn(s,r,p,u),za(s,r,p))}};function rg(r,s,u,p,y,k,I){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,k,I):s.prototype&&s.prototype.isPureReactComponent?!Hs(u,p)||!Hs(y,k):!0}function ig(r,s,u){var p=!1,y=dr,k=s.contextType;return typeof k=="object"&&k!==null?k=Gt(k):(y=Tt(s)?Vr:mt.current,p=s.contextTypes,k=(p=p!=null)?Oi(r,y):dr),s=new s(u,k),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ya,r.stateNode=s,s._reactInternals=r,p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=k),s}function sg(r,s,u,p){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==r&&Ya.enqueueReplaceState(s,s.state,null)}function nf(r,s,u,p){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},Vc(r);var k=s.contextType;typeof k=="object"&&k!==null?y.context=Gt(k):(k=Tt(s)?Vr:mt.current,y.context=Oi(r,k)),y.state=r.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(tf(r,s,k,u),y.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(s=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),s!==y.state&&Ya.enqueueReplaceState(y,y.state,null),Fa(r,u,y,p),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function $i(r,s){try{var u="",p=s;do u+=J(p),p=p.return;while(p);var y=u}catch(k){y=`
39
- Error generating stack: `+k.message+`
40
- `+k.stack}return{value:r,source:s,stack:y,digest:null}}function rf(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function sf(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var Kk=typeof WeakMap=="function"?WeakMap:Map;function og(r,s,u){u=Un(-1,u),u.tag=3,u.payload={element:null};var p=s.value;return u.callback=function(){el||(el=!0,xf=p),sf(r,s)},u}function ag(r,s,u){u=Un(-1,u),u.tag=3;var p=r.type.getDerivedStateFromError;if(typeof p=="function"){var y=s.value;u.payload=function(){return p(y)},u.callback=function(){sf(r,s)}}var k=r.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){sf(r,s),typeof p!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var I=s.stack;this.componentDidCatch(s.value,{componentStack:I!==null?I:""})}),u}function lg(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Kk;var y=new Set;p.set(s,y)}else y=p.get(s),y===void 0&&(y=new Set,p.set(s,y));y.has(u)||(y.add(u),r=lS.bind(null,r,s,u),s.then(r,r))}function ug(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function cg(r,s,u,p,y){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Un(-1,1),s.tag=2,mr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var Gk=T.ReactCurrentOwner,It=!1;function xt(r,s,u,p){s.child=r===null?Om(s,null,u,p):Ri(s,r.child,u,p)}function fg(r,s,u,p,y){u=u.render;var k=s.ref;return ji(s,y),p=Gc(r,s,u,p,k,y),u=Xc(),r!==null&&!It?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&u&&Ac(s),s.flags|=1,xt(r,s,p,y),s.child)}function dg(r,s,u,p,y){if(r===null){var k=u.type;return typeof k=="function"&&!Cf(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=k,hg(r,s,k,p,y)):(r=ol(u.type,null,p,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(k=r.child,(r.lanes&y)===0){var I=k.memoizedProps;if(u=u.compare,u=u!==null?u:Hs,u(I,p)&&r.ref===s.ref)return Hn(r,s,y)}return s.flags|=1,r=br(k,p),r.ref=s.ref,r.return=s,s.child=r}function hg(r,s,u,p,y){if(r!==null){var k=r.memoizedProps;if(Hs(k,p)&&r.ref===s.ref)if(It=!1,s.pendingProps=p=k,(r.lanes&y)!==0)(r.flags&131072)!==0&&(It=!0);else return s.lanes=r.lanes,Hn(r,s,y)}return of(r,s,u,p,y)}function pg(r,s,u){var p=s.pendingProps,y=p.children,k=r!==null?r.memoizedState:null;if(p.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(Fi,Bt),Bt|=u;else{if((u&1073741824)===0)return r=k!==null?k.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,$e(Fi,Bt),Bt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=k!==null?k.baseLanes:u,$e(Fi,Bt),Bt|=p}else k!==null?(p=k.baseLanes|u,s.memoizedState=null):p=u,$e(Fi,Bt),Bt|=p;return xt(r,s,y,u),s.child}function mg(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function of(r,s,u,p,y){var k=Tt(u)?Vr:mt.current;return k=Oi(s,k),ji(s,y),u=Gc(r,s,u,p,k,y),p=Xc(),r!==null&&!It?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&p&&Ac(s),s.flags|=1,xt(r,s,u,y),s.child)}function gg(r,s,u,p,y){if(Tt(u)){var k=!0;Pa(s)}else k=!1;if(ji(s,y),s.stateNode===null)Ga(r,s),ig(s,u,p),nf(s,u,p,y),p=!0;else if(r===null){var I=s.stateNode,F=s.memoizedProps;I.props=F;var q=I.context,ie=u.contextType;typeof ie=="object"&&ie!==null?ie=Gt(ie):(ie=Tt(u)?Vr:mt.current,ie=Oi(s,ie));var le=u.getDerivedStateFromProps,ue=typeof le=="function"||typeof I.getSnapshotBeforeUpdate=="function";ue||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==p||q!==ie)&&sg(s,I,p,ie),pr=!1;var ae=s.memoizedState;I.state=ae,Fa(s,p,I,y),q=s.memoizedState,F!==p||ae!==q||Ct.current||pr?(typeof le=="function"&&(tf(s,u,le,p),q=s.memoizedState),(F=pr||rg(s,u,F,p,ae,q,ie))?(ue||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(s.flags|=4194308)):(typeof I.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=q),I.props=p,I.state=q,I.context=ie,p=F):(typeof I.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{I=s.stateNode,Am(r,s),F=s.memoizedProps,ie=s.type===s.elementType?F:an(s.type,F),I.props=ie,ue=s.pendingProps,ae=I.context,q=u.contextType,typeof q=="object"&&q!==null?q=Gt(q):(q=Tt(u)?Vr:mt.current,q=Oi(s,q));var pe=u.getDerivedStateFromProps;(le=typeof pe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==ue||ae!==q)&&sg(s,I,p,q),pr=!1,ae=s.memoizedState,I.state=ae,Fa(s,p,I,y);var ve=s.memoizedState;F!==ue||ae!==ve||Ct.current||pr?(typeof pe=="function"&&(tf(s,u,pe,p),ve=s.memoizedState),(ie=pr||rg(s,u,ie,p,ae,ve,q)||!1)?(le||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(p,ve,q),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(p,ve,q)),typeof I.componentDidUpdate=="function"&&(s.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof I.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=ve),I.props=p,I.state=ve,I.context=q,p=ie):(typeof I.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),p=!1)}return af(r,s,u,p,k,y)}function af(r,s,u,p,y,k){mg(r,s);var I=(s.flags&128)!==0;if(!p&&!I)return y&&bm(s,u,!1),Hn(r,s,k);p=s.stateNode,Gk.current=s;var F=I&&typeof u.getDerivedStateFromError!="function"?null:p.render();return s.flags|=1,r!==null&&I?(s.child=Ri(s,r.child,null,k),s.child=Ri(s,null,F,k)):xt(r,s,F,k),s.memoizedState=p.state,y&&bm(s,u,!0),s.child}function yg(r){var s=r.stateNode;s.pendingContext?wm(r,s.pendingContext,s.pendingContext!==s.context):s.context&&wm(r,s.context,!1),Wc(r,s.containerInfo)}function vg(r,s,u,p,y){return Mi(),jc(y),s.flags|=256,xt(r,s,u,p),s.child}var lf={dehydrated:null,treeContext:null,retryLane:0};function uf(r){return{baseLanes:r,cachePool:null,transitions:null}}function wg(r,s,u){var p=s.pendingProps,y=Ke.current,k=!1,I=(s.flags&128)!==0,F;if((F=I)||(F=r!==null&&r.memoizedState===null?!1:(y&2)!==0),F?(k=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),$e(Ke,y&1),r===null)return Lc(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(I=p.children,r=p.fallback,k?(p=s.mode,k=s.child,I={mode:"hidden",children:I},(p&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=al(I,p,0,null),r=Jr(r,p,u,null),k.return=s,r.return=s,k.sibling=r,s.child=k,s.child.memoizedState=uf(u),s.memoizedState=lf,r):cf(s,I));if(y=r.memoizedState,y!==null&&(F=y.dehydrated,F!==null))return Xk(r,s,I,p,F,y,u);if(k){k=p.fallback,I=s.mode,y=r.child,F=y.sibling;var q={mode:"hidden",children:p.children};return(I&1)===0&&s.child!==y?(p=s.child,p.childLanes=0,p.pendingProps=q,s.deletions=null):(p=br(y,q),p.subtreeFlags=y.subtreeFlags&14680064),F!==null?k=br(F,k):(k=Jr(k,I,u,null),k.flags|=2),k.return=s,p.return=s,p.sibling=k,s.child=p,p=k,k=s.child,I=r.child.memoizedState,I=I===null?uf(u):{baseLanes:I.baseLanes|u,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=r.childLanes&~u,s.memoizedState=lf,p}return k=r.child,r=k.sibling,p=br(k,{mode:"visible",children:p.children}),(s.mode&1)===0&&(p.lanes=u),p.return=s,p.sibling=null,r!==null&&(u=s.deletions,u===null?(s.deletions=[r],s.flags|=16):u.push(r)),s.child=p,s.memoizedState=null,p}function cf(r,s){return s=al({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function Ka(r,s,u,p){return p!==null&&jc(p),Ri(s,r.child,null,u),r=cf(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Xk(r,s,u,p,y,k,I){if(u)return s.flags&256?(s.flags&=-257,p=rf(Error(n(422))),Ka(r,s,I,p)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(k=p.fallback,y=s.mode,p=al({mode:"visible",children:p.children},y,0,null),k=Jr(k,y,I,null),k.flags|=2,p.return=s,k.return=s,p.sibling=k,s.child=p,(s.mode&1)!==0&&Ri(s,r.child,null,I),s.child.memoizedState=uf(I),s.memoizedState=lf,k);if((s.mode&1)===0)return Ka(r,s,I,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var F=p.dgst;return p=F,k=Error(n(419)),p=rf(k,p,void 0),Ka(r,s,I,p)}if(F=(I&r.childLanes)!==0,It||F){if(p=lt,p!==null){switch(I&-I){case 4:y=2;break;case 16:y=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(p.suspendedLanes|I))!==0?0:y,y!==0&&y!==k.retryLane&&(k.retryLane=y,Wn(r,y),cn(p,r,y,-1))}return _f(),p=rf(Error(n(421))),Ka(r,s,I,p)}return y.data==="$?"?(s.flags|=128,s.child=r.child,s=uS.bind(null,r),y._reactRetry=s,null):(r=k.treeContext,Ft=cr(y.nextSibling),zt=s,Ue=!0,on=null,r!==null&&(Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Wr,Bn=r.id,Vn=r.overflow,Wr=s),s=cf(s,p.children),s.flags|=4096,s)}function xg(r,s,u){r.lanes|=s;var p=r.alternate;p!==null&&(p.lanes|=s),Fc(r.return,s,u)}function ff(r,s,u,p,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=p,k.tail=u,k.tailMode=y)}function bg(r,s,u){var p=s.pendingProps,y=p.revealOrder,k=p.tail;if(xt(r,s,p.children,u),p=Ke.current,(p&2)!==0)p=p&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xg(r,u,s);else if(r.tag===19)xg(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}p&=1}if($e(Ke,p),(s.mode&1)===0)s.memoizedState=null;else switch(y){case"forwards":for(u=s.child,y=null;u!==null;)r=u.alternate,r!==null&&Ba(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),ff(s,!1,y,u,k);break;case"backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(r=y.alternate,r!==null&&Ba(r)===null){s.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}ff(s,!0,u,null,k);break;case"together":ff(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ga(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Hn(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Kr|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=br(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=br(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Qk(r,s,u){switch(s.tag){case 3:yg(s),Mi();break;case 5:Lm(s);break;case 1:Tt(s.type)&&Pa(s);break;case 4:Wc(s,s.stateNode.containerInfo);break;case 10:var p=s.type._context,y=s.memoizedProps.value;$e(Da,p._currentValue),p._currentValue=y;break;case 13:if(p=s.memoizedState,p!==null)return p.dehydrated!==null?($e(Ke,Ke.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?wg(r,s,u):($e(Ke,Ke.current&1),r=Hn(r,s,u),r!==null?r.sibling:null);$e(Ke,Ke.current&1);break;case 19:if(p=(u&s.childLanes)!==0,(r.flags&128)!==0){if(p)return bg(r,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),$e(Ke,Ke.current),p)break;return null;case 22:case 23:return s.lanes=0,pg(r,s,u)}return Hn(r,s,u)}var kg,df,Sg,Eg;kg=function(r,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},df=function(){},Sg=function(r,s,u,p){var y=r.memoizedProps;if(y!==p){r=s.stateNode,qr(Nn.current);var k=null;switch(u){case"input":y=Se(r,y),p=Se(r,p),k=[];break;case"select":y=V({},y,{value:void 0}),p=V({},p,{value:void 0}),k=[];break;case"textarea":y=jn(r,y),p=jn(r,p),k=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Ta)}Ss(u,p);var I;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var F=y[ie];for(I in F)F.hasOwnProperty(I)&&(u||(u={}),u[I]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?k||(k=[]):(k=k||[]).push(ie,null));for(ie in p){var q=p[ie];if(F=y!=null?y[ie]:void 0,p.hasOwnProperty(ie)&&q!==F&&(q!=null||F!=null))if(ie==="style")if(F){for(I in F)!F.hasOwnProperty(I)||q&&q.hasOwnProperty(I)||(u||(u={}),u[I]="");for(I in q)q.hasOwnProperty(I)&&F[I]!==q[I]&&(u||(u={}),u[I]=q[I])}else u||(k||(k=[]),k.push(ie,u)),u=q;else ie==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,F=F?F.__html:void 0,q!=null&&F!==q&&(k=k||[]).push(ie,q)):ie==="children"?typeof q!="string"&&typeof q!="number"||(k=k||[]).push(ie,""+q):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(q!=null&&ie==="onScroll"&&Be("scroll",r),k||F===q||(k=[])):(k=k||[]).push(ie,q))}u&&(k=k||[]).push("style",u);var ie=k;(s.updateQueue=ie)&&(s.flags|=4)}},Eg=function(r,s,u,p){u!==p&&(s.flags|=4)};function oo(r,s){if(!Ue)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function yt(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(s)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&14680064,p|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,s}function Jk(r,s,u){var p=s.pendingProps;switch(Mc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(s),null;case 1:return Tt(s.type)&&Oa(),yt(s),null;case 3:return p=s.stateNode,Di(),Ve(Ct),Ve(mt),qc(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(r===null||r.child===null)&&(La(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,on!==null&&(Sf(on),on=null))),df(r,s),yt(s),null;case 5:Uc(s);var y=qr(to.current);if(u=s.type,r!==null&&s.stateNode!=null)Sg(r,s,u,p,y),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!p){if(s.stateNode===null)throw Error(n(166));return yt(s),null}if(r=qr(Nn.current),La(s)){p=s.stateNode,u=s.type;var k=s.memoizedProps;switch(p[En]=s,p[Xs]=k,r=(s.mode&1)!==0,u){case"dialog":Be("cancel",p),Be("close",p);break;case"iframe":case"object":case"embed":Be("load",p);break;case"video":case"audio":for(y=0;y<Ys.length;y++)Be(Ys[y],p);break;case"source":Be("error",p);break;case"img":case"image":case"link":Be("error",p),Be("load",p);break;case"details":Be("toggle",p);break;case"input":Pe(p,k),Be("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!k.multiple},Be("invalid",p);break;case"textarea":bn(p,k),Be("invalid",p)}Ss(u,k),y=null;for(var I in k)if(k.hasOwnProperty(I)){var F=k[I];I==="children"?typeof F=="string"?p.textContent!==F&&(k.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",F]):typeof F=="number"&&p.textContent!==""+F&&(k.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",""+F]):o.hasOwnProperty(I)&&F!=null&&I==="onScroll"&&Be("scroll",p)}switch(u){case"input":xe(p),wt(p,k,!0);break;case"textarea":xe(p),_t(p);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(p.onclick=Ta)}p=y,s.updateQueue=p,p!==null&&(s.flags|=4)}else{I=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ht(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=I.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=I.createElement(u,{is:p.is}):(r=I.createElement(u),u==="select"&&(I=r,p.multiple?I.multiple=!0:p.size&&(I.size=p.size))):r=I.createElementNS(r,u),r[En]=s,r[Xs]=p,kg(r,s,!1,!1),s.stateNode=r;e:{switch(I=Es(u,p),u){case"dialog":Be("cancel",r),Be("close",r),y=p;break;case"iframe":case"object":case"embed":Be("load",r),y=p;break;case"video":case"audio":for(y=0;y<Ys.length;y++)Be(Ys[y],r);y=p;break;case"source":Be("error",r),y=p;break;case"img":case"image":case"link":Be("error",r),Be("load",r),y=p;break;case"details":Be("toggle",r),y=p;break;case"input":Pe(r,p),y=Se(r,p),Be("invalid",r);break;case"option":y=p;break;case"select":r._wrapperState={wasMultiple:!!p.multiple},y=V({},p,{value:void 0}),Be("invalid",r);break;case"textarea":bn(r,p),y=jn(r,p),Be("invalid",r);break;default:y=p}Ss(u,y),F=y;for(k in F)if(F.hasOwnProperty(k)){var q=F[k];k==="style"?Jo(r,q):k==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Xo(r,q)):k==="children"?typeof q=="string"?(u!=="textarea"||q!=="")&&Dn(r,q):typeof q=="number"&&Dn(r,""+q):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(o.hasOwnProperty(k)?q!=null&&k==="onScroll"&&Be("scroll",r):q!=null&&E(r,k,q,I))}switch(u){case"input":xe(r),wt(r,p,!1);break;case"textarea":xe(r),_t(r);break;case"option":p.value!=null&&r.setAttribute("value",""+ee(p.value));break;case"select":r.multiple=!!p.multiple,k=p.value,k!=null?pt(r,!!p.multiple,k,!1):p.defaultValue!=null&&pt(r,!!p.multiple,p.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=Ta)}switch(u){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}}p&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return yt(s),null;case 6:if(r&&s.stateNode!=null)Eg(r,s,r.memoizedProps,p);else{if(typeof p!="string"&&s.stateNode===null)throw Error(n(166));if(u=qr(to.current),qr(Nn.current),La(s)){if(p=s.stateNode,u=s.memoizedProps,p[En]=s,(k=p.nodeValue!==u)&&(r=zt,r!==null))switch(r.tag){case 3:Ca(p.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ca(p.nodeValue,u,(r.mode&1)!==0)}k&&(s.flags|=4)}else p=(u.nodeType===9?u:u.ownerDocument).createTextNode(p),p[En]=s,s.stateNode=p}return yt(s),null;case 13:if(Ve(Ke),p=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ue&&Ft!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Cm(),Mi(),s.flags|=98560,k=!1;else if(k=La(s),p!==null&&p.dehydrated!==null){if(r===null){if(!k)throw Error(n(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[En]=s}else Mi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;yt(s),k=!1}else on!==null&&(Sf(on),on=null),k=!0;if(!k)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(p=p!==null,p!==(r!==null&&r.memoizedState!==null)&&p&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(Ke.current&1)!==0?st===0&&(st=3):_f())),s.updateQueue!==null&&(s.flags|=4),yt(s),null);case 4:return Di(),df(r,s),r===null&&Ks(s.stateNode.containerInfo),yt(s),null;case 10:return zc(s.type._context),yt(s),null;case 17:return Tt(s.type)&&Oa(),yt(s),null;case 19:if(Ve(Ke),k=s.memoizedState,k===null)return yt(s),null;if(p=(s.flags&128)!==0,I=k.rendering,I===null)if(p)oo(k,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(I=Ba(r),I!==null){for(s.flags|=128,oo(k,!1),p=I.updateQueue,p!==null&&(s.updateQueue=p,s.flags|=4),s.subtreeFlags=0,p=u,u=s.child;u!==null;)k=u,r=p,k.flags&=14680066,I=k.alternate,I===null?(k.childLanes=0,k.lanes=r,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,r=I.dependencies,k.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return $e(Ke,Ke.current&1|2),s.child}r=r.sibling}k.tail!==null&&Ye()>Bi&&(s.flags|=128,p=!0,oo(k,!1),s.lanes=4194304)}else{if(!p)if(r=Ba(I),r!==null){if(s.flags|=128,p=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),oo(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!Ue)return yt(s),null}else 2*Ye()-k.renderingStartTime>Bi&&u!==1073741824&&(s.flags|=128,p=!0,oo(k,!1),s.lanes=4194304);k.isBackwards?(I.sibling=s.child,s.child=I):(u=k.last,u!==null?u.sibling=I:s.child=I,k.last=I)}return k.tail!==null?(s=k.tail,k.rendering=s,k.tail=s.sibling,k.renderingStartTime=Ye(),s.sibling=null,u=Ke.current,$e(Ke,p?u&1|2:u&1),s):(yt(s),null);case 22:case 23:return Nf(),p=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==p&&(s.flags|=8192),p&&(s.mode&1)!==0?(Bt&1073741824)!==0&&(yt(s),s.subtreeFlags&6&&(s.flags|=8192)):yt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Zk(r,s){switch(Mc(s),s.tag){case 1:return Tt(s.type)&&Oa(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Di(),Ve(Ct),Ve(mt),qc(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Uc(s),null;case 13:if(Ve(Ke),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Mi()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Ve(Ke),null;case 4:return Di(),null;case 10:return zc(s.type._context),null;case 22:case 23:return Nf(),null;case 24:return null;default:return null}}var Xa=!1,vt=!1,eS=typeof WeakSet=="function"?WeakSet:Set,ge=null;function zi(r,s){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(p){Xe(r,s,p)}else u.current=null}function hf(r,s,u){try{u()}catch(p){Xe(r,s,p)}}var Ng=!1;function tS(r,s){if(Ec=ga,r=rm(),gc(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,k=p.focusNode;p=p.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var I=0,F=-1,q=-1,ie=0,le=0,ue=r,ae=null;t:for(;;){for(var pe;ue!==u||y!==0&&ue.nodeType!==3||(F=I+y),ue!==k||p!==0&&ue.nodeType!==3||(q=I+p),ue.nodeType===3&&(I+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)ae=ue,ue=pe;for(;;){if(ue===r)break t;if(ae===u&&++ie===y&&(F=I),ae===k&&++le===p&&(q=I),(pe=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=pe}u=F===-1||q===-1?null:{start:F,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Nc={focusedElem:r,selectionRange:u},ga=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ve=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Qe=ve.memoizedState,te=s.stateNode,Q=te.getSnapshotBeforeUpdate(s.elementType===s.type?we:an(s.type,we),Qe);te.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var ne=s.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){Xe(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ve=Ng,Ng=!1,ve}function ao(r,s,u){var p=s.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&r)===r){var k=y.destroy;y.destroy=void 0,k!==void 0&&hf(s,u,k)}y=y.next}while(y!==p)}}function Qa(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&r)===r){var p=u.create;u.destroy=p()}u=u.next}while(u!==s)}}function pf(r){var s=r.ref;if(s!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof s=="function"?s(r):s.current=r}}function _g(r){var s=r.alternate;s!==null&&(r.alternate=null,_g(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[En],delete s[Xs],delete s[Ic],delete s[Dk],delete s[$k])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Cg(r){return r.tag===5||r.tag===3||r.tag===4}function Tg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Cg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function mf(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(r,s):u.insertBefore(r,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(r,u)):(s=u,s.appendChild(r)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Ta));else if(p!==4&&(r=r.child,r!==null))for(mf(r,s,u),r=r.sibling;r!==null;)mf(r,s,u),r=r.sibling}function gf(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(p!==4&&(r=r.child,r!==null))for(gf(r,s,u),r=r.sibling;r!==null;)gf(r,s,u),r=r.sibling}var ct=null,ln=!1;function gr(r,s,u){for(u=u.child;u!==null;)Ig(r,s,u),u=u.sibling}function Ig(r,s,u){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(yi,u)}catch{}switch(u.tag){case 5:vt||zi(u,s);case 6:var p=ct,y=ln;ct=null,gr(r,s,u),ct=p,ln=y,ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):ct.removeChild(u.stateNode));break;case 18:ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?Tc(r.parentNode,u):r.nodeType===1&&Tc(r,u),zs(r)):Tc(ct,u.stateNode));break;case 4:p=ct,y=ln,ct=u.stateNode.containerInfo,ln=!0,gr(r,s,u),ct=p,ln=y;break;case 0:case 11:case 14:case 15:if(!vt&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var k=y,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&hf(u,s,I),y=y.next}while(y!==p)}gr(r,s,u);break;case 1:if(!vt&&(zi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(F){Xe(u,s,F)}gr(r,s,u);break;case 21:gr(r,s,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,gr(r,s,u),vt=p):gr(r,s,u);break;default:gr(r,s,u)}}function Og(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new eS),s.forEach(function(p){var y=cS.bind(null,r,p);u.has(p)||(u.add(p),p.then(y,y))})}}function un(r,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];try{var k=r,I=s,F=I;e:for(;F!==null;){switch(F.tag){case 5:ct=F.stateNode,ln=!1;break e;case 3:ct=F.stateNode.containerInfo,ln=!0;break e;case 4:ct=F.stateNode.containerInfo,ln=!0;break e}F=F.return}if(ct===null)throw Error(n(160));Ig(k,I,y),ct=null,ln=!1;var q=y.alternate;q!==null&&(q.return=null),y.return=null}catch(ie){Xe(y,s,ie)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Pg(s,r),s=s.sibling}function Pg(r,s){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(un(s,r),Cn(r),p&4){try{ao(3,r,r.return),Qa(3,r)}catch(we){Xe(r,r.return,we)}try{ao(5,r,r.return)}catch(we){Xe(r,r.return,we)}}break;case 1:un(s,r),Cn(r),p&512&&u!==null&&zi(u,u.return);break;case 5:if(un(s,r),Cn(r),p&512&&u!==null&&zi(u,u.return),r.flags&32){var y=r.stateNode;try{Dn(y,"")}catch(we){Xe(r,r.return,we)}}if(p&4&&(y=r.stateNode,y!=null)){var k=r.memoizedProps,I=u!==null?u.memoizedProps:k,F=r.type,q=r.updateQueue;if(r.updateQueue=null,q!==null)try{F==="input"&&k.type==="radio"&&k.name!=null&&Ae(y,k),Es(F,I);var ie=Es(F,k);for(I=0;I<q.length;I+=2){var le=q[I],ue=q[I+1];le==="style"?Jo(y,ue):le==="dangerouslySetInnerHTML"?Xo(y,ue):le==="children"?Dn(y,ue):E(y,le,ue,ie)}switch(F){case"input":Fe(y,k);break;case"textarea":kn(y,k);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!k.multiple;var pe=k.value;pe!=null?pt(y,!!k.multiple,pe,!1):ae!==!!k.multiple&&(k.defaultValue!=null?pt(y,!!k.multiple,k.defaultValue,!0):pt(y,!!k.multiple,k.multiple?[]:"",!1))}y[Xs]=k}catch(we){Xe(r,r.return,we)}}break;case 6:if(un(s,r),Cn(r),p&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,k=r.memoizedProps;try{y.nodeValue=k}catch(we){Xe(r,r.return,we)}}break;case 3:if(un(s,r),Cn(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{zs(s.containerInfo)}catch(we){Xe(r,r.return,we)}break;case 4:un(s,r),Cn(r);break;case 13:un(s,r),Cn(r),y=r.child,y.flags&8192&&(k=y.memoizedState!==null,y.stateNode.isHidden=k,!k||y.alternate!==null&&y.alternate.memoizedState!==null||(wf=Ye())),p&4&&Og(r);break;case 22:if(le=u!==null&&u.memoizedState!==null,r.mode&1?(vt=(ie=vt)||le,un(s,r),vt=ie):un(s,r),Cn(r),p&8192){if(ie=r.memoizedState!==null,(r.stateNode.isHidden=ie)&&!le&&(r.mode&1)!==0)for(ge=r,le=r.child;le!==null;){for(ue=ge=le;ge!==null;){switch(ae=ge,pe=ae.child,ae.tag){case 0:case 11:case 14:case 15:ao(4,ae,ae.return);break;case 1:zi(ae,ae.return);var ve=ae.stateNode;if(typeof ve.componentWillUnmount=="function"){p=ae,u=ae.return;try{s=p,ve.props=s.memoizedProps,ve.state=s.memoizedState,ve.componentWillUnmount()}catch(we){Xe(p,u,we)}}break;case 5:zi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Rg(ue);continue}}pe!==null?(pe.return=ae,ge=pe):Rg(ue)}le=le.sibling}e:for(le=null,ue=r;;){if(ue.tag===5){if(le===null){le=ue;try{y=ue.stateNode,ie?(k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(F=ue.stateNode,q=ue.memoizedProps.style,I=q!=null&&q.hasOwnProperty("display")?q.display:null,F.style.display=Qo("display",I))}catch(we){Xe(r,r.return,we)}}}else if(ue.tag===6){if(le===null)try{ue.stateNode.nodeValue=ie?"":ue.memoizedProps}catch(we){Xe(r,r.return,we)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===r)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===r)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===r)break e;le===ue&&(le=null),ue=ue.return}le===ue&&(le=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:un(s,r),Cn(r),p&4&&Og(r);break;case 21:break;default:un(s,r),Cn(r)}}function Cn(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(Cg(u)){var p=u;break e}u=u.return}throw Error(n(160))}switch(p.tag){case 5:var y=p.stateNode;p.flags&32&&(Dn(y,""),p.flags&=-33);var k=Tg(r);gf(r,k,y);break;case 3:case 4:var I=p.stateNode.containerInfo,F=Tg(r);mf(r,F,I);break;default:throw Error(n(161))}}catch(q){Xe(r,r.return,q)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function nS(r,s,u){ge=r,Ag(r)}function Ag(r,s,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,k=y.child;if(y.tag===22&&p){var I=y.memoizedState!==null||Xa;if(!I){var F=y.alternate,q=F!==null&&F.memoizedState!==null||vt;F=Xa;var ie=vt;if(Xa=I,(vt=q)&&!ie)for(ge=y;ge!==null;)I=ge,q=I.child,I.tag===22&&I.memoizedState!==null?Lg(y):q!==null?(q.return=I,ge=q):Lg(y);for(;k!==null;)ge=k,Ag(k),k=k.sibling;ge=y,Xa=F,vt=ie}Mg(r)}else(y.subtreeFlags&8772)!==0&&k!==null?(k.return=y,ge=k):Mg(r)}}function Mg(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:vt||Qa(5,s);break;case 1:var p=s.stateNode;if(s.flags&4&&!vt)if(u===null)p.componentDidMount();else{var y=s.elementType===s.type?u.memoizedProps:an(s.type,u.memoizedProps);p.componentDidUpdate(y,u.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var k=s.updateQueue;k!==null&&Rm(s,k,p);break;case 3:var I=s.updateQueue;if(I!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}Rm(s,I,u)}break;case 5:var F=s.stateNode;if(u===null&&s.flags&4){u=F;var q=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&u.focus();break;case"img":q.src&&(u.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var ie=s.alternate;if(ie!==null){var le=ie.memoizedState;if(le!==null){var ue=le.dehydrated;ue!==null&&zs(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vt||s.flags&512&&pf(s)}catch(ae){Xe(s,s.return,ae)}}if(s===r){ge=null;break}if(u=s.sibling,u!==null){u.return=s.return,ge=u;break}ge=s.return}}function Rg(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ge=u;break}ge=s.return}}function Lg(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Qa(4,s)}catch(q){Xe(s,u,q)}break;case 1:var p=s.stateNode;if(typeof p.componentDidMount=="function"){var y=s.return;try{p.componentDidMount()}catch(q){Xe(s,y,q)}}var k=s.return;try{pf(s)}catch(q){Xe(s,k,q)}break;case 5:var I=s.return;try{pf(s)}catch(q){Xe(s,I,q)}}}catch(q){Xe(s,s.return,q)}if(s===r){ge=null;break}var F=s.sibling;if(F!==null){F.return=s.return,ge=F;break}ge=s.return}}var rS=Math.ceil,Ja=T.ReactCurrentDispatcher,yf=T.ReactCurrentOwner,Qt=T.ReactCurrentBatchConfig,Re=0,lt=null,tt=null,ft=0,Bt=0,Fi=fr(0),st=0,lo=null,Kr=0,Za=0,vf=0,uo=null,Ot=null,wf=0,Bi=1/0,qn=null,el=!1,xf=null,yr=null,tl=!1,vr=null,nl=0,co=0,bf=null,rl=-1,il=0;function bt(){return(Re&6)!==0?Ye():rl!==-1?rl:rl=Ye()}function wr(r){return(r.mode&1)===0?1:(Re&2)!==0&&ft!==0?ft&-ft:Fk.transition!==null?(il===0&&(il=ha()),il):(r=De,r!==0||(r=window.event,r=r===void 0?16:Dp(r.type)),r)}function cn(r,s,u,p){if(50<co)throw co=0,bf=null,Error(n(185));Fr(r,u,p),((Re&2)===0||r!==lt)&&(r===lt&&((Re&2)===0&&(Za|=u),st===4&&xr(r,ft)),Pt(r,p),u===1&&Re===0&&(s.mode&1)===0&&(Bi=Ye()+500,Aa&&hr()))}function Pt(r,s){var u=r.callbackNode;da(r,s);var p=$n(r,r===lt?ft:0);if(p===0)u!==null&&la(u),r.callbackNode=null,r.callbackPriority=0;else if(s=p&-p,r.callbackPriority!==s){if(u!=null&&la(u),s===1)r.tag===0?zk(Dg.bind(null,r)):km(Dg.bind(null,r)),Lk(function(){(Re&6)===0&&hr()}),u=null;else{switch(Ip(p)){case 1:u=Ms;break;case 4:u=ca;break;case 16:u=gi;break;case 536870912:u=fa;break;default:u=gi}u=Hg(u,jg.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function jg(r,s){if(rl=-1,il=0,(Re&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Vi()&&r.callbackNode!==u)return null;var p=$n(r,r===lt?ft:0);if(p===0)return null;if((p&30)!==0||(p&r.expiredLanes)!==0||s)s=sl(r,p);else{s=p;var y=Re;Re|=2;var k=zg();(lt!==r||ft!==s)&&(qn=null,Bi=Ye()+500,Xr(r,s));do try{oS();break}catch(F){$g(r,F)}while(!0);$c(),Ja.current=k,Re=y,tt!==null?s=0:(lt=null,ft=0,s=st)}if(s!==0){if(s===2&&(y=Rs(r),y!==0&&(p=y,s=kf(r,y))),s===1)throw u=lo,Xr(r,0),xr(r,p),Pt(r,Ye()),u;if(s===6)xr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!iS(y)&&(s=sl(r,p),s===2&&(k=Rs(r),k!==0&&(p=k,s=kf(r,k))),s===1))throw u=lo,Xr(r,0),xr(r,p),Pt(r,Ye()),u;switch(r.finishedWork=y,r.finishedLanes=p,s){case 0:case 1:throw Error(n(345));case 2:Qr(r,Ot,qn);break;case 3:if(xr(r,p),(p&130023424)===p&&(s=wf+500-Ye(),10<s)){if($n(r,0)!==0)break;if(y=r.suspendedLanes,(y&p)!==p){bt(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=Cc(Qr.bind(null,r,Ot,qn),s);break}Qr(r,Ot,qn);break;case 4:if(xr(r,p),(p&4194240)===p)break;for(s=r.eventTimes,y=-1;0<p;){var I=31-Dt(p);k=1<<I,I=s[I],I>y&&(y=I),p&=~k}if(p=y,p=Ye()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*rS(p/1960))-p,10<p){r.timeoutHandle=Cc(Qr.bind(null,r,Ot,qn),p);break}Qr(r,Ot,qn);break;case 5:Qr(r,Ot,qn);break;default:throw Error(n(329))}}}return Pt(r,Ye()),r.callbackNode===u?jg.bind(null,r):null}function kf(r,s){var u=uo;return r.current.memoizedState.isDehydrated&&(Xr(r,s).flags|=256),r=sl(r,s),r!==2&&(s=Ot,Ot=u,s!==null&&Sf(s)),r}function Sf(r){Ot===null?Ot=r:Ot.push.apply(Ot,r)}function iS(r){for(var s=r;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var p=0;p<u.length;p++){var y=u[p],k=y.getSnapshot;y=y.value;try{if(!sn(k(),y))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function xr(r,s){for(s&=~vf,s&=~Za,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-Dt(s),p=1<<u;r[u]=-1,s&=~p}}function Dg(r){if((Re&6)!==0)throw Error(n(327));Vi();var s=$n(r,0);if((s&1)===0)return Pt(r,Ye()),null;var u=sl(r,s);if(r.tag!==0&&u===2){var p=Rs(r);p!==0&&(s=p,u=kf(r,p))}if(u===1)throw u=lo,Xr(r,0),xr(r,s),Pt(r,Ye()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Qr(r,Ot,qn),Pt(r,Ye()),null}function Ef(r,s){var u=Re;Re|=1;try{return r(s)}finally{Re=u,Re===0&&(Bi=Ye()+500,Aa&&hr())}}function Gr(r){vr!==null&&vr.tag===0&&(Re&6)===0&&Vi();var s=Re;Re|=1;var u=Qt.transition,p=De;try{if(Qt.transition=null,De=1,r)return r()}finally{De=p,Qt.transition=u,Re=s,(Re&6)===0&&hr()}}function Nf(){Bt=Fi.current,Ve(Fi)}function Xr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Rk(u)),tt!==null)for(u=tt.return;u!==null;){var p=u;switch(Mc(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&Oa();break;case 3:Di(),Ve(Ct),Ve(mt),qc();break;case 5:Uc(p);break;case 4:Di();break;case 13:Ve(Ke);break;case 19:Ve(Ke);break;case 10:zc(p.type._context);break;case 22:case 23:Nf()}u=u.return}if(lt=r,tt=r=br(r.current,null),ft=Bt=s,st=0,lo=null,vf=Za=Kr=0,Ot=uo=null,Hr!==null){for(s=0;s<Hr.length;s++)if(u=Hr[s],p=u.interleaved,p!==null){u.interleaved=null;var y=p.next,k=u.pending;if(k!==null){var I=k.next;k.next=y,p.next=I}u.pending=p}Hr=null}return r}function $g(r,s){do{var u=tt;try{if($c(),Va.current=qa,Wa){for(var p=Ge.memoizedState;p!==null;){var y=p.queue;y!==null&&(y.pending=null),p=p.next}Wa=!1}if(Yr=0,at=it=Ge=null,no=!1,ro=0,yf.current=null,u===null||u.return===null){st=1,lo=s,tt=null;break}e:{var k=r,I=u.return,F=u,q=s;if(s=ft,F.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var ie=q,le=F,ue=le.tag;if((le.mode&1)===0&&(ue===0||ue===11||ue===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var pe=ug(I);if(pe!==null){pe.flags&=-257,cg(pe,I,F,k,s),pe.mode&1&&lg(k,ie,s),s=pe,q=ie;var ve=s.updateQueue;if(ve===null){var we=new Set;we.add(q),s.updateQueue=we}else ve.add(q);break e}else{if((s&1)===0){lg(k,ie,s),_f();break e}q=Error(n(426))}}else if(Ue&&F.mode&1){var Qe=ug(I);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),cg(Qe,I,F,k,s),jc($i(q,F));break e}}k=q=$i(q,F),st!==4&&(st=2),uo===null?uo=[k]:uo.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,s&=-s,k.lanes|=s;var te=og(k,q,s);Mm(k,te);break e;case 1:F=q;var Q=k.type,ne=k.stateNode;if((k.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(yr===null||!yr.has(ne)))){k.flags|=65536,s&=-s,k.lanes|=s;var ce=ag(k,F,s);Mm(k,ce);break e}}k=k.return}while(k!==null)}Bg(u)}catch(be){s=be,tt===u&&u!==null&&(tt=u=u.return);continue}break}while(!0)}function zg(){var r=Ja.current;return Ja.current=qa,r===null?qa:r}function _f(){(st===0||st===3||st===2)&&(st=4),lt===null||(Kr&268435455)===0&&(Za&268435455)===0||xr(lt,ft)}function sl(r,s){var u=Re;Re|=2;var p=zg();(lt!==r||ft!==s)&&(qn=null,Xr(r,s));do try{sS();break}catch(y){$g(r,y)}while(!0);if($c(),Re=u,Ja.current=p,tt!==null)throw Error(n(261));return lt=null,ft=0,st}function sS(){for(;tt!==null;)Fg(tt)}function oS(){for(;tt!==null&&!Ku();)Fg(tt)}function Fg(r){var s=Ug(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,s===null?Bg(r):tt=s,yf.current=null}function Bg(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Jk(u,s,Bt),u!==null){tt=u;return}}else{if(u=Zk(u,s),u!==null){u.flags&=32767,tt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{st=6,tt=null;return}}if(s=s.sibling,s!==null){tt=s;return}tt=s=r}while(s!==null);st===0&&(st=5)}function Qr(r,s,u){var p=De,y=Qt.transition;try{Qt.transition=null,De=1,aS(r,s,u,p)}finally{Qt.transition=y,De=p}return null}function aS(r,s,u,p){do Vi();while(vr!==null);if((Re&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var k=u.lanes|u.childLanes;if(nc(r,k),r===lt&&(tt=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||tl||(tl=!0,Hg(gi,function(){return Vi(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=Qt.transition,Qt.transition=null;var I=De;De=1;var F=Re;Re|=4,yf.current=null,tS(r,u),Pg(u,r),Ck(Nc),ga=!!Ec,Nc=Ec=null,r.current=u,nS(u),ua(),Re=F,De=I,Qt.transition=k}else r.current=u;if(tl&&(tl=!1,vr=r,nl=y),k=r.pendingLanes,k===0&&(yr=null),Qu(u.stateNode),Pt(r,Ye()),s!==null)for(p=r.onRecoverableError,u=0;u<s.length;u++)y=s[u],p(y.value,{componentStack:y.stack,digest:y.digest});if(el)throw el=!1,r=xf,xf=null,r;return(nl&1)!==0&&r.tag!==0&&Vi(),k=r.pendingLanes,(k&1)!==0?r===bf?co++:(co=0,bf=r):co=0,hr(),null}function Vi(){if(vr!==null){var r=Ip(nl),s=Qt.transition,u=De;try{if(Qt.transition=null,De=16>r?16:r,vr===null)var p=!1;else{if(r=vr,vr=null,nl=0,(Re&6)!==0)throw Error(n(331));var y=Re;for(Re|=4,ge=r.current;ge!==null;){var k=ge,I=k.child;if((ge.flags&16)!==0){var F=k.deletions;if(F!==null){for(var q=0;q<F.length;q++){var ie=F[q];for(ge=ie;ge!==null;){var le=ge;switch(le.tag){case 0:case 11:case 15:ao(8,le,k)}var ue=le.child;if(ue!==null)ue.return=le,ge=ue;else for(;ge!==null;){le=ge;var ae=le.sibling,pe=le.return;if(_g(le),le===ie){ge=null;break}if(ae!==null){ae.return=pe,ge=ae;break}ge=pe}}}var ve=k.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Qe=we.sibling;we.sibling=null,we=Qe}while(we!==null)}}ge=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,ge=I;else e:for(;ge!==null;){if(k=ge,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ao(9,k,k.return)}var te=k.sibling;if(te!==null){te.return=k.return,ge=te;break e}ge=k.return}}var Q=r.current;for(ge=Q;ge!==null;){I=ge;var ne=I.child;if((I.subtreeFlags&2064)!==0&&ne!==null)ne.return=I,ge=ne;else e:for(I=Q;ge!==null;){if(F=ge,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Qa(9,F)}}catch(be){Xe(F,F.return,be)}if(F===I){ge=null;break e}var ce=F.sibling;if(ce!==null){ce.return=F.return,ge=ce;break e}ge=F.return}}if(Re=y,hr(),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(yi,r)}catch{}p=!0}return p}finally{De=u,Qt.transition=s}}return!1}function Vg(r,s,u){s=$i(u,s),s=og(r,s,1),r=mr(r,s,1),s=bt(),r!==null&&(Fr(r,1,s),Pt(r,s))}function Xe(r,s,u){if(r.tag===3)Vg(r,r,u);else for(;s!==null;){if(s.tag===3){Vg(s,r,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(yr===null||!yr.has(p))){r=$i(u,r),r=ag(s,r,1),s=mr(s,r,1),r=bt(),s!==null&&(Fr(s,1,r),Pt(s,r));break}}s=s.return}}function lS(r,s,u){var p=r.pingCache;p!==null&&p.delete(s),s=bt(),r.pingedLanes|=r.suspendedLanes&u,lt===r&&(ft&u)===u&&(st===4||st===3&&(ft&130023424)===ft&&500>Ye()-wf?Xr(r,0):vf|=u),Pt(r,s)}function Wg(r,s){s===0&&((r.mode&1)===0?s=1:(s=wi,wi<<=1,(wi&130023424)===0&&(wi=4194304)));var u=bt();r=Wn(r,s),r!==null&&(Fr(r,s,u),Pt(r,u))}function uS(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Wg(r,u)}function cS(r,s){var u=0;switch(r.tag){case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=r.stateNode;break;default:throw Error(n(314))}p!==null&&p.delete(s),Wg(r,u)}var Ug;Ug=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||Ct.current)It=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return It=!1,Qk(r,s,u);It=(r.flags&131072)!==0}else It=!1,Ue&&(s.flags&1048576)!==0&&Sm(s,Ra,s.index);switch(s.lanes=0,s.tag){case 2:var p=s.type;Ga(r,s),r=s.pendingProps;var y=Oi(s,mt.current);ji(s,u),y=Gc(null,s,p,r,y,u);var k=Xc();return s.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Tt(p)?(k=!0,Pa(s)):k=!1,s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Vc(s),y.updater=Ya,s.stateNode=y,y._reactInternals=s,nf(s,p,r,u),s=af(null,s,p,!0,k,u)):(s.tag=0,Ue&&k&&Ac(s),xt(null,s,y,u),s=s.child),s;case 16:p=s.elementType;e:{switch(Ga(r,s),r=s.pendingProps,y=p._init,p=y(p._payload),s.type=p,y=s.tag=dS(p),r=an(p,r),y){case 0:s=of(null,s,p,r,u);break e;case 1:s=gg(null,s,p,r,u);break e;case 11:s=fg(null,s,p,r,u);break e;case 14:s=dg(null,s,p,an(p.type,r),u);break e}throw Error(n(306,p,""))}return s;case 0:return p=s.type,y=s.pendingProps,y=s.elementType===p?y:an(p,y),of(r,s,p,y,u);case 1:return p=s.type,y=s.pendingProps,y=s.elementType===p?y:an(p,y),gg(r,s,p,y,u);case 3:e:{if(yg(s),r===null)throw Error(n(387));p=s.pendingProps,k=s.memoizedState,y=k.element,Am(r,s),Fa(s,p,null,u);var I=s.memoizedState;if(p=I.element,k.isDehydrated)if(k={element:p,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},s.updateQueue.baseState=k,s.memoizedState=k,s.flags&256){y=$i(Error(n(423)),s),s=vg(r,s,p,u,y);break e}else if(p!==y){y=$i(Error(n(424)),s),s=vg(r,s,p,u,y);break e}else for(Ft=cr(s.stateNode.containerInfo.firstChild),zt=s,Ue=!0,on=null,u=Om(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Mi(),p===y){s=Hn(r,s,u);break e}xt(r,s,p,u)}s=s.child}return s;case 5:return Lm(s),r===null&&Lc(s),p=s.type,y=s.pendingProps,k=r!==null?r.memoizedProps:null,I=y.children,_c(p,y)?I=null:k!==null&&_c(p,k)&&(s.flags|=32),mg(r,s),xt(r,s,I,u),s.child;case 6:return r===null&&Lc(s),null;case 13:return wg(r,s,u);case 4:return Wc(s,s.stateNode.containerInfo),p=s.pendingProps,r===null?s.child=Ri(s,null,p,u):xt(r,s,p,u),s.child;case 11:return p=s.type,y=s.pendingProps,y=s.elementType===p?y:an(p,y),fg(r,s,p,y,u);case 7:return xt(r,s,s.pendingProps,u),s.child;case 8:return xt(r,s,s.pendingProps.children,u),s.child;case 12:return xt(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(p=s.type._context,y=s.pendingProps,k=s.memoizedProps,I=y.value,$e(Da,p._currentValue),p._currentValue=I,k!==null)if(sn(k.value,I)){if(k.children===y.children&&!Ct.current){s=Hn(r,s,u);break e}}else for(k=s.child,k!==null&&(k.return=s);k!==null;){var F=k.dependencies;if(F!==null){I=k.child;for(var q=F.firstContext;q!==null;){if(q.context===p){if(k.tag===1){q=Un(-1,u&-u),q.tag=2;var ie=k.updateQueue;if(ie!==null){ie=ie.shared;var le=ie.pending;le===null?q.next=q:(q.next=le.next,le.next=q),ie.pending=q}}k.lanes|=u,q=k.alternate,q!==null&&(q.lanes|=u),Fc(k.return,u,s),F.lanes|=u;break}q=q.next}}else if(k.tag===10)I=k.type===s.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=u,F=I.alternate,F!==null&&(F.lanes|=u),Fc(I,u,s),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===s){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}xt(r,s,y.children,u),s=s.child}return s;case 9:return y=s.type,p=s.pendingProps.children,ji(s,u),y=Gt(y),p=p(y),s.flags|=1,xt(r,s,p,u),s.child;case 14:return p=s.type,y=an(p,s.pendingProps),y=an(p.type,y),dg(r,s,p,y,u);case 15:return hg(r,s,s.type,s.pendingProps,u);case 17:return p=s.type,y=s.pendingProps,y=s.elementType===p?y:an(p,y),Ga(r,s),s.tag=1,Tt(p)?(r=!0,Pa(s)):r=!1,ji(s,u),ig(s,p,y),nf(s,p,y,u),af(null,s,p,!0,r,u);case 19:return bg(r,s,u);case 22:return pg(r,s,u)}throw Error(n(156,s.tag))};function Hg(r,s){return aa(r,s)}function fS(r,s,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(r,s,u,p){return new fS(r,s,u,p)}function Cf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function dS(r){if(typeof r=="function")return Cf(r)?1:0;if(r!=null){if(r=r.$$typeof,r===D)return 11;if(r===G)return 14}return 2}function br(r,s){var u=r.alternate;return u===null?(u=Jt(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function ol(r,s,u,p,y,k){var I=2;if(p=r,typeof r=="function")Cf(r)&&(I=1);else if(typeof r=="string")I=5;else e:switch(r){case M:return Jr(u.children,y,k,s);case C:I=8,y|=8;break;case P:return r=Jt(12,u,s,y|2),r.elementType=P,r.lanes=k,r;case X:return r=Jt(13,u,s,y),r.elementType=X,r.lanes=k,r;case z:return r=Jt(19,u,s,y),r.elementType=z,r.lanes=k,r;case Z:return al(u,y,k,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case j:I=10;break e;case L:I=9;break e;case D:I=11;break e;case G:I=14;break e;case Y:I=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jt(I,u,s,y),s.elementType=r,s.type=p,s.lanes=k,s}function Jr(r,s,u,p){return r=Jt(7,r,p,s),r.lanes=u,r}function al(r,s,u,p){return r=Jt(22,r,p,s),r.elementType=Z,r.lanes=u,r.stateNode={isHidden:!1},r}function Tf(r,s,u){return r=Jt(6,r,null,s),r.lanes=u,r}function If(r,s,u){return s=Jt(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function hS(r,s,u,p,y){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zr(0),this.expirationTimes=zr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zr(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Of(r,s,u,p,y,k,I,F,q){return r=new hS(r,s,u,F,q),s===1?(s=1,k===!0&&(s|=8)):s=0,k=Jt(3,null,null,s),r.current=k,k.stateNode=r,k.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vc(k),r}function pS(r,s,u){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:p==null?null:""+p,children:r,containerInfo:s,implementation:u}}function qg(r){if(!r)return dr;r=r._reactInternals;e:{if(Sn(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Tt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Tt(u))return xm(r,u,s)}return s}function Yg(r,s,u,p,y,k,I,F,q){return r=Of(u,p,!0,r,y,k,I,F,q),r.context=qg(null),u=r.current,p=bt(),y=wr(u),k=Un(p,y),k.callback=s??null,mr(u,k,y),r.current.lanes=y,Fr(r,y,p),Pt(r,p),r}function ll(r,s,u,p){var y=s.current,k=bt(),I=wr(y);return u=qg(u),s.context===null?s.context=u:s.pendingContext=u,s=Un(k,I),s.payload={element:r},p=p===void 0?null:p,p!==null&&(s.callback=p),r=mr(y,s,I),r!==null&&(cn(r,y,I,k),za(r,y,I)),I}function ul(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Kg(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function Pf(r,s){Kg(r,s),(r=r.alternate)&&Kg(r,s)}function mS(){return null}var Gg=typeof reportError=="function"?reportError:function(r){console.error(r)};function Af(r){this._internalRoot=r}cl.prototype.render=Af.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));ll(r,s,null,null)},cl.prototype.unmount=Af.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Gr(function(){ll(null,r,null,null)}),s[zn]=null}};function cl(r){this._internalRoot=r}cl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ap();r={blockedOn:null,target:r,priority:s};for(var u=0;u<ar.length&&s!==0&&s<ar[u].priority;u++);ar.splice(u,0,r),u===0&&Lp(r)}};function Mf(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function fl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Xg(){}function gS(r,s,u,p,y){if(y){if(typeof p=="function"){var k=p;p=function(){var ie=ul(I);k.call(ie)}}var I=Yg(s,p,r,0,null,!1,!1,"",Xg);return r._reactRootContainer=I,r[zn]=I.current,Ks(r.nodeType===8?r.parentNode:r),Gr(),I}for(;y=r.lastChild;)r.removeChild(y);if(typeof p=="function"){var F=p;p=function(){var ie=ul(q);F.call(ie)}}var q=Of(r,0,!1,null,null,!1,!1,"",Xg);return r._reactRootContainer=q,r[zn]=q.current,Ks(r.nodeType===8?r.parentNode:r),Gr(function(){ll(s,q,u,p)}),q}function dl(r,s,u,p,y){var k=u._reactRootContainer;if(k){var I=k;if(typeof y=="function"){var F=y;y=function(){var q=ul(I);F.call(q)}}ll(s,I,r,y)}else I=gS(u,s,r,y,p);return ul(I)}Op=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=$r(s.pendingLanes);u!==0&&(xi(s,u|1),Pt(s,Ye()),(Re&6)===0&&(Bi=Ye()+500,hr()))}break;case 13:Gr(function(){var p=Wn(r,1);if(p!==null){var y=bt();cn(p,r,1,y)}}),Pf(r,1)}},rc=function(r){if(r.tag===13){var s=Wn(r,134217728);if(s!==null){var u=bt();cn(s,r,134217728,u)}Pf(r,134217728)}},Pp=function(r){if(r.tag===13){var s=wr(r),u=Wn(r,s);if(u!==null){var p=bt();cn(u,r,s,p)}Pf(r,s)}},Ap=function(){return De},Mp=function(r,s){var u=De;try{return De=r,s()}finally{De=u}},Cs=function(r,s,u){switch(s){case"input":if(Fe(r,u),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==r&&p.form===r.form){var y=Ia(p);if(!y)throw Error(n(90));he(p),Fe(p,y)}}}break;case"textarea":kn(r,u);break;case"select":s=u.value,s!=null&&pt(r,!!u.multiple,s,!1)}},na=Ef,ra=Gr;var yS={usingClientEntryPoint:!1,Events:[Qs,Ti,Ia,ea,ta,Ef]},fo={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vS={bundleType:fo.bundleType,version:fo.version,rendererPackageName:fo.rendererPackageName,rendererConfig:fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=sa(r),r===null?null:r.stateNode},findFiberByHostInstance:fo.findFiberByHostInstance||mS,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 hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{yi=hl.inject(vS),jt=hl}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yS,At.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mf(s))throw Error(n(200));return pS(r,s,null,u)},At.createRoot=function(r,s){if(!Mf(r))throw Error(n(299));var u=!1,p="",y=Gg;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(y=s.onRecoverableError)),s=Of(r,1,!1,null,null,u,!1,p,y),r[zn]=s.current,Ks(r.nodeType===8?r.parentNode:r),new Af(s)},At.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=sa(s),r=r===null?null:r.stateNode,r},At.flushSync=function(r){return Gr(r)},At.hydrate=function(r,s,u){if(!fl(s))throw Error(n(200));return dl(null,r,s,!0,u)},At.hydrateRoot=function(r,s,u){if(!Mf(r))throw Error(n(405));var p=u!=null&&u.hydratedSources||null,y=!1,k="",I=Gg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(I=u.onRecoverableError)),s=Yg(s,null,r,1,u??null,y,!1,k,I),r[zn]=s.current,Ks(r),p)for(r=0;r<p.length;r++)u=p[r],y=u._getVersion,y=y(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,y]:s.mutableSourceEagerHydrationData.push(u,y);return new cl(s)},At.render=function(r,s,u){if(!fl(s))throw Error(n(200));return dl(null,r,s,!1,u)},At.unmountComponentAtNode=function(r){if(!fl(r))throw Error(n(40));return r._reactRootContainer?(Gr(function(){dl(null,null,r,!1,function(){r._reactRootContainer=null,r[zn]=null})}),!0):!1},At.unstable_batchedUpdates=Ef,At.unstable_renderSubtreeIntoContainer=function(r,s,u,p){if(!fl(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return dl(r,s,u,!1,p)},At.version="18.3.1-next-f1338f8080-20240426",At}var iy;function Zv(){if(iy)return jf.exports;iy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jf.exports=TS(),jf.exports}var sy;function IS(){if(sy)return pl;sy=1;var e=Zv();return pl.createRoot=e.createRoot,pl.hydrateRoot=e.hydrateRoot,pl}var OS=IS();const PS=pu(OS);function rt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=rt(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var AS={value:()=>{}};function mu(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new zl(n)}function zl(e){this._=e}function MS(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",o=n.indexOf(".");if(o>=0&&(i=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}zl.prototype=mu.prototype={constructor:zl,on:function(e,t){var n=this._,i=MS(e+"",n),o,a=-1,l=i.length;if(arguments.length<2){for(;++a<l;)if((o=(e=i[a]).type)&&(o=RS(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<l;)if(o=(e=i[a]).type)n[o]=oy(n[o],e.name,t);else if(t==null)for(o in n)n[o]=oy(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zl(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),i=0,o,a;i<o;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(t,n)}};function RS(e,t){for(var n=0,i=e.length,o;n<i;++n)if((o=e[n]).name===t)return o.value}function oy(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=AS,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var uh="http://www.w3.org/1999/xhtml";const ay={svg:"http://www.w3.org/2000/svg",xhtml:uh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ay.hasOwnProperty(t)?{space:ay[t],local:e}:e}function LS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===uh&&t.documentElement.namespaceURI===uh?t.createElement(e):t.createElementNS(n,e)}}function jS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ew(e){var t=gu(e);return(t.local?jS:LS)(t)}function DS(){}function jh(e){return e==null?DS:function(){return this.querySelector(e)}}function $S(e){typeof e!="function"&&(e=jh(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=new Array(l),f,h,m=0;m<l;++m)(f=a[m])&&(h=e.call(f,f.__data__,m,a))&&("__data__"in f&&(h.__data__=f.__data__),c[m]=h);return new Wt(i,this._parents)}function zS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FS(){return[]}function tw(e){return e==null?FS:function(){return this.querySelectorAll(e)}}function BS(e){return function(){return zS(e.apply(this,arguments))}}function VS(e){typeof e=="function"?e=BS(e):e=tw(e);for(var t=this._groups,n=t.length,i=[],o=[],a=0;a<n;++a)for(var l=t[a],c=l.length,f,h=0;h<c;++h)(f=l[h])&&(i.push(e.call(f,f.__data__,h,l)),o.push(f));return new Wt(i,o)}function nw(e){return function(){return this.matches(e)}}function rw(e){return function(t){return t.matches(e)}}var WS=Array.prototype.find;function US(e){return function(){return WS.call(this.children,e)}}function HS(){return this.firstElementChild}function qS(e){return this.select(e==null?HS:US(typeof e=="function"?e:rw(e)))}var YS=Array.prototype.filter;function KS(){return Array.from(this.children)}function GS(e){return function(){return YS.call(this.children,e)}}function XS(e){return this.selectAll(e==null?KS:GS(typeof e=="function"?e:rw(e)))}function QS(e){typeof e!="function"&&(e=nw(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=[],f,h=0;h<l;++h)(f=a[h])&&e.call(f,f.__data__,h,a)&&c.push(f);return new Wt(i,this._parents)}function iw(e){return new Array(e.length)}function JS(){return new Wt(this._enter||this._groups.map(iw),this._parents)}function Gl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gl.prototype={constructor:Gl,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 ZS(e){return function(){return e}}function eE(e,t,n,i,o,a){for(var l=0,c,f=t.length,h=a.length;l<h;++l)(c=t[l])?(c.__data__=a[l],i[l]=c):n[l]=new Gl(e,a[l]);for(;l<f;++l)(c=t[l])&&(o[l]=c)}function tE(e,t,n,i,o,a,l){var c,f,h=new Map,m=t.length,d=a.length,g=new Array(m),v;for(c=0;c<m;++c)(f=t[c])&&(g[c]=v=l.call(f,f.__data__,c,t)+"",h.has(v)?o[c]=f:h.set(v,f));for(c=0;c<d;++c)v=l.call(e,a[c],c,a)+"",(f=h.get(v))?(i[c]=f,f.__data__=a[c],h.delete(v)):n[c]=new Gl(e,a[c]);for(c=0;c<m;++c)(f=t[c])&&h.get(g[c])===f&&(o[c]=f)}function nE(e){return e.__data__}function rE(e,t){if(!arguments.length)return Array.from(this,nE);var n=t?tE:eE,i=this._parents,o=this._groups;typeof e!="function"&&(e=ZS(e));for(var a=o.length,l=new Array(a),c=new Array(a),f=new Array(a),h=0;h<a;++h){var m=i[h],d=o[h],g=d.length,v=iE(e.call(m,m&&m.__data__,h,i)),x=v.length,w=c[h]=new Array(x),b=l[h]=new Array(x),S=f[h]=new Array(g);n(m,d,w,b,S,v,t);for(var _=0,E=0,T,A;_<x;++_)if(T=w[_]){for(_>=E&&(E=_+1);!(A=b[E])&&++E<x;);T._next=A||null}}return l=new Wt(l,i),l._enter=c,l._exit=f,l}function iE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sE(){return new Wt(this._exit||this._groups.map(iw),this._parents)}function oE(e,t,n){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?a.remove():n(a),i&&o?i.merge(o).order():o}function aE(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,o=n.length,a=i.length,l=Math.min(o,a),c=new Array(o),f=0;f<l;++f)for(var h=n[f],m=i[f],d=h.length,g=c[f]=new Array(d),v,x=0;x<d;++x)(v=h[x]||m[x])&&(g[x]=v);for(;f<o;++f)c[f]=n[f];return new Wt(c,this._parents)}function lE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],o=i.length-1,a=i[o],l;--o>=0;)(l=i[o])&&(a&&l.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(l,a),a=l);return this}function uE(e){e||(e=cE);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a){for(var l=n[a],c=l.length,f=o[a]=new Array(c),h,m=0;m<c;++m)(h=l[m])&&(f[m]=h);f.sort(t)}return new Wt(o,this._parents).order()}function cE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function fE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dE(){return Array.from(this)}function hE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var l=i[o];if(l)return l}return null}function pE(){let e=0;for(const t of this)++e;return e}function mE(){return!this.node()}function gE(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o=t[n],a=0,l=o.length,c;a<l;++a)(c=o[a])&&e.call(c,c.__data__,a,o);return this}function yE(e){return function(){this.removeAttribute(e)}}function vE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wE(e,t){return function(){this.setAttribute(e,t)}}function xE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kE(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 SE(e,t){var n=gu(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?vE:yE:typeof t=="function"?n.local?kE:bE:n.local?xE:wE)(n,t))}function sw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function EE(e){return function(){this.style.removeProperty(e)}}function NE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _E(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function CE(e,t,n){return arguments.length>1?this.each((t==null?EE:typeof t=="function"?_E:NE)(e,t,n??"")):ss(this.node(),e)}function ss(e,t){return e.style.getPropertyValue(t)||sw(e).getComputedStyle(e,null).getPropertyValue(t)}function TE(e){return function(){delete this[e]}}function IE(e,t){return function(){this[e]=t}}function OE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function PE(e,t){return arguments.length>1?this.each((t==null?TE:typeof t=="function"?OE:IE)(e,t)):this.node()[e]}function ow(e){return e.trim().split(/^|\s+/)}function Dh(e){return e.classList||new aw(e)}function aw(e){this._node=e,this._names=ow(e.getAttribute("class")||"")}aw.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 lw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function uw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function AE(e){return function(){lw(this,e)}}function ME(e){return function(){uw(this,e)}}function RE(e,t){return function(){(t.apply(this,arguments)?lw:uw)(this,e)}}function LE(e,t){var n=ow(e+"");if(arguments.length<2){for(var i=Dh(this.node()),o=-1,a=n.length;++o<a;)if(!i.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?RE:t?AE:ME)(n,t))}function jE(){this.textContent=""}function DE(e){return function(){this.textContent=e}}function $E(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zE(e){return arguments.length?this.each(e==null?jE:(typeof e=="function"?$E:DE)(e)):this.node().textContent}function FE(){this.innerHTML=""}function BE(e){return function(){this.innerHTML=e}}function VE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function WE(e){return arguments.length?this.each(e==null?FE:(typeof e=="function"?VE:BE)(e)):this.node().innerHTML}function UE(){this.nextSibling&&this.parentNode.appendChild(this)}function HE(){return this.each(UE)}function qE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function YE(){return this.each(qE)}function KE(e){var t=typeof e=="function"?e:ew(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GE(){return null}function XE(e,t){var n=typeof e=="function"?e:ew(e),i=t==null?GE:typeof t=="function"?t:jh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function QE(){var e=this.parentNode;e&&e.removeChild(this)}function JE(){return this.each(QE)}function ZE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tN(e){return this.select(e?eN:ZE)}function nN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rN(e){return function(t){e.call(this,t,this.__data__)}}function iN(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function sN(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,o=t.length,a;n<o;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function oN(e,t,n){return function(){var i=this.__on,o,a=rN(t);if(i){for(var l=0,c=i.length;l<c;++l)if((o=i[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),o.value=t;return}}this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},i?i.push(o):this.__on=[o]}}function aN(e,t,n){var i=iN(e+""),o,a=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,h=c.length,m;f<h;++f)for(o=0,m=c[f];o<a;++o)if((l=i[o]).type===m.type&&l.name===m.name)return m.value}return}for(c=t?oN:sN,o=0;o<a;++o)this.each(c(i[o],t,n));return this}function cw(e,t,n){var i=sw(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,n):(o=i.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function lN(e,t){return function(){return cw(this,e,t)}}function uN(e,t){return function(){return cw(this,e,t.apply(this,arguments))}}function cN(e,t){return this.each((typeof t=="function"?uN:lN)(e,t))}function*fN(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,a=i.length,l;o<a;++o)(l=i[o])&&(yield l)}var fw=[null];function Wt(e,t){this._groups=e,this._parents=t}function Bo(){return new Wt([[document.documentElement]],fw)}function dN(){return this}Wt.prototype=Bo.prototype={constructor:Wt,select:$S,selectAll:VS,selectChild:qS,selectChildren:XS,filter:QS,data:rE,enter:JS,exit:sE,join:oE,merge:aE,selection:dN,order:lE,sort:uE,call:fE,nodes:dE,node:hE,size:pE,empty:mE,each:gE,attr:SE,style:CE,property:PE,classed:LE,text:zE,html:WE,raise:HE,lower:YE,append:KE,insert:XE,remove:JE,clone:tN,datum:nN,on:aN,dispatch:cN,[Symbol.iterator]:fN};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],fw)}function hN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=hN(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const pN={passive:!1},Io={capture:!0,passive:!1};function zf(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function dw(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",es,Io);"onselectstart"in t?n.on("selectstart.drag",es,Io):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hw(e,t){var n=e.document.documentElement,i=Vt(e).on("dragstart.drag",null);t&&(i.on("click.drag",es,Io),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ml=e=>()=>e;function ch(e,{sourceEvent:t,subject:n,target:i,identifier:o,active:a,x:l,y:c,dx:f,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}ch.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mN(e){return!e.ctrlKey&&!e.button}function gN(){return this.parentNode}function yN(e,t){return t??{x:e.x,y:e.y}}function vN(){return navigator.maxTouchPoints||"ontouchstart"in this}function pw(){var e=mN,t=gN,n=yN,i=vN,o={},a=mu("start","drag","end"),l=0,c,f,h,m,d=0;function g(T){T.on("mousedown.drag",v).filter(i).on("touchstart.drag",b).on("touchmove.drag",S,pN).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(T,A){if(!(m||!e.call(this,T,A))){var R=E(this,t.call(this,T,A),T,A,"mouse");R&&(Vt(T.view).on("mousemove.drag",x,Io).on("mouseup.drag",w,Io),dw(T.view),zf(T),h=!1,c=T.clientX,f=T.clientY,R("start",T))}}function x(T){if(es(T),!h){var A=T.clientX-c,R=T.clientY-f;h=A*A+R*R>d}o.mouse("drag",T)}function w(T){Vt(T.view).on("mousemove.drag mouseup.drag",null),hw(T.view,h),es(T),o.mouse("end",T)}function b(T,A){if(e.call(this,T,A)){var R=T.changedTouches,M=t.call(this,T,A),C=R.length,P,j;for(P=0;P<C;++P)(j=E(this,M,T,A,R[P].identifier,R[P]))&&(zf(T),j("start",T,R[P]))}}function S(T){var A=T.changedTouches,R=A.length,M,C;for(M=0;M<R;++M)(C=o[A[M].identifier])&&(es(T),C("drag",T,A[M]))}function _(T){var A=T.changedTouches,R=A.length,M,C;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),M=0;M<R;++M)(C=o[A[M].identifier])&&(zf(T),C("end",T,A[M]))}function E(T,A,R,M,C,P){var j=a.copy(),L=dn(P||R,A),D,X,z;if((z=n.call(T,new ch("beforestart",{sourceEvent:R,target:g,identifier:C,active:l,x:L[0],y:L[1],dx:0,dy:0,dispatch:j}),M))!=null)return D=z.x-L[0]||0,X=z.y-L[1]||0,function G(Y,Z,H){var B=L,V;switch(Y){case"start":o[C]=G,V=l++;break;case"end":delete o[C],--l;case"drag":L=dn(H||Z,A),V=l;break}j.call(Y,T,new ch(Y,{sourceEvent:Z,subject:z,target:g,identifier:C,active:V,x:L[0]+D,y:L[1]+X,dx:L[0]-B[0],dy:L[1]-B[1],dispatch:j}),M)}}return g.filter=function(T){return arguments.length?(e=typeof T=="function"?T:ml(!!T),g):e},g.container=function(T){return arguments.length?(t=typeof T=="function"?T:ml(T),g):t},g.subject=function(T){return arguments.length?(n=typeof T=="function"?T:ml(T),g):n},g.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:ml(!!T),g):i},g.on=function(){var T=a.on.apply(a,arguments);return T===a?g:T},g.clickDistance=function(T){return arguments.length?(d=(T=+T)*T,g):Math.sqrt(d)},g}function $h(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Vo(){}var Oo=.7,Xl=1/Oo,ts="\\s*([+-]?\\d+)\\s*",Po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wN=/^#([0-9a-f]{3,8})$/,xN=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),bN=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),kN=new RegExp(`^rgba\\(${ts},${ts},${ts},${Po}\\)$`),SN=new RegExp(`^rgba\\(${An},${An},${An},${Po}\\)$`),EN=new RegExp(`^hsl\\(${Po},${An},${An}\\)$`),NN=new RegExp(`^hsla\\(${Po},${An},${An},${Po}\\)$`),ly={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};$h(Vo,ai,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:uy,formatHex:uy,formatHex8:_N,formatHsl:CN,formatRgb:cy,toString:cy});function uy(){return this.rgb().formatHex()}function _N(){return this.rgb().formatHex8()}function CN(){return gw(this).formatHsl()}function cy(){return this.rgb().formatRgb()}function ai(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fy(t):n===3?new Mt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gl(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=xN.exec(e))?new Mt(t[1],t[2],t[3],1):(t=bN.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=kN.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=SN.exec(e))?gl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=EN.exec(e))?py(t[1],t[2]/100,t[3]/100,1):(t=NN.exec(e))?py(t[1],t[2]/100,t[3]/100,t[4]):ly.hasOwnProperty(e)?fy(ly[e]):e==="transparent"?new Mt(NaN,NaN,NaN,0):null}function fy(e){return new Mt(e>>16&255,e>>8&255,e&255,1)}function gl(e,t,n,i){return i<=0&&(e=t=n=NaN),new Mt(e,t,n,i)}function TN(e){return e instanceof Vo||(e=ai(e)),e?(e=e.rgb(),new Mt(e.r,e.g,e.b,e.opacity)):new Mt}function fh(e,t,n,i){return arguments.length===1?TN(e):new Mt(e,t,n,i??1)}function Mt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}$h(Mt,fh,mw(Vo,{brighter(e){return e=e==null?Xl:Math.pow(Xl,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mt(si(this.r),si(this.g),si(this.b),Ql(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:dy,formatHex:dy,formatHex8:IN,formatRgb:hy,toString:hy}));function dy(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function IN(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni((isNaN(this.opacity)?1:this.opacity)*255)}`}function hy(){const e=Ql(this.opacity);return`${e===1?"rgb(":"rgba("}${si(this.r)}, ${si(this.g)}, ${si(this.b)}${e===1?")":`, ${e})`}`}function Ql(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function si(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ni(e){return e=si(e),(e<16?"0":"")+e.toString(16)}function py(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hn(e,t,n,i)}function gw(e){if(e instanceof hn)return new hn(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=ai(e)),!e)return new hn;if(e instanceof hn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),a=Math.max(t,n,i),l=NaN,c=a-o,f=(a+o)/2;return c?(t===a?l=(n-i)/c+(n<i)*6:n===a?l=(i-t)/c+2:l=(t-n)/c+4,c/=f<.5?a+o:2-a-o,l*=60):c=f>0&&f<1?0:l,new hn(l,c,f,e.opacity)}function ON(e,t,n,i){return arguments.length===1?gw(e):new hn(e,t,n,i??1)}function hn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}$h(hn,ON,mw(Vo,{brighter(e){return e=e==null?Xl:Math.pow(Xl,e),new hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new hn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new Mt(Ff(e>=240?e-240:e+120,o,i),Ff(e,o,i),Ff(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new hn(my(this.h),yl(this.s),yl(this.l),Ql(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=Ql(this.opacity);return`${e===1?"hsl(":"hsla("}${my(this.h)}, ${yl(this.s)*100}%, ${yl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function my(e){return e=(e||0)%360,e<0?e+360:e}function yl(e){return Math.max(0,Math.min(1,e||0))}function Ff(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 zh=e=>()=>e;function PN(e,t){return function(n){return e+n*t}}function AN(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function MN(e){return(e=+e)==1?yw:function(t,n){return n-t?AN(t,n,e):zh(isNaN(t)?n:t)}}function yw(e,t){var n=t-e;return n?PN(e,n):zh(isNaN(e)?t:e)}const Jl=(function e(t){var n=MN(t);function i(o,a){var l=n((o=fh(o)).r,(a=fh(a)).r),c=n(o.g,a.g),f=n(o.b,a.b),h=yw(o.opacity,a.opacity);return function(m){return o.r=l(m),o.g=c(m),o.b=f(m),o.opacity=h(m),o+""}}return i.gamma=e,i})(1);function RN(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),o;return function(a){for(o=0;o<n;++o)i[o]=e[o]*(1-a)+t[o]*a;return i}}function LN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jN(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,o=new Array(i),a=new Array(n),l;for(l=0;l<i;++l)o[l]=No(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(c){for(l=0;l<i;++l)a[l]=o[l](c);return a}}function DN(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function On(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function $N(e,t){var n={},i={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=No(e[o],t[o]):i[o]=t[o];return function(a){for(o in n)i[o]=n[o](a);return i}}var dh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bf=new RegExp(dh.source,"g");function zN(e){return function(){return e}}function FN(e){return function(t){return e(t)+""}}function vw(e,t){var n=dh.lastIndex=Bf.lastIndex=0,i,o,a,l=-1,c=[],f=[];for(e=e+"",t=t+"";(i=dh.exec(e))&&(o=Bf.exec(t));)(a=o.index)>n&&(a=t.slice(n,a),c[l]?c[l]+=a:c[++l]=a),(i=i[0])===(o=o[0])?c[l]?c[l]+=o:c[++l]=o:(c[++l]=null,f.push({i:l,x:On(i,o)})),n=Bf.lastIndex;return n<t.length&&(a=t.slice(n),c[l]?c[l]+=a:c[++l]=a),c.length<2?f[0]?FN(f[0].x):zN(t):(t=f.length,function(h){for(var m=0,d;m<t;++m)c[(d=f[m]).i]=d.x(h);return c.join("")})}function No(e,t){var n=typeof t,i;return t==null||n==="boolean"?zh(t):(n==="number"?On:n==="string"?(i=ai(t))?(t=i,Jl):vw:t instanceof ai?Jl:t instanceof Date?DN:LN(t)?RN:Array.isArray(t)?jN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?$N:On)(e,t)}var gy=180/Math.PI,hh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ww(e,t,n,i,o,a){var l,c,f;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(f=e*n+t*i)&&(n-=e*f,i-=t*f),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,f/=c),e*i<t*n&&(e=-e,t=-t,f=-f,l=-l),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*gy,skewX:Math.atan(f)*gy,scaleX:l,scaleY:c}}var vl;function BN(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hh:ww(t.a,t.b,t.c,t.d,t.e,t.f)}function VN(e){return e==null||(vl||(vl=document.createElementNS("http://www.w3.org/2000/svg","g")),vl.setAttribute("transform",e),!(e=vl.transform.baseVal.consolidate()))?hh:(e=e.matrix,ww(e.a,e.b,e.c,e.d,e.e,e.f))}function xw(e,t,n,i){function o(h){return h.length?h.pop()+" ":""}function a(h,m,d,g,v,x){if(h!==d||m!==g){var w=v.push("translate(",null,t,null,n);x.push({i:w-4,x:On(h,d)},{i:w-2,x:On(m,g)})}else(d||g)&&v.push("translate("+d+t+g+n)}function l(h,m,d,g){h!==m?(h-m>180?m+=360:m-h>180&&(h+=360),g.push({i:d.push(o(d)+"rotate(",null,i)-2,x:On(h,m)})):m&&d.push(o(d)+"rotate("+m+i)}function c(h,m,d,g){h!==m?g.push({i:d.push(o(d)+"skewX(",null,i)-2,x:On(h,m)}):m&&d.push(o(d)+"skewX("+m+i)}function f(h,m,d,g,v,x){if(h!==d||m!==g){var w=v.push(o(v)+"scale(",null,",",null,")");x.push({i:w-4,x:On(h,d)},{i:w-2,x:On(m,g)})}else(d!==1||g!==1)&&v.push(o(v)+"scale("+d+","+g+")")}return function(h,m){var d=[],g=[];return h=e(h),m=e(m),a(h.translateX,h.translateY,m.translateX,m.translateY,d,g),l(h.rotate,m.rotate,d,g),c(h.skewX,m.skewX,d,g),f(h.scaleX,h.scaleY,m.scaleX,m.scaleY,d,g),h=m=null,function(v){for(var x=-1,w=g.length,b;++x<w;)d[(b=g[x]).i]=b.x(v);return d.join("")}}}var WN=xw(BN,"px, ","px)","deg)"),UN=xw(VN,", ",")",")"),HN=1e-12;function yy(e){return((e=Math.exp(e))+1/e)/2}function qN(e){return((e=Math.exp(e))-1/e)/2}function YN(e){return((e=Math.exp(2*e))-1)/(e+1)}const Fl=(function e(t,n,i){function o(a,l){var c=a[0],f=a[1],h=a[2],m=l[0],d=l[1],g=l[2],v=m-c,x=d-f,w=v*v+x*x,b,S;if(w<HN)S=Math.log(g/h)/t,b=function(M){return[c+M*v,f+M*x,h*Math.exp(t*M*S)]};else{var _=Math.sqrt(w),E=(g*g-h*h+i*w)/(2*h*n*_),T=(g*g-h*h-i*w)/(2*g*n*_),A=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(T*T+1)-T);S=(R-A)/t,b=function(M){var C=M*S,P=yy(A),j=h/(n*_)*(P*YN(t*C+A)-qN(A));return[c+j*v,f+j*x,h*P/yy(t*C+A)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return o.rho=function(a){var l=Math.max(.001,+a),c=l*l,f=c*c;return e(l,c,f)},o})(Math.SQRT2,2,4);var os=0,wo=0,po=0,bw=1e3,Zl,xo,eu=0,li=0,yu=0,Ao=typeof performance=="object"&&performance.now?performance:Date,kw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fh(){return li||(kw(KN),li=Ao.now()+yu)}function KN(){li=0}function tu(){this._call=this._time=this._next=null}tu.prototype=Sw.prototype={constructor:tu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fh():+n)+(t==null?0:+t),!this._next&&xo!==this&&(xo?xo._next=this:Zl=this,xo=this),this._call=e,this._time=n,ph()},stop:function(){this._call&&(this._call=null,this._time=1/0,ph())}};function Sw(e,t,n){var i=new tu;return i.restart(e,t,n),i}function GN(){Fh(),++os;for(var e=Zl,t;e;)(t=li-e._time)>=0&&e._call.call(void 0,t),e=e._next;--os}function vy(){li=(eu=Ao.now())+yu,os=wo=0;try{GN()}finally{os=0,QN(),li=0}}function XN(){var e=Ao.now(),t=e-eu;t>bw&&(yu-=t,eu=e)}function QN(){for(var e,t=Zl,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Zl=n);xo=e,ph(i)}function ph(e){if(!os){wo&&(wo=clearTimeout(wo));var t=e-li;t>24?(e<1/0&&(wo=setTimeout(vy,e-Ao.now()-yu)),po&&(po=clearInterval(po))):(po||(eu=Ao.now(),po=setInterval(XN,bw)),os=1,kw(vy))}}function wy(e,t,n){var i=new tu;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,n),i}var JN=mu("start","end","cancel","interrupt"),ZN=[],Ew=0,xy=1,mh=2,Bl=3,by=4,gh=5,Vl=6;function vu(e,t,n,i,o,a){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;e_(e,n,{name:t,index:i,group:o,on:JN,tween:ZN,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Ew})}function Bh(e,t){var n=vn(e,t);if(n.state>Ew)throw new Error("too late; already scheduled");return n}function Rn(e,t){var n=vn(e,t);if(n.state>Bl)throw new Error("too late; already running");return n}function vn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e_(e,t,n){var i=e.__transition,o;i[t]=n,n.timer=Sw(a,0,n.time);function a(h){n.state=xy,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var m,d,g,v;if(n.state!==xy)return f();for(m in i)if(v=i[m],v.name===n.name){if(v.state===Bl)return wy(l);v.state===by?(v.state=Vl,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete i[m]):+m<t&&(v.state=Vl,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete i[m])}if(wy(function(){n.state===Bl&&(n.state=by,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=mh,n.on.call("start",e,e.__data__,n.index,n.group),n.state===mh){for(n.state=Bl,o=new Array(g=n.tween.length),m=0,d=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=v);o.length=d+1}}function c(h){for(var m=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=gh,1),d=-1,g=o.length;++d<g;)o[d].call(e,m);n.state===gh&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=Vl,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function Wl(e,t){var n=e.__transition,i,o,a=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((i=n[l]).name!==t){a=!1;continue}o=i.state>mh&&i.state<gh,i.state=Vl,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[l]}a&&delete e.__transition}}function t_(e){return this.each(function(){Wl(this,e)})}function n_(e,t){var n,i;return function(){var o=Rn(this,e),a=o.tween;if(a!==n){i=n=a;for(var l=0,c=i.length;l<c;++l)if(i[l].name===t){i=i.slice(),i.splice(l,1);break}}o.tween=i}}function r_(e,t,n){var i,o;if(typeof n!="function")throw new Error;return function(){var a=Rn(this,e),l=a.tween;if(l!==i){o=(i=l).slice();for(var c={name:t,value:n},f=0,h=o.length;f<h;++f)if(o[f].name===t){o[f]=c;break}f===h&&o.push(c)}a.tween=o}}function i_(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=vn(this.node(),n).tween,o=0,a=i.length,l;o<a;++o)if((l=i[o]).name===e)return l.value;return null}return this.each((t==null?n_:r_)(n,e,t))}function Vh(e,t,n){var i=e._id;return e.each(function(){var o=Rn(this,i);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return vn(o,i).value[t]}}function Nw(e,t){var n;return(typeof t=="number"?On:t instanceof ai?Jl:(n=ai(t))?(t=n,Jl):vw)(e,t)}function s_(e){return function(){this.removeAttribute(e)}}function o_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function a_(e,t,n){var i,o=n+"",a;return function(){var l=this.getAttribute(e);return l===o?null:l===i?a:a=t(i=l,n)}}function l_(e,t,n){var i,o=n+"",a;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===i?a:a=t(i=l,n)}}function u_(e,t,n){var i,o,a;return function(){var l,c=n(this),f;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),f=c+"",l===f?null:l===i&&f===o?a:(o=f,a=t(i=l,c)))}}function c_(e,t,n){var i,o,a;return function(){var l,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),f=c+"",l===f?null:l===i&&f===o?a:(o=f,a=t(i=l,c)))}}function f_(e,t){var n=gu(e),i=n==="transform"?UN:Nw;return this.attrTween(e,typeof t=="function"?(n.local?c_:u_)(n,i,Vh(this,"attr."+e,t)):t==null?(n.local?o_:s_)(n):(n.local?l_:a_)(n,i,t))}function d_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function h_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function p_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&h_(e,a)),n}return o._value=t,o}function m_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&d_(e,a)),n}return o._value=t,o}function g_(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=gu(e);return this.tween(n,(i.local?p_:m_)(i,t))}function y_(e,t){return function(){Bh(this,e).delay=+t.apply(this,arguments)}}function v_(e,t){return t=+t,function(){Bh(this,e).delay=t}}function w_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y_:v_)(t,e)):vn(this.node(),t).delay}function x_(e,t){return function(){Rn(this,e).duration=+t.apply(this,arguments)}}function b_(e,t){return t=+t,function(){Rn(this,e).duration=t}}function k_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?x_:b_)(t,e)):vn(this.node(),t).duration}function S_(e,t){if(typeof t!="function")throw new Error;return function(){Rn(this,e).ease=t}}function E_(e){var t=this._id;return arguments.length?this.each(S_(t,e)):vn(this.node(),t).ease}function N_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Rn(this,e).ease=n}}function __(e){if(typeof e!="function")throw new Error;return this.each(N_(this._id,e))}function C_(e){typeof e!="function"&&(e=nw(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=[],f,h=0;h<l;++h)(f=a[h])&&e.call(f,f.__data__,h,a)&&c.push(f);return new er(i,this._parents,this._name,this._id)}function T_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,o=n.length,a=Math.min(i,o),l=new Array(i),c=0;c<a;++c)for(var f=t[c],h=n[c],m=f.length,d=l[c]=new Array(m),g,v=0;v<m;++v)(g=f[v]||h[v])&&(d[v]=g);for(;c<i;++c)l[c]=t[c];return new er(l,this._parents,this._name,this._id)}function I_(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 O_(e,t,n){var i,o,a=I_(t)?Bh:Rn;return function(){var l=a(this,e),c=l.on;c!==i&&(o=(i=c).copy()).on(t,n),l.on=o}}function P_(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(O_(n,e,t))}function A_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function M_(){return this.on("end.remove",A_(this._id))}function R_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jh(e));for(var i=this._groups,o=i.length,a=new Array(o),l=0;l<o;++l)for(var c=i[l],f=c.length,h=a[l]=new Array(f),m,d,g=0;g<f;++g)(m=c[g])&&(d=e.call(m,m.__data__,g,c))&&("__data__"in m&&(d.__data__=m.__data__),h[g]=d,vu(h[g],t,n,g,h,vn(m,n)));return new er(a,this._parents,t,n)}function L_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tw(e));for(var i=this._groups,o=i.length,a=[],l=[],c=0;c<o;++c)for(var f=i[c],h=f.length,m,d=0;d<h;++d)if(m=f[d]){for(var g=e.call(m,m.__data__,d,f),v,x=vn(m,n),w=0,b=g.length;w<b;++w)(v=g[w])&&vu(v,t,n,w,g,x);a.push(g),l.push(m)}return new er(a,l,t,n)}var j_=Bo.prototype.constructor;function D_(){return new j_(this._groups,this._parents)}function $_(e,t){var n,i,o;return function(){var a=ss(this,e),l=(this.style.removeProperty(e),ss(this,e));return a===l?null:a===n&&l===i?o:o=t(n=a,i=l)}}function _w(e){return function(){this.style.removeProperty(e)}}function z_(e,t,n){var i,o=n+"",a;return function(){var l=ss(this,e);return l===o?null:l===i?a:a=t(i=l,n)}}function F_(e,t,n){var i,o,a;return function(){var l=ss(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),ss(this,e))),l===f?null:l===i&&f===o?a:(o=f,a=t(i=l,c))}}function B_(e,t){var n,i,o,a="style."+t,l="end."+a,c;return function(){var f=Rn(this,e),h=f.on,m=f.value[a]==null?c||(c=_w(t)):void 0;(h!==n||o!==m)&&(i=(n=h).copy()).on(l,o=m),f.on=i}}function V_(e,t,n){var i=(e+="")=="transform"?WN:Nw;return t==null?this.styleTween(e,$_(e,i)).on("end.style."+e,_w(e)):typeof t=="function"?this.styleTween(e,F_(e,i,Vh(this,"style."+e,t))).each(B_(this._id,e)):this.styleTween(e,z_(e,i,t),n).on("end.style."+e,null)}function W_(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function U_(e,t,n){var i,o;function a(){var l=t.apply(this,arguments);return l!==o&&(i=(o=l)&&W_(e,l,n)),i}return a._value=t,a}function H_(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,U_(e,t,n??""))}function q_(e){return function(){this.textContent=e}}function Y_(e){return function(){var t=e(this);this.textContent=t??""}}function K_(e){return this.tween("text",typeof e=="function"?Y_(Vh(this,"text",e)):q_(e==null?"":e+""))}function G_(e){return function(t){this.textContent=e.call(this,t)}}function X_(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&G_(o)),t}return i._value=e,i}function Q_(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,X_(e))}function J_(){for(var e=this._name,t=this._id,n=Cw(),i=this._groups,o=i.length,a=0;a<o;++a)for(var l=i[a],c=l.length,f,h=0;h<c;++h)if(f=l[h]){var m=vn(f,t);vu(f,e,n,h,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new er(i,this._parents,e,n)}function Z_(){var e,t,n=this,i=n._id,o=n.size();return new Promise(function(a,l){var c={value:l},f={value:function(){--o===0&&a()}};n.each(function(){var h=Rn(this,i),m=h.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),h.on=t}),o===0&&a()})}var eC=0;function er(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Cw(){return++eC}var Yn=Bo.prototype;er.prototype={constructor:er,select:R_,selectAll:L_,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:C_,merge:T_,selection:D_,transition:J_,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:P_,attr:f_,attrTween:g_,style:V_,styleTween:H_,text:K_,textTween:Q_,remove:M_,tween:i_,delay:w_,duration:k_,ease:E_,easeVarying:__,end:Z_,[Symbol.iterator]:Yn[Symbol.iterator]};function tC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nC={time:null,delay:0,duration:250,ease:tC};function rC(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 iC(e){var t,n;e instanceof er?(t=e._id,e=e._name):(t=Cw(),(n=nC).time=Fh(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var l=i[a],c=l.length,f,h=0;h<c;++h)(f=l[h])&&vu(f,e,t,h,l,n||rC(f,t));return new er(i,this._parents,e,t)}Bo.prototype.interrupt=t_;Bo.prototype.transition=iC;const wl=e=>()=>e;function sC(e,{sourceEvent:t,target:n,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Xn(e,t,n){this.k=e,this.x=t,this.y=n}Xn.prototype={constructor:Xn,scale:function(e){return e===1?this:new Xn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xn(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 wu=new Xn(1,0,0);Tw.prototype=Xn.prototype;function Tw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wu;return e.__zoom}function Vf(e){e.stopImmediatePropagation()}function mo(e){e.preventDefault(),e.stopImmediatePropagation()}function oC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function aC(){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 ky(){return this.__zoom||wu}function lC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uC(){return navigator.maxTouchPoints||"ontouchstart"in this}function cC(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function Iw(){var e=oC,t=aC,n=cC,i=lC,o=uC,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=Fl,h=mu("start","zoom","end"),m,d,g,v=500,x=150,w=0,b=10;function S(z){z.property("__zoom",ky).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",j).filter(o).on("touchstart.zoom",L).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(z,G,Y,Z){var H=z.selection?z.selection():z;H.property("__zoom",ky),z!==H?A(z,G,Y,Z):H.interrupt().each(function(){R(this,arguments).event(Z).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},S.scaleBy=function(z,G,Y,Z){S.scaleTo(z,function(){var H=this.__zoom.k,B=typeof G=="function"?G.apply(this,arguments):G;return H*B},Y,Z)},S.scaleTo=function(z,G,Y,Z){S.transform(z,function(){var H=t.apply(this,arguments),B=this.__zoom,V=Y==null?T(H):typeof Y=="function"?Y.apply(this,arguments):Y,$=B.invert(V),U=typeof G=="function"?G.apply(this,arguments):G;return n(E(_(B,U),V,$),H,l)},Y,Z)},S.translateBy=function(z,G,Y,Z){S.transform(z,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),l)},null,Z)},S.translateTo=function(z,G,Y,Z,H){S.transform(z,function(){var B=t.apply(this,arguments),V=this.__zoom,$=Z==null?T(B):typeof Z=="function"?Z.apply(this,arguments):Z;return n(wu.translate($[0],$[1]).scale(V.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof Y=="function"?-Y.apply(this,arguments):-Y),B,l)},Z,H)};function _(z,G){return G=Math.max(a[0],Math.min(a[1],G)),G===z.k?z:new Xn(G,z.x,z.y)}function E(z,G,Y){var Z=G[0]-Y[0]*z.k,H=G[1]-Y[1]*z.k;return Z===z.x&&H===z.y?z:new Xn(z.k,Z,H)}function T(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function A(z,G,Y,Z){z.on("start.zoom",function(){R(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(Z).end()}).tween("zoom",function(){var H=this,B=arguments,V=R(H,B).event(Z),$=t.apply(H,B),U=Y==null?T($):typeof Y=="function"?Y.apply(H,B):Y,W=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),K=H.__zoom,J=typeof G=="function"?G.apply(H,B):G,re=f(K.invert(U).concat(W/K.k),J.invert(U).concat(W/J.k));return function(oe){if(oe===1)oe=J;else{var ee=re(oe),se=W/ee[2];oe=new Xn(se,U[0]-ee[0]*se,U[1]-ee[1]*se)}V.zoom(null,oe)}})}function R(z,G,Y){return!Y&&z.__zooming||new M(z,G)}function M(z,G){this.that=z,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,G),this.taps=0}M.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,G){return this.mouse&&z!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var G=Vt(this.that).datum();h.call(z,this.that,new sC(z,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:h}),G)}};function C(z,...G){if(!e.apply(this,arguments))return;var Y=R(this,G).event(z),Z=this.__zoom,H=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,i.apply(this,arguments)))),B=dn(z);if(Y.wheel)(Y.mouse[0][0]!==B[0]||Y.mouse[0][1]!==B[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=B)),clearTimeout(Y.wheel);else{if(Z.k===H)return;Y.mouse=[B,Z.invert(B)],Wl(this),Y.start()}mo(z),Y.wheel=setTimeout(V,x),Y.zoom("mouse",n(E(_(Z,H),Y.mouse[0],Y.mouse[1]),Y.extent,l));function V(){Y.wheel=null,Y.end()}}function P(z,...G){if(g||!e.apply(this,arguments))return;var Y=z.currentTarget,Z=R(this,G,!0).event(z),H=Vt(z.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",W,!0),B=dn(z,Y),V=z.clientX,$=z.clientY;dw(z.view),Vf(z),Z.mouse=[B,this.__zoom.invert(B)],Wl(this),Z.start();function U(K){if(mo(K),!Z.moved){var J=K.clientX-V,re=K.clientY-$;Z.moved=J*J+re*re>w}Z.event(K).zoom("mouse",n(E(Z.that.__zoom,Z.mouse[0]=dn(K,Y),Z.mouse[1]),Z.extent,l))}function W(K){H.on("mousemove.zoom mouseup.zoom",null),hw(K.view,Z.moved),mo(K),Z.event(K).end()}}function j(z,...G){if(e.apply(this,arguments)){var Y=this.__zoom,Z=dn(z.changedTouches?z.changedTouches[0]:z,this),H=Y.invert(Z),B=Y.k*(z.shiftKey?.5:2),V=n(E(_(Y,B),Z,H),t.apply(this,G),l);mo(z),c>0?Vt(this).transition().duration(c).call(A,V,Z,z):Vt(this).call(S.transform,V,Z,z)}}function L(z,...G){if(e.apply(this,arguments)){var Y=z.touches,Z=Y.length,H=R(this,G,z.changedTouches.length===Z).event(z),B,V,$,U;for(Vf(z),V=0;V<Z;++V)$=Y[V],U=dn($,this),U=[U,this.__zoom.invert(U),$.identifier],H.touch0?!H.touch1&&H.touch0[2]!==U[2]&&(H.touch1=U,H.taps=0):(H.touch0=U,B=!0,H.taps=1+!!m);m&&(m=clearTimeout(m)),B&&(H.taps<2&&(d=U[0],m=setTimeout(function(){m=null},v)),Wl(this),H.start())}}function D(z,...G){if(this.__zooming){var Y=R(this,G).event(z),Z=z.changedTouches,H=Z.length,B,V,$,U;for(mo(z),B=0;B<H;++B)V=Z[B],$=dn(V,this),Y.touch0&&Y.touch0[2]===V.identifier?Y.touch0[0]=$:Y.touch1&&Y.touch1[2]===V.identifier&&(Y.touch1[0]=$);if(V=Y.that.__zoom,Y.touch1){var W=Y.touch0[0],K=Y.touch0[1],J=Y.touch1[0],re=Y.touch1[1],oe=(oe=J[0]-W[0])*oe+(oe=J[1]-W[1])*oe,ee=(ee=re[0]-K[0])*ee+(ee=re[1]-K[1])*ee;V=_(V,Math.sqrt(oe/ee)),$=[(W[0]+J[0])/2,(W[1]+J[1])/2],U=[(K[0]+re[0])/2,(K[1]+re[1])/2]}else if(Y.touch0)$=Y.touch0[0],U=Y.touch0[1];else return;Y.zoom("touch",n(E(V,$,U),Y.extent,l))}}function X(z,...G){if(this.__zooming){var Y=R(this,G).event(z),Z=z.changedTouches,H=Z.length,B,V;for(Vf(z),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),B=0;B<H;++B)V=Z[B],Y.touch0&&Y.touch0[2]===V.identifier?delete Y.touch0:Y.touch1&&Y.touch1[2]===V.identifier&&delete Y.touch1;if(Y.touch1&&!Y.touch0&&(Y.touch0=Y.touch1,delete Y.touch1),Y.touch0)Y.touch0[1]=this.__zoom.invert(Y.touch0[0]);else if(Y.end(),Y.taps===2&&(V=dn(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<b)){var $=Vt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return S.wheelDelta=function(z){return arguments.length?(i=typeof z=="function"?z:wl(+z),S):i},S.filter=function(z){return arguments.length?(e=typeof z=="function"?z:wl(!!z),S):e},S.touchable=function(z){return arguments.length?(o=typeof z=="function"?z:wl(!!z),S):o},S.extent=function(z){return arguments.length?(t=typeof z=="function"?z:wl([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),S):t},S.scaleExtent=function(z){return arguments.length?(a[0]=+z[0],a[1]=+z[1],S):[a[0],a[1]]},S.translateExtent=function(z){return arguments.length?(l[0][0]=+z[0][0],l[1][0]=+z[1][0],l[0][1]=+z[0][1],l[1][1]=+z[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(z){return arguments.length?(n=z,S):n},S.duration=function(z){return arguments.length?(c=+z,S):c},S.interpolate=function(z){return arguments.length?(f=z,S):f},S.on=function(){var z=h.on.apply(h,arguments);return z===h?S:z},S.clickDistance=function(z){return arguments.length?(w=(z=+z)*z,S):Math.sqrt(w)},S.tapDistance=function(z){return arguments.length?(b=+z,S):b},S}const gn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Mo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ow=["Enter"," ","Escape"],Pw={"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 as;(function(e){e.Strict="strict",e.Loose="loose"})(as||(as={}));var oi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(oi||(oi={}));var Ro;(function(e){e.Partial="partial",e.Full="full"})(Ro||(Ro={}));const Aw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Tr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Tr||(Tr={}));var nu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nu||(nu={}));var ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ke||(ke={}));const Sy={[ke.Left]:ke.Right,[ke.Right]:ke.Left,[ke.Top]:ke.Bottom,[ke.Bottom]:ke.Top};function Mw(e){return e===null?null:e?"valid":"invalid"}const Rw=e=>"id"in e&&"source"in e&&"target"in e,fC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Wo=(e,t=[0,0])=>{const{width:n,height:i}=tr(e),o=e.origin??t,a=n*o[0],l=i*o[1];return{x:e.position.x-a,y:e.position.y-l}},dC=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,o)=>{const a=typeof o=="string";let l=!t.nodeLookup&&!a?o:void 0;t.nodeLookup&&(l=a?t.nodeLookup.get(o):Wh(o)?o:t.nodeLookup.get(o.id));const c=l?ru(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xu(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return bu(n)},Uo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=xu(n,ru(o)),i=!0)}),i?bu(n):{x:0,y:0,width:0,height:0}},Uh=(e,t,[n,i,o]=[0,0,1],a=!1,l=!1)=>{const c={...ys(t,[n,i,o]),width:t.width/o,height:t.height/o},f=[];for(const h of e.values()){const{measured:m,selectable:d=!0,hidden:g=!1}=h;if(l&&!d||g)continue;const v=m.width??h.width??h.initialWidth??null,x=m.height??h.height??h.initialHeight??null,w=Lo(c,us(h)),b=(v??0)*(x??0),S=a&&w>0;(!h.internals.handleBounds||S||w>=b||h.dragging)&&f.push(h)}return f},hC=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function pC(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!i||i.has(o.id))&&n.set(o.id,o)}),n}async function mC({nodes:e,width:t,height:n,panZoom:i,minZoom:o,maxZoom:a},l){if(e.size===0)return!0;const c=pC(e,l),f=Uo(c),h=qh(f,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??a,(l==null?void 0:l.padding)??.1);return await i.setViewport(h,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function Lw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:o,onError:a}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:f,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let d=l.extent||o;if(l.extent==="parent"&&!l.expandParent)if(!c)a==null||a("005",gn.error005());else{const v=c.measured.width,x=c.measured.height;v&&x&&(d=[[f,h],[f+v,h+x]])}else c&&ci(l.extent)&&(d=[[l.extent[0][0]+f,l.extent[0][1]+h],[l.extent[1][0]+f,l.extent[1][1]+h]]);const g=ci(d)?ui(t,d,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(a==null||a("015",gn.error015())),{position:{x:g.x-f+(l.measured.width??0)*m[0],y:g.y-h+(l.measured.height??0)*m[1]},positionAbsolute:g}}async function gC({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:o}){const a=new Set(e.map(g=>g.id)),l=[];for(const g of n){if(g.deletable===!1)continue;const v=a.has(g.id),x=!v&&g.parentId&&l.find(w=>w.id===g.parentId);(v||x)&&l.push(g)}const c=new Set(t.map(g=>g.id)),f=i.filter(g=>g.deletable!==!1),m=hC(l,f);for(const g of f)c.has(g.id)&&!m.find(x=>x.id===g.id)&&m.push(g);if(!o)return{edges:m,nodes:l};const d=await o({nodes:l,edges:m});return typeof d=="boolean"?d?{edges:m,nodes:l}:{edges:[],nodes:[]}:d}const ls=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ui=(e={x:0,y:0},t,n)=>({x:ls(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ls(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function jw(e,t,n){const{width:i,height:o}=tr(n),{x:a,y:l}=n.internals.positionAbsolute;return ui(e,[[a,l],[a+i,l+o]],t)}const Ey=(e,t,n)=>e<t?ls(Math.abs(e-t),1,t)/t:e>n?-ls(Math.abs(e-n),1,t)/t:0,Hh=(e,t,n=15,i=40)=>{const o=Ey(e.x,i,t.width-i)*n,a=Ey(e.y,i,t.height-i)*n;return[o,a]},xu=(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)}),yh=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),bu=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),us=(e,t=[0,0])=>{var o,a;const{x:n,y:i}=Wh(e)?e.internals.positionAbsolute:Wo(e,t);return{x:n,y:i,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},ru=(e,t=[0,0])=>{var o,a;const{x:n,y:i}=Wh(e)?e.internals.positionAbsolute:Wo(e,t);return{x:n,y:i,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:i+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},Dw=(e,t)=>bu(xu(yh(e),yh(t))),Lo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Ny=e=>pn(e.width)&&pn(e.height)&&pn(e.x)&&pn(e.y),pn=e=>!isNaN(e)&&isFinite(e),$w=(e,t)=>(n,i)=>{},Ho=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ys=({x:e,y:t},[n,i,o],a=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-i)/o};return a?Ho(c,l):c},cs=({x:e,y:t},[n,i,o])=>({x:e*o+n,y:t*o+i});function Wi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yC(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Wi(e,n),o=Wi(e,t);return{top:i,right:o,bottom:i,left:o,x:o*2,y:i*2}}if(typeof e=="object"){const i=Wi(e.top??e.y??0,n),o=Wi(e.bottom??e.y??0,n),a=Wi(e.left??e.x??0,t),l=Wi(e.right??e.x??0,t);return{top:i,right:l,bottom:o,left:a,x:a+l,y:i+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vC(e,t,n,i,o,a){const{x:l,y:c}=cs(e,[t,n,i]),{x:f,y:h}=cs({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=o-f,d=a-h;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(d)}}const qh=(e,t,n,i,o,a)=>{const l=yC(a,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,h=Math.min(c,f),m=ls(h,i,o),d=e.x+e.width/2,g=e.y+e.height/2,v=t/2-d*m,x=n/2-g*m,w=vC(e,v,x,m,t,n),b={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:v-b.left+b.right,y:x-b.top+b.bottom,zoom:m}},jo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ci(e){return e!=null&&e!=="parent"}function tr(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 zw(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 Fw(e,t={width:0,height:0},n,i,o){const a={...e},l=i.get(n);if(l){const c=l.origin||o;a.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],a.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return a}function _y(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function wC(){let e,t;return{promise:new Promise((i,o)=>{e=i,t=o}),resolve:e,reject:t}}function xC(e){return{...Pw,...e||{}}}function _o(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:o}){const{x:a,y:l}=mn(e),c=ys({x:a-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},i),{x:f,y:h}=n?Ho(c,t):c;return{xSnapped:f,ySnapped:h,...c}}const Yh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Bw=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},bC=["INPUT","SELECT","TEXTAREA"];function Vw(e){var i,o;const t=((o=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:bC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ww=e=>"clientX"in e,mn=(e,t)=>{var a,l;const n=Ww(e),i=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Cy=(e,t,n,i,o)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...Yh(l)}})};function Uw({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:o,sourceControlY:a,targetControlX:l,targetControlY:c}){const f=e*.125+o*.375+l*.375+n*.125,h=t*.125+a*.375+c*.375+i*.125,m=Math.abs(f-e),d=Math.abs(h-t);return[f,h,m,d]}function xl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ty({pos:e,x1:t,y1:n,x2:i,y2:o,c:a}){switch(e){case ke.Left:return[t-xl(t-i,a),n];case ke.Right:return[t+xl(i-t,a),n];case ke.Top:return[t,n-xl(n-o,a)];case ke.Bottom:return[t,n+xl(o-n,a)]}}function Hw({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top,curvature:l=.25}){const[c,f]=Ty({pos:n,x1:e,y1:t,x2:i,y2:o,c:l}),[h,m]=Ty({pos:a,x1:i,y1:o,x2:e,y2:t,c:l}),[d,g,v,x]=Uw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:m});return[`M${e},${t} C${c},${f} ${h},${m} ${i},${o}`,d,g,v,x]}function qw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,l=Math.abs(i-t)/2,c=i<t?i+l:i-l;return[a,c,o,l]}function kC({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if(a==="manual")return i;const l=o&&n?i+1e3:i,c=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return l+c}function SC({sourceNode:e,targetNode:t,width:n,height:i,transform:o}){const a=xu(ru(e),ru(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:i/o[2]};return Lo(l,bu(a))>0}const EC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,NC=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),_C=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",gn.error006()),t;const i=n.getEdgeId||EC;let o;return Rw(e)?o={...e}:o={...e,id:i(e)},NC(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Yw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[o,a,l,c]=qw({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,o,a,l,c]}const Iy={[ke.Left]:{x:-1,y:0},[ke.Right]:{x:1,y:0},[ke.Top]:{x:0,y:-1},[ke.Bottom]:{x:0,y:1}},CC=({source:e,sourcePosition:t=ke.Bottom,target:n})=>t===ke.Left||t===ke.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},Oy=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function TC({source:e,sourcePosition:t=ke.Bottom,target:n,targetPosition:i=ke.Top,center:o,offset:a,stepPosition:l}){const c=Iy[t],f=Iy[i],h={x:e.x+c.x*a,y:e.y+c.y*a},m={x:n.x+f.x*a,y:n.y+f.y*a},d=CC({source:h,sourcePosition:t,target:m}),g=d.x!==0?"x":"y",v=d[g];let x=[],w,b;const S={x:0,y:0},_={x:0,y:0},[,,E,T]=qw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(w=o.x??h.x+(m.x-h.x)*l,b=o.y??(h.y+m.y)/2):(w=o.x??(h.x+m.x)/2,b=o.y??h.y+(m.y-h.y)*l);const C=[{x:w,y:h.y},{x:w,y:m.y}],P=[{x:h.x,y:b},{x:m.x,y:b}];c[g]===v?x=g==="x"?C:P:x=g==="x"?P:C}else{const C=[{x:h.x,y:m.y}],P=[{x:m.x,y:h.y}];if(g==="x"?x=c.x===v?P:C:x=c.y===v?C:P,t===i){const z=Math.abs(e[g]-n[g]);if(z<=a){const G=Math.min(a-1,a-z);c[g]===v?S[g]=(h[g]>e[g]?-1:1)*G:_[g]=(m[g]>n[g]?-1:1)*G}}if(t!==i){const z=g==="x"?"y":"x",G=c[g]===f[z],Y=h[z]>m[z],Z=h[z]<m[z];(c[g]===1&&(!G&&Y||G&&Z)||c[g]!==1&&(!G&&Z||G&&Y))&&(x=g==="x"?C:P)}const j={x:h.x+S.x,y:h.y+S.y},L={x:m.x+_.x,y:m.y+_.y},D=Math.max(Math.abs(j.x-x[0].x),Math.abs(L.x-x[0].x)),X=Math.max(Math.abs(j.y-x[0].y),Math.abs(L.y-x[0].y));D>=X?(w=(j.x+L.x)/2,b=x[0].y):(w=x[0].x,b=(j.y+L.y)/2)}const A={x:h.x+S.x,y:h.y+S.y},R={x:m.x+_.x,y:m.y+_.y};return[[e,...A.x!==x[0].x||A.y!==x[0].y?[A]:[],...x,...R.x!==x[x.length-1].x||R.y!==x[x.length-1].y?[R]:[],n],w,b,E,T]}function IC(e,t,n,i){const o=Math.min(Oy(e,t)/2,Oy(t,n)/2,i),{x:a,y:l}=t;if(e.x===a&&a===n.x||e.y===l&&l===n.y)return`L${a} ${l}`;if(e.y===l){const h=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${a+o*h},${l}Q ${a},${l} ${a},${l+o*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${a},${l+o*f}Q ${a},${l} ${a+o*c},${l}`}function vh({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top,borderRadius:l=5,centerX:c,centerY:f,offset:h=20,stepPosition:m=.5}){const[d,g,v,x,w]=TC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:o},targetPosition:a,center:{x:c,y:f},offset:h,stepPosition:m});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=IC(d[S-1],d[S],d[S+1],l);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,g,v,x,w]}function Py(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function OC(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Py(t)||!Py(n))return null;const i=t.internals.handleBounds||Ay(t.handles),o=n.internals.handleBounds||Ay(n.handles),a=My((i==null?void 0:i.source)??[],e.sourceHandle),l=My(e.connectionMode===as.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!l)return(d=e.onError)==null||d.call(e,"008",gn.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(a==null?void 0:a.position)||ke.Bottom,f=(l==null?void 0:l.position)||ke.Top,h=fi(t,a,c),m=fi(n,l,f);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function Ay(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function fi(e,t,n=ke.Left,i=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??tr(e);if(i)return{x:o+l/2,y:a+c/2};switch((t==null?void 0:t.position)??n){case ke.Top:return{x:o+l/2,y:a};case ke.Right:return{x:o+l,y:a+c/2};case ke.Bottom:return{x:o+l/2,y:a+c};case ke.Left:return{x:o,y:a+c/2}}}function My(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function wh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function PC(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:o}){const a=new Set;return e.reduce((l,c)=>([c.markerStart||i,c.markerEnd||o].forEach(f=>{if(f&&typeof f=="object"){const h=wh(f,t);a.has(h)||(l.push({id:h,color:f.color||n,...f}),a.add(h))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Kw=1e3,AC=10,Kh={nodeOrigin:[0,0],nodeExtent:Mo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},MC={...Kh,checkEquality:!0};function Gh(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function RC(e,t,n){const i=Gh(Kh,n);for(const o of e.values())if(o.parentId)Qh(o,e,t,i);else{const a=Wo(o,i.nodeOrigin),l=ci(o.extent)?o.extent:i.nodeExtent,c=ui(a,l,tr(o));o.internals.positionAbsolute=c}}function LC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const o of e.handles){const a={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(a):o.type==="target"&&i.push(a)}return{source:n,target:i}}function Xh(e){return e==="manual"}function xh(e,t,n,i={}){var m,d;const o=Gh(MC,i),a={i:0},l=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!Xh(o.zIndexMode)?Kw:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const g of e){let v=l.get(g.id);if(o.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const x=Wo(g,o.nodeOrigin),w=ci(g.extent)?g.extent:o.nodeExtent,b=ui(x,w,tr(g));v={...o.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(d=g.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:LC(g,v),z:Gw(g,c,o.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(f=!1),g.parentId&&Qh(v,t,n,i,a),h||(h=g.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function jC(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 Qh(e,t,n,i,o){const{elevateNodesOnSelect:a,nodeOrigin:l,nodeExtent:c,zIndexMode:f}=Gh(Kh,i),h=e.parentId,m=t.get(h);if(!m){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jC(e,n),o&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++o.i,m.internals.z=m.internals.z+o.i*AC),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const d=a&&!Xh(f)?Kw:0,{x:g,y:v,z:x}=DC(e,m,l,c,d,f),{positionAbsolute:w}=e.internals,b=g!==w.x||v!==w.y;(b||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y:v}:w,z:x}})}function Gw(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return Xh(n)?i:i+(e.selected?t:0)}function DC(e,t,n,i,o,a){const{x:l,y:c}=t.internals.positionAbsolute,f=tr(e),h=Wo(e,n),m=ci(e.extent)?ui(h,e.extent,f):h;let d=ui({x:l+m.x,y:c+m.y},i,f);e.extent==="parent"&&(d=jw(d,f,t));const g=Gw(e,o,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=g?v+1:g}}function Jh(e,t,n,i=[0,0]){var l;const o=[],a=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const h=((l=a.get(c.parentId))==null?void 0:l.expandedRect)??us(f),m=Dw(h,c.rect);a.set(c.parentId,{expandedRect:m,parent:f})}return a.size>0&&a.forEach(({expandedRect:c,parent:f},h)=>{var E;const m=f.internals.positionAbsolute,d=tr(f),g=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,x=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(d.width,Math.round(c.width)),b=Math.max(d.height,Math.round(c.height)),S=(w-d.width)*g[0],_=(b-d.height)*g[1];(v>0||x>0||S||_)&&(o.push({id:h,type:"position",position:{x:f.position.x-v+S,y:f.position.y-x+_}}),(E=n.get(h))==null||E.forEach(T=>{e.some(A=>A.id===T.id)||o.push({id:T.id,type:"position",position:{x:T.position.x+v,y:T.position.y+x}})})),(d.width<c.width||d.height<c.height||v||x)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-S:0),height:b+(x?g[1]*x-_:0)}})}),o}function $C(e,t,n,i,o,a,l){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const h=[],m=window.getComputedStyle(c),{m22:d}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const x=t.get(v.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),f=!0;continue}const w=Yh(v.nodeElement),b=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(b||!x.internals.handleBounds||v.force))){const _=v.nodeElement.getBoundingClientRect(),E=ci(x.extent)?x.extent:a;let{positionAbsolute:T}=x.internals;x.parentId&&x.extent==="parent"?T=jw(T,w,t.get(x.parentId)):E&&(T=ui(T,E,w));const A={...x,measured:w,internals:{...x.internals,positionAbsolute:T,handleBounds:{source:Cy("source",v.nodeElement,_,d,x.id),target:Cy("target",v.nodeElement,_,d,x.id)}}};t.set(x.id,A),x.parentId&&Qh(A,t,n,{nodeOrigin:o,zIndexMode:l}),f=!0,b&&(h.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&g.push({id:x.id,parentId:x.parentId,rect:us(A,o)}))}}if(g.length>0){const v=Jh(g,t,n,o);h.push(...v)}return{changes:h,updatedInternals:f}}async function zC({delta:e,panZoom:t,transform:n,translateExtent:i,width:o,height:a}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,a]],i);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function Ry(e,t,n,i,o,a){let l=o;const c=i.get(l)||new Map;i.set(l,c.set(n,t)),l=`${o}-${e}`;const f=i.get(l)||new Map;if(i.set(l,f.set(n,t)),a){l=`${o}-${e}-${a}`;const h=i.get(l)||new Map;i.set(l,h.set(n,t))}}function Xw(e,t,n){e.clear(),t.clear();for(const i of n){const{source:o,target:a,sourceHandle:l=null,targetHandle:c=null}=i,f={edgeId:i.id,source:o,target:a,sourceHandle:l,targetHandle:c},h=`${o}-${l}--${a}-${c}`,m=`${a}-${c}--${o}-${l}`;Ry("source",f,m,e,o,l),Ry("target",f,h,e,a,c),t.set(i.id,i)}}function Qw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Qw(n,t):!1}function Ly(e,t,n){var o;let i=e;do{if((o=i==null?void 0:i.matches)!=null&&o.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function FC(e,t,n,i){const o=new Map;for(const[a,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!Qw(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(a);c&&o.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Wf({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var l,c,f;const o=[];for(const[h,m]of t){const d=(l=n.get(h))==null?void 0:l.internals.userNode;d&&o.push({...d,position:m.position,dragging:i})}if(!e)return[o[0],o];const a=(c=n.get(e))==null?void 0:c.internals.userNode;return[a?{...a,position:((f=t.get(e))==null?void 0:f.position)||a.position,dragging:i}:o[0],o]}function BC({dragItems:e,snapGrid:t,x:n,y:i}){const o=e.values().next().value;if(!o)return null;const a={x:n-o.distance.x,y:i-o.distance.y},l=Ho(a,t);return{x:l.x-a.x,y:l.y-a.y}}function VC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:o}){let a={x:null,y:null},l=0,c=new Map,f=!1,h={x:0,y:0},m=null,d=!1,g=null,v=!1,x=!1,w=null;function b({noDragClassName:_,handleSelector:E,domNode:T,isSelectable:A,nodeId:R,nodeClickDistance:M=0}){g=Vt(T);function C({x:D,y:X}){const{nodeLookup:z,nodeExtent:G,snapGrid:Y,snapToGrid:Z,nodeOrigin:H,onNodeDrag:B,onSelectionDrag:V,onError:$,updateNodePositions:U}=t();a={x:D,y:X};let W=!1;const K=c.size>1,J=K&&G?yh(Uo(c)):null,re=K&&Z?BC({dragItems:c,snapGrid:Y,x:D,y:X}):null;for(const[oe,ee]of c){if(!z.has(oe))continue;let se={x:D-ee.distance.x,y:X-ee.distance.y};Z&&(se=re?{x:Math.round(se.x+re.x),y:Math.round(se.y+re.y)}:Ho(se,Y));let de=null;if(K&&G&&!ee.extent&&J){const{positionAbsolute:fe}=ee.internals,Se=fe.x-J.x+G[0][0],Pe=fe.x+ee.measured.width-J.x2+G[1][0],Ae=fe.y-J.y+G[0][1],Fe=fe.y+ee.measured.height-J.y2+G[1][1];de=[[Se,Ae],[Pe,Fe]]}const{position:xe,positionAbsolute:he}=Lw({nodeId:oe,nextPosition:se,nodeLookup:z,nodeExtent:de||G,nodeOrigin:H,onError:$});W=W||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=he}if(x=x||W,!!W&&(U(c,!0),w&&(i||B||!R&&V))){const[oe,ee]=Wf({nodeId:R,dragItems:c,nodeLookup:z});i==null||i(w,c,oe,ee),B==null||B(w,oe,ee),R||V==null||V(w,ee)}}async function P(){if(!m)return;const{transform:D,panBy:X,autoPanSpeed:z,autoPanOnNodeDrag:G}=t();if(!G){f=!1,cancelAnimationFrame(l);return}const[Y,Z]=Hh(h,m,z);(Y!==0||Z!==0)&&(a.x=(a.x??0)-Y/D[2],a.y=(a.y??0)-Z/D[2],await X({x:Y,y:Z})&&C(a)),l=requestAnimationFrame(P)}function j(D){var K;const{nodeLookup:X,multiSelectionActive:z,nodesDraggable:G,transform:Y,snapGrid:Z,snapToGrid:H,selectNodesOnDrag:B,onNodeDragStart:V,onSelectionDragStart:$,unselectNodesAndEdges:U}=t();d=!0,(!B||!A)&&!z&&R&&((K=X.get(R))!=null&&K.selected||U()),A&&B&&R&&(e==null||e(R));const W=_o(D.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:H,containerBounds:m});if(a=W,c=FC(X,G,W,R),c.size>0&&(n||V||!R&&$)){const[J,re]=Wf({nodeId:R,dragItems:c,nodeLookup:X});n==null||n(D.sourceEvent,c,J,re),V==null||V(D.sourceEvent,J,re),R||$==null||$(D.sourceEvent,re)}}const L=pw().clickDistance(M).on("start",D=>{const{domNode:X,nodeDragThreshold:z,transform:G,snapGrid:Y,snapToGrid:Z}=t();m=(X==null?void 0:X.getBoundingClientRect())||null,v=!1,x=!1,w=D.sourceEvent,z===0&&j(D),a=_o(D.sourceEvent,{transform:G,snapGrid:Y,snapToGrid:Z,containerBounds:m}),h=mn(D.sourceEvent,m)}).on("drag",D=>{const{autoPanOnNodeDrag:X,transform:z,snapGrid:G,snapToGrid:Y,nodeDragThreshold:Z,nodeLookup:H}=t(),B=_o(D.sourceEvent,{transform:z,snapGrid:G,snapToGrid:Y,containerBounds:m});if(w=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||R&&!H.has(R))&&(v=!0),!v){if(!f&&X&&d&&(f=!0,P()),!d){const V=mn(D.sourceEvent,m),$=V.x-h.x,U=V.y-h.y;Math.sqrt($*$+U*U)>Z&&j(D)}(a.x!==B.xSnapped||a.y!==B.ySnapped)&&c&&d&&(h=mn(D.sourceEvent,m),C(B))}}).on("end",D=>{if(!d||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(f=!1,d=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:X,updateNodePositions:z,onNodeDragStop:G,onSelectionDragStop:Y}=t();if(x&&(z(c,!1),x=!1),o||G||!R&&Y){const[Z,H]=Wf({nodeId:R,dragItems:c,nodeLookup:X,dragging:!1});o==null||o(D.sourceEvent,c,Z,H),G==null||G(D.sourceEvent,Z,H),R||Y==null||Y(D.sourceEvent,H)}}}).filter(D=>{const X=D.target;return!D.button&&(!_||!Ly(X,`.${_}`,T))&&(!E||Ly(X,E,T))});g.call(L)}function S(){g==null||g.on(".drag",null)}return{update:b,destroy:S}}function WC(e,t,n){const i=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())Lo(o,us(a))>0&&i.push(a);return i}const UC=250;function HC(e,t,n,i){var c,f;let o=[],a=1/0;const l=WC(e,n,t+UC);for(const h of l){const m=[...((c=h.internals.handleBounds)==null?void 0:c.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const d of m){if(i.nodeId===d.nodeId&&i.type===d.type&&i.id===d.id)continue;const{x:g,y:v}=fi(h,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));x>t||(x<a?(o=[{...d,x:g,y:v}],a=x):x===a&&o.push({...d,x:g,y:v}))}}if(!o.length)return null;if(o.length>1){const h=i.type==="source"?"target":"source";return o.find(m=>m.type===h)??o[0]}return o[0]}function Jw(e,t,n,i,o,a=!1){var h,m,d;const l=i.get(e);if(!l)return null;const c=o==="strict"?(h=l.internals.handleBounds)==null?void 0:h[t]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((d=l.internals.handleBounds)==null?void 0:d.target)??[]],f=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return f&&a?{...f,...fi(l,f,f.position,!0)}:f}function Zw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function qC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ex=()=>!0;function YC(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:o,edgeUpdaterType:a,isTarget:l,domNode:c,nodeLookup:f,lib:h,autoPanOnConnect:m,flowId:d,panBy:g,cancelConnection:v,onConnectStart:x,onConnect:w,onConnectEnd:b,isValidConnection:S=ex,onReconnectEnd:_,updateConnection:E,getTransform:T,getFromHandle:A,autoPanSpeed:R,dragThreshold:M=1,handleDomNode:C}){const P=Bw(e.target);let j=0,L;const{x:D,y:X}=mn(e),z=Zw(a,C),G=c==null?void 0:c.getBoundingClientRect();let Y=!1;if(!G||!z)return;const Z=Jw(o,z,i,f,t);if(!Z)return;let H=mn(e,G),B=!1,V=null,$=!1,U=null;function W(){if(!m||!G)return;const[xe,he]=Hh(H,G,R);g({x:xe,y:he}),j=requestAnimationFrame(W)}const K={...Z,nodeId:o,type:z,position:Z.position},J=f.get(o);let oe={inProgress:!0,isValid:null,from:fi(J,K,ke.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:H,toHandle:null,toPosition:Sy[K.position],toNode:null,pointer:H};function ee(){Y=!0,E(oe),x==null||x(e,{nodeId:o,handleId:i,handleType:z})}M===0&&ee();function se(xe){if(!Y){const{x:Fe,y:wt}=mn(xe),Nt=Fe-D,ht=wt-X;if(!(Nt*Nt+ht*ht>M*M))return;ee()}if(!A()||!K){de(xe);return}const he=T();H=mn(xe,G),L=HC(ys(H,he,!1,[1,1]),n,f,K),B||(W(),B=!0);const fe=tx(xe,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:i,fromType:l?"target":"source",isValidConnection:S,doc:P,lib:h,flowId:d,nodeLookup:f});U=fe.handleDomNode,V=fe.connection,$=qC(!!L,fe.isValid);const Se=f.get(o),Pe=Se?fi(Se,K,ke.Left,!0):oe.from,Ae={...oe,from:Pe,isValid:$,to:fe.toHandle&&$?cs({x:fe.toHandle.x,y:fe.toHandle.y},he):H,toHandle:fe.toHandle,toPosition:$&&fe.toHandle?fe.toHandle.position:Sy[K.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:H};E(Ae),oe=Ae}function de(xe){if(!("touches"in xe&&xe.touches.length>0)){if(Y){(L||U)&&V&&$&&(w==null||w(V));const{inProgress:he,...fe}=oe,Se={...fe,toPosition:oe.toHandle?oe.toPosition:null};b==null||b(xe,Se),a&&(_==null||_(xe,Se))}v(),cancelAnimationFrame(j),B=!1,$=!1,V=null,U=null,P.removeEventListener("mousemove",se),P.removeEventListener("mouseup",de),P.removeEventListener("touchmove",se),P.removeEventListener("touchend",de)}}P.addEventListener("mousemove",se),P.addEventListener("mouseup",de),P.addEventListener("touchmove",se),P.addEventListener("touchend",de)}function tx(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:o,fromType:a,doc:l,lib:c,flowId:f,isValidConnection:h=ex,nodeLookup:m}){const d=a==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:x}=mn(e),w=l.elementFromPoint(v,x),b=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const _=Zw(void 0,b),E=b.getAttribute("data-nodeid"),T=b.getAttribute("data-handleid"),A=b.classList.contains("connectable"),R=b.classList.contains("connectableend");if(!E||!_)return S;const M={source:d?E:i,sourceHandle:d?T:o,target:d?i:E,targetHandle:d?o:T};S.connection=M;const P=A&&R&&(n===as.Strict?d&&_==="source"||!d&&_==="target":E!==i||T!==o);S.isValid=P&&h(M),S.toHandle=Jw(E,_,T,m,n,!0)}return S}const bh={onPointerDown:YC,isValid:tx};function KC({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const o=Vt(e);function a({translateExtent:c,width:f,height:h,zoomStep:m=1,pannable:d=!0,zoomable:g=!0,inversePan:v=!1}){const x=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const T=n(),A=E.sourceEvent.ctrlKey&&jo()?10:1,R=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,M=T[2]*Math.pow(2,R*A);t.scaleTo(M)};let w=[0,0];const b=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},S=E=>{const T=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const A=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],R=[A[0]-w[0],A[1]-w[1]];w=A;const M=i()*Math.max(T[2],Math.log(T[2]))*(v?-1:1),C={x:T[0]-R[0]*M,y:T[1]-R[1]*M},P=[[0,0],[f,h]];t.setViewportConstrained({x:C.x,y:C.y,zoom:T[2]},P,c)},_=Iw().on("start",b).on("zoom",d?S:null).on("zoom.wheel",g?x:null);o.call(_,{})}function l(){o.on("zoom",null)}return{update:a,destroy:l,pointer:dn}}const ku=e=>({x:e.x,y:e.y,zoom:e.k}),Uf=({x:e,y:t,zoom:n})=>wu.translate(e,t).scale(n),Gi=(e,t)=>e.target.closest(`.${t}`),nx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),GC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Hf=(e,t=0,n=GC,i=()=>{})=>{const o=typeof t=="number"&&t>0;return o||i(),o?e.transition().duration(t).ease(n).on("end",i):e},rx=e=>{const t=e.ctrlKey&&jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function XC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:h}){return m=>{if(Gi(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(m.ctrlKey&&l){const b=dn(m),S=rx(m),_=d*Math.pow(2,S);i.scaleTo(n,_,b,m);return}const g=m.deltaMode===1?20:1;let v=o===oi.Vertical?0:m.deltaX*g,x=o===oi.Horizontal?0:m.deltaY*g;!jo()&&m.shiftKey&&o!==oi.Vertical&&(v=m.deltaY*g,x=0),i.translateBy(n,-(v/d)*a,-(x/d)*a,{internal:!0});const w=ku(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{h==null||h(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function QC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,o){const a=i.type==="wheel",l=!t&&a&&!i.ctrlKey,c=Gi(i,e);if(i.ctrlKey&&a&&c&&i.preventDefault(),l||c)return null;i.preventDefault(),n.call(this,i,o)}}function JC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var a,l,c;if((a=i.sourceEvent)!=null&&a.internal)return;const o=ku(i.transform);e.mouseButton=((l=i.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,o))}}function ZC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:o}){return a=>{var l,c;e.usedRightMouseButton=!!(n&&nx(t,e.mouseButton??0)),(l=a.sourceEvent)!=null&&l.sync||i([a.transform.x,a.transform.y,a.transform.k]),o&&!((c=a.sourceEvent)!=null&&c.internal)&&(o==null||o(a.sourceEvent,ku(a.transform)))}}function e2({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:o,onPaneContextMenu:a}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,a&&nx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&a(l.sourceEvent),e.usedRightMouseButton=!1,i(!1),o)){const f=ku(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,f)},n?150:0)}}}function t2({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:f,lib:h,connectionInProgress:m}){return d=>{var b;const g=e||t,v=n&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Gi(d,`${h}-flow__node`)||Gi(d,`${h}-flow__edge`)))return!0;if(!i&&!g&&!o&&!a&&!n||l||m&&!x||Gi(d,c)&&x||Gi(d,f)&&(!x||o&&x&&!e)||!n&&d.ctrlKey&&x)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!g&&!o&&!v&&x||!i&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(i)&&!i.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&w}}function n2({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:o,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),d=Iw().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(d);_({x:o.x,y:o.y,zoom:ls(o.zoom,t,n)},[[0,0],[m.width,m.height]],i);const v=g.on("wheel.zoom"),x=g.on("dblclick.zoom");d.wheelDelta(rx);async function w(L,D){return g?new Promise(X=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).transform(Hf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),L)}):!1}function b({noWheelClassName:L,noPanClassName:D,onPaneContextMenu:X,userSelectionActive:z,panOnScroll:G,panOnDrag:Y,panOnScrollMode:Z,panOnScrollSpeed:H,preventScrolling:B,zoomOnPinch:V,zoomOnScroll:$,zoomOnDoubleClick:U,zoomActivationKeyPressed:W,lib:K,onTransformChange:J,connectionInProgress:re,paneClickDistance:oe,selectionOnDrag:ee}){z&&!h.isZoomingOrPanning&&S();const se=G&&!W&&!z;d.clickDistance(ee?1/0:!pn(oe)||oe<0?0:oe);const de=se?XC({zoomPanValues:h,noWheelClassName:L,d3Selection:g,d3Zoom:d,panOnScrollMode:Z,panOnScrollSpeed:H,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}):QC({noWheelClassName:L,preventScrolling:B,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=JC({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:l});d.on("start",xe);const he=ZC({zoomPanValues:h,panOnDrag:Y,onPaneContextMenu:!!X,onPanZoom:a,onTransformChange:J});d.on("zoom",he);const fe=e2({zoomPanValues:h,panOnDrag:Y,panOnScroll:G,onPaneContextMenu:X,onPanZoomEnd:c,onDraggingChange:f});d.on("end",fe);const Se=t2({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:$,panOnScroll:G,zoomOnDoubleClick:U,zoomOnPinch:V,userSelectionActive:z,noPanClassName:D,noWheelClassName:L,lib:K,connectionInProgress:re});d.filter(Se),U?g.on("dblclick.zoom",x):g.on("dblclick.zoom",null)}function S(){d.on("zoom",null)}async function _(L,D,X){const z=Uf(L),G=d==null?void 0:d.constrain()(z,D,X);return G&&await w(G),G}async function E(L,D){const X=Uf(L);return await w(X,D),X}function T(L){if(g){const D=Uf(L),X=g.property("__zoom");(X.k!==L.zoom||X.x!==L.x||X.y!==L.y)&&(d==null||d.transform(g,D,null,{sync:!0}))}}function A(){const L=g?Tw(g.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function R(L,D){return g?new Promise(X=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).scaleTo(Hf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),L)}):!1}async function M(L,D){return g?new Promise(X=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).scaleBy(Hf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),L)}):!1}function C(L){d==null||d.scaleExtent(L)}function P(L){d==null||d.translateExtent(L)}function j(L){const D=!pn(L)||L<0?0:L;d==null||d.clickDistance(D)}return{update:b,destroy:S,setViewport:E,setViewportConstrained:_,getViewport:A,scaleTo:R,scaleBy:M,setScaleExtent:C,setTranslateExtent:P,syncViewport:T,setClickDistance:j}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function r2({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:o,affectsY:a}){const l=e-t,c=n-i,f=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(f[0]=f[0]*-1),c&&a&&(f[1]=f[1]*-1),f}function jy(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:o}}function Sr(e,t){return Math.max(0,t-e)}function Er(e,t){return Math.max(0,e-t)}function bl(e,t,n){return Math.max(0,t-e,e-n)}function Dy(e,t){return e?!t:t}function i2(e,t,n,i,o,a,l,c){let{affectsX:f,affectsY:h}=t;const{isHorizontal:m,isVertical:d}=t,g=m&&d,{xSnapped:v,ySnapped:x}=n,{minWidth:w,maxWidth:b,minHeight:S,maxHeight:_}=i,{x:E,y:T,width:A,height:R,aspectRatio:M}=e;let C=Math.floor(m?v-e.pointerX:0),P=Math.floor(d?x-e.pointerY:0);const j=A+(f?-C:C),L=R+(h?-P:P),D=-a[0]*A,X=-a[1]*R;let z=bl(j,w,b),G=bl(L,S,_);if(l){let H=0,B=0;f&&C<0?H=Sr(E+C+D,l[0][0]):!f&&C>0&&(H=Er(E+j+D,l[1][0])),h&&P<0?B=Sr(T+P+X,l[0][1]):!h&&P>0&&(B=Er(T+L+X,l[1][1])),z=Math.max(z,H),G=Math.max(G,B)}if(c){let H=0,B=0;f&&C>0?H=Er(E+C,c[0][0]):!f&&C<0&&(H=Sr(E+j,c[1][0])),h&&P>0?B=Er(T+P,c[0][1]):!h&&P<0&&(B=Sr(T+L,c[1][1])),z=Math.max(z,H),G=Math.max(G,B)}if(o){if(m){const H=bl(j/M,S,_)*M;if(z=Math.max(z,H),l){let B=0;!f&&!h||f&&!h&&g?B=Er(T+X+j/M,l[1][1])*M:B=Sr(T+X+(f?C:-C)/M,l[0][1])*M,z=Math.max(z,B)}if(c){let B=0;!f&&!h||f&&!h&&g?B=Sr(T+j/M,c[1][1])*M:B=Er(T+(f?C:-C)/M,c[0][1])*M,z=Math.max(z,B)}}if(d){const H=bl(L*M,w,b)/M;if(G=Math.max(G,H),l){let B=0;!f&&!h||h&&!f&&g?B=Er(E+L*M+D,l[1][0])/M:B=Sr(E+(h?P:-P)*M+D,l[0][0])/M,G=Math.max(G,B)}if(c){let B=0;!f&&!h||h&&!f&&g?B=Sr(E+L*M,c[1][0])/M:B=Er(E+(h?P:-P)*M,c[0][0])/M,G=Math.max(G,B)}}}P=P+(P<0?G:-G),C=C+(C<0?z:-z),o&&(g?j>L*M?P=(Dy(f,h)?-C:C)/M:C=(Dy(f,h)?-P:P)*M:m?(P=C/M,h=f):(C=P*M,f=h));const Y=f?E+C:E,Z=h?T+P:T;return{width:A+(f?-C:C),height:R+(h?-P:P),x:a[0]*C*(f?-1:1)+Y,y:a[1]*P*(h?-1:1)+Z}}const ix={width:0,height:0,x:0,y:0},s2={...ix,pointerX:0,pointerY:0,aspectRatio:1};function o2(e,t,n){const i=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,l=e.measured.height??0,c=n[0]*a,f=n[1]*l;return[[i-c,o-f],[i+a-c,o+l-f]]}function a2({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:o}){const a=Vt(e);let l={controlDirection:jy("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:h,boundaries:m,keepAspectRatio:d,resizeDirection:g,onResizeStart:v,onResize:x,onResizeEnd:w,shouldResize:b}){let S={...ix},_={...s2};l={boundaries:m,resizeDirection:g,keepAspectRatio:d,controlDirection:jy(h)};let E,T=null,A=[],R,M,C,P=!1;const j=pw().on("start",L=>{const{nodeLookup:D,transform:X,snapGrid:z,snapToGrid:G,nodeOrigin:Y,paneDomNode:Z}=n();if(E=D.get(t),!E)return;T=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:B}=_o(L.sourceEvent,{transform:X,snapGrid:z,snapToGrid:G,containerBounds:T});S={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},_={...S,pointerX:H,pointerY:B,aspectRatio:S.width/S.height},R=void 0,M=ci(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(R=D.get(E.parentId)),R&&E.extent==="parent"&&(M=[[0,0],[R.measured.width,R.measured.height]]),A=[],C=void 0;for(const[V,$]of D)if($.parentId===t&&(A.push({id:V,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const U=o2($,E,$.origin??Y);C?C=[[Math.min(U[0][0],C[0][0]),Math.min(U[0][1],C[0][1])],[Math.max(U[1][0],C[1][0]),Math.max(U[1][1],C[1][1])]]:C=U}v==null||v(L,{...S})}).on("drag",L=>{const{transform:D,snapGrid:X,snapToGrid:z,nodeOrigin:G}=n(),Y=_o(L.sourceEvent,{transform:D,snapGrid:X,snapToGrid:z,containerBounds:T}),Z=[];if(!E)return;const{x:H,y:B,width:V,height:$}=S,U={},W=E.origin??G,{width:K,height:J,x:re,y:oe}=i2(_,l.controlDirection,Y,l.boundaries,l.keepAspectRatio,W,M,C),ee=K!==V,se=J!==$,de=re!==H&&ee,xe=oe!==B&&se;if(!de&&!xe&&!ee&&!se)return;if((de||xe||W[0]===1||W[1]===1)&&(U.x=de?re:S.x,U.y=xe?oe:S.y,S.x=U.x,S.y=U.y,A.length>0)){const Pe=re-H,Ae=oe-B;for(const Fe of A)Fe.position={x:Fe.position.x-Pe+W[0]*(K-V),y:Fe.position.y-Ae+W[1]*(J-$)},Z.push(Fe)}if((ee||se)&&(U.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?K:S.width,U.height=se&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:S.height,S.width=U.width,S.height=U.height),R&&E.expandParent){const Pe=W[0]*(U.width??0);U.x&&U.x<Pe&&(S.x=Pe,_.x=_.x-(U.x-Pe));const Ae=W[1]*(U.height??0);U.y&&U.y<Ae&&(S.y=Ae,_.y=_.y-(U.y-Ae))}const he=r2({width:S.width,prevWidth:V,height:S.height,prevHeight:$,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),fe={...S,direction:he};(b==null?void 0:b(L,fe))!==!1&&(P=!0,x==null||x(L,fe),i(U,Z))}).on("end",L=>{P&&(w==null||w(L,{...S}),o==null||o({...S}),P=!1)});a.call(j)}function f(){a.on(".drag",null)}return{update:c,destroy:f}}var qf={exports:{}},Yf={},Kf={exports:{}},Gf={};/**
41
- * @license React
42
- * use-sync-external-store-shim.production.js
43
- *
44
- * Copyright (c) Meta Platforms, Inc. and affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */var $y;function l2(){if($y)return Gf;$y=1;var e=Fo();function t(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(d,g){var v=g(),x=i({inst:{value:v,getSnapshot:g}}),w=x[0].inst,b=x[1];return a(function(){w.value=v,w.getSnapshot=g,f(w)&&b({inst:w})},[d,v,g]),o(function(){return f(w)&&b({inst:w}),d(function(){f(w)&&b({inst:w})})},[d]),l(v),v}function f(d){var g=d.getSnapshot;d=d.value;try{var v=g();return!n(d,v)}catch{return!0}}function h(d,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Gf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Gf}var zy;function u2(){return zy||(zy=1,Kf.exports=l2()),Kf.exports}/**
49
- * @license React
50
- * use-sync-external-store-shim/with-selector.production.js
51
- *
52
- * Copyright (c) Meta Platforms, Inc. and affiliates.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE file in the root directory of this source tree.
56
- */var Fy;function c2(){if(Fy)return Yf;Fy=1;var e=Fo(),t=u2();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var i=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Yf.useSyncExternalStoreWithSelector=function(h,m,d,g,v){var x=a(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function S(R){if(!_){if(_=!0,E=R,R=g(R),v!==void 0&&w.hasValue){var M=w.value;if(v(M,R))return T=M}return T=R}if(M=T,i(E,R))return M;var C=g(R);return v!==void 0&&v(M,C)?(E=R,M):(E=R,T=C)}var _=!1,E,T,A=d===void 0?null:d;return[function(){return S(m())},A===null?void 0:function(){return S(A())}]},[m,d,g,v]);var b=o(h,x[0],x[1]);return l(function(){w.hasValue=!0,w.value=b},[b]),f(b),b},Yf}var By;function f2(){return By||(By=1,qf.exports=c2()),qf.exports}var d2=f2();const h2=pu(d2),p2={},Vy=e=>{let t;const n=new Set,i=(m,d)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=d??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(x=>x(t,v))}},o=()=>t,f={setState:i,getState:o,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(p2?"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()}},h=t=e(i,o,f);return f},m2=e=>e?Vy(e):Vy,{useDebugValue:g2}=Rh,{useSyncExternalStoreWithSelector:y2}=h2,v2=e=>e;function sx(e,t=v2,n){const i=y2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return g2(i),i}const Wy=(e,t)=>{const n=m2(e),i=(o,a=t)=>sx(n,o,a);return Object.assign(i,n),i},w2=(e,t)=>e?Wy(e,t):Wy;function He(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,o]of e)if(!Object.is(o,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}var ox=Zv();const Su=O.createContext(null),x2=Su.Provider,ax=gn.error001("react");function Me(e,t){const n=O.useContext(Su);if(n===null)throw new Error(ax);return sx(n,e,t)}function qe(){const e=O.useContext(Su);if(e===null)throw new Error(ax);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Uy={display:"none"},b2={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},lx="react-flow__node-desc",ux="react-flow__edge-desc",k2="react-flow__aria-live",S2=e=>e.ariaLiveMessage,E2=e=>e.ariaLabelConfig;function N2({rfId:e}){const t=Me(S2);return N.jsx("div",{id:`${k2}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:b2,children:t})}function _2({rfId:e,disableKeyboardA11y:t}){const n=Me(E2);return N.jsxs(N.Fragment,{children:[N.jsx("div",{id:`${lx}-${e}`,style:Uy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),N.jsx("div",{id:`${ux}-${e}`,style:Uy,children:n["edge.a11yDescription.default"]}),!t&&N.jsx(N2,{rfId:e})]})}const Eu=O.forwardRef(({position:e="top-left",children:t,className:n,style:i,...o},a)=>{const l=`${e}`.split("-");return N.jsx("div",{className:rt(["react-flow__panel",n,...l]),style:i,ref:a,...o,children:t})});Eu.displayName="Panel";function C2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:N.jsx(Eu,{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:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const T2=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},kl=e=>e.id;function I2(e,t){return He(e.selectedNodes.map(kl),t.selectedNodes.map(kl))&&He(e.selectedEdges.map(kl),t.selectedEdges.map(kl))}function O2({onSelectionChange:e}){const t=qe(),{selectedNodes:n,selectedEdges:i}=Me(T2,I2);return O.useEffect(()=>{const o={nodes:n,edges:i};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[n,i,e]),null}const P2=e=>!!e.onSelectionChangeHandlers;function A2({onSelectionChange:e}){const t=Me(P2);return e||t?N.jsx(O2,{onSelectionChange:e}):null}const cx=[0,0],M2={x:0,y:0,zoom:1},R2=["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"],Hy=[...R2,"rfId"],L2=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}),qy={translateExtent:Mo,nodeOrigin:cx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function j2(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=Me(L2,He),h=qe();O.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=qy,c()}),[]);const m=O.useRef(qy);return O.useEffect(()=>{for(const d of Hy){const g=e[d],v=m.current[d];g!==v&&(typeof e[d]>"u"||(d==="nodes"?t(g):d==="edges"?n(g):d==="minZoom"?i(g):d==="maxZoom"?o(g):d==="translateExtent"?a(g):d==="nodeExtent"?l(g):d==="ariaLabelConfig"?h.setState({ariaLabelConfig:xC(g)}):d==="fitView"?h.setState({fitViewQueued:g}):d==="fitViewOptions"?h.setState({fitViewOptions:g}):h.setState({[d]:g})))}m.current=e},Hy.map(d=>e[d])),null}function Yy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function D2(e){var i;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const o=Yy(),a=()=>n(o!=null&&o.matches?"dark":"light");return a(),o==null||o.addEventListener("change",a),()=>{o==null||o.removeEventListener("change",a)}},[e]),t!==null?t:(i=Yy())!=null&&i.matches?"dark":"light"}const Ky=typeof document<"u"?document:null;function Do(e=null,t={target:Ky,actInsideInputWithModifier:!0}){const[n,i]=O.useState(!1),o=O.useRef(!1),a=O.useRef(new Set([])),[l,c]=O.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),m=h.reduce((d,g)=>d.concat(...g),[]);return[h,m]}return[[],[]]},[e]);return O.useEffect(()=>{const f=(t==null?void 0:t.target)??Ky,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var b,S;if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!h)&&Vw(v))return!1;const w=Xy(v.code,c);if(a.current.add(v[w]),Gy(l,a.current,!1)){const _=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,E=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(o.current||!E)&&v.preventDefault(),i(!0)}},d=v=>{const x=Xy(v.code,c);Gy(l,a.current,!0)?(i(!1),a.current.clear()):a.current.delete(v[x]),v.key==="Meta"&&a.current.clear(),o.current=!1},g=()=>{a.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,i]),n}function Gy(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(o=>t.has(o)))}function Xy(e,t){return t.includes(e)?"code":"key"}const $2=()=>{const e=qe();return O.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,o,a],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??i,y:t.y??o,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:o,minZoom:a,maxZoom:l,panZoom:c}=e.getState(),f=qh(t,i,o,a,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:o,snapToGrid:a,domNode:l}=e.getState();if(!l)return t;const{x:c,y:f}=l.getBoundingClientRect(),h={x:t.x-c,y:t.y-f},m=n.snapGrid??o,d=n.snapToGrid??a;return ys(h,i,d,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:o,y:a}=i.getBoundingClientRect(),l=cs(t,n);return{x:l.x+o,y:l.y+a}}}),[])};function fx(e,t){const n=[],i=new Map,o=[];for(const a of e)if(a.type==="add"){o.push(a);continue}else if(a.type==="remove"||a.type==="replace")i.set(a.id,[a]);else{const l=i.get(a.id);l?l.push(a):i.set(a.id,[a])}for(const a of t){const l=i.get(a.id);if(!l){n.push(a);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...a};for(const f of l)z2(f,c);n.push(c)}return o.length&&o.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function z2(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 F2(e,t){return fx(e,t)}function B2(e,t){return fx(e,t)}function ei(e,t){return{id:e,type:"select",selected:t}}function Xi(e,t=new Set,n=!1){const i=[];for(const[o,a]of e){const l=t.has(o);!(a.selected===void 0&&!l)&&a.selected!==l&&(n&&(a.selected=l),i.push(ei(a.id,l)))}return i}function Qy({items:e=[],lookup:t}){var o;const n=[],i=new Map(e.map(a=>[a.id,a]));for(const[a,l]of e.entries()){const c=t.get(l.id),f=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;f!==void 0&&f!==l&&n.push({id:l.id,item:l,type:"replace"}),f===void 0&&n.push({item:l,type:"add",index:a})}for(const[a]of t)i.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function Jy(e){return{id:e.id,type:"remove"}}const V2=$w();function W2(e,t,n={}){return _C(e,t,{...n,onError:n.onError??V2})}const Zy=e=>fC(e),U2=e=>Rw(e);function dx(e){return O.forwardRef(e)}const H2=typeof window<"u"?O.useLayoutEffect:O.useEffect;function e0(e){const[t,n]=O.useState(BigInt(0)),[i]=O.useState(()=>q2(()=>n(o=>o+BigInt(1))));return H2(()=>{const o=i.get();o.length&&(e(o),i.reset())},[t]),i}function q2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const hx=O.createContext(null);function Y2({children:e}){const t=qe(),n=O.useCallback(c=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:m,onNodesChange:d,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:x}=t.getState();let w=f;for(const S of c)w=typeof S=="function"?S(w):S;let b=Qy({items:w,lookup:g});for(const S of x.values())b=S(b);m&&h(w),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:_,setNodes:E}=t.getState();S&&E(_)})},[]),i=e0(n),o=O.useCallback(c=>{const{edges:f=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:d,edgeLookup:g}=t.getState();let v=f;for(const x of c)v=typeof x=="function"?x(v):x;m?h(v):d&&d(Qy({items:v,lookup:g}))},[]),a=e0(o),l=O.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return N.jsx(hx.Provider,{value:l,children:e})}function K2(){const e=O.useContext(hx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const G2=e=>!!e.panZoom;function Zh(){const e=$2(),t=qe(),n=K2(),i=Me(G2),o=O.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),l=d=>{n.nodeQueue.push(d)},c=d=>{n.edgeQueue.push(d)},f=d=>{var S,_;const{nodeLookup:g,nodeOrigin:v}=t.getState(),x=Zy(d)?d:g.get(d.id),w=x.parentId?Fw(x.position,x.measured,x.parentId,g,v):x.position,b={...x,position:w,width:((S=x.measured)==null?void 0:S.width)??x.width,height:((_=x.measured)==null?void 0:_.height)??x.height};return us(b)},h=(d,g,v={replace:!1})=>{l(x=>x.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return v.replace&&Zy(b)?b:{...w,...b}}return w}))},m=(d,g,v={replace:!1})=>{c(x=>x.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return v.replace&&U2(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=a(d))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(g=>({...g}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:l,setEdges:c,addNodes:d=>{const g=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:v}=t.getState(),[x,w,b]=v;return{nodes:d.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x,y:w,zoom:b}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:x,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:_,onDelete:E,onBeforeDelete:T}=t.getState(),{nodes:A,edges:R}=await gC({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:x,onBeforeDelete:T}),M=R.length>0,C=A.length>0;if(M){const P=R.map(Jy);b==null||b(R),_(P)}if(C){const P=A.map(Jy);w==null||w(A),S(P)}return(C||M)&&(E==null||E({nodes:A,edges:R})),{deletedNodes:A,deletedEdges:R}},getIntersectingNodes:(d,g=!0,v)=>{const x=Ny(d),w=x?d:f(d),b=v!==void 0;return w?(v||t.getState().nodes).filter(S=>{const _=t.getState().nodeLookup.get(S.id);if(_&&!x&&(S.id===d.id||!_.internals.positionAbsolute))return!1;const E=us(b?S:_),T=Lo(E,w);return g&&T>0||T>=E.width*E.height||T>=w.width*w.height}):[]},isNodeIntersecting:(d,g,v=!0)=>{const w=Ny(d)?d:f(d);if(!w)return!1;const b=Lo(w,g);return v&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:h,updateNodeData:(d,g,v={replace:!1})=>{h(d,x=>{const w=typeof g=="function"?g(x):g;return v.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},v)},updateEdge:m,updateEdgeData:(d,g,v={replace:!1})=>{m(d,x=>{const w=typeof g=="function"?g(x):g;return v.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},v)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return dC(d,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:d,id:g,nodeId:v})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${v}-${d}${g?`-${g}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:v})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${v}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const g=t.getState().fitViewResolver??wC();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return O.useMemo(()=>({...o,...e,viewportInitialized:i}),[i])}const t0=e=>e.selected,X2=typeof window<"u"?window:void 0;function Q2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qe(),{deleteElements:i}=Zh(),o=Do(e,{actInsideInputWithModifier:!1}),a=Do(t,{target:X2});O.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(t0),edges:l.filter(t0)}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function J2(e){const t=qe();O.useEffect(()=>{const n=()=>{var o,a,l,c;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const i=Yh(e.current);(i.height===0||i.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",gn.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const Nu={position:"absolute",width:"100%",height:"100%",top:0,left:0},Z2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function eT({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=oi.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:v=!0,children:x,noWheelClassName:w,noPanClassName:b,onViewportChange:S,isControlledViewport:_,paneClickDistance:E,selectionOnDrag:T}){const A=qe(),R=O.useRef(null),{userSelectionActive:M,lib:C,connectionInProgress:P}=Me(Z2,He),j=Do(g),L=O.useRef();J2(R);const D=O.useCallback(X=>{S==null||S({x:X[0],y:X[1],zoom:X[2]}),_||A.setState({transform:X})},[S,_]);return O.useEffect(()=>{if(R.current){L.current=n2({domNode:R.current,minZoom:m,maxZoom:d,translateExtent:h,viewport:f,onDraggingChange:Y=>A.setState(Z=>Z.paneDragging===Y?Z:{paneDragging:Y}),onPanZoomStart:(Y,Z)=>{const{onViewportChangeStart:H,onMoveStart:B}=A.getState();B==null||B(Y,Z),H==null||H(Z)},onPanZoom:(Y,Z)=>{const{onViewportChange:H,onMove:B}=A.getState();B==null||B(Y,Z),H==null||H(Z)},onPanZoomEnd:(Y,Z)=>{const{onViewportChangeEnd:H,onMoveEnd:B}=A.getState();B==null||B(Y,Z),H==null||H(Z)}});const{x:X,y:z,zoom:G}=L.current.getViewport();return A.setState({panZoom:L.current,transform:[X,z,G],domNode:R.current.closest(".react-flow")}),()=>{var Y;(Y=L.current)==null||Y.destroy()}}},[]),O.useEffect(()=>{var X;(X=L.current)==null||X.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:j,preventScrolling:v,noPanClassName:b,userSelectionActive:M,noWheelClassName:w,lib:C,onTransformChange:D,connectionInProgress:P,selectionOnDrag:T,paneClickDistance:E})},[e,t,n,i,o,a,l,c,j,v,b,M,w,C,D,P,T,E]),N.jsx("div",{className:"react-flow__renderer",ref:R,style:Nu,children:x})}const tT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function nT(){const{userSelectionActive:e,userSelectionRect:t}=Me(tT,He);return e&&t?N.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 Xf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},rT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function iT({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ro.Full,panOnDrag:i,autoPanOnSelection:o,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:m,onPaneScroll:d,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:x,children:w}){const b=O.useRef(0),S=qe(),{userSelectionActive:_,elementsSelectable:E,dragging:T,connectionInProgress:A,panBy:R,autoPanSpeed:M}=Me(rT,He),C=E&&(e||_),P=O.useRef(null),j=O.useRef(),L=O.useRef(new Set),D=O.useRef(new Set),X=O.useRef(!1),z=O.useRef({x:0,y:0}),G=O.useRef(!1),Y=ee=>{if(X.current||A){X.current=!1;return}h==null||h(ee),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},Z=ee=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){ee.preventDefault();return}m==null||m(ee)},H=d?ee=>d(ee):void 0,B=ee=>{X.current&&(ee.stopPropagation(),X.current=!1)},V=ee=>{var Fe,wt;const{domNode:se,transform:de}=S.getState();if(j.current=se==null?void 0:se.getBoundingClientRect(),!j.current)return;const xe=ee.target===P.current;if(!xe&&!!ee.target.closest(".nokey")||!e||!(l&&xe||t)||ee.button!==0||!ee.isPrimary)return;(wt=(Fe=ee.target)==null?void 0:Fe.setPointerCapture)==null||wt.call(Fe,ee.pointerId),X.current=!1;const{x:Se,y:Pe}=mn(ee.nativeEvent,j.current),Ae=ys({x:Se,y:Pe},de);S.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:Se,y:Pe}}),xe||(ee.stopPropagation(),ee.preventDefault())};function $(ee,se){const{userSelectionRect:de}=S.getState();if(!de)return;const{transform:xe,nodeLookup:he,edgeLookup:fe,connectionLookup:Se,triggerNodeChanges:Pe,triggerEdgeChanges:Ae,defaultEdgeOptions:Fe}=S.getState(),wt={x:de.startX,y:de.startY},{x:Nt,y:ht}=cs(wt,xe),pt={startX:wt.x,startY:wt.y,x:ee<Nt?ee:Nt,y:se<ht?se:ht,width:Math.abs(ee-Nt),height:Math.abs(se-ht)},jn=L.current,bn=D.current;L.current=new Set(Uh(he,pt,xe,n===Ro.Partial,!0).map(_t=>_t.id)),D.current=new Set;const kn=(Fe==null?void 0:Fe.selectable)??!0;for(const _t of L.current){const Ht=Se.get(_t);if(Ht)for(const{edgeId:Lt}of Ht.values()){const qt=fe.get(Lt);qt&&(qt.selectable??kn)&&D.current.add(Lt)}}if(!_y(jn,L.current)){const _t=Xi(he,L.current,!0);Pe(_t)}if(!_y(bn,D.current)){const _t=Xi(fe,D.current);Ae(_t)}S.setState({userSelectionRect:pt,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!o||!j.current)return;const[ee,se]=Hh(z.current,j.current,M);R({x:ee,y:se}).then(de=>{if(!X.current||!de){b.current=requestAnimationFrame(U);return}const{x:xe,y:he}=z.current;$(xe,he),b.current=requestAnimationFrame(U)})}const W=()=>{cancelAnimationFrame(b.current),b.current=0,G.current=!1};O.useEffect(()=>()=>W(),[]);const K=ee=>{const{userSelectionRect:se,transform:de,resetSelectedElements:xe}=S.getState();if(!j.current||!se)return;const{x:he,y:fe}=mn(ee.nativeEvent,j.current);z.current={x:he,y:fe};const Se=cs({x:se.startX,y:se.startY},de);if(!X.current){const Pe=t?0:a;if(Math.hypot(he-Se.x,fe-Se.y)<=Pe)return;xe(),c==null||c(ee)}X.current=!0,G.current||(U(),G.current=!0),$(he,fe)},J=ee=>{var se,de;ee.button===0&&((de=(se=ee.target)==null?void 0:se.releasePointerCapture)==null||de.call(se,ee.pointerId),!_&&ee.target===P.current&&S.getState().userSelectionRect&&(Y==null||Y(ee)),S.setState({userSelectionActive:!1,userSelectionRect:null}),X.current&&(f==null||f(ee),S.setState({nodesSelectionActive:L.current.size>0})),W())},re=ee=>{var se,de;(de=(se=ee.target)==null?void 0:se.releasePointerCapture)==null||de.call(se,ee.pointerId),W()},oe=i===!0||Array.isArray(i)&&i.includes(0);return N.jsxs("div",{className:rt(["react-flow__pane",{draggable:oe,dragging:T,selection:e}]),onClick:C?void 0:Xf(Y,P),onContextMenu:Xf(Z,P),onWheel:Xf(H,P),onPointerEnter:C?void 0:g,onPointerMove:C?K:v,onPointerUp:C?J:void 0,onPointerCancel:C?re:void 0,onPointerDownCapture:C?V:void 0,onClickCapture:C?B:void 0,onPointerLeave:x,ref:P,style:Nu,children:[w,N.jsx(nT,{})]})}function kh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:c,onError:f}=t.getState(),h=c.get(e);if(!h){f==null||f("012",gn.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(a({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):o([e])}function px({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:o,isSelectable:a,nodeClickDistance:l}){const c=qe(),[f,h]=O.useState(!1),m=O.useRef();return O.useEffect(()=>{m.current=VC({getStoreItems:()=>c.getState(),onNodeMouseDown:d=>{kh({id:d,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:l}),()=>{var d;(d=m.current)==null||d.destroy()}},[n,i,t,a,e,o,l]),f}const sT=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function mx(){const e=qe();return O.useCallback(n=>{const{nodeExtent:i,snapToGrid:o,snapGrid:a,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:h,nodeOrigin:m}=e.getState(),d=new Map,g=sT(l),v=o?a[0]:5,x=o?a[1]:5,w=n.direction.x*v*n.factor,b=n.direction.y*x*n.factor;for(const[,S]of h){if(!g(S))continue;let _={x:S.internals.positionAbsolute.x+w,y:S.internals.positionAbsolute.y+b};o&&(_=Ho(_,a));const{position:E,positionAbsolute:T}=Lw({nodeId:S.id,nextPosition:_,nodeLookup:h,nodeExtent:i,nodeOrigin:m,onError:c});S.position=E,S.internals.positionAbsolute=T,d.set(S.id,S)}f(d)},[])}const ep=O.createContext(null),oT=ep.Provider;ep.Consumer;const gx=()=>O.useContext(ep),aT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),lT=(e,t,n)=>i=>{const{connectionClickStartHandle:o,connectionMode:a,connection:l}=i,{fromHandle:c,toHandle:f,isValid:h}=l,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:a===as.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!o,valid:m&&h}};function uT({type:e="source",position:t=ke.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:l,onConnect:c,children:f,className:h,onMouseDown:m,onTouchStart:d,...g},v){var G,Y;const x=l||null,w=e==="target",b=qe(),S=gx(),{connectOnClick:_,noPanClassName:E,rfId:T}=Me(aT,He),{connectingFrom:A,connectingTo:R,clickConnecting:M,isPossibleEndHandle:C,connectionInProcess:P,clickConnectionInProcess:j,valid:L}=Me(lT(S,x,e),He);S||(Y=(G=b.getState()).onError)==null||Y.call(G,"010",gn.error010());const D=Z=>{const{defaultEdgeOptions:H,onConnect:B,hasDefaultEdges:V}=b.getState(),$={...H,...Z};if(V){const{edges:U,setEdges:W,onError:K}=b.getState();W(W2($,U,{onError:K}))}B==null||B($),c==null||c($)},X=Z=>{if(!S)return;const H=Ww(Z.nativeEvent);if(o&&(H&&Z.button===0||!H)){const B=b.getState();bh.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:w,handleId:x,nodeId:S,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...V)=>{var $,U;return(U=($=b.getState()).onConnectEnd)==null?void 0:U.call($,...V)},updateConnection:B.updateConnection,onConnect:D,isValidConnection:n||((...V)=>{var $,U;return((U=($=b.getState()).isValidConnection)==null?void 0:U.call($,...V))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}H?m==null||m(Z):d==null||d(Z)},z=Z=>{const{onClickConnectStart:H,onClickConnectEnd:B,connectionClickStartHandle:V,connectionMode:$,isValidConnection:U,lib:W,rfId:K,nodeLookup:J,connection:re}=b.getState();if(!S||!V&&!o)return;if(!V){H==null||H(Z.nativeEvent,{nodeId:S,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:x}});return}const oe=Bw(Z.target),ee=n||U,{connection:se,isValid:de}=bh.isValid(Z.nativeEvent,{handle:{nodeId:S,id:x,type:e},connectionMode:$,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ee,flowId:K,doc:oe,lib:W,nodeLookup:J});de&&se&&D(se);const xe=structuredClone(re);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,B==null||B(Z,xe),b.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":x,"data-nodeid":S,"data-handlepos":t,"data-id":`${T}-${S}-${x}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,h,{source:!w,target:w,connectable:i,connectablestart:o,connectableend:a,clickconnecting:M,connectingfrom:A,connectingto:R,valid:L,connectionindicator:i&&(!P||C)&&(P||j?a:o)}]),onMouseDown:X,onTouchStart:X,onClick:_?z:void 0,ref:v,...g,children:f})}const Or=O.memo(dx(uT));function cT({data:e,isConnectable:t,sourcePosition:n=ke.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(Or,{type:"source",position:n,isConnectable:t})]})}function fT({data:e,isConnectable:t,targetPosition:n=ke.Top,sourcePosition:i=ke.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(Or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(Or,{type:"source",position:i,isConnectable:t})]})}function dT(){return null}function hT({data:e,isConnectable:t,targetPosition:n=ke.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(Or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const iu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},n0={input:cT,default:fT,output:hT,group:dT};function pT(e){var t,n,i,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const mT=e=>{const{width:t,height:n,x:i,y:o}=Uo(e.nodeLookup,{filter:a=>!!a.selected});return{width:pn(t)?t:null,height:pn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${o}px)`}};function gT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=qe(),{width:o,height:a,transformString:l,userSelectionActive:c}=Me(mT,He),f=mx(),h=O.useRef(null);O.useEffect(()=>{var v;n||(v=h.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&o!==null&&a!==null;if(px({nodeRef:h,disabled:!m}),!m)return null;const d=e?v=>{const x=i.getState().nodes.filter(w=>w.selected);e(v,x)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(iu,v.key)&&(v.preventDefault(),f({direction:iu[v.key],factor:v.shiftKey?4:1}))};return N.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:N.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:o,height:a}})})}const r0=typeof window<"u"?window:void 0,yT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function yx({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:m,selectionMode:d,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:T,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:M,panOnDrag:C,autoPanOnSelection:P,defaultViewport:j,translateExtent:L,minZoom:D,maxZoom:X,preventScrolling:z,onSelectionContextMenu:G,noWheelClassName:Y,noPanClassName:Z,disableKeyboardA11y:H,onViewportChange:B,isControlledViewport:V}){const{nodesSelectionActive:$,userSelectionActive:U}=Me(yT,He),W=Do(h,{target:r0}),K=Do(w,{target:r0}),J=K||C,re=K||T,oe=m&&J!==!0,ee=W||U||oe;return Q2({deleteKeyCode:f,multiSelectionKeyCode:x}),N.jsx(eT,{onPaneContextMenu:a,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:M,panOnDrag:!W&&J,defaultViewport:j,translateExtent:L,minZoom:D,maxZoom:X,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:Y,noPanClassName:Z,onViewportChange:B,isControlledViewport:V,paneClickDistance:c,selectionOnDrag:oe,children:N.jsxs(iT,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:J,autoPanOnSelection:P,isSelecting:!!ee,selectionMode:d,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:oe,children:[e,$&&N.jsx(gT,{onSelectionContextMenu:G,noPanClassName:Z,disableKeyboardA11y:H})]})})}yx.displayName="FlowRenderer";const vT=O.memo(yx),wT=e=>t=>e?Uh(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 xT(e){return Me(O.useCallback(wT(e),[e]),He)}const bT=e=>e.updateNodeInternals;function kT(){const e=Me(bT),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(o=>{const a=o.target.getAttribute("data-id");i.set(a,{id:a,nodeElement:o.target,force:!0})}),e(i)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function ST({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const o=qe(),a=O.useRef(null),l=O.useRef(null),c=O.useRef(e.sourcePosition),f=O.useRef(e.targetPosition),h=O.useRef(t),m=n&&!!e.internals.handleBounds;return O.useEffect(()=>{a.current&&!e.hidden&&(!m||l.current!==a.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(a.current),l.current=a.current)},[m,e.hidden]),O.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),O.useEffect(()=>{if(a.current){const d=h.current!==t,g=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(d||g||v)&&(h.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function ET({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:o,onContextMenu:a,onDoubleClick:l,nodesDraggable:c,elementsSelectable:f,nodesConnectable:h,nodesFocusable:m,resizeObserver:d,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:x,rfId:w,nodeTypes:b,nodeClickDistance:S,onError:_}){const{node:E,internals:T,isParent:A}=Me(ee=>{const se=ee.nodeLookup.get(e),de=ee.parentLookup.has(e);return{node:se,internals:se.internals,isParent:de}},He);let R=E.type||"default",M=(b==null?void 0:b[R])||n0[R];M===void 0&&(_==null||_("003",gn.error003(R)),R="default",M=(b==null?void 0:b.default)||n0.default);const C=!!(E.draggable||c&&typeof E.draggable>"u"),P=!!(E.selectable||f&&typeof E.selectable>"u"),j=!!(E.connectable||h&&typeof E.connectable>"u"),L=!!(E.focusable||m&&typeof E.focusable>"u"),D=qe(),X=zw(E),z=ST({node:E,nodeType:R,hasDimensions:X,resizeObserver:d}),G=px({nodeRef:z,disabled:E.hidden||!C,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:S}),Y=mx();if(E.hidden)return null;const Z=tr(E),H=pT(E),B=P||C||t||n||i||o,V=n?ee=>n(ee,{...T.userNode}):void 0,$=i?ee=>i(ee,{...T.userNode}):void 0,U=o?ee=>o(ee,{...T.userNode}):void 0,W=a?ee=>a(ee,{...T.userNode}):void 0,K=l?ee=>l(ee,{...T.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:se,nodeDragThreshold:de}=D.getState();P&&(!se||!C||de>0)&&kh({id:e,store:D,nodeRef:z}),t&&t(ee,{...T.userNode})},re=ee=>{if(!(Vw(ee.nativeEvent)||x)){if(Ow.includes(ee.key)&&P){const se=ee.key==="Escape";kh({id:e,store:D,unselect:se,nodeRef:z})}else if(C&&E.selected&&Object.prototype.hasOwnProperty.call(iu,ee.key)){ee.preventDefault();const{ariaLabelConfig:se}=D.getState();D.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),Y({direction:iu[ee.key],factor:ee.shiftKey?4:1})}}},oe=()=>{var Se;if(x||!((Se=z.current)!=null&&Se.matches(":focus-visible")))return;const{transform:ee,width:se,height:de,autoPanOnNodeFocus:xe,setCenter:he}=D.getState();if(!xe)return;Uh(new Map([[e,E]]),{x:0,y:0,width:se,height:de},ee,!0).length>0||he(E.position.x+Z.width/2,E.position.y+Z.height/2,{zoom:ee[2]})};return N.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${R}`,{[v]:C},E.className,{selected:E.selected,selectable:P,parent:A,draggable:C,dragging:G}]),ref:z,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:X?"visible":"hidden",...E.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:$,onMouseLeave:U,onContextMenu:W,onClick:J,onDoubleClick:K,onKeyDown:L?re:void 0,tabIndex:L?0:void 0,onFocus:L?oe:void 0,role:E.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${lx}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:N.jsx(oT,{value:e,children:N.jsx(M,{id:e,data:E.data,type:R,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:E.selected??!1,selectable:P,draggable:C,deletable:E.deletable??!0,isConnectable:j,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:T.z,parentId:E.parentId,...Z})})})}var NT=O.memo(ET);const _T=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function vx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:o,onError:a}=Me(_T,He),l=xT(e.onlyRenderVisibleElements),c=kT();return N.jsx("div",{className:"react-flow__nodes",style:Nu,children:l.map(f=>N.jsx(NT,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},f))})}vx.displayName="NodeRenderer";const CT=O.memo(vx);function TT(e){return Me(O.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const i=[];if(n.width&&n.height)for(const o of n.edges){const a=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);a&&l&&SC({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(o.id)}return i},[e]),He)}const IT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return N.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},OT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return N.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},i0={[nu.Arrow]:IT,[nu.ArrowClosed]:OT};function PT(e){const t=qe();return O.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(i0,e)?i0[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",gn.error009(e)),null)},[e])}const AT=({id:e,type:t,color:n,width:i=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const f=PT(t);return f?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:N.jsx(f,{color:n,strokeWidth:l})}):null},wx=({defaultColor:e,rfId:t})=>{const n=Me(a=>a.edges),i=Me(a=>a.defaultEdgeOptions),o=O.useMemo(()=>PC(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return o.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:o.map(a=>N.jsx(AT,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};wx.displayName="MarkerDefinitions";var MT=O.memo(wx);function xx({x:e,y:t,label:n,labelStyle:i,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:f,className:h,...m}){const[d,g]=O.useState({x:1,y:0,width:0,height:0}),v=rt(["react-flow__edge-textwrapper",h]),x=O.useRef(null);return O.useEffect(()=>{if(x.current){const w=x.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...m,children:[o&&N.jsx("rect",{width:d.width+2*l[0],x:-l[0],y:-l[1],height:d.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),N.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:i,children:n}),f]}):null}xx.displayName="EdgeText";const RT=O.memo(xx);function _u({path:e,labelX:t,labelY:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:h=20,...m}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...m,d:e,fill:"none",className:rt(["react-flow__edge-path",m.className])}),h?N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?N.jsx(RT,{x:t,y:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function s0({pos:e,x1:t,y1:n,x2:i,y2:o}){return e===ke.Left||e===ke.Right?[.5*(t+i),n]:[t,.5*(n+o)]}function bx({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top}){const[l,c]=s0({pos:n,x1:e,y1:t,x2:i,y2:o}),[f,h]=s0({pos:a,x1:i,y1:o,x2:e,y2:t}),[m,d,g,v]=Uw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${c} ${f},${h} ${i},${o}`,m,d,g,v]}function kx(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l,targetPosition:c,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:S})=>{const[_,E,T]=bx({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c}),A=e.isInternal?void 0:t;return N.jsx(_u,{id:A,path:_,labelX:E,labelY:T,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:S})})}const LT=kx({isInternal:!1}),Sx=kx({isInternal:!0});LT.displayName="SimpleBezierEdge";Sx.displayName="SimpleBezierEdgeInternal";function Ex(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,sourcePosition:v=ke.Bottom,targetPosition:x=ke.Top,markerEnd:w,markerStart:b,pathOptions:S,interactionWidth:_})=>{const[E,T,A]=vh({sourceX:n,sourceY:i,sourcePosition:v,targetX:o,targetY:a,targetPosition:x,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),R=e.isInternal?void 0:t;return N.jsx(_u,{id:R,path:E,labelX:T,labelY:A,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:b,interactionWidth:_})})}const Nx=Ex({isInternal:!1}),_x=Ex({isInternal:!0});Nx.displayName="SmoothStepEdge";_x.displayName="SmoothStepEdgeInternal";function Cx(e){return O.memo(({id:t,...n})=>{var o;const i=e.isInternal?void 0:t;return N.jsx(Nx,{...n,id:i,pathOptions:O.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const jT=Cx({isInternal:!1}),Tx=Cx({isInternal:!0});jT.displayName="StepEdge";Tx.displayName="StepEdgeInternal";function Ix(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:x,interactionWidth:w})=>{const[b,S,_]=Yw({sourceX:n,sourceY:i,targetX:o,targetY:a}),E=e.isInternal?void 0:t;return N.jsx(_u,{id:E,path:b,labelX:S,labelY:_,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:x,interactionWidth:w})})}const DT=Ix({isInternal:!1}),Ox=Ix({isInternal:!0});DT.displayName="StraightEdge";Ox.displayName="StraightEdgeInternal";function Px(e){return O.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l=ke.Bottom,targetPosition:c=ke.Top,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,pathOptions:S,interactionWidth:_})=>{const[E,T,A]=Hw({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c,curvature:S==null?void 0:S.curvature}),R=e.isInternal?void 0:t;return N.jsx(_u,{id:R,path:E,labelX:T,labelY:A,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:_})})}const $T=Px({isInternal:!1}),Ax=Px({isInternal:!0});$T.displayName="BezierEdge";Ax.displayName="BezierEdgeInternal";const o0={default:Ax,straight:Ox,step:Tx,smoothstep:_x,simplebezier:Sx},a0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},zT=(e,t,n)=>n===ke.Left?e-t:n===ke.Right?e+t:e,FT=(e,t,n)=>n===ke.Top?e-t:n===ke.Bottom?e+t:e,l0="react-flow__edgeupdater";function u0({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:o,onMouseEnter:a,onMouseOut:l,type:c}){return N.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:l,className:rt([l0,`${l0}-${c}`]),cx:zT(t,i,e),cy:FT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function BT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:o,targetX:a,targetY:l,sourcePosition:c,targetPosition:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:d,setReconnecting:g,setUpdateHover:v}){const x=qe(),w=(T,A)=>{if(T.button!==0)return;const{autoPanOnConnect:R,domNode:M,connectionMode:C,connectionRadius:P,lib:j,onConnectStart:L,cancelConnection:D,nodeLookup:X,rfId:z,panBy:G,updateConnection:Y}=x.getState(),Z=A.type==="target",H=($,U)=>{g(!1),d==null||d($,n,A.type,U)},B=$=>h==null?void 0:h(n,$),V=($,U)=>{g(!0),m==null||m(T,n,A.type),L==null||L($,U)};bh.onPointerDown(T.nativeEvent,{autoPanOnConnect:R,connectionMode:C,connectionRadius:P,domNode:M,handleId:A.id,nodeId:A.nodeId,nodeLookup:X,isTarget:Z,edgeUpdaterType:A.type,lib:j,flowId:z,cancelConnection:D,panBy:G,isValidConnection:(...$)=>{var U,W;return((W=(U=x.getState()).isValidConnection)==null?void 0:W.call(U,...$))??!0},onConnect:B,onConnectStart:V,onConnectEnd:(...$)=>{var U,W;return(W=(U=x.getState()).onConnectEnd)==null?void 0:W.call(U,...$)},onReconnectEnd:H,updateConnection:Y,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},b=T=>w(T,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=T=>w(T,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>v(!0),E=()=>v(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(u0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:b,onMouseEnter:_,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&N.jsx(u0,{position:f,centerX:a,centerY:l,radius:t,onMouseDown:S,onMouseEnter:_,onMouseOut:E,type:"target"})]})}function VT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:o,onDoubleClick:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,rfId:x,edgeTypes:w,noPanClassName:b,onError:S,disableKeyboardA11y:_}){let E=Me(he=>he.edgeLookup.get(e));const T=Me(he=>he.defaultEdgeOptions);E=T?{...T,...E}:E;let A=E.type||"default",R=(w==null?void 0:w[A])||o0[A];R===void 0&&(S==null||S("011",gn.error011(A)),A="default",R=(w==null?void 0:w.default)||o0.default);const M=!!(E.focusable||t&&typeof E.focusable>"u"),C=typeof d<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),P=!!(E.selectable||i&&typeof E.selectable>"u"),j=O.useRef(null),[L,D]=O.useState(!1),[X,z]=O.useState(!1),G=qe(),{zIndex:Y,sourceX:Z,sourceY:H,targetX:B,targetY:V,sourcePosition:$,targetPosition:U}=Me(O.useCallback(he=>{const fe=he.nodeLookup.get(E.source),Se=he.nodeLookup.get(E.target);if(!fe||!Se)return{zIndex:E.zIndex,...a0};const Pe=OC({id:e,sourceNode:fe,targetNode:Se,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:he.connectionMode,onError:S});return{zIndex:kC({selected:E.selected,zIndex:E.zIndex,sourceNode:fe,targetNode:Se,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Pe||a0}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),He),W=O.useMemo(()=>E.markerStart?`url('#${wh(E.markerStart,x)}')`:void 0,[E.markerStart,x]),K=O.useMemo(()=>E.markerEnd?`url('#${wh(E.markerEnd,x)}')`:void 0,[E.markerEnd,x]);if(E.hidden||Z===null||H===null||B===null||V===null)return null;const J=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:Se,multiSelectionActive:Pe}=G.getState();P&&(G.setState({nodesSelectionActive:!1}),E.selected&&Pe?(Se({nodes:[],edges:[E]}),(Ae=j.current)==null||Ae.blur()):fe([e])),o&&o(he,E)},re=a?he=>{a(he,{...E})}:void 0,oe=l?he=>{l(he,{...E})}:void 0,ee=c?he=>{c(he,{...E})}:void 0,se=f?he=>{f(he,{...E})}:void 0,de=h?he=>{h(he,{...E})}:void 0,xe=he=>{var fe;if(!_&&Ow.includes(he.key)&&P){const{unselectNodesAndEdges:Se,addSelectedEdges:Pe}=G.getState();he.key==="Escape"?((fe=j.current)==null||fe.blur(),Se({edges:[E]})):Pe([e])}};return N.jsx("svg",{style:{zIndex:Y},children:N.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${A}`,E.className,b,{selected:E.selected,animated:E.animated,inactive:!P&&!o,updating:L,selectable:P}]),onClick:J,onDoubleClick:re,onContextMenu:oe,onMouseEnter:ee,onMouseMove:se,onMouseLeave:de,onKeyDown:M?xe:void 0,tabIndex:M?0:void 0,role:E.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":M?`${ux}-${x}`:void 0,ref:j,...E.domAttributes,children:[!X&&N.jsx(R,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:P,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:Z,sourceY:H,targetX:B,targetY:V,sourcePosition:$,targetPosition:U,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:W,markerEnd:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),C&&N.jsx(BT,{edge:E,isReconnectable:C,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:Z,sourceY:H,targetX:B,targetY:V,sourcePosition:$,targetPosition:U,setUpdateHover:D,setReconnecting:z})]})})}var WT=O.memo(VT);const UT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Mx({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:o,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:_,onError:E}=Me(UT,He),T=TT(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(MT,{defaultColor:e,rfId:n}),T.map(A=>N.jsx(WT,{id:A,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:_,noPanClassName:o,onReconnect:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,onClick:m,reconnectRadius:d,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:x,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:w},A))]})}Mx.displayName="EdgeRenderer";const HT=O.memo(Mx),qT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function YT({children:e}){const t=Me(qT);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function KT(e){const t=Zh(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const GT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function XT(e){const t=Me(GT),n=qe();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function QT(e){return e.connection.inProgress?{...e.connection,to:ys(e.connection.to,e.transform)}:{...e.connection}}function JT(e){return QT}function ZT(e){const t=JT();return Me(t,He)}const eI=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tI({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:o,width:a,height:l,isValid:c,inProgress:f}=Me(eI,He);return!(a&&o&&f)?null:N.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:rt(["react-flow__connection",Mw(c)]),children:N.jsx(Rx,{style:t,type:n,CustomComponent:i,isValid:c})})})}const Rx=({style:e,type:t=Tr.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:o,from:a,fromNode:l,fromHandle:c,fromPosition:f,to:h,toNode:m,toHandle:d,toPosition:g,pointer:v}=ZT();if(!o)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:a.x,fromY:a.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Mw(i),toNode:m,toHandle:d,pointer:v});let x="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(t){case Tr.Bezier:[x]=Hw(w);break;case Tr.SimpleBezier:[x]=bx(w);break;case Tr.Step:[x]=vh({...w,borderRadius:0});break;case Tr.SmoothStep:[x]=vh(w);break;default:[x]=Yw(w)}return N.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Rx.displayName="ConnectionLine";const nI={};function c0(e=nI){O.useRef(e),qe(),O.useEffect(()=>{},[e])}function rI(){qe(),O.useRef(!1),O.useEffect(()=>{},[])}function Lx({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:v,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:_,selectionOnDrag:E,selectionMode:T,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:M,deleteKeyCode:C,onlyRenderVisibleElements:P,elementsSelectable:j,defaultViewport:L,translateExtent:D,minZoom:X,maxZoom:z,preventScrolling:G,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:H,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:$,zoomOnDoubleClick:U,panOnDrag:W,autoPanOnSelection:K,onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneScroll:se,onPaneContextMenu:de,paneClickDistance:xe,nodeClickDistance:he,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,reconnectRadius:Fe,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,noDragClassName:pt,noWheelClassName:jn,noPanClassName:bn,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht,viewport:Lt,onViewportChange:qt}){return c0(e),c0(t),rI(),KT(n),XT(Lt),N.jsx(vT,{onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:se,paneClickDistance:xe,deleteKeyCode:C,selectionKeyCode:_,selectionOnDrag:E,selectionMode:T,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:M,elementsSelectable:j,zoomOnScroll:Z,zoomOnPinch:H,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:V,panOnScrollMode:$,panOnDrag:W,autoPanOnSelection:K,defaultViewport:L,translateExtent:D,minZoom:X,maxZoom:z,onSelectionContextMenu:d,preventScrolling:G,noDragClassName:pt,noWheelClassName:jn,noPanClassName:bn,disableKeyboardA11y:kn,onViewportChange:qt,isControlledViewport:!!Lt,children:N.jsxs(YT,{children:[N.jsx(HT,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,onlyRenderVisibleElements:P,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:bn,disableKeyboardA11y:kn,rfId:Ht}),N.jsx(tI,{style:w,type:x,component:b,containerStyle:S}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(CT,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:P,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}Lx.displayName="GraphView";const iI=O.memo(Lx),sI=$w(),f0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:d,zIndexMode:g="basic"}={})=>{const v=new Map,x=new Map,w=new Map,b=new Map,S=i??t??[],_=n??e??[],E=m??[0,0],T=d??Mo;Xw(w,b,S);const{nodesInitialized:A}=xh(_,v,x,{nodeOrigin:E,nodeExtent:T,zIndexMode:g});let R=[0,0,1];if(l&&o&&a){const M=Uo(v,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:C,y:P,zoom:j}=qh(M,o,a,f,h,(c==null?void 0:c.padding)??.1);R=[C,P,j]}return{rfId:"1",width:o??0,height:a??0,transform:R,nodes:_,nodesInitialized:A,nodeLookup:v,parentLookup:x,edges:S,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Mo,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:as.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Aw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:sI,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Pw,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},oI=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g})=>w2((v,x)=>{async function w(){const{nodeLookup:b,panZoom:S,fitViewOptions:_,fitViewResolver:E,width:T,height:A,minZoom:R,maxZoom:M}=x();S&&(await mC({nodes:b,width:T,height:A,panZoom:S,minZoom:R,maxZoom:M},_),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...f0({nodes:e,edges:t,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:d,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:b=>{const{nodeLookup:S,parentLookup:_,nodeOrigin:E,elevateNodesOnSelect:T,fitViewQueued:A,zIndexMode:R,nodesSelectionActive:M}=x(),{nodesInitialized:C,hasSelectedNodes:P}=xh(b,S,_,{nodeOrigin:E,nodeExtent:d,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:R}),j=M&&P;A&&C?(w(),v({nodes:b,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):v({nodes:b,nodesInitialized:C,nodesSelectionActive:j})},setEdges:b=>{const{connectionLookup:S,edgeLookup:_}=x();Xw(S,_,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:_}=x();_(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:_}=x();_(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:_,parentLookup:E,domNode:T,nodeOrigin:A,nodeExtent:R,debug:M,fitViewQueued:C,zIndexMode:P}=x(),{changes:j,updatedInternals:L}=$C(b,_,E,T,A,R,P);L&&(RC(_,E,{nodeOrigin:A,nodeExtent:R,zIndexMode:P}),C?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(j==null?void 0:j.length)>0&&(M&&console.log("React Flow: trigger node changes",j),S==null||S(j)))},updateNodePositions:(b,S=!1)=>{const _=[];let E=[];const{nodeLookup:T,triggerNodeChanges:A,connection:R,updateConnection:M,onNodesChangeMiddlewareMap:C}=x();for(const[P,j]of b){const L=T.get(P),D=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(j!=null&&j.position)),X={id:P,type:"position",position:D?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:S};if(L&&R.inProgress&&R.fromNode.id===L.id){const z=fi(L,R.fromHandle,ke.Left,!0);M({...R,from:z})}D&&L.parentId&&_.push({id:P,parentId:L.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),E.push(X)}if(_.length>0){const{parentLookup:P,nodeOrigin:j}=x(),L=Jh(_,T,P,j);E.push(...L)}for(const P of C.values())E=P(E);A(E)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:_,nodes:E,hasDefaultNodes:T,debug:A}=x();if(b!=null&&b.length){if(T){const R=F2(b,E);_(R)}A&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:_,edges:E,hasDefaultEdges:T,debug:A}=x();if(b!=null&&b.length){if(T){const R=B2(b,E);_(R)}A&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:_,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(S){const R=b.map(M=>ei(M,!0));T(R);return}T(Xi(E,new Set([...b]),!0)),A(Xi(_))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:_,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(S){const R=b.map(M=>ei(M,!0));A(R);return}A(Xi(_,new Set([...b]))),T(Xi(E,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:_,nodes:E,nodeLookup:T,triggerNodeChanges:A,triggerEdgeChanges:R}=x(),M=b||E,C=S||_,P=[];for(const L of M){if(!L.selected)continue;const D=T.get(L.id);D&&(D.selected=!1),P.push(ei(L.id,!1))}const j=[];for(const L of C)L.selected&&j.push(ei(L.id,!1));A(P),R(j)},setMinZoom:b=>{const{panZoom:S,maxZoom:_}=x();S==null||S.setScaleExtent([b,_]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:_}=x();S==null||S.setScaleExtent([_,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=x().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:_,triggerEdgeChanges:E,elementsSelectable:T}=x();if(!T)return;const A=S.reduce((M,C)=>C.selected?[...M,ei(C.id,!1)]:M,[]),R=b.reduce((M,C)=>C.selected?[...M,ei(C.id,!1)]:M,[]);_(A),E(R)},setNodeExtent:b=>{const{nodes:S,nodeLookup:_,parentLookup:E,nodeOrigin:T,elevateNodesOnSelect:A,nodeExtent:R,zIndexMode:M}=x();b[0][0]===R[0][0]&&b[0][1]===R[0][1]&&b[1][0]===R[1][0]&&b[1][1]===R[1][1]||(xh(S,_,E,{nodeOrigin:T,nodeExtent:b,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:M}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:_,height:E,panZoom:T,translateExtent:A}=x();return zC({delta:b,panZoom:T,transform:S,translateExtent:A,width:_,height:E})},setCenter:async(b,S,_)=>{const{width:E,height:T,maxZoom:A,panZoom:R}=x();if(!R)return!1;const M=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:A;return await R.setViewport({x:E/2-b*M,y:T/2-S*M,zoom:M},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),!0},cancelConnection:()=>{v({connection:{...Aw}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...f0()})}},Object.is);function jx({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:o,initialHeight:a,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:f,fitView:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g,children:v}){const[x]=O.useState(()=>oI({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:h,minZoom:l,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:d,zIndexMode:g}));return N.jsx(x2,{value:x,children:N.jsx(Y2,{children:v})})}function aI({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:a,height:l,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v}){return O.useContext(Su)?N.jsx(N.Fragment,{children:e}):N.jsx(jx,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:o,initialWidth:a,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v,children:e})}const lI={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function uI({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:o,nodeTypes:a,edgeTypes:l,onNodeClick:c,onEdgeClick:f,onInit:h,onMove:m,onMoveStart:d,onMoveEnd:g,onConnect:v,onConnectStart:x,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:R,onNodeDragStart:M,onNodeDrag:C,onNodeDragStop:P,onNodesDelete:j,onEdgesDelete:L,onDelete:D,onSelectionChange:X,onSelectionDragStart:z,onSelectionDrag:G,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:H,onSelectionEnd:B,onBeforeDelete:V,connectionMode:$,connectionLineType:U=Tr.Bezier,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:re="Backspace",selectionKeyCode:oe="Shift",selectionOnDrag:ee=!1,selectionMode:se=Ro.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:xe=jo()?"Meta":"Control",zoomActivationKeyCode:he=jo()?"Meta":"Control",snapToGrid:fe,snapGrid:Se,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:Ae,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,nodeOrigin:pt=cx,edgesFocusable:jn,edgesReconnectable:bn,elementsSelectable:kn=!0,defaultViewport:_t=M2,minZoom:Ht=.5,maxZoom:Lt=2,translateExtent:qt=Mo,preventScrolling:Xo=!0,nodeExtent:Dn,defaultMarkerColor:Rr="#b1b1b7",zoomOnScroll:Bu=!0,zoomOnPinch:Qo=!0,panOnScroll:Jo=!1,panOnScrollSpeed:Vu=.5,panOnScrollMode:Ss=oi.Free,zoomOnDoubleClick:Es=!0,panOnDrag:Ns=!0,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:nr,onPaneMouseLeave:rr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta=1,nodeClickDistance:na=0,children:ra,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Is,onEdgeDoubleClick:jr,onEdgeMouseEnter:Wu,onEdgeMouseMove:Dr,onEdgeMouseLeave:pi,reconnectRadius:mi=10,onNodesChange:Os,onEdgesChange:Uu,noDragClassName:Hu="nodrag",noWheelClassName:qu="nowheel",noPanClassName:Sn="nopan",fitView:Ps,fitViewOptions:As,connectOnClick:Yu,attributionPosition:sa,proOptions:oa,defaultEdgeOptions:aa,elevateNodesOnSelect:la=!0,elevateEdgesOnSelect:Ku=!1,disableKeyboardA11y:ua=!1,autoPanOnConnect:Ye,autoPanOnNodeDrag:Gu,autoPanOnSelection:Ms=!0,autoPanSpeed:ca,connectionRadius:gi,isValidConnection:Xu,onError:fa,style:yi,id:jt,nodeDragThreshold:Qu,connectionDragThreshold:Dt,viewport:Ju,onViewportChange:Zu,width:ec,height:vi,colorMode:wi="light",debug:$r,onScroll:$n,ariaLabelConfig:tc,zIndexMode:da="basic",...Rs},ha){const zr=jt||"1",Fr=D2(wi),nc=O.useCallback(xi=>{xi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$n==null||$n(xi)},[$n]);return N.jsx("div",{"data-testid":"rf__wrapper",...Rs,onScroll:nc,style:{...yi,...lI},ref:ha,className:rt(["react-flow",o,Fr]),id:jt,role:"application",children:N.jsxs(aI,{nodes:e,edges:t,width:ec,height:vi,fitView:Ps,fitViewOptions:As,minZoom:Ht,maxZoom:Lt,nodeOrigin:pt,nodeExtent:Dn,zIndexMode:da,children:[N.jsx(j2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:x,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,edgesFocusable:jn,edgesReconnectable:bn,elementsSelectable:kn,elevateNodesOnSelect:la,elevateEdgesOnSelect:Ku,minZoom:Ht,maxZoom:Lt,nodeExtent:Dn,onNodesChange:Os,onEdgesChange:Uu,snapToGrid:fe,snapGrid:Se,connectionMode:$,translateExtent:qt,connectOnClick:Yu,defaultEdgeOptions:aa,fitView:Ps,fitViewOptions:As,onNodesDelete:j,onEdgesDelete:L,onDelete:D,onNodeDragStart:M,onNodeDrag:C,onNodeDragStop:P,onSelectionDrag:G,onSelectionDragStart:z,onSelectionDragStop:Y,onMove:m,onMoveStart:d,onMoveEnd:g,noPanClassName:Sn,nodeOrigin:pt,rfId:zr,autoPanOnConnect:Ye,autoPanOnNodeDrag:Gu,autoPanSpeed:ca,onError:fa,connectionRadius:gi,isValidConnection:Xu,selectNodesOnDrag:Ae,nodeDragThreshold:Qu,connectionDragThreshold:Dt,onBeforeDelete:V,debug:$r,ariaLabelConfig:tc,zIndexMode:da}),N.jsx(iI,{onInit:h,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:_,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:R,nodeTypes:a,edgeTypes:l,connectionLineType:U,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:oe,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:re,multiSelectionKeyCode:xe,panActivationKeyCode:de,zoomActivationKeyCode:he,onlyRenderVisibleElements:Pe,defaultViewport:_t,translateExtent:qt,minZoom:Ht,maxZoom:Lt,preventScrolling:Xo,zoomOnScroll:Bu,zoomOnPinch:Qo,zoomOnDoubleClick:Es,panOnScroll:Jo,panOnScrollSpeed:Vu,panOnScrollMode:Ss,panOnDrag:Ns,autoPanOnSelection:Ms,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:nr,onPaneMouseLeave:rr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta,nodeClickDistance:na,onSelectionContextMenu:Z,onSelectionStart:H,onSelectionEnd:B,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Is,onEdgeDoubleClick:jr,onEdgeMouseEnter:Wu,onEdgeMouseMove:Dr,onEdgeMouseLeave:pi,reconnectRadius:mi,defaultMarkerColor:Rr,noDragClassName:Hu,noWheelClassName:qu,noPanClassName:Sn,rfId:zr,disableKeyboardA11y:ua,nodeExtent:Dn,viewport:Ju,onViewportChange:Zu}),N.jsx(A2,{onSelectionChange:X}),ra,N.jsx(C2,{proOptions:oa,position:sa}),N.jsx(_2,{rfId:zr,disableKeyboardA11y:ua})]})})}var cI=dx(uI);function fI({dimensions:e,lineWidth:t,variant:n,className:i}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",n,i])})}function dI({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",t])})}var Jn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Jn||(Jn={}));const hI={[Jn.Dots]:1,[Jn.Lines]:1,[Jn.Cross]:6},pI=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Dx({id:e,variant:t=Jn.Dots,gap:n=20,size:i,lineWidth:o=1,offset:a=0,color:l,bgColor:c,style:f,className:h,patternClassName:m}){const d=O.useRef(null),{transform:g,patternId:v}=Me(pI,He),x=i||hI[t],w=t===Jn.Dots,b=t===Jn.Cross,S=Array.isArray(n)?n:[n,n],_=[S[0]*g[2]||1,S[1]*g[2]||1],E=x*g[2],T=Array.isArray(a)?a:[a,a],A=b?[E,E]:_,R=[T[0]*g[2]||1+A[0]/2,T[1]*g[2]||1+A[1]/2],M=`${v}${e||""}`;return N.jsxs("svg",{className:rt(["react-flow__background",h]),style:{...f,...Nu,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:d,"data-testid":"rf__background",children:[N.jsx("pattern",{id:M,x:g[0]%_[0],y:g[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:w?N.jsx(dI,{radius:E/2,className:m}):N.jsx(fI,{dimensions:A,lineWidth:o,variant:t,className:m})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}Dx.displayName="Background";const mI=O.memo(Dx);function gI(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yI(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function vI(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.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 wI(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 xI(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 Sl({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:rt(["react-flow__controls-button",t]),...n,children:e})}const bI=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $x({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:l,onFitView:c,onInteractiveChange:f,className:h,children:m,position:d="bottom-left",orientation:g="vertical","aria-label":v}){const x=qe(),{isInteractive:w,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:_}=Me(bI,He),{zoomIn:E,zoomOut:T,fitView:A}=Zh(),R=()=>{E(),a==null||a()},M=()=>{T(),l==null||l()},C=()=>{A(o),c==null||c()},P=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},j=g==="horizontal"?"horizontal":"vertical";return N.jsxs(Eu,{className:rt(["react-flow__controls",j,h]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??_["controls.ariaLabel"],children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(Sl,{onClick:R,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:S,children:N.jsx(gI,{})}),N.jsx(Sl,{onClick:M,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:b,children:N.jsx(yI,{})})]}),n&&N.jsx(Sl,{className:"react-flow__controls-fitview",onClick:C,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:N.jsx(vI,{})}),i&&N.jsx(Sl,{className:"react-flow__controls-interactive",onClick:P,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?N.jsx(xI,{}):N.jsx(wI,{})}),m]})}$x.displayName="Controls";const kI=O.memo($x);function SI({id:e,x:t,y:n,width:i,height:o,style:a,color:l,strokeColor:c,strokeWidth:f,className:h,borderRadius:m,shapeRendering:d,selected:g,onClick:v}){const{background:x,backgroundColor:w}=a||{},b=l||x||w;return N.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:g},h]),x:t,y:n,rx:m,ry:m,width:i,height:o,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const EI=O.memo(SI),NI=e=>e.nodes.map(t=>t.id),Qf=e=>e instanceof Function?e:()=>e;function _I({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:a=EI,onClick:l}){const c=Me(NI,He),f=Qf(t),h=Qf(e),m=Qf(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:c.map(g=>N.jsx(TI,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:o,NodeComponent:a,onClick:l,shapeRendering:d},g))})}function CI({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:c,onClick:f}){const{node:h,x:m,y:d,width:g,height:v}=Me(x=>{const w=x.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:S,y:_}=w.internals.positionAbsolute,{width:E,height:T}=tr(b);return{node:b,x:S,y:_,width:E,height:T}},He);return!h||h.hidden||!zw(h)?null:N.jsx(c,{x:m,y:d,width:g,height:v,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:o,strokeColor:n(h),strokeWidth:a,shapeRendering:l,onClick:f,id:h.id})}const TI=O.memo(CI);var II=O.memo(_I);const OI=200,PI=150,AI=e=>!e.hidden,MI=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?Dw(Uo(e.nodeLookup,{filter:AI}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},RI="react-flow__minimap-desc";function zx({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:f,maskColor:h,maskStrokeColor:m,maskStrokeWidth:d,position:g="bottom-right",onClick:v,onNodeClick:x,pannable:w=!1,zoomable:b=!1,ariaLabel:S,inversePan:_,zoomStep:E=1,offsetScale:T=5}){const A=qe(),R=O.useRef(null),{boundingRect:M,viewBB:C,rfId:P,panZoom:j,translateExtent:L,flowWidth:D,flowHeight:X,ariaLabelConfig:z}=Me(MI,He),G=(e==null?void 0:e.width)??OI,Y=(e==null?void 0:e.height)??PI,Z=M.width/G,H=M.height/Y,B=Math.max(Z,H),V=B*G,$=B*Y,U=T*B,W=M.x-(V-M.width)/2-U,K=M.y-($-M.height)/2-U,J=V+U*2,re=$+U*2,oe=`${RI}-${P}`,ee=O.useRef(0),se=O.useRef();ee.current=B,O.useEffect(()=>{if(R.current&&j)return se.current=KC({domNode:R.current,panZoom:j,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=se.current)==null||fe.destroy()}},[j]),O.useEffect(()=>{var fe;(fe=se.current)==null||fe.update({translateExtent:L,width:D,height:X,inversePan:_,pannable:w,zoomStep:E,zoomable:b})},[w,b,_,E,L,D,X]);const de=v?fe=>{var Ae;const[Se,Pe]=((Ae=se.current)==null?void 0:Ae.pointer(fe))||[0,0];v(fe,{x:Se,y:Pe})}:void 0,xe=x?O.useCallback((fe,Se)=>{const Pe=A.getState().nodeLookup.get(Se).internals.userNode;x(fe,Pe)},[]):void 0,he=S??z["minimap.ariaLabel"];return N.jsx(Eu,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*B:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:rt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:G,height:Y,viewBox:`${W} ${K} ${J} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:R,onClick:de,children:[he&&N.jsx("title",{id:oe,children:he}),N.jsx(II,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-U},${K-U}h${J+U*2}v${re+U*2}h${-J-U*2}z
62
- M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zx.displayName="MiniMap";O.memo(zx);const LI=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,jI={[fs.Line]:"right",[fs.Handle]:"bottom-right"};function DI({nodeId:e,position:t,variant:n=fs.Handle,className:i,style:o=void 0,children:a,color:l,minWidth:c=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:v=!0,shouldResize:x,onResizeStart:w,onResize:b,onResizeEnd:S}){const _=gx(),E=typeof e=="string"?e:_,T=qe(),A=O.useRef(null),R=n===fs.Handle,M=Me(O.useCallback(LI(R&&v),[R,v]),He),C=O.useRef(null),P=t??jI[n];O.useEffect(()=>{if(!(!A.current||!E))return C.current||(C.current=a2({domNode:A.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:L,transform:D,snapGrid:X,snapToGrid:z,nodeOrigin:G,domNode:Y}=T.getState();return{nodeLookup:L,transform:D,snapGrid:X,snapToGrid:z,nodeOrigin:G,paneDomNode:Y}},onChange:(L,D)=>{const{triggerNodeChanges:X,nodeLookup:z,parentLookup:G,nodeOrigin:Y}=T.getState(),Z=[],H={x:L.x,y:L.y},B=z.get(E);if(B&&B.expandParent&&B.parentId){const V=B.origin??Y,$=L.width??B.measured.width??0,U=L.height??B.measured.height??0,W={id:B.id,parentId:B.parentId,rect:{width:$,height:U,...Fw({x:L.x??B.position.x,y:L.y??B.position.y},{width:$,height:U},B.parentId,z,V)}},K=Jh([W],z,G,Y);Z.push(...K),H.x=L.x?Math.max(V[0]*$,L.x):void 0,H.y=L.y?Math.max(V[1]*U,L.y):void 0}if(H.x!==void 0&&H.y!==void 0){const V={id:E,type:"position",position:{...H}};Z.push(V)}if(L.width!==void 0&&L.height!==void 0){const $={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};Z.push($)}for(const V of D){const $={...V,type:"position"};Z.push($)}X(Z)},onEnd:({width:L,height:D})=>{const X={id:E,type:"dimensions",resizing:!1,dimensions:{width:L,height:D}};T.getState().triggerNodeChanges([X])}})),C.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:f,maxWidth:h,maxHeight:m},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:S,shouldResize:x}),()=>{var L;(L=C.current)==null||L.destroy()}},[P,c,f,h,m,d,w,b,S,x]);const j=P.split("-");return N.jsx("div",{className:rt(["react-flow__resize-control","nodrag",...j,n,i]),ref:A,style:{...o,scale:M,...l&&{[R?"backgroundColor":"borderColor"]:l}},children:a})}O.memo(DI);function Fx(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Bx(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fx(e))&&(i&&(i+=" "),i+=t);return i}const $I=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},zI=(e,t)=>({classGroupId:e,validator:t}),Vx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),su="-",d0=[],FI="arbitrary..",BI=e=>{const t=WI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return VI(l);const c=l.split(su),f=c[0]===""&&c.length>1?1:0;return Wx(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=i[l],h=n[l];return f?h?$I(h,f):f:h||d0}return n[l]||d0}}},Wx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const h=Wx(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(su):e.slice(t).join(su),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},VI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?FI+i:void 0})(),WI=e=>{const{theme:t,classGroups:n}=e;return UI(n,t)},UI=(e,t)=>{const n=Vx();for(const i in e){const o=e[i];tp(o,n,i,t)}return n},tp=(e,t,n,i)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];HI(l,t,n,i)}},HI=(e,t,n,i)=>{if(typeof e=="string"){qI(e,t,n);return}if(typeof e=="function"){YI(e,t,n,i);return}KI(e,t,n,i)},qI=(e,t,n)=>{const i=e===""?t:Ux(t,e);i.classGroupId=n},YI=(e,t,n,i)=>{if(GI(e)){tp(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(zI(n,e))},KI=(e,t,n,i)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[c,f]=o[l];tp(f,Ux(t,c),n,i)}},Ux=(e,t)=>{let n=e;const i=t.split(su),o=i.length;for(let a=0;a<o;a++){const l=i[a];let c=n.nextPart.get(l);c||(c=Vx(),n.nextPart.set(l,c)),n=c}return n},GI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const o=(a,l)=>{n[a]=l,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=i[a])!==void 0)return o(a,l),l},set(a,l){a in n?n[a]=l:o(a,l)}}},Sh="!",h0=":",QI=[],p0=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),JI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=o=>{const a=[];let l=0,c=0,f=0,h;const m=o.length;for(let w=0;w<m;w++){const b=o[w];if(l===0&&c===0){if(b===h0){a.push(o.slice(f,w)),f=w+1;continue}if(b==="/"){h=w;continue}}b==="["?l++:b==="]"?l--:b==="("?c++:b===")"&&c--}const d=a.length===0?o:o.slice(f);let g=d,v=!1;d.endsWith(Sh)?(g=d.slice(0,-1),v=!0):d.startsWith(Sh)&&(g=d.slice(1),v=!0);const x=h&&h>f?h-f:void 0;return p0(a,v,g,x)};if(t){const o=t+h0,a=i;i=l=>l.startsWith(o)?a(l.slice(o.length)):p0(QI,!1,l,void 0,!0)}if(n){const o=i;i=a=>n({className:a,parseClassName:o})}return i},ZI=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let o=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",f=t.has(l);c||f?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(l)):o.push(l)}return o.length>0&&(o.sort(),i.push(...o)),i}},eO=e=>({cache:XI(e.cacheSize),parseClassName:JI(e),sortModifiers:ZI(e),postfixLookupClassGroupIds:tO(e),...BI(e)}),tO=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let i=0;i<n.length;i++)t[n[i]]=!0;return t},nO=/\s+/,rO=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(nO);let h="";for(let m=f.length-1;m>=0;m-=1){const d=f[m],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:b}=n(d);if(g){h=d+(h.length>0?" "+h:h);continue}let S=!!b,_;if(S){const M=w.substring(0,b);_=i(M);const C=_&&l[_]?i(w):void 0;C&&C!==_&&(_=C,S=!1)}else _=i(w);if(!_){if(!S){h=d+(h.length>0?" "+h:h);continue}if(_=i(w),!_){h=d+(h.length>0?" "+h:h);continue}S=!1}const E=v.length===0?"":v.length===1?v[0]:a(v).join(":"),T=x?E+Sh:E,A=T+_;if(c.indexOf(A)>-1)continue;c.push(A);const R=o(_,S);for(let M=0;M<R.length;++M){const C=R[M];c.push(T+C)}h=d+(h.length>0?" "+h:h)}return h},iO=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=Hx(n))&&(o&&(o+=" "),o+=i);return o},Hx=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Hx(e[i]))&&(n&&(n+=" "),n+=t);return n},sO=(e,...t)=>{let n,i,o,a;const l=f=>{const h=t.reduce((m,d)=>d(m),e());return n=eO(h),i=n.cache.get,o=n.cache.set,a=c,c(f)},c=f=>{const h=i(f);if(h)return h;const m=rO(f,n);return o(f,m),m};return a=l,(...f)=>a(iO(...f))},oO=[],ot=e=>{const t=n=>n[e]||oO;return t.isThemeGetter=!0,t},qx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Yx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nr=e=>aO.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),Jf=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),Kn=e=>lO.test(e),Kx=()=>!0,hO=e=>uO.test(e)&&!cO.test(e),np=()=>!1,pO=e=>fO.test(e),mO=e=>dO.test(e),gO=e=>!me(e)&&!ye(e),yO=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),vO=e=>Ar(e,Qx,np),me=e=>qx.test(e),Zr=e=>Ar(e,Jx,hO),m0=e=>Ar(e,_O,Ie),wO=e=>Ar(e,e1,Kx),xO=e=>Ar(e,Zx,np),g0=e=>Ar(e,Gx,np),bO=e=>Ar(e,Xx,mO),El=e=>Ar(e,t1,pO),ye=e=>Yx.test(e),go=e=>hi(e,Jx),kO=e=>hi(e,Zx),y0=e=>hi(e,Gx),SO=e=>hi(e,Qx),EO=e=>hi(e,Xx),Nl=e=>hi(e,t1,!0),NO=e=>hi(e,e1,!0),Ar=(e,t,n)=>{const i=qx.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},hi=(e,t,n=!1)=>{const i=Yx.exec(e);return i?i[1]?t(i[1]):n:!1},Gx=e=>e==="position"||e==="percentage",Xx=e=>e==="image"||e==="url",Qx=e=>e==="length"||e==="size"||e==="bg-size",Jx=e=>e==="length",_O=e=>e==="number",Zx=e=>e==="family-name",e1=e=>e==="number"||e==="weight",t1=e=>e==="shadow",CO=()=>{const e=ot("color"),t=ot("font"),n=ot("text"),i=ot("font-weight"),o=ot("tracking"),a=ot("leading"),l=ot("breakpoint"),c=ot("container"),f=ot("spacing"),h=ot("radius"),m=ot("shadow"),d=ot("inset-shadow"),g=ot("text-shadow"),v=ot("drop-shadow"),x=ot("blur"),w=ot("perspective"),b=ot("aspect"),S=ot("ease"),_=ot("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...T(),ye,me],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],C=()=>[ye,me,f],P=()=>[Nr,"full","auto",...C()],j=()=>[Tn,"none","subgrid",ye,me],L=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],D=()=>[Tn,"auto",ye,me],X=()=>["auto","min","max","fr",ye,me],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...C()],Z=()=>[Nr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],H=()=>[Nr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],B=()=>[Nr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],V=()=>[e,ye,me],$=()=>[...T(),y0,g0,{position:[ye,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",SO,vO,{size:[ye,me]}],K=()=>[Jf,go,Zr],J=()=>["","none","full",h,ye,me],re=()=>["",Ie,go,Zr],oe=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ie,Jf,y0,g0],de=()=>["","none",x,ye,me],xe=()=>["none",Ie,ye,me],he=()=>["none",Ie,ye,me],fe=()=>[Ie,ye,me],Se=()=>[Nr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[Kx],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[gO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",Ie],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nr,me,ye,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[yO],columns:[{columns:[Ie,me,ye,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Nr,"full","auto",c,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Nr,"auto","initial","none",me]}],grow:[{grow:["",Ie,ye,me]}],shrink:[{shrink:["",Ie,ye,me]}],order:[{order:[Tn,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[c,"screen",...Z()]}],"min-w":[{"min-w":[c,"screen","none",...Z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,go,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,NO,wO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jf,me]}],"font-family":[{font:[kO,xO,t]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ye,me]}],"line-clamp":[{"line-clamp":[Ie,"none",ye,m0]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",ye,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",ye,Zr]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Ie,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Tn,ye,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,ye,me],radial:["",ye,me],conic:[Tn,ye,me]},EO,bO]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,ye,me]}],"outline-w":[{outline:["",Ie,go,Zr]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,Nl,El]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",d,Nl,El]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Ie,Zr]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",g,Nl,El]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Ie,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:de()}],brightness:[{brightness:[Ie,ye,me]}],contrast:[{contrast:[Ie,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Nl,El]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Ie,ye,me]}],"hue-rotate":[{"hue-rotate":[Ie,ye,me]}],invert:[{invert:["",Ie,ye,me]}],saturate:[{saturate:[Ie,ye,me]}],sepia:[{sepia:["",Ie,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Ie,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",ye,me]}],ease:[{ease:["linear","initial",S,ye,me]}],delay:[{delay:[Ie,ye,me]}],animate:[{animate:["none",_,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ye,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],zoom:[{zoom:[Tn,ye,me]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,me]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Ie,go,Zr,m0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},TO=sO(CO);function je(...e){return TO(Bx(e))}function yo(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function Zf(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function IO(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw new Error("Invalid ISO8601 passed to timezone parser.");let i=e.substring(9);return i.includes("Z")||i.includes("+")||i.includes("-")?Eh(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Etc/UTC"):Eh(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function v0(e,t,n){return n1(IO(e,t),n)}function n1(e,t){let n=new Date(yo(e)),i=bo(n,e.tz),o=yo(e),a=yo(i),l=o-a,c=new Date(n.getTime()+l),f=bo(c,e.tz);if(Zf(f,e)){let d=new Date(c.getTime()-36e5),g=bo(d,e.tz);return Zf(g,e)?d:c}let h=new Date(c.getTime()+yo(e)-yo(f)),m=bo(h,e.tz);if(Zf(m,e))return h;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>h.getTime()?c:h}function bo(e,t){let n,i;try{n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=n.formatToParts(e)}catch(a){let l=a instanceof Error?a.message:String(a);throw new RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${l}`)}let o={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let a of i)(a.type==="year"||a.type==="month"||a.type==="day"||a.type==="hour"||a.type==="minute"||a.type==="second")&&(o[a.type]=parseInt(a.value,10));if(isNaN(o.year)||isNaN(o.month)||isNaN(o.day)||isNaN(o.hour)||isNaN(o.minute)||isNaN(o.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(o)}`);return o.hour===24&&(o.hour=0),{y:o.year,m:o.month,d:o.day,h:o.hour,i:o.minute,s:o.second,tz:t}}function Eh(e,t,n,i,o,a,l){return{y:e,m:t,d:n,h:i,i:o,s:a,tz:l}}var r1=[1,2,4,8,16],w0=class{constructor(e,t,n){_e(this,"pattern");_e(this,"timezone");_e(this,"mode");_e(this,"alternativeWeekdays");_e(this,"sloppyRanges");_e(this,"second");_e(this,"minute");_e(this,"hour");_e(this,"day");_e(this,"month");_e(this,"dayOfWeek");_e(this,"year");_e(this,"lastDayOfMonth");_e(this,"lastWeekday");_e(this,"nearestWeekdays");_e(this,"starDOM");_e(this,"starDOW");_e(this,"starYear");_e(this,"useAndLogic");this.pattern=e,this.timezone=t,this.mode=(n==null?void 0:n.mode)??"auto",this.alternativeWeekdays=(n==null?void 0:n.alternativeWeekdays)??!1,this.sloppyRanges=(n==null?void 0:n.sloppyRanges)??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[""],t=e.length;if(e.length<5||e.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(t):t===i)){let o=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${o} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift("0"),e.length===6&&e.push("*"),e[3].toUpperCase()==="LW"?(this.lastWeekday=!0,e[3]=""):e[3].toUpperCase().indexOf("L")>=0&&(e[3]=e[3].replace(/L/gi,""),this.lastDayOfMonth=!0),e[3]=="*"&&(this.starDOM=!0),e[6]=="*"&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith("+")&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(e[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(e[0]=e[0].replace(/\?/g,"*"),e[1]=e[1].replace(/\?/g,"*"),e[2]=e[2].replace(/\?/g,"*"),e[3]=e[3].replace(/\?/g,"*"),e[4]=e[4].replace(/\?/g,"*"),e[5]=e[5].replace(/\?/g,"*"),e[6]&&(e[6]=e[6].replace(/\?/g,"*"))),this.mode){case"5-part":e[0]="0",e[6]="*";break;case"6-part":e[6]="*";break;case"5-or-6-parts":e[6]="*";break}this.throwAtIllegalCharacters(e),this.partToArray("second",e[0],0,1),this.partToArray("minute",e[1],0,1),this.partToArray("hour",e[2],0,1),this.partToArray("day",e[3],-1,1),this.partToArray("month",e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",e[5],n,63),this.partToArray("year",e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,i){let o=this[e],a=e==="day"&&this.lastDayOfMonth,l=e==="day"&&this.lastWeekday;if(t===""&&!a&&!l)throw new TypeError("CronPattern: configuration entry "+e+" ("+t+") is empty, check for trailing spaces.");if(t==="*")return o.fill(i);let c=t.split(",");if(c.length>1)for(let f=0;f<c.length;f++)this.partToArray(e,c[f],n,i);else t.indexOf("-")!==-1&&t.indexOf("/")!==-1?this.handleRangeWithStepping(t,e,n,i):t.indexOf("-")!==-1?this.handleRange(t,e,n,i):t.indexOf("/")!==-1?this.handleStepping(t,e,n,i):t!==""&&this.handleNumber(t,e,n,i)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw new TypeError("CronPattern: configuration entry "+t+" ("+e[t]+") contains illegal characters.")}handleNumber(e,t,n,i){let o=this.extractNth(e,t),a=e.toUpperCase().includes("W");if(t!=="day"&&a)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");a&&(t="nearestWeekdays");let l=parseInt(o[0],10)+n;if(isNaN(l))throw new TypeError("CronPattern: "+t+" is not a number: '"+e+"'");this.setPart(t,l,o[1]||i)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw new TypeError("CronPattern: Invalid part specified: "+e);if(e==="dayOfWeek"){if(t===7&&(t=0),t<0||t>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+t);this.setNthWeekdayOfMonth(t,n);return}if(e==="second"||e==="minute"){if(t<0||t>=60)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="hour"){if(t<0||t>=24)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="day"||e==="nearestWeekdays"){if(t<0||t>=31)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="month"){if(t<0||t>=12)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="year"&&(t<1||t>=1e4))throw new RangeError("CronPattern: Invalid value for "+e+": "+t+" (supported range: 1-9999)");this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw new TypeError(t)}validateRange(e,t,n,i,o){if(e>t)throw new TypeError("CronPattern: From value is larger than to value: '"+o+"'");if(n!==void 0){if(n===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(n>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let o=this.extractNth(e,t),a=o[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(a===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+e+"'");let[,l,c,f]=a,h=parseInt(l,10)+n,m=parseInt(c,10)+n,d=parseInt(f,10);this.validateNotNaN(h,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(d,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(h,m,d,t,e);for(let g=h;g<=m;g+=d)this.setPart(t,g,o[1]||i)}extractNth(e,t){let n=e,i;if(n.includes("#")){if(t!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=n.split("#")[1],n=n.split("#")[0]}else if(n.toUpperCase().endsWith("L")){if(t!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",n=n.slice(0,-1)}return[n,i]}handleRange(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let o=this.extractNth(e,t),a=o[0].split("-");if(a.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+e+"'");let l=parseInt(a[0],10)+n,c=parseInt(a[1],10)+n;this.validateNotNaN(l,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(c,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(l,c,void 0,t,e);for(let f=l;f<=c;f++)this.setPart(t,f,o[1]||i)}handleStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let o=this.extractNth(e,t),a=o[0].split("/");if(a.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+e+"'");if(this.sloppyRanges)a[0]===""&&(a[0]="*");else{if(a[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(a[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let l=0;a[0]!=="*"&&(l=parseInt(a[0],10)+n);let c=parseInt(a[1],10);this.validateNotNaN(c,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[t].length-1,c,t,e);for(let f=l;f<this[t].length;f+=c)this.setPart(t,f,o[1]||i)}replaceAlphaDays(e){return e.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(e){return e.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(e){let t=e.trim().toLowerCase();if(t==="@yearly"||t==="@annually")return"0 0 1 1 *";if(t==="@monthly")return"0 0 1 * *";if(t==="@weekly")return"0 0 * * 0";if(t==="@daily"||t==="@midnight")return"0 0 * * *";if(t==="@hourly")return"0 * * * *";if(t==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return e}setNthWeekdayOfMonth(e,t){if(typeof t!="number"&&t.toUpperCase()==="L")this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|r1[t-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},ed=[31,28,31,30,31,30,31,31,30,31,30,31],We=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],dt=class i1{constructor(t,n){_e(this,"tz");_e(this,"ms");_e(this,"second");_e(this,"minute");_e(this,"hour");_e(this,"day");_e(this,"month");_e(this,"year");if(this.tz=n,t&&t instanceof Date)if(!isNaN(t))this.fromDate(t);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(t==null)this.fromDate(new Date);else if(t&&typeof t=="string")this.fromString(t);else if(t instanceof i1)this.fromCronDate(t);else throw new TypeError("CronDate: Invalid type ("+typeof t+") passed to CronDate constructor")}getLastDayOfMonth(t,n){return n!==1?ed[n]:new Date(Date.UTC(t,n+1,0)).getUTCDate()}getLastWeekday(t,n){let i=this.getLastDayOfMonth(t,n),o=new Date(Date.UTC(t,n,i)).getUTCDay();return o===0?i-2:o===6?i-1:i}getNearestWeekday(t,n,i){let o=this.getLastDayOfMonth(t,n);if(i>o)return-1;let a=new Date(Date.UTC(t,n,i)).getUTCDay();return a===0?i===o?i-2:i+1:a===6?i===1?i+2:i-1:i}isNthWeekdayOfMonth(t,n,i,o){let a=new Date(Date.UTC(t,n,i)).getUTCDay(),l=0;for(let c=1;c<=i;c++)new Date(Date.UTC(t,n,c)).getUTCDay()===a&&l++;if(o&63&&r1[l-1]&o)return!0;if(o&32){let c=this.getLastDayOfMonth(t,n);for(let f=i+1;f<=c;f++)if(new Date(Date.UTC(t,n,f)).getUTCDay()===a)return!1;return!0}return!1}fromDate(t){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes()+this.tz,this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply();else try{let n=bo(t,this.tz);this.ms=t.getMilliseconds(),this.second=n.s,this.minute=n.i,this.hour=n.h,this.day=n.d,this.month=n.m-1,this.year=n.y}catch(n){let i=n instanceof Error?n.message:String(n);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${i}`)}else this.ms=t.getMilliseconds(),this.second=t.getSeconds(),this.minute=t.getMinutes(),this.hour=t.getHours(),this.day=t.getDate(),this.month=t.getMonth(),this.year=t.getFullYear()}fromCronDate(t){this.tz=t.tz,this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.ms=t.ms}apply(){if(this.month>11||this.month<0||this.day>ed[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let t=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),!0}else return!1}fromString(t){if(typeof this.tz=="number"){let n=v0(t);this.ms=n.getUTCMilliseconds(),this.second=n.getUTCSeconds(),this.minute=n.getUTCMinutes(),this.hour=n.getUTCHours(),this.day=n.getUTCDate(),this.month=n.getUTCMonth(),this.year=n.getUTCFullYear(),this.apply()}else return this.fromDate(v0(t,this.tz))}findNext(t,n,i,o){return this._findMatch(t,n,i,o,1)}_findMatch(t,n,i,o,a){let l=this[n],c;i.lastDayOfMonth&&(c=this.getLastDayOfMonth(this.year,this.month));let f=!i.starDOW&&n=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,h=this[n]+o,m=a===1?d=>d<i[n].length:d=>d>=0;for(let d=h;m(d);d+=a){let g=i[n][d];if(n==="day"&&!g){for(let v=0;v<i.nearestWeekdays.length;v++)if(i.nearestWeekdays[v]){let x=this.getNearestWeekday(this.year,this.month,v-o);if(x===-1)continue;if(x===d-o){g=1;break}}}if(n==="day"&&i.lastWeekday){let v=this.getLastWeekday(this.year,this.month);d-o===v&&(g=1)}if(n==="day"&&i.lastDayOfMonth&&d-o==c&&(g=1),n==="day"&&!i.starDOW){let v=i.dayOfWeek[(f+(d-o-1))%7];if(v&&v&63)v=this.isNthWeekdayOfMonth(this.year,this.month,d-o,v)?1:0;else if(v)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${v}`);i.useAndLogic?g=g&&v:!t.domAndDow&&!i.starDOM?g=g||v:g=g&&v}if(g)return this[n]=d-o,l!==this[n]?2:1}return 3}recurse(t,n,i){if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let a=-1;for(let l=this.year+1;l<t.year.length&&l<1e4;l++)if(t.year[l]===1){a=l;break}if(a===-1)return null;this.year=a,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let o=this.findNext(n,We[i][0],t,We[i][2]);if(o>1){let a=i+1;for(;a<We.length;)this[We[a][0]]=-We[a][2],a++;if(o===3){if(this[We[i][1]]++,this[We[i][0]]=-We[i][2],this.apply(),i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=t.year.length)return null}return this.recurse(t,n,0)}else if(this.apply())return this.recurse(t,n,i-1)}return i+=1,i>=We.length?this:(t.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(t,n,i)}increment(t,n,i){return this.second+=n.interval!==void 0&&n.interval>1&&i?n.interval:1,this.ms=0,this.apply(),this.recurse(t,n,0)}decrement(t,n){return this.second-=n.interval!==void 0&&n.interval>1?n.interval:1,this.ms=0,this.apply(),this.recurseBackward(t,n,0,0)}recurseBackward(t,n,i,o=0){if(o>1e4)return null;if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let l=-1;for(let c=this.year-1;c>=0;c--)if(t.year[c]===1){l=c;break}if(l===-1)return null;this.year=l,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let a=this.findPrevious(n,We[i][0],t,We[i][2]);if(a>1){let l=i+1;for(;l<We.length;){let c=We[l][0],f=We[l][2],h=this.getMaxPatternValue(c,t,f);this[c]=h,l++}if(a===3){if(this[We[i][1]]--,i===0){let m=this.getLastDayOfMonth(this.year,this.month);this.day>m&&(this.day=m)}if(i===1)if(this.day<=0)this.day=1;else{let m=this.year,d=this.month;for(;d<0;)d+=12,m--;for(;d>11;)d-=12,m++;let g=d!==1?ed[d]:new Date(Date.UTC(m,d+1,0)).getUTCDate();this.day>g&&(this.day=g)}this.apply();let c=We[i][0],f=We[i][2],h=this.getMaxPatternValue(c,t,f);if(c==="day"){let m=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(h,m)}else this[c]=h;if(this.apply(),i===0){let m=We[1][2],d=this.getMaxPatternValue("day",t,m),g=this.getLastDayOfMonth(this.year,this.month),v=Math.min(d,g);v!==this.day&&(this.day=v,this.hour=this.getMaxPatternValue("hour",t,We[2][2]),this.minute=this.getMaxPatternValue("minute",t,We[3][2]),this.second=this.getMaxPatternValue("second",t,We[4][2]))}if(i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(t,n,0,o+1)}else if(this.apply())return this.recurseBackward(t,n,i-1,o+1)}return i+=1,i>=We.length?this:this.year<0?null:this.recurseBackward(t,n,i,o+1)}getMaxPatternValue(t,n,i){if(t==="day"&&n.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(t==="day"&&!n.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let o=n[t].length-1;o>=0;o--)if(n[t][o])return o-i;return n[t].length-1-i}findPrevious(t,n,i,o){return this._findMatch(t,n,i,o,-1)}getDate(t){return t||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):n1(Eh(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(t,n){if(!t.starYear&&(this.year<0||this.year>=t.year.length||t.year[this.year]===0))return!1;for(let i=0;i<We.length;i++){let o=We[i][0],a=We[i][2],l=this[o];if(l+a<0||l+a>=t[o].length)return!1;let c=t[o][l+a];if(o==="day"){if(!c){for(let f=0;f<t.nearestWeekdays.length;f++)if(t.nearestWeekdays[f]){let h=this.getNearestWeekday(this.year,this.month,f-a);if(h!==-1&&h===l){c=1;break}}}if(t.lastWeekday){let f=this.getLastWeekday(this.year,this.month);l===f&&(c=1)}if(t.lastDayOfMonth){let f=this.getLastDayOfMonth(this.year,this.month);l===f&&(c=1)}if(!t.starDOW){let f=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),h=t.dayOfWeek[(f+(l-1))%7];h&&h&63&&(h=this.isNthWeekdayOfMonth(this.year,this.month,l,h)?1:0),t.useAndLogic?c=c&&h:!n.domAndDow&&!t.starDOM?c=c||h:c=c&&h}}if(!c)return!1}return!0}};function OO(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused===void 0?!1:e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch===void 0?!1:e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref===void 0?!1:e.unref,e.mode=e.mode===void 0?"auto":e.mode,e.alternativeWeekdays=e.alternativeWeekdays===void 0?!1:e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges===void 0?!1:e.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(e.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(e.startAt&&(e.startAt=new dt(e.startAt,e.timezone)),e.stopAt&&(e.stopAt=new dt(e.stopAt,e.timezone)),e.interval!==null){if(isNaN(e.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(e.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(e.utcOffset<-870||e.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(e.utcOffset!==void 0&&e.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(e.unref!==!0&&e.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return e}function ko(e){return Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function}function PO(e){return ko(e)}function AO(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var x0=30*1e3,_l=[],MO=class{constructor(e,t,n){_e(this,"name");_e(this,"options");_e(this,"_states");_e(this,"fn");let i,o;if(ko(t))o=t;else if(typeof t=="object")i=t;else if(t!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(ko(n))o=n;else if(typeof n=="object")i=n;else if(n!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=i==null?void 0:i.name,this.options=OO(i),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:i?i.maxRuns:void 0,paused:i?i.paused:!1,pattern:new w0("* * * * *",void 0,{mode:"auto"})},e&&(e instanceof Date||typeof e=="string"&&e.indexOf(":")>0)?this._states.once=new dt(e,this.getTz()):this._states.pattern=new w0(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(_l.find(a=>a.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");_l.push(this)}return o!==void 0&&PO(o)&&(this.fn=o,this.schedule()),this}getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,"next")}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,"previous")}_enumerateRuns(e,t,n){let i=[],o=t?new dt(t,this.getTz()):null,a=n==="next"?this._next:this._previous;for(;e--;){let l=a.call(this,o);if(!l)break;let c=l.getDate(!1);i.push(this.applyDayOffset(c)),o=l}return i}match(e){if(this._states.once){let n=new dt(e,this.getTz());n.ms=0;let i=new dt(this._states.once,this.getTz());return i.ms=0,n.getTime()===i.getTime()}let t=new dt(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,i=!this._states.kill;return t&&n&&i&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof dt||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new dt(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=_l.indexOf(this);e>=0&&_l.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>x0&&(t=x0),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&AO(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new dt(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(t){if(ko(this.options.catch))try{this.options.catch(t,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new dt(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),i=this._states.blocking&&this.options.protect;n&&!i?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&i&&ko(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new dt(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let i=this._states.once||new dt(e,this.getTz());return!n&&i!==this._states.once&&(i=i.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||i===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&i.getTime()>=this.options.stopAt.getTime()?null:i}_previous(e){let t=new dt(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new dt(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new dt(void 0,this.getTz()),i=e;if(this.options.startAt.getTime()<=n.getTime()){i=this.options.startAt;let o=i.getTime()+this.options.interval*1e3;for(;o<=n.getTime();)i=new dt(i,this.getTz()).increment(this._states.pattern,this.options,!0),o=i.getTime()+this.options.interval*1e3;t=!0}return i===null&&(i=void 0),[i,t]}};function RO(e){var i,o;const t=(i=e.nodes)==null?void 0:i.find(a=>a.type==="trigger.cron"),n=(o=t==null?void 0:t.config)==null?void 0:o.cron;return typeof n=="string"?n:null}function LO(e,t=new Date){try{return new MO(e).nextRun(t)}catch{return null}}function jO(e){const t=Math.round(e/6e4);if(t<1)return"<1m";if(t<60)return`${t}m`;const n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function DO(e,t=new Date){const n=LO(e,t);if(!n)return null;const i=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),o=n.toLocaleString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}),a=jO(n.getTime()-t.getTime());return{short:i,title:`Next run ${o} (in ${a}) · cron ${e}`}}function b0(e){return e?e.replace(/^trigger\./,""):""}const $O=200,zO=560;function FO({liveConnected:e,workflows:t=[],selected:n,onSelect:i,onRun:o,version:a}){const[l,c]=O.useState(248),[f,h]=O.useState(!1),m=O.useCallback(d=>{d.preventDefault(),h(!0)},[]);return O.useEffect(()=>{if(!f)return;const d=v=>c(Math.min(zO,Math.max($O,v.clientX))),g=()=>h(!1);return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[f]),N.jsxs("aside",{className:"relative shrink-0 bg-bg border-r border-border flex flex-col",style:{width:l},children:[N.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[N.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),N.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),a&&N.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",a]})]}),N.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),N.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their ",N.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover → ",N.jsx("span",{className:"font-mono text-fg",children:"▶ run"}),", or select one and use the header."]}),N.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 space-y-0.5",children:[t.length===0&&N.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),t.map(d=>{const g=RO(d),v=g?DO(g):null;return N.jsxs("div",{"data-testid":"workflow-item",className:je("group w-full px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px] cursor-pointer",d.name===n?"bg-muted":"hover:bg-muted text-mutedfg"),onClick:()=>i==null?void 0:i(d.name),title:d.title??d.name,children:[N.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",d.name===n?"bg-ok":"bg-border")}),N.jsx("span",{className:"truncate",children:d.title??d.name}),N.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[v?N.jsxs("span",{"data-testid":"next-run",title:v.title,className:"text-[10px] text-mutedfg font-mono whitespace-nowrap",children:["next ",v.short]}):b0(d.triggerType)&&N.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:b0(d.triggerType)}),d.runnable&&o&&N.jsx("button",{"data-testid":"run-workflow",title:`Run ${d.title??d.name}${d.needsPayload?" (needs a payload — use the header Run…)":""}`,onClick:x=>{x.stopPropagation(),d.needsPayload?i==null||i(d.name):o(d.name)},className:"text-[11px] font-mono text-mutedfg hover:text-ok px-1 rounded opacity-0 group-hover:opacity-100",children:"▶ run"})]})]},d.name)})]}),N.jsxs("div",{className:"p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx("span",{className:je("size-1.5 rounded-full",e?"bg-ok":"bg-border")}),e?"server connected":"offline"]}),N.jsx("div",{className:"mt-1 font-mono",children:"surfaces are the source of truth"})]}),N.jsx("div",{"data-testid":"sidebar-resizer",onMouseDown:m,className:je("absolute top-0 right-0 h-full w-1 cursor-col-resize hover:bg-primary/40",f&&"bg-primary/60")})]})}function BO({workflow:e,selected:t,dryRun:n,paused:i,pauseControllable:o,onTogglePause:a,onLoadYaml:l,onRun:c,onToggleRuns:f,onToggleCache:h,runsOpen:m,cacheOpen:d}){const g=(t==null?void 0:t.title)??(e==null?void 0:e.name)??"no workflow loaded",v=e?`workflows/${e.name}.yaml`:"",[x,w]=O.useState(!1),[b,S]=O.useState(!1),[_,E]=O.useState(null),T=O.useRef(null),A=O.useRef(null),R=O.useCallback(()=>{var L;const j=((L=T.current)==null?void 0:L.value)??"";j.trim()&&(l(j),w(!1))},[l]),M=O.useCallback(()=>{t!=null&&t.needsPayload?(E(null),S(!0)):c()},[t,c]),C=O.useCallback(()=>{var D;const j=(((D=A.current)==null?void 0:D.value)??"").trim();if(!j){E('enter a payload, e.g. { "key": "PD-109" }');return}let L;try{L=JSON.parse(j)}catch{E("not valid JSON");return}c(L),S(!1)},[c]),P="text-[12px] px-2.5 py-1 rounded transition-colors";return N.jsxs(N.Fragment,{children:[N.jsxs("header",{className:je("h-12 shrink-0 bg-bg border-b flex items-center px-4 gap-3",n===!1?"border-fail":"border-border"),children:[o&&N.jsx("button",{"data-testid":"topbar-pause",onClick:a,title:i?"Paused — scheduled runs are not firing. Click to resume the platform.":"Running — scheduled workflows fire on their cron. Click to pause the platform.",className:je("text-[11px] font-mono font-bold px-2 py-1 rounded shrink-0 transition-colors",i?"bg-fail/20 text-fail hover:bg-fail/30":"bg-ok/15 text-ok hover:bg-ok/25"),children:i?"▶ Paused":"❚❚ Running"}),n!==void 0&&N.jsx("span",{"data-testid":"run-mode",title:n?"Dry-run: writes are blocked + logged, nothing is sent":"LIVE: writes are real (comments, descriptions, Jira/Confluence)",className:je("text-[10px] font-mono font-bold px-2 py-1 rounded shrink-0",n?"bg-run/20 text-run":"bg-fail/20 text-fail"),children:n?"DRY-RUN":"● LIVE"}),N.jsx("h1",{className:"font-semibold tracking-tight truncate max-w-[35%]",title:g,children:g}),v&&N.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded shrink-0",children:v}),N.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(t==null?void 0:t.runnable)&&N.jsxs("button",{"data-testid":"topbar-run",onClick:M,className:je(P,"bg-ok/15 text-ok hover:bg-ok/25 font-medium"),children:["▶ Run",t.needsPayload?"…":""]}),N.jsx("button",{"data-testid":"topbar-runs",onClick:f,className:je(P,m?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Runs"}),N.jsx("button",{"data-testid":"topbar-cache",onClick:h,className:je(P,d?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Cache"}),N.jsx("button",{onClick:()=>w(!0),className:je(P,"bg-muted hover:bg-border text-fg"),children:"Paste YAML"})]})]}),b&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",onClick:()=>S(!1),children:N.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[420px] max-w-[90vw]",onClick:j=>j.stopPropagation(),children:[N.jsxs("span",{className:"font-semibold text-sm",children:["Run ",g," — trigger payload"]}),N.jsx("p",{className:"text-[12px] text-mutedfg",children:"This is a per-item sub-workflow; give it the item to process, e.g. an idea key."}),N.jsx("textarea",{ref:A,defaultValue:'{ "key": "PD-109" }',spellCheck:!1,className:"w-full h-24 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary"}),_&&N.jsx("span",{className:"text-[11px] text-fail",children:_}),N.jsxs("div",{className:"flex justify-end gap-2",children:[N.jsx("button",{onClick:()=>S(!1),className:je(P,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),N.jsx("button",{onClick:C,className:je(P,"bg-ok/20 text-ok hover:bg-ok/30 font-medium"),children:"▶ Run"})]})]})}),x&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:N.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[520px] max-w-[90vw]",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),N.jsx("button",{onClick:()=>w(!1),className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),N.jsx("textarea",{ref:T,spellCheck:!1,placeholder:"Paste your workflow YAML here...",className:"w-full h-64 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary"}),N.jsxs("div",{className:"flex justify-end gap-2",children:[N.jsx("button",{onClick:()=>w(!1),className:je(P,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),N.jsx("button",{onClick:R,className:"text-[12px] px-3 py-1.5 rounded bg-primary hover:opacity-90 text-white transition-opacity",children:"Apply"})]})]})})]})}function k0({status:e}){return N.jsx("span",{"data-testid":"status-dot","data-status":e,className:je("size-1.5 rounded-full flex-shrink-0",e==="idle"&&"bg-border",e==="running"&&"bg-run pulse-dot",e==="success"&&"bg-ok",e==="failed"&&"bg-fail")})}function S0({data:e,selected:t}){const{node:n,liveStatus:i="idle"}=e;if(n.type==="agent.run"){const a=i==="running";return N.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className:je("rounded-lg border overflow-hidden cursor-pointer","bg-agentbg border-agent/40",a?"agent-ring agent-live":"agent-ring"),style:{width:220,height:60},onClick:()=>{var l;return(l=e.onNodeClick)==null?void 0:l.call(e,n)},children:[N.jsx("div",{className:"h-1 bg-agent"}),N.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx(k0,{status:i}),N.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),N.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),N.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),N.jsx(Or,{type:"target",position:ke.Left,className:"!bg-agent/50"}),N.jsx(Or,{type:"source",position:ke.Right,className:"!bg-agent/50"})]})}return N.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className:je("rounded-lg border overflow-hidden cursor-pointer bg-bg border-border shadow-sm",t&&"ring-2 ring-fg/20"),style:{width:n.type==="task.branch"||n.type.startsWith("trigger.")?140:220,height:60},onClick:()=>{var a;return(a=e.onNodeClick)==null?void 0:a.call(e,n)},children:[N.jsx("div",{className:"h-1 bg-mutedfg/30"}),N.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx(k0,{status:i}),N.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),N.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),N.jsx(Or,{type:"target",position:ke.Left,className:"!bg-mutedfg/50"}),N.jsx(Or,{type:"source",position:ke.Right,className:"!bg-mutedfg/50"})]})}var td,E0;function rp(){if(E0)return td;E0=1;var e="\0",t="\0",n="";class i{constructor(m){_e(this,"_isDirected",!0);_e(this,"_isMultigraph",!1);_e(this,"_isCompound",!1);_e(this,"_label");_e(this,"_defaultNodeLabelFn",()=>{});_e(this,"_defaultEdgeLabelFn",()=>{});_e(this,"_nodes",{});_e(this,"_in",{});_e(this,"_preds",{});_e(this,"_out",{});_e(this,"_sucs",{});_e(this,"_edgeObjs",{});_e(this,"_edgeLabels",{});_e(this,"_nodeCount",0);_e(this,"_edgeCount",0);_e(this,"_parent");_e(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(d=>Object.keys(m._in[d]).length===0)}sinks(){var m=this;return this.nodes().filter(d=>Object.keys(m._out[d]).length===0)}setNodes(m,d){var g=arguments,v=this;return m.forEach(function(x){g.length>1?v.setNode(x,d):v.setNode(x)}),this}setNode(m,d){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=d),this):(this._nodes[m]=arguments.length>1?d:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var d=this;if(Object.hasOwn(this._nodes,m)){var g=v=>d.removeEdge(d._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){d.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(g),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=t;else{d+="";for(var g=d;g!==void 0;g=this.parent(g))if(g===m)throw new Error("Setting "+d+" as parent of "+m+" would create a cycle");this.setNode(d)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=d,this._children[d][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var d=this._parent[m];if(d!==t)return d}}children(m=t){if(this._isCompound){var d=this._children[m];if(d)return Object.keys(d)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var d=this._preds[m];if(d)return Object.keys(d)}successors(m){var d=this._sucs[m];if(d)return Object.keys(d)}neighbors(m){var d=this.predecessors(m);if(d){const v=new Set(d);for(var g of this.successors(m))v.add(g);return Array.from(v.values())}}isLeaf(m){var d;return this.isDirected()?d=this.successors(m):d=this.neighbors(m),d.length===0}filterNodes(m){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var g=this;Object.entries(this._nodes).forEach(function([w,b]){m(w)&&d.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){d.hasNode(w.v)&&d.hasNode(w.w)&&d.setEdge(w,g.edge(w))});var v={};function x(w){var b=g.parent(w);return b===void 0||d.hasNode(b)?(v[w]=b,b):b in v?v[b]:x(b)}return this._isCompound&&d.nodes().forEach(w=>d.setParent(w,x(w))),d}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,d){var g=this,v=arguments;return m.reduce(function(x,w){return v.length>1?g.setEdge(x,w,d):g.setEdge(x,w),w}),this}setEdge(){var m,d,g,v,x=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,d=w.w,g=w.name,arguments.length===2&&(v=arguments[1],x=!0)):(m=w,d=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],x=!0)),m=""+m,d=""+d,g!==void 0&&(g=""+g);var b=l(this._isDirected,m,d,g);if(Object.hasOwn(this._edgeLabels,b))return x&&(this._edgeLabels[b]=v),this;if(g!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(d),this._edgeLabels[b]=x?v:this._defaultEdgeLabelFn(m,d,g);var S=c(this._isDirected,m,d,g);return m=S.v,d=S.w,Object.freeze(S),this._edgeObjs[b]=S,o(this._preds[d],m),o(this._sucs[m],d),this._in[d][b]=S,this._out[m][b]=S,this._edgeCount++,this}edge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g),x=this._edgeObjs[v];return x&&(m=x.v,d=x.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[d],m),a(this._sucs[m],d),delete this._in[d][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,d){var g=this._in[m];if(g){var v=Object.values(g);return d?v.filter(x=>x.v===d):v}}outEdges(m,d){var g=this._out[m];if(g){var v=Object.values(g);return d?v.filter(x=>x.w===d):v}}nodeEdges(m,d){var g=this.inEdges(m,d);if(g)return g.concat(this.outEdges(m,d))}}function o(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,d,g){var v=""+m,x=""+d;if(!h&&v>x){var w=v;v=x,x=w}return v+n+x+n+(g===void 0?e:g)}function c(h,m,d,g){var v=""+m,x=""+d;if(!h&&v>x){var w=v;v=x,x=w}var b={v,w:x};return g&&(b.name=g),b}function f(h,m){return l(h,m.v,m.w,m.name)}return td=i,td}var nd,N0;function VO(){return N0||(N0=1,nd="2.2.4"),nd}var rd,_0;function WO(){return _0||(_0=1,rd={Graph:rp(),version:VO()}),rd}var id,C0;function UO(){if(C0)return id;C0=1;var e=rp();id={write:t,read:o};function t(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:i(a)};return a.graph()!==void 0&&(l.value=structuredClone(a.graph())),l}function n(a){return a.nodes().map(function(l){var c=a.node(l),f=a.parent(l),h={v:l};return c!==void 0&&(h.value=c),f!==void 0&&(h.parent=f),h})}function i(a){return a.edges().map(function(l){var c=a.edge(l),f={v:l.v,w:l.w};return l.name!==void 0&&(f.name=l.name),c!==void 0&&(f.value=c),f})}function o(a){var l=new e(a.options).setGraph(a.value);return a.nodes.forEach(function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),a.edges.forEach(function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return id}var sd,T0;function HO(){if(T0)return sd;T0=1,sd=e;function e(t){var n={},i=[],o;function a(l){Object.hasOwn(n,l)||(n[l]=!0,o.push(l),t.successors(l).forEach(a),t.predecessors(l).forEach(a))}return t.nodes().forEach(function(l){o=[],a(l),o.length&&i.push(o)}),i}return sd}var od,I0;function s1(){if(I0)return od;I0=1;class e{constructor(){_e(this,"_arr",[]);_e(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var o=this._keyIndices;if(n=String(n),!Object.hasOwn(o,n)){var a=this._arr,l=a.length;return o[n]=l,a.push({key:n,priority:i}),this._decrease(l),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var o=this._keyIndices[n];if(i>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+i);this._arr[o].priority=i,this._decrease(o)}_heapify(n){var i=this._arr,o=2*n,a=o+1,l=n;o<i.length&&(l=i[o].priority<i[l].priority?o:l,a<i.length&&(l=i[a].priority<i[l].priority?a:l),l!==n&&(this._swap(n,l),this._heapify(l)))}_decrease(n){for(var i=this._arr,o=i[n].priority,a;n!==0&&(a=n>>1,!(i[a].priority<o));)this._swap(n,a),n=a}_swap(n,i){var o=this._arr,a=this._keyIndices,l=o[n],c=o[i];o[n]=c,o[i]=l,a[c.key]=n,a[l.key]=i}}return od=e,od}var ad,O0;function o1(){if(O0)return ad;O0=1;var e=s1();ad=n;var t=()=>1;function n(o,a,l,c){return i(o,String(a),l||t,c||function(f){return o.outEdges(f)})}function i(o,a,l,c){var f={},h=new e,m,d,g=function(v){var x=v.v!==m?v.v:v.w,w=f[x],b=l(v),S=d.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+b);S<w.distance&&(w.distance=S,w.predecessor=m,h.decrease(x,S))};for(o.nodes().forEach(function(v){var x=v===a?0:Number.POSITIVE_INFINITY;f[v]={distance:x},h.add(v,x)});h.size()>0&&(m=h.removeMin(),d=f[m],d.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(g);return f}return ad}var ld,P0;function qO(){if(P0)return ld;P0=1;var e=o1();ld=t;function t(n,i,o){return n.nodes().reduce(function(a,l){return a[l]=e(n,l,i,o),a},{})}return ld}var ud,A0;function a1(){if(A0)return ud;A0=1,ud=e;function e(t){var n=0,i=[],o={},a=[];function l(c){var f=o[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),t.successors(c).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(f.lowlink=Math.min(f.lowlink,o[d].index)):(l(d),f.lowlink=Math.min(f.lowlink,o[d].lowlink))}),f.lowlink===f.index){var h=[],m;do m=i.pop(),o[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return t.nodes().forEach(function(c){Object.hasOwn(o,c)||l(c)}),a}return ud}var cd,M0;function YO(){if(M0)return cd;M0=1;var e=a1();cd=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return cd}var fd,R0;function KO(){if(R0)return fd;R0=1,fd=t;var e=()=>1;function t(i,o,a){return n(i,o||e,a||function(l){return i.outEdges(l)})}function n(i,o,a){var l={},c=i.nodes();return c.forEach(function(f){l[f]={},l[f][f]={distance:0},c.forEach(function(h){f!==h&&(l[f][h]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(h){var m=h.v===f?h.w:h.v,d=o(h);l[f][m]={distance:d,predecessor:f}})}),c.forEach(function(f){var h=l[f];c.forEach(function(m){var d=l[m];c.forEach(function(g){var v=d[f],x=h[g],w=d[g],b=v.distance+x.distance;b<w.distance&&(w.distance=b,w.predecessor=x.predecessor)})})}),l}return fd}var dd,L0;function l1(){if(L0)return dd;L0=1;function e(n){var i={},o={},a=[];function l(c){if(Object.hasOwn(o,c))throw new t;Object.hasOwn(i,c)||(o[c]=!0,i[c]=!0,n.predecessors(c).forEach(l),delete o[c],a.push(c))}if(n.sinks().forEach(l),Object.keys(i).length!==n.nodeCount())throw new t;return a}class t extends Error{constructor(){super(...arguments)}}return dd=e,e.CycleException=t,dd}var hd,j0;function GO(){if(j0)return hd;j0=1;var e=l1();hd=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return hd}var pd,D0;function u1(){if(D0)return pd;D0=1,pd=e;function e(o,a,l){Array.isArray(a)||(a=[a]);var c=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),f=l==="post"?t:n,h=[],m={};return a.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);f(d,c,m,h)}),h}function t(o,a,l,c){for(var f=[[o,!1]];f.length>0;){var h=f.pop();h[1]?c.push(h[0]):Object.hasOwn(l,h[0])||(l[h[0]]=!0,f.push([h[0],!0]),i(a(h[0]),m=>f.push([m,!1])))}}function n(o,a,l,c){for(var f=[o];f.length>0;){var h=f.pop();Object.hasOwn(l,h)||(l[h]=!0,c.push(h),i(a(h),m=>f.push(m)))}}function i(o,a){for(var l=o.length;l--;)a(o[l],l,o);return o}return pd}var md,$0;function XO(){if($0)return md;$0=1;var e=u1();md=t;function t(n,i){return e(n,i,"post")}return md}var gd,z0;function QO(){if(z0)return gd;z0=1;var e=u1();gd=t;function t(n,i){return e(n,i,"pre")}return gd}var yd,F0;function JO(){if(F0)return yd;F0=1;var e=rp(),t=s1();yd=n;function n(i,o){var a=new e,l={},c=new t,f;function h(d){var g=d.v===f?d.w:d.v,v=c.priority(g);if(v!==void 0){var x=o(d);x<v&&(l[g]=f,c.decrease(g,x))}}if(i.nodeCount()===0)return a;i.nodes().forEach(function(d){c.add(d,Number.POSITIVE_INFINITY),a.setNode(d)}),c.decrease(i.nodes()[0],0);for(var m=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(l,f))a.setEdge(f,l[f]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(f).forEach(h)}return a}return yd}var vd,B0;function ZO(){return B0||(B0=1,vd={components:HO(),dijkstra:o1(),dijkstraAll:qO(),findCycles:YO(),floydWarshall:KO(),isAcyclic:GO(),postorder:XO(),preorder:QO(),prim:JO(),tarjan:a1(),topsort:l1()}),vd}var wd,V0;function yn(){if(V0)return wd;V0=1;var e=WO();return wd={Graph:e.Graph,json:UO(),alg:ZO(),version:e.version},wd}var xd,W0;function eP(){if(W0)return xd;W0=1;class e{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,a=o._prev;if(a!==o)return t(a),a}enqueue(o){let a=this._sentinel;o._prev&&o._next&&t(o),o._next=a._next,a._next._prev=o,a._next=o,o._prev=a}toString(){let o=[],a=this._sentinel,l=a._prev;for(;l!==a;)o.push(JSON.stringify(l,n)),l=l._prev;return"["+o.join(", ")+"]"}}function t(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function n(i,o){if(i!=="_next"&&i!=="_prev")return o}return xd=e,xd}var bd,U0;function tP(){if(U0)return bd;U0=1;let e=yn().Graph,t=eP();bd=i;let n=()=>1;function i(h,m){if(h.nodeCount()<=1)return[];let d=l(h,m||n);return o(d.graph,d.buckets,d.zeroIdx).flatMap(v=>h.outEdges(v.v,v.w))}function o(h,m,d){let g=[],v=m[m.length-1],x=m[0],w;for(;h.nodeCount();){for(;w=x.dequeue();)a(h,m,d,w);for(;w=v.dequeue();)a(h,m,d,w);if(h.nodeCount()){for(let b=m.length-2;b>0;--b)if(w=m[b].dequeue(),w){g=g.concat(a(h,m,d,w,!0));break}}}return g}function a(h,m,d,g,v){let x=v?[]:void 0;return h.inEdges(g.v).forEach(w=>{let b=h.edge(w),S=h.node(w.v);v&&x.push({v:w.v,w:w.w}),S.out-=b,c(m,d,S)}),h.outEdges(g.v).forEach(w=>{let b=h.edge(w),S=w.w,_=h.node(S);_.in-=b,c(m,d,_)}),h.removeNode(g.v),x}function l(h,m){let d=new e,g=0,v=0;h.nodes().forEach(b=>{d.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let S=d.edge(b.v,b.w)||0,_=m(b),E=S+_;d.setEdge(b.v,b.w,E),v=Math.max(v,d.node(b.v).out+=_),g=Math.max(g,d.node(b.w).in+=_)});let x=f(v+g+3).map(()=>new t),w=g+1;return d.nodes().forEach(b=>{c(x,w,d.node(b))}),{graph:d,buckets:x,zeroIdx:w}}function c(h,m,d){d.out?d.in?h[d.out-d.in+m].enqueue(d):h[h.length-1].enqueue(d):h[0].enqueue(d)}function f(h){const m=[];for(let d=0;d<h;d++)m.push(d);return m}return bd}var kd,H0;function nt(){if(H0)return kd;H0=1;let e=yn().Graph;kd={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:R,maxRank:x,normalizeRanks:f,notime:S,partition:w,pick:A,predecessorWeights:a,range:T,removeEmptyRanks:h,simplify:n,successorWeights:o,time:b,uniqueId:E,zipObject:M};function t(C,P,j,L){for(var D=L;C.hasNode(D);)D=E(L);return j.dummy=P,C.setNode(D,j),D}function n(C){let P=new e().setGraph(C.graph());return C.nodes().forEach(j=>P.setNode(j,C.node(j))),C.edges().forEach(j=>{let L=P.edge(j.v,j.w)||{weight:0,minlen:1},D=C.edge(j);P.setEdge(j.v,j.w,{weight:L.weight+D.weight,minlen:Math.max(L.minlen,D.minlen)})}),P}function i(C){let P=new e({multigraph:C.isMultigraph()}).setGraph(C.graph());return C.nodes().forEach(j=>{C.children(j).length||P.setNode(j,C.node(j))}),C.edges().forEach(j=>{P.setEdge(j,C.edge(j))}),P}function o(C){let P=C.nodes().map(j=>{let L={};return C.outEdges(j).forEach(D=>{L[D.w]=(L[D.w]||0)+C.edge(D).weight}),L});return M(C.nodes(),P)}function a(C){let P=C.nodes().map(j=>{let L={};return C.inEdges(j).forEach(D=>{L[D.v]=(L[D.v]||0)+C.edge(D).weight}),L});return M(C.nodes(),P)}function l(C,P){let j=C.x,L=C.y,D=P.x-j,X=P.y-L,z=C.width/2,G=C.height/2;if(!D&&!X)throw new Error("Not possible to find intersection inside of the rectangle");let Y,Z;return Math.abs(X)*z>Math.abs(D)*G?(X<0&&(G=-G),Y=G*D/X,Z=G):(D<0&&(z=-z),Y=z,Z=z*X/D),{x:j+Y,y:L+Z}}function c(C){let P=T(x(C)+1).map(()=>[]);return C.nodes().forEach(j=>{let L=C.node(j),D=L.rank;D!==void 0&&(P[D][L.order]=j)}),P}function f(C){let P=C.nodes().map(L=>{let D=C.node(L).rank;return D===void 0?Number.MAX_VALUE:D}),j=v(Math.min,P);C.nodes().forEach(L=>{let D=C.node(L);Object.hasOwn(D,"rank")&&(D.rank-=j)})}function h(C){let P=C.nodes().map(z=>C.node(z).rank),j=v(Math.min,P),L=[];C.nodes().forEach(z=>{let G=C.node(z).rank-j;L[G]||(L[G]=[]),L[G].push(z)});let D=0,X=C.graph().nodeRankFactor;Array.from(L).forEach((z,G)=>{z===void 0&&G%X!==0?--D:z!==void 0&&D&&z.forEach(Y=>C.node(Y).rank+=D)})}function m(C,P,j,L){let D={width:0,height:0};return arguments.length>=4&&(D.rank=j,D.order=L),t(C,"border",D,P)}function d(C,P=g){const j=[];for(let L=0;L<C.length;L+=P){const D=C.slice(L,L+P);j.push(D)}return j}const g=65535;function v(C,P){if(P.length>g){const j=d(P);return C.apply(null,j.map(L=>C.apply(null,L)))}else return C.apply(null,P)}function x(C){const j=C.nodes().map(L=>{let D=C.node(L).rank;return D===void 0?Number.MIN_VALUE:D});return v(Math.max,j)}function w(C,P){let j={lhs:[],rhs:[]};return C.forEach(L=>{P(L)?j.lhs.push(L):j.rhs.push(L)}),j}function b(C,P){let j=Date.now();try{return P()}finally{console.log(C+" time: "+(Date.now()-j)+"ms")}}function S(C,P){return P()}let _=0;function E(C){var P=++_;return C+(""+P)}function T(C,P,j=1){P==null&&(P=C,C=0);let L=X=>X<P;j<0&&(L=X=>P<X);const D=[];for(let X=C;L(X);X+=j)D.push(X);return D}function A(C,P){const j={};for(const L of P)C[L]!==void 0&&(j[L]=C[L]);return j}function R(C,P){let j=P;return typeof P=="string"&&(j=L=>L[P]),Object.entries(C).reduce((L,[D,X])=>(L[D]=j(X,D),L),{})}function M(C,P){return C.reduce((j,L,D)=>(j[L]=P[D],j),{})}return kd}var Sd,q0;function nP(){if(q0)return Sd;q0=1;let e=tP(),t=nt().uniqueId;Sd={run:n,undo:o};function n(a){(a.graph().acyclicer==="greedy"?e(a,c(a)):i(a)).forEach(f=>{let h=a.edge(f);a.removeEdge(f),h.forwardName=f.name,h.reversed=!0,a.setEdge(f.w,f.v,h,t("rev"))});function c(f){return h=>f.edge(h).weight}}function i(a){let l=[],c={},f={};function h(m){Object.hasOwn(f,m)||(f[m]=!0,c[m]=!0,a.outEdges(m).forEach(d=>{Object.hasOwn(c,d.w)?l.push(d):h(d.w)}),delete c[m])}return a.nodes().forEach(h),l}function o(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let f=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,f)}})}return Sd}var Ed,Y0;function rP(){if(Y0)return Ed;Y0=1;let e=nt();Ed={run:t,undo:i};function t(o){o.graph().dummyChains=[],o.edges().forEach(a=>n(o,a))}function n(o,a){let l=a.v,c=o.node(l).rank,f=a.w,h=o.node(f).rank,m=a.name,d=o.edge(a),g=d.labelRank;if(h===c+1)return;o.removeEdge(a);let v,x,w;for(w=0,++c;c<h;++w,++c)d.points=[],x={width:0,height:0,edgeLabel:d,edgeObj:a,rank:c},v=e.addDummyNode(o,"edge",x,"_d"),c===g&&(x.width=d.width,x.height=d.height,x.dummy="edge-label",x.labelpos=d.labelpos),o.setEdge(l,v,{weight:d.weight},m),w===0&&o.graph().dummyChains.push(v),l=v;o.setEdge(l,f,{weight:d.weight},m)}function i(o){o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeLabel,f;for(o.setEdge(l.edgeObj,c);l.dummy;)f=o.successors(a)[0],o.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=f,l=o.node(a)})}return Ed}var Nd,K0;function ou(){if(K0)return Nd;K0=1;const{applyWithChunking:e}=nt();Nd={longestPath:t,slack:n};function t(i){var o={};function a(l){var c=i.node(l);if(Object.hasOwn(o,l))return c.rank;o[l]=!0;let f=i.outEdges(l).map(m=>m==null?Number.POSITIVE_INFINITY:a(m.w)-i.edge(m).minlen);var h=e(Math.min,f);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}i.sources().forEach(a)}function n(i,o){return i.node(o.w).rank-i.node(o.v).rank-i.edge(o).minlen}return Nd}var _d,G0;function c1(){if(G0)return _d;G0=1;var e=yn().Graph,t=ou().slack;_d=n;function n(l){var c=new e({directed:!1}),f=l.nodes()[0],h=l.nodeCount();c.setNode(f,{});for(var m,d;i(c,l)<h;)m=o(c,l),d=c.hasNode(m.v)?t(l,m):-t(l,m),a(c,l,d);return c}function i(l,c){function f(h){c.nodeEdges(h).forEach(m=>{var d=m.v,g=h===d?m.w:d;!l.hasNode(g)&&!t(c,m)&&(l.setNode(g,{}),l.setEdge(h,g,{}),f(g))})}return l.nodes().forEach(f),l.nodeCount()}function o(l,c){return c.edges().reduce((h,m)=>{let d=Number.POSITIVE_INFINITY;return l.hasNode(m.v)!==l.hasNode(m.w)&&(d=t(c,m)),d<h[0]?[d,m]:h},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,f){l.nodes().forEach(h=>c.node(h).rank+=f)}return _d}var Cd,X0;function iP(){if(X0)return Cd;X0=1;var e=c1(),t=ou().slack,n=ou().longestPath,i=yn().alg.preorder,o=yn().alg.postorder,a=nt().simplify;Cd=l,l.initLowLimValues=m,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=x;function l(_){_=a(_),n(_);var E=e(_);m(E),c(E,_);for(var T,A;T=g(E);)A=v(E,_,T),x(E,_,T,A)}function c(_,E){var T=o(_,_.nodes());T=T.slice(0,T.length-1),T.forEach(A=>f(_,E,A))}function f(_,E,T){var A=_.node(T),R=A.parent;_.edge(T,R).cutvalue=h(_,E,T)}function h(_,E,T){var A=_.node(T),R=A.parent,M=!0,C=E.edge(T,R),P=0;return C||(M=!1,C=E.edge(R,T)),P=C.weight,E.nodeEdges(T).forEach(j=>{var L=j.v===T,D=L?j.w:j.v;if(D!==R){var X=L===M,z=E.edge(j).weight;if(P+=X?z:-z,b(_,T,D)){var G=_.edge(T,D).cutvalue;P+=X?-G:G}}}),P}function m(_,E){arguments.length<2&&(E=_.nodes()[0]),d(_,{},1,E)}function d(_,E,T,A,R){var M=T,C=_.node(A);return E[A]=!0,_.neighbors(A).forEach(P=>{Object.hasOwn(E,P)||(T=d(_,E,T,P,A))}),C.low=M,C.lim=T++,R?C.parent=R:delete C.parent,T}function g(_){return _.edges().find(E=>_.edge(E).cutvalue<0)}function v(_,E,T){var A=T.v,R=T.w;E.hasEdge(A,R)||(A=T.w,R=T.v);var M=_.node(A),C=_.node(R),P=M,j=!1;M.lim>C.lim&&(P=C,j=!0);var L=E.edges().filter(D=>j===S(_,_.node(D.v),P)&&j!==S(_,_.node(D.w),P));return L.reduce((D,X)=>t(E,X)<t(E,D)?X:D)}function x(_,E,T,A){var R=T.v,M=T.w;_.removeEdge(R,M),_.setEdge(A.v,A.w,{}),m(_),c(_,E),w(_,E)}function w(_,E){var T=_.nodes().find(R=>!E.node(R).parent),A=i(_,T);A=A.slice(1),A.forEach(R=>{var M=_.node(R).parent,C=E.edge(R,M),P=!1;C||(C=E.edge(M,R),P=!0),E.node(R).rank=E.node(M).rank+(P?C.minlen:-C.minlen)})}function b(_,E,T){return _.hasEdge(E,T)}function S(_,E,T){return T.low<=E.lim&&E.lim<=T.lim}return Cd}var Td,Q0;function sP(){if(Q0)return Td;Q0=1;var e=ou(),t=e.longestPath,n=c1(),i=iP();Td=o;function o(f){var h=f.graph().ranker;if(h instanceof Function)return h(f);switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":l(f);break;case"longest-path":a(f);break;case"none":break;default:c(f)}}var a=t;function l(f){t(f),n(f)}function c(f){i(f)}return Td}var Id,J0;function oP(){if(J0)return Id;J0=1,Id=e;function e(i){let o=n(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),c=l.edgeObj,f=t(i,o,c.v,c.w),h=f.path,m=f.lca,d=0,g=h[d],v=!0;for(;a!==c.w;){if(l=i.node(a),v){for(;(g=h[d])!==m&&i.node(g).maxRank<l.rank;)d++;g===m&&(v=!1)}if(!v){for(;d<h.length-1&&i.node(g=h[d+1]).minRank<=l.rank;)d++;g=h[d]}i.setParent(a,g),a=i.successors(a)[0]}})}function t(i,o,a,l){let c=[],f=[],h=Math.min(o[a].low,o[l].low),m=Math.max(o[a].lim,o[l].lim),d,g;d=a;do d=i.parent(d),c.push(d);while(d&&(o[d].low>h||m>o[d].lim));for(g=d,d=l;(d=i.parent(d))!==g;)f.push(d);return{path:c.concat(f.reverse()),lca:g}}function n(i){let o={},a=0;function l(c){let f=a;i.children(c).forEach(l),o[c]={low:f,lim:a++}}return i.children().forEach(l),o}return Id}var Od,Z0;function aP(){if(Z0)return Od;Z0=1;let e=nt();Od={run:t,cleanup:a};function t(l){let c=e.addDummyNode(l,"root",{},"_root"),f=i(l),h=Object.values(f),m=e.applyWithChunking(Math.max,h)-1,d=2*m+1;l.graph().nestingRoot=c,l.edges().forEach(v=>l.edge(v).minlen*=d);let g=o(l)+1;l.children().forEach(v=>n(l,c,d,g,m,f,v)),l.graph().nodeRankFactor=d}function n(l,c,f,h,m,d,g){let v=l.children(g);if(!v.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:f});return}let x=e.addBorderNode(l,"_bt"),w=e.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(x,g),b.borderTop=x,l.setParent(w,g),b.borderBottom=w,v.forEach(S=>{n(l,c,f,h,m,d,S);let _=l.node(S),E=_.borderTop?_.borderTop:S,T=_.borderBottom?_.borderBottom:S,A=_.borderTop?h:2*h,R=E!==T?1:m-d[g]+1;l.setEdge(x,E,{weight:A,minlen:R,nestingEdge:!0}),l.setEdge(T,w,{weight:A,minlen:R,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,x,{weight:0,minlen:m+d[g]})}function i(l){var c={};function f(h,m){var d=l.children(h);d&&d.length&&d.forEach(g=>f(g,m+1)),c[h]=m}return l.children().forEach(h=>f(h,1)),c}function o(l){return l.edges().reduce((c,f)=>c+l.edge(f).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(f=>{var h=l.edge(f);h.nestingEdge&&l.removeEdge(f)})}return Od}var Pd,ev;function lP(){if(ev)return Pd;ev=1;let e=nt();Pd=t;function t(i){function o(a){let l=i.children(a),c=i.node(a);if(l.length&&l.forEach(o),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,h=c.maxRank+1;f<h;++f)n(i,"borderLeft","_bl",a,c,f),n(i,"borderRight","_br",a,c,f)}}i.children().forEach(o)}function n(i,o,a,l,c,f){let h={width:0,height:0,rank:f,borderType:o},m=c[o][f-1],d=e.addDummyNode(i,"border",h,a);c[o][f]=d,i.setParent(d,l),m&&i.setEdge(m,d,{weight:1})}return Pd}var Ad,tv;function uP(){if(tv)return Ad;tv=1,Ad={adjust:e,undo:t};function e(f){let h=f.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(f)}function t(f){let h=f.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&o(f),(h==="lr"||h==="rl")&&(l(f),n(f))}function n(f){f.nodes().forEach(h=>i(f.node(h))),f.edges().forEach(h=>i(f.edge(h)))}function i(f){let h=f.width;f.width=f.height,f.height=h}function o(f){f.nodes().forEach(h=>a(f.node(h))),f.edges().forEach(h=>{let m=f.edge(h);m.points.forEach(a),Object.hasOwn(m,"y")&&a(m)})}function a(f){f.y=-f.y}function l(f){f.nodes().forEach(h=>c(f.node(h))),f.edges().forEach(h=>{let m=f.edge(h);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(f){let h=f.x;f.x=f.y,f.y=h}return Ad}var Md,nv;function cP(){if(nv)return Md;nv=1;let e=nt();Md=t;function t(n){let i={},o=n.nodes().filter(m=>!n.children(m).length),a=o.map(m=>n.node(m).rank),l=e.applyWithChunking(Math.max,a),c=e.range(l+1).map(()=>[]);function f(m){if(i[m])return;i[m]=!0;let d=n.node(m);c[d.rank].push(m),n.successors(m).forEach(f)}return o.sort((m,d)=>n.node(m).rank-n.node(d).rank).forEach(f),c}return Md}var Rd,rv;function fP(){if(rv)return Rd;rv=1;let e=nt().zipObject;Rd=t;function t(i,o){let a=0;for(let l=1;l<o.length;++l)a+=n(i,o[l-1],o[l]);return a}function n(i,o,a){let l=e(a,a.map((g,v)=>v)),c=o.flatMap(g=>i.outEdges(g).map(v=>({pos:l[v.w],weight:i.edge(v).weight})).sort((v,x)=>v.pos-x.pos)),f=1;for(;f<a.length;)f<<=1;let h=2*f-1;f-=1;let m=new Array(h).fill(0),d=0;return c.forEach(g=>{let v=g.pos+f;m[v]+=g.weight;let x=0;for(;v>0;)v%2&&(x+=m[v+1]),v=v-1>>1,m[v]+=g.weight;d+=g.weight*x}),d}return Rd}var Ld,iv;function dP(){if(iv)return Ld;iv=1,Ld=e;function e(t,n=[]){return n.map(i=>{let o=t.inEdges(i);if(o.length){let a=o.reduce((l,c)=>{let f=t.edge(c),h=t.node(c.v);return{sum:l.sum+f.weight*h.order,weight:l.weight+f.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}return Ld}var jd,sv;function hP(){if(sv)return jd;sv=1;let e=nt();jd=t;function t(o,a){let l={};o.forEach((f,h)=>{let m=l[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:h};f.barycenter!==void 0&&(m.barycenter=f.barycenter,m.weight=f.weight)}),a.edges().forEach(f=>{let h=l[f.v],m=l[f.w];h!==void 0&&m!==void 0&&(m.indegree++,h.out.push(l[f.w]))});let c=Object.values(l).filter(f=>!f.indegree);return n(c)}function n(o){let a=[];function l(f){return h=>{h.merged||(h.barycenter===void 0||f.barycenter===void 0||h.barycenter>=f.barycenter)&&i(f,h)}}function c(f){return h=>{h.in.push(f),--h.indegree===0&&o.push(h)}}for(;o.length;){let f=o.pop();a.push(f),f.in.reverse().forEach(l(f)),f.out.forEach(c(f))}return a.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function i(o,a){let l=0,c=0;o.weight&&(l+=o.barycenter*o.weight,c+=o.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),o.vs=a.vs.concat(o.vs),o.barycenter=l/c,o.weight=c,o.i=Math.min(a.i,o.i),a.merged=!0}return jd}var Dd,ov;function pP(){if(ov)return Dd;ov=1;let e=nt();Dd=t;function t(o,a){let l=e.partition(o,x=>Object.hasOwn(x,"barycenter")),c=l.lhs,f=l.rhs.sort((x,w)=>w.i-x.i),h=[],m=0,d=0,g=0;c.sort(i(!!a)),g=n(h,f,g),c.forEach(x=>{g+=x.vs.length,h.push(x.vs),m+=x.barycenter*x.weight,d+=x.weight,g=n(h,f,g)});let v={vs:h.flat(!0)};return d&&(v.barycenter=m/d,v.weight=d),v}function n(o,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),o.push(c.vs),l++;return l}function i(o){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:o?l.i-a.i:a.i-l.i}return Dd}var $d,av;function mP(){if(av)return $d;av=1;let e=dP(),t=hP(),n=pP();$d=i;function i(l,c,f,h){let m=l.children(c),d=l.node(c),g=d?d.borderLeft:void 0,v=d?d.borderRight:void 0,x={};g&&(m=m.filter(_=>_!==g&&_!==v));let w=e(l,m);w.forEach(_=>{if(l.children(_.v).length){let E=i(l,_.v,f,h);x[_.v]=E,Object.hasOwn(E,"barycenter")&&a(_,E)}});let b=t(w,f);o(b,x);let S=n(b,h);if(g&&(S.vs=[g,S.vs,v].flat(!0),l.predecessors(g).length)){let _=l.node(l.predecessors(g)[0]),E=l.node(l.predecessors(v)[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+_.order+E.order)/(S.weight+2),S.weight+=2}return S}function o(l,c){l.forEach(f=>{f.vs=f.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}return $d}var zd,lv;function gP(){if(lv)return zd;lv=1;let e=yn().Graph,t=nt();zd=n;function n(o,a,l,c){c||(c=o.nodes());let f=i(o),h=new e({compound:!0}).setGraph({root:f}).setDefaultNodeLabel(m=>o.node(m));return c.forEach(m=>{let d=o.node(m),g=o.parent(m);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(h.setNode(m),h.setParent(m,g||f),o[l](m).forEach(v=>{let x=v.v===m?v.w:v.v,w=h.edge(x,m),b=w!==void 0?w.weight:0;h.setEdge(x,m,{weight:o.edge(v).weight+b})}),Object.hasOwn(d,"minRank")&&h.setNode(m,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),h}function i(o){for(var a;o.hasNode(a=t.uniqueId("_root")););return a}return zd}var Fd,uv;function yP(){if(uv)return Fd;uv=1,Fd=e;function e(t,n,i){let o={},a;i.forEach(l=>{let c=t.parent(l),f,h;for(;c;){if(f=t.parent(c),f?(h=o[f],o[f]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=f}})}return Fd}var Bd,cv;function vP(){if(cv)return Bd;cv=1;let e=cP(),t=fP(),n=mP(),i=gP(),o=yP(),a=yn().Graph,l=nt();Bd=c;function c(d,g){if(g&&typeof g.customOrder=="function"){g.customOrder(d,c);return}let v=l.maxRank(d),x=f(d,l.range(1,v+1),"inEdges"),w=f(d,l.range(v-1,-1,-1),"outEdges"),b=e(d);if(m(d,b),g&&g.disableOptimalOrderHeuristic)return;let S=Number.POSITIVE_INFINITY,_;for(let E=0,T=0;T<4;++E,++T){h(E%2?x:w,E%4>=2),b=l.buildLayerMatrix(d);let A=t(d,b);A<S&&(T=0,_=Object.assign({},b),S=A)}m(d,_)}function f(d,g,v){const x=new Map,w=(b,S)=>{x.has(b)||x.set(b,[]),x.get(b).push(S)};for(const b of d.nodes()){const S=d.node(b);if(typeof S.rank=="number"&&w(S.rank,b),typeof S.minRank=="number"&&typeof S.maxRank=="number")for(let _=S.minRank;_<=S.maxRank;_++)_!==S.rank&&w(_,b)}return g.map(function(b){return i(d,b,v,x.get(b)||[])})}function h(d,g){let v=new a;d.forEach(function(x){let w=x.graph().root,b=n(x,w,v,g);b.vs.forEach((S,_)=>x.node(S).order=_),o(x,v,b.vs)})}function m(d,g){Object.values(g).forEach(v=>v.forEach((x,w)=>d.node(x).order=w))}return Bd}var Vd,fv;function wP(){if(fv)return Vd;fv=1;let e=yn().Graph,t=nt();Vd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:d,findSmallestWidthAlignment:m,balance:g};function n(b,S){let _={};function E(T,A){let R=0,M=0,C=T.length,P=A[A.length-1];return A.forEach((j,L)=>{let D=o(b,j),X=D?b.node(D).order:C;(D||j===P)&&(A.slice(M,L+1).forEach(z=>{b.predecessors(z).forEach(G=>{let Y=b.node(G),Z=Y.order;(Z<R||X<Z)&&!(Y.dummy&&b.node(z).dummy)&&a(_,G,z)})}),M=L+1,R=X)}),A}return S.length&&S.reduce(E),_}function i(b,S){let _={};function E(A,R,M,C,P){let j;t.range(R,M).forEach(L=>{j=A[L],b.node(j).dummy&&b.predecessors(j).forEach(D=>{let X=b.node(D);X.dummy&&(X.order<C||X.order>P)&&a(_,D,j)})})}function T(A,R){let M=-1,C,P=0;return R.forEach((j,L)=>{if(b.node(j).dummy==="border"){let D=b.predecessors(j);D.length&&(C=b.node(D[0]).order,E(R,P,L,M,C),P=L,M=C)}E(R,P,R.length,C,A.length)}),R}return S.length&&S.reduce(T),_}function o(b,S){if(b.node(S).dummy)return b.predecessors(S).find(_=>b.node(_).dummy)}function a(b,S,_){if(S>_){let T=S;S=_,_=T}let E=b[S];E||(b[S]=E={}),E[_]=!0}function l(b,S,_){if(S>_){let E=S;S=_,_=E}return!!b[S]&&Object.hasOwn(b[S],_)}function c(b,S,_,E){let T={},A={},R={};return S.forEach(M=>{M.forEach((C,P)=>{T[C]=C,A[C]=C,R[C]=P})}),S.forEach(M=>{let C=-1;M.forEach(P=>{let j=E(P);if(j.length){j=j.sort((D,X)=>R[D]-R[X]);let L=(j.length-1)/2;for(let D=Math.floor(L),X=Math.ceil(L);D<=X;++D){let z=j[D];A[P]===P&&C<R[z]&&!l(_,P,z)&&(A[z]=P,A[P]=T[P]=T[z],C=R[z])}}})}),{root:T,align:A}}function f(b,S,_,E,T){let A={},R=h(b,S,_,T),M=T?"borderLeft":"borderRight";function C(L,D){let X=R.nodes(),z=X.pop(),G={};for(;z;)G[z]?L(z):(G[z]=!0,X.push(z),X=X.concat(D(z))),z=X.pop()}function P(L){A[L]=R.inEdges(L).reduce((D,X)=>Math.max(D,A[X.v]+R.edge(X)),0)}function j(L){let D=R.outEdges(L).reduce((z,G)=>Math.min(z,A[G.w]-R.edge(G)),Number.POSITIVE_INFINITY),X=b.node(L);D!==Number.POSITIVE_INFINITY&&X.borderType!==M&&(A[L]=Math.max(A[L],D))}return C(P,R.predecessors.bind(R)),C(j,R.successors.bind(R)),Object.keys(E).forEach(L=>A[L]=A[_[L]]),A}function h(b,S,_,E){let T=new e,A=b.graph(),R=x(A.nodesep,A.edgesep,E);return S.forEach(M=>{let C;M.forEach(P=>{let j=_[P];if(T.setNode(j),C){var L=_[C],D=T.edge(L,j);T.setEdge(L,j,Math.max(R(b,P,C),D||0))}C=P})}),T}function m(b,S){return Object.values(S).reduce((_,E)=>{let T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([M,C])=>{let P=w(b,M)/2;T=Math.max(C+P,T),A=Math.min(C-P,A)});const R=T-A;return R<_[0]&&(_=[R,E]),_},[Number.POSITIVE_INFINITY,null])[1]}function d(b,S){let _=Object.values(S),E=t.applyWithChunking(Math.min,_),T=t.applyWithChunking(Math.max,_);["u","d"].forEach(A=>{["l","r"].forEach(R=>{let M=A+R,C=b[M];if(C===S)return;let P=Object.values(C),j=E-t.applyWithChunking(Math.min,P);R!=="l"&&(j=T-t.applyWithChunking(Math.max,P)),j&&(b[M]=t.mapValues(C,L=>L+j))})})}function g(b,S){return t.mapValues(b.ul,(_,E)=>{if(S)return b[S.toLowerCase()][E];{let T=Object.values(b).map(A=>A[E]).sort((A,R)=>A-R);return(T[1]+T[2])/2}})}function v(b){let S=t.buildLayerMatrix(b),_=Object.assign(n(b,S),i(b,S)),E={},T;["u","d"].forEach(R=>{T=R==="u"?S:Object.values(S).reverse(),["l","r"].forEach(M=>{M==="r"&&(T=T.map(L=>Object.values(L).reverse()));let C=(R==="u"?b.predecessors:b.successors).bind(b),P=c(b,T,_,C),j=f(b,T,P.root,P.align,M==="r");M==="r"&&(j=t.mapValues(j,L=>-L)),E[R+M]=j})});let A=m(b,E);return d(E,A),g(E,b.graph().align)}function x(b,S,_){return(E,T,A)=>{let R=E.node(T),M=E.node(A),C=0,P;if(C+=R.width/2,Object.hasOwn(R,"labelpos"))switch(R.labelpos.toLowerCase()){case"l":P=-R.width/2;break;case"r":P=R.width/2;break}if(P&&(C+=_?P:-P),P=0,C+=(R.dummy?S:b)/2,C+=(M.dummy?S:b)/2,C+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":P=M.width/2;break;case"r":P=-M.width/2;break}return P&&(C+=_?P:-P),P=0,C}}function w(b,S){return b.node(S).width}return Vd}var Wd,dv;function xP(){if(dv)return Wd;dv=1;let e=nt(),t=wP().positionX;Wd=n;function n(o){o=e.asNonCompoundGraph(o),i(o),Object.entries(t(o)).forEach(([a,l])=>o.node(a).x=l)}function i(o){let a=e.buildLayerMatrix(o),l=o.graph().ranksep,c=0;a.forEach(f=>{const h=f.reduce((m,d)=>{const g=o.node(d).height;return m>g?m:g},0);f.forEach(m=>o.node(m).y=c+h/2),c+=h+l})}return Wd}var Ud,hv;function bP(){if(hv)return Ud;hv=1;let e=nP(),t=rP(),n=sP(),i=nt().normalizeRanks,o=oP(),a=nt().removeEmptyRanks,l=aP(),c=lP(),f=uP(),h=vP(),m=xP(),d=nt(),g=yn().Graph;Ud=v;function v(W,K){let J=K&&K.debugTiming?d.time:d.notime;J("layout",()=>{let re=J(" buildLayoutGraph",()=>C(W));J(" runLayout",()=>x(re,J,K)),J(" updateInputGraph",()=>w(W,re))})}function x(W,K,J){K(" makeSpaceForEdgeLabels",()=>P(W)),K(" removeSelfEdges",()=>H(W)),K(" acyclic",()=>e.run(W)),K(" nestingGraph.run",()=>l.run(W)),K(" rank",()=>n(d.asNonCompoundGraph(W))),K(" injectEdgeLabelProxies",()=>j(W)),K(" removeEmptyRanks",()=>a(W)),K(" nestingGraph.cleanup",()=>l.cleanup(W)),K(" normalizeRanks",()=>i(W)),K(" assignRankMinMax",()=>L(W)),K(" removeEdgeLabelProxies",()=>D(W)),K(" normalize.run",()=>t.run(W)),K(" parentDummyChains",()=>o(W)),K(" addBorderSegments",()=>c(W)),K(" order",()=>h(W,J)),K(" insertSelfEdges",()=>B(W)),K(" adjustCoordinateSystem",()=>f.adjust(W)),K(" position",()=>m(W)),K(" positionSelfEdges",()=>V(W)),K(" removeBorderNodes",()=>Z(W)),K(" normalize.undo",()=>t.undo(W)),K(" fixupEdgeLabelCoords",()=>G(W)),K(" undoCoordinateSystem",()=>f.undo(W)),K(" translateGraph",()=>X(W)),K(" assignNodeIntersects",()=>z(W)),K(" reversePoints",()=>Y(W)),K(" acyclic.undo",()=>e.undo(W))}function w(W,K){W.nodes().forEach(J=>{let re=W.node(J),oe=K.node(J);re&&(re.x=oe.x,re.y=oe.y,re.rank=oe.rank,K.children(J).length&&(re.width=oe.width,re.height=oe.height))}),W.edges().forEach(J=>{let re=W.edge(J),oe=K.edge(J);re.points=oe.points,Object.hasOwn(oe,"x")&&(re.x=oe.x,re.y=oe.y)}),W.graph().width=K.graph().width,W.graph().height=K.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],S={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],E=["width","height","rank"],T={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],R={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function C(W){let K=new g({multigraph:!0,compound:!0}),J=U(W.graph());return K.setGraph(Object.assign({},S,$(J,b),d.pick(J,_))),W.nodes().forEach(re=>{let oe=U(W.node(re));const ee=$(oe,E);Object.keys(T).forEach(se=>{ee[se]===void 0&&(ee[se]=T[se])}),K.setNode(re,ee),K.setParent(re,W.parent(re))}),W.edges().forEach(re=>{let oe=U(W.edge(re));K.setEdge(re,Object.assign({},R,$(oe,A),d.pick(oe,M)))}),K}function P(W){let K=W.graph();K.ranksep/=2,W.edges().forEach(J=>{let re=W.edge(J);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function j(W){W.edges().forEach(K=>{let J=W.edge(K);if(J.width&&J.height){let re=W.node(K.v),ee={rank:(W.node(K.w).rank-re.rank)/2+re.rank,e:K};d.addDummyNode(W,"edge-proxy",ee,"_ep")}})}function L(W){let K=0;W.nodes().forEach(J=>{let re=W.node(J);re.borderTop&&(re.minRank=W.node(re.borderTop).rank,re.maxRank=W.node(re.borderBottom).rank,K=Math.max(K,re.maxRank))}),W.graph().maxRank=K}function D(W){W.nodes().forEach(K=>{let J=W.node(K);J.dummy==="edge-proxy"&&(W.edge(J.e).labelRank=J.rank,W.removeNode(K))})}function X(W){let K=Number.POSITIVE_INFINITY,J=0,re=Number.POSITIVE_INFINITY,oe=0,ee=W.graph(),se=ee.marginx||0,de=ee.marginy||0;function xe(he){let fe=he.x,Se=he.y,Pe=he.width,Ae=he.height;K=Math.min(K,fe-Pe/2),J=Math.max(J,fe+Pe/2),re=Math.min(re,Se-Ae/2),oe=Math.max(oe,Se+Ae/2)}W.nodes().forEach(he=>xe(W.node(he))),W.edges().forEach(he=>{let fe=W.edge(he);Object.hasOwn(fe,"x")&&xe(fe)}),K-=se,re-=de,W.nodes().forEach(he=>{let fe=W.node(he);fe.x-=K,fe.y-=re}),W.edges().forEach(he=>{let fe=W.edge(he);fe.points.forEach(Se=>{Se.x-=K,Se.y-=re}),Object.hasOwn(fe,"x")&&(fe.x-=K),Object.hasOwn(fe,"y")&&(fe.y-=re)}),ee.width=J-K+se,ee.height=oe-re+de}function z(W){W.edges().forEach(K=>{let J=W.edge(K),re=W.node(K.v),oe=W.node(K.w),ee,se;J.points?(ee=J.points[0],se=J.points[J.points.length-1]):(J.points=[],ee=oe,se=re),J.points.unshift(d.intersectRect(re,ee)),J.points.push(d.intersectRect(oe,se))})}function G(W){W.edges().forEach(K=>{let J=W.edge(K);if(Object.hasOwn(J,"x"))switch((J.labelpos==="l"||J.labelpos==="r")&&(J.width-=J.labeloffset),J.labelpos){case"l":J.x-=J.width/2+J.labeloffset;break;case"r":J.x+=J.width/2+J.labeloffset;break}})}function Y(W){W.edges().forEach(K=>{let J=W.edge(K);J.reversed&&J.points.reverse()})}function Z(W){W.nodes().forEach(K=>{if(W.children(K).length){let J=W.node(K),re=W.node(J.borderTop),oe=W.node(J.borderBottom),ee=W.node(J.borderLeft[J.borderLeft.length-1]),se=W.node(J.borderRight[J.borderRight.length-1]);J.width=Math.abs(se.x-ee.x),J.height=Math.abs(oe.y-re.y),J.x=ee.x+J.width/2,J.y=re.y+J.height/2}}),W.nodes().forEach(K=>{W.node(K).dummy==="border"&&W.removeNode(K)})}function H(W){W.edges().forEach(K=>{if(K.v===K.w){var J=W.node(K.v);J.selfEdges||(J.selfEdges=[]),J.selfEdges.push({e:K,label:W.edge(K)}),W.removeEdge(K)}})}function B(W){var K=d.buildLayerMatrix(W);K.forEach(J=>{var re=0;J.forEach((oe,ee)=>{var se=W.node(oe);se.order=ee+re,(se.selfEdges||[]).forEach(de=>{d.addDummyNode(W,"selfedge",{width:de.label.width,height:de.label.height,rank:se.rank,order:ee+ ++re,e:de.e,label:de.label},"_se")}),delete se.selfEdges})})}function V(W){W.nodes().forEach(K=>{var J=W.node(K);if(J.dummy==="selfedge"){var re=W.node(J.e.v),oe=re.x+re.width/2,ee=re.y,se=J.x-oe,de=re.height/2;W.setEdge(J.e,J.label),W.removeNode(K),J.label.points=[{x:oe+2*se/3,y:ee-de},{x:oe+5*se/6,y:ee-de},{x:oe+se,y:ee},{x:oe+5*se/6,y:ee+de},{x:oe+2*se/3,y:ee+de}],J.label.x=J.x,J.label.y=J.y}})}function $(W,K){return d.mapValues(d.pick(W,K),Number)}function U(W){var K={};return W&&Object.entries(W).forEach(([J,re])=>{typeof J=="string"&&(J=J.toLowerCase()),K[J]=re}),K}return Ud}var Hd,pv;function kP(){if(pv)return Hd;pv=1;let e=nt(),t=yn().Graph;Hd={debugOrdering:n};function n(i){let o=e.buildLayerMatrix(i),a=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),o.forEach((l,c)=>{let f="layer"+c;a.setNode(f,{rank:"same"}),l.reduce((h,m)=>(a.setEdge(h,m,{style:"invis"}),m))}),a}return Hd}var qd,mv;function SP(){return mv||(mv=1,qd="1.1.8"),qd}var Yd,gv;function EP(){return gv||(gv=1,Yd={graphlib:yn(),layout:bP(),debug:kP(),util:{time:nt().time,notime:nt().notime},version:SP()}),Yd}var NP=EP();const yv=pu(NP),vv=220,wv=140,Kd=60;function _P(e){return O.useMemo(()=>{if(!e)return{nodes:[],edges:[]};const t=new yv.graphlib.Graph;t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"LR",nodesep:40,ranksep:80});for(const o of e.nodes){const a=o.type==="task.branch"||o.type.startsWith("trigger.")?wv:vv;t.setNode(o.id,{width:a,height:Kd})}for(const o of e.edges)t.setEdge(o.from,o.to);yv.layout(t);const n=e.nodes.map(o=>{const a=t.node(o.id),l=o.type==="task.branch"||o.type.startsWith("trigger.")?wv:vv;return{id:o.id,type:o.type==="agent.run"?"agentNode":"workflowNode",position:{x:a.x-l/2,y:a.y-Kd/2},data:{node:o},width:l,height:Kd}}),i=e.edges.map((o,a)=>({id:`e-${a}`,source:o.from,target:o.to,label:o.when,type:"smoothstep",style:{stroke:"hsl(240 5% 65%)",strokeWidth:1.5},labelStyle:{fontSize:11,fontFamily:"JetBrains Mono, monospace"}}));return{nodes:n,edges:i}},[e])}const CP="hsl(240 5% 65%)",f1="hsl(142 71% 42%)",TP="hsl(0 72% 55%)",IP="hsl(38 92% 50%)";function OP(e,t){const n=e!=="idle";return{stroke:e==="failed"?TP:e==="running"?IP:n?f1:CP,strokeWidth:n?2.5:1.5,strokeDasharray:t&&!n?"6 4":void 0,animated:e==="running",fired:n}}const PP={workflowNode:S0,agentNode:S0};function AP({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:o,edges:a}=_P(e),[l,c]=O.useState(!1),f=o.map(x=>({...x,data:{...x.data,onNodeClick:t,liveStatus:i[x.id]??"idle"}})),h=a.map(x=>{const w=OP(i[x.target]??"idle",x.label!=null&&x.label!=="");return{...x,animated:w.animated,style:{stroke:w.stroke,strokeWidth:w.strokeWidth,strokeDasharray:w.strokeDasharray},labelStyle:{fontSize:11,fontFamily:"JetBrains Mono, monospace",fill:w.fired?w.stroke:"hsl(240 5% 50%)"},labelBgStyle:{fill:"hsl(0 0% 100%)",fillOpacity:.85}}}),m=O.useCallback((x,w)=>{const b=w.data.node;b&&t(b)},[t]),d=O.useCallback(x=>{x.preventDefault(),x.dataTransfer.dropEffect="copy",c(!0)},[]),g=O.useCallback(()=>{c(!1)},[]),v=O.useCallback(x=>{x.preventDefault(),c(!1);const w=x.dataTransfer.files[0];if(!w)return;const b=new FileReader;b.onload=S=>{var E;const _=(E=S.target)==null?void 0:E.result;typeof _=="string"&&n(_)},b.readAsText(w)},[n]);return N.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:d,onDragLeave:g,onDrop:v,children:[N.jsxs(cI,{nodes:f,edges:h,nodeTypes:PP,onNodeClick:m,fitView:!0,attributionPosition:"bottom-right",children:[N.jsx(mI,{variant:Jn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),N.jsx(kI,{})]}),l&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/70 border-2 border-dashed border-primary pointer-events-none z-10",children:N.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),N.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"}),N.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-3 text-[10px] font-mono text-mutedfg pointer-events-none bg-bg/80 border border-border rounded px-2 py-1",children:[N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{className:"inline-block w-4 border-t-2 border-dashed",style:{borderColor:"hsl(240 5% 65%)"}})," branch"]}),N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{className:"inline-block w-4 border-t-2",style:{borderColor:f1}})," taken"]})]})]})}function St(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function MP(...e){return t=>{let n=!1;const i=e.map(o=>{const a=xv(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<i.length;o++){const a=i[o];typeof a=="function"?a():xv(e[o],null)}}}}function Ut(...e){return O.useCallback(MP(...e),e)}function d1(e,t=[]){let n=[];function i(a,l){const c=O.createContext(l);c.displayName=a+"Context";const f=n.length;n=[...n,l];const h=d=>{var S;const{scope:g,children:v,...x}=d,w=((S=g==null?void 0:g[e])==null?void 0:S[f])||c,b=O.useMemo(()=>x,Object.values(x));return N.jsx(w.Provider,{value:b,children:v})};h.displayName=a+"Provider";function m(d,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[f])||c,x=O.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[h,m]}const o=()=>{const a=n.map(l=>O.createContext(l));return function(c){const f=(c==null?void 0:c[e])||a;return O.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[i,RP(o,...t)]}function RP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const l=i.reduce((c,{useScope:f,scopeName:h})=>{const d=f(a)[`__scope${h}`];return{...c,...d}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ds=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},LP=Lh[" useId ".trim().toString()]||(()=>{}),jP=0;function Gd(e){const[t,n]=O.useState(LP());return ds(()=>{n(i=>i??String(jP++))},[e]),e||(t?`radix-${t}`:"")}var DP=Lh[" useInsertionEffect ".trim().toString()]||ds;function $P({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,a,l]=zP({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:o;{const m=O.useRef(e!==void 0);O.useEffect(()=>{const d=m.current;d!==c&&console.warn(`${i} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,i])}const h=O.useCallback(m=>{var d;if(c){const g=FP(m)?m(e):m;g!==e&&((d=l.current)==null||d.call(l,g))}else a(m)},[c,e,a,l]);return[f,h]}function zP({defaultProp:e,onChange:t}){const[n,i]=O.useState(e),o=O.useRef(n),a=O.useRef(t);return DP(()=>{a.current=t},[t]),O.useEffect(()=>{var l;o.current!==n&&((l=a.current)==null||l.call(a,n),o.current=n)},[n,o]),[n,i,a]}function FP(e){return typeof e=="function"}function h1(e){const t=O.forwardRef((n,i)=>{let{children:o,...a}=n,l=null,c=!1;const f=[];bv(o)&&typeof Cl=="function"&&(o=Cl(o._payload)),O.Children.forEach(o,g=>{var v;if(HP(g)){c=!0;const x=g;let w="child"in x.props?x.props.child:x.props.children;bv(w)&&typeof Cl=="function"&&(w=Cl(w._payload)),l=VP(x,w),f.push((v=l==null?void 0:l.props)==null?void 0:v.children)}else f.push(g)}),l?l=O.cloneElement(l,void 0,f):!c&&O.Children.count(o)===1&&O.isValidElement(o)&&(l=o);const h=l?UP(l):void 0,m=Ut(i,h);if(!l){if(o||o===0)throw new Error(c?GP(e):KP(e));return o}const d=WP(a,l.props??{});return l.type!==O.Fragment&&(d.ref=i?m:h),O.cloneElement(l,d)});return t.displayName=`${e}.Slot`,t}var BP=Symbol.for("radix.slottable"),VP=(e,t)=>{if("child"in e.props){const n=e.props.child;return O.isValidElement(n)?O.cloneElement(n,void 0,e.props.children(n.props.children)):null}return O.isValidElement(t)?t:null};function WP(e,t){const n={...t};for(const i in t){const o=e[i],a=t[i];/^on[A-Z]/.test(i)?o&&a?n[i]=(...c)=>{const f=a(...c);return o(...c),f}:o&&(n[i]=o):i==="style"?n[i]={...o,...a}:i==="className"&&(n[i]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function UP(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function HP(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BP}var qP=Symbol.for("react.lazy");function bv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qP&&"_payload"in e&&YP(e._payload)}function YP(e){return typeof e=="object"&&e!==null&&"then"in e}var KP=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,GP=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cl=Lh[" use ".trim().toString()],XP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=XP.reduce((e,t)=>{const n=h1(`Primitive.${t}`),i=O.forwardRef((o,a)=>{const{asChild:l,...c}=o,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),N.jsx(f,{...c,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function QP(e,t){e&&ox.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function JP(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);O.useEffect(()=>{const i=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var ZP="DismissableLayer",Nh="dismissableLayer.update",eA="dismissableLayer.pointerDownOutside",tA="dismissableLayer.focusOutside",kv,ip=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),p1=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...h}=e,m=O.useContext(ip),[d,g]=O.useState(null),v=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=O.useState({}),w=Ut(t,P=>g(P)),b=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=b.indexOf(S),E=d?b.indexOf(d):-1,T=m.layersWithOutsidePointerEventsDisabled.size>0,A=E>=_,R=O.useRef(!1),M=sA(P=>{const j=P.target;if(!(j instanceof Node))return;const L=[...m.branches].some(D=>D.contains(j));!A||L||(a==null||a(P),c==null||c(P),P.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:m.dismissableSurfaces}),C=oA(P=>{if(i&&R.current)return;const j=P.target;[...m.branches].some(D=>D.contains(j))||(l==null||l(P),c==null||c(P),P.defaultPrevented||f==null||f())},v);return JP(P=>{E===m.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&f&&(P.preventDefault(),f()))},v),O.useEffect(()=>{if(d)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(kv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(d)),m.layers.add(d),Sv(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(d),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=kv))}},[d,v,n,m]),O.useEffect(()=>()=>{d&&(m.layers.delete(d),m.layersWithOutsidePointerEventsDisabled.delete(d),Sv())},[d,m]),O.useEffect(()=>{const P=()=>x({});return document.addEventListener(Nh,P),()=>document.removeEventListener(Nh,P)},[]),N.jsx(Rt.div,{...h,ref:w,style:{pointerEvents:T?A?"auto":"none":void 0,...e.style},onFocusCapture:St(e.onFocusCapture,C.onFocusCapture),onBlurCapture:St(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:St(e.onPointerDownCapture,M.onPointerDownCapture)})});p1.displayName=ZP;var nA="DismissableLayerBranch",rA=O.forwardRef((e,t)=>{const n=O.useContext(ip),i=O.useRef(null),o=Ut(t,i);return O.useEffect(()=>{const a=i.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),N.jsx(Rt.div,{...e,ref:o})});rA.displayName=nA;function iA(){const e=O.useContext(ip),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function sA(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a}=t,l=Zt(e),c=O.useRef(!1),f=O.useRef(!1),h=O.useRef(new Map),m=O.useRef(()=>{});return O.useEffect(()=>{function d(){f.current=!1,o.current=!1,h.current.clear()}function g(){return Array.from(h.current.values()).some(Boolean)}function v(_){if(!f.current)return;const E=_.target;E instanceof Node&&[...a].some(A=>A.contains(E))||h.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function x(_){f.current&&h.current.set(_.type,!1)}const w=_=>{if(_.target&&!c.current){let E=function(){n.removeEventListener("click",m.current);const A=g();d(),A||m1(eA,l,T,{discrete:!0})};const T={originalEvent:_};f.current=!0,o.current=i&&_.button===0,h.current.clear(),!i||_.button!==0?E():(n.removeEventListener("click",m.current),m.current=E,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),d();c.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)n.addEventListener(_,v,!0),n.addEventListener(_,x);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const _ of b)n.removeEventListener(_,v,!0),n.removeEventListener(_,x)}},[n,l,i,o,a]),{onPointerDownCapture:()=>c.current=!0}}function oA(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=O.useRef(!1);return O.useEffect(()=>{const o=a=>{a.target&&!i.current&&m1(tA,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Sv(){const e=new CustomEvent(Nh);document.dispatchEvent(e)}function m1(e,t,n,{discrete:i}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?QP(o,a):o.dispatchEvent(a)}var Xd="focusScope.autoFocusOnMount",Qd="focusScope.autoFocusOnUnmount",Ev={bubbles:!1,cancelable:!0},aA="FocusScope",g1=O.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...l}=e,[c,f]=O.useState(null),h=Zt(o),m=Zt(a),d=O.useRef(null),g=Ut(t,w=>f(w)),v=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(i){let w=function(E){if(v.paused||!c)return;const T=E.target;c.contains(T)?d.current=T:_r(d.current,{select:!0})},b=function(E){if(v.paused||!c)return;const T=E.relatedTarget;T!==null&&(c.contains(T)||_r(d.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const A of E)A.removedNodes.length>0&&_r(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const _=new MutationObserver(S);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),_.disconnect()}}},[i,c,v.paused]),O.useEffect(()=>{if(c){_v.add(v);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Xd,Ev);c.addEventListener(Xd,h),c.dispatchEvent(S),S.defaultPrevented||(lA(hA(y1(c)),{select:!0}),document.activeElement===w&&_r(c))}return()=>{c.removeEventListener(Xd,h),setTimeout(()=>{const S=new CustomEvent(Qd,Ev);c.addEventListener(Qd,m),c.dispatchEvent(S),S.defaultPrevented||_r(w??document.body,{select:!0}),c.removeEventListener(Qd,m),_v.remove(v)},0)}}},[c,h,m,v]);const x=O.useCallback(w=>{if(!n&&!i||v.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(b&&S){const _=w.currentTarget,[E,T]=uA(_);E&&T?!w.shiftKey&&S===T?(w.preventDefault(),n&&_r(E,{select:!0})):w.shiftKey&&S===E&&(w.preventDefault(),n&&_r(T,{select:!0})):S===_&&w.preventDefault()}},[n,i,v.paused]);return N.jsx(Rt.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});g1.displayName=aA;function lA(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(_r(i,{select:t}),document.activeElement!==n)return}function uA(e){const t=y1(e),n=Nv(t,e),i=Nv(t.reverse(),e);return[n,i]}function y1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nv(e,t){for(const n of e)if(!cA(n,{upTo:t}))return n}function cA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fA(e){return e instanceof HTMLInputElement&&"select"in e}function _r(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fA(e)&&t&&e.select()}}var _v=dA();function dA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cv(e,t),e.unshift(t)},remove(t){var n;e=Cv(e,t),(n=e[0])==null||n.resume()}}}function Cv(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function hA(e){return e.filter(t=>t.tagName!=="A")}var pA="Portal",v1=O.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,a]=O.useState(!1);ds(()=>a(!0),[]);const l=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?ox.createPortal(N.jsx(Rt.div,{...i,ref:t}),l):null});v1.displayName=pA;function mA(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var Mr=e=>{const{present:t,children:n}=e,i=gA(t),o=typeof n=="function"?n({present:i.isPresent}):O.Children.only(n),a=yA(i.ref,vA(o));return typeof n=="function"||i.isPresent?O.cloneElement(o,{ref:a}):null};Mr.displayName="Presence";function gA(e){const[t,n]=O.useState(),i=O.useRef(null),o=O.useRef(e),a=O.useRef("none"),l=e?"mounted":"unmounted",[c,f]=mA(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const h=Tl(i.current);a.current=c==="mounted"?h:"none"},[c]),ds(()=>{const h=i.current,m=o.current;if(m!==e){const g=a.current,v=Tl(h);e?f("MOUNT"):v==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),ds(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,d=v=>{const w=Tl(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=v=>{v.target===t&&(a.current=Tl(i.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:O.useCallback(h=>{i.current=h?getComputedStyle(h):null,n(h)},[])}}function Tv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yA(...e){const t=O.useRef(e);return t.current=e,O.useCallback(n=>{const i=t.current;let o=!1;const a=i.map(l=>{const c=Tv(l,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():Tv(i[l],null)}}},[])}function Tl(e){return(e==null?void 0:e.animationName)||"none"}function vA(e){var i,o;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Il=0,In=null;function wA(){O.useEffect(()=>{In||(In={start:Iv(),end:Iv()});const{start:e,end:t}=In;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Il++,()=>{Il===1&&(In==null||In.start.remove(),In==null||In.end.remove(),In=null),Il=Math.max(0,Il-1)}},[])}function Iv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pn=function(){return Pn=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Pn.apply(this,arguments)};function w1(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function xA(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,a;i<o;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}var Ul="right-scroll-bar-position",Hl="width-before-scroll-bar",bA="with-scroll-bars-hidden",kA="--removed-body-scroll-bar-size";function Jd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function SA(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var o=n.value;o!==i&&(n.value=i,n.callback(i,o))}}}})[0];return n.callback=t,n.facade}var EA=typeof window<"u"?O.useLayoutEffect:O.useEffect,Ov=new WeakMap;function NA(e,t){var n=SA(null,function(i){return e.forEach(function(o){return Jd(o,i)})});return EA(function(){var i=Ov.get(n);if(i){var o=new Set(i),a=new Set(e),l=n.current;o.forEach(function(c){a.has(c)||Jd(c,null)}),a.forEach(function(c){o.has(c)||Jd(c,l)})}Ov.set(n,e)},[e]),n}function _A(e){return e}function CA(e,t){t===void 0&&(t=_A);var n=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,i);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(i=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){i=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var f=function(){var m=l;l=[],m.forEach(a)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return o}function TA(e){e===void 0&&(e={});var t=CA(null);return t.options=Pn({async:!0,ssr:!1},e),t}var x1=function(e){var t=e.sideCar,n=w1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return O.createElement(i,Pn({},n))};x1.isSideCarExport=!0;function IA(e,t){return e.useMedium(t),x1}var b1=TA(),Zd=function(){},Cu=O.forwardRef(function(e,t){var n=O.useRef(null),i=O.useState({onScrollCapture:Zd,onWheelCapture:Zd,onTouchMoveCapture:Zd}),o=i[0],a=i[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,d=e.shards,g=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,b=e.allowPinchZoom,S=e.as,_=S===void 0?"div":S,E=e.gapMode,T=w1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,R=NA([n,t]),M=Pn(Pn({},T),o);return O.createElement(O.Fragment,null,m&&O.createElement(A,{sideCar:b1,removeScrollBar:h,shards:d,noRelative:v,noIsolation:x,inert:w,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:E}),l?O.cloneElement(O.Children.only(c),Pn(Pn({},M),{ref:R})):O.createElement(_,Pn({},M,{className:f,ref:R}),c))});Cu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cu.classNames={fullWidth:Hl,zeroRight:Ul};var OA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=OA();return t&&e.setAttribute("nonce",t),e}function AA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=PA())&&(AA(t,n),MA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LA=function(){var e=RA();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},k1=function(){var e=LA(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},jA={left:0,top:0,right:0,gap:0},eh=function(e){return parseInt(e||"",10)||0},DA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[eh(n),eh(i),eh(o)]},$A=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jA;var t=DA(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},zA=k1(),ns="data-scroll-locked",FA=function(e,t,n,i){var o=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
63
- .`.concat(bA,` {
64
- overflow: hidden `).concat(i,`;
65
- padding-right: `).concat(c,"px ").concat(i,`;
66
- }
67
- body[`).concat(ns,`] {
68
- overflow: hidden `).concat(i,`;
69
- overscroll-behavior: contain;
70
- `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
71
- padding-left: `.concat(o,`px;
72
- padding-top: `).concat(a,`px;
73
- padding-right: `).concat(l,`px;
74
- margin-left:0;
75
- margin-top:0;
76
- margin-right: `).concat(c,"px ").concat(i,`;
77
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
78
- }
79
-
80
- .`).concat(Ul,` {
81
- right: `).concat(c,"px ").concat(i,`;
82
- }
83
-
84
- .`).concat(Hl,` {
85
- margin-right: `).concat(c,"px ").concat(i,`;
86
- }
87
-
88
- .`).concat(Ul," .").concat(Ul,` {
89
- right: 0 `).concat(i,`;
90
- }
91
-
92
- .`).concat(Hl," .").concat(Hl,` {
93
- margin-right: 0 `).concat(i,`;
94
- }
95
-
96
- body[`).concat(ns,`] {
97
- `).concat(kA,": ").concat(c,`px;
98
- }
99
- `)},Pv=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},BA=function(){O.useEffect(function(){return document.body.setAttribute(ns,(Pv()+1).toString()),function(){var e=Pv()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},VA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;BA();var a=O.useMemo(function(){return $A(o)},[o]);return O.createElement(zA,{styles:FA(a,!t,o,n?"":"!important")})},_h=!1;if(typeof window<"u")try{var Ol=Object.defineProperty({},"passive",{get:function(){return _h=!0,!0}});window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{_h=!1}var Ui=_h?{passive:!1}:!1,WA=function(e){return e.tagName==="TEXTAREA"},S1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!WA(e)&&n[t]==="visible")},UA=function(e){return S1(e,"overflowY")},HA=function(e){return S1(e,"overflowX")},Av=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=E1(e,i);if(o){var a=N1(e,i),l=a[1],c=a[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},qA=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},YA=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},E1=function(e,t){return e==="v"?UA(t):HA(t)},N1=function(e,t){return e==="v"?qA(t):YA(t)},KA=function(e,t){return e==="h"&&t==="rtl"?-1:1},GA=function(e,t,n,i,o){var a=KA(e,window.getComputedStyle(t).direction),l=a*i,c=n.target,f=t.contains(c),h=!1,m=l>0,d=0,g=0;do{if(!c)break;var v=N1(e,c),x=v[0],w=v[1],b=v[2],S=w-b-a*x;(x||S)&&E1(e,c)&&(d+=S,g+=x);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(d)<1||!m&&Math.abs(g)<1)&&(h=!0),h},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mv=function(e){return[e.deltaX,e.deltaY]},Rv=function(e){return e&&"current"in e?e.current:e},XA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},QA=function(e){return`
100
- .block-interactivity-`.concat(e,` {pointer-events: none;}
101
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
102
- `)},JA=0,Hi=[];function ZA(e){var t=O.useRef([]),n=O.useRef([0,0]),i=O.useRef(),o=O.useState(JA++)[0],a=O.useState(k1)[0],l=O.useRef(e);O.useEffect(function(){l.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=xA([e.lockRef.current],(e.shards||[]).map(Rv),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=O.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var S=Pl(w),_=n.current,E="deltaX"in w?w.deltaX:_[0]-S[0],T="deltaY"in w?w.deltaY:_[1]-S[1],A,R=w.target,M=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in w&&M==="h"&&R.type==="range")return!1;var C=window.getSelection(),P=C&&C.anchorNode,j=P?P===R||P.contains(R):!1;if(j)return!1;var L=Av(M,R);if(!L)return!0;if(L?A=M:(A=M==="v"?"h":"v",L=Av(M,R)),!L)return!1;if(!i.current&&"changedTouches"in w&&(E||T)&&(i.current=A),!A)return!0;var D=i.current||A;return GA(D,b,w,D==="h"?E:T)},[]),f=O.useCallback(function(w){var b=w;if(!(!Hi.length||Hi[Hi.length-1]!==a)){var S="deltaY"in b?Mv(b):Pl(b),_=t.current.filter(function(A){return A.name===b.type&&(A.target===b.target||b.target===A.shadowParent)&&XA(A.delta,S)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var E=(l.current.shards||[]).map(Rv).filter(Boolean).filter(function(A){return A.contains(b.target)}),T=E.length>0?c(b,E[0]):!l.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),h=O.useCallback(function(w,b,S,_){var E={name:w,delta:b,target:S,should:_,shadowParent:eM(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=O.useCallback(function(w){n.current=Pl(w),i.current=void 0},[]),d=O.useCallback(function(w){h(w.type,Mv(w),w.target,c(w,e.lockRef.current))},[]),g=O.useCallback(function(w){h(w.type,Pl(w),w.target,c(w,e.lockRef.current))},[]);O.useEffect(function(){return Hi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",f,Ui),document.addEventListener("touchmove",f,Ui),document.addEventListener("touchstart",m,Ui),function(){Hi=Hi.filter(function(w){return w!==a}),document.removeEventListener("wheel",f,Ui),document.removeEventListener("touchmove",f,Ui),document.removeEventListener("touchstart",m,Ui)}},[]);var v=e.removeScrollBar,x=e.inert;return O.createElement(O.Fragment,null,x?O.createElement(a,{styles:QA(o)}):null,v?O.createElement(VA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tM=IA(b1,ZA);var _1=O.forwardRef(function(e,t){return O.createElement(Cu,Pn({},e,{ref:t,sideCar:tM}))});_1.classNames=Cu.classNames;var nM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qi=new WeakMap,Al=new WeakMap,Ml={},th=0,C1=function(e){return e&&(e.host||C1(e.parentNode))},rM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=C1(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},iM=function(e,t,n,i){var o=rM(t,Array.isArray(e)?e:[e]);Ml[n]||(Ml[n]=new WeakMap);var a=Ml[n],l=[],c=new Set,f=new Set(o),h=function(d){!d||c.has(d)||(c.add(d),h(d.parentNode))};o.forEach(h);var m=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(i),x=v!==null&&v!=="false",w=(qi.get(g)||0)+1,b=(a.get(g)||0)+1;qi.set(g,w),a.set(g,b),l.push(g),w===1&&x&&Al.set(g,!0),b===1&&g.setAttribute(n,"true"),x||g.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(t),c.clear(),th++,function(){l.forEach(function(d){var g=qi.get(d)-1,v=a.get(d)-1;qi.set(d,g),a.set(d,v),g||(Al.has(d)||d.removeAttribute(i),Al.delete(d)),v||d.removeAttribute(n)}),th--,th||(qi=new WeakMap,qi=new WeakMap,Al=new WeakMap,Ml={})}},sM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=nM(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),iM(i,o,n,"aria-hidden")):function(){return null}},Tu="Dialog",[T1]=d1(Tu),[oM,wn]=T1(Tu),I1=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=O.useRef(null),f=O.useRef(null),[h,m]=$P({prop:i,defaultProp:o??!1,onChange:a,caller:Tu});return N.jsx(oM,{scope:t,triggerRef:c,contentRef:f,contentId:Gd(),titleId:Gd(),descriptionId:Gd(),open:h,onOpenChange:m,onOpenToggle:O.useCallback(()=>m(d=>!d),[m]),modal:l,children:n})};I1.displayName=Tu;var O1="DialogTrigger",aM=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(O1,n),a=Ut(t,o.triggerRef);return N.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":up(o.open),...i,ref:a,onClick:St(e.onClick,o.onOpenToggle)})});aM.displayName=O1;var sp="DialogPortal",[lM,P1]=T1(sp,{forceMount:void 0}),A1=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:o}=e,a=wn(sp,t);return N.jsx(lM,{scope:t,forceMount:n,children:O.Children.map(i,l=>N.jsx(Mr,{present:n||a.open,children:N.jsx(v1,{asChild:!0,container:o,children:l})}))})};A1.displayName=sp;var au="DialogOverlay",op=O.forwardRef((e,t)=>{const n=P1(au,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(au,e.__scopeDialog);return a.modal?N.jsx(Mr,{present:i||a.open,children:N.jsx(cM,{...o,ref:t})}):null});op.displayName=au;var uM=h1("DialogOverlay.RemoveScroll"),cM=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(au,n),a=iA(),l=Ut(t,a);return N.jsx(_1,{as:uM,allowPinchZoom:!0,shards:[o.contentRef],children:N.jsx(Rt.div,{"data-state":up(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),hs="DialogContent",ap=O.forwardRef((e,t)=>{const n=P1(hs,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(hs,e.__scopeDialog);return N.jsx(Mr,{present:i||a.open,children:a.modal?N.jsx(fM,{...o,ref:t}):N.jsx(dM,{...o,ref:t})})});ap.displayName=hs;var fM=O.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=O.useRef(null),o=Ut(t,n.contentRef,i);return O.useEffect(()=>{const a=i.current;if(a)return sM(a)},[]),N.jsx(M1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:St(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:St(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&a.preventDefault()}),onFocusOutside:St(e.onFocusOutside,a=>a.preventDefault())})}),dM=O.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=O.useRef(!1),o=O.useRef(!1);return N.jsx(M1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(i.current||(c=n.triggerRef.current)==null||c.focus(),a.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),M1=O.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...l}=e,c=wn(hs,n);return wA(),N.jsx(N.Fragment,{children:N.jsx(g1,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:N.jsx(p1,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":up(c.open),...l,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),R1="DialogTitle",lp=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(R1,n);return N.jsx(Rt.h2,{id:o.titleId,...i,ref:t})});lp.displayName=R1;var L1="DialogDescription",hM=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(L1,n);return N.jsx(Rt.p,{id:o.descriptionId,...i,ref:t})});hM.displayName=L1;var j1="DialogClose",D1=O.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(j1,n);return N.jsx(Rt.button,{type:"button",...i,ref:t,onClick:St(e.onClick,()=>o.onOpenChange(!1))})});D1.displayName=j1;function up(e){return e?"open":"closed"}/**
103
- * @license lucide-react v0.513.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const pM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),Lv=e=>{const t=mM(e);return t.charAt(0).toUpperCase()+t.slice(1)},$1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),gM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
108
- * @license lucide-react v0.513.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */var yM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
113
- * @license lucide-react v0.513.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const vM=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:a,iconNode:l,...c},f)=>O.createElement("svg",{ref:f,...yM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:$1("lucide",o),...!a&&!gM(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,m])=>O.createElement(h,m)),...Array.isArray(a)?a:[a]]));/**
118
- * @license lucide-react v0.513.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const wM=(e,t)=>{const n=O.forwardRef(({className:i,...o},a)=>O.createElement(vM,{ref:a,iconNode:t,className:$1(`lucide-${pM(Lv(e))}`,`lucide-${e}`,i),...o}));return n.displayName=Lv(e),n};/**
123
- * @license lucide-react v0.513.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const xM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bM=wM("x",xM),kM=I1,SM=A1,z1=O.forwardRef(({className:e,...t},n)=>N.jsx(op,{className:je("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));z1.displayName=op.displayName;const F1=O.forwardRef(({side:e="right",className:t,children:n,...i},o)=>N.jsxs(SM,{children:[N.jsx(z1,{}),N.jsxs(ap,{ref:o,className:je("fixed z-50 bg-bg shadow-lg transition flex flex-col",e==="right"&&"inset-y-0 right-0 w-80 border-l border-border",e==="left"&&"inset-y-0 left-0 w-80 border-r border-border",t),...i,children:[n,N.jsxs(D1,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[N.jsx(bM,{className:"h-4 w-4"}),N.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));F1.displayName=ap.displayName;const B1=({className:e,...t})=>N.jsx("div",{className:je("flex flex-col space-y-2 p-4 border-b border-border",e),...t});B1.displayName="SheetHeader";const V1=O.forwardRef(({className:e,...t},n)=>N.jsx(lp,{ref:n,className:je("font-semibold",e),...t}));V1.displayName=lp.displayName;var EM=O.createContext(void 0);function NM(e){const t=O.useContext(EM);return e||t||"ltr"}function _M(e,[t,n]){return Math.min(n,Math.max(t,e))}function CM(e,t){return O.useReducer((n,i)=>t[n][i]??n,e)}var cp="ScrollArea",[W1]=d1(cp),[TM,rn]=W1(cp),U1=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:a=600,...l}=e,[c,f]=O.useState(null),[h,m]=O.useState(null),[d,g]=O.useState(null),[v,x]=O.useState(null),[w,b]=O.useState(null),[S,_]=O.useState(0),[E,T]=O.useState(0),[A,R]=O.useState(!1),[M,C]=O.useState(!1),P=Ut(t,L=>f(L)),j=NM(o);return N.jsx(TM,{scope:n,type:i,dir:j,scrollHideDelay:a,scrollArea:c,viewport:h,onViewportChange:m,content:d,onContentChange:g,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:A,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:M,onScrollbarYEnabledChange:C,onCornerWidthChange:_,onCornerHeightChange:T,children:N.jsx(Rt.div,{dir:j,...l,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});U1.displayName=cp;var H1="ScrollAreaViewport",q1=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:o,...a}=e,l=rn(H1,n),c=O.useRef(null),f=Ut(t,c,l.onViewportChange);return N.jsxs(N.Fragment,{children:[N.jsx(IM,{nonce:o}),N.jsx(Rt.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:N.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});q1.displayName=H1;var IM=O.memo(({nonce:e})=>N.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),Ln="ScrollAreaScrollbar",fp=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Ln,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=o,c=e.orientation==="horizontal";return O.useEffect(()=>(c?a(!0):l(!0),()=>{c?a(!1):l(!1)}),[c,a,l]),o.type==="hover"?N.jsx(OM,{...i,ref:t,forceMount:n}):o.type==="scroll"?N.jsx(PM,{...i,ref:t,forceMount:n}):o.type==="auto"?N.jsx(Y1,{...i,ref:t,forceMount:n}):o.type==="always"?N.jsx(dp,{...i,ref:t,"data-state":"visible"}):null});fp.displayName=Ln;var OM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Ln,e.__scopeScrollArea),[a,l]=O.useState(!1);return O.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const h=()=>{window.clearTimeout(f),l(!0)},m=()=>{f=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),N.jsx(Mr,{present:n||a,children:N.jsx(Y1,{"data-state":a?"visible":"hidden",...i,ref:t})})}),PM=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Ln,e.__scopeScrollArea),a=e.orientation==="horizontal",l=Ou(()=>f("SCROLL_END"),100),[c,f]=CM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,o.scrollHideDelay,f]),O.useEffect(()=>{const h=o.viewport,m=a?"scrollLeft":"scrollTop";if(h){let d=h[m];const g=()=>{const v=h[m];d!==v&&(f("SCROLL"),l()),d=v};return h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[o.viewport,a,f,l]),N.jsx(Mr,{present:n||c!=="hidden",children:N.jsx(dp,{"data-state":c==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:St(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:St(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),Y1=O.forwardRef((e,t)=>{const n=rn(Ln,e.__scopeScrollArea),{forceMount:i,...o}=e,[a,l]=O.useState(!1),c=e.orientation==="horizontal",f=Ou(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?h:m)}},10);return ps(n.viewport,f),ps(n.content,f),N.jsx(Mr,{present:i||a,children:N.jsx(dp,{"data-state":a?"visible":"hidden",...o,ref:t})})}),dp=O.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,o=rn(Ln,e.__scopeScrollArea),a=O.useRef(null),l=O.useRef(0),[c,f]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=J1(c.viewport,c.content),m={...i,sizes:c,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function d(g,v){return DM(g,l.current,c,v)}return n==="horizontal"?N.jsx(AM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollLeft,v=jv(g,c,o.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=d(g,o.dir))}}):n==="vertical"?N.jsx(MM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollTop,v=jv(g,c);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=d(g))}}):null}),AM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Ln,e.__scopeScrollArea),[l,c]=O.useState(),f=O.useRef(null),h=Ut(t,f,a.onScrollbarXChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),N.jsx(G1,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Iu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),eb(g,d)&&m.preventDefault()}},onResize:()=>{f.current&&a.viewport&&l&&i({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:uu(l.paddingLeft),paddingEnd:uu(l.paddingRight)}})}})}),MM=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Ln,e.__scopeScrollArea),[l,c]=O.useState(),f=O.useRef(null),h=Ut(t,f,a.onScrollbarYChange);return O.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),N.jsx(G1,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Iu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),eb(g,d)&&m.preventDefault()}},onResize:()=>{f.current&&a.viewport&&l&&i({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:uu(l.paddingTop),paddingEnd:uu(l.paddingBottom)}})}})}),[RM,K1]=W1(Ln),G1=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:o,onThumbChange:a,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:d,...g}=e,v=rn(Ln,n),[x,w]=O.useState(null),b=Ut(t,P=>w(P)),S=O.useRef(null),_=O.useRef(""),E=v.viewport,T=i.content-i.viewport,A=Zt(m),R=Zt(f),M=Ou(d,10);function C(P){if(S.current){const j=P.clientX-S.current.left,L=P.clientY-S.current.top;h({x:j,y:L})}}return O.useEffect(()=>{const P=j=>{const L=j.target;(x==null?void 0:x.contains(L))&&A(j,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[E,x,T,A]),O.useEffect(R,[i,R]),ps(x,M),ps(v.content,M),N.jsx(RM,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Zt(a),onThumbPointerUp:Zt(l),onThumbPositionChange:R,onThumbPointerDown:Zt(c),children:N.jsx(Rt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:St(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),S.current=x.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),C(P))}),onPointerMove:St(e.onPointerMove,C),onPointerUp:St(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})})})}),lu="ScrollAreaThumb",X1=O.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=K1(lu,e.__scopeScrollArea);return N.jsx(Mr,{present:n||o.hasThumb,children:N.jsx(LM,{ref:t,...i})})}),LM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...o}=e,a=rn(lu,n),l=K1(lu,n),{onThumbPositionChange:c}=l,f=Ut(t,d=>l.onThumbChange(d)),h=O.useRef(void 0),m=Ou(()=>{h.current&&(h.current(),h.current=void 0)},100);return O.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(m(),!h.current){const v=$M(d,c);h.current=v,c()}};return c(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,m,c]),N.jsx(Rt.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:St(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),x=d.clientX-v.left,w=d.clientY-v.top;l.onThumbPointerDown({x,y:w})}),onPointerUp:St(e.onPointerUp,l.onThumbPointerUp)})});X1.displayName=lu;var hp="ScrollAreaCorner",Q1=O.forwardRef((e,t)=>{const n=rn(hp,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?N.jsx(jM,{...e,ref:t}):null});Q1.displayName=hp;var jM=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,o=rn(hp,n),[a,l]=O.useState(0),[c,f]=O.useState(0),h=!!(a&&c);return ps(o.scrollbarX,()=>{var d;const m=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),ps(o.scrollbarY,()=>{var d;const m=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(m),l(m)}),h?N.jsx(Rt.div,{...i,ref:t,style:{width:a,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function uu(e){return e?parseInt(e,10):0}function J1(e,t){const n=e/t;return isNaN(n)?0:n}function Iu(e){const t=J1(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function DM(e,t,n,i="ltr"){const o=Iu(n),a=o/2,l=t||a,c=o-l,f=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,d=i==="ltr"?[0,m]:[m*-1,0];return Z1([f,h],d)(e)}function jv(e,t,n="ltr"){const i=Iu(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,l=t.content-t.viewport,c=a-i,f=n==="ltr"?[0,l]:[l*-1,0],h=_M(e,f);return Z1([0,l],[0,c])(h)}function Z1(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function eb(e,t){return e>0&&e<t}var $M=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function o(){const a={left:e.scrollLeft,top:e.scrollTop},l=n.left!==a.left,c=n.top!==a.top;(l||c)&&t(),n=a,i=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(i)};function Ou(e,t){const n=Zt(e),i=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(i.current),[]),O.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function ps(e,t){const n=Zt(t);ds(()=>{let i=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(i),o.unobserve(e)}}},[e,n])}var tb=U1,zM=q1,FM=Q1;const nb=O.forwardRef(({className:e,children:t,...n},i)=>N.jsxs(tb,{ref:i,className:je("relative overflow-hidden",e),...n,children:[N.jsx(zM,{className:"h-full w-full rounded-[inherit]",children:t}),N.jsx(rb,{}),N.jsx(FM,{})]}));nb.displayName=tb.displayName;const rb=O.forwardRef(({className:e,orientation:t="vertical",...n},i)=>N.jsx(fp,{ref:i,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:N.jsx(X1,{className:"relative flex-1 rounded-full bg-border"})}));rb.displayName=fp.displayName;const Dv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$v=Bx,BM=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return $v(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],d=a==null?void 0:a[h];if(m===null)return null;const g=Dv(m)||Dv(d);return o[h][g]}),c=n&&Object.entries(n).reduce((h,m)=>{let[d,g]=m;return g===void 0||(h[d]=g),h},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,m)=>{let{class:d,className:g,...v}=m;return Object.entries(v).every(x=>{let[w,b]=x;return Array.isArray(b)?b.includes({...a,...c}[w]):{...a,...c}[w]===b})?[...h,d,g]:h},[]);return $v(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},VM=BM("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono font-medium uppercase tracking-wide transition-colors",{variants:{variant:{default:"bg-fg text-bg",agent:"bg-agent/10 text-agent",muted:"bg-muted text-mutedfg"}},defaultVariants:{variant:"default"}});function WM({className:e,variant:t,...n}){return N.jsx("div",{className:je(VM({variant:t}),e),...n})}function Ir(e){return Number.isFinite(e)?e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`:"—"}function cu(e){return Number.isFinite(e)?e===0?"$0":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`:"—"}const zv={idle:{label:"idle",cls:"text-mutedfg"},running:{label:"running",cls:"text-run"},success:{label:"success",cls:"text-ok"},failed:{label:"failed",cls:"text-fail"}};function UM({node:e,onClose:t,agentDefaults:n,agents:i,status:o,output:a,error:l,activity:c,usage:f}){const h=(e==null?void 0:e.type)==="agent.run",m=(e==null?void 0:e.config)??{},d=m.agent?i==null?void 0:i[m.agent]:void 0,g=m.model??(d==null?void 0:d.model)??(n==null?void 0:n.model)??"claude-opus-4-8",v=!m.model,x=m.model?void 0:d!=null&&d.model?`from agent ${m.agent}`:"project default",w=m.effort??(d==null?void 0:d.effort)??(n==null?void 0:n.effort)??"high",b=!m.effort,S=m.effort?void 0:d!=null&&d.effort?`from agent ${m.agent}`:n!=null&&n.effort?"project default":"model default";return N.jsx(kM,{open:!!e,onOpenChange:_=>!_&&t(),children:N.jsxs(F1,{side:"right",children:[N.jsx(B1,{children:N.jsxs(V1,{className:"flex items-center gap-2",children:[h&&N.jsx(WM,{variant:"agent",children:"agent"}),N.jsx("span",{className:h?"text-agent":void 0,children:e==null?void 0:e.id})]})}),N.jsx(nb,{className:"flex-1 p-4",children:e&&N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),N.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),N.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),h&&N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),m.agent&&N.jsxs("div",{"data-testid":"agent-ref",className:"mt-1 mb-2 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:[m.agent,!d&&N.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),N.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[N.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),N.jsx("div",{className:"font-mono text-[12px] truncate",children:g}),v&&x&&N.jsx("div",{className:"text-[10px] text-mutedfg",children:x})]}),N.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),N.jsx("div",{className:"font-mono text-[12px]",children:w}),b&&S&&N.jsx("div",{className:"text-[10px] text-mutedfg",children:S})]})]}),(d==null?void 0:d.commands)&&d.commands.length>0&&N.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),N.jsx("div",{className:"mt-1 space-y-1",children:d.commands.map(_=>N.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[N.jsx("span",{className:"font-mono text-[12px]",children:_.name}),_.name===d.fallback&&N.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),_.description&&N.jsx("div",{className:"text-[11px] text-mutedfg",children:_.description})]},_.name))})]})]}),f&&f.totalTokens>0&&N.jsxs("div",{"data-testid":"node-usage",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Token usage"}),N.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-x-4 gap-y-1 text-[12px]",children:[N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"total"}),N.jsx("span",{className:"font-mono font-medium",children:Ir(f.totalTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cost"}),N.jsx("span",{className:"font-mono font-medium",children:cu(f.costUsd)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"input"}),N.jsx("span",{className:"font-mono",children:Ir(f.inputTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"output"}),N.jsx("span",{className:"font-mono",children:Ir(f.outputTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cache read"}),N.jsx("span",{className:"font-mono",children:Ir(f.cacheReadTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cache write"}),N.jsx("span",{className:"font-mono",children:Ir(f.cacheCreationTokens)})]})]})]}),c&&c.length>0&&N.jsxs("div",{"data-testid":"node-activity-log",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent activity"}),N.jsx("div",{className:"mt-1 space-y-1.5",children:c.map((_,E)=>{if(_.kind==="tool_use"){const A=_.input!==void 0?JSON.stringify(_.input):"";return N.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded-md px-2.5 py-1.5 break-all",children:[N.jsxs("span",{className:"text-agent",children:["🔧 ",_.tool]}),A&&N.jsxs("span",{className:"text-mutedfg",children:[" ",A.length>200?A.slice(0,200)+"…":A]})]},E)}if(_.kind==="tool_result")return N.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2.5 break-all",children:["↳ ",_.text]},E);const T=_.kind==="thinking";return N.jsx("div",{className:`text-[12px] px-2.5 py-1 whitespace-pre-wrap break-words ${T?"text-mutedfg italic":"text-fg"}`,children:_.text},E)})})]}),(o||a!==void 0||l)&&N.jsxs("div",{"data-testid":"node-last-run",children:[N.jsxs("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg flex items-center gap-2",children:["Last run",o&&N.jsx("span",{className:`text-[11px] font-medium ${zv[o].cls}`,children:zv[o].label})]}),l&&N.jsx("pre",{"data-testid":"node-output-error",className:"mt-1 text-[11px] font-mono text-fail bg-fail/5 rounded-md p-2.5 whitespace-pre-wrap break-words",children:l}),a!==void 0?N.jsx("pre",{"data-testid":"node-output",className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all max-h-80 overflow-y-auto",children:a}):!l&&N.jsx("div",{className:"mt-1 text-[11px] text-mutedfg px-1",children:"No output captured yet — run the workflow to see what this node fetches."})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),N.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all",children:JSON.stringify(e.config,null,2)})]}),e.retry&&N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),N.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[N.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",N.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),N.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",N.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}const HM={mcp__atlassian__editJiraIssue:{kind:"issue",action:"edited issue",field:"issueIdOrKey"},mcp__atlassian__transitionJiraIssue:{kind:"issue",action:"transitioned",field:"issueIdOrKey"},mcp__atlassian__addCommentToJiraIssue:{kind:"comment",action:"commented on",field:"issueIdOrKey"},mcp__atlassian__createJiraIssue:{kind:"issue",action:"created issue"},mcp__atlassian__updateConfluencePage:{kind:"page",action:"edited page",field:"pageId"},mcp__atlassian__createConfluencePage:{kind:"page",action:"created page"},mcp__atlassian__createConfluenceFooterComment:{kind:"comment",action:"commented on page",field:"pageId"},mcp__atlassian__createConfluenceInlineComment:{kind:"comment",action:"commented on page",field:"pageId"}},qM=/https?:\/\/[^\s"')]+atlassian\.net[^\s"')]*/g;function YM(e,t){if(!t||!e||typeof e!="object")return;const n=e[t];return typeof n=="string"||typeof n=="number"?String(n):void 0}function KM(e,t,n){if(!(!n||!t))return e==="page"?`https://${n}/wiki/pages/viewpage.action?pageId=${encodeURIComponent(t)}`:`https://${n}/browse/${encodeURIComponent(t)}`}function GM(e,t){var o,a,l;if(!e)return[];const n=[];for(const c of e.order){const f=((o=e.nodes[c])==null?void 0:o.activity)??[];for(let h=0;h<f.length;h++){const m=f[h];if(m.kind!=="tool_use"||!m.tool)continue;const d=HM[m.tool];if(!d)continue;const g=YM(m.input,d.field),x=(l=(((a=f[h+1])==null?void 0:a.kind)==="tool_result"?f[h+1].text??"":"").match(qM))==null?void 0:l[0];n.push({kind:d.kind,action:d.action,target:g,url:x??KM(d.kind,g,t),nodeId:c})}}const i=new Set;return n.filter(c=>{const f=`${c.action}|${c.target??""}|${c.url??""}`;return i.has(f)?!1:(i.add(f),!0)})}function Ch(e,t=300){const n=e.replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}function nh(e){return e==="running"?"bg-run pulse-dot":e==="failed"?"bg-fail":"bg-ok"}function Fv(e){if(!e.finishedAt)return;const t=e.finishedAt-e.startedAt;return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}const XM={issue:"🪪",page:"📄",comment:"💬"};function QM({a:e}){if(e.kind==="tool_use"){const n=e.input!==void 0?Ch(JSON.stringify(e.input),160):"";return N.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded px-2 py-1 break-all",children:[N.jsxs("span",{className:"text-agent",children:["🔧 ",e.tool]}),n&&N.jsxs("span",{className:"text-mutedfg",children:[" ",n]})]})}if(e.kind==="tool_result")return N.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2 break-all",children:["↳ ",Ch(e.text??"")]});const t=e.kind==="thinking";return N.jsx("div",{className:je("text-[12px] px-2 py-0.5 whitespace-pre-wrap break-words",t?"text-mutedfg italic":"text-fg"),children:e.text})}function JM({workflowName:e,workflowTitle:t,runs:n,runDetails:i,atlassianSite:o,onClose:a}){var v;const l=e?n.filter(x=>x.workflow===e):n,[c,f]=O.useState(null),h=c&&l.some(x=>x.id===c)?c:((v=l[0])==null?void 0:v.id)??null,m=l.find(x=>x.id===h)??null,d=h?i[h]:void 0,g=O.useMemo(()=>GM(d,o),[d,o]);return N.jsxs("aside",{className:"w-[48rem] max-w-[60vw] shrink-0 bg-bg border-l border-border flex flex-col",children:[N.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[N.jsxs("span",{className:"font-semibold tracking-tight truncate",title:t??e,children:["Runs · ",t??e??"all"]}),N.jsx("button",{onClick:a,className:"ml-auto text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),N.jsxs("div",{className:"flex-1 flex min-h-0",children:[N.jsxs("div",{className:"w-56 shrink-0 border-r border-border overflow-y-auto p-2 space-y-1",children:[l.length===0&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-2",children:"no runs yet"}),l.slice(0,60).map(x=>N.jsxs("button",{"data-testid":"scoped-run-row",onClick:()=>f(x.id),className:je("w-full text-left rounded-md px-2.5 py-1.5 flex items-center gap-2 border transition-colors",x.id===h?"bg-muted border-border":"bg-muted/30 border-transparent hover:bg-muted/60"),children:[N.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",nh(x.status))}),N.jsx("span",{className:"font-mono text-[11px] text-fg truncate",children:x.label??x.workflow}),x.usage&&x.usage.totalTokens>0&&N.jsx("span",{className:"font-mono text-[10px] text-agent ml-auto shrink-0",children:Ir(x.usage.totalTokens)})]},x.id))]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-w-0","data-testid":"run-detail",children:[!m&&N.jsx("div",{className:"text-[12px] text-mutedfg",children:"select a run to see its breakdown"}),m&&N.jsxs(N.Fragment,{children:[N.jsxs("div",{children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:je("size-2 rounded-full",nh(m.status))}),N.jsx("span",{className:"font-mono text-[13px] font-medium",children:m.label??m.workflow}),N.jsx("span",{className:"text-[11px] text-mutedfg",children:m.workflow})]}),N.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-mutedfg font-mono",children:[N.jsx("span",{children:m.status}),Fv(m)&&N.jsxs("span",{children:["· ",Fv(m)]}),m.usage&&m.usage.totalTokens>0&&N.jsxs("span",{children:["· ",Ir(m.usage.totalTokens)," tok · ",cu(m.usage.costUsd)]})]}),m.error&&N.jsx("div",{className:"mt-1 text-[11px] text-fail font-mono break-all",children:m.error})]}),g.length>0&&N.jsxs("div",{"data-testid":"run-artifacts",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Touched"}),N.jsx("div",{className:"mt-1 space-y-1",children:g.map((x,w)=>N.jsxs("div",{className:"text-[12px] flex items-center gap-1.5",children:[N.jsx("span",{children:XM[x.kind]??"•"}),N.jsx("span",{className:"text-mutedfg",children:x.action}),x.url?N.jsx("a",{href:x.url,target:"_blank",rel:"noreferrer",className:"font-mono text-agent hover:underline truncate",children:x.target??x.url}):N.jsx("span",{className:"font-mono text-fg truncate",children:x.target??"—"})]},w))})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent history"}),(!d||d.order.length===0)&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-1",children:"no detail retained"}),N.jsx("div",{className:"mt-1 space-y-2",children:d==null?void 0:d.order.map(x=>{const w=d.nodes[x];return w?N.jsxs("div",{className:"border border-border rounded-md",children:[N.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-muted/40 rounded-t-md",children:[N.jsx("span",{className:je("size-1.5 rounded-full",nh(w.status))}),N.jsx("span",{className:"font-mono text-[12px] text-fg",children:x}),w.usage&&w.usage.totalTokens>0&&N.jsxs("span",{className:"font-mono text-[10px] text-agent ml-auto",children:[Ir(w.usage.totalTokens)," tok · ",cu(w.usage.costUsd)]})]}),(w.activity.length>0||w.output||w.error)&&N.jsxs("div",{className:"px-2 py-1.5 space-y-1",children:[w.activity.map((b,S)=>N.jsx(QM,{a:b},S)),w.error&&N.jsxs("div",{className:"text-[11px] text-fail font-mono break-all",children:["error: ",w.error]}),w.activity.length===0&&w.output&&N.jsx("div",{className:"text-[11px] font-mono text-mutedfg break-all",children:Ch(w.output,400)})]})]},x):null})})]})]})]})]})]})}function ZM(e){const t=Date.now()-e;return t<6e4?`${Math.max(1,Math.round(t/1e3))}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}function eR({cache:e,onReload:t,onForget:n,onClose:i}){return N.jsxs("aside",{className:"w-96 shrink-0 bg-bg border-l border-border flex flex-col",children:[N.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[N.jsx("span",{className:"font-semibold tracking-tight",children:"Cache"}),N.jsxs("span",{className:"text-[11px] text-mutedfg",children:[e.seen.length," seen"]}),N.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[N.jsx("button",{onClick:t,className:"text-[11px] text-mutedfg hover:text-fg",title:"Refresh",children:"↻"}),N.jsx("button",{onClick:i,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[N.jsx("p",{className:"text-[11px] text-mutedfg leading-snug",children:"Items the engine has already actioned (per-workflow seen-state). Clearing one makes the workflow reprocess it on the next run."}),N.jsxs("div",{children:[N.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Seen (",e.seen.length,")"]}),e.seen.length===0&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"empty"}),N.jsx("div",{className:"space-y-1",children:e.seen.map(o=>{const a=o.key.indexOf(" "),l=a>0?o.key.slice(0,a):"",c=a>0?o.key.slice(a+1):o.key;return N.jsxs("div",{"data-testid":"cache-seen-row",className:"group bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[N.jsxs("div",{className:"flex-1 min-w-0",children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[l&&N.jsx("span",{className:"text-[9px] uppercase tracking-wide text-mutedfg bg-muted rounded px-1 py-0.5",children:l}),o.label&&N.jsx("span",{className:"font-mono text-[11px] text-fg",children:o.label}),N.jsx("span",{className:"font-mono text-[11px] text-mutedfg break-all",children:c})]}),o.ts&&N.jsxs("div",{className:"text-[10px] text-mutedfg",children:["seen ",ZM(o.ts)]})]}),N.jsx("button",{"data-testid":"cache-forget",onClick:()=>n(o.key),title:`Forget "${o.key}" (reprocess it)`,className:"text-[11px] text-mutedfg hover:text-fail px-1 opacity-0 group-hover:opacity-100",children:"clear"})]},o.key)})})]}),e.cursors.length>0&&N.jsxs("div",{children:[N.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Cursors (",e.cursors.length,")"]}),N.jsx("div",{className:"space-y-1",children:e.cursors.map(o=>N.jsxs("div",{className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[N.jsxs("span",{className:"font-mono text-[11px] text-fg break-all flex-1",children:[o.key," = ",o.value]}),N.jsx("button",{onClick:()=>n(o.key),className:"text-[11px] text-mutedfg hover:text-fail px-1",children:"clear"})]},o.key))})]})]})]})}const pp=Symbol.for("yaml.alias"),Th=Symbol.for("yaml.document"),Pr=Symbol.for("yaml.map"),ib=Symbol.for("yaml.pair"),Mn=Symbol.for("yaml.scalar"),vs=Symbol.for("yaml.seq"),nn=Symbol.for("yaml.node.type"),ws=e=>!!e&&typeof e=="object"&&e[nn]===pp,Pu=e=>!!e&&typeof e=="object"&&e[nn]===Th,qo=e=>!!e&&typeof e=="object"&&e[nn]===Pr,et=e=>!!e&&typeof e=="object"&&e[nn]===ib,ze=e=>!!e&&typeof e=="object"&&e[nn]===Mn,Yo=e=>!!e&&typeof e=="object"&&e[nn]===vs;function Je(e){if(e&&typeof e=="object")switch(e[nn]){case Pr:case vs:return!0}return!1}function Ze(e){if(e&&typeof e=="object")switch(e[nn]){case pp:case Pr:case Mn:case vs:return!0}return!1}const sb=e=>(ze(e)||Je(e))&&!!e.anchor,ti=Symbol("break visit"),tR=Symbol("skip children"),Co=Symbol("remove node");function xs(e,t){const n=nR(t);Pu(e)?Qi(null,e.contents,n,Object.freeze([e]))===Co&&(e.contents=null):Qi(null,e,n,Object.freeze([]))}xs.BREAK=ti;xs.SKIP=tR;xs.REMOVE=Co;function Qi(e,t,n,i){const o=rR(e,t,n,i);if(Ze(o)||et(o))return iR(e,i,o),Qi(e,o,n,i);if(typeof o!="symbol"){if(Je(t)){i=Object.freeze(i.concat(t));for(let a=0;a<t.items.length;++a){const l=Qi(a,t.items[a],n,i);if(typeof l=="number")a=l-1;else{if(l===ti)return ti;l===Co&&(t.items.splice(a,1),a-=1)}}}else if(et(t)){i=Object.freeze(i.concat(t));const a=Qi("key",t.key,n,i);if(a===ti)return ti;a===Co&&(t.key=null);const l=Qi("value",t.value,n,i);if(l===ti)return ti;l===Co&&(t.value=null)}}return o}function nR(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function rR(e,t,n,i){var o,a,l,c,f;if(typeof n=="function")return n(e,t,i);if(qo(t))return(o=n.Map)==null?void 0:o.call(n,e,t,i);if(Yo(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,i);if(et(t))return(l=n.Pair)==null?void 0:l.call(n,e,t,i);if(ze(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,i);if(ws(t))return(f=n.Alias)==null?void 0:f.call(n,e,t,i)}function iR(e,t,n){const i=t[t.length-1];if(Je(i))i.items[e]=n;else if(et(i))e==="key"?i.key=n:i.value=n;else if(Pu(i))i.contents=n;else{const o=ws(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const sR={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},oR=e=>e.replace(/[!,[\]{}]/g,t=>sR[t]);class kt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},kt.defaultYaml,t),this.tags=Object.assign({},kt.defaultTags,n)}clone(){const t=new kt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new kt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:kt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},kt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:kt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},kt.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),o=i.shift();switch(o){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[a,l]=i;return this.tags[a]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const l=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,l),!1}}default:return n(0,`Unknown directive ${o}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,i,o]=t.match(/^(.*!)([^!]*)$/s);o||n(`The ${t} tag has no suffix`);const a=this.tags[i];if(a)try{return a+decodeURIComponent(o)}catch(l){return n(String(l)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+oR(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let o;if(t&&i.length>0&&Ze(t.contents)){const a={};xs(t.contents,(l,c)=>{Ze(c)&&c.tag&&(a[c.tag]=!0)}),o=Object.keys(a)}else o=[];for(const[a,l]of i)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||o.some(c=>c.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
128
- `)}}kt.defaultYaml={explicit:!1,version:"1.2"};kt.defaultTags={"!!":"tag:yaml.org,2002:"};function ob(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ab(e){const t=new Set;return xs(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function lb(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function aR(e,t){const n=[],i=new Map;let o=null;return{onAnchor:a=>{n.push(a),o??(o=ab(e));const l=lb(t,o);return o.add(l),l},setAnchors:()=>{for(const a of n){const l=i.get(a);if(typeof l=="object"&&l.anchor&&(ze(l.node)||Je(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:i}}function Ji(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let o=0,a=i.length;o<a;++o){const l=i[o],c=Ji(e,i,String(o),l);c===void 0?delete i[o]:c!==l&&(i[o]=c)}else if(i instanceof Map)for(const o of Array.from(i.keys())){const a=i.get(o),l=Ji(e,i,o,a);l===void 0?i.delete(o):l!==a&&i.set(o,l)}else if(i instanceof Set)for(const o of Array.from(i)){const a=Ji(e,i,o,o);a===void 0?i.delete(o):a!==o&&(i.delete(o),i.add(a))}else for(const[o,a]of Object.entries(i)){const l=Ji(e,i,o,a);l===void 0?delete i[o]:l!==a&&(i[o]=l)}return e.call(t,n,i)}function tn(e,t,n){if(Array.isArray(e))return e.map((i,o)=>tn(i,String(o),n));if(e&&typeof e.toJSON=="function"){if(!n||!sb(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=a=>{i.res=a,delete n.onCreate};const o=e.toJSON(t,n);return n.onCreate&&n.onCreate(o),o}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class mp{constructor(t){Object.defineProperty(this,nn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!Pu(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=tn(this,"",l);if(typeof o=="function")for(const{count:f,res:h}of l.anchors.values())o(h,f);return typeof a=="function"?Ji(a,{"":c},"",c):c}}class gp extends mp{constructor(t){super(pp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],xs(t,{Node:(a,l)=>{(ws(l)||sb(l))&&i.push(l)}}),n&&(n.aliasResolveCache=i));let o;for(const a of i){if(a===this)break;a.anchor===this.source&&(o=a)}return o}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:o,maxAliasCount:a}=n,l=this.resolve(o,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=i.get(l);if(c||(tn(l,null,n),c=i.get(l)),(c==null?void 0:c.res)===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ql(o,l,i)),c.count*c.aliasCount>a)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,i){const o=`*${this.source}`;if(t){if(ob(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${o} `}return o}}function ql(e,t,n){if(ws(t)){const i=t.resolve(e),o=n&&i&&n.get(i);return o?o.count*o.aliasCount:0}else if(Je(t)){let i=0;for(const o of t.items){const a=ql(e,o,n);a>i&&(i=a)}return i}else if(et(t)){const i=ql(e,t.key,n),o=ql(e,t.value,n);return Math.max(i,o)}return 1}const ub=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends mp{constructor(t){super(Mn),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tn(this.value,t,n)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const lR="tag:yaml.org,2002:";function uR(e,t,n){if(t){const i=n.filter(a=>a.tag===t),o=i.find(a=>!a.format)??i[0];if(!o)throw new Error(`Tag ${t} not found`);return o}return n.find(i=>{var o;return((o=i.identify)==null?void 0:o.call(i,e))&&!i.format})}function $o(e,t,n){var d,g,v;if(Pu(e)&&(e=e.contents),Ze(e))return e;if(et(e)){const x=(g=(d=n.schema[Pr]).createNode)==null?void 0:g.call(d,n.schema,null,n);return x.items.push(e),x}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:o,onTagObj:a,schema:l,sourceObjects:c}=n;let f;if(i&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=o(e)),new gp(f.anchor);f={anchor:null,node:null},c.set(e,f)}t!=null&&t.startsWith("!!")&&(t=lR+t.slice(2));let h=uR(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new Te(e);return f&&(f.node=x),x}h=e instanceof Map?l[Pr]:Symbol.iterator in Object(e)?l[vs]:l[Pr]}a&&(a(h),delete n.onTagObj);const m=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((v=h==null?void 0:h.nodeClass)==null?void 0:v.from)=="function"?h.nodeClass.from(n.schema,e,n):new Te(e);return t?m.tag=t:h.default||(m.tag=h.tag),f&&(f.node=m),m}function fu(e,t,n){let i=n;for(let o=t.length-1;o>=0;--o){const a=t[o];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const l=[];l[a]=i,i=l}else i=new Map([[a,i]])}return $o(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const So=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class cb extends mp{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Ze(i)||et(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(So(t))this.add(n);else{const[i,...o]=t,a=this.get(i,!0);if(Je(a))a.addIn(o,n);else if(a===void 0&&this.schema)this.set(i,fu(this.schema,o,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${o}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const o=this.get(n,!0);if(Je(o))return o.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...o]=t,a=this.get(i,!0);return o.length===0?!n&&ze(a)?a.value:a:Je(a)?a.getIn(o,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!et(n))return!1;const i=n.value;return i==null||t&&ze(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const o=this.get(n,!0);return Je(o)?o.hasIn(i):!1}setIn(t,n){const[i,...o]=t;if(o.length===0)this.set(i,n);else{const a=this.get(i,!0);if(Je(a))a.setIn(o,n);else if(a===void 0&&this.schema)this.set(i,fu(this.schema,o,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${o}`)}}}const cR=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Qn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ri=(e,t,n)=>e.endsWith(`
129
- `)?Qn(n,t):n.includes(`
130
- `)?`
131
- `+Qn(n,t):(e.endsWith(" ")?"":" ")+n,fb="flow",Ih="block",Yl="quoted";function Au(e,t,n="flow",{indentAtStart:i,lineWidth:o=80,minContentWidth:a=20,onFold:l,onOverflow:c}={}){if(!o||o<0)return e;o<a&&(a=0);const f=Math.max(1+a,1+o-t.length);if(e.length<=f)return e;const h=[],m={};let d=o-t.length;typeof i=="number"&&(i>o-Math.max(2,a)?h.push(0):d=o-i);let g,v,x=!1,w=-1,b=-1,S=-1;n===Ih&&(w=Bv(e,w,t.length),w!==-1&&(d=w+f));for(let E;E=e[w+=1];){if(n===Yl&&E==="\\"){switch(b=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}S=w}if(E===`
132
- `)n===Ih&&(w=Bv(e,w,t.length)),d=w+t.length+f,g=void 0;else{if(E===" "&&v&&v!==" "&&v!==`
133
- `&&v!==" "){const T=e[w+1];T&&T!==" "&&T!==`
134
- `&&T!==" "&&(g=w)}if(w>=d)if(g)h.push(g),d=g+f,g=void 0;else if(n===Yl){for(;v===" "||v===" ";)v=E,E=e[w+=1],x=!0;const T=w>S+1?w-2:b-1;if(m[T])return e;h.push(T),m[T]=!0,d=T+f,g=void 0}else x=!0}v=E}if(x&&c&&c(),h.length===0)return e;l&&l();let _=e.slice(0,h[0]);for(let E=0;E<h.length;++E){const T=h[E],A=h[E+1]||e.length;T===0?_=`
135
- ${t}${e.slice(0,A)}`:(n===Yl&&m[T]&&(_+=`${e[T]}\\`),_+=`
136
- ${t}${e.slice(T+1,A)}`)}return _}function Bv(e,t,n){let i=t,o=t+1,a=e[o];for(;a===" "||a===" ";)if(t<o+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
137
- `);i=t,o=t+1,a=e[o]}return i}const Mu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ru=e=>/^(%|---|\.\.\.)/m.test(e);function fR(e,t,n){if(!t||t<0)return!1;const i=t-n,o=e.length;if(o<=i)return!1;for(let a=0,l=0;a<o;++a)if(e[a]===`
138
- `){if(a-l>i)return!0;if(l=a+1,o-l<=i)return!1}return!0}function To(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,o=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Ru(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const m=n.substr(f+2,4);switch(m){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:m.substr(0,2)==="00"?l+="\\x"+m.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(i||n[f+2]==='"'||n.length<o)f+=1;else{for(l+=n.slice(c,f)+`
139
-
140
- `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
141
- `,f+=2;l+=a,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,i?l:Au(l,a,Yl,Mu(t,!1))}function Oh(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
142
- `)||/[ \t]\n|\n[ \t]/.test(e))return To(e,t);const n=t.indent||(Ru(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
143
- ${n}`)+"'";return t.implicitKey?i:Au(i,n,fb,Mu(t,!1))}function Zi(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=To;else{const o=e.includes('"'),a=e.includes("'");o&&!a?i=Oh:a&&!o?i=To:i=n?Oh:To}return i(e,t)}let Ph;try{Ph=new RegExp(`(^|(?<!
144
- ))
145
- +(?!
146
- |$)`,"g")}catch{Ph=/\n+(?!\n|$)/g}function Kl({comment:e,type:t,value:n},i,o,a){const{blockQuote:l,commentString:c,lineWidth:f}=i.options;if(!l||/\n[\t ]+$/.test(n))return Zi(n,i);const h=i.indent||(i.forceBlockIndent||Ru(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!fR(n,f,h.length);if(!n)return m?`|
147
- `:`>
148
- `;let d,g;for(g=n.length;g>0;--g){const A=n[g-1];if(A!==`
149
- `&&A!==" "&&A!==" ")break}let v=n.substring(g);const x=v.indexOf(`
150
- `);x===-1?d="-":n===v||x!==v.length-1?(d="+",a&&a()):d="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
151
- `&&(v=v.slice(0,-1)),v=v.replace(Ph,`$&${h}`));let w=!1,b,S=-1;for(b=0;b<n.length;++b){const A=n[b];if(A===" ")w=!0;else if(A===`
152
- `)S=b;else break}let _=n.substring(0,S<b?S+1:b);_&&(n=n.substring(_.length),_=_.replace(/\n+/g,`$&${h}`));let T=(w?h?"2":"1":"")+d;if(e&&(T+=" "+c(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!m){const A=n.replace(/\n+/g,`
153
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let R=!1;const M=Mu(i,!0);l!=="folded"&&t!==Te.BLOCK_FOLDED&&(M.onOverflow=()=>{R=!0});const C=Au(`${_}${A}${v}`,h,Ih,M);if(!R)return`>${T}
154
- ${h}${C}`}return n=n.replace(/\n+/g,`$&${h}`),`|${T}
155
- ${h}${_}${n}${v}`}function dR(e,t,n,i){const{type:o,value:a}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:m}=t;if(c&&a.includes(`
156
- `)||m&&/[[\]{},]/.test(a))return Zi(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||m||!a.includes(`
157
- `)?Zi(a,t):Kl(e,t,n,i);if(!c&&!m&&o!==Te.PLAIN&&a.includes(`
158
- `))return Kl(e,t,n,i);if(Ru(a)){if(f==="")return t.forceBlockIndent=!0,Kl(e,t,n,i);if(c&&f===h)return Zi(a,t)}const d=a.replace(/\n+/g,`$&
159
- ${f}`);if(l){const g=w=>{var b;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((b=w.test)==null?void 0:b.test(d))},{compat:v,tags:x}=t.doc.schema;if(x.some(g)||v!=null&&v.some(g))return Zi(a,t)}return c?d:Au(d,f,fb,Mu(t,!1))}function yp(e,t,n,i){const{implicitKey:o,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Te.QUOTE_DOUBLE);const f=m=>{switch(m){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return o||a?Zi(l.value,t):Kl(l,t,n,i);case Te.QUOTE_DOUBLE:return To(l.value,t);case Te.QUOTE_SINGLE:return Oh(l.value,t);case Te.PLAIN:return dR(l,t,n,i);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:m,defaultStringType:d}=t.options,g=o&&m||d;if(h=f(g),h===null)throw new Error(`Unsupported default string type ${g}`)}return h}function db(e,t){const n=Object.assign({blockQuote:!0,commentString:cR,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function hR(e,t){var o;if(t.tag){const a=e.filter(l=>l.tag===t.tag);if(a.length>0)return a.find(l=>l.format===t.format)??a[0]}let n,i;if(ze(t)){i=t.value;let a=e.filter(l=>{var c;return(c=l.identify)==null?void 0:c.call(l,i)});if(a.length>1){const l=a.filter(c=>c.test);l.length>0&&(a=l)}n=a.find(l=>l.format===t.format)??a.find(l=>!l.format)}else i=t,n=e.find(a=>a.nodeClass&&i instanceof a.nodeClass);if(!n){const a=((o=i==null?void 0:i.constructor)==null?void 0:o.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${a} value`)}return n}function pR(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const o=[],a=(ze(e)||Je(e))&&e.anchor;a&&ob(a)&&(n.add(a),o.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&o.push(i.directives.tagString(l)),o.join(" ")}function ms(e,t,n,i){var f;if(et(e))return e.toString(t,n,i);if(ws(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o;const a=Ze(e)?e:t.doc.createNode(e,{onTagObj:h=>o=h});o??(o=hR(t.doc.schema.tags,a));const l=pR(a,o,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof o.stringify=="function"?o.stringify(a,t,n,i):ze(a)?yp(a,t,n,i):a.toString(t,n,i);return l?ze(a)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
160
- ${t.indent}${c}`:c}function mR({key:e,value:t},n,i,o){const{allNullValues:a,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:m,simpleKeys:d}}=n;let g=Ze(e)&&e.comment||null;if(d){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Je(e)||!Ze(e)&&typeof e=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let v=!d&&(!e||g&&t==null&&!n.inFlow||Je(e)||(ze(e)?e.type===Te.BLOCK_FOLDED||e.type===Te.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(d||!a),indent:c+f});let x=!1,w=!1,b=ms(e,n,()=>x=!0,()=>w=!0);if(!v&&!n.inFlow&&b.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return x&&i&&i(),b===""?"?":v?`? ${b}`:b}else if(a&&!d||t==null&&v)return b=`? ${b}`,g&&!x?b+=ri(b,n.indent,h(g)):w&&o&&o(),b;x&&(g=null),v?(g&&(b+=ri(b,n.indent,h(g))),b=`? ${b}
161
- ${c}:`):(b=`${b}:`,g&&(b+=ri(b,n.indent,h(g))));let S,_,E;Ze(t)?(S=!!t.spaceBefore,_=t.commentBefore,E=t.comment):(S=!1,_=null,E=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&ze(t)&&(n.indentAtStart=b.length+1),w=!1,!m&&f.length>=2&&!n.inFlow&&!v&&Yo(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let T=!1;const A=ms(t,n,()=>T=!0,()=>w=!0);let R=" ";if(g||S||_){if(R=S?`
162
- `:"",_){const M=h(_);R+=`
163
- ${Qn(M,n.indent)}`}A===""&&!n.inFlow?R===`
164
- `&&E&&(R=`
165
-
166
- `):R+=`
167
- ${n.indent}`}else if(!v&&Je(t)){const M=A[0],C=A.indexOf(`
168
- `),P=C!==-1,j=n.inFlow??t.flow??t.items.length===0;if(P||!j){let L=!1;if(P&&(M==="&"||M==="!")){let D=A.indexOf(" ");M==="&"&&D!==-1&&D<C&&A[D+1]==="!"&&(D=A.indexOf(" ",D+1)),(D===-1||C<D)&&(L=!0)}L||(R=`
169
- ${n.indent}`)}}else(A===""||A[0]===`
170
- `)&&(R="");return b+=R+A,n.inFlow?T&&i&&i():E&&!T?b+=ri(b,n.indent,h(E)):w&&o&&o(),b}function hb(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Rl="<<",Zn={identify:e=>e===Rl||typeof e=="symbol"&&e.description===Rl,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(Rl)),{addToJSMap:pb}),stringify:()=>Rl},gR=(e,t)=>(Zn.identify(t)||ze(t)&&(!t.type||t.type===Te.PLAIN)&&Zn.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zn.tag&&n.default));function pb(e,t,n){const i=mb(e,n);if(Yo(i))for(const o of i.items)rh(e,t,o);else if(Array.isArray(i))for(const o of i)rh(e,t,o);else rh(e,t,i)}function rh(e,t,n){const i=mb(e,n);if(!qo(i))throw new Error("Merge sources must be maps or map aliases");const o=i.toJSON(null,e,Map);for(const[a,l]of o)t instanceof Map?t.has(a)||t.set(a,l):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function mb(e,t){return e&&ws(t)?t.resolve(e.doc,e):t}function gb(e,t,{key:n,value:i}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(gR(e,n))pb(e,t,i);else{const o=tn(n,"",e);if(t instanceof Map)t.set(o,tn(i,o,e));else if(t instanceof Set)t.add(o);else{const a=yR(n,o,e),l=tn(i,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function yR(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const i=db(n.doc,{});i.anchors=new Set;for(const a of n.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;const o=e.toString(i);if(!n.mapKeyWarned){let a=JSON.stringify(o);a.length>40&&(a=a.substring(0,36)+'..."'),hb(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return o}return JSON.stringify(t)}function vp(e,t,n){const i=$o(e,void 0,n),o=$o(t,void 0,n);return new Et(i,o)}class Et{constructor(t,n=null){Object.defineProperty(this,nn,{value:ib}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ze(n)&&(n=n.clone(t)),Ze(i)&&(i=i.clone(t)),new Et(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return gb(n,i,this)}toString(t,n,i){return t!=null&&t.doc?mR(this,t,n,i):JSON.stringify(this)}}function yb(e,t,n){return(t.inFlow??e.flow?wR:vR)(e,t,n)}function vR({comment:e,items:t},n,{blockItemPrefix:i,flowChars:o,itemIndent:a,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,m=Object.assign({},n,{indent:a,type:null});let d=!1;const g=[];for(let x=0;x<t.length;++x){const w=t[x];let b=null;if(Ze(w))!d&&w.spaceBefore&&g.push(""),du(n,g,w.commentBefore,d),w.comment&&(b=w.comment);else if(et(w)){const _=Ze(w.key)?w.key:null;_&&(!d&&_.spaceBefore&&g.push(""),du(n,g,_.commentBefore,d))}d=!1;let S=ms(w,m,()=>b=null,()=>d=!0);b&&(S+=ri(S,a,h(b))),d&&b&&(d=!1),g.push(i+S)}let v;if(g.length===0)v=o.start+o.end;else{v=g[0];for(let x=1;x<g.length;++x){const w=g[x];v+=w?`
171
- ${f}${w}`:`
172
- `}}return e?(v+=`
173
- `+Qn(h(e),f),c&&c()):d&&l&&l(),v}function wR({items:e},t,{flowChars:n,itemIndent:i}){const{indent:o,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=t;i+=a;const f=Object.assign({},t,{indent:i,inFlow:!0,type:null});let h=!1,m=0;const d=[];for(let x=0;x<e.length;++x){const w=e[x];let b=null;if(Ze(w))w.spaceBefore&&d.push(""),du(t,d,w.commentBefore,!1),w.comment&&(b=w.comment);else if(et(w)){const _=Ze(w.key)?w.key:null;_&&(_.spaceBefore&&d.push(""),du(t,d,_.commentBefore,!1),_.comment&&(h=!0));const E=Ze(w.value)?w.value:null;E?(E.comment&&(b=E.comment),E.commentBefore&&(h=!0)):w.value==null&&(_!=null&&_.comment)&&(b=_.comment)}b&&(h=!0);let S=ms(w,f,()=>b=null);h||(h=d.length>m||S.includes(`
174
- `)),x<e.length-1?S+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=d.reduce((_,E)=>_+E.length+2,2)+(S.length+2)>t.options.lineWidth)),h&&(S+=",")),b&&(S+=ri(S,i,c(b))),d.push(S),m=d.length}const{start:g,end:v}=n;if(d.length===0)return g+v;if(!h){const x=d.reduce((w,b)=>w+b.length+2,2);h=t.options.lineWidth>0&&x>t.options.lineWidth}if(h){let x=g;for(const w of d)x+=w?`
175
- ${a}${o}${w}`:`
176
- `;return`${x}
177
- ${o}${v}`}else return`${g}${l}${d.join(" ")}${l}${v}`}function du({indent:e,options:{commentString:t}},n,i,o){if(i&&o&&(i=i.replace(/^\n+/,"")),i){const a=Qn(t(i),e);n.push(a.trimStart())}}function ii(e,t){const n=ze(t)?t.value:t;for(const i of e)if(et(i)&&(i.key===t||i.key===n||ze(i.key)&&i.key.value===n))return i}class en extends cb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Pr,t),this.items=[]}static from(t,n,i){const{keepUndefined:o,replacer:a}=i,l=new this(t),c=(f,h)=>{if(typeof a=="function")h=a.call(n,f,h);else if(Array.isArray(a)&&!a.includes(f))return;(h!==void 0||o)&&l.items.push(vp(f,h,i))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){var l;let i;et(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Et(t,t==null?void 0:t.value):i=new Et(t.key,t.value);const o=ii(this.items,i.key),a=(l=this.schema)==null?void 0:l.sortMapEntries;if(o){if(!n)throw new Error(`Key ${i.key} already set`);ze(o.value)&&ub(i.value)?o.value.value=i.value:o.value=i.value}else if(a){const c=this.items.findIndex(f=>a(i,f)<0);c===-1?this.items.push(i):this.items.splice(c,0,i)}else this.items.push(i)}delete(t){const n=ii(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=ii(this.items,t),o=i==null?void 0:i.value;return(!n&&ze(o)?o.value:o)??void 0}has(t){return!!ii(this.items,t)}set(t,n){this.add(new Et(t,n),!0)}toJSON(t,n,i){const o=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(o);for(const a of this.items)gb(n,o,a);return o}toString(t,n,i){if(!t)return JSON.stringify(this);for(const o of this.items)if(!et(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),yb(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const bs={collection:"map",default:!0,nodeClass:en,tag:"tag:yaml.org,2002:map",resolve(e,t){return qo(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>en.from(e,t,n)};class di extends cb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(vs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Ll(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Ll(t);if(typeof i!="number")return;const o=this.items[i];return!n&&ze(o)?o.value:o}has(t){const n=Ll(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Ll(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const o=this.items[i];ze(o)&&ub(n)?o.value=n:this.items[i]=n}toJSON(t,n){const i=[];n!=null&&n.onCreate&&n.onCreate(i);let o=0;for(const a of this.items)i.push(tn(a,String(o++),n));return i}toString(t,n,i){return t?yb(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:o}=i,a=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof o=="function"){const f=n instanceof Set?c:String(l++);c=o.call(n,f,c)}a.items.push($o(c,void 0,i))}}return a}}function Ll(e){let t=ze(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const ks={collection:"seq",default:!0,nodeClass:di,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Yo(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>di.from(e,t,n)},Lu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),yp(e,t,n,i)}},ju={identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:e},t)=>typeof e=="string"&&ju.test.test(e)?e:t.options.nullStr},wp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Te(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&wp.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function xn({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const o=typeof i=="number"?i:Number(i);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let l=a.indexOf(".");l<0&&(l=a.length,a+=".");let c=t-(a.length-l-1);for(;c-- >0;)a+="0"}return a}const vb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xn},wb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():xn(e)}},xb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Te(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xn},Du=e=>typeof e=="bigint"||Number.isInteger(e),xp=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function bb(e,t,n){const{value:i}=e;return Du(i)&&i>=0?n+i.toString(t):xn(e)}const kb={identify:e=>Du(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>xp(e,2,8,n),stringify:e=>bb(e,8,"0o")},Sb={identify:Du,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>xp(e,0,10,n),stringify:xn},Eb={identify:e=>Du(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>xp(e,2,16,n),stringify:e=>bb(e,16,"0x")},xR=[bs,ks,Lu,ju,wp,kb,Sb,Eb,vb,wb,xb];function Vv(e){return typeof e=="bigint"||Number.isInteger(e)}const jl=({value:e})=>JSON.stringify(e),bR=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:jl},{identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:jl},{identify:Vv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Vv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:jl}],kR={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},SR=[bs,ks].concat(bR,kR),bp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let o=0;o<n.length;++o)i[o]=n.charCodeAt(o);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,o,a){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Te.BLOCK_LITERAL),t!==Te.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(c.length/f),m=new Array(h);for(let d=0,g=0;d<h;++d,g+=f)m[d]=c.substr(g,f);c=m.join(t===Te.BLOCK_LITERAL?`
178
- `:" ")}return yp({comment:e,type:t,value:c},i,o,a)}};function Nb(e,t){if(Yo(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!et(i)){if(qo(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const o=i.items[0]||new Et(new Te(null));if(i.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${i.commentBefore}
179
- ${o.key.commentBefore}`:i.commentBefore),i.comment){const a=o.value??o.key;a.comment=a.comment?`${i.comment}
180
- ${a.comment}`:i.comment}i=o}e.items[n]=et(i)?i:new Et(i)}}else t("Expected a sequence for this tag");return e}function _b(e,t,n){const{replacer:i}=n,o=new di(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof i=="function"&&(l=i.call(t,String(a++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;o.items.push(vp(c,f,n))}return o}const kp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Nb,createNode:_b};class rs extends di{constructor(){super(),this.add=en.prototype.add.bind(this),this.delete=en.prototype.delete.bind(this),this.get=en.prototype.get.bind(this),this.has=en.prototype.has.bind(this),this.set=en.prototype.set.bind(this),this.tag=rs.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const o of this.items){let a,l;if(et(o)?(a=tn(o.key,"",n),l=tn(o.value,a,n)):a=tn(o,"",n),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,l)}return i}static from(t,n,i){const o=_b(t,n,i),a=new this;return a.items=o.items,a}}rs.tag="tag:yaml.org,2002:omap";const Sp={collection:"seq",identify:e=>e instanceof Map,nodeClass:rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Nb(e,t),i=[];for(const{key:o}of n.items)ze(o)&&(i.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):i.push(o.value));return Object.assign(new rs,n)},createNode:(e,t,n)=>rs.from(e,t,n)};function Cb({value:e,source:t},n){return t&&(e?Tb:Ib).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Tb={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Te(!0),stringify:Cb},Ib={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Te(!1),stringify:Cb},ER={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xn},NR={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():xn(e)}},_R={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Te(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:xn},Ko=e=>typeof e=="bigint"||Number.isInteger(e);function $u(e,t,n,{intAsBigInt:i}){const o=e[0];if((o==="-"||o==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return o==="-"?BigInt(-1)*l:l}const a=parseInt(e,n);return o==="-"?-1*a:a}function Ep(e,t,n){const{value:i}=e;if(Ko(i)){const o=i.toString(t);return i<0?"-"+n+o.substr(1):n+o}return xn(e)}const CR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>$u(e,2,2,n),stringify:e=>Ep(e,2,"0b")},TR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>$u(e,1,8,n),stringify:e=>Ep(e,8,"0")},IR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>$u(e,0,10,n),stringify:xn},OR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>$u(e,2,16,n),stringify:e=>Ep(e,16,"0x")};class is extends en{constructor(t){super(t),this.tag=is.tag}add(t){let n;et(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Et(t.key,null):n=new Et(t,null),ii(this.items,n.key)||this.items.push(n)}get(t,n){const i=ii(this.items,t);return!n&&et(i)?ze(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=ii(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Et(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:o}=i,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof o=="function"&&(l=o.call(n,l,l)),a.items.push(vp(l,null,i));return a}}is.tag="tag:yaml.org,2002:set";const Np={collection:"map",identify:e=>e instanceof Set,nodeClass:is,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>is.from(e,t,n),resolve(e,t){if(qo(e)){if(e.hasAllNullValues(!0))return Object.assign(new is,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function _p(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,o=l=>t?BigInt(l):Number(l),a=i.replace(/_/g,"").split(":").reduce((l,c)=>l*o(60)+o(c),o(0));return n==="-"?o(-1)*a:a}function Ob(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return xn(e);let i="";t<0&&(i="-",t*=n(-1));const o=n(60),a=[t%o];return t<60?a.unshift(0):(t=(t-a[0])/o,a.unshift(t%o),t>=60&&(t=(t-a[0])/o,a.unshift(t))),i+a.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Pb={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>_p(e,n),stringify:Ob},Ab={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>_p(e,!1),stringify:Ob},zu={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(zu.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,o,a,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,i-1,o,a||0,l||0,c||0,f);const m=t[8];if(m&&m!=="Z"){let d=_p(m,!1);Math.abs(d)<30&&(d*=60),h-=6e4*d}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Wv=[bs,ks,Lu,ju,Tb,Ib,CR,TR,IR,OR,ER,NR,_R,bp,Zn,Sp,kp,Np,Pb,Ab,zu],Uv=new Map([["core",xR],["failsafe",[bs,ks,Lu]],["json",SR],["yaml11",Wv],["yaml-1.1",Wv]]),Hv={binary:bp,bool:wp,float:xb,floatExp:wb,floatNaN:vb,floatTime:Ab,int:Sb,intHex:Eb,intOct:kb,intTime:Pb,map:bs,merge:Zn,null:ju,omap:Sp,pairs:kp,seq:ks,set:Np,timestamp:zu},PR={"tag:yaml.org,2002:binary":bp,"tag:yaml.org,2002:merge":Zn,"tag:yaml.org,2002:omap":Sp,"tag:yaml.org,2002:pairs":kp,"tag:yaml.org,2002:set":Np,"tag:yaml.org,2002:timestamp":zu};function ih(e,t,n){const i=Uv.get(t);if(i&&!e)return n&&!i.includes(Zn)?i.concat(Zn):i.slice();let o=i;if(!o)if(Array.isArray(e))o=[];else{const a=Array.from(Uv.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)o=o.concat(a);else typeof e=="function"&&(o=e(o.slice()));return n&&(o=o.concat(Zn)),o.reduce((a,l)=>{const c=typeof l=="string"?Hv[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(Hv).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return a.includes(c)||a.push(c),a},[])}const AR=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Cp{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:o,schema:a,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?ih(t,"compat"):t?ih(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=o?PR:{},this.tags=ih(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,Pr,{value:bs}),Object.defineProperty(this,Mn,{value:Lu}),Object.defineProperty(this,vs,{value:ks}),this.sortMapEntries=typeof l=="function"?l:l===!0?AR:null}clone(){const t=Object.create(Cp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function MR(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const o=db(e,t),{commentString:a}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=a(e.commentBefore);n.unshift(Qn(h,""))}let l=!1,c=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Qn(d,""))}o.forceBlockIndent=!!e.comment,c=e.contents.comment}const h=c?void 0:()=>l=!0;let m=ms(e.contents,o,()=>c=null,h);c&&(m+=ri(m,"",a(c))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(ms(e.contents,o));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const h=a(e.comment);h.includes(`
181
- `)?(n.push("..."),n.push(Qn(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&l&&(h=h.replace(/^\n+/,"")),h&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Qn(a(h),"")))}return n.join(`
182
- `)+`
183
- `}class Fu{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,nn,{value:Th});let o=null;typeof n=="function"||Array.isArray(n)?o=n:i===void 0&&n&&(i=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:l}=a;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new kt({version:l}),this.setSchema(l,i),this.contents=t===void 0?null:this.createNode(t,o,i)}clone(){const t=Object.create(Fu.prototype,{[nn]:{value:Th}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ze(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Yi(this.contents)&&this.contents.add(t)}addIn(t,n){Yi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=ab(this);t.anchor=!n||i.has(n)?lb(n||"a",i):n}return new gp(t.anchor)}createNode(t,n,i){let o;if(typeof n=="function")t=n.call({"":t},"",t),o=n;else if(Array.isArray(n)){const b=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,S=n.filter(b).map(String);S.length>0&&(n=n.concat(S)),o=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:m}=i??{},{onAnchor:d,setAnchors:g,sourceObjects:v}=aR(this,l||"a"),x={aliasDuplicateObjects:a??!0,keepUndefined:f??!1,onAnchor:d,onTagObj:h,replacer:o,schema:this.schema,sourceObjects:v},w=$o(t,m,x);return c&&Je(w)&&(w.flow=!0),g(),w}createPair(t,n,i={}){const o=this.createNode(t,null,i),a=this.createNode(n,null,i);return new Et(o,a)}delete(t){return Yi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return So(t)?this.contents==null?!1:(this.contents=null,!0):Yi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Je(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return So(t)?!n&&ze(this.contents)?this.contents.value:this.contents:Je(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Je(this.contents)?this.contents.has(t):!1}hasIn(t){return So(t)?this.contents!==void 0:Je(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=fu(this.schema,[t],n):Yi(this.contents)&&this.contents.set(t,n)}setIn(t,n){So(t)?this.contents=n:this.contents==null?this.contents=fu(this.schema,Array.from(t),n):Yi(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new kt({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new kt({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const o=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new Cp(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:o,onAnchor:a,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},f=tn(this.contents,n??"",c);if(typeof a=="function")for(const{count:h,res:m}of c.anchors.values())a(m,h);return typeof l=="function"?Ji(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return MR(this,t)}}function Yi(e){if(Je(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Mb extends Error{constructor(t,n,i,o){super(),this.name=t,this.code=i,this.message=o,this.pos=n}}class Eo extends Mb{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class RR extends Mb{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const qv=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:i,col:o}=n.linePos[0];n.message+=` at line ${i}, column ${o}`;let a=o-1,l=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const c=Math.min(a-39,l.length-79);l="…"+l.substring(c),a-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),i>1&&/^ *$/.test(l.substring(0,a))){let c=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);c.length>80&&(c=c.substring(0,79)+`…
184
- `),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];(f==null?void 0:f.line)===i&&f.col>o&&(c=Math.max(1,Math.min(f.col-o,80-a)));const h=" ".repeat(a)+"^".repeat(c);n.message+=`:
185
-
186
- ${l}
187
- ${h}
188
- `}};function gs(e,{flow:t,indicator:n,next:i,offset:o,onError:a,parentIndent:l,startOnNewline:c}){let f=!1,h=c,m=c,d="",g="",v=!1,x=!1,w=null,b=null,S=null,_=null,E=null,T=null,A=null;for(const C of e)switch(x&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&a(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),w&&(h&&C.type!=="comment"&&C.type!=="newline"&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&C.source.includes(" ")&&(w=C),m=!0;break;case"comment":{m||a(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=C.source.substring(1)||" ";d?d+=g+P:d=P,g="",h=!1;break}case"newline":h?d?d+=C.source:(!T||n!=="seq-item-ind")&&(f=!0):g+=C.source,h=!0,v=!0,(b||S)&&(_=C),m=!0;break;case"anchor":b&&a(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&a(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=C,A??(A=C.offset),h=!1,m=!1,x=!0;break;case"tag":{S&&a(C,"MULTIPLE_TAGS","A node can have at most one tag"),S=C,A??(A=C.offset),h=!1,m=!1,x=!0;break}case n:(b||S)&&a(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),T&&a(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),T=C,h=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){E&&a(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),E=C,h=!1,m=!1;break}default:a(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),h=!1,m=!1}const R=e[e.length-1],M=R?R.offset+R.source.length:o;return x&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(h&&w.indent<=l||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:T,spaceBefore:f,comment:d,hasNewline:v,anchor:b,tag:S,newlineAfterProp:_,end:M,start:A??M}}function zo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
189
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(zo(t.key)||zo(t.value))return!0}return!1;default:return!0}}function Ah(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&zo(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Rb(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const o=typeof i=="function"?i:(a,l)=>a===l||ze(a)&&ze(l)&&a.value===l.value;return t.some(a=>o(a.key,n))}const Yv="All mapping items must start at the same column";function LR({composeNode:e,composeEmptyNode:t},n,i,o,a){var m;const l=(a==null?void 0:a.nodeClass)??en,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=i.offset,h=null;for(const d of i.items){const{start:g,key:v,sep:x,value:w}=d,b=gs(g,{indicator:"explicit-key-ind",next:v??(x==null?void 0:x[0]),offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0}),S=!b.found;if(S){if(v&&(v.type==="block-seq"?o(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==i.indent&&o(f,"BAD_INDENT",Yv)),!b.anchor&&!b.tag&&!x){h=b.end,b.comment&&(c.comment?c.comment+=`
190
- `+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||zo(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=b.found)==null?void 0:m.indent)!==i.indent&&o(f,"BAD_INDENT",Yv);n.atKey=!0;const _=b.end,E=v?e(n,v,b,o):t(n,_,g,null,b,o);n.schema.compat&&Ah(i.indent,v,o),n.atKey=!1,Rb(n,c.items,E)&&o(_,"DUPLICATE_KEY","Map keys must be unique");const T=gs(x??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:o,parentIndent:i.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=T.end,T.found){S&&((w==null?void 0:w.type)==="block-map"&&!T.hasNewline&&o(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<T.found.offset-1024&&o(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=w?e(n,w,T,o):t(n,f,x,null,T,o);n.schema.compat&&Ah(i.indent,w,o),f=A.range[2];const R=new Et(E,A);n.options.keepSourceTokens&&(R.srcToken=d),c.items.push(R)}else{S&&o(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(E.comment?E.comment+=`
191
- `+T.comment:E.comment=T.comment);const A=new Et(E);n.options.keepSourceTokens&&(A.srcToken=d),c.items.push(A)}}return h&&h<f&&o(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[i.offset,f,h??f],c}function jR({composeNode:e,composeEmptyNode:t},n,i,o,a){const l=(a==null?void 0:a.nodeClass)??di,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset,h=null;for(const{start:m,value:d}of i.items){const g=gs(m,{indicator:"seq-item-ind",next:d,offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||d)(d==null?void 0:d.type)==="block-seq"?o(g.end,"BAD_INDENT","All sequence items must start at the same column"):o(f,"MISSING_CHAR","Sequence item without - indicator");else{h=g.end,g.comment&&(c.comment=g.comment);continue}const v=d?e(n,d,g,o):t(n,g.end,m,null,g,o);n.schema.compat&&Ah(i.indent,d,o),f=v.range[2],c.items.push(v)}return c.range=[i.offset,f,h??f],c}function Go(e,t,n,i){let o="";if(e){let a=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":a=!0;break;case"comment":{n&&!a&&i(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=f.substring(1)||" ";o?o+=l+m:o=m,l="";break}case"newline":o&&(l+=f),a=!0;break;default:i(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:o,offset:t}}const sh="Block collections are not allowed within flow collections",oh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function DR({composeNode:e,composeEmptyNode:t},n,i,o,a){var b;const l=i.start.source==="{",c=l?"flow map":"flow sequence",f=(a==null?void 0:a.nodeClass)??(l?en:di),h=new f(n.schema);h.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let S=0;S<i.items.length;++S){const _=i.items[S],{start:E,key:T,sep:A,value:R}=_,M=gs(E,{flow:c,indicator:"explicit-key-ind",next:T??(A==null?void 0:A[0]),offset:d,onError:o,parentIndent:i.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!A&&!R){S===0&&M.comma?o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<i.items.length-1&&o(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),M.comment&&(h.comment?h.comment+=`
192
- `+M.comment:h.comment=M.comment),d=M.end;continue}!l&&n.options.strict&&zo(T)&&o(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)M.comma&&o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(M.comma||o(M.start,"MISSING_CHAR",`Missing , between ${c} items`),M.comment){let C="";e:for(const P of E)switch(P.type){case"comma":case"space":break;case"comment":C=P.source.substring(1);break e;default:break e}if(C){let P=h.items[h.items.length-1];et(P)&&(P=P.value??P.key),P.comment?P.comment+=`
193
- `+C:P.comment=C,M.comment=M.comment.substring(C.length+1)}}if(!l&&!A&&!M.found){const C=R?e(n,R,M,o):t(n,M.end,A,null,M,o);h.items.push(C),d=C.range[2],oh(R)&&o(C.range,"BLOCK_IN_FLOW",sh)}else{n.atKey=!0;const C=M.end,P=T?e(n,T,M,o):t(n,C,E,null,M,o);oh(T)&&o(P.range,"BLOCK_IN_FLOW",sh),n.atKey=!1;const j=gs(A??[],{flow:c,indicator:"map-value-ind",next:R,offset:P.range[2],onError:o,parentIndent:i.indent,startOnNewline:!1});if(j.found){if(!l&&!M.found&&n.options.strict){if(A)for(const X of A){if(X===j.found)break;if(X.type==="newline"){o(X,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<j.found.offset-1024&&o(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else R&&("source"in R&&((b=R.source)==null?void 0:b[0])===":"?o(R,"MISSING_CHAR",`Missing space after : in ${c}`):o(j.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const L=R?e(n,R,j,o):j.found?t(n,j.end,A,null,j,o):null;L?oh(R)&&o(L.range,"BLOCK_IN_FLOW",sh):j.comment&&(P.comment?P.comment+=`
194
- `+j.comment:P.comment=j.comment);const D=new Et(P,L);if(n.options.keepSourceTokens&&(D.srcToken=_),l){const X=h;Rb(n,X.items,P)&&o(C,"DUPLICATE_KEY","Map keys must be unique"),X.items.push(D)}else{const X=new en(n.schema);X.flow=!0,X.items.push(D);const z=(L??P).range;X.range=[P.range[0],z[1],z[2]],h.items.push(X)}d=L?L.range[2]:j.end}}const g=l?"}":"]",[v,...x]=i.end;let w=d;if((v==null?void 0:v.source)===g)w=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),_=m?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;o(d,m?"MISSING_CHAR":"BAD_INDENT",_),v&&v.source.length!==1&&x.unshift(v)}if(x.length>0){const S=Go(x,w,n.options.strict,o);S.comment&&(h.comment?h.comment+=`
195
- `+S.comment:h.comment=S.comment),h.range=[i.offset,w,S.offset]}else h.range=[i.offset,w,w];return h}function ah(e,t,n,i,o,a){const l=n.type==="block-map"?LR(e,t,n,i,a):n.type==="block-seq"?jR(e,t,n,i,a):DR(e,t,n,i,a),c=l.constructor;return o==="!"||o===c.tagName?(l.tag=c.tagName,l):(o&&(l.tag=o),l)}function $R(e,t,n,i,o){var g;const a=i.tag,l=a?t.directives.tagName(a.source,v=>o(a,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:x}=i,w=v&&a?v.offset>a.offset?v:a:v??a;w&&(!x||x.offset<w.offset)&&o(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===en.tagName&&c==="map"||l===di.tagName&&c==="seq")return ah(e,t,n,o,l);let f=t.schema.tags.find(v=>v.tag===l&&v.collection===c);if(!f){const v=t.schema.knownTags[l];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?o(a,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),ah(e,t,n,o,l)}const h=ah(e,t,n,o,l,f),m=((g=f.resolve)==null?void 0:g.call(f,h,v=>o(a,"TAG_RESOLVE_FAILED",v),t.options))??h,d=Ze(m)?m:new Te(m);return d.range=h.range,d.tag=l,f!=null&&f.format&&(d.format=f.format),d}function zR(e,t,n){const i=t.offset,o=FR(t,e.options.strict,n);if(!o)return{value:"",type:null,comment:"",range:[i,i,i]};const a=o.mode===">"?Te.BLOCK_FOLDED:Te.BLOCK_LITERAL,l=t.source?BR(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const b=l[w][1];if(b===""||b==="\r")c=w;else break}if(c===0){const w=o.chomp==="+"&&l.length>0?`
196
- `.repeat(Math.max(1,l.length-1)):"";let b=i+o.length;return t.source&&(b+=t.source.length),{value:w,type:a,comment:o.comment,range:[i,b,b]}}let f=t.indent+o.indent,h=t.offset+o.length,m=0;for(let w=0;w<c;++w){const[b,S]=l[w];if(S===""||S==="\r")o.indent===0&&b.length>f&&(f=b.length);else{b.length<f&&n(h+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(f=b.length),m=w,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=b.length+S.length+1}for(let w=l.length-1;w>=c;--w)l[w][0].length>f&&(c=w+1);let d="",g="",v=!1;for(let w=0;w<m;++w)d+=l[w][0].slice(f)+`
197
- `;for(let w=m;w<c;++w){let[b,S]=l[w];h+=b.length+S.length+1;const _=S[S.length-1]==="\r";if(_&&(S=S.slice(0,-1)),S&&b.length<f){const T=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;n(h-S.length-(_?2:1),"BAD_INDENT",T),b=""}a===Te.BLOCK_LITERAL?(d+=g+b.slice(f)+S,g=`
198
- `):b.length>f||S[0]===" "?(g===" "?g=`
199
- `:!v&&g===`
200
- `&&(g=`
201
-
202
- `),d+=g+b.slice(f)+S,g=`
203
- `,v=!0):S===""?g===`
204
- `?d+=`
205
- `:g=`
206
- `:(d+=g+S,g=" ",v=!1)}switch(o.chomp){case"-":break;case"+":for(let w=c;w<l.length;++w)d+=`
207
- `+l[w][0].slice(f);d[d.length-1]!==`
208
- `&&(d+=`
209
- `);break;default:d+=`
210
- `}const x=i+o.length+t.source.length;return{value:d,type:a,comment:o.comment,range:[i,x,x]}}function FR({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=t[0],a=o[0];let l=0,c="",f=-1;for(let g=1;g<o.length;++g){const v=o[g];if(!c&&(v==="-"||v==="+"))c=v;else{const x=Number(v);!l&&x?l=x:f===-1&&(f=e+g)}}f!==-1&&i(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let h=!1,m="",d=o.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":h=!0;case"newline":d+=v.source.length;break;case"comment":n&&!h&&i(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=v.source.length,m=v.source.substring(1);break;case"error":i(v,"UNEXPECTED_TOKEN",v.message),d+=v.source.length;break;default:{const x=`Unexpected token in block scalar header: ${v.type}`;i(v,"UNEXPECTED_TOKEN",x);const w=v.source;w&&typeof w=="string"&&(d+=w.length)}}}return{mode:a,indent:l,chomp:c,comment:m,length:d}}function BR(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),a=[i!=null&&i[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)a.push([t[l],t[l+1]]);return a}function VR(e,t,n){const{offset:i,type:o,source:a,end:l}=e;let c,f;const h=(g,v,x)=>n(i+g,v,x);switch(o){case"scalar":c=Te.PLAIN,f=WR(a,h);break;case"single-quoted-scalar":c=Te.QUOTE_SINGLE,f=UR(a,h);break;case"double-quoted-scalar":c=Te.QUOTE_DOUBLE,f=HR(a,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}const m=i+a.length,d=Go(l,m,t,n);return{value:f,type:c,comment:d.comment,range:[i,m,d.offset]}}function WR(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Lb(e)}function UR(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Lb(e.slice(1,-1)).replace(/''/g,"'")}function Lb(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
211
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
212
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let o=i[1],a=" ",l=t.lastIndex;for(n.lastIndex=l;i=n.exec(e);)i[1]===""?a===`
213
- `?o+=a:a=`
214
- `:(o+=a+i[1],a=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,i=c.exec(e),o+a+((i==null?void 0:i[1])??"")}function HR(e,t){let n="";for(let i=1;i<e.length-1;++i){const o=e[i];if(!(o==="\r"&&e[i+1]===`
215
- `))if(o===`
216
- `){const{fold:a,offset:l}=qR(e,i);n+=a,i=l}else if(o==="\\"){let a=e[++i];const l=YR[a];if(l)n+=l;else if(a===`
217
- `)for(a=e[i+1];a===" "||a===" ";)a=e[++i+1];else if(a==="\r"&&e[i+1]===`
218
- `)for(a=e[++i+1];a===" "||a===" ";)a=e[++i+1];else if(a==="x"||a==="u"||a==="U"){const c=a==="x"?2:a==="u"?4:8;n+=KR(e,i+1,c,t),i+=c}else{const c=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(o===" "||o===" "){const a=i;let l=e[i+1];for(;l===" "||l===" ";)l=e[++i+1];l!==`
219
- `&&!(l==="\r"&&e[i+2]===`
220
- `)&&(n+=i>a?e.slice(a,i+1):o)}else n+=o}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function qR(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
221
- `||i==="\r")&&!(i==="\r"&&e[t+2]!==`
222
- `);)i===`
223
- `&&(n+=`
224
- `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const YR={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
225
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function KR(e,t,n,i){const o=e.substr(t,n),l=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(l)}catch{const c=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}}function jb(e,t,n,i){const{value:o,type:a,comment:l,range:c}=t.type==="block-scalar"?zR(e,t,i):VR(t,e.options.strict,i),f=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Mn]:f?h=GR(e.schema,o,f,n,i):t.type==="scalar"?h=XR(e,o,t,i):h=e.schema[Mn];let m;try{const d=h.resolve(o,g=>i(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=ze(d)?d:new Te(d)}catch(d){const g=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",g),m=new Te(o)}return m.range=c,m.source=o,a&&(m.type=a),f&&(m.tag=f),h.format&&(m.format=h.format),l&&(m.comment=l),m}function GR(e,t,n,i,o){var c;if(n==="!")return e[Mn];const a=[];for(const f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)a.push(f);else return f;for(const f of a)if((c=f.test)!=null&&c.test(t))return f;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(o(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Mn])}function XR({atKey:e,directives:t,schema:n},i,o,a){const l=n.tags.find(c=>{var f;return(c.default===!0||e&&c.default==="key")&&((f=c.test)==null?void 0:f.test(i))})||n[Mn];if(n.compat){const c=n.compat.find(f=>{var h;return f.default&&((h=f.test)==null?void 0:h.test(i))})??n[Mn];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${h}`;a(o,"TAG_RESOLVE_FAILED",m,!0)}}return l}function QR(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let o=t[i];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=t[++i];(o==null?void 0:o.type)==="space";)e+=o.source.length,o=t[++i];break}}return e}const JR={composeNode:Db,composeEmptyNode:Tp};function Db(e,t,n,i){const o=e.atKey,{spaceBefore:a,comment:l,anchor:c,tag:f}=n;let h,m=!0;switch(t.type){case"alias":h=ZR(e,t,i),(c||f)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=jb(e,t,f,i),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=$R(JR,e,t,n,i),c&&(h.anchor=c.source.substring(1))}catch(d){const g=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",g)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),m=!1}}return h??(h=Tp(e,t.offset,void 0,null,n,i)),c&&h.anchor===""&&i(c,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!ze(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&m&&(h.srcToken=t),h}function Tp(e,t,n,i,{spaceBefore:o,comment:a,anchor:l,tag:c,end:f},h){const m={type:"scalar",offset:QR(t,n,i),indent:-1,source:""},d=jb(e,m,c,h);return l&&(d.anchor=l.source.substring(1),d.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=f),d}function ZR({options:e},{offset:t,source:n,end:i},o){const a=new gp(n.substring(1));a.source===""&&o(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&o(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=Go(i,l,e.strict,o);return a.range=[t,l,c.offset],c.comment&&(a.comment=c.comment),a}function eL(e,t,{offset:n,start:i,value:o,end:a},l){const c=Object.assign({_directives:t},e),f=new Fu(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=gs(i,{indicator:"doc-start",next:o??(a==null?void 0:a[0]),offset:n,onError:l,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!m.hasNewline&&l(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=o?Db(h,o,m,l):Tp(h,m.end,i,null,m,l);const d=f.contents.range[2],g=Go(a,d,!1,l);return g.comment&&(f.comment=g.comment),f.range=[n,d,g.offset],f}function vo(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Kv(e){var o;let t="",n=!1,i=!1;for(let a=0;a<e.length;++a){const l=e[a];switch(l[0]){case"#":t+=(t===""?"":i?`
226
-
227
- `:`
228
- `)+(l.substring(1)||" "),n=!0,i=!1;break;case"%":((o=e[a+1])==null?void 0:o[0])!=="#"&&(a+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class tL{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,o,a)=>{const l=vo(n);a?this.warnings.push(new RR(l,i,o)):this.errors.push(new Eo(l,i,o))},this.directives=new kt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:o}=Kv(this.prelude);if(i){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
229
- ${i}`:i;else if(o||t.directives.docStart||!a)t.commentBefore=i;else if(Je(a)&&!a.flow&&a.items.length>0){let l=a.items[0];et(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${i}
230
- ${c}`:i}else{const l=a.commentBefore;a.commentBefore=l?`${i}
231
- ${l}`:i}}if(n){for(let a=0;a<this.errors.length;++a)t.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)t.warnings.push(this.warnings[a])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Kv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const o of t)yield*this.next(o);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,o)=>{const a=vo(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",i,o)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=eL(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Eo(vo(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Eo(vo(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=Go(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
232
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Eo(vo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),o=new Fu(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,n,n],this.decorate(o,!1),yield o}}}const $b="\uFEFF",zb="",Fb="",Mh="";function nL(e){switch(e){case $b:return"byte-order-mark";case zb:return"doc-mode";case Fb:return"flow-error-end";case Mh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
233
- `:case`\r
234
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function fn(e){switch(e){case void 0:case" ":case`
235
- `:case"\r":case" ":return!0;default:return!1}}const Gv=new Set("0123456789ABCDEFabcdef"),rL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Dl=new Set(",[]{}"),iL=new Set(` ,[]{}
236
- \r `),lh=e=>!e||iL.has(e);class sL{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
237
- `?!0:n==="\r"?this.buffer[t+1]===`
238
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const o=this.buffer[i+t+1];if(o===`
239
- `||!o&&!this.atEnd)return t+i+1}return n===`
240
- `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&fn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
241
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===$b&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const a=t[i-1];if(a===" "||a===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const o=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield zb,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&fn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!fn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&fn(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(lh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&o[0]!=="#"||i===0&&(o.startsWith("---")||o.startsWith("..."))&&fn(o[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield Fb,yield*this.parseLineStart();let a=0;for(;o[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),o[a]){case void 0:return"flow";case"#":return yield*this.pushCount(o.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(lh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||fn(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let o=i.indexOf(`
242
- `,this.pos);if(o!==-1){for(;o!==-1;){const a=this.continueScalar(o+1);if(a===-1)break;o=i.indexOf(`
243
- `,a)}o!==-1&&(n=o-(i[o-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>fn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let a=this.pos;i=this.buffer[a];++a)switch(i){case" ":n+=1;break;case`
244
- `:t=a,n=0;break;case"\r":{const l=this.buffer[a+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
245
- `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
246
- `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let o=t+1;for(i=this.buffer[o];i===" ";)i=this.buffer[++o];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
247
- `;)i=this.buffer[++o];t=o-1}else if(!this.blockScalarKeep)do{let a=t-1,l=this.buffer[a];l==="\r"&&(l=this.buffer[--a]);const c=a;for(;l===" ";)l=this.buffer[--a];if(l===`
248
- `&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield Mh,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,o;for(;o=this.buffer[++i];)if(o===":"){const a=this.buffer[i+1];if(fn(a)||t&&Dl.has(a))break;n=i}else if(fn(o)){let a=this.buffer[i+1];if(o==="\r"&&(a===`
249
- `?(i+=1,o=`
250
- `,a=this.buffer[i+1]):n=i),a==="#"||t&&Dl.has(a))break;if(o===`
251
- `){const l=this.continueScalar(i+1);if(l===-1)break;i=Math.max(i,l-2)}}else{if(t&&Dl.has(o))break;n=i}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield Mh,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(lh),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(fn(i)||n&&Dl.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!fn(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(rL.has(n))n=this.buffer[++t];else if(n==="%"&&Gv.has(this.buffer[t+1])&&Gv.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
252
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
253
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const o=n-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=n),o}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class oL{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){const a=n+i>>1;this.lineStarts[a]<t?n=a+1:i=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const o=this.lineStarts[n-1];return{line:n,col:t-o+1}}}}function Cr(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Xv(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Bb(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $l(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ki(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function hu(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Qv(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Cr(t.start,"explicit-key-ind")&&!Cr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Bb(t.value)?t.value.end?hu(t.value.end,t.sep):t.value.end=t.sep:hu(t.start,t.sep),delete t.sep)}class aL{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sL,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=nL(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Qv(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const o=i.items[i.items.length-1];if(o.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=n;else{Object.assign(o,{key:n,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=i.items[i.items.length-1];o.value?i.items.push({start:[],value:n}):o.value=n;break}case"flow-collection":{const o=i.items[i.items.length-1];!o||o.value?i.items.push({start:[],key:n,sep:[]}):o.sep?o.value=n:Object.assign(o,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const o=n.items[n.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Xv(o.start)===-1&&(n.indent===0||o.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(i.type==="document"?i.end=o.start:i.items.push({start:o.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Xv(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=$l(this.peek(2)),i=Ki(n);let o;t.end?(o=t.end,o.push(this.sourceToken),delete t.end):o=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
254
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
255
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const o="end"in n.value?n.value.end:void 0,a=Array.isArray(o)?o[o.length-1]:void 0;(a==null?void 0:a.type)==="comment"?o==null||o.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2],a=(i=o==null?void 0:o.value)==null?void 0:i.end;if(Array.isArray(a)){hu(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const o=!this.onKeyLine&&this.indent===t.indent,a=o&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let l=[];if(a&&n.sep&&!n.value){const c=[];for(let f=0;f<n.sep.length;++f){const h=n.sep[f];switch(h.type){case"newline":c.push(f);break;case"space":break;case"comment":h.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(l=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(l.push(this.sourceToken),t.items.push({start:l}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(l.push(this.sourceToken),t.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Cr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if(Bb(n.key)&&!Cr(n.sep,"newline")){const c=Ki(n.start),f=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:f,sep:h}]})}else l.length>0?n.sep=n.sep.concat(l,this.sourceToken):n.sep.push(this.sourceToken);else if(Cr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Ki(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:l,key:null,sep:[this.sourceToken]}):Cr(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);a||n.value?(t.items.push({start:l,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Cr(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else o&&t.items.push({start:l});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const o="end"in n.value?n.value.end:void 0,a=Array.isArray(o)?o[o.length-1]:void 0;(a==null?void 0:a.type)==="comment"?o==null||o.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2],a=(i=o==null?void 0:o.value)==null?void 0:i.end;if(Array.isArray(a)){hu(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Cr(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const o=this.startBlockValue(t);if(o){this.stack.push(o);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const o=$l(i),a=Ki(o);Qv(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
256
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
257
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=$l(t),i=Ki(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=$l(t),i=Ki(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function lL(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new oL||null,prettyErrors:t}}function uL(e,t={}){const{lineCounter:n,prettyErrors:i}=lL(t),o=new aL(n==null?void 0:n.addNewLine),a=new tL(t);let l=null;for(const c of a.compose(o.parse(e),!0,e.length))if(!l)l=c;else if(l.options.logLevel!=="silent"){l.errors.push(new Eo(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(l.errors.forEach(qv(e,n)),l.warnings.forEach(qv(e,n))),l}function cL(e,t,n){let i;const o=uL(e,n);if(!o)return null;if(o.warnings.forEach(a=>hb(o.options.logLevel,a)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:i},n))}const fL=`name: jpd-comment-triage
258
- nodes:
259
- - id: hourly
260
- type: trigger.cron
261
- config: { cron: "0 * * * *" }
262
-
263
- - id: fetchComments
264
- type: task.http
265
- config:
266
- url: "https://api.test/ideas/IDEA-1/comments"
267
- headers: { authorization: "Bearer \${JPD_TOKEN}" }
268
-
269
- - id: unhandled
270
- type: task.transform
271
- config:
272
- expression: "fetchComments.comments[author != 'agent']"
273
-
274
- - id: gate
275
- type: task.branch
276
- config:
277
- expression: "$count(unhandled) > 0"
278
-
279
- - id: interpret
280
- type: agent.run
281
- config:
282
- prompt: "A user commented on a JPD idea. Decide a concise, helpful reply."
283
-
284
- - id: reply
285
- type: task.http
286
- config:
287
- url: "https://api.test/ideas/IDEA-1/comments"
288
- method: POST
289
- headers: { authorization: "Bearer \${JPD_TOKEN}" }
290
- bodyExpression: "{ 'body': '[agent] ' & interpret.text }"
291
-
292
- edges:
293
- - { from: hourly, to: fetchComments }
294
- - { from: fetchComments, to: unhandled }
295
- - { from: unhandled, to: gate }
296
- - { from: gate, to: interpret, when: "true" }
297
- - { from: interpret, to: reply }
298
- `;function dL(){const[e,t]=O.useState(null),[n,i]=O.useState(null),o=O.useCallback(c=>{try{const f=cL(c);t(f),i(null)}catch(f){i(f instanceof Error?f.message:"Failed to parse YAML")}},[]),a=O.useCallback(c=>{t(c),i(null)},[]),l=O.useCallback(()=>{o(fL)},[o]);return{workflow:e,error:n,loadFromString:o,loadFromObject:a,loadDefault:l}}const hL={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,costUsd:0};function pL(e,t){return{inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,cacheReadTokens:e.cacheReadTokens+t.cacheReadTokens,cacheCreationTokens:e.cacheCreationTokens+t.cacheCreationTokens,totalTokens:e.totalTokens+t.totalTokens,costUsd:e.costUsd+t.costUsd}}function mL(e){const[t,n]=O.useState({}),[i,o]=O.useState({}),[a,l]=O.useState({}),[c,f]=O.useState({}),[h,m]=O.useState({}),[d,g]=O.useState({}),[v,x]=O.useState([]),[w,b]=O.useState(!1),[S,_]=O.useState([]),E=O.useRef(0),T=O.useRef(null),A=O.useRef(null),R=O.useCallback(M=>{_(P=>[...P,M]);const C=M.runId??T.current??void 0;if(M.type==="run:start"){const P=M.runId??`run_${(++E.current).toString(16).padStart(4,"0")}`;T.current=P,A.current=null,x(j=>[{id:P,workflow:M.workflow,label:M.label,status:"running",startedAt:M.ts},...j]),g(j=>({...j,[P]:{nodes:{},order:[]}})),n({}),o({}),l({}),f({}),m({})}else if(M.type==="node:start"&&M.nodeId)n(P=>({...P,[M.nodeId]:"running"})),C&&g(P=>{const j=P[C]??{nodes:{},order:[]};return j.nodes[M.nodeId]?P:{...P,[C]:{nodes:{...j.nodes,[M.nodeId]:{nodeId:M.nodeId,status:"running",activity:[]}},order:[...j.order,M.nodeId]}}});else if(M.type==="node:activity"&&M.nodeId){const P=M.meta;P&&(f(j=>({...j,[M.nodeId]:[...j[M.nodeId]??[],P]})),C&&g(j=>{const L=j[C];if(!L)return j;const D=L.nodes[M.nodeId]??{nodeId:M.nodeId,status:"running",activity:[]};return{...j,[C]:{...L,nodes:{...L.nodes,[M.nodeId]:{...D,activity:[...D.activity,P]}}}}}))}else if(M.type==="node:finish"&&M.nodeId){const P=M.status==="failed";n(L=>({...L,[M.nodeId]:P?"failed":"success"}));const j=M.meta;if((j==null?void 0:j.output)!==void 0&&l(L=>({...L,[M.nodeId]:j.output})),j!=null&&j.usage&&(m(L=>({...L,[M.nodeId]:j.usage})),C&&x(L=>L.map(D=>D.id===C?{...D,usage:pL(D.usage??hL,j.usage)}:D))),P){const L=j==null?void 0:j.error;L&&(o(D=>({...D,[M.nodeId]:L})),C&&T.current===C&&!A.current&&(A.current=`${M.nodeId}: ${L}`))}C&&g(L=>{const D=L[C];if(!D)return L;const X=D.nodes[M.nodeId]??{nodeId:M.nodeId,status:"running",activity:[]};return{...L,[C]:{...D,nodes:{...D.nodes,[M.nodeId]:{...X,status:P?"failed":"success",output:(j==null?void 0:j.output)??X.output,error:P?j==null?void 0:j.error:X.error,usage:(j==null?void 0:j.usage)??X.usage}}}}})}else if(M.type==="run:finish"){const P=M.status==="failed"?"failed":"success",j=C,L=A.current??void 0;j&&x(D=>D.map(X=>X.id===j?{...X,status:P,finishedAt:M.ts,error:P==="failed"?L:void 0}:X))}},[]);return O.useEffect(()=>{if(!e)return;let M;try{M=new EventSource(`${e}/api/events`)}catch{return}return M.onopen=()=>b(!0),M.onmessage=C=>{try{const P=JSON.parse(C.data);R(P)}catch{}},M.onerror=()=>{b(!1)},()=>{M.close(),b(!1)}},[e,R]),{nodeStatuses:t,nodeErrors:i,nodeOutputs:a,nodeActivity:c,nodeUsage:h,runDetails:d,runs:v,connected:w,events:S}}function gL(e){const[t,n]=O.useState([]);return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/workflows`).then(o=>o.ok?o.json():[]).then(o=>{!i&&Array.isArray(o)&&n(o)}).catch(()=>{}),()=>{i=!0}},[e]),{workflows:t}}function yL(e){const[t,n]=O.useState({});return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/config`).then(o=>o.ok?o.json():{}).then(o=>{!i&&o&&typeof o=="object"&&n(o)}).catch(()=>{}),()=>{i=!0}},[e]),t}function vL(e){const[t,n]=O.useState(!1),[i,o]=O.useState(!1);return O.useEffect(()=>{if(!e)return;let l=!1;const c=()=>fetch(`${e}/api/state`).then(h=>h.ok?h.json():null).then(h=>{l||!h||(n(!!h.paused),o(!!h.controllable))}).catch(()=>{});c();const f=setInterval(c,5e3);return()=>{l=!0,clearInterval(f)}},[e]),{paused:t,controllable:i,toggle:async()=>{if(!e)return;const l=!t;n(l);try{const c=await fetch(`${e}/api/${l?"pause":"resume"}`,{method:"POST"}),f=c.ok?await c.json():null;f&&typeof f.paused=="boolean"&&n(f.paused)}catch{n(!l)}}}}function wL(e){const[t,n]=O.useState(null);return O.useEffect(()=>{if(!e)return;let i=!1;const o=()=>fetch(`${e}/api/usage`).then(l=>l.ok?l.json():null).then(l=>{!i&&l&&typeof l=="object"&&n(l)}).catch(()=>{});o();const a=setInterval(o,12e4);return()=>{i=!0,clearInterval(a)}},[e]),t}function xL(e){const[t,n]=O.useState({});return O.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/agents`).then(o=>o.ok?o.json():[]).then(o=>{if(i||!Array.isArray(o))return;const a={};for(const l of o)a[l.name]=l;n(a)}).catch(()=>{}),()=>{i=!0}},[e]),t}async function bL(e,t,n){await fetch(`${e}/api/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n===void 0?{workflow:t}:{workflow:t,payload:n})})}function kL(e,t=0){const[n,i]=O.useState({seen:[],cursors:[]}),[o,a]=O.useState(0),l=()=>a(f=>f+1);return O.useEffect(()=>{if(!e)return;let f=!1;return fetch(`${e}/api/cache`).then(h=>h.ok?h.json():{seen:[],cursors:[]}).then(h=>{!f&&h&&typeof h=="object"&&i(h)}).catch(()=>{}),()=>{f=!0}},[e,o,t]),{cache:n,reload:l,forget:async f=>{e&&(await fetch(`${e}/api/cache`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:f})}),l())}}}function SL(e,t){const n=t-36e5;let i=0;for(const o of e)o.startedAt>=n&&o.usage&&(i+=o.usage.costUsd);return i}function EL(e){if(!e)return"";const t=Date.parse(e)-Date.now();if(!Number.isFinite(t)||t<=0)return"";const n=Math.floor(t/36e5),i=Math.floor(t%36e5/6e4);return n>=48?`⤺ ${Math.floor(n/24)}d`:n>=1?`⤺ ${n}h${i>0?` ${i}m`:""}`:`⤺ ${i}m`}function Jv({label:e,win:t}){const n=t==null?void 0:t.utilization,i=typeof n=="number"?Math.max(0,Math.min(100,n)):null,o=i!==null&&i>=80;return N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"text-mutedfg w-12 shrink-0",children:e}),N.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:i!==null&&N.jsx("div",{className:je("h-full rounded-full",o?"bg-fail":"bg-agent"),style:{width:`${i}%`}})}),N.jsx("span",{className:je("font-mono w-9 text-right",o?"text-fail":"text-fg"),children:i!==null?`${Math.round(i)}%`:"n/a"}),N.jsx("span",{className:"font-mono text-mutedfg w-14 text-right",children:EL(t==null?void 0:t.resetsAt)})]})}function NL({runs:e,usage:t}){const n=SL(e,Date.now()),i=(t==null?void 0:t.available)&&(t.fiveHour||t.sevenDay);return N.jsxs("div",{"data-testid":"spend-balance",className:"absolute bottom-4 right-4 z-10 w-64 rounded-lg border border-border bg-bg/95 backdrop-blur px-3 py-2 shadow-lg text-[11px]",children:[N.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[N.jsx("span",{className:"uppercase tracking-wider text-mutedfg text-[10px]",children:"Spend & balance"}),(t==null?void 0:t.subscriptionType)&&N.jsx("span",{className:"font-mono text-[10px] text-mutedfg",children:t.subscriptionType})]}),N.jsxs("div",{className:"flex items-baseline gap-1.5 mb-1.5",children:[N.jsx("span",{className:"font-mono text-[15px] font-semibold text-fg",children:cu(n)}),N.jsx("span",{className:"text-mutedfg",children:"/ hr · last 60m"})]}),i?N.jsxs("div",{className:"space-y-1",children:[N.jsx(Jv,{label:"session",win:t.fiveHour}),N.jsx(Jv,{label:"weekly",win:t.sevenDay})]}):N.jsxs("div",{className:"text-mutedfg text-[10px] leading-snug",children:["plan balance n/a",t&&!t.available?" (API-key session)":" — experimental, may be unavailable"]})]})}const Gn=typeof window<"u"&&window.location.protocol.startsWith("http")?window.location.origin:void 0;function _L(){const{workflow:e,loadDefault:t,loadFromString:n,loadFromObject:i}=dL(),[o,a]=O.useState(null),[l,c]=O.useState(null),[f,h]=O.useState("none"),{nodeStatuses:m,nodeErrors:d,nodeOutputs:g,nodeActivity:v,nodeUsage:x,runDetails:w,runs:b,connected:S}=mL(Gn),{workflows:_}=gL(Gn),E=yL(Gn),T=xL(Gn),{paused:A,controllable:R,toggle:M}=vL(Gn),C=wL(Gn),P=b.filter(B=>B.status!=="running").length,{cache:j,reload:L,forget:D}=kL(Gn,P);O.useEffect(()=>{if(_.length===0){t();return}const B=_.find(V=>V.name===l)??_[0];B.name!==l&&c(B.name),i(B)},[_,l,t,i]);const X=_.find(B=>B.name===l),z=O.useCallback(B=>c(B),[]),G=O.useCallback((B,V)=>{Gn&&bL(Gn,B,V),h("runs")},[]),Y=O.useCallback(B=>{l&&G(l,B)},[l,G]),Z=O.useCallback(B=>a(B),[]),H=B=>h(V=>V===B?"none":B);return N.jsxs("div",{className:"h-screen w-screen flex overflow-hidden bg-muted text-fg font-sans text-[13px] antialiased relative",children:[N.jsx(FO,{liveConnected:S,workflows:_,selected:l,onSelect:z,onRun:B=>G(B),version:E.version}),N.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[N.jsx(BO,{workflow:e,selected:X,dryRun:E.dryRun,paused:A,pauseControllable:R,onTogglePause:M,onLoadYaml:n,onRun:Y,onToggleRuns:()=>H("runs"),onToggleCache:()=>{L(),H("cache")},runsOpen:f==="runs",cacheOpen:f==="cache"}),N.jsxs("div",{className:"flex-1 flex min-h-0 relative",children:[N.jsx(jx,{children:N.jsx(AP,{workflow:e,onNodeClick:Z,onLoadYaml:n,nodeStatuses:m})}),N.jsx(NL,{runs:b,usage:C})]})]}),f==="runs"&&N.jsx(JM,{workflowName:l??void 0,workflowTitle:X==null?void 0:X.title,runs:b,runDetails:w,atlassianSite:E.atlassianSite,onClose:()=>h("none")}),f==="cache"&&N.jsx(eR,{cache:j,onReload:L,onForget:B=>void D(B),onClose:()=>h("none")}),N.jsx(UM,{node:o,onClose:()=>a(null),agentDefaults:E.agent,agents:T,status:o?m[o.id]:void 0,output:o?g[o.id]:void 0,error:o?d[o.id]:void 0,activity:o?v[o.id]:void 0,usage:o?x[o.id]:void 0})]})}PS.createRoot(document.getElementById("root")).render(N.jsx(Rh.StrictMode,{children:N.jsx(_L,{})}));