@agentic-surfaces/server 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/assets/index-C7_sNeWL.js +298 -0
- package/dist/editor/assets/{index-CQwBaAEq.css → index-CQrXDTe4.css} +1 -1
- package/dist/editor/index.html +2 -2
- package/dist/http.d.ts +1 -0
- package/dist/serve.d.ts +1 -0
- package/dist/streaming-observer.d.ts +7 -5
- package/dist/streaming-observer.js +10 -10
- package/package.json +2 -2
- package/dist/editor/assets/index-CS8llYsy.js +0 -298
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
var wS=Object.defineProperty;var xS=(e,t,n)=>t in e?wS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>xS(e,typeof t!="symbol"?t+"":t,n);function bS(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 hu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mf={exports:{}},ho={},Rf={exports:{}},Ie={};/**
|
|
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 kS(){if(Qg)return Ie;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 k($,U,W){this.props=$,this.context=U,this.refs=w,this.updater=W||v}k.prototype.isReactComponent={},k.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")},k.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function S(){}S.prototype=k.prototype;function N($,U,W){this.props=$,this.context=U,this.refs=w,this.updater=W||v}var E=N.prototype=new S;E.constructor=N,x(E,k.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 I($,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 Q($,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===""?"."+Q(oe,0):K,T(J)?(W="",$!=null&&(W=$.replace(D,"$&/")+"/"),z(J,U,W,"",function(de){return de})):J!=null&&(j(J)&&(J=I(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+Q(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+Q(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},B={transition:null},H={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:B,ReactCurrentOwner:R};function V(){throw Error("act(...) is not supported in production builds of React.")}return Ie.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 $}},Ie.Component=k,Ie.Fragment=n,Ie.Profiler=o,Ie.PureComponent=N,Ie.StrictMode=i,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,Ie.act=V,Ie.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}},Ie.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:a,_context:$},$.Consumer=$},Ie.createElement=C,Ie.createFactory=function($){var U=C.bind(null,$);return U.type=$,U},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function($){return{$$typeof:c,render:$}},Ie.isValidElement=j,Ie.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:Y}},Ie.memo=function($,U){return{$$typeof:h,type:$,compare:U===void 0?null:U}},Ie.startTransition=function($){var U=B.transition;B.transition={};try{$()}finally{B.transition=U}},Ie.unstable_act=V,Ie.useCallback=function($,U){return Z.current.useCallback($,U)},Ie.useContext=function($){return Z.current.useContext($)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function($){return Z.current.useDeferredValue($)},Ie.useEffect=function($,U){return Z.current.useEffect($,U)},Ie.useId=function(){return Z.current.useId()},Ie.useImperativeHandle=function($,U,W){return Z.current.useImperativeHandle($,U,W)},Ie.useInsertionEffect=function($,U){return Z.current.useInsertionEffect($,U)},Ie.useLayoutEffect=function($,U){return Z.current.useLayoutEffect($,U)},Ie.useMemo=function($,U){return Z.current.useMemo($,U)},Ie.useReducer=function($,U,W){return Z.current.useReducer($,U,W)},Ie.useRef=function($){return Z.current.useRef($)},Ie.useState=function($){return Z.current.useState($)},Ie.useSyncExternalStore=function($,U,W){return Z.current.useSyncExternalStore($,U,W)},Ie.useTransition=function(){return Z.current.useTransition()},Ie.version="18.3.1",Ie}var Jg;function Fo(){return Jg||(Jg=1,Rf.exports=kS()),Rf.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 SS(){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 ES(){return ey||(ey=1,Mf.exports=SS()),Mf.exports}var _=ES(),P=Fo();const Rh=hu(P),Lh=bS({__proto__:null,default:Rh},[P]);var pl={},Lf={exports:{}},At={},jf={exports:{}},Df={};/**
|
|
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 NS(){return ty||(ty=1,(function(e){function t(B,H){var V=B.length;B.push(H);e:for(;0<V;){var $=V-1>>>1,U=B[$];if(0<o(U,H))B[$]=H,B[V]=U,V=$;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var H=B[0],V=B.pop();if(V!==H){B[0]=V;e:for(var $=0,U=B.length,W=U>>>1;$<W;){var K=2*($+1)-1,J=B[K],re=K+1,oe=B[re];if(0>o(J,V))re<U&&0>o(oe,J)?(B[$]=oe,B[re]=V,$=re):(B[$]=J,B[K]=V,$=K);else if(re<U&&0>o(oe,V))B[$]=oe,B[re]=V,$=re;else break e}}return H}function o(B,H){var V=B.sortIndex-H.sortIndex;return V!==0?V:B.id-H.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,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(B){for(var H=n(h);H!==null;){if(H.callback===null)i(h);else if(H.startTime<=B)i(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function T(B){if(w=!1,E(B),!x)if(n(f)!==null)x=!0,Y(A);else{var H=n(h);H!==null&&Z(T,H.startTime-B)}}function A(B,H){x=!1,w&&(w=!1,S(C),C=-1),v=!0;var V=g;try{for(E(H),d=n(f);d!==null&&(!(d.expirationTime>H)||B&&!L());){var $=d.callback;if(typeof $=="function"){d.callback=null,g=d.priorityLevel;var U=$(d.expirationTime<=H);H=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(f)&&i(f),E(H)}else i(f);d=n(f)}if(d!==null)var W=!0;else{var K=n(h);K!==null&&Z(T,K.startTime-H),W=!1}return W}finally{d=null,g=V,v=!1}}var R=!1,M=null,C=-1,I=5,j=-1;function L(){return!(e.unstable_now()-j<I)}function D(){if(M!==null){var B=e.unstable_now();j=B;var H=!0;try{H=M(!0,B)}finally{H?Q():(R=!1,M=null)}}else R=!1}var Q;if(typeof N=="function")Q=function(){N(D)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,G=z.port2;z.port1.onmessage=D,Q=function(){G.postMessage(null)}}else Q=function(){k(D,0)};function Y(B){M=B,R||(R=!0,Q())}function Z(B,H){C=k(function(){B(e.unstable_now())},H)}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(B){B.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,Y(A))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var H=3;break;default:H=g}var V=g;g=H;try{return B()}finally{g=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,H){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var V=g;g=B;try{return H()}finally{g=V}},e.unstable_scheduleCallback=function(B,H,V){var $=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?$+V:$):V=$,B){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,B={id:m++,callback:H,priorityLevel:B,startTime:V,expirationTime:U,sortIndex:-1},V>$?(B.sortIndex=V,t(h,B),n(f)===null&&B===n(h)&&(w?(S(C),C=-1):w=!0,Z(T,V-$))):(B.sortIndex=U,t(f,B),x||v||(x=!0,Y(A))),B},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(B){var H=g;return function(){var V=g;g=H;try{return B.apply(this,arguments)}finally{g=V}}}})(Df)),Df}var ny;function _S(){return ny||(ny=1,jf.exports=NS()),jf.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 CS(){if(ry)return At;ry=1;var e=Fo(),t=_S();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,b,O){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=b,this.removeEmptyString=O}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){k[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];k[s]=new w(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){k[r]=new w(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){k[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){k[r]=new w(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){k[r]=new w(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){k[r]=new w(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){k[r]=new w(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){k[r]=new w(r,5,!1,r.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(S,N);k[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,N);k[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,N);k[s]=new w(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){k[r]=new w(r,1,!1,r.toLowerCase(),null,!1,!1)}),k.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){k[r]=new w(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,s,u,p){var y=k.hasOwnProperty(s)?k[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"),I=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),L=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),Q=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"),B=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||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
|
+
`),b=p.stack.split(`
|
|
36
|
+
`),O=y.length-1,F=b.length-1;1<=O&&0<=F&&y[O]!==b[F];)F--;for(;1<=O&&0<=F;O--,F--)if(y[O]!==b[F]){if(O!==1||F!==1)do if(O--,F--,0>F||y[O]!==b[F]){var q=`
|
|
37
|
+
`+y[O].replace(" at new "," at ");return r.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",r.displayName)),q}while(1<=O&&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 I:return"Profiler";case C:return"StrictMode";case Q: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,b=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(O){p=""+O,b.call(this,O)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(O){p=""+O},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},Fu=["Webkit","ms","Moz","O"];Object.keys(Rr).forEach(function(r){Fu.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 Bu=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(Bu[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,tr=null,nr=null;function Zo(r){if(r=Qs(r)){if(typeof Cs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Oa(s),Cs(r.stateNode,r.type,s))}}function ea(r){tr?nr?nr.push(r):nr=[r]:tr=r}function ta(){if(tr){var r=tr,s=nr;if(nr=tr=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,(tr!==null||nr!==null)&&(ra(),ta())}}function Lr(r,s){var u=r.stateNode;if(u===null)return null;var p=Oa(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 Os=!1;if(c)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){Os=!0}}),window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{Os=!1}function Vu(r,s,u,p,y,b,O,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,Is=null,Wu={onError:function(r){Dr=!0,pi=r}};function Uu(r,s,u,p,y,b,O,F,q){Dr=!1,pi=null,Vu.apply(Wu,arguments)}function Hu(r,s,u,p,y,b,O,F,q){if(Uu.apply(this,arguments),Dr){if(Dr){var ie=pi;Dr=!1,pi=null}else throw Error(n(198));mi||(mi=!0,Is=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 qu(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 b=y.alternate;if(b===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===u)return As(y),r;if(b===p)return As(y),s;b=b.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=b;else{for(var O=!1,F=y.child;F;){if(F===u){O=!0,u=y,p=b;break}if(F===p){O=!0,p=y,u=b;break}F=F.sibling}if(!O){for(F=b.child;F;){if(F===u){O=!0,u=b,p=y;break}if(F===p){O=!0,p=b,u=y;break}F=F.sibling}if(!O)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=qu(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,Yu=t.unstable_shouldYield,ua=t.unstable_requestPaint,Ye=t.unstable_now,Ku=t.unstable_getCurrentPriorityLevel,Ms=t.unstable_ImmediatePriority,ca=t.unstable_UserBlockingPriority,gi=t.unstable_NormalPriority,Gu=t.unstable_LowPriority,fa=t.unstable_IdlePriority,yi=null,jt=null;function Xu(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:Zu,Qu=Math.log,Ju=Math.LN2;function Zu(r){return r>>>=0,r===0?32:31-(Qu(r)/Ju|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,b=r.pingedLanes,O=u&268435455;if(O!==0){var F=O&~y;F!==0?p=$r(F):(b&=O,b!==0&&(p=$r(b)))}else O=u&~y,O!==0?p=$r(O):b!==0&&(p=$r(b));if(p===0)return 0;if(s!==0&&s!==p&&(s&y)===0&&(y=p&-p,b=s&-s,y>=b||y===16&&(b&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 ec(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,b=r.pendingLanes;0<b;){var O=31-Dt(b),F=1<<O,q=y[O];q===-1?((F&u)===0||(F&p)!==0)&&(y[O]=ec(F,s)):q<=s&&(r.expiredLanes|=F),b&=~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 tc(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),b=1<<y;s[y]=0,p[y]=-1,r[y]=-1,u&=~b}}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 je=0;function Op(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Ip,nc,Pp,Ap,Mp,rc=!1,pa=[],rr=null,ir=null,sr=null,Ls=new Map,js=new Map,or=[],Bb="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":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":sr=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,b){return r===null||r.nativeEvent!==b?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:b,targetContainers:[y]},s!==null&&(s=Qs(s),s!==null&&nc(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),r)}function Vb(r,s,u,p,y){switch(s){case"focusin":return rr=Ds(rr,r,s,u,p,y),!0;case"dragenter":return ir=Ds(ir,r,s,u,p,y),!0;case"mouseover":return sr=Ds(sr,r,s,u,p,y),!0;case"pointerover":var b=y.pointerId;return Ls.set(b,Ds(Ls.get(b)||null,r,s,u,p,y)),!0;case"gotpointercapture":return b=y.pointerId,js.set(b,Ds(js.get(b)||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=sc(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&&nc(s),r.blockedOn=u,!1;s.shift()}return!0}function jp(r,s,u){ma(r)&&u.delete(s)}function Wb(){rc=!1,rr!==null&&ma(rr)&&(rr=null),ir!==null&&ma(ir)&&(ir=null),sr!==null&&ma(sr)&&(sr=null),Ls.forEach(jp),js.forEach(jp)}function $s(r,s){r.blockedOn===s&&(r.blockedOn=null,rc||(rc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wb)))}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(rr!==null&&$s(rr,r),ir!==null&&$s(ir,r),sr!==null&&$s(sr,r),Ls.forEach(s),js.forEach(s),u=0;u<or.length;u++)p=or[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<or.length&&(u=or[0],u.blockedOn===null);)Lp(u),u.blockedOn===null&&or.shift()}var bi=T.ReactCurrentBatchConfig,ga=!0;function Ub(r,s,u,p){var y=je,b=bi.transition;bi.transition=null;try{je=1,ic(r,s,u,p)}finally{je=y,bi.transition=b}}function Hb(r,s,u,p){var y=je,b=bi.transition;bi.transition=null;try{je=4,ic(r,s,u,p)}finally{je=y,bi.transition=b}}function ic(r,s,u,p){if(ga){var y=sc(r,s,u,p);if(y===null)kc(r,s,p,ya,u),Rp(r,p);else if(Vb(y,r,s,u,p))p.stopPropagation();else if(Rp(r,p),s&4&&-1<Bb.indexOf(r)){for(;y!==null;){var b=Qs(y);if(b!==null&&Ip(b),b=sc(r,s,u,p),b===null&&kc(r,s,p,ya,u),b===y)break;y=b}y!==null&&p.stopPropagation()}else kc(r,s,p,null,u)}}var ya=null;function sc(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(Ku()){case Ms:return 1;case ca:return 4;case gi:case Gu:return 16;case fa:return 536870912;default:return 16}default:return 16}}var ar=null,oc=null,va=null;function $p(){if(va)return va;var r,s=oc,u=s.length,p,y="value"in ar?ar.value:ar.textContent,b=y.length;for(r=0;r<u&&s[r]===y[r];r++);var O=u-r;for(p=1;p<=O&&s[u-p]===y[b-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,b,O){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=b,this.target=O,this.currentTarget=null;for(var F in r)r.hasOwnProperty(F)&&(u=r[F],this[F]=u?u(b):b[F]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.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},ac=$t(ki),Fs=V({},ki,{view:0,detail:0}),qb=$t(Fs),lc,uc,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:fc,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"?(lc=r.screenX-Bs.screenX,uc=r.screenY-Bs.screenY):uc=lc=0,Bs=r),lc)},movementY:function(r){return"movementY"in r?r.movementY:uc}}),Fp=$t(ba),Yb=V({},ba,{dataTransfer:0}),Kb=$t(Yb),Gb=V({},Fs,{relatedTarget:0}),cc=$t(Gb),Xb=V({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),Qb=$t(Xb),Jb=V({},ki,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Zb=$t(Jb),ek=V({},ki,{data:0}),Bp=$t(ek),tk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nk={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"},rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ik(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=rk[r])?!!s[r]:!1}function fc(){return ik}var sk=V({},Fs,{key:function(r){if(r.key){var s=tk[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"?nk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fc,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}}),ok=$t(sk),ak=V({},ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vp=$t(ak),lk=V({},Fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),uk=$t(lk),ck=V({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),fk=$t(ck),dk=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}),hk=$t(dk),pk=[9,13,27,32],dc=c&&"CompositionEvent"in window,Vs=null;c&&"documentMode"in document&&(Vs=document.documentMode);var mk=c&&"TextEvent"in window&&!Vs,Wp=c&&(!dc||Vs&&8<Vs&&11>=Vs),Up=" ",Hp=!1;function qp(r,s){switch(r){case"keyup":return pk.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 gk(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 yk(r,s){if(Si)return r==="compositionend"||!dc&&qp(r,s)?(r=$p(),va=oc=ar=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 vk={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"?!!vk[r.type]:s==="textarea"}function Gp(r,s,u,p){ea(p),s=_a(s,"onChange"),0<s.length&&(u=new ac("onChange","change",null,u,p),r.push({event:u,listeners:s}))}var Ws=null,Us=null;function wk(r){hm(r,0)}function ka(r){var s=Ti(r);if(he(s))return r}function xk(r,s){if(r==="change")return s}var Xp=!1;if(c){var hc;if(c){var pc="oninput"in document;if(!pc){var Qp=document.createElement("div");Qp.setAttribute("oninput","return;"),pc=typeof Qp.oninput=="function"}hc=pc}else hc=!1;Xp=hc&&(!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(wk,s)}}function bk(r,s,u){r==="focusin"?(Jp(),Ws=s,Us=u,Ws.attachEvent("onpropertychange",Zp)):r==="focusout"&&Jp()}function kk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ka(Us)}function Sk(r,s){if(r==="click")return ka(s)}function Ek(r,s){if(r==="input"||r==="change")return ka(s)}function Nk(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var sn=typeof Object.is=="function"?Object.is:Nk;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 mc(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 _k(r){var s=rm(),u=r.focusedElem,p=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&nm(u.ownerDocument.documentElement,u)){if(p!==null&&mc(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,b=Math.min(p.start,y);p=p.end===void 0?b:Math.min(p.end,y),!r.extend&&b>p&&(y=p,p=b,b=y),y=tm(u,b);var O=tm(u,p);y&&O&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==O.node||r.focusOffset!==O.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),r.removeAllRanges(),b>p?(r.addRange(s),r.extend(O.node,O.offset)):(s.setEnd(O.node,O.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 Ck=c&&"documentMode"in document&&11>=document.documentMode,Ei=null,gc=null,qs=null,yc=!1;function im(r,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;yc||Ei==null||Ei!==fe(p)||(p=Ei,"selectionStart"in p&&mc(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(gc,"onSelect"),0<p.length&&(s=new ac("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")},vc={},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(vc[r])return vc[r];if(!Ni[r])return r;var s=Ni[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in sm)return vc[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 lr(r,s){cm.set(r,s),a(s,[r])}for(var wc=0;wc<fm.length;wc++){var xc=fm[wc],Tk=xc.toLowerCase(),Ok=xc[0].toUpperCase()+xc.slice(1);lr(Tk,"on"+Ok)}lr(om,"onAnimationEnd"),lr(am,"onAnimationIteration"),lr(lm,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(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(" "),Ik=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,Hu(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 b=void 0;if(s)for(var O=p.length-1;0<=O;O--){var F=p[O],q=F.instance,ie=F.currentTarget;if(F=F.listener,q!==b&&y.isPropagationStopped())break e;dm(y,F,ie),b=q}else for(O=0;O<p.length;O++){if(F=p[O],q=F.instance,ie=F.currentTarget,F=F.listener,q!==b&&y.isPropagationStopped())break e;dm(y,F,ie),b=q}}}if(mi)throw r=Is,mi=!1,Is=null,r}function Be(r,s){var u=s[Tc];u===void 0&&(u=s[Tc]=new Set);var p=r+"__bubble";u.has(p)||(pm(s,r,2,!1),u.add(p))}function bc(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"&&(Ik.has(u)||bc(u,!1,r),bc(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Na]||(s[Na]=!0,bc("selectionchange",!1,s))}}function pm(r,s,u,p){switch(Dp(s)){case 1:var y=Ub;break;case 4:y=Hb;break;default:y=ic}u=y.bind(null,s,u,r),y=void 0,!Os||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 kc(r,s,u,p,y){var b=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var F=p.stateNode.containerInfo;if(F===y||F.nodeType===8&&F.parentNode===y)break;if(O===4)for(O=p.return;O!==null;){var q=O.tag;if((q===3||q===4)&&(q=O.stateNode.containerInfo,q===y||q.nodeType===8&&q.parentNode===y))return;O=O.return}for(;F!==null;){if(O=Br(F),O===null)return;if(q=O.tag,q===5||q===6){p=b=O;continue e}F=F.parentNode}}p=p.return}ia(function(){var ie=b,le=_s(u),ue=[];e:{var ae=cm.get(r);if(ae!==void 0){var pe=ac,ve=r;switch(r){case"keypress":if(wa(u)===0)break e;case"keydown":case"keyup":pe=ok;break;case"focusin":ve="focus",pe=cc;break;case"focusout":ve="blur",pe=cc;break;case"beforeblur":case"afterblur":pe=cc;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=Kb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=uk;break;case om:case am:case lm:pe=Qb;break;case um:pe=fk;break;case"scroll":pe=qb;break;case"wheel":pe=hk;break;case"copy":case"cut":case"paste":pe=Zb;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 X=ie,ne;X!==null;){ne=X;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Lr(X,te),ce!=null&&we.push(Gs(X,ce,ne)))),Qe)break;X=X.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",X="mouse",(r==="pointerout"||r==="pointerover")&&(we=Vp,ce="onPointerLeave",te="onPointerEnter",X="pointer"),Qe=pe==null?ae:Ti(pe),ne=ve==null?ae:Ti(ve),ae=new we(ce,X+"leave",pe,u,le),ae.target=Qe,ae.relatedTarget=ne,ce=null,Br(le)===ie&&(we=new we(te,X+"enter",ve,u,le),we.target=ne,we.relatedTarget=Qe,ce=we),Qe=ce,pe&&ve)t:{for(we=pe,te=ve,X=0,ne=we;ne;ne=_i(ne))X++;for(ne=0,ce=te;ce;ce=_i(ce))ne++;for(;0<X-ne;)we=_i(we),X--;for(;0<ne-X;)te=_i(te),ne--;for(;X--;){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=xk;else if(Kp(ae))if(Xp)be=Ek;else{be=kk;var Ee=bk}else(pe=ae.nodeName)&&pe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(be=Sk);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,gc=ie,qs=null);break;case"focusout":qs=gc=Ei=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,im(ue,u,le);break;case"selectionchange":if(Ck)break;case"keydown":case"keyup":im(ue,u,le)}var Ne;if(dc)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()):(ar=le,oc="value"in ar?ar.value:ar.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=mk?gk(r,u):yk(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,b=y.stateNode;y.tag===5&&b!==null&&(y=b,b=Lr(r,u),b!=null&&p.unshift(Gs(r,b,y)),b=Lr(r,s),b!=null&&p.push(Gs(r,b,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 b=s._reactName,O=[];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,b),q!=null&&O.unshift(Gs(u,q,F))):y||(q=Lr(u,b),q!=null&&O.push(Gs(u,q,F)))),u=u.return}O.length!==0&&r.push({event:s,listeners:O})}var Pk=/\r\n?/g,Ak=/\u0000|\uFFFD/g;function gm(r){return(typeof r=="string"?r:""+r).replace(Pk,`
|
|
38
|
+
`).replace(Ak,"")}function Ca(r,s,u){if(s=gm(s),gm(r)!==s&&u)throw Error(n(425))}function Ta(){}var Sc=null,Ec=null;function Nc(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 _c=typeof setTimeout=="function"?setTimeout:void 0,Mk=typeof clearTimeout=="function"?clearTimeout:void 0,ym=typeof Promise=="function"?Promise:void 0,Rk=typeof queueMicrotask=="function"?queueMicrotask:typeof ym<"u"?function(r){return ym.resolve(null).then(r).catch(Lk)}:_c;function Lk(r){setTimeout(function(){throw r})}function Cc(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 ur(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,Tc="__reactEvents$"+Ci,jk="__reactListeners$"+Ci,Dk="__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 Oa(r){return r[Xs]||null}var Oc=[],Oi=-1;function cr(r){return{current:r}}function Ve(r){0>Oi||(r.current=Oc[Oi],Oc[Oi]=null,Oi--)}function $e(r,s){Oi++,Oc[Oi]=r.current,r.current=s}var fr={},mt=cr(fr),Ct=cr(!1),Vr=fr;function Ii(r,s){var u=r.type.contextTypes;if(!u)return fr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var y={},b;for(b in u)y[b]=s[b];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Ia(){Ve(Ct),Ve(mt)}function wm(r,s,u){if(mt.current!==fr)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||fr,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,Ic=!1;function km(r){Fn===null?Fn=[r]:Fn.push(r)}function $k(r){Aa=!0,km(r)}function dr(){if(!Ic&&Fn!==null){Ic=!0;var r=0,s=je;try{var u=Fn;for(je=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,dr),y}finally{je=s,Ic=!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 b=32-Dt(s)+y;if(30<b){var O=y-y%5;b=(p&(1<<O)-1).toString(32),p>>=O,y-=O,Bn=1<<32-Dt(s)+y|u<<y|p,Vn=b+r}else Bn=1<<b|u<<y|p,Vn=r}function Pc(r){r.return!==null&&(Ur(r,1),Sm(r,1,0))}function Ac(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=ur(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 Mc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Rc(r){if(Ue){var s=Ft;if(s){var u=s;if(!Nm(r,s)){if(Mc(r))throw Error(n(418));s=ur(u.nextSibling);var p=zt;s&&Nm(r,s)?Em(p,u):(r.flags=r.flags&-4097|2,Ue=!1,zt=r)}}else{if(Mc(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"&&!Nc(r.type,r.memoizedProps)),s&&(s=Ft)){if(Mc(r))throw Cm(),Error(n(418));for(;s;)Em(r,s),s=ur(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=ur(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Ft=null}}else Ft=zt?ur(r.stateNode.nextSibling):null;return!0}function Cm(){for(var r=Ft;r;)r=ur(r.nextSibling)}function Mi(){Ft=zt=null,Ue=!1}function Lc(r){on===null?on=[r]:on.push(r)}var zk=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,b=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===b?s.ref:(s=function(O){var F=y.refs;O===null?delete F[b]:F[b]=O},s._stringRef=b,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 Om(r){function s(te,X){if(r){var ne=te.deletions;ne===null?(te.deletions=[X],te.flags|=16):ne.push(X)}}function u(te,X){if(!r)return null;for(;X!==null;)s(te,X),X=X.sibling;return null}function p(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function y(te,X){return te=xr(te,X),te.index=0,te.sibling=null,te}function b(te,X,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<X?(te.flags|=2,X):ne):(te.flags|=2,X)):(te.flags|=1048576,X)}function O(te){return r&&te.alternate===null&&(te.flags|=2),te}function F(te,X,ne,ce){return X===null||X.tag!==6?(X=Cf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne),X.return=te,X)}function q(te,X,ne,ce){var be=ne.type;return be===M?le(te,X,ne.props.children,ce,ne.key):X!==null&&(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===X.type)?(ce=y(X,ne.props),ce.ref=Js(te,X,ne),ce.return=te,ce):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,X,ne),ce.return=te,ce)}function ie(te,X,ne,ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Tf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne.children||[]),X.return=te,X)}function le(te,X,ne,ce,be){return X===null||X.tag!==7?(X=Jr(ne,te.mode,ce,be),X.return=te,X):(X=y(X,ne),X.return=te,X)}function ue(te,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Cf(""+X,te.mode,ne),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case A:return ne=ol(X.type,X.key,X.props,null,te.mode,ne),ne.ref=Js(te,null,X),ne.return=te,ne;case R:return X=Tf(X,te.mode,ne),X.return=te,X;case Y:var ce=X._init;return ue(te,ce(X._payload),ne)}if(ht(X)||H(X))return X=Jr(X,te.mode,ne,null),X.return=te,X;ja(te,X)}return null}function ae(te,X,ne,ce){var be=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:F(te,X,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===be?q(te,X,ne,ce):null;case R:return ne.key===be?ie(te,X,ne,ce):null;case Y:return be=ne._init,ae(te,X,be(ne._payload),ce)}if(ht(ne)||H(ne))return be!==null?null:le(te,X,ne,ce,null);ja(te,ne)}return null}function pe(te,X,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,F(X,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case A:return te=te.get(ce.key===null?ne:ce.key)||null,q(X,te,ce,be);case R:return te=te.get(ce.key===null?ne:ce.key)||null,ie(X,te,ce,be);case Y:var Ee=ce._init;return pe(te,X,ne,Ee(ce._payload),be)}if(ht(ce)||H(ce))return te=te.get(ne)||null,le(X,te,ce,be,null);ja(X,ce)}return null}function ve(te,X,ne,ce){for(var be=null,Ee=null,Ne=X,Ce=X=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),X=b(Le,X,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&&(X=b(Ne,X,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),X=b(ut,X,Ce),Ee===null?be=ut:Ee.sibling=ut,Ee=ut);return r&&Ne.forEach(function(br){return s(te,br)}),Ue&&Ur(te,Ce),be}function we(te,X,ne,ce){var be=H(ne);if(typeof be!="function")throw Error(n(150));if(ne=be.call(ne),ne==null)throw Error(n(151));for(var Ee=be=null,Ne=X,Ce=X=0,ut=null,Le=ne.next();Ne!==null&&!Le.done;Ce++,Le=ne.next()){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var br=ae(te,Ne,Le.value,ce);if(br===null){Ne===null&&(Ne=ut);break}r&&Ne&&br.alternate===null&&s(te,Ne),X=b(br,X,Ce),Ee===null?be=br:Ee.sibling=br,Ee=br,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&&(X=b(Le,X,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),X=b(Le,X,Ce),Ee===null?be=Le:Ee.sibling=Le,Ee=Le);return r&&Ne.forEach(function(vS){return s(te,vS)}),Ue&&Ur(te,Ce),be}function Qe(te,X,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=X;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===M){if(Ee.tag===7){u(te,Ee.sibling),X=y(Ee,ne.props.children),X.return=te,te=X;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===Ee.type){u(te,Ee.sibling),X=y(Ee,ne.props),X.ref=Js(te,Ee,ne),X.return=te,te=X;break e}u(te,Ee);break}else s(te,Ee);Ee=Ee.sibling}ne.type===M?(X=Jr(ne.props.children,te.mode,ce,ne.key),X.return=te,te=X):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,X,ne),ce.return=te,te=ce)}return O(te);case R:e:{for(Ee=ne.key;X!==null;){if(X.key===Ee)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){u(te,X.sibling),X=y(X,ne.children||[]),X.return=te,te=X;break e}else{u(te,X);break}else s(te,X);X=X.sibling}X=Tf(ne,te.mode,ce),X.return=te,te=X}return O(te);case Y:return Ee=ne._init,Qe(te,X,Ee(ne._payload),ce)}if(ht(ne))return ve(te,X,ne,ce);if(H(ne))return we(te,X,ne,ce);ja(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(u(te,X.sibling),X=y(X,ne),X.return=te,te=X):(u(te,X),X=Cf(ne,te.mode,ce),X.return=te,te=X),O(te)):u(te,X)}return Qe}var Ri=Om(!0),Im=Om(!1),Da=cr(null),$a=null,Li=null,jc=null;function Dc(){jc=Li=$a=null}function $c(r){var s=Da.current;Ve(Da),r._currentValue=s}function zc(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,jc=Li=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Ot=!0),r.firstContext=null)}function Gt(r){var s=r._currentValue;if(jc!==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 Fc(r){Hr===null?Hr=[r]:Hr.push(r)}function Pm(r,s,u,p){var y=s.interleaved;return y===null?(u.next=u,Fc(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 hr=!1;function Bc(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 pr(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,Fc(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,b=null;if(u=u.firstBaseUpdate,u!==null){do{var O={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};b===null?y=b=O:b=b.next=O,u=u.next}while(u!==null);b===null?y=b=s:b=b.next=s}else y=b=s;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:b,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;hr=!1;var b=y.firstBaseUpdate,O=y.lastBaseUpdate,F=y.shared.pending;if(F!==null){y.shared.pending=null;var q=F,ie=q.next;q.next=null,O===null?b=ie:O.next=ie,O=q;var le=r.alternate;le!==null&&(le=le.updateQueue,F=le.lastBaseUpdate,F!==O&&(F===null?le.firstBaseUpdate=ie:F.next=ie,le.lastBaseUpdate=q))}if(b!==null){var ue=y.baseState;O=0,le=ie=q=null,F=b;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:hr=!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,O|=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 O|=y.lane,y=y.next;while(y!==s)}else b===null&&(y.shared.lanes=0);Kr|=O,r.lanes=O,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=cr(Zs),eo=cr(Zs),to=cr(Zs);function qr(r){if(r===Zs)throw Error(n(174));return r}function Vc(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 Wc(r){eo.current===r&&(Ve(Nn),Ve(eo))}var Ke=cr(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 Uc=[];function Hc(){for(var r=0;r<Uc.length;r++)Uc[r]._workInProgressVersionPrimary=null;Uc.length=0}var Va=T.ReactCurrentDispatcher,qc=T.ReactCurrentBatchConfig,Yr=0,Ge=null,it=null,at=null,Wa=!1,no=!1,ro=0,Fk=0;function gt(){throw Error(n(321))}function Yc(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 Kc(r,s,u,p,y,b){if(Yr=b,Ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Va.current=r===null||r.memoizedState===null?Uk:Hk,r=u(p,y),no){b=0;do{if(no=!1,ro=0,25<=b)throw Error(n(301));b+=1,at=it=null,s.updateQueue=null,Va.current=qk,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 Gc(){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 Xc(r){var s=Xt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=it,y=p.baseQueue,b=u.pending;if(b!==null){if(y!==null){var O=y.next;y.next=b.next,b.next=O}p.baseQueue=y=b,u.pending=null}if(y!==null){b=y.next,p=p.baseState;var F=O=null,q=null,ie=b;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,O=p):q=q.next=ue,Ge.lanes|=le,Kr|=le}ie=ie.next}while(ie!==null&&ie!==b);q===null?O=p:q.next=F,sn(p,s.memoizedState)||(Ot=!0),s.memoizedState=p,s.baseState=O,s.baseQueue=q,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do b=y.lane,Ge.lanes|=b,Kr|=b,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function Qc(r){var s=Xt(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,b=s.memoizedState;if(y!==null){u.pending=null;var O=y=y.next;do b=r(b,O.action),O=O.next;while(O!==y);sn(b,s.memoizedState)||(Ot=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),u.lastRenderedState=b}return[b,p]}function jm(){}function Dm(r,s){var u=Ge,p=Xt(),y=s(),b=!sn(p.memoizedState,y);if(b&&(p.memoizedState=y,Ot=!0),p=p.queue,Jc(Fm.bind(null,u,p,r),[r]),p.getSnapshot!==s||b||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=Wk.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 b=void 0;if(it!==null){var O=it.memoizedState;if(b=O.destroy,p!==null&&Yc(p,O.deps)){y.memoizedState=so(s,u,b,p);return}}Ge.flags|=r,y.memoizedState=so(1|s,u,b,p)}function Hm(r,s){return Ua(8390656,8,r,s)}function Jc(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 Zc(){}function Xm(r,s){var u=Xt();s=s===void 0?null:s;var p=u.memoizedState;return p!==null&&s!==null&&Yc(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&&Yc(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,Ot=!0),r.memoizedState=u):(sn(u,s)||(u=ha(),Ge.lanes|=u,Kr|=u,r.baseState=!0),s)}function Bk(r,s){var u=je;je=u!==0&&4>u?u:4,r(!0);var p=qc.transition;qc.transition={};try{r(!1),s()}finally{je=u,qc.transition=p}}function Zm(){return Xt().memoizedState}function Vk(r,s,u){var p=vr(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 Wk(r,s,u){var p=vr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(eg(r))tg(s,y);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var O=s.lastRenderedState,F=b(O,u);if(y.hasEagerState=!0,y.eagerState=F,sn(F,O)){var q=s.interleaved;q===null?(y.next=y,Fc(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},Uk={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=Vk.bind(null,Ge,r),[p.memoizedState,r]},useRef:function(r){var s=_n();return r={current:r},s.memoizedState=r},useState:Wm,useDebugValue:Zc,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=Wm(!1),s=r[0];return r=Bk.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 b={value:u,getSnapshot:s};return y.queue=b,Hm(Fm.bind(null,p,b,r),[r]),p.flags|=2048,so(9,zm.bind(null,p,b,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=Fk++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Hk={readContext:Gt,useCallback:Xm,useContext:Gt,useEffect:Jc,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Ym,useMemo:Qm,useReducer:Xc,useRef:Um,useState:function(){return Xc(io)},useDebugValue:Zc,useDeferredValue:function(r){var s=Xt();return Jm(s,it.memoizedState,r)},useTransition:function(){var r=Xc(io)[0],s=Xt().memoizedState;return[r,s]},useMutableSource:jm,useSyncExternalStore:Dm,useId:Zm,unstable_isNewReconciler:!1},qk={readContext:Gt,useCallback:Xm,useContext:Gt,useEffect:Jc,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Ym,useMemo:Qm,useReducer:Qc,useRef:Um,useState:function(){return Qc(io)},useDebugValue:Zc,useDeferredValue:function(r){var s=Xt();return it===null?s.memoizedState=r: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};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 ef(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=vr(r),b=Un(p,y);b.payload=s,u!=null&&(b.callback=u),s=pr(r,b,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=bt(),y=vr(r),b=Un(p,y);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=pr(r,b,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=bt(),p=vr(r),y=Un(u,p);y.tag=2,s!=null&&(y.callback=s),s=pr(r,y,p),s!==null&&(cn(s,r,p,u),za(s,r,p))}};function rg(r,s,u,p,y,b,O){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,b,O):s.prototype&&s.prototype.isPureReactComponent?!Hs(u,p)||!Hs(y,b):!0}function ig(r,s,u){var p=!1,y=fr,b=s.contextType;return typeof b=="object"&&b!==null?b=Gt(b):(y=Tt(s)?Vr:mt.current,p=s.contextTypes,b=(p=p!=null)?Ii(r,y):fr),s=new s(u,b),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=b),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 tf(r,s,u,p){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},Bc(r);var b=s.contextType;typeof b=="object"&&b!==null?y.context=Gt(b):(b=Tt(s)?Vr:mt.current,y.context=Ii(r,b)),y.state=r.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(ef(r,s,b,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(b){y=`
|
|
39
|
+
Error generating stack: `+b.message+`
|
|
40
|
+
`+b.stack}return{value:r,source:s,stack:y,digest:null}}function nf(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function rf(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var Yk=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,wf=p),rf(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(){rf(r,s)}}var b=r.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(u.callback=function(){rf(r,s),typeof p!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var O=s.stack;this.componentDidCatch(s.value,{componentStack:O!==null?O:""})}),u}function lg(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Yk;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=aS.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,pr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var Kk=T.ReactCurrentOwner,Ot=!1;function xt(r,s,u,p){s.child=r===null?Im(s,null,u,p):Ri(s,r.child,u,p)}function fg(r,s,u,p,y){u=u.render;var b=s.ref;return ji(s,y),p=Kc(r,s,u,p,b,y),u=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&u&&Pc(s),s.flags|=1,xt(r,s,p,y),s.child)}function dg(r,s,u,p,y){if(r===null){var b=u.type;return typeof b=="function"&&!_f(b)&&b.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=b,hg(r,s,b,p,y)):(r=ol(u.type,null,p,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(b=r.child,(r.lanes&y)===0){var O=b.memoizedProps;if(u=u.compare,u=u!==null?u:Hs,u(O,p)&&r.ref===s.ref)return Hn(r,s,y)}return s.flags|=1,r=xr(b,p),r.ref=s.ref,r.return=s,s.child=r}function hg(r,s,u,p,y){if(r!==null){var b=r.memoizedProps;if(Hs(b,p)&&r.ref===s.ref)if(Ot=!1,s.pendingProps=p=b,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Ot=!0);else return s.lanes=r.lanes,Hn(r,s,y)}return sf(r,s,u,p,y)}function pg(r,s,u){var p=s.pendingProps,y=p.children,b=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=b!==null?b.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=b!==null?b.baseLanes:u,$e(Fi,Bt),Bt|=p}else b!==null?(p=b.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 sf(r,s,u,p,y){var b=Tt(u)?Vr:mt.current;return b=Ii(s,b),ji(s,y),u=Kc(r,s,u,p,b,y),p=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&p&&Pc(s),s.flags|=1,xt(r,s,u,y),s.child)}function gg(r,s,u,p,y){if(Tt(u)){var b=!0;Pa(s)}else b=!1;if(ji(s,y),s.stateNode===null)Ga(r,s),ig(s,u,p),tf(s,u,p,y),p=!0;else if(r===null){var O=s.stateNode,F=s.memoizedProps;O.props=F;var q=O.context,ie=u.contextType;typeof ie=="object"&&ie!==null?ie=Gt(ie):(ie=Tt(u)?Vr:mt.current,ie=Ii(s,ie));var le=u.getDerivedStateFromProps,ue=typeof le=="function"||typeof O.getSnapshotBeforeUpdate=="function";ue||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==p||q!==ie)&&sg(s,O,p,ie),hr=!1;var ae=s.memoizedState;O.state=ae,Fa(s,p,O,y),q=s.memoizedState,F!==p||ae!==q||Ct.current||hr?(typeof le=="function"&&(ef(s,u,le,p),q=s.memoizedState),(F=hr||rg(s,u,F,p,ae,q,ie))?(ue||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(s.flags|=4194308)):(typeof O.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=q),O.props=p,O.state=q,O.context=ie,p=F):(typeof O.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{O=s.stateNode,Am(r,s),F=s.memoizedProps,ie=s.type===s.elementType?F:an(s.type,F),O.props=ie,ue=s.pendingProps,ae=O.context,q=u.contextType,typeof q=="object"&&q!==null?q=Gt(q):(q=Tt(u)?Vr:mt.current,q=Ii(s,q));var pe=u.getDerivedStateFromProps;(le=typeof pe=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==ue||ae!==q)&&sg(s,O,p,q),hr=!1,ae=s.memoizedState,O.state=ae,Fa(s,p,O,y);var ve=s.memoizedState;F!==ue||ae!==ve||Ct.current||hr?(typeof pe=="function"&&(ef(s,u,pe,p),ve=s.memoizedState),(ie=hr||rg(s,u,ie,p,ae,ve,q)||!1)?(le||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(p,ve,q),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(p,ve,q)),typeof O.componentDidUpdate=="function"&&(s.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof O.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=ve),O.props=p,O.state=ve,O.context=q,p=ie):(typeof O.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),p=!1)}return of(r,s,u,p,b,y)}function of(r,s,u,p,y,b){mg(r,s);var O=(s.flags&128)!==0;if(!p&&!O)return y&&bm(s,u,!1),Hn(r,s,b);p=s.stateNode,Kk.current=s;var F=O&&typeof u.getDerivedStateFromError!="function"?null:p.render();return s.flags|=1,r!==null&&O?(s.child=Ri(s,r.child,null,b),s.child=Ri(s,null,F,b)):xt(r,s,F,b),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),Vc(r,s.containerInfo)}function vg(r,s,u,p,y){return Mi(),Lc(y),s.flags|=256,xt(r,s,u,p),s.child}var af={dehydrated:null,treeContext:null,retryLane:0};function lf(r){return{baseLanes:r,cachePool:null,transitions:null}}function wg(r,s,u){var p=s.pendingProps,y=Ke.current,b=!1,O=(s.flags&128)!==0,F;if((F=O)||(F=r!==null&&r.memoizedState===null?!1:(y&2)!==0),F?(b=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),$e(Ke,y&1),r===null)return Rc(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):(O=p.children,r=p.fallback,b?(p=s.mode,b=s.child,O={mode:"hidden",children:O},(p&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=O):b=al(O,p,0,null),r=Jr(r,p,u,null),b.return=s,r.return=s,b.sibling=r,s.child=b,s.child.memoizedState=lf(u),s.memoizedState=af,r):uf(s,O));if(y=r.memoizedState,y!==null&&(F=y.dehydrated,F!==null))return Gk(r,s,O,p,F,y,u);if(b){b=p.fallback,O=s.mode,y=r.child,F=y.sibling;var q={mode:"hidden",children:p.children};return(O&1)===0&&s.child!==y?(p=s.child,p.childLanes=0,p.pendingProps=q,s.deletions=null):(p=xr(y,q),p.subtreeFlags=y.subtreeFlags&14680064),F!==null?b=xr(F,b):(b=Jr(b,O,u,null),b.flags|=2),b.return=s,p.return=s,p.sibling=b,s.child=p,p=b,b=s.child,O=r.child.memoizedState,O=O===null?lf(u):{baseLanes:O.baseLanes|u,cachePool:null,transitions:O.transitions},b.memoizedState=O,b.childLanes=r.childLanes&~u,s.memoizedState=af,p}return b=r.child,r=b.sibling,p=xr(b,{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 uf(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&&Lc(p),Ri(s,r.child,null,u),r=uf(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Gk(r,s,u,p,y,b,O){if(u)return s.flags&256?(s.flags&=-257,p=nf(Error(n(422))),Ka(r,s,O,p)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(b=p.fallback,y=s.mode,p=al({mode:"visible",children:p.children},y,0,null),b=Jr(b,y,O,null),b.flags|=2,p.return=s,b.return=s,p.sibling=b,s.child=p,(s.mode&1)!==0&&Ri(s,r.child,null,O),s.child.memoizedState=lf(O),s.memoizedState=af,b);if((s.mode&1)===0)return Ka(r,s,O,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var F=p.dgst;return p=F,b=Error(n(419)),p=nf(b,p,void 0),Ka(r,s,O,p)}if(F=(O&r.childLanes)!==0,Ot||F){if(p=lt,p!==null){switch(O&-O){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|O))!==0?0:y,y!==0&&y!==b.retryLane&&(b.retryLane=y,Wn(r,y),cn(p,r,y,-1))}return Nf(),p=nf(Error(n(421))),Ka(r,s,O,p)}return y.data==="$?"?(s.flags|=128,s.child=r.child,s=lS.bind(null,r),y._reactRetry=s,null):(r=b.treeContext,Ft=ur(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=uf(s,p.children),s.flags|=4096,s)}function xg(r,s,u){r.lanes|=s;var p=r.alternate;p!==null&&(p.lanes|=s),zc(r.return,s,u)}function cf(r,s,u,p,y){var b=r.memoizedState;b===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=p,b.tail=u,b.tailMode=y)}function bg(r,s,u){var p=s.pendingProps,y=p.revealOrder,b=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),cf(s,!1,y,u,b);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}cf(s,!0,u,null,b);break;case"together":cf(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=xr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=xr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Xk(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:Vc(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,ff,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}},ff=function(){},Sg=function(r,s,u,p){var y=r.memoizedProps;if(y!==p){r=s.stateNode,qr(Nn.current);var b=null;switch(u){case"input":y=Se(r,y),p=Se(r,p),b=[];break;case"select":y=V({},y,{value:void 0}),p=V({},p,{value:void 0}),b=[];break;case"textarea":y=jn(r,y),p=jn(r,p),b=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Ta)}Ss(u,p);var O;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var F=y[ie];for(O in F)F.hasOwnProperty(O)&&(u||(u={}),u[O]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?b||(b=[]):(b=b||[]).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(O in F)!F.hasOwnProperty(O)||q&&q.hasOwnProperty(O)||(u||(u={}),u[O]="");for(O in q)q.hasOwnProperty(O)&&F[O]!==q[O]&&(u||(u={}),u[O]=q[O])}else u||(b||(b=[]),b.push(ie,u)),u=q;else ie==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,F=F?F.__html:void 0,q!=null&&F!==q&&(b=b||[]).push(ie,q)):ie==="children"?typeof q!="string"&&typeof q!="number"||(b=b||[]).push(ie,""+q):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(q!=null&&ie==="onScroll"&&Be("scroll",r),b||F===q||(b=[])):(b=b||[]).push(ie,q))}u&&(b=b||[]).push("style",u);var ie=b;(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 Qk(r,s,u){var p=s.pendingProps;switch(Ac(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)&&Ia(),yt(s),null;case 3:return p=s.stateNode,Di(),Ve(Ct),Ve(mt),Hc(),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&&(kf(on),on=null))),ff(r,s),yt(s),null;case 5:Wc(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 b=s.memoizedProps;switch(p[En]=s,p[Xs]=b,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,b),Be("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!b.multiple},Be("invalid",p);break;case"textarea":bn(p,b),Be("invalid",p)}Ss(u,b),y=null;for(var O in b)if(b.hasOwnProperty(O)){var F=b[O];O==="children"?typeof F=="string"?p.textContent!==F&&(b.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",F]):typeof F=="number"&&p.textContent!==""+F&&(b.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",""+F]):o.hasOwnProperty(O)&&F!=null&&O==="onScroll"&&Be("scroll",p)}switch(u){case"input":xe(p),wt(p,b,!0);break;case"textarea":xe(p),_t(p);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(p.onclick=Ta)}p=y,s.updateQueue=p,p!==null&&(s.flags|=4)}else{O=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=O.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=O.createElement(u,{is:p.is}):(r=O.createElement(u),u==="select"&&(O=r,p.multiple?O.multiple=!0:p.size&&(O.size=p.size))):r=O.createElementNS(r,u),r[En]=s,r[Xs]=p,kg(r,s,!1,!1),s.stateNode=r;e:{switch(O=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(b in F)if(F.hasOwnProperty(b)){var q=F[b];b==="style"?Jo(r,q):b==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Xo(r,q)):b==="children"?typeof q=="string"?(u!=="textarea"||q!=="")&&Dn(r,q):typeof q=="number"&&Dn(r,""+q):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(o.hasOwnProperty(b)?q!=null&&b==="onScroll"&&Be("scroll",r):q!=null&&E(r,b,q,O))}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,b=p.value,b!=null?pt(r,!!p.multiple,b,!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,(b=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)}b&&(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,b=!1;else if(b=La(s),p!==null&&p.dehydrated!==null){if(r===null){if(!b)throw Error(n(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(n(317));b[En]=s}else Mi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;yt(s),b=!1}else on!==null&&(kf(on),on=null),b=!0;if(!b)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):Nf())),s.updateQueue!==null&&(s.flags|=4),yt(s),null);case 4:return Di(),ff(r,s),r===null&&Ks(s.stateNode.containerInfo),yt(s),null;case 10:return $c(s.type._context),yt(s),null;case 17:return Tt(s.type)&&Ia(),yt(s),null;case 19:if(Ve(Ke),b=s.memoizedState,b===null)return yt(s),null;if(p=(s.flags&128)!==0,O=b.rendering,O===null)if(p)oo(b,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(O=Ba(r),O!==null){for(s.flags|=128,oo(b,!1),p=O.updateQueue,p!==null&&(s.updateQueue=p,s.flags|=4),s.subtreeFlags=0,p=u,u=s.child;u!==null;)b=u,r=p,b.flags&=14680066,O=b.alternate,O===null?(b.childLanes=0,b.lanes=r,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=O.childLanes,b.lanes=O.lanes,b.child=O.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=O.memoizedProps,b.memoizedState=O.memoizedState,b.updateQueue=O.updateQueue,b.type=O.type,r=O.dependencies,b.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}b.tail!==null&&Ye()>Bi&&(s.flags|=128,p=!0,oo(b,!1),s.lanes=4194304)}else{if(!p)if(r=Ba(O),r!==null){if(s.flags|=128,p=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),oo(b,!0),b.tail===null&&b.tailMode==="hidden"&&!O.alternate&&!Ue)return yt(s),null}else 2*Ye()-b.renderingStartTime>Bi&&u!==1073741824&&(s.flags|=128,p=!0,oo(b,!1),s.lanes=4194304);b.isBackwards?(O.sibling=s.child,s.child=O):(u=b.last,u!==null?u.sibling=O:s.child=O,b.last=O)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.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 Ef(),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 Jk(r,s){switch(Ac(s),s.tag){case 1:return Tt(s.type)&&Ia(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Di(),Ve(Ct),Ve(mt),Hc(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Wc(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 $c(s.type._context),null;case 22:case 23:return Ef(),null;case 24:return null;default:return null}}var Xa=!1,vt=!1,Zk=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 df(r,s,u){try{u()}catch(p){Xe(r,s,p)}}var Ng=!1;function eS(r,s){if(Sc=ga,r=rm(),mc(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,b=p.focusNode;p=p.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var O=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=O+y),ue!==b||p!==0&&ue.nodeType!==3||(q=O+p),ue.nodeType===3&&(O+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)ae=ue,ue=pe;for(;;){if(ue===r)break t;if(ae===u&&++ie===y&&(F=O),ae===b&&++le===p&&(q=O),(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(Ec={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,X=te.getSnapshotBeforeUpdate(s.elementType===s.type?we:an(s.type,we),Qe);te.__reactInternalSnapshotBeforeUpdate=X}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 b=y.destroy;y.destroy=void 0,b!==void 0&&df(s,u,b)}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 hf(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[Tc],delete s[jk],delete s[Dk])),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 pf(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(pf(r,s,u),r=r.sibling;r!==null;)pf(r,s,u),r=r.sibling}function mf(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(mf(r,s,u),r=r.sibling;r!==null;)mf(r,s,u),r=r.sibling}var ct=null,ln=!1;function mr(r,s,u){for(u=u.child;u!==null;)Og(r,s,u),u=u.sibling}function Og(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,mr(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?Cc(r.parentNode,u):r.nodeType===1&&Cc(r,u),zs(r)):Cc(ct,u.stateNode));break;case 4:p=ct,y=ln,ct=u.stateNode.containerInfo,ln=!0,mr(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 b=y,O=b.destroy;b=b.tag,O!==void 0&&((b&2)!==0||(b&4)!==0)&&df(u,s,O),y=y.next}while(y!==p)}mr(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)}mr(r,s,u);break;case 21:mr(r,s,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,mr(r,s,u),vt=p):mr(r,s,u);break;default:mr(r,s,u)}}function Ig(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Zk),s.forEach(function(p){var y=uS.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 b=r,O=s,F=O;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));Og(b,O,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 b=r.memoizedProps,O=u!==null?u.memoizedProps:b,F=r.type,q=r.updateQueue;if(r.updateQueue=null,q!==null)try{F==="input"&&b.type==="radio"&&b.name!=null&&Ae(y,b),Es(F,O);var ie=Es(F,b);for(O=0;O<q.length;O+=2){var le=q[O],ue=q[O+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,b);break;case"textarea":kn(y,b);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!b.multiple;var pe=b.value;pe!=null?pt(y,!!b.multiple,pe,!1):ae!==!!b.multiple&&(b.defaultValue!=null?pt(y,!!b.multiple,b.defaultValue,!0):pt(y,!!b.multiple,b.multiple?[]:"",!1))}y[Xs]=b}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,b=r.memoizedProps;try{y.nodeValue=b}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&&(b=y.memoizedState!==null,y.stateNode.isHidden=b,!b||y.alternate!==null&&y.alternate.memoizedState!==null||(vf=Ye())),p&4&&Ig(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?(b=y.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(F=ue.stateNode,q=ue.memoizedProps.style,O=q!=null&&q.hasOwnProperty("display")?q.display:null,F.style.display=Qo("display",O))}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&&Ig(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 b=Tg(r);mf(r,b,y);break;case 3:case 4:var O=p.stateNode.containerInfo,F=Tg(r);pf(r,F,O);break;default:throw Error(n(161))}}catch(q){Xe(r,r.return,q)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function tS(r,s,u){ge=r,Ag(r)}function Ag(r,s,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,b=y.child;if(y.tag===22&&p){var O=y.memoizedState!==null||Xa;if(!O){var F=y.alternate,q=F!==null&&F.memoizedState!==null||vt;F=Xa;var ie=vt;if(Xa=O,(vt=q)&&!ie)for(ge=y;ge!==null;)O=ge,q=O.child,O.tag===22&&O.memoizedState!==null?Lg(y):q!==null?(q.return=O,ge=q):Lg(y);for(;b!==null;)ge=b,Ag(b),b=b.sibling;ge=y,Xa=F,vt=ie}Mg(r)}else(y.subtreeFlags&8772)!==0&&b!==null?(b.return=y,ge=b):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 b=s.updateQueue;b!==null&&Rm(s,b,p);break;case 3:var O=s.updateQueue;if(O!==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,O,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&&hf(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 b=s.return;try{hf(s)}catch(q){Xe(s,b,q)}break;case 5:var O=s.return;try{hf(s)}catch(q){Xe(s,O,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 nS=Math.ceil,Ja=T.ReactCurrentDispatcher,gf=T.ReactCurrentOwner,Qt=T.ReactCurrentBatchConfig,Re=0,lt=null,tt=null,ft=0,Bt=0,Fi=cr(0),st=0,lo=null,Kr=0,Za=0,yf=0,uo=null,It=null,vf=0,Bi=1/0,qn=null,el=!1,wf=null,gr=null,tl=!1,yr=null,nl=0,co=0,xf=null,rl=-1,il=0;function bt(){return(Re&6)!==0?Ye():rl!==-1?rl:rl=Ye()}function vr(r){return(r.mode&1)===0?1:(Re&2)!==0&&ft!==0?ft&-ft:zk.transition!==null?(il===0&&(il=ha()),il):(r=je,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,xf=null,Error(n(185));Fr(r,u,p),((Re&2)===0||r!==lt)&&(r===lt&&((Re&2)===0&&(Za|=u),st===4&&wr(r,ft)),Pt(r,p),u===1&&Re===0&&(s.mode&1)===0&&(Bi=Ye()+500,Aa&&dr()))}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?$k(Dg.bind(null,r)):km(Dg.bind(null,r)),Rk(function(){(Re&6)===0&&dr()}),u=null;else{switch(Op(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 b=zg();(lt!==r||ft!==s)&&(qn=null,Bi=Ye()+500,Xr(r,s));do try{sS();break}catch(F){$g(r,F)}while(!0);Dc(),Ja.current=b,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=bf(r,y))),s===1)throw u=lo,Xr(r,0),wr(r,p),Pt(r,Ye()),u;if(s===6)wr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!rS(y)&&(s=sl(r,p),s===2&&(b=Rs(r),b!==0&&(p=b,s=bf(r,b))),s===1))throw u=lo,Xr(r,0),wr(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,It,qn);break;case 3:if(wr(r,p),(p&130023424)===p&&(s=vf+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=_c(Qr.bind(null,r,It,qn),s);break}Qr(r,It,qn);break;case 4:if(wr(r,p),(p&4194240)===p)break;for(s=r.eventTimes,y=-1;0<p;){var O=31-Dt(p);b=1<<O,O=s[O],O>y&&(y=O),p&=~b}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*nS(p/1960))-p,10<p){r.timeoutHandle=_c(Qr.bind(null,r,It,qn),p);break}Qr(r,It,qn);break;case 5:Qr(r,It,qn);break;default:throw Error(n(329))}}}return Pt(r,Ye()),r.callbackNode===u?jg.bind(null,r):null}function bf(r,s){var u=uo;return r.current.memoizedState.isDehydrated&&(Xr(r,s).flags|=256),r=sl(r,s),r!==2&&(s=It,It=u,s!==null&&kf(s)),r}function kf(r){It===null?It=r:It.push.apply(It,r)}function rS(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],b=y.getSnapshot;y=y.value;try{if(!sn(b(),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 wr(r,s){for(s&=~yf,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=bf(r,p))}if(u===1)throw u=lo,Xr(r,0),wr(r,s),Pt(r,Ye()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Qr(r,It,qn),Pt(r,Ye()),null}function Sf(r,s){var u=Re;Re|=1;try{return r(s)}finally{Re=u,Re===0&&(Bi=Ye()+500,Aa&&dr())}}function Gr(r){yr!==null&&yr.tag===0&&(Re&6)===0&&Vi();var s=Re;Re|=1;var u=Qt.transition,p=je;try{if(Qt.transition=null,je=1,r)return r()}finally{je=p,Qt.transition=u,Re=s,(Re&6)===0&&dr()}}function Ef(){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,Mk(u)),tt!==null)for(u=tt.return;u!==null;){var p=u;switch(Ac(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&Ia();break;case 3:Di(),Ve(Ct),Ve(mt),Hc();break;case 5:Wc(p);break;case 4:Di();break;case 13:Ve(Ke);break;case 19:Ve(Ke);break;case 10:$c(p.type._context);break;case 22:case 23:Ef()}u=u.return}if(lt=r,tt=r=xr(r.current,null),ft=Bt=s,st=0,lo=null,yf=Za=Kr=0,It=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,b=u.pending;if(b!==null){var O=b.next;b.next=y,p.next=O}u.pending=p}Hr=null}return r}function $g(r,s){do{var u=tt;try{if(Dc(),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,gf.current=null,u===null||u.return===null){st=1,lo=s,tt=null;break}e:{var b=r,O=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(O);if(pe!==null){pe.flags&=-257,cg(pe,O,F,b,s),pe.mode&1&&lg(b,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(b,ie,s),Nf();break e}q=Error(n(426))}}else if(Ue&&F.mode&1){var Qe=ug(O);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),cg(Qe,O,F,b,s),Lc($i(q,F));break e}}b=q=$i(q,F),st!==4&&(st=2),uo===null?uo=[b]:uo.push(b),b=O;do{switch(b.tag){case 3:b.flags|=65536,s&=-s,b.lanes|=s;var te=og(b,q,s);Mm(b,te);break e;case 1:F=q;var X=b.type,ne=b.stateNode;if((b.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(gr===null||!gr.has(ne)))){b.flags|=65536,s&=-s,b.lanes|=s;var ce=ag(b,F,s);Mm(b,ce);break e}}b=b.return}while(b!==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 Nf(){(st===0||st===3||st===2)&&(st=4),lt===null||(Kr&268435455)===0&&(Za&268435455)===0||wr(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{iS();break}catch(y){$g(r,y)}while(!0);if(Dc(),Re=u,Ja.current=p,tt!==null)throw Error(n(261));return lt=null,ft=0,st}function iS(){for(;tt!==null;)Fg(tt)}function sS(){for(;tt!==null&&!Yu();)Fg(tt)}function Fg(r){var s=Ug(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,s===null?Bg(r):tt=s,gf.current=null}function Bg(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Qk(u,s,Bt),u!==null){tt=u;return}}else{if(u=Jk(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=je,y=Qt.transition;try{Qt.transition=null,je=1,oS(r,s,u,p)}finally{Qt.transition=y,je=p}return null}function oS(r,s,u,p){do Vi();while(yr!==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 b=u.lanes|u.childLanes;if(tc(r,b),r===lt&&(tt=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||tl||(tl=!0,Hg(gi,function(){return Vi(),null})),b=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||b){b=Qt.transition,Qt.transition=null;var O=je;je=1;var F=Re;Re|=4,gf.current=null,eS(r,u),Pg(u,r),_k(Ec),ga=!!Sc,Ec=Sc=null,r.current=u,tS(u),ua(),Re=F,je=O,Qt.transition=b}else r.current=u;if(tl&&(tl=!1,yr=r,nl=y),b=r.pendingLanes,b===0&&(gr=null),Xu(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=wf,wf=null,r;return(nl&1)!==0&&r.tag!==0&&Vi(),b=r.pendingLanes,(b&1)!==0?r===xf?co++:(co=0,xf=r):co=0,dr(),null}function Vi(){if(yr!==null){var r=Op(nl),s=Qt.transition,u=je;try{if(Qt.transition=null,je=16>r?16:r,yr===null)var p=!1;else{if(r=yr,yr=null,nl=0,(Re&6)!==0)throw Error(n(331));var y=Re;for(Re|=4,ge=r.current;ge!==null;){var b=ge,O=b.child;if((ge.flags&16)!==0){var F=b.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,b)}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=b.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=b}}if((b.subtreeFlags&2064)!==0&&O!==null)O.return=b,ge=O;else e:for(;ge!==null;){if(b=ge,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:ao(9,b,b.return)}var te=b.sibling;if(te!==null){te.return=b.return,ge=te;break e}ge=b.return}}var X=r.current;for(ge=X;ge!==null;){O=ge;var ne=O.child;if((O.subtreeFlags&2064)!==0&&ne!==null)ne.return=O,ge=ne;else e:for(O=X;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===O){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,dr(),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(yi,r)}catch{}p=!0}return p}finally{je=u,Qt.transition=s}}return!1}function Vg(r,s,u){s=$i(u,s),s=og(r,s,1),r=pr(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"&&(gr===null||!gr.has(p))){r=$i(u,r),r=ag(s,r,1),s=pr(s,r,1),r=bt(),s!==null&&(Fr(s,1,r),Pt(s,r));break}}s=s.return}}function aS(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()-vf?Xr(r,0):yf|=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 lS(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Wg(r,u)}function uS(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)Ot=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return Ot=!1,Xk(r,s,u);Ot=(r.flags&131072)!==0}else Ot=!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=Ii(s,mt.current);ji(s,u),y=Kc(null,s,p,r,y,u);var b=Gc();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)?(b=!0,Pa(s)):b=!1,s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Bc(s),y.updater=Ya,s.stateNode=y,y._reactInternals=s,tf(s,p,r,u),s=of(null,s,p,!0,b,u)):(s.tag=0,Ue&&b&&Pc(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=fS(p),r=an(p,r),y){case 0:s=sf(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),sf(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,b=s.memoizedState,y=b.element,Am(r,s),Fa(s,p,null,u);var O=s.memoizedState;if(p=O.element,b.isDehydrated)if(b={element:p,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},s.updateQueue.baseState=b,s.memoizedState=b,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=ur(s.stateNode.containerInfo.firstChild),zt=s,Ue=!0,on=null,u=Im(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&&Rc(s),p=s.type,y=s.pendingProps,b=r!==null?r.memoizedProps:null,O=y.children,Nc(p,y)?O=null:b!==null&&Nc(p,b)&&(s.flags|=32),mg(r,s),xt(r,s,O,u),s.child;case 6:return r===null&&Rc(s),null;case 13:return wg(r,s,u);case 4:return Vc(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,b=s.memoizedProps,O=y.value,$e(Da,p._currentValue),p._currentValue=O,b!==null)if(sn(b.value,O)){if(b.children===y.children&&!Ct.current){s=Hn(r,s,u);break e}}else for(b=s.child,b!==null&&(b.return=s);b!==null;){var F=b.dependencies;if(F!==null){O=b.child;for(var q=F.firstContext;q!==null;){if(q.context===p){if(b.tag===1){q=Un(-1,u&-u),q.tag=2;var ie=b.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}}b.lanes|=u,q=b.alternate,q!==null&&(q.lanes|=u),zc(b.return,u,s),F.lanes|=u;break}q=q.next}}else if(b.tag===10)O=b.type===s.type?null:b.child;else if(b.tag===18){if(O=b.return,O===null)throw Error(n(341));O.lanes|=u,F=O.alternate,F!==null&&(F.lanes|=u),zc(O,u,s),O=b.sibling}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===s){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}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),tf(s,p,y,u),of(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 cS(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 cS(r,s,u,p)}function _f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function fS(r){if(typeof r=="function")return _f(r)?1:0;if(r!=null){if(r=r.$$typeof,r===D)return 11;if(r===G)return 14}return 2}function xr(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,b){var O=2;if(p=r,typeof r=="function")_f(r)&&(O=1);else if(typeof r=="string")O=5;else e:switch(r){case M:return Jr(u.children,y,b,s);case C:O=8,y|=8;break;case I:return r=Jt(12,u,s,y|2),r.elementType=I,r.lanes=b,r;case Q:return r=Jt(13,u,s,y),r.elementType=Q,r.lanes=b,r;case z:return r=Jt(19,u,s,y),r.elementType=z,r.lanes=b,r;case Z:return al(u,y,b,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case j:O=10;break e;case L:O=9;break e;case D:O=11;break e;case G:O=14;break e;case Y:O=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jt(O,u,s,y),s.elementType=r,s.type=p,s.lanes=b,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 Cf(r,s,u){return r=Jt(6,r,null,s),r.lanes=u,r}function Tf(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 dS(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,b,O,F,q){return r=new dS(r,s,u,F,q),s===1?(s=1,b===!0&&(s|=8)):s=0,b=Jt(3,null,null,s),r.current=b,b.stateNode=r,b.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bc(b),r}function hS(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 fr;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,b,O,F,q){return r=Of(u,p,!0,r,y,b,O,F,q),r.context=qg(null),u=r.current,p=bt(),y=vr(u),b=Un(p,y),b.callback=s??null,pr(u,b,y),r.current.lanes=y,Fr(r,y,p),Pt(r,p),r}function ll(r,s,u,p){var y=s.current,b=bt(),O=vr(y);return u=qg(u),s.context===null?s.context=u:s.pendingContext=u,s=Un(b,O),s.payload={element:r},p=p===void 0?null:p,p!==null&&(s.callback=p),r=pr(y,s,O),r!==null&&(cn(r,y,O,b),za(r,y,O)),O}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 If(r,s){Kg(r,s),(r=r.alternate)&&Kg(r,s)}function pS(){return null}var Gg=typeof reportError=="function"?reportError:function(r){console.error(r)};function Pf(r){this._internalRoot=r}cl.prototype.render=Pf.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));ll(r,s,null,null)},cl.prototype.unmount=Pf.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<or.length&&s!==0&&s<or[u].priority;u++);or.splice(u,0,r),u===0&&Lp(r)}};function Af(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 mS(r,s,u,p,y){if(y){if(typeof p=="function"){var b=p;p=function(){var ie=ul(O);b.call(ie)}}var O=Yg(s,p,r,0,null,!1,!1,"",Xg);return r._reactRootContainer=O,r[zn]=O.current,Ks(r.nodeType===8?r.parentNode:r),Gr(),O}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 b=u._reactRootContainer;if(b){var O=b;if(typeof y=="function"){var F=y;y=function(){var q=ul(O);F.call(q)}}ll(s,O,r,y)}else O=mS(u,s,r,y,p);return ul(O)}Ip=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,dr()))}break;case 13:Gr(function(){var p=Wn(r,1);if(p!==null){var y=bt();cn(p,r,1,y)}}),If(r,1)}},nc=function(r){if(r.tag===13){var s=Wn(r,134217728);if(s!==null){var u=bt();cn(s,r,134217728,u)}If(r,134217728)}},Pp=function(r){if(r.tag===13){var s=vr(r),u=Wn(r,s);if(u!==null){var p=bt();cn(u,r,s,p)}If(r,s)}},Ap=function(){return je},Mp=function(r,s){var u=je;try{return je=r,s()}finally{je=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=Oa(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=Sf,ra=Gr;var gS={usingClientEntryPoint:!1,Events:[Qs,Ti,Oa,ea,ta,Sf]},fo={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yS={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||pS,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(yS),jt=hl}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gS,At.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Af(s))throw Error(n(200));return hS(r,s,null,u)},At.createRoot=function(r,s){if(!Af(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 Pf(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(!Af(r))throw Error(n(405));var p=u!=null&&u.hydratedSources||null,y=!1,b="",O=Gg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),s=Yg(s,null,r,1,u??null,y,!1,b,O),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=Sf,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 Jv(){if(iy)return Lf.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(),Lf.exports=CS(),Lf.exports}var sy;function TS(){if(sy)return pl;sy=1;var e=Jv();return pl.createRoot=e.createRoot,pl.hydrateRoot=e.hydrateRoot,pl}var OS=TS();const IS=hu(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 PS={value:()=>{}};function pu(){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 AS(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=pu.prototype={constructor:zl,on:function(e,t){var n=this._,i=AS(e+"",n),o,a=-1,l=i.length;if(arguments.length<2){for(;++a<l;)if((o=(e=i[a]).type)&&(o=MS(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 MS(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]=PS,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var lh="http://www.w3.org/1999/xhtml";const ay={svg:"http://www.w3.org/2000/svg",xhtml:lh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mu(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 RS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lh&&t.documentElement.namespaceURI===lh?t.createElement(e):t.createElementNS(n,e)}}function LS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Zv(e){var t=mu(e);return(t.local?LS:RS)(t)}function jS(){}function jh(e){return e==null?jS:function(){return this.querySelector(e)}}function DS(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 $S(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zS(){return[]}function ew(e){return e==null?zS:function(){return this.querySelectorAll(e)}}function FS(e){return function(){return $S(e.apply(this,arguments))}}function BS(e){typeof e=="function"?e=FS(e):e=ew(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 tw(e){return function(){return this.matches(e)}}function nw(e){return function(t){return t.matches(e)}}var VS=Array.prototype.find;function WS(e){return function(){return VS.call(this.children,e)}}function US(){return this.firstElementChild}function HS(e){return this.select(e==null?US:WS(typeof e=="function"?e:nw(e)))}var qS=Array.prototype.filter;function YS(){return Array.from(this.children)}function KS(e){return function(){return qS.call(this.children,e)}}function GS(e){return this.selectAll(e==null?YS:KS(typeof e=="function"?e:nw(e)))}function XS(e){typeof e!="function"&&(e=tw(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 rw(e){return new Array(e.length)}function QS(){return new Wt(this._enter||this._groups.map(rw),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 JS(e){return function(){return e}}function ZS(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 eE(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 tE(e){return e.__data__}function nE(e,t){if(!arguments.length)return Array.from(this,tE);var n=t?eE:ZS,i=this._parents,o=this._groups;typeof e!="function"&&(e=JS(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=rE(e.call(m,m&&m.__data__,h,i)),x=v.length,w=c[h]=new Array(x),k=l[h]=new Array(x),S=f[h]=new Array(g);n(m,d,w,k,S,v,t);for(var N=0,E=0,T,A;N<x;++N)if(T=w[N]){for(N>=E&&(E=N+1);!(A=k[E])&&++E<x;);T._next=A||null}}return l=new Wt(l,i),l._enter=c,l._exit=f,l}function rE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iE(){return new Wt(this._exit||this._groups.map(rw),this._parents)}function sE(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 oE(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 aE(){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 lE(e){e||(e=uE);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 uE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fE(){return Array.from(this)}function dE(){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 hE(){let e=0;for(const t of this)++e;return e}function pE(){return!this.node()}function mE(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 gE(e){return function(){this.removeAttribute(e)}}function yE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vE(e,t){return function(){this.setAttribute(e,t)}}function wE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function bE(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 kE(e,t){var n=mu(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?yE:gE:typeof t=="function"?n.local?bE:xE:n.local?wE:vE)(n,t))}function iw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function SE(e){return function(){this.style.removeProperty(e)}}function EE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function NE(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function _E(e,t,n){return arguments.length>1?this.each((t==null?SE:typeof t=="function"?NE:EE)(e,t,n??"")):ss(this.node(),e)}function ss(e,t){return e.style.getPropertyValue(t)||iw(e).getComputedStyle(e,null).getPropertyValue(t)}function CE(e){return function(){delete this[e]}}function TE(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 IE(e,t){return arguments.length>1?this.each((t==null?CE:typeof t=="function"?OE:TE)(e,t)):this.node()[e]}function sw(e){return e.trim().split(/^|\s+/)}function Dh(e){return e.classList||new ow(e)}function ow(e){this._node=e,this._names=sw(e.getAttribute("class")||"")}ow.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 aw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function lw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function PE(e){return function(){aw(this,e)}}function AE(e){return function(){lw(this,e)}}function ME(e,t){return function(){(t.apply(this,arguments)?aw:lw)(this,e)}}function RE(e,t){var n=sw(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"?ME:t?PE:AE)(n,t))}function LE(){this.textContent=""}function jE(e){return function(){this.textContent=e}}function DE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $E(e){return arguments.length?this.each(e==null?LE:(typeof e=="function"?DE:jE)(e)):this.node().textContent}function zE(){this.innerHTML=""}function FE(e){return function(){this.innerHTML=e}}function BE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function VE(e){return arguments.length?this.each(e==null?zE:(typeof e=="function"?BE:FE)(e)):this.node().innerHTML}function WE(){this.nextSibling&&this.parentNode.appendChild(this)}function UE(){return this.each(WE)}function HE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qE(){return this.each(HE)}function YE(e){var t=typeof e=="function"?e:Zv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function KE(){return null}function GE(e,t){var n=typeof e=="function"?e:Zv(e),i=t==null?KE:typeof t=="function"?t:jh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function XE(){var e=this.parentNode;e&&e.removeChild(this)}function QE(){return this.each(XE)}function JE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eN(e){return this.select(e?ZE:JE)}function tN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nN(e){return function(t){e.call(this,t,this.__data__)}}function rN(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 iN(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 sN(e,t,n){return function(){var i=this.__on,o,a=nN(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 oN(e,t,n){var i=rN(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?sN:iN,o=0;o<a;++o)this.each(c(i[o],t,n));return this}function uw(e,t,n){var i=iw(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 aN(e,t){return function(){return uw(this,e,t)}}function lN(e,t){return function(){return uw(this,e,t.apply(this,arguments))}}function uN(e,t){return this.each((typeof t=="function"?lN:aN)(e,t))}function*cN(){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 cw=[null];function Wt(e,t){this._groups=e,this._parents=t}function Bo(){return new Wt([[document.documentElement]],cw)}function fN(){return this}Wt.prototype=Bo.prototype={constructor:Wt,select:DS,selectAll:BS,selectChild:HS,selectChildren:GS,filter:XS,data:nE,enter:QS,exit:iE,join:sE,merge:oE,selection:fN,order:aE,sort:lE,call:cE,nodes:fE,node:dE,size:hE,empty:pE,each:mE,attr:kE,style:_E,property:IE,classed:RE,text:$E,html:VE,raise:UE,lower:qE,append:YE,insert:GE,remove:QE,clone:eN,datum:tN,on:oN,dispatch:uN,[Symbol.iterator]:cN};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],cw)}function dN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=dN(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 hN={passive:!1},Oo={capture:!0,passive:!1};function $f(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function fw(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",es,Oo);"onselectstart"in t?n.on("selectstart.drag",es,Oo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function dw(e,t){var n=e.document.documentElement,i=Vt(e).on("dragstart.drag",null);t&&(i.on("click.drag",es,Oo),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 uh(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}})}uh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pN(e){return!e.ctrlKey&&!e.button}function mN(){return this.parentNode}function gN(e,t){return t??{x:e.x,y:e.y}}function yN(){return navigator.maxTouchPoints||"ontouchstart"in this}function hw(){var e=pN,t=mN,n=gN,i=yN,o={},a=pu("start","drag","end"),l=0,c,f,h,m,d=0;function g(T){T.on("mousedown.drag",v).filter(i).on("touchstart.drag",k).on("touchmove.drag",S,hN).on("touchend.drag touchcancel.drag",N).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,Oo).on("mouseup.drag",w,Oo),fw(T.view),$f(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),dw(T.view,h),es(T),o.mouse("end",T)}function k(T,A){if(e.call(this,T,A)){var R=T.changedTouches,M=t.call(this,T,A),C=R.length,I,j;for(I=0;I<C;++I)(j=E(this,M,T,A,R[I].identifier,R[I]))&&($f(T),j("start",T,R[I]))}}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 N(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])&&($f(T),C("end",T,A[M]))}function E(T,A,R,M,C,I){var j=a.copy(),L=dn(I||R,A),D,Q,z;if((z=n.call(T,new uh("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,Q=z.y-L[1]||0,function G(Y,Z,B){var H=L,V;switch(Y){case"start":o[C]=G,V=l++;break;case"end":delete o[C],--l;case"drag":L=dn(B||Z,A),V=l;break}j.call(Y,T,new uh(Y,{sourceEvent:Z,subject:z,target:g,identifier:C,active:V,x:L[0]+D,y:L[1]+Q,dx:L[0]-H[0],dy:L[1]-H[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 pw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Vo(){}var Io=.7,Xl=1/Io,ts="\\s*([+-]?\\d+)\\s*",Po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vN=/^#([0-9a-f]{3,8})$/,wN=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),xN=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),bN=new RegExp(`^rgba\\(${ts},${ts},${ts},${Po}\\)$`),kN=new RegExp(`^rgba\\(${An},${An},${An},${Po}\\)$`),SN=new RegExp(`^hsl\\(${Po},${An},${An}\\)$`),EN=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:NN,formatHsl:_N,formatRgb:cy,toString:cy});function uy(){return this.rgb().formatHex()}function NN(){return this.rgb().formatHex8()}function _N(){return mw(this).formatHsl()}function cy(){return this.rgb().formatRgb()}function ai(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=vN.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=wN.exec(e))?new Mt(t[1],t[2],t[3],1):(t=xN.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bN.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=kN.exec(e))?gl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SN.exec(e))?py(t[1],t[2]/100,t[3]/100,1):(t=EN.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 CN(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 ch(e,t,n,i){return arguments.length===1?CN(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,ch,pw(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?Io:Math.pow(Io,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:TN,formatRgb:hy,toString:hy}));function dy(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function TN(){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 mw(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?mw(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,pw(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?Io:Math.pow(Io,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(zf(e>=240?e-240:e+120,o,i),zf(e,o,i),zf(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 zf(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 IN(e,t){return function(n){return e+n*t}}function PN(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 AN(e){return(e=+e)==1?gw:function(t,n){return n-t?PN(t,n,e):zh(isNaN(t)?n:t)}}function gw(e,t){var n=t-e;return n?IN(e,n):zh(isNaN(e)?t:e)}const Jl=(function e(t){var n=AN(t);function i(o,a){var l=n((o=ch(o)).r,(a=ch(a)).r),c=n(o.g,a.g),f=n(o.b,a.b),h=gw(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 MN(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 RN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function LN(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 jN(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function In(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function DN(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 fh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ff=new RegExp(fh.source,"g");function $N(e){return function(){return e}}function zN(e){return function(t){return e(t)+""}}function yw(e,t){var n=fh.lastIndex=Ff.lastIndex=0,i,o,a,l=-1,c=[],f=[];for(e=e+"",t=t+"";(i=fh.exec(e))&&(o=Ff.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:In(i,o)})),n=Ff.lastIndex;return n<t.length&&(a=t.slice(n),c[l]?c[l]+=a:c[++l]=a),c.length<2?f[0]?zN(f[0].x):$N(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"?In:n==="string"?(i=ai(t))?(t=i,Jl):yw:t instanceof ai?Jl:t instanceof Date?jN:RN(t)?MN:Array.isArray(t)?LN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?DN:In)(e,t)}var gy=180/Math.PI,dh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vw(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 FN(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?dh:vw(t.a,t.b,t.c,t.d,t.e,t.f)}function BN(e){return e==null||(vl||(vl=document.createElementNS("http://www.w3.org/2000/svg","g")),vl.setAttribute("transform",e),!(e=vl.transform.baseVal.consolidate()))?dh:(e=e.matrix,vw(e.a,e.b,e.c,e.d,e.e,e.f))}function ww(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:In(h,d)},{i:w-2,x:In(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:In(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:In(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:In(h,d)},{i:w-2,x:In(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,k;++x<w;)d[(k=g[x]).i]=k.x(v);return d.join("")}}}var VN=ww(FN,"px, ","px)","deg)"),WN=ww(BN,", ",")",")"),UN=1e-12;function yy(e){return((e=Math.exp(e))+1/e)/2}function HN(e){return((e=Math.exp(e))-1/e)/2}function qN(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,k,S;if(w<UN)S=Math.log(g/h)/t,k=function(M){return[c+M*v,f+M*x,h*Math.exp(t*M*S)]};else{var N=Math.sqrt(w),E=(g*g-h*h+i*w)/(2*h*n*N),T=(g*g-h*h-i*w)/(2*g*n*N),A=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(T*T+1)-T);S=(R-A)/t,k=function(M){var C=M*S,I=yy(A),j=h/(n*N)*(I*qN(t*C+A)-HN(A));return[c+j*v,f+j*x,h*I/yy(t*C+A)]}}return k.duration=S*1e3*t/Math.SQRT2,k}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,xw=1e3,Zl,xo,eu=0,li=0,gu=0,Ao=typeof performance=="object"&&performance.now?performance:Date,bw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fh(){return li||(bw(YN),li=Ao.now()+gu)}function YN(){li=0}function tu(){this._call=this._time=this._next=null}tu.prototype=kw.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,hh()},stop:function(){this._call&&(this._call=null,this._time=1/0,hh())}};function kw(e,t,n){var i=new tu;return i.restart(e,t,n),i}function KN(){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())+gu,os=wo=0;try{KN()}finally{os=0,XN(),li=0}}function GN(){var e=Ao.now(),t=e-eu;t>xw&&(gu-=t,eu=e)}function XN(){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,hh(i)}function hh(e){if(!os){wo&&(wo=clearTimeout(wo));var t=e-li;t>24?(e<1/0&&(wo=setTimeout(vy,e-Ao.now()-gu)),po&&(po=clearInterval(po))):(po||(eu=Ao.now(),po=setInterval(GN,xw)),os=1,bw(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 QN=pu("start","end","cancel","interrupt"),JN=[],Sw=0,xy=1,ph=2,Bl=3,by=4,mh=5,Vl=6;function yu(e,t,n,i,o,a){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ZN(e,n,{name:t,index:i,group:o,on:QN,tween:JN,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Sw})}function Bh(e,t){var n=vn(e,t);if(n.state>Sw)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 ZN(e,t,n){var i=e.__transition,o;i[t]=n,n.timer=kw(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=ph,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ph){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=mh,1),d=-1,g=o.length;++d<g;)o[d].call(e,m);n.state===mh&&(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>ph&&i.state<mh,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 e_(e){return this.each(function(){Wl(this,e)})}function t_(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 n_(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 r_(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?t_:n_)(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 Ew(e,t){var n;return(typeof t=="number"?In:t instanceof ai?Jl:(n=ai(t))?(t=n,Jl):yw)(e,t)}function i_(e){return function(){this.removeAttribute(e)}}function s_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o_(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 a_(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 l_(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 u_(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 c_(e,t){var n=mu(e),i=n==="transform"?WN:Ew;return this.attrTween(e,typeof t=="function"?(n.local?u_:l_)(n,i,Vh(this,"attr."+e,t)):t==null?(n.local?s_:i_)(n):(n.local?a_:o_)(n,i,t))}function f_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function d_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function h_(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 p_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&f_(e,a)),n}return o._value=t,o}function m_(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=mu(e);return this.tween(n,(i.local?h_:p_)(i,t))}function g_(e,t){return function(){Bh(this,e).delay=+t.apply(this,arguments)}}function y_(e,t){return t=+t,function(){Bh(this,e).delay=t}}function v_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?g_:y_)(t,e)):vn(this.node(),t).delay}function w_(e,t){return function(){Rn(this,e).duration=+t.apply(this,arguments)}}function x_(e,t){return t=+t,function(){Rn(this,e).duration=t}}function b_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?w_:x_)(t,e)):vn(this.node(),t).duration}function k_(e,t){if(typeof t!="function")throw new Error;return function(){Rn(this,e).ease=t}}function S_(e){var t=this._id;return arguments.length?this.each(k_(t,e)):vn(this.node(),t).ease}function E_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Rn(this,e).ease=n}}function N_(e){if(typeof e!="function")throw new Error;return this.each(E_(this._id,e))}function __(e){typeof e!="function"&&(e=tw(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 Zn(i,this._parents,this._name,this._id)}function C_(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 Zn(l,this._parents,this._name,this._id)}function T_(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=T_(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 I_(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(O_(n,e,t))}function P_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function A_(){return this.on("end.remove",P_(this._id))}function M_(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,yu(h[g],t,n,g,h,vn(m,n)));return new Zn(a,this._parents,t,n)}function R_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ew(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,k=g.length;w<k;++w)(v=g[w])&&yu(v,t,n,w,g,x);a.push(g),l.push(m)}return new Zn(a,l,t,n)}var L_=Bo.prototype.constructor;function j_(){return new L_(this._groups,this._parents)}function D_(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 Nw(e){return function(){this.style.removeProperty(e)}}function $_(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 z_(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 F_(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=Nw(t)):void 0;(h!==n||o!==m)&&(i=(n=h).copy()).on(l,o=m),f.on=i}}function B_(e,t,n){var i=(e+="")=="transform"?VN:Ew;return t==null?this.styleTween(e,D_(e,i)).on("end.style."+e,Nw(e)):typeof t=="function"?this.styleTween(e,z_(e,i,Vh(this,"style."+e,t))).each(F_(this._id,e)):this.styleTween(e,$_(e,i,t),n).on("end.style."+e,null)}function V_(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function W_(e,t,n){var i,o;function a(){var l=t.apply(this,arguments);return l!==o&&(i=(o=l)&&V_(e,l,n)),i}return a._value=t,a}function U_(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,W_(e,t,n??""))}function H_(e){return function(){this.textContent=e}}function q_(e){return function(){var t=e(this);this.textContent=t??""}}function Y_(e){return this.tween("text",typeof e=="function"?q_(Vh(this,"text",e)):H_(e==null?"":e+""))}function K_(e){return function(t){this.textContent=e.call(this,t)}}function G_(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&K_(o)),t}return i._value=e,i}function X_(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,G_(e))}function Q_(){for(var e=this._name,t=this._id,n=_w(),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);yu(f,e,n,h,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Zn(i,this._parents,e,n)}function J_(){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 Z_=0;function Zn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function _w(){return++Z_}var Yn=Bo.prototype;Zn.prototype={constructor:Zn,select:M_,selectAll:R_,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:__,merge:C_,selection:j_,transition:Q_,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:I_,attr:c_,attrTween:m_,style:B_,styleTween:U_,text:Y_,textTween:X_,remove:A_,tween:r_,delay:v_,duration:b_,ease:S_,easeVarying:N_,end:J_,[Symbol.iterator]:Yn[Symbol.iterator]};function eC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tC={time:null,delay:0,duration:250,ease:eC};function nC(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 rC(e){var t,n;e instanceof Zn?(t=e._id,e=e._name):(t=_w(),(n=tC).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])&&yu(f,e,t,h,l,n||nC(f,t));return new Zn(i,this._parents,e,t)}Bo.prototype.interrupt=e_;Bo.prototype.transition=rC;const wl=e=>()=>e;function iC(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 Gn(e,t,n){this.k=e,this.x=t,this.y=n}Gn.prototype={constructor:Gn,scale:function(e){return e===1?this:new Gn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var vu=new Gn(1,0,0);Cw.prototype=Gn.prototype;function Cw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vu;return e.__zoom}function Bf(e){e.stopImmediatePropagation()}function mo(e){e.preventDefault(),e.stopImmediatePropagation()}function sC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oC(){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||vu}function aC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lC(){return navigator.maxTouchPoints||"ontouchstart"in this}function uC(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 Tw(){var e=sC,t=oC,n=uC,i=aC,o=lC,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=Fl,h=pu("start","zoom","end"),m,d,g,v=500,x=150,w=0,k=10;function S(z){z.property("__zoom",ky).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",j).filter(o).on("touchstart.zoom",L).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(z,G,Y,Z){var B=z.selection?z.selection():z;B.property("__zoom",ky),z!==B?A(z,G,Y,Z):B.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 B=this.__zoom.k,H=typeof G=="function"?G.apply(this,arguments):G;return B*H},Y,Z)},S.scaleTo=function(z,G,Y,Z){S.transform(z,function(){var B=t.apply(this,arguments),H=this.__zoom,V=Y==null?T(B):typeof Y=="function"?Y.apply(this,arguments):Y,$=H.invert(V),U=typeof G=="function"?G.apply(this,arguments):G;return n(E(N(H,U),V,$),B,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,B){S.transform(z,function(){var H=t.apply(this,arguments),V=this.__zoom,$=Z==null?T(H):typeof Z=="function"?Z.apply(this,arguments):Z;return n(vu.translate($[0],$[1]).scale(V.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof Y=="function"?-Y.apply(this,arguments):-Y),H,l)},Z,B)};function N(z,G){return G=Math.max(a[0],Math.min(a[1],G)),G===z.k?z:new Gn(G,z.x,z.y)}function E(z,G,Y){var Z=G[0]-Y[0]*z.k,B=G[1]-Y[1]*z.k;return Z===z.x&&B===z.y?z:new Gn(z.k,Z,B)}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 B=this,H=arguments,V=R(B,H).event(Z),$=t.apply(B,H),U=Y==null?T($):typeof Y=="function"?Y.apply(B,H):Y,W=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),K=B.__zoom,J=typeof G=="function"?G.apply(B,H):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 Gn(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 iC(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,B=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,i.apply(this,arguments)))),H=dn(z);if(Y.wheel)(Y.mouse[0][0]!==H[0]||Y.mouse[0][1]!==H[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=H)),clearTimeout(Y.wheel);else{if(Z.k===B)return;Y.mouse=[H,Z.invert(H)],Wl(this),Y.start()}mo(z),Y.wheel=setTimeout(V,x),Y.zoom("mouse",n(E(N(Z,B),Y.mouse[0],Y.mouse[1]),Y.extent,l));function V(){Y.wheel=null,Y.end()}}function I(z,...G){if(g||!e.apply(this,arguments))return;var Y=z.currentTarget,Z=R(this,G,!0).event(z),B=Vt(z.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",W,!0),H=dn(z,Y),V=z.clientX,$=z.clientY;fw(z.view),Bf(z),Z.mouse=[H,this.__zoom.invert(H)],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){B.on("mousemove.zoom mouseup.zoom",null),dw(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),B=Y.invert(Z),H=Y.k*(z.shiftKey?.5:2),V=n(E(N(Y,H),Z,B),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,B=R(this,G,z.changedTouches.length===Z).event(z),H,V,$,U;for(Bf(z),V=0;V<Z;++V)$=Y[V],U=dn($,this),U=[U,this.__zoom.invert(U),$.identifier],B.touch0?!B.touch1&&B.touch0[2]!==U[2]&&(B.touch1=U,B.taps=0):(B.touch0=U,H=!0,B.taps=1+!!m);m&&(m=clearTimeout(m)),H&&(B.taps<2&&(d=U[0],m=setTimeout(function(){m=null},v)),Wl(this),B.start())}}function D(z,...G){if(this.__zooming){var Y=R(this,G).event(z),Z=z.changedTouches,B=Z.length,H,V,$,U;for(mo(z),H=0;H<B;++H)V=Z[H],$=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=N(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 Q(z,...G){if(this.__zooming){var Y=R(this,G).event(z),Z=z.changedTouches,B=Z.length,H,V;for(Bf(z),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),H=0;H<B;++H)V=Z[H],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])<k)){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?(k=+z,S):k},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"],Iw={"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 Pw={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 Aw(e){return e===null?null:e?"valid":"invalid"}const Mw=e=>"id"in e&&"source"in e&&"target"in e,cC=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}=er(e),o=e.origin??t,a=n*o[0],l=i*o[1];return{x:e.position.x-a,y:e.position.y-l}},fC=(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 wu(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xu(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=wu(n,ru(o)),i=!0)}),i?xu(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)),k=(v??0)*(x??0),S=a&&w>0;(!h.internals.handleBounds||S||w>=k||h.dragging)&&f.push(h)}return f},dC=(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 hC(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 pC({nodes:e,width:t,height:n,panZoom:i,minZoom:o,maxZoom:a},l){if(e.size===0)return!0;const c=hC(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 Rw({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 mC({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=dC(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 Lw(e,t,n){const{width:i,height:o}=er(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]},wu=(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)}),gh=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),xu=({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)}},jw=(e,t)=>xu(wu(gh(e),gh(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),Dw=(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 gC(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 yC(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=gC(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=yC(e,v,x,m,t,n),k={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-k.left+k.right,y:x-k.top+k.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 er(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function $w(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 zw(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 vC(){let e,t;return{promise:new Promise((i,o)=>{e=i,t=o}),resolve:e,reject:t}}function wC(e){return{...Iw,...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}),Fw=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},xC=["INPUT","SELECT","TEXTAREA"];function Bw(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:xC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Vw=e=>"clientX"in e,mn=(e,t)=>{var a,l;const n=Vw(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 Ww({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 Uw({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]=Ww({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 Hw({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 bC({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 kC({sourceNode:e,targetNode:t,width:n,height:i,transform:o}){const a=wu(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,xu(a))>0}const SC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,EC=(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)),NC=(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||SC;let o;return Mw(e)?o={...e}:o={...e,id:i(e)},EC(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function qw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[o,a,l,c]=Hw({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,o,a,l,c]}const Oy={[ke.Left]:{x:-1,y:0},[ke.Right]:{x:1,y:0},[ke.Top]:{x:0,y:-1},[ke.Bottom]:{x:0,y:1}},_C=({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},Iy=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function CC({source:e,sourcePosition:t=ke.Bottom,target:n,targetPosition:i=ke.Top,center:o,offset:a,stepPosition:l}){const c=Oy[t],f=Oy[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=_C({source:h,sourcePosition:t,target:m}),g=d.x!==0?"x":"y",v=d[g];let x=[],w,k;const S={x:0,y:0},N={x:0,y:0},[,,E,T]=Hw({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,k=o.y??(h.y+m.y)/2):(w=o.x??(h.x+m.x)/2,k=o.y??h.y+(m.y-h.y)*l);const C=[{x:w,y:h.y},{x:w,y:m.y}],I=[{x:h.x,y:k},{x:m.x,y:k}];c[g]===v?x=g==="x"?C:I:x=g==="x"?I:C}else{const C=[{x:h.x,y:m.y}],I=[{x:m.x,y:h.y}];if(g==="x"?x=c.x===v?I:C:x=c.y===v?C:I,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:N[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:I)}const j={x:h.x+S.x,y:h.y+S.y},L={x:m.x+N.x,y:m.y+N.y},D=Math.max(Math.abs(j.x-x[0].x),Math.abs(L.x-x[0].x)),Q=Math.max(Math.abs(j.y-x[0].y),Math.abs(L.y-x[0].y));D>=Q?(w=(j.x+L.x)/2,k=x[0].y):(w=x[0].x,k=(j.y+L.y)/2)}const A={x:h.x+S.x,y:h.y+S.y},R={x:m.x+N.x,y:m.y+N.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,k,E,T]}function TC(e,t,n,i){const o=Math.min(Iy(e,t)/2,Iy(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 yh({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]=CC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:o},targetPosition:a,center:{x:c,y:f},offset:h,stepPosition:m});let k=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)k+=TC(d[S-1],d[S],d[S+1],l);return k+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[k,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??er(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 vh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function IC(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=vh(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 Yw=1e3,PC=10,Kh={nodeOrigin:[0,0],nodeExtent:Mo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},AC={...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 MC(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,er(o));o.internals.positionAbsolute=c}}function RC(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 wh(e,t,n,i={}){var m,d;const o=Gh(AC,i),a={i:0},l=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!Xh(o.zIndexMode)?Yw: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,k=ui(x,w,er(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:k,handleBounds:RC(g,v),z:Kw(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 LC(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}LC(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*PC),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const d=a&&!Xh(f)?Yw:0,{x:g,y:v,z:x}=jC(e,m,l,c,d,f),{positionAbsolute:w}=e.internals,k=g!==w.x||v!==w.y;(k||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:g,y:v}:w,z:x}})}function Kw(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return Xh(n)?i:i+(e.selected?t:0)}function jC(e,t,n,i,o,a){const{x:l,y:c}=t.internals.positionAbsolute,f=er(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=Lw(d,f,t));const g=Kw(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=jw(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=er(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)),k=Math.max(d.height,Math.round(c.height)),S=(w-d.width)*g[0],N=(k-d.height)*g[1];(v>0||x>0||S||N)&&(o.push({id:h,type:"position",position:{x:f.position.x-v+S,y:f.position.y-x+N}}),(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:k+(x?g[1]*x-N:0)}})}),o}function DC(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),k=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(k||!x.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),E=ci(x.extent)?x.extent:a;let{positionAbsolute:T}=x.internals;x.parentId&&x.extent==="parent"?T=Lw(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,N,d,x.id),target:Cy("target",v.nodeElement,N,d,x.id)}}};t.set(x.id,A),x.parentId&&Qh(A,t,n,{nodeOrigin:o,zIndexMode:l}),f=!0,k&&(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 $C({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 Gw(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 Xw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Xw(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 zC(e,t,n,i){const o=new Map;for(const[a,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!Xw(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 Vf({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 FC({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 BC({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 k({noDragClassName:N,handleSelector:E,domNode:T,isSelectable:A,nodeId:R,nodeClickDistance:M=0}){g=Vt(T);function C({x:D,y:Q}){const{nodeLookup:z,nodeExtent:G,snapGrid:Y,snapToGrid:Z,nodeOrigin:B,onNodeDrag:H,onSelectionDrag:V,onError:$,updateNodePositions:U}=t();a={x:D,y:Q};let W=!1;const K=c.size>1,J=K&&G?gh(Uo(c)):null,re=K&&Z?FC({dragItems:c,snapGrid:Y,x:D,y:Q}):null;for(const[oe,ee]of c){if(!z.has(oe))continue;let se={x:D-ee.distance.x,y:Q-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}=Rw({nodeId:oe,nextPosition:se,nodeLookup:z,nodeExtent:de||G,nodeOrigin:B,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||H||!R&&V))){const[oe,ee]=Vf({nodeId:R,dragItems:c,nodeLookup:z});i==null||i(w,c,oe,ee),H==null||H(w,oe,ee),R||V==null||V(w,ee)}}async function I(){if(!m)return;const{transform:D,panBy:Q,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 Q({x:Y,y:Z})&&C(a)),l=requestAnimationFrame(I)}function j(D){var K;const{nodeLookup:Q,multiSelectionActive:z,nodesDraggable:G,transform:Y,snapGrid:Z,snapToGrid:B,selectNodesOnDrag:H,onNodeDragStart:V,onSelectionDragStart:$,unselectNodesAndEdges:U}=t();d=!0,(!H||!A)&&!z&&R&&((K=Q.get(R))!=null&&K.selected||U()),A&&H&&R&&(e==null||e(R));const W=_o(D.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:B,containerBounds:m});if(a=W,c=zC(Q,G,W,R),c.size>0&&(n||V||!R&&$)){const[J,re]=Vf({nodeId:R,dragItems:c,nodeLookup:Q});n==null||n(D.sourceEvent,c,J,re),V==null||V(D.sourceEvent,J,re),R||$==null||$(D.sourceEvent,re)}}const L=hw().clickDistance(M).on("start",D=>{const{domNode:Q,nodeDragThreshold:z,transform:G,snapGrid:Y,snapToGrid:Z}=t();m=(Q==null?void 0:Q.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:Q,transform:z,snapGrid:G,snapToGrid:Y,nodeDragThreshold:Z,nodeLookup:B}=t(),H=_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&&!B.has(R))&&(v=!0),!v){if(!f&&Q&&d&&(f=!0,I()),!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!==H.xSnapped||a.y!==H.ySnapped)&&c&&d&&(h=mn(D.sourceEvent,m),C(H))}}).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:Q,updateNodePositions:z,onNodeDragStop:G,onSelectionDragStop:Y}=t();if(x&&(z(c,!1),x=!1),o||G||!R&&Y){const[Z,B]=Vf({nodeId:R,dragItems:c,nodeLookup:Q,dragging:!1});o==null||o(D.sourceEvent,c,Z,B),G==null||G(D.sourceEvent,Z,B),R||Y==null||Y(D.sourceEvent,B)}}}).filter(D=>{const Q=D.target;return!D.button&&(!N||!Ly(Q,`.${N}`,T))&&(!E||Ly(Q,E,T))});g.call(L)}function S(){g==null||g.on(".drag",null)}return{update:k,destroy:S}}function VC(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 WC=250;function UC(e,t,n,i){var c,f;let o=[],a=1/0;const l=VC(e,n,t+WC);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 Qw(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 Jw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function HC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Zw=()=>!0;function qC(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:k,isValidConnection:S=Zw,onReconnectEnd:N,updateConnection:E,getTransform:T,getFromHandle:A,autoPanSpeed:R,dragThreshold:M=1,handleDomNode:C}){const I=Fw(e.target);let j=0,L;const{x:D,y:Q}=mn(e),z=Jw(a,C),G=c==null?void 0:c.getBoundingClientRect();let Y=!1;if(!G||!z)return;const Z=Qw(o,z,i,f,t);if(!Z)return;let B=mn(e,G),H=!1,V=null,$=!1,U=null;function W(){if(!m||!G)return;const[xe,he]=Hh(B,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:B,toHandle:null,toPosition:Sy[K.position],toNode:null,pointer:B};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-Q;if(!(Nt*Nt+ht*ht>M*M))return;ee()}if(!A()||!K){de(xe);return}const he=T();B=mn(xe,G),L=UC(ys(B,he,!1,[1,1]),n,f,K),H||(W(),H=!0);const fe=ex(xe,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:i,fromType:l?"target":"source",isValidConnection:S,doc:I,lib:h,flowId:d,nodeLookup:f});U=fe.handleDomNode,V=fe.connection,$=HC(!!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):B,toHandle:fe.toHandle,toPosition:$&&fe.toHandle?fe.toHandle.position:Sy[K.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:B};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};k==null||k(xe,Se),a&&(N==null||N(xe,Se))}v(),cancelAnimationFrame(j),H=!1,$=!1,V=null,U=null,I.removeEventListener("mousemove",se),I.removeEventListener("mouseup",de),I.removeEventListener("touchmove",se),I.removeEventListener("touchend",de)}}I.addEventListener("mousemove",se),I.addEventListener("mouseup",de),I.addEventListener("touchmove",se),I.addEventListener("touchend",de)}function ex(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:o,fromType:a,doc:l,lib:c,flowId:f,isValidConnection:h=Zw,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),k=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,S={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const N=Jw(void 0,k),E=k.getAttribute("data-nodeid"),T=k.getAttribute("data-handleid"),A=k.classList.contains("connectable"),R=k.classList.contains("connectableend");if(!E||!N)return S;const M={source:d?E:i,sourceHandle:d?T:o,target:d?i:E,targetHandle:d?o:T};S.connection=M;const I=A&&R&&(n===as.Strict?d&&N==="source"||!d&&N==="target":E!==i||T!==o);S.isValid=I&&h(M),S.toHandle=Qw(E,N,T,m,n,!0)}return S}const xh={onPointerDown:qC,isValid:ex};function YC({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 k=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},I=[[0,0],[f,h]];t.setViewportConstrained({x:C.x,y:C.y,zoom:T[2]},I,c)},N=Tw().on("start",k).on("zoom",d?S:null).on("zoom.wheel",g?x:null);o.call(N,{})}function l(){o.on("zoom",null)}return{update:a,destroy:l,pointer:dn}}const bu=e=>({x:e.x,y:e.y,zoom:e.k}),Wf=({x:e,y:t,zoom:n})=>vu.translate(e,t).scale(n),Gi=(e,t)=>e.target.closest(`.${t}`),tx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),KC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Uf=(e,t=0,n=KC,i=()=>{})=>{const o=typeof t=="number"&&t>0;return o||i(),o?e.transition().duration(t).ease(n).on("end",i):e},nx=e=>{const t=e.ctrlKey&&jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function GC({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 k=dn(m),S=nx(m),N=d*Math.pow(2,S);i.scaleTo(n,N,k,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=bu(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 XC({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 QC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var a,l,c;if((a=i.sourceEvent)!=null&&a.internal)return;const o=bu(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 JC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:o}){return a=>{var l,c;e.usedRightMouseButton=!!(n&&tx(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,bu(a.transform)))}}function ZC({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&&tx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&a(l.sourceEvent),e.usedRightMouseButton=!1,i(!1),o)){const f=bu(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,f)},n?150:0)}}}function e2({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 k;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"&&((k=d.touches)==null?void 0:k.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 t2({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=Tw().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(d);N({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(nx);async function w(L,D){return g?new Promise(Q=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).transform(Uf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>Q(!0)),L)}):!1}function k({noWheelClassName:L,noPanClassName:D,onPaneContextMenu:Q,userSelectionActive:z,panOnScroll:G,panOnDrag:Y,panOnScrollMode:Z,panOnScrollSpeed:B,preventScrolling:H,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?GC({zoomPanValues:h,noWheelClassName:L,d3Selection:g,d3Zoom:d,panOnScrollMode:Z,panOnScrollSpeed:B,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}):XC({noWheelClassName:L,preventScrolling:H,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=QC({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:l});d.on("start",xe);const he=JC({zoomPanValues:h,panOnDrag:Y,onPaneContextMenu:!!Q,onPanZoom:a,onTransformChange:J});d.on("zoom",he);const fe=ZC({zoomPanValues:h,panOnDrag:Y,panOnScroll:G,onPaneContextMenu:Q,onPanZoomEnd:c,onDraggingChange:f});d.on("end",fe);const Se=e2({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 N(L,D,Q){const z=Wf(L),G=d==null?void 0:d.constrain()(z,D,Q);return G&&await w(G),G}async function E(L,D){const Q=Wf(L);return await w(Q,D),Q}function T(L){if(g){const D=Wf(L),Q=g.property("__zoom");(Q.k!==L.zoom||Q.x!==L.x||Q.y!==L.y)&&(d==null||d.transform(g,D,null,{sync:!0}))}}function A(){const L=g?Cw(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(Q=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).scaleTo(Uf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>Q(!0)),L)}):!1}async function M(L,D){return g?new Promise(Q=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?No:Fl).scaleBy(Uf(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>Q(!0)),L)}):!1}function C(L){d==null||d.scaleExtent(L)}function I(L){d==null||d.translateExtent(L)}function j(L){const D=!pn(L)||L<0?0:L;d==null||d.clickDistance(D)}return{update:k,destroy:S,setViewport:E,setViewportConstrained:N,getViewport:A,scaleTo:R,scaleBy:M,setScaleExtent:C,setTranslateExtent:I,syncViewport:T,setClickDistance:j}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function n2({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 kr(e,t){return Math.max(0,t-e)}function Sr(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 r2(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:k,minHeight:S,maxHeight:N}=i,{x:E,y:T,width:A,height:R,aspectRatio:M}=e;let C=Math.floor(m?v-e.pointerX:0),I=Math.floor(d?x-e.pointerY:0);const j=A+(f?-C:C),L=R+(h?-I:I),D=-a[0]*A,Q=-a[1]*R;let z=bl(j,w,k),G=bl(L,S,N);if(l){let B=0,H=0;f&&C<0?B=kr(E+C+D,l[0][0]):!f&&C>0&&(B=Sr(E+j+D,l[1][0])),h&&I<0?H=kr(T+I+Q,l[0][1]):!h&&I>0&&(H=Sr(T+L+Q,l[1][1])),z=Math.max(z,B),G=Math.max(G,H)}if(c){let B=0,H=0;f&&C>0?B=Sr(E+C,c[0][0]):!f&&C<0&&(B=kr(E+j,c[1][0])),h&&I>0?H=Sr(T+I,c[0][1]):!h&&I<0&&(H=kr(T+L,c[1][1])),z=Math.max(z,B),G=Math.max(G,H)}if(o){if(m){const B=bl(j/M,S,N)*M;if(z=Math.max(z,B),l){let H=0;!f&&!h||f&&!h&&g?H=Sr(T+Q+j/M,l[1][1])*M:H=kr(T+Q+(f?C:-C)/M,l[0][1])*M,z=Math.max(z,H)}if(c){let H=0;!f&&!h||f&&!h&&g?H=kr(T+j/M,c[1][1])*M:H=Sr(T+(f?C:-C)/M,c[0][1])*M,z=Math.max(z,H)}}if(d){const B=bl(L*M,w,k)/M;if(G=Math.max(G,B),l){let H=0;!f&&!h||h&&!f&&g?H=Sr(E+L*M+D,l[1][0])/M:H=kr(E+(h?I:-I)*M+D,l[0][0])/M,G=Math.max(G,H)}if(c){let H=0;!f&&!h||h&&!f&&g?H=kr(E+L*M,c[1][0])/M:H=Sr(E+(h?I:-I)*M,c[0][0])/M,G=Math.max(G,H)}}}I=I+(I<0?G:-G),C=C+(C<0?z:-z),o&&(g?j>L*M?I=(Dy(f,h)?-C:C)/M:C=(Dy(f,h)?-I:I)*M:m?(I=C/M,h=f):(C=I*M,f=h));const Y=f?E+C:E,Z=h?T+I:T;return{width:A+(f?-C:C),height:R+(h?-I:I),x:a[0]*C*(f?-1:1)+Y,y:a[1]*I*(h?-1:1)+Z}}const rx={width:0,height:0,x:0,y:0},i2={...rx,pointerX:0,pointerY:0,aspectRatio:1};function s2(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 o2({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:k}){let S={...rx},N={...i2};l={boundaries:m,resizeDirection:g,keepAspectRatio:d,controlDirection:jy(h)};let E,T=null,A=[],R,M,C,I=!1;const j=hw().on("start",L=>{const{nodeLookup:D,transform:Q,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:B,ySnapped:H}=_o(L.sourceEvent,{transform:Q,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},N={...S,pointerX:B,pointerY:H,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=s2($,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:Q,snapToGrid:z,nodeOrigin:G}=n(),Y=_o(L.sourceEvent,{transform:D,snapGrid:Q,snapToGrid:z,containerBounds:T}),Z=[];if(!E)return;const{x:B,y:H,width:V,height:$}=S,U={},W=E.origin??G,{width:K,height:J,x:re,y:oe}=r2(N,l.controlDirection,Y,l.boundaries,l.keepAspectRatio,W,M,C),ee=K!==V,se=J!==$,de=re!==B&&ee,xe=oe!==H&&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-B,Ae=oe-H;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,N.x=N.x-(U.x-Pe));const Ae=W[1]*(U.height??0);U.y&&U.y<Ae&&(S.y=Ae,N.y=N.y-(U.y-Ae))}const he=n2({width:S.width,prevWidth:V,height:S.height,prevHeight:$,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),fe={...S,direction:he};(k==null?void 0:k(L,fe))!==!1&&(I=!0,x==null||x(L,fe),i(U,Z))}).on("end",L=>{I&&(w==null||w(L,{...S}),o==null||o({...S}),I=!1)});a.call(j)}function f(){a.on(".drag",null)}return{update:c,destroy:f}}var Hf={exports:{}},qf={},Yf={exports:{}},Kf={};/**
|
|
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 a2(){if($y)return Kf;$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,k=x[1];return a(function(){w.value=v,w.getSnapshot=g,f(w)&&k({inst:w})},[d,v,g]),o(function(){return f(w)&&k({inst:w}),d(function(){f(w)&&k({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 Kf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Kf}var zy;function l2(){return zy||(zy=1,Yf.exports=a2()),Yf.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 u2(){if(Fy)return qf;Fy=1;var e=Fo(),t=l2();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 qf.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(!N){if(N=!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 N=!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 k=o(h,x[0],x[1]);return l(function(){w.hasValue=!0,w.value=k},[k]),f(k),k},qf}var By;function c2(){return By||(By=1,Hf.exports=u2()),Hf.exports}var f2=c2();const d2=hu(f2),h2={},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:()=>{(h2?"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},p2=e=>e?Vy(e):Vy,{useDebugValue:m2}=Rh,{useSyncExternalStoreWithSelector:g2}=d2,y2=e=>e;function ix(e,t=y2,n){const i=g2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return m2(i),i}const Wy=(e,t)=>{const n=p2(e),i=(o,a=t)=>ix(n,o,a);return Object.assign(i,n),i},v2=(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 sx=Jv();const ku=P.createContext(null),w2=ku.Provider,ox=gn.error001("react");function Me(e,t){const n=P.useContext(ku);if(n===null)throw new Error(ox);return ix(n,e,t)}function qe(){const e=P.useContext(ku);if(e===null)throw new Error(ox);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Uy={display:"none"},x2={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ax="react-flow__node-desc",lx="react-flow__edge-desc",b2="react-flow__aria-live",k2=e=>e.ariaLiveMessage,S2=e=>e.ariaLabelConfig;function E2({rfId:e}){const t=Me(k2);return _.jsx("div",{id:`${b2}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:x2,children:t})}function N2({rfId:e,disableKeyboardA11y:t}){const n=Me(S2);return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:`${ax}-${e}`,style:Uy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),_.jsx("div",{id:`${lx}-${e}`,style:Uy,children:n["edge.a11yDescription.default"]}),!t&&_.jsx(E2,{rfId:e})]})}const Su=P.forwardRef(({position:e="top-left",children:t,className:n,style:i,...o},a)=>{const l=`${e}`.split("-");return _.jsx("div",{className:rt(["react-flow__panel",n,...l]),style:i,ref:a,...o,children:t})});Su.displayName="Panel";function _2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_.jsx(Su,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const C2=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 T2(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(C2,T2);return P.useEffect(()=>{const o={nodes:n,edges:i};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[n,i,e]),null}const I2=e=>!!e.onSelectionChangeHandlers;function P2({onSelectionChange:e}){const t=Me(I2);return e||t?_.jsx(O2,{onSelectionChange:e}):null}const ux=[0,0],A2={x:0,y:0,zoom:1},M2=["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=[...M2,"rfId"],R2=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:ux,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function L2(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=Me(R2,He),h=qe();P.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=qy,c()}),[]);const m=P.useRef(qy);return P.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:wC(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 j2(e){var i;const[t,n]=P.useState(e==="system"?null:e);return P.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]=P.useState(!1),o=P.useRef(!1),a=P.useRef(new Set([])),[l,c]=P.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 P.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 k,S;if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!h)&&Bw(v))return!1;const w=Xy(v.code,c);if(a.current.add(v[w]),Gy(l,a.current,!1)){const N=((S=(k=v.composedPath)==null?void 0:k.call(v))==null?void 0:S[0])||v.target,E=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.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 D2=()=>{const e=qe();return P.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 cx(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)$2(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 $2(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 z2(e,t){return cx(e,t)}function F2(e,t){return cx(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 B2=Dw();function V2(e,t,n={}){return NC(e,t,{...n,onError:n.onError??B2})}const Zy=e=>cC(e),W2=e=>Mw(e);function fx(e){return P.forwardRef(e)}const U2=typeof window<"u"?P.useLayoutEffect:P.useEffect;function e0(e){const[t,n]=P.useState(BigInt(0)),[i]=P.useState(()=>H2(()=>n(o=>o+BigInt(1))));return U2(()=>{const o=i.get();o.length&&(e(o),i.reset())},[t]),i}function H2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const dx=P.createContext(null);function q2({children:e}){const t=qe(),n=P.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 k=Qy({items:w,lookup:g});for(const S of x.values())k=S(k);m&&h(w),k.length>0?d==null||d(k):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:N,setNodes:E}=t.getState();S&&E(N)})},[]),i=e0(n),o=P.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=P.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return _.jsx(dx.Provider,{value:l,children:e})}function Y2(){const e=P.useContext(dx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const K2=e=>!!e.panZoom;function Zh(){const e=D2(),t=qe(),n=Y2(),i=Me(K2),o=P.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,N;const{nodeLookup:g,nodeOrigin:v}=t.getState(),x=Zy(d)?d:g.get(d.id),w=x.parentId?zw(x.position,x.measured,x.parentId,g,v):x.position,k={...x,position:w,width:((S=x.measured)==null?void 0:S.width)??x.width,height:((N=x.measured)==null?void 0:N.height)??x.height};return us(k)},h=(d,g,v={replace:!1})=>{l(x=>x.map(w=>{if(w.id===d){const k=typeof g=="function"?g(w):g;return v.replace&&Zy(k)?k:{...w,...k}}return w}))},m=(d,g,v={replace:!1})=>{c(x=>x.map(w=>{if(w.id===d){const k=typeof g=="function"?g(w):g;return v.replace&&W2(k)?k:{...w,...k}}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,k]=v;return{nodes:d.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x,y:w,zoom:k}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:x,onNodesDelete:w,onEdgesDelete:k,triggerNodeChanges:S,triggerEdgeChanges:N,onDelete:E,onBeforeDelete:T}=t.getState(),{nodes:A,edges:R}=await mC({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:x,onBeforeDelete:T}),M=R.length>0,C=A.length>0;if(M){const I=R.map(Jy);k==null||k(R),N(I)}if(C){const I=A.map(Jy);w==null||w(A),S(I)}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),k=v!==void 0;return w?(v||t.getState().nodes).filter(S=>{const N=t.getState().nodeLookup.get(S.id);if(N&&!x&&(S.id===d.id||!N.internals.positionAbsolute))return!1;const E=us(k?S:N),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 k=Lo(w,g);return v&&k>0||k>=g.width*g.height||k>=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 fC(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??vC();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return P.useMemo(()=>({...o,...e,viewportInitialized:i}),[i])}const t0=e=>e.selected,G2=typeof window<"u"?window:void 0;function X2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qe(),{deleteElements:i}=Zh(),o=Do(e,{actInsideInputWithModifier:!1}),a=Do(t,{target:G2});P.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(t0),edges:l.filter(t0)}),n.setState({nodesSelectionActive:!1})}},[o]),P.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function Q2(e){const t=qe();P.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 Eu={position:"absolute",width:"100%",height:"100%",top:0,left:0},J2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Z2({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:k,onViewportChange:S,isControlledViewport:N,paneClickDistance:E,selectionOnDrag:T}){const A=qe(),R=P.useRef(null),{userSelectionActive:M,lib:C,connectionInProgress:I}=Me(J2,He),j=Do(g),L=P.useRef();Q2(R);const D=P.useCallback(Q=>{S==null||S({x:Q[0],y:Q[1],zoom:Q[2]}),N||A.setState({transform:Q})},[S,N]);return P.useEffect(()=>{if(R.current){L.current=t2({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:B,onMoveStart:H}=A.getState();H==null||H(Y,Z),B==null||B(Z)},onPanZoom:(Y,Z)=>{const{onViewportChange:B,onMove:H}=A.getState();H==null||H(Y,Z),B==null||B(Z)},onPanZoomEnd:(Y,Z)=>{const{onViewportChangeEnd:B,onMoveEnd:H}=A.getState();H==null||H(Y,Z),B==null||B(Z)}});const{x:Q,y:z,zoom:G}=L.current.getViewport();return A.setState({panZoom:L.current,transform:[Q,z,G],domNode:R.current.closest(".react-flow")}),()=>{var Y;(Y=L.current)==null||Y.destroy()}}},[]),P.useEffect(()=>{var Q;(Q=L.current)==null||Q.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:j,preventScrolling:v,noPanClassName:k,userSelectionActive:M,noWheelClassName:w,lib:C,onTransformChange:D,connectionInProgress:I,selectionOnDrag:T,paneClickDistance:E})},[e,t,n,i,o,a,l,c,j,v,k,M,w,C,D,I,T,E]),_.jsx("div",{className:"react-flow__renderer",ref:R,style:Eu,children:x})}const eT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function tT(){const{userSelectionActive:e,userSelectionRect:t}=Me(eT,He);return e&&t?_.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 Gf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function rT({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 k=P.useRef(0),S=qe(),{userSelectionActive:N,elementsSelectable:E,dragging:T,connectionInProgress:A,panBy:R,autoPanSpeed:M}=Me(nT,He),C=E&&(e||N),I=P.useRef(null),j=P.useRef(),L=P.useRef(new Set),D=P.useRef(new Set),Q=P.useRef(!1),z=P.useRef({x:0,y:0}),G=P.useRef(!1),Y=ee=>{if(Q.current||A){Q.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)},B=d?ee=>d(ee):void 0,H=ee=>{Q.current&&(ee.stopPropagation(),Q.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===I.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),Q.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(!Q.current||!de){k.current=requestAnimationFrame(U);return}const{x:xe,y:he}=z.current;$(xe,he),k.current=requestAnimationFrame(U)})}const W=()=>{cancelAnimationFrame(k.current),k.current=0,G.current=!1};P.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(!Q.current){const Pe=t?0:a;if(Math.hypot(he-Se.x,fe-Se.y)<=Pe)return;xe(),c==null||c(ee)}Q.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),!N&&ee.target===I.current&&S.getState().userSelectionRect&&(Y==null||Y(ee)),S.setState({userSelectionActive:!1,userSelectionRect:null}),Q.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 _.jsxs("div",{className:rt(["react-flow__pane",{draggable:oe,dragging:T,selection:e}]),onClick:C?void 0:Gf(Y,I),onContextMenu:Gf(Z,I),onWheel:Gf(B,I),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?H:void 0,onPointerLeave:x,ref:I,style:Eu,children:[w,_.jsx(tT,{})]})}function bh({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 hx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:o,isSelectable:a,nodeClickDistance:l}){const c=qe(),[f,h]=P.useState(!1),m=P.useRef();return P.useEffect(()=>{m.current=BC({getStoreItems:()=>c.getState(),onNodeMouseDown:d=>{bh({id:d,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),P.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 iT=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function px(){const e=qe();return P.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=iT(l),v=o?a[0]:5,x=o?a[1]:5,w=n.direction.x*v*n.factor,k=n.direction.y*x*n.factor;for(const[,S]of h){if(!g(S))continue;let N={x:S.internals.positionAbsolute.x+w,y:S.internals.positionAbsolute.y+k};o&&(N=Ho(N,a));const{position:E,positionAbsolute:T}=Rw({nodeId:S.id,nextPosition:N,nodeLookup:h,nodeExtent:i,nodeOrigin:m,onError:c});S.position=E,S.internals.positionAbsolute=T,d.set(S.id,S)}f(d)},[])}const ep=P.createContext(null),sT=ep.Provider;ep.Consumer;const mx=()=>P.useContext(ep),oT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),aT=(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 lT({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",k=qe(),S=mx(),{connectOnClick:N,noPanClassName:E,rfId:T}=Me(oT,He),{connectingFrom:A,connectingTo:R,clickConnecting:M,isPossibleEndHandle:C,connectionInProcess:I,clickConnectionInProcess:j,valid:L}=Me(aT(S,x,e),He);S||(Y=(G=k.getState()).onError)==null||Y.call(G,"010",gn.error010());const D=Z=>{const{defaultEdgeOptions:B,onConnect:H,hasDefaultEdges:V}=k.getState(),$={...B,...Z};if(V){const{edges:U,setEdges:W,onError:K}=k.getState();W(V2($,U,{onError:K}))}H==null||H($),c==null||c($)},Q=Z=>{if(!S)return;const B=Vw(Z.nativeEvent);if(o&&(B&&Z.button===0||!B)){const H=k.getState();xh.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:w,handleId:x,nodeId:S,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...V)=>{var $,U;return(U=($=k.getState()).onConnectEnd)==null?void 0:U.call($,...V)},updateConnection:H.updateConnection,onConnect:D,isValidConnection:n||((...V)=>{var $,U;return((U=($=k.getState()).isValidConnection)==null?void 0:U.call($,...V))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}B?m==null||m(Z):d==null||d(Z)},z=Z=>{const{onClickConnectStart:B,onClickConnectEnd:H,connectionClickStartHandle:V,connectionMode:$,isValidConnection:U,lib:W,rfId:K,nodeLookup:J,connection:re}=k.getState();if(!S||!V&&!o)return;if(!V){B==null||B(Z.nativeEvent,{nodeId:S,handleId:x,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:S,type:e,id:x}});return}const oe=Fw(Z.target),ee=n||U,{connection:se,isValid:de}=xh.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,H==null||H(Z,xe),k.setState({connectionClickStartHandle:null})};return _.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&&(!I||C)&&(I||j?a:o)}]),onMouseDown:Q,onTouchStart:Q,onClick:N?z:void 0,ref:v,...g,children:f})}const Ir=P.memo(fx(lT));function uT({data:e,isConnectable:t,sourcePosition:n=ke.Bottom}){return _.jsxs(_.Fragment,{children:[e==null?void 0:e.label,_.jsx(Ir,{type:"source",position:n,isConnectable:t})]})}function cT({data:e,isConnectable:t,targetPosition:n=ke.Top,sourcePosition:i=ke.Bottom}){return _.jsxs(_.Fragment,{children:[_.jsx(Ir,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_.jsx(Ir,{type:"source",position:i,isConnectable:t})]})}function fT(){return null}function dT({data:e,isConnectable:t,targetPosition:n=ke.Top}){return _.jsxs(_.Fragment,{children:[_.jsx(Ir,{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:uT,default:cT,output:dT,group:fT};function hT(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 pT=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 mT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=qe(),{width:o,height:a,transformString:l,userSelectionActive:c}=Me(pT,He),f=px(),h=P.useRef(null);P.useEffect(()=>{var v;n||(v=h.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&o!==null&&a!==null;if(hx({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 _.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:_.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,gT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gx({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:k,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:T,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:M,panOnDrag:C,autoPanOnSelection:I,defaultViewport:j,translateExtent:L,minZoom:D,maxZoom:Q,preventScrolling:z,onSelectionContextMenu:G,noWheelClassName:Y,noPanClassName:Z,disableKeyboardA11y:B,onViewportChange:H,isControlledViewport:V}){const{nodesSelectionActive:$,userSelectionActive:U}=Me(gT,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 X2({deleteKeyCode:f,multiSelectionKeyCode:x}),_.jsx(Z2,{onPaneContextMenu:a,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:M,panOnDrag:!W&&J,defaultViewport:j,translateExtent:L,minZoom:D,maxZoom:Q,zoomActivationKeyCode:k,preventScrolling:z,noWheelClassName:Y,noPanClassName:Z,onViewportChange:H,isControlledViewport:V,paneClickDistance:c,selectionOnDrag:oe,children:_.jsxs(rT,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:J,autoPanOnSelection:I,isSelecting:!!ee,selectionMode:d,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:oe,children:[e,$&&_.jsx(mT,{onSelectionContextMenu:G,noPanClassName:Z,disableKeyboardA11y:B})]})})}gx.displayName="FlowRenderer";const yT=P.memo(gx),vT=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 wT(e){return Me(P.useCallback(vT(e),[e]),He)}const xT=e=>e.updateNodeInternals;function bT(){const e=Me(xT),[t]=P.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 P.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function kT({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const o=qe(),a=P.useRef(null),l=P.useRef(null),c=P.useRef(e.sourcePosition),f=P.useRef(e.targetPosition),h=P.useRef(t),m=n&&!!e.internals.handleBounds;return P.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]),P.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),P.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 ST({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:k,nodeClickDistance:S,onError:N}){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=(k==null?void 0:k[R])||n0[R];M===void 0&&(N==null||N("003",gn.error003(R)),R="default",M=(k==null?void 0:k.default)||n0.default);const C=!!(E.draggable||c&&typeof E.draggable>"u"),I=!!(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(),Q=$w(E),z=kT({node:E,nodeType:R,hasDimensions:Q,resizeObserver:d}),G=hx({nodeRef:z,disabled:E.hidden||!C,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:S}),Y=px();if(E.hidden)return null;const Z=er(E),B=hT(E),H=I||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();I&&(!se||!C||de>0)&&bh({id:e,store:D,nodeRef:z}),t&&t(ee,{...T.userNode})},re=ee=>{if(!(Bw(ee.nativeEvent)||x)){if(Ow.includes(ee.key)&&I){const se=ee.key==="Escape";bh({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 _.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${R}`,{[v]:C},E.className,{selected:E.selected,selectable:I,parent:A,draggable:C,dragging:G}]),ref:z,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:Q?"visible":"hidden",...E.style,...B},"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:`${ax}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:_.jsx(sT,{value:e,children:_.jsx(M,{id:e,data:E.data,type:R,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:E.selected??!1,selectable:I,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 ET=P.memo(ST);const NT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function yx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:o,onError:a}=Me(NT,He),l=wT(e.onlyRenderVisibleElements),c=bT();return _.jsx("div",{className:"react-flow__nodes",style:Eu,children:l.map(f=>_.jsx(ET,{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))})}yx.displayName="NodeRenderer";const _T=P.memo(yx);function CT(e){return Me(P.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&&kC({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(o.id)}return i},[e]),He)}const TT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return _.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 _.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},i0={[nu.Arrow]:TT,[nu.ArrowClosed]:OT};function IT(e){const t=qe();return P.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 PT=({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=IT(t);return f?_.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:_.jsx(f,{color:n,strokeWidth:l})}):null},vx=({defaultColor:e,rfId:t})=>{const n=Me(a=>a.edges),i=Me(a=>a.defaultEdgeOptions),o=P.useMemo(()=>IC(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?_.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:_.jsx("defs",{children:o.map(a=>_.jsx(PT,{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};vx.displayName="MarkerDefinitions";var AT=P.memo(vx);function wx({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]=P.useState({x:1,y:0,width:0,height:0}),v=rt(["react-flow__edge-textwrapper",h]),x=P.useRef(null);return P.useEffect(()=>{if(x.current){const w=x.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?_.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...m,children:[o&&_.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}),_.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:i,children:n}),f]}):null}wx.displayName="EdgeText";const MT=P.memo(wx);function Nu({path:e,labelX:t,labelY:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:h=20,...m}){return _.jsxs(_.Fragment,{children:[_.jsx("path",{...m,d:e,fill:"none",className:rt(["react-flow__edge-path",m.className])}),h?_.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?_.jsx(MT,{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 xx({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]=Ww({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 bx(e){return P.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:k,interactionWidth:S})=>{const[N,E,T]=xx({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c}),A=e.isInternal?void 0:t;return _.jsx(Nu,{id:A,path:N,labelX:E,labelY:T,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:k,interactionWidth:S})})}const RT=bx({isInternal:!1}),kx=bx({isInternal:!0});RT.displayName="SimpleBezierEdge";kx.displayName="SimpleBezierEdgeInternal";function Sx(e){return P.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:k,pathOptions:S,interactionWidth:N})=>{const[E,T,A]=yh({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 _.jsx(Nu,{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:k,interactionWidth:N})})}const Ex=Sx({isInternal:!1}),Nx=Sx({isInternal:!0});Ex.displayName="SmoothStepEdge";Nx.displayName="SmoothStepEdgeInternal";function _x(e){return P.memo(({id:t,...n})=>{var o;const i=e.isInternal?void 0:t;return _.jsx(Ex,{...n,id:i,pathOptions:P.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const LT=_x({isInternal:!1}),Cx=_x({isInternal:!0});LT.displayName="StepEdge";Cx.displayName="StepEdgeInternal";function Tx(e){return P.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[k,S,N]=qw({sourceX:n,sourceY:i,targetX:o,targetY:a}),E=e.isInternal?void 0:t;return _.jsx(Nu,{id:E,path:k,labelX:S,labelY:N,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:x,interactionWidth:w})})}const jT=Tx({isInternal:!1}),Ox=Tx({isInternal:!0});jT.displayName="StraightEdge";Ox.displayName="StraightEdgeInternal";function Ix(e){return P.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:k,pathOptions:S,interactionWidth:N})=>{const[E,T,A]=Uw({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 _.jsx(Nu,{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:k,interactionWidth:N})})}const DT=Ix({isInternal:!1}),Px=Ix({isInternal:!0});DT.displayName="BezierEdge";Px.displayName="BezierEdgeInternal";const o0={default:Px,straight:Ox,step:Cx,smoothstep:Nx,simplebezier:kx},a0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$T=(e,t,n)=>n===ke.Left?e-t:n===ke.Right?e+t:e,zT=(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 _.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:l,className:rt([l0,`${l0}-${c}`]),cx:$T(t,i,e),cy:zT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function FT({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:I,lib:j,onConnectStart:L,cancelConnection:D,nodeLookup:Q,rfId:z,panBy:G,updateConnection:Y}=x.getState(),Z=A.type==="target",B=($,U)=>{g(!1),d==null||d($,n,A.type,U)},H=$=>h==null?void 0:h(n,$),V=($,U)=>{g(!0),m==null||m(T,n,A.type),L==null||L($,U)};xh.onPointerDown(T.nativeEvent,{autoPanOnConnect:R,connectionMode:C,connectionRadius:I,domNode:M,handleId:A.id,nodeId:A.nodeId,nodeLookup:Q,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:H,onConnectStart:V,onConnectEnd:(...$)=>{var U,W;return(W=(U=x.getState()).onConnectEnd)==null?void 0:W.call(U,...$)},onReconnectEnd:B,updateConnection:Y,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},k=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"}),N=()=>v(!0),E=()=>v(!1);return _.jsxs(_.Fragment,{children:[(e===!0||e==="source")&&_.jsx(u0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:k,onMouseEnter:N,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&_.jsx(u0,{position:f,centerX:a,centerY:l,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:E,type:"target"})]})}function BT({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:k,onError:S,disableKeyboardA11y:N}){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"),I=!!(E.selectable||i&&typeof E.selectable>"u"),j=P.useRef(null),[L,D]=P.useState(!1),[Q,z]=P.useState(!1),G=qe(),{zIndex:Y,sourceX:Z,sourceY:B,targetX:H,targetY:V,sourcePosition:$,targetPosition:U}=Me(P.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:bC({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=P.useMemo(()=>E.markerStart?`url('#${vh(E.markerStart,x)}')`:void 0,[E.markerStart,x]),K=P.useMemo(()=>E.markerEnd?`url('#${vh(E.markerEnd,x)}')`:void 0,[E.markerEnd,x]);if(E.hidden||Z===null||B===null||H===null||V===null)return null;const J=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:Se,multiSelectionActive:Pe}=G.getState();I&&(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(!N&&Ow.includes(he.key)&&I){const{unselectNodesAndEdges:Se,addSelectedEdges:Pe}=G.getState();he.key==="Escape"?((fe=j.current)==null||fe.blur(),Se({edges:[E]})):Pe([e])}};return _.jsx("svg",{style:{zIndex:Y},children:_.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${A}`,E.className,k,{selected:E.selected,animated:E.animated,inactive:!I&&!o,updating:L,selectable:I}]),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?`${lx}-${x}`:void 0,ref:j,...E.domAttributes,children:[!Q&&_.jsx(R,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:I,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:Z,sourceY:B,targetX:H,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&&_.jsx(FT,{edge:E,isReconnectable:C,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:Z,sourceY:B,targetX:H,targetY:V,sourcePosition:$,targetPosition:U,setUpdateHover:D,setReconnecting:z})]})})}var VT=P.memo(BT);const WT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ax({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:k,edgesReconnectable:S,elementsSelectable:N,onError:E}=Me(WT,He),T=CT(t);return _.jsxs("div",{className:"react-flow__edges",children:[_.jsx(AT,{defaultColor:e,rfId:n}),T.map(A=>_.jsx(VT,{id:A,edgesFocusable:k,edgesReconnectable:S,elementsSelectable:N,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))]})}Ax.displayName="EdgeRenderer";const UT=P.memo(Ax),HT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function qT({children:e}){const t=Me(HT);return _.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function YT(e){const t=Zh(),n=P.useRef(!1);P.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const KT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function GT(e){const t=Me(KT),n=qe();return P.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function XT(e){return e.connection.inProgress?{...e.connection,to:ys(e.connection.to,e.transform)}:{...e.connection}}function QT(e){return XT}function JT(e){const t=QT();return Me(t,He)}const ZT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function eO({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:o,width:a,height:l,isValid:c,inProgress:f}=Me(ZT,He);return!(a&&o&&f)?null:_.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:_.jsx("g",{className:rt(["react-flow__connection",Aw(c)]),children:_.jsx(Mx,{style:t,type:n,CustomComponent:i,isValid:c})})})}const Mx=({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}=JT();if(!o)return;if(n)return _.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:Aw(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]=Uw(w);break;case Tr.SimpleBezier:[x]=xx(w);break;case Tr.Step:[x]=yh({...w,borderRadius:0});break;case Tr.SmoothStep:[x]=yh(w);break;default:[x]=qw(w)}return _.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Mx.displayName="ConnectionLine";const tO={};function c0(e=tO){P.useRef(e),qe(),P.useEffect(()=>{},[e])}function nO(){qe(),P.useRef(!1),P.useEffect(()=>{},[])}function Rx({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:k,connectionLineContainerStyle:S,selectionKeyCode:N,selectionOnDrag:E,selectionMode:T,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:M,deleteKeyCode:C,onlyRenderVisibleElements:I,elementsSelectable:j,defaultViewport:L,translateExtent:D,minZoom:Q,maxZoom:z,preventScrolling:G,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:B,panOnScroll:H,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),nO(),YT(n),GT(Lt),_.jsx(yT,{onPaneClick:J,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:se,paneClickDistance:xe,deleteKeyCode:C,selectionKeyCode:N,selectionOnDrag:E,selectionMode:T,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:M,elementsSelectable:j,zoomOnScroll:Z,zoomOnPinch:B,zoomOnDoubleClick:U,panOnScroll:H,panOnScrollSpeed:V,panOnScrollMode:$,panOnDrag:W,autoPanOnSelection:K,defaultViewport:L,translateExtent:D,minZoom:Q,maxZoom:z,onSelectionContextMenu:d,preventScrolling:G,noDragClassName:pt,noWheelClassName:jn,noPanClassName:bn,disableKeyboardA11y:kn,onViewportChange:qt,isControlledViewport:!!Lt,children:_.jsxs(qT,{children:[_.jsx(UT,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,onlyRenderVisibleElements:I,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:bn,disableKeyboardA11y:kn,rfId:Ht}),_.jsx(eO,{style:w,type:x,component:k,containerStyle:S}),_.jsx("div",{className:"react-flow__edgelabel-renderer"}),_.jsx(_T,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:I,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht}),_.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rx.displayName="GraphView";const rO=P.memo(Rx),iO=Dw(),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,k=new Map,S=i??t??[],N=n??e??[],E=m??[0,0],T=d??Mo;Gw(w,k,S);const{nodesInitialized:A}=wh(N,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:I,zoom:j}=qh(M,o,a,f,h,(c==null?void 0:c.padding)??.1);R=[C,I,j]}return{rfId:"1",width:o??0,height:a??0,transform:R,nodes:N,nodesInitialized:A,nodeLookup:v,parentLookup:x,edges:S,edgeLookup:k,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:{...Pw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:iO,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Iw,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},sO=({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})=>v2((v,x)=>{async function w(){const{nodeLookup:k,panZoom:S,fitViewOptions:N,fitViewResolver:E,width:T,height:A,minZoom:R,maxZoom:M}=x();S&&(await pC({nodes:k,width:T,height:A,panZoom:S,minZoom:R,maxZoom:M},N),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:k=>{const{nodeLookup:S,parentLookup:N,nodeOrigin:E,elevateNodesOnSelect:T,fitViewQueued:A,zIndexMode:R,nodesSelectionActive:M}=x(),{nodesInitialized:C,hasSelectedNodes:I}=wh(k,S,N,{nodeOrigin:E,nodeExtent:d,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:R}),j=M&&I;A&&C?(w(),v({nodes:k,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):v({nodes:k,nodesInitialized:C,nodesSelectionActive:j})},setEdges:k=>{const{connectionLookup:S,edgeLookup:N}=x();Gw(S,N,k),v({edges:k})},setDefaultNodesAndEdges:(k,S)=>{if(k){const{setNodes:N}=x();N(k),v({hasDefaultNodes:!0})}if(S){const{setEdges:N}=x();N(S),v({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:S,nodeLookup:N,parentLookup:E,domNode:T,nodeOrigin:A,nodeExtent:R,debug:M,fitViewQueued:C,zIndexMode:I}=x(),{changes:j,updatedInternals:L}=DC(k,N,E,T,A,R,I);L&&(MC(N,E,{nodeOrigin:A,nodeExtent:R,zIndexMode:I}),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:(k,S=!1)=>{const N=[];let E=[];const{nodeLookup:T,triggerNodeChanges:A,connection:R,updateConnection:M,onNodesChangeMiddlewareMap:C}=x();for(const[I,j]of k){const L=T.get(I),D=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(j!=null&&j.position)),Q={id:I,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&&N.push({id:I,parentId:L.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),E.push(Q)}if(N.length>0){const{parentLookup:I,nodeOrigin:j}=x(),L=Jh(N,T,I,j);E.push(...L)}for(const I of C.values())E=I(E);A(E)},triggerNodeChanges:k=>{const{onNodesChange:S,setNodes:N,nodes:E,hasDefaultNodes:T,debug:A}=x();if(k!=null&&k.length){if(T){const R=z2(k,E);N(R)}A&&console.log("React Flow: trigger node changes",k),S==null||S(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:S,setEdges:N,edges:E,hasDefaultEdges:T,debug:A}=x();if(k!=null&&k.length){if(T){const R=F2(k,E);N(R)}A&&console.log("React Flow: trigger edge changes",k),S==null||S(k)}},addSelectedNodes:k=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(S){const R=k.map(M=>ei(M,!0));T(R);return}T(Xi(E,new Set([...k]),!0)),A(Xi(N))},addSelectedEdges:k=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(S){const R=k.map(M=>ei(M,!0));A(R);return}A(Xi(N,new Set([...k]))),T(Xi(E,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:S}={})=>{const{edges:N,nodes:E,nodeLookup:T,triggerNodeChanges:A,triggerEdgeChanges:R}=x(),M=k||E,C=S||N,I=[];for(const L of M){if(!L.selected)continue;const D=T.get(L.id);D&&(D.selected=!1),I.push(ei(L.id,!1))}const j=[];for(const L of C)L.selected&&j.push(ei(L.id,!1));A(I),R(j)},setMinZoom:k=>{const{panZoom:S,maxZoom:N}=x();S==null||S.setScaleExtent([k,N]),v({minZoom:k})},setMaxZoom:k=>{const{panZoom:S,minZoom:N}=x();S==null||S.setScaleExtent([N,k]),v({maxZoom:k})},setTranslateExtent:k=>{var S;(S=x().panZoom)==null||S.setTranslateExtent(k),v({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:S,triggerNodeChanges:N,triggerEdgeChanges:E,elementsSelectable:T}=x();if(!T)return;const A=S.reduce((M,C)=>C.selected?[...M,ei(C.id,!1)]:M,[]),R=k.reduce((M,C)=>C.selected?[...M,ei(C.id,!1)]:M,[]);N(A),E(R)},setNodeExtent:k=>{const{nodes:S,nodeLookup:N,parentLookup:E,nodeOrigin:T,elevateNodesOnSelect:A,nodeExtent:R,zIndexMode:M}=x();k[0][0]===R[0][0]&&k[0][1]===R[0][1]&&k[1][0]===R[1][0]&&k[1][1]===R[1][1]||(wh(S,N,E,{nodeOrigin:T,nodeExtent:k,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:M}),v({nodeExtent:k}))},panBy:k=>{const{transform:S,width:N,height:E,panZoom:T,translateExtent:A}=x();return $C({delta:k,panZoom:T,transform:S,translateExtent:A,width:N,height:E})},setCenter:async(k,S,N)=>{const{width:E,height:T,maxZoom:A,panZoom:R}=x();if(!R)return!1;const M=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:A;return await R.setViewport({x:E/2-k*M,y:T/2-S*M,zoom:M},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),!0},cancelConnection:()=>{v({connection:{...Pw}})},updateConnection:k=>{v({connection:k})},reset:()=>v({...f0()})}},Object.is);function Lx({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]=P.useState(()=>sO({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 _.jsx(w2,{value:x,children:_.jsx(q2,{children:v})})}function oO({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 P.useContext(ku)?_.jsx(_.Fragment,{children:e}):_.jsx(Lx,{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 aO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function lO({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:k,onClickConnectEnd:S,onNodeMouseEnter:N,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:R,onNodeDragStart:M,onNodeDrag:C,onNodeDragStop:I,onNodesDelete:j,onEdgesDelete:L,onDelete:D,onSelectionChange:Q,onSelectionDragStart:z,onSelectionDrag:G,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:H,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=ux,edgesFocusable:jn,edgesReconnectable:bn,elementsSelectable:kn=!0,defaultViewport:_t=A2,minZoom:Ht=.5,maxZoom:Lt=2,translateExtent:qt=Mo,preventScrolling:Xo=!0,nodeExtent:Dn,defaultMarkerColor:Rr="#b1b1b7",zoomOnScroll:Fu=!0,zoomOnPinch:Qo=!0,panOnScroll:Jo=!1,panOnScrollSpeed:Bu=.5,panOnScrollMode:Ss=oi.Free,zoomOnDoubleClick:Es=!0,panOnDrag:Ns=!0,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta=1,nodeClickDistance:na=0,children:ra,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Os,onEdgeDoubleClick:jr,onEdgeMouseEnter:Vu,onEdgeMouseMove:Dr,onEdgeMouseLeave:pi,reconnectRadius:mi=10,onNodesChange:Is,onEdgesChange:Wu,noDragClassName:Uu="nodrag",noWheelClassName:Hu="nowheel",noPanClassName:Sn="nopan",fitView:Ps,fitViewOptions:As,connectOnClick:qu,attributionPosition:sa,proOptions:oa,defaultEdgeOptions:aa,elevateNodesOnSelect:la=!0,elevateEdgesOnSelect:Yu=!1,disableKeyboardA11y:ua=!1,autoPanOnConnect:Ye,autoPanOnNodeDrag:Ku,autoPanOnSelection:Ms=!0,autoPanSpeed:ca,connectionRadius:gi,isValidConnection:Gu,onError:fa,style:yi,id:jt,nodeDragThreshold:Xu,connectionDragThreshold:Dt,viewport:Qu,onViewportChange:Ju,width:Zu,height:vi,colorMode:wi="light",debug:$r,onScroll:$n,ariaLabelConfig:ec,zIndexMode:da="basic",...Rs},ha){const zr=jt||"1",Fr=j2(wi),tc=P.useCallback(xi=>{xi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$n==null||$n(xi)},[$n]);return _.jsx("div",{"data-testid":"rf__wrapper",...Rs,onScroll:tc,style:{...yi,...aO},ref:ha,className:rt(["react-flow",o,Fr]),id:jt,role:"application",children:_.jsxs(oO,{nodes:e,edges:t,width:Zu,height:vi,fitView:Ps,fitViewOptions:As,minZoom:Ht,maxZoom:Lt,nodeOrigin:pt,nodeExtent:Dn,zIndexMode:da,children:[_.jsx(L2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:x,onConnectEnd:w,onClickConnectStart:k,onClickConnectEnd:S,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,edgesFocusable:jn,edgesReconnectable:bn,elementsSelectable:kn,elevateNodesOnSelect:la,elevateEdgesOnSelect:Yu,minZoom:Ht,maxZoom:Lt,nodeExtent:Dn,onNodesChange:Is,onEdgesChange:Wu,snapToGrid:fe,snapGrid:Se,connectionMode:$,translateExtent:qt,connectOnClick:qu,defaultEdgeOptions:aa,fitView:Ps,fitViewOptions:As,onNodesDelete:j,onEdgesDelete:L,onDelete:D,onNodeDragStart:M,onNodeDrag:C,onNodeDragStop:I,onSelectionDrag:G,onSelectionDragStart:z,onSelectionDragStop:Y,onMove:m,onMoveStart:d,onMoveEnd:g,noPanClassName:Sn,nodeOrigin:pt,rfId:zr,autoPanOnConnect:Ye,autoPanOnNodeDrag:Ku,autoPanSpeed:ca,onError:fa,connectionRadius:gi,isValidConnection:Gu,selectNodesOnDrag:Ae,nodeDragThreshold:Xu,connectionDragThreshold:Dt,onBeforeDelete:V,debug:$r,ariaLabelConfig:ec,zIndexMode:da}),_.jsx(rO,{onInit:h,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,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:Fu,zoomOnPinch:Qo,zoomOnDoubleClick:Es,panOnScroll:Jo,panOnScrollSpeed:Bu,panOnScrollMode:Ss,panOnDrag:Ns,autoPanOnSelection:Ms,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta,nodeClickDistance:na,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:H,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Os,onEdgeDoubleClick:jr,onEdgeMouseEnter:Vu,onEdgeMouseMove:Dr,onEdgeMouseLeave:pi,reconnectRadius:mi,defaultMarkerColor:Rr,noDragClassName:Uu,noWheelClassName:Hu,noPanClassName:Sn,rfId:zr,disableKeyboardA11y:ua,nodeExtent:Dn,viewport:Qu,onViewportChange:Ju}),_.jsx(P2,{onSelectionChange:Q}),ra,_.jsx(_2,{proOptions:oa,position:sa}),_.jsx(N2,{rfId:zr,disableKeyboardA11y:ua})]})})}var uO=fx(lO);function cO({dimensions:e,lineWidth:t,variant:n,className:i}){return _.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 fO({radius:e,className:t}){return _.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",t])})}var Qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qn||(Qn={}));const dO={[Qn.Dots]:1,[Qn.Lines]:1,[Qn.Cross]:6},hO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jx({id:e,variant:t=Qn.Dots,gap:n=20,size:i,lineWidth:o=1,offset:a=0,color:l,bgColor:c,style:f,className:h,patternClassName:m}){const d=P.useRef(null),{transform:g,patternId:v}=Me(hO,He),x=i||dO[t],w=t===Qn.Dots,k=t===Qn.Cross,S=Array.isArray(n)?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=k?[E,E]:N,R=[T[0]*g[2]||1+A[0]/2,T[1]*g[2]||1+A[1]/2],M=`${v}${e||""}`;return _.jsxs("svg",{className:rt(["react-flow__background",h]),style:{...f,...Eu,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:d,"data-testid":"rf__background",children:[_.jsx("pattern",{id:M,x:g[0]%N[0],y:g[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:w?_.jsx(fO,{radius:E/2,className:m}):_.jsx(cO,{dimensions:A,lineWidth:o,variant:t,className:m})}),_.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}jx.displayName="Background";const pO=P.memo(jx);function mO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function gO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_.jsx("path",{d:"M0 0h32v4.2H0z"})})}function yO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_.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 vO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.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 wO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.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 _.jsx("button",{type:"button",className:rt(["react-flow__controls-button",t]),...n,children:e})}const xO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dx({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:k,maxZoomReached:S,ariaLabelConfig:N}=Me(xO,He),{zoomIn:E,zoomOut:T,fitView:A}=Zh(),R=()=>{E(),a==null||a()},M=()=>{T(),l==null||l()},C=()=>{A(o),c==null||c()},I=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},j=g==="horizontal"?"horizontal":"vertical";return _.jsxs(Su,{className:rt(["react-flow__controls",j,h]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&_.jsxs(_.Fragment,{children:[_.jsx(Sl,{onClick:R,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:S,children:_.jsx(mO,{})}),_.jsx(Sl,{onClick:M,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:k,children:_.jsx(gO,{})})]}),n&&_.jsx(Sl,{className:"react-flow__controls-fitview",onClick:C,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:_.jsx(yO,{})}),i&&_.jsx(Sl,{className:"react-flow__controls-interactive",onClick:I,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:w?_.jsx(wO,{}):_.jsx(vO,{})}),m]})}Dx.displayName="Controls";const bO=P.memo(Dx);function kO({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||{},k=l||x||w;return _.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:k,stroke:c,strokeWidth:f},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const SO=P.memo(kO),EO=e=>e.nodes.map(t=>t.id),Xf=e=>e instanceof Function?e:()=>e;function NO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:a=SO,onClick:l}){const c=Me(EO,He),f=Xf(t),h=Xf(e),m=Xf(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return _.jsx(_.Fragment,{children:c.map(g=>_.jsx(CO,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:o,NodeComponent:a,onClick:l,shapeRendering:d},g))})}function _O({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 k=w.internals.userNode,{x:S,y:N}=w.internals.positionAbsolute,{width:E,height:T}=er(k);return{node:k,x:S,y:N,width:E,height:T}},He);return!h||h.hidden||!$w(h)?null:_.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 CO=P.memo(_O);var TO=P.memo(NO);const OO=200,IO=150,PO=e=>!e.hidden,AO=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?jw(Uo(e.nodeLookup,{filter:PO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},MO="react-flow__minimap-desc";function $x({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:k=!1,ariaLabel:S,inversePan:N,zoomStep:E=1,offsetScale:T=5}){const A=qe(),R=P.useRef(null),{boundingRect:M,viewBB:C,rfId:I,panZoom:j,translateExtent:L,flowWidth:D,flowHeight:Q,ariaLabelConfig:z}=Me(AO,He),G=(e==null?void 0:e.width)??OO,Y=(e==null?void 0:e.height)??IO,Z=M.width/G,B=M.height/Y,H=Math.max(Z,B),V=H*G,$=H*Y,U=T*H,W=M.x-(V-M.width)/2-U,K=M.y-($-M.height)/2-U,J=V+U*2,re=$+U*2,oe=`${MO}-${I}`,ee=P.useRef(0),se=P.useRef();ee.current=H,P.useEffect(()=>{if(R.current&&j)return se.current=YC({domNode:R.current,panZoom:j,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=se.current)==null||fe.destroy()}},[j]),P.useEffect(()=>{var fe;(fe=se.current)==null||fe.update({translateExtent:L,width:D,height:Q,inversePan:N,pannable:w,zoomStep:E,zoomable:k})},[w,k,N,E,L,D,Q]);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?P.useCallback((fe,Se)=>{const Pe=A.getState().nodeLookup.get(Se).internals.userNode;x(fe,Pe)},[]):void 0,he=S??z["minimap.ariaLabel"];return _.jsx(Su,{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*H: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:_.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&&_.jsx("title",{id:oe,children:he}),_.jsx(TO,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),_.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"})]})})}$x.displayName="MiniMap";P.memo($x);const RO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,LO={[fs.Line]:"right",[fs.Handle]:"bottom-right"};function jO({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:k,onResizeEnd:S}){const N=mx(),E=typeof e=="string"?e:N,T=qe(),A=P.useRef(null),R=n===fs.Handle,M=Me(P.useCallback(RO(R&&v),[R,v]),He),C=P.useRef(null),I=t??LO[n];P.useEffect(()=>{if(!(!A.current||!E))return C.current||(C.current=o2({domNode:A.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:L,transform:D,snapGrid:Q,snapToGrid:z,nodeOrigin:G,domNode:Y}=T.getState();return{nodeLookup:L,transform:D,snapGrid:Q,snapToGrid:z,nodeOrigin:G,paneDomNode:Y}},onChange:(L,D)=>{const{triggerNodeChanges:Q,nodeLookup:z,parentLookup:G,nodeOrigin:Y}=T.getState(),Z=[],B={x:L.x,y:L.y},H=z.get(E);if(H&&H.expandParent&&H.parentId){const V=H.origin??Y,$=L.width??H.measured.width??0,U=L.height??H.measured.height??0,W={id:H.id,parentId:H.parentId,rect:{width:$,height:U,...zw({x:L.x??H.position.x,y:L.y??H.position.y},{width:$,height:U},H.parentId,z,V)}},K=Jh([W],z,G,Y);Z.push(...K),B.x=L.x?Math.max(V[0]*$,L.x):void 0,B.y=L.y?Math.max(V[1]*U,L.y):void 0}if(B.x!==void 0&&B.y!==void 0){const V={id:E,type:"position",position:{...B}};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($)}Q(Z)},onEnd:({width:L,height:D})=>{const Q={id:E,type:"dimensions",resizing:!1,dimensions:{width:L,height:D}};T.getState().triggerNodeChanges([Q])}})),C.current.update({controlPosition:I,boundaries:{minWidth:c,minHeight:f,maxWidth:h,maxHeight:m},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:k,onResizeEnd:S,shouldResize:x}),()=>{var L;(L=C.current)==null||L.destroy()}},[I,c,f,h,m,d,w,k,S,x]);const j=I.split("-");return _.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})}P.memo(jO);function zx(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=zx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Fx(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=zx(e))&&(i&&(i+=" "),i+=t);return i}const DO=(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},$O=(e,t)=>({classGroupId:e,validator:t}),Bx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),su="-",d0=[],zO="arbitrary..",FO=e=>{const t=VO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return BO(l);const c=l.split(su),f=c[0]===""&&c.length>1?1:0;return Vx(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=i[l],h=n[l];return f?h?DO(h,f):f:h||d0}return n[l]||d0}}},Vx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const h=Vx(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}},BO=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?zO+i:void 0})(),VO=e=>{const{theme:t,classGroups:n}=e;return WO(n,t)},WO=(e,t)=>{const n=Bx();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];UO(l,t,n,i)}},UO=(e,t,n,i)=>{if(typeof e=="string"){HO(e,t,n);return}if(typeof e=="function"){qO(e,t,n,i);return}YO(e,t,n,i)},HO=(e,t,n)=>{const i=e===""?t:Wx(t,e);i.classGroupId=n},qO=(e,t,n,i)=>{if(KO(e)){tp(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push($O(n,e))},YO=(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,Wx(t,c),n,i)}},Wx=(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=Bx(),n.nextPart.set(l,c)),n=c}return n},KO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,GO=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)}}},kh="!",h0=":",XO=[],p0=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),QO=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 k=o[w];if(l===0&&c===0){if(k===h0){a.push(o.slice(f,w)),f=w+1;continue}if(k==="/"){h=w;continue}}k==="["?l++:k==="]"?l--:k==="("?c++:k===")"&&c--}const d=a.length===0?o:o.slice(f);let g=d,v=!1;d.endsWith(kh)?(g=d.slice(0,-1),v=!0):d.startsWith(kh)&&(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(XO,!1,l,void 0,!0)}if(n){const o=i;i=a=>n({className:a,parseClassName:o})}return i},JO=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}},ZO=e=>({cache:GO(e.cacheSize),parseClassName:QO(e),sortModifiers:JO(e),postfixLookupClassGroupIds:eI(e),...FO(e)}),eI=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},tI=/\s+/,nI=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(tI);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:k}=n(d);if(g){h=d+(h.length>0?" "+h:h);continue}let S=!!k,N;if(S){const M=w.substring(0,k);N=i(M);const C=N&&l[N]?i(w):void 0;C&&C!==N&&(N=C,S=!1)}else N=i(w);if(!N){if(!S){h=d+(h.length>0?" "+h:h);continue}if(N=i(w),!N){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+kh:E,A=T+N;if(c.indexOf(A)>-1)continue;c.push(A);const R=o(N,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},rI=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=Ux(n))&&(o&&(o+=" "),o+=i);return o},Ux=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Ux(e[i]))&&(n&&(n+=" "),n+=t);return n},iI=(e,...t)=>{let n,i,o,a;const l=f=>{const h=t.reduce((m,d)=>d(m),e());return n=ZO(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=nI(f,n);return o(f,m),m};return a=l,(...f)=>a(rI(...f))},sI=[],ot=e=>{const t=n=>n[e]||sI;return t.isThemeGetter=!0,t},Hx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lI=/\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$/,uI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Er=e=>oI.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),Qf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Kn=e=>aI.test(e),Yx=()=>!0,dI=e=>lI.test(e)&&!uI.test(e),np=()=>!1,hI=e=>cI.test(e),pI=e=>fI.test(e),mI=e=>!me(e)&&!ye(e),gI=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)),yI=e=>Ar(e,Xx,np),me=e=>Hx.test(e),Zr=e=>Ar(e,Qx,dI),m0=e=>Ar(e,NI,Oe),vI=e=>Ar(e,Zx,Yx),wI=e=>Ar(e,Jx,np),g0=e=>Ar(e,Kx,np),xI=e=>Ar(e,Gx,pI),El=e=>Ar(e,e1,hI),ye=e=>qx.test(e),go=e=>hi(e,Qx),bI=e=>hi(e,Jx),y0=e=>hi(e,Kx),kI=e=>hi(e,Xx),SI=e=>hi(e,Gx),Nl=e=>hi(e,e1,!0),EI=e=>hi(e,Zx,!0),Ar=(e,t,n)=>{const i=Hx.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},hi=(e,t,n=!1)=>{const i=qx.exec(e);return i?i[1]?t(i[1]):n:!1},Kx=e=>e==="position"||e==="percentage",Gx=e=>e==="image"||e==="url",Xx=e=>e==="length"||e==="size"||e==="bg-size",Qx=e=>e==="length",NI=e=>e==="number",Jx=e=>e==="family-name",Zx=e=>e==="number"||e==="weight",e1=e=>e==="shadow",_I=()=>{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"),k=ot("aspect"),S=ot("ease"),N=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],I=()=>[Er,"full","auto",...C()],j=()=>[Tn,"none","subgrid",ye,me],L=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],D=()=>[Tn,"auto",ye,me],Q=()=>["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=()=>[Er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[Er,"screen","full","dvw","lvw","svw","min","max","fit",...C()],H=()=>[Er,"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",kI,yI,{size:[ye,me]}],K=()=>[Qf,go,Zr],J=()=>["","none","full",h,ye,me],re=()=>["",Oe,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=()=>[Oe,Qf,y0,g0],de=()=>["","none",x,ye,me],xe=()=>["none",Oe,ye,me],he=()=>["none",Oe,ye,me],fe=()=>[Oe,ye,me],Se=()=>[Er,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[Yx],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[mI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",Oe],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Er,me,ye,k]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[gI],columns:[{columns:[Oe,me,ye,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow: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:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Er,"full","auto",c,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Er,"auto","initial","none",me]}],grow:[{grow:["",Oe,ye,me]}],shrink:[{shrink:["",Oe,ye,me]}],order:[{order:[Tn,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":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":Q()}],"auto-rows":[{"auto-rows":Q()}],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",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],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,EI,vI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qf,me]}],"font-family":[{font:[bI,wI,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":[Oe,"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:[Oe,"from-font","auto",ye,Zr]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Tn,ye,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"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]},SI,xI]}],"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":[Oe,ye,me]}],"outline-w":[{outline:["",Oe,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":[Oe,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:[Oe,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":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":[Oe]}],"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:[Oe,ye,me]}],contrast:[{contrast:[Oe,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Nl,El]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Oe,ye,me]}],"hue-rotate":[{"hue-rotate":[Oe,ye,me]}],invert:[{invert:["",Oe,ye,me]}],saturate:[{saturate:[Oe,ye,me]}],sepia:[{sepia:["",Oe,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ye,me]}],ease:[{ease:["linear","initial",S,ye,me]}],delay:[{delay:[Oe,ye,me]}],animate:[{animate:["none",N,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ye,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate: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:[Oe,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"]}},CI=iI(_I);function De(...e){return CI(Fx(e))}function yo(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function Jf(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 TI(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("-")?Sh(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Etc/UTC"):Sh(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function v0(e,t,n){return t1(TI(e,t),n)}function t1(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(Jf(f,e)){let d=new Date(c.getTime()-36e5),g=bo(d,e.tz);return Jf(g,e)?d:c}let h=new Date(c.getTime()+yo(e)-yo(f)),m=bo(h,e.tz);if(Jf(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 Sh(e,t,n,i,o,a,l){return{y:e,m:t,d:n,h:i,i:o,s:a,tz:l}}var n1=[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]|n1[t-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},Zf=[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 r1{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 r1)this.fromCronDate(t);else throw new TypeError("CronDate: Invalid type ("+typeof t+") passed to CronDate constructor")}getLastDayOfMonth(t,n){return n!==1?Zf[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&&n1[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>Zf[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?Zf[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)):t1(Sh(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 OI(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 II(e){return ko(e)}function PI(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var x0=30*1e3,_l=[],AI=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=OI(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&&II(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&&PI(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 MI(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 RI(e,t=new Date){try{return new AI(e).nextRun(t)}catch{return null}}function LI(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 jI(e,t=new Date){const n=RI(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=LI(n.getTime()-t.getTime());return{short:i,title:`Next run ${o} (in ${a}) · cron ${e}`}}function b0(e){return e?e.replace(/^trigger\./,""):""}const DI=200,$I=560;function zI({liveConnected:e,workflows:t=[],selected:n,onSelect:i,onRun:o,version:a}){const[l,c]=P.useState(248),[f,h]=P.useState(!1),m=P.useCallback(d=>{d.preventDefault(),h(!0)},[]);return P.useEffect(()=>{if(!f)return;const d=v=>c(Math.min($I,Math.max(DI,v.clientX))),g=()=>h(!1);return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[f]),_.jsxs("aside",{className:"relative shrink-0 bg-bg border-r border-border flex flex-col",style:{width:l},children:[_.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[_.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),_.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),a&&_.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",a]})]}),_.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),_.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their ",_.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover → ",_.jsx("span",{className:"font-mono text-fg",children:"▶ run"}),", or select one and use the header."]}),_.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 space-y-0.5",children:[t.length===0&&_.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),t.map(d=>{const g=MI(d),v=g?jI(g):null;return _.jsxs("div",{"data-testid":"workflow-item",className:De("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:[_.jsx("span",{className:De("size-1.5 rounded-full flex-shrink-0",d.name===n?"bg-ok":"bg-border")}),_.jsx("span",{className:"truncate",children:d.title??d.name}),_.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[v?_.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)&&_.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:b0(d.triggerType)}),d.runnable&&o&&_.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)})]}),_.jsxs("div",{className:"p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx("span",{className:De("size-1.5 rounded-full",e?"bg-ok":"bg-border")}),e?"server connected":"offline"]}),_.jsx("div",{className:"mt-1 font-mono",children:"surfaces are the source of truth"})]}),_.jsx("div",{"data-testid":"sidebar-resizer",onMouseDown:m,className:De("absolute top-0 right-0 h-full w-1 cursor-col-resize hover:bg-primary/40",f&&"bg-primary/60")})]})}function FI({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]=P.useState(!1),[k,S]=P.useState(!1),[N,E]=P.useState(null),T=P.useRef(null),A=P.useRef(null),R=P.useCallback(()=>{var L;const j=((L=T.current)==null?void 0:L.value)??"";j.trim()&&(l(j),w(!1))},[l]),M=P.useCallback(()=>{t!=null&&t.needsPayload?(E(null),S(!0)):c()},[t,c]),C=P.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]),I="text-[12px] px-2.5 py-1 rounded transition-colors";return _.jsxs(_.Fragment,{children:[_.jsxs("header",{className:De("h-12 shrink-0 bg-bg border-b flex items-center px-4 gap-3",n===!1?"border-fail":"border-border"),children:[o&&_.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:De("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&&_.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:De("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"}),_.jsx("h1",{className:"font-semibold tracking-tight truncate max-w-[35%]",title:g,children:g}),v&&_.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded shrink-0",children:v}),_.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(t==null?void 0:t.runnable)&&_.jsxs("button",{"data-testid":"topbar-run",onClick:M,className:De(I,"bg-ok/15 text-ok hover:bg-ok/25 font-medium"),children:["▶ Run",t.needsPayload?"…":""]}),_.jsx("button",{"data-testid":"topbar-runs",onClick:f,className:De(I,m?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Runs"}),_.jsx("button",{"data-testid":"topbar-cache",onClick:h,className:De(I,d?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Cache"}),_.jsx("button",{onClick:()=>w(!0),className:De(I,"bg-muted hover:bg-border text-fg"),children:"Paste YAML"})]})]}),k&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",onClick:()=>S(!1),children:_.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:[_.jsxs("span",{className:"font-semibold text-sm",children:["Run ",g," — trigger payload"]}),_.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."}),_.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:[_.jsx("button",{onClick:()=>S(!1),className:De(I,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),_.jsx("button",{onClick:C,className:De(I,"bg-ok/20 text-ok hover:bg-ok/30 font-medium"),children:"▶ Run"})]})]})}),x&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:_.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:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),_.jsx("button",{onClick:()=>w(!1),className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),_.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"}),_.jsxs("div",{className:"flex justify-end gap-2",children:[_.jsx("button",{onClick:()=>w(!1),className:De(I,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),_.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 _.jsx("span",{"data-testid":"status-dot","data-status":e,className:De("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 _.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className:De("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:[_.jsx("div",{className:"h-1 bg-agent"}),_.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(k0,{status:i}),_.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),_.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),_.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),_.jsx(Ir,{type:"target",position:ke.Left,className:"!bg-agent/50"}),_.jsx(Ir,{type:"source",position:ke.Right,className:"!bg-agent/50"})]})}return _.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className:De("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:[_.jsx("div",{className:"h-1 bg-mutedfg/30"}),_.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(k0,{status:i}),_.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),_.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),_.jsx(Ir,{type:"target",position:ke.Left,className:"!bg-mutedfg/50"}),_.jsx(Ir,{type:"source",position:ke.Right,className:"!bg-mutedfg/50"})]})}var ed,E0;function rp(){if(E0)return ed;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,k]){m(w)&&d.setNode(w,k)}),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 k=g.parent(w);return k===void 0||d.hasNode(k)?(v[w]=k,k):k in v?v[k]:x(k)}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 k=l(this._isDirected,m,d,g);if(Object.hasOwn(this._edgeLabels,k))return x&&(this._edgeLabels[k]=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[k]=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[k]=S,o(this._preds[d],m),o(this._sucs[m],d),this._in[d][k]=S,this._out[m][k]=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 k={v,w:x};return g&&(k.name=g),k}function f(h,m){return l(h,m.v,m.w,m.name)}return ed=i,ed}var td,N0;function BI(){return N0||(N0=1,td="2.2.4"),td}var nd,_0;function VI(){return _0||(_0=1,nd={Graph:rp(),version:BI()}),nd}var rd,C0;function WI(){if(C0)return rd;C0=1;var e=rp();rd={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 rd}var id,T0;function UI(){if(T0)return id;T0=1,id=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 id}var sd,O0;function i1(){if(O0)return sd;O0=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 sd=e,sd}var od,I0;function s1(){if(I0)return od;I0=1;var e=i1();od=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],k=l(v),S=d.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+k);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 od}var ad,P0;function HI(){if(P0)return ad;P0=1;var e=s1();ad=t;function t(n,i,o){return n.nodes().reduce(function(a,l){return a[l]=e(n,l,i,o),a},{})}return ad}var ld,A0;function o1(){if(A0)return ld;A0=1,ld=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 ld}var ud,M0;function qI(){if(M0)return ud;M0=1;var e=o1();ud=t;function t(n){return e(n).filter(function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return ud}var cd,R0;function YI(){if(R0)return cd;R0=1,cd=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],k=v.distance+x.distance;k<w.distance&&(w.distance=k,w.predecessor=x.predecessor)})})}),l}return cd}var fd,L0;function a1(){if(L0)return fd;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 fd=e,e.CycleException=t,fd}var dd,j0;function KI(){if(j0)return dd;j0=1;var e=a1();dd=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return dd}var hd,D0;function l1(){if(D0)return hd;D0=1,hd=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 hd}var pd,$0;function GI(){if($0)return pd;$0=1;var e=l1();pd=t;function t(n,i){return e(n,i,"post")}return pd}var md,z0;function XI(){if(z0)return md;z0=1;var e=l1();md=t;function t(n,i){return e(n,i,"pre")}return md}var gd,F0;function QI(){if(F0)return gd;F0=1;var e=rp(),t=i1();gd=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 gd}var yd,B0;function JI(){return B0||(B0=1,yd={components:UI(),dijkstra:s1(),dijkstraAll:HI(),findCycles:qI(),floydWarshall:YI(),isAcyclic:KI(),postorder:GI(),preorder:XI(),prim:QI(),tarjan:o1(),topsort:a1()}),yd}var vd,V0;function yn(){if(V0)return vd;V0=1;var e=VI();return vd={Graph:e.Graph,json:WI(),alg:JI(),version:e.version},vd}var wd,W0;function ZI(){if(W0)return wd;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 wd=e,wd}var xd,U0;function eP(){if(U0)return xd;U0=1;let e=yn().Graph,t=ZI();xd=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 k=m.length-2;k>0;--k)if(w=m[k].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 k=h.edge(w),S=h.node(w.v);v&&x.push({v:w.v,w:w.w}),S.out-=k,c(m,d,S)}),h.outEdges(g.v).forEach(w=>{let k=h.edge(w),S=w.w,N=h.node(S);N.in-=k,c(m,d,N)}),h.removeNode(g.v),x}function l(h,m){let d=new e,g=0,v=0;h.nodes().forEach(k=>{d.setNode(k,{v:k,in:0,out:0})}),h.edges().forEach(k=>{let S=d.edge(k.v,k.w)||0,N=m(k),E=S+N;d.setEdge(k.v,k.w,E),v=Math.max(v,d.node(k.v).out+=N),g=Math.max(g,d.node(k.w).in+=N)});let x=f(v+g+3).map(()=>new t),w=g+1;return d.nodes().forEach(k=>{c(x,w,d.node(k))}),{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 xd}var bd,H0;function nt(){if(H0)return bd;H0=1;let e=yn().Graph;bd={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:k,uniqueId:E,zipObject:M};function t(C,I,j,L){for(var D=L;C.hasNode(D);)D=E(L);return j.dummy=I,C.setNode(D,j),D}function n(C){let I=new e().setGraph(C.graph());return C.nodes().forEach(j=>I.setNode(j,C.node(j))),C.edges().forEach(j=>{let L=I.edge(j.v,j.w)||{weight:0,minlen:1},D=C.edge(j);I.setEdge(j.v,j.w,{weight:L.weight+D.weight,minlen:Math.max(L.minlen,D.minlen)})}),I}function i(C){let I=new e({multigraph:C.isMultigraph()}).setGraph(C.graph());return C.nodes().forEach(j=>{C.children(j).length||I.setNode(j,C.node(j))}),C.edges().forEach(j=>{I.setEdge(j,C.edge(j))}),I}function o(C){let I=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(),I)}function a(C){let I=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(),I)}function l(C,I){let j=C.x,L=C.y,D=I.x-j,Q=I.y-L,z=C.width/2,G=C.height/2;if(!D&&!Q)throw new Error("Not possible to find intersection inside of the rectangle");let Y,Z;return Math.abs(Q)*z>Math.abs(D)*G?(Q<0&&(G=-G),Y=G*D/Q,Z=G):(D<0&&(z=-z),Y=z,Z=z*Q/D),{x:j+Y,y:L+Z}}function c(C){let I=T(x(C)+1).map(()=>[]);return C.nodes().forEach(j=>{let L=C.node(j),D=L.rank;D!==void 0&&(I[D][L.order]=j)}),I}function f(C){let I=C.nodes().map(L=>{let D=C.node(L).rank;return D===void 0?Number.MAX_VALUE:D}),j=v(Math.min,I);C.nodes().forEach(L=>{let D=C.node(L);Object.hasOwn(D,"rank")&&(D.rank-=j)})}function h(C){let I=C.nodes().map(z=>C.node(z).rank),j=v(Math.min,I),L=[];C.nodes().forEach(z=>{let G=C.node(z).rank-j;L[G]||(L[G]=[]),L[G].push(z)});let D=0,Q=C.graph().nodeRankFactor;Array.from(L).forEach((z,G)=>{z===void 0&&G%Q!==0?--D:z!==void 0&&D&&z.forEach(Y=>C.node(Y).rank+=D)})}function m(C,I,j,L){let D={width:0,height:0};return arguments.length>=4&&(D.rank=j,D.order=L),t(C,"border",D,I)}function d(C,I=g){const j=[];for(let L=0;L<C.length;L+=I){const D=C.slice(L,L+I);j.push(D)}return j}const g=65535;function v(C,I){if(I.length>g){const j=d(I);return C.apply(null,j.map(L=>C.apply(null,L)))}else return C.apply(null,I)}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,I){let j={lhs:[],rhs:[]};return C.forEach(L=>{I(L)?j.lhs.push(L):j.rhs.push(L)}),j}function k(C,I){let j=Date.now();try{return I()}finally{console.log(C+" time: "+(Date.now()-j)+"ms")}}function S(C,I){return I()}let N=0;function E(C){var I=++N;return C+(""+I)}function T(C,I,j=1){I==null&&(I=C,C=0);let L=Q=>Q<I;j<0&&(L=Q=>I<Q);const D=[];for(let Q=C;L(Q);Q+=j)D.push(Q);return D}function A(C,I){const j={};for(const L of I)C[L]!==void 0&&(j[L]=C[L]);return j}function R(C,I){let j=I;return typeof I=="string"&&(j=L=>L[I]),Object.entries(C).reduce((L,[D,Q])=>(L[D]=j(Q,D),L),{})}function M(C,I){return C.reduce((j,L,D)=>(j[L]=I[D],j),{})}return bd}var kd,q0;function tP(){if(q0)return kd;q0=1;let e=eP(),t=nt().uniqueId;kd={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 kd}var Sd,Y0;function nP(){if(Y0)return Sd;Y0=1;let e=nt();Sd={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 Sd}var Ed,K0;function ou(){if(K0)return Ed;K0=1;const{applyWithChunking:e}=nt();Ed={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 Ed}var Nd,G0;function u1(){if(G0)return Nd;G0=1;var e=yn().Graph,t=ou().slack;Nd=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 Nd}var _d,X0;function rP(){if(X0)return _d;X0=1;var e=u1(),t=ou().slack,n=ou().longestPath,i=yn().alg.preorder,o=yn().alg.postorder,a=nt().simplify;_d=l,l.initLowLimValues=m,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=x;function l(N){N=a(N),n(N);var E=e(N);m(E),c(E,N);for(var T,A;T=g(E);)A=v(E,N,T),x(E,N,T,A)}function c(N,E){var T=o(N,N.nodes());T=T.slice(0,T.length-1),T.forEach(A=>f(N,E,A))}function f(N,E,T){var A=N.node(T),R=A.parent;N.edge(T,R).cutvalue=h(N,E,T)}function h(N,E,T){var A=N.node(T),R=A.parent,M=!0,C=E.edge(T,R),I=0;return C||(M=!1,C=E.edge(R,T)),I=C.weight,E.nodeEdges(T).forEach(j=>{var L=j.v===T,D=L?j.w:j.v;if(D!==R){var Q=L===M,z=E.edge(j).weight;if(I+=Q?z:-z,k(N,T,D)){var G=N.edge(T,D).cutvalue;I+=Q?-G:G}}}),I}function m(N,E){arguments.length<2&&(E=N.nodes()[0]),d(N,{},1,E)}function d(N,E,T,A,R){var M=T,C=N.node(A);return E[A]=!0,N.neighbors(A).forEach(I=>{Object.hasOwn(E,I)||(T=d(N,E,T,I,A))}),C.low=M,C.lim=T++,R?C.parent=R:delete C.parent,T}function g(N){return N.edges().find(E=>N.edge(E).cutvalue<0)}function v(N,E,T){var A=T.v,R=T.w;E.hasEdge(A,R)||(A=T.w,R=T.v);var M=N.node(A),C=N.node(R),I=M,j=!1;M.lim>C.lim&&(I=C,j=!0);var L=E.edges().filter(D=>j===S(N,N.node(D.v),I)&&j!==S(N,N.node(D.w),I));return L.reduce((D,Q)=>t(E,Q)<t(E,D)?Q:D)}function x(N,E,T,A){var R=T.v,M=T.w;N.removeEdge(R,M),N.setEdge(A.v,A.w,{}),m(N),c(N,E),w(N,E)}function w(N,E){var T=N.nodes().find(R=>!E.node(R).parent),A=i(N,T);A=A.slice(1),A.forEach(R=>{var M=N.node(R).parent,C=E.edge(R,M),I=!1;C||(C=E.edge(M,R),I=!0),E.node(R).rank=E.node(M).rank+(I?C.minlen:-C.minlen)})}function k(N,E,T){return N.hasEdge(E,T)}function S(N,E,T){return T.low<=E.lim&&E.lim<=T.lim}return _d}var Cd,Q0;function iP(){if(Q0)return Cd;Q0=1;var e=ou(),t=e.longestPath,n=u1(),i=rP();Cd=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 Cd}var Td,J0;function sP(){if(J0)return Td;J0=1,Td=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 Td}var Od,Z0;function oP(){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"),k=l.node(g);l.setParent(x,g),k.borderTop=x,l.setParent(w,g),k.borderBottom=w,v.forEach(S=>{n(l,c,f,h,m,d,S);let N=l.node(S),E=N.borderTop?N.borderTop:S,T=N.borderBottom?N.borderBottom:S,A=N.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 Id,ev;function aP(){if(ev)return Id;ev=1;let e=nt();Id=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 Id}var Pd,tv;function lP(){if(tv)return Pd;tv=1,Pd={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 Pd}var Ad,nv;function uP(){if(nv)return Ad;nv=1;let e=nt();Ad=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 Ad}var Md,rv;function cP(){if(rv)return Md;rv=1;let e=nt().zipObject;Md=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 Md}var Rd,iv;function fP(){if(iv)return Rd;iv=1,Rd=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 Rd}var Ld,sv;function dP(){if(sv)return Ld;sv=1;let e=nt();Ld=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 Ld}var jd,ov;function hP(){if(ov)return jd;ov=1;let e=nt();jd=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 jd}var Dd,av;function pP(){if(av)return Dd;av=1;let e=fP(),t=dP(),n=hP();Dd=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(N=>N!==g&&N!==v));let w=e(l,m);w.forEach(N=>{if(l.children(N.v).length){let E=i(l,N.v,f,h);x[N.v]=E,Object.hasOwn(E,"barycenter")&&a(N,E)}});let k=t(w,f);o(k,x);let S=n(k,h);if(g&&(S.vs=[g,S.vs,v].flat(!0),l.predecessors(g).length)){let N=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+N.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 Dd}var $d,lv;function mP(){if(lv)return $d;lv=1;let e=yn().Graph,t=nt();$d=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),k=w!==void 0?w.weight:0;h.setEdge(x,m,{weight:o.edge(v).weight+k})}),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 $d}var zd,uv;function gP(){if(uv)return zd;uv=1,zd=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 zd}var Fd,cv;function yP(){if(cv)return Fd;cv=1;let e=uP(),t=cP(),n=pP(),i=mP(),o=gP(),a=yn().Graph,l=nt();Fd=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"),k=e(d);if(m(d,k),g&&g.disableOptimalOrderHeuristic)return;let S=Number.POSITIVE_INFINITY,N;for(let E=0,T=0;T<4;++E,++T){h(E%2?x:w,E%4>=2),k=l.buildLayerMatrix(d);let A=t(d,k);A<S&&(T=0,N=Object.assign({},k),S=A)}m(d,N)}function f(d,g,v){const x=new Map,w=(k,S)=>{x.has(k)||x.set(k,[]),x.get(k).push(S)};for(const k of d.nodes()){const S=d.node(k);if(typeof S.rank=="number"&&w(S.rank,k),typeof S.minRank=="number"&&typeof S.maxRank=="number")for(let N=S.minRank;N<=S.maxRank;N++)N!==S.rank&&w(N,k)}return g.map(function(k){return i(d,k,v,x.get(k)||[])})}function h(d,g){let v=new a;d.forEach(function(x){let w=x.graph().root,k=n(x,w,v,g);k.vs.forEach((S,N)=>x.node(S).order=N),o(x,v,k.vs)})}function m(d,g){Object.values(g).forEach(v=>v.forEach((x,w)=>d.node(x).order=w))}return Fd}var Bd,fv;function vP(){if(fv)return Bd;fv=1;let e=yn().Graph,t=nt();Bd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:d,findSmallestWidthAlignment:m,balance:g};function n(k,S){let N={};function E(T,A){let R=0,M=0,C=T.length,I=A[A.length-1];return A.forEach((j,L)=>{let D=o(k,j),Q=D?k.node(D).order:C;(D||j===I)&&(A.slice(M,L+1).forEach(z=>{k.predecessors(z).forEach(G=>{let Y=k.node(G),Z=Y.order;(Z<R||Q<Z)&&!(Y.dummy&&k.node(z).dummy)&&a(N,G,z)})}),M=L+1,R=Q)}),A}return S.length&&S.reduce(E),N}function i(k,S){let N={};function E(A,R,M,C,I){let j;t.range(R,M).forEach(L=>{j=A[L],k.node(j).dummy&&k.predecessors(j).forEach(D=>{let Q=k.node(D);Q.dummy&&(Q.order<C||Q.order>I)&&a(N,D,j)})})}function T(A,R){let M=-1,C,I=0;return R.forEach((j,L)=>{if(k.node(j).dummy==="border"){let D=k.predecessors(j);D.length&&(C=k.node(D[0]).order,E(R,I,L,M,C),I=L,M=C)}E(R,I,R.length,C,A.length)}),R}return S.length&&S.reduce(T),N}function o(k,S){if(k.node(S).dummy)return k.predecessors(S).find(N=>k.node(N).dummy)}function a(k,S,N){if(S>N){let T=S;S=N,N=T}let E=k[S];E||(k[S]=E={}),E[N]=!0}function l(k,S,N){if(S>N){let E=S;S=N,N=E}return!!k[S]&&Object.hasOwn(k[S],N)}function c(k,S,N,E){let T={},A={},R={};return S.forEach(M=>{M.forEach((C,I)=>{T[C]=C,A[C]=C,R[C]=I})}),S.forEach(M=>{let C=-1;M.forEach(I=>{let j=E(I);if(j.length){j=j.sort((D,Q)=>R[D]-R[Q]);let L=(j.length-1)/2;for(let D=Math.floor(L),Q=Math.ceil(L);D<=Q;++D){let z=j[D];A[I]===I&&C<R[z]&&!l(N,I,z)&&(A[z]=I,A[I]=T[I]=T[z],C=R[z])}}})}),{root:T,align:A}}function f(k,S,N,E,T){let A={},R=h(k,S,N,T),M=T?"borderLeft":"borderRight";function C(L,D){let Q=R.nodes(),z=Q.pop(),G={};for(;z;)G[z]?L(z):(G[z]=!0,Q.push(z),Q=Q.concat(D(z))),z=Q.pop()}function I(L){A[L]=R.inEdges(L).reduce((D,Q)=>Math.max(D,A[Q.v]+R.edge(Q)),0)}function j(L){let D=R.outEdges(L).reduce((z,G)=>Math.min(z,A[G.w]-R.edge(G)),Number.POSITIVE_INFINITY),Q=k.node(L);D!==Number.POSITIVE_INFINITY&&Q.borderType!==M&&(A[L]=Math.max(A[L],D))}return C(I,R.predecessors.bind(R)),C(j,R.successors.bind(R)),Object.keys(E).forEach(L=>A[L]=A[N[L]]),A}function h(k,S,N,E){let T=new e,A=k.graph(),R=x(A.nodesep,A.edgesep,E);return S.forEach(M=>{let C;M.forEach(I=>{let j=N[I];if(T.setNode(j),C){var L=N[C],D=T.edge(L,j);T.setEdge(L,j,Math.max(R(k,I,C),D||0))}C=I})}),T}function m(k,S){return Object.values(S).reduce((N,E)=>{let T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([M,C])=>{let I=w(k,M)/2;T=Math.max(C+I,T),A=Math.min(C-I,A)});const R=T-A;return R<N[0]&&(N=[R,E]),N},[Number.POSITIVE_INFINITY,null])[1]}function d(k,S){let N=Object.values(S),E=t.applyWithChunking(Math.min,N),T=t.applyWithChunking(Math.max,N);["u","d"].forEach(A=>{["l","r"].forEach(R=>{let M=A+R,C=k[M];if(C===S)return;let I=Object.values(C),j=E-t.applyWithChunking(Math.min,I);R!=="l"&&(j=T-t.applyWithChunking(Math.max,I)),j&&(k[M]=t.mapValues(C,L=>L+j))})})}function g(k,S){return t.mapValues(k.ul,(N,E)=>{if(S)return k[S.toLowerCase()][E];{let T=Object.values(k).map(A=>A[E]).sort((A,R)=>A-R);return(T[1]+T[2])/2}})}function v(k){let S=t.buildLayerMatrix(k),N=Object.assign(n(k,S),i(k,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"?k.predecessors:k.successors).bind(k),I=c(k,T,N,C),j=f(k,T,I.root,I.align,M==="r");M==="r"&&(j=t.mapValues(j,L=>-L)),E[R+M]=j})});let A=m(k,E);return d(E,A),g(E,k.graph().align)}function x(k,S,N){return(E,T,A)=>{let R=E.node(T),M=E.node(A),C=0,I;if(C+=R.width/2,Object.hasOwn(R,"labelpos"))switch(R.labelpos.toLowerCase()){case"l":I=-R.width/2;break;case"r":I=R.width/2;break}if(I&&(C+=N?I:-I),I=0,C+=(R.dummy?S:k)/2,C+=(M.dummy?S:k)/2,C+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":I=M.width/2;break;case"r":I=-M.width/2;break}return I&&(C+=N?I:-I),I=0,C}}function w(k,S){return k.node(S).width}return Bd}var Vd,dv;function wP(){if(dv)return Vd;dv=1;let e=nt(),t=vP().positionX;Vd=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 Vd}var Wd,hv;function xP(){if(hv)return Wd;hv=1;let e=tP(),t=nP(),n=iP(),i=nt().normalizeRanks,o=sP(),a=nt().removeEmptyRanks,l=oP(),c=aP(),f=lP(),h=yP(),m=wP(),d=nt(),g=yn().Graph;Wd=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",()=>I(W)),K(" removeSelfEdges",()=>B(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",()=>H(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",()=>Q(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 k=["nodesep","edgesep","ranksep","marginx","marginy"],S={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["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,k),d.pick(J,N))),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 I(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 Q(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 B(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 H(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 Wd}var Ud,pv;function bP(){if(pv)return Ud;pv=1;let e=nt(),t=yn().Graph;Ud={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 Ud}var Hd,mv;function kP(){return mv||(mv=1,Hd="1.1.8"),Hd}var qd,gv;function SP(){return gv||(gv=1,qd={graphlib:yn(),layout:xP(),debug:bP(),util:{time:nt().time,notime:nt().notime},version:kP()}),qd}var EP=SP();const yv=hu(EP),vv=220,wv=140,Yd=60;function NP(e){return P.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:Yd})}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-Yd/2},data:{node:o},width:l,height:Yd}}),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 _P="hsl(240 5% 65%)",c1="hsl(142 71% 42%)",CP="hsl(0 72% 55%)",TP="hsl(38 92% 50%)";function OP(e,t){const n=e!=="idle";return{stroke:e==="failed"?CP:e==="running"?TP:n?c1:_P,strokeWidth:n?2.5:1.5,strokeDasharray:t&&!n?"6 4":void 0,animated:e==="running",fired:n}}const IP={workflowNode:S0,agentNode:S0};function PP({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:o,edges:a}=NP(e),[l,c]=P.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=P.useCallback((x,w)=>{const k=w.data.node;k&&t(k)},[t]),d=P.useCallback(x=>{x.preventDefault(),x.dataTransfer.dropEffect="copy",c(!0)},[]),g=P.useCallback(()=>{c(!1)},[]),v=P.useCallback(x=>{x.preventDefault(),c(!1);const w=x.dataTransfer.files[0];if(!w)return;const k=new FileReader;k.onload=S=>{var E;const N=(E=S.target)==null?void 0:E.result;typeof N=="string"&&n(N)},k.readAsText(w)},[n]);return _.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:d,onDragLeave:g,onDrop:v,children:[_.jsxs(uO,{nodes:f,edges:h,nodeTypes:IP,onNodeClick:m,fitView:!0,attributionPosition:"bottom-right",children:[_.jsx(pO,{variant:Qn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),_.jsx(bO,{})]}),l&&_.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:_.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),_.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"}),_.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:[_.jsxs("span",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"inline-block w-4 border-t-2 border-dashed",style:{borderColor:"hsl(240 5% 65%)"}})," branch"]}),_.jsxs("span",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"inline-block w-4 border-t-2",style:{borderColor:c1}})," 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 AP(...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 P.useCallback(AP(...e),e)}function f1(e,t=[]){let n=[];function i(a,l){const c=P.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,k=P.useMemo(()=>x,Object.values(x));return _.jsx(w.Provider,{value:k,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=P.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=>P.createContext(l));return function(c){const f=(c==null?void 0:c[e])||a;return P.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[i,MP(o,...t)]}function MP(...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 P.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ds=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},RP=Lh[" useId ".trim().toString()]||(()=>{}),LP=0;function Kd(e){const[t,n]=P.useState(RP());return ds(()=>{n(i=>i??String(LP++))},[e]),e||(t?`radix-${t}`:"")}var jP=Lh[" useInsertionEffect ".trim().toString()]||ds;function DP({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,a,l]=$P({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:o;{const m=P.useRef(e!==void 0);P.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=P.useCallback(m=>{var d;if(c){const g=zP(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 $P({defaultProp:e,onChange:t}){const[n,i]=P.useState(e),o=P.useRef(n),a=P.useRef(t);return jP(()=>{a.current=t},[t]),P.useEffect(()=>{var l;o.current!==n&&((l=a.current)==null||l.call(a,n),o.current=n)},[n,o]),[n,i,a]}function zP(e){return typeof e=="function"}function d1(e){const t=P.forwardRef((n,i)=>{let{children:o,...a}=n,l=null,c=!1;const f=[];bv(o)&&typeof Cl=="function"&&(o=Cl(o._payload)),P.Children.forEach(o,g=>{var v;if(UP(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=BP(x,w),f.push((v=l==null?void 0:l.props)==null?void 0:v.children)}else f.push(g)}),l?l=P.cloneElement(l,void 0,f):!c&&P.Children.count(o)===1&&P.isValidElement(o)&&(l=o);const h=l?WP(l):void 0,m=Ut(i,h);if(!l){if(o||o===0)throw new Error(c?KP(e):YP(e));return o}const d=VP(a,l.props??{});return l.type!==P.Fragment&&(d.ref=i?m:h),P.cloneElement(l,d)});return t.displayName=`${e}.Slot`,t}var FP=Symbol.for("radix.slottable"),BP=(e,t)=>{if("child"in e.props){const n=e.props.child;return P.isValidElement(n)?P.cloneElement(n,void 0,e.props.children(n.props.children)):null}return P.isValidElement(t)?t:null};function VP(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 WP(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 UP(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FP}var HP=Symbol.for("react.lazy");function bv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===HP&&"_payload"in e&&qP(e._payload)}function qP(e){return typeof e=="object"&&e!==null&&"then"in e}var YP=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,KP=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cl=Lh[" use ".trim().toString()],GP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=GP.reduce((e,t)=>{const n=d1(`Primitive.${t}`),i=P.forwardRef((o,a)=>{const{asChild:l,...c}=o,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(f,{...c,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function XP(e,t){e&&sx.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function QP(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);P.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 JP="DismissableLayer",Eh="dismissableLayer.update",ZP="dismissableLayer.pointerDownOutside",eA="dismissableLayer.focusOutside",kv,ip=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),h1=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...h}=e,m=P.useContext(ip),[d,g]=P.useState(null),v=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=P.useState({}),w=Ut(t,I=>g(I)),k=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=k.indexOf(S),E=d?k.indexOf(d):-1,T=m.layersWithOutsidePointerEventsDisabled.size>0,A=E>=N,R=P.useRef(!1),M=iA(I=>{const j=I.target;if(!(j instanceof Node))return;const L=[...m.branches].some(D=>D.contains(j));!A||L||(a==null||a(I),c==null||c(I),I.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:m.dismissableSurfaces}),C=sA(I=>{if(i&&R.current)return;const j=I.target;[...m.branches].some(D=>D.contains(j))||(l==null||l(I),c==null||c(I),I.defaultPrevented||f==null||f())},v);return QP(I=>{E===m.layers.size-1&&(o==null||o(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},v),P.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]),P.useEffect(()=>()=>{d&&(m.layers.delete(d),m.layersWithOutsidePointerEventsDisabled.delete(d),Sv())},[d,m]),P.useEffect(()=>{const I=()=>x({});return document.addEventListener(Eh,I),()=>document.removeEventListener(Eh,I)},[]),_.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)})});h1.displayName=JP;var tA="DismissableLayerBranch",nA=P.forwardRef((e,t)=>{const n=P.useContext(ip),i=P.useRef(null),o=Ut(t,i);return P.useEffect(()=>{const a=i.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),_.jsx(Rt.div,{...e,ref:o})});nA.displayName=tA;function rA(){const e=P.useContext(ip),[t,n]=P.useState(null);return P.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function iA(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a}=t,l=Zt(e),c=P.useRef(!1),f=P.useRef(!1),h=P.useRef(new Map),m=P.useRef(()=>{});return P.useEffect(()=>{function d(){f.current=!1,o.current=!1,h.current.clear()}function g(){return Array.from(h.current.values()).some(Boolean)}function v(N){if(!f.current)return;const E=N.target;E instanceof Node&&[...a].some(A=>A.contains(E))||h.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function x(N){f.current&&h.current.set(N.type,!1)}const w=N=>{if(N.target&&!c.current){let E=function(){n.removeEventListener("click",m.current);const A=g();d(),A||p1(ZP,l,T,{discrete:!0})};const T={originalEvent:N};f.current=!0,o.current=i&&N.button===0,h.current.clear(),!i||N.button!==0?E():(n.removeEventListener("click",m.current),m.current=E,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),d();c.current=!1},k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of k)n.addEventListener(N,v,!0),n.addEventListener(N,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 N of k)n.removeEventListener(N,v,!0),n.removeEventListener(N,x)}},[n,l,i,o,a]),{onPointerDownCapture:()=>c.current=!0}}function sA(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=P.useRef(!1);return P.useEffect(()=>{const o=a=>{a.target&&!i.current&&p1(eA,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(Eh);document.dispatchEvent(e)}function p1(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?XP(o,a):o.dispatchEvent(a)}var Gd="focusScope.autoFocusOnMount",Xd="focusScope.autoFocusOnUnmount",Ev={bubbles:!1,cancelable:!0},oA="FocusScope",m1=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...l}=e,[c,f]=P.useState(null),h=Zt(o),m=Zt(a),d=P.useRef(null),g=Ut(t,w=>f(w)),v=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.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})},k=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",k);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",k),N.disconnect()}}},[i,c,v.paused]),P.useEffect(()=>{if(c){_v.add(v);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Gd,Ev);c.addEventListener(Gd,h),c.dispatchEvent(S),S.defaultPrevented||(aA(dA(g1(c)),{select:!0}),document.activeElement===w&&_r(c))}return()=>{c.removeEventListener(Gd,h),setTimeout(()=>{const S=new CustomEvent(Xd,Ev);c.addEventListener(Xd,m),c.dispatchEvent(S),S.defaultPrevented||_r(w??document.body,{select:!0}),c.removeEventListener(Xd,m),_v.remove(v)},0)}}},[c,h,m,v]);const x=P.useCallback(w=>{if(!n&&!i||v.paused)return;const k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(k&&S){const N=w.currentTarget,[E,T]=lA(N);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===N&&w.preventDefault()}},[n,i,v.paused]);return _.jsx(Rt.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});m1.displayName=oA;function aA(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(_r(i,{select:t}),document.activeElement!==n)return}function lA(e){const t=g1(e),n=Nv(t,e),i=Nv(t.reverse(),e);return[n,i]}function g1(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(!uA(n,{upTo:t}))return n}function uA(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 cA(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&&cA(e)&&t&&e.select()}}var _v=fA();function fA(){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 dA(e){return e.filter(t=>t.tagName!=="A")}var hA="Portal",y1=P.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,a]=P.useState(!1);ds(()=>a(!0),[]);const l=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?sx.createPortal(_.jsx(Rt.div,{...i,ref:t}),l):null});y1.displayName=hA;function pA(e,t){return P.useReducer((n,i)=>t[n][i]??n,e)}var Mr=e=>{const{present:t,children:n}=e,i=mA(t),o=typeof n=="function"?n({present:i.isPresent}):P.Children.only(n),a=gA(i.ref,yA(o));return typeof n=="function"||i.isPresent?P.cloneElement(o,{ref:a}):null};Mr.displayName="Presence";function mA(e){const[t,n]=P.useState(),i=P.useRef(null),o=P.useRef(e),a=P.useRef("none"),l=e?"mounted":"unmounted",[c,f]=pA(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.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 k=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},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:P.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 gA(...e){const t=P.useRef(e);return t.current=e,P.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 yA(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 Ol=0,On=null;function vA(){P.useEffect(()=>{On||(On={start:Ov(),end:Ov()});const{start:e,end:t}=On;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ol++,()=>{Ol===1&&(On==null||On.start.remove(),On==null||On.end.remove(),On=null),Ol=Math.max(0,Ol-1)}},[])}function Ov(){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 v1(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 wA(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",xA="with-scroll-bars-hidden",bA="--removed-body-scroll-bar-size";function Qd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kA(e,t){var n=P.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 SA=typeof window<"u"?P.useLayoutEffect:P.useEffect,Iv=new WeakMap;function EA(e,t){var n=kA(null,function(i){return e.forEach(function(o){return Qd(o,i)})});return SA(function(){var i=Iv.get(n);if(i){var o=new Set(i),a=new Set(e),l=n.current;o.forEach(function(c){a.has(c)||Qd(c,null)}),a.forEach(function(c){o.has(c)||Qd(c,l)})}Iv.set(n,e)},[e]),n}function NA(e){return e}function _A(e,t){t===void 0&&(t=NA);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 CA(e){e===void 0&&(e={});var t=_A(null);return t.options=Pn({async:!0,ssr:!1},e),t}var w1=function(e){var t=e.sideCar,n=v1(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 P.createElement(i,Pn({},n))};w1.isSideCarExport=!0;function TA(e,t){return e.useMedium(t),w1}var x1=CA(),Jd=function(){},_u=P.forwardRef(function(e,t){var n=P.useRef(null),i=P.useState({onScrollCapture:Jd,onWheelCapture:Jd,onTouchMoveCapture:Jd}),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,k=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,E=e.gapMode,T=v1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,R=EA([n,t]),M=Pn(Pn({},T),o);return P.createElement(P.Fragment,null,m&&P.createElement(A,{sideCar:x1,removeScrollBar:h,shards:d,noRelative:v,noIsolation:x,inert:w,setCallbacks:a,allowPinchZoom:!!k,lockRef:n,gapMode:E}),l?P.cloneElement(P.Children.only(c),Pn(Pn({},M),{ref:R})):P.createElement(N,Pn({},M,{className:f,ref:R}),c))});_u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_u.classNames={fullWidth:Hl,zeroRight:Ul};var OA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=OA();return t&&e.setAttribute("nonce",t),e}function PA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IA())&&(PA(t,n),AA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},RA=function(){var e=MA();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},b1=function(){var e=RA(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},LA={left:0,top:0,right:0,gap:0},Zd=function(e){return parseInt(e||"",10)||0},jA=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[Zd(n),Zd(i),Zd(o)]},DA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LA;var t=jA(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},$A=b1(),ns="data-scroll-locked",zA=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(xA,` {
|
|
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(bA,": ").concat(c,`px;
|
|
98
|
+
}
|
|
99
|
+
`)},Pv=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},FA=function(){P.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())}},[])},BA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;FA();var a=P.useMemo(function(){return DA(o)},[o]);return P.createElement($A,{styles:zA(a,!t,o,n?"":"!important")})},Nh=!1;if(typeof window<"u")try{var Il=Object.defineProperty({},"passive",{get:function(){return Nh=!0,!0}});window.addEventListener("test",Il,Il),window.removeEventListener("test",Il,Il)}catch{Nh=!1}var Ui=Nh?{passive:!1}:!1,VA=function(e){return e.tagName==="TEXTAREA"},k1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VA(e)&&n[t]==="visible")},WA=function(e){return k1(e,"overflowY")},UA=function(e){return k1(e,"overflowX")},Av=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=S1(e,i);if(o){var a=E1(e,i),l=a[1],c=a[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},HA=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},qA=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},S1=function(e,t){return e==="v"?WA(t):UA(t)},E1=function(e,t){return e==="v"?HA(t):qA(t)},YA=function(e,t){return e==="h"&&t==="rtl"?-1:1},KA=function(e,t,n,i,o){var a=YA(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=E1(e,c),x=v[0],w=v[1],k=v[2],S=w-k-a*x;(x||S)&&S1(e,c)&&(d+=S,g+=x);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(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},GA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XA=function(e){return`
|
|
100
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
101
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
102
|
+
`)},QA=0,Hi=[];function JA(e){var t=P.useRef([]),n=P.useRef([0,0]),i=P.useRef(),o=P.useState(QA++)[0],a=P.useState(b1)[0],l=P.useRef(e);P.useEffect(function(){l.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=wA([e.lockRef.current],(e.shards||[]).map(Rv),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=P.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var S=Pl(w),N=n.current,E="deltaX"in w?w.deltaX:N[0]-S[0],T="deltaY"in w?w.deltaY:N[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(),I=C&&C.anchorNode,j=I?I===R||I.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 KA(D,k,w,D==="h"?E:T)},[]),f=P.useCallback(function(w){var k=w;if(!(!Hi.length||Hi[Hi.length-1]!==a)){var S="deltaY"in k?Mv(k):Pl(k),N=t.current.filter(function(A){return A.name===k.type&&(A.target===k.target||k.target===A.shadowParent)&&GA(A.delta,S)})[0];if(N&&N.should){k.cancelable&&k.preventDefault();return}if(!N){var E=(l.current.shards||[]).map(Rv).filter(Boolean).filter(function(A){return A.contains(k.target)}),T=E.length>0?c(k,E[0]):!l.current.noIsolation;T&&k.cancelable&&k.preventDefault()}}},[]),h=P.useCallback(function(w,k,S,N){var E={name:w,delta:k,target:S,should:N,shadowParent:ZA(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=P.useCallback(function(w){n.current=Pl(w),i.current=void 0},[]),d=P.useCallback(function(w){h(w.type,Mv(w),w.target,c(w,e.lockRef.current))},[]),g=P.useCallback(function(w){h(w.type,Pl(w),w.target,c(w,e.lockRef.current))},[]);P.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 P.createElement(P.Fragment,null,x?P.createElement(a,{styles:XA(o)}):null,v?P.createElement(BA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const eM=TA(x1,JA);var N1=P.forwardRef(function(e,t){return P.createElement(_u,Pn({},e,{ref:t,sideCar:eM}))});N1.classNames=_u.classNames;var tM=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={},eh=0,_1=function(e){return e&&(e.host||_1(e.parentNode))},nM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=_1(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})},rM=function(e,t,n,i){var o=nM(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,k=(a.get(g)||0)+1;qi.set(g,w),a.set(g,k),l.push(g),w===1&&x&&Al.set(g,!0),k===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(),eh++,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)}),eh--,eh||(qi=new WeakMap,qi=new WeakMap,Al=new WeakMap,Ml={})}},iM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=tM(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),rM(i,o,n,"aria-hidden")):function(){return null}},Cu="Dialog",[C1]=f1(Cu),[sM,wn]=C1(Cu),T1=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=P.useRef(null),f=P.useRef(null),[h,m]=DP({prop:i,defaultProp:o??!1,onChange:a,caller:Cu});return _.jsx(sM,{scope:t,triggerRef:c,contentRef:f,contentId:Kd(),titleId:Kd(),descriptionId:Kd(),open:h,onOpenChange:m,onOpenToggle:P.useCallback(()=>m(d=>!d),[m]),modal:l,children:n})};T1.displayName=Cu;var O1="DialogTrigger",oM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(O1,n),a=Ut(t,o.triggerRef);return _.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)})});oM.displayName=O1;var sp="DialogPortal",[aM,I1]=C1(sp,{forceMount:void 0}),P1=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:o}=e,a=wn(sp,t);return _.jsx(aM,{scope:t,forceMount:n,children:P.Children.map(i,l=>_.jsx(Mr,{present:n||a.open,children:_.jsx(y1,{asChild:!0,container:o,children:l})}))})};P1.displayName=sp;var au="DialogOverlay",op=P.forwardRef((e,t)=>{const n=I1(au,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(au,e.__scopeDialog);return a.modal?_.jsx(Mr,{present:i||a.open,children:_.jsx(uM,{...o,ref:t})}):null});op.displayName=au;var lM=d1("DialogOverlay.RemoveScroll"),uM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(au,n),a=rA(),l=Ut(t,a);return _.jsx(N1,{as:lM,allowPinchZoom:!0,shards:[o.contentRef],children:_.jsx(Rt.div,{"data-state":up(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),hs="DialogContent",ap=P.forwardRef((e,t)=>{const n=I1(hs,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(hs,e.__scopeDialog);return _.jsx(Mr,{present:i||a.open,children:a.modal?_.jsx(cM,{...o,ref:t}):_.jsx(fM,{...o,ref:t})})});ap.displayName=hs;var cM=P.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=P.useRef(null),o=Ut(t,n.contentRef,i);return P.useEffect(()=>{const a=i.current;if(a)return iM(a)},[]),_.jsx(A1,{...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())})}),fM=P.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=P.useRef(!1),o=P.useRef(!1);return _.jsx(A1,{...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()}})}),A1=P.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...l}=e,c=wn(hs,n);return vA(),_.jsx(_.Fragment,{children:_.jsx(m1,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:_.jsx(h1,{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)})})})}),M1="DialogTitle",lp=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(M1,n);return _.jsx(Rt.h2,{id:o.titleId,...i,ref:t})});lp.displayName=M1;var R1="DialogDescription",dM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(R1,n);return _.jsx(Rt.p,{id:o.descriptionId,...i,ref:t})});dM.displayName=R1;var L1="DialogClose",j1=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(L1,n);return _.jsx(Rt.button,{type:"button",...i,ref:t,onClick:St(e.onClick,()=>o.onOpenChange(!1))})});j1.displayName=L1;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 hM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),Lv=e=>{const t=pM(e);return t.charAt(0).toUpperCase()+t.slice(1)},D1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),mM=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 gM={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 yM=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:a,iconNode:l,...c},f)=>P.createElement("svg",{ref:f,...gM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:D1("lucide",o),...!a&&!mM(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,m])=>P.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 vM=(e,t)=>{const n=P.forwardRef(({className:i,...o},a)=>P.createElement(yM,{ref:a,iconNode:t,className:D1(`lucide-${hM(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 wM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xM=vM("x",wM),bM=T1,kM=P1,$1=P.forwardRef(({className:e,...t},n)=>_.jsx(op,{className:De("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));$1.displayName=op.displayName;const z1=P.forwardRef(({side:e="right",className:t,children:n,...i},o)=>_.jsxs(kM,{children:[_.jsx($1,{}),_.jsxs(ap,{ref:o,className:De("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,_.jsxs(j1,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[_.jsx(xM,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));z1.displayName=ap.displayName;const F1=({className:e,...t})=>_.jsx("div",{className:De("flex flex-col space-y-2 p-4 border-b border-border",e),...t});F1.displayName="SheetHeader";const B1=P.forwardRef(({className:e,...t},n)=>_.jsx(lp,{ref:n,className:De("font-semibold",e),...t}));B1.displayName=lp.displayName;var SM=P.createContext(void 0);function EM(e){const t=P.useContext(SM);return e||t||"ltr"}function NM(e,[t,n]){return Math.min(n,Math.max(t,e))}function _M(e,t){return P.useReducer((n,i)=>t[n][i]??n,e)}var cp="ScrollArea",[V1]=f1(cp),[CM,rn]=V1(cp),W1=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:a=600,...l}=e,[c,f]=P.useState(null),[h,m]=P.useState(null),[d,g]=P.useState(null),[v,x]=P.useState(null),[w,k]=P.useState(null),[S,N]=P.useState(0),[E,T]=P.useState(0),[A,R]=P.useState(!1),[M,C]=P.useState(!1),I=Ut(t,L=>f(L)),j=EM(o);return _.jsx(CM,{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:k,scrollbarYEnabled:M,onScrollbarYEnabledChange:C,onCornerWidthChange:N,onCornerHeightChange:T,children:_.jsx(Rt.div,{dir:j,...l,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});W1.displayName=cp;var U1="ScrollAreaViewport",H1=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:o,...a}=e,l=rn(U1,n),c=P.useRef(null),f=Ut(t,c,l.onViewportChange);return _.jsxs(_.Fragment,{children:[_.jsx(TM,{nonce:o}),_.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:_.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});H1.displayName=U1;var TM=P.memo(({nonce:e})=>_.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=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Ln,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=o,c=e.orientation==="horizontal";return P.useEffect(()=>(c?a(!0):l(!0),()=>{c?a(!1):l(!1)}),[c,a,l]),o.type==="hover"?_.jsx(OM,{...i,ref:t,forceMount:n}):o.type==="scroll"?_.jsx(IM,{...i,ref:t,forceMount:n}):o.type==="auto"?_.jsx(q1,{...i,ref:t,forceMount:n}):o.type==="always"?_.jsx(dp,{...i,ref:t,"data-state":"visible"}):null});fp.displayName=Ln;var OM=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Ln,e.__scopeScrollArea),[a,l]=P.useState(!1);return P.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]),_.jsx(Mr,{present:n||a,children:_.jsx(q1,{"data-state":a?"visible":"hidden",...i,ref:t})})}),IM=P.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]=_M("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 P.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,o.scrollHideDelay,f]),P.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]),_.jsx(Mr,{present:n||c!=="hidden",children:_.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"))})})}),q1=P.forwardRef((e,t)=>{const n=rn(Ln,e.__scopeScrollArea),{forceMount:i,...o}=e,[a,l]=P.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),_.jsx(Mr,{present:i||a,children:_.jsx(dp,{"data-state":a?"visible":"hidden",...o,ref:t})})}),dp=P.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,o=rn(Ln,e.__scopeScrollArea),a=P.useRef(null),l=P.useRef(0),[c,f]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=Q1(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 jM(g,l.current,c,v)}return n==="horizontal"?_.jsx(PM,{...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"?_.jsx(AM,{...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}),PM=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Ln,e.__scopeScrollArea),[l,c]=P.useState(),f=P.useRef(null),h=Ut(t,f,a.onScrollbarXChange);return P.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),_.jsx(K1,{"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":Tu(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),Z1(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)}})}})}),AM=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Ln,e.__scopeScrollArea),[l,c]=P.useState(),f=P.useRef(null),h=Ut(t,f,a.onScrollbarYChange);return P.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),_.jsx(K1,{"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":Tu(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),Z1(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)}})}})}),[MM,Y1]=V1(Ln),K1=P.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]=P.useState(null),k=Ut(t,I=>w(I)),S=P.useRef(null),N=P.useRef(""),E=v.viewport,T=i.content-i.viewport,A=Zt(m),R=Zt(f),M=Ou(d,10);function C(I){if(S.current){const j=I.clientX-S.current.left,L=I.clientY-S.current.top;h({x:j,y:L})}}return P.useEffect(()=>{const I=j=>{const L=j.target;(x==null?void 0:x.contains(L))&&A(j,T)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,x,T,A]),P.useEffect(R,[i,R]),ps(x,M),ps(v.content,M),_.jsx(MM,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Zt(a),onThumbPointerUp:Zt(l),onThumbPositionChange:R,onThumbPointerDown:Zt(c),children:_.jsx(Rt.div,{...g,ref:k,style:{position:"absolute",...g.style},onPointerDown:St(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),S.current=x.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),C(I))}),onPointerMove:St(e.onPointerMove,C),onPointerUp:St(e.onPointerUp,I=>{const j=I.target;j.hasPointerCapture(I.pointerId)&&j.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})})})}),lu="ScrollAreaThumb",G1=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=Y1(lu,e.__scopeScrollArea);return _.jsx(Mr,{present:n||o.hasThumb,children:_.jsx(RM,{ref:t,...i})})}),RM=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...o}=e,a=rn(lu,n),l=Y1(lu,n),{onThumbPositionChange:c}=l,f=Ut(t,d=>l.onThumbChange(d)),h=P.useRef(void 0),m=Ou(()=>{h.current&&(h.current(),h.current=void 0)},100);return P.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(m(),!h.current){const v=DM(d,c);h.current=v,c()}};return c(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,m,c]),_.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)})});G1.displayName=lu;var hp="ScrollAreaCorner",X1=P.forwardRef((e,t)=>{const n=rn(hp,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?_.jsx(LM,{...e,ref:t}):null});X1.displayName=hp;var LM=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,o=rn(hp,n),[a,l]=P.useState(0),[c,f]=P.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?_.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 Q1(e,t){const n=e/t;return isNaN(n)?0:n}function Tu(e){const t=Q1(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function jM(e,t,n,i="ltr"){const o=Tu(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 J1([f,h],d)(e)}function jv(e,t,n="ltr"){const i=Tu(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=NM(e,f);return J1([0,l],[0,c])(h)}function J1(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 Z1(e,t){return e>0&&e<t}var DM=(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=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(i.current),[]),P.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 eb=W1,$M=H1,zM=X1;const tb=P.forwardRef(({className:e,children:t,...n},i)=>_.jsxs(eb,{ref:i,className:De("relative overflow-hidden",e),...n,children:[_.jsx($M,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(nb,{}),_.jsx(zM,{})]}));tb.displayName=eb.displayName;const nb=P.forwardRef(({className:e,orientation:t="vertical",...n},i)=>_.jsx(fp,{ref:i,orientation:t,className:De("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:_.jsx(G1,{className:"relative flex-1 rounded-full bg-border"})}));nb.displayName=fp.displayName;const Dv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$v=Fx,FM=(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,k]=x;return Array.isArray(k)?k.includes({...a,...c}[w]):{...a,...c}[w]===k})?[...h,d,g]:h},[]);return $v(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},BM=FM("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 VM({className:e,variant:t,...n}){return _.jsx("div",{className:De(BM({variant:t}),e),...n})}function Or(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 _h(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 WM({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",k=!m.effort,S=m.effort?void 0:d!=null&&d.effort?`from agent ${m.agent}`:n!=null&&n.effort?"project default":"model default";return _.jsx(bM,{open:!!e,onOpenChange:N=>!N&&t(),children:_.jsxs(z1,{side:"right",children:[_.jsx(F1,{children:_.jsxs(B1,{className:"flex items-center gap-2",children:[h&&_.jsx(VM,{variant:"agent",children:"agent"}),_.jsx("span",{className:h?"text-agent":void 0,children:e==null?void 0:e.id})]})}),_.jsx(tb,{className:"flex-1 p-4",children:e&&_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),_.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),_.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),h&&_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),m.agent&&_.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&&_.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[_.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),_.jsx("div",{className:"font-mono text-[12px] truncate",children:g}),v&&x&&_.jsx("div",{className:"text-[10px] text-mutedfg",children:x})]}),_.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),_.jsx("div",{className:"font-mono text-[12px]",children:w}),k&&S&&_.jsx("div",{className:"text-[10px] text-mutedfg",children:S})]})]}),(d==null?void 0:d.commands)&&d.commands.length>0&&_.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),_.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:[_.jsx("span",{className:"font-mono text-[12px]",children:N.name}),N.name===d.fallback&&_.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),N.description&&_.jsx("div",{className:"text-[11px] text-mutedfg",children:N.description})]},N.name))})]})]}),f&&f.totalTokens>0&&_.jsxs("div",{"data-testid":"node-usage",children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Token usage"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-x-4 gap-y-1 text-[12px]",children:[_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"total"}),_.jsx("span",{className:"font-mono font-medium",children:Or(f.totalTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cost"}),_.jsx("span",{className:"font-mono font-medium",children:_h(f.costUsd)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"input"}),_.jsx("span",{className:"font-mono",children:Or(f.inputTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"output"}),_.jsx("span",{className:"font-mono",children:Or(f.outputTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cache read"}),_.jsx("span",{className:"font-mono",children:Or(f.cacheReadTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cache write"}),_.jsx("span",{className:"font-mono",children:Or(f.cacheCreationTokens)})]})]})]}),c&&c.length>0&&_.jsxs("div",{"data-testid":"node-activity-log",children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent activity"}),_.jsx("div",{className:"mt-1 space-y-1.5",children:c.map((N,E)=>{if(N.kind==="tool_use"){const A=N.input!==void 0?JSON.stringify(N.input):"";return _.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded-md px-2.5 py-1.5 break-all",children:[_.jsxs("span",{className:"text-agent",children:["🔧 ",N.tool]}),A&&_.jsxs("span",{className:"text-mutedfg",children:[" ",A.length>200?A.slice(0,200)+"…":A]})]},E)}if(N.kind==="tool_result")return _.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2.5 break-all",children:["↳ ",N.text]},E);const T=N.kind==="thinking";return _.jsx("div",{className:`text-[12px] px-2.5 py-1 whitespace-pre-wrap break-words ${T?"text-mutedfg italic":"text-fg"}`,children:N.text},E)})})]}),(o||a!==void 0||l)&&_.jsxs("div",{"data-testid":"node-last-run",children:[_.jsxs("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg flex items-center gap-2",children:["Last run",o&&_.jsx("span",{className:`text-[11px] font-medium ${zv[o].cls}`,children:zv[o].label})]}),l&&_.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?_.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&&_.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."})]}),_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),_.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&&_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[_.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",_.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),_.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",_.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}const UM={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"}},HM=/https?:\/\/[^\s"')]+atlassian\.net[^\s"')]*/g;function qM(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 YM(e,t,n){if(!(!n||!t))return e==="page"?`https://${n}/wiki/pages/viewpage.action?pageId=${encodeURIComponent(t)}`:`https://${n}/browse/${encodeURIComponent(t)}`}function KM(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=UM[m.tool];if(!d)continue;const g=qM(m.input,d.field),x=(l=(((a=f[h+1])==null?void 0:a.kind)==="tool_result"?f[h+1].text??"":"").match(HM))==null?void 0:l[0];n.push({kind:d.kind,action:d.action,target:g,url:x??YM(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 th(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 GM={issue:"🪪",page:"📄",comment:"💬"};function XM({a:e}){if(e.kind==="tool_use"){const n=e.input!==void 0?Ch(JSON.stringify(e.input),160):"";return _.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded px-2 py-1 break-all",children:[_.jsxs("span",{className:"text-agent",children:["🔧 ",e.tool]}),n&&_.jsxs("span",{className:"text-mutedfg",children:[" ",n]})]})}if(e.kind==="tool_result")return _.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2 break-all",children:["↳ ",Ch(e.text??"")]});const t=e.kind==="thinking";return _.jsx("div",{className:De("text-[12px] px-2 py-0.5 whitespace-pre-wrap break-words",t?"text-mutedfg italic":"text-fg"),children:e.text})}function QM({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]=P.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=P.useMemo(()=>KM(d,o),[d,o]);return _.jsxs("aside",{className:"w-[48rem] max-w-[60vw] shrink-0 bg-bg border-l border-border flex flex-col",children:[_.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[_.jsxs("span",{className:"font-semibold tracking-tight truncate",title:t??e,children:["Runs · ",t??e??"all"]}),_.jsx("button",{onClick:a,className:"ml-auto text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),_.jsxs("div",{className:"flex-1 flex min-h-0",children:[_.jsxs("div",{className:"w-56 shrink-0 border-r border-border overflow-y-auto p-2 space-y-1",children:[l.length===0&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-2",children:"no runs yet"}),l.slice(0,60).map(x=>_.jsxs("button",{"data-testid":"scoped-run-row",onClick:()=>f(x.id),className:De("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:[_.jsx("span",{className:De("size-1.5 rounded-full flex-shrink-0",th(x.status))}),_.jsx("span",{className:"font-mono text-[11px] text-fg truncate",children:x.label??x.workflow}),x.usage&&x.usage.totalTokens>0&&_.jsx("span",{className:"font-mono text-[10px] text-agent ml-auto shrink-0",children:Or(x.usage.totalTokens)})]},x.id))]}),_.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-w-0","data-testid":"run-detail",children:[!m&&_.jsx("div",{className:"text-[12px] text-mutedfg",children:"select a run to see its breakdown"}),m&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:De("size-2 rounded-full",th(m.status))}),_.jsx("span",{className:"font-mono text-[13px] font-medium",children:m.label??m.workflow}),_.jsx("span",{className:"text-[11px] text-mutedfg",children:m.workflow})]}),_.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-mutedfg font-mono",children:[_.jsx("span",{children:m.status}),Fv(m)&&_.jsxs("span",{children:["· ",Fv(m)]}),m.usage&&m.usage.totalTokens>0&&_.jsxs("span",{children:["· ",Or(m.usage.totalTokens)," tok · ",_h(m.usage.costUsd)]})]}),m.error&&_.jsx("div",{className:"mt-1 text-[11px] text-fail font-mono break-all",children:m.error})]}),g.length>0&&_.jsxs("div",{"data-testid":"run-artifacts",children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Touched"}),_.jsx("div",{className:"mt-1 space-y-1",children:g.map((x,w)=>_.jsxs("div",{className:"text-[12px] flex items-center gap-1.5",children:[_.jsx("span",{children:GM[x.kind]??"•"}),_.jsx("span",{className:"text-mutedfg",children:x.action}),x.url?_.jsx("a",{href:x.url,target:"_blank",rel:"noreferrer",className:"font-mono text-agent hover:underline truncate",children:x.target??x.url}):_.jsx("span",{className:"font-mono text-fg truncate",children:x.target??"—"})]},w))})]}),_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent history"}),(!d||d.order.length===0)&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-1",children:"no detail retained"}),_.jsx("div",{className:"mt-1 space-y-2",children:d==null?void 0:d.order.map(x=>{const w=d.nodes[x];return w?_.jsxs("div",{className:"border border-border rounded-md",children:[_.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-muted/40 rounded-t-md",children:[_.jsx("span",{className:De("size-1.5 rounded-full",th(w.status))}),_.jsx("span",{className:"font-mono text-[12px] text-fg",children:x}),w.usage&&w.usage.totalTokens>0&&_.jsxs("span",{className:"font-mono text-[10px] text-agent ml-auto",children:[Or(w.usage.totalTokens)," tok · ",_h(w.usage.costUsd)]})]}),(w.activity.length>0||w.output||w.error)&&_.jsxs("div",{className:"px-2 py-1.5 space-y-1",children:[w.activity.map((k,S)=>_.jsx(XM,{a:k},S)),w.error&&_.jsxs("div",{className:"text-[11px] text-fail font-mono break-all",children:["error: ",w.error]}),w.activity.length===0&&w.output&&_.jsx("div",{className:"text-[11px] font-mono text-mutedfg break-all",children:Ch(w.output,400)})]})]},x):null})})]})]})]})]})]})}function JM(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 ZM({cache:e,onReload:t,onForget:n,onClose:i}){return _.jsxs("aside",{className:"w-96 shrink-0 bg-bg border-l border-border flex flex-col",children:[_.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[_.jsx("span",{className:"font-semibold tracking-tight",children:"Cache"}),_.jsxs("span",{className:"text-[11px] text-mutedfg",children:[e.seen.length," seen"]}),_.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[_.jsx("button",{onClick:t,className:"text-[11px] text-mutedfg hover:text-fg",title:"Refresh",children:"↻"}),_.jsx("button",{onClick:i,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[_.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."}),_.jsxs("div",{children:[_.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Seen (",e.seen.length,")"]}),e.seen.length===0&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"empty"}),_.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 _.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:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[l&&_.jsx("span",{className:"text-[9px] uppercase tracking-wide text-mutedfg bg-muted rounded px-1 py-0.5",children:l}),o.label&&_.jsx("span",{className:"font-mono text-[11px] text-fg",children:o.label}),_.jsx("span",{className:"font-mono text-[11px] text-mutedfg break-all",children:c})]}),o.ts&&_.jsxs("div",{className:"text-[10px] text-mutedfg",children:["seen ",JM(o.ts)]})]}),_.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&&_.jsxs("div",{children:[_.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Cursors (",e.cursors.length,")"]}),_.jsx("div",{className:"space-y-1",children:e.cursors.map(o=>_.jsxs("div",{className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[_.jsxs("span",{className:"font-mono text-[11px] text-fg break-all flex-1",children:[o.key," = ",o.value]}),_.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"),rb=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,Iu=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]===rb,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 ib=e=>(ze(e)||Je(e))&&!!e.anchor,ti=Symbol("break visit"),eR=Symbol("skip children"),Co=Symbol("remove node");function xs(e,t){const n=tR(t);Iu(e)?Qi(null,e.contents,n,Object.freeze([e]))===Co&&(e.contents=null):Qi(null,e,n,Object.freeze([]))}xs.BREAK=ti;xs.SKIP=eR;xs.REMOVE=Co;function Qi(e,t,n,i){const o=nR(e,t,n,i);if(Ze(o)||et(o))return rR(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 tR(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 nR(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 rR(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(Iu(i))i.contents=n;else{const o=ws(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const iR={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sR=e=>e.replace(/[!,[\]{}]/g,t=>iR[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+sR(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 sb(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 ob(e){const t=new Set;return xs(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function ab(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function oR(e,t){const n=[],i=new Map;let o=null;return{onAnchor:a=>{n.push(a),o??(o=ob(e));const l=ab(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||!ib(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(!Iu(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)||ib(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(sb(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 lb=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 aR="tag:yaml.org,2002:";function lR(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(Iu(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=aR+t.slice(2));let h=lR(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 cu(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 ub 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,cu(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,cu(this.schema,o,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${o}`)}}}const uR=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ri=(e,t,n)=>e.endsWith(`
|
|
129
|
+
`)?Xn(n,t):n.includes(`
|
|
130
|
+
`)?`
|
|
131
|
+
`+Xn(n,t):(e.endsWith(" ")?"":" ")+n,cb="flow",Oh="block",Yl="quoted";function Pu(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,k=-1,S=-1;n===Oh&&(w=Bv(e,w,t.length),w!==-1&&(d=w+f));for(let E;E=e[w+=1];){if(n===Yl&&E==="\\"){switch(k=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===Oh&&(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:k-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 N=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?N=`
|
|
135
|
+
${t}${e.slice(0,A)}`:(n===Yl&&m[T]&&(N+=`${e[T]}\\`),N+=`
|
|
136
|
+
${t}${e.slice(T+1,A)}`)}return N}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 Au=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Mu=e=>/^(%|---|\.\.\.)/m.test(e);function cR(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||(Mu(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:Pu(l,a,Yl,Au(t,!1))}function Ih(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||(Mu(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
143
|
+
${n}`)+"'";return t.implicitKey?i:Pu(i,n,cb,Au(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=Ih:a&&!o?i=To:i=n?Ih: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||Mu(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!cR(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,k,S=-1;for(k=0;k<n.length;++k){const A=n[k];if(A===" ")w=!0;else if(A===`
|
|
152
|
+
`)S=k;else break}let N=n.substring(0,S<k?S+1:k);N&&(n=n.substring(N.length),N=N.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=Au(i,!0);l!=="folded"&&t!==Te.BLOCK_FOLDED&&(M.onOverflow=()=>{R=!0});const C=Pu(`${N}${A}${v}`,h,Oh,M);if(!R)return`>${T}
|
|
154
|
+
${h}${C}`}return n=n.replace(/\n+/g,`$&${h}`),`|${T}
|
|
155
|
+
${h}${N}${n}${v}`}function fR(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(Mu(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 k;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((k=w.test)==null?void 0:k.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:Pu(d,f,cb,Au(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 Ih(l.value,t);case Te.PLAIN:return fR(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 fb(e,t){const n=Object.assign({blockQuote:!0,commentString:uR,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 dR(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 hR(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const o=[],a=(ze(e)||Je(e))&&e.anchor;a&&sb(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=dR(t.doc.schema.tags,a));const l=hR(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 pR({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,k=ms(e,n,()=>x=!0,()=>w=!0);if(!v&&!n.inFlow&&k.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(),k===""?"?":v?`? ${k}`:k}else if(a&&!d||t==null&&v)return k=`? ${k}`,g&&!x?k+=ri(k,n.indent,h(g)):w&&o&&o(),k;x&&(g=null),v?(g&&(k+=ri(k,n.indent,h(g))),k=`? ${k}
|
|
161
|
+
${c}:`):(k=`${k}:`,g&&(k+=ri(k,n.indent,h(g))));let S,N,E;Ze(t)?(S=!!t.spaceBefore,N=t.commentBefore,E=t.comment):(S=!1,N=null,E=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&ze(t)&&(n.indentAtStart=k.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||N){if(R=S?`
|
|
162
|
+
`:"",N){const M=h(N);R+=`
|
|
163
|
+
${Xn(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
|
+
`),I=C!==-1,j=n.inFlow??t.flow??t.items.length===0;if(I||!j){let L=!1;if(I&&(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 k+=R+A,n.inFlow?T&&i&&i():E&&!T?k+=ri(k,n.indent,h(E)):w&&o&&o(),k}function db(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Rl="<<",Jn={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:hb}),stringify:()=>Rl},mR=(e,t)=>(Jn.identify(t)||ze(t)&&(!t.type||t.type===Te.PLAIN)&&Jn.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Jn.tag&&n.default));function hb(e,t,n){const i=pb(e,n);if(Yo(i))for(const o of i.items)nh(e,t,o);else if(Array.isArray(i))for(const o of i)nh(e,t,o);else nh(e,t,i)}function nh(e,t,n){const i=pb(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 pb(e,t){return e&&ws(t)?t.resolve(e.doc,e):t}function mb(e,t,{key:n,value:i}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(mR(e,n))hb(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=gR(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 gR(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const i=fb(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)+'..."'),db(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:rb}),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 mb(n,i,this)}toString(t,n,i){return t!=null&&t.doc?pR(this,t,n,i):JSON.stringify(this)}}function gb(e,t,n){return(t.inFlow??e.flow?vR:yR)(e,t,n)}function yR({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 k=null;if(Ze(w))!d&&w.spaceBefore&&g.push(""),fu(n,g,w.commentBefore,d),w.comment&&(k=w.comment);else if(et(w)){const N=Ze(w.key)?w.key:null;N&&(!d&&N.spaceBefore&&g.push(""),fu(n,g,N.commentBefore,d))}d=!1;let S=ms(w,m,()=>k=null,()=>d=!0);k&&(S+=ri(S,a,h(k))),d&&k&&(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
|
+
`+Xn(h(e),f),c&&c()):d&&l&&l(),v}function vR({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 k=null;if(Ze(w))w.spaceBefore&&d.push(""),fu(t,d,w.commentBefore,!1),w.comment&&(k=w.comment);else if(et(w)){const N=Ze(w.key)?w.key:null;N&&(N.spaceBefore&&d.push(""),fu(t,d,N.commentBefore,!1),N.comment&&(h=!0));const E=Ze(w.value)?w.value:null;E?(E.comment&&(k=E.comment),E.commentBefore&&(h=!0)):w.value==null&&(N!=null&&N.comment)&&(k=N.comment)}k&&(h=!0);let S=ms(w,f,()=>k=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((N,E)=>N+E.length+2,2)+(S.length+2)>t.options.lineWidth)),h&&(S+=",")),k&&(S+=ri(S,i,c(k))),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,k)=>w+k.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 fu({indent:e,options:{commentString:t}},n,i,o){if(i&&o&&(i=i.replace(/^\n+/,"")),i){const a=Xn(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 ub{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)&&lb(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)mb(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})),gb(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 ub{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)&&lb(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?gb(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)},Ru={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)}},Lu={identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:e},t)=>typeof e=="string"&&Lu.test.test(e)?e:t.options.nullStr},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 yb={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},vb={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)}},wb={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},ju=e=>typeof e=="bigint"||Number.isInteger(e),xp=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function xb(e,t,n){const{value:i}=e;return ju(i)&&i>=0?n+i.toString(t):xn(e)}const bb={identify:e=>ju(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=>xb(e,8,"0o")},kb={identify:ju,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>xp(e,0,10,n),stringify:xn},Sb={identify:e=>ju(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=>xb(e,16,"0x")},wR=[bs,ks,Ru,Lu,wp,bb,kb,Sb,yb,vb,wb];function Vv(e){return typeof e=="bigint"||Number.isInteger(e)}const jl=({value:e})=>JSON.stringify(e),xR=[{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}],bR={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},kR=[bs,ks].concat(xR,bR),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 Eb(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 Nb(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:Eb,createNode:Nb};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=Nb(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=Eb(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 _b({value:e,source:t},n){return t&&(e?Cb:Tb).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Cb={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:_b},Tb={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:_b},SR={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},ER={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)}},NR={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 Du(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 _R={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Du(e,2,2,n),stringify:e=>Ep(e,2,"0b")},CR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Du(e,1,8,n),stringify:e=>Ep(e,8,"0")},TR={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Du(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)=>Du(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 Ib={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},Pb={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},$u={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($u.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,Ru,Lu,Cb,Tb,_R,CR,TR,OR,SR,ER,NR,bp,Jn,Sp,kp,Np,Ib,Pb,$u],Uv=new Map([["core",wR],["failsafe",[bs,ks,Ru]],["json",kR],["yaml11",Wv],["yaml-1.1",Wv]]),Hv={binary:bp,bool:wp,float:wb,floatExp:vb,floatNaN:yb,floatTime:Pb,int:kb,intHex:Sb,intOct:bb,intTime:Ib,map:bs,merge:Jn,null:Lu,omap:Sp,pairs:kp,seq:ks,set:Np,timestamp:$u},IR={"tag:yaml.org,2002:binary":bp,"tag:yaml.org,2002:merge":Jn,"tag:yaml.org,2002:omap":Sp,"tag:yaml.org,2002:pairs":kp,"tag:yaml.org,2002:set":Np,"tag:yaml.org,2002:timestamp":$u};function rh(e,t,n){const i=Uv.get(t);if(i&&!e)return n&&!i.includes(Jn)?i.concat(Jn):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(Jn)),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 PR=(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)?rh(t,"compat"):t?rh(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=o?IR:{},this.tags=rh(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,Pr,{value:bs}),Object.defineProperty(this,Mn,{value:Ru}),Object.defineProperty(this,vs,{value:ks}),this.sortMapEntries=typeof l=="function"?l:l===!0?PR:null}clone(){const t=Object.create(Cp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function AR(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=fb(e,t),{commentString:a}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=a(e.commentBefore);n.unshift(Xn(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(Xn(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(Xn(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(Xn(a(h),"")))}return n.join(`
|
|
182
|
+
`)+`
|
|
183
|
+
`}class zu{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(zu.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=ob(this);t.anchor=!n||i.has(n)?ab(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 k=N=>typeof N=="number"||N instanceof String||N instanceof Number,S=n.filter(k).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}=oR(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=cu(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=cu(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 AR(this,t)}}function Yi(e){if(Je(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Ab extends Error{constructor(t,n,i,o){super(),this.name=t,this.code=i,this.message=o,this.pos=n}}class Eo extends Ab{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class MR extends Ab{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,k=null,S=null,N=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 I=C.source.substring(1)||" ";d?d+=g+I:d=I,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,(k||S)&&(N=C),m=!0;break;case"anchor":k&&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),k=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:(k||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:k,tag:S,newlineAfterProp:N,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 Mb(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 RR({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,k=gs(g,{indicator:"explicit-key-ind",next:v??(x==null?void 0:x[0]),offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0}),S=!k.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)),!k.anchor&&!k.tag&&!x){h=k.end,k.comment&&(c.comment?c.comment+=`
|
|
190
|
+
`+k.comment:c.comment=k.comment);continue}(k.newlineAfterProp||zo(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=k.found)==null?void 0:m.indent)!==i.indent&&o(f,"BAD_INDENT",Yv);n.atKey=!0;const N=k.end,E=v?e(n,v,k,o):t(n,N,g,null,k,o);n.schema.compat&&Ah(i.indent,v,o),n.atKey=!1,Mb(n,c.items,E)&&o(N,"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&&k.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 LR({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 ih="Block collections are not allowed within flow collections",sh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function jR({composeNode:e,composeEmptyNode:t},n,i,o,a){var k;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 N=i.items[S],{start:E,key:T,sep:A,value:R}=N,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 I of E)switch(I.type){case"comma":case"space":break;case"comment":C=I.source.substring(1);break e;default:break e}if(C){let I=h.items[h.items.length-1];et(I)&&(I=I.value??I.key),I.comment?I.comment+=`
|
|
193
|
+
`+C:I.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],sh(R)&&o(C.range,"BLOCK_IN_FLOW",ih)}else{n.atKey=!0;const C=M.end,I=T?e(n,T,M,o):t(n,C,E,null,M,o);sh(T)&&o(I.range,"BLOCK_IN_FLOW",ih),n.atKey=!1;const j=gs(A??[],{flow:c,indicator:"map-value-ind",next:R,offset:I.range[2],onError:o,parentIndent:i.indent,startOnNewline:!1});if(j.found){if(!l&&!M.found&&n.options.strict){if(A)for(const Q of A){if(Q===j.found)break;if(Q.type==="newline"){o(Q,"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&&((k=R.source)==null?void 0:k[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?sh(R)&&o(L.range,"BLOCK_IN_FLOW",ih):j.comment&&(I.comment?I.comment+=`
|
|
194
|
+
`+j.comment:I.comment=j.comment);const D=new Et(I,L);if(n.options.keepSourceTokens&&(D.srcToken=N),l){const Q=h;Mb(n,Q.items,I)&&o(C,"DUPLICATE_KEY","Map keys must be unique"),Q.items.push(D)}else{const Q=new en(n.schema);Q.flow=!0,Q.items.push(D);const z=(L??I).range;Q.range=[I.range[0],z[1],z[2]],h.items.push(Q)}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),N=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",N),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 oh(e,t,n,i,o,a){const l=n.type==="block-map"?RR(e,t,n,i,a):n.type==="block-seq"?LR(e,t,n,i,a):jR(e,t,n,i,a),c=l.constructor;return o==="!"||o===c.tagName?(l.tag=c.tagName,l):(o&&(l.tag=o),l)}function DR(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 oh(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),oh(e,t,n,o,l)}const h=oh(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 $R(e,t,n){const i=t.offset,o=zR(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?FR(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const k=l[w][1];if(k===""||k==="\r")c=w;else break}if(c===0){const w=o.chomp==="+"&&l.length>0?`
|
|
196
|
+
`.repeat(Math.max(1,l.length-1)):"";let k=i+o.length;return t.source&&(k+=t.source.length),{value:w,type:a,comment:o.comment,range:[i,k,k]}}let f=t.indent+o.indent,h=t.offset+o.length,m=0;for(let w=0;w<c;++w){const[k,S]=l[w];if(S===""||S==="\r")o.indent===0&&k.length>f&&(f=k.length);else{k.length<f&&n(h+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(f=k.length),m=w,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=k.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[k,S]=l[w];h+=k.length+S.length+1;const N=S[S.length-1]==="\r";if(N&&(S=S.slice(0,-1)),S&&k.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-(N?2:1),"BAD_INDENT",T),k=""}a===Te.BLOCK_LITERAL?(d+=g+k.slice(f)+S,g=`
|
|
198
|
+
`):k.length>f||S[0]===" "?(g===" "?g=`
|
|
199
|
+
`:!v&&g===`
|
|
200
|
+
`&&(g=`
|
|
201
|
+
|
|
202
|
+
`),d+=g+k.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 zR({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 FR(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 BR(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=VR(a,h);break;case"single-quoted-scalar":c=Te.QUOTE_SINGLE,f=WR(a,h);break;case"double-quoted-scalar":c=Te.QUOTE_DOUBLE,f=UR(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 VR(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}`),Rb(e)}function WR(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Rb(e.slice(1,-1)).replace(/''/g,"'")}function Rb(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 UR(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}=HR(e,i);n+=a,i=l}else if(o==="\\"){let a=e[++i];const l=qR[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+=YR(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 HR(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 qR={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
225
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function YR(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 Lb(e,t,n,i){const{value:o,type:a,comment:l,range:c}=t.type==="block-scalar"?$R(e,t,i):BR(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=KR(e.schema,o,f,n,i):t.type==="scalar"?h=GR(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 KR(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 GR({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 XR(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 QR={composeNode:jb,composeEmptyNode:Tp};function jb(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=JR(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=Lb(e,t,f,i),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=DR(QR,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:XR(t,n,i),indent:-1,source:""},d=Lb(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 JR({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 ZR(e,t,{offset:n,start:i,value:o,end:a},l){const c=Object.assign({_directives:t},e),f=new zu(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?jb(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 eL{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 MR(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=ZR(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 zu(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 Db="\uFEFF",$b="",zb="",Mh="";function tL(e){switch(e){case Db:return"byte-order-mark";case $b:return"doc-mode";case zb: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"),nL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Dl=new Set(",[]{}"),rL=new Set(` ,[]{}
|
|
236
|
+
\r `),ah=e=>!e||rL.has(e);class iL{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]===Db&&(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 $b,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(ah),"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 zb,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(ah),"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(ah),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(nL.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 sL{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 Fb(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 du(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,Fb(t.value)?t.value.end?du(t.value.end,t.sep):t.value.end=t.sep:du(t.start,t.sep),delete t.sep)}class oL{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 iL,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=tL(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)){du(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(Fb(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)){du(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 aL(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new sL||null,prettyErrors:t}}function lL(e,t={}){const{lineCounter:n,prettyErrors:i}=aL(t),o=new oL(n==null?void 0:n.addNewLine),a=new eL(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 uL(e,t,n){let i;const o=lL(e,n);if(!o)return null;if(o.warnings.forEach(a=>db(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 cL=`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 fL(){const[e,t]=P.useState(null),[n,i]=P.useState(null),o=P.useCallback(c=>{try{const f=uL(c);t(f),i(null)}catch(f){i(f instanceof Error?f.message:"Failed to parse YAML")}},[]),a=P.useCallback(c=>{t(c),i(null)},[]),l=P.useCallback(()=>{o(cL)},[o]);return{workflow:e,error:n,loadFromString:o,loadFromObject:a,loadDefault:l}}const dL={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,costUsd:0};function hL(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 pL(e){const[t,n]=P.useState({}),[i,o]=P.useState({}),[a,l]=P.useState({}),[c,f]=P.useState({}),[h,m]=P.useState({}),[d,g]=P.useState({}),[v,x]=P.useState([]),[w,k]=P.useState(!1),[S,N]=P.useState([]),E=P.useRef(0),T=P.useRef(null),A=P.useRef(null),R=P.useCallback(M=>{N(I=>[...I,M]);const C=M.runId??T.current??void 0;if(M.type==="run:start"){const I=M.runId??`run_${(++E.current).toString(16).padStart(4,"0")}`;T.current=I,A.current=null,x(j=>[{id:I,workflow:M.workflow,label:M.label,status:"running",startedAt:M.ts},...j]),g(j=>({...j,[I]:{nodes:{},order:[]}})),n({}),o({}),l({}),f({}),m({})}else if(M.type==="node:start"&&M.nodeId)n(I=>({...I,[M.nodeId]:"running"})),C&&g(I=>{const j=I[C]??{nodes:{},order:[]};return j.nodes[M.nodeId]?I:{...I,[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 I=M.meta;I&&(f(j=>({...j,[M.nodeId]:[...j[M.nodeId]??[],I]})),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,I]}}}}}))}else if(M.type==="node:finish"&&M.nodeId){const I=M.status==="failed";n(L=>({...L,[M.nodeId]:I?"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:hL(D.usage??dL,j.usage)}:D))),I){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 Q=D.nodes[M.nodeId]??{nodeId:M.nodeId,status:"running",activity:[]};return{...L,[C]:{...D,nodes:{...D.nodes,[M.nodeId]:{...Q,status:I?"failed":"success",output:(j==null?void 0:j.output)??Q.output,error:I?j==null?void 0:j.error:Q.error,usage:(j==null?void 0:j.usage)??Q.usage}}}}})}else if(M.type==="run:finish"){const I=M.status==="failed"?"failed":"success",j=C,L=A.current??void 0;j&&x(D=>D.map(Q=>Q.id===j?{...Q,status:I,finishedAt:M.ts,error:I==="failed"?L:void 0}:Q))}},[]);return P.useEffect(()=>{if(!e)return;let M;try{M=new EventSource(`${e}/api/events`)}catch{return}return M.onopen=()=>k(!0),M.onmessage=C=>{try{const I=JSON.parse(C.data);R(I)}catch{}},M.onerror=()=>{k(!1)},()=>{M.close(),k(!1)}},[e,R]),{nodeStatuses:t,nodeErrors:i,nodeOutputs:a,nodeActivity:c,nodeUsage:h,runDetails:d,runs:v,connected:w,events:S}}function mL(e){const[t,n]=P.useState([]);return P.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 gL(e){const[t,n]=P.useState({});return P.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 yL(e){const[t,n]=P.useState(!1),[i,o]=P.useState(!1);return P.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 vL(e){const[t,n]=P.useState({});return P.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 wL(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 xL(e,t=0){const[n,i]=P.useState({seen:[],cursors:[]}),[o,a]=P.useState(0),l=()=>a(f=>f+1);return P.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())}}}const Nr=typeof window<"u"&&window.location.protocol.startsWith("http")?window.location.origin:void 0;function bL(){const{workflow:e,loadDefault:t,loadFromString:n,loadFromObject:i}=fL(),[o,a]=P.useState(null),[l,c]=P.useState(null),[f,h]=P.useState("none"),{nodeStatuses:m,nodeErrors:d,nodeOutputs:g,nodeActivity:v,nodeUsage:x,runDetails:w,runs:k,connected:S}=pL(Nr),{workflows:N}=mL(Nr),E=gL(Nr),T=vL(Nr),{paused:A,controllable:R,toggle:M}=yL(Nr),C=k.filter(B=>B.status!=="running").length,{cache:I,reload:j,forget:L}=xL(Nr,C);P.useEffect(()=>{if(N.length===0){t();return}const B=N.find(H=>H.name===l)??N[0];B.name!==l&&c(B.name),i(B)},[N,l,t,i]);const D=N.find(B=>B.name===l),Q=P.useCallback(B=>c(B),[]),z=P.useCallback((B,H)=>{Nr&&wL(Nr,B,H),h("runs")},[]),G=P.useCallback(B=>{l&&z(l,B)},[l,z]),Y=P.useCallback(B=>a(B),[]),Z=B=>h(H=>H===B?"none":B);return _.jsxs("div",{className:"h-screen w-screen flex overflow-hidden bg-muted text-fg font-sans text-[13px] antialiased relative",children:[_.jsx(zI,{liveConnected:S,workflows:N,selected:l,onSelect:Q,onRun:B=>z(B),version:E.version}),_.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[_.jsx(FI,{workflow:e,selected:D,dryRun:E.dryRun,paused:A,pauseControllable:R,onTogglePause:M,onLoadYaml:n,onRun:G,onToggleRuns:()=>Z("runs"),onToggleCache:()=>{j(),Z("cache")},runsOpen:f==="runs",cacheOpen:f==="cache"}),_.jsx("div",{className:"flex-1 flex min-h-0",children:_.jsx(Lx,{children:_.jsx(PP,{workflow:e,onNodeClick:Y,onLoadYaml:n,nodeStatuses:m})})})]}),f==="runs"&&_.jsx(QM,{workflowName:l??void 0,workflowTitle:D==null?void 0:D.title,runs:k,runDetails:w,atlassianSite:E.atlassianSite,onClose:()=>h("none")}),f==="cache"&&_.jsx(ZM,{cache:I,onReload:j,onForget:B=>void L(B),onClose:()=>h("none")}),_.jsx(WM,{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})]})}IS.createRoot(document.getElementById("root")).render(_.jsx(Rh.StrictMode,{children:_.jsx(bL,{})}));
|