@agentic-surfaces/server 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/assets/{index-CQrXDTe4.css → index-D-uLRZZ-.css} +1 -1
- package/dist/editor/assets/index-Vur7bXRy.js +298 -0
- package/dist/editor/index.html +2 -2
- package/dist/http.d.ts +10 -1
- package/dist/http.js +97 -13
- package/dist/serve.d.ts +4 -0
- package/dist/serve.js +8 -2
- package/dist/streaming-observer.d.ts +10 -1
- package/dist/streaming-observer.js +47 -5
- package/package.json +2 -2
- package/dist/editor/assets/index-C7_sNeWL.js +0 -298
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
var SS=Object.defineProperty;var ES=(e,t,n)=>t in e?SS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>ES(e,typeof t!="symbol"?t+"":t,n);function NS(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 _S(){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"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.iterator;function g($){return $===null||typeof $!="object"?null:($=h&&$[h]||$["@@iterator"],typeof $=="function"?$:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function b($,U,V){this.props=$,this.context=U,this.refs=w,this.updater=V||v}b.prototype.isReactComponent={},b.prototype.setState=function($,U){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,U,"setState")},b.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function E(){}E.prototype=b.prototype;function _($,U,V){this.props=$,this.context=U,this.refs=w,this.updater=V||v}var S=_.prototype=new E;S.constructor=_,x(S,b.prototype),S.isPureReactComponent=!0;var C=Array.isArray,A=Object.prototype.hasOwnProperty,M={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function T($,U,V){var W,Q={},re=null,oe=null;if(U!=null)for(W in U.ref!==void 0&&(oe=U.ref),U.key!==void 0&&(re=""+U.key),U)A.call(U,W)&&!D.hasOwnProperty(W)&&(Q[W]=U[W]);var ee=arguments.length-2;if(ee===1)Q.children=V;else if(1<ee){for(var se=Array(ee),de=0;de<ee;de++)se[de]=arguments[de+2];Q.children=se}if($&&$.defaultProps)for(W in ee=$.defaultProps,ee)Q[W]===void 0&&(Q[W]=ee[W]);return{$$typeof:e,type:$,key:re,ref:oe,props:Q,_owner:M.current}}function O($,U){return{$$typeof:e,type:$.type,key:U,ref:$.ref,props:$.props,_owner:$._owner}}function z($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function R($){var U={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(V){return U[V]})}var L=/\/+/g;function G($,U){return typeof $=="object"&&$!==null&&$.key!=null?R(""+$.key):U.toString(36)}function j($,U,V,W,Q){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=$,Q=Q(oe),$=W===""?"."+G(oe,0):W,C(Q)?(V="",$!=null&&(V=$.replace(L,"$&/")+"/"),j(Q,U,V,"",function(de){return de})):Q!=null&&(z(Q)&&(Q=O(Q,V+(!Q.key||oe&&oe.key===Q.key?"":(""+Q.key).replace(L,"$&/")+"/")+$)),U.push(Q)),1;if(oe=0,W=W===""?".":W+":",C($))for(var ee=0;ee<$.length;ee++){re=$[ee];var se=W+G(re,ee);oe+=j(re,U,V,se,Q)}else if(se=g($),typeof se=="function")for($=se.call($),ee=0;!(re=$.next()).done;)re=re.value,se=W+G(re,ee++),oe+=j(re,U,V,se,Q);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 X($,U,V){if($==null)return $;var W=[],Q=0;return j($,W,"","",function(re){return U.call(V,re,Q++)}),W}function Y($){if($._status===-1){var U=$._result;U=U(),U.then(function(V){($._status===0||$._status===-1)&&($._status=1,$._result=V)},function(V){($._status===0||$._status===-1)&&($._status=2,$._result=V)}),$._status===-1&&($._status=0,$._result=U)}if($._status===1)return $._result.default;throw $._result}var Z={current:null},q={transition:null},H={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:q,ReactCurrentOwner:M};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:X,forEach:function($,U,V){X($,function(){U.apply(this,arguments)},V)},count:function($){var U=0;return X($,function(){U++}),U},toArray:function($){return X($,function(U){return U})||[]},only:function($){if(!z($))throw Error("React.Children.only expected to receive a single React element child.");return $}},Ie.Component=b,Ie.Fragment=n,Ie.Profiler=o,Ie.PureComponent=_,Ie.StrictMode=i,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,Ie.act=B,Ie.cloneElement=function($,U,V){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var W=x({},$.props),Q=$.key,re=$.ref,oe=$._owner;if(U!=null){if(U.ref!==void 0&&(re=U.ref,oe=M.current),U.key!==void 0&&(Q=""+U.key),$.type&&$.type.defaultProps)var ee=$.type.defaultProps;for(se in U)A.call(U,se)&&!D.hasOwnProperty(se)&&(W[se]=U[se]===void 0&&ee!==void 0?ee[se]:U[se])}var se=arguments.length-2;if(se===1)W.children=V;else if(1<se){ee=Array(se);for(var de=0;de<se;de++)ee[de]=arguments[de+2];W.children=ee}return{$$typeof:e,type:$.type,key:Q,ref:re,props:W,_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=T,Ie.createFactory=function($){var U=T.bind(null,$);return U.type=$,U},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function($){return{$$typeof:c,render:$}},Ie.isValidElement=z,Ie.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:Y}},Ie.memo=function($,U){return{$$typeof:d,type:$,compare:U===void 0?null:U}},Ie.startTransition=function($){var U=q.transition;q.transition={};try{$()}finally{q.transition=U}},Ie.unstable_act=B,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,V){return Z.current.useImperativeHandle($,U,V)},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,V){return Z.current.useReducer($,U,V)},Ie.useRef=function($){return Z.current.useRef($)},Ie.useState=function($){return Z.current.useState($)},Ie.useSyncExternalStore=function($,U,V){return Z.current.useSyncExternalStore($,U,V)},Ie.useTransition=function(){return Z.current.useTransition()},Ie.version="18.3.1",Ie}var Jg;function Fo(){return Jg||(Jg=1,Rf.exports=_S()),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 CS(){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,d){var m,h={},g=null,v=null;d!==void 0&&(g=""+d),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(v=f.ref);for(m in f)i.call(f,m)&&!a.hasOwnProperty(m)&&(h[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)h[m]===void 0&&(h[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:v,props:h,_owner:o.current}}return ho.Fragment=n,ho.jsx=l,ho.jsxs=l,ho}var ey;function TS(){return ey||(ey=1,Mf.exports=CS()),Mf.exports}var N=TS(),I=Fo();const Rh=hu(I),Lh=NS({__proto__:null,default:Rh},[I]);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 OS(){return ty||(ty=1,(function(e){function t(q,H){var B=q.length;q.push(H);e:for(;0<B;){var $=B-1>>>1,U=q[$];if(0<o(U,H))q[$]=H,q[B]=U,B=$;else break e}}function n(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var H=q[0],B=q.pop();if(B!==H){q[0]=B;e:for(var $=0,U=q.length,V=U>>>1;$<V;){var W=2*($+1)-1,Q=q[W],re=W+1,oe=q[re];if(0>o(Q,B))re<U&&0>o(oe,Q)?(q[$]=oe,q[re]=B,$=re):(q[$]=Q,q[W]=B,$=W);else if(re<U&&0>o(oe,B))q[$]=oe,q[re]=B,$=re;else break e}}return H}function o(q,H){var B=q.sortIndex-H.sortIndex;return B!==0?B:q.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=[],d=[],m=1,h=null,g=3,v=!1,x=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(q){for(var H=n(d);H!==null;){if(H.callback===null)i(d);else if(H.startTime<=q)i(d),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(d)}}function C(q){if(w=!1,S(q),!x)if(n(f)!==null)x=!0,Y(A);else{var H=n(d);H!==null&&Z(C,H.startTime-q)}}function A(q,H){x=!1,w&&(w=!1,E(T),T=-1),v=!0;var B=g;try{for(S(H),h=n(f);h!==null&&(!(h.expirationTime>H)||q&&!R());){var $=h.callback;if(typeof $=="function"){h.callback=null,g=h.priorityLevel;var U=$(h.expirationTime<=H);H=e.unstable_now(),typeof U=="function"?h.callback=U:h===n(f)&&i(f),S(H)}else i(f);h=n(f)}if(h!==null)var V=!0;else{var W=n(d);W!==null&&Z(C,W.startTime-H),V=!1}return V}finally{h=null,g=B,v=!1}}var M=!1,D=null,T=-1,O=5,z=-1;function R(){return!(e.unstable_now()-z<O)}function L(){if(D!==null){var q=e.unstable_now();z=q;var H=!0;try{H=D(!0,q)}finally{H?G():(M=!1,D=null)}}else M=!1}var G;if(typeof _=="function")G=function(){_(L)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,X=j.port2;j.port1.onmessage=L,G=function(){X.postMessage(null)}}else G=function(){b(L,0)};function Y(q){D=q,M||(M=!0,G())}function Z(q,H){T=b(function(){q(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(q){q.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,Y(A))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(q){switch(g){case 1:case 2:case 3:var H=3;break;default:H=g}var B=g;g=H;try{return q()}finally{g=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,H){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var B=g;g=q;try{return H()}finally{g=B}},e.unstable_scheduleCallback=function(q,H,B){var $=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?$+B:$):B=$,q){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=B+U,q={id:m++,callback:H,priorityLevel:q,startTime:B,expirationTime:U,sortIndex:-1},B>$?(q.sortIndex=B,t(d,q),n(f)===null&&q===n(d)&&(w?(E(T),T=-1):w=!0,Z(C,B-$))):(q.sortIndex=U,t(f,q),x||v||(x=!0,Y(A))),q},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(q){var H=g;return function(){var B=g;g=H;try{return q.apply(this,arguments)}finally{g=B}}}})(Df)),Df}var ny;function IS(){return ny||(ny=1,jf.exports=OS()),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 PS(){if(ry)return At;ry=1;var e=Fo(),t=IS();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,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},h={};function g(r){return f.call(h,r)?!0:f.call(m,r)?!1:d.test(r)?h[r]=!0:(m[r]=!0,!1)}function v(r,s,u,p){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,s,u,p){if(s===null||typeof s>"u"||v(r,s,u,p))return!0;if(p)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(r,s,u,p,y,k,P){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=k,this.removeEmptyString=P}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){b[r]=new w(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];b[s]=new w(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){b[r]=new w(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){b[r]=new w(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){b[r]=new w(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){b[r]=new w(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){b[r]=new w(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){b[r]=new w(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){b[r]=new w(r,5,!1,r.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function _(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(E,_);b[s]=new w(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(E,_);b[s]=new w(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(E,_);b[s]=new w(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!0,!0)});function S(r,s,u,p){var y=b.hasOwnProperty(s)?b[s]:null;(y!==null?y.type!==0:p||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(x(s,u,y,p)&&(u=null),p||y===null?g(s)&&(u===null?r.removeAttribute(s):r.setAttribute(s,""+u)):y.mustUseProperty?r[y.propertyName]=u===null?y.type===3?!1:"":u:(s=y.attributeName,p=y.attributeNamespace,u===null?r.removeAttribute(s):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,p?r.setAttributeNS(p,s,u):r.setAttribute(s,u))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),R=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),q=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var B=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 V=!1;function W(r,s){if(!r||V)return"";V=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(ie){var p=ie}Reflect.construct(r,[],s)}else{try{s.call()}catch(ie){p=ie}r.call(s.prototype)}else{try{throw Error()}catch(ie){p=ie}r()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var y=ie.stack.split(`
|
|
35
|
+
`),k=p.stack.split(`
|
|
36
|
+
`),P=y.length-1,F=k.length-1;1<=P&&0<=F&&y[P]!==k[F];)F--;for(;1<=P&&0<=F;P--,F--)if(y[P]!==k[F]){if(P!==1||F!==1)do if(P--,F--,0>F||y[P]!==k[F]){var K=`
|
|
37
|
+
`+y[P].replace(" at new "," at ");return r.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",r.displayName)),K}while(1<=P&&0<=F);break}}}finally{V=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?U(r):""}function Q(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=W(r.type,!1),r;case 11:return r=W(r.type.render,!1),r;case 1:return r=W(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 D:return"Fragment";case M:return"Portal";case O:return"Profiler";case T:return"StrictMode";case G:return"Suspense";case j:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case R:return(r.displayName||"Context")+".Consumer";case z:return(r._context.displayName||"Context")+".Provider";case L:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case X: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===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ee(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function se(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function de(r){var s=se(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),p=""+r[s];if(!r.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,k=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(P){p=""+P,k.call(this,P)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(P){p=""+P},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 B({},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&&S(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 Dn(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},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 $n(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=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function 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,nr=null,rr=null;function Zo(r){if(r=Qs(r)){if(typeof Cs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Oa(s),Cs(r.stateNode,r.type,s))}}function ea(r){nr?rr?rr.push(r):rr=[r]:nr=r}function ta(){if(nr){var r=nr,s=rr;if(rr=nr=null,Zo(r),s)for(r=0;r<s.length;r++)Zo(s[r])}}function na(r,s){return r(s)}function ra(){}var Ts=!1;function ia(r,s,u){if(Ts)return r(s,u);Ts=!0;try{return na(r,s,u)}finally{Ts=!1,(nr!==null||rr!==null)&&(ra(),ta())}}function Lr(r,s){var u=r.stateNode;if(u===null)return null;var p=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,k,P,F,K){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,k,P,F,K){Dr=!1,pi=null,Vu.apply(Wu,arguments)}function Hu(r,s,u,p,y,k,P,F,K){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 k=y.alternate;if(k===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===k.child){for(k=y.child;k;){if(k===u)return As(y),r;if(k===p)return As(y),s;k=k.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=k;else{for(var P=!1,F=y.child;F;){if(F===u){P=!0,u=y,p=k;break}if(F===p){P=!0,p=y,u=k;break}F=F.sibling}if(!P){for(F=k.child;F;){if(F===u){P=!0,u=k,p=y;break}if(F===p){P=!0,p=k,u=y;break}F=F.sibling}if(!P)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 zn(r,s){var u=r.pendingLanes;if(u===0)return 0;var p=0,y=r.suspendedLanes,k=r.pingedLanes,P=u&268435455;if(P!==0){var F=P&~y;F!==0?p=$r(F):(k&=P,k!==0&&(p=$r(k)))}else P=u&~y,P!==0?p=$r(P):k!==0&&(p=$r(k));if(p===0)return 0;if(s!==0&&s!==p&&(s&y)===0&&(y=p&-p,k=s&-s,y>=k||y===16&&(k&4194240)!==0))return s;if((p&4)!==0&&(p|=u&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=p;0<s;)u=31-Dt(s),y=1<<u,p|=r[u],s&=~y;return p}function 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,k=r.pendingLanes;0<k;){var P=31-Dt(k),F=1<<P,K=y[P];K===-1?((F&u)===0||(F&p)!==0)&&(y[P]=ec(F,s)):K<=s&&(r.expiredLanes|=F),k&=~F}}function Rs(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function ha(){var r=vi;return vi<<=1,(vi&4194240)===0&&(vi=64),r}function zr(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function Fr(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Dt(s),r[s]=u}function 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),k=1<<y;s[y]=0,p[y]=-1,r[y]=-1,u&=~k}}function xi(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var p=31-Dt(u),y=1<<p;y&s|r[p]&s&&(r[p]|=s),u&=~y}}var De=0;function 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=[],ir=null,sr=null,or=null,Ls=new Map,js=new Map,ar=[],Hb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rp(r,s){switch(r){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ls.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(s.pointerId)}}function Ds(r,s,u,p,y,k){return r===null||r.nativeEvent!==k?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:k,targetContainers:[y]},s!==null&&(s=Qs(s),s!==null&&nc(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),r)}function qb(r,s,u,p,y){switch(s){case"focusin":return ir=Ds(ir,r,s,u,p,y),!0;case"dragenter":return sr=Ds(sr,r,s,u,p,y),!0;case"mouseover":return or=Ds(or,r,s,u,p,y),!0;case"pointerover":var k=y.pointerId;return Ls.set(k,Ds(Ls.get(k)||null,r,s,u,p,y)),!0;case"gotpointercapture":return k=y.pointerId,js.set(k,Ds(js.get(k)||null,r,s,u,p,y)),!0}return!1}function Lp(r){var s=Br(r.target);if(s!==null){var u=Sn(s);if(u!==null){if(s=u.tag,s===13){if(s=Ps(u),s!==null){r.blockedOn=s,Mp(r.priority,function(){Pp(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ma(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=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 Yb(){rc=!1,ir!==null&&ma(ir)&&(ir=null),sr!==null&&ma(sr)&&(sr=null),or!==null&&ma(or)&&(or=null),Ls.forEach(jp),js.forEach(jp)}function $s(r,s){r.blockedOn===s&&(r.blockedOn=null,rc||(rc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yb)))}function zs(r){function s(y){return $s(y,r)}if(0<pa.length){$s(pa[0],r);for(var u=1;u<pa.length;u++){var p=pa[u];p.blockedOn===r&&(p.blockedOn=null)}}for(ir!==null&&$s(ir,r),sr!==null&&$s(sr,r),or!==null&&$s(or,r),Ls.forEach(s),js.forEach(s),u=0;u<ar.length;u++)p=ar[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<ar.length&&(u=ar[0],u.blockedOn===null);)Lp(u),u.blockedOn===null&&ar.shift()}var bi=C.ReactCurrentBatchConfig,ga=!0;function Kb(r,s,u,p){var y=De,k=bi.transition;bi.transition=null;try{De=1,ic(r,s,u,p)}finally{De=y,bi.transition=k}}function Gb(r,s,u,p){var y=De,k=bi.transition;bi.transition=null;try{De=4,ic(r,s,u,p)}finally{De=y,bi.transition=k}}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(qb(y,r,s,u,p))p.stopPropagation();else if(Rp(r,p),s&4&&-1<Hb.indexOf(r)){for(;y!==null;){var k=Qs(y);if(k!==null&&Ip(k),k=sc(r,s,u,p),k===null&&kc(r,s,p,ya,u),k===y)break;y=k}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 lr=null,oc=null,va=null;function $p(){if(va)return va;var r,s=oc,u=s.length,p,y="value"in lr?lr.value:lr.textContent,k=y.length;for(r=0;r<u&&s[r]===y[r];r++);var P=u-r;for(p=1;p<=P&&s[u-p]===y[k-p];p++);return va=y.slice(r,1<p?1-p:void 0)}function wa(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function xa(){return!0}function zp(){return!1}function $t(r){function s(u,p,y,k,P){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=k,this.target=P,this.currentTarget=null;for(var F in r)r.hasOwnProperty(F)&&(u=r[F],this[F]=u?u(k):k[F]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?xa:zp,this.isPropagationStopped=zp,this}return B(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=B({},ki,{view:0,detail:0}),Xb=$t(Fs),lc,uc,Bs,ba=B({},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),Qb=B({},ba,{dataTransfer:0}),Jb=$t(Qb),Zb=B({},Fs,{relatedTarget:0}),cc=$t(Zb),ek=B({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),tk=$t(ek),nk=B({},ki,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),rk=$t(nk),ik=B({},ki,{data:0}),Bp=$t(ik),sk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ok={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"},ak={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lk(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=ak[r])?!!s[r]:!1}function fc(){return lk}var uk=B({},Fs,{key:function(r){if(r.key){var s=sk[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"?ok[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}}),ck=$t(uk),fk=B({},ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vp=$t(fk),dk=B({},Fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),hk=$t(dk),pk=B({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),mk=$t(pk),gk=B({},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}),yk=$t(gk),vk=[9,13,27,32],dc=c&&"CompositionEvent"in window,Vs=null;c&&"documentMode"in document&&(Vs=document.documentMode);var wk=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 vk.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 xk(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 bk(r,s){if(Si)return r==="compositionend"||!dc&&qp(r,s)?(r=$p(),va=oc=lr=null,Si=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Wp&&s.locale!=="ko"?null:s.data;default:return null}}var kk={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"?!!kk[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 Sk(r){hm(r,0)}function ka(r){var s=Ti(r);if(he(s))return r}function Ek(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(Sk,s)}}function Nk(r,s,u){r==="focusin"?(Jp(),Ws=s,Us=u,Ws.attachEvent("onpropertychange",Zp)):r==="focusout"&&Jp()}function _k(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ka(Us)}function Ck(r,s){if(r==="click")return ka(s)}function Tk(r,s){if(r==="input"||r==="change")return ka(s)}function Ok(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var sn=typeof Object.is=="function"?Object.is:Ok;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 Ik(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,k=Math.min(p.start,y);p=p.end===void 0?k:Math.min(p.end,y),!r.extend&&k>p&&(y=p,p=k,k=y),y=tm(u,k);var P=tm(u,p);y&&P&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==P.node||r.focusOffset!==P.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),r.removeAllRanges(),k>p?(r.addRange(s),r.extend(P.node,P.offset)):(s.setEnd(P.node,P.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 Pk=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 ur(r,s){cm.set(r,s),a(s,[r])}for(var wc=0;wc<fm.length;wc++){var xc=fm[wc],Ak=xc.toLowerCase(),Mk=xc[0].toUpperCase()+xc.slice(1);ur(Ak,"on"+Mk)}ur(om,"onAnimationEnd"),ur(am,"onAnimationIteration"),ur(lm,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(um,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Rk=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 k=void 0;if(s)for(var P=p.length-1;0<=P;P--){var F=p[P],K=F.instance,ie=F.currentTarget;if(F=F.listener,K!==k&&y.isPropagationStopped())break e;dm(y,F,ie),k=K}else for(P=0;P<p.length;P++){if(F=p[P],K=F.instance,ie=F.currentTarget,F=F.listener,K!==k&&y.isPropagationStopped())break e;dm(y,F,ie),k=K}}}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"&&(Rk.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=Kb;break;case 4:y=Gb;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 k=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var P=p.tag;if(P===3||P===4){var F=p.stateNode.containerInfo;if(F===y||F.nodeType===8&&F.parentNode===y)break;if(P===4)for(P=p.return;P!==null;){var K=P.tag;if((K===3||K===4)&&(K=P.stateNode.containerInfo,K===y||K.nodeType===8&&K.parentNode===y))return;P=P.return}for(;F!==null;){if(P=Br(F),P===null)return;if(K=P.tag,K===5||K===6){p=k=P;continue e}F=F.parentNode}}p=p.return}ia(function(){var ie=k,le=_s(u),ue=[];e:{var ae=cm.get(r);if(ae!==void 0){var pe=ac,ve=r;switch(r){case"keypress":if(wa(u)===0)break e;case"keydown":case"keyup":pe=ck;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=Jb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=hk;break;case om:case am:case lm:pe=tk;break;case um:pe=mk;break;case"scroll":pe=Xb;break;case"wheel":pe=yk;break;case"copy":case"cut":case"paste":pe=rk;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 J=ie,ne;J!==null;){ne=J;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Lr(J,te),ce!=null&&we.push(Gs(J,ce,ne)))),Qe)break;J=J.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[Fn]))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",J="mouse",(r==="pointerout"||r==="pointerover")&&(we=Vp,ce="onPointerLeave",te="onPointerEnter",J="pointer"),Qe=pe==null?ae:Ti(pe),ne=ve==null?ae:Ti(ve),ae=new we(ce,J+"leave",pe,u,le),ae.target=Qe,ae.relatedTarget=ne,ce=null,Br(le)===ie&&(we=new we(te,J+"enter",ve,u,le),we.target=ne,we.relatedTarget=Qe,ce=we),Qe=ce,pe&&ve)t:{for(we=pe,te=ve,J=0,ne=we;ne;ne=_i(ne))J++;for(ne=0,ce=te;ce;ce=_i(ce))ne++;for(;0<J-ne;)we=_i(we),J--;for(;0<ne-J;)te=_i(te),ne--;for(;J--;){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=Ek;else if(Kp(ae))if(Xp)be=Tk;else{be=_k;var Ee=Nk}else(pe=ae.nodeName)&&pe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(be=Ck);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(Pk)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()):(lr=le,oc="value"in lr?lr.value:lr.textContent,Si=!0)),Ee=_a(ie,Ce),0<Ee.length&&(Ce=new Bp(Ce,r,null,u,le),ue.push({event:Ce,listeners:Ee}),Ne?Ce.data=Ne:(Ne=Yp(u),Ne!==null&&(Ce.data=Ne)))),(Ne=wk?xk(r,u):bk(r,u))&&(ie=_a(ie,"onBeforeInput"),0<ie.length&&(le=new Bp("onBeforeInput","beforeinput",null,u,le),ue.push({event:le,listeners:ie}),le.data=Ne))}hm(ue,s)})}function Gs(r,s,u){return{instance:r,listener:s,currentTarget:u}}function _a(r,s){for(var u=s+"Capture",p=[];r!==null;){var y=r,k=y.stateNode;y.tag===5&&k!==null&&(y=k,k=Lr(r,u),k!=null&&p.unshift(Gs(r,k,y)),k=Lr(r,s),k!=null&&p.push(Gs(r,k,y))),r=r.return}return p}function _i(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function mm(r,s,u,p,y){for(var k=s._reactName,P=[];u!==null&&u!==p;){var F=u,K=F.alternate,ie=F.stateNode;if(K!==null&&K===p)break;F.tag===5&&ie!==null&&(F=ie,y?(K=Lr(u,k),K!=null&&P.unshift(Gs(u,K,F))):y||(K=Lr(u,k),K!=null&&P.push(Gs(u,K,F)))),u=u.return}P.length!==0&&r.push({event:s,listeners:P})}var Lk=/\r\n?/g,jk=/\u0000|\uFFFD/g;function gm(r){return(typeof r=="string"?r:""+r).replace(Lk,`
|
|
38
|
+
`).replace(jk,"")}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,Dk=typeof clearTimeout=="function"?clearTimeout:void 0,ym=typeof Promise=="function"?Promise:void 0,$k=typeof queueMicrotask=="function"?queueMicrotask:typeof ym<"u"?function(r){return ym.resolve(null).then(r).catch(zk)}:_c;function zk(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 cr(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function vm(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return r;s--}else u==="/$"&&s++}r=r.previousSibling}return null}var Ci=Math.random().toString(36).slice(2),En="__reactFiber$"+Ci,Xs="__reactProps$"+Ci,Fn="__reactContainer$"+Ci,Tc="__reactEvents$"+Ci,Fk="__reactListeners$"+Ci,Bk="__reactHandles$"+Ci;function Br(r){var s=r[En];if(s)return s;for(var u=r.parentNode;u;){if(s=u[Fn]||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[Fn],!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 fr(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 dr={},mt=fr(dr),Ct=fr(!1),Vr=dr;function Ii(r,s){var u=r.type.contextTypes;if(!u)return dr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var y={},k;for(k in u)y[k]=s[k];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Ia(){Ve(Ct),Ve(mt)}function wm(r,s,u){if(mt.current!==dr)throw Error(n(168));$e(mt,s),$e(Ct,u)}function xm(r,s,u){var p=r.stateNode;if(s=s.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var y in p)if(!(y in s))throw Error(n(108,oe(r)||"Unknown",y));return B({},u,p)}function Pa(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||dr,Vr=mt.current,$e(mt,r),$e(Ct,Ct.current),!0}function bm(r,s,u){var p=r.stateNode;if(!p)throw Error(n(169));u?(r=xm(r,s,Vr),p.__reactInternalMemoizedMergedChildContext=r,Ve(Ct),Ve(mt),$e(mt,r)):Ve(Ct),$e(Ct,u)}var Bn=null,Aa=!1,Ic=!1;function km(r){Bn===null?Bn=[r]:Bn.push(r)}function Vk(r){Aa=!0,km(r)}function hr(){if(!Ic&&Bn!==null){Ic=!0;var r=0,s=De;try{var u=Bn;for(De=1;r<u.length;r++){var p=u[r];do p=p(!0);while(p!==null)}Bn=null,Aa=!1}catch(y){throw Bn!==null&&(Bn=Bn.slice(r+1)),aa(Ms,hr),y}finally{De=s,Ic=!1}}return null}var Pi=[],Ai=0,Ma=null,Ra=0,Yt=[],Kt=0,Wr=null,Vn=1,Wn="";function Ur(r,s){Pi[Ai++]=Ra,Pi[Ai++]=Ma,Ma=r,Ra=s}function Sm(r,s,u){Yt[Kt++]=Vn,Yt[Kt++]=Wn,Yt[Kt++]=Wr,Wr=r;var p=Vn;r=Wn;var y=32-Dt(p)-1;p&=~(1<<y),u+=1;var k=32-Dt(s)+y;if(30<k){var P=y-y%5;k=(p&(1<<P)-1).toString(32),p>>=P,y-=P,Vn=1<<32-Dt(s)+y|u<<y|p,Wn=k+r}else Vn=1<<k|u<<y|p,Wn=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,Wn=Yt[--Kt],Yt[Kt]=null,Vn=Yt[--Kt],Yt[Kt]=null}var zt=null,Ft=null,Ue=!1,on=null;function Em(r,s){var u=Jt(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=r,s=r.deletions,s===null?(r.deletions=[u],r.flags|=16):s.push(u)}function Nm(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,zt=r,Ft=cr(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,zt=r,Ft=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=Wr!==null?{id:Vn,overflow:Wn}: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=cr(u.nextSibling);var p=zt;s&&Nm(r,s)?Em(p,u):(r.flags=r.flags&-4097|2,Ue=!1,zt=r)}}else{if(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=cr(s.nextSibling)}if(_m(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){Ft=cr(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Ft=null}}else Ft=zt?cr(r.stateNode.nextSibling):null;return!0}function Cm(){for(var r=Ft;r;)r=cr(r.nextSibling)}function Mi(){Ft=zt=null,Ue=!1}function Lc(r){on===null?on=[r]:on.push(r)}var Wk=C.ReactCurrentBatchConfig;function Js(r,s,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var p=u.stateNode}if(!p)throw Error(n(147,r));var y=p,k=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===k?s.ref:(s=function(P){var F=y.refs;P===null?delete F[k]:F[k]=P},s._stringRef=k,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function ja(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Tm(r){var s=r._init;return s(r._payload)}function Om(r){function s(te,J){if(r){var ne=te.deletions;ne===null?(te.deletions=[J],te.flags|=16):ne.push(J)}}function u(te,J){if(!r)return null;for(;J!==null;)s(te,J),J=J.sibling;return null}function p(te,J){for(te=new Map;J!==null;)J.key!==null?te.set(J.key,J):te.set(J.index,J),J=J.sibling;return te}function y(te,J){return te=br(te,J),te.index=0,te.sibling=null,te}function k(te,J,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<J?(te.flags|=2,J):ne):(te.flags|=2,J)):(te.flags|=1048576,J)}function P(te){return r&&te.alternate===null&&(te.flags|=2),te}function F(te,J,ne,ce){return J===null||J.tag!==6?(J=Cf(ne,te.mode,ce),J.return=te,J):(J=y(J,ne),J.return=te,J)}function K(te,J,ne,ce){var be=ne.type;return be===D?le(te,J,ne.props.children,ce,ne.key):J!==null&&(J.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===J.type)?(ce=y(J,ne.props),ce.ref=Js(te,J,ne),ce.return=te,ce):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,J,ne),ce.return=te,ce)}function ie(te,J,ne,ce){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=Tf(ne,te.mode,ce),J.return=te,J):(J=y(J,ne.children||[]),J.return=te,J)}function le(te,J,ne,ce,be){return J===null||J.tag!==7?(J=Jr(ne,te.mode,ce,be),J.return=te,J):(J=y(J,ne),J.return=te,J)}function ue(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Cf(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return ne=ol(J.type,J.key,J.props,null,te.mode,ne),ne.ref=Js(te,null,J),ne.return=te,ne;case M:return J=Tf(J,te.mode,ne),J.return=te,J;case Y:var ce=J._init;return ue(te,ce(J._payload),ne)}if(ht(J)||H(J))return J=Jr(J,te.mode,ne,null),J.return=te,J;ja(te,J)}return null}function ae(te,J,ne,ce){var be=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:F(te,J,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===be?K(te,J,ne,ce):null;case M:return ne.key===be?ie(te,J,ne,ce):null;case Y:return be=ne._init,ae(te,J,be(ne._payload),ce)}if(ht(ne)||H(ne))return be!==null?null:le(te,J,ne,ce,null);ja(te,ne)}return null}function pe(te,J,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,F(J,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,K(J,te,ce,be);case M:return te=te.get(ce.key===null?ne:ce.key)||null,ie(J,te,ce,be);case Y:var Ee=ce._init;return pe(te,J,ne,Ee(ce._payload),be)}if(ht(ce)||H(ce))return te=te.get(ne)||null,le(J,te,ce,be,null);ja(J,ce)}return null}function ve(te,J,ne,ce){for(var be=null,Ee=null,Ne=J,Ce=J=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),J=k(Le,J,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&&(J=k(Ne,J,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),J=k(ut,J,Ce),Ee===null?be=ut:Ee.sibling=ut,Ee=ut);return r&&Ne.forEach(function(kr){return s(te,kr)}),Ue&&Ur(te,Ce),be}function we(te,J,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=J,Ce=J=0,ut=null,Le=ne.next();Ne!==null&&!Le.done;Ce++,Le=ne.next()){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var kr=ae(te,Ne,Le.value,ce);if(kr===null){Ne===null&&(Ne=ut);break}r&&Ne&&kr.alternate===null&&s(te,Ne),J=k(kr,J,Ce),Ee===null?be=kr:Ee.sibling=kr,Ee=kr,Ne=ut}if(Le.done)return u(te,Ne),Ue&&Ur(te,Ce),be;if(Ne===null){for(;!Le.done;Ce++,Le=ne.next())Le=ue(te,Le.value,ce),Le!==null&&(J=k(Le,J,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),J=k(Le,J,Ce),Ee===null?be=Le:Ee.sibling=Le,Ee=Le);return r&&Ne.forEach(function(kS){return s(te,kS)}),Ue&&Ur(te,Ce),be}function Qe(te,J,ne,ce){if(typeof ne=="object"&&ne!==null&&ne.type===D&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var be=ne.key,Ee=J;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===D){if(Ee.tag===7){u(te,Ee.sibling),J=y(Ee,ne.props.children),J.return=te,te=J;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Tm(be)===Ee.type){u(te,Ee.sibling),J=y(Ee,ne.props),J.ref=Js(te,Ee,ne),J.return=te,te=J;break e}u(te,Ee);break}else s(te,Ee);Ee=Ee.sibling}ne.type===D?(J=Jr(ne.props.children,te.mode,ce,ne.key),J.return=te,te=J):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,J,ne),ce.return=te,te=ce)}return P(te);case M:e:{for(Ee=ne.key;J!==null;){if(J.key===Ee)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){u(te,J.sibling),J=y(J,ne.children||[]),J.return=te,te=J;break e}else{u(te,J);break}else s(te,J);J=J.sibling}J=Tf(ne,te.mode,ce),J.return=te,te=J}return P(te);case Y:return Ee=ne._init,Qe(te,J,Ee(ne._payload),ce)}if(ht(ne))return ve(te,J,ne,ce);if(H(ne))return we(te,J,ne,ce);ja(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,J!==null&&J.tag===6?(u(te,J.sibling),J=y(J,ne),J.return=te,te=J):(u(te,J),J=Cf(ne,te.mode,ce),J.return=te,te=J),P(te)):u(te,J)}return Qe}var Ri=Om(!0),Im=Om(!1),Da=fr(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,Un(r,p)}function Un(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var pr=!1;function 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 Hn(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function mr(r,s,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Re&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,Un(r,u)}return y=p.interleaved,y===null?(s.next=s,Fc(p)):(s.next=y.next,y.next=s),p.interleaved=s,Un(r,u)}function za(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,xi(r,u)}}function Mm(r,s){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var P={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?y=k=P:k=k.next=P,u=u.next}while(u!==null);k===null?y=k=s:k=k.next=s}else y=k=s;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:k,shared:p.shared,effects:p.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function Fa(r,s,u,p){var y=r.updateQueue;pr=!1;var k=y.firstBaseUpdate,P=y.lastBaseUpdate,F=y.shared.pending;if(F!==null){y.shared.pending=null;var K=F,ie=K.next;K.next=null,P===null?k=ie:P.next=ie,P=K;var le=r.alternate;le!==null&&(le=le.updateQueue,F=le.lastBaseUpdate,F!==P&&(F===null?le.firstBaseUpdate=ie:F.next=ie,le.lastBaseUpdate=K))}if(k!==null){var ue=y.baseState;P=0,le=ie=K=null,F=k;do{var ae=F.lane,pe=F.eventTime;if((p&ae)===ae){le!==null&&(le=le.next={eventTime:pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var ve=r,we=F;switch(ae=s,pe=u,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ue=ve.call(pe,ue,ae);break e}ue=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,ae=typeof ve=="function"?ve.call(pe,ue,ae):ve,ae==null)break e;ue=B({},ue,ae);break e;case 2:pr=!0}}F.callback!==null&&F.lane!==0&&(r.flags|=64,ae=y.effects,ae===null?y.effects=[F]:ae.push(F))}else pe={eventTime:pe,lane:ae,tag:F.tag,payload:F.payload,callback:F.callback,next:null},le===null?(ie=le=pe,K=ue):le=le.next=pe,P|=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&&(K=ue),y.baseState=K,y.firstBaseUpdate=ie,y.lastBaseUpdate=le,s=y.shared.interleaved,s!==null){y=s;do P|=y.lane,y=y.next;while(y!==s)}else k===null&&(y.shared.lanes=0);Kr|=P,r.lanes=P,r.memoizedState=ue}}function Rm(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var p=r[s],y=p.callback;if(y!==null){if(p.callback=null,p=u,typeof y!="function")throw Error(n(191,y));y.call(p)}}}var Zs={},Nn=fr(Zs),eo=fr(Zs),to=fr(Zs);function qr(r){if(r===Zs)throw Error(n(174));return r}function 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=fr(0);function Ba(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Uc=[];function Hc(){for(var r=0;r<Uc.length;r++)Uc[r]._workInProgressVersionPrimary=null;Uc.length=0}var Va=C.ReactCurrentDispatcher,qc=C.ReactCurrentBatchConfig,Yr=0,Ge=null,it=null,at=null,Wa=!1,no=!1,ro=0,Uk=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,k){if(Yr=k,Ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Va.current=r===null||r.memoizedState===null?Kk:Gk,r=u(p,y),no){k=0;do{if(no=!1,ro=0,25<=k)throw Error(n(301));k+=1,at=it=null,s.updateQueue=null,Va.current=Xk,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,k=u.pending;if(k!==null){if(y!==null){var P=y.next;y.next=k.next,k.next=P}p.baseQueue=y=k,u.pending=null}if(y!==null){k=y.next,p=p.baseState;var F=P=null,K=null,ie=k;do{var le=ie.lane;if((Yr&le)===le)K!==null&&(K=K.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};K===null?(F=K=ue,P=p):K=K.next=ue,Ge.lanes|=le,Kr|=le}ie=ie.next}while(ie!==null&&ie!==k);K===null?P=p:K.next=F,sn(p,s.memoizedState)||(Ot=!0),s.memoizedState=p,s.baseState=P,s.baseQueue=K,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do k=y.lane,Ge.lanes|=k,Kr|=k,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function 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,k=s.memoizedState;if(y!==null){u.pending=null;var P=y=y.next;do k=r(k,P.action),P=P.next;while(P!==y);sn(k,s.memoizedState)||(Ot=!0),s.memoizedState=k,s.baseQueue===null&&(s.baseState=k),u.lastRenderedState=k}return[k,p]}function jm(){}function Dm(r,s){var u=Ge,p=Xt(),y=s(),k=!sn(p.memoizedState,y);if(k&&(p.memoizedState=y,Ot=!0),p=p.queue,Jc(Fm.bind(null,u,p,r),[r]),p.getSnapshot!==s||k||at!==null&&at.memoizedState.tag&1){if(u.flags|=2048,so(9,zm.bind(null,u,p,y,s),void 0,null),lt===null)throw Error(n(349));(Yr&30)!==0||$m(u,s,y)}return y}function $m(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=Ge.updateQueue,s===null?(s={lastEffect:null,stores:null},Ge.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function zm(r,s,u,p){s.value=u,s.getSnapshot=p,Bm(s)&&Vm(r)}function Fm(r,s,u){return u(function(){Bm(s)&&Vm(r)})}function Bm(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!sn(r,u)}catch{return!0}}function Vm(r){var s=Un(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=Yk.bind(null,Ge,r),[s.memoizedState,r]}function so(r,s,u,p){return r={tag:r,create:s,destroy:u,deps:p,next:null},s=Ge.updateQueue,s===null?(s={lastEffect:null,stores:null},Ge.updateQueue=s,s.lastEffect=r.next=r):(u=s.lastEffect,u===null?s.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,s.lastEffect=r)),r}function Um(){return Xt().memoizedState}function Ua(r,s,u,p){var y=_n();Ge.flags|=r,y.memoizedState=so(1|s,u,void 0,p===void 0?null:p)}function Ha(r,s,u,p){var y=Xt();p=p===void 0?null:p;var k=void 0;if(it!==null){var P=it.memoizedState;if(k=P.destroy,p!==null&&Yc(p,P.deps)){y.memoizedState=so(s,u,k,p);return}}Ge.flags|=r,y.memoizedState=so(1|s,u,k,p)}function Hm(r,s){return Ua(8390656,8,r,s)}function 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 Hk(r,s){var u=De;De=u!==0&&4>u?u:4,r(!0);var p=qc.transition;qc.transition={};try{r(!1),s()}finally{De=u,qc.transition=p}}function Zm(){return Xt().memoizedState}function qk(r,s,u){var p=wr(r);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},eg(r))tg(s,u);else if(u=Pm(r,s,u,p),u!==null){var y=bt();cn(u,r,p,y),ng(u,s,p)}}function Yk(r,s,u){var p=wr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(eg(r))tg(s,y);else{var k=r.alternate;if(r.lanes===0&&(k===null||k.lanes===0)&&(k=s.lastRenderedReducer,k!==null))try{var P=s.lastRenderedState,F=k(P,u);if(y.hasEagerState=!0,y.eagerState=F,sn(F,P)){var K=s.interleaved;K===null?(y.next=y,Fc(s)):(y.next=K.next,K.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},Kk={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=qk.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=Hk.bind(null,r[1]),_n().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var p=Ge,y=_n();if(Ue){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),lt===null)throw Error(n(349));(Yr&30)!==0||$m(p,s,u)}y.memoizedState=u;var k={value:u,getSnapshot:s};return y.queue=k,Hm(Fm.bind(null,p,k,r),[r]),p.flags|=2048,so(9,zm.bind(null,p,k,u,s),void 0,null),u},useId:function(){var r=_n(),s=lt.identifierPrefix;if(Ue){var u=Wn,p=Vn;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=Uk++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Gk={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},Xk={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=B({},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:B({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Ya={isMounted:function(r){return(r=r._reactInternals)?Sn(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var p=bt(),y=wr(r),k=Hn(p,y);k.payload=s,u!=null&&(k.callback=u),s=mr(r,k,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=bt(),y=wr(r),k=Hn(p,y);k.tag=1,k.payload=s,u!=null&&(k.callback=u),s=mr(r,k,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=bt(),p=wr(r),y=Hn(u,p);y.tag=2,s!=null&&(y.callback=s),s=mr(r,y,p),s!==null&&(cn(s,r,p,u),za(s,r,p))}};function rg(r,s,u,p,y,k,P){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,k,P):s.prototype&&s.prototype.isPureReactComponent?!Hs(u,p)||!Hs(y,k):!0}function ig(r,s,u){var p=!1,y=dr,k=s.contextType;return typeof k=="object"&&k!==null?k=Gt(k):(y=Tt(s)?Vr:mt.current,p=s.contextTypes,k=(p=p!=null)?Ii(r,y):dr),s=new s(u,k),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ya,r.stateNode=s,s._reactInternals=r,p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=k),s}function sg(r,s,u,p){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==r&&Ya.enqueueReplaceState(s,s.state,null)}function tf(r,s,u,p){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},Bc(r);var k=s.contextType;typeof k=="object"&&k!==null?y.context=Gt(k):(k=Tt(s)?Vr:mt.current,y.context=Ii(r,k)),y.state=r.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(ef(r,s,k,u),y.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(s=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),s!==y.state&&Ya.enqueueReplaceState(y,y.state,null),Fa(r,u,y,p),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function $i(r,s){try{var u="",p=s;do u+=Q(p),p=p.return;while(p);var y=u}catch(k){y=`
|
|
39
|
+
Error generating stack: `+k.message+`
|
|
40
|
+
`+k.stack}return{value:r,source:s,stack:y,digest:null}}function 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 Qk=typeof WeakMap=="function"?WeakMap:Map;function og(r,s,u){u=Hn(-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=Hn(-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 k=r.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){rf(r,s),typeof p!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var P=s.stack;this.componentDidCatch(s.value,{componentStack:P!==null?P:""})}),u}function lg(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Qk;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=fS.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=Hn(-1,1),s.tag=2,mr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var Jk=C.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 k=s.ref;return ji(s,y),p=Kc(r,s,u,p,k,y),u=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,qn(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 k=u.type;return typeof k=="function"&&!_f(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=k,hg(r,s,k,p,y)):(r=ol(u.type,null,p,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(k=r.child,(r.lanes&y)===0){var P=k.memoizedProps;if(u=u.compare,u=u!==null?u:Hs,u(P,p)&&r.ref===s.ref)return qn(r,s,y)}return s.flags|=1,r=br(k,p),r.ref=s.ref,r.return=s,s.child=r}function hg(r,s,u,p,y){if(r!==null){var k=r.memoizedProps;if(Hs(k,p)&&r.ref===s.ref)if(Ot=!1,s.pendingProps=p=k,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Ot=!0);else return s.lanes=r.lanes,qn(r,s,y)}return sf(r,s,u,p,y)}function pg(r,s,u){var p=s.pendingProps,y=p.children,k=r!==null?r.memoizedState:null;if(p.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(Fi,Bt),Bt|=u;else{if((u&1073741824)===0)return r=k!==null?k.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,$e(Fi,Bt),Bt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=k!==null?k.baseLanes:u,$e(Fi,Bt),Bt|=p}else k!==null?(p=k.baseLanes|u,s.memoizedState=null):p=u,$e(Fi,Bt),Bt|=p;return xt(r,s,y,u),s.child}function mg(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function sf(r,s,u,p,y){var k=Tt(u)?Vr:mt.current;return k=Ii(s,k),ji(s,y),u=Kc(r,s,u,p,k,y),p=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,qn(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 k=!0;Pa(s)}else k=!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 P=s.stateNode,F=s.memoizedProps;P.props=F;var K=P.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 P.getSnapshotBeforeUpdate=="function";ue||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==p||K!==ie)&&sg(s,P,p,ie),pr=!1;var ae=s.memoizedState;P.state=ae,Fa(s,p,P,y),K=s.memoizedState,F!==p||ae!==K||Ct.current||pr?(typeof le=="function"&&(ef(s,u,le,p),K=s.memoizedState),(F=pr||rg(s,u,F,p,ae,K,ie))?(ue||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(s.flags|=4194308)):(typeof P.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=K),P.props=p,P.state=K,P.context=ie,p=F):(typeof P.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{P=s.stateNode,Am(r,s),F=s.memoizedProps,ie=s.type===s.elementType?F:an(s.type,F),P.props=ie,ue=s.pendingProps,ae=P.context,K=u.contextType,typeof K=="object"&&K!==null?K=Gt(K):(K=Tt(u)?Vr:mt.current,K=Ii(s,K));var pe=u.getDerivedStateFromProps;(le=typeof pe=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(F!==ue||ae!==K)&&sg(s,P,p,K),pr=!1,ae=s.memoizedState,P.state=ae,Fa(s,p,P,y);var ve=s.memoizedState;F!==ue||ae!==ve||Ct.current||pr?(typeof pe=="function"&&(ef(s,u,pe,p),ve=s.memoizedState),(ie=pr||rg(s,u,ie,p,ae,ve,K)||!1)?(le||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(p,ve,K),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(p,ve,K)),typeof P.componentDidUpdate=="function"&&(s.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof P.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=ve),P.props=p,P.state=ve,P.context=K,p=ie):(typeof P.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),p=!1)}return of(r,s,u,p,k,y)}function of(r,s,u,p,y,k){mg(r,s);var P=(s.flags&128)!==0;if(!p&&!P)return y&&bm(s,u,!1),qn(r,s,k);p=s.stateNode,Jk.current=s;var F=P&&typeof u.getDerivedStateFromError!="function"?null:p.render();return s.flags|=1,r!==null&&P?(s.child=Ri(s,r.child,null,k),s.child=Ri(s,null,F,k)):xt(r,s,F,k),s.memoizedState=p.state,y&&bm(s,u,!0),s.child}function yg(r){var s=r.stateNode;s.pendingContext?wm(r,s.pendingContext,s.pendingContext!==s.context):s.context&&wm(r,s.context,!1),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,k=!1,P=(s.flags&128)!==0,F;if((F=P)||(F=r!==null&&r.memoizedState===null?!1:(y&2)!==0),F?(k=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),$e(Ke,y&1),r===null)return 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):(P=p.children,r=p.fallback,k?(p=s.mode,k=s.child,P={mode:"hidden",children:P},(p&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=P):k=al(P,p,0,null),r=Jr(r,p,u,null),k.return=s,r.return=s,k.sibling=r,s.child=k,s.child.memoizedState=lf(u),s.memoizedState=af,r):uf(s,P));if(y=r.memoizedState,y!==null&&(F=y.dehydrated,F!==null))return Zk(r,s,P,p,F,y,u);if(k){k=p.fallback,P=s.mode,y=r.child,F=y.sibling;var K={mode:"hidden",children:p.children};return(P&1)===0&&s.child!==y?(p=s.child,p.childLanes=0,p.pendingProps=K,s.deletions=null):(p=br(y,K),p.subtreeFlags=y.subtreeFlags&14680064),F!==null?k=br(F,k):(k=Jr(k,P,u,null),k.flags|=2),k.return=s,p.return=s,p.sibling=k,s.child=p,p=k,k=s.child,P=r.child.memoizedState,P=P===null?lf(u):{baseLanes:P.baseLanes|u,cachePool:null,transitions:P.transitions},k.memoizedState=P,k.childLanes=r.childLanes&~u,s.memoizedState=af,p}return k=r.child,r=k.sibling,p=br(k,{mode:"visible",children:p.children}),(s.mode&1)===0&&(p.lanes=u),p.return=s,p.sibling=null,r!==null&&(u=s.deletions,u===null?(s.deletions=[r],s.flags|=16):u.push(r)),s.child=p,s.memoizedState=null,p}function 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 Zk(r,s,u,p,y,k,P){if(u)return s.flags&256?(s.flags&=-257,p=nf(Error(n(422))),Ka(r,s,P,p)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(k=p.fallback,y=s.mode,p=al({mode:"visible",children:p.children},y,0,null),k=Jr(k,y,P,null),k.flags|=2,p.return=s,k.return=s,p.sibling=k,s.child=p,(s.mode&1)!==0&&Ri(s,r.child,null,P),s.child.memoizedState=lf(P),s.memoizedState=af,k);if((s.mode&1)===0)return Ka(r,s,P,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var F=p.dgst;return p=F,k=Error(n(419)),p=nf(k,p,void 0),Ka(r,s,P,p)}if(F=(P&r.childLanes)!==0,Ot||F){if(p=lt,p!==null){switch(P&-P){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|P))!==0?0:y,y!==0&&y!==k.retryLane&&(k.retryLane=y,Un(r,y),cn(p,r,y,-1))}return Nf(),p=nf(Error(n(421))),Ka(r,s,P,p)}return y.data==="$?"?(s.flags|=128,s.child=r.child,s=dS.bind(null,r),y._reactRetry=s,null):(r=k.treeContext,Ft=cr(y.nextSibling),zt=s,Ue=!0,on=null,r!==null&&(Yt[Kt++]=Vn,Yt[Kt++]=Wn,Yt[Kt++]=Wr,Vn=r.id,Wn=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 k=r.memoizedState;k===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=p,k.tail=u,k.tailMode=y)}function bg(r,s,u){var p=s.pendingProps,y=p.revealOrder,k=p.tail;if(xt(r,s,p.children,u),p=Ke.current,(p&2)!==0)p=p&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xg(r,u,s);else if(r.tag===19)xg(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}p&=1}if($e(Ke,p),(s.mode&1)===0)s.memoizedState=null;else switch(y){case"forwards":for(u=s.child,y=null;u!==null;)r=u.alternate,r!==null&&Ba(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),cf(s,!1,y,u,k);break;case"backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(r=y.alternate,r!==null&&Ba(r)===null){s.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}cf(s,!0,u,null,k);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 qn(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Kr|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=br(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=br(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function eS(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=qn(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 qn(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 k=null;switch(u){case"input":y=Se(r,y),p=Se(r,p),k=[];break;case"select":y=B({},y,{value:void 0}),p=B({},p,{value:void 0}),k=[];break;case"textarea":y=Dn(r,y),p=Dn(r,p),k=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Ta)}Ss(u,p);var P;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var F=y[ie];for(P in F)F.hasOwnProperty(P)&&(u||(u={}),u[P]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?k||(k=[]):(k=k||[]).push(ie,null));for(ie in p){var K=p[ie];if(F=y!=null?y[ie]:void 0,p.hasOwnProperty(ie)&&K!==F&&(K!=null||F!=null))if(ie==="style")if(F){for(P in F)!F.hasOwnProperty(P)||K&&K.hasOwnProperty(P)||(u||(u={}),u[P]="");for(P in K)K.hasOwnProperty(P)&&F[P]!==K[P]&&(u||(u={}),u[P]=K[P])}else u||(k||(k=[]),k.push(ie,u)),u=K;else ie==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,F=F?F.__html:void 0,K!=null&&F!==K&&(k=k||[]).push(ie,K)):ie==="children"?typeof K!="string"&&typeof K!="number"||(k=k||[]).push(ie,""+K):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(K!=null&&ie==="onScroll"&&Be("scroll",r),k||F===K||(k=[])):(k=k||[]).push(ie,K))}u&&(k=k||[]).push("style",u);var ie=k;(s.updateQueue=ie)&&(s.flags|=4)}},Eg=function(r,s,u,p){u!==p&&(s.flags|=4)};function oo(r,s){if(!Ue)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function yt(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(s)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&14680064,p|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,s}function tS(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 k=s.memoizedProps;switch(p[En]=s,p[Xs]=k,r=(s.mode&1)!==0,u){case"dialog":Be("cancel",p),Be("close",p);break;case"iframe":case"object":case"embed":Be("load",p);break;case"video":case"audio":for(y=0;y<Ys.length;y++)Be(Ys[y],p);break;case"source":Be("error",p);break;case"img":case"image":case"link":Be("error",p),Be("load",p);break;case"details":Be("toggle",p);break;case"input":Pe(p,k),Be("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!k.multiple},Be("invalid",p);break;case"textarea":bn(p,k),Be("invalid",p)}Ss(u,k),y=null;for(var P in k)if(k.hasOwnProperty(P)){var F=k[P];P==="children"?typeof F=="string"?p.textContent!==F&&(k.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",F]):typeof F=="number"&&p.textContent!==""+F&&(k.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",""+F]):o.hasOwnProperty(P)&&F!=null&&P==="onScroll"&&Be("scroll",p)}switch(u){case"input":xe(p),wt(p,k,!0);break;case"textarea":xe(p),_t(p);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(p.onclick=Ta)}p=y,s.updateQueue=p,p!==null&&(s.flags|=4)}else{P=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=P.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=P.createElement(u,{is:p.is}):(r=P.createElement(u),u==="select"&&(P=r,p.multiple?P.multiple=!0:p.size&&(P.size=p.size))):r=P.createElementNS(r,u),r[En]=s,r[Xs]=p,kg(r,s,!1,!1),s.stateNode=r;e:{switch(P=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=B({},p,{value:void 0}),Be("invalid",r);break;case"textarea":bn(r,p),y=Dn(r,p),Be("invalid",r);break;default:y=p}Ss(u,y),F=y;for(k in F)if(F.hasOwnProperty(k)){var K=F[k];k==="style"?Jo(r,K):k==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Xo(r,K)):k==="children"?typeof K=="string"?(u!=="textarea"||K!=="")&&$n(r,K):typeof K=="number"&&$n(r,""+K):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(o.hasOwnProperty(k)?K!=null&&k==="onScroll"&&Be("scroll",r):K!=null&&S(r,k,K,P))}switch(u){case"input":xe(r),wt(r,p,!1);break;case"textarea":xe(r),_t(r);break;case"option":p.value!=null&&r.setAttribute("value",""+ee(p.value));break;case"select":r.multiple=!!p.multiple,k=p.value,k!=null?pt(r,!!p.multiple,k,!1):p.defaultValue!=null&&pt(r,!!p.multiple,p.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=Ta)}switch(u){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}}p&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return yt(s),null;case 6:if(r&&s.stateNode!=null)Eg(r,s,r.memoizedProps,p);else{if(typeof p!="string"&&s.stateNode===null)throw Error(n(166));if(u=qr(to.current),qr(Nn.current),La(s)){if(p=s.stateNode,u=s.memoizedProps,p[En]=s,(k=p.nodeValue!==u)&&(r=zt,r!==null))switch(r.tag){case 3:Ca(p.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ca(p.nodeValue,u,(r.mode&1)!==0)}k&&(s.flags|=4)}else p=(u.nodeType===9?u:u.ownerDocument).createTextNode(p),p[En]=s,s.stateNode=p}return yt(s),null;case 13:if(Ve(Ke),p=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Ue&&Ft!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Cm(),Mi(),s.flags|=98560,k=!1;else if(k=La(s),p!==null&&p.dehydrated!==null){if(r===null){if(!k)throw Error(n(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[En]=s}else Mi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;yt(s),k=!1}else on!==null&&(kf(on),on=null),k=!0;if(!k)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(p=p!==null,p!==(r!==null&&r.memoizedState!==null)&&p&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(Ke.current&1)!==0?st===0&&(st=3):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),k=s.memoizedState,k===null)return yt(s),null;if(p=(s.flags&128)!==0,P=k.rendering,P===null)if(p)oo(k,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(P=Ba(r),P!==null){for(s.flags|=128,oo(k,!1),p=P.updateQueue,p!==null&&(s.updateQueue=p,s.flags|=4),s.subtreeFlags=0,p=u,u=s.child;u!==null;)k=u,r=p,k.flags&=14680066,P=k.alternate,P===null?(k.childLanes=0,k.lanes=r,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=P.childLanes,k.lanes=P.lanes,k.child=P.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=P.memoizedProps,k.memoizedState=P.memoizedState,k.updateQueue=P.updateQueue,k.type=P.type,r=P.dependencies,k.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return $e(Ke,Ke.current&1|2),s.child}r=r.sibling}k.tail!==null&&Ye()>Bi&&(s.flags|=128,p=!0,oo(k,!1),s.lanes=4194304)}else{if(!p)if(r=Ba(P),r!==null){if(s.flags|=128,p=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),oo(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!Ue)return yt(s),null}else 2*Ye()-k.renderingStartTime>Bi&&u!==1073741824&&(s.flags|=128,p=!0,oo(k,!1),s.lanes=4194304);k.isBackwards?(P.sibling=s.child,s.child=P):(u=k.last,u!==null?u.sibling=P:s.child=P,k.last=P)}return k.tail!==null?(s=k.tail,k.rendering=s,k.tail=s.sibling,k.renderingStartTime=Ye(),s.sibling=null,u=Ke.current,$e(Ke,p?u&1|2:u&1),s):(yt(s),null);case 22:case 23:return 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 nS(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,rS=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 iS(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,k=p.focusNode;p=p.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var P=0,F=-1,K=-1,ie=0,le=0,ue=r,ae=null;t:for(;;){for(var pe;ue!==u||y!==0&&ue.nodeType!==3||(F=P+y),ue!==k||p!==0&&ue.nodeType!==3||(K=P+p),ue.nodeType===3&&(P+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)ae=ue,ue=pe;for(;;){if(ue===r)break t;if(ae===u&&++ie===y&&(F=P),ae===k&&++le===p&&(K=P),(pe=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=pe}u=F===-1||K===-1?null:{start:F,end:K}}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,J=te.getSnapshotBeforeUpdate(s.elementType===s.type?we:an(s.type,we),Qe);te.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var ne=s.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){Xe(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ve=Ng,Ng=!1,ve}function ao(r,s,u){var p=s.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&r)===r){var k=y.destroy;y.destroy=void 0,k!==void 0&&df(s,u,k)}y=y.next}while(y!==p)}}function Qa(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&r)===r){var p=u.create;u.destroy=p()}u=u.next}while(u!==s)}}function 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[Fk],delete s[Bk])),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 gr(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,gr(r,s,u),ct=p,ln=y,ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):ct.removeChild(u.stateNode));break;case 18:ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?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,gr(r,s,u),ct=p,ln=y;break;case 0:case 11:case 14:case 15:if(!vt&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var k=y,P=k.destroy;k=k.tag,P!==void 0&&((k&2)!==0||(k&4)!==0)&&df(u,s,P),y=y.next}while(y!==p)}gr(r,s,u);break;case 1:if(!vt&&(zi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(F){Xe(u,s,F)}gr(r,s,u);break;case 21:gr(r,s,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,gr(r,s,u),vt=p):gr(r,s,u);break;default:gr(r,s,u)}}function Ig(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new rS),s.forEach(function(p){var y=hS.bind(null,r,p);u.has(p)||(u.add(p),p.then(y,y))})}}function un(r,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];try{var k=r,P=s,F=P;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(k,P,y),ct=null,ln=!1;var K=y.alternate;K!==null&&(K.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{$n(y,"")}catch(we){Xe(r,r.return,we)}}if(p&4&&(y=r.stateNode,y!=null)){var k=r.memoizedProps,P=u!==null?u.memoizedProps:k,F=r.type,K=r.updateQueue;if(r.updateQueue=null,K!==null)try{F==="input"&&k.type==="radio"&&k.name!=null&&Ae(y,k),Es(F,P);var ie=Es(F,k);for(P=0;P<K.length;P+=2){var le=K[P],ue=K[P+1];le==="style"?Jo(y,ue):le==="dangerouslySetInnerHTML"?Xo(y,ue):le==="children"?$n(y,ue):S(y,le,ue,ie)}switch(F){case"input":Fe(y,k);break;case"textarea":kn(y,k);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!k.multiple;var pe=k.value;pe!=null?pt(y,!!k.multiple,pe,!1):ae!==!!k.multiple&&(k.defaultValue!=null?pt(y,!!k.multiple,k.defaultValue,!0):pt(y,!!k.multiple,k.multiple?[]:"",!1))}y[Xs]=k}catch(we){Xe(r,r.return,we)}}break;case 6:if(un(s,r),Cn(r),p&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,k=r.memoizedProps;try{y.nodeValue=k}catch(we){Xe(r,r.return,we)}}break;case 3:if(un(s,r),Cn(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{zs(s.containerInfo)}catch(we){Xe(r,r.return,we)}break;case 4:un(s,r),Cn(r);break;case 13:un(s,r),Cn(r),y=r.child,y.flags&8192&&(k=y.memoizedState!==null,y.stateNode.isHidden=k,!k||y.alternate!==null&&y.alternate.memoizedState!==null||(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?(k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(F=ue.stateNode,K=ue.memoizedProps.style,P=K!=null&&K.hasOwnProperty("display")?K.display:null,F.style.display=Qo("display",P))}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&&($n(y,""),p.flags&=-33);var k=Tg(r);mf(r,k,y);break;case 3:case 4:var P=p.stateNode.containerInfo,F=Tg(r);pf(r,F,P);break;default:throw Error(n(161))}}catch(K){Xe(r,r.return,K)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function sS(r,s,u){ge=r,Ag(r)}function Ag(r,s,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,k=y.child;if(y.tag===22&&p){var P=y.memoizedState!==null||Xa;if(!P){var F=y.alternate,K=F!==null&&F.memoizedState!==null||vt;F=Xa;var ie=vt;if(Xa=P,(vt=K)&&!ie)for(ge=y;ge!==null;)P=ge,K=P.child,P.tag===22&&P.memoizedState!==null?Lg(y):K!==null?(K.return=P,ge=K):Lg(y);for(;k!==null;)ge=k,Ag(k),k=k.sibling;ge=y,Xa=F,vt=ie}Mg(r)}else(y.subtreeFlags&8772)!==0&&k!==null?(k.return=y,ge=k):Mg(r)}}function Mg(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:vt||Qa(5,s);break;case 1:var p=s.stateNode;if(s.flags&4&&!vt)if(u===null)p.componentDidMount();else{var y=s.elementType===s.type?u.memoizedProps:an(s.type,u.memoizedProps);p.componentDidUpdate(y,u.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var k=s.updateQueue;k!==null&&Rm(s,k,p);break;case 3:var P=s.updateQueue;if(P!==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,P,u)}break;case 5:var F=s.stateNode;if(u===null&&s.flags&4){u=F;var K=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&u.focus();break;case"img":K.src&&(u.src=K.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(K){Xe(s,u,K)}break;case 1:var p=s.stateNode;if(typeof p.componentDidMount=="function"){var y=s.return;try{p.componentDidMount()}catch(K){Xe(s,y,K)}}var k=s.return;try{hf(s)}catch(K){Xe(s,k,K)}break;case 5:var P=s.return;try{hf(s)}catch(K){Xe(s,P,K)}}}catch(K){Xe(s,s.return,K)}if(s===r){ge=null;break}var F=s.sibling;if(F!==null){F.return=s.return,ge=F;break}ge=s.return}}var oS=Math.ceil,Ja=C.ReactCurrentDispatcher,gf=C.ReactCurrentOwner,Qt=C.ReactCurrentBatchConfig,Re=0,lt=null,tt=null,ft=0,Bt=0,Fi=fr(0),st=0,lo=null,Kr=0,Za=0,yf=0,uo=null,It=null,vf=0,Bi=1/0,Yn=null,el=!1,wf=null,yr=null,tl=!1,vr=null,nl=0,co=0,xf=null,rl=-1,il=0;function bt(){return(Re&6)!==0?Ye():rl!==-1?rl:rl=Ye()}function wr(r){return(r.mode&1)===0?1:(Re&2)!==0&&ft!==0?ft&-ft:Wk.transition!==null?(il===0&&(il=ha()),il):(r=De,r!==0||(r=window.event,r=r===void 0?16:Dp(r.type)),r)}function cn(r,s,u,p){if(50<co)throw co=0,xf=null,Error(n(185));Fr(r,u,p),((Re&2)===0||r!==lt)&&(r===lt&&((Re&2)===0&&(Za|=u),st===4&&xr(r,ft)),Pt(r,p),u===1&&Re===0&&(s.mode&1)===0&&(Bi=Ye()+500,Aa&&hr()))}function Pt(r,s){var u=r.callbackNode;da(r,s);var p=zn(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?Vk(Dg.bind(null,r)):km(Dg.bind(null,r)),$k(function(){(Re&6)===0&&hr()}),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=zn(r,r===lt?ft:0);if(p===0)return null;if((p&30)!==0||(p&r.expiredLanes)!==0||s)s=sl(r,p);else{s=p;var y=Re;Re|=2;var k=zg();(lt!==r||ft!==s)&&(Yn=null,Bi=Ye()+500,Xr(r,s));do try{uS();break}catch(F){$g(r,F)}while(!0);Dc(),Ja.current=k,Re=y,tt!==null?s=0:(lt=null,ft=0,s=st)}if(s!==0){if(s===2&&(y=Rs(r),y!==0&&(p=y,s=bf(r,y))),s===1)throw u=lo,Xr(r,0),xr(r,p),Pt(r,Ye()),u;if(s===6)xr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!aS(y)&&(s=sl(r,p),s===2&&(k=Rs(r),k!==0&&(p=k,s=bf(r,k))),s===1))throw u=lo,Xr(r,0),xr(r,p),Pt(r,Ye()),u;switch(r.finishedWork=y,r.finishedLanes=p,s){case 0:case 1:throw Error(n(345));case 2:Qr(r,It,Yn);break;case 3:if(xr(r,p),(p&130023424)===p&&(s=vf+500-Ye(),10<s)){if(zn(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,Yn),s);break}Qr(r,It,Yn);break;case 4:if(xr(r,p),(p&4194240)===p)break;for(s=r.eventTimes,y=-1;0<p;){var P=31-Dt(p);k=1<<P,P=s[P],P>y&&(y=P),p&=~k}if(p=y,p=Ye()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*oS(p/1960))-p,10<p){r.timeoutHandle=_c(Qr.bind(null,r,It,Yn),p);break}Qr(r,It,Yn);break;case 5:Qr(r,It,Yn);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 aS(r){for(var s=r;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var p=0;p<u.length;p++){var y=u[p],k=y.getSnapshot;y=y.value;try{if(!sn(k(),y))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function xr(r,s){for(s&=~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=zn(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),xr(r,s),Pt(r,Ye()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Qr(r,It,Yn),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&&hr())}}function Gr(r){vr!==null&&vr.tag===0&&(Re&6)===0&&Vi();var s=Re;Re|=1;var u=Qt.transition,p=De;try{if(Qt.transition=null,De=1,r)return r()}finally{De=p,Qt.transition=u,Re=s,(Re&6)===0&&hr()}}function 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,Dk(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=br(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,k=u.pending;if(k!==null){var P=k.next;k.next=y,p.next=P}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 k=r,P=u.return,F=u,K=s;if(s=ft,F.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ie=K,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(P);if(pe!==null){pe.flags&=-257,cg(pe,P,F,k,s),pe.mode&1&&lg(k,ie,s),s=pe,K=ie;var ve=s.updateQueue;if(ve===null){var we=new Set;we.add(K),s.updateQueue=we}else ve.add(K);break e}else{if((s&1)===0){lg(k,ie,s),Nf();break e}K=Error(n(426))}}else if(Ue&&F.mode&1){var Qe=ug(P);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),cg(Qe,P,F,k,s),Lc($i(K,F));break e}}k=K=$i(K,F),st!==4&&(st=2),uo===null?uo=[k]:uo.push(k),k=P;do{switch(k.tag){case 3:k.flags|=65536,s&=-s,k.lanes|=s;var te=og(k,K,s);Mm(k,te);break e;case 1:F=K;var J=k.type,ne=k.stateNode;if((k.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(yr===null||!yr.has(ne)))){k.flags|=65536,s&=-s,k.lanes|=s;var ce=ag(k,F,s);Mm(k,ce);break e}}k=k.return}while(k!==null)}Bg(u)}catch(be){s=be,tt===u&&u!==null&&(tt=u=u.return);continue}break}while(!0)}function zg(){var r=Ja.current;return Ja.current=qa,r===null?qa:r}function Nf(){(st===0||st===3||st===2)&&(st=4),lt===null||(Kr&268435455)===0&&(Za&268435455)===0||xr(lt,ft)}function sl(r,s){var u=Re;Re|=2;var p=zg();(lt!==r||ft!==s)&&(Yn=null,Xr(r,s));do try{lS();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 lS(){for(;tt!==null;)Fg(tt)}function uS(){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=tS(u,s,Bt),u!==null){tt=u;return}}else{if(u=nS(u,s),u!==null){u.flags&=32767,tt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{st=6,tt=null;return}}if(s=s.sibling,s!==null){tt=s;return}tt=s=r}while(s!==null);st===0&&(st=5)}function Qr(r,s,u){var p=De,y=Qt.transition;try{Qt.transition=null,De=1,cS(r,s,u,p)}finally{Qt.transition=y,De=p}return null}function cS(r,s,u,p){do Vi();while(vr!==null);if((Re&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var k=u.lanes|u.childLanes;if(tc(r,k),r===lt&&(tt=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||tl||(tl=!0,Hg(gi,function(){return Vi(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=Qt.transition,Qt.transition=null;var P=De;De=1;var F=Re;Re|=4,gf.current=null,iS(r,u),Pg(u,r),Ik(Ec),ga=!!Sc,Ec=Sc=null,r.current=u,sS(u),ua(),Re=F,De=P,Qt.transition=k}else r.current=u;if(tl&&(tl=!1,vr=r,nl=y),k=r.pendingLanes,k===0&&(yr=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(),k=r.pendingLanes,(k&1)!==0?r===xf?co++:(co=0,xf=r):co=0,hr(),null}function Vi(){if(vr!==null){var r=Op(nl),s=Qt.transition,u=De;try{if(Qt.transition=null,De=16>r?16:r,vr===null)var p=!1;else{if(r=vr,vr=null,nl=0,(Re&6)!==0)throw Error(n(331));var y=Re;for(Re|=4,ge=r.current;ge!==null;){var k=ge,P=k.child;if((ge.flags&16)!==0){var F=k.deletions;if(F!==null){for(var K=0;K<F.length;K++){var ie=F[K];for(ge=ie;ge!==null;){var le=ge;switch(le.tag){case 0:case 11:case 15:ao(8,le,k)}var ue=le.child;if(ue!==null)ue.return=le,ge=ue;else for(;ge!==null;){le=ge;var ae=le.sibling,pe=le.return;if(_g(le),le===ie){ge=null;break}if(ae!==null){ae.return=pe,ge=ae;break}ge=pe}}}var ve=k.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Qe=we.sibling;we.sibling=null,we=Qe}while(we!==null)}}ge=k}}if((k.subtreeFlags&2064)!==0&&P!==null)P.return=k,ge=P;else e:for(;ge!==null;){if(k=ge,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ao(9,k,k.return)}var te=k.sibling;if(te!==null){te.return=k.return,ge=te;break e}ge=k.return}}var J=r.current;for(ge=J;ge!==null;){P=ge;var ne=P.child;if((P.subtreeFlags&2064)!==0&&ne!==null)ne.return=P,ge=ne;else e:for(P=J;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===P){ge=null;break e}var ce=F.sibling;if(ce!==null){ce.return=F.return,ge=ce;break e}ge=F.return}}if(Re=y,hr(),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(yi,r)}catch{}p=!0}return p}finally{De=u,Qt.transition=s}}return!1}function Vg(r,s,u){s=$i(u,s),s=og(r,s,1),r=mr(r,s,1),s=bt(),r!==null&&(Fr(r,1,s),Pt(r,s))}function Xe(r,s,u){if(r.tag===3)Vg(r,r,u);else for(;s!==null;){if(s.tag===3){Vg(s,r,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(yr===null||!yr.has(p))){r=$i(u,r),r=ag(s,r,1),s=mr(s,r,1),r=bt(),s!==null&&(Fr(s,1,r),Pt(s,r));break}}s=s.return}}function fS(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=Un(r,s),r!==null&&(Fr(r,s,u),Pt(r,u))}function dS(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Wg(r,u)}function hS(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,eS(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 k=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)?(k=!0,Pa(s)):k=!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,k,u)):(s.tag=0,Ue&&k&&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=mS(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,k=s.memoizedState,y=k.element,Am(r,s),Fa(s,p,null,u);var P=s.memoizedState;if(p=P.element,k.isDehydrated)if(k={element:p,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},s.updateQueue.baseState=k,s.memoizedState=k,s.flags&256){y=$i(Error(n(423)),s),s=vg(r,s,p,u,y);break e}else if(p!==y){y=$i(Error(n(424)),s),s=vg(r,s,p,u,y);break e}else for(Ft=cr(s.stateNode.containerInfo.firstChild),zt=s,Ue=!0,on=null,u=Im(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Mi(),p===y){s=qn(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,k=r!==null?r.memoizedProps:null,P=y.children,Nc(p,y)?P=null:k!==null&&Nc(p,k)&&(s.flags|=32),mg(r,s),xt(r,s,P,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,k=s.memoizedProps,P=y.value,$e(Da,p._currentValue),p._currentValue=P,k!==null)if(sn(k.value,P)){if(k.children===y.children&&!Ct.current){s=qn(r,s,u);break e}}else for(k=s.child,k!==null&&(k.return=s);k!==null;){var F=k.dependencies;if(F!==null){P=k.child;for(var K=F.firstContext;K!==null;){if(K.context===p){if(k.tag===1){K=Hn(-1,u&-u),K.tag=2;var ie=k.updateQueue;if(ie!==null){ie=ie.shared;var le=ie.pending;le===null?K.next=K:(K.next=le.next,le.next=K),ie.pending=K}}k.lanes|=u,K=k.alternate,K!==null&&(K.lanes|=u),zc(k.return,u,s),F.lanes|=u;break}K=K.next}}else if(k.tag===10)P=k.type===s.type?null:k.child;else if(k.tag===18){if(P=k.return,P===null)throw Error(n(341));P.lanes|=u,F=P.alternate,F!==null&&(F.lanes|=u),zc(P,u,s),P=k.sibling}else P=k.child;if(P!==null)P.return=k;else for(P=k;P!==null;){if(P===s){P=null;break}if(k=P.sibling,k!==null){k.return=P.return,P=k;break}P=P.return}k=P}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 pS(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 pS(r,s,u,p)}function _f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function mS(r){if(typeof r=="function")return _f(r)?1:0;if(r!=null){if(r=r.$$typeof,r===L)return 11;if(r===X)return 14}return 2}function br(r,s){var u=r.alternate;return u===null?(u=Jt(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function ol(r,s,u,p,y,k){var P=2;if(p=r,typeof r=="function")_f(r)&&(P=1);else if(typeof r=="string")P=5;else e:switch(r){case D:return Jr(u.children,y,k,s);case T:P=8,y|=8;break;case O:return r=Jt(12,u,s,y|2),r.elementType=O,r.lanes=k,r;case G:return r=Jt(13,u,s,y),r.elementType=G,r.lanes=k,r;case j:return r=Jt(19,u,s,y),r.elementType=j,r.lanes=k,r;case Z:return al(u,y,k,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:P=10;break e;case R:P=9;break e;case L:P=11;break e;case X:P=14;break e;case Y:P=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jt(P,u,s,y),s.elementType=r,s.type=p,s.lanes=k,s}function Jr(r,s,u,p){return r=Jt(7,r,p,s),r.lanes=u,r}function al(r,s,u,p){return r=Jt(22,r,p,s),r.elementType=Z,r.lanes=u,r.stateNode={isHidden:!1},r}function 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 gS(r,s,u,p,y){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zr(0),this.expirationTimes=zr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zr(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Of(r,s,u,p,y,k,P,F,K){return r=new gS(r,s,u,F,K),s===1?(s=1,k===!0&&(s|=8)):s=0,k=Jt(3,null,null,s),r.current=k,k.stateNode=r,k.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bc(k),r}function yS(r,s,u){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:p==null?null:""+p,children:r,containerInfo:s,implementation:u}}function qg(r){if(!r)return dr;r=r._reactInternals;e:{if(Sn(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Tt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Tt(u))return xm(r,u,s)}return s}function Yg(r,s,u,p,y,k,P,F,K){return r=Of(u,p,!0,r,y,k,P,F,K),r.context=qg(null),u=r.current,p=bt(),y=wr(u),k=Hn(p,y),k.callback=s??null,mr(u,k,y),r.current.lanes=y,Fr(r,y,p),Pt(r,p),r}function ll(r,s,u,p){var y=s.current,k=bt(),P=wr(y);return u=qg(u),s.context===null?s.context=u:s.pendingContext=u,s=Hn(k,P),s.payload={element:r},p=p===void 0?null:p,p!==null&&(s.callback=p),r=mr(y,s,P),r!==null&&(cn(r,y,P,k),za(r,y,P)),P}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 vS(){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[Fn]=null}};function cl(r){this._internalRoot=r}cl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ap();r={blockedOn:null,target:r,priority:s};for(var u=0;u<ar.length&&s!==0&&s<ar[u].priority;u++);ar.splice(u,0,r),u===0&&Lp(r)}};function 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 wS(r,s,u,p,y){if(y){if(typeof p=="function"){var k=p;p=function(){var ie=ul(P);k.call(ie)}}var P=Yg(s,p,r,0,null,!1,!1,"",Xg);return r._reactRootContainer=P,r[Fn]=P.current,Ks(r.nodeType===8?r.parentNode:r),Gr(),P}for(;y=r.lastChild;)r.removeChild(y);if(typeof p=="function"){var F=p;p=function(){var ie=ul(K);F.call(ie)}}var K=Of(r,0,!1,null,null,!1,!1,"",Xg);return r._reactRootContainer=K,r[Fn]=K.current,Ks(r.nodeType===8?r.parentNode:r),Gr(function(){ll(s,K,u,p)}),K}function dl(r,s,u,p,y){var k=u._reactRootContainer;if(k){var P=k;if(typeof y=="function"){var F=y;y=function(){var K=ul(P);F.call(K)}}ll(s,P,r,y)}else P=wS(u,s,r,y,p);return ul(P)}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,hr()))}break;case 13:Gr(function(){var p=Un(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=Un(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=wr(r),u=Un(r,s);if(u!==null){var p=bt();cn(u,r,s,p)}If(r,s)}},Ap=function(){return De},Mp=function(r,s){var u=De;try{return De=r,s()}finally{De=u}},Cs=function(r,s,u){switch(s){case"input":if(Fe(r,u),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==r&&p.form===r.form){var y=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 xS={usingClientEntryPoint:!1,Events:[Qs,Ti,Oa,ea,ta,Sf]},fo={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bS={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:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=sa(r),r===null?null:r.stateNode},findFiberByHostInstance:fo.findFiberByHostInstance||vS,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(bS),jt=hl}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xS,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 yS(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[Fn]=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,k="",P=Gg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),s=Yg(s,null,r,1,u??null,y,!1,k,P),r[Fn]=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[Fn]=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 ew(){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=PS(),Lf.exports}var sy;function AS(){if(sy)return pl;sy=1;var e=ew();return pl.createRoot=e.createRoot,pl.hydrateRoot=e.hydrateRoot,pl}var MS=AS();const RS=hu(MS);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 LS={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 jS(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=jS(e+"",n),o,a=-1,l=i.length;if(arguments.length<2){for(;++a<l;)if((o=(e=i[a]).type)&&(o=DS(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 DS(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]=LS,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 $S(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 zS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tw(e){var t=mu(e);return(t.local?zS:$S)(t)}function FS(){}function jh(e){return e==null?FS:function(){return this.querySelector(e)}}function BS(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,d,m=0;m<l;++m)(f=a[m])&&(d=e.call(f,f.__data__,m,a))&&("__data__"in f&&(d.__data__=f.__data__),c[m]=d);return new Wt(i,this._parents)}function VS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function WS(){return[]}function nw(e){return e==null?WS:function(){return this.querySelectorAll(e)}}function US(e){return function(){return VS(e.apply(this,arguments))}}function HS(e){typeof e=="function"?e=US(e):e=nw(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,d=0;d<c;++d)(f=l[d])&&(i.push(e.call(f,f.__data__,d,l)),o.push(f));return new Wt(i,o)}function rw(e){return function(){return this.matches(e)}}function iw(e){return function(t){return t.matches(e)}}var qS=Array.prototype.find;function YS(e){return function(){return qS.call(this.children,e)}}function KS(){return this.firstElementChild}function GS(e){return this.select(e==null?KS:YS(typeof e=="function"?e:iw(e)))}var XS=Array.prototype.filter;function QS(){return Array.from(this.children)}function JS(e){return function(){return XS.call(this.children,e)}}function ZS(e){return this.selectAll(e==null?QS:JS(typeof e=="function"?e:iw(e)))}function eE(e){typeof e!="function"&&(e=rw(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,d=0;d<l;++d)(f=a[d])&&e.call(f,f.__data__,d,a)&&c.push(f);return new Wt(i,this._parents)}function sw(e){return new Array(e.length)}function tE(){return new Wt(this._enter||this._groups.map(sw),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 nE(e){return function(){return e}}function rE(e,t,n,i,o,a){for(var l=0,c,f=t.length,d=a.length;l<d;++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 iE(e,t,n,i,o,a,l){var c,f,d=new Map,m=t.length,h=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)+"",d.has(v)?o[c]=f:d.set(v,f));for(c=0;c<h;++c)v=l.call(e,a[c],c,a)+"",(f=d.get(v))?(i[c]=f,f.__data__=a[c],d.delete(v)):n[c]=new Gl(e,a[c]);for(c=0;c<m;++c)(f=t[c])&&d.get(g[c])===f&&(o[c]=f)}function sE(e){return e.__data__}function oE(e,t){if(!arguments.length)return Array.from(this,sE);var n=t?iE:rE,i=this._parents,o=this._groups;typeof e!="function"&&(e=nE(e));for(var a=o.length,l=new Array(a),c=new Array(a),f=new Array(a),d=0;d<a;++d){var m=i[d],h=o[d],g=h.length,v=aE(e.call(m,m&&m.__data__,d,i)),x=v.length,w=c[d]=new Array(x),b=l[d]=new Array(x),E=f[d]=new Array(g);n(m,h,w,b,E,v,t);for(var _=0,S=0,C,A;_<x;++_)if(C=w[_]){for(_>=S&&(S=_+1);!(A=b[S])&&++S<x;);C._next=A||null}}return l=new Wt(l,i),l._enter=c,l._exit=f,l}function aE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lE(){return new Wt(this._exit||this._groups.map(sw),this._parents)}function uE(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 cE(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 d=n[f],m=i[f],h=d.length,g=c[f]=new Array(h),v,x=0;x<h;++x)(v=d[x]||m[x])&&(g[x]=v);for(;f<o;++f)c[f]=n[f];return new Wt(c,this._parents)}function fE(){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 dE(e){e||(e=hE);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!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),d,m=0;m<c;++m)(d=l[m])&&(f[m]=d);f.sort(t)}return new Wt(o,this._parents).order()}function hE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mE(){return Array.from(this)}function gE(){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 yE(){let e=0;for(const t of this)++e;return e}function vE(){return!this.node()}function wE(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 xE(e){return function(){this.removeAttribute(e)}}function bE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kE(e,t){return function(){this.setAttribute(e,t)}}function SE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function EE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function NE(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 _E(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?bE:xE:typeof t=="function"?n.local?NE:EE:n.local?SE:kE)(n,t))}function ow(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CE(e){return function(){this.style.removeProperty(e)}}function TE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function OE(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function IE(e,t,n){return arguments.length>1?this.each((t==null?CE:typeof t=="function"?OE:TE)(e,t,n??"")):ss(this.node(),e)}function ss(e,t){return e.style.getPropertyValue(t)||ow(e).getComputedStyle(e,null).getPropertyValue(t)}function PE(e){return function(){delete this[e]}}function AE(e,t){return function(){this[e]=t}}function ME(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function RE(e,t){return arguments.length>1?this.each((t==null?PE:typeof t=="function"?ME:AE)(e,t)):this.node()[e]}function aw(e){return e.trim().split(/^|\s+/)}function Dh(e){return e.classList||new lw(e)}function lw(e){this._node=e,this._names=aw(e.getAttribute("class")||"")}lw.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 uw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function cw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function LE(e){return function(){uw(this,e)}}function jE(e){return function(){cw(this,e)}}function DE(e,t){return function(){(t.apply(this,arguments)?uw:cw)(this,e)}}function $E(e,t){var n=aw(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"?DE:t?LE:jE)(n,t))}function zE(){this.textContent=""}function FE(e){return function(){this.textContent=e}}function BE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function VE(e){return arguments.length?this.each(e==null?zE:(typeof e=="function"?BE:FE)(e)):this.node().textContent}function WE(){this.innerHTML=""}function UE(e){return function(){this.innerHTML=e}}function HE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function qE(e){return arguments.length?this.each(e==null?WE:(typeof e=="function"?HE:UE)(e)):this.node().innerHTML}function YE(){this.nextSibling&&this.parentNode.appendChild(this)}function KE(){return this.each(YE)}function GE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function XE(){return this.each(GE)}function QE(e){var t=typeof e=="function"?e:tw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function JE(){return null}function ZE(e,t){var n=typeof e=="function"?e:tw(e),i=t==null?JE:typeof t=="function"?t:jh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function eN(){var e=this.parentNode;e&&e.removeChild(this)}function tN(){return this.each(eN)}function nN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function iN(e){return this.select(e?rN:nN)}function sN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function oN(e){return function(t){e.call(this,t,this.__data__)}}function aN(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 lN(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 uN(e,t,n){return function(){var i=this.__on,o,a=oN(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 cN(e,t,n){var i=aN(e+""),o,a=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,m;f<d;++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?uN:lN,o=0;o<a;++o)this.each(c(i[o],t,n));return this}function fw(e,t,n){var i=ow(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 fN(e,t){return function(){return fw(this,e,t)}}function dN(e,t){return function(){return fw(this,e,t.apply(this,arguments))}}function hN(e,t){return this.each((typeof t=="function"?dN:fN)(e,t))}function*pN(){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 dw=[null];function Wt(e,t){this._groups=e,this._parents=t}function Bo(){return new Wt([[document.documentElement]],dw)}function mN(){return this}Wt.prototype=Bo.prototype={constructor:Wt,select:BS,selectAll:HS,selectChild:GS,selectChildren:ZS,filter:eE,data:oE,enter:tE,exit:lE,join:uE,merge:cE,selection:mN,order:fE,sort:dE,call:pE,nodes:mE,node:gE,size:yE,empty:vE,each:wE,attr:_E,style:IE,property:RE,classed:$E,text:VE,html:qE,raise:KE,lower:XE,append:QE,insert:ZE,remove:tN,clone:iN,datum:sN,on:cN,dispatch:hN,[Symbol.iterator]:pN};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],dw)}function gN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=gN(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 yN={passive:!1},Oo={capture:!0,passive:!1};function $f(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function hw(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 pw(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:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value: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:d,enumerable:!0,configurable:!0},_:{value:m}})}uh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vN(e){return!e.ctrlKey&&!e.button}function wN(){return this.parentNode}function xN(e,t){return t??{x:e.x,y:e.y}}function bN(){return navigator.maxTouchPoints||"ontouchstart"in this}function mw(){var e=vN,t=wN,n=xN,i=bN,o={},a=pu("start","drag","end"),l=0,c,f,d,m,h=0;function g(C){C.on("mousedown.drag",v).filter(i).on("touchstart.drag",b).on("touchmove.drag",E,yN).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,A){if(!(m||!e.call(this,C,A))){var M=S(this,t.call(this,C,A),C,A,"mouse");M&&(Vt(C.view).on("mousemove.drag",x,Oo).on("mouseup.drag",w,Oo),hw(C.view),$f(C),d=!1,c=C.clientX,f=C.clientY,M("start",C))}}function x(C){if(es(C),!d){var A=C.clientX-c,M=C.clientY-f;d=A*A+M*M>h}o.mouse("drag",C)}function w(C){Vt(C.view).on("mousemove.drag mouseup.drag",null),pw(C.view,d),es(C),o.mouse("end",C)}function b(C,A){if(e.call(this,C,A)){var M=C.changedTouches,D=t.call(this,C,A),T=M.length,O,z;for(O=0;O<T;++O)(z=S(this,D,C,A,M[O].identifier,M[O]))&&($f(C),z("start",C,M[O]))}}function E(C){var A=C.changedTouches,M=A.length,D,T;for(D=0;D<M;++D)(T=o[A[D].identifier])&&(es(C),T("drag",C,A[D]))}function _(C){var A=C.changedTouches,M=A.length,D,T;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),D=0;D<M;++D)(T=o[A[D].identifier])&&($f(C),T("end",C,A[D]))}function S(C,A,M,D,T,O){var z=a.copy(),R=dn(O||M,A),L,G,j;if((j=n.call(C,new uh("beforestart",{sourceEvent:M,target:g,identifier:T,active:l,x:R[0],y:R[1],dx:0,dy:0,dispatch:z}),D))!=null)return L=j.x-R[0]||0,G=j.y-R[1]||0,function X(Y,Z,q){var H=R,B;switch(Y){case"start":o[T]=X,B=l++;break;case"end":delete o[T],--l;case"drag":R=dn(q||Z,A),B=l;break}z.call(Y,C,new uh(Y,{sourceEvent:Z,subject:j,target:g,identifier:T,active:B,x:R[0]+L,y:R[1]+G,dx:R[0]-H[0],dy:R[1]-H[1],dispatch:z}),D)}}return g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ml(!!C),g):e},g.container=function(C){return arguments.length?(t=typeof C=="function"?C:ml(C),g):t},g.subject=function(C){return arguments.length?(n=typeof C=="function"?C:ml(C),g):n},g.touchable=function(C){return arguments.length?(i=typeof C=="function"?C:ml(!!C),g):i},g.on=function(){var C=a.on.apply(a,arguments);return C===a?g:C},g.clickDistance=function(C){return arguments.length?(h=(C=+C)*C,g):Math.sqrt(h)},g}function $h(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gw(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*",Mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kN=/^#([0-9a-f]{3,8})$/,SN=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),EN=new RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`),NN=new RegExp(`^rgba\\(${ts},${ts},${ts},${Po}\\)$`),_N=new RegExp(`^rgba\\(${Mn},${Mn},${Mn},${Po}\\)$`),CN=new RegExp(`^hsl\\(${Po},${Mn},${Mn}\\)$`),TN=new RegExp(`^hsla\\(${Po},${Mn},${Mn},${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:ON,formatHsl:IN,formatRgb:cy,toString:cy});function uy(){return this.rgb().formatHex()}function ON(){return this.rgb().formatHex8()}function IN(){return yw(this).formatHsl()}function cy(){return this.rgb().formatRgb()}function ai(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=kN.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=SN.exec(e))?new Mt(t[1],t[2],t[3],1):(t=EN.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NN.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=_N.exec(e))?gl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=CN.exec(e))?py(t[1],t[2]/100,t[3]/100,1):(t=TN.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 PN(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?PN(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,gw(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:AN,formatRgb:hy,toString:hy}));function dy(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function AN(){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 yw(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 MN(e,t,n,i){return arguments.length===1?yw(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,MN,gw(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 RN(e,t){return function(n){return e+n*t}}function LN(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 jN(e){return(e=+e)==1?vw:function(t,n){return n-t?LN(t,n,e):zh(isNaN(t)?n:t)}}function vw(e,t){var n=t-e;return n?RN(e,n):zh(isNaN(e)?t:e)}const Jl=(function e(t){var n=jN(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),d=vw(o.opacity,a.opacity);return function(m){return o.r=l(m),o.g=c(m),o.b=f(m),o.opacity=d(m),o+""}}return i.gamma=e,i})(1);function DN(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 $N(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zN(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 FN(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Pn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function BN(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 VN(e){return function(){return e}}function WN(e){return function(t){return e(t)+""}}function ww(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:Pn(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]?WN(f[0].x):VN(t):(t=f.length,function(d){for(var m=0,h;m<t;++m)c[(h=f[m]).i]=h.x(d);return c.join("")})}function No(e,t){var n=typeof t,i;return t==null||n==="boolean"?zh(t):(n==="number"?Pn:n==="string"?(i=ai(t))?(t=i,Jl):ww:t instanceof ai?Jl:t instanceof Date?FN:$N(t)?DN:Array.isArray(t)?zN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?BN:Pn)(e,t)}var gy=180/Math.PI,dh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xw(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 UN(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?dh:xw(t.a,t.b,t.c,t.d,t.e,t.f)}function HN(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,xw(e.a,e.b,e.c,e.d,e.e,e.f))}function bw(e,t,n,i){function o(d){return d.length?d.pop()+" ":""}function a(d,m,h,g,v,x){if(d!==h||m!==g){var w=v.push("translate(",null,t,null,n);x.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h||g)&&v.push("translate("+h+t+g+n)}function l(d,m,h,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Pn(d,m)})):m&&h.push(o(h)+"rotate("+m+i)}function c(d,m,h,g){d!==m?g.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Pn(d,m)}):m&&h.push(o(h)+"skewX("+m+i)}function f(d,m,h,g,v,x){if(d!==h||m!==g){var w=v.push(o(v)+"scale(",null,",",null,")");x.push({i:w-4,x:Pn(d,h)},{i:w-2,x:Pn(m,g)})}else(h!==1||g!==1)&&v.push(o(v)+"scale("+h+","+g+")")}return function(d,m){var h=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,h,g),l(d.rotate,m.rotate,h,g),c(d.skewX,m.skewX,h,g),f(d.scaleX,d.scaleY,m.scaleX,m.scaleY,h,g),d=m=null,function(v){for(var x=-1,w=g.length,b;++x<w;)h[(b=g[x]).i]=b.x(v);return h.join("")}}}var qN=bw(UN,"px, ","px)","deg)"),YN=bw(HN,", ",")",")"),KN=1e-12;function yy(e){return((e=Math.exp(e))+1/e)/2}function GN(e){return((e=Math.exp(e))-1/e)/2}function XN(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],d=a[2],m=l[0],h=l[1],g=l[2],v=m-c,x=h-f,w=v*v+x*x,b,E;if(w<KN)E=Math.log(g/d)/t,b=function(D){return[c+D*v,f+D*x,d*Math.exp(t*D*E)]};else{var _=Math.sqrt(w),S=(g*g-d*d+i*w)/(2*d*n*_),C=(g*g-d*d-i*w)/(2*g*n*_),A=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(C*C+1)-C);E=(M-A)/t,b=function(D){var T=D*E,O=yy(A),z=d/(n*_)*(O*XN(t*T+A)-GN(A));return[c+z*v,f+z*x,d*O/yy(t*T+A)]}}return b.duration=E*1e3*t/Math.SQRT2,b}return o.rho=function(a){var l=Math.max(.001,+a),c=l*l,f=c*c;return e(l,c,f)},o})(Math.SQRT2,2,4);var os=0,wo=0,po=0,kw=1e3,Zl,xo,eu=0,li=0,gu=0,Ao=typeof performance=="object"&&performance.now?performance:Date,Sw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fh(){return li||(Sw(QN),li=Ao.now()+gu)}function QN(){li=0}function tu(){this._call=this._time=this._next=null}tu.prototype=Ew.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 Ew(e,t,n){var i=new tu;return i.restart(e,t,n),i}function JN(){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{JN()}finally{os=0,e_(),li=0}}function ZN(){var e=Ao.now(),t=e-eu;t>kw&&(gu-=t,eu=e)}function e_(){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(ZN,kw)),os=1,Sw(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 t_=pu("start","end","cancel","interrupt"),n_=[],Nw=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;r_(e,n,{name:t,index:i,group:o,on:t_,tween:n_,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Nw})}function Bh(e,t){var n=vn(e,t);if(n.state>Nw)throw new Error("too late; already scheduled");return n}function Ln(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 r_(e,t,n){var i=e.__transition,o;i[t]=n,n.timer=Ew(a,0,n.time);function a(d){n.state=xy,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var m,h,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(d))}),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,h=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(o[++h]=v);o.length=h+1}}function c(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=mh,1),h=-1,g=o.length;++h<g;)o[h].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 d 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 i_(e){return this.each(function(){Wl(this,e)})}function s_(e,t){var n,i;return function(){var o=Ln(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 o_(e,t,n){var i,o;if(typeof n!="function")throw new Error;return function(){var a=Ln(this,e),l=a.tween;if(l!==i){o=(i=l).slice();for(var c={name:t,value:n},f=0,d=o.length;f<d;++f)if(o[f].name===t){o[f]=c;break}f===d&&o.push(c)}a.tween=o}}function a_(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?s_:o_)(n,e,t))}function Vh(e,t,n){var i=e._id;return e.each(function(){var o=Ln(this,i);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return vn(o,i).value[t]}}function _w(e,t){var n;return(typeof t=="number"?Pn:t instanceof ai?Jl:(n=ai(t))?(t=n,Jl):ww)(e,t)}function l_(e){return function(){this.removeAttribute(e)}}function u_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c_(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 f_(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 d_(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 h_(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 p_(e,t){var n=mu(e),i=n==="transform"?YN:_w;return this.attrTween(e,typeof t=="function"?(n.local?h_:d_)(n,i,Vh(this,"attr."+e,t)):t==null?(n.local?u_:l_)(n):(n.local?f_:c_)(n,i,t))}function m_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function g_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function y_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&g_(e,a)),n}return o._value=t,o}function v_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&m_(e,a)),n}return o._value=t,o}function w_(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?y_:v_)(i,t))}function x_(e,t){return function(){Bh(this,e).delay=+t.apply(this,arguments)}}function b_(e,t){return t=+t,function(){Bh(this,e).delay=t}}function k_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?x_:b_)(t,e)):vn(this.node(),t).delay}function S_(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function E_(e,t){return t=+t,function(){Ln(this,e).duration=t}}function N_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?S_:E_)(t,e)):vn(this.node(),t).duration}function __(e,t){if(typeof t!="function")throw new Error;return function(){Ln(this,e).ease=t}}function C_(e){var t=this._id;return arguments.length?this.each(__(t,e)):vn(this.node(),t).ease}function T_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ln(this,e).ease=n}}function O_(e){if(typeof e!="function")throw new Error;return this.each(T_(this._id,e))}function I_(e){typeof e!="function"&&(e=rw(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,d=0;d<l;++d)(f=a[d])&&e.call(f,f.__data__,d,a)&&c.push(f);return new er(i,this._parents,this._name,this._id)}function P_(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],d=n[c],m=f.length,h=l[c]=new Array(m),g,v=0;v<m;++v)(g=f[v]||d[v])&&(h[v]=g);for(;c<i;++c)l[c]=t[c];return new er(l,this._parents,this._name,this._id)}function A_(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 M_(e,t,n){var i,o,a=A_(t)?Bh:Ln;return function(){var l=a(this,e),c=l.on;c!==i&&(o=(i=c).copy()).on(t,n),l.on=o}}function R_(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(M_(n,e,t))}function L_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function j_(){return this.on("end.remove",L_(this._id))}function D_(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,d=a[l]=new Array(f),m,h,g=0;g<f;++g)(m=c[g])&&(h=e.call(m,m.__data__,g,c))&&("__data__"in m&&(h.__data__=m.__data__),d[g]=h,yu(d[g],t,n,g,d,vn(m,n)));return new er(a,this._parents,t,n)}function $_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nw(e));for(var i=this._groups,o=i.length,a=[],l=[],c=0;c<o;++c)for(var f=i[c],d=f.length,m,h=0;h<d;++h)if(m=f[h]){for(var g=e.call(m,m.__data__,h,f),v,x=vn(m,n),w=0,b=g.length;w<b;++w)(v=g[w])&&yu(v,t,n,w,g,x);a.push(g),l.push(m)}return new er(a,l,t,n)}var z_=Bo.prototype.constructor;function F_(){return new z_(this._groups,this._parents)}function B_(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 Cw(e){return function(){this.style.removeProperty(e)}}function V_(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 W_(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 U_(e,t){var n,i,o,a="style."+t,l="end."+a,c;return function(){var f=Ln(this,e),d=f.on,m=f.value[a]==null?c||(c=Cw(t)):void 0;(d!==n||o!==m)&&(i=(n=d).copy()).on(l,o=m),f.on=i}}function H_(e,t,n){var i=(e+="")=="transform"?qN:_w;return t==null?this.styleTween(e,B_(e,i)).on("end.style."+e,Cw(e)):typeof t=="function"?this.styleTween(e,W_(e,i,Vh(this,"style."+e,t))).each(U_(this._id,e)):this.styleTween(e,V_(e,i,t),n).on("end.style."+e,null)}function q_(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function Y_(e,t,n){var i,o;function a(){var l=t.apply(this,arguments);return l!==o&&(i=(o=l)&&q_(e,l,n)),i}return a._value=t,a}function K_(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,Y_(e,t,n??""))}function G_(e){return function(){this.textContent=e}}function X_(e){return function(){var t=e(this);this.textContent=t??""}}function Q_(e){return this.tween("text",typeof e=="function"?X_(Vh(this,"text",e)):G_(e==null?"":e+""))}function J_(e){return function(t){this.textContent=e.call(this,t)}}function Z_(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&J_(o)),t}return i._value=e,i}function eC(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,Z_(e))}function tC(){for(var e=this._name,t=this._id,n=Tw(),i=this._groups,o=i.length,a=0;a<o;++a)for(var l=i[a],c=l.length,f,d=0;d<c;++d)if(f=l[d]){var m=vn(f,t);yu(f,e,n,d,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new er(i,this._parents,e,n)}function nC(){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 d=Ln(this,i),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),o===0&&a()})}var rC=0;function er(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Tw(){return++rC}var Kn=Bo.prototype;er.prototype={constructor:er,select:D_,selectAll:$_,selectChild:Kn.selectChild,selectChildren:Kn.selectChildren,filter:I_,merge:P_,selection:F_,transition:tC,call:Kn.call,nodes:Kn.nodes,node:Kn.node,size:Kn.size,empty:Kn.empty,each:Kn.each,on:R_,attr:p_,attrTween:w_,style:H_,styleTween:K_,text:Q_,textTween:eC,remove:j_,tween:a_,delay:k_,duration:N_,ease:C_,easeVarying:O_,end:nC,[Symbol.iterator]:Kn[Symbol.iterator]};function iC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sC={time:null,delay:0,duration:250,ease:iC};function oC(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 aC(e){var t,n;e instanceof er?(t=e._id,e=e._name):(t=Tw(),(n=sC).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,d=0;d<c;++d)(f=l[d])&&yu(f,e,t,d,l,n||oC(f,t));return new er(i,this._parents,e,t)}Bo.prototype.interrupt=i_;Bo.prototype.transition=aC;const wl=e=>()=>e;function lC(e,{sourceEvent:t,target:n,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Xn(e,t,n){this.k=e,this.x=t,this.y=n}Xn.prototype={constructor:Xn,scale:function(e){return e===1?this:new Xn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var vu=new Xn(1,0,0);Ow.prototype=Xn.prototype;function Ow(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 uC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function cC(){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 fC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dC(){return navigator.maxTouchPoints||"ontouchstart"in this}function hC(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function Iw(){var e=uC,t=cC,n=hC,i=fC,o=dC,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=Fl,d=pu("start","zoom","end"),m,h,g,v=500,x=150,w=0,b=10;function E(j){j.property("__zoom",ky).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",z).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(j,X,Y,Z){var q=j.selection?j.selection():j;q.property("__zoom",ky),j!==q?A(j,X,Y,Z):q.interrupt().each(function(){M(this,arguments).event(Z).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},E.scaleBy=function(j,X,Y,Z){E.scaleTo(j,function(){var q=this.__zoom.k,H=typeof X=="function"?X.apply(this,arguments):X;return q*H},Y,Z)},E.scaleTo=function(j,X,Y,Z){E.transform(j,function(){var q=t.apply(this,arguments),H=this.__zoom,B=Y==null?C(q):typeof Y=="function"?Y.apply(this,arguments):Y,$=H.invert(B),U=typeof X=="function"?X.apply(this,arguments):X;return n(S(_(H,U),B,$),q,l)},Y,Z)},E.translateBy=function(j,X,Y,Z){E.transform(j,function(){return n(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),l)},null,Z)},E.translateTo=function(j,X,Y,Z,q){E.transform(j,function(){var H=t.apply(this,arguments),B=this.__zoom,$=Z==null?C(H):typeof Z=="function"?Z.apply(this,arguments):Z;return n(vu.translate($[0],$[1]).scale(B.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof Y=="function"?-Y.apply(this,arguments):-Y),H,l)},Z,q)};function _(j,X){return X=Math.max(a[0],Math.min(a[1],X)),X===j.k?j:new Xn(X,j.x,j.y)}function S(j,X,Y){var Z=X[0]-Y[0]*j.k,q=X[1]-Y[1]*j.k;return Z===j.x&&q===j.y?j:new Xn(j.k,Z,q)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function A(j,X,Y,Z){j.on("start.zoom",function(){M(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(Z).end()}).tween("zoom",function(){var q=this,H=arguments,B=M(q,H).event(Z),$=t.apply(q,H),U=Y==null?C($):typeof Y=="function"?Y.apply(q,H):Y,V=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),W=q.__zoom,Q=typeof X=="function"?X.apply(q,H):X,re=f(W.invert(U).concat(V/W.k),Q.invert(U).concat(V/Q.k));return function(oe){if(oe===1)oe=Q;else{var ee=re(oe),se=V/ee[2];oe=new Xn(se,U[0]-ee[0]*se,U[1]-ee[1]*se)}B.zoom(null,oe)}})}function M(j,X,Y){return!Y&&j.__zooming||new D(j,X)}function D(j,X){this.that=j,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,X),this.taps=0}D.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,X){return this.mouse&&j!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var X=Vt(this.that).datum();d.call(j,this.that,new lC(j,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:d}),X)}};function T(j,...X){if(!e.apply(this,arguments))return;var Y=M(this,X).event(j),Z=this.__zoom,q=Math.max(a[0],Math.min(a[1],Z.k*Math.pow(2,i.apply(this,arguments)))),H=dn(j);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===q)return;Y.mouse=[H,Z.invert(H)],Wl(this),Y.start()}mo(j),Y.wheel=setTimeout(B,x),Y.zoom("mouse",n(S(_(Z,q),Y.mouse[0],Y.mouse[1]),Y.extent,l));function B(){Y.wheel=null,Y.end()}}function O(j,...X){if(g||!e.apply(this,arguments))return;var Y=j.currentTarget,Z=M(this,X,!0).event(j),q=Vt(j.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",V,!0),H=dn(j,Y),B=j.clientX,$=j.clientY;hw(j.view),Bf(j),Z.mouse=[H,this.__zoom.invert(H)],Wl(this),Z.start();function U(W){if(mo(W),!Z.moved){var Q=W.clientX-B,re=W.clientY-$;Z.moved=Q*Q+re*re>w}Z.event(W).zoom("mouse",n(S(Z.that.__zoom,Z.mouse[0]=dn(W,Y),Z.mouse[1]),Z.extent,l))}function V(W){q.on("mousemove.zoom mouseup.zoom",null),pw(W.view,Z.moved),mo(W),Z.event(W).end()}}function z(j,...X){if(e.apply(this,arguments)){var Y=this.__zoom,Z=dn(j.changedTouches?j.changedTouches[0]:j,this),q=Y.invert(Z),H=Y.k*(j.shiftKey?.5:2),B=n(S(_(Y,H),Z,q),t.apply(this,X),l);mo(j),c>0?Vt(this).transition().duration(c).call(A,B,Z,j):Vt(this).call(E.transform,B,Z,j)}}function R(j,...X){if(e.apply(this,arguments)){var Y=j.touches,Z=Y.length,q=M(this,X,j.changedTouches.length===Z).event(j),H,B,$,U;for(Bf(j),B=0;B<Z;++B)$=Y[B],U=dn($,this),U=[U,this.__zoom.invert(U),$.identifier],q.touch0?!q.touch1&&q.touch0[2]!==U[2]&&(q.touch1=U,q.taps=0):(q.touch0=U,H=!0,q.taps=1+!!m);m&&(m=clearTimeout(m)),H&&(q.taps<2&&(h=U[0],m=setTimeout(function(){m=null},v)),Wl(this),q.start())}}function L(j,...X){if(this.__zooming){var Y=M(this,X).event(j),Z=j.changedTouches,q=Z.length,H,B,$,U;for(mo(j),H=0;H<q;++H)B=Z[H],$=dn(B,this),Y.touch0&&Y.touch0[2]===B.identifier?Y.touch0[0]=$:Y.touch1&&Y.touch1[2]===B.identifier&&(Y.touch1[0]=$);if(B=Y.that.__zoom,Y.touch1){var V=Y.touch0[0],W=Y.touch0[1],Q=Y.touch1[0],re=Y.touch1[1],oe=(oe=Q[0]-V[0])*oe+(oe=Q[1]-V[1])*oe,ee=(ee=re[0]-W[0])*ee+(ee=re[1]-W[1])*ee;B=_(B,Math.sqrt(oe/ee)),$=[(V[0]+Q[0])/2,(V[1]+Q[1])/2],U=[(W[0]+re[0])/2,(W[1]+re[1])/2]}else if(Y.touch0)$=Y.touch0[0],U=Y.touch0[1];else return;Y.zoom("touch",n(S(B,$,U),Y.extent,l))}}function G(j,...X){if(this.__zooming){var Y=M(this,X).event(j),Z=j.changedTouches,q=Z.length,H,B;for(Bf(j),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),H=0;H<q;++H)B=Z[H],Y.touch0&&Y.touch0[2]===B.identifier?delete Y.touch0:Y.touch1&&Y.touch1[2]===B.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&&(B=dn(B,this),Math.hypot(h[0]-B[0],h[1]-B[1])<b)){var $=Vt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return E.wheelDelta=function(j){return arguments.length?(i=typeof j=="function"?j:wl(+j),E):i},E.filter=function(j){return arguments.length?(e=typeof j=="function"?j:wl(!!j),E):e},E.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:wl(!!j),E):o},E.extent=function(j){return arguments.length?(t=typeof j=="function"?j:wl([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),E):t},E.scaleExtent=function(j){return arguments.length?(a[0]=+j[0],a[1]=+j[1],E):[a[0],a[1]]},E.translateExtent=function(j){return arguments.length?(l[0][0]=+j[0][0],l[1][0]=+j[1][0],l[0][1]=+j[0][1],l[1][1]=+j[1][1],E):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},E.constrain=function(j){return arguments.length?(n=j,E):n},E.duration=function(j){return arguments.length?(c=+j,E):c},E.interpolate=function(j){return arguments.length?(f=j,E):f},E.on=function(){var j=d.on.apply(d,arguments);return j===d?E:j},E.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,E):Math.sqrt(w)},E.tapDistance=function(j){return arguments.length?(b=+j,E):b},E}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]],Pw=["Enter"," ","Escape"],Aw={"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 Mw={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 Rw(e){return e===null?null:e?"valid":"invalid"}const Lw=e=>"id"in e&&"source"in e&&"target"in e,pC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Wh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Wo=(e,t=[0,0])=>{const{width:n,height:i}=tr(e),o=e.origin??t,a=n*o[0],l=i*o[1];return{x:e.position.x-a,y:e.position.y-l}},mC=(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 d of e.values()){const{measured:m,selectable:h=!0,hidden:g=!1}=d;if(l&&!h||g)continue;const v=m.width??d.width??d.initialWidth??null,x=m.height??d.height??d.initialHeight??null,w=Lo(c,us(d)),b=(v??0)*(x??0),E=a&&w>0;(!d.internals.handleBounds||E||w>=b||d.dragging)&&f.push(d)}return f},gC=(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 yC(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 vC({nodes:e,width:t,height:n,panZoom:i,minZoom:o,maxZoom:a},l){if(e.size===0)return!0;const c=yC(e,l),f=Uo(c),d=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(d,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function jw({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:d}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let h=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&&(h=[[f,d],[f+v,d+x]])}else c&&ci(l.extent)&&(h=[[l.extent[0][0]+f,l.extent[0][1]+d],[l.extent[1][0]+f,l.extent[1][1]+d]]);const g=ci(h)?ui(t,h,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-d+(l.measured.height??0)*m[1]},positionAbsolute:g}}async function wC({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=gC(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 h=await o({nodes:l,edges:m});return typeof h=="boolean"?h?{edges:m,nodes:l}:{edges:[],nodes:[]}:h}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 Dw(e,t,n){const{width:i,height:o}=tr(n),{x:a,y:l}=n.internals.positionAbsolute;return ui(e,[[a,l],[a+i,l+o]],t)}const Ey=(e,t,n)=>e<t?ls(Math.abs(e-t),1,t)/t:e>n?-ls(Math.abs(e-n),1,t)/t:0,Hh=(e,t,n=15,i=40)=>{const o=Ey(e.x,i,t.width-i)*n,a=Ey(e.y,i,t.height-i)*n;return[o,a]},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)}},$w=(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),zw=(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 xC(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 bC(e,t,n,i,o,a){const{x:l,y:c}=cs(e,[t,n,i]),{x:f,y:d}=cs({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=o-f,h=a-d;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(h)}}const qh=(e,t,n,i,o,a)=>{const l=xC(a,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,d=Math.min(c,f),m=ls(d,i,o),h=e.x+e.width/2,g=e.y+e.height/2,v=t/2-h*m,x=n/2-g*m,w=bC(e,v,x,m,t,n),b={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:v-b.left+b.right,y:x-b.top+b.bottom,zoom:m}},jo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ci(e){return e!=null&&e!=="parent"}function tr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Fw(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 Bw(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 kC(){let e,t;return{promise:new Promise((i,o)=>{e=i,t=o}),resolve:e,reject:t}}function SC(e){return{...Aw,...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:d}=n?Ho(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Yh=e=>({width:e.offsetWidth,height:e.offsetHeight}),Vw=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},EC=["INPUT","SELECT","TEXTAREA"];function Ww(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:EC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Uw=e=>"clientX"in e,mn=(e,t)=>{var a,l;const n=Uw(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 Hw({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,d=t*.125+a*.375+c*.375+i*.125,m=Math.abs(f-e),h=Math.abs(d-t);return[f,d,m,h]}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 qw({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}),[d,m]=Ty({pos:a,x1:i,y1:o,x2:e,y2:t,c:l}),[h,g,v,x]=Hw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:m});return[`M${e},${t} C${c},${f} ${d},${m} ${i},${o}`,h,g,v,x]}function Yw({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 NC({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 _C({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 CC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,TC=(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)),OC=(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||CC;let o;return Lw(e)?o={...e}:o={...e,id:i(e)},TC(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Kw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[o,a,l,c]=Yw({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}},IC=({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 PC({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],d={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},h=IC({source:d,sourcePosition:t,target:m}),g=h.x!==0?"x":"y",v=h[g];let x=[],w,b;const E={x:0,y:0},_={x:0,y:0},[,,S,C]=Yw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(w=o.x??d.x+(m.x-d.x)*l,b=o.y??(d.y+m.y)/2):(w=o.x??(d.x+m.x)/2,b=o.y??d.y+(m.y-d.y)*l);const T=[{x:w,y:d.y},{x:w,y:m.y}],O=[{x:d.x,y:b},{x:m.x,y:b}];c[g]===v?x=g==="x"?T:O:x=g==="x"?O:T}else{const T=[{x:d.x,y:m.y}],O=[{x:m.x,y:d.y}];if(g==="x"?x=c.x===v?O:T:x=c.y===v?T:O,t===i){const j=Math.abs(e[g]-n[g]);if(j<=a){const X=Math.min(a-1,a-j);c[g]===v?E[g]=(d[g]>e[g]?-1:1)*X:_[g]=(m[g]>n[g]?-1:1)*X}}if(t!==i){const j=g==="x"?"y":"x",X=c[g]===f[j],Y=d[j]>m[j],Z=d[j]<m[j];(c[g]===1&&(!X&&Y||X&&Z)||c[g]!==1&&(!X&&Z||X&&Y))&&(x=g==="x"?T:O)}const z={x:d.x+E.x,y:d.y+E.y},R={x:m.x+_.x,y:m.y+_.y},L=Math.max(Math.abs(z.x-x[0].x),Math.abs(R.x-x[0].x)),G=Math.max(Math.abs(z.y-x[0].y),Math.abs(R.y-x[0].y));L>=G?(w=(z.x+R.x)/2,b=x[0].y):(w=x[0].x,b=(z.y+R.y)/2)}const A={x:d.x+E.x,y:d.y+E.y},M={x:m.x+_.x,y:m.y+_.y};return[[e,...A.x!==x[0].x||A.y!==x[0].y?[A]:[],...x,...M.x!==x[x.length-1].x||M.y!==x[x.length-1].y?[M]:[],n],w,b,S,C]}function AC(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 d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${a+o*d},${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:d=20,stepPosition:m=.5}){const[h,g,v,x,w]=PC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:o},targetPosition:a,center:{x:c,y:f},offset:d,stepPosition:m});let b=`M${h[0].x} ${h[0].y}`;for(let E=1;E<h.length-1;E++)b+=AC(h[E-1],h[E],h[E+1],l);return b+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[b,g,v,x,w]}function Py(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function MC(e){var h;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(h=e.onError)==null||h.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,d=fi(t,a,c),m=fi(n,l,f);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function Ay(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function fi(e,t,n=ke.Left,i=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??tr(e);if(i)return{x:o+l/2,y:a+c/2};switch((t==null?void 0:t.position)??n){case ke.Top:return{x:o+l/2,y:a};case ke.Right:return{x:o+l,y:a+c/2};case ke.Bottom:return{x:o+l/2,y:a+c};case ke.Left:return{x:o,y:a+c/2}}}function My(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function vh(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function RC(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 d=vh(f,t);a.has(d)||(l.push({id:d,color:f.color||n,...f}),a.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Gw=1e3,LC=10,Kh={nodeOrigin:[0,0],nodeExtent:Mo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jC={...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 DC(e,t,n){const i=Gh(Kh,n);for(const o of e.values())if(o.parentId)Qh(o,e,t,i);else{const a=Wo(o,i.nodeOrigin),l=ci(o.extent)?o.extent:i.nodeExtent,c=ui(a,l,tr(o));o.internals.positionAbsolute=c}}function $C(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,h;const o=Gh(jC,i),a={i:0},l=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!Xh(o.zIndexMode)?Gw:0;let f=e.length>0,d=!1;t.clear(),n.clear();for(const g of e){let v=l.get(g.id);if(o.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const x=Wo(g,o.nodeOrigin),w=ci(g.extent)?g.extent:o.nodeExtent,b=ui(x,w,tr(g));v={...o.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(h=g.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:$C(g,v),z:Xw(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),d||(d=g.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:d}}function zC(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),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}zC(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*LC),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const h=a&&!Xh(f)?Gw:0,{x:g,y:v,z:x}=FC(e,m,l,c,h,f),{positionAbsolute:w}=e.internals,b=g!==w.x||v!==w.y;(b||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y:v}:w,z:x}})}function Xw(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return Xh(n)?i:i+(e.selected?t:0)}function FC(e,t,n,i,o,a){const{x:l,y:c}=t.internals.positionAbsolute,f=tr(e),d=Wo(e,n),m=ci(e.extent)?ui(d,e.extent,f):d;let h=ui({x:l+m.x,y:c+m.y},i,f);e.extent==="parent"&&(h=Dw(h,f,t));const g=Xw(e,o,a),v=t.internals.z??0;return{x:h.x,y:h.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 d=((l=a.get(c.parentId))==null?void 0:l.expandedRect)??us(f),m=$w(d,c.rect);a.set(c.parentId,{expandedRect:m,parent:f})}return a.size>0&&a.forEach(({expandedRect:c,parent:f},d)=>{var S;const m=f.internals.positionAbsolute,h=tr(f),g=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,x=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(h.width,Math.round(c.width)),b=Math.max(h.height,Math.round(c.height)),E=(w-h.width)*g[0],_=(b-h.height)*g[1];(v>0||x>0||E||_)&&(o.push({id:d,type:"position",position:{x:f.position.x-v+E,y:f.position.y-x+_}}),(S=n.get(d))==null||S.forEach(C=>{e.some(A=>A.id===C.id)||o.push({id:C.id,type:"position",position:{x:C.position.x+v,y:C.position.y+x}})})),(h.width<c.width||h.height<c.height||v||x)&&o.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-E:0),height:b+(x?g[1]*x-_:0)}})}),o}function BC(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 d=[],m=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const x=t.get(v.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),f=!0;continue}const w=Yh(v.nodeElement),b=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(b||!x.internals.handleBounds||v.force))){const _=v.nodeElement.getBoundingClientRect(),S=ci(x.extent)?x.extent:a;let{positionAbsolute:C}=x.internals;x.parentId&&x.extent==="parent"?C=Dw(C,w,t.get(x.parentId)):S&&(C=ui(C,S,w));const A={...x,measured:w,internals:{...x.internals,positionAbsolute:C,handleBounds:{source:Cy("source",v.nodeElement,_,h,x.id),target:Cy("target",v.nodeElement,_,h,x.id)}}};t.set(x.id,A),x.parentId&&Qh(A,t,n,{nodeOrigin:o,zIndexMode:l}),f=!0,b&&(d.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);d.push(...v)}return{changes:d,updatedInternals:f}}async function VC({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 d=i.get(l)||new Map;i.set(l,d.set(n,t))}}function Qw(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},d=`${o}-${l}--${a}-${c}`,m=`${a}-${c}--${o}-${l}`;Ry("source",f,m,e,o,l),Ry("target",f,d,e,a,c),t.set(i.id,i)}}function Jw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Jw(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 WC(e,t,n,i){const o=new Map;for(const[a,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!Jw(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[d,m]of t){const h=(l=n.get(d))==null?void 0:l.internals.userNode;h&&o.push({...h,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 UC({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 HC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:o}){let a={x:null,y:null},l=0,c=new Map,f=!1,d={x:0,y:0},m=null,h=!1,g=null,v=!1,x=!1,w=null;function b({noDragClassName:_,handleSelector:S,domNode:C,isSelectable:A,nodeId:M,nodeClickDistance:D=0}){g=Vt(C);function T({x:L,y:G}){const{nodeLookup:j,nodeExtent:X,snapGrid:Y,snapToGrid:Z,nodeOrigin:q,onNodeDrag:H,onSelectionDrag:B,onError:$,updateNodePositions:U}=t();a={x:L,y:G};let V=!1;const W=c.size>1,Q=W&&X?gh(Uo(c)):null,re=W&&Z?UC({dragItems:c,snapGrid:Y,x:L,y:G}):null;for(const[oe,ee]of c){if(!j.has(oe))continue;let se={x:L-ee.distance.x,y:G-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(W&&X&&!ee.extent&&Q){const{positionAbsolute:fe}=ee.internals,Se=fe.x-Q.x+X[0][0],Pe=fe.x+ee.measured.width-Q.x2+X[1][0],Ae=fe.y-Q.y+X[0][1],Fe=fe.y+ee.measured.height-Q.y2+X[1][1];de=[[Se,Ae],[Pe,Fe]]}const{position:xe,positionAbsolute:he}=jw({nodeId:oe,nextPosition:se,nodeLookup:j,nodeExtent:de||X,nodeOrigin:q,onError:$});V=V||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=he}if(x=x||V,!!V&&(U(c,!0),w&&(i||H||!M&&B))){const[oe,ee]=Vf({nodeId:M,dragItems:c,nodeLookup:j});i==null||i(w,c,oe,ee),H==null||H(w,oe,ee),M||B==null||B(w,ee)}}async function O(){if(!m)return;const{transform:L,panBy:G,autoPanSpeed:j,autoPanOnNodeDrag:X}=t();if(!X){f=!1,cancelAnimationFrame(l);return}const[Y,Z]=Hh(d,m,j);(Y!==0||Z!==0)&&(a.x=(a.x??0)-Y/L[2],a.y=(a.y??0)-Z/L[2],await G({x:Y,y:Z})&&T(a)),l=requestAnimationFrame(O)}function z(L){var W;const{nodeLookup:G,multiSelectionActive:j,nodesDraggable:X,transform:Y,snapGrid:Z,snapToGrid:q,selectNodesOnDrag:H,onNodeDragStart:B,onSelectionDragStart:$,unselectNodesAndEdges:U}=t();h=!0,(!H||!A)&&!j&&M&&((W=G.get(M))!=null&&W.selected||U()),A&&H&&M&&(e==null||e(M));const V=_o(L.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:q,containerBounds:m});if(a=V,c=WC(G,X,V,M),c.size>0&&(n||B||!M&&$)){const[Q,re]=Vf({nodeId:M,dragItems:c,nodeLookup:G});n==null||n(L.sourceEvent,c,Q,re),B==null||B(L.sourceEvent,Q,re),M||$==null||$(L.sourceEvent,re)}}const R=mw().clickDistance(D).on("start",L=>{const{domNode:G,nodeDragThreshold:j,transform:X,snapGrid:Y,snapToGrid:Z}=t();m=(G==null?void 0:G.getBoundingClientRect())||null,v=!1,x=!1,w=L.sourceEvent,j===0&&z(L),a=_o(L.sourceEvent,{transform:X,snapGrid:Y,snapToGrid:Z,containerBounds:m}),d=mn(L.sourceEvent,m)}).on("drag",L=>{const{autoPanOnNodeDrag:G,transform:j,snapGrid:X,snapToGrid:Y,nodeDragThreshold:Z,nodeLookup:q}=t(),H=_o(L.sourceEvent,{transform:j,snapGrid:X,snapToGrid:Y,containerBounds:m});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||M&&!q.has(M))&&(v=!0),!v){if(!f&&G&&h&&(f=!0,O()),!h){const B=mn(L.sourceEvent,m),$=B.x-d.x,U=B.y-d.y;Math.sqrt($*$+U*U)>Z&&z(L)}(a.x!==H.xSnapped||a.y!==H.ySnapped)&&c&&h&&(d=mn(L.sourceEvent,m),T(H))}}).on("end",L=>{if(!h||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(f=!1,h=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:G,updateNodePositions:j,onNodeDragStop:X,onSelectionDragStop:Y}=t();if(x&&(j(c,!1),x=!1),o||X||!M&&Y){const[Z,q]=Vf({nodeId:M,dragItems:c,nodeLookup:G,dragging:!1});o==null||o(L.sourceEvent,c,Z,q),X==null||X(L.sourceEvent,Z,q),M||Y==null||Y(L.sourceEvent,q)}}}).filter(L=>{const G=L.target;return!L.button&&(!_||!Ly(G,`.${_}`,C))&&(!S||Ly(G,S,C))});g.call(R)}function E(){g==null||g.on(".drag",null)}return{update:b,destroy:E}}function qC(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 YC=250;function KC(e,t,n,i){var c,f;let o=[],a=1/0;const l=qC(e,n,t+YC);for(const d of l){const m=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((f=d.internals.handleBounds)==null?void 0:f.target)??[]];for(const h of m){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:g,y:v}=fi(d,h,h.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));x>t||(x<a?(o=[{...h,x:g,y:v}],a=x):x===a&&o.push({...h,x:g,y:v}))}}if(!o.length)return null;if(o.length>1){const d=i.type==="source"?"target":"source";return o.find(m=>m.type===d)??o[0]}return o[0]}function Zw(e,t,n,i,o,a=!1){var d,m,h;const l=i.get(e);if(!l)return null;const c=o==="strict"?(d=l.internals.handleBounds)==null?void 0:d[t]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((h=l.internals.handleBounds)==null?void 0:h.target)??[]],f=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return f&&a?{...f,...fi(l,f,f.position,!0)}:f}function ex(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function GC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const tx=()=>!0;function XC(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:o,edgeUpdaterType:a,isTarget:l,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:m,flowId:h,panBy:g,cancelConnection:v,onConnectStart:x,onConnect:w,onConnectEnd:b,isValidConnection:E=tx,onReconnectEnd:_,updateConnection:S,getTransform:C,getFromHandle:A,autoPanSpeed:M,dragThreshold:D=1,handleDomNode:T}){const O=Vw(e.target);let z=0,R;const{x:L,y:G}=mn(e),j=ex(a,T),X=c==null?void 0:c.getBoundingClientRect();let Y=!1;if(!X||!j)return;const Z=Zw(o,j,i,f,t);if(!Z)return;let q=mn(e,X),H=!1,B=null,$=!1,U=null;function V(){if(!m||!X)return;const[xe,he]=Hh(q,X,M);g({x:xe,y:he}),z=requestAnimationFrame(V)}const W={...Z,nodeId:o,type:j,position:Z.position},Q=f.get(o);let oe={inProgress:!0,isValid:null,from:fi(Q,W,ke.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:Q,to:q,toHandle:null,toPosition:Sy[W.position],toNode:null,pointer:q};function ee(){Y=!0,S(oe),x==null||x(e,{nodeId:o,handleId:i,handleType:j})}D===0&&ee();function se(xe){if(!Y){const{x:Fe,y:wt}=mn(xe),Nt=Fe-L,ht=wt-G;if(!(Nt*Nt+ht*ht>D*D))return;ee()}if(!A()||!W){de(xe);return}const he=C();q=mn(xe,X),R=KC(ys(q,he,!1,[1,1]),n,f,W),H||(V(),H=!0);const fe=nx(xe,{handle:R,connectionMode:t,fromNodeId:o,fromHandleId:i,fromType:l?"target":"source",isValidConnection:E,doc:O,lib:d,flowId:h,nodeLookup:f});U=fe.handleDomNode,B=fe.connection,$=GC(!!R,fe.isValid);const Se=f.get(o),Pe=Se?fi(Se,W,ke.Left,!0):oe.from,Ae={...oe,from:Pe,isValid:$,to:fe.toHandle&&$?cs({x:fe.toHandle.x,y:fe.toHandle.y},he):q,toHandle:fe.toHandle,toPosition:$&&fe.toHandle?fe.toHandle.position:Sy[W.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:q};S(Ae),oe=Ae}function de(xe){if(!("touches"in xe&&xe.touches.length>0)){if(Y){(R||U)&&B&&$&&(w==null||w(B));const{inProgress:he,...fe}=oe,Se={...fe,toPosition:oe.toHandle?oe.toPosition:null};b==null||b(xe,Se),a&&(_==null||_(xe,Se))}v(),cancelAnimationFrame(z),H=!1,$=!1,B=null,U=null,O.removeEventListener("mousemove",se),O.removeEventListener("mouseup",de),O.removeEventListener("touchmove",se),O.removeEventListener("touchend",de)}}O.addEventListener("mousemove",se),O.addEventListener("mouseup",de),O.addEventListener("touchmove",se),O.addEventListener("touchend",de)}function nx(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:o,fromType:a,doc:l,lib:c,flowId:f,isValidConnection:d=tx,nodeLookup:m}){const h=a==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:x}=mn(e),w=l.elementFromPoint(v,x),b=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,E={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const _=ex(void 0,b),S=b.getAttribute("data-nodeid"),C=b.getAttribute("data-handleid"),A=b.classList.contains("connectable"),M=b.classList.contains("connectableend");if(!S||!_)return E;const D={source:h?S:i,sourceHandle:h?C:o,target:h?i:S,targetHandle:h?o:C};E.connection=D;const O=A&&M&&(n===as.Strict?h&&_==="source"||!h&&_==="target":S!==i||C!==o);E.isValid=O&&d(D),E.toHandle=Zw(S,_,C,m,n,!0)}return E}const xh={onPointerDown:XC,isValid:nx};function QC({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const o=Vt(e);function a({translateExtent:c,width:f,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const x=S=>{if(S.sourceEvent.type!=="wheel"||!t)return;const C=n(),A=S.sourceEvent.ctrlKey&&jo()?10:1,M=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*m,D=C[2]*Math.pow(2,M*A);t.scaleTo(D)};let w=[0,0];const b=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},E=S=>{const C=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const A=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[A[0]-w[0],A[1]-w[1]];w=A;const D=i()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),T={x:C[0]-M[0]*D,y:C[1]-M[1]*D},O=[[0,0],[f,d]];t.setViewportConstrained({x:T.x,y:T.y,zoom:C[2]},O,c)},_=Iw().on("start",b).on("zoom",h?E:null).on("zoom.wheel",g?x:null);o.call(_,{})}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}`),rx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),JC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Uf=(e,t=0,n=JC,i=()=>{})=>{const o=typeof t=="number"&&t>0;return o||i(),o?e.transition().duration(t).ease(n).on("end",i):e},ix=e=>{const t=e.ctrlKey&&jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ZC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return m=>{if(Gi(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(m.ctrlKey&&l){const b=dn(m),E=ix(m),_=h*Math.pow(2,E);i.scaleTo(n,_,b,m);return}const g=m.deltaMode===1?20:1;let v=o===oi.Vertical?0:m.deltaX*g,x=o===oi.Horizontal?0:m.deltaY*g;!jo()&&m.shiftKey&&o!==oi.Vertical&&(v=m.deltaY*g,x=0),i.translateBy(n,-(v/h)*a,-(x/h)*a,{internal:!0});const w=bu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function e2({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 t2({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 n2({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:o}){return a=>{var l,c;e.usedRightMouseButton=!!(n&&rx(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 r2({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&&rx(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 i2({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:f,lib:d,connectionInProgress:m}){return h=>{var b;const g=e||t,v=n&&h.ctrlKey,x=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Gi(h,`${d}-flow__node`)||Gi(h,`${d}-flow__edge`)))return!0;if(!i&&!g&&!o&&!a&&!n||l||m&&!x||Gi(h,c)&&x||Gi(h,f)&&(!x||o&&x&&!e)||!n&&h.ctrlKey&&x)return!1;if(!n&&h.type==="touchstart"&&((b=h.touches)==null?void 0:b.length)>1)return h.preventDefault(),!1;if(!g&&!o&&!v&&x||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||x)&&w}}function s2({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:o,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),h=Iw().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(h);_({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");h.wheelDelta(ix);async function w(R,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?No:Fl).transform(Uf(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),R)}):!1}function b({noWheelClassName:R,noPanClassName:L,onPaneContextMenu:G,userSelectionActive:j,panOnScroll:X,panOnDrag:Y,panOnScrollMode:Z,panOnScrollSpeed:q,preventScrolling:H,zoomOnPinch:B,zoomOnScroll:$,zoomOnDoubleClick:U,zoomActivationKeyPressed:V,lib:W,onTransformChange:Q,connectionInProgress:re,paneClickDistance:oe,selectionOnDrag:ee}){j&&!d.isZoomingOrPanning&&E();const se=X&&!V&&!j;h.clickDistance(ee?1/0:!pn(oe)||oe<0?0:oe);const de=se?ZC({zoomPanValues:d,noWheelClassName:R,d3Selection:g,d3Zoom:h,panOnScrollMode:Z,panOnScrollSpeed:q,zoomOnPinch:B,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}):e2({noWheelClassName:R,preventScrolling:H,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=t2({zoomPanValues:d,onDraggingChange:f,onPanZoomStart:l});h.on("start",xe);const he=n2({zoomPanValues:d,panOnDrag:Y,onPaneContextMenu:!!G,onPanZoom:a,onTransformChange:Q});h.on("zoom",he);const fe=r2({zoomPanValues:d,panOnDrag:Y,panOnScroll:X,onPaneContextMenu:G,onPanZoomEnd:c,onDraggingChange:f});h.on("end",fe);const Se=i2({zoomActivationKeyPressed:V,panOnDrag:Y,zoomOnScroll:$,panOnScroll:X,zoomOnDoubleClick:U,zoomOnPinch:B,userSelectionActive:j,noPanClassName:L,noWheelClassName:R,lib:W,connectionInProgress:re});h.filter(Se),U?g.on("dblclick.zoom",x):g.on("dblclick.zoom",null)}function E(){h.on("zoom",null)}async function _(R,L,G){const j=Wf(R),X=h==null?void 0:h.constrain()(j,L,G);return X&&await w(X),X}async function S(R,L){const G=Wf(R);return await w(G,L),G}function C(R){if(g){const L=Wf(R),G=g.property("__zoom");(G.k!==R.zoom||G.x!==R.x||G.y!==R.y)&&(h==null||h.transform(g,L,null,{sync:!0}))}}function A(){const R=g?Ow(g.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function M(R,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?No:Fl).scaleTo(Uf(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),R)}):!1}async function D(R,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?No:Fl).scaleBy(Uf(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),R)}):!1}function T(R){h==null||h.scaleExtent(R)}function O(R){h==null||h.translateExtent(R)}function z(R){const L=!pn(R)||R<0?0:R;h==null||h.clickDistance(L)}return{update:b,destroy:E,setViewport:S,setViewportConstrained:_,getViewport:A,scaleTo:M,scaleBy:D,setScaleExtent:T,setTranslateExtent:O,syncViewport:C,setClickDistance:z}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function o2({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:o,affectsY:a}){const l=e-t,c=n-i,f=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(f[0]=f[0]*-1),c&&a&&(f[1]=f[1]*-1),f}function jy(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:o}}function Sr(e,t){return Math.max(0,t-e)}function Er(e,t){return Math.max(0,e-t)}function bl(e,t,n){return Math.max(0,t-e,e-n)}function Dy(e,t){return e?!t:t}function a2(e,t,n,i,o,a,l,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:m,isVertical:h}=t,g=m&&h,{xSnapped:v,ySnapped:x}=n,{minWidth:w,maxWidth:b,minHeight:E,maxHeight:_}=i,{x:S,y:C,width:A,height:M,aspectRatio:D}=e;let T=Math.floor(m?v-e.pointerX:0),O=Math.floor(h?x-e.pointerY:0);const z=A+(f?-T:T),R=M+(d?-O:O),L=-a[0]*A,G=-a[1]*M;let j=bl(z,w,b),X=bl(R,E,_);if(l){let q=0,H=0;f&&T<0?q=Sr(S+T+L,l[0][0]):!f&&T>0&&(q=Er(S+z+L,l[1][0])),d&&O<0?H=Sr(C+O+G,l[0][1]):!d&&O>0&&(H=Er(C+R+G,l[1][1])),j=Math.max(j,q),X=Math.max(X,H)}if(c){let q=0,H=0;f&&T>0?q=Er(S+T,c[0][0]):!f&&T<0&&(q=Sr(S+z,c[1][0])),d&&O>0?H=Er(C+O,c[0][1]):!d&&O<0&&(H=Sr(C+R,c[1][1])),j=Math.max(j,q),X=Math.max(X,H)}if(o){if(m){const q=bl(z/D,E,_)*D;if(j=Math.max(j,q),l){let H=0;!f&&!d||f&&!d&&g?H=Er(C+G+z/D,l[1][1])*D:H=Sr(C+G+(f?T:-T)/D,l[0][1])*D,j=Math.max(j,H)}if(c){let H=0;!f&&!d||f&&!d&&g?H=Sr(C+z/D,c[1][1])*D:H=Er(C+(f?T:-T)/D,c[0][1])*D,j=Math.max(j,H)}}if(h){const q=bl(R*D,w,b)/D;if(X=Math.max(X,q),l){let H=0;!f&&!d||d&&!f&&g?H=Er(S+R*D+L,l[1][0])/D:H=Sr(S+(d?O:-O)*D+L,l[0][0])/D,X=Math.max(X,H)}if(c){let H=0;!f&&!d||d&&!f&&g?H=Sr(S+R*D,c[1][0])/D:H=Er(S+(d?O:-O)*D,c[0][0])/D,X=Math.max(X,H)}}}O=O+(O<0?X:-X),T=T+(T<0?j:-j),o&&(g?z>R*D?O=(Dy(f,d)?-T:T)/D:T=(Dy(f,d)?-O:O)*D:m?(O=T/D,d=f):(T=O*D,f=d));const Y=f?S+T:S,Z=d?C+O:C;return{width:A+(f?-T:T),height:M+(d?-O:O),x:a[0]*T*(f?-1:1)+Y,y:a[1]*O*(d?-1:1)+Z}}const sx={width:0,height:0,x:0,y:0},l2={...sx,pointerX:0,pointerY:0,aspectRatio:1};function u2(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 c2({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:d,boundaries:m,keepAspectRatio:h,resizeDirection:g,onResizeStart:v,onResize:x,onResizeEnd:w,shouldResize:b}){let E={...sx},_={...l2};l={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:jy(d)};let S,C=null,A=[],M,D,T,O=!1;const z=mw().on("start",R=>{const{nodeLookup:L,transform:G,snapGrid:j,snapToGrid:X,nodeOrigin:Y,paneDomNode:Z}=n();if(S=L.get(t),!S)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:H}=_o(R.sourceEvent,{transform:G,snapGrid:j,snapToGrid:X,containerBounds:C});E={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},_={...E,pointerX:q,pointerY:H,aspectRatio:E.width/E.height},M=void 0,D=ci(S.extent)?S.extent:void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(M=L.get(S.parentId)),M&&S.extent==="parent"&&(D=[[0,0],[M.measured.width,M.measured.height]]),A=[],T=void 0;for(const[B,$]of L)if($.parentId===t&&(A.push({id:B,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const U=u2($,S,$.origin??Y);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}v==null||v(R,{...E})}).on("drag",R=>{const{transform:L,snapGrid:G,snapToGrid:j,nodeOrigin:X}=n(),Y=_o(R.sourceEvent,{transform:L,snapGrid:G,snapToGrid:j,containerBounds:C}),Z=[];if(!S)return;const{x:q,y:H,width:B,height:$}=E,U={},V=S.origin??X,{width:W,height:Q,x:re,y:oe}=a2(_,l.controlDirection,Y,l.boundaries,l.keepAspectRatio,V,D,T),ee=W!==B,se=Q!==$,de=re!==q&&ee,xe=oe!==H&&se;if(!de&&!xe&&!ee&&!se)return;if((de||xe||V[0]===1||V[1]===1)&&(U.x=de?re:E.x,U.y=xe?oe:E.y,E.x=U.x,E.y=U.y,A.length>0)){const Pe=re-q,Ae=oe-H;for(const Fe of A)Fe.position={x:Fe.position.x-Pe+V[0]*(W-B),y:Fe.position.y-Ae+V[1]*(Q-$)},Z.push(Fe)}if((ee||se)&&(U.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?W:E.width,U.height=se&&(!l.resizeDirection||l.resizeDirection==="vertical")?Q:E.height,E.width=U.width,E.height=U.height),M&&S.expandParent){const Pe=V[0]*(U.width??0);U.x&&U.x<Pe&&(E.x=Pe,_.x=_.x-(U.x-Pe));const Ae=V[1]*(U.height??0);U.y&&U.y<Ae&&(E.y=Ae,_.y=_.y-(U.y-Ae))}const he=o2({width:E.width,prevWidth:B,height:E.height,prevHeight:$,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),fe={...E,direction:he};(b==null?void 0:b(R,fe))!==!1&&(O=!0,x==null||x(R,fe),i(U,Z))}).on("end",R=>{O&&(w==null||w(R,{...E}),o==null||o({...E}),O=!1)});a.call(z)}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 f2(){if($y)return Kf;$y=1;var e=Fo();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(h,g){var v=g(),x=i({inst:{value:v,getSnapshot:g}}),w=x[0].inst,b=x[1];return a(function(){w.value=v,w.getSnapshot=g,f(w)&&b({inst:w})},[h,v,g]),o(function(){return f(w)&&b({inst:w}),h(function(){f(w)&&b({inst:w})})},[h]),l(v),v}function f(h){var g=h.getSnapshot;h=h.value;try{var v=g();return!n(h,v)}catch{return!0}}function d(h,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Kf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Kf}var zy;function d2(){return zy||(zy=1,Yf.exports=f2()),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 h2(){if(Fy)return qf;Fy=1;var e=Fo(),t=d2();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return qf.useSyncExternalStoreWithSelector=function(d,m,h,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 E(M){if(!_){if(_=!0,S=M,M=g(M),v!==void 0&&w.hasValue){var D=w.value;if(v(D,M))return C=D}return C=M}if(D=C,i(S,M))return D;var T=g(M);return v!==void 0&&v(D,T)?(S=M,D):(S=M,C=T)}var _=!1,S,C,A=h===void 0?null:h;return[function(){return E(m())},A===null?void 0:function(){return E(A())}]},[m,h,g,v]);var b=o(d,x[0],x[1]);return l(function(){w.hasValue=!0,w.value=b},[b]),f(b),b},qf}var By;function p2(){return By||(By=1,Hf.exports=h2()),Hf.exports}var m2=p2();const g2=hu(m2),y2={},Vy=e=>{let t;const n=new Set,i=(m,h)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(x=>x(t,v))}},o=()=>t,f={setState:i,getState:o,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(y2?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(i,o,f);return f},v2=e=>e?Vy(e):Vy,{useDebugValue:w2}=Rh,{useSyncExternalStoreWithSelector:x2}=g2,b2=e=>e;function ox(e,t=b2,n){const i=x2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return w2(i),i}const Wy=(e,t)=>{const n=v2(e),i=(o,a=t)=>ox(n,o,a);return Object.assign(i,n),i},k2=(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 ax=ew();const ku=I.createContext(null),S2=ku.Provider,lx=gn.error001("react");function Me(e,t){const n=I.useContext(ku);if(n===null)throw new Error(lx);return ox(n,e,t)}function qe(){const e=I.useContext(ku);if(e===null)throw new Error(lx);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Uy={display:"none"},E2={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ux="react-flow__node-desc",cx="react-flow__edge-desc",N2="react-flow__aria-live",_2=e=>e.ariaLiveMessage,C2=e=>e.ariaLabelConfig;function T2({rfId:e}){const t=Me(_2);return N.jsx("div",{id:`${N2}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:E2,children:t})}function O2({rfId:e,disableKeyboardA11y:t}){const n=Me(C2);return N.jsxs(N.Fragment,{children:[N.jsx("div",{id:`${ux}-${e}`,style:Uy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),N.jsx("div",{id:`${cx}-${e}`,style:Uy,children:n["edge.a11yDescription.default"]}),!t&&N.jsx(T2,{rfId:e})]})}const Su=I.forwardRef(({position:e="top-left",children:t,className:n,style:i,...o},a)=>{const l=`${e}`.split("-");return N.jsx("div",{className:rt(["react-flow__panel",n,...l]),style:i,ref:a,...o,children:t})});Su.displayName="Panel";function I2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:N.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:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const P2=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 A2(e,t){return He(e.selectedNodes.map(kl),t.selectedNodes.map(kl))&&He(e.selectedEdges.map(kl),t.selectedEdges.map(kl))}function M2({onSelectionChange:e}){const t=qe(),{selectedNodes:n,selectedEdges:i}=Me(P2,A2);return I.useEffect(()=>{const o={nodes:n,edges:i};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[n,i,e]),null}const R2=e=>!!e.onSelectionChangeHandlers;function L2({onSelectionChange:e}){const t=Me(R2);return e||t?N.jsx(M2,{onSelectionChange:e}):null}const fx=[0,0],j2={x:0,y:0,zoom:1},D2=["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=[...D2,"rfId"],$2=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:fx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function z2(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=Me($2,He),d=qe();I.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=qy,c()}),[]);const m=I.useRef(qy);return I.useEffect(()=>{for(const h of Hy){const g=e[h],v=m.current[h];g!==v&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?i(g):h==="maxZoom"?o(g):h==="translateExtent"?a(g):h==="nodeExtent"?l(g):h==="ariaLabelConfig"?d.setState({ariaLabelConfig:SC(g)}):h==="fitView"?d.setState({fitViewQueued:g}):h==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[h]:g})))}m.current=e},Hy.map(h=>e[h])),null}function Yy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function F2(e){var i;const[t,n]=I.useState(e==="system"?null:e);return I.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]=I.useState(!1),o=I.useRef(!1),a=I.useRef(new Set([])),[l,c]=I.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),m=d.reduce((h,g)=>h.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return I.useEffect(()=>{const f=(t==null?void 0:t.target)??Ky,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var b,E;if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!d)&&Ww(v))return!1;const w=Xy(v.code,c);if(a.current.add(v[w]),Gy(l,a.current,!1)){const _=((E=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:E[0])||v.target,S=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(o.current||!S)&&v.preventDefault(),i(!0)}},h=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",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,i]),n}function 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 B2=()=>{const e=qe();return I.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(),d={x:t.x-c,y:t.y-f},m=n.snapGrid??o,h=n.snapToGrid??a;return ys(d,i,h,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 dx(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)V2(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 V2(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 W2(e,t){return dx(e,t)}function U2(e,t){return dx(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 H2=zw();function q2(e,t,n={}){return OC(e,t,{...n,onError:n.onError??H2})}const Zy=e=>pC(e),Y2=e=>Lw(e);function hx(e){return I.forwardRef(e)}const K2=typeof window<"u"?I.useLayoutEffect:I.useEffect;function e0(e){const[t,n]=I.useState(BigInt(0)),[i]=I.useState(()=>G2(()=>n(o=>o+BigInt(1))));return K2(()=>{const o=i.get();o.length&&(e(o),i.reset())},[t]),i}function G2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const px=I.createContext(null);function X2({children:e}){const t=qe(),n=I.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:m,onNodesChange:h,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:x}=t.getState();let w=f;for(const E of c)w=typeof E=="function"?E(w):E;let b=Qy({items:w,lookup:g});for(const E of x.values())b=E(b);m&&d(w),b.length>0?h==null||h(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:_,setNodes:S}=t.getState();E&&S(_)})},[]),i=e0(n),o=I.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:h,edgeLookup:g}=t.getState();let v=f;for(const x of c)v=typeof x=="function"?x(v):x;m?d(v):h&&h(Qy({items:v,lookup:g}))},[]),a=e0(o),l=I.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return N.jsx(px.Provider,{value:l,children:e})}function Q2(){const e=I.useContext(px);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const J2=e=>!!e.panZoom;function Zh(){const e=B2(),t=qe(),n=Q2(),i=Me(J2),o=I.useMemo(()=>{const a=h=>t.getState().nodeLookup.get(h),l=h=>{n.nodeQueue.push(h)},c=h=>{n.edgeQueue.push(h)},f=h=>{var E,_;const{nodeLookup:g,nodeOrigin:v}=t.getState(),x=Zy(h)?h:g.get(h.id),w=x.parentId?Bw(x.position,x.measured,x.parentId,g,v):x.position,b={...x,position:w,width:((E=x.measured)==null?void 0:E.width)??x.width,height:((_=x.measured)==null?void 0:_.height)??x.height};return us(b)},d=(h,g,v={replace:!1})=>{l(x=>x.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&Zy(b)?b:{...w,...b}}return w}))},m=(h,g,v={replace:!1})=>{c(x=>x.map(w=>{if(w.id===h){const b=typeof g=="function"?g(w):g;return v.replace&&Y2(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=a(h))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:l,setEdges:c,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(v=>[...v,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:v}=t.getState(),[x,w,b]=v;return{nodes:h.map(E=>({...E})),edges:g.map(E=>({...E})),viewport:{x,y:w,zoom:b}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:v,edges:x,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:E,triggerEdgeChanges:_,onDelete:S,onBeforeDelete:C}=t.getState(),{nodes:A,edges:M}=await wC({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:x,onBeforeDelete:C}),D=M.length>0,T=A.length>0;if(D){const O=M.map(Jy);b==null||b(M),_(O)}if(T){const O=A.map(Jy);w==null||w(A),E(O)}return(T||D)&&(S==null||S({nodes:A,edges:M})),{deletedNodes:A,deletedEdges:M}},getIntersectingNodes:(h,g=!0,v)=>{const x=Ny(h),w=x?h:f(h),b=v!==void 0;return w?(v||t.getState().nodes).filter(E=>{const _=t.getState().nodeLookup.get(E.id);if(_&&!x&&(E.id===h.id||!_.internals.positionAbsolute))return!1;const S=us(b?E:_),C=Lo(S,w);return g&&C>0||C>=S.width*S.height||C>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=Ny(h)?h:f(h);if(!w)return!1;const b=Lo(w,g);return v&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:d,updateNodeData:(h,g,v={replace:!1})=>{d(h,x=>{const w=typeof g=="function"?g(x):g;return v.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},v)},updateEdge:m,updateEdgeData:(h,g,v={replace:!1})=>{m(h,x=>{const w=typeof g=="function"?g(x):g;return v.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},v)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return mC(h,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:h,id:g,nodeId:v})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${v}-${h}${g?`-${g}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:v})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${v}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:x.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??kC();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return I.useMemo(()=>({...o,...e,viewportInitialized:i}),[i])}const t0=e=>e.selected,Z2=typeof window<"u"?window:void 0;function eT({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qe(),{deleteElements:i}=Zh(),o=Do(e,{actInsideInputWithModifier:!1}),a=Do(t,{target:Z2});I.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(t0),edges:l.filter(t0)}),n.setState({nodesSelectionActive:!1})}},[o]),I.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function tT(e){const t=qe();I.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},nT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function rT({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:d,minZoom:m,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:v=!0,children:x,noWheelClassName:w,noPanClassName:b,onViewportChange:E,isControlledViewport:_,paneClickDistance:S,selectionOnDrag:C}){const A=qe(),M=I.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:O}=Me(nT,He),z=Do(g),R=I.useRef();tT(M);const L=I.useCallback(G=>{E==null||E({x:G[0],y:G[1],zoom:G[2]}),_||A.setState({transform:G})},[E,_]);return I.useEffect(()=>{if(M.current){R.current=s2({domNode:M.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:f,onDraggingChange:Y=>A.setState(Z=>Z.paneDragging===Y?Z:{paneDragging:Y}),onPanZoomStart:(Y,Z)=>{const{onViewportChangeStart:q,onMoveStart:H}=A.getState();H==null||H(Y,Z),q==null||q(Z)},onPanZoom:(Y,Z)=>{const{onViewportChange:q,onMove:H}=A.getState();H==null||H(Y,Z),q==null||q(Z)},onPanZoomEnd:(Y,Z)=>{const{onViewportChangeEnd:q,onMoveEnd:H}=A.getState();H==null||H(Y,Z),q==null||q(Z)}});const{x:G,y:j,zoom:X}=R.current.getViewport();return A.setState({panZoom:R.current,transform:[G,j,X],domNode:M.current.closest(".react-flow")}),()=>{var Y;(Y=R.current)==null||Y.destroy()}}},[]),I.useEffect(()=>{var G;(G=R.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:z,preventScrolling:v,noPanClassName:b,userSelectionActive:D,noWheelClassName:w,lib:T,onTransformChange:L,connectionInProgress:O,selectionOnDrag:C,paneClickDistance:S})},[e,t,n,i,o,a,l,c,z,v,b,D,w,T,L,O,C,S]),N.jsx("div",{className:"react-flow__renderer",ref:M,style:Eu,children:x})}const iT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function sT(){const{userSelectionActive:e,userSelectionRect:t}=Me(iT,He);return e&&t?N.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Gf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},oT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function aT({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ro.Full,panOnDrag:i,autoPanOnSelection:o,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:f,onPaneClick:d,onPaneContextMenu:m,onPaneScroll:h,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:x,children:w}){const b=I.useRef(0),E=qe(),{userSelectionActive:_,elementsSelectable:S,dragging:C,connectionInProgress:A,panBy:M,autoPanSpeed:D}=Me(oT,He),T=S&&(e||_),O=I.useRef(null),z=I.useRef(),R=I.useRef(new Set),L=I.useRef(new Set),G=I.useRef(!1),j=I.useRef({x:0,y:0}),X=I.useRef(!1),Y=ee=>{if(G.current||A){G.current=!1;return}d==null||d(ee),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},Z=ee=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){ee.preventDefault();return}m==null||m(ee)},q=h?ee=>h(ee):void 0,H=ee=>{G.current&&(ee.stopPropagation(),G.current=!1)},B=ee=>{var Fe,wt;const{domNode:se,transform:de}=E.getState();if(z.current=se==null?void 0:se.getBoundingClientRect(),!z.current)return;const xe=ee.target===O.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),G.current=!1;const{x:Se,y:Pe}=mn(ee.nativeEvent,z.current),Ae=ys({x:Se,y:Pe},de);E.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}=E.getState();if(!de)return;const{transform:xe,nodeLookup:he,edgeLookup:fe,connectionLookup:Se,triggerNodeChanges:Pe,triggerEdgeChanges:Ae,defaultEdgeOptions:Fe}=E.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)},Dn=R.current,bn=L.current;R.current=new Set(Uh(he,pt,xe,n===Ro.Partial,!0).map(_t=>_t.id)),L.current=new Set;const kn=(Fe==null?void 0:Fe.selectable)??!0;for(const _t of R.current){const Ht=Se.get(_t);if(Ht)for(const{edgeId:Lt}of Ht.values()){const qt=fe.get(Lt);qt&&(qt.selectable??kn)&&L.current.add(Lt)}}if(!_y(Dn,R.current)){const _t=Xi(he,R.current,!0);Pe(_t)}if(!_y(bn,L.current)){const _t=Xi(fe,L.current);Ae(_t)}E.setState({userSelectionRect:pt,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!o||!z.current)return;const[ee,se]=Hh(j.current,z.current,D);M({x:ee,y:se}).then(de=>{if(!G.current||!de){b.current=requestAnimationFrame(U);return}const{x:xe,y:he}=j.current;$(xe,he),b.current=requestAnimationFrame(U)})}const V=()=>{cancelAnimationFrame(b.current),b.current=0,X.current=!1};I.useEffect(()=>()=>V(),[]);const W=ee=>{const{userSelectionRect:se,transform:de,resetSelectedElements:xe}=E.getState();if(!z.current||!se)return;const{x:he,y:fe}=mn(ee.nativeEvent,z.current);j.current={x:he,y:fe};const Se=cs({x:se.startX,y:se.startY},de);if(!G.current){const Pe=t?0:a;if(Math.hypot(he-Se.x,fe-Se.y)<=Pe)return;xe(),c==null||c(ee)}G.current=!0,X.current||(U(),X.current=!0),$(he,fe)},Q=ee=>{var se,de;ee.button===0&&((de=(se=ee.target)==null?void 0:se.releasePointerCapture)==null||de.call(se,ee.pointerId),!_&&ee.target===O.current&&E.getState().userSelectionRect&&(Y==null||Y(ee)),E.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f==null||f(ee),E.setState({nodesSelectionActive:R.current.size>0})),V())},re=ee=>{var se,de;(de=(se=ee.target)==null?void 0:se.releasePointerCapture)==null||de.call(se,ee.pointerId),V()},oe=i===!0||Array.isArray(i)&&i.includes(0);return N.jsxs("div",{className:rt(["react-flow__pane",{draggable:oe,dragging:C,selection:e}]),onClick:T?void 0:Gf(Y,O),onContextMenu:Gf(Z,O),onWheel:Gf(q,O),onPointerEnter:T?void 0:g,onPointerMove:T?W:v,onPointerUp:T?Q:void 0,onPointerCancel:T?re:void 0,onPointerDownCapture:T?B:void 0,onClickCapture:T?H:void 0,onPointerLeave:x,ref:O,style:Eu,children:[w,N.jsx(sT,{})]})}function bh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f==null||f("012",gn.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):o([e])}function mx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:o,isSelectable:a,nodeClickDistance:l}){const c=qe(),[f,d]=I.useState(!1),m=I.useRef();return I.useEffect(()=>{m.current=HC({getStoreItems:()=>c.getState(),onNodeMouseDown:h=>{bh({id:h,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),I.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 h;(h=m.current)==null||h.destroy()}},[n,i,t,a,e,o,l]),f}const lT=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function gx(){const e=qe();return I.useCallback(n=>{const{nodeExtent:i,snapToGrid:o,snapGrid:a,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:m}=e.getState(),h=new Map,g=lT(l),v=o?a[0]:5,x=o?a[1]:5,w=n.direction.x*v*n.factor,b=n.direction.y*x*n.factor;for(const[,E]of d){if(!g(E))continue;let _={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};o&&(_=Ho(_,a));const{position:S,positionAbsolute:C}=jw({nodeId:E.id,nextPosition:_,nodeLookup:d,nodeExtent:i,nodeOrigin:m,onError:c});E.position=S,E.internals.positionAbsolute=C,h.set(E.id,E)}f(h)},[])}const ep=I.createContext(null),uT=ep.Provider;ep.Consumer;const yx=()=>I.useContext(ep),cT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),fT=(e,t,n)=>i=>{const{connectionClickStartHandle:o,connectionMode:a,connection:l}=i,{fromHandle:c,toHandle:f,isValid:d}=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&&d}};function dT({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:d,onMouseDown:m,onTouchStart:h,...g},v){var X,Y;const x=l||null,w=e==="target",b=qe(),E=yx(),{connectOnClick:_,noPanClassName:S,rfId:C}=Me(cT,He),{connectingFrom:A,connectingTo:M,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:O,clickConnectionInProcess:z,valid:R}=Me(fT(E,x,e),He);E||(Y=(X=b.getState()).onError)==null||Y.call(X,"010",gn.error010());const L=Z=>{const{defaultEdgeOptions:q,onConnect:H,hasDefaultEdges:B}=b.getState(),$={...q,...Z};if(B){const{edges:U,setEdges:V,onError:W}=b.getState();V(q2($,U,{onError:W}))}H==null||H($),c==null||c($)},G=Z=>{if(!E)return;const q=Uw(Z.nativeEvent);if(o&&(q&&Z.button===0||!q)){const H=b.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:E,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...B)=>{var $,U;return(U=($=b.getState()).onConnectEnd)==null?void 0:U.call($,...B)},updateConnection:H.updateConnection,onConnect:L,isValidConnection:n||((...B)=>{var $,U;return((U=($=b.getState()).isValidConnection)==null?void 0:U.call($,...B))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}q?m==null||m(Z):h==null||h(Z)},j=Z=>{const{onClickConnectStart:q,onClickConnectEnd:H,connectionClickStartHandle:B,connectionMode:$,isValidConnection:U,lib:V,rfId:W,nodeLookup:Q,connection:re}=b.getState();if(!E||!B&&!o)return;if(!B){q==null||q(Z.nativeEvent,{nodeId:E,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:E,type:e,id:x}});return}const oe=Vw(Z.target),ee=n||U,{connection:se,isValid:de}=xh.isValid(Z.nativeEvent,{handle:{nodeId:E,id:x,type:e},connectionMode:$,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ee,flowId:W,doc:oe,lib:V,nodeLookup:Q});de&&se&&L(se);const xe=structuredClone(re);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,H==null||H(Z,xe),b.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":x,"data-nodeid":E,"data-handlepos":t,"data-id":`${C}-${E}-${x}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,d,{source:!w,target:w,connectable:i,connectablestart:o,connectableend:a,clickconnecting:D,connectingfrom:A,connectingto:M,valid:R,connectionindicator:i&&(!O||T)&&(O||z?a:o)}]),onMouseDown:G,onTouchStart:G,onClick:_?j:void 0,ref:v,...g,children:f})}const Ir=I.memo(hx(dT));function hT({data:e,isConnectable:t,sourcePosition:n=ke.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(Ir,{type:"source",position:n,isConnectable:t})]})}function pT({data:e,isConnectable:t,targetPosition:n=ke.Top,sourcePosition:i=ke.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(Ir,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(Ir,{type:"source",position:i,isConnectable:t})]})}function mT(){return null}function gT({data:e,isConnectable:t,targetPosition:n=ke.Top}){return N.jsxs(N.Fragment,{children:[N.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:hT,default:pT,output:gT,group:mT};function yT(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 vT=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 wT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=qe(),{width:o,height:a,transformString:l,userSelectionActive:c}=Me(vT,He),f=gx(),d=I.useRef(null);I.useEffect(()=>{var v;n||(v=d.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&o!==null&&a!==null;if(mx({nodeRef:d,disabled:!m}),!m)return null;const h=e?v=>{const x=i.getState().nodes.filter(w=>w.selected);e(v,x)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(iu,v.key)&&(v.preventDefault(),f({direction:iu[v.key],factor:v.shiftKey?4:1}))};return N.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:N.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:o,height:a}})})}const r0=typeof window<"u"?window:void 0,xT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function vx({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:m,selectionMode:h,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:E,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:C,panOnScrollSpeed:A,panOnScrollMode:M,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:O,defaultViewport:z,translateExtent:R,minZoom:L,maxZoom:G,preventScrolling:j,onSelectionContextMenu:X,noWheelClassName:Y,noPanClassName:Z,disableKeyboardA11y:q,onViewportChange:H,isControlledViewport:B}){const{nodesSelectionActive:$,userSelectionActive:U}=Me(xT,He),V=Do(d,{target:r0}),W=Do(w,{target:r0}),Q=W||T,re=W||C,oe=m&&Q!==!0,ee=V||U||oe;return eT({deleteKeyCode:f,multiSelectionKeyCode:x}),N.jsx(rT,{onPaneContextMenu:a,elementsSelectable:E,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:re,panOnScrollSpeed:A,panOnScrollMode:M,zoomOnDoubleClick:D,panOnDrag:!V&&Q,defaultViewport:z,translateExtent:R,minZoom:L,maxZoom:G,zoomActivationKeyCode:b,preventScrolling:j,noWheelClassName:Y,noPanClassName:Z,onViewportChange:H,isControlledViewport:B,paneClickDistance:c,selectionOnDrag:oe,children:N.jsxs(aT,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:Q,autoPanOnSelection:O,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:V,paneClickDistance:c,selectionOnDrag:oe,children:[e,$&&N.jsx(wT,{onSelectionContextMenu:X,noPanClassName:Z,disableKeyboardA11y:q})]})})}vx.displayName="FlowRenderer";const bT=I.memo(vx),kT=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 ST(e){return Me(I.useCallback(kT(e),[e]),He)}const ET=e=>e.updateNodeInternals;function NT(){const e=Me(ET),[t]=I.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 I.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function _T({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const o=qe(),a=I.useRef(null),l=I.useRef(null),c=I.useRef(e.sourcePosition),f=I.useRef(e.targetPosition),d=I.useRef(t),m=n&&!!e.internals.handleBounds;return I.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]),I.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),I.useEffect(()=>{if(a.current){const h=d.current!==t,g=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(h||g||v)&&(d.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function CT({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:o,onContextMenu:a,onDoubleClick:l,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:m,resizeObserver:h,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:x,rfId:w,nodeTypes:b,nodeClickDistance:E,onError:_}){const{node:S,internals:C,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 M=S.type||"default",D=(b==null?void 0:b[M])||n0[M];D===void 0&&(_==null||_("003",gn.error003(M)),M="default",D=(b==null?void 0:b.default)||n0.default);const T=!!(S.draggable||c&&typeof S.draggable>"u"),O=!!(S.selectable||f&&typeof S.selectable>"u"),z=!!(S.connectable||d&&typeof S.connectable>"u"),R=!!(S.focusable||m&&typeof S.focusable>"u"),L=qe(),G=Fw(S),j=_T({node:S,nodeType:M,hasDimensions:G,resizeObserver:h}),X=mx({nodeRef:j,disabled:S.hidden||!T,noDragClassName:g,handleSelector:S.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:E}),Y=gx();if(S.hidden)return null;const Z=tr(S),q=yT(S),H=O||T||t||n||i||o,B=n?ee=>n(ee,{...C.userNode}):void 0,$=i?ee=>i(ee,{...C.userNode}):void 0,U=o?ee=>o(ee,{...C.userNode}):void 0,V=a?ee=>a(ee,{...C.userNode}):void 0,W=l?ee=>l(ee,{...C.userNode}):void 0,Q=ee=>{const{selectNodesOnDrag:se,nodeDragThreshold:de}=L.getState();O&&(!se||!T||de>0)&&bh({id:e,store:L,nodeRef:j}),t&&t(ee,{...C.userNode})},re=ee=>{if(!(Ww(ee.nativeEvent)||x)){if(Pw.includes(ee.key)&&O){const se=ee.key==="Escape";bh({id:e,store:L,unselect:se,nodeRef:j})}else if(T&&S.selected&&Object.prototype.hasOwnProperty.call(iu,ee.key)){ee.preventDefault();const{ariaLabelConfig:se}=L.getState();L.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),Y({direction:iu[ee.key],factor:ee.shiftKey?4:1})}}},oe=()=>{var Se;if(x||!((Se=j.current)!=null&&Se.matches(":focus-visible")))return;const{transform:ee,width:se,height:de,autoPanOnNodeFocus:xe,setCenter:he}=L.getState();if(!xe)return;Uh(new Map([[e,S]]),{x:0,y:0,width:se,height:de},ee,!0).length>0||he(S.position.x+Z.width/2,S.position.y+Z.height/2,{zoom:ee[2]})};return N.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${M}`,{[v]:T},S.className,{selected:S.selected,selectable:O,parent:A,draggable:T,dragging:X}]),ref:j,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:G?"visible":"hidden",...S.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:$,onMouseLeave:U,onContextMenu:V,onClick:Q,onDoubleClick:W,onKeyDown:R?re:void 0,tabIndex:R?0:void 0,onFocus:R?oe:void 0,role:S.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${ux}-${w}`,"aria-label":S.ariaLabel,...S.domAttributes,children:N.jsx(uT,{value:e,children:N.jsx(D,{id:e,data:S.data,type:M,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:S.selected??!1,selectable:O,draggable:T,deletable:S.deletable??!0,isConnectable:z,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:X,dragHandle:S.dragHandle,zIndex:C.z,parentId:S.parentId,...Z})})})}var TT=I.memo(CT);const OT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function wx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:o,onError:a}=Me(OT,He),l=ST(e.onlyRenderVisibleElements),c=NT();return N.jsx("div",{className:"react-flow__nodes",style:Eu,children:l.map(f=>N.jsx(TT,{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))})}wx.displayName="NodeRenderer";const IT=I.memo(wx);function PT(e){return Me(I.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&&_C({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(o.id)}return i},[e]),He)}const AT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return N.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},MT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return N.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},i0={[nu.Arrow]:AT,[nu.ArrowClosed]:MT};function RT(e){const t=qe();return I.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 LT=({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=RT(t);return f?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:N.jsx(f,{color:n,strokeWidth:l})}):null},xx=({defaultColor:e,rfId:t})=>{const n=Me(a=>a.edges),i=Me(a=>a.defaultEdgeOptions),o=I.useMemo(()=>RC(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return o.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:o.map(a=>N.jsx(LT,{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};xx.displayName="MarkerDefinitions";var jT=I.memo(xx);function bx({x:e,y:t,label:n,labelStyle:i,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...m}){const[h,g]=I.useState({x:1,y:0,width:0,height:0}),v=rt(["react-flow__edge-textwrapper",d]),x=I.useRef(null);return I.useEffect(()=>{if(x.current){const w=x.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...m,children:[o&&N.jsx("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),N.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:x,style:i,children:n}),f]}):null}bx.displayName="EdgeText";const DT=I.memo(bx);function Nu({path:e,labelX:t,labelY:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...m}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...m,d:e,fill:"none",className:rt(["react-flow__edge-path",m.className])}),d?N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?N.jsx(DT,{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 kx({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,d]=s0({pos:a,x1:i,y1:o,x2:e,y2:t}),[m,h,g,v]=Hw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${l},${c} ${f},${d} ${i},${o}`,m,h,g,v]}function Sx(e){return I.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l,targetPosition:c,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:E})=>{const[_,S,C]=kx({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c}),A=e.isInternal?void 0:t;return N.jsx(Nu,{id:A,path:_,labelX:S,labelY:C,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:E})})}const $T=Sx({isInternal:!1}),Ex=Sx({isInternal:!0});$T.displayName="SimpleBezierEdge";Ex.displayName="SimpleBezierEdgeInternal";function Nx(e){return I.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=ke.Bottom,targetPosition:x=ke.Top,markerEnd:w,markerStart:b,pathOptions:E,interactionWidth:_})=>{const[S,C,A]=yh({sourceX:n,sourceY:i,sourcePosition:v,targetX:o,targetY:a,targetPosition:x,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),M=e.isInternal?void 0:t;return N.jsx(Nu,{id:M,path:S,labelX:C,labelY:A,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:b,interactionWidth:_})})}const _x=Nx({isInternal:!1}),Cx=Nx({isInternal:!0});_x.displayName="SmoothStepEdge";Cx.displayName="SmoothStepEdgeInternal";function Tx(e){return I.memo(({id:t,...n})=>{var o;const i=e.isInternal?void 0:t;return N.jsx(_x,{...n,id:i,pathOptions:I.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const zT=Tx({isInternal:!1}),Ox=Tx({isInternal:!0});zT.displayName="StepEdge";Ox.displayName="StepEdgeInternal";function Ix(e){return I.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,interactionWidth:w})=>{const[b,E,_]=Kw({sourceX:n,sourceY:i,targetX:o,targetY:a}),S=e.isInternal?void 0:t;return N.jsx(Nu,{id:S,path:b,labelX:E,labelY:_,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:x,interactionWidth:w})})}const FT=Ix({isInternal:!1}),Px=Ix({isInternal:!0});FT.displayName="StraightEdge";Px.displayName="StraightEdgeInternal";function Ax(e){return I.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l=ke.Bottom,targetPosition:c=ke.Top,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,pathOptions:E,interactionWidth:_})=>{const[S,C,A]=qw({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c,curvature:E==null?void 0:E.curvature}),M=e.isInternal?void 0:t;return N.jsx(Nu,{id:M,path:S,labelX:C,labelY:A,label:f,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:x,markerEnd:w,markerStart:b,interactionWidth:_})})}const BT=Ax({isInternal:!1}),Mx=Ax({isInternal:!0});BT.displayName="BezierEdge";Mx.displayName="BezierEdgeInternal";const o0={default:Mx,straight:Px,step:Ox,smoothstep:Cx,simplebezier:Ex},a0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},VT=(e,t,n)=>n===ke.Left?e-t:n===ke.Right?e+t:e,WT=(e,t,n)=>n===ke.Top?e-t:n===ke.Bottom?e+t:e,l0="react-flow__edgeupdater";function u0({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:o,onMouseEnter:a,onMouseOut:l,type:c}){return N.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:l,className:rt([l0,`${l0}-${c}`]),cx:VT(t,i,e),cy:WT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function UT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:o,targetX:a,targetY:l,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:m,onReconnectEnd:h,setReconnecting:g,setUpdateHover:v}){const x=qe(),w=(C,A)=>{if(C.button!==0)return;const{autoPanOnConnect:M,domNode:D,connectionMode:T,connectionRadius:O,lib:z,onConnectStart:R,cancelConnection:L,nodeLookup:G,rfId:j,panBy:X,updateConnection:Y}=x.getState(),Z=A.type==="target",q=($,U)=>{g(!1),h==null||h($,n,A.type,U)},H=$=>d==null?void 0:d(n,$),B=($,U)=>{g(!0),m==null||m(C,n,A.type),R==null||R($,U)};xh.onPointerDown(C.nativeEvent,{autoPanOnConnect:M,connectionMode:T,connectionRadius:O,domNode:D,handleId:A.id,nodeId:A.nodeId,nodeLookup:G,isTarget:Z,edgeUpdaterType:A.type,lib:z,flowId:j,cancelConnection:L,panBy:X,isValidConnection:(...$)=>{var U,V;return((V=(U=x.getState()).isValidConnection)==null?void 0:V.call(U,...$))??!0},onConnect:H,onConnectStart:B,onConnectEnd:(...$)=>{var U,V;return(V=(U=x.getState()).onConnectEnd)==null?void 0:V.call(U,...$)},onReconnectEnd:q,updateConnection:Y,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},b=C=>w(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=C=>w(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>v(!0),S=()=>v(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(u0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:b,onMouseEnter:_,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&N.jsx(u0,{position:f,centerX:a,centerY:l,radius:t,onMouseDown:E,onMouseEnter:_,onMouseOut:S,type:"target"})]})}function HT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:o,onDoubleClick:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,rfId:x,edgeTypes:w,noPanClassName:b,onError:E,disableKeyboardA11y:_}){let S=Me(he=>he.edgeLookup.get(e));const C=Me(he=>he.defaultEdgeOptions);S=C?{...C,...S}:S;let A=S.type||"default",M=(w==null?void 0:w[A])||o0[A];M===void 0&&(E==null||E("011",gn.error011(A)),A="default",M=(w==null?void 0:w.default)||o0.default);const D=!!(S.focusable||t&&typeof S.focusable>"u"),T=typeof h<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),O=!!(S.selectable||i&&typeof S.selectable>"u"),z=I.useRef(null),[R,L]=I.useState(!1),[G,j]=I.useState(!1),X=qe(),{zIndex:Y,sourceX:Z,sourceY:q,targetX:H,targetY:B,sourcePosition:$,targetPosition:U}=Me(I.useCallback(he=>{const fe=he.nodeLookup.get(S.source),Se=he.nodeLookup.get(S.target);if(!fe||!Se)return{zIndex:S.zIndex,...a0};const Pe=MC({id:e,sourceNode:fe,targetNode:Se,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:he.connectionMode,onError:E});return{zIndex:NC({selected:S.selected,zIndex:S.zIndex,sourceNode:fe,targetNode:Se,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Pe||a0}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),He),V=I.useMemo(()=>S.markerStart?`url('#${vh(S.markerStart,x)}')`:void 0,[S.markerStart,x]),W=I.useMemo(()=>S.markerEnd?`url('#${vh(S.markerEnd,x)}')`:void 0,[S.markerEnd,x]);if(S.hidden||Z===null||q===null||H===null||B===null)return null;const Q=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:Se,multiSelectionActive:Pe}=X.getState();O&&(X.setState({nodesSelectionActive:!1}),S.selected&&Pe?(Se({nodes:[],edges:[S]}),(Ae=z.current)==null||Ae.blur()):fe([e])),o&&o(he,S)},re=a?he=>{a(he,{...S})}:void 0,oe=l?he=>{l(he,{...S})}:void 0,ee=c?he=>{c(he,{...S})}:void 0,se=f?he=>{f(he,{...S})}:void 0,de=d?he=>{d(he,{...S})}:void 0,xe=he=>{var fe;if(!_&&Pw.includes(he.key)&&O){const{unselectNodesAndEdges:Se,addSelectedEdges:Pe}=X.getState();he.key==="Escape"?((fe=z.current)==null||fe.blur(),Se({edges:[S]})):Pe([e])}};return N.jsx("svg",{style:{zIndex:Y},children:N.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${A}`,S.className,b,{selected:S.selected,animated:S.animated,inactive:!O&&!o,updating:R,selectable:O}]),onClick:Q,onDoubleClick:re,onContextMenu:oe,onMouseEnter:ee,onMouseMove:se,onMouseLeave:de,onKeyDown:D?xe:void 0,tabIndex:D?0:void 0,role:S.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":D?`${cx}-${x}`:void 0,ref:z,...S.domAttributes,children:[!G&&N.jsx(M,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:O,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:Z,sourceY:q,targetX:H,targetY:B,sourcePosition:$,targetPosition:U,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:V,markerEnd:W,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),T&&N.jsx(UT,{edge:S,isReconnectable:T,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:Z,sourceY:q,targetX:H,targetY:B,sourcePosition:$,targetPosition:U,setUpdateHover:L,setReconnecting:j})]})})}var qT=I.memo(HT);const YT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Rx({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:o,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:E,elementsSelectable:_,onError:S}=Me(YT,He),C=PT(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(jT,{defaultColor:e,rfId:n}),C.map(A=>N.jsx(qT,{id:A,edgesFocusable:b,edgesReconnectable:E,elementsSelectable:_,noPanClassName:o,onReconnect:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:m,reconnectRadius:h,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:x,rfId:n,onError:S,edgeTypes:i,disableKeyboardA11y:w},A))]})}Rx.displayName="EdgeRenderer";const KT=I.memo(Rx),GT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function XT({children:e}){const t=Me(GT);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function QT(e){const t=Zh(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const JT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ZT(e){const t=Me(JT),n=qe();return I.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function eO(e){return e.connection.inProgress?{...e.connection,to:ys(e.connection.to,e.transform)}:{...e.connection}}function tO(e){return eO}function nO(e){const t=tO();return Me(t,He)}const rO=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iO({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:o,width:a,height:l,isValid:c,inProgress:f}=Me(rO,He);return!(a&&o&&f)?null:N.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:rt(["react-flow__connection",Rw(c)]),children:N.jsx(Lx,{style:t,type:n,CustomComponent:i,isValid:c})})})}const Lx=({style:e,type:t=Tr.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:o,from:a,fromNode:l,fromHandle:c,fromPosition:f,to:d,toNode:m,toHandle:h,toPosition:g,pointer:v}=nO();if(!o)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:g,connectionStatus:Rw(i),toNode:m,toHandle:h,pointer:v});let x="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Tr.Bezier:[x]=qw(w);break;case Tr.SimpleBezier:[x]=kx(w);break;case Tr.Step:[x]=yh({...w,borderRadius:0});break;case Tr.SmoothStep:[x]=yh(w);break;default:[x]=Kw(w)}return N.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Lx.displayName="ConnectionLine";const sO={};function c0(e=sO){I.useRef(e),qe(),I.useEffect(()=>{},[e])}function oO(){qe(),I.useRef(!1),I.useEffect(()=>{},[])}function jx({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:v,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:E,selectionKeyCode:_,selectionOnDrag:S,selectionMode:C,multiSelectionKeyCode:A,panActivationKeyCode:M,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:O,elementsSelectable:z,defaultViewport:R,translateExtent:L,minZoom:G,maxZoom:j,preventScrolling:X,defaultMarkerColor:Y,zoomOnScroll:Z,zoomOnPinch:q,panOnScroll:H,panOnScrollSpeed:B,panOnScrollMode:$,zoomOnDoubleClick:U,panOnDrag:V,autoPanOnSelection:W,onPaneClick:Q,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:Dn,noPanClassName:bn,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht,viewport:Lt,onViewportChange:qt}){return c0(e),c0(t),oO(),QT(n),ZT(Lt),N.jsx(bT,{onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:se,paneClickDistance:xe,deleteKeyCode:T,selectionKeyCode:_,selectionOnDrag:S,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:A,panActivationKeyCode:M,zoomActivationKeyCode:D,elementsSelectable:z,zoomOnScroll:Z,zoomOnPinch:q,zoomOnDoubleClick:U,panOnScroll:H,panOnScrollSpeed:B,panOnScrollMode:$,panOnDrag:V,autoPanOnSelection:W,defaultViewport:R,translateExtent:L,minZoom:G,maxZoom:j,onSelectionContextMenu:h,preventScrolling:X,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:kn,onViewportChange:qt,isControlledViewport:!!Lt,children:N.jsxs(XT,{children:[N.jsx(KT,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,onlyRenderVisibleElements:O,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:bn,disableKeyboardA11y:kn,rfId:Ht}),N.jsx(iO,{style:w,type:x,component:b,containerStyle:E}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(IT,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:O,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}jx.displayName="GraphView";const aO=I.memo(jx),lO=zw(),f0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:h,zIndexMode:g="basic"}={})=>{const v=new Map,x=new Map,w=new Map,b=new Map,E=i??t??[],_=n??e??[],S=m??[0,0],C=h??Mo;Qw(w,b,E);const{nodesInitialized:A}=wh(_,v,x,{nodeOrigin:S,nodeExtent:C,zIndexMode:g});let M=[0,0,1];if(l&&o&&a){const D=Uo(v,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:T,y:O,zoom:z}=qh(D,o,a,f,d,(c==null?void 0:c.padding)??.1);M=[T,O,z]}return{rfId:"1",width:o??0,height:a??0,transform:M,nodes:_,nodesInitialized:A,nodeLookup:v,parentLookup:x,edges:E,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:Mo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:as.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,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:{...Mw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lO,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Aw,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g})=>k2((v,x)=>{async function w(){const{nodeLookup:b,panZoom:E,fitViewOptions:_,fitViewResolver:S,width:C,height:A,minZoom:M,maxZoom:D}=x();E&&(await vC({nodes:b,width:C,height:A,panZoom:E,minZoom:M,maxZoom:D},_),S==null||S.resolve(!0),v({fitViewResolver:null}))}return{...f0({nodes:e,edges:t,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:m,nodeExtent:h,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:b=>{const{nodeLookup:E,parentLookup:_,nodeOrigin:S,elevateNodesOnSelect:C,fitViewQueued:A,zIndexMode:M,nodesSelectionActive:D}=x(),{nodesInitialized:T,hasSelectedNodes:O}=wh(b,E,_,{nodeOrigin:S,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:M}),z=D&&O;A&&T?(w(),v({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):v({nodes:b,nodesInitialized:T,nodesSelectionActive:z})},setEdges:b=>{const{connectionLookup:E,edgeLookup:_}=x();Qw(E,_,b),v({edges:b})},setDefaultNodesAndEdges:(b,E)=>{if(b){const{setNodes:_}=x();_(b),v({hasDefaultNodes:!0})}if(E){const{setEdges:_}=x();_(E),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:E,nodeLookup:_,parentLookup:S,domNode:C,nodeOrigin:A,nodeExtent:M,debug:D,fitViewQueued:T,zIndexMode:O}=x(),{changes:z,updatedInternals:R}=BC(b,_,S,C,A,M,O);R&&(DC(_,S,{nodeOrigin:A,nodeExtent:M,zIndexMode:O}),T?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(z==null?void 0:z.length)>0&&(D&&console.log("React Flow: trigger node changes",z),E==null||E(z)))},updateNodePositions:(b,E=!1)=>{const _=[];let S=[];const{nodeLookup:C,triggerNodeChanges:A,connection:M,updateConnection:D,onNodesChangeMiddlewareMap:T}=x();for(const[O,z]of b){const R=C.get(O),L=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(z!=null&&z.position)),G={id:O,type:"position",position:L?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:E};if(R&&M.inProgress&&M.fromNode.id===R.id){const j=fi(R,M.fromHandle,ke.Left,!0);D({...M,from:j})}L&&R.parentId&&_.push({id:O,parentId:R.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),S.push(G)}if(_.length>0){const{parentLookup:O,nodeOrigin:z}=x(),R=Jh(_,C,O,z);S.push(...R)}for(const O of T.values())S=O(S);A(S)},triggerNodeChanges:b=>{const{onNodesChange:E,setNodes:_,nodes:S,hasDefaultNodes:C,debug:A}=x();if(b!=null&&b.length){if(C){const M=W2(b,S);_(M)}A&&console.log("React Flow: trigger node changes",b),E==null||E(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:E,setEdges:_,edges:S,hasDefaultEdges:C,debug:A}=x();if(b!=null&&b.length){if(C){const M=U2(b,S);_(M)}A&&console.log("React Flow: trigger edge changes",b),E==null||E(b)}},addSelectedNodes:b=>{const{multiSelectionActive:E,edgeLookup:_,nodeLookup:S,triggerNodeChanges:C,triggerEdgeChanges:A}=x();if(E){const M=b.map(D=>ei(D,!0));C(M);return}C(Xi(S,new Set([...b]),!0)),A(Xi(_))},addSelectedEdges:b=>{const{multiSelectionActive:E,edgeLookup:_,nodeLookup:S,triggerNodeChanges:C,triggerEdgeChanges:A}=x();if(E){const M=b.map(D=>ei(D,!0));A(M);return}A(Xi(_,new Set([...b]))),C(Xi(S,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:E}={})=>{const{edges:_,nodes:S,nodeLookup:C,triggerNodeChanges:A,triggerEdgeChanges:M}=x(),D=b||S,T=E||_,O=[];for(const R of D){if(!R.selected)continue;const L=C.get(R.id);L&&(L.selected=!1),O.push(ei(R.id,!1))}const z=[];for(const R of T)R.selected&&z.push(ei(R.id,!1));A(O),M(z)},setMinZoom:b=>{const{panZoom:E,maxZoom:_}=x();E==null||E.setScaleExtent([b,_]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:E,minZoom:_}=x();E==null||E.setScaleExtent([_,b]),v({maxZoom:b})},setTranslateExtent:b=>{var E;(E=x().panZoom)==null||E.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:E,triggerNodeChanges:_,triggerEdgeChanges:S,elementsSelectable:C}=x();if(!C)return;const A=E.reduce((D,T)=>T.selected?[...D,ei(T.id,!1)]:D,[]),M=b.reduce((D,T)=>T.selected?[...D,ei(T.id,!1)]:D,[]);_(A),S(M)},setNodeExtent:b=>{const{nodes:E,nodeLookup:_,parentLookup:S,nodeOrigin:C,elevateNodesOnSelect:A,nodeExtent:M,zIndexMode:D}=x();b[0][0]===M[0][0]&&b[0][1]===M[0][1]&&b[1][0]===M[1][0]&&b[1][1]===M[1][1]||(wh(E,_,S,{nodeOrigin:C,nodeExtent:b,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:D}),v({nodeExtent:b}))},panBy:b=>{const{transform:E,width:_,height:S,panZoom:C,translateExtent:A}=x();return VC({delta:b,panZoom:C,transform:E,translateExtent:A,width:_,height:S})},setCenter:async(b,E,_)=>{const{width:S,height:C,maxZoom:A,panZoom:M}=x();if(!M)return!1;const D=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:A;return await M.setViewport({x:S/2-b*D,y:C/2-E*D,zoom:D},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),!0},cancelConnection:()=>{v({connection:{...Mw}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...f0()})}},Object.is);function Dx({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:o,initialHeight:a,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g,children:v}){const[x]=I.useState(()=>uO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:h,zIndexMode:g}));return N.jsx(S2,{value:x,children:N.jsx(X2,{children:v})})}function cO({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:a,height:l,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v}){return I.useContext(ku)?N.jsx(N.Fragment,{children:e}):N.jsx(Dx,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:o,initialWidth:a,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v,children:e})}const fO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:o,nodeTypes:a,edgeTypes:l,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:m,onMoveStart:h,onMoveEnd:g,onConnect:v,onConnectStart:x,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:E,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:C,onNodeContextMenu:A,onNodeDoubleClick:M,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:O,onNodesDelete:z,onEdgesDelete:R,onDelete:L,onSelectionChange:G,onSelectionDragStart:j,onSelectionDrag:X,onSelectionDragStop:Y,onSelectionContextMenu:Z,onSelectionStart:q,onSelectionEnd:H,onBeforeDelete:B,connectionMode:$,connectionLineType:U=Tr.Bezier,connectionLineStyle:V,connectionLineComponent:W,connectionLineContainerStyle:Q,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=fx,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:kn=!0,defaultViewport:_t=j2,minZoom:Ht=.5,maxZoom:Lt=2,translateExtent:qt=Mo,preventScrolling:Xo=!0,nodeExtent:$n,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:nr,onPaneMouseLeave:rr,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:zn,ariaLabelConfig:ec,zIndexMode:da="basic",...Rs},ha){const zr=jt||"1",Fr=F2(wi),tc=I.useCallback(xi=>{xi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),zn==null||zn(xi)},[zn]);return N.jsx("div",{"data-testid":"rf__wrapper",...Rs,onScroll:tc,style:{...yi,...fO},ref:ha,className:rt(["react-flow",o,Fr]),id:jt,role:"application",children:N.jsxs(cO,{nodes:e,edges:t,width:Zu,height:vi,fitView:Ps,fitViewOptions:As,minZoom:Ht,maxZoom:Lt,nodeOrigin:pt,nodeExtent:$n,zIndexMode:da,children:[N.jsx(z2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:x,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:E,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:kn,elevateNodesOnSelect:la,elevateEdgesOnSelect:Yu,minZoom:Ht,maxZoom:Lt,nodeExtent:$n,onNodesChange:Is,onEdgesChange:Wu,snapToGrid:fe,snapGrid:Se,connectionMode:$,translateExtent:qt,connectOnClick:qu,defaultEdgeOptions:aa,fitView:Ps,fitViewOptions:As,onNodesDelete:z,onEdgesDelete:R,onDelete:L,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:O,onSelectionDrag:X,onSelectionDragStart:j,onSelectionDragStop:Y,onMove:m,onMoveStart:h,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:B,debug:$r,ariaLabelConfig:ec,zIndexMode:da}),N.jsx(aO,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:C,onNodeContextMenu:A,onNodeDoubleClick:M,nodeTypes:a,edgeTypes:l,connectionLineType:U,connectionLineStyle:V,connectionLineComponent:W,connectionLineContainerStyle:Q,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:nr,onPaneMouseLeave:rr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta,nodeClickDistance:na,onSelectionContextMenu:Z,onSelectionStart:q,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:$n,viewport:Qu,onViewportChange:Ju}),N.jsx(L2,{onSelectionChange:G}),ra,N.jsx(I2,{proOptions:oa,position:sa}),N.jsx(O2,{rfId:zr,disableKeyboardA11y:ua})]})})}var hO=hx(dO);function pO({dimensions:e,lineWidth:t,variant:n,className:i}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",n,i])})}function mO({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",t])})}var Jn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Jn||(Jn={}));const gO={[Jn.Dots]:1,[Jn.Lines]:1,[Jn.Cross]:6},yO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $x({id:e,variant:t=Jn.Dots,gap:n=20,size:i,lineWidth:o=1,offset:a=0,color:l,bgColor:c,style:f,className:d,patternClassName:m}){const h=I.useRef(null),{transform:g,patternId:v}=Me(yO,He),x=i||gO[t],w=t===Jn.Dots,b=t===Jn.Cross,E=Array.isArray(n)?n:[n,n],_=[E[0]*g[2]||1,E[1]*g[2]||1],S=x*g[2],C=Array.isArray(a)?a:[a,a],A=b?[S,S]:_,M=[C[0]*g[2]||1+A[0]/2,C[1]*g[2]||1+A[1]/2],D=`${v}${e||""}`;return N.jsxs("svg",{className:rt(["react-flow__background",d]),style:{...f,...Eu,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:h,"data-testid":"rf__background",children:[N.jsx("pattern",{id:D,x:g[0]%_[0],y:g[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?N.jsx(mO,{radius:S/2,className:m}):N.jsx(pO,{dimensions:A,lineWidth:o,variant:t,className:m})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}$x.displayName="Background";const vO=I.memo($x);function wO(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xO(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bO(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function kO(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function SO(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Sl({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:rt(["react-flow__controls-button",t]),...n,children:e})}const EO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function zx({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:l,onFitView:c,onInteractiveChange:f,className:d,children:m,position:h="bottom-left",orientation:g="vertical","aria-label":v}){const x=qe(),{isInteractive:w,minZoomReached:b,maxZoomReached:E,ariaLabelConfig:_}=Me(EO,He),{zoomIn:S,zoomOut:C,fitView:A}=Zh(),M=()=>{S(),a==null||a()},D=()=>{C(),l==null||l()},T=()=>{A(o),c==null||c()},O=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},z=g==="horizontal"?"horizontal":"vertical";return N.jsxs(Su,{className:rt(["react-flow__controls",z,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??_["controls.ariaLabel"],children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(Sl,{onClick:M,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:E,children:N.jsx(wO,{})}),N.jsx(Sl,{onClick:D,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:b,children:N.jsx(xO,{})})]}),n&&N.jsx(Sl,{className:"react-flow__controls-fitview",onClick:T,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:N.jsx(bO,{})}),i&&N.jsx(Sl,{className:"react-flow__controls-interactive",onClick:O,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?N.jsx(SO,{}):N.jsx(kO,{})}),m]})}zx.displayName="Controls";const NO=I.memo(zx);function _O({id:e,x:t,y:n,width:i,height:o,style:a,color:l,strokeColor:c,strokeWidth:f,className:d,borderRadius:m,shapeRendering:h,selected:g,onClick:v}){const{background:x,backgroundColor:w}=a||{},b=l||x||w;return N.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:i,height:o,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:h,onClick:v?E=>v(E,e):void 0})}const CO=I.memo(_O),TO=e=>e.nodes.map(t=>t.id),Xf=e=>e instanceof Function?e:()=>e;function OO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:a=CO,onClick:l}){const c=Me(TO,He),f=Xf(t),d=Xf(e),m=Xf(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:c.map(g=>N.jsx(PO,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:o,NodeComponent:a,onClick:l,shapeRendering:h},g))})}function IO({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:c,onClick:f}){const{node:d,x:m,y:h,width:g,height:v}=Me(x=>{const w=x.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:E,y:_}=w.internals.positionAbsolute,{width:S,height:C}=tr(b);return{node:b,x:E,y:_,width:S,height:C}},He);return!d||d.hidden||!Fw(d)?null:N.jsx(c,{x:m,y:h,width:g,height:v,style:d.style,selected:!!d.selected,className:i(d),color:t(d),borderRadius:o,strokeColor:n(d),strokeWidth:a,shapeRendering:l,onClick:f,id:d.id})}const PO=I.memo(IO);var AO=I.memo(OO);const MO=200,RO=150,LO=e=>!e.hidden,jO=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?$w(Uo(e.nodeLookup,{filter:LO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},DO="react-flow__minimap-desc";function Fx({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:m,maskStrokeWidth:h,position:g="bottom-right",onClick:v,onNodeClick:x,pannable:w=!1,zoomable:b=!1,ariaLabel:E,inversePan:_,zoomStep:S=1,offsetScale:C=5}){const A=qe(),M=I.useRef(null),{boundingRect:D,viewBB:T,rfId:O,panZoom:z,translateExtent:R,flowWidth:L,flowHeight:G,ariaLabelConfig:j}=Me(jO,He),X=(e==null?void 0:e.width)??MO,Y=(e==null?void 0:e.height)??RO,Z=D.width/X,q=D.height/Y,H=Math.max(Z,q),B=H*X,$=H*Y,U=C*H,V=D.x-(B-D.width)/2-U,W=D.y-($-D.height)/2-U,Q=B+U*2,re=$+U*2,oe=`${DO}-${O}`,ee=I.useRef(0),se=I.useRef();ee.current=H,I.useEffect(()=>{if(M.current&&z)return se.current=QC({domNode:M.current,panZoom:z,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=se.current)==null||fe.destroy()}},[z]),I.useEffect(()=>{var fe;(fe=se.current)==null||fe.update({translateExtent:R,width:L,height:G,inversePan:_,pannable:w,zoomStep:S,zoomable:b})},[w,b,_,S,R,L,G]);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?I.useCallback((fe,Se)=>{const Pe=A.getState().nodeLookup.get(Se).internals.userNode;x(fe,Pe)},[]):void 0,he=E??j["minimap.ariaLabel"];return N.jsx(Su,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*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:N.jsxs("svg",{width:X,height:Y,viewBox:`${V} ${W} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:M,onClick:de,children:[he&&N.jsx("title",{id:oe,children:he}),N.jsx(AO,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-U},${W-U}h${Q+U*2}v${re+U*2}h${-Q-U*2}z
|
|
62
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Fx.displayName="MiniMap";I.memo(Fx);const $O=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,zO={[fs.Line]:"right",[fs.Handle]:"bottom-right"};function FO({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:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:v=!0,shouldResize:x,onResizeStart:w,onResize:b,onResizeEnd:E}){const _=yx(),S=typeof e=="string"?e:_,C=qe(),A=I.useRef(null),M=n===fs.Handle,D=Me(I.useCallback($O(M&&v),[M,v]),He),T=I.useRef(null),O=t??zO[n];I.useEffect(()=>{if(!(!A.current||!S))return T.current||(T.current=c2({domNode:A.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:R,transform:L,snapGrid:G,snapToGrid:j,nodeOrigin:X,domNode:Y}=C.getState();return{nodeLookup:R,transform:L,snapGrid:G,snapToGrid:j,nodeOrigin:X,paneDomNode:Y}},onChange:(R,L)=>{const{triggerNodeChanges:G,nodeLookup:j,parentLookup:X,nodeOrigin:Y}=C.getState(),Z=[],q={x:R.x,y:R.y},H=j.get(S);if(H&&H.expandParent&&H.parentId){const B=H.origin??Y,$=R.width??H.measured.width??0,U=R.height??H.measured.height??0,V={id:H.id,parentId:H.parentId,rect:{width:$,height:U,...Bw({x:R.x??H.position.x,y:R.y??H.position.y},{width:$,height:U},H.parentId,j,B)}},W=Jh([V],j,X,Y);Z.push(...W),q.x=R.x?Math.max(B[0]*$,R.x):void 0,q.y=R.y?Math.max(B[1]*U,R.y):void 0}if(q.x!==void 0&&q.y!==void 0){const B={id:S,type:"position",position:{...q}};Z.push(B)}if(R.width!==void 0&&R.height!==void 0){const $={id:S,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};Z.push($)}for(const B of L){const $={...B,type:"position"};Z.push($)}G(Z)},onEnd:({width:R,height:L})=>{const G={id:S,type:"dimensions",resizing:!1,dimensions:{width:R,height:L}};C.getState().triggerNodeChanges([G])}})),T.current.update({controlPosition:O,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:m},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:E,shouldResize:x}),()=>{var R;(R=T.current)==null||R.destroy()}},[O,c,f,d,m,h,w,b,E,x]);const z=O.split("-");return N.jsx("div",{className:rt(["react-flow__resize-control","nodrag",...z,n,i]),ref:A,style:{...o,scale:D,...l&&{[M?"backgroundColor":"borderColor"]:l}},children:a})}I.memo(FO);function Bx(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=Bx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Vx(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bx(e))&&(i&&(i+=" "),i+=t);return i}const BO=(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},VO=(e,t)=>({classGroupId:e,validator:t}),Wx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),su="-",d0=[],WO="arbitrary..",UO=e=>{const t=qO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return HO(l);const c=l.split(su),f=c[0]===""&&c.length>1?1:0;return Ux(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=i[l],d=n[l];return f?d?BO(d,f):f:d||d0}return n[l]||d0}}},Ux=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const d=Ux(e,t+1,a);if(d)return d}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 d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},HO=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?WO+i:void 0})(),qO=e=>{const{theme:t,classGroups:n}=e;return YO(n,t)},YO=(e,t)=>{const n=Wx();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];KO(l,t,n,i)}},KO=(e,t,n,i)=>{if(typeof e=="string"){GO(e,t,n);return}if(typeof e=="function"){XO(e,t,n,i);return}QO(e,t,n,i)},GO=(e,t,n)=>{const i=e===""?t:Hx(t,e);i.classGroupId=n},XO=(e,t,n,i)=>{if(JO(e)){tp(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(VO(n,e))},QO=(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,Hx(t,c),n,i)}},Hx=(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=Wx(),n.nextPart.set(l,c)),n=c}return n},JO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ZO=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=":",eI=[],p0=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),tI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=o=>{const a=[];let l=0,c=0,f=0,d;const m=o.length;for(let w=0;w<m;w++){const b=o[w];if(l===0&&c===0){if(b===h0){a.push(o.slice(f,w)),f=w+1;continue}if(b==="/"){d=w;continue}}b==="["?l++:b==="]"?l--:b==="("?c++:b===")"&&c--}const h=a.length===0?o:o.slice(f);let g=h,v=!1;h.endsWith(kh)?(g=h.slice(0,-1),v=!0):h.startsWith(kh)&&(g=h.slice(1),v=!0);const x=d&&d>f?d-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(eI,!1,l,void 0,!0)}if(n){const o=i;i=a=>n({className:a,parseClassName:o})}return i},nI=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}},rI=e=>({cache:ZO(e.cacheSize),parseClassName:tI(e),sortModifiers:nI(e),postfixLookupClassGroupIds:iI(e),...UO(e)}),iI=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},sI=/\s+/,oI=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(sI);let d="";for(let m=f.length-1;m>=0;m-=1){const h=f[m],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:b}=n(h);if(g){d=h+(d.length>0?" "+d:d);continue}let E=!!b,_;if(E){const D=w.substring(0,b);_=i(D);const T=_&&l[_]?i(w):void 0;T&&T!==_&&(_=T,E=!1)}else _=i(w);if(!_){if(!E){d=h+(d.length>0?" "+d:d);continue}if(_=i(w),!_){d=h+(d.length>0?" "+d:d);continue}E=!1}const S=v.length===0?"":v.length===1?v[0]:a(v).join(":"),C=x?S+kh:S,A=C+_;if(c.indexOf(A)>-1)continue;c.push(A);const M=o(_,E);for(let D=0;D<M.length;++D){const T=M[D];c.push(C+T)}d=h+(d.length>0?" "+d:d)}return d},aI=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=qx(n))&&(o&&(o+=" "),o+=i);return o},qx=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=qx(e[i]))&&(n&&(n+=" "),n+=t);return n},lI=(e,...t)=>{let n,i,o,a;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=rI(d),i=n.cache.get,o=n.cache.set,a=c,c(f)},c=f=>{const d=i(f);if(d)return d;const m=oI(f,n);return o(f,m),m};return a=l,(...f)=>a(aI(...f))},uI=[],ot=e=>{const t=n=>n[e]||uI;return t.isThemeGetter=!0,t},Yx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dI=/\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$/,hI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nr=e=>cI.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)),Gn=e=>fI.test(e),Gx=()=>!0,gI=e=>dI.test(e)&&!hI.test(e),np=()=>!1,yI=e=>pI.test(e),vI=e=>mI.test(e),wI=e=>!me(e)&&!ye(e),xI=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)),bI=e=>Ar(e,Jx,np),me=e=>Yx.test(e),Zr=e=>Ar(e,Zx,gI),m0=e=>Ar(e,OI,Oe),kI=e=>Ar(e,t1,Gx),SI=e=>Ar(e,e1,np),g0=e=>Ar(e,Xx,np),EI=e=>Ar(e,Qx,vI),El=e=>Ar(e,n1,yI),ye=e=>Kx.test(e),go=e=>hi(e,Zx),NI=e=>hi(e,e1),y0=e=>hi(e,Xx),_I=e=>hi(e,Jx),CI=e=>hi(e,Qx),Nl=e=>hi(e,n1,!0),TI=e=>hi(e,t1,!0),Ar=(e,t,n)=>{const i=Yx.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},hi=(e,t,n=!1)=>{const i=Kx.exec(e);return i?i[1]?t(i[1]):n:!1},Xx=e=>e==="position"||e==="percentage",Qx=e=>e==="image"||e==="url",Jx=e=>e==="length"||e==="size"||e==="bg-size",Zx=e=>e==="length",OI=e=>e==="number",e1=e=>e==="family-name",t1=e=>e==="number"||e==="weight",n1=e=>e==="shadow",II=()=>{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"),d=ot("radius"),m=ot("shadow"),h=ot("inset-shadow"),g=ot("text-shadow"),v=ot("drop-shadow"),x=ot("blur"),w=ot("perspective"),b=ot("aspect"),E=ot("ease"),_=ot("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...C(),ye,me],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],T=()=>[ye,me,f],O=()=>[Nr,"full","auto",...T()],z=()=>[Tn,"none","subgrid",ye,me],R=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],L=()=>[Tn,"auto",ye,me],G=()=>["auto","min","max","fr",ye,me],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...T()],Z=()=>[Nr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],q=()=>[Nr,"screen","full","dvw","lvw","svw","min","max","fit",...T()],H=()=>[Nr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],B=()=>[e,ye,me],$=()=>[...C(),y0,g0,{position:[ye,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",_I,bI,{size:[ye,me]}],W=()=>[Qf,go,Zr],Q=()=>["","none","full",d,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=()=>[Nr,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gn],breakpoint:[Gn],color:[Gx],container:[Gn],"drop-shadow":[Gn],ease:["in","out","in-out"],font:[wI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gn],shadow:[Gn],spacing:["px",Oe],text:[Gn],"text-shadow":[Gn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nr,me,ye,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[xI],columns:[{columns:[Oe,me,ye,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Nr,"full","auto",c,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Nr,"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":z()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],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":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"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,TI,kI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qf,me]}],"font-family":[{font:[NI,SI,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,...T()]}],"list-image":[{"list-image":["none",ye,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Zr]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"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:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,ye,me],radial:["",ye,me],conic:[Tn,ye,me]},CI,EI]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,me]}],"outline-w":[{outline:["",Oe,go,Zr]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",m,Nl,El]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,Nl,El]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Oe,Zr]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",g,Nl,El]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Oe,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"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":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:de()}],brightness:[{brightness:[Oe,ye,me]}],contrast:[{contrast:[Oe,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Nl,El]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Oe,ye,me]}],"hue-rotate":[{"hue-rotate":[Oe,ye,me]}],invert:[{invert:["",Oe,ye,me]}],saturate:[{saturate:[Oe,ye,me]}],sepia:[{sepia:["",Oe,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"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",E,ye,me]}],delay:[{delay:[Oe,ye,me]}],animate:[{animate:["none",_,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":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:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Oe,go,Zr,m0]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},PI=lI(II);function je(...e){return PI(Vx(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 AI(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 r1(AI(e,t),n)}function r1(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 h=new Date(c.getTime()-36e5),g=bo(h,e.tz);return Jf(g,e)?h:c}let d=new Date(c.getTime()+yo(e)-yo(f)),m=bo(d,e.tz);if(Jf(m,e))return d;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>d.getTime()?c:d}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 i1=[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,d=parseInt(l,10)+n,m=parseInt(c,10)+n,h=parseInt(f,10);this.validateNotNaN(d,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(h,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(d,m,h,t,e);for(let g=d;g<=m;g+=h)this.setPart(t,g,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]|i1[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 s1{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 s1)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&&i1[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,d=this[n]+o,m=a===1?h=>h<i[n].length:h=>h>=0;for(let h=d;m(h);h+=a){let g=i[n][h];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===h-o){g=1;break}}}if(n==="day"&&i.lastWeekday){let v=this.getLastWeekday(this.year,this.month);h-o===v&&(g=1)}if(n==="day"&&i.lastDayOfMonth&&h-o==c&&(g=1),n==="day"&&!i.starDOW){let v=i.dayOfWeek[(f+(h-o-1))%7];if(v&&v&63)v=this.isNthWeekdayOfMonth(this.year,this.month,h-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]=h-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],d=this.getMaxPatternValue(c,t,f);this[c]=d,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,h=this.month;for(;h<0;)h+=12,m--;for(;h>11;)h-=12,m++;let g=h!==1?Zf[h]:new Date(Date.UTC(m,h+1,0)).getUTCDate();this.day>g&&(this.day=g)}this.apply();let c=We[i][0],f=We[i][2],d=this.getMaxPatternValue(c,t,f);if(c==="day"){let m=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(d,m)}else this[c]=d;if(this.apply(),i===0){let m=We[1][2],h=this.getMaxPatternValue("day",t,m),g=this.getLastDayOfMonth(this.year,this.month),v=Math.min(h,g);v!==this.day&&(this.day=v,this.hour=this.getMaxPatternValue("hour",t,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)):r1(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 d=this.getNearestWeekday(this.year,this.month,f-a);if(d!==-1&&d===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(),d=t.dayOfWeek[(f+(l-1))%7];d&&d&63&&(d=this.isNthWeekdayOfMonth(this.year,this.month,l,d)?1:0),t.useAndLogic?c=c&&d:!n.domAndDow&&!t.starDOM?c=c||d:c=c&&d}}if(!c)return!1}return!0}};function MI(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 RI(e){return ko(e)}function LI(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var x0=30*1e3,_l=[],jI=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=MI(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&&RI(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&&LI(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 DI(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 $I(e,t=new Date){try{return new jI(e).nextRun(t)}catch{return null}}function zI(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 FI(e,t=new Date){const n=$I(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=zI(n.getTime()-t.getTime());return{short:i,title:`Next run ${o} (in ${a}) · cron ${e}`}}function b0(e){return e?e.replace(/^trigger\./,""):""}const BI=200,VI=560;function k0(e,t){return{label:e,path:t,workflows:[],children:new Map}}function WI(e){const t=k0("","");for(const n of e){const i=(n.group??"").split("/").map(l=>l.trim()).filter(Boolean);let o=t,a="";for(const l of i){a=a?`${a}/${l}`:l;let c=o.children.get(l);c||(c=k0(l,a),o.children.set(l,c)),o=c}o.workflows.push(n)}return t}function o1({wf:e,selected:t,onSelect:n,onRun:i}){const o=DI(e),a=o?FI(o):null;return N.jsxs("div",{"data-testid":"workflow-item",className:je("group w-full px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px] cursor-pointer",e.name===t?"bg-muted":"hover:bg-muted text-mutedfg"),onClick:()=>n==null?void 0:n(e.name),title:e.title??e.name,children:[N.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",e.name===t?"bg-ok":"bg-border")}),N.jsx("span",{className:"truncate",children:e.title??e.name}),N.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[a?N.jsxs("span",{"data-testid":"next-run",title:a.title,className:"text-[10px] text-mutedfg font-mono whitespace-nowrap",children:["next ",a.short]}):b0(e.triggerType)&&N.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:b0(e.triggerType)}),e.runnable&&i&&N.jsx("button",{"data-testid":"run-workflow",title:`Run ${e.title??e.name}${e.needsPayload?" (needs a payload — use the header Run…)":""}`,onClick:l=>{l.stopPropagation(),e.needsPayload?n==null||n(e.name):i(e.name)},className:"text-[11px] font-mono text-mutedfg hover:text-ok px-1 rounded opacity-0 group-hover:opacity-100",children:"▶ run"})]})]})}function a1({node:e,depth:t,expanded:n,toggle:i,selected:o,onSelect:a,onRun:l}){const c=n[e.path]!==!1,f=e.workflows.length+e.children.size;return N.jsxs("div",{"data-testid":"workflow-group","data-group":e.path,children:[N.jsxs("button",{"data-testid":"group-header",onClick:()=>i(e.path),title:e.path,className:"w-full flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[12px] text-mutedfg hover:bg-muted",style:{paddingLeft:10+t*12},"aria-expanded":c,children:[N.jsx("span",{className:je("text-[9px] transition-transform",c?"rotate-90":"rotate-0"),children:"▶"}),N.jsx("span",{className:"truncate font-medium tracking-tight",children:e.label}),N.jsx("span",{className:"ml-auto text-[10px] text-mutedfg font-mono",children:f})]}),c&&N.jsxs("div",{style:{paddingLeft:t>=0?8:0},children:[[...e.children.values()].map(d=>N.jsx(a1,{node:d,depth:t+1,expanded:n,toggle:i,selected:o,onSelect:a,onRun:l},d.path)),e.workflows.map(d=>N.jsx(o1,{wf:d,selected:o,onSelect:a,onRun:l},d.name))]})]})}function UI({liveConnected:e,workflows:t=[],selected:n,onSelect:i,onRun:o,version:a,onReload:l,reloadedAt:c}){const[f,d]=I.useState(248),[m,h]=I.useState(!1),[g,v]=I.useState({}),x=I.useCallback(A=>{v(M=>({...M,[A]:M[A]===!1}))},[]),[w,b]=I.useState(!1);I.useEffect(()=>{if(!c)return;b(!0);const A=setTimeout(()=>b(!1),1500);return()=>clearTimeout(A)},[c]);const E=I.useCallback(A=>{A.preventDefault(),h(!0)},[]);I.useEffect(()=>{if(!m)return;const A=D=>d(Math.min(VI,Math.max(BI,D.clientX))),M=()=>h(!1);return window.addEventListener("mousemove",A),window.addEventListener("mouseup",M),()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",M)}},[m]);const _=I.useMemo(()=>WI(t),[t]),S=_.workflows,C=[..._.children.values()];return N.jsxs("aside",{className:"relative shrink-0 bg-bg border-r border-border flex flex-col",style:{width:f},children:[N.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[N.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),N.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),a&&N.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",a]})]}),N.jsxs("div",{className:"px-3 pt-3 pb-1 flex items-center gap-2",children:[N.jsx("span",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),l&&N.jsx("button",{"data-testid":"reload-workflows",onClick:()=>void l(),title:"Reload workflows + agents from disk (POST /api/reload)",className:"ml-auto text-[10px] font-mono px-1.5 py-0.5 rounded bg-muted/50 text-mutedfg hover:bg-muted hover:text-fg transition-colors",children:w?"reloaded ✓":"⟳ reload"})]}),N.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their"," ",N.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover →"," ",N.jsx("span",{className:"font-mono text-fg",children:"▶ run"}),", or select one and use the header."]}),N.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 space-y-0.5",children:[t.length===0&&N.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),S.map(A=>N.jsx(o1,{wf:A,selected:n,onSelect:i,onRun:o},A.name)),C.map(A=>N.jsx(a1,{node:A,depth:0,expanded:g,toggle:x,selected:n,onSelect:i,onRun:o},A.path))]}),N.jsxs("div",{className:"p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx("span",{className:je("size-1.5 rounded-full",e?"bg-ok":"bg-border")}),e?"server connected":"offline"]}),N.jsx("div",{className:"mt-1 font-mono",children:"surfaces are the source of truth"})]}),N.jsx("div",{"data-testid":"sidebar-resizer",onMouseDown:E,className:je("absolute top-0 right-0 h-full w-1 cursor-col-resize hover:bg-primary/40",m&&"bg-primary/60")})]})}function HI({workflow:e,selected:t,dryRun:n,paused:i,pauseControllable:o,onTogglePause:a,onLoadYaml:l,onRun:c,onToggleRuns:f,onToggleCache:d,runsOpen:m,cacheOpen:h}){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]=I.useState(!1),[b,E]=I.useState(!1),[_,S]=I.useState(null),C=I.useRef(null),A=I.useRef(null),M=I.useCallback(()=>{var R;const z=((R=C.current)==null?void 0:R.value)??"";z.trim()&&(l(z),w(!1))},[l]),D=I.useCallback(()=>{t!=null&&t.needsPayload?(S(null),E(!0)):c()},[t,c]),T=I.useCallback(()=>{var L;const z=(((L=A.current)==null?void 0:L.value)??"").trim();if(!z){S('enter a payload, e.g. { "key": "PD-109" }');return}let R;try{R=JSON.parse(z)}catch{S("not valid JSON");return}c(R),E(!1)},[c]),O="text-[12px] px-2.5 py-1 rounded transition-colors";return N.jsxs(N.Fragment,{children:[N.jsxs("header",{className:je("h-12 shrink-0 bg-bg border-b flex items-center px-4 gap-3",n===!1?"border-fail":"border-border"),children:[o&&N.jsx("button",{"data-testid":"topbar-pause",onClick:a,title:i?"Paused — scheduled runs are not firing. Click to resume the platform.":"Running — scheduled workflows fire on their cron. Click to pause the platform.",className:je("text-[11px] font-mono font-bold px-2 py-1 rounded shrink-0 transition-colors",i?"bg-fail/20 text-fail hover:bg-fail/30":"bg-ok/15 text-ok hover:bg-ok/25"),children:i?"▶ Paused":"❚❚ Running"}),n!==void 0&&N.jsx("span",{"data-testid":"run-mode",title:n?"Dry-run: writes are blocked + logged, nothing is sent":"LIVE: writes are real (comments, descriptions, Jira/Confluence)",className:je("text-[10px] font-mono font-bold px-2 py-1 rounded shrink-0",n?"bg-run/20 text-run":"bg-fail/20 text-fail"),children:n?"DRY-RUN":"● LIVE"}),N.jsx("h1",{className:"font-semibold tracking-tight truncate max-w-[35%]",title:g,children:g}),v&&N.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded shrink-0",children:v}),N.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(t==null?void 0:t.runnable)&&N.jsxs("button",{"data-testid":"topbar-run",onClick:D,className:je(O,"bg-ok/15 text-ok hover:bg-ok/25 font-medium"),children:["▶ Run",t.needsPayload?"…":""]}),N.jsx("button",{"data-testid":"topbar-runs",onClick:f,className:je(O,m?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Runs"}),N.jsx("button",{"data-testid":"topbar-cache",onClick:d,className:je(O,h?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Cache"}),N.jsx("button",{onClick:()=>w(!0),className:je(O,"bg-muted hover:bg-border text-fg"),children:"Paste YAML"})]})]}),b&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",onClick:()=>E(!1),children:N.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[420px] max-w-[90vw]",onClick:z=>z.stopPropagation(),children:[N.jsxs("span",{className:"font-semibold text-sm",children:["Run ",g," — trigger payload"]}),N.jsx("p",{className:"text-[12px] text-mutedfg",children:"This is a per-item sub-workflow; give it the item to process, e.g. an idea key."}),N.jsx("textarea",{ref:A,defaultValue:'{ "key": "PD-109" }',spellCheck:!1,className:"w-full h-24 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary"}),_&&N.jsx("span",{className:"text-[11px] text-fail",children:_}),N.jsxs("div",{className:"flex justify-end gap-2",children:[N.jsx("button",{onClick:()=>E(!1),className:je(O,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),N.jsx("button",{onClick:T,className:je(O,"bg-ok/20 text-ok hover:bg-ok/30 font-medium"),children:"▶ Run"})]})]})}),x&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:N.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[520px] max-w-[90vw]",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),N.jsx("button",{onClick:()=>w(!1),className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),N.jsx("textarea",{ref:C,spellCheck:!1,placeholder:"Paste your workflow YAML here...",className:"w-full h-64 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary"}),N.jsxs("div",{className:"flex justify-end gap-2",children:[N.jsx("button",{onClick:()=>w(!1),className:je(O,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),N.jsx("button",{onClick:M,className:"text-[12px] px-3 py-1.5 rounded bg-primary hover:opacity-90 text-white transition-opacity",children:"Apply"})]})]})})]})}function S0({status:e}){return N.jsx("span",{"data-testid":"status-dot","data-status":e,className:je("size-1.5 rounded-full flex-shrink-0",e==="idle"&&"bg-border",e==="running"&&"bg-run pulse-dot",e==="success"&&"bg-ok",e==="failed"&&"bg-fail")})}function E0({data:e,selected:t}){const{node:n,liveStatus:i="idle"}=e;if(n.type==="agent.run"){const a=i==="running";return N.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className:je("rounded-lg border overflow-hidden cursor-pointer","bg-agentbg border-agent/40",a?"agent-ring agent-live":"agent-ring"),style:{width:220,height:60},onClick:()=>{var l;return(l=e.onNodeClick)==null?void 0:l.call(e,n)},children:[N.jsx("div",{className:"h-1 bg-agent"}),N.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx(S0,{status:i}),N.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),N.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),N.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),N.jsx(Ir,{type:"target",position:ke.Left,className:"!bg-agent/50"}),N.jsx(Ir,{type:"source",position:ke.Right,className:"!bg-agent/50"})]})}return N.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className:je("rounded-lg border overflow-hidden cursor-pointer bg-bg border-border shadow-sm",t&&"ring-2 ring-fg/20"),style:{width:n.type==="task.branch"||n.type.startsWith("trigger.")?140:220,height:60},onClick:()=>{var a;return(a=e.onNodeClick)==null?void 0:a.call(e,n)},children:[N.jsx("div",{className:"h-1 bg-mutedfg/30"}),N.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[N.jsx(S0,{status:i}),N.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),N.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),N.jsx(Ir,{type:"target",position:ke.Left,className:"!bg-mutedfg/50"}),N.jsx(Ir,{type:"source",position:ke.Right,className:"!bg-mutedfg/50"})]})}var ed,N0;function rp(){if(N0)return ed;N0=1;var e="\0",t="\0",n="";class i{constructor(m){_e(this,"_isDirected",!0);_e(this,"_isMultigraph",!1);_e(this,"_isCompound",!1);_e(this,"_label");_e(this,"_defaultNodeLabelFn",()=>{});_e(this,"_defaultEdgeLabelFn",()=>{});_e(this,"_nodes",{});_e(this,"_in",{});_e(this,"_preds",{});_e(this,"_out",{});_e(this,"_sucs",{});_e(this,"_edgeObjs",{});_e(this,"_edgeLabels",{});_e(this,"_nodeCount",0);_e(this,"_edgeCount",0);_e(this,"_parent");_e(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(h=>Object.keys(m._in[h]).length===0)}sinks(){var m=this;return this.nodes().filter(h=>Object.keys(m._out[h]).length===0)}setNodes(m,h){var g=arguments,v=this;return m.forEach(function(x){g.length>1?v.setNode(x,h):v.setNode(x)}),this}setNode(m,h){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=h),this):(this._nodes[m]=arguments.length>1?h:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var h=this;if(Object.hasOwn(this._nodes,m)){var g=v=>h.removeEdge(h._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){h.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(g),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var g=h;g!==void 0;g=this.parent(g))if(g===m)throw new Error("Setting "+h+" as parent of "+m+" would create a cycle");this.setNode(h)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=h,this._children[h][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var h=this._parent[m];if(h!==t)return h}}children(m=t){if(this._isCompound){var h=this._children[m];if(h)return Object.keys(h)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var h=this._preds[m];if(h)return Object.keys(h)}successors(m){var h=this._sucs[m];if(h)return Object.keys(h)}neighbors(m){var h=this.predecessors(m);if(h){const v=new Set(h);for(var g of this.successors(m))v.add(g);return Array.from(v.values())}}isLeaf(m){var h;return this.isDirected()?h=this.successors(m):h=this.neighbors(m),h.length===0}filterNodes(m){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var g=this;Object.entries(this._nodes).forEach(function([w,b]){m(w)&&h.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,g.edge(w))});var v={};function x(w){var b=g.parent(w);return b===void 0||h.hasNode(b)?(v[w]=b,b):b in v?v[b]:x(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,x(w))),h}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,h){var g=this,v=arguments;return m.reduce(function(x,w){return v.length>1?g.setEdge(x,w,h):g.setEdge(x,w),w}),this}setEdge(){var m,h,g,v,x=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,h=w.w,g=w.name,arguments.length===2&&(v=arguments[1],x=!0)):(m=w,h=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],x=!0)),m=""+m,h=""+h,g!==void 0&&(g=""+g);var b=l(this._isDirected,m,h,g);if(Object.hasOwn(this._edgeLabels,b))return x&&(this._edgeLabels[b]=v),this;if(g!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(h),this._edgeLabels[b]=x?v:this._defaultEdgeLabelFn(m,h,g);var E=c(this._isDirected,m,h,g);return m=E.v,h=E.w,Object.freeze(E),this._edgeObjs[b]=E,o(this._preds[h],m),o(this._sucs[m],h),this._in[h][b]=E,this._out[m][b]=E,this._edgeCount++,this}edge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,h,g);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,h,g);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,h,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,h,g),x=this._edgeObjs[v];return x&&(m=x.v,h=x.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[h],m),a(this._sucs[m],h),delete this._in[h][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,h){var g=this._in[m];if(g){var v=Object.values(g);return h?v.filter(x=>x.v===h):v}}outEdges(m,h){var g=this._out[m];if(g){var v=Object.values(g);return h?v.filter(x=>x.w===h):v}}nodeEdges(m,h){var g=this.inEdges(m,h);if(g)return g.concat(this.outEdges(m,h))}}function o(d,m){d[m]?d[m]++:d[m]=1}function a(d,m){--d[m]||delete d[m]}function l(d,m,h,g){var v=""+m,x=""+h;if(!d&&v>x){var w=v;v=x,x=w}return v+n+x+n+(g===void 0?e:g)}function c(d,m,h,g){var v=""+m,x=""+h;if(!d&&v>x){var w=v;v=x,x=w}var b={v,w:x};return g&&(b.name=g),b}function f(d,m){return l(d,m.v,m.w,m.name)}return ed=i,ed}var td,_0;function qI(){return _0||(_0=1,td="2.2.4"),td}var nd,C0;function YI(){return C0||(C0=1,nd={Graph:rp(),version:qI()}),nd}var rd,T0;function KI(){if(T0)return rd;T0=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),d={v:l};return c!==void 0&&(d.value=c),f!==void 0&&(d.parent=f),d})}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,O0;function GI(){if(O0)return id;O0=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,I0;function l1(){if(I0)return sd;I0=1;class e{constructor(){_e(this,"_arr",[]);_e(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var o=this._keyIndices;if(n=String(n),!Object.hasOwn(o,n)){var a=this._arr,l=a.length;return o[n]=l,a.push({key:n,priority:i}),this._decrease(l),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var o=this._keyIndices[n];if(i>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+i);this._arr[o].priority=i,this._decrease(o)}_heapify(n){var i=this._arr,o=2*n,a=o+1,l=n;o<i.length&&(l=i[o].priority<i[l].priority?o:l,a<i.length&&(l=i[a].priority<i[l].priority?a:l),l!==n&&(this._swap(n,l),this._heapify(l)))}_decrease(n){for(var i=this._arr,o=i[n].priority,a;n!==0&&(a=n>>1,!(i[a].priority<o));)this._swap(n,a),n=a}_swap(n,i){var o=this._arr,a=this._keyIndices,l=o[n],c=o[i];o[n]=c,o[i]=l,a[c.key]=n,a[l.key]=i}}return sd=e,sd}var od,P0;function u1(){if(P0)return od;P0=1;var e=l1();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={},d=new e,m,h,g=function(v){var x=v.v!==m?v.v:v.w,w=f[x],b=l(v),E=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+b);E<w.distance&&(w.distance=E,w.predecessor=m,d.decrease(x,E))};for(o.nodes().forEach(function(v){var x=v===a?0:Number.POSITIVE_INFINITY;f[v]={distance:x},d.add(v,x)});d.size()>0&&(m=d.removeMin(),h=f[m],h.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(g);return f}return od}var ad,A0;function XI(){if(A0)return ad;A0=1;var e=u1();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,M0;function c1(){if(M0)return ld;M0=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(h){Object.hasOwn(o,h)?o[h].onStack&&(f.lowlink=Math.min(f.lowlink,o[h].index)):(l(h),f.lowlink=Math.min(f.lowlink,o[h].lowlink))}),f.lowlink===f.index){var d=[],m;do m=i.pop(),o[m].onStack=!1,d.push(m);while(c!==m);a.push(d)}}return t.nodes().forEach(function(c){Object.hasOwn(o,c)||l(c)}),a}return ld}var ud,R0;function QI(){if(R0)return ud;R0=1;var e=c1();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,L0;function JI(){if(L0)return cd;L0=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(d){f!==d&&(l[f][d]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(d){var m=d.v===f?d.w:d.v,h=o(d);l[f][m]={distance:h,predecessor:f}})}),c.forEach(function(f){var d=l[f];c.forEach(function(m){var h=l[m];c.forEach(function(g){var v=h[f],x=d[g],w=h[g],b=v.distance+x.distance;b<w.distance&&(w.distance=b,w.predecessor=x.predecessor)})})}),l}return cd}var fd,j0;function f1(){if(j0)return fd;j0=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,D0;function ZI(){if(D0)return dd;D0=1;var e=f1();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,$0;function d1(){if($0)return hd;$0=1,hd=e;function e(o,a,l){Array.isArray(a)||(a=[a]);var c=o.isDirected()?h=>o.successors(h):h=>o.neighbors(h),f=l==="post"?t:n,d=[],m={};return a.forEach(h=>{if(!o.hasNode(h))throw new Error("Graph does not have node: "+h);f(h,c,m,d)}),d}function t(o,a,l,c){for(var f=[[o,!1]];f.length>0;){var d=f.pop();d[1]?c.push(d[0]):Object.hasOwn(l,d[0])||(l[d[0]]=!0,f.push([d[0],!0]),i(a(d[0]),m=>f.push([m,!1])))}}function n(o,a,l,c){for(var f=[o];f.length>0;){var d=f.pop();Object.hasOwn(l,d)||(l[d]=!0,c.push(d),i(a(d),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,z0;function eP(){if(z0)return pd;z0=1;var e=d1();pd=t;function t(n,i){return e(n,i,"post")}return pd}var md,F0;function tP(){if(F0)return md;F0=1;var e=d1();md=t;function t(n,i){return e(n,i,"pre")}return md}var gd,B0;function nP(){if(B0)return gd;B0=1;var e=rp(),t=l1();gd=n;function n(i,o){var a=new e,l={},c=new t,f;function d(h){var g=h.v===f?h.w:h.v,v=c.priority(g);if(v!==void 0){var x=o(h);x<v&&(l[g]=f,c.decrease(g,x))}}if(i.nodeCount()===0)return a;i.nodes().forEach(function(h){c.add(h,Number.POSITIVE_INFINITY),a.setNode(h)}),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(d)}return a}return gd}var yd,V0;function rP(){return V0||(V0=1,yd={components:GI(),dijkstra:u1(),dijkstraAll:XI(),findCycles:QI(),floydWarshall:JI(),isAcyclic:ZI(),postorder:eP(),preorder:tP(),prim:nP(),tarjan:c1(),topsort:f1()}),yd}var vd,W0;function yn(){if(W0)return vd;W0=1;var e=YI();return vd={Graph:e.Graph,json:KI(),alg:rP(),version:e.version},vd}var wd,U0;function iP(){if(U0)return wd;U0=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,H0;function sP(){if(H0)return xd;H0=1;let e=yn().Graph,t=iP();xd=i;let n=()=>1;function i(d,m){if(d.nodeCount()<=1)return[];let h=l(d,m||n);return o(h.graph,h.buckets,h.zeroIdx).flatMap(v=>d.outEdges(v.v,v.w))}function o(d,m,h){let g=[],v=m[m.length-1],x=m[0],w;for(;d.nodeCount();){for(;w=x.dequeue();)a(d,m,h,w);for(;w=v.dequeue();)a(d,m,h,w);if(d.nodeCount()){for(let b=m.length-2;b>0;--b)if(w=m[b].dequeue(),w){g=g.concat(a(d,m,h,w,!0));break}}}return g}function a(d,m,h,g,v){let x=v?[]:void 0;return d.inEdges(g.v).forEach(w=>{let b=d.edge(w),E=d.node(w.v);v&&x.push({v:w.v,w:w.w}),E.out-=b,c(m,h,E)}),d.outEdges(g.v).forEach(w=>{let b=d.edge(w),E=w.w,_=d.node(E);_.in-=b,c(m,h,_)}),d.removeNode(g.v),x}function l(d,m){let h=new e,g=0,v=0;d.nodes().forEach(b=>{h.setNode(b,{v:b,in:0,out:0})}),d.edges().forEach(b=>{let E=h.edge(b.v,b.w)||0,_=m(b),S=E+_;h.setEdge(b.v,b.w,S),v=Math.max(v,h.node(b.v).out+=_),g=Math.max(g,h.node(b.w).in+=_)});let x=f(v+g+3).map(()=>new t),w=g+1;return h.nodes().forEach(b=>{c(x,w,h.node(b))}),{graph:h,buckets:x,zeroIdx:w}}function c(d,m,h){h.out?h.in?d[h.out-h.in+m].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}function f(d){const m=[];for(let h=0;h<d;h++)m.push(h);return m}return xd}var bd,q0;function nt(){if(q0)return bd;q0=1;let e=yn().Graph;bd={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:M,maxRank:x,normalizeRanks:f,notime:E,partition:w,pick:A,predecessorWeights:a,range:C,removeEmptyRanks:d,simplify:n,successorWeights:o,time:b,uniqueId:S,zipObject:D};function t(T,O,z,R){for(var L=R;T.hasNode(L);)L=S(R);return z.dummy=O,T.setNode(L,z),L}function n(T){let O=new e().setGraph(T.graph());return T.nodes().forEach(z=>O.setNode(z,T.node(z))),T.edges().forEach(z=>{let R=O.edge(z.v,z.w)||{weight:0,minlen:1},L=T.edge(z);O.setEdge(z.v,z.w,{weight:R.weight+L.weight,minlen:Math.max(R.minlen,L.minlen)})}),O}function i(T){let O=new e({multigraph:T.isMultigraph()}).setGraph(T.graph());return T.nodes().forEach(z=>{T.children(z).length||O.setNode(z,T.node(z))}),T.edges().forEach(z=>{O.setEdge(z,T.edge(z))}),O}function o(T){let O=T.nodes().map(z=>{let R={};return T.outEdges(z).forEach(L=>{R[L.w]=(R[L.w]||0)+T.edge(L).weight}),R});return D(T.nodes(),O)}function a(T){let O=T.nodes().map(z=>{let R={};return T.inEdges(z).forEach(L=>{R[L.v]=(R[L.v]||0)+T.edge(L).weight}),R});return D(T.nodes(),O)}function l(T,O){let z=T.x,R=T.y,L=O.x-z,G=O.y-R,j=T.width/2,X=T.height/2;if(!L&&!G)throw new Error("Not possible to find intersection inside of the rectangle");let Y,Z;return Math.abs(G)*j>Math.abs(L)*X?(G<0&&(X=-X),Y=X*L/G,Z=X):(L<0&&(j=-j),Y=j,Z=j*G/L),{x:z+Y,y:R+Z}}function c(T){let O=C(x(T)+1).map(()=>[]);return T.nodes().forEach(z=>{let R=T.node(z),L=R.rank;L!==void 0&&(O[L][R.order]=z)}),O}function f(T){let O=T.nodes().map(R=>{let L=T.node(R).rank;return L===void 0?Number.MAX_VALUE:L}),z=v(Math.min,O);T.nodes().forEach(R=>{let L=T.node(R);Object.hasOwn(L,"rank")&&(L.rank-=z)})}function d(T){let O=T.nodes().map(j=>T.node(j).rank),z=v(Math.min,O),R=[];T.nodes().forEach(j=>{let X=T.node(j).rank-z;R[X]||(R[X]=[]),R[X].push(j)});let L=0,G=T.graph().nodeRankFactor;Array.from(R).forEach((j,X)=>{j===void 0&&X%G!==0?--L:j!==void 0&&L&&j.forEach(Y=>T.node(Y).rank+=L)})}function m(T,O,z,R){let L={width:0,height:0};return arguments.length>=4&&(L.rank=z,L.order=R),t(T,"border",L,O)}function h(T,O=g){const z=[];for(let R=0;R<T.length;R+=O){const L=T.slice(R,R+O);z.push(L)}return z}const g=65535;function v(T,O){if(O.length>g){const z=h(O);return T.apply(null,z.map(R=>T.apply(null,R)))}else return T.apply(null,O)}function x(T){const z=T.nodes().map(R=>{let L=T.node(R).rank;return L===void 0?Number.MIN_VALUE:L});return v(Math.max,z)}function w(T,O){let z={lhs:[],rhs:[]};return T.forEach(R=>{O(R)?z.lhs.push(R):z.rhs.push(R)}),z}function b(T,O){let z=Date.now();try{return O()}finally{console.log(T+" time: "+(Date.now()-z)+"ms")}}function E(T,O){return O()}let _=0;function S(T){var O=++_;return T+(""+O)}function C(T,O,z=1){O==null&&(O=T,T=0);let R=G=>G<O;z<0&&(R=G=>O<G);const L=[];for(let G=T;R(G);G+=z)L.push(G);return L}function A(T,O){const z={};for(const R of O)T[R]!==void 0&&(z[R]=T[R]);return z}function M(T,O){let z=O;return typeof O=="string"&&(z=R=>R[O]),Object.entries(T).reduce((R,[L,G])=>(R[L]=z(G,L),R),{})}function D(T,O){return T.reduce((z,R,L)=>(z[R]=O[L],z),{})}return bd}var kd,Y0;function oP(){if(Y0)return kd;Y0=1;let e=sP(),t=nt().uniqueId;kd={run:n,undo:o};function n(a){(a.graph().acyclicer==="greedy"?e(a,c(a)):i(a)).forEach(f=>{let d=a.edge(f);a.removeEdge(f),d.forwardName=f.name,d.reversed=!0,a.setEdge(f.w,f.v,d,t("rev"))});function c(f){return d=>f.edge(d).weight}}function i(a){let l=[],c={},f={};function d(m){Object.hasOwn(f,m)||(f[m]=!0,c[m]=!0,a.outEdges(m).forEach(h=>{Object.hasOwn(c,h.w)?l.push(h):d(h.w)}),delete c[m])}return a.nodes().forEach(d),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,K0;function aP(){if(K0)return Sd;K0=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,d=o.node(f).rank,m=a.name,h=o.edge(a),g=h.labelRank;if(d===c+1)return;o.removeEdge(a);let v,x,w;for(w=0,++c;c<d;++w,++c)h.points=[],x={width:0,height:0,edgeLabel:h,edgeObj:a,rank:c},v=e.addDummyNode(o,"edge",x,"_d"),c===g&&(x.width=h.width,x.height=h.height,x.dummy="edge-label",x.labelpos=h.labelpos),o.setEdge(l,v,{weight:h.weight},m),w===0&&o.graph().dummyChains.push(v),l=v;o.setEdge(l,f,{weight:h.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,G0;function ou(){if(G0)return Ed;G0=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 d=e(Math.min,f);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}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,X0;function h1(){if(X0)return Nd;X0=1;var e=yn().Graph,t=ou().slack;Nd=n;function n(l){var c=new e({directed:!1}),f=l.nodes()[0],d=l.nodeCount();c.setNode(f,{});for(var m,h;i(c,l)<d;)m=o(c,l),h=c.hasNode(m.v)?t(l,m):-t(l,m),a(c,l,h);return c}function i(l,c){function f(d){c.nodeEdges(d).forEach(m=>{var h=m.v,g=d===h?m.w:h;!l.hasNode(g)&&!t(c,m)&&(l.setNode(g,{}),l.setEdge(d,g,{}),f(g))})}return l.nodes().forEach(f),l.nodeCount()}function o(l,c){return c.edges().reduce((d,m)=>{let h=Number.POSITIVE_INFINITY;return l.hasNode(m.v)!==l.hasNode(m.w)&&(h=t(c,m)),h<d[0]?[h,m]:d},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,f){l.nodes().forEach(d=>c.node(d).rank+=f)}return Nd}var _d,Q0;function lP(){if(Q0)return _d;Q0=1;var e=h1(),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=d,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=x;function l(_){_=a(_),n(_);var S=e(_);m(S),c(S,_);for(var C,A;C=g(S);)A=v(S,_,C),x(S,_,C,A)}function c(_,S){var C=o(_,_.nodes());C=C.slice(0,C.length-1),C.forEach(A=>f(_,S,A))}function f(_,S,C){var A=_.node(C),M=A.parent;_.edge(C,M).cutvalue=d(_,S,C)}function d(_,S,C){var A=_.node(C),M=A.parent,D=!0,T=S.edge(C,M),O=0;return T||(D=!1,T=S.edge(M,C)),O=T.weight,S.nodeEdges(C).forEach(z=>{var R=z.v===C,L=R?z.w:z.v;if(L!==M){var G=R===D,j=S.edge(z).weight;if(O+=G?j:-j,b(_,C,L)){var X=_.edge(C,L).cutvalue;O+=G?-X:X}}}),O}function m(_,S){arguments.length<2&&(S=_.nodes()[0]),h(_,{},1,S)}function h(_,S,C,A,M){var D=C,T=_.node(A);return S[A]=!0,_.neighbors(A).forEach(O=>{Object.hasOwn(S,O)||(C=h(_,S,C,O,A))}),T.low=D,T.lim=C++,M?T.parent=M:delete T.parent,C}function g(_){return _.edges().find(S=>_.edge(S).cutvalue<0)}function v(_,S,C){var A=C.v,M=C.w;S.hasEdge(A,M)||(A=C.w,M=C.v);var D=_.node(A),T=_.node(M),O=D,z=!1;D.lim>T.lim&&(O=T,z=!0);var R=S.edges().filter(L=>z===E(_,_.node(L.v),O)&&z!==E(_,_.node(L.w),O));return R.reduce((L,G)=>t(S,G)<t(S,L)?G:L)}function x(_,S,C,A){var M=C.v,D=C.w;_.removeEdge(M,D),_.setEdge(A.v,A.w,{}),m(_),c(_,S),w(_,S)}function w(_,S){var C=_.nodes().find(M=>!S.node(M).parent),A=i(_,C);A=A.slice(1),A.forEach(M=>{var D=_.node(M).parent,T=S.edge(M,D),O=!1;T||(T=S.edge(D,M),O=!0),S.node(M).rank=S.node(D).rank+(O?T.minlen:-T.minlen)})}function b(_,S,C){return _.hasEdge(S,C)}function E(_,S,C){return C.low<=S.lim&&S.lim<=C.lim}return _d}var Cd,J0;function uP(){if(J0)return Cd;J0=1;var e=ou(),t=e.longestPath,n=h1(),i=lP();Cd=o;function o(f){var d=f.graph().ranker;if(d instanceof Function)return d(f);switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":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,Z0;function cP(){if(Z0)return Td;Z0=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),d=f.path,m=f.lca,h=0,g=d[h],v=!0;for(;a!==c.w;){if(l=i.node(a),v){for(;(g=d[h])!==m&&i.node(g).maxRank<l.rank;)h++;g===m&&(v=!1)}if(!v){for(;h<d.length-1&&i.node(g=d[h+1]).minRank<=l.rank;)h++;g=d[h]}i.setParent(a,g),a=i.successors(a)[0]}})}function t(i,o,a,l){let c=[],f=[],d=Math.min(o[a].low,o[l].low),m=Math.max(o[a].lim,o[l].lim),h,g;h=a;do h=i.parent(h),c.push(h);while(h&&(o[h].low>d||m>o[h].lim));for(g=h,h=l;(h=i.parent(h))!==g;)f.push(h);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,ev;function fP(){if(ev)return Od;ev=1;let e=nt();Od={run:t,cleanup:a};function t(l){let c=e.addDummyNode(l,"root",{},"_root"),f=i(l),d=Object.values(f),m=e.applyWithChunking(Math.max,d)-1,h=2*m+1;l.graph().nestingRoot=c,l.edges().forEach(v=>l.edge(v).minlen*=h);let g=o(l)+1;l.children().forEach(v=>n(l,c,h,g,m,f,v)),l.graph().nodeRankFactor=h}function n(l,c,f,d,m,h,g){let v=l.children(g);if(!v.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:f});return}let x=e.addBorderNode(l,"_bt"),w=e.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(x,g),b.borderTop=x,l.setParent(w,g),b.borderBottom=w,v.forEach(E=>{n(l,c,f,d,m,h,E);let _=l.node(E),S=_.borderTop?_.borderTop:E,C=_.borderBottom?_.borderBottom:E,A=_.borderTop?d:2*d,M=S!==C?1:m-h[g]+1;l.setEdge(x,S,{weight:A,minlen:M,nestingEdge:!0}),l.setEdge(C,w,{weight:A,minlen:M,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,x,{weight:0,minlen:m+h[g]})}function i(l){var c={};function f(d,m){var h=l.children(d);h&&h.length&&h.forEach(g=>f(g,m+1)),c[d]=m}return l.children().forEach(d=>f(d,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 d=l.edge(f);d.nestingEdge&&l.removeEdge(f)})}return Od}var Id,tv;function dP(){if(tv)return Id;tv=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,d=c.maxRank+1;f<d;++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 d={width:0,height:0,rank:f,borderType:o},m=c[o][f-1],h=e.addDummyNode(i,"border",d,a);c[o][f]=h,i.setParent(h,l),m&&i.setEdge(m,h,{weight:1})}return Id}var Pd,nv;function hP(){if(nv)return Pd;nv=1,Pd={adjust:e,undo:t};function e(f){let d=f.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(f)}function t(f){let d=f.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&o(f),(d==="lr"||d==="rl")&&(l(f),n(f))}function n(f){f.nodes().forEach(d=>i(f.node(d))),f.edges().forEach(d=>i(f.edge(d)))}function i(f){let d=f.width;f.width=f.height,f.height=d}function o(f){f.nodes().forEach(d=>a(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(a),Object.hasOwn(m,"y")&&a(m)})}function a(f){f.y=-f.y}function l(f){f.nodes().forEach(d=>c(f.node(d))),f.edges().forEach(d=>{let m=f.edge(d);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(f){let d=f.x;f.x=f.y,f.y=d}return Pd}var Ad,rv;function pP(){if(rv)return Ad;rv=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 h=n.node(m);c[h.rank].push(m),n.successors(m).forEach(f)}return o.sort((m,h)=>n.node(m).rank-n.node(h).rank).forEach(f),c}return Ad}var Md,iv;function mP(){if(iv)return Md;iv=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 d=2*f-1;f-=1;let m=new Array(d).fill(0),h=0;return c.forEach(g=>{let v=g.pos+f;m[v]+=g.weight;let x=0;for(;v>0;)v%2&&(x+=m[v+1]),v=v-1>>1,m[v]+=g.weight;h+=g.weight*x}),h}return Md}var Rd,sv;function gP(){if(sv)return Rd;sv=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),d=t.node(c.v);return{sum:l.sum+f.weight*d.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,ov;function yP(){if(ov)return Ld;ov=1;let e=nt();Ld=t;function t(o,a){let l={};o.forEach((f,d)=>{let m=l[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:d};f.barycenter!==void 0&&(m.barycenter=f.barycenter,m.weight=f.weight)}),a.edges().forEach(f=>{let d=l[f.v],m=l[f.w];d!==void 0&&m!==void 0&&(m.indegree++,d.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 d=>{d.merged||(d.barycenter===void 0||f.barycenter===void 0||d.barycenter>=f.barycenter)&&i(f,d)}}function c(f){return d=>{d.in.push(f),--d.indegree===0&&o.push(d)}}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,av;function vP(){if(av)return jd;av=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),d=[],m=0,h=0,g=0;c.sort(i(!!a)),g=n(d,f,g),c.forEach(x=>{g+=x.vs.length,d.push(x.vs),m+=x.barycenter*x.weight,h+=x.weight,g=n(d,f,g)});let v={vs:d.flat(!0)};return h&&(v.barycenter=m/h,v.weight=h),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,lv;function wP(){if(lv)return Dd;lv=1;let e=gP(),t=yP(),n=vP();Dd=i;function i(l,c,f,d){let m=l.children(c),h=l.node(c),g=h?h.borderLeft:void 0,v=h?h.borderRight:void 0,x={};g&&(m=m.filter(_=>_!==g&&_!==v));let w=e(l,m);w.forEach(_=>{if(l.children(_.v).length){let S=i(l,_.v,f,d);x[_.v]=S,Object.hasOwn(S,"barycenter")&&a(_,S)}});let b=t(w,f);o(b,x);let E=n(b,d);if(g&&(E.vs=[g,E.vs,v].flat(!0),l.predecessors(g).length)){let _=l.node(l.predecessors(g)[0]),S=l.node(l.predecessors(v)[0]);Object.hasOwn(E,"barycenter")||(E.barycenter=0,E.weight=0),E.barycenter=(E.barycenter*E.weight+_.order+S.order)/(E.weight+2),E.weight+=2}return E}function o(l,c){l.forEach(f=>{f.vs=f.vs.flatMap(d=>c[d]?c[d].vs:d)})}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,uv;function xP(){if(uv)return $d;uv=1;let e=yn().Graph,t=nt();$d=n;function n(o,a,l,c){c||(c=o.nodes());let f=i(o),d=new e({compound:!0}).setGraph({root:f}).setDefaultNodeLabel(m=>o.node(m));return c.forEach(m=>{let h=o.node(m),g=o.parent(m);(h.rank===a||h.minRank<=a&&a<=h.maxRank)&&(d.setNode(m),d.setParent(m,g||f),o[l](m).forEach(v=>{let x=v.v===m?v.w:v.v,w=d.edge(x,m),b=w!==void 0?w.weight:0;d.setEdge(x,m,{weight:o.edge(v).weight+b})}),Object.hasOwn(h,"minRank")&&d.setNode(m,{borderLeft:h.borderLeft[a],borderRight:h.borderRight[a]}))}),d}function i(o){for(var a;o.hasNode(a=t.uniqueId("_root")););return a}return $d}var zd,cv;function bP(){if(cv)return zd;cv=1,zd=e;function e(t,n,i){let o={},a;i.forEach(l=>{let c=t.parent(l),f,d;for(;c;){if(f=t.parent(c),f?(d=o[f],o[f]=c):(d=a,a=c),d&&d!==c){n.setEdge(d,c);return}c=f}})}return zd}var Fd,fv;function kP(){if(fv)return Fd;fv=1;let e=pP(),t=mP(),n=wP(),i=xP(),o=bP(),a=yn().Graph,l=nt();Fd=c;function c(h,g){if(g&&typeof g.customOrder=="function"){g.customOrder(h,c);return}let v=l.maxRank(h),x=f(h,l.range(1,v+1),"inEdges"),w=f(h,l.range(v-1,-1,-1),"outEdges"),b=e(h);if(m(h,b),g&&g.disableOptimalOrderHeuristic)return;let E=Number.POSITIVE_INFINITY,_;for(let S=0,C=0;C<4;++S,++C){d(S%2?x:w,S%4>=2),b=l.buildLayerMatrix(h);let A=t(h,b);A<E&&(C=0,_=Object.assign({},b),E=A)}m(h,_)}function f(h,g,v){const x=new Map,w=(b,E)=>{x.has(b)||x.set(b,[]),x.get(b).push(E)};for(const b of h.nodes()){const E=h.node(b);if(typeof E.rank=="number"&&w(E.rank,b),typeof E.minRank=="number"&&typeof E.maxRank=="number")for(let _=E.minRank;_<=E.maxRank;_++)_!==E.rank&&w(_,b)}return g.map(function(b){return i(h,b,v,x.get(b)||[])})}function d(h,g){let v=new a;h.forEach(function(x){let w=x.graph().root,b=n(x,w,v,g);b.vs.forEach((E,_)=>x.node(E).order=_),o(x,v,b.vs)})}function m(h,g){Object.values(g).forEach(v=>v.forEach((x,w)=>h.node(x).order=w))}return Fd}var Bd,dv;function SP(){if(dv)return Bd;dv=1;let e=yn().Graph,t=nt();Bd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:h,findSmallestWidthAlignment:m,balance:g};function n(b,E){let _={};function S(C,A){let M=0,D=0,T=C.length,O=A[A.length-1];return A.forEach((z,R)=>{let L=o(b,z),G=L?b.node(L).order:T;(L||z===O)&&(A.slice(D,R+1).forEach(j=>{b.predecessors(j).forEach(X=>{let Y=b.node(X),Z=Y.order;(Z<M||G<Z)&&!(Y.dummy&&b.node(j).dummy)&&a(_,X,j)})}),D=R+1,M=G)}),A}return E.length&&E.reduce(S),_}function i(b,E){let _={};function S(A,M,D,T,O){let z;t.range(M,D).forEach(R=>{z=A[R],b.node(z).dummy&&b.predecessors(z).forEach(L=>{let G=b.node(L);G.dummy&&(G.order<T||G.order>O)&&a(_,L,z)})})}function C(A,M){let D=-1,T,O=0;return M.forEach((z,R)=>{if(b.node(z).dummy==="border"){let L=b.predecessors(z);L.length&&(T=b.node(L[0]).order,S(M,O,R,D,T),O=R,D=T)}S(M,O,M.length,T,A.length)}),M}return E.length&&E.reduce(C),_}function o(b,E){if(b.node(E).dummy)return b.predecessors(E).find(_=>b.node(_).dummy)}function a(b,E,_){if(E>_){let C=E;E=_,_=C}let S=b[E];S||(b[E]=S={}),S[_]=!0}function l(b,E,_){if(E>_){let S=E;E=_,_=S}return!!b[E]&&Object.hasOwn(b[E],_)}function c(b,E,_,S){let C={},A={},M={};return E.forEach(D=>{D.forEach((T,O)=>{C[T]=T,A[T]=T,M[T]=O})}),E.forEach(D=>{let T=-1;D.forEach(O=>{let z=S(O);if(z.length){z=z.sort((L,G)=>M[L]-M[G]);let R=(z.length-1)/2;for(let L=Math.floor(R),G=Math.ceil(R);L<=G;++L){let j=z[L];A[O]===O&&T<M[j]&&!l(_,O,j)&&(A[j]=O,A[O]=C[O]=C[j],T=M[j])}}})}),{root:C,align:A}}function f(b,E,_,S,C){let A={},M=d(b,E,_,C),D=C?"borderLeft":"borderRight";function T(R,L){let G=M.nodes(),j=G.pop(),X={};for(;j;)X[j]?R(j):(X[j]=!0,G.push(j),G=G.concat(L(j))),j=G.pop()}function O(R){A[R]=M.inEdges(R).reduce((L,G)=>Math.max(L,A[G.v]+M.edge(G)),0)}function z(R){let L=M.outEdges(R).reduce((j,X)=>Math.min(j,A[X.w]-M.edge(X)),Number.POSITIVE_INFINITY),G=b.node(R);L!==Number.POSITIVE_INFINITY&&G.borderType!==D&&(A[R]=Math.max(A[R],L))}return T(O,M.predecessors.bind(M)),T(z,M.successors.bind(M)),Object.keys(S).forEach(R=>A[R]=A[_[R]]),A}function d(b,E,_,S){let C=new e,A=b.graph(),M=x(A.nodesep,A.edgesep,S);return E.forEach(D=>{let T;D.forEach(O=>{let z=_[O];if(C.setNode(z),T){var R=_[T],L=C.edge(R,z);C.setEdge(R,z,Math.max(M(b,O,T),L||0))}T=O})}),C}function m(b,E){return Object.values(E).reduce((_,S)=>{let C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([D,T])=>{let O=w(b,D)/2;C=Math.max(T+O,C),A=Math.min(T-O,A)});const M=C-A;return M<_[0]&&(_=[M,S]),_},[Number.POSITIVE_INFINITY,null])[1]}function h(b,E){let _=Object.values(E),S=t.applyWithChunking(Math.min,_),C=t.applyWithChunking(Math.max,_);["u","d"].forEach(A=>{["l","r"].forEach(M=>{let D=A+M,T=b[D];if(T===E)return;let O=Object.values(T),z=S-t.applyWithChunking(Math.min,O);M!=="l"&&(z=C-t.applyWithChunking(Math.max,O)),z&&(b[D]=t.mapValues(T,R=>R+z))})})}function g(b,E){return t.mapValues(b.ul,(_,S)=>{if(E)return b[E.toLowerCase()][S];{let C=Object.values(b).map(A=>A[S]).sort((A,M)=>A-M);return(C[1]+C[2])/2}})}function v(b){let E=t.buildLayerMatrix(b),_=Object.assign(n(b,E),i(b,E)),S={},C;["u","d"].forEach(M=>{C=M==="u"?E:Object.values(E).reverse(),["l","r"].forEach(D=>{D==="r"&&(C=C.map(R=>Object.values(R).reverse()));let T=(M==="u"?b.predecessors:b.successors).bind(b),O=c(b,C,_,T),z=f(b,C,O.root,O.align,D==="r");D==="r"&&(z=t.mapValues(z,R=>-R)),S[M+D]=z})});let A=m(b,S);return h(S,A),g(S,b.graph().align)}function x(b,E,_){return(S,C,A)=>{let M=S.node(C),D=S.node(A),T=0,O;if(T+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":O=-M.width/2;break;case"r":O=M.width/2;break}if(O&&(T+=_?O:-O),O=0,T+=(M.dummy?E:b)/2,T+=(D.dummy?E:b)/2,T+=D.width/2,Object.hasOwn(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":O=D.width/2;break;case"r":O=-D.width/2;break}return O&&(T+=_?O:-O),O=0,T}}function w(b,E){return b.node(E).width}return Bd}var Vd,hv;function EP(){if(hv)return Vd;hv=1;let e=nt(),t=SP().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 d=f.reduce((m,h)=>{const g=o.node(h).height;return m>g?m:g},0);f.forEach(m=>o.node(m).y=c+d/2),c+=d+l})}return Vd}var Wd,pv;function NP(){if(pv)return Wd;pv=1;let e=oP(),t=aP(),n=uP(),i=nt().normalizeRanks,o=cP(),a=nt().removeEmptyRanks,l=fP(),c=dP(),f=hP(),d=kP(),m=EP(),h=nt(),g=yn().Graph;Wd=v;function v(V,W){let Q=W&&W.debugTiming?h.time:h.notime;Q("layout",()=>{let re=Q(" buildLayoutGraph",()=>T(V));Q(" runLayout",()=>x(re,Q,W)),Q(" updateInputGraph",()=>w(V,re))})}function x(V,W,Q){W(" makeSpaceForEdgeLabels",()=>O(V)),W(" removeSelfEdges",()=>q(V)),W(" acyclic",()=>e.run(V)),W(" nestingGraph.run",()=>l.run(V)),W(" rank",()=>n(h.asNonCompoundGraph(V))),W(" injectEdgeLabelProxies",()=>z(V)),W(" removeEmptyRanks",()=>a(V)),W(" nestingGraph.cleanup",()=>l.cleanup(V)),W(" normalizeRanks",()=>i(V)),W(" assignRankMinMax",()=>R(V)),W(" removeEdgeLabelProxies",()=>L(V)),W(" normalize.run",()=>t.run(V)),W(" parentDummyChains",()=>o(V)),W(" addBorderSegments",()=>c(V)),W(" order",()=>d(V,Q)),W(" insertSelfEdges",()=>H(V)),W(" adjustCoordinateSystem",()=>f.adjust(V)),W(" position",()=>m(V)),W(" positionSelfEdges",()=>B(V)),W(" removeBorderNodes",()=>Z(V)),W(" normalize.undo",()=>t.undo(V)),W(" fixupEdgeLabelCoords",()=>X(V)),W(" undoCoordinateSystem",()=>f.undo(V)),W(" translateGraph",()=>G(V)),W(" assignNodeIntersects",()=>j(V)),W(" reversePoints",()=>Y(V)),W(" acyclic.undo",()=>e.undo(V))}function w(V,W){V.nodes().forEach(Q=>{let re=V.node(Q),oe=W.node(Q);re&&(re.x=oe.x,re.y=oe.y,re.rank=oe.rank,W.children(Q).length&&(re.width=oe.width,re.height=oe.height))}),V.edges().forEach(Q=>{let re=V.edge(Q),oe=W.edge(Q);re.points=oe.points,Object.hasOwn(oe,"x")&&(re.x=oe.x,re.y=oe.y)}),V.graph().width=W.graph().width,V.graph().height=W.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],S=["width","height","rank"],C={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function T(V){let W=new g({multigraph:!0,compound:!0}),Q=U(V.graph());return W.setGraph(Object.assign({},E,$(Q,b),h.pick(Q,_))),V.nodes().forEach(re=>{let oe=U(V.node(re));const ee=$(oe,S);Object.keys(C).forEach(se=>{ee[se]===void 0&&(ee[se]=C[se])}),W.setNode(re,ee),W.setParent(re,V.parent(re))}),V.edges().forEach(re=>{let oe=U(V.edge(re));W.setEdge(re,Object.assign({},M,$(oe,A),h.pick(oe,D)))}),W}function O(V){let W=V.graph();W.ranksep/=2,V.edges().forEach(Q=>{let re=V.edge(Q);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(W.rankdir==="TB"||W.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function z(V){V.edges().forEach(W=>{let Q=V.edge(W);if(Q.width&&Q.height){let re=V.node(W.v),ee={rank:(V.node(W.w).rank-re.rank)/2+re.rank,e:W};h.addDummyNode(V,"edge-proxy",ee,"_ep")}})}function R(V){let W=0;V.nodes().forEach(Q=>{let re=V.node(Q);re.borderTop&&(re.minRank=V.node(re.borderTop).rank,re.maxRank=V.node(re.borderBottom).rank,W=Math.max(W,re.maxRank))}),V.graph().maxRank=W}function L(V){V.nodes().forEach(W=>{let Q=V.node(W);Q.dummy==="edge-proxy"&&(V.edge(Q.e).labelRank=Q.rank,V.removeNode(W))})}function G(V){let W=Number.POSITIVE_INFINITY,Q=0,re=Number.POSITIVE_INFINITY,oe=0,ee=V.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;W=Math.min(W,fe-Pe/2),Q=Math.max(Q,fe+Pe/2),re=Math.min(re,Se-Ae/2),oe=Math.max(oe,Se+Ae/2)}V.nodes().forEach(he=>xe(V.node(he))),V.edges().forEach(he=>{let fe=V.edge(he);Object.hasOwn(fe,"x")&&xe(fe)}),W-=se,re-=de,V.nodes().forEach(he=>{let fe=V.node(he);fe.x-=W,fe.y-=re}),V.edges().forEach(he=>{let fe=V.edge(he);fe.points.forEach(Se=>{Se.x-=W,Se.y-=re}),Object.hasOwn(fe,"x")&&(fe.x-=W),Object.hasOwn(fe,"y")&&(fe.y-=re)}),ee.width=Q-W+se,ee.height=oe-re+de}function j(V){V.edges().forEach(W=>{let Q=V.edge(W),re=V.node(W.v),oe=V.node(W.w),ee,se;Q.points?(ee=Q.points[0],se=Q.points[Q.points.length-1]):(Q.points=[],ee=oe,se=re),Q.points.unshift(h.intersectRect(re,ee)),Q.points.push(h.intersectRect(oe,se))})}function X(V){V.edges().forEach(W=>{let Q=V.edge(W);if(Object.hasOwn(Q,"x"))switch((Q.labelpos==="l"||Q.labelpos==="r")&&(Q.width-=Q.labeloffset),Q.labelpos){case"l":Q.x-=Q.width/2+Q.labeloffset;break;case"r":Q.x+=Q.width/2+Q.labeloffset;break}})}function Y(V){V.edges().forEach(W=>{let Q=V.edge(W);Q.reversed&&Q.points.reverse()})}function Z(V){V.nodes().forEach(W=>{if(V.children(W).length){let Q=V.node(W),re=V.node(Q.borderTop),oe=V.node(Q.borderBottom),ee=V.node(Q.borderLeft[Q.borderLeft.length-1]),se=V.node(Q.borderRight[Q.borderRight.length-1]);Q.width=Math.abs(se.x-ee.x),Q.height=Math.abs(oe.y-re.y),Q.x=ee.x+Q.width/2,Q.y=re.y+Q.height/2}}),V.nodes().forEach(W=>{V.node(W).dummy==="border"&&V.removeNode(W)})}function q(V){V.edges().forEach(W=>{if(W.v===W.w){var Q=V.node(W.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:W,label:V.edge(W)}),V.removeEdge(W)}})}function H(V){var W=h.buildLayerMatrix(V);W.forEach(Q=>{var re=0;Q.forEach((oe,ee)=>{var se=V.node(oe);se.order=ee+re,(se.selfEdges||[]).forEach(de=>{h.addDummyNode(V,"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 B(V){V.nodes().forEach(W=>{var Q=V.node(W);if(Q.dummy==="selfedge"){var re=V.node(Q.e.v),oe=re.x+re.width/2,ee=re.y,se=Q.x-oe,de=re.height/2;V.setEdge(Q.e,Q.label),V.removeNode(W),Q.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}],Q.label.x=Q.x,Q.label.y=Q.y}})}function $(V,W){return h.mapValues(h.pick(V,W),Number)}function U(V){var W={};return V&&Object.entries(V).forEach(([Q,re])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),W[Q]=re}),W}return Wd}var Ud,mv;function _P(){if(mv)return Ud;mv=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((d,m)=>(a.setEdge(d,m,{style:"invis"}),m))}),a}return Ud}var Hd,gv;function CP(){return gv||(gv=1,Hd="1.1.8"),Hd}var qd,yv;function TP(){return yv||(yv=1,qd={graphlib:yn(),layout:NP(),debug:_P(),util:{time:nt().time,notime:nt().notime},version:CP()}),qd}var OP=TP();const vv=hu(OP),wv=220,xv=140,Yd=60;function IP(e){return I.useMemo(()=>{if(!e)return{nodes:[],edges:[]};const t=new vv.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.")?xv:wv;t.setNode(o.id,{width:a,height:Yd})}for(const o of e.edges)t.setEdge(o.from,o.to);vv.layout(t);const n=e.nodes.map(o=>{const a=t.node(o.id),l=o.type==="task.branch"||o.type.startsWith("trigger.")?xv:wv;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 PP="hsl(240 5% 65%)",p1="hsl(142 71% 42%)",AP="hsl(0 72% 55%)",MP="hsl(38 92% 50%)";function RP(e,t){const n=e!=="idle";return{stroke:e==="failed"?AP:e==="running"?MP:n?p1:PP,strokeWidth:n?2.5:1.5,strokeDasharray:t&&!n?"6 4":void 0,animated:e==="running",fired:n}}const LP={workflowNode:E0,agentNode:E0};function jP({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:o,edges:a}=IP(e),[l,c]=I.useState(!1),f=o.map(x=>({...x,data:{...x.data,onNodeClick:t,liveStatus:i[x.id]??"idle"}})),d=a.map(x=>{const w=RP(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=I.useCallback((x,w)=>{const b=w.data.node;b&&t(b)},[t]),h=I.useCallback(x=>{x.preventDefault(),x.dataTransfer.dropEffect="copy",c(!0)},[]),g=I.useCallback(()=>{c(!1)},[]),v=I.useCallback(x=>{x.preventDefault(),c(!1);const w=x.dataTransfer.files[0];if(!w)return;const b=new FileReader;b.onload=E=>{var S;const _=(S=E.target)==null?void 0:S.result;typeof _=="string"&&n(_)},b.readAsText(w)},[n]);return N.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:h,onDragLeave:g,onDrop:v,children:[N.jsxs(hO,{nodes:f,edges:d,nodeTypes:LP,onNodeClick:m,fitView:!0,attributionPosition:"bottom-right",children:[N.jsx(vO,{variant:Jn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),N.jsx(NO,{})]}),l&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/70 border-2 border-dashed border-primary pointer-events-none z-10",children:N.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),N.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"}),N.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-3 text-[10px] font-mono text-mutedfg pointer-events-none bg-bg/80 border border-border rounded px-2 py-1",children:[N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{className:"inline-block w-4 border-t-2 border-dashed",style:{borderColor:"hsl(240 5% 65%)"}})," branch"]}),N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{className:"inline-block w-4 border-t-2",style:{borderColor:p1}})," 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 bv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function DP(...e){return t=>{let n=!1;const i=e.map(o=>{const a=bv(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():bv(e[o],null)}}}}function Ut(...e){return I.useCallback(DP(...e),e)}function m1(e,t=[]){let n=[];function i(a,l){const c=I.createContext(l);c.displayName=a+"Context";const f=n.length;n=[...n,l];const d=h=>{var E;const{scope:g,children:v,...x}=h,w=((E=g==null?void 0:g[e])==null?void 0:E[f])||c,b=I.useMemo(()=>x,Object.values(x));return N.jsx(w.Provider,{value:b,children:v})};d.displayName=a+"Provider";function m(h,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[f])||c,x=I.useContext(v);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,m]}const o=()=>{const a=n.map(l=>I.createContext(l));return function(c){const f=(c==null?void 0:c[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[i,$P(o,...t)]}function $P(...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:d})=>{const h=f(a)[`__scope${d}`];return{...c,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ds=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},zP=Lh[" useId ".trim().toString()]||(()=>{}),FP=0;function Kd(e){const[t,n]=I.useState(zP());return ds(()=>{n(i=>i??String(FP++))},[e]),e||(t?`radix-${t}`:"")}var BP=Lh[" useInsertionEffect ".trim().toString()]||ds;function VP({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,a,l]=WP({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:o;{const m=I.useRef(e!==void 0);I.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${i} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,i])}const d=I.useCallback(m=>{var h;if(c){const g=UP(m)?m(e):m;g!==e&&((h=l.current)==null||h.call(l,g))}else a(m)},[c,e,a,l]);return[f,d]}function WP({defaultProp:e,onChange:t}){const[n,i]=I.useState(e),o=I.useRef(n),a=I.useRef(t);return BP(()=>{a.current=t},[t]),I.useEffect(()=>{var l;o.current!==n&&((l=a.current)==null||l.call(a,n),o.current=n)},[n,o]),[n,i,a]}function UP(e){return typeof e=="function"}function g1(e){const t=I.forwardRef((n,i)=>{let{children:o,...a}=n,l=null,c=!1;const f=[];kv(o)&&typeof Cl=="function"&&(o=Cl(o._payload)),I.Children.forEach(o,g=>{var v;if(GP(g)){c=!0;const x=g;let w="child"in x.props?x.props.child:x.props.children;kv(w)&&typeof Cl=="function"&&(w=Cl(w._payload)),l=qP(x,w),f.push((v=l==null?void 0:l.props)==null?void 0:v.children)}else f.push(g)}),l?l=I.cloneElement(l,void 0,f):!c&&I.Children.count(o)===1&&I.isValidElement(o)&&(l=o);const d=l?KP(l):void 0,m=Ut(i,d);if(!l){if(o||o===0)throw new Error(c?ZP(e):JP(e));return o}const h=YP(a,l.props??{});return l.type!==I.Fragment&&(h.ref=i?m:d),I.cloneElement(l,h)});return t.displayName=`${e}.Slot`,t}var HP=Symbol.for("radix.slottable"),qP=(e,t)=>{if("child"in e.props){const n=e.props.child;return I.isValidElement(n)?I.cloneElement(n,void 0,e.props.children(n.props.children)):null}return I.isValidElement(t)?t:null};function YP(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 KP(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 GP(e){return I.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HP}var XP=Symbol.for("react.lazy");function kv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===XP&&"_payload"in e&&QP(e._payload)}function QP(e){return typeof e=="object"&&e!==null&&"then"in e}var JP=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ZP=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cl=Lh[" use ".trim().toString()],eA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=eA.reduce((e,t)=>{const n=g1(`Primitive.${t}`),i=I.forwardRef((o,a)=>{const{asChild:l,...c}=o,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),N.jsx(f,{...c,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function tA(e,t){e&&ax.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function nA(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);I.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 rA="DismissableLayer",Eh="dismissableLayer.update",iA="dismissableLayer.pointerDownOutside",sA="dismissableLayer.focusOutside",Sv,ip=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),y1=I.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...d}=e,m=I.useContext(ip),[h,g]=I.useState(null),v=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=I.useState({}),w=Ut(t,O=>g(O)),b=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=b.indexOf(E),S=h?b.indexOf(h):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,A=S>=_,M=I.useRef(!1),D=uA(O=>{const z=O.target;if(!(z instanceof Node))return;const R=[...m.branches].some(L=>L.contains(z));!A||R||(a==null||a(O),c==null||c(O),O.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:m.dismissableSurfaces}),T=cA(O=>{if(i&&M.current)return;const z=O.target;[...m.branches].some(L=>L.contains(z))||(l==null||l(O),c==null||c(O),O.defaultPrevented||f==null||f())},v);return nA(O=>{S===m.layers.size-1&&(o==null||o(O),!O.defaultPrevented&&f&&(O.preventDefault(),f()))},v),I.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Sv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Ev(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=Sv))}},[h,v,n,m]),I.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Ev())},[h,m]),I.useEffect(()=>{const O=()=>x({});return document.addEventListener(Eh,O),()=>document.removeEventListener(Eh,O)},[]),N.jsx(Rt.div,{...d,ref:w,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:St(e.onFocusCapture,T.onFocusCapture),onBlurCapture:St(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:St(e.onPointerDownCapture,D.onPointerDownCapture)})});y1.displayName=rA;var oA="DismissableLayerBranch",aA=I.forwardRef((e,t)=>{const n=I.useContext(ip),i=I.useRef(null),o=Ut(t,i);return I.useEffect(()=>{const a=i.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),N.jsx(Rt.div,{...e,ref:o})});aA.displayName=oA;function lA(){const e=I.useContext(ip),[t,n]=I.useState(null);return I.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function uA(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a}=t,l=Zt(e),c=I.useRef(!1),f=I.useRef(!1),d=I.useRef(new Map),m=I.useRef(()=>{});return I.useEffect(()=>{function h(){f.current=!1,o.current=!1,d.current.clear()}function g(){return Array.from(d.current.values()).some(Boolean)}function v(_){if(!f.current)return;const S=_.target;S instanceof Node&&[...a].some(A=>A.contains(S))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function x(_){f.current&&d.current.set(_.type,!1)}const w=_=>{if(_.target&&!c.current){let S=function(){n.removeEventListener("click",m.current);const A=g();h(),A||v1(iA,l,C,{discrete:!0})};const C={originalEvent:_};f.current=!0,o.current=i&&_.button===0,d.current.clear(),!i||_.button!==0?S():(n.removeEventListener("click",m.current),m.current=S,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),h();c.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)n.addEventListener(_,v,!0),n.addEventListener(_,x);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const _ of b)n.removeEventListener(_,v,!0),n.removeEventListener(_,x)}},[n,l,i,o,a]),{onPointerDownCapture:()=>c.current=!0}}function cA(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=I.useRef(!1);return I.useEffect(()=>{const o=a=>{a.target&&!i.current&&v1(sA,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 Ev(){const e=new CustomEvent(Eh);document.dispatchEvent(e)}function v1(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?tA(o,a):o.dispatchEvent(a)}var Gd="focusScope.autoFocusOnMount",Xd="focusScope.autoFocusOnUnmount",Nv={bubbles:!1,cancelable:!0},fA="FocusScope",w1=I.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...l}=e,[c,f]=I.useState(null),d=Zt(o),m=Zt(a),h=I.useRef(null),g=Ut(t,w=>f(w)),v=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(i){let w=function(S){if(v.paused||!c)return;const C=S.target;c.contains(C)?h.current=C:_r(h.current,{select:!0})},b=function(S){if(v.paused||!c)return;const C=S.relatedTarget;C!==null&&(c.contains(C)||_r(h.current,{select:!0}))},E=function(S){if(document.activeElement===document.body)for(const A of S)A.removedNodes.length>0&&_r(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const _=new MutationObserver(E);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),_.disconnect()}}},[i,c,v.paused]),I.useEffect(()=>{if(c){Cv.add(v);const w=document.activeElement;if(!c.contains(w)){const E=new CustomEvent(Gd,Nv);c.addEventListener(Gd,d),c.dispatchEvent(E),E.defaultPrevented||(dA(yA(x1(c)),{select:!0}),document.activeElement===w&&_r(c))}return()=>{c.removeEventListener(Gd,d),setTimeout(()=>{const E=new CustomEvent(Xd,Nv);c.addEventListener(Xd,m),c.dispatchEvent(E),E.defaultPrevented||_r(w??document.body,{select:!0}),c.removeEventListener(Xd,m),Cv.remove(v)},0)}}},[c,d,m,v]);const x=I.useCallback(w=>{if(!n&&!i||v.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(b&&E){const _=w.currentTarget,[S,C]=hA(_);S&&C?!w.shiftKey&&E===C?(w.preventDefault(),n&&_r(S,{select:!0})):w.shiftKey&&E===S&&(w.preventDefault(),n&&_r(C,{select:!0})):E===_&&w.preventDefault()}},[n,i,v.paused]);return N.jsx(Rt.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});w1.displayName=fA;function dA(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(_r(i,{select:t}),document.activeElement!==n)return}function hA(e){const t=x1(e),n=_v(t,e),i=_v(t.reverse(),e);return[n,i]}function x1(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 _v(e,t){for(const n of e)if(!pA(n,{upTo:t}))return n}function pA(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 mA(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&&mA(e)&&t&&e.select()}}var Cv=gA();function gA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Tv(e,t),e.unshift(t)},remove(t){var n;e=Tv(e,t),(n=e[0])==null||n.resume()}}}function Tv(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function yA(e){return e.filter(t=>t.tagName!=="A")}var vA="Portal",b1=I.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,a]=I.useState(!1);ds(()=>a(!0),[]);const l=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?ax.createPortal(N.jsx(Rt.div,{...i,ref:t}),l):null});b1.displayName=vA;function wA(e,t){return I.useReducer((n,i)=>t[n][i]??n,e)}var Mr=e=>{const{present:t,children:n}=e,i=xA(t),o=typeof n=="function"?n({present:i.isPresent}):I.Children.only(n),a=bA(i.ref,kA(o));return typeof n=="function"||i.isPresent?I.cloneElement(o,{ref:a}):null};Mr.displayName="Presence";function xA(e){const[t,n]=I.useState(),i=I.useRef(null),o=I.useRef(e),a=I.useRef("none"),l=e?"mounted":"unmounted",[c,f]=wA(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const d=Tl(i.current);a.current=c==="mounted"?d:"none"},[c]),ds(()=>{const d=i.current,m=o.current;if(m!==e){const g=a.current,v=Tl(d);e?f("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),ds(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=Tl(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=v=>{v.target===t&&(a.current=Tl(i.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:I.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function Ov(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bA(...e){const t=I.useRef(e);return t.current=e,I.useCallback(n=>{const i=t.current;let o=!1;const a=i.map(l=>{const c=Ov(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():Ov(i[l],null)}}},[])}function Tl(e){return(e==null?void 0:e.animationName)||"none"}function kA(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 SA(){I.useEffect(()=>{On||(On={start:Iv(),end:Iv()});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 Iv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var An=function(){return An=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},An.apply(this,arguments)};function k1(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 EA(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",NA="with-scroll-bars-hidden",_A="--removed-body-scroll-bar-size";function Qd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CA(e,t){var n=I.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 TA=typeof window<"u"?I.useLayoutEffect:I.useEffect,Pv=new WeakMap;function OA(e,t){var n=CA(null,function(i){return e.forEach(function(o){return Qd(o,i)})});return TA(function(){var i=Pv.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)})}Pv.set(n,e)},[e]),n}function IA(e){return e}function PA(e,t){t===void 0&&(t=IA);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)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(m){l.push(m),d()},filter:function(m){return l=l.filter(m),n}}}};return o}function AA(e){e===void 0&&(e={});var t=PA(null);return t.options=An({async:!0,ssr:!1},e),t}var S1=function(e){var t=e.sideCar,n=k1(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 I.createElement(i,An({},n))};S1.isSideCarExport=!0;function MA(e,t){return e.useMedium(t),S1}var E1=AA(),Jd=function(){},_u=I.forwardRef(function(e,t){var n=I.useRef(null),i=I.useState({onScrollCapture:Jd,onWheelCapture:Jd,onTouchMoveCapture:Jd}),o=i[0],a=i[1],l=e.forwardProps,c=e.children,f=e.className,d=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,b=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,S=e.gapMode,C=k1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,M=OA([n,t]),D=An(An({},C),o);return I.createElement(I.Fragment,null,m&&I.createElement(A,{sideCar:E1,removeScrollBar:d,shards:h,noRelative:v,noIsolation:x,inert:w,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:S}),l?I.cloneElement(I.Children.only(c),An(An({},D),{ref:M})):I.createElement(_,An({},D,{className:f,ref:M}),c))});_u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_u.classNames={fullWidth:Hl,zeroRight:Ul};var RA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=RA();return t&&e.setAttribute("nonce",t),e}function jA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $A=function(){var e=0,t=null;return{add:function(n){e==0&&(t=LA())&&(jA(t,n),DA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zA=function(){var e=$A();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},N1=function(){var e=zA(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},FA={left:0,top:0,right:0,gap:0},Zd=function(e){return parseInt(e||"",10)||0},BA=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)]},VA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return FA;var t=BA(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])}},WA=N1(),ns="data-scroll-locked",UA=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(NA,` {
|
|
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(_A,": ").concat(c,`px;
|
|
98
|
+
}
|
|
99
|
+
`)},Av=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},HA=function(){I.useEffect(function(){return document.body.setAttribute(ns,(Av()+1).toString()),function(){var e=Av()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},qA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;HA();var a=I.useMemo(function(){return VA(o)},[o]);return I.createElement(WA,{styles:UA(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,YA=function(e){return e.tagName==="TEXTAREA"},_1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YA(e)&&n[t]==="visible")},KA=function(e){return _1(e,"overflowY")},GA=function(e){return _1(e,"overflowX")},Mv=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=C1(e,i);if(o){var a=T1(e,i),l=a[1],c=a[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},XA=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]},C1=function(e,t){return e==="v"?KA(t):GA(t)},T1=function(e,t){return e==="v"?XA(t):QA(t)},JA=function(e,t){return e==="h"&&t==="rtl"?-1:1},ZA=function(e,t,n,i,o){var a=JA(e,window.getComputedStyle(t).direction),l=a*i,c=n.target,f=t.contains(c),d=!1,m=l>0,h=0,g=0;do{if(!c)break;var v=T1(e,c),x=v[0],w=v[1],b=v[2],E=w-b-a*x;(x||E)&&C1(e,c)&&(h+=E,g+=x);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(h)<1||!m&&Math.abs(g)<1)&&(d=!0),d},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rv=function(e){return[e.deltaX,e.deltaY]},Lv=function(e){return e&&"current"in e?e.current:e},eM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tM=function(e){return`
|
|
100
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
101
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
102
|
+
`)},nM=0,Hi=[];function rM(e){var t=I.useRef([]),n=I.useRef([0,0]),i=I.useRef(),o=I.useState(nM++)[0],a=I.useState(N1)[0],l=I.useRef(e);I.useEffect(function(){l.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=EA([e.lockRef.current],(e.shards||[]).map(Lv),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=I.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var E=Pl(w),_=n.current,S="deltaX"in w?w.deltaX:_[0]-E[0],C="deltaY"in w?w.deltaY:_[1]-E[1],A,M=w.target,D=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in w&&D==="h"&&M.type==="range")return!1;var T=window.getSelection(),O=T&&T.anchorNode,z=O?O===M||O.contains(M):!1;if(z)return!1;var R=Mv(D,M);if(!R)return!0;if(R?A=D:(A=D==="v"?"h":"v",R=Mv(D,M)),!R)return!1;if(!i.current&&"changedTouches"in w&&(S||C)&&(i.current=A),!A)return!0;var L=i.current||A;return ZA(L,b,w,L==="h"?S:C)},[]),f=I.useCallback(function(w){var b=w;if(!(!Hi.length||Hi[Hi.length-1]!==a)){var E="deltaY"in b?Rv(b):Pl(b),_=t.current.filter(function(A){return A.name===b.type&&(A.target===b.target||b.target===A.shadowParent)&&eM(A.delta,E)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var S=(l.current.shards||[]).map(Lv).filter(Boolean).filter(function(A){return A.contains(b.target)}),C=S.length>0?c(b,S[0]):!l.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),d=I.useCallback(function(w,b,E,_){var S={name:w,delta:b,target:E,should:_,shadowParent:iM(E)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),m=I.useCallback(function(w){n.current=Pl(w),i.current=void 0},[]),h=I.useCallback(function(w){d(w.type,Rv(w),w.target,c(w,e.lockRef.current))},[]),g=I.useCallback(function(w){d(w.type,Pl(w),w.target,c(w,e.lockRef.current))},[]);I.useEffect(function(){return Hi.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,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 I.createElement(I.Fragment,null,x?I.createElement(a,{styles:tM(o)}):null,v?I.createElement(qA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sM=MA(E1,rM);var O1=I.forwardRef(function(e,t){return I.createElement(_u,An({},e,{ref:t,sideCar:sM}))});O1.classNames=_u.classNames;var oM=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,I1=function(e){return e&&(e.host||I1(e.parentNode))},aM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=I1(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})},lM=function(e,t,n,i){var o=aM(t,Array.isArray(e)?e:[e]);Ml[n]||(Ml[n]=new WeakMap);var a=Ml[n],l=[],c=new Set,f=new Set(o),d=function(h){!h||c.has(h)||(c.add(h),d(h.parentNode))};o.forEach(d);var m=function(h){!h||f.has(h)||Array.prototype.forEach.call(h.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(i),x=v!==null&&v!=="false",w=(qi.get(g)||0)+1,b=(a.get(g)||0)+1;qi.set(g,w),a.set(g,b),l.push(g),w===1&&x&&Al.set(g,!0),b===1&&g.setAttribute(n,"true"),x||g.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return m(t),c.clear(),eh++,function(){l.forEach(function(h){var g=qi.get(h)-1,v=a.get(h)-1;qi.set(h,g),a.set(h,v),g||(Al.has(h)||h.removeAttribute(i),Al.delete(h)),v||h.removeAttribute(n)}),eh--,eh||(qi=new WeakMap,qi=new WeakMap,Al=new WeakMap,Ml={})}},uM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=oM(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),lM(i,o,n,"aria-hidden")):function(){return null}},Cu="Dialog",[P1]=m1(Cu),[cM,wn]=P1(Cu),A1=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=I.useRef(null),f=I.useRef(null),[d,m]=VP({prop:i,defaultProp:o??!1,onChange:a,caller:Cu});return N.jsx(cM,{scope:t,triggerRef:c,contentRef:f,contentId:Kd(),titleId:Kd(),descriptionId:Kd(),open:d,onOpenChange:m,onOpenToggle:I.useCallback(()=>m(h=>!h),[m]),modal:l,children:n})};A1.displayName=Cu;var M1="DialogTrigger",fM=I.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(M1,n),a=Ut(t,o.triggerRef);return N.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":up(o.open),...i,ref:a,onClick:St(e.onClick,o.onOpenToggle)})});fM.displayName=M1;var sp="DialogPortal",[dM,R1]=P1(sp,{forceMount:void 0}),L1=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:o}=e,a=wn(sp,t);return N.jsx(dM,{scope:t,forceMount:n,children:I.Children.map(i,l=>N.jsx(Mr,{present:n||a.open,children:N.jsx(b1,{asChild:!0,container:o,children:l})}))})};L1.displayName=sp;var au="DialogOverlay",op=I.forwardRef((e,t)=>{const n=R1(au,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(au,e.__scopeDialog);return a.modal?N.jsx(Mr,{present:i||a.open,children:N.jsx(pM,{...o,ref:t})}):null});op.displayName=au;var hM=g1("DialogOverlay.RemoveScroll"),pM=I.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(au,n),a=lA(),l=Ut(t,a);return N.jsx(O1,{as:hM,allowPinchZoom:!0,shards:[o.contentRef],children:N.jsx(Rt.div,{"data-state":up(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),hs="DialogContent",ap=I.forwardRef((e,t)=>{const n=R1(hs,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(hs,e.__scopeDialog);return N.jsx(Mr,{present:i||a.open,children:a.modal?N.jsx(mM,{...o,ref:t}):N.jsx(gM,{...o,ref:t})})});ap.displayName=hs;var mM=I.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=I.useRef(null),o=Ut(t,n.contentRef,i);return I.useEffect(()=>{const a=i.current;if(a)return uM(a)},[]),N.jsx(j1,{...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())})}),gM=I.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=I.useRef(!1),o=I.useRef(!1);return N.jsx(j1,{...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,d;(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;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),j1=I.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...l}=e,c=wn(hs,n);return SA(),N.jsx(N.Fragment,{children:N.jsx(w1,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:N.jsx(y1,{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)})})})}),D1="DialogTitle",lp=I.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(D1,n);return N.jsx(Rt.h2,{id:o.titleId,...i,ref:t})});lp.displayName=D1;var $1="DialogDescription",yM=I.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn($1,n);return N.jsx(Rt.p,{id:o.descriptionId,...i,ref:t})});yM.displayName=$1;var z1="DialogClose",F1=I.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(z1,n);return N.jsx(Rt.button,{type:"button",...i,ref:t,onClick:St(e.onClick,()=>o.onOpenChange(!1))})});F1.displayName=z1;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 vM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),jv=e=>{const t=wM(e);return t.charAt(0).toUpperCase()+t.slice(1)},B1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),xM=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 bM={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 kM=I.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:a,iconNode:l,...c},f)=>I.createElement("svg",{ref:f,...bM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:B1("lucide",o),...!a&&!xM(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>I.createElement(d,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 SM=(e,t)=>{const n=I.forwardRef(({className:i,...o},a)=>I.createElement(kM,{ref:a,iconNode:t,className:B1(`lucide-${vM(jv(e))}`,`lucide-${e}`,i),...o}));return n.displayName=jv(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 EM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],NM=SM("x",EM),_M=A1,CM=L1,V1=I.forwardRef(({className:e,...t},n)=>N.jsx(op,{className:je("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));V1.displayName=op.displayName;const W1=I.forwardRef(({side:e="right",wide:t=!1,className:n,children:i,...o},a)=>N.jsxs(CM,{children:[N.jsx(V1,{}),N.jsxs(ap,{ref:a,className:je("fixed z-50 bg-bg shadow-lg transition-[width] duration-200 flex flex-col",t?"w-[42rem] max-w-[70vw]":"w-80",e==="right"&&"inset-y-0 right-0 border-l border-border",e==="left"&&"inset-y-0 left-0 border-r border-border",n),...o,children:[i,N.jsxs(F1,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[N.jsx(NM,{className:"h-4 w-4"}),N.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));W1.displayName=ap.displayName;const U1=({className:e,...t})=>N.jsx("div",{className:je("flex flex-col space-y-2 p-4 border-b border-border",e),...t});U1.displayName="SheetHeader";const H1=I.forwardRef(({className:e,...t},n)=>N.jsx(lp,{ref:n,className:je("font-semibold",e),...t}));H1.displayName=lp.displayName;var TM=I.createContext(void 0);function OM(e){const t=I.useContext(TM);return e||t||"ltr"}function IM(e,[t,n]){return Math.min(n,Math.max(t,e))}function PM(e,t){return I.useReducer((n,i)=>t[n][i]??n,e)}var cp="ScrollArea",[q1]=m1(cp),[AM,rn]=q1(cp),Y1=I.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:a=600,...l}=e,[c,f]=I.useState(null),[d,m]=I.useState(null),[h,g]=I.useState(null),[v,x]=I.useState(null),[w,b]=I.useState(null),[E,_]=I.useState(0),[S,C]=I.useState(0),[A,M]=I.useState(!1),[D,T]=I.useState(!1),O=Ut(t,R=>f(R)),z=OM(o);return N.jsx(AM,{scope:n,type:i,dir:z,scrollHideDelay:a,scrollArea:c,viewport:d,onViewportChange:m,content:h,onContentChange:g,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:A,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:D,onScrollbarYEnabledChange:T,onCornerWidthChange:_,onCornerHeightChange:C,children:N.jsx(Rt.div,{dir:z,...l,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});Y1.displayName=cp;var K1="ScrollAreaViewport",G1=I.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:o,...a}=e,l=rn(K1,n),c=I.useRef(null),f=Ut(t,c,l.onViewportChange);return N.jsxs(N.Fragment,{children:[N.jsx(MM,{nonce:o}),N.jsx(Rt.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:N.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});G1.displayName=K1;var MM=I.memo(({nonce:e})=>N.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),jn="ScrollAreaScrollbar",fp=I.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(jn,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=o,c=e.orientation==="horizontal";return I.useEffect(()=>(c?a(!0):l(!0),()=>{c?a(!1):l(!1)}),[c,a,l]),o.type==="hover"?N.jsx(RM,{...i,ref:t,forceMount:n}):o.type==="scroll"?N.jsx(LM,{...i,ref:t,forceMount:n}):o.type==="auto"?N.jsx(X1,{...i,ref:t,forceMount:n}):o.type==="always"?N.jsx(dp,{...i,ref:t,"data-state":"visible"}):null});fp.displayName=jn;var RM=I.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(jn,e.__scopeScrollArea),[a,l]=I.useState(!1);return I.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const d=()=>{window.clearTimeout(f),l(!0)},m=()=>{f=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),N.jsx(Mr,{present:n||a,children:N.jsx(X1,{"data-state":a?"visible":"hidden",...i,ref:t})})}),LM=I.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(jn,e.__scopeScrollArea),a=e.orientation==="horizontal",l=Ou(()=>f("SCROLL_END"),100),[c,f]=PM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return I.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,o.scrollHideDelay,f]),I.useEffect(()=>{const d=o.viewport,m=a?"scrollLeft":"scrollTop";if(d){let h=d[m];const g=()=>{const v=d[m];h!==v&&(f("SCROLL"),l()),h=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[o.viewport,a,f,l]),N.jsx(Mr,{present:n||c!=="hidden",children:N.jsx(dp,{"data-state":c==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:St(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:St(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),X1=I.forwardRef((e,t)=>{const n=rn(jn,e.__scopeScrollArea),{forceMount:i,...o}=e,[a,l]=I.useState(!1),c=e.orientation==="horizontal",f=Ou(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?d:m)}},10);return ps(n.viewport,f),ps(n.content,f),N.jsx(Mr,{present:i||a,children:N.jsx(dp,{"data-state":a?"visible":"hidden",...o,ref:t})})}),dp=I.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,o=rn(jn,e.__scopeScrollArea),a=I.useRef(null),l=I.useRef(0),[c,f]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=tb(c.viewport,c.content),m={...i,sizes:c,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function h(g,v){return BM(g,l.current,c,v)}return n==="horizontal"?N.jsx(jM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollLeft,v=Dv(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=h(g,o.dir))}}):n==="vertical"?N.jsx(DM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollTop,v=Dv(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=h(g))}}):null}),jM=I.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(jn,e.__scopeScrollArea),[l,c]=I.useState(),f=I.useRef(null),d=Ut(t,f,a.onScrollbarXChange);return I.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),N.jsx(J1,{"data-orientation":"horizontal",...o,ref:d,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,h)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),rb(g,h)&&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)}})}})}),DM=I.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(jn,e.__scopeScrollArea),[l,c]=I.useState(),f=I.useRef(null),d=Ut(t,f,a.onScrollbarYChange);return I.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),N.jsx(J1,{"data-orientation":"vertical",...o,ref:d,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,h)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),rb(g,h)&&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)}})}})}),[$M,Q1]=q1(jn),J1=I.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:o,onThumbChange:a,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:m,onResize:h,...g}=e,v=rn(jn,n),[x,w]=I.useState(null),b=Ut(t,O=>w(O)),E=I.useRef(null),_=I.useRef(""),S=v.viewport,C=i.content-i.viewport,A=Zt(m),M=Zt(f),D=Ou(h,10);function T(O){if(E.current){const z=O.clientX-E.current.left,R=O.clientY-E.current.top;d({x:z,y:R})}}return I.useEffect(()=>{const O=z=>{const R=z.target;(x==null?void 0:x.contains(R))&&A(z,C)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[S,x,C,A]),I.useEffect(M,[i,M]),ps(x,D),ps(v.content,D),N.jsx($M,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Zt(a),onThumbPointerUp:Zt(l),onThumbPositionChange:M,onThumbPointerDown:Zt(c),children:N.jsx(Rt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:St(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),E.current=x.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),T(O))}),onPointerMove:St(e.onPointerMove,T),onPointerUp:St(e.onPointerUp,O=>{const z=O.target;z.hasPointerCapture(O.pointerId)&&z.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),E.current=null})})})}),lu="ScrollAreaThumb",Z1=I.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=Q1(lu,e.__scopeScrollArea);return N.jsx(Mr,{present:n||o.hasThumb,children:N.jsx(zM,{ref:t,...i})})}),zM=I.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...o}=e,a=rn(lu,n),l=Q1(lu,n),{onThumbPositionChange:c}=l,f=Ut(t,h=>l.onThumbChange(h)),d=I.useRef(void 0),m=Ou(()=>{d.current&&(d.current(),d.current=void 0)},100);return I.useEffect(()=>{const h=a.viewport;if(h){const g=()=>{if(m(),!d.current){const v=VM(h,c);d.current=v,c()}};return c(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[a.viewport,m,c]),N.jsx(Rt.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:St(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),x=h.clientX-v.left,w=h.clientY-v.top;l.onThumbPointerDown({x,y:w})}),onPointerUp:St(e.onPointerUp,l.onThumbPointerUp)})});Z1.displayName=lu;var hp="ScrollAreaCorner",eb=I.forwardRef((e,t)=>{const n=rn(hp,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?N.jsx(FM,{...e,ref:t}):null});eb.displayName=hp;var FM=I.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,o=rn(hp,n),[a,l]=I.useState(0),[c,f]=I.useState(0),d=!!(a&&c);return ps(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),ps(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),l(m)}),d?N.jsx(Rt.div,{...i,ref:t,style:{width:a,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function uu(e){return e?parseInt(e,10):0}function tb(e,t){const n=e/t;return isNaN(n)?0:n}function Tu(e){const t=tb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function BM(e,t,n,i="ltr"){const o=Tu(n),a=o/2,l=t||a,c=o-l,f=n.scrollbar.paddingStart+l,d=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,h=i==="ltr"?[0,m]:[m*-1,0];return nb([f,d],h)(e)}function Dv(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],d=IM(e,f);return nb([0,l],[0,c])(d)}function nb(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 rb(e,t){return e>0&&e<t}var VM=(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=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(i.current),[]),I.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 ib=Y1,WM=G1,UM=eb;const sb=I.forwardRef(({className:e,children:t,...n},i)=>N.jsxs(ib,{ref:i,className:je("relative overflow-hidden",e),...n,children:[N.jsx(WM,{className:"h-full w-full rounded-[inherit]",children:t}),N.jsx(ob,{}),N.jsx(UM,{})]}));sb.displayName=ib.displayName;const ob=I.forwardRef(({className:e,orientation:t="vertical",...n},i)=>N.jsx(fp,{ref:i,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:N.jsx(Z1,{className:"relative flex-1 rounded-full bg-border"})}));ob.displayName=fp.displayName;const $v=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zv=Vx,HM=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return zv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(d=>{const m=n==null?void 0:n[d],h=a==null?void 0:a[d];if(m===null)return null;const g=$v(m)||$v(h);return o[d][g]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,g]=m;return g===void 0||(d[h]=g),d},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:h,className:g,...v}=m;return Object.entries(v).every(x=>{let[w,b]=x;return Array.isArray(b)?b.includes({...a,...c}[w]):{...a,...c}[w]===b})?[...d,h,g]:d},[]);return zv(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},qM=HM("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 YM({className:e,variant:t,...n}){return N.jsx("div",{className:je(qM({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 Fv={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 KM({node:e,onClose:t,agentDefaults:n,agents:i,status:o,output:a,error:l,activity:c,usage:f}){const d=(e==null?void 0:e.type)==="agent.run",m=(e==null?void 0:e.config)??{},h=m.agent?i==null?void 0:i[m.agent]:void 0,g=o==="running"||((c==null?void 0:c.length)??0)>0,v=m.model??(h==null?void 0:h.model)??(n==null?void 0:n.model)??"claude-opus-4-8",x=!m.model,w=m.model?void 0:h!=null&&h.model?`from agent ${m.agent}`:"project default",b=m.effort??(h==null?void 0:h.effort)??(n==null?void 0:n.effort)??"high",E=!m.effort,_=m.effort?void 0:h!=null&&h.effort?`from agent ${m.agent}`:n!=null&&n.effort?"project default":"model default";return N.jsx(_M,{open:!!e,onOpenChange:S=>!S&&t(),children:N.jsxs(W1,{side:"right",wide:g,children:[N.jsx(U1,{children:N.jsxs(H1,{className:"flex items-center gap-2",children:[d&&N.jsx(YM,{variant:"agent",children:"agent"}),N.jsx("span",{className:d?"text-agent":void 0,children:e==null?void 0:e.id})]})}),N.jsx(sb,{className:"flex-1 p-4",children:e&&N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),N.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),N.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),d&&N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),m.agent&&N.jsxs("div",{"data-testid":"agent-ref",className:"mt-1 mb-2 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:[m.agent,!h&&N.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),N.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[N.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),N.jsx("div",{className:"font-mono text-[12px] truncate",children:v}),x&&w&&N.jsx("div",{className:"text-[10px] text-mutedfg",children:w})]}),N.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),N.jsx("div",{className:"font-mono text-[12px]",children:b}),E&&_&&N.jsx("div",{className:"text-[10px] text-mutedfg",children:_})]})]}),(h==null?void 0:h.profile)&&N.jsxs("div",{className:"mt-2","data-testid":"agent-profile",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"profile"}),N.jsx("div",{className:"mt-1 px-2.5 py-1.5 border border-border rounded-md font-mono text-[12px]",children:h.profile})]}),(h==null?void 0:h.commands)&&h.commands.length>0&&N.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),N.jsx("div",{className:"mt-1 space-y-1",children:h.commands.map(S=>N.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[N.jsx("span",{className:"font-mono text-[12px]",children:S.name}),S.name===h.fallback&&N.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),S.description&&N.jsx("div",{className:"text-[11px] text-mutedfg",children:S.description})]},S.name))})]}),(h==null?void 0:h.mcpServers)&&h.mcpServers.length>0&&N.jsxs("div",{className:"mt-2","data-testid":"agent-mcp",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"mcp servers"}),N.jsx("div",{className:"mt-1 space-y-1",children:h.mcpServers.map(S=>N.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[N.jsx("span",{className:"font-mono text-[12px]",children:S.name}),(S.url??S.command)&&N.jsx("span",{className:"text-[11px] text-mutedfg ml-2 break-all",children:S.url??S.command})]},S.name))})]}),(h==null?void 0:h.instructions)&&N.jsxs("div",{className:"mt-2","data-testid":"agent-instructions",children:[N.jsx("div",{className:"text-mutedfg text-[11px]",children:"instructions"}),N.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 leading-relaxed whitespace-pre-wrap break-words max-h-96 overflow-y-auto",children:h.instructions})]})]}),f&&f.totalTokens>0&&N.jsxs("div",{"data-testid":"node-usage",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Token usage"}),N.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-x-4 gap-y-1 text-[12px]",children:[N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"total"}),N.jsx("span",{className:"font-mono font-medium",children:Or(f.totalTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cost"}),N.jsx("span",{className:"font-mono font-medium",children:_h(f.costUsd)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"input"}),N.jsx("span",{className:"font-mono",children:Or(f.inputTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"output"}),N.jsx("span",{className:"font-mono",children:Or(f.outputTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cache read"}),N.jsx("span",{className:"font-mono",children:Or(f.cacheReadTokens)})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-mutedfg",children:"cache write"}),N.jsx("span",{className:"font-mono",children:Or(f.cacheCreationTokens)})]})]})]}),c&&c.length>0&&N.jsxs("div",{"data-testid":"node-activity-log",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent activity"}),N.jsx("div",{className:"mt-1 space-y-1.5",children:c.map((S,C)=>{if(S.kind==="tool_use"){const M=S.input!==void 0?JSON.stringify(S.input):"";return N.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded-md px-2.5 py-1.5 break-all",children:[N.jsxs("span",{className:"text-agent",children:["🔧 ",S.tool]}),M&&N.jsxs("span",{className:"text-mutedfg",children:[" ",M.length>200?M.slice(0,200)+"…":M]})]},C)}if(S.kind==="tool_result")return N.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2.5 break-all",children:["↳ ",S.text]},C);const A=S.kind==="thinking";return N.jsx("div",{className:`text-[12px] px-2.5 py-1 whitespace-pre-wrap break-words ${A?"text-mutedfg italic":"text-fg"}`,children:S.text},C)})})]}),(o||a!==void 0||l)&&N.jsxs("div",{"data-testid":"node-last-run",children:[N.jsxs("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg flex items-center gap-2",children:["Last run",o&&N.jsx("span",{className:`text-[11px] font-medium ${Fv[o].cls}`,children:Fv[o].label})]}),l&&N.jsx("pre",{"data-testid":"node-output-error",className:"mt-1 text-[11px] font-mono text-fail bg-fail/5 rounded-md p-2.5 whitespace-pre-wrap break-words",children:l}),a!==void 0?N.jsx("pre",{"data-testid":"node-output",className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all max-h-80 overflow-y-auto",children:a}):!l&&N.jsx("div",{className:"mt-1 text-[11px] text-mutedfg px-1",children:"No output captured yet — run the workflow to see what this node fetches."})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),N.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all",children:JSON.stringify(e.config,null,2)})]}),e.retry&&N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),N.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[N.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",N.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),N.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[N.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",N.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}const GM={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"}},XM=/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 JM(e,t,n){if(!(!n||!t))return e==="page"?`https://${n}/wiki/pages/viewpage.action?pageId=${encodeURIComponent(t)}`:`https://${n}/browse/${encodeURIComponent(t)}`}function ZM(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 d=0;d<f.length;d++){const m=f[d];if(m.kind!=="tool_use"||!m.tool)continue;const h=GM[m.tool];if(!h)continue;const g=QM(m.input,h.field),x=(l=(((a=f[d+1])==null?void 0:a.kind)==="tool_result"?f[d+1].text??"":"").match(XM))==null?void 0:l[0];n.push({kind:h.kind,action:h.action,target:g,url:x??JM(h.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 Bv(e){if(!e.finishedAt)return;const t=e.finishedAt-e.startedAt;return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}const eR={issue:"🪪",page:"📄",comment:"💬"};function tR({a:e}){if(e.kind==="tool_use"){const n=e.input!==void 0?Ch(JSON.stringify(e.input),160):"";return N.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded px-2 py-1 break-all",children:[N.jsxs("span",{className:"text-agent",children:["🔧 ",e.tool]}),n&&N.jsxs("span",{className:"text-mutedfg",children:[" ",n]})]})}if(e.kind==="tool_result")return N.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2 break-all",children:["↳ ",Ch(e.text??"")]});const t=e.kind==="thinking";return N.jsx("div",{className:je("text-[12px] px-2 py-0.5 whitespace-pre-wrap break-words",t?"text-mutedfg italic":"text-fg"),children:e.text})}function nR({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]=I.useState(null),d=c&&l.some(x=>x.id===c)?c:((v=l[0])==null?void 0:v.id)??null,m=l.find(x=>x.id===d)??null,h=d?i[d]:void 0,g=I.useMemo(()=>ZM(h,o),[h,o]);return N.jsxs("aside",{className:"w-[48rem] max-w-[60vw] shrink-0 bg-bg border-l border-border flex flex-col",children:[N.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[N.jsxs("span",{className:"font-semibold tracking-tight truncate",title:t??e,children:["Runs · ",t??e??"all"]}),N.jsx("button",{onClick:a,className:"ml-auto text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),N.jsxs("div",{className:"flex-1 flex min-h-0",children:[N.jsxs("div",{className:"w-56 shrink-0 border-r border-border overflow-y-auto p-2 space-y-1",children:[l.length===0&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-2",children:"no runs yet"}),l.slice(0,60).map(x=>N.jsxs("button",{"data-testid":"scoped-run-row",onClick:()=>f(x.id),className:je("w-full text-left rounded-md px-2.5 py-1.5 flex items-center gap-2 border transition-colors",x.id===d?"bg-muted border-border":"bg-muted/30 border-transparent hover:bg-muted/60"),children:[N.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",th(x.status))}),N.jsx("span",{className:"font-mono text-[11px] text-fg truncate",children:x.label??x.workflow}),x.usage&&x.usage.totalTokens>0&&N.jsx("span",{className:"font-mono text-[10px] text-agent ml-auto shrink-0",children:Or(x.usage.totalTokens)})]},x.id))]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-w-0","data-testid":"run-detail",children:[!m&&N.jsx("div",{className:"text-[12px] text-mutedfg",children:"select a run to see its breakdown"}),m&&N.jsxs(N.Fragment,{children:[N.jsxs("div",{children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:je("size-2 rounded-full",th(m.status))}),N.jsx("span",{className:"font-mono text-[13px] font-medium",children:m.label??m.workflow}),N.jsx("span",{className:"text-[11px] text-mutedfg",children:m.workflow})]}),N.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-mutedfg font-mono",children:[N.jsx("span",{children:m.status}),Bv(m)&&N.jsxs("span",{children:["· ",Bv(m)]}),m.usage&&m.usage.totalTokens>0&&N.jsxs("span",{children:["· ",Or(m.usage.totalTokens)," tok · ",_h(m.usage.costUsd)]})]}),m.error&&N.jsx("div",{className:"mt-1 text-[11px] text-fail font-mono break-all",children:m.error})]}),g.length>0&&N.jsxs("div",{"data-testid":"run-artifacts",children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Touched"}),N.jsx("div",{className:"mt-1 space-y-1",children:g.map((x,w)=>N.jsxs("div",{className:"text-[12px] flex items-center gap-1.5",children:[N.jsx("span",{children:eR[x.kind]??"•"}),N.jsx("span",{className:"text-mutedfg",children:x.action}),x.url?N.jsx("a",{href:x.url,target:"_blank",rel:"noreferrer",className:"font-mono text-agent hover:underline truncate",children:x.target??x.url}):N.jsx("span",{className:"font-mono text-fg truncate",children:x.target??"—"})]},w))})]}),N.jsxs("div",{children:[N.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent history"}),(!h||h.order.length===0)&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1 py-1",children:"no detail retained"}),N.jsx("div",{className:"mt-1 space-y-2",children:h==null?void 0:h.order.map(x=>{const w=h.nodes[x];return w?N.jsxs("div",{className:"border border-border rounded-md",children:[N.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-muted/40 rounded-t-md",children:[N.jsx("span",{className:je("size-1.5 rounded-full",th(w.status))}),N.jsx("span",{className:"font-mono text-[12px] text-fg",children:x}),w.usage&&w.usage.totalTokens>0&&N.jsxs("span",{className:"font-mono text-[10px] text-agent ml-auto",children:[Or(w.usage.totalTokens)," tok · ",_h(w.usage.costUsd)]})]}),(w.activity.length>0||w.output||w.error)&&N.jsxs("div",{className:"px-2 py-1.5 space-y-1",children:[w.activity.map((b,E)=>N.jsx(tR,{a:b},E)),w.error&&N.jsxs("div",{className:"text-[11px] text-fail font-mono break-all",children:["error: ",w.error]}),w.activity.length===0&&w.output&&N.jsx("div",{className:"text-[11px] font-mono text-mutedfg break-all",children:Ch(w.output,400)})]})]},x):null})})]})]})]})]})]})}function rR(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 iR({cache:e,onReload:t,onForget:n,onClose:i}){return N.jsxs("aside",{className:"w-96 shrink-0 bg-bg border-l border-border flex flex-col",children:[N.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[N.jsx("span",{className:"font-semibold tracking-tight",children:"Cache"}),N.jsxs("span",{className:"text-[11px] text-mutedfg",children:[e.seen.length," seen"]}),N.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[N.jsx("button",{onClick:t,className:"text-[11px] text-mutedfg hover:text-fg",title:"Refresh",children:"↻"}),N.jsx("button",{onClick:i,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[N.jsx("p",{className:"text-[11px] text-mutedfg leading-snug",children:"Items the engine has already actioned (per-workflow seen-state). Clearing one makes the workflow reprocess it on the next run."}),N.jsxs("div",{children:[N.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Seen (",e.seen.length,")"]}),e.seen.length===0&&N.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"empty"}),N.jsx("div",{className:"space-y-1",children:e.seen.map(o=>{const a=o.key.indexOf(" "),l=a>0?o.key.slice(0,a):"",c=a>0?o.key.slice(a+1):o.key;return N.jsxs("div",{"data-testid":"cache-seen-row",className:"group bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[N.jsxs("div",{className:"flex-1 min-w-0",children:[N.jsxs("div",{className:"flex items-center gap-1.5",children:[l&&N.jsx("span",{className:"text-[9px] uppercase tracking-wide text-mutedfg bg-muted rounded px-1 py-0.5",children:l}),o.label&&N.jsx("span",{className:"font-mono text-[11px] text-fg",children:o.label}),N.jsx("span",{className:"font-mono text-[11px] text-mutedfg break-all",children:c})]}),o.ts&&N.jsxs("div",{className:"text-[10px] text-mutedfg",children:["seen ",rR(o.ts)]})]}),N.jsx("button",{"data-testid":"cache-forget",onClick:()=>n(o.key),title:`Forget "${o.key}" (reprocess it)`,className:"text-[11px] text-mutedfg hover:text-fail px-1 opacity-0 group-hover:opacity-100",children:"clear"})]},o.key)})})]}),e.cursors.length>0&&N.jsxs("div",{children:[N.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Cursors (",e.cursors.length,")"]}),N.jsx("div",{className:"space-y-1",children:e.cursors.map(o=>N.jsxs("div",{className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[N.jsxs("span",{className:"font-mono text-[11px] text-fg break-all flex-1",children:[o.key," = ",o.value]}),N.jsx("button",{onClick:()=>n(o.key),className:"text-[11px] text-mutedfg hover:text-fail px-1",children:"clear"})]},o.key))})]})]})]})}const pp=Symbol.for("yaml.alias"),Th=Symbol.for("yaml.document"),Pr=Symbol.for("yaml.map"),ab=Symbol.for("yaml.pair"),Rn=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]===ab,ze=e=>!!e&&typeof e=="object"&&e[nn]===Rn,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 Rn:case vs:return!0}return!1}const lb=e=>(ze(e)||Je(e))&&!!e.anchor,ti=Symbol("break visit"),sR=Symbol("skip children"),Co=Symbol("remove node");function xs(e,t){const n=oR(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=sR;xs.REMOVE=Co;function Qi(e,t,n,i){const o=aR(e,t,n,i);if(Ze(o)||et(o))return lR(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 oR(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 aR(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 lR(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 uR={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cR=e=>e.replace(/[!,[\]{}]/g,t=>uR[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+cR(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 ub(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 cb(e){const t=new Set;return xs(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function fb(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function fR(e,t){const n=[],i=new Map;let o=null;return{onAnchor:a=>{n.push(a),o??(o=cb(e));const l=fb(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||!lb(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:d}of l.anchors.values())o(d,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)||lb(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(ub(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 db=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends mp{constructor(t){super(Rn),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 dR="tag:yaml.org,2002:";function hR(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 h,g,v;if(Iu(e)&&(e=e.contents),Ze(e))return e;if(et(e)){const x=(g=(h=n.schema[Pr]).createNode)==null?void 0:g.call(h,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=dR+t.slice(2));let d=hR(e,t,l.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new Te(e);return f&&(f.node=x),x}d=e instanceof Map?l[Pr]:Symbol.iterator in Object(e)?l[vs]:l[Pr]}a&&(a(d),delete n.onTagObj);const m=d!=null&&d.createNode?d.createNode(n.schema,e,n):typeof((v=d==null?void 0:d.nodeClass)==null?void 0:v.from)=="function"?d.nodeClass.from(n.schema,e,n):new Te(e);return t?m.tag=t:d.default||(m.tag=d.tag),f&&(f.node=m),m}function 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 hb 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 pR=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Qn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ri=(e,t,n)=>e.endsWith(`
|
|
129
|
+
`)?Qn(n,t):n.includes(`
|
|
130
|
+
`)?`
|
|
131
|
+
`+Qn(n,t):(e.endsWith(" ")?"":" ")+n,pb="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 d=[],m={};let h=o-t.length;typeof i=="number"&&(i>o-Math.max(2,a)?d.push(0):h=o-i);let g,v,x=!1,w=-1,b=-1,E=-1;n===Oh&&(w=Vv(e,w,t.length),w!==-1&&(h=w+f));for(let S;S=e[w+=1];){if(n===Yl&&S==="\\"){switch(b=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}E=w}if(S===`
|
|
132
|
+
`)n===Oh&&(w=Vv(e,w,t.length)),h=w+t.length+f,g=void 0;else{if(S===" "&&v&&v!==" "&&v!==`
|
|
133
|
+
`&&v!==" "){const C=e[w+1];C&&C!==" "&&C!==`
|
|
134
|
+
`&&C!==" "&&(g=w)}if(w>=h)if(g)d.push(g),h=g+f,g=void 0;else if(n===Yl){for(;v===" "||v===" ";)v=S,S=e[w+=1],x=!0;const C=w>E+1?w-2:b-1;if(m[C])return e;d.push(C),m[C]=!0,h=C+f,g=void 0}else x=!0}v=S}if(x&&c&&c(),d.length===0)return e;l&&l();let _=e.slice(0,d[0]);for(let S=0;S<d.length;++S){const C=d[S],A=d[S+1]||e.length;C===0?_=`
|
|
135
|
+
${t}${e.slice(0,A)}`:(n===Yl&&m[C]&&(_+=`${e[C]}\\`),_+=`
|
|
136
|
+
${t}${e.slice(C+1,A)}`)}return _}function Vv(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 mR(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,d=n[f];d;d=n[++f])if(d===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,d="\\"),d==="\\")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,pb,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 d=i.indent||(i.forceBlockIndent||Mu(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!mR(n,f,d.length);if(!n)return m?`|
|
|
147
|
+
`:`>
|
|
148
|
+
`;let h,g;for(g=n.length;g>0;--g){const A=n[g-1];if(A!==`
|
|
149
|
+
`&&A!==" "&&A!==" ")break}let v=n.substring(g);const x=v.indexOf(`
|
|
150
|
+
`);x===-1?h="-":n===v||x!==v.length-1?(h="+",a&&a()):h="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
151
|
+
`&&(v=v.slice(0,-1)),v=v.replace(Ph,`$&${d}`));let w=!1,b,E=-1;for(b=0;b<n.length;++b){const A=n[b];if(A===" ")w=!0;else if(A===`
|
|
152
|
+
`)E=b;else break}let _=n.substring(0,E<b?E+1:b);_&&(n=n.substring(_.length),_=_.replace(/\n+/g,`$&${d}`));let C=(w?d?"2":"1":"")+h;if(e&&(C+=" "+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,`$&${d}`);let M=!1;const D=Au(i,!0);l!=="folded"&&t!==Te.BLOCK_FOLDED&&(D.onOverflow=()=>{M=!0});const T=Pu(`${_}${A}${v}`,d,Oh,D);if(!M)return`>${C}
|
|
154
|
+
${d}${T}`}return n=n.replace(/\n+/g,`$&${d}`),`|${C}
|
|
155
|
+
${d}${_}${n}${v}`}function gR(e,t,n,i){const{type:o,value:a}=e,{actualString:l,implicitKey:c,indent:f,indentStep:d,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===d)return Zi(a,t)}const h=a.replace(/\n+/g,`$&
|
|
159
|
+
${f}`);if(l){const g=w=>{var b;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((b=w.test)==null?void 0:b.test(h))},{compat:v,tags:x}=t.doc.schema;if(x.some(g)||v!=null&&v.some(g))return Zi(a,t)}return c?h:Pu(h,f,pb,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 gR(l,t,n,i);default:return null}};let d=f(c);if(d===null){const{defaultKeyType:m,defaultStringType:h}=t.options,g=o&&m||h;if(d=f(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function mb(e,t){const n=Object.assign({blockQuote:!0,commentString:pR,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 yR(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 vR(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const o=[],a=(ze(e)||Je(e))&&e.anchor;a&&ub(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:d=>o=d});o??(o=yR(t.doc.schema.tags,a));const l=vR(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 wR({key:e,value:t},n,i,o){const{allNullValues:a,doc:l,indent:c,indentStep:f,options:{commentString:d,indentSeq:m,simpleKeys:h}}=n;let g=Ze(e)&&e.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Je(e)||!Ze(e)&&typeof e=="object"){const D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let v=!h&&(!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&&(h||!a),indent:c+f});let x=!1,w=!1,b=ms(e,n,()=>x=!0,()=>w=!0);if(!v&&!n.inFlow&&b.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return x&&i&&i(),b===""?"?":v?`? ${b}`:b}else if(a&&!h||t==null&&v)return b=`? ${b}`,g&&!x?b+=ri(b,n.indent,d(g)):w&&o&&o(),b;x&&(g=null),v?(g&&(b+=ri(b,n.indent,d(g))),b=`? ${b}
|
|
161
|
+
${c}:`):(b=`${b}:`,g&&(b+=ri(b,n.indent,d(g))));let E,_,S;Ze(t)?(E=!!t.spaceBefore,_=t.commentBefore,S=t.comment):(E=!1,_=null,S=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&ze(t)&&(n.indentAtStart=b.length+1),w=!1,!m&&f.length>=2&&!n.inFlow&&!v&&Yo(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const A=ms(t,n,()=>C=!0,()=>w=!0);let M=" ";if(g||E||_){if(M=E?`
|
|
162
|
+
`:"",_){const D=d(_);M+=`
|
|
163
|
+
${Qn(D,n.indent)}`}A===""&&!n.inFlow?M===`
|
|
164
|
+
`&&S&&(M=`
|
|
165
|
+
|
|
166
|
+
`):M+=`
|
|
167
|
+
${n.indent}`}else if(!v&&Je(t)){const D=A[0],T=A.indexOf(`
|
|
168
|
+
`),O=T!==-1,z=n.inFlow??t.flow??t.items.length===0;if(O||!z){let R=!1;if(O&&(D==="&"||D==="!")){let L=A.indexOf(" ");D==="&"&&L!==-1&&L<T&&A[L+1]==="!"&&(L=A.indexOf(" ",L+1)),(L===-1||T<L)&&(R=!0)}R||(M=`
|
|
169
|
+
${n.indent}`)}}else(A===""||A[0]===`
|
|
170
|
+
`)&&(M="");return b+=M+A,n.inFlow?C&&i&&i():S&&!C?b+=ri(b,n.indent,d(S)):w&&o&&o(),b}function gb(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Rl="<<",Zn={identify:e=>e===Rl||typeof e=="symbol"&&e.description===Rl,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(Rl)),{addToJSMap:yb}),stringify:()=>Rl},xR=(e,t)=>(Zn.identify(t)||ze(t)&&(!t.type||t.type===Te.PLAIN)&&Zn.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zn.tag&&n.default));function yb(e,t,n){const i=vb(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=vb(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 vb(e,t){return e&&ws(t)?t.resolve(e.doc,e):t}function wb(e,t,{key:n,value:i}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(xR(e,n))yb(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=bR(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 bR(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const i=mb(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)+'..."'),gb(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:ab}),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 wb(n,i,this)}toString(t,n,i){return t!=null&&t.doc?wR(this,t,n,i):JSON.stringify(this)}}function xb(e,t,n){return(t.inFlow??e.flow?SR:kR)(e,t,n)}function kR({comment:e,items:t},n,{blockItemPrefix:i,flowChars:o,itemIndent:a,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:d}}=n,m=Object.assign({},n,{indent:a,type:null});let h=!1;const g=[];for(let x=0;x<t.length;++x){const w=t[x];let b=null;if(Ze(w))!h&&w.spaceBefore&&g.push(""),fu(n,g,w.commentBefore,h),w.comment&&(b=w.comment);else if(et(w)){const _=Ze(w.key)?w.key:null;_&&(!h&&_.spaceBefore&&g.push(""),fu(n,g,_.commentBefore,h))}h=!1;let E=ms(w,m,()=>b=null,()=>h=!0);b&&(E+=ri(E,a,d(b))),h&&b&&(h=!1),g.push(i+E)}let v;if(g.length===0)v=o.start+o.end;else{v=g[0];for(let x=1;x<g.length;++x){const w=g[x];v+=w?`
|
|
171
|
+
${f}${w}`:`
|
|
172
|
+
`}}return e?(v+=`
|
|
173
|
+
`+Qn(d(e),f),c&&c()):h&&l&&l(),v}function SR({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 d=!1,m=0;const h=[];for(let x=0;x<e.length;++x){const w=e[x];let b=null;if(Ze(w))w.spaceBefore&&h.push(""),fu(t,h,w.commentBefore,!1),w.comment&&(b=w.comment);else if(et(w)){const _=Ze(w.key)?w.key:null;_&&(_.spaceBefore&&h.push(""),fu(t,h,_.commentBefore,!1),_.comment&&(d=!0));const S=Ze(w.value)?w.value:null;S?(S.comment&&(b=S.comment),S.commentBefore&&(d=!0)):w.value==null&&(_!=null&&_.comment)&&(b=_.comment)}b&&(d=!0);let E=ms(w,f,()=>b=null);d||(d=h.length>m||E.includes(`
|
|
174
|
+
`)),x<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(d||(d=h.reduce((_,S)=>_+S.length+2,2)+(E.length+2)>t.options.lineWidth)),d&&(E+=",")),b&&(E+=ri(E,i,c(b))),h.push(E),m=h.length}const{start:g,end:v}=n;if(h.length===0)return g+v;if(!d){const x=h.reduce((w,b)=>w+b.length+2,2);d=t.options.lineWidth>0&&x>t.options.lineWidth}if(d){let x=g;for(const w of h)x+=w?`
|
|
175
|
+
${a}${o}${w}`:`
|
|
176
|
+
`;return`${x}
|
|
177
|
+
${o}${v}`}else return`${g}${l}${h.join(" ")}${l}${v}`}function fu({indent:e,options:{commentString:t}},n,i,o){if(i&&o&&(i=i.replace(/^\n+/,"")),i){const a=Qn(t(i),e);n.push(a.trimStart())}}function ii(e,t){const n=ze(t)?t.value:t;for(const i of e)if(et(i)&&(i.key===t||i.key===n||ze(i.key)&&i.key.value===n))return i}class en extends hb{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,d)=>{if(typeof a=="function")d=a.call(n,f,d);else if(Array.isArray(a)&&!a.includes(f))return;(d!==void 0||o)&&l.items.push(vp(f,d,i))};if(n instanceof Map)for(const[f,d]of n)c(f,d);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&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)&&db(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)wb(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})),xb(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 hb{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)&&db(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?xb(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 bb={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},kb={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)}},Sb={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 Eb(e,t,n){const{value:i}=e;return ju(i)&&i>=0?n+i.toString(t):xn(e)}const Nb={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=>Eb(e,8,"0o")},_b={identify:ju,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>xp(e,0,10,n),stringify:xn},Cb={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=>Eb(e,16,"0x")},ER=[bs,ks,Ru,Lu,wp,Nb,_b,Cb,bb,kb,Sb];function Wv(e){return typeof e=="bigint"||Number.isInteger(e)}const jl=({value:e})=>JSON.stringify(e),NR=[{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:Wv,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})=>Wv(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}],_R={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},CR=[bs,ks].concat(NR,_R),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 d=0;d<l.length;++d)f+=String.fromCharCode(l[d]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Te.BLOCK_LITERAL),t!==Te.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),d=Math.ceil(c.length/f),m=new Array(d);for(let h=0,g=0;h<d;++h,g+=f)m[h]=c.substr(g,f);c=m.join(t===Te.BLOCK_LITERAL?`
|
|
178
|
+
`:" ")}return yp({comment:e,type:t,value:c},i,o,a)}};function Tb(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 Ob(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 d=Object.keys(l);if(d.length===1)c=d[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${d.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:Tb,createNode:Ob};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=Ob(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=Tb(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 Ib({value:e,source:t},n){return t&&(e?Pb:Ab).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Pb={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:Ib},Ab={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:Ib},TR={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},OR={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)}},IR={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 PR={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")},AR={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")},MR={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},RR={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 Mb(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 Rb={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:Mb},Lb={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:Mb},$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 d=Date.UTC(n,i-1,o,a||0,l||0,c||0,f);const m=t[8];if(m&&m!=="Z"){let h=_p(m,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Uv=[bs,ks,Ru,Lu,Pb,Ab,PR,AR,MR,RR,TR,OR,IR,bp,Zn,Sp,kp,Np,Rb,Lb,$u],Hv=new Map([["core",ER],["failsafe",[bs,ks,Ru]],["json",CR],["yaml11",Uv],["yaml-1.1",Uv]]),qv={binary:bp,bool:wp,float:Sb,floatExp:kb,floatNaN:bb,floatTime:Lb,int:_b,intHex:Cb,intOct:Nb,intTime:Rb,map:bs,merge:Zn,null:Lu,omap:Sp,pairs:kp,seq:ks,set:Np,timestamp:$u},LR={"tag:yaml.org,2002:binary":bp,"tag:yaml.org,2002:merge":Zn,"tag:yaml.org,2002:omap":Sp,"tag:yaml.org,2002:pairs":kp,"tag:yaml.org,2002:set":Np,"tag:yaml.org,2002:timestamp":$u};function rh(e,t,n){const i=Hv.get(t);if(i&&!e)return n&&!i.includes(Zn)?i.concat(Zn):i.slice();let o=i;if(!o)if(Array.isArray(e))o=[];else{const a=Array.from(Hv.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)o=o.concat(a);else typeof e=="function"&&(o=e(o.slice()));return n&&(o=o.concat(Zn)),o.reduce((a,l)=>{const c=typeof l=="string"?qv[l]:l;if(!c){const f=JSON.stringify(l),d=Object.keys(qv).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return a.includes(c)||a.push(c),a},[])}const jR=(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?LR:{},this.tags=rh(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,Pr,{value:bs}),Object.defineProperty(this,Rn,{value:Ru}),Object.defineProperty(this,vs,{value:ks}),this.sortMapEntries=typeof l=="function"?l:l===!0?jR:null}clone(){const t=Object.create(Cp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function DR(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const o=mb(e,t),{commentString:a}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Qn(d,""))}let l=!1,c=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const h=a(e.contents.commentBefore);n.push(Qn(h,""))}o.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>l=!0;let m=ms(e.contents,o,()=>c=null,d);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 d=a(e.comment);d.includes(`
|
|
181
|
+
`)?(n.push("..."),n.push(Qn(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Qn(a(d),"")))}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=cb(this);t.anchor=!n||i.has(n)?fb(n||"a",i):n}return new gp(t.anchor)}createNode(t,n,i){let o;if(typeof n=="function")t=n.call({"":t},"",t),o=n;else if(Array.isArray(n)){const b=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,E=n.filter(b).map(String);E.length>0&&(n=n.concat(E)),o=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:d,tag:m}=i??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=fR(this,l||"a"),x={aliasDuplicateObjects:a??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:d,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:d,res:m}of c.anchors.values())a(m,d);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 DR(this,t)}}function Yi(e){if(Je(e))return!0;throw new Error("Expected a YAML collection as document contents")}class jb extends Error{constructor(t,n,i,o){super(),this.name=t,this.code=i,this.message=o,this.pos=n}}class Eo extends jb{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class $R extends jb{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Yv=(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 d=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
185
|
+
|
|
186
|
+
${l}
|
|
187
|
+
${d}
|
|
188
|
+
`}};function gs(e,{flow:t,indicator:n,next:i,offset:o,onError:a,parentIndent:l,startOnNewline:c}){let f=!1,d=c,m=c,h="",g="",v=!1,x=!1,w=null,b=null,E=null,_=null,S=null,C=null,A=null;for(const T of e)switch(x&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&a(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),w&&(d&&T.type!=="comment"&&T.type!=="newline"&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),T.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&T.source.includes(" ")&&(w=T),m=!0;break;case"comment":{m||a(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const O=T.source.substring(1)||" ";h?h+=g+O:h=O,g="",d=!1;break}case"newline":d?h?h+=T.source:(!C||n!=="seq-item-ind")&&(f=!0):g+=T.source,d=!0,v=!0,(b||E)&&(_=T),m=!0;break;case"anchor":b&&a(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&a(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=T,A??(A=T.offset),d=!1,m=!1,x=!0;break;case"tag":{E&&a(T,"MULTIPLE_TAGS","A node can have at most one tag"),E=T,A??(A=T.offset),d=!1,m=!1,x=!0;break}case n:(b||E)&&a(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),C&&a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),C=T,d=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){S&&a(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=T,d=!1,m=!1;break}default:a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),d=!1,m=!1}const M=e[e.length-1],D=M?M.offset+M.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&&(d&&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:S,found:C,spaceBefore:f,comment:h,hasNewline:v,anchor:b,tag:E,newlineAfterProp:_,end:D,start:A??D}}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 Db(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 Kv="All mapping items must start at the same column";function zR({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,d=null;for(const h of i.items){const{start:g,key:v,sep:x,value:w}=h,b=gs(g,{indicator:"explicit-key-ind",next:v??(x==null?void 0:x[0]),offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0}),E=!b.found;if(E){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",Kv)),!b.anchor&&!b.tag&&!x){d=b.end,b.comment&&(c.comment?c.comment+=`
|
|
190
|
+
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||zo(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=b.found)==null?void 0:m.indent)!==i.indent&&o(f,"BAD_INDENT",Kv);n.atKey=!0;const _=b.end,S=v?e(n,v,b,o):t(n,_,g,null,b,o);n.schema.compat&&Ah(i.indent,v,o),n.atKey=!1,Db(n,c.items,S)&&o(_,"DUPLICATE_KEY","Map keys must be unique");const C=gs(x??[],{indicator:"map-value-ind",next:w,offset:S.range[2],onError:o,parentIndent:i.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=C.end,C.found){E&&((w==null?void 0:w.type)==="block-map"&&!C.hasNewline&&o(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<C.found.offset-1024&&o(S.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,C,o):t(n,f,x,null,C,o);n.schema.compat&&Ah(i.indent,w,o),f=A.range[2];const M=new Et(S,A);n.options.keepSourceTokens&&(M.srcToken=h),c.items.push(M)}else{E&&o(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(S.comment?S.comment+=`
|
|
191
|
+
`+C.comment:S.comment=C.comment);const A=new Et(S);n.options.keepSourceTokens&&(A.srcToken=h),c.items.push(A)}}return d&&d<f&&o(d,"IMPOSSIBLE","Map comment with trailing content"),c.range=[i.offset,f,d??f],c}function FR({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,d=null;for(const{start:m,value:h}of i.items){const g=gs(m,{indicator:"seq-item-ind",next:h,offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)(h==null?void 0:h.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{d=g.end,g.comment&&(c.comment=g.comment);continue}const v=h?e(n,h,g,o):t(n,g.end,m,null,g,o);n.schema.compat&&Ah(i.indent,h,o),f=v.range[2],c.items.push(v)}return c.range=[i.offset,f,d??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:d}=c;switch(d){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 ${d} 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 BR({composeNode:e,composeEmptyNode:t},n,i,o,a){var b;const l=i.start.source==="{",c=l?"flow map":"flow sequence",f=(a==null?void 0:a.nodeClass)??(l?en:di),d=new f(n.schema);d.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let h=i.offset+i.start.source.length;for(let E=0;E<i.items.length;++E){const _=i.items[E],{start:S,key:C,sep:A,value:M}=_,D=gs(S,{flow:c,indicator:"explicit-key-ind",next:C??(A==null?void 0:A[0]),offset:h,onError:o,parentIndent:i.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!A&&!M){E===0&&D.comma?o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):E<i.items.length-1&&o(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),D.comment&&(d.comment?d.comment+=`
|
|
192
|
+
`+D.comment:d.comment=D.comment),h=D.end;continue}!l&&n.options.strict&&zo(C)&&o(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)D.comma&&o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(D.comma||o(D.start,"MISSING_CHAR",`Missing , between ${c} items`),D.comment){let T="";e:for(const O of S)switch(O.type){case"comma":case"space":break;case"comment":T=O.source.substring(1);break e;default:break e}if(T){let O=d.items[d.items.length-1];et(O)&&(O=O.value??O.key),O.comment?O.comment+=`
|
|
193
|
+
`+T:O.comment=T,D.comment=D.comment.substring(T.length+1)}}if(!l&&!A&&!D.found){const T=M?e(n,M,D,o):t(n,D.end,A,null,D,o);d.items.push(T),h=T.range[2],sh(M)&&o(T.range,"BLOCK_IN_FLOW",ih)}else{n.atKey=!0;const T=D.end,O=C?e(n,C,D,o):t(n,T,S,null,D,o);sh(C)&&o(O.range,"BLOCK_IN_FLOW",ih),n.atKey=!1;const z=gs(A??[],{flow:c,indicator:"map-value-ind",next:M,offset:O.range[2],onError:o,parentIndent:i.indent,startOnNewline:!1});if(z.found){if(!l&&!D.found&&n.options.strict){if(A)for(const G of A){if(G===z.found)break;if(G.type==="newline"){o(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<z.found.offset-1024&&o(z.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&((b=M.source)==null?void 0:b[0])===":"?o(M,"MISSING_CHAR",`Missing space after : in ${c}`):o(z.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const R=M?e(n,M,z,o):z.found?t(n,z.end,A,null,z,o):null;R?sh(M)&&o(R.range,"BLOCK_IN_FLOW",ih):z.comment&&(O.comment?O.comment+=`
|
|
194
|
+
`+z.comment:O.comment=z.comment);const L=new Et(O,R);if(n.options.keepSourceTokens&&(L.srcToken=_),l){const G=d;Db(n,G.items,O)&&o(T,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(L)}else{const G=new en(n.schema);G.flow=!0,G.items.push(L);const j=(R??O).range;G.range=[O.range[0],j[1],j[2]],d.items.push(G)}h=R?R.range[2]:z.end}}const g=l?"}":"]",[v,...x]=i.end;let w=h;if((v==null?void 0:v.source)===g)w=v.offset+v.source.length;else{const E=c[0].toUpperCase()+c.substring(1),_=m?`${E} must end with a ${g}`:`${E} in block collection must be sufficiently indented and end with a ${g}`;o(h,m?"MISSING_CHAR":"BAD_INDENT",_),v&&v.source.length!==1&&x.unshift(v)}if(x.length>0){const E=Go(x,w,n.options.strict,o);E.comment&&(d.comment?d.comment+=`
|
|
195
|
+
`+E.comment:d.comment=E.comment),d.range=[i.offset,w,E.offset]}else d.range=[i.offset,w,w];return d}function oh(e,t,n,i,o,a){const l=n.type==="block-map"?zR(e,t,n,i,a):n.type==="block-seq"?FR(e,t,n,i,a):BR(e,t,n,i,a),c=l.constructor;return o==="!"||o===c.tagName?(l.tag=c.tagName,l):(o&&(l.tag=o),l)}function VR(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 d=oh(e,t,n,o,l,f),m=((g=f.resolve)==null?void 0:g.call(f,d,v=>o(a,"TAG_RESOLVE_FAILED",v),t.options))??d,h=Ze(m)?m:new Te(m);return h.range=d.range,h.tag=l,f!=null&&f.format&&(h.format=f.format),h}function WR(e,t,n){const i=t.offset,o=UR(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?HR(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const b=l[w][1];if(b===""||b==="\r")c=w;else break}if(c===0){const w=o.chomp==="+"&&l.length>0?`
|
|
196
|
+
`.repeat(Math.max(1,l.length-1)):"";let b=i+o.length;return t.source&&(b+=t.source.length),{value:w,type:a,comment:o.comment,range:[i,b,b]}}let f=t.indent+o.indent,d=t.offset+o.length,m=0;for(let w=0;w<c;++w){const[b,E]=l[w];if(E===""||E==="\r")o.indent===0&&b.length>f&&(f=b.length);else{b.length<f&&n(d+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(f=b.length),m=w,f===0&&!e.atRoot&&n(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=b.length+E.length+1}for(let w=l.length-1;w>=c;--w)l[w][0].length>f&&(c=w+1);let h="",g="",v=!1;for(let w=0;w<m;++w)h+=l[w][0].slice(f)+`
|
|
197
|
+
`;for(let w=m;w<c;++w){let[b,E]=l[w];d+=b.length+E.length+1;const _=E[E.length-1]==="\r";if(_&&(E=E.slice(0,-1)),E&&b.length<f){const C=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;n(d-E.length-(_?2:1),"BAD_INDENT",C),b=""}a===Te.BLOCK_LITERAL?(h+=g+b.slice(f)+E,g=`
|
|
198
|
+
`):b.length>f||E[0]===" "?(g===" "?g=`
|
|
199
|
+
`:!v&&g===`
|
|
200
|
+
`&&(g=`
|
|
201
|
+
|
|
202
|
+
`),h+=g+b.slice(f)+E,g=`
|
|
203
|
+
`,v=!0):E===""?g===`
|
|
204
|
+
`?h+=`
|
|
205
|
+
`:g=`
|
|
206
|
+
`:(h+=g+E,g=" ",v=!1)}switch(o.chomp){case"-":break;case"+":for(let w=c;w<l.length;++w)h+=`
|
|
207
|
+
`+l[w][0].slice(f);h[h.length-1]!==`
|
|
208
|
+
`&&(h+=`
|
|
209
|
+
`);break;default:h+=`
|
|
210
|
+
`}const x=i+o.length+t.source.length;return{value:h,type:a,comment:o.comment,range:[i,x,x]}}function UR({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 d=!1,m="",h=o.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":d=!0;case"newline":h+=v.source.length;break;case"comment":n&&!d&&i(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,m=v.source.substring(1);break;case"error":i(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{const x=`Unexpected token in block scalar header: ${v.type}`;i(v,"UNEXPECTED_TOKEN",x);const w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:a,indent:l,chomp:c,comment:m,length:h}}function HR(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 qR(e,t,n){const{offset:i,type:o,source:a,end:l}=e;let c,f;const d=(g,v,x)=>n(i+g,v,x);switch(o){case"scalar":c=Te.PLAIN,f=YR(a,d);break;case"single-quoted-scalar":c=Te.QUOTE_SINGLE,f=KR(a,d);break;case"double-quoted-scalar":c=Te.QUOTE_DOUBLE,f=GR(a,d);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,h=Go(l,m,t,n);return{value:f,type:c,comment:h.comment,range:[i,m,h.offset]}}function YR(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}`),$b(e)}function KR(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),$b(e.slice(1,-1)).replace(/''/g,"'")}function $b(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 GR(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}=XR(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+=JR(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 XR(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 JR(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 zb(e,t,n,i){const{value:o,type:a,comment:l,range:c}=t.type==="block-scalar"?WR(e,t,i):qR(t,e.options.strict,i),f=n?e.directives.tagName(n.source,h=>i(n,"TAG_RESOLVE_FAILED",h)):null;let d;e.options.stringKeys&&e.atKey?d=e.schema[Rn]:f?d=ZR(e.schema,o,f,n,i):t.type==="scalar"?d=eL(e,o,t,i):d=e.schema[Rn];let m;try{const h=d.resolve(o,g=>i(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=ze(h)?h:new Te(h)}catch(h){const g=h instanceof Error?h.message:String(h);i(n??t,"TAG_RESOLVE_FAILED",g),m=new Te(o)}return m.range=c,m.source=o,a&&(m.type=a),f&&(m.tag=f),d.format&&(m.format=d.format),l&&(m.comment=l),m}function ZR(e,t,n,i,o){var c;if(n==="!")return e[Rn];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[Rn])}function eL({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[Rn];if(n.compat){const c=n.compat.find(f=>{var d;return f.default&&((d=f.test)==null?void 0:d.test(i))})??n[Rn];if(l.tag!==c.tag){const f=t.tagString(l.tag),d=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${d}`;a(o,"TAG_RESOLVE_FAILED",m,!0)}}return l}function tL(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 nL={composeNode:Fb,composeEmptyNode:Tp};function Fb(e,t,n,i){const o=e.atKey,{spaceBefore:a,comment:l,anchor:c,tag:f}=n;let d,m=!0;switch(t.type){case"alias":d=rL(e,t,i),(c||f)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=zb(e,t,f,i),c&&(d.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=VR(nL,e,t,n,i),c&&(d.anchor=c.source.substring(1))}catch(h){const g=h instanceof Error?h.message:String(h);i(t,"RESOURCE_EXHAUSTION",g)}break;default:{const h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",h),m=!1}}return d??(d=Tp(e,t.offset,void 0,null,n,i)),c&&d.anchor===""&&i(c,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!ze(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(d.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?d.comment=l:d.commentBefore=l),e.options.keepSourceTokens&&m&&(d.srcToken=t),d}function Tp(e,t,n,i,{spaceBefore:o,comment:a,anchor:l,tag:c,end:f},d){const m={type:"scalar",offset:tL(t,n,i),indent:-1,source:""},h=zb(e,m,c,d);return l&&(h.anchor=l.source.substring(1),h.anchor===""&&d(l,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),a&&(h.comment=a,h.range[2]=f),h}function rL({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 iL(e,t,{offset:n,start:i,value:o,end:a},l){const c=Object.assign({_directives:t},e),f=new zu(void 0,c),d={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?Fb(d,o,m,l):Tp(d,m.end,i,null,m,l);const h=f.contents.range[2],g=Go(a,h,!1,l);return g.comment&&(f.comment=g.comment),f.range=[n,h,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 Gv(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 sL{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 $R(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}=Gv(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:Gv(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=iL(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 Bb="\uFEFF",Vb="",Wb="",Mh="";function oL(e){switch(e){case Bb:return"byte-order-mark";case Vb:return"doc-mode";case Wb: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 Xv=new Set("0123456789ABCDEFabcdef"),aL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Dl=new Set(",[]{}"),lL=new Set(` ,[]{}
|
|
236
|
+
\r `),ah=e=>!e||lL.has(e);class uL{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]===Bb&&(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 Vb,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 Wb,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(aL.has(n))n=this.buffer[++t];else if(n==="%"&&Xv.has(this.buffer[t+1])&&Xv.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 cL{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 Qv(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 Ub(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 Jv(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,Ub(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 fL{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 uL,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=oL(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"&&Jv(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&&Qv(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":{Qv(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 d=n.sep[f];switch(d.type){case"newline":c.push(f);break;case"space":break;case"comment":d.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(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(Ub(n.key)&&!Cr(n.sep,"newline")){const c=Ki(n.start),f=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:f,sep:d}]})}else 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);Jv(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 dL(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new cL||null,prettyErrors:t}}function hL(e,t={}){const{lineCounter:n,prettyErrors:i}=dL(t),o=new fL(n==null?void 0:n.addNewLine),a=new sL(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(Yv(e,n)),l.warnings.forEach(Yv(e,n))),l}function pL(e,t,n){let i;const o=hL(e,n);if(!o)return null;if(o.warnings.forEach(a=>gb(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 mL=`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 gL(){const[e,t]=I.useState(null),[n,i]=I.useState(null),o=I.useCallback(c=>{try{const f=pL(c);t(f),i(null)}catch(f){i(f instanceof Error?f.message:"Failed to parse YAML")}},[]),a=I.useCallback(c=>{t(c),i(null)},[]),l=I.useCallback(()=>{o(mL)},[o]);return{workflow:e,error:n,loadFromString:o,loadFromObject:a,loadDefault:l}}const yL={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,costUsd:0};function vL(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 wL(e){const[t,n]=I.useState({}),[i,o]=I.useState({}),[a,l]=I.useState({}),[c,f]=I.useState({}),[d,m]=I.useState({}),[h,g]=I.useState({}),[v,x]=I.useState([]),[w,b]=I.useState(!1),[E,_]=I.useState([]),[S,C]=I.useState(0),A=I.useRef(0),M=I.useRef(null),D=I.useRef(null),T=I.useCallback(O=>{if(O.type==="workflows:changed"){C(O.ts||Date.now());return}_(R=>[...R,O]);const z=O.runId??M.current??void 0;if(O.type==="run:start"){const R=O.runId??`run_${(++A.current).toString(16).padStart(4,"0")}`;M.current=R,D.current=null,x(L=>[{id:R,workflow:O.workflow,label:O.label,status:"running",startedAt:O.ts},...L]),g(L=>({...L,[R]:{nodes:{},order:[]}})),n({}),o({}),l({}),f({}),m({})}else if(O.type==="node:start"&&O.nodeId)n(R=>({...R,[O.nodeId]:"running"})),z&&g(R=>{const L=R[z]??{nodes:{},order:[]};return L.nodes[O.nodeId]?R:{...R,[z]:{nodes:{...L.nodes,[O.nodeId]:{nodeId:O.nodeId,status:"running",activity:[]}},order:[...L.order,O.nodeId]}}});else if(O.type==="node:activity"&&O.nodeId){const R=O.meta;R&&(f(L=>({...L,[O.nodeId]:[...L[O.nodeId]??[],R]})),z&&g(L=>{const G=L[z];if(!G)return L;const j=G.nodes[O.nodeId]??{nodeId:O.nodeId,status:"running",activity:[]};return{...L,[z]:{...G,nodes:{...G.nodes,[O.nodeId]:{...j,activity:[...j.activity,R]}}}}}))}else if(O.type==="node:finish"&&O.nodeId){const R=O.status==="failed";n(G=>({...G,[O.nodeId]:R?"failed":"success"}));const L=O.meta;if((L==null?void 0:L.output)!==void 0&&l(G=>({...G,[O.nodeId]:L.output})),L!=null&&L.usage&&(m(G=>({...G,[O.nodeId]:L.usage})),z&&x(G=>G.map(j=>j.id===z?{...j,usage:vL(j.usage??yL,L.usage)}:j))),R){const G=L==null?void 0:L.error;G&&(o(j=>({...j,[O.nodeId]:G})),z&&M.current===z&&!D.current&&(D.current=`${O.nodeId}: ${G}`))}z&&g(G=>{const j=G[z];if(!j)return G;const X=j.nodes[O.nodeId]??{nodeId:O.nodeId,status:"running",activity:[]};return{...G,[z]:{...j,nodes:{...j.nodes,[O.nodeId]:{...X,status:R?"failed":"success",output:(L==null?void 0:L.output)??X.output,error:R?L==null?void 0:L.error:X.error,usage:(L==null?void 0:L.usage)??X.usage}}}}})}else if(O.type==="run:finish"){const R=O.status==="failed"?"failed":"success",L=z,G=D.current??void 0;L&&x(j=>j.map(X=>X.id===L?{...X,status:R,finishedAt:O.ts,error:R==="failed"?G:void 0}:X))}},[]);return I.useEffect(()=>{if(!e)return;let O;try{O=new EventSource(`${e}/api/events`)}catch{return}return O.onopen=()=>b(!0),O.onmessage=z=>{try{const R=JSON.parse(z.data);T(R)}catch{}},O.onerror=()=>{b(!1)},()=>{O.close(),b(!1)}},[e,T]),{nodeStatuses:t,nodeErrors:i,nodeOutputs:a,nodeActivity:c,nodeUsage:d,runDetails:h,runs:v,connected:w,events:E,workflowsChangedAt:S}}function xL(e,t=0){const[n,i]=I.useState([]),[o,a]=I.useState(0);return I.useEffect(()=>{if(!e)return;let c=!1;return fetch(`${e}/api/workflows`).then(f=>f.ok?f.json():[]).then(f=>{!c&&Array.isArray(f)&&i(f)}).catch(()=>{}),()=>{c=!0}},[e,t,o]),{workflows:n,reload:async()=>{if(e){try{await fetch(`${e}/api/reload`,{method:"POST"})}catch{}a(c=>c+1)}}}}function bL(e){const[t,n]=I.useState({});return I.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 kL(e){const[t,n]=I.useState(!1),[i,o]=I.useState(!1);return I.useEffect(()=>{if(!e)return;let l=!1;const c=()=>fetch(`${e}/api/state`).then(d=>d.ok?d.json():null).then(d=>{l||!d||(n(!!d.paused),o(!!d.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 SL(e){const[t,n]=I.useState(null);return I.useEffect(()=>{if(!e)return;let i=!1;const o=()=>fetch(`${e}/api/usage`).then(l=>l.ok?l.json():null).then(l=>{!i&&l&&typeof l=="object"&&n(l)}).catch(()=>{});o();const a=setInterval(o,12e4);return()=>{i=!0,clearInterval(a)}},[e]),t}function EL(e){const[t,n]=I.useState({});return I.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 NL(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 _L(e,t=0){const[n,i]=I.useState({seen:[],cursors:[]}),[o,a]=I.useState(0),l=()=>a(f=>f+1);return I.useEffect(()=>{if(!e)return;let f=!1;return fetch(`${e}/api/cache`).then(d=>d.ok?d.json():{seen:[],cursors:[]}).then(d=>{!f&&d&&typeof d=="object"&&i(d)}).catch(()=>{}),()=>{f=!0}},[e,o,t]),{cache:n,reload:l,forget:async f=>{e&&(await fetch(`${e}/api/cache`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:f})}),l())}}}function CL(e){if(!e)return"";const t=Date.parse(e)-Date.now();if(!Number.isFinite(t)||t<=0)return"";const n=Math.floor(t/36e5),i=Math.floor(t%36e5/6e4);return n>=48?`⤺ ${Math.floor(n/24)}d`:n>=1?`⤺ ${n}h${i>0?` ${i}m`:""}`:`⤺ ${i}m`}function Zv({label:e,win:t}){const n=t==null?void 0:t.utilization,i=typeof n=="number"?Math.max(0,Math.min(100,n)):null,o=i!==null&&i>=80;return N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"text-mutedfg w-12 shrink-0",children:e}),N.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:i!==null&&N.jsx("div",{className:je("h-full rounded-full",o?"bg-fail":"bg-agent"),style:{width:`${i}%`}})}),N.jsx("span",{className:je("font-mono w-9 text-right",o?"text-fail":"text-fg"),children:i!==null?`${Math.round(i)}%`:"n/a"}),N.jsx("span",{className:"font-mono text-mutedfg w-14 text-right",children:CL(t==null?void 0:t.resetsAt)})]})}function TL({usage:e}){const t=(e==null?void 0:e.available)&&(e.fiveHour||e.sevenDay);return N.jsxs("div",{"data-testid":"spend-balance",className:"absolute bottom-4 right-4 z-10 w-64 rounded-lg border border-border bg-bg/95 backdrop-blur px-3 py-2 shadow-lg text-[11px]",children:[N.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[N.jsx("span",{className:"uppercase tracking-wider text-mutedfg text-[10px]",children:"Spend & balance"}),(e==null?void 0:e.subscriptionType)&&N.jsx("span",{className:"font-mono text-[10px] text-mutedfg",children:e.subscriptionType})]}),t?N.jsxs("div",{className:"space-y-1",children:[N.jsx(Zv,{label:"session",win:e.fiveHour}),N.jsx(Zv,{label:"weekly",win:e.sevenDay})]}):N.jsxs("div",{className:"text-mutedfg text-[10px] leading-snug",children:["plan balance n/a",e&&!e.available?" (API-key session)":" — experimental, may be unavailable"]})]})}const In=typeof window<"u"&&window.location.protocol.startsWith("http")?window.location.origin:void 0;function OL(){const{workflow:e,loadDefault:t,loadFromString:n,loadFromObject:i}=gL(),[o,a]=I.useState(null),[l,c]=I.useState(null),[f,d]=I.useState("none"),{nodeStatuses:m,nodeErrors:h,nodeOutputs:g,nodeActivity:v,nodeUsage:x,runDetails:w,runs:b,connected:E,workflowsChangedAt:_}=wL(In),{workflows:S,reload:C}=xL(In,_),[A,M]=I.useState(0),D=I.useCallback(async()=>{await C(),M(Date.now())},[C]),T=bL(In),O=EL(In),{paused:z,controllable:R,toggle:L}=kL(In),G=SL(In),j=b.filter(W=>W.status!=="running").length,{cache:X,reload:Y,forget:Z}=_L(In,j);I.useEffect(()=>{if(S.length===0){t();return}const W=S.find(Q=>Q.name===l)??S[0];W.name!==l&&c(W.name),i(W)},[S,l,t,i]);const q=S.find(W=>W.name===l),H=I.useCallback(W=>c(W),[]),B=I.useCallback((W,Q)=>{In&&NL(In,W,Q),d("runs")},[]),$=I.useCallback(W=>{l&&B(l,W)},[l,B]),U=I.useCallback(W=>a(W),[]),V=W=>d(Q=>Q===W?"none":W);return N.jsxs("div",{className:"h-screen w-screen flex overflow-hidden bg-muted text-fg font-sans text-[13px] antialiased relative",children:[N.jsx(UI,{liveConnected:E,workflows:S,selected:l,onSelect:H,onRun:W=>B(W),version:T.version,onReload:In?D:void 0,reloadedAt:A}),N.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[N.jsx(HI,{workflow:e,selected:q,dryRun:T.dryRun,paused:z,pauseControllable:R,onTogglePause:L,onLoadYaml:n,onRun:$,onToggleRuns:()=>V("runs"),onToggleCache:()=>{Y(),V("cache")},runsOpen:f==="runs",cacheOpen:f==="cache"}),N.jsxs("div",{className:"flex-1 flex min-h-0 relative",children:[N.jsx(Dx,{children:N.jsx(jP,{workflow:e,onNodeClick:U,onLoadYaml:n,nodeStatuses:m})}),N.jsx(TL,{usage:G})]})]}),f==="runs"&&N.jsx(nR,{workflowName:l??void 0,workflowTitle:q==null?void 0:q.title,runs:b,runDetails:w,atlassianSite:T.atlassianSite,onClose:()=>d("none")}),f==="cache"&&N.jsx(iR,{cache:X,onReload:Y,onForget:W=>void Z(W),onClose:()=>d("none")}),N.jsx(KM,{node:o,onClose:()=>a(null),agentDefaults:T.agent,agents:O,status:o?m[o.id]:void 0,output:o?g[o.id]:void 0,error:o?h[o.id]:void 0,activity:o?v[o.id]:void 0,usage:o?x[o.id]:void 0})]})}RS.createRoot(document.getElementById("root")).render(N.jsx(Rh.StrictMode,{children:N.jsx(OL,{})}));
|