@agentic-surfaces/server 0.1.27 → 0.1.29
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-CQwBaAEq.css → index-HQKltIcN.css} +1 -1
- package/dist/editor/assets/index-kTJFLfkQ.js +298 -0
- package/dist/editor/index.html +2 -2
- package/dist/http.d.ts +4 -1
- package/dist/http.js +25 -1
- package/dist/serve.d.ts +3 -0
- package/dist/serve.js +1 -0
- package/dist/streaming-observer.d.ts +7 -5
- package/dist/streaming-observer.js +10 -10
- package/package.json +2 -2
- package/dist/editor/assets/index-CS8llYsy.js +0 -298
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
var yS=Object.defineProperty;var vS=(e,t,n)=>t in e?yS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>vS(e,typeof t!="symbol"?t+"":t,n);function wS(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={},Lf={exports:{}},Pe={};/**
|
|
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 Xg;function xS(){if(Xg)return Pe;Xg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),d=Symbol.iterator;function g(D){return D===null||typeof D!="object"?null:(D=d&&D[d]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,w={};function b(D,U,W){this.props=D,this.context=U,this.refs=w,this.updater=W||v}b.prototype.isReactComponent={},b.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,U,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=b.prototype;function N(D,U,W){this.props=D,this.context=U,this.refs=w,this.updater=W||v}var E=N.prototype=new S;E.constructor=N,k(E,b.prototype),E.isPureReactComponent=!0;var C=Array.isArray,I=Object.prototype.hasOwnProperty,M={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function T(D,U,W){var K,Q={},re=null,oe=null;if(U!=null)for(K in U.ref!==void 0&&(oe=U.ref),U.key!==void 0&&(re=""+U.key),U)I.call(U,K)&&!L.hasOwnProperty(K)&&(Q[K]=U[K]);var ee=arguments.length-2;if(ee===1)Q.children=W;else if(1<ee){for(var se=Array(ee),de=0;de<ee;de++)se[de]=arguments[de+2];Q.children=se}if(D&&D.defaultProps)for(K in ee=D.defaultProps,ee)Q[K]===void 0&&(Q[K]=ee[K]);return{$$typeof:e,type:D,key:re,ref:oe,props:Q,_owner:M.current}}function A(D,U){return{$$typeof:e,type:D.type,key:U,ref:D.ref,props:D.props,_owner:D._owner}}function z(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function R(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(W){return U[W]})}var $=/\/+/g;function Z(D,U){return typeof D=="object"&&D!==null&&D.key!=null?R(""+D.key):U.toString(36)}function j(D,U,W,K,Q){var re=typeof D;(re==="undefined"||re==="boolean")&&(D=null);var oe=!1;if(D===null)oe=!0;else switch(re){case"string":case"number":oe=!0;break;case"object":switch(D.$$typeof){case e:case t:oe=!0}}if(oe)return oe=D,Q=Q(oe),D=K===""?"."+Z(oe,0):K,C(Q)?(W="",D!=null&&(W=D.replace($,"$&/")+"/"),j(Q,U,W,"",function(de){return de})):Q!=null&&(z(Q)&&(Q=A(Q,W+(!Q.key||oe&&oe.key===Q.key?"":(""+Q.key).replace($,"$&/")+"/")+D)),U.push(Q)),1;if(oe=0,K=K===""?".":K+":",C(D))for(var ee=0;ee<D.length;ee++){re=D[ee];var se=K+Z(re,ee);oe+=j(re,U,W,se,Q)}else if(se=g(D),typeof se=="function")for(D=se.call(D),ee=0;!(re=D.next()).done;)re=re.value,se=K+Z(re,ee++),oe+=j(re,U,W,se,Q);else if(re==="object")throw U=String(D),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return oe}function G(D,U,W){if(D==null)return D;var K=[],Q=0;return j(D,K,"","",function(re){return U.call(W,re,Q++)}),K}function Y(D){if(D._status===-1){var U=D._result;U=U(),U.then(function(W){(D._status===0||D._status===-1)&&(D._status=1,D._result=W)},function(W){(D._status===0||D._status===-1)&&(D._status=2,D._result=W)}),D._status===-1&&(D._status=0,D._result=U)}if(D._status===1)return D._result.default;throw D._result}var J={current:null},B={transition:null},H={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:B,ReactCurrentOwner:M};function V(){throw Error("act(...) is not supported in production builds of React.")}return Pe.Children={map:G,forEach:function(D,U,W){G(D,function(){U.apply(this,arguments)},W)},count:function(D){var U=0;return G(D,function(){U++}),U},toArray:function(D){return G(D,function(U){return U})||[]},only:function(D){if(!z(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Pe.Component=b,Pe.Fragment=n,Pe.Profiler=o,Pe.PureComponent=N,Pe.StrictMode=i,Pe.Suspense=f,Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,Pe.act=V,Pe.cloneElement=function(D,U,W){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var K=k({},D.props),Q=D.key,re=D.ref,oe=D._owner;if(U!=null){if(U.ref!==void 0&&(re=U.ref,oe=M.current),U.key!==void 0&&(Q=""+U.key),D.type&&D.type.defaultProps)var ee=D.type.defaultProps;for(se in U)I.call(U,se)&&!L.hasOwnProperty(se)&&(K[se]=U[se]===void 0&&ee!==void 0?ee[se]:U[se])}var se=arguments.length-2;if(se===1)K.children=W;else if(1<se){ee=Array(se);for(var de=0;de<se;de++)ee[de]=arguments[de+2];K.children=ee}return{$$typeof:e,type:D.type,key:Q,ref:re,props:K,_owner:oe}},Pe.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:a,_context:D},D.Consumer=D},Pe.createElement=T,Pe.createFactory=function(D){var U=T.bind(null,D);return U.type=D,U},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(D){return{$$typeof:c,render:D}},Pe.isValidElement=z,Pe.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:Y}},Pe.memo=function(D,U){return{$$typeof:h,type:D,compare:U===void 0?null:U}},Pe.startTransition=function(D){var U=B.transition;B.transition={};try{D()}finally{B.transition=U}},Pe.unstable_act=V,Pe.useCallback=function(D,U){return J.current.useCallback(D,U)},Pe.useContext=function(D){return J.current.useContext(D)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(D){return J.current.useDeferredValue(D)},Pe.useEffect=function(D,U){return J.current.useEffect(D,U)},Pe.useId=function(){return J.current.useId()},Pe.useImperativeHandle=function(D,U,W){return J.current.useImperativeHandle(D,U,W)},Pe.useInsertionEffect=function(D,U){return J.current.useInsertionEffect(D,U)},Pe.useLayoutEffect=function(D,U){return J.current.useLayoutEffect(D,U)},Pe.useMemo=function(D,U){return J.current.useMemo(D,U)},Pe.useReducer=function(D,U,W){return J.current.useReducer(D,U,W)},Pe.useRef=function(D){return J.current.useRef(D)},Pe.useState=function(D){return J.current.useState(D)},Pe.useSyncExternalStore=function(D,U,W){return J.current.useSyncExternalStore(D,U,W)},Pe.useTransition=function(){return J.current.useTransition()},Pe.version="18.3.1",Pe}var Qg;function Fo(){return Qg||(Qg=1,Lf.exports=xS()),Lf.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Jg;function bS(){if(Jg)return ho;Jg=1;var e=Fo(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,h){var m,d={},g=null,v=null;h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(v=f.ref);for(m in f)i.call(f,m)&&!a.hasOwnProperty(m)&&(d[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)d[m]===void 0&&(d[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:v,props:d,_owner:o.current}}return ho.Fragment=n,ho.jsx=l,ho.jsxs=l,ho}var Zg;function kS(){return Zg||(Zg=1,Mf.exports=bS()),Mf.exports}var _=kS(),P=Fo();const Mh=hu(P),Lh=wS({__proto__:null,default:Mh},[P]);var pl={},Rf={exports:{}},At={},Df={exports:{}},jf={};/**
|
|
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 ey;function SS(){return ey||(ey=1,(function(e){function t(B,H){var V=B.length;B.push(H);e:for(;0<V;){var D=V-1>>>1,U=B[D];if(0<o(U,H))B[D]=H,B[V]=U,V=D;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var H=B[0],V=B.pop();if(V!==H){B[0]=V;e:for(var D=0,U=B.length,W=U>>>1;D<W;){var K=2*(D+1)-1,Q=B[K],re=K+1,oe=B[re];if(0>o(Q,V))re<U&&0>o(oe,Q)?(B[D]=oe,B[re]=V,D=re):(B[D]=Q,B[K]=V,D=K);else if(re<U&&0>o(oe,V))B[D]=oe,B[re]=V,D=re;else break e}}return H}function o(B,H){var V=B.sortIndex-H.sortIndex;return V!==0?V:B.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],m=1,d=null,g=3,v=!1,k=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(B){for(var H=n(h);H!==null;){if(H.callback===null)i(h);else if(H.startTime<=B)i(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function C(B){if(w=!1,E(B),!k)if(n(f)!==null)k=!0,Y(I);else{var H=n(h);H!==null&&J(C,H.startTime-B)}}function I(B,H){k=!1,w&&(w=!1,S(T),T=-1),v=!0;var V=g;try{for(E(H),d=n(f);d!==null&&(!(d.expirationTime>H)||B&&!R());){var D=d.callback;if(typeof D=="function"){d.callback=null,g=d.priorityLevel;var U=D(d.expirationTime<=H);H=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(f)&&i(f),E(H)}else i(f);d=n(f)}if(d!==null)var W=!0;else{var K=n(h);K!==null&&J(C,K.startTime-H),W=!1}return W}finally{d=null,g=V,v=!1}}var M=!1,L=null,T=-1,A=5,z=-1;function R(){return!(e.unstable_now()-z<A)}function $(){if(L!==null){var B=e.unstable_now();z=B;var H=!0;try{H=L(!0,B)}finally{H?Z():(M=!1,L=null)}}else M=!1}var Z;if(typeof N=="function")Z=function(){N($)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=$,Z=function(){G.postMessage(null)}}else Z=function(){b($,0)};function Y(B){L=B,M||(M=!0,Z())}function J(B,H){T=b(function(){B(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){k||v||(k=!0,Y(I))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var H=3;break;default:H=g}var V=g;g=H;try{return B()}finally{g=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,H){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var V=g;g=B;try{return H()}finally{g=V}},e.unstable_scheduleCallback=function(B,H,V){var D=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?D+V:D):V=D,B){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=V+U,B={id:m++,callback:H,priorityLevel:B,startTime:V,expirationTime:U,sortIndex:-1},V>D?(B.sortIndex=V,t(h,B),n(f)===null&&B===n(h)&&(w?(S(T),T=-1):w=!0,J(C,V-D))):(B.sortIndex=U,t(f,B),k||v||(k=!0,Y(I))),B},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(B){var H=g;return function(){var V=g;g=H;try{return B.apply(this,arguments)}finally{g=V}}}})(jf)),jf}var ty;function ES(){return ty||(ty=1,Df.exports=SS()),Df.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var ny;function NS(){if(ny)return At;ny=1;var e=Fo(),t=ES();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},d={};function g(r){return f.call(d,r)?!0:f.call(m,r)?!1:h.test(r)?d[r]=!0:(m[r]=!0,!1)}function v(r,s,u,p){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function k(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,x,O){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=x,this.removeEmptyString=O}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){b[r]=new w(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];b[s]=new w(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){b[r]=new w(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){b[r]=new w(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){b[r]=new w(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){b[r]=new w(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){b[r]=new w(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){b[r]=new w(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){b[r]=new w(r,5,!1,r.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(S,N);b[s]=new w(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(S,N);b[s]=new w(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(S,N);b[s]=new w(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){b[r]=new w(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,s,u,p){var y=b.hasOwnProperty(s)?b[s]:null;(y!==null?y.type!==0:p||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(k(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,I=Symbol.for("react.element"),M=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),R=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),B=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,D;function U(r){if(D===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);D=s&&s[1]||""}return`
|
|
34
|
-
`+D+r}var W=!1;function K(r,s){if(!r||W)return"";W=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(ie){var p=ie}Reflect.construct(r,[],s)}else{try{s.call()}catch(ie){p=ie}r.call(s.prototype)}else{try{throw Error()}catch(ie){p=ie}r()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var y=ie.stack.split(`
|
|
35
|
-
`),x=p.stack.split(`
|
|
36
|
-
`),O=y.length-1,F=x.length-1;1<=O&&0<=F&&y[O]!==x[F];)F--;for(;1<=O&&0<=F;O--,F--)if(y[O]!==x[F]){if(O!==1||F!==1)do if(O--,F--,0>F||y[O]!==x[F]){var q=`
|
|
37
|
-
`+y[O].replace(" at new "," at ");return r.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",r.displayName)),q}while(1<=O&&0<=F);break}}}finally{W=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?U(r):""}function 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=K(r.type,!1),r;case 11:return r=K(r.type.render,!1),r;case 1:return r=K(r.type,!0),r;default:return""}}function re(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case L:return"Fragment";case M:return"Portal";case A:return"Profiler";case T:return"StrictMode";case Z: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 $:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case G:return s=r.displayName||null,s!==null?s:re(r.type)||"Memo";case Y:s=r._payload,r=r._init;try{return re(r(s))}catch{}}return null}function oe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(s);case 8:return s===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,x=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(O){p=""+O,x.call(this,O)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(O){p=""+O},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function xe(r){r._valueTracker||(r._valueTracker=de(r))}function he(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return r&&(p=se(r)?r.checked?"true":"false":r.value),r=p,r!==u?(s.setValue(r),!0):!1}function fe(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Se(r,s){var u=s.checked;return V({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ie(r,s){var u=s.defaultValue==null?"":s.defaultValue,p=s.checked!=null?s.checked:s.defaultChecked;u=ee(s.value!=null?s.value:u),r._wrapperState={initialChecked:p,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Ae(r,s){s=s.checked,s!=null&&E(r,"checked",s,!1)}function Fe(r,s){Ae(r,s);var u=ee(s.value),p=s.type;if(u!=null)p==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(p==="submit"||p==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Nt(r,s.type,u):s.hasOwnProperty("defaultValue")&&Nt(r,s.type,ee(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function wt(r,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var p=s.type;if(!(p!=="submit"&&p!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,u||s===r.value||(r.value=s),r.defaultValue=s}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Nt(r,s,u){(s!=="number"||fe(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var ht=Array.isArray;function pt(r,s,u,p){if(r=r.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=s.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+ee(u),s=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}s!==null||r[y].disabled||(s=r[y])}s!==null&&(s.selected=!0)}}function Dn(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function bn(r,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(ht(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:ee(u)}}function kn(r,s){var u=ee(s.value),p=ee(s.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),s.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),p!=null&&(r.defaultValue=""+p)}function _t(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Ht(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rt(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 jn(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var Mr={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(Mr).forEach(function(r){Fu.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Mr[s]=Mr[r]})});function Qo(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Mr.hasOwnProperty(r)&&Mr[r]?(""+s).trim():s+"px"}function Jo(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var p=u.indexOf("--")===0,y=Qo(u,s[u],p);u==="float"&&(u="cssFloat"),p?r.setProperty(u,y):r[u]=y}}var Bu=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ss(r,s){if(s){if(Bu[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Es(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ns=null;function _s(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Cs=null,tr=null,nr=null;function Zo(r){if(r=Qs(r)){if(typeof Cs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Oa(s),Cs(r.stateNode,r.type,s))}}function ea(r){tr?nr?nr.push(r):nr=[r]:tr=r}function ta(){if(tr){var r=tr,s=nr;if(nr=tr=null,Zo(r),s)for(r=0;r<s.length;r++)Zo(s[r])}}function na(r,s){return r(s)}function ra(){}var Ts=!1;function ia(r,s,u){if(Ts)return r(s,u);Ts=!0;try{return na(r,s,u)}finally{Ts=!1,(tr!==null||nr!==null)&&(ra(),ta())}}function Lr(r,s){var u=r.stateNode;if(u===null)return null;var p=Oa(u);if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var Os=!1;if(c)try{var Rr={};Object.defineProperty(Rr,"passive",{get:function(){Os=!0}}),window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{Os=!1}function Vu(r,s,u,p,y,x,O,F,q){var ie=Array.prototype.slice.call(arguments,3);try{s.apply(u,ie)}catch(le){this.onError(le)}}var Dr=!1,hi=null,pi=!1,Ps=null,Wu={onError:function(r){Dr=!0,hi=r}};function Uu(r,s,u,p,y,x,O,F,q){Dr=!1,hi=null,Vu.apply(Wu,arguments)}function Hu(r,s,u,p,y,x,O,F,q){if(Uu.apply(this,arguments),Dr){if(Dr){var ie=hi;Dr=!1,hi=null}else throw Error(n(198));pi||(pi=!0,Ps=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 Is(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 x=y.alternate;if(x===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return As(y),r;if(x===p)return As(y),s;x=x.sibling}throw Error(n(188))}if(u.return!==p.return)u=y,p=x;else{for(var O=!1,F=y.child;F;){if(F===u){O=!0,u=y,p=x;break}if(F===p){O=!0,p=y,u=x;break}F=F.sibling}if(!O){for(F=x.child;F;){if(F===u){O=!0,u=x,p=y;break}if(F===p){O=!0,p=x,u=y;break}F=F.sibling}if(!O)throw Error(n(189))}}if(u.alternate!==p)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:s}function sa(r){return r=qu(r),r!==null?oa(r):null}function oa(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=oa(r);if(s!==null)return s;r=r.sibling}return null}var aa=t.unstable_scheduleCallback,la=t.unstable_cancelCallback,Yu=t.unstable_shouldYield,ua=t.unstable_requestPaint,Ye=t.unstable_now,Ku=t.unstable_getCurrentPriorityLevel,Ms=t.unstable_ImmediatePriority,ca=t.unstable_UserBlockingPriority,mi=t.unstable_NormalPriority,Gu=t.unstable_LowPriority,fa=t.unstable_IdlePriority,gi=null,Dt=null;function Xu(r){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(gi,r,void 0,(r.current.flags&128)===128)}catch{}}var jt=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 yi=64,vi=4194304;function jr(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function $n(r,s){var u=r.pendingLanes;if(u===0)return 0;var p=0,y=r.suspendedLanes,x=r.pingedLanes,O=u&268435455;if(O!==0){var F=O&~y;F!==0?p=jr(F):(x&=O,x!==0&&(p=jr(x)))}else O=u&~y,O!==0?p=jr(O):x!==0&&(p=jr(x));if(p===0)return 0;if(s!==0&&s!==p&&(s&y)===0&&(y=p&-p,x=s&-s,y>=x||y===16&&(x&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-jt(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,x=r.pendingLanes;0<x;){var O=31-jt(x),F=1<<O,q=y[O];q===-1?((F&u)===0||(F&p)!==0)&&(y[O]=ec(F,s)):q<=s&&(r.expiredLanes|=F),x&=~F}}function Ls(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function ha(){var r=yi;return yi<<=1,(yi&4194240)===0&&(yi=64),r}function $r(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function zr(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-jt(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-jt(u),x=1<<y;s[y]=0,p[y]=-1,r[y]=-1,u&=~x}}function wi(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var p=31-jt(u),y=1<<p;y&s|r[p]&s&&(r[p]|=s),u&=~y}}var De=0;function Tp(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Op,nc,Pp,Ip,Ap,rc=!1,pa=[],rr=null,ir=null,sr=null,Rs=new Map,Ds=new Map,or=[],zb="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 Mp(r,s){switch(r){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":Rs.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ds.delete(s.pointerId)}}function js(r,s,u,p,y,x){return r===null||r.nativeEvent!==x?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,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 Fb(r,s,u,p,y){switch(s){case"focusin":return rr=js(rr,r,s,u,p,y),!0;case"dragenter":return ir=js(ir,r,s,u,p,y),!0;case"mouseover":return sr=js(sr,r,s,u,p,y),!0;case"pointerover":var x=y.pointerId;return Rs.set(x,js(Rs.get(x)||null,r,s,u,p,y)),!0;case"gotpointercapture":return x=y.pointerId,Ds.set(x,js(Ds.get(x)||null,r,s,u,p,y)),!0}return!1}function Lp(r){var s=Fr(r.target);if(s!==null){var u=Sn(s);if(u!==null){if(s=u.tag,s===13){if(s=Is(u),s!==null){r.blockedOn=s,Ap(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 Rp(r,s,u){ma(r)&&u.delete(s)}function Bb(){rc=!1,rr!==null&&ma(rr)&&(rr=null),ir!==null&&ma(ir)&&(ir=null),sr!==null&&ma(sr)&&(sr=null),Rs.forEach(Rp),Ds.forEach(Rp)}function $s(r,s){r.blockedOn===s&&(r.blockedOn=null,rc||(rc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bb)))}function zs(r){function s(y){return $s(y,r)}if(0<pa.length){$s(pa[0],r);for(var u=1;u<pa.length;u++){var p=pa[u];p.blockedOn===r&&(p.blockedOn=null)}}for(rr!==null&&$s(rr,r),ir!==null&&$s(ir,r),sr!==null&&$s(sr,r),Rs.forEach(s),Ds.forEach(s),u=0;u<or.length;u++)p=or[u],p.blockedOn===r&&(p.blockedOn=null);for(;0<or.length&&(u=or[0],u.blockedOn===null);)Lp(u),u.blockedOn===null&&or.shift()}var xi=C.ReactCurrentBatchConfig,ga=!0;function Vb(r,s,u,p){var y=De,x=xi.transition;xi.transition=null;try{De=1,ic(r,s,u,p)}finally{De=y,xi.transition=x}}function Wb(r,s,u,p){var y=De,x=xi.transition;xi.transition=null;try{De=4,ic(r,s,u,p)}finally{De=y,xi.transition=x}}function ic(r,s,u,p){if(ga){var y=sc(r,s,u,p);if(y===null)kc(r,s,p,ya,u),Mp(r,p);else if(Fb(y,r,s,u,p))p.stopPropagation();else if(Mp(r,p),s&4&&-1<zb.indexOf(r)){for(;y!==null;){var x=Qs(y);if(x!==null&&Op(x),x=sc(r,s,u,p),x===null&&kc(r,s,p,ya,u),x===y)break;y=x}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=Fr(r),r!==null)if(s=Sn(r),s===null)r=null;else if(u=s.tag,u===13){if(r=Is(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 mi:case Gu:return 16;case fa:return 536870912;default:return 16}default:return 16}}var ar=null,oc=null,va=null;function jp(){if(va)return va;var r,s=oc,u=s.length,p,y="value"in ar?ar.value:ar.textContent,x=y.length;for(r=0;r<u&&s[r]===y[r];r++);var O=u-r;for(p=1;p<=O&&s[u-p]===y[x-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 $p(){return!1}function $t(r){function s(u,p,y,x,O){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=x,this.target=O,this.currentTarget=null;for(var F in r)r.hasOwnProperty(F)&&(u=r[F],this[F]=u?u(x):x[F]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?xa:$p,this.isPropagationStopped=$p,this}return V(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=xa)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=xa)},persist:function(){},isPersistent:xa}),s}var bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ac=$t(bi),Fs=V({},bi,{view:0,detail:0}),Ub=$t(Fs),lc,uc,Bs,ba=V({},Fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Bs&&(Bs&&r.type==="mousemove"?(lc=r.screenX-Bs.screenX,uc=r.screenY-Bs.screenY):uc=lc=0,Bs=r),lc)},movementY:function(r){return"movementY"in r?r.movementY:uc}}),zp=$t(ba),Hb=V({},ba,{dataTransfer:0}),qb=$t(Hb),Yb=V({},Fs,{relatedTarget:0}),cc=$t(Yb),Kb=V({},bi,{animationName:0,elapsedTime:0,pseudoElement:0}),Gb=$t(Kb),Xb=V({},bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Qb=$t(Xb),Jb=V({},bi,{data:0}),Fp=$t(Jb),Zb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ek={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"},tk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nk(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=tk[r])?!!s[r]:!1}function fc(){return nk}var rk=V({},Fs,{key:function(r){if(r.key){var s=Zb[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"?ek[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}}),ik=$t(rk),sk=V({},ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bp=$t(sk),ok=V({},Fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fc}),ak=$t(ok),lk=V({},bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),uk=$t(lk),ck=V({},ba,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),fk=$t(ck),dk=[9,13,27,32],dc=c&&"CompositionEvent"in window,Vs=null;c&&"documentMode"in document&&(Vs=document.documentMode);var hk=c&&"TextEvent"in window&&!Vs,Vp=c&&(!dc||Vs&&8<Vs&&11>=Vs),Wp=" ",Up=!1;function Hp(r,s){switch(r){case"keyup":return dk.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ki=!1;function pk(r,s){switch(r){case"compositionend":return qp(s);case"keypress":return s.which!==32?null:(Up=!0,Wp);case"textInput":return r=s.data,r===Wp&&Up?null:r;default:return null}}function mk(r,s){if(ki)return r==="compositionend"||!dc&&Hp(r,s)?(r=jp(),va=oc=ar=null,ki=!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 Vp&&s.locale!=="ko"?null:s.data;default:return null}}var gk={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 Yp(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!gk[r.type]:s==="textarea"}function Kp(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 yk(r){dm(r,0)}function ka(r){var s=Ci(r);if(he(s))return r}function vk(r,s){if(r==="change")return s}var Gp=!1;if(c){var hc;if(c){var pc="oninput"in document;if(!pc){var Xp=document.createElement("div");Xp.setAttribute("oninput","return;"),pc=typeof Xp.oninput=="function"}hc=pc}else hc=!1;Gp=hc&&(!document.documentMode||9<document.documentMode)}function Qp(){Ws&&(Ws.detachEvent("onpropertychange",Jp),Us=Ws=null)}function Jp(r){if(r.propertyName==="value"&&ka(Us)){var s=[];Kp(s,Us,r,_s(r)),ia(yk,s)}}function wk(r,s,u){r==="focusin"?(Qp(),Ws=s,Us=u,Ws.attachEvent("onpropertychange",Jp)):r==="focusout"&&Qp()}function xk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ka(Us)}function bk(r,s){if(r==="click")return ka(s)}function kk(r,s){if(r==="input"||r==="change")return ka(s)}function Sk(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var sn=typeof Object.is=="function"?Object.is:Sk;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 Zp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function em(r,s){var u=Zp(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=Zp(u)}}function tm(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?tm(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function nm(){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 Ek(r){var s=nm(),u=r.focusedElem,p=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&tm(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,x=Math.min(p.start,y);p=p.end===void 0?x:Math.min(p.end,y),!r.extend&&x>p&&(y=p,p=x,x=y),y=em(u,x);var O=em(u,p);y&&O&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==O.node||r.focusOffset!==O.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),r.removeAllRanges(),x>p?(r.addRange(s),r.extend(O.node,O.offset)):(s.setEnd(O.node,O.offset),r.addRange(s)))}}for(s=[],r=u;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)r=s[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var Nk=c&&"documentMode"in document&&11>=document.documentMode,Si=null,gc=null,qs=null,yc=!1;function rm(r,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;yc||Si==null||Si!==fe(p)||(p=Si,"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=Si)))}function Sa(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Ei={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},vc={},im={};c&&(im=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function Ea(r){if(vc[r])return vc[r];if(!Ei[r])return r;var s=Ei[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in im)return vc[r]=s[u];return r}var sm=Ea("animationend"),om=Ea("animationiteration"),am=Ea("animationstart"),lm=Ea("transitionend"),um=new Map,cm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function lr(r,s){um.set(r,s),a(s,[r])}for(var wc=0;wc<cm.length;wc++){var xc=cm[wc],_k=xc.toLowerCase(),Ck=xc[0].toUpperCase()+xc.slice(1);lr(_k,"on"+Ck)}lr(sm,"onAnimationEnd"),lr(om,"onAnimationIteration"),lr(am,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(lm,"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(" "),Tk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ys));function fm(r,s,u){var p=r.type||"unknown-event";r.currentTarget=u,Hu(p,s,void 0,r),r.currentTarget=null}function dm(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 x=void 0;if(s)for(var O=p.length-1;0<=O;O--){var F=p[O],q=F.instance,ie=F.currentTarget;if(F=F.listener,q!==x&&y.isPropagationStopped())break e;fm(y,F,ie),x=q}else for(O=0;O<p.length;O++){if(F=p[O],q=F.instance,ie=F.currentTarget,F=F.listener,q!==x&&y.isPropagationStopped())break e;fm(y,F,ie),x=q}}}if(pi)throw r=Ps,pi=!1,Ps=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)||(hm(s,r,2,!1),u.add(p))}function bc(r,s,u){var p=0;s&&(p|=4),hm(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"&&(Tk.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 hm(r,s,u,p){switch(Dp(s)){case 1:var y=Vb;break;case 4:y=Wb;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 x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var F=p.stateNode.containerInfo;if(F===y||F.nodeType===8&&F.parentNode===y)break;if(O===4)for(O=p.return;O!==null;){var q=O.tag;if((q===3||q===4)&&(q=O.stateNode.containerInfo,q===y||q.nodeType===8&&q.parentNode===y))return;O=O.return}for(;F!==null;){if(O=Fr(F),O===null)return;if(q=O.tag,q===5||q===6){p=x=O;continue e}F=F.parentNode}}p=p.return}ia(function(){var ie=x,le=_s(u),ue=[];e:{var ae=um.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=ik;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=zp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=qb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=ak;break;case sm:case om:case am:pe=Gb;break;case lm:pe=uk;break;case"scroll":pe=Ub;break;case"wheel":pe=fk;break;case"copy":case"cut":case"paste":pe=Qb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Bp}var we=(s&4)!==0,Qe=!we&&r==="scroll",te=we?ae!==null?ae+"Capture":null:ae;we=[];for(var X=ie,ne;X!==null;){ne=X;var ce=ne.stateNode;if(ne.tag===5&&ce!==null&&(ne=ce,te!==null&&(ce=Lr(X,te),ce!=null&&we.push(Gs(X,ce,ne)))),Qe)break;X=X.return}0<we.length&&(ae=new pe(ae,ve,null,u,le),ue.push({event:ae,listeners:we}))}}if((s&7)===0){e:{if(ae=r==="mouseover"||r==="pointerover",pe=r==="mouseout"||r==="pointerout",ae&&u!==Ns&&(ve=u.relatedTarget||u.fromElement)&&(Fr(ve)||ve[zn]))break e;if((pe||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,pe?(ve=u.relatedTarget||u.toElement,pe=ie,ve=ve?Fr(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=zp,ce="onMouseLeave",te="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&(we=Bp,ce="onPointerLeave",te="onPointerEnter",X="pointer"),Qe=pe==null?ae:Ci(pe),ne=ve==null?ae:Ci(ve),ae=new we(ce,X+"leave",pe,u,le),ae.target=Qe,ae.relatedTarget=ne,ce=null,Fr(le)===ie&&(we=new we(te,X+"enter",ve,u,le),we.target=ne,we.relatedTarget=Qe,ce=we),Qe=ce,pe&&ve)t:{for(we=pe,te=ve,X=0,ne=we;ne;ne=Ni(ne))X++;for(ne=0,ce=te;ce;ce=Ni(ce))ne++;for(;0<X-ne;)we=Ni(we),X--;for(;0<ne-X;)te=Ni(te),ne--;for(;X--;){if(we===te||te!==null&&we===te.alternate)break t;we=Ni(we),te=Ni(te)}we=null}else we=null;pe!==null&&pm(ue,ae,pe,we,!1),ve!==null&&Qe!==null&&pm(ue,Qe,ve,we,!0)}}e:{if(ae=ie?Ci(ie):window,pe=ae.nodeName&&ae.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ae.type==="file")var be=vk;else if(Yp(ae))if(Gp)be=kk;else{be=xk;var Ee=wk}else(pe=ae.nodeName)&&pe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(be=bk);if(be&&(be=be(r,ie))){Kp(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?Ci(ie):window,r){case"focusin":(Yp(Ee)||Ee.contentEditable==="true")&&(Si=Ee,gc=ie,qs=null);break;case"focusout":qs=gc=Si=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,rm(ue,u,le);break;case"selectionchange":if(Nk)break;case"keydown":case"keyup":rm(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 ki?Hp(r,u)&&(Ce="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ce="onCompositionStart");Ce&&(Vp&&u.locale!=="ko"&&(ki||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ki&&(Ne=jp()):(ar=le,oc="value"in ar?ar.value:ar.textContent,ki=!0)),Ee=_a(ie,Ce),0<Ee.length&&(Ce=new Fp(Ce,r,null,u,le),ue.push({event:Ce,listeners:Ee}),Ne?Ce.data=Ne:(Ne=qp(u),Ne!==null&&(Ce.data=Ne)))),(Ne=hk?pk(r,u):mk(r,u))&&(ie=_a(ie,"onBeforeInput"),0<ie.length&&(le=new Fp("onBeforeInput","beforeinput",null,u,le),ue.push({event:le,listeners:ie}),le.data=Ne))}dm(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,x=y.stateNode;y.tag===5&&x!==null&&(y=x,x=Lr(r,u),x!=null&&p.unshift(Gs(r,x,y)),x=Lr(r,s),x!=null&&p.push(Gs(r,x,y))),r=r.return}return p}function Ni(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function pm(r,s,u,p,y){for(var x=s._reactName,O=[];u!==null&&u!==p;){var F=u,q=F.alternate,ie=F.stateNode;if(q!==null&&q===p)break;F.tag===5&&ie!==null&&(F=ie,y?(q=Lr(u,x),q!=null&&O.unshift(Gs(u,q,F))):y||(q=Lr(u,x),q!=null&&O.push(Gs(u,q,F)))),u=u.return}O.length!==0&&r.push({event:s,listeners:O})}var Ok=/\r\n?/g,Pk=/\u0000|\uFFFD/g;function mm(r){return(typeof r=="string"?r:""+r).replace(Ok,`
|
|
38
|
-
`).replace(Pk,"")}function Ca(r,s,u){if(s=mm(s),mm(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,Ik=typeof clearTimeout=="function"?clearTimeout:void 0,gm=typeof Promise=="function"?Promise:void 0,Ak=typeof queueMicrotask=="function"?queueMicrotask:typeof gm<"u"?function(r){return gm.resolve(null).then(r).catch(Mk)}:_c;function Mk(r){setTimeout(function(){throw r})}function Cc(r,s){var u=s,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(p===0){r.removeChild(y),zs(s);return}p--}else u!=="$"&&u!=="$?"&&u!=="$!"||p++;u=y}while(u);zs(s)}function ur(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function ym(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 _i=Math.random().toString(36).slice(2),En="__reactFiber$"+_i,Xs="__reactProps$"+_i,zn="__reactContainer$"+_i,Tc="__reactEvents$"+_i,Lk="__reactListeners$"+_i,Rk="__reactHandles$"+_i;function Fr(r){var s=r[En];if(s)return s;for(var u=r.parentNode;u;){if(s=u[zn]||u[En]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=ym(r);r!==null;){if(u=r[En])return u;r=ym(r)}return s}r=u,u=r.parentNode}return null}function Qs(r){return r=r[En]||r[zn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ci(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Oa(r){return r[Xs]||null}var Oc=[],Ti=-1;function cr(r){return{current:r}}function Ve(r){0>Ti||(r.current=Oc[Ti],Oc[Ti]=null,Ti--)}function $e(r,s){Ti++,Oc[Ti]=r.current,r.current=s}var fr={},mt=cr(fr),Ct=cr(!1),Br=fr;function Oi(r,s){var u=r.type.contextTypes;if(!u)return fr;var p=r.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var y={},x;for(x in u)y[x]=s[x];return p&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=y),y}function Tt(r){return r=r.childContextTypes,r!=null}function Pa(){Ve(Ct),Ve(mt)}function vm(r,s,u){if(mt.current!==fr)throw Error(n(168));$e(mt,s),$e(Ct,u)}function wm(r,s,u){var p=r.stateNode;if(s=s.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var y in p)if(!(y in s))throw Error(n(108,oe(r)||"Unknown",y));return V({},u,p)}function Ia(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||fr,Br=mt.current,$e(mt,r),$e(Ct,Ct.current),!0}function xm(r,s,u){var p=r.stateNode;if(!p)throw Error(n(169));u?(r=wm(r,s,Br),p.__reactInternalMemoizedMergedChildContext=r,Ve(Ct),Ve(mt),$e(mt,r)):Ve(Ct),$e(Ct,u)}var Fn=null,Aa=!1,Pc=!1;function bm(r){Fn===null?Fn=[r]:Fn.push(r)}function Dk(r){Aa=!0,bm(r)}function dr(){if(!Pc&&Fn!==null){Pc=!0;var r=0,s=De;try{var u=Fn;for(De=1;r<u.length;r++){var p=u[r];do p=p(!0);while(p!==null)}Fn=null,Aa=!1}catch(y){throw Fn!==null&&(Fn=Fn.slice(r+1)),aa(Ms,dr),y}finally{De=s,Pc=!1}}return null}var Pi=[],Ii=0,Ma=null,La=0,Yt=[],Kt=0,Vr=null,Bn=1,Vn="";function Wr(r,s){Pi[Ii++]=La,Pi[Ii++]=Ma,Ma=r,La=s}function km(r,s,u){Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Vr,Vr=r;var p=Bn;r=Vn;var y=32-jt(p)-1;p&=~(1<<y),u+=1;var x=32-jt(s)+y;if(30<x){var O=y-y%5;x=(p&(1<<O)-1).toString(32),p>>=O,y-=O,Bn=1<<32-jt(s)+y|u<<y|p,Vn=x+r}else Bn=1<<x|u<<y|p,Vn=r}function Ic(r){r.return!==null&&(Wr(r,1),km(r,1,0))}function Ac(r){for(;r===Ma;)Ma=Pi[--Ii],Pi[Ii]=null,La=Pi[--Ii],Pi[Ii]=null;for(;r===Vr;)Vr=Yt[--Kt],Yt[Kt]=null,Vn=Yt[--Kt],Yt[Kt]=null,Bn=Yt[--Kt],Yt[Kt]=null}var zt=null,Ft=null,Ue=!1,on=null;function Sm(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 Em(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,zt=r,Ft=ur(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,zt=r,Ft=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=Vr!==null?{id:Bn,overflow:Vn}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=Jt(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,zt=r,Ft=null,!0):!1;default:return!1}}function Mc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Lc(r){if(Ue){var s=Ft;if(s){var u=s;if(!Em(r,s)){if(Mc(r))throw Error(n(418));s=ur(u.nextSibling);var p=zt;s&&Em(r,s)?Sm(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 Nm(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;zt=r}function Ra(r){if(r!==zt)return!1;if(!Ue)return Nm(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 _m(),Error(n(418));for(;s;)Sm(r,s),s=ur(s.nextSibling)}if(Nm(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){Ft=ur(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Ft=null}}else Ft=zt?ur(r.stateNode.nextSibling):null;return!0}function _m(){for(var r=Ft;r;)r=ur(r.nextSibling)}function Ai(){Ft=zt=null,Ue=!1}function Rc(r){on===null?on=[r]:on.push(r)}var jk=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,x=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===x?s.ref:(s=function(O){var F=y.refs;O===null?delete F[x]:F[x]=O},s._stringRef=x,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function Da(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Cm(r){var s=r._init;return s(r._payload)}function Tm(r){function s(te,X){if(r){var ne=te.deletions;ne===null?(te.deletions=[X],te.flags|=16):ne.push(X)}}function u(te,X){if(!r)return null;for(;X!==null;)s(te,X),X=X.sibling;return null}function p(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function y(te,X){return te=xr(te,X),te.index=0,te.sibling=null,te}function x(te,X,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<X?(te.flags|=2,X):ne):(te.flags|=2,X)):(te.flags|=1048576,X)}function O(te){return r&&te.alternate===null&&(te.flags|=2),te}function F(te,X,ne,ce){return X===null||X.tag!==6?(X=Cf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne),X.return=te,X)}function q(te,X,ne,ce){var be=ne.type;return be===L?le(te,X,ne.props.children,ce,ne.key):X!==null&&(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Cm(be)===X.type)?(ce=y(X,ne.props),ce.ref=Js(te,X,ne),ce.return=te,ce):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,X,ne),ce.return=te,ce)}function ie(te,X,ne,ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Tf(ne,te.mode,ce),X.return=te,X):(X=y(X,ne.children||[]),X.return=te,X)}function le(te,X,ne,ce,be){return X===null||X.tag!==7?(X=Qr(ne,te.mode,ce,be),X.return=te,X):(X=y(X,ne),X.return=te,X)}function ue(te,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Cf(""+X,te.mode,ne),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case I:return ne=ol(X.type,X.key,X.props,null,te.mode,ne),ne.ref=Js(te,null,X),ne.return=te,ne;case M:return X=Tf(X,te.mode,ne),X.return=te,X;case Y:var ce=X._init;return ue(te,ce(X._payload),ne)}if(ht(X)||H(X))return X=Qr(X,te.mode,ne,null),X.return=te,X;Da(te,X)}return null}function ae(te,X,ne,ce){var be=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return be!==null?null:F(te,X,""+ne,ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:return ne.key===be?q(te,X,ne,ce):null;case M:return ne.key===be?ie(te,X,ne,ce):null;case Y:return be=ne._init,ae(te,X,be(ne._payload),ce)}if(ht(ne)||H(ne))return be!==null?null:le(te,X,ne,ce,null);Da(te,ne)}return null}function pe(te,X,ne,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return te=te.get(ne)||null,F(X,te,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case I:return te=te.get(ce.key===null?ne:ce.key)||null,q(X,te,ce,be);case M:return te=te.get(ce.key===null?ne:ce.key)||null,ie(X,te,ce,be);case Y:var Ee=ce._init;return pe(te,X,ne,Ee(ce._payload),be)}if(ht(ce)||H(ce))return te=te.get(ne)||null,le(X,te,ce,be,null);Da(X,ce)}return null}function ve(te,X,ne,ce){for(var be=null,Ee=null,Ne=X,Ce=X=0,ut=null;Ne!==null&&Ce<ne.length;Ce++){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var Re=ae(te,Ne,ne[Ce],ce);if(Re===null){Ne===null&&(Ne=ut);break}r&&Ne&&Re.alternate===null&&s(te,Ne),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re,Ne=ut}if(Ce===ne.length)return u(te,Ne),Ue&&Wr(te,Ce),be;if(Ne===null){for(;Ce<ne.length;Ce++)Ne=ue(te,ne[Ce],ce),Ne!==null&&(X=x(Ne,X,Ce),Ee===null?be=Ne:Ee.sibling=Ne,Ee=Ne);return Ue&&Wr(te,Ce),be}for(Ne=p(te,Ne);Ce<ne.length;Ce++)ut=pe(Ne,te,Ce,ne[Ce],ce),ut!==null&&(r&&ut.alternate!==null&&Ne.delete(ut.key===null?Ce:ut.key),X=x(ut,X,Ce),Ee===null?be=ut:Ee.sibling=ut,Ee=ut);return r&&Ne.forEach(function(br){return s(te,br)}),Ue&&Wr(te,Ce),be}function we(te,X,ne,ce){var be=H(ne);if(typeof be!="function")throw Error(n(150));if(ne=be.call(ne),ne==null)throw Error(n(151));for(var Ee=be=null,Ne=X,Ce=X=0,ut=null,Re=ne.next();Ne!==null&&!Re.done;Ce++,Re=ne.next()){Ne.index>Ce?(ut=Ne,Ne=null):ut=Ne.sibling;var br=ae(te,Ne,Re.value,ce);if(br===null){Ne===null&&(Ne=ut);break}r&&Ne&&br.alternate===null&&s(te,Ne),X=x(br,X,Ce),Ee===null?be=br:Ee.sibling=br,Ee=br,Ne=ut}if(Re.done)return u(te,Ne),Ue&&Wr(te,Ce),be;if(Ne===null){for(;!Re.done;Ce++,Re=ne.next())Re=ue(te,Re.value,ce),Re!==null&&(X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return Ue&&Wr(te,Ce),be}for(Ne=p(te,Ne);!Re.done;Ce++,Re=ne.next())Re=pe(Ne,te,Ce,Re.value,ce),Re!==null&&(r&&Re.alternate!==null&&Ne.delete(Re.key===null?Ce:Re.key),X=x(Re,X,Ce),Ee===null?be=Re:Ee.sibling=Re,Ee=Re);return r&&Ne.forEach(function(gS){return s(te,gS)}),Ue&&Wr(te,Ce),be}function Qe(te,X,ne,ce){if(typeof ne=="object"&&ne!==null&&ne.type===L&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:e:{for(var be=ne.key,Ee=X;Ee!==null;){if(Ee.key===be){if(be=ne.type,be===L){if(Ee.tag===7){u(te,Ee.sibling),X=y(Ee,ne.props.children),X.return=te,te=X;break e}}else if(Ee.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===Y&&Cm(be)===Ee.type){u(te,Ee.sibling),X=y(Ee,ne.props),X.ref=Js(te,Ee,ne),X.return=te,te=X;break e}u(te,Ee);break}else s(te,Ee);Ee=Ee.sibling}ne.type===L?(X=Qr(ne.props.children,te.mode,ce,ne.key),X.return=te,te=X):(ce=ol(ne.type,ne.key,ne.props,null,te.mode,ce),ce.ref=Js(te,X,ne),ce.return=te,te=ce)}return O(te);case M:e:{for(Ee=ne.key;X!==null;){if(X.key===Ee)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){u(te,X.sibling),X=y(X,ne.children||[]),X.return=te,te=X;break e}else{u(te,X);break}else s(te,X);X=X.sibling}X=Tf(ne,te.mode,ce),X.return=te,te=X}return O(te);case Y:return Ee=ne._init,Qe(te,X,Ee(ne._payload),ce)}if(ht(ne))return ve(te,X,ne,ce);if(H(ne))return we(te,X,ne,ce);Da(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(u(te,X.sibling),X=y(X,ne),X.return=te,te=X):(u(te,X),X=Cf(ne,te.mode,ce),X.return=te,te=X),O(te)):u(te,X)}return Qe}var Mi=Tm(!0),Om=Tm(!1),ja=cr(null),$a=null,Li=null,Dc=null;function jc(){Dc=Li=$a=null}function $c(r){var s=ja.current;Ve(ja),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 Ri(r,s){$a=r,Dc=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(Dc!==r)if(r={context:r,memoizedValue:s,next:null},Li===null){if($a===null)throw Error(n(308));Li=r,$a.dependencies={lanes:0,firstContext:r}}else Li=Li.next=r;return s}var Ur=null;function Fc(r){Ur===null?Ur=[r]:Ur.push(r)}function Pm(r,s,u,p){var y=s.interleaved;return y===null?(u.next=u,Fc(s)):(u.next=y.next,y.next=u),s.interleaved=u,Wn(r,p)}function Wn(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var hr=!1;function Bc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Im(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Un(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function pr(r,s,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Le&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,Wn(r,u)}return y=p.interleaved,y===null?(s.next=s,Fc(p)):(s.next=y.next,y.next=s),p.interleaved=s,Wn(r,u)}function za(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,wi(r,u)}}function Am(r,s){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var O={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?y=x=O:x=x.next=O,u=u.next}while(u!==null);x===null?y=x=s:x=x.next=s}else y=x=s;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:p.shared,effects:p.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function Fa(r,s,u,p){var y=r.updateQueue;hr=!1;var x=y.firstBaseUpdate,O=y.lastBaseUpdate,F=y.shared.pending;if(F!==null){y.shared.pending=null;var q=F,ie=q.next;q.next=null,O===null?x=ie:O.next=ie,O=q;var le=r.alternate;le!==null&&(le=le.updateQueue,F=le.lastBaseUpdate,F!==O&&(F===null?le.firstBaseUpdate=ie:F.next=ie,le.lastBaseUpdate=q))}if(x!==null){var ue=y.baseState;O=0,le=ie=q=null,F=x;do{var ae=F.lane,pe=F.eventTime;if((p&ae)===ae){le!==null&&(le=le.next={eventTime:pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var ve=r,we=F;switch(ae=s,pe=u,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ue=ve.call(pe,ue,ae);break e}ue=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,ae=typeof ve=="function"?ve.call(pe,ue,ae):ve,ae==null)break e;ue=V({},ue,ae);break e;case 2:hr=!0}}F.callback!==null&&F.lane!==0&&(r.flags|=64,ae=y.effects,ae===null?y.effects=[F]:ae.push(F))}else pe={eventTime:pe,lane:ae,tag:F.tag,payload:F.payload,callback:F.callback,next:null},le===null?(ie=le=pe,q=ue):le=le.next=pe,O|=ae;if(F=F.next,F===null){if(F=y.shared.pending,F===null)break;ae=F,F=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);if(le===null&&(q=ue),y.baseState=q,y.firstBaseUpdate=ie,y.lastBaseUpdate=le,s=y.shared.interleaved,s!==null){y=s;do O|=y.lane,y=y.next;while(y!==s)}else x===null&&(y.shared.lanes=0);Yr|=O,r.lanes=O,r.memoizedState=ue}}function Mm(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var p=r[s],y=p.callback;if(y!==null){if(p.callback=null,p=u,typeof y!="function")throw Error(n(191,y));y.call(p)}}}var Zs={},Nn=cr(Zs),eo=cr(Zs),to=cr(Zs);function Hr(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:Rt(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Rt(s,r)}Ve(Nn),$e(Nn,s)}function Di(){Ve(Nn),Ve(eo),Ve(to)}function Lm(r){Hr(to.current);var s=Hr(Nn.current),u=Rt(s,r.type);s!==u&&($e(eo,r),$e(Nn,u))}function Wc(r){eo.current===r&&(Ve(Nn),Ve(eo))}var Ke=cr(0);function Ba(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Uc=[];function Hc(){for(var r=0;r<Uc.length;r++)Uc[r]._workInProgressVersionPrimary=null;Uc.length=0}var Va=C.ReactCurrentDispatcher,qc=C.ReactCurrentBatchConfig,qr=0,Ge=null,it=null,at=null,Wa=!1,no=!1,ro=0,$k=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,x){if(qr=x,Ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Va.current=r===null||r.memoizedState===null?Vk:Wk,r=u(p,y),no){x=0;do{if(no=!1,ro=0,25<=x)throw Error(n(301));x+=1,at=it=null,s.updateQueue=null,Va.current=Uk,r=u(p,y)}while(no)}if(Va.current=qa,s=it!==null&&it.next!==null,qr=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,x=u.pending;if(x!==null){if(y!==null){var O=y.next;y.next=x.next,x.next=O}p.baseQueue=y=x,u.pending=null}if(y!==null){x=y.next,p=p.baseState;var F=O=null,q=null,ie=x;do{var le=ie.lane;if((qr&le)===le)q!==null&&(q=q.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),p=ie.hasEagerState?ie.eagerState:r(p,ie.action);else{var ue={lane:le,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};q===null?(F=q=ue,O=p):q=q.next=ue,Ge.lanes|=le,Yr|=le}ie=ie.next}while(ie!==null&&ie!==x);q===null?O=p:q.next=F,sn(p,s.memoizedState)||(Ot=!0),s.memoizedState=p,s.baseState=O,s.baseQueue=q,u.lastRenderedState=p}if(r=u.interleaved,r!==null){y=r;do x=y.lane,Ge.lanes|=x,Yr|=x,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,x=s.memoizedState;if(y!==null){u.pending=null;var O=y=y.next;do x=r(x,O.action),O=O.next;while(O!==y);sn(x,s.memoizedState)||(Ot=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function Rm(){}function Dm(r,s){var u=Ge,p=Xt(),y=s(),x=!sn(p.memoizedState,y);if(x&&(p.memoizedState=y,Ot=!0),p=p.queue,Jc(zm.bind(null,u,p,r),[r]),p.getSnapshot!==s||x||at!==null&&at.memoizedState.tag&1){if(u.flags|=2048,so(9,$m.bind(null,u,p,y,s),void 0,null),lt===null)throw Error(n(349));(qr&30)!==0||jm(u,s,y)}return y}function jm(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 $m(r,s,u,p){s.value=u,s.getSnapshot=p,Fm(s)&&Bm(r)}function zm(r,s,u){return u(function(){Fm(s)&&Bm(r)})}function Fm(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!sn(r,u)}catch{return!0}}function Bm(r){var s=Wn(r,1);s!==null&&cn(s,r,1,-1)}function Vm(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=Bk.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 Wm(){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 x=void 0;if(it!==null){var O=it.memoizedState;if(x=O.destroy,p!==null&&Yc(p,O.deps)){y.memoizedState=so(s,u,x,p);return}}Ge.flags|=r,y.memoizedState=so(1|s,u,x,p)}function Um(r,s){return Ua(8390656,8,r,s)}function Jc(r,s){return Ha(2048,8,r,s)}function Hm(r,s){return Ha(4,2,r,s)}function qm(r,s){return Ha(4,4,r,s)}function Ym(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 Km(r,s,u){return u=u!=null?u.concat([r]):null,Ha(4,4,Ym.bind(null,s,r),u)}function Zc(){}function Gm(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 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]:(r=r(),u.memoizedState=[r,s],r)}function Qm(r,s,u){return(qr&21)===0?(r.baseState&&(r.baseState=!1,Ot=!0),r.memoizedState=u):(sn(u,s)||(u=ha(),Ge.lanes|=u,Yr|=u,r.baseState=!0),s)}function zk(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 Jm(){return Xt().memoizedState}function Fk(r,s,u){var p=vr(r);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},Zm(r))eg(s,u);else if(u=Pm(r,s,u,p),u!==null){var y=bt();cn(u,r,p,y),tg(u,s,p)}}function Bk(r,s,u){var p=vr(r),y={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(Zm(r))eg(s,y);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var O=s.lastRenderedState,F=x(O,u);if(y.hasEagerState=!0,y.eagerState=F,sn(F,O)){var q=s.interleaved;q===null?(y.next=y,Fc(s)):(y.next=q.next,q.next=y),s.interleaved=y;return}}catch{}finally{}u=Pm(r,s,y,p),u!==null&&(y=bt(),cn(u,r,p,y),tg(u,s,p))}}function Zm(r){var s=r.alternate;return r===Ge||s!==null&&s===Ge}function eg(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 tg(r,s,u){if((u&4194240)!==0){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,wi(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},Vk={readContext:Gt,useCallback:function(r,s){return _n().memoizedState=[r,s===void 0?null:s],r},useContext:Gt,useEffect:Um,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,Ua(4194308,4,Ym.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=Fk.bind(null,Ge,r),[p.memoizedState,r]},useRef:function(r){var s=_n();return r={current:r},s.memoizedState=r},useState:Vm,useDebugValue:Zc,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=Vm(!1),s=r[0];return r=zk.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));(qr&30)!==0||jm(p,s,u)}y.memoizedState=u;var x={value:u,getSnapshot:s};return y.queue=x,Um(zm.bind(null,p,x,r),[r]),p.flags|=2048,so(9,$m.bind(null,p,x,u,s),void 0,null),u},useId:function(){var r=_n(),s=lt.identifierPrefix;if(Ue){var u=Vn,p=Bn;u=(p&~(1<<32-jt(p)-1)).toString(32)+u,s=":"+s+"R"+u,u=ro++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=$k++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},Wk={readContext:Gt,useCallback:Gm,useContext:Gt,useEffect:Jc,useImperativeHandle:Km,useInsertionEffect:Hm,useLayoutEffect:qm,useMemo:Xm,useReducer:Xc,useRef:Wm,useState:function(){return Xc(io)},useDebugValue:Zc,useDeferredValue:function(r){var s=Xt();return Qm(s,it.memoizedState,r)},useTransition:function(){var r=Xc(io)[0],s=Xt().memoizedState;return[r,s]},useMutableSource:Rm,useSyncExternalStore:Dm,useId:Jm,unstable_isNewReconciler:!1},Uk={readContext:Gt,useCallback:Gm,useContext:Gt,useEffect:Jc,useImperativeHandle:Km,useInsertionEffect:Hm,useLayoutEffect:qm,useMemo:Xm,useReducer:Qc,useRef:Wm,useState:function(){return Qc(io)},useDebugValue:Zc,useDeferredValue:function(r){var s=Xt();return it===null?s.memoizedState=r:Qm(s,it.memoizedState,r)},useTransition:function(){var r=Qc(io)[0],s=Xt().memoizedState;return[r,s]},useMutableSource:Rm,useSyncExternalStore:Dm,useId:Jm,unstable_isNewReconciler:!1};function an(r,s){if(r&&r.defaultProps){s=V({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function ef(r,s,u,p){s=r.memoizedState,u=u(p,s),u=u==null?s:V({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Ya={isMounted:function(r){return(r=r._reactInternals)?Sn(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.payload=s,u!=null&&(x.callback=u),s=pr(r,x,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=bt(),y=vr(r),x=Un(p,y);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=pr(r,x,y),s!==null&&(cn(s,r,y,p),za(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=bt(),p=vr(r),y=Un(u,p);y.tag=2,s!=null&&(y.callback=s),s=pr(r,y,p),s!==null&&(cn(s,r,p,u),za(s,r,p))}};function ng(r,s,u,p,y,x,O){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,x,O):s.prototype&&s.prototype.isPureReactComponent?!Hs(u,p)||!Hs(y,x):!0}function rg(r,s,u){var p=!1,y=fr,x=s.contextType;return typeof x=="object"&&x!==null?x=Gt(x):(y=Tt(s)?Br:mt.current,p=s.contextTypes,x=(p=p!=null)?Oi(r,y):fr),s=new s(u,x),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=x),s}function ig(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 x=s.contextType;typeof x=="object"&&x!==null?y.context=Gt(x):(x=Tt(s)?Br:mt.current,y.context=Oi(r,x)),y.state=r.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(ef(r,s,x,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 ji(r,s){try{var u="",p=s;do u+=Q(p),p=p.return;while(p);var y=u}catch(x){y=`
|
|
39
|
-
Error generating stack: `+x.message+`
|
|
40
|
-
`+x.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 Hk=typeof WeakMap=="function"?WeakMap:Map;function sg(r,s,u){u=Un(-1,u),u.tag=3,u.payload={element:null};var p=s.value;return u.callback=function(){el||(el=!0,wf=p),rf(r,s)},u}function og(r,s,u){u=Un(-1,u),u.tag=3;var p=r.type.getDerivedStateFromError;if(typeof p=="function"){var y=s.value;u.payload=function(){return p(y)},u.callback=function(){rf(r,s)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){rf(r,s),typeof p!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var O=s.stack;this.componentDidCatch(s.value,{componentStack:O!==null?O:""})}),u}function ag(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Hk;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=sS.bind(null,r,s,u),s.then(r,r))}function lg(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 ug(r,s,u,p,y){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Un(-1,1),s.tag=2,pr(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var qk=C.ReactCurrentOwner,Ot=!1;function xt(r,s,u,p){s.child=r===null?Om(s,null,u,p):Mi(s,r.child,u,p)}function cg(r,s,u,p,y){u=u.render;var x=s.ref;return Ri(s,y),p=Kc(r,s,u,p,x,y),u=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&u&&Ic(s),s.flags|=1,xt(r,s,p,y),s.child)}function fg(r,s,u,p,y){if(r===null){var x=u.type;return typeof x=="function"&&!_f(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=x,dg(r,s,x,p,y)):(r=ol(u.type,null,p,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(x=r.child,(r.lanes&y)===0){var O=x.memoizedProps;if(u=u.compare,u=u!==null?u:Hs,u(O,p)&&r.ref===s.ref)return Hn(r,s,y)}return s.flags|=1,r=xr(x,p),r.ref=s.ref,r.return=s,s.child=r}function dg(r,s,u,p,y){if(r!==null){var x=r.memoizedProps;if(Hs(x,p)&&r.ref===s.ref)if(Ot=!1,s.pendingProps=p=x,(r.lanes&y)!==0)(r.flags&131072)!==0&&(Ot=!0);else return s.lanes=r.lanes,Hn(r,s,y)}return sf(r,s,u,p,y)}function hg(r,s,u){var p=s.pendingProps,y=p.children,x=r!==null?r.memoizedState:null;if(p.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(zi,Bt),Bt|=u;else{if((u&1073741824)===0)return r=x!==null?x.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,$e(zi,Bt),Bt|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=x!==null?x.baseLanes:u,$e(zi,Bt),Bt|=p}else x!==null?(p=x.baseLanes|u,s.memoizedState=null):p=u,$e(zi,Bt),Bt|=p;return xt(r,s,y,u),s.child}function pg(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 x=Tt(u)?Br:mt.current;return x=Oi(s,x),Ri(s,y),u=Kc(r,s,u,p,x,y),p=Gc(),r!==null&&!Ot?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hn(r,s,y)):(Ue&&p&&Ic(s),s.flags|=1,xt(r,s,u,y),s.child)}function mg(r,s,u,p,y){if(Tt(u)){var x=!0;Ia(s)}else x=!1;if(Ri(s,y),s.stateNode===null)Ga(r,s),rg(s,u,p),tf(s,u,p,y),p=!0;else if(r===null){var O=s.stateNode,F=s.memoizedProps;O.props=F;var q=O.context,ie=u.contextType;typeof ie=="object"&&ie!==null?ie=Gt(ie):(ie=Tt(u)?Br:mt.current,ie=Oi(s,ie));var le=u.getDerivedStateFromProps,ue=typeof le=="function"||typeof O.getSnapshotBeforeUpdate=="function";ue||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==p||q!==ie)&&ig(s,O,p,ie),hr=!1;var ae=s.memoizedState;O.state=ae,Fa(s,p,O,y),q=s.memoizedState,F!==p||ae!==q||Ct.current||hr?(typeof le=="function"&&(ef(s,u,le,p),q=s.memoizedState),(F=hr||ng(s,u,F,p,ae,q,ie))?(ue||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(s.flags|=4194308)):(typeof O.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=q),O.props=p,O.state=q,O.context=ie,p=F):(typeof O.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{O=s.stateNode,Im(r,s),F=s.memoizedProps,ie=s.type===s.elementType?F:an(s.type,F),O.props=ie,ue=s.pendingProps,ae=O.context,q=u.contextType,typeof q=="object"&&q!==null?q=Gt(q):(q=Tt(u)?Br:mt.current,q=Oi(s,q));var pe=u.getDerivedStateFromProps;(le=typeof pe=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==ue||ae!==q)&&ig(s,O,p,q),hr=!1,ae=s.memoizedState,O.state=ae,Fa(s,p,O,y);var ve=s.memoizedState;F!==ue||ae!==ve||Ct.current||hr?(typeof pe=="function"&&(ef(s,u,pe,p),ve=s.memoizedState),(ie=hr||ng(s,u,ie,p,ae,ve,q)||!1)?(le||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(p,ve,q),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(p,ve,q)),typeof O.componentDidUpdate=="function"&&(s.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof O.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=ve),O.props=p,O.state=ve,O.context=q,p=ie):(typeof O.componentDidUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&ae===r.memoizedState||(s.flags|=1024),p=!1)}return of(r,s,u,p,x,y)}function of(r,s,u,p,y,x){pg(r,s);var O=(s.flags&128)!==0;if(!p&&!O)return y&&xm(s,u,!1),Hn(r,s,x);p=s.stateNode,qk.current=s;var F=O&&typeof u.getDerivedStateFromError!="function"?null:p.render();return s.flags|=1,r!==null&&O?(s.child=Mi(s,r.child,null,x),s.child=Mi(s,null,F,x)):xt(r,s,F,x),s.memoizedState=p.state,y&&xm(s,u,!0),s.child}function gg(r){var s=r.stateNode;s.pendingContext?vm(r,s.pendingContext,s.pendingContext!==s.context):s.context&&vm(r,s.context,!1),Vc(r,s.containerInfo)}function yg(r,s,u,p,y){return Ai(),Rc(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 vg(r,s,u){var p=s.pendingProps,y=Ke.current,x=!1,O=(s.flags&128)!==0,F;if((F=O)||(F=r!==null&&r.memoizedState===null?!1:(y&2)!==0),F?(x=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),$e(Ke,y&1),r===null)return Lc(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(O=p.children,r=p.fallback,x?(p=s.mode,x=s.child,O={mode:"hidden",children:O},(p&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=O):x=al(O,p,0,null),r=Qr(r,p,u,null),x.return=s,r.return=s,x.sibling=r,s.child=x,s.child.memoizedState=lf(u),s.memoizedState=af,r):uf(s,O));if(y=r.memoizedState,y!==null&&(F=y.dehydrated,F!==null))return Yk(r,s,O,p,F,y,u);if(x){x=p.fallback,O=s.mode,y=r.child,F=y.sibling;var q={mode:"hidden",children:p.children};return(O&1)===0&&s.child!==y?(p=s.child,p.childLanes=0,p.pendingProps=q,s.deletions=null):(p=xr(y,q),p.subtreeFlags=y.subtreeFlags&14680064),F!==null?x=xr(F,x):(x=Qr(x,O,u,null),x.flags|=2),x.return=s,p.return=s,p.sibling=x,s.child=p,p=x,x=s.child,O=r.child.memoizedState,O=O===null?lf(u):{baseLanes:O.baseLanes|u,cachePool:null,transitions:O.transitions},x.memoizedState=O,x.childLanes=r.childLanes&~u,s.memoizedState=af,p}return x=r.child,r=x.sibling,p=xr(x,{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&&Rc(p),Mi(s,r.child,null,u),r=uf(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Yk(r,s,u,p,y,x,O){if(u)return s.flags&256?(s.flags&=-257,p=nf(Error(n(422))),Ka(r,s,O,p)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(x=p.fallback,y=s.mode,p=al({mode:"visible",children:p.children},y,0,null),x=Qr(x,y,O,null),x.flags|=2,p.return=s,x.return=s,p.sibling=x,s.child=p,(s.mode&1)!==0&&Mi(s,r.child,null,O),s.child.memoizedState=lf(O),s.memoizedState=af,x);if((s.mode&1)===0)return Ka(r,s,O,null);if(y.data==="$!"){if(p=y.nextSibling&&y.nextSibling.dataset,p)var F=p.dgst;return p=F,x=Error(n(419)),p=nf(x,p,void 0),Ka(r,s,O,p)}if(F=(O&r.childLanes)!==0,Ot||F){if(p=lt,p!==null){switch(O&-O){case 4:y=2;break;case 16:y=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(p.suspendedLanes|O))!==0?0:y,y!==0&&y!==x.retryLane&&(x.retryLane=y,Wn(r,y),cn(p,r,y,-1))}return Nf(),p=nf(Error(n(421))),Ka(r,s,O,p)}return y.data==="$?"?(s.flags|=128,s.child=r.child,s=oS.bind(null,r),y._reactRetry=s,null):(r=x.treeContext,Ft=ur(y.nextSibling),zt=s,Ue=!0,on=null,r!==null&&(Yt[Kt++]=Bn,Yt[Kt++]=Vn,Yt[Kt++]=Vr,Bn=r.id,Vn=r.overflow,Vr=s),s=uf(s,p.children),s.flags|=4096,s)}function wg(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 x=r.memoizedState;x===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=p,x.tail=u,x.tailMode=y)}function xg(r,s,u){var p=s.pendingProps,y=p.revealOrder,x=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&&wg(r,u,s);else if(r.tag===19)wg(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,x);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,x);break;case"together":cf(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ga(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Hn(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Yr|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=xr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=xr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Kk(r,s,u){switch(s.tag){case 3:gg(s),Ai();break;case 5:Lm(s);break;case 1:Tt(s.type)&&Ia(s);break;case 4:Vc(s,s.stateNode.containerInfo);break;case 10:var p=s.type._context,y=s.memoizedProps.value;$e(ja,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?vg(r,s,u):($e(Ke,Ke.current&1),r=Hn(r,s,u),r!==null?r.sibling:null);$e(Ke,Ke.current&1);break;case 19:if(p=(u&s.childLanes)!==0,(r.flags&128)!==0){if(p)return xg(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,hg(r,s,u)}return Hn(r,s,u)}var bg,ff,kg,Sg;bg=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(){},kg=function(r,s,u,p){var y=r.memoizedProps;if(y!==p){r=s.stateNode,Hr(Nn.current);var x=null;switch(u){case"input":y=Se(r,y),p=Se(r,p),x=[];break;case"select":y=V({},y,{value:void 0}),p=V({},p,{value:void 0}),x=[];break;case"textarea":y=Dn(r,y),p=Dn(r,p),x=[];break;default:typeof y.onClick!="function"&&typeof p.onClick=="function"&&(r.onclick=Ta)}Ss(u,p);var O;u=null;for(ie in y)if(!p.hasOwnProperty(ie)&&y.hasOwnProperty(ie)&&y[ie]!=null)if(ie==="style"){var F=y[ie];for(O in F)F.hasOwnProperty(O)&&(u||(u={}),u[O]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in p){var q=p[ie];if(F=y!=null?y[ie]:void 0,p.hasOwnProperty(ie)&&q!==F&&(q!=null||F!=null))if(ie==="style")if(F){for(O in F)!F.hasOwnProperty(O)||q&&q.hasOwnProperty(O)||(u||(u={}),u[O]="");for(O in q)q.hasOwnProperty(O)&&F[O]!==q[O]&&(u||(u={}),u[O]=q[O])}else u||(x||(x=[]),x.push(ie,u)),u=q;else ie==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,F=F?F.__html:void 0,q!=null&&F!==q&&(x=x||[]).push(ie,q)):ie==="children"?typeof q!="string"&&typeof q!="number"||(x=x||[]).push(ie,""+q):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(q!=null&&ie==="onScroll"&&Be("scroll",r),x||F===q||(x=[])):(x=x||[]).push(ie,q))}u&&(x=x||[]).push("style",u);var ie=x;(s.updateQueue=ie)&&(s.flags|=4)}},Sg=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 Gk(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)&&Pa(),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)&&(Ra(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=Hr(to.current);if(u=s.type,r!==null&&s.stateNode!=null)kg(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=Hr(Nn.current),Ra(s)){p=s.stateNode,u=s.type;var x=s.memoizedProps;switch(p[En]=s,p[Xs]=x,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":Ie(p,x),Be("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!x.multiple},Be("invalid",p);break;case"textarea":bn(p,x),Be("invalid",p)}Ss(u,x),y=null;for(var O in x)if(x.hasOwnProperty(O)){var F=x[O];O==="children"?typeof F=="string"?p.textContent!==F&&(x.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",F]):typeof F=="number"&&p.textContent!==""+F&&(x.suppressHydrationWarning!==!0&&Ca(p.textContent,F,r),y=["children",""+F]):o.hasOwnProperty(O)&&F!=null&&O==="onScroll"&&Be("scroll",p)}switch(u){case"input":xe(p),wt(p,x,!0);break;case"textarea":xe(p),_t(p);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(p.onclick=Ta)}p=y,s.updateQueue=p,p!==null&&(s.flags|=4)}else{O=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ht(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=O.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof p.is=="string"?r=O.createElement(u,{is:p.is}):(r=O.createElement(u),u==="select"&&(O=r,p.multiple?O.multiple=!0:p.size&&(O.size=p.size))):r=O.createElementNS(r,u),r[En]=s,r[Xs]=p,bg(r,s,!1,!1),s.stateNode=r;e:{switch(O=Es(u,p),u){case"dialog":Be("cancel",r),Be("close",r),y=p;break;case"iframe":case"object":case"embed":Be("load",r),y=p;break;case"video":case"audio":for(y=0;y<Ys.length;y++)Be(Ys[y],r);y=p;break;case"source":Be("error",r),y=p;break;case"img":case"image":case"link":Be("error",r),Be("load",r),y=p;break;case"details":Be("toggle",r),y=p;break;case"input":Ie(r,p),y=Se(r,p),Be("invalid",r);break;case"option":y=p;break;case"select":r._wrapperState={wasMultiple:!!p.multiple},y=V({},p,{value:void 0}),Be("invalid",r);break;case"textarea":bn(r,p),y=Dn(r,p),Be("invalid",r);break;default:y=p}Ss(u,y),F=y;for(x in F)if(F.hasOwnProperty(x)){var q=F[x];x==="style"?Jo(r,q):x==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Xo(r,q)):x==="children"?typeof q=="string"?(u!=="textarea"||q!=="")&&jn(r,q):typeof q=="number"&&jn(r,""+q):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?q!=null&&x==="onScroll"&&Be("scroll",r):q!=null&&E(r,x,q,O))}switch(u){case"input":xe(r),wt(r,p,!1);break;case"textarea":xe(r),_t(r);break;case"option":p.value!=null&&r.setAttribute("value",""+ee(p.value));break;case"select":r.multiple=!!p.multiple,x=p.value,x!=null?pt(r,!!p.multiple,x,!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)Sg(r,s,r.memoizedProps,p);else{if(typeof p!="string"&&s.stateNode===null)throw Error(n(166));if(u=Hr(to.current),Hr(Nn.current),Ra(s)){if(p=s.stateNode,u=s.memoizedProps,p[En]=s,(x=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)}x&&(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)_m(),Ai(),s.flags|=98560,x=!1;else if(x=Ra(s),p!==null&&p.dehydrated!==null){if(r===null){if(!x)throw Error(n(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[En]=s}else Ai(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;yt(s),x=!1}else on!==null&&(kf(on),on=null),x=!0;if(!x)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)&&Pa(),yt(s),null;case 19:if(Ve(Ke),x=s.memoizedState,x===null)return yt(s),null;if(p=(s.flags&128)!==0,O=x.rendering,O===null)if(p)oo(x,!1);else{if(st!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(O=Ba(r),O!==null){for(s.flags|=128,oo(x,!1),p=O.updateQueue,p!==null&&(s.updateQueue=p,s.flags|=4),s.subtreeFlags=0,p=u,u=s.child;u!==null;)x=u,r=p,x.flags&=14680066,O=x.alternate,O===null?(x.childLanes=0,x.lanes=r,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=O.childLanes,x.lanes=O.lanes,x.child=O.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=O.memoizedProps,x.memoizedState=O.memoizedState,x.updateQueue=O.updateQueue,x.type=O.type,r=O.dependencies,x.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}x.tail!==null&&Ye()>Fi&&(s.flags|=128,p=!0,oo(x,!1),s.lanes=4194304)}else{if(!p)if(r=Ba(O),r!==null){if(s.flags|=128,p=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),oo(x,!0),x.tail===null&&x.tailMode==="hidden"&&!O.alternate&&!Ue)return yt(s),null}else 2*Ye()-x.renderingStartTime>Fi&&u!==1073741824&&(s.flags|=128,p=!0,oo(x,!1),s.lanes=4194304);x.isBackwards?(O.sibling=s.child,s.child=O):(u=x.last,u!==null?u.sibling=O:s.child=O,x.last=O)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.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 Xk(r,s){switch(Ac(s),s.tag){case 1:return Tt(s.type)&&Pa(),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));Ai()}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,Qk=typeof WeakSet=="function"?WeakSet:Set,ge=null;function $i(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 Eg=!1;function Jk(r,s){if(Sc=ga,r=nm(),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,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var O=0,F=-1,q=-1,ie=0,le=0,ue=r,ae=null;t:for(;;){for(var pe;ue!==u||y!==0&&ue.nodeType!==3||(F=O+y),ue!==x||p!==0&&ue.nodeType!==3||(q=O+p),ue.nodeType===3&&(O+=ue.nodeValue.length),(pe=ue.firstChild)!==null;)ae=ue,ue=pe;for(;;){if(ue===r)break t;if(ae===u&&++ie===y&&(F=O),ae===x&&++le===p&&(q=O),(pe=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=pe}u=F===-1||q===-1?null:{start:F,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ec={focusedElem:r,selectionRange:u},ga=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ve=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Qe=ve.memoizedState,te=s.stateNode,X=te.getSnapshotBeforeUpdate(s.elementType===s.type?we:an(s.type,we),Qe);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=s.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){Xe(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ve=Eg,Eg=!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 x=y.destroy;y.destroy=void 0,x!==void 0&&df(s,u,x)}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 Ng(r){var s=r.alternate;s!==null&&(r.alternate=null,Ng(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[Lk],delete s[Rk])),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 _g(r){return r.tag===5||r.tag===3||r.tag===4}function Cg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||_g(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function pf(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(r,s):u.insertBefore(r,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(r,u)):(s=u,s.appendChild(r)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Ta));else if(p!==4&&(r=r.child,r!==null))for(pf(r,s,u),r=r.sibling;r!==null;)pf(r,s,u),r=r.sibling}function mf(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(p!==4&&(r=r.child,r!==null))for(mf(r,s,u),r=r.sibling;r!==null;)mf(r,s,u),r=r.sibling}var ct=null,ln=!1;function mr(r,s,u){for(u=u.child;u!==null;)Tg(r,s,u),u=u.sibling}function Tg(r,s,u){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(gi,u)}catch{}switch(u.tag){case 5:vt||$i(u,s);case 6:var p=ct,y=ln;ct=null,mr(r,s,u),ct=p,ln=y,ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):ct.removeChild(u.stateNode));break;case 18:ct!==null&&(ln?(r=ct,u=u.stateNode,r.nodeType===8?Cc(r.parentNode,u):r.nodeType===1&&Cc(r,u),zs(r)):Cc(ct,u.stateNode));break;case 4:p=ct,y=ln,ct=u.stateNode.containerInfo,ln=!0,mr(r,s,u),ct=p,ln=y;break;case 0:case 11:case 14:case 15:if(!vt&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var x=y,O=x.destroy;x=x.tag,O!==void 0&&((x&2)!==0||(x&4)!==0)&&df(u,s,O),y=y.next}while(y!==p)}mr(r,s,u);break;case 1:if(!vt&&($i(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(F){Xe(u,s,F)}mr(r,s,u);break;case 21:mr(r,s,u);break;case 22:u.mode&1?(vt=(p=vt)||u.memoizedState!==null,mr(r,s,u),vt=p):mr(r,s,u);break;default:mr(r,s,u)}}function Og(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Qk),s.forEach(function(p){var y=aS.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 x=r,O=s,F=O;e:for(;F!==null;){switch(F.tag){case 5:ct=F.stateNode,ln=!1;break e;case 3:ct=F.stateNode.containerInfo,ln=!0;break e;case 4:ct=F.stateNode.containerInfo,ln=!0;break e}F=F.return}if(ct===null)throw Error(n(160));Tg(x,O,y),ct=null,ln=!1;var q=y.alternate;q!==null&&(q.return=null),y.return=null}catch(ie){Xe(y,s,ie)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Pg(s,r),s=s.sibling}function Pg(r,s){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(un(s,r),Cn(r),p&4){try{ao(3,r,r.return),Qa(3,r)}catch(we){Xe(r,r.return,we)}try{ao(5,r,r.return)}catch(we){Xe(r,r.return,we)}}break;case 1:un(s,r),Cn(r),p&512&&u!==null&&$i(u,u.return);break;case 5:if(un(s,r),Cn(r),p&512&&u!==null&&$i(u,u.return),r.flags&32){var y=r.stateNode;try{jn(y,"")}catch(we){Xe(r,r.return,we)}}if(p&4&&(y=r.stateNode,y!=null)){var x=r.memoizedProps,O=u!==null?u.memoizedProps:x,F=r.type,q=r.updateQueue;if(r.updateQueue=null,q!==null)try{F==="input"&&x.type==="radio"&&x.name!=null&&Ae(y,x),Es(F,O);var ie=Es(F,x);for(O=0;O<q.length;O+=2){var le=q[O],ue=q[O+1];le==="style"?Jo(y,ue):le==="dangerouslySetInnerHTML"?Xo(y,ue):le==="children"?jn(y,ue):E(y,le,ue,ie)}switch(F){case"input":Fe(y,x);break;case"textarea":kn(y,x);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!x.multiple;var pe=x.value;pe!=null?pt(y,!!x.multiple,pe,!1):ae!==!!x.multiple&&(x.defaultValue!=null?pt(y,!!x.multiple,x.defaultValue,!0):pt(y,!!x.multiple,x.multiple?[]:"",!1))}y[Xs]=x}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,x=r.memoizedProps;try{y.nodeValue=x}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&&(x=y.memoizedState!==null,y.stateNode.isHidden=x,!x||y.alternate!==null&&y.alternate.memoizedState!==null||(vf=Ye())),p&4&&Og(r);break;case 22:if(le=u!==null&&u.memoizedState!==null,r.mode&1?(vt=(ie=vt)||le,un(s,r),vt=ie):un(s,r),Cn(r),p&8192){if(ie=r.memoizedState!==null,(r.stateNode.isHidden=ie)&&!le&&(r.mode&1)!==0)for(ge=r,le=r.child;le!==null;){for(ue=ge=le;ge!==null;){switch(ae=ge,pe=ae.child,ae.tag){case 0:case 11:case 14:case 15:ao(4,ae,ae.return);break;case 1:$i(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:$i(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Mg(ue);continue}}pe!==null?(pe.return=ae,ge=pe):Mg(ue)}le=le.sibling}e:for(le=null,ue=r;;){if(ue.tag===5){if(le===null){le=ue;try{y=ue.stateNode,ie?(x=y.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(F=ue.stateNode,q=ue.memoizedProps.style,O=q!=null&&q.hasOwnProperty("display")?q.display:null,F.style.display=Qo("display",O))}catch(we){Xe(r,r.return,we)}}}else if(ue.tag===6){if(le===null)try{ue.stateNode.nodeValue=ie?"":ue.memoizedProps}catch(we){Xe(r,r.return,we)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===r)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===r)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===r)break e;le===ue&&(le=null),ue=ue.return}le===ue&&(le=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:un(s,r),Cn(r),p&4&&Og(r);break;case 21:break;default:un(s,r),Cn(r)}}function Cn(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(_g(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&&(jn(y,""),p.flags&=-33);var x=Cg(r);mf(r,x,y);break;case 3:case 4:var O=p.stateNode.containerInfo,F=Cg(r);pf(r,F,O);break;default:throw Error(n(161))}}catch(q){Xe(r,r.return,q)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Zk(r,s,u){ge=r,Ig(r)}function Ig(r,s,u){for(var p=(r.mode&1)!==0;ge!==null;){var y=ge,x=y.child;if(y.tag===22&&p){var O=y.memoizedState!==null||Xa;if(!O){var F=y.alternate,q=F!==null&&F.memoizedState!==null||vt;F=Xa;var ie=vt;if(Xa=O,(vt=q)&&!ie)for(ge=y;ge!==null;)O=ge,q=O.child,O.tag===22&&O.memoizedState!==null?Lg(y):q!==null?(q.return=O,ge=q):Lg(y);for(;x!==null;)ge=x,Ig(x),x=x.sibling;ge=y,Xa=F,vt=ie}Ag(r)}else(y.subtreeFlags&8772)!==0&&x!==null?(x.return=y,ge=x):Ag(r)}}function Ag(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 x=s.updateQueue;x!==null&&Mm(s,x,p);break;case 3:var O=s.updateQueue;if(O!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}Mm(s,O,u)}break;case 5:var F=s.stateNode;if(u===null&&s.flags&4){u=F;var q=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&u.focus();break;case"img":q.src&&(u.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var ie=s.alternate;if(ie!==null){var le=ie.memoizedState;if(le!==null){var ue=le.dehydrated;ue!==null&&zs(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vt||s.flags&512&&hf(s)}catch(ae){Xe(s,s.return,ae)}}if(s===r){ge=null;break}if(u=s.sibling,u!==null){u.return=s.return,ge=u;break}ge=s.return}}function Mg(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var u=s.sibling;if(u!==null){u.return=s.return,ge=u;break}ge=s.return}}function Lg(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Qa(4,s)}catch(q){Xe(s,u,q)}break;case 1:var p=s.stateNode;if(typeof p.componentDidMount=="function"){var y=s.return;try{p.componentDidMount()}catch(q){Xe(s,y,q)}}var x=s.return;try{hf(s)}catch(q){Xe(s,x,q)}break;case 5:var O=s.return;try{hf(s)}catch(q){Xe(s,O,q)}}}catch(q){Xe(s,s.return,q)}if(s===r){ge=null;break}var F=s.sibling;if(F!==null){F.return=s.return,ge=F;break}ge=s.return}}var eS=Math.ceil,Ja=C.ReactCurrentDispatcher,gf=C.ReactCurrentOwner,Qt=C.ReactCurrentBatchConfig,Le=0,lt=null,tt=null,ft=0,Bt=0,zi=cr(0),st=0,lo=null,Yr=0,Za=0,yf=0,uo=null,Pt=null,vf=0,Fi=1/0,qn=null,el=!1,wf=null,gr=null,tl=!1,yr=null,nl=0,co=0,xf=null,rl=-1,il=0;function bt(){return(Le&6)!==0?Ye():rl!==-1?rl:rl=Ye()}function vr(r){return(r.mode&1)===0?1:(Le&2)!==0&&ft!==0?ft&-ft:jk.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));zr(r,u,p),((Le&2)===0||r!==lt)&&(r===lt&&((Le&2)===0&&(Za|=u),st===4&&wr(r,ft)),It(r,p),u===1&&Le===0&&(s.mode&1)===0&&(Fi=Ye()+500,Aa&&dr()))}function It(r,s){var u=r.callbackNode;da(r,s);var p=$n(r,r===lt?ft:0);if(p===0)u!==null&&la(u),r.callbackNode=null,r.callbackPriority=0;else if(s=p&-p,r.callbackPriority!==s){if(u!=null&&la(u),s===1)r.tag===0?Dk(Dg.bind(null,r)):bm(Dg.bind(null,r)),Ak(function(){(Le&6)===0&&dr()}),u=null;else{switch(Tp(p)){case 1:u=Ms;break;case 4:u=ca;break;case 16:u=mi;break;case 536870912:u=fa;break;default:u=mi}u=Ug(u,Rg.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function Rg(r,s){if(rl=-1,il=0,(Le&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Bi()&&r.callbackNode!==u)return null;var p=$n(r,r===lt?ft:0);if(p===0)return null;if((p&30)!==0||(p&r.expiredLanes)!==0||s)s=sl(r,p);else{s=p;var y=Le;Le|=2;var x=$g();(lt!==r||ft!==s)&&(qn=null,Fi=Ye()+500,Gr(r,s));do try{rS();break}catch(F){jg(r,F)}while(!0);jc(),Ja.current=x,Le=y,tt!==null?s=0:(lt=null,ft=0,s=st)}if(s!==0){if(s===2&&(y=Ls(r),y!==0&&(p=y,s=bf(r,y))),s===1)throw u=lo,Gr(r,0),wr(r,p),It(r,Ye()),u;if(s===6)wr(r,p);else{if(y=r.current.alternate,(p&30)===0&&!tS(y)&&(s=sl(r,p),s===2&&(x=Ls(r),x!==0&&(p=x,s=bf(r,x))),s===1))throw u=lo,Gr(r,0),wr(r,p),It(r,Ye()),u;switch(r.finishedWork=y,r.finishedLanes=p,s){case 0:case 1:throw Error(n(345));case 2:Xr(r,Pt,qn);break;case 3:if(wr(r,p),(p&130023424)===p&&(s=vf+500-Ye(),10<s)){if($n(r,0)!==0)break;if(y=r.suspendedLanes,(y&p)!==p){bt(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=_c(Xr.bind(null,r,Pt,qn),s);break}Xr(r,Pt,qn);break;case 4:if(wr(r,p),(p&4194240)===p)break;for(s=r.eventTimes,y=-1;0<p;){var O=31-jt(p);x=1<<O,O=s[O],O>y&&(y=O),p&=~x}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*eS(p/1960))-p,10<p){r.timeoutHandle=_c(Xr.bind(null,r,Pt,qn),p);break}Xr(r,Pt,qn);break;case 5:Xr(r,Pt,qn);break;default:throw Error(n(329))}}}return It(r,Ye()),r.callbackNode===u?Rg.bind(null,r):null}function bf(r,s){var u=uo;return r.current.memoizedState.isDehydrated&&(Gr(r,s).flags|=256),r=sl(r,s),r!==2&&(s=Pt,Pt=u,s!==null&&kf(s)),r}function kf(r){Pt===null?Pt=r:Pt.push.apply(Pt,r)}function tS(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],x=y.getSnapshot;y=y.value;try{if(!sn(x(),y))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function wr(r,s){for(s&=~yf,s&=~Za,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-jt(s),p=1<<u;r[u]=-1,s&=~p}}function Dg(r){if((Le&6)!==0)throw Error(n(327));Bi();var s=$n(r,0);if((s&1)===0)return It(r,Ye()),null;var u=sl(r,s);if(r.tag!==0&&u===2){var p=Ls(r);p!==0&&(s=p,u=bf(r,p))}if(u===1)throw u=lo,Gr(r,0),wr(r,s),It(r,Ye()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Xr(r,Pt,qn),It(r,Ye()),null}function Sf(r,s){var u=Le;Le|=1;try{return r(s)}finally{Le=u,Le===0&&(Fi=Ye()+500,Aa&&dr())}}function Kr(r){yr!==null&&yr.tag===0&&(Le&6)===0&&Bi();var s=Le;Le|=1;var u=Qt.transition,p=De;try{if(Qt.transition=null,De=1,r)return r()}finally{De=p,Qt.transition=u,Le=s,(Le&6)===0&&dr()}}function Ef(){Bt=zi.current,Ve(zi)}function Gr(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Ik(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&&Pa();break;case 3:Di(),Ve(Ct),Ve(mt),Hc();break;case 5:Wc(p);break;case 4:Di();break;case 13:Ve(Ke);break;case 19:Ve(Ke);break;case 10:$c(p.type._context);break;case 22:case 23:Ef()}u=u.return}if(lt=r,tt=r=xr(r.current,null),ft=Bt=s,st=0,lo=null,yf=Za=Yr=0,Pt=uo=null,Ur!==null){for(s=0;s<Ur.length;s++)if(u=Ur[s],p=u.interleaved,p!==null){u.interleaved=null;var y=p.next,x=u.pending;if(x!==null){var O=x.next;x.next=y,p.next=O}u.pending=p}Ur=null}return r}function jg(r,s){do{var u=tt;try{if(jc(),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(qr=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 x=r,O=u.return,F=u,q=s;if(s=ft,F.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var ie=q,le=F,ue=le.tag;if((le.mode&1)===0&&(ue===0||ue===11||ue===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var pe=lg(O);if(pe!==null){pe.flags&=-257,ug(pe,O,F,x,s),pe.mode&1&&ag(x,ie,s),s=pe,q=ie;var ve=s.updateQueue;if(ve===null){var we=new Set;we.add(q),s.updateQueue=we}else ve.add(q);break e}else{if((s&1)===0){ag(x,ie,s),Nf();break e}q=Error(n(426))}}else if(Ue&&F.mode&1){var Qe=lg(O);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),ug(Qe,O,F,x,s),Rc(ji(q,F));break e}}x=q=ji(q,F),st!==4&&(st=2),uo===null?uo=[x]:uo.push(x),x=O;do{switch(x.tag){case 3:x.flags|=65536,s&=-s,x.lanes|=s;var te=sg(x,q,s);Am(x,te);break e;case 1:F=q;var X=x.type,ne=x.stateNode;if((x.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(gr===null||!gr.has(ne)))){x.flags|=65536,s&=-s,x.lanes|=s;var ce=og(x,F,s);Am(x,ce);break e}}x=x.return}while(x!==null)}Fg(u)}catch(be){s=be,tt===u&&u!==null&&(tt=u=u.return);continue}break}while(!0)}function $g(){var r=Ja.current;return Ja.current=qa,r===null?qa:r}function Nf(){(st===0||st===3||st===2)&&(st=4),lt===null||(Yr&268435455)===0&&(Za&268435455)===0||wr(lt,ft)}function sl(r,s){var u=Le;Le|=2;var p=$g();(lt!==r||ft!==s)&&(qn=null,Gr(r,s));do try{nS();break}catch(y){jg(r,y)}while(!0);if(jc(),Le=u,Ja.current=p,tt!==null)throw Error(n(261));return lt=null,ft=0,st}function nS(){for(;tt!==null;)zg(tt)}function rS(){for(;tt!==null&&!Yu();)zg(tt)}function zg(r){var s=Wg(r.alternate,r,Bt);r.memoizedProps=r.pendingProps,s===null?Fg(r):tt=s,gf.current=null}function Fg(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Gk(u,s,Bt),u!==null){tt=u;return}}else{if(u=Xk(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 Xr(r,s,u){var p=De,y=Qt.transition;try{Qt.transition=null,De=1,iS(r,s,u,p)}finally{Qt.transition=y,De=p}return null}function iS(r,s,u,p){do Bi();while(yr!==null);if((Le&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 x=u.lanes|u.childLanes;if(tc(r,x),r===lt&&(tt=lt=null,ft=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||tl||(tl=!0,Ug(mi,function(){return Bi(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Qt.transition,Qt.transition=null;var O=De;De=1;var F=Le;Le|=4,gf.current=null,Jk(r,u),Pg(u,r),Ek(Ec),ga=!!Sc,Ec=Sc=null,r.current=u,Zk(u),ua(),Le=F,De=O,Qt.transition=x}else r.current=u;if(tl&&(tl=!1,yr=r,nl=y),x=r.pendingLanes,x===0&&(gr=null),Xu(u.stateNode),It(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&&Bi(),x=r.pendingLanes,(x&1)!==0?r===xf?co++:(co=0,xf=r):co=0,dr(),null}function Bi(){if(yr!==null){var r=Tp(nl),s=Qt.transition,u=De;try{if(Qt.transition=null,De=16>r?16:r,yr===null)var p=!1;else{if(r=yr,yr=null,nl=0,(Le&6)!==0)throw Error(n(331));var y=Le;for(Le|=4,ge=r.current;ge!==null;){var x=ge,O=x.child;if((ge.flags&16)!==0){var F=x.deletions;if(F!==null){for(var q=0;q<F.length;q++){var ie=F[q];for(ge=ie;ge!==null;){var le=ge;switch(le.tag){case 0:case 11:case 15:ao(8,le,x)}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(Ng(le),le===ie){ge=null;break}if(ae!==null){ae.return=pe,ge=ae;break}ge=pe}}}var ve=x.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=x}}if((x.subtreeFlags&2064)!==0&&O!==null)O.return=x,ge=O;else e:for(;ge!==null;){if(x=ge,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ao(9,x,x.return)}var te=x.sibling;if(te!==null){te.return=x.return,ge=te;break e}ge=x.return}}var X=r.current;for(ge=X;ge!==null;){O=ge;var ne=O.child;if((O.subtreeFlags&2064)!==0&&ne!==null)ne.return=O,ge=ne;else e:for(O=X;ge!==null;){if(F=ge,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Qa(9,F)}}catch(be){Xe(F,F.return,be)}if(F===O){ge=null;break e}var ce=F.sibling;if(ce!==null){ce.return=F.return,ge=ce;break e}ge=F.return}}if(Le=y,dr(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(gi,r)}catch{}p=!0}return p}finally{De=u,Qt.transition=s}}return!1}function Bg(r,s,u){s=ji(u,s),s=sg(r,s,1),r=pr(r,s,1),s=bt(),r!==null&&(zr(r,1,s),It(r,s))}function Xe(r,s,u){if(r.tag===3)Bg(r,r,u);else for(;s!==null;){if(s.tag===3){Bg(s,r,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(gr===null||!gr.has(p))){r=ji(u,r),r=og(s,r,1),s=pr(s,r,1),r=bt(),s!==null&&(zr(s,1,r),It(s,r));break}}s=s.return}}function sS(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?Gr(r,0):yf|=u),It(r,s)}function Vg(r,s){s===0&&((r.mode&1)===0?s=1:(s=vi,vi<<=1,(vi&130023424)===0&&(vi=4194304)));var u=bt();r=Wn(r,s),r!==null&&(zr(r,s,u),It(r,u))}function oS(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Vg(r,u)}function aS(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),Vg(r,u)}var Wg;Wg=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,Kk(r,s,u);Ot=(r.flags&131072)!==0}else Ot=!1,Ue&&(s.flags&1048576)!==0&&km(s,La,s.index);switch(s.lanes=0,s.tag){case 2:var p=s.type;Ga(r,s),r=s.pendingProps;var y=Oi(s,mt.current);Ri(s,u),y=Kc(null,s,p,r,y,u);var x=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)?(x=!0,Ia(s)):x=!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,x,u)):(s.tag=0,Ue&&x&&Ic(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=uS(p),r=an(p,r),y){case 0:s=sf(null,s,p,r,u);break e;case 1:s=mg(null,s,p,r,u);break e;case 11:s=cg(null,s,p,r,u);break e;case 14:s=fg(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),mg(r,s,p,y,u);case 3:e:{if(gg(s),r===null)throw Error(n(387));p=s.pendingProps,x=s.memoizedState,y=x.element,Im(r,s),Fa(s,p,null,u);var O=s.memoizedState;if(p=O.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){y=ji(Error(n(423)),s),s=yg(r,s,p,u,y);break e}else if(p!==y){y=ji(Error(n(424)),s),s=yg(r,s,p,u,y);break e}else for(Ft=ur(s.stateNode.containerInfo.firstChild),zt=s,Ue=!0,on=null,u=Om(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ai(),p===y){s=Hn(r,s,u);break e}xt(r,s,p,u)}s=s.child}return s;case 5:return Lm(s),r===null&&Lc(s),p=s.type,y=s.pendingProps,x=r!==null?r.memoizedProps:null,O=y.children,Nc(p,y)?O=null:x!==null&&Nc(p,x)&&(s.flags|=32),pg(r,s),xt(r,s,O,u),s.child;case 6:return r===null&&Lc(s),null;case 13:return vg(r,s,u);case 4:return Vc(s,s.stateNode.containerInfo),p=s.pendingProps,r===null?s.child=Mi(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),cg(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,x=s.memoizedProps,O=y.value,$e(ja,p._currentValue),p._currentValue=O,x!==null)if(sn(x.value,O)){if(x.children===y.children&&!Ct.current){s=Hn(r,s,u);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var F=x.dependencies;if(F!==null){O=x.child;for(var q=F.firstContext;q!==null;){if(q.context===p){if(x.tag===1){q=Un(-1,u&-u),q.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var le=ie.pending;le===null?q.next=q:(q.next=le.next,le.next=q),ie.pending=q}}x.lanes|=u,q=x.alternate,q!==null&&(q.lanes|=u),zc(x.return,u,s),F.lanes|=u;break}q=q.next}}else if(x.tag===10)O=x.type===s.type?null:x.child;else if(x.tag===18){if(O=x.return,O===null)throw Error(n(341));O.lanes|=u,F=O.alternate,F!==null&&(F.lanes|=u),zc(O,u,s),O=x.sibling}else O=x.child;if(O!==null)O.return=x;else for(O=x;O!==null;){if(O===s){O=null;break}if(x=O.sibling,x!==null){x.return=O.return,O=x;break}O=O.return}x=O}xt(r,s,y.children,u),s=s.child}return s;case 9:return y=s.type,p=s.pendingProps.children,Ri(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),fg(r,s,p,y,u);case 15:return dg(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,Ia(s)):r=!1,Ri(s,u),rg(s,p,y),tf(s,p,y,u),of(null,s,p,!0,r,u);case 19:return xg(r,s,u);case 22:return hg(r,s,u)}throw Error(n(156,s.tag))};function Ug(r,s){return aa(r,s)}function lS(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 lS(r,s,u,p)}function _f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function uS(r){if(typeof r=="function")return _f(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$)return 11;if(r===G)return 14}return 2}function xr(r,s){var u=r.alternate;return u===null?(u=Jt(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function ol(r,s,u,p,y,x){var O=2;if(p=r,typeof r=="function")_f(r)&&(O=1);else if(typeof r=="string")O=5;else e:switch(r){case L:return Qr(u.children,y,x,s);case T:O=8,y|=8;break;case A:return r=Jt(12,u,s,y|2),r.elementType=A,r.lanes=x,r;case Z:return r=Jt(13,u,s,y),r.elementType=Z,r.lanes=x,r;case j:return r=Jt(19,u,s,y),r.elementType=j,r.lanes=x,r;case J:return al(u,y,x,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:O=10;break e;case R:O=9;break e;case $:O=11;break e;case G:O=14;break e;case Y:O=16,p=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jt(O,u,s,y),s.elementType=r,s.type=p,s.lanes=x,s}function Qr(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=J,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 cS(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=$r(0),this.expirationTimes=$r(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$r(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Of(r,s,u,p,y,x,O,F,q){return r=new cS(r,s,u,F,q),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Jt(3,null,null,s),r.current=x,x.stateNode=r,x.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bc(x),r}function fS(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 Hg(r){if(!r)return fr;r=r._reactInternals;e:{if(Sn(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Tt(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Tt(u))return wm(r,u,s)}return s}function qg(r,s,u,p,y,x,O,F,q){return r=Of(u,p,!0,r,y,x,O,F,q),r.context=Hg(null),u=r.current,p=bt(),y=vr(u),x=Un(p,y),x.callback=s??null,pr(u,x,y),r.current.lanes=y,zr(r,y,p),It(r,p),r}function ll(r,s,u,p){var y=s.current,x=bt(),O=vr(y);return u=Hg(u),s.context===null?s.context=u:s.pendingContext=u,s=Un(x,O),s.payload={element:r},p=p===void 0?null:p,p!==null&&(s.callback=p),r=pr(y,s,O),r!==null&&(cn(r,y,O,x),za(r,y,O)),O}function ul(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Yg(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function Pf(r,s){Yg(r,s),(r=r.alternate)&&Yg(r,s)}function dS(){return null}var Kg=typeof reportError=="function"?reportError:function(r){console.error(r)};function If(r){this._internalRoot=r}cl.prototype.render=If.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));ll(r,s,null,null)},cl.prototype.unmount=If.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Kr(function(){ll(null,r,null,null)}),s[zn]=null}};function cl(r){this._internalRoot=r}cl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ip();r={blockedOn:null,target:r,priority:s};for(var u=0;u<or.length&&s!==0&&s<or[u].priority;u++);or.splice(u,0,r),u===0&&Lp(r)}};function Af(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function fl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Gg(){}function hS(r,s,u,p,y){if(y){if(typeof p=="function"){var x=p;p=function(){var ie=ul(O);x.call(ie)}}var O=qg(s,p,r,0,null,!1,!1,"",Gg);return r._reactRootContainer=O,r[zn]=O.current,Ks(r.nodeType===8?r.parentNode:r),Kr(),O}for(;y=r.lastChild;)r.removeChild(y);if(typeof p=="function"){var F=p;p=function(){var ie=ul(q);F.call(ie)}}var q=Of(r,0,!1,null,null,!1,!1,"",Gg);return r._reactRootContainer=q,r[zn]=q.current,Ks(r.nodeType===8?r.parentNode:r),Kr(function(){ll(s,q,u,p)}),q}function dl(r,s,u,p,y){var x=u._reactRootContainer;if(x){var O=x;if(typeof y=="function"){var F=y;y=function(){var q=ul(O);F.call(q)}}ll(s,O,r,y)}else O=hS(u,s,r,y,p);return ul(O)}Op=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=jr(s.pendingLanes);u!==0&&(wi(s,u|1),It(s,Ye()),(Le&6)===0&&(Fi=Ye()+500,dr()))}break;case 13:Kr(function(){var p=Wn(r,1);if(p!==null){var y=bt();cn(p,r,1,y)}}),Pf(r,1)}},nc=function(r){if(r.tag===13){var s=Wn(r,134217728);if(s!==null){var u=bt();cn(s,r,134217728,u)}Pf(r,134217728)}},Pp=function(r){if(r.tag===13){var s=vr(r),u=Wn(r,s);if(u!==null){var p=bt();cn(u,r,s,p)}Pf(r,s)}},Ip=function(){return De},Ap=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=Kr;var pS={usingClientEntryPoint:!1,Events:[Qs,Ci,Oa,ea,ta,Sf]},fo={findFiberByHostInstance:Fr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mS={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||dS,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{gi=hl.inject(mS),Dt=hl}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pS,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 fS(r,s,null,u)},At.createRoot=function(r,s){if(!Af(r))throw Error(n(299));var u=!1,p="",y=Kg;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(y=s.onRecoverableError)),s=Of(r,1,!1,null,null,u,!1,p,y),r[zn]=s.current,Ks(r.nodeType===8?r.parentNode:r),new If(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 Kr(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,x="",O=Kg;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),s=qg(s,null,r,1,u??null,y,!1,x,O),r[zn]=s.current,Ks(r),p)for(r=0;r<p.length;r++)u=p[r],y=u._getVersion,y=y(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,y]:s.mutableSourceEagerHydrationData.push(u,y);return new cl(s)},At.render=function(r,s,u){if(!fl(s))throw Error(n(200));return dl(null,r,s,!1,u)},At.unmountComponentAtNode=function(r){if(!fl(r))throw Error(n(40));return r._reactRootContainer?(Kr(function(){dl(null,null,r,!1,function(){r._reactRootContainer=null,r[zn]=null})}),!0):!1},At.unstable_batchedUpdates=Sf,At.unstable_renderSubtreeIntoContainer=function(r,s,u,p){if(!fl(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return dl(r,s,u,!1,p)},At.version="18.3.1-next-f1338f8080-20240426",At}var ry;function Xv(){if(ry)return Rf.exports;ry=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(),Rf.exports=NS(),Rf.exports}var iy;function _S(){if(iy)return pl;iy=1;var e=Xv();return pl.createRoot=e.createRoot,pl.hydrateRoot=e.hydrateRoot,pl}var CS=_S();const TS=hu(CS);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 OS={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 PS(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=PS(e+"",n),o,a=-1,l=i.length;if(arguments.length<2){for(;++a<l;)if((o=(e=i[a]).type)&&(o=IS(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]=sy(n[o],e.name,t);else if(t==null)for(o in n)n[o]=sy(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 IS(e,t){for(var n=0,i=e.length,o;n<i;++n)if((o=e[n]).name===t)return o.value}function sy(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=OS,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 oy={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)),oy.hasOwnProperty(t)?{space:oy[t],local:e}:e}function AS(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 MS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qv(e){var t=mu(e);return(t.local?MS:AS)(t)}function LS(){}function Rh(e){return e==null?LS:function(){return this.querySelector(e)}}function RS(e){typeof e!="function"&&(e=Rh(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=new Array(l),f,h,m=0;m<l;++m)(f=a[m])&&(h=e.call(f,f.__data__,m,a))&&("__data__"in f&&(h.__data__=f.__data__),c[m]=h);return new Wt(i,this._parents)}function DS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jS(){return[]}function Jv(e){return e==null?jS:function(){return this.querySelectorAll(e)}}function $S(e){return function(){return DS(e.apply(this,arguments))}}function zS(e){typeof e=="function"?e=$S(e):e=Jv(e);for(var t=this._groups,n=t.length,i=[],o=[],a=0;a<n;++a)for(var l=t[a],c=l.length,f,h=0;h<c;++h)(f=l[h])&&(i.push(e.call(f,f.__data__,h,l)),o.push(f));return new Wt(i,o)}function Zv(e){return function(){return this.matches(e)}}function ew(e){return function(t){return t.matches(e)}}var FS=Array.prototype.find;function BS(e){return function(){return FS.call(this.children,e)}}function VS(){return this.firstElementChild}function WS(e){return this.select(e==null?VS:BS(typeof e=="function"?e:ew(e)))}var US=Array.prototype.filter;function HS(){return Array.from(this.children)}function qS(e){return function(){return US.call(this.children,e)}}function YS(e){return this.selectAll(e==null?HS:qS(typeof e=="function"?e:ew(e)))}function KS(e){typeof e!="function"&&(e=Zv(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=[],f,h=0;h<l;++h)(f=a[h])&&e.call(f,f.__data__,h,a)&&c.push(f);return new Wt(i,this._parents)}function tw(e){return new Array(e.length)}function GS(){return new Wt(this._enter||this._groups.map(tw),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 XS(e){return function(){return e}}function QS(e,t,n,i,o,a){for(var l=0,c,f=t.length,h=a.length;l<h;++l)(c=t[l])?(c.__data__=a[l],i[l]=c):n[l]=new Gl(e,a[l]);for(;l<f;++l)(c=t[l])&&(o[l]=c)}function JS(e,t,n,i,o,a,l){var c,f,h=new Map,m=t.length,d=a.length,g=new Array(m),v;for(c=0;c<m;++c)(f=t[c])&&(g[c]=v=l.call(f,f.__data__,c,t)+"",h.has(v)?o[c]=f:h.set(v,f));for(c=0;c<d;++c)v=l.call(e,a[c],c,a)+"",(f=h.get(v))?(i[c]=f,f.__data__=a[c],h.delete(v)):n[c]=new Gl(e,a[c]);for(c=0;c<m;++c)(f=t[c])&&h.get(g[c])===f&&(o[c]=f)}function ZS(e){return e.__data__}function eE(e,t){if(!arguments.length)return Array.from(this,ZS);var n=t?JS:QS,i=this._parents,o=this._groups;typeof e!="function"&&(e=XS(e));for(var a=o.length,l=new Array(a),c=new Array(a),f=new Array(a),h=0;h<a;++h){var m=i[h],d=o[h],g=d.length,v=tE(e.call(m,m&&m.__data__,h,i)),k=v.length,w=c[h]=new Array(k),b=l[h]=new Array(k),S=f[h]=new Array(g);n(m,d,w,b,S,v,t);for(var N=0,E=0,C,I;N<k;++N)if(C=w[N]){for(N>=E&&(E=N+1);!(I=b[E])&&++E<k;);C._next=I||null}}return l=new Wt(l,i),l._enter=c,l._exit=f,l}function tE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nE(){return new Wt(this._exit||this._groups.map(tw),this._parents)}function rE(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 iE(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,o=n.length,a=i.length,l=Math.min(o,a),c=new Array(o),f=0;f<l;++f)for(var h=n[f],m=i[f],d=h.length,g=c[f]=new Array(d),v,k=0;k<d;++k)(v=h[k]||m[k])&&(g[k]=v);for(;f<o;++f)c[f]=n[f];return new Wt(c,this._parents)}function sE(){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 oE(e){e||(e=aE);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a){for(var l=n[a],c=l.length,f=o[a]=new Array(c),h,m=0;m<c;++m)(h=l[m])&&(f[m]=h);f.sort(t)}return new Wt(o,this._parents).order()}function aE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uE(){return Array.from(this)}function cE(){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 fE(){let e=0;for(const t of this)++e;return e}function dE(){return!this.node()}function hE(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 pE(e){return function(){this.removeAttribute(e)}}function mE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gE(e,t){return function(){this.setAttribute(e,t)}}function yE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function vE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wE(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 xE(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?mE:pE:typeof t=="function"?n.local?wE:vE:n.local?yE:gE)(n,t))}function nw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bE(e){return function(){this.style.removeProperty(e)}}function kE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function SE(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function EE(e,t,n){return arguments.length>1?this.each((t==null?bE:typeof t=="function"?SE:kE)(e,t,n??"")):ss(this.node(),e)}function ss(e,t){return e.style.getPropertyValue(t)||nw(e).getComputedStyle(e,null).getPropertyValue(t)}function NE(e){return function(){delete this[e]}}function _E(e,t){return function(){this[e]=t}}function CE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function TE(e,t){return arguments.length>1?this.each((t==null?NE:typeof t=="function"?CE:_E)(e,t)):this.node()[e]}function rw(e){return e.trim().split(/^|\s+/)}function Dh(e){return e.classList||new iw(e)}function iw(e){this._node=e,this._names=rw(e.getAttribute("class")||"")}iw.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 sw(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function ow(e,t){for(var n=Dh(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function OE(e){return function(){sw(this,e)}}function PE(e){return function(){ow(this,e)}}function IE(e,t){return function(){(t.apply(this,arguments)?sw:ow)(this,e)}}function AE(e,t){var n=rw(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"?IE:t?OE:PE)(n,t))}function ME(){this.textContent=""}function LE(e){return function(){this.textContent=e}}function RE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function DE(e){return arguments.length?this.each(e==null?ME:(typeof e=="function"?RE:LE)(e)):this.node().textContent}function jE(){this.innerHTML=""}function $E(e){return function(){this.innerHTML=e}}function zE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FE(e){return arguments.length?this.each(e==null?jE:(typeof e=="function"?zE:$E)(e)):this.node().innerHTML}function BE(){this.nextSibling&&this.parentNode.appendChild(this)}function VE(){return this.each(BE)}function WE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UE(){return this.each(WE)}function HE(e){var t=typeof e=="function"?e:Qv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qE(){return null}function YE(e,t){var n=typeof e=="function"?e:Qv(e),i=t==null?qE:typeof t=="function"?t:Rh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function KE(){var e=this.parentNode;e&&e.removeChild(this)}function GE(){return this.each(KE)}function XE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function JE(e){return this.select(e?QE:XE)}function ZE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function eN(e){return function(t){e.call(this,t,this.__data__)}}function tN(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 nN(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 rN(e,t,n){return function(){var i=this.__on,o,a=eN(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 iN(e,t,n){var i=tN(e+""),o,a=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,h=c.length,m;f<h;++f)for(o=0,m=c[f];o<a;++o)if((l=i[o]).type===m.type&&l.name===m.name)return m.value}return}for(c=t?rN:nN,o=0;o<a;++o)this.each(c(i[o],t,n));return this}function aw(e,t,n){var i=nw(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 sN(e,t){return function(){return aw(this,e,t)}}function oN(e,t){return function(){return aw(this,e,t.apply(this,arguments))}}function aN(e,t){return this.each((typeof t=="function"?oN:sN)(e,t))}function*lN(){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 lw=[null];function Wt(e,t){this._groups=e,this._parents=t}function Bo(){return new Wt([[document.documentElement]],lw)}function uN(){return this}Wt.prototype=Bo.prototype={constructor:Wt,select:RS,selectAll:zS,selectChild:WS,selectChildren:YS,filter:KS,data:eE,enter:GS,exit:nE,join:rE,merge:iE,selection:uN,order:sE,sort:oE,call:lE,nodes:uE,node:cE,size:fE,empty:dE,each:hE,attr:xE,style:EE,property:TE,classed:AE,text:DE,html:FE,raise:VE,lower:UE,append:HE,insert:YE,remove:GE,clone:JE,datum:ZE,on:iN,dispatch:aN,[Symbol.iterator]:lN};function Vt(e){return typeof e=="string"?new Wt([[document.querySelector(e)]],[document.documentElement]):new Wt([[e]],lw)}function cN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dn(e,t){if(e=cN(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 fN={passive:!1},Oo={capture:!0,passive:!1};function $f(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function uw(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 cw(e,t){var n=e.document.documentElement,i=Vt(e).on("dragstart.drag",null);t&&(i.on("click.drag",es,Oo),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ml=e=>()=>e;function uh(e,{sourceEvent:t,subject:n,target:i,identifier:o,active:a,x:l,y:c,dx:f,dy:h,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:m}})}uh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dN(e){return!e.ctrlKey&&!e.button}function hN(){return this.parentNode}function pN(e,t){return t??{x:e.x,y:e.y}}function mN(){return navigator.maxTouchPoints||"ontouchstart"in this}function fw(){var e=dN,t=hN,n=pN,i=mN,o={},a=pu("start","drag","end"),l=0,c,f,h,m,d=0;function g(C){C.on("mousedown.drag",v).filter(i).on("touchstart.drag",b).on("touchmove.drag",S,fN).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,I){if(!(m||!e.call(this,C,I))){var M=E(this,t.call(this,C,I),C,I,"mouse");M&&(Vt(C.view).on("mousemove.drag",k,Oo).on("mouseup.drag",w,Oo),uw(C.view),$f(C),h=!1,c=C.clientX,f=C.clientY,M("start",C))}}function k(C){if(es(C),!h){var I=C.clientX-c,M=C.clientY-f;h=I*I+M*M>d}o.mouse("drag",C)}function w(C){Vt(C.view).on("mousemove.drag mouseup.drag",null),cw(C.view,h),es(C),o.mouse("end",C)}function b(C,I){if(e.call(this,C,I)){var M=C.changedTouches,L=t.call(this,C,I),T=M.length,A,z;for(A=0;A<T;++A)(z=E(this,L,C,I,M[A].identifier,M[A]))&&($f(C),z("start",C,M[A]))}}function S(C){var I=C.changedTouches,M=I.length,L,T;for(L=0;L<M;++L)(T=o[I[L].identifier])&&(es(C),T("drag",C,I[L]))}function N(C){var I=C.changedTouches,M=I.length,L,T;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),L=0;L<M;++L)(T=o[I[L].identifier])&&($f(C),T("end",C,I[L]))}function E(C,I,M,L,T,A){var z=a.copy(),R=dn(A||M,I),$,Z,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}),L))!=null)return $=j.x-R[0]||0,Z=j.y-R[1]||0,function G(Y,J,B){var H=R,V;switch(Y){case"start":o[T]=G,V=l++;break;case"end":delete o[T],--l;case"drag":R=dn(B||J,I),V=l;break}z.call(Y,C,new uh(Y,{sourceEvent:J,subject:j,target:g,identifier:T,active:V,x:R[0]+$,y:R[1]+Z,dx:R[0]-H[0],dy:R[1]-H[1],dispatch:z}),L)}}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?(d=(C=+C)*C,g):Math.sqrt(d)},g}function jh(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function dw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Vo(){}var Po=.7,Xl=1/Po,ts="\\s*([+-]?\\d+)\\s*",Io="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gN=/^#([0-9a-f]{3,8})$/,yN=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),vN=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),wN=new RegExp(`^rgba\\(${ts},${ts},${ts},${Io}\\)$`),xN=new RegExp(`^rgba\\(${An},${An},${An},${Io}\\)$`),bN=new RegExp(`^hsl\\(${Io},${An},${An}\\)$`),kN=new RegExp(`^hsla\\(${Io},${An},${An},${Io}\\)$`),ay={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};jh(Vo,oi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ly,formatHex:ly,formatHex8:SN,formatHsl:EN,formatRgb:uy,toString:uy});function ly(){return this.rgb().formatHex()}function SN(){return this.rgb().formatHex8()}function EN(){return hw(this).formatHsl()}function uy(){return this.rgb().formatRgb()}function oi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cy(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=yN.exec(e))?new Mt(t[1],t[2],t[3],1):(t=vN.exec(e))?new Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wN.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=xN.exec(e))?gl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bN.exec(e))?hy(t[1],t[2]/100,t[3]/100,1):(t=kN.exec(e))?hy(t[1],t[2]/100,t[3]/100,t[4]):ay.hasOwnProperty(e)?cy(ay[e]):e==="transparent"?new Mt(NaN,NaN,NaN,0):null}function cy(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 NN(e){return e instanceof Vo||(e=oi(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?NN(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}jh(Mt,ch,dw(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?Po:Math.pow(Po,e),new Mt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mt(ii(this.r),ii(this.g),ii(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:fy,formatHex:fy,formatHex8:_N,formatRgb:dy,toString:dy}));function fy(){return`#${ti(this.r)}${ti(this.g)}${ti(this.b)}`}function _N(){return`#${ti(this.r)}${ti(this.g)}${ti(this.b)}${ti((isNaN(this.opacity)?1:this.opacity)*255)}`}function dy(){const e=Ql(this.opacity);return`${e===1?"rgb(":"rgba("}${ii(this.r)}, ${ii(this.g)}, ${ii(this.b)}${e===1?")":`, ${e})`}`}function Ql(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ii(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ti(e){return e=ii(e),(e<16?"0":"")+e.toString(16)}function hy(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 hw(e){if(e instanceof hn)return new hn(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=oi(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 CN(e,t,n,i){return arguments.length===1?hw(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}jh(hn,CN,dw(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?Po:Math.pow(Po,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(py(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("}${py(this.h)}, ${yl(this.s)*100}%, ${yl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function py(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 $h=e=>()=>e;function TN(e,t){return function(n){return e+n*t}}function ON(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 PN(e){return(e=+e)==1?pw:function(t,n){return n-t?ON(t,n,e):$h(isNaN(t)?n:t)}}function pw(e,t){var n=t-e;return n?TN(e,n):$h(isNaN(e)?t:e)}const Jl=(function e(t){var n=PN(t);function i(o,a){var l=n((o=ch(o)).r,(a=ch(a)).r),c=n(o.g,a.g),f=n(o.b,a.b),h=pw(o.opacity,a.opacity);return function(m){return o.r=l(m),o.g=c(m),o.b=f(m),o.opacity=h(m),o+""}}return i.gamma=e,i})(1);function IN(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 AN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MN(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 LN(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 RN(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 DN(e){return function(){return e}}function jN(e){return function(t){return e(t)+""}}function mw(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]?jN(f[0].x):DN(t):(t=f.length,function(h){for(var m=0,d;m<t;++m)c[(d=f[m]).i]=d.x(h);return c.join("")})}function No(e,t){var n=typeof t,i;return t==null||n==="boolean"?$h(t):(n==="number"?Pn:n==="string"?(i=oi(t))?(t=i,Jl):mw:t instanceof oi?Jl:t instanceof Date?LN:AN(t)?IN:Array.isArray(t)?MN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RN:Pn)(e,t)}var my=180/Math.PI,dh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gw(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)*my,skewX:Math.atan(f)*my,scaleX:l,scaleY:c}}var vl;function $N(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?dh:gw(t.a,t.b,t.c,t.d,t.e,t.f)}function zN(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,gw(e.a,e.b,e.c,e.d,e.e,e.f))}function yw(e,t,n,i){function o(h){return h.length?h.pop()+" ":""}function a(h,m,d,g,v,k){if(h!==d||m!==g){var w=v.push("translate(",null,t,null,n);k.push({i:w-4,x:Pn(h,d)},{i:w-2,x:Pn(m,g)})}else(d||g)&&v.push("translate("+d+t+g+n)}function l(h,m,d,g){h!==m?(h-m>180?m+=360:m-h>180&&(h+=360),g.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Pn(h,m)})):m&&d.push(o(d)+"rotate("+m+i)}function c(h,m,d,g){h!==m?g.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Pn(h,m)}):m&&d.push(o(d)+"skewX("+m+i)}function f(h,m,d,g,v,k){if(h!==d||m!==g){var w=v.push(o(v)+"scale(",null,",",null,")");k.push({i:w-4,x:Pn(h,d)},{i:w-2,x:Pn(m,g)})}else(d!==1||g!==1)&&v.push(o(v)+"scale("+d+","+g+")")}return function(h,m){var d=[],g=[];return h=e(h),m=e(m),a(h.translateX,h.translateY,m.translateX,m.translateY,d,g),l(h.rotate,m.rotate,d,g),c(h.skewX,m.skewX,d,g),f(h.scaleX,h.scaleY,m.scaleX,m.scaleY,d,g),h=m=null,function(v){for(var k=-1,w=g.length,b;++k<w;)d[(b=g[k]).i]=b.x(v);return d.join("")}}}var FN=yw($N,"px, ","px)","deg)"),BN=yw(zN,", ",")",")"),VN=1e-12;function gy(e){return((e=Math.exp(e))+1/e)/2}function WN(e){return((e=Math.exp(e))-1/e)/2}function UN(e){return((e=Math.exp(2*e))-1)/(e+1)}const Fl=(function e(t,n,i){function o(a,l){var c=a[0],f=a[1],h=a[2],m=l[0],d=l[1],g=l[2],v=m-c,k=d-f,w=v*v+k*k,b,S;if(w<VN)S=Math.log(g/h)/t,b=function(L){return[c+L*v,f+L*k,h*Math.exp(t*L*S)]};else{var N=Math.sqrt(w),E=(g*g-h*h+i*w)/(2*h*n*N),C=(g*g-h*h-i*w)/(2*g*n*N),I=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(C*C+1)-C);S=(M-I)/t,b=function(L){var T=L*S,A=gy(I),z=h/(n*N)*(A*UN(t*T+I)-WN(I));return[c+z*v,f+z*k,h*A/gy(t*T+I)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return o.rho=function(a){var l=Math.max(.001,+a),c=l*l,f=c*c;return e(l,c,f)},o})(Math.SQRT2,2,4);var os=0,wo=0,po=0,vw=1e3,Zl,xo,eu=0,ai=0,gu=0,Ao=typeof performance=="object"&&performance.now?performance:Date,ww=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zh(){return ai||(ww(HN),ai=Ao.now()+gu)}function HN(){ai=0}function tu(){this._call=this._time=this._next=null}tu.prototype=xw.prototype={constructor:tu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?zh():+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 xw(e,t,n){var i=new tu;return i.restart(e,t,n),i}function qN(){zh(),++os;for(var e=Zl,t;e;)(t=ai-e._time)>=0&&e._call.call(void 0,t),e=e._next;--os}function yy(){ai=(eu=Ao.now())+gu,os=wo=0;try{qN()}finally{os=0,KN(),ai=0}}function YN(){var e=Ao.now(),t=e-eu;t>vw&&(gu-=t,eu=e)}function KN(){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-ai;t>24?(e<1/0&&(wo=setTimeout(yy,e-Ao.now()-gu)),po&&(po=clearInterval(po))):(po||(eu=Ao.now(),po=setInterval(YN,vw)),os=1,ww(yy))}}function vy(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 GN=pu("start","end","cancel","interrupt"),XN=[],bw=0,wy=1,ph=2,Bl=3,xy=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;QN(e,n,{name:t,index:i,group:o,on:GN,tween:XN,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:bw})}function Fh(e,t){var n=vn(e,t);if(n.state>bw)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 QN(e,t,n){var i=e.__transition,o;i[t]=n,n.timer=xw(a,0,n.time);function a(h){n.state=wy,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var m,d,g,v;if(n.state!==wy)return f();for(m in i)if(v=i[m],v.name===n.name){if(v.state===Bl)return vy(l);v.state===xy?(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(vy(function(){n.state===Bl&&(n.state=xy,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=ph,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ph){for(n.state=Bl,o=new Array(g=n.tween.length),m=0,d=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=v);o.length=d+1}}function c(h){for(var m=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=mh,1),d=-1,g=o.length;++d<g;)o[d].call(e,m);n.state===mh&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=Vl,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function Wl(e,t){var n=e.__transition,i,o,a=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((i=n[l]).name!==t){a=!1;continue}o=i.state>ph&&i.state<mh,i.state=Vl,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[l]}a&&delete e.__transition}}function JN(e){return this.each(function(){Wl(this,e)})}function ZN(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 e_(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,h=o.length;f<h;++f)if(o[f].name===t){o[f]=c;break}f===h&&o.push(c)}a.tween=o}}function t_(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?ZN:e_)(n,e,t))}function Bh(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 kw(e,t){var n;return(typeof t=="number"?Pn:t instanceof oi?Jl:(n=oi(t))?(t=n,Jl):mw)(e,t)}function n_(e){return function(){this.removeAttribute(e)}}function r_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function i_(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 s_(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 o_(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 a_(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 l_(e,t){var n=mu(e),i=n==="transform"?BN:kw;return this.attrTween(e,typeof t=="function"?(n.local?a_:o_)(n,i,Bh(this,"attr."+e,t)):t==null?(n.local?r_:n_)(n):(n.local?s_:i_)(n,i,t))}function u_(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function c_(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function f_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&c_(e,a)),n}return o._value=t,o}function d_(e,t){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&u_(e,a)),n}return o._value=t,o}function h_(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?f_:d_)(i,t))}function p_(e,t){return function(){Fh(this,e).delay=+t.apply(this,arguments)}}function m_(e,t){return t=+t,function(){Fh(this,e).delay=t}}function g_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p_:m_)(t,e)):vn(this.node(),t).delay}function y_(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function v_(e,t){return t=+t,function(){Ln(this,e).duration=t}}function w_(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y_:v_)(t,e)):vn(this.node(),t).duration}function x_(e,t){if(typeof t!="function")throw new Error;return function(){Ln(this,e).ease=t}}function b_(e){var t=this._id;return arguments.length?this.each(x_(t,e)):vn(this.node(),t).ease}function k_(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ln(this,e).ease=n}}function S_(e){if(typeof e!="function")throw new Error;return this.each(k_(this._id,e))}function E_(e){typeof e!="function"&&(e=Zv(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a=t[o],l=a.length,c=i[o]=[],f,h=0;h<l;++h)(f=a[h])&&e.call(f,f.__data__,h,a)&&c.push(f);return new Zn(i,this._parents,this._name,this._id)}function N_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,o=n.length,a=Math.min(i,o),l=new Array(i),c=0;c<a;++c)for(var f=t[c],h=n[c],m=f.length,d=l[c]=new Array(m),g,v=0;v<m;++v)(g=f[v]||h[v])&&(d[v]=g);for(;c<i;++c)l[c]=t[c];return new Zn(l,this._parents,this._name,this._id)}function __(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 C_(e,t,n){var i,o,a=__(t)?Fh:Ln;return function(){var l=a(this,e),c=l.on;c!==i&&(o=(i=c).copy()).on(t,n),l.on=o}}function T_(e,t){var n=this._id;return arguments.length<2?vn(this.node(),n).on.on(e):this.each(C_(n,e,t))}function O_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function P_(){return this.on("end.remove",O_(this._id))}function I_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rh(e));for(var i=this._groups,o=i.length,a=new Array(o),l=0;l<o;++l)for(var c=i[l],f=c.length,h=a[l]=new Array(f),m,d,g=0;g<f;++g)(m=c[g])&&(d=e.call(m,m.__data__,g,c))&&("__data__"in m&&(d.__data__=m.__data__),h[g]=d,yu(h[g],t,n,g,h,vn(m,n)));return new Zn(a,this._parents,t,n)}function A_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jv(e));for(var i=this._groups,o=i.length,a=[],l=[],c=0;c<o;++c)for(var f=i[c],h=f.length,m,d=0;d<h;++d)if(m=f[d]){for(var g=e.call(m,m.__data__,d,f),v,k=vn(m,n),w=0,b=g.length;w<b;++w)(v=g[w])&&yu(v,t,n,w,g,k);a.push(g),l.push(m)}return new Zn(a,l,t,n)}var M_=Bo.prototype.constructor;function L_(){return new M_(this._groups,this._parents)}function R_(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 Sw(e){return function(){this.style.removeProperty(e)}}function D_(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 j_(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 $_(e,t){var n,i,o,a="style."+t,l="end."+a,c;return function(){var f=Ln(this,e),h=f.on,m=f.value[a]==null?c||(c=Sw(t)):void 0;(h!==n||o!==m)&&(i=(n=h).copy()).on(l,o=m),f.on=i}}function z_(e,t,n){var i=(e+="")=="transform"?FN:kw;return t==null?this.styleTween(e,R_(e,i)).on("end.style."+e,Sw(e)):typeof t=="function"?this.styleTween(e,j_(e,i,Bh(this,"style."+e,t))).each($_(this._id,e)):this.styleTween(e,D_(e,i,t),n).on("end.style."+e,null)}function F_(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function B_(e,t,n){var i,o;function a(){var l=t.apply(this,arguments);return l!==o&&(i=(o=l)&&F_(e,l,n)),i}return a._value=t,a}function V_(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,B_(e,t,n??""))}function W_(e){return function(){this.textContent=e}}function U_(e){return function(){var t=e(this);this.textContent=t??""}}function H_(e){return this.tween("text",typeof e=="function"?U_(Bh(this,"text",e)):W_(e==null?"":e+""))}function q_(e){return function(t){this.textContent=e.call(this,t)}}function Y_(e){var t,n;function i(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&q_(o)),t}return i._value=e,i}function K_(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,Y_(e))}function G_(){for(var e=this._name,t=this._id,n=Ew(),i=this._groups,o=i.length,a=0;a<o;++a)for(var l=i[a],c=l.length,f,h=0;h<c;++h)if(f=l[h]){var m=vn(f,t);yu(f,e,n,h,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Zn(i,this._parents,e,n)}function X_(){var e,t,n=this,i=n._id,o=n.size();return new Promise(function(a,l){var c={value:l},f={value:function(){--o===0&&a()}};n.each(function(){var h=Ln(this,i),m=h.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),h.on=t}),o===0&&a()})}var Q_=0;function Zn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Ew(){return++Q_}var Yn=Bo.prototype;Zn.prototype={constructor:Zn,select:I_,selectAll:A_,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:E_,merge:N_,selection:L_,transition:G_,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:T_,attr:l_,attrTween:h_,style:z_,styleTween:V_,text:H_,textTween:K_,remove:P_,tween:t_,delay:g_,duration:w_,ease:b_,easeVarying:S_,end:X_,[Symbol.iterator]:Yn[Symbol.iterator]};function J_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Z_={time:null,delay:0,duration:250,ease:J_};function eC(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 tC(e){var t,n;e instanceof Zn?(t=e._id,e=e._name):(t=Ew(),(n=Z_).time=zh(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var l=i[a],c=l.length,f,h=0;h<c;++h)(f=l[h])&&yu(f,e,t,h,l,n||eC(f,t));return new Zn(i,this._parents,e,t)}Bo.prototype.interrupt=JN;Bo.prototype.transition=tC;const wl=e=>()=>e;function nC(e,{sourceEvent:t,target:n,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Gn(e,t,n){this.k=e,this.x=t,this.y=n}Gn.prototype={constructor:Gn,scale:function(e){return e===1?this:new Gn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var vu=new Gn(1,0,0);Nw.prototype=Gn.prototype;function Nw(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 rC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function iC(){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 by(){return this.__zoom||vu}function sC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function oC(){return navigator.maxTouchPoints||"ontouchstart"in this}function aC(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 _w(){var e=rC,t=iC,n=aC,i=sC,o=oC,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=Fl,h=pu("start","zoom","end"),m,d,g,v=500,k=150,w=0,b=10;function S(j){j.property("__zoom",by).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",z).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(j,G,Y,J){var B=j.selection?j.selection():j;B.property("__zoom",by),j!==B?I(j,G,Y,J):B.interrupt().each(function(){M(this,arguments).event(J).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},S.scaleBy=function(j,G,Y,J){S.scaleTo(j,function(){var B=this.__zoom.k,H=typeof G=="function"?G.apply(this,arguments):G;return B*H},Y,J)},S.scaleTo=function(j,G,Y,J){S.transform(j,function(){var B=t.apply(this,arguments),H=this.__zoom,V=Y==null?C(B):typeof Y=="function"?Y.apply(this,arguments):Y,D=H.invert(V),U=typeof G=="function"?G.apply(this,arguments):G;return n(E(N(H,U),V,D),B,l)},Y,J)},S.translateBy=function(j,G,Y,J){S.transform(j,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),l)},null,J)},S.translateTo=function(j,G,Y,J,B){S.transform(j,function(){var H=t.apply(this,arguments),V=this.__zoom,D=J==null?C(H):typeof J=="function"?J.apply(this,arguments):J;return n(vu.translate(D[0],D[1]).scale(V.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof Y=="function"?-Y.apply(this,arguments):-Y),H,l)},J,B)};function N(j,G){return G=Math.max(a[0],Math.min(a[1],G)),G===j.k?j:new Gn(G,j.x,j.y)}function E(j,G,Y){var J=G[0]-Y[0]*j.k,B=G[1]-Y[1]*j.k;return J===j.x&&B===j.y?j:new Gn(j.k,J,B)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function I(j,G,Y,J){j.on("start.zoom",function(){M(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(J).end()}).tween("zoom",function(){var B=this,H=arguments,V=M(B,H).event(J),D=t.apply(B,H),U=Y==null?C(D):typeof Y=="function"?Y.apply(B,H):Y,W=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),K=B.__zoom,Q=typeof G=="function"?G.apply(B,H):G,re=f(K.invert(U).concat(W/K.k),Q.invert(U).concat(W/Q.k));return function(oe){if(oe===1)oe=Q;else{var ee=re(oe),se=W/ee[2];oe=new Gn(se,U[0]-ee[0]*se,U[1]-ee[1]*se)}V.zoom(null,oe)}})}function M(j,G,Y){return!Y&&j.__zooming||new L(j,G)}function L(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,G),this.taps=0}L.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,G){return this.mouse&&j!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var G=Vt(this.that).datum();h.call(j,this.that,new nC(j,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:h}),G)}};function T(j,...G){if(!e.apply(this,arguments))return;var Y=M(this,G).event(j),J=this.__zoom,B=Math.max(a[0],Math.min(a[1],J.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]=J.invert(Y.mouse[0]=H)),clearTimeout(Y.wheel);else{if(J.k===B)return;Y.mouse=[H,J.invert(H)],Wl(this),Y.start()}mo(j),Y.wheel=setTimeout(V,k),Y.zoom("mouse",n(E(N(J,B),Y.mouse[0],Y.mouse[1]),Y.extent,l));function V(){Y.wheel=null,Y.end()}}function A(j,...G){if(g||!e.apply(this,arguments))return;var Y=j.currentTarget,J=M(this,G,!0).event(j),B=Vt(j.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",W,!0),H=dn(j,Y),V=j.clientX,D=j.clientY;uw(j.view),Bf(j),J.mouse=[H,this.__zoom.invert(H)],Wl(this),J.start();function U(K){if(mo(K),!J.moved){var Q=K.clientX-V,re=K.clientY-D;J.moved=Q*Q+re*re>w}J.event(K).zoom("mouse",n(E(J.that.__zoom,J.mouse[0]=dn(K,Y),J.mouse[1]),J.extent,l))}function W(K){B.on("mousemove.zoom mouseup.zoom",null),cw(K.view,J.moved),mo(K),J.event(K).end()}}function z(j,...G){if(e.apply(this,arguments)){var Y=this.__zoom,J=dn(j.changedTouches?j.changedTouches[0]:j,this),B=Y.invert(J),H=Y.k*(j.shiftKey?.5:2),V=n(E(N(Y,H),J,B),t.apply(this,G),l);mo(j),c>0?Vt(this).transition().duration(c).call(I,V,J,j):Vt(this).call(S.transform,V,J,j)}}function R(j,...G){if(e.apply(this,arguments)){var Y=j.touches,J=Y.length,B=M(this,G,j.changedTouches.length===J).event(j),H,V,D,U;for(Bf(j),V=0;V<J;++V)D=Y[V],U=dn(D,this),U=[U,this.__zoom.invert(U),D.identifier],B.touch0?!B.touch1&&B.touch0[2]!==U[2]&&(B.touch1=U,B.taps=0):(B.touch0=U,H=!0,B.taps=1+!!m);m&&(m=clearTimeout(m)),H&&(B.taps<2&&(d=U[0],m=setTimeout(function(){m=null},v)),Wl(this),B.start())}}function $(j,...G){if(this.__zooming){var Y=M(this,G).event(j),J=j.changedTouches,B=J.length,H,V,D,U;for(mo(j),H=0;H<B;++H)V=J[H],D=dn(V,this),Y.touch0&&Y.touch0[2]===V.identifier?Y.touch0[0]=D:Y.touch1&&Y.touch1[2]===V.identifier&&(Y.touch1[0]=D);if(V=Y.that.__zoom,Y.touch1){var W=Y.touch0[0],K=Y.touch0[1],Q=Y.touch1[0],re=Y.touch1[1],oe=(oe=Q[0]-W[0])*oe+(oe=Q[1]-W[1])*oe,ee=(ee=re[0]-K[0])*ee+(ee=re[1]-K[1])*ee;V=N(V,Math.sqrt(oe/ee)),D=[(W[0]+Q[0])/2,(W[1]+Q[1])/2],U=[(K[0]+re[0])/2,(K[1]+re[1])/2]}else if(Y.touch0)D=Y.touch0[0],U=Y.touch0[1];else return;Y.zoom("touch",n(E(V,D,U),Y.extent,l))}}function Z(j,...G){if(this.__zooming){var Y=M(this,G).event(j),J=j.changedTouches,B=J.length,H,V;for(Bf(j),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),H=0;H<B;++H)V=J[H],Y.touch0&&Y.touch0[2]===V.identifier?delete Y.touch0:Y.touch1&&Y.touch1[2]===V.identifier&&delete Y.touch1;if(Y.touch1&&!Y.touch0&&(Y.touch0=Y.touch1,delete Y.touch1),Y.touch0)Y.touch0[1]=this.__zoom.invert(Y.touch0[0]);else if(Y.end(),Y.taps===2&&(V=dn(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<b)){var D=Vt(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return S.wheelDelta=function(j){return arguments.length?(i=typeof j=="function"?j:wl(+j),S):i},S.filter=function(j){return arguments.length?(e=typeof j=="function"?j:wl(!!j),S):e},S.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:wl(!!j),S):o},S.extent=function(j){return arguments.length?(t=typeof j=="function"?j:wl([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),S):t},S.scaleExtent=function(j){return arguments.length?(a[0]=+j[0],a[1]=+j[1],S):[a[0],a[1]]},S.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],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(j){return arguments.length?(n=j,S):n},S.duration=function(j){return arguments.length?(c=+j,S):c},S.interpolate=function(j){return arguments.length?(f=j,S):f},S.on=function(){var j=h.on.apply(h,arguments);return j===h?S:j},S.clickDistance=function(j){return arguments.length?(w=(j=+j)*j,S):Math.sqrt(w)},S.tapDistance=function(j){return arguments.length?(b=+j,S):b},S}const gn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Mo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Cw=["Enter"," ","Escape"],Tw={"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 si;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(si||(si={}));var Lo;(function(e){e.Partial="partial",e.Full="full"})(Lo||(Lo={}));const Ow={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 ky={[ke.Left]:ke.Right,[ke.Right]:ke.Left,[ke.Top]:ke.Bottom,[ke.Bottom]:ke.Top};function Pw(e){return e===null?null:e?"valid":"invalid"}const Iw=e=>"id"in e&&"source"in e&&"target"in e,lC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Vh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Wo=(e,t=[0,0])=>{const{width:n,height:i}=er(e),o=e.origin??t,a=n*o[0],l=i*o[1];return{x:e.position.x-a,y:e.position.y-l}},uC=(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):Vh(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}},Wh=(e,t,[n,i,o]=[0,0,1],a=!1,l=!1)=>{const c={...ys(t,[n,i,o]),width:t.width/o,height:t.height/o},f=[];for(const h of e.values()){const{measured:m,selectable:d=!0,hidden:g=!1}=h;if(l&&!d||g)continue;const v=m.width??h.width??h.initialWidth??null,k=m.height??h.height??h.initialHeight??null,w=Ro(c,us(h)),b=(v??0)*(k??0),S=a&&w>0;(!h.internals.handleBounds||S||w>=b||h.dragging)&&f.push(h)}return f},cC=(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 fC(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 dC({nodes:e,width:t,height:n,panZoom:i,minZoom:o,maxZoom:a},l){if(e.size===0)return!0;const c=fC(e,l),f=Uo(c),h=Hh(f,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??a,(l==null?void 0:l.padding)??.1);return await i.setViewport(h,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function Aw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:o,onError:a}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:f,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let d=l.extent||o;if(l.extent==="parent"&&!l.expandParent)if(!c)a==null||a("005",gn.error005());else{const v=c.measured.width,k=c.measured.height;v&&k&&(d=[[f,h],[f+v,h+k]])}else c&&ui(l.extent)&&(d=[[l.extent[0][0]+f,l.extent[0][1]+h],[l.extent[1][0]+f,l.extent[1][1]+h]]);const g=ui(d)?li(t,d,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(a==null||a("015",gn.error015())),{position:{x:g.x-f+(l.measured.width??0)*m[0],y:g.y-h+(l.measured.height??0)*m[1]},positionAbsolute:g}}async function hC({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),k=!v&&g.parentId&&l.find(w=>w.id===g.parentId);(v||k)&&l.push(g)}const c=new Set(t.map(g=>g.id)),f=i.filter(g=>g.deletable!==!1),m=cC(l,f);for(const g of f)c.has(g.id)&&!m.find(k=>k.id===g.id)&&m.push(g);if(!o)return{edges:m,nodes:l};const d=await o({nodes:l,edges:m});return typeof d=="boolean"?d?{edges:m,nodes:l}:{edges:[],nodes:[]}:d}const ls=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),li=(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 Mw(e,t,n){const{width:i,height:o}=er(n),{x:a,y:l}=n.internals.positionAbsolute;return li(e,[[a,l],[a+i,l+o]],t)}const Sy=(e,t,n)=>e<t?ls(Math.abs(e-t),1,t)/t:e>n?-ls(Math.abs(e-n),1,t)/t:0,Uh=(e,t,n=15,i=40)=>{const o=Sy(e.x,i,t.width-i)*n,a=Sy(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}=Vh(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}=Vh(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)}},Lw=(e,t)=>xu(wu(gh(e),gh(t))),Ro=(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)},Ey=e=>pn(e.width)&&pn(e.height)&&pn(e.x)&&pn(e.y),pn=e=>!isNaN(e)&&isFinite(e),Rw=(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 Vi(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 pC(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Vi(e,n),o=Vi(e,t);return{top:i,right:o,bottom:i,left:o,x:o*2,y:i*2}}if(typeof e=="object"){const i=Vi(e.top??e.y??0,n),o=Vi(e.bottom??e.y??0,n),a=Vi(e.left??e.x??0,t),l=Vi(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 mC(e,t,n,i,o,a){const{x:l,y:c}=cs(e,[t,n,i]),{x:f,y:h}=cs({x:e.x+e.width,y:e.y+e.height},[t,n,i]),m=o-f,d=a-h;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(d)}}const Hh=(e,t,n,i,o,a)=>{const l=pC(a,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,h=Math.min(c,f),m=ls(h,i,o),d=e.x+e.width/2,g=e.y+e.height/2,v=t/2-d*m,k=n/2-g*m,w=mC(e,v,k,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:k-b.top+b.bottom,zoom:m}},Do=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ui(e){return e!=null&&e!=="parent"}function er(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Dw(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 jw(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 Ny(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gC(){let e,t;return{promise:new Promise((i,o)=>{e=i,t=o}),resolve:e,reject:t}}function yC(e){return{...Tw,...e||{}}}function _o(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:o}){const{x:a,y:l}=mn(e),c=ys({x:a-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},i),{x:f,y:h}=n?Ho(c,t):c;return{xSnapped:f,ySnapped:h,...c}}const qh=e=>({width:e.offsetWidth,height:e.offsetHeight}),$w=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},vC=["INPUT","SELECT","TEXTAREA"];function zw(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:vC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Fw=e=>"clientX"in e,mn=(e,t)=>{var a,l;const n=Fw(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)}},_y=(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,...qh(l)}})};function Bw({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:o,sourceControlY:a,targetControlX:l,targetControlY:c}){const f=e*.125+o*.375+l*.375+n*.125,h=t*.125+a*.375+c*.375+i*.125,m=Math.abs(f-e),d=Math.abs(h-t);return[f,h,m,d]}function xl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Cy({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 Vw({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top,curvature:l=.25}){const[c,f]=Cy({pos:n,x1:e,y1:t,x2:i,y2:o,c:l}),[h,m]=Cy({pos:a,x1:i,y1:o,x2:e,y2:t,c:l}),[d,g,v,k]=Bw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:m});return[`M${e},${t} C${c},${f} ${h},${m} ${i},${o}`,d,g,v,k]}function Ww({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 wC({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 xC({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 Ro(l,xu(a))>0}const bC=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,kC=(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)),SC=(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||bC;let o;return Iw(e)?o={...e}:o={...e,id:i(e)},kC(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Uw({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[o,a,l,c]=Ww({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,o,a,l,c]}const Ty={[ke.Left]:{x:-1,y:0},[ke.Right]:{x:1,y:0},[ke.Top]:{x:0,y:-1},[ke.Bottom]:{x:0,y:1}},EC=({source:e,sourcePosition:t=ke.Bottom,target:n})=>t===ke.Left||t===ke.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Oy=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function NC({source:e,sourcePosition:t=ke.Bottom,target:n,targetPosition:i=ke.Top,center:o,offset:a,stepPosition:l}){const c=Ty[t],f=Ty[i],h={x:e.x+c.x*a,y:e.y+c.y*a},m={x:n.x+f.x*a,y:n.y+f.y*a},d=EC({source:h,sourcePosition:t,target:m}),g=d.x!==0?"x":"y",v=d[g];let k=[],w,b;const S={x:0,y:0},N={x:0,y:0},[,,E,C]=Ww({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*f[g]===-1){g==="x"?(w=o.x??h.x+(m.x-h.x)*l,b=o.y??(h.y+m.y)/2):(w=o.x??(h.x+m.x)/2,b=o.y??h.y+(m.y-h.y)*l);const T=[{x:w,y:h.y},{x:w,y:m.y}],A=[{x:h.x,y:b},{x:m.x,y:b}];c[g]===v?k=g==="x"?T:A:k=g==="x"?A:T}else{const T=[{x:h.x,y:m.y}],A=[{x:m.x,y:h.y}];if(g==="x"?k=c.x===v?A:T:k=c.y===v?T:A,t===i){const j=Math.abs(e[g]-n[g]);if(j<=a){const G=Math.min(a-1,a-j);c[g]===v?S[g]=(h[g]>e[g]?-1:1)*G:N[g]=(m[g]>n[g]?-1:1)*G}}if(t!==i){const j=g==="x"?"y":"x",G=c[g]===f[j],Y=h[j]>m[j],J=h[j]<m[j];(c[g]===1&&(!G&&Y||G&&J)||c[g]!==1&&(!G&&J||G&&Y))&&(k=g==="x"?T:A)}const z={x:h.x+S.x,y:h.y+S.y},R={x:m.x+N.x,y:m.y+N.y},$=Math.max(Math.abs(z.x-k[0].x),Math.abs(R.x-k[0].x)),Z=Math.max(Math.abs(z.y-k[0].y),Math.abs(R.y-k[0].y));$>=Z?(w=(z.x+R.x)/2,b=k[0].y):(w=k[0].x,b=(z.y+R.y)/2)}const I={x:h.x+S.x,y:h.y+S.y},M={x:m.x+N.x,y:m.y+N.y};return[[e,...I.x!==k[0].x||I.y!==k[0].y?[I]:[],...k,...M.x!==k[k.length-1].x||M.y!==k[k.length-1].y?[M]:[],n],w,b,E,C]}function _C(e,t,n,i){const o=Math.min(Oy(e,t)/2,Oy(t,n)/2,i),{x:a,y:l}=t;if(e.x===a&&a===n.x||e.y===l&&l===n.y)return`L${a} ${l}`;if(e.y===l){const h=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${a+o*h},${l}Q ${a},${l} ${a},${l+o*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${a},${l+o*f}Q ${a},${l} ${a+o*c},${l}`}function yh({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top,borderRadius:l=5,centerX:c,centerY:f,offset:h=20,stepPosition:m=.5}){const[d,g,v,k,w]=NC({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:o},targetPosition:a,center:{x:c,y:f},offset:h,stepPosition:m});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=_C(d[S-1],d[S],d[S+1],l);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,g,v,k,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 CC(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Py(t)||!Py(n))return null;const i=t.internals.handleBounds||Iy(t.handles),o=n.internals.handleBounds||Iy(n.handles),a=Ay((i==null?void 0:i.source)??[],e.sourceHandle),l=Ay(e.connectionMode===as.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!l)return(d=e.onError)==null||d.call(e,"008",gn.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(a==null?void 0:a.position)||ke.Bottom,f=(l==null?void 0:l.position)||ke.Top,h=ci(t,a,c),m=ci(n,l,f);return{sourceX:h.x,sourceY:h.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function Iy(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 ci(e,t,n=ke.Left,i=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??er(e);if(i)return{x:o+l/2,y:a+c/2};switch((t==null?void 0:t.position)??n){case ke.Top:return{x:o+l/2,y:a};case ke.Right:return{x:o+l,y:a+c/2};case ke.Bottom:return{x:o+l/2,y:a+c};case ke.Left:return{x:o,y:a+c/2}}}function Ay(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 TC(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:o}){const a=new Set;return e.reduce((l,c)=>([c.markerStart||i,c.markerEnd||o].forEach(f=>{if(f&&typeof f=="object"){const h=vh(f,t);a.has(h)||(l.push({id:h,color:f.color||n,...f}),a.add(h))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Hw=1e3,OC=10,Yh={nodeOrigin:[0,0],nodeExtent:Mo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},PC={...Yh,checkEquality:!0};function Kh(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function IC(e,t,n){const i=Kh(Yh,n);for(const o of e.values())if(o.parentId)Xh(o,e,t,i);else{const a=Wo(o,i.nodeOrigin),l=ui(o.extent)?o.extent:i.nodeExtent,c=li(a,l,er(o));o.internals.positionAbsolute=c}}function AC(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 Gh(e){return e==="manual"}function wh(e,t,n,i={}){var m,d;const o=Kh(PC,i),a={i:0},l=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!Gh(o.zIndexMode)?Hw:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const g of e){let v=l.get(g.id);if(o.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const k=Wo(g,o.nodeOrigin),w=ui(g.extent)?g.extent:o.nodeExtent,b=li(k,w,er(g));v={...o.defaults,...g,measured:{width:(m=g.measured)==null?void 0:m.width,height:(d=g.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:AC(g,v),z:qw(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&&Xh(v,t,n,i,a),h||(h=g.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function MC(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 Xh(e,t,n,i,o){const{elevateNodesOnSelect:a,nodeOrigin:l,nodeExtent:c,zIndexMode:f}=Kh(Yh,i),h=e.parentId,m=t.get(h);if(!m){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}MC(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*OC),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const d=a&&!Gh(f)?Hw:0,{x:g,y:v,z:k}=LC(e,m,l,c,d,f),{positionAbsolute:w}=e.internals,b=g!==w.x||v!==w.y;(b||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:g,y:v}:w,z:k}})}function qw(e,t,n){const i=pn(e.zIndex)?e.zIndex:0;return Gh(n)?i:i+(e.selected?t:0)}function LC(e,t,n,i,o,a){const{x:l,y:c}=t.internals.positionAbsolute,f=er(e),h=Wo(e,n),m=ui(e.extent)?li(h,e.extent,f):h;let d=li({x:l+m.x,y:c+m.y},i,f);e.extent==="parent"&&(d=Mw(d,f,t));const g=qw(e,o,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=g?v+1:g}}function Qh(e,t,n,i=[0,0]){var l;const o=[],a=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const h=((l=a.get(c.parentId))==null?void 0:l.expandedRect)??us(f),m=Lw(h,c.rect);a.set(c.parentId,{expandedRect:m,parent:f})}return a.size>0&&a.forEach(({expandedRect:c,parent:f},h)=>{var E;const m=f.internals.positionAbsolute,d=er(f),g=f.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,k=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(d.width,Math.round(c.width)),b=Math.max(d.height,Math.round(c.height)),S=(w-d.width)*g[0],N=(b-d.height)*g[1];(v>0||k>0||S||N)&&(o.push({id:h,type:"position",position:{x:f.position.x-v+S,y:f.position.y-k+N}}),(E=n.get(h))==null||E.forEach(C=>{e.some(I=>I.id===C.id)||o.push({id:C.id,type:"position",position:{x:C.position.x+v,y:C.position.y+k}})})),(d.width<c.width||d.height<c.height||v||k)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-S:0),height:b+(k?g[1]*k-N:0)}})}),o}function RC(e,t,n,i,o,a,l){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const h=[],m=window.getComputedStyle(c),{m22:d}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const k=t.get(v.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),f=!0;continue}const w=qh(v.nodeElement),b=k.measured.width!==w.width||k.measured.height!==w.height;if(!!(w.width&&w.height&&(b||!k.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),E=ui(k.extent)?k.extent:a;let{positionAbsolute:C}=k.internals;k.parentId&&k.extent==="parent"?C=Mw(C,w,t.get(k.parentId)):E&&(C=li(C,E,w));const I={...k,measured:w,internals:{...k.internals,positionAbsolute:C,handleBounds:{source:_y("source",v.nodeElement,N,d,k.id),target:_y("target",v.nodeElement,N,d,k.id)}}};t.set(k.id,I),k.parentId&&Xh(I,t,n,{nodeOrigin:o,zIndexMode:l}),f=!0,b&&(h.push({id:k.id,type:"dimensions",dimensions:w}),k.expandParent&&k.parentId&&g.push({id:k.id,parentId:k.parentId,rect:us(I,o)}))}}if(g.length>0){const v=Qh(g,t,n,o);h.push(...v)}return{changes:h,updatedInternals:f}}async function DC({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 My(e,t,n,i,o,a){let l=o;const c=i.get(l)||new Map;i.set(l,c.set(n,t)),l=`${o}-${e}`;const f=i.get(l)||new Map;if(i.set(l,f.set(n,t)),a){l=`${o}-${e}-${a}`;const h=i.get(l)||new Map;i.set(l,h.set(n,t))}}function Yw(e,t,n){e.clear(),t.clear();for(const i of n){const{source:o,target:a,sourceHandle:l=null,targetHandle:c=null}=i,f={edgeId:i.id,source:o,target:a,sourceHandle:l,targetHandle:c},h=`${o}-${l}--${a}-${c}`,m=`${a}-${c}--${o}-${l}`;My("source",f,m,e,o,l),My("target",f,h,e,a,c),t.set(i.id,i)}}function Kw(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Kw(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 jC(e,t,n,i){const o=new Map;for(const[a,l]of e)if((l.selected||l.id===i)&&(!l.parentId||!Kw(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(a);c&&o.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Vf({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var l,c,f;const o=[];for(const[h,m]of t){const d=(l=n.get(h))==null?void 0:l.internals.userNode;d&&o.push({...d,position:m.position,dragging:i})}if(!e)return[o[0],o];const a=(c=n.get(e))==null?void 0:c.internals.userNode;return[a?{...a,position:((f=t.get(e))==null?void 0:f.position)||a.position,dragging:i}:o[0],o]}function $C({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 zC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:o}){let a={x:null,y:null},l=0,c=new Map,f=!1,h={x:0,y:0},m=null,d=!1,g=null,v=!1,k=!1,w=null;function b({noDragClassName:N,handleSelector:E,domNode:C,isSelectable:I,nodeId:M,nodeClickDistance:L=0}){g=Vt(C);function T({x:$,y:Z}){const{nodeLookup:j,nodeExtent:G,snapGrid:Y,snapToGrid:J,nodeOrigin:B,onNodeDrag:H,onSelectionDrag:V,onError:D,updateNodePositions:U}=t();a={x:$,y:Z};let W=!1;const K=c.size>1,Q=K&&G?gh(Uo(c)):null,re=K&&J?$C({dragItems:c,snapGrid:Y,x:$,y:Z}):null;for(const[oe,ee]of c){if(!j.has(oe))continue;let se={x:$-ee.distance.x,y:Z-ee.distance.y};J&&(se=re?{x:Math.round(se.x+re.x),y:Math.round(se.y+re.y)}:Ho(se,Y));let de=null;if(K&&G&&!ee.extent&&Q){const{positionAbsolute:fe}=ee.internals,Se=fe.x-Q.x+G[0][0],Ie=fe.x+ee.measured.width-Q.x2+G[1][0],Ae=fe.y-Q.y+G[0][1],Fe=fe.y+ee.measured.height-Q.y2+G[1][1];de=[[Se,Ae],[Ie,Fe]]}const{position:xe,positionAbsolute:he}=Aw({nodeId:oe,nextPosition:se,nodeLookup:j,nodeExtent:de||G,nodeOrigin:B,onError:D});W=W||ee.position.x!==xe.x||ee.position.y!==xe.y,ee.position=xe,ee.internals.positionAbsolute=he}if(k=k||W,!!W&&(U(c,!0),w&&(i||H||!M&&V))){const[oe,ee]=Vf({nodeId:M,dragItems:c,nodeLookup:j});i==null||i(w,c,oe,ee),H==null||H(w,oe,ee),M||V==null||V(w,ee)}}async function A(){if(!m)return;const{transform:$,panBy:Z,autoPanSpeed:j,autoPanOnNodeDrag:G}=t();if(!G){f=!1,cancelAnimationFrame(l);return}const[Y,J]=Uh(h,m,j);(Y!==0||J!==0)&&(a.x=(a.x??0)-Y/$[2],a.y=(a.y??0)-J/$[2],await Z({x:Y,y:J})&&T(a)),l=requestAnimationFrame(A)}function z($){var K;const{nodeLookup:Z,multiSelectionActive:j,nodesDraggable:G,transform:Y,snapGrid:J,snapToGrid:B,selectNodesOnDrag:H,onNodeDragStart:V,onSelectionDragStart:D,unselectNodesAndEdges:U}=t();d=!0,(!H||!I)&&!j&&M&&((K=Z.get(M))!=null&&K.selected||U()),I&&H&&M&&(e==null||e(M));const W=_o($.sourceEvent,{transform:Y,snapGrid:J,snapToGrid:B,containerBounds:m});if(a=W,c=jC(Z,G,W,M),c.size>0&&(n||V||!M&&D)){const[Q,re]=Vf({nodeId:M,dragItems:c,nodeLookup:Z});n==null||n($.sourceEvent,c,Q,re),V==null||V($.sourceEvent,Q,re),M||D==null||D($.sourceEvent,re)}}const R=fw().clickDistance(L).on("start",$=>{const{domNode:Z,nodeDragThreshold:j,transform:G,snapGrid:Y,snapToGrid:J}=t();m=(Z==null?void 0:Z.getBoundingClientRect())||null,v=!1,k=!1,w=$.sourceEvent,j===0&&z($),a=_o($.sourceEvent,{transform:G,snapGrid:Y,snapToGrid:J,containerBounds:m}),h=mn($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:Z,transform:j,snapGrid:G,snapToGrid:Y,nodeDragThreshold:J,nodeLookup:B}=t(),H=_o($.sourceEvent,{transform:j,snapGrid:G,snapToGrid:Y,containerBounds:m});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||M&&!B.has(M))&&(v=!0),!v){if(!f&&Z&&d&&(f=!0,A()),!d){const V=mn($.sourceEvent,m),D=V.x-h.x,U=V.y-h.y;Math.sqrt(D*D+U*U)>J&&z($)}(a.x!==H.xSnapped||a.y!==H.ySnapped)&&c&&d&&(h=mn($.sourceEvent,m),T(H))}}).on("end",$=>{if(!d||v){v&&c.size>0&&t().updateNodePositions(c,!1);return}if(f=!1,d=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:Z,updateNodePositions:j,onNodeDragStop:G,onSelectionDragStop:Y}=t();if(k&&(j(c,!1),k=!1),o||G||!M&&Y){const[J,B]=Vf({nodeId:M,dragItems:c,nodeLookup:Z,dragging:!1});o==null||o($.sourceEvent,c,J,B),G==null||G($.sourceEvent,J,B),M||Y==null||Y($.sourceEvent,B)}}}).filter($=>{const Z=$.target;return!$.button&&(!N||!Ly(Z,`.${N}`,C))&&(!E||Ly(Z,E,C))});g.call(R)}function S(){g==null||g.on(".drag",null)}return{update:b,destroy:S}}function FC(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())Ro(o,us(a))>0&&i.push(a);return i}const BC=250;function VC(e,t,n,i){var c,f;let o=[],a=1/0;const l=FC(e,n,t+BC);for(const h of l){const m=[...((c=h.internals.handleBounds)==null?void 0:c.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const d of m){if(i.nodeId===d.nodeId&&i.type===d.type&&i.id===d.id)continue;const{x:g,y:v}=ci(h,d,d.position,!0),k=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));k>t||(k<a?(o=[{...d,x:g,y:v}],a=k):k===a&&o.push({...d,x:g,y:v}))}}if(!o.length)return null;if(o.length>1){const h=i.type==="source"?"target":"source";return o.find(m=>m.type===h)??o[0]}return o[0]}function Gw(e,t,n,i,o,a=!1){var h,m,d;const l=i.get(e);if(!l)return null;const c=o==="strict"?(h=l.internals.handleBounds)==null?void 0:h[t]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((d=l.internals.handleBounds)==null?void 0:d.target)??[]],f=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return f&&a?{...f,...ci(l,f,f.position,!0)}:f}function Xw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Qw=()=>!0;function UC(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:o,edgeUpdaterType:a,isTarget:l,domNode:c,nodeLookup:f,lib:h,autoPanOnConnect:m,flowId:d,panBy:g,cancelConnection:v,onConnectStart:k,onConnect:w,onConnectEnd:b,isValidConnection:S=Qw,onReconnectEnd:N,updateConnection:E,getTransform:C,getFromHandle:I,autoPanSpeed:M,dragThreshold:L=1,handleDomNode:T}){const A=$w(e.target);let z=0,R;const{x:$,y:Z}=mn(e),j=Xw(a,T),G=c==null?void 0:c.getBoundingClientRect();let Y=!1;if(!G||!j)return;const J=Gw(o,j,i,f,t);if(!J)return;let B=mn(e,G),H=!1,V=null,D=!1,U=null;function W(){if(!m||!G)return;const[xe,he]=Uh(B,G,M);g({x:xe,y:he}),z=requestAnimationFrame(W)}const K={...J,nodeId:o,type:j,position:J.position},Q=f.get(o);let oe={inProgress:!0,isValid:null,from:ci(Q,K,ke.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:Q,to:B,toHandle:null,toPosition:ky[K.position],toNode:null,pointer:B};function ee(){Y=!0,E(oe),k==null||k(e,{nodeId:o,handleId:i,handleType:j})}L===0&&ee();function se(xe){if(!Y){const{x:Fe,y:wt}=mn(xe),Nt=Fe-$,ht=wt-Z;if(!(Nt*Nt+ht*ht>L*L))return;ee()}if(!I()||!K){de(xe);return}const he=C();B=mn(xe,G),R=VC(ys(B,he,!1,[1,1]),n,f,K),H||(W(),H=!0);const fe=Jw(xe,{handle:R,connectionMode:t,fromNodeId:o,fromHandleId:i,fromType:l?"target":"source",isValidConnection:S,doc:A,lib:h,flowId:d,nodeLookup:f});U=fe.handleDomNode,V=fe.connection,D=WC(!!R,fe.isValid);const Se=f.get(o),Ie=Se?ci(Se,K,ke.Left,!0):oe.from,Ae={...oe,from:Ie,isValid:D,to:fe.toHandle&&D?cs({x:fe.toHandle.x,y:fe.toHandle.y},he):B,toHandle:fe.toHandle,toPosition:D&&fe.toHandle?fe.toHandle.position:ky[K.position],toNode:fe.toHandle?f.get(fe.toHandle.nodeId):null,pointer:B};E(Ae),oe=Ae}function de(xe){if(!("touches"in xe&&xe.touches.length>0)){if(Y){(R||U)&&V&&D&&(w==null||w(V));const{inProgress:he,...fe}=oe,Se={...fe,toPosition:oe.toHandle?oe.toPosition:null};b==null||b(xe,Se),a&&(N==null||N(xe,Se))}v(),cancelAnimationFrame(z),H=!1,D=!1,V=null,U=null,A.removeEventListener("mousemove",se),A.removeEventListener("mouseup",de),A.removeEventListener("touchmove",se),A.removeEventListener("touchend",de)}}A.addEventListener("mousemove",se),A.addEventListener("mouseup",de),A.addEventListener("touchmove",se),A.addEventListener("touchend",de)}function Jw(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:o,fromType:a,doc:l,lib:c,flowId:f,isValidConnection:h=Qw,nodeLookup:m}){const d=a==="target",g=t?l.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:k}=mn(e),w=l.elementFromPoint(v,k),b=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const N=Xw(void 0,b),E=b.getAttribute("data-nodeid"),C=b.getAttribute("data-handleid"),I=b.classList.contains("connectable"),M=b.classList.contains("connectableend");if(!E||!N)return S;const L={source:d?E:i,sourceHandle:d?C:o,target:d?i:E,targetHandle:d?o:C};S.connection=L;const A=I&&M&&(n===as.Strict?d&&N==="source"||!d&&N==="target":E!==i||C!==o);S.isValid=A&&h(L),S.toHandle=Gw(E,N,C,m,n,!0)}return S}const xh={onPointerDown:UC,isValid:Jw};function HC({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const o=Vt(e);function a({translateExtent:c,width:f,height:h,zoomStep:m=1,pannable:d=!0,zoomable:g=!0,inversePan:v=!1}){const k=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const C=n(),I=E.sourceEvent.ctrlKey&&Do()?10:1,M=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,L=C[2]*Math.pow(2,M*I);t.scaleTo(L)};let w=[0,0];const b=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},S=E=>{const C=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const I=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],M=[I[0]-w[0],I[1]-w[1]];w=I;const L=i()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),T={x:C[0]-M[0]*L,y:C[1]-M[1]*L},A=[[0,0],[f,h]];t.setViewportConstrained({x:T.x,y:T.y,zoom:C[2]},A,c)},N=_w().on("start",b).on("zoom",d?S:null).on("zoom.wheel",g?k:null);o.call(N,{})}function l(){o.on("zoom",null)}return{update:a,destroy:l,pointer:dn}}const bu=e=>({x:e.x,y:e.y,zoom:e.k}),Wf=({x:e,y:t,zoom:n})=>vu.translate(e,t).scale(n),Gi=(e,t)=>e.target.closest(`.${t}`),Zw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Uf=(e,t=0,n=qC,i=()=>{})=>{const o=typeof t=="number"&&t>0;return o||i(),o?e.transition().duration(t).ease(n).on("end",i):e},ex=e=>{const t=e.ctrlKey&&Do()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function YC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:h}){return m=>{if(Gi(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(m.ctrlKey&&l){const b=dn(m),S=ex(m),N=d*Math.pow(2,S);i.scaleTo(n,N,b,m);return}const g=m.deltaMode===1?20:1;let v=o===si.Vertical?0:m.deltaX*g,k=o===si.Horizontal?0:m.deltaY*g;!Do()&&m.shiftKey&&o!==si.Vertical&&(v=m.deltaY*g,k=0),i.translateBy(n,-(v/d)*a,-(k/d)*a,{internal:!0});const w=bu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{h==null||h(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function KC({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 GC({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 XC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:o}){return a=>{var l,c;e.usedRightMouseButton=!!(n&&Zw(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 QC({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&&Zw(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 JC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:f,lib:h,connectionInProgress:m}){return d=>{var b;const g=e||t,v=n&&d.ctrlKey,k=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Gi(d,`${h}-flow__node`)||Gi(d,`${h}-flow__edge`)))return!0;if(!i&&!g&&!o&&!a&&!n||l||m&&!k||Gi(d,c)&&k||Gi(d,f)&&(!k||o&&k&&!e)||!n&&d.ctrlKey&&k)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!g&&!o&&!v&&k||!i&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(i)&&!i.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||k)&&w}}function ZC({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:o,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),d=_w().scaleExtent([t,n]).translateExtent(i),g=Vt(e).call(d);N({x:o.x,y:o.y,zoom:ls(o.zoom,t,n)},[[0,0],[m.width,m.height]],i);const v=g.on("wheel.zoom"),k=g.on("dblclick.zoom");d.wheelDelta(ex);async function w(R,$){return g?new Promise(Z=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?No:Fl).transform(Uf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}function b({noWheelClassName:R,noPanClassName:$,onPaneContextMenu:Z,userSelectionActive:j,panOnScroll:G,panOnDrag:Y,panOnScrollMode:J,panOnScrollSpeed:B,preventScrolling:H,zoomOnPinch:V,zoomOnScroll:D,zoomOnDoubleClick:U,zoomActivationKeyPressed:W,lib:K,onTransformChange:Q,connectionInProgress:re,paneClickDistance:oe,selectionOnDrag:ee}){j&&!h.isZoomingOrPanning&&S();const se=G&&!W&&!j;d.clickDistance(ee?1/0:!pn(oe)||oe<0?0:oe);const de=se?YC({zoomPanValues:h,noWheelClassName:R,d3Selection:g,d3Zoom:d,panOnScrollMode:J,panOnScrollSpeed:B,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}):KC({noWheelClassName:R,preventScrolling:H,d3ZoomHandler:v});g.on("wheel.zoom",de,{passive:!1});const xe=GC({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:l});d.on("start",xe);const he=XC({zoomPanValues:h,panOnDrag:Y,onPaneContextMenu:!!Z,onPanZoom:a,onTransformChange:Q});d.on("zoom",he);const fe=QC({zoomPanValues:h,panOnDrag:Y,panOnScroll:G,onPaneContextMenu:Z,onPanZoomEnd:c,onDraggingChange:f});d.on("end",fe);const Se=JC({zoomActivationKeyPressed:W,panOnDrag:Y,zoomOnScroll:D,panOnScroll:G,zoomOnDoubleClick:U,zoomOnPinch:V,userSelectionActive:j,noPanClassName:$,noWheelClassName:R,lib:K,connectionInProgress:re});d.filter(Se),U?g.on("dblclick.zoom",k):g.on("dblclick.zoom",null)}function S(){d.on("zoom",null)}async function N(R,$,Z){const j=Wf(R),G=d==null?void 0:d.constrain()(j,$,Z);return G&&await w(G),G}async function E(R,$){const Z=Wf(R);return await w(Z,$),Z}function C(R){if(g){const $=Wf(R),Z=g.property("__zoom");(Z.k!==R.zoom||Z.x!==R.x||Z.y!==R.y)&&(d==null||d.transform(g,$,null,{sync:!0}))}}function I(){const R=g?Nw(g.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function M(R,$){return g?new Promise(Z=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?No:Fl).scaleTo(Uf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}async function L(R,$){return g?new Promise(Z=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?No:Fl).scaleBy(Uf(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>Z(!0)),R)}):!1}function T(R){d==null||d.scaleExtent(R)}function A(R){d==null||d.translateExtent(R)}function z(R){const $=!pn(R)||R<0?0:R;d==null||d.clickDistance($)}return{update:b,destroy:S,setViewport:E,setViewportConstrained:N,getViewport:I,scaleTo:M,scaleBy:L,setScaleExtent:T,setTranslateExtent:A,syncViewport:C,setClickDistance:z}}var fs;(function(e){e.Line="line",e.Handle="handle"})(fs||(fs={}));function e2({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 Ry(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:o}}function kr(e,t){return Math.max(0,t-e)}function Sr(e,t){return Math.max(0,e-t)}function bl(e,t,n){return Math.max(0,t-e,e-n)}function Dy(e,t){return e?!t:t}function t2(e,t,n,i,o,a,l,c){let{affectsX:f,affectsY:h}=t;const{isHorizontal:m,isVertical:d}=t,g=m&&d,{xSnapped:v,ySnapped:k}=n,{minWidth:w,maxWidth:b,minHeight:S,maxHeight:N}=i,{x:E,y:C,width:I,height:M,aspectRatio:L}=e;let T=Math.floor(m?v-e.pointerX:0),A=Math.floor(d?k-e.pointerY:0);const z=I+(f?-T:T),R=M+(h?-A:A),$=-a[0]*I,Z=-a[1]*M;let j=bl(z,w,b),G=bl(R,S,N);if(l){let B=0,H=0;f&&T<0?B=kr(E+T+$,l[0][0]):!f&&T>0&&(B=Sr(E+z+$,l[1][0])),h&&A<0?H=kr(C+A+Z,l[0][1]):!h&&A>0&&(H=Sr(C+R+Z,l[1][1])),j=Math.max(j,B),G=Math.max(G,H)}if(c){let B=0,H=0;f&&T>0?B=Sr(E+T,c[0][0]):!f&&T<0&&(B=kr(E+z,c[1][0])),h&&A>0?H=Sr(C+A,c[0][1]):!h&&A<0&&(H=kr(C+R,c[1][1])),j=Math.max(j,B),G=Math.max(G,H)}if(o){if(m){const B=bl(z/L,S,N)*L;if(j=Math.max(j,B),l){let H=0;!f&&!h||f&&!h&&g?H=Sr(C+Z+z/L,l[1][1])*L:H=kr(C+Z+(f?T:-T)/L,l[0][1])*L,j=Math.max(j,H)}if(c){let H=0;!f&&!h||f&&!h&&g?H=kr(C+z/L,c[1][1])*L:H=Sr(C+(f?T:-T)/L,c[0][1])*L,j=Math.max(j,H)}}if(d){const B=bl(R*L,w,b)/L;if(G=Math.max(G,B),l){let H=0;!f&&!h||h&&!f&&g?H=Sr(E+R*L+$,l[1][0])/L:H=kr(E+(h?A:-A)*L+$,l[0][0])/L,G=Math.max(G,H)}if(c){let H=0;!f&&!h||h&&!f&&g?H=kr(E+R*L,c[1][0])/L:H=Sr(E+(h?A:-A)*L,c[0][0])/L,G=Math.max(G,H)}}}A=A+(A<0?G:-G),T=T+(T<0?j:-j),o&&(g?z>R*L?A=(Dy(f,h)?-T:T)/L:T=(Dy(f,h)?-A:A)*L:m?(A=T/L,h=f):(T=A*L,f=h));const Y=f?E+T:E,J=h?C+A:C;return{width:I+(f?-T:T),height:M+(h?-A:A),x:a[0]*T*(f?-1:1)+Y,y:a[1]*A*(h?-1:1)+J}}const tx={width:0,height:0,x:0,y:0},n2={...tx,pointerX:0,pointerY:0,aspectRatio:1};function r2(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 i2({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:o}){const a=Vt(e);let l={controlDirection:Ry("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:h,boundaries:m,keepAspectRatio:d,resizeDirection:g,onResizeStart:v,onResize:k,onResizeEnd:w,shouldResize:b}){let S={...tx},N={...n2};l={boundaries:m,resizeDirection:g,keepAspectRatio:d,controlDirection:Ry(h)};let E,C=null,I=[],M,L,T,A=!1;const z=fw().on("start",R=>{const{nodeLookup:$,transform:Z,snapGrid:j,snapToGrid:G,nodeOrigin:Y,paneDomNode:J}=n();if(E=$.get(t),!E)return;C=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:H}=_o(R.sourceEvent,{transform:Z,snapGrid:j,snapToGrid:G,containerBounds:C});S={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},N={...S,pointerX:B,pointerY:H,aspectRatio:S.width/S.height},M=void 0,L=ui(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(M=$.get(E.parentId)),M&&E.extent==="parent"&&(L=[[0,0],[M.measured.width,M.measured.height]]),I=[],T=void 0;for(const[V,D]of $)if(D.parentId===t&&(I.push({id:V,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const U=r2(D,E,D.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,{...S})}).on("drag",R=>{const{transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G}=n(),Y=_o(R.sourceEvent,{transform:$,snapGrid:Z,snapToGrid:j,containerBounds:C}),J=[];if(!E)return;const{x:B,y:H,width:V,height:D}=S,U={},W=E.origin??G,{width:K,height:Q,x:re,y:oe}=t2(N,l.controlDirection,Y,l.boundaries,l.keepAspectRatio,W,L,T),ee=K!==V,se=Q!==D,de=re!==B&&ee,xe=oe!==H&&se;if(!de&&!xe&&!ee&&!se)return;if((de||xe||W[0]===1||W[1]===1)&&(U.x=de?re:S.x,U.y=xe?oe:S.y,S.x=U.x,S.y=U.y,I.length>0)){const Ie=re-B,Ae=oe-H;for(const Fe of I)Fe.position={x:Fe.position.x-Ie+W[0]*(K-V),y:Fe.position.y-Ae+W[1]*(Q-D)},J.push(Fe)}if((ee||se)&&(U.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?K:S.width,U.height=se&&(!l.resizeDirection||l.resizeDirection==="vertical")?Q:S.height,S.width=U.width,S.height=U.height),M&&E.expandParent){const Ie=W[0]*(U.width??0);U.x&&U.x<Ie&&(S.x=Ie,N.x=N.x-(U.x-Ie));const Ae=W[1]*(U.height??0);U.y&&U.y<Ae&&(S.y=Ae,N.y=N.y-(U.y-Ae))}const he=e2({width:S.width,prevWidth:V,height:S.height,prevHeight:D,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),fe={...S,direction:he};(b==null?void 0:b(R,fe))!==!1&&(A=!0,k==null||k(R,fe),i(U,J))}).on("end",R=>{A&&(w==null||w(R,{...S}),o==null||o({...S}),A=!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 jy;function s2(){if(jy)return Kf;jy=1;var e=Fo();function t(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(d,g){var v=g(),k=i({inst:{value:v,getSnapshot:g}}),w=k[0].inst,b=k[1];return a(function(){w.value=v,w.getSnapshot=g,f(w)&&b({inst:w})},[d,v,g]),o(function(){return f(w)&&b({inst:w}),d(function(){f(w)&&b({inst:w})})},[d]),l(v),v}function f(d){var g=d.getSnapshot;d=d.value;try{var v=g();return!n(d,v)}catch{return!0}}function h(d,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Kf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Kf}var $y;function o2(){return $y||($y=1,Yf.exports=s2()),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 zy;function a2(){if(zy)return qf;zy=1;var e=Fo(),t=o2();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var i=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return qf.useSyncExternalStoreWithSelector=function(h,m,d,g,v){var k=a(null);if(k.current===null){var w={hasValue:!1,value:null};k.current=w}else w=k.current;k=c(function(){function S(M){if(!N){if(N=!0,E=M,M=g(M),v!==void 0&&w.hasValue){var L=w.value;if(v(L,M))return C=L}return C=M}if(L=C,i(E,M))return L;var T=g(M);return v!==void 0&&v(L,T)?(E=M,L):(E=M,C=T)}var N=!1,E,C,I=d===void 0?null:d;return[function(){return S(m())},I===null?void 0:function(){return S(I())}]},[m,d,g,v]);var b=o(h,k[0],k[1]);return l(function(){w.hasValue=!0,w.value=b},[b]),f(b),b},qf}var Fy;function l2(){return Fy||(Fy=1,Hf.exports=a2()),Hf.exports}var u2=l2();const c2=hu(u2),f2={},By=e=>{let t;const n=new Set,i=(m,d)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=d??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(k=>k(t,v))}},o=()=>t,f={setState:i,getState:o,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(f2?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(i,o,f);return f},d2=e=>e?By(e):By,{useDebugValue:h2}=Mh,{useSyncExternalStoreWithSelector:p2}=c2,m2=e=>e;function nx(e,t=m2,n){const i=p2(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return h2(i),i}const Vy=(e,t)=>{const n=d2(e),i=(o,a=t)=>nx(n,o,a);return Object.assign(i,n),i},g2=(e,t)=>e?Vy(e,t):Vy;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 rx=Xv();const ku=P.createContext(null),y2=ku.Provider,ix=gn.error001("react");function Me(e,t){const n=P.useContext(ku);if(n===null)throw new Error(ix);return nx(n,e,t)}function qe(){const e=P.useContext(ku);if(e===null)throw new Error(ix);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Wy={display:"none"},v2={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sx="react-flow__node-desc",ox="react-flow__edge-desc",w2="react-flow__aria-live",x2=e=>e.ariaLiveMessage,b2=e=>e.ariaLabelConfig;function k2({rfId:e}){const t=Me(x2);return _.jsx("div",{id:`${w2}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:v2,children:t})}function S2({rfId:e,disableKeyboardA11y:t}){const n=Me(b2);return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:`${sx}-${e}`,style:Wy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),_.jsx("div",{id:`${ox}-${e}`,style:Wy,children:n["edge.a11yDescription.default"]}),!t&&_.jsx(k2,{rfId:e})]})}const Su=P.forwardRef(({position:e="top-left",children:t,className:n,style:i,...o},a)=>{const l=`${e}`.split("-");return _.jsx("div",{className:rt(["react-flow__panel",n,...l]),style:i,ref:a,...o,children:t})});Su.displayName="Panel";function E2({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_.jsx(Su,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const N2=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 _2(e,t){return He(e.selectedNodes.map(kl),t.selectedNodes.map(kl))&&He(e.selectedEdges.map(kl),t.selectedEdges.map(kl))}function C2({onSelectionChange:e}){const t=qe(),{selectedNodes:n,selectedEdges:i}=Me(N2,_2);return P.useEffect(()=>{const o={nodes:n,edges:i};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[n,i,e]),null}const T2=e=>!!e.onSelectionChangeHandlers;function O2({onSelectionChange:e}){const t=Me(T2);return e||t?_.jsx(C2,{onSelectionChange:e}):null}const ax=[0,0],P2={x:0,y:0,zoom:1},I2=["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"],Uy=[...I2,"rfId"],A2=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}),Hy={translateExtent:Mo,nodeOrigin:ax,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function M2(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f}=Me(A2,He),h=qe();P.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=Hy,c()}),[]);const m=P.useRef(Hy);return P.useEffect(()=>{for(const d of Uy){const g=e[d],v=m.current[d];g!==v&&(typeof e[d]>"u"||(d==="nodes"?t(g):d==="edges"?n(g):d==="minZoom"?i(g):d==="maxZoom"?o(g):d==="translateExtent"?a(g):d==="nodeExtent"?l(g):d==="ariaLabelConfig"?h.setState({ariaLabelConfig:yC(g)}):d==="fitView"?h.setState({fitViewQueued:g}):d==="fitViewOptions"?h.setState({fitViewOptions:g}):h.setState({[d]:g})))}m.current=e},Uy.map(d=>e[d])),null}function qy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function L2(e){var i;const[t,n]=P.useState(e==="system"?null:e);return P.useEffect(()=>{if(e!=="system"){n(e);return}const o=qy(),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=qy())!=null&&i.matches?"dark":"light"}const Yy=typeof document<"u"?document:null;function jo(e=null,t={target:Yy,actInsideInputWithModifier:!0}){const[n,i]=P.useState(!1),o=P.useRef(!1),a=P.useRef(new Set([])),[l,c]=P.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),m=h.reduce((d,g)=>d.concat(...g),[]);return[h,m]}return[[],[]]},[e]);return P.useEffect(()=>{const f=(t==null?void 0:t.target)??Yy,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var b,S;if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!h)&&zw(v))return!1;const w=Gy(v.code,c);if(a.current.add(v[w]),Ky(l,a.current,!1)){const N=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,E=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(o.current||!E)&&v.preventDefault(),i(!0)}},d=v=>{const k=Gy(v.code,c);Ky(l,a.current,!0)?(i(!1),a.current.clear()):a.current.delete(v[k]),v.key==="Meta"&&a.current.clear(),o.current=!1},g=()=>{a.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,i]),n}function Ky(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(o=>t.has(o)))}function Gy(e,t){return t.includes(e)?"code":"key"}const R2=()=>{const e=qe();return P.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,o,a],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??i,y:t.y??o,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:o,minZoom:a,maxZoom:l,panZoom:c}=e.getState(),f=Hh(t,i,o,a,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:o,snapToGrid:a,domNode:l}=e.getState();if(!l)return t;const{x:c,y:f}=l.getBoundingClientRect(),h={x:t.x-c,y:t.y-f},m=n.snapGrid??o,d=n.snapToGrid??a;return ys(h,i,d,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:o,y:a}=i.getBoundingClientRect(),l=cs(t,n);return{x:l.x+o,y:l.y+a}}}),[])};function lx(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)D2(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 D2(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 j2(e,t){return lx(e,t)}function $2(e,t){return lx(e,t)}function Zr(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(Zr(a.id,l)))}return i}function Xy({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 Qy(e){return{id:e.id,type:"remove"}}const z2=Rw();function F2(e,t,n={}){return SC(e,t,{...n,onError:n.onError??z2})}const Jy=e=>lC(e),B2=e=>Iw(e);function ux(e){return P.forwardRef(e)}const V2=typeof window<"u"?P.useLayoutEffect:P.useEffect;function Zy(e){const[t,n]=P.useState(BigInt(0)),[i]=P.useState(()=>W2(()=>n(o=>o+BigInt(1))));return V2(()=>{const o=i.get();o.length&&(e(o),i.reset())},[t]),i}function W2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const cx=P.createContext(null);function U2({children:e}){const t=qe(),n=P.useCallback(c=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:m,onNodesChange:d,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:k}=t.getState();let w=f;for(const S of c)w=typeof S=="function"?S(w):S;let b=Xy({items:w,lookup:g});for(const S of k.values())b=S(b);m&&h(w),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:N,setNodes:E}=t.getState();S&&E(N)})},[]),i=Zy(n),o=P.useCallback(c=>{const{edges:f=[],setEdges:h,hasDefaultEdges:m,onEdgesChange:d,edgeLookup:g}=t.getState();let v=f;for(const k of c)v=typeof k=="function"?k(v):k;m?h(v):d&&d(Xy({items:v,lookup:g}))},[]),a=Zy(o),l=P.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return _.jsx(cx.Provider,{value:l,children:e})}function H2(){const e=P.useContext(cx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const q2=e=>!!e.panZoom;function Jh(){const e=R2(),t=qe(),n=H2(),i=Me(q2),o=P.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),l=d=>{n.nodeQueue.push(d)},c=d=>{n.edgeQueue.push(d)},f=d=>{var S,N;const{nodeLookup:g,nodeOrigin:v}=t.getState(),k=Jy(d)?d:g.get(d.id),w=k.parentId?jw(k.position,k.measured,k.parentId,g,v):k.position,b={...k,position:w,width:((S=k.measured)==null?void 0:S.width)??k.width,height:((N=k.measured)==null?void 0:N.height)??k.height};return us(b)},h=(d,g,v={replace:!1})=>{l(k=>k.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return v.replace&&Jy(b)?b:{...w,...b}}return w}))},m=(d,g,v={replace:!1})=>{c(k=>k.map(w=>{if(w.id===d){const b=typeof g=="function"?g(w):g;return v.replace&&B2(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=a(d))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(g=>({...g}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:l,setEdges:c,addNodes:d=>{const g=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:v}=t.getState(),[k,w,b]=v;return{nodes:d.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:k,y:w,zoom:b}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:k,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:N,onDelete:E,onBeforeDelete:C}=t.getState(),{nodes:I,edges:M}=await hC({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:k,onBeforeDelete:C}),L=M.length>0,T=I.length>0;if(L){const A=M.map(Qy);b==null||b(M),N(A)}if(T){const A=I.map(Qy);w==null||w(I),S(A)}return(T||L)&&(E==null||E({nodes:I,edges:M})),{deletedNodes:I,deletedEdges:M}},getIntersectingNodes:(d,g=!0,v)=>{const k=Ey(d),w=k?d:f(d),b=v!==void 0;return w?(v||t.getState().nodes).filter(S=>{const N=t.getState().nodeLookup.get(S.id);if(N&&!k&&(S.id===d.id||!N.internals.positionAbsolute))return!1;const E=us(b?S:N),C=Ro(E,w);return g&&C>0||C>=E.width*E.height||C>=w.width*w.height}):[]},isNodeIntersecting:(d,g,v=!0)=>{const w=Ey(d)?d:f(d);if(!w)return!1;const b=Ro(w,g);return v&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:h,updateNodeData:(d,g,v={replace:!1})=>{h(d,k=>{const w=typeof g=="function"?g(k):g;return v.replace?{...k,data:w}:{...k,data:{...k.data,...w}}},v)},updateEdge:m,updateEdgeData:(d,g,v={replace:!1})=>{m(d,k=>{const w=typeof g=="function"?g(k):g;return v.replace?{...k,data:w}:{...k,data:{...k.data,...w}}},v)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return uC(d,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:d,id:g,nodeId:v})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${v}-${d}${g?`-${g}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:v})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${v}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:k.values())??[])},fitView:async d=>{const g=t.getState().fitViewResolver??gC();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return P.useMemo(()=>({...o,...e,viewportInitialized:i}),[i])}const e0=e=>e.selected,Y2=typeof window<"u"?window:void 0;function K2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qe(),{deleteElements:i}=Jh(),o=jo(e,{actInsideInputWithModifier:!1}),a=jo(t,{target:Y2});P.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(e0),edges:l.filter(e0)}),n.setState({nodesSelectionActive:!1})}},[o]),P.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function G2(e){const t=qe();P.useEffect(()=>{const n=()=>{var o,a,l,c;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const i=qh(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},X2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Q2({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=si.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:v=!0,children:k,noWheelClassName:w,noPanClassName:b,onViewportChange:S,isControlledViewport:N,paneClickDistance:E,selectionOnDrag:C}){const I=qe(),M=P.useRef(null),{userSelectionActive:L,lib:T,connectionInProgress:A}=Me(X2,He),z=jo(g),R=P.useRef();G2(M);const $=P.useCallback(Z=>{S==null||S({x:Z[0],y:Z[1],zoom:Z[2]}),N||I.setState({transform:Z})},[S,N]);return P.useEffect(()=>{if(M.current){R.current=ZC({domNode:M.current,minZoom:m,maxZoom:d,translateExtent:h,viewport:f,onDraggingChange:Y=>I.setState(J=>J.paneDragging===Y?J:{paneDragging:Y}),onPanZoomStart:(Y,J)=>{const{onViewportChangeStart:B,onMoveStart:H}=I.getState();H==null||H(Y,J),B==null||B(J)},onPanZoom:(Y,J)=>{const{onViewportChange:B,onMove:H}=I.getState();H==null||H(Y,J),B==null||B(J)},onPanZoomEnd:(Y,J)=>{const{onViewportChangeEnd:B,onMoveEnd:H}=I.getState();H==null||H(Y,J),B==null||B(J)}});const{x:Z,y:j,zoom:G}=R.current.getViewport();return I.setState({panZoom:R.current,transform:[Z,j,G],domNode:M.current.closest(".react-flow")}),()=>{var Y;(Y=R.current)==null||Y.destroy()}}},[]),P.useEffect(()=>{var Z;(Z=R.current)==null||Z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:z,preventScrolling:v,noPanClassName:b,userSelectionActive:L,noWheelClassName:w,lib:T,onTransformChange:$,connectionInProgress:A,selectionOnDrag:C,paneClickDistance:E})},[e,t,n,i,o,a,l,c,z,v,b,L,w,T,$,A,C,E]),_.jsx("div",{className:"react-flow__renderer",ref:M,style:Eu,children:k})}const J2=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Z2(){const{userSelectionActive:e,userSelectionRect:t}=Me(J2,He);return e&&t?_.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Gf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},eT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function tT({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Lo.Full,panOnDrag:i,autoPanOnSelection:o,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:m,onPaneScroll:d,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:k,children:w}){const b=P.useRef(0),S=qe(),{userSelectionActive:N,elementsSelectable:E,dragging:C,connectionInProgress:I,panBy:M,autoPanSpeed:L}=Me(eT,He),T=E&&(e||N),A=P.useRef(null),z=P.useRef(),R=P.useRef(new Set),$=P.useRef(new Set),Z=P.useRef(!1),j=P.useRef({x:0,y:0}),G=P.useRef(!1),Y=ee=>{if(Z.current||I){Z.current=!1;return}h==null||h(ee),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},J=ee=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){ee.preventDefault();return}m==null||m(ee)},B=d?ee=>d(ee):void 0,H=ee=>{Z.current&&(ee.stopPropagation(),Z.current=!1)},V=ee=>{var Fe,wt;const{domNode:se,transform:de}=S.getState();if(z.current=se==null?void 0:se.getBoundingClientRect(),!z.current)return;const xe=ee.target===A.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),Z.current=!1;const{x:Se,y:Ie}=mn(ee.nativeEvent,z.current),Ae=ys({x:Se,y:Ie},de);S.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:Se,y:Ie}}),xe||(ee.stopPropagation(),ee.preventDefault())};function D(ee,se){const{userSelectionRect:de}=S.getState();if(!de)return;const{transform:xe,nodeLookup:he,edgeLookup:fe,connectionLookup:Se,triggerNodeChanges:Ie,triggerEdgeChanges:Ae,defaultEdgeOptions:Fe}=S.getState(),wt={x:de.startX,y:de.startY},{x:Nt,y:ht}=cs(wt,xe),pt={startX:wt.x,startY:wt.y,x:ee<Nt?ee:Nt,y:se<ht?se:ht,width:Math.abs(ee-Nt),height:Math.abs(se-ht)},Dn=R.current,bn=$.current;R.current=new Set(Wh(he,pt,xe,n===Lo.Partial,!0).map(_t=>_t.id)),$.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:Rt}of Ht.values()){const qt=fe.get(Rt);qt&&(qt.selectable??kn)&&$.current.add(Rt)}}if(!Ny(Dn,R.current)){const _t=Xi(he,R.current,!0);Ie(_t)}if(!Ny(bn,$.current)){const _t=Xi(fe,$.current);Ae(_t)}S.setState({userSelectionRect:pt,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!o||!z.current)return;const[ee,se]=Uh(j.current,z.current,L);M({x:ee,y:se}).then(de=>{if(!Z.current||!de){b.current=requestAnimationFrame(U);return}const{x:xe,y:he}=j.current;D(xe,he),b.current=requestAnimationFrame(U)})}const W=()=>{cancelAnimationFrame(b.current),b.current=0,G.current=!1};P.useEffect(()=>()=>W(),[]);const K=ee=>{const{userSelectionRect:se,transform:de,resetSelectedElements:xe}=S.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(!Z.current){const Ie=t?0:a;if(Math.hypot(he-Se.x,fe-Se.y)<=Ie)return;xe(),c==null||c(ee)}Z.current=!0,G.current||(U(),G.current=!0),D(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),!N&&ee.target===A.current&&S.getState().userSelectionRect&&(Y==null||Y(ee)),S.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f==null||f(ee),S.setState({nodesSelectionActive:R.current.size>0})),W())},re=ee=>{var se,de;(de=(se=ee.target)==null?void 0:se.releasePointerCapture)==null||de.call(se,ee.pointerId),W()},oe=i===!0||Array.isArray(i)&&i.includes(0);return _.jsxs("div",{className:rt(["react-flow__pane",{draggable:oe,dragging:C,selection:e}]),onClick:T?void 0:Gf(Y,A),onContextMenu:Gf(J,A),onWheel:Gf(B,A),onPointerEnter:T?void 0:g,onPointerMove:T?K:v,onPointerUp:T?Q:void 0,onPointerCancel:T?re:void 0,onPointerDownCapture:T?V:void 0,onClickCapture:T?H:void 0,onPointerLeave:k,ref:A,style:Eu,children:[w,_.jsx(Z2,{})]})}function bh({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:c,onError:f}=t.getState(),h=c.get(e);if(!h){f==null||f("012",gn.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(a({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):o([e])}function fx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:o,isSelectable:a,nodeClickDistance:l}){const c=qe(),[f,h]=P.useState(!1),m=P.useRef();return P.useEffect(()=>{m.current=zC({getStoreItems:()=>c.getState(),onNodeMouseDown:d=>{bh({id:d,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),P.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:l}),()=>{var d;(d=m.current)==null||d.destroy()}},[n,i,t,a,e,o,l]),f}const nT=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function dx(){const e=qe();return P.useCallback(n=>{const{nodeExtent:i,snapToGrid:o,snapGrid:a,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:h,nodeOrigin:m}=e.getState(),d=new Map,g=nT(l),v=o?a[0]:5,k=o?a[1]:5,w=n.direction.x*v*n.factor,b=n.direction.y*k*n.factor;for(const[,S]of h){if(!g(S))continue;let N={x:S.internals.positionAbsolute.x+w,y:S.internals.positionAbsolute.y+b};o&&(N=Ho(N,a));const{position:E,positionAbsolute:C}=Aw({nodeId:S.id,nextPosition:N,nodeLookup:h,nodeExtent:i,nodeOrigin:m,onError:c});S.position=E,S.internals.positionAbsolute=C,d.set(S.id,S)}f(d)},[])}const Zh=P.createContext(null),rT=Zh.Provider;Zh.Consumer;const hx=()=>P.useContext(Zh),iT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sT=(e,t,n)=>i=>{const{connectionClickStartHandle:o,connectionMode:a,connection:l}=i,{fromHandle:c,toHandle:f,isValid:h}=l,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:a===as.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!o,valid:m&&h}};function oT({type:e="source",position:t=ke.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:l,onConnect:c,children:f,className:h,onMouseDown:m,onTouchStart:d,...g},v){var G,Y;const k=l||null,w=e==="target",b=qe(),S=hx(),{connectOnClick:N,noPanClassName:E,rfId:C}=Me(iT,He),{connectingFrom:I,connectingTo:M,clickConnecting:L,isPossibleEndHandle:T,connectionInProcess:A,clickConnectionInProcess:z,valid:R}=Me(sT(S,k,e),He);S||(Y=(G=b.getState()).onError)==null||Y.call(G,"010",gn.error010());const $=J=>{const{defaultEdgeOptions:B,onConnect:H,hasDefaultEdges:V}=b.getState(),D={...B,...J};if(V){const{edges:U,setEdges:W,onError:K}=b.getState();W(F2(D,U,{onError:K}))}H==null||H(D),c==null||c(D)},Z=J=>{if(!S)return;const B=Fw(J.nativeEvent);if(o&&(B&&J.button===0||!B)){const H=b.getState();xh.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:w,handleId:k,nodeId:S,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...V)=>{var D,U;return(U=(D=b.getState()).onConnectEnd)==null?void 0:U.call(D,...V)},updateConnection:H.updateConnection,onConnect:$,isValidConnection:n||((...V)=>{var D,U;return((U=(D=b.getState()).isValidConnection)==null?void 0:U.call(D,...V))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}B?m==null||m(J):d==null||d(J)},j=J=>{const{onClickConnectStart:B,onClickConnectEnd:H,connectionClickStartHandle:V,connectionMode:D,isValidConnection:U,lib:W,rfId:K,nodeLookup:Q,connection:re}=b.getState();if(!S||!V&&!o)return;if(!V){B==null||B(J.nativeEvent,{nodeId:S,handleId:k,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:k}});return}const oe=$w(J.target),ee=n||U,{connection:se,isValid:de}=xh.isValid(J.nativeEvent,{handle:{nodeId:S,id:k,type:e},connectionMode:D,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ee,flowId:K,doc:oe,lib:W,nodeLookup:Q});de&&se&&$(se);const xe=structuredClone(re);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,H==null||H(J,xe),b.setState({connectionClickStartHandle:null})};return _.jsx("div",{"data-handleid":k,"data-nodeid":S,"data-handlepos":t,"data-id":`${C}-${S}-${k}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,h,{source:!w,target:w,connectable:i,connectablestart:o,connectableend:a,clickconnecting:L,connectingfrom:I,connectingto:M,valid:R,connectionindicator:i&&(!A||T)&&(A||z?a:o)}]),onMouseDown:Z,onTouchStart:Z,onClick:N?j:void 0,ref:v,...g,children:f})}const Or=P.memo(ux(oT));function aT({data:e,isConnectable:t,sourcePosition:n=ke.Bottom}){return _.jsxs(_.Fragment,{children:[e==null?void 0:e.label,_.jsx(Or,{type:"source",position:n,isConnectable:t})]})}function lT({data:e,isConnectable:t,targetPosition:n=ke.Top,sourcePosition:i=ke.Bottom}){return _.jsxs(_.Fragment,{children:[_.jsx(Or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_.jsx(Or,{type:"source",position:i,isConnectable:t})]})}function uT(){return null}function cT({data:e,isConnectable:t,targetPosition:n=ke.Top}){return _.jsxs(_.Fragment,{children:[_.jsx(Or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const iu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},t0={input:aT,default:lT,output:cT,group:uT};function fT(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 dT=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 hT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=qe(),{width:o,height:a,transformString:l,userSelectionActive:c}=Me(dT,He),f=dx(),h=P.useRef(null);P.useEffect(()=>{var v;n||(v=h.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&o!==null&&a!==null;if(fx({nodeRef:h,disabled:!m}),!m)return null;const d=e?v=>{const k=i.getState().nodes.filter(w=>w.selected);e(v,k)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(iu,v.key)&&(v.preventDefault(),f({direction:iu[v.key],factor:v.shiftKey?4:1}))};return _.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:_.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:o,height:a}})})}const n0=typeof window<"u"?window:void 0,pT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function px({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:m,selectionMode:d,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:k,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:C,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:T,autoPanOnSelection:A,defaultViewport:z,translateExtent:R,minZoom:$,maxZoom:Z,preventScrolling:j,onSelectionContextMenu:G,noWheelClassName:Y,noPanClassName:J,disableKeyboardA11y:B,onViewportChange:H,isControlledViewport:V}){const{nodesSelectionActive:D,userSelectionActive:U}=Me(pT,He),W=jo(h,{target:n0}),K=jo(w,{target:n0}),Q=K||T,re=K||C,oe=m&&Q!==!0,ee=W||U||oe;return K2({deleteKeyCode:f,multiSelectionKeyCode:k}),_.jsx(Q2,{onPaneContextMenu:a,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:!W&&Q,defaultViewport:z,translateExtent:R,minZoom:$,maxZoom:Z,zoomActivationKeyCode:b,preventScrolling:j,noWheelClassName:Y,noPanClassName:J,onViewportChange:H,isControlledViewport:V,paneClickDistance:c,selectionOnDrag:oe,children:_.jsxs(tT,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:Q,autoPanOnSelection:A,isSelecting:!!ee,selectionMode:d,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:oe,children:[e,D&&_.jsx(hT,{onSelectionContextMenu:G,noPanClassName:J,disableKeyboardA11y:B})]})})}px.displayName="FlowRenderer";const mT=P.memo(px),gT=e=>t=>e?Wh(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 yT(e){return Me(P.useCallback(gT(e),[e]),He)}const vT=e=>e.updateNodeInternals;function wT(){const e=Me(vT),[t]=P.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(o=>{const a=o.target.getAttribute("data-id");i.set(a,{id:a,nodeElement:o.target,force:!0})}),e(i)}));return P.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function xT({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const o=qe(),a=P.useRef(null),l=P.useRef(null),c=P.useRef(e.sourcePosition),f=P.useRef(e.targetPosition),h=P.useRef(t),m=n&&!!e.internals.handleBounds;return P.useEffect(()=>{a.current&&!e.hidden&&(!m||l.current!==a.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(a.current),l.current=a.current)},[m,e.hidden]),P.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),P.useEffect(()=>{if(a.current){const d=h.current!==t,g=c.current!==e.sourcePosition,v=f.current!==e.targetPosition;(d||g||v)&&(h.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function bT({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:o,onContextMenu:a,onDoubleClick:l,nodesDraggable:c,elementsSelectable:f,nodesConnectable:h,nodesFocusable:m,resizeObserver:d,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:k,rfId:w,nodeTypes:b,nodeClickDistance:S,onError:N}){const{node:E,internals:C,isParent:I}=Me(ee=>{const se=ee.nodeLookup.get(e),de=ee.parentLookup.has(e);return{node:se,internals:se.internals,isParent:de}},He);let M=E.type||"default",L=(b==null?void 0:b[M])||t0[M];L===void 0&&(N==null||N("003",gn.error003(M)),M="default",L=(b==null?void 0:b.default)||t0.default);const T=!!(E.draggable||c&&typeof E.draggable>"u"),A=!!(E.selectable||f&&typeof E.selectable>"u"),z=!!(E.connectable||h&&typeof E.connectable>"u"),R=!!(E.focusable||m&&typeof E.focusable>"u"),$=qe(),Z=Dw(E),j=xT({node:E,nodeType:M,hasDimensions:Z,resizeObserver:d}),G=fx({nodeRef:j,disabled:E.hidden||!T,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:S}),Y=dx();if(E.hidden)return null;const J=er(E),B=fT(E),H=A||T||t||n||i||o,V=n?ee=>n(ee,{...C.userNode}):void 0,D=i?ee=>i(ee,{...C.userNode}):void 0,U=o?ee=>o(ee,{...C.userNode}):void 0,W=a?ee=>a(ee,{...C.userNode}):void 0,K=l?ee=>l(ee,{...C.userNode}):void 0,Q=ee=>{const{selectNodesOnDrag:se,nodeDragThreshold:de}=$.getState();A&&(!se||!T||de>0)&&bh({id:e,store:$,nodeRef:j}),t&&t(ee,{...C.userNode})},re=ee=>{if(!(zw(ee.nativeEvent)||k)){if(Cw.includes(ee.key)&&A){const se=ee.key==="Escape";bh({id:e,store:$,unselect:se,nodeRef:j})}else if(T&&E.selected&&Object.prototype.hasOwnProperty.call(iu,ee.key)){ee.preventDefault();const{ariaLabelConfig:se}=$.getState();$.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(k||!((Se=j.current)!=null&&Se.matches(":focus-visible")))return;const{transform:ee,width:se,height:de,autoPanOnNodeFocus:xe,setCenter:he}=$.getState();if(!xe)return;Wh(new Map([[e,E]]),{x:0,y:0,width:se,height:de},ee,!0).length>0||he(E.position.x+J.width/2,E.position.y+J.height/2,{zoom:ee[2]})};return _.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${M}`,{[v]:T},E.className,{selected:E.selected,selectable:A,parent:I,draggable:T,dragging:G}]),ref:j,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:Z?"visible":"hidden",...E.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:D,onMouseLeave:U,onContextMenu:W,onClick:Q,onDoubleClick:K,onKeyDown:R?re:void 0,tabIndex:R?0:void 0,onFocus:R?oe:void 0,role:E.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${sx}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:_.jsx(rT,{value:e,children:_.jsx(L,{id:e,data:E.data,type:M,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:E.selected??!1,selectable:A,draggable:T,deletable:E.deletable??!0,isConnectable:z,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:C.z,parentId:E.parentId,...J})})})}var kT=P.memo(bT);const ST=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function mx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:o,onError:a}=Me(ST,He),l=yT(e.onlyRenderVisibleElements),c=wT();return _.jsx("div",{className:"react-flow__nodes",style:Eu,children:l.map(f=>_.jsx(kT,{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))})}mx.displayName="NodeRenderer";const ET=P.memo(mx);function NT(e){return Me(P.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const i=[];if(n.width&&n.height)for(const o of n.edges){const a=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);a&&l&&xC({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(o.id)}return i},[e]),He)}const _T=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return _.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},CT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return _.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},r0={[nu.Arrow]:_T,[nu.ArrowClosed]:CT};function TT(e){const t=qe();return P.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(r0,e)?r0[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",gn.error009(e)),null)},[e])}const OT=({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=TT(t);return f?_.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:_.jsx(f,{color:n,strokeWidth:l})}):null},gx=({defaultColor:e,rfId:t})=>{const n=Me(a=>a.edges),i=Me(a=>a.defaultEdgeOptions),o=P.useMemo(()=>TC(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return o.length?_.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:_.jsx("defs",{children:o.map(a=>_.jsx(OT,{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};gx.displayName="MarkerDefinitions";var PT=P.memo(gx);function yx({x:e,y:t,label:n,labelStyle:i,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:f,className:h,...m}){const[d,g]=P.useState({x:1,y:0,width:0,height:0}),v=rt(["react-flow__edge-textwrapper",h]),k=P.useRef(null);return P.useEffect(()=>{if(k.current){const w=k.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?_.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...m,children:[o&&_.jsx("rect",{width:d.width+2*l[0],x:-l[0],y:-l[1],height:d.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),_.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:k,style:i,children:n}),f]}):null}yx.displayName="EdgeText";const IT=P.memo(yx);function Nu({path:e,labelX:t,labelY:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:h=20,...m}){return _.jsxs(_.Fragment,{children:[_.jsx("path",{...m,d:e,fill:"none",className:rt(["react-flow__edge-path",m.className])}),h?_.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&pn(t)&&pn(n)?_.jsx(IT,{x:t,y:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function i0({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 vx({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:i,targetY:o,targetPosition:a=ke.Top}){const[l,c]=i0({pos:n,x1:e,y1:t,x2:i,y2:o}),[f,h]=i0({pos:a,x1:i,y1:o,x2:e,y2:t}),[m,d,g,v]=Bw({sourceX:e,sourceY:t,targetX:i,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${c} ${f},${h} ${i},${o}`,m,d,g,v]}function wx(e){return P.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l,targetPosition:c,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:w,markerStart:b,interactionWidth:S})=>{const[N,E,C]=vx({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c}),I=e.isInternal?void 0:t;return _.jsx(Nu,{id:I,path:N,labelX:E,labelY:C,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:w,markerStart:b,interactionWidth:S})})}const AT=wx({isInternal:!1}),xx=wx({isInternal:!0});AT.displayName="SimpleBezierEdge";xx.displayName="SimpleBezierEdgeInternal";function bx(e){return P.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,sourcePosition:v=ke.Bottom,targetPosition:k=ke.Top,markerEnd:w,markerStart:b,pathOptions:S,interactionWidth:N})=>{const[E,C,I]=yh({sourceX:n,sourceY:i,sourcePosition:v,targetX:o,targetY:a,targetPosition:k,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),M=e.isInternal?void 0:t;return _.jsx(Nu,{id:M,path:E,labelX:C,labelY:I,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:b,interactionWidth:N})})}const kx=bx({isInternal:!1}),Sx=bx({isInternal:!0});kx.displayName="SmoothStepEdge";Sx.displayName="SmoothStepEdgeInternal";function Ex(e){return P.memo(({id:t,...n})=>{var o;const i=e.isInternal?void 0:t;return _.jsx(kx,{...n,id:i,pathOptions:P.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const MT=Ex({isInternal:!1}),Nx=Ex({isInternal:!0});MT.displayName="StepEdge";Nx.displayName="StepEdgeInternal";function _x(e){return P.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:k,interactionWidth:w})=>{const[b,S,N]=Uw({sourceX:n,sourceY:i,targetX:o,targetY:a}),E=e.isInternal?void 0:t;return _.jsx(Nu,{id:E,path:b,labelX:S,labelY:N,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:k,interactionWidth:w})})}const LT=_x({isInternal:!1}),Cx=_x({isInternal:!0});LT.displayName="StraightEdge";Cx.displayName="StraightEdgeInternal";function Tx(e){return P.memo(({id:t,sourceX:n,sourceY:i,targetX:o,targetY:a,sourcePosition:l=ke.Bottom,targetPosition:c=ke.Top,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:w,markerStart:b,pathOptions:S,interactionWidth:N})=>{const[E,C,I]=Vw({sourceX:n,sourceY:i,sourcePosition:l,targetX:o,targetY:a,targetPosition:c,curvature:S==null?void 0:S.curvature}),M=e.isInternal?void 0:t;return _.jsx(Nu,{id:M,path:E,labelX:C,labelY:I,label:f,labelStyle:h,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:k,markerEnd:w,markerStart:b,interactionWidth:N})})}const RT=Tx({isInternal:!1}),Ox=Tx({isInternal:!0});RT.displayName="BezierEdge";Ox.displayName="BezierEdgeInternal";const s0={default:Ox,straight:Cx,step:Nx,smoothstep:Sx,simplebezier:xx},o0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},DT=(e,t,n)=>n===ke.Left?e-t:n===ke.Right?e+t:e,jT=(e,t,n)=>n===ke.Top?e-t:n===ke.Bottom?e+t:e,a0="react-flow__edgeupdater";function l0({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:o,onMouseEnter:a,onMouseOut:l,type:c}){return _.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:l,className:rt([a0,`${a0}-${c}`]),cx:DT(t,i,e),cy:jT(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function $T({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:o,targetX:a,targetY:l,sourcePosition:c,targetPosition:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:d,setReconnecting:g,setUpdateHover:v}){const k=qe(),w=(C,I)=>{if(C.button!==0)return;const{autoPanOnConnect:M,domNode:L,connectionMode:T,connectionRadius:A,lib:z,onConnectStart:R,cancelConnection:$,nodeLookup:Z,rfId:j,panBy:G,updateConnection:Y}=k.getState(),J=I.type==="target",B=(D,U)=>{g(!1),d==null||d(D,n,I.type,U)},H=D=>h==null?void 0:h(n,D),V=(D,U)=>{g(!0),m==null||m(C,n,I.type),R==null||R(D,U)};xh.onPointerDown(C.nativeEvent,{autoPanOnConnect:M,connectionMode:T,connectionRadius:A,domNode:L,handleId:I.id,nodeId:I.nodeId,nodeLookup:Z,isTarget:J,edgeUpdaterType:I.type,lib:z,flowId:j,cancelConnection:$,panBy:G,isValidConnection:(...D)=>{var U,W;return((W=(U=k.getState()).isValidConnection)==null?void 0:W.call(U,...D))??!0},onConnect:H,onConnectStart:V,onConnectEnd:(...D)=>{var U,W;return(W=(U=k.getState()).onConnectEnd)==null?void 0:W.call(U,...D)},onReconnectEnd:B,updateConnection:Y,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},b=C=>w(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=C=>w(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>v(!0),E=()=>v(!1);return _.jsxs(_.Fragment,{children:[(e===!0||e==="source")&&_.jsx(l0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:b,onMouseEnter:N,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&_.jsx(l0,{position:f,centerX:a,centerY:l,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:E,type:"target"})]})}function zT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:o,onDoubleClick:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,rfId:k,edgeTypes:w,noPanClassName:b,onError:S,disableKeyboardA11y:N}){let E=Me(he=>he.edgeLookup.get(e));const C=Me(he=>he.defaultEdgeOptions);E=C?{...C,...E}:E;let I=E.type||"default",M=(w==null?void 0:w[I])||s0[I];M===void 0&&(S==null||S("011",gn.error011(I)),I="default",M=(w==null?void 0:w.default)||s0.default);const L=!!(E.focusable||t&&typeof E.focusable>"u"),T=typeof d<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),A=!!(E.selectable||i&&typeof E.selectable>"u"),z=P.useRef(null),[R,$]=P.useState(!1),[Z,j]=P.useState(!1),G=qe(),{zIndex:Y,sourceX:J,sourceY:B,targetX:H,targetY:V,sourcePosition:D,targetPosition:U}=Me(P.useCallback(he=>{const fe=he.nodeLookup.get(E.source),Se=he.nodeLookup.get(E.target);if(!fe||!Se)return{zIndex:E.zIndex,...o0};const Ie=CC({id:e,sourceNode:fe,targetNode:Se,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:he.connectionMode,onError:S});return{zIndex:wC({selected:E.selected,zIndex:E.zIndex,sourceNode:fe,targetNode:Se,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Ie||o0}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),He),W=P.useMemo(()=>E.markerStart?`url('#${vh(E.markerStart,k)}')`:void 0,[E.markerStart,k]),K=P.useMemo(()=>E.markerEnd?`url('#${vh(E.markerEnd,k)}')`:void 0,[E.markerEnd,k]);if(E.hidden||J===null||B===null||H===null||V===null)return null;const Q=he=>{var Ae;const{addSelectedEdges:fe,unselectNodesAndEdges:Se,multiSelectionActive:Ie}=G.getState();A&&(G.setState({nodesSelectionActive:!1}),E.selected&&Ie?(Se({nodes:[],edges:[E]}),(Ae=z.current)==null||Ae.blur()):fe([e])),o&&o(he,E)},re=a?he=>{a(he,{...E})}:void 0,oe=l?he=>{l(he,{...E})}:void 0,ee=c?he=>{c(he,{...E})}:void 0,se=f?he=>{f(he,{...E})}:void 0,de=h?he=>{h(he,{...E})}:void 0,xe=he=>{var fe;if(!N&&Cw.includes(he.key)&&A){const{unselectNodesAndEdges:Se,addSelectedEdges:Ie}=G.getState();he.key==="Escape"?((fe=z.current)==null||fe.blur(),Se({edges:[E]})):Ie([e])}};return _.jsx("svg",{style:{zIndex:Y},children:_.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${I}`,E.className,b,{selected:E.selected,animated:E.animated,inactive:!A&&!o,updating:R,selectable:A}]),onClick:Q,onDoubleClick:re,onContextMenu:oe,onMouseEnter:ee,onMouseMove:se,onMouseLeave:de,onKeyDown:L?xe:void 0,tabIndex:L?0:void 0,role:E.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":L?`${ox}-${k}`:void 0,ref:z,...E.domAttributes,children:[!Z&&_.jsx(M,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:A,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:J,sourceY:B,targetX:H,targetY:V,sourcePosition:D,targetPosition:U,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:W,markerEnd:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),T&&_.jsx($T,{edge:E,isReconnectable:T,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:J,sourceY:B,targetX:H,targetY:V,sourcePosition:D,targetPosition:U,setUpdateHover:$,setReconnecting:j})]})})}var FT=P.memo(zT);const BT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Px({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:o,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:k,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:N,onError:E}=Me(BT,He),C=NT(t);return _.jsxs("div",{className:"react-flow__edges",children:[_.jsx(PT,{defaultColor:e,rfId:n}),C.map(I=>_.jsx(FT,{id:I,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:N,noPanClassName:o,onReconnect:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,onClick:m,reconnectRadius:d,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:k,rfId:n,onError:E,edgeTypes:i,disableKeyboardA11y:w},I))]})}Px.displayName="EdgeRenderer";const VT=P.memo(Px),WT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function UT({children:e}){const t=Me(WT);return _.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function HT(e){const t=Jh(),n=P.useRef(!1);P.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const qT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function YT(e){const t=Me(qT),n=qe();return P.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function KT(e){return e.connection.inProgress?{...e.connection,to:ys(e.connection.to,e.transform)}:{...e.connection}}function GT(e){return KT}function XT(e){const t=GT();return Me(t,He)}const QT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function JT({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:o,width:a,height:l,isValid:c,inProgress:f}=Me(QT,He);return!(a&&o&&f)?null:_.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:_.jsx("g",{className:rt(["react-flow__connection",Pw(c)]),children:_.jsx(Ix,{style:t,type:n,CustomComponent:i,isValid:c})})})}const Ix=({style:e,type:t=Tr.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:o,from:a,fromNode:l,fromHandle:c,fromPosition:f,to:h,toNode:m,toHandle:d,toPosition:g,pointer:v}=XT();if(!o)return;if(n)return _.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:a.x,fromY:a.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Pw(i),toNode:m,toHandle:d,pointer:v});let k="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(t){case Tr.Bezier:[k]=Vw(w);break;case Tr.SimpleBezier:[k]=vx(w);break;case Tr.Step:[k]=yh({...w,borderRadius:0});break;case Tr.SmoothStep:[k]=yh(w);break;default:[k]=Uw(w)}return _.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};Ix.displayName="ConnectionLine";const ZT={};function u0(e=ZT){P.useRef(e),qe(),P.useEffect(()=>{},[e])}function eO(){qe(),P.useRef(!1),P.useEffect(()=>{},[])}function Ax({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:v,connectionLineType:k,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:N,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:I,panActivationKeyCode:M,zoomActivationKeyCode:L,deleteKeyCode:T,onlyRenderVisibleElements:A,elementsSelectable:z,defaultViewport:R,translateExtent:$,minZoom:Z,maxZoom:j,preventScrolling:G,defaultMarkerColor:Y,zoomOnScroll:J,zoomOnPinch:B,panOnScroll:H,panOnScrollSpeed:V,panOnScrollMode:D,zoomOnDoubleClick:U,panOnDrag:W,autoPanOnSelection:K,onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneScroll:se,onPaneContextMenu:de,paneClickDistance:xe,nodeClickDistance:he,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:Fe,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht,viewport:Rt,onViewportChange:qt}){return u0(e),u0(t),eO(),HT(n),YT(Rt),_.jsx(mT,{onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:ee,onPaneContextMenu:de,onPaneScroll:se,paneClickDistance:xe,deleteKeyCode:T,selectionKeyCode:N,selectionOnDrag:E,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:M,zoomActivationKeyCode:L,elementsSelectable:z,zoomOnScroll:J,zoomOnPinch:B,zoomOnDoubleClick:U,panOnScroll:H,panOnScrollSpeed:V,panOnScrollMode:D,panOnDrag:W,autoPanOnSelection:K,defaultViewport:R,translateExtent:$,minZoom:Z,maxZoom:j,onSelectionContextMenu:d,preventScrolling:G,noDragClassName:pt,noWheelClassName:Dn,noPanClassName:bn,disableKeyboardA11y:kn,onViewportChange:qt,isControlledViewport:!!Rt,children:_.jsxs(UT,{children:[_.jsx(VT,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:wt,onReconnectStart:Nt,onReconnectEnd:ht,onlyRenderVisibleElements:A,onEdgeContextMenu:fe,onEdgeMouseEnter:Se,onEdgeMouseMove:Ie,onEdgeMouseLeave:Ae,reconnectRadius:Fe,defaultMarkerColor:Y,noPanClassName:bn,disableKeyboardA11y:kn,rfId:Ht}),_.jsx(JT,{style:w,type:k,component:b,containerStyle:S}),_.jsx("div",{className:"react-flow__edgelabel-renderer"}),_.jsx(ET,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:A,noPanClassName:bn,noDragClassName:pt,disableKeyboardA11y:kn,nodeExtent:_t,rfId:Ht}),_.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ax.displayName="GraphView";const tO=P.memo(Ax),nO=Rw(),c0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f=.5,maxZoom:h=2,nodeOrigin:m,nodeExtent:d,zIndexMode:g="basic"}={})=>{const v=new Map,k=new Map,w=new Map,b=new Map,S=i??t??[],N=n??e??[],E=m??[0,0],C=d??Mo;Yw(w,b,S);const{nodesInitialized:I}=wh(N,v,k,{nodeOrigin:E,nodeExtent:C,zIndexMode:g});let M=[0,0,1];if(l&&o&&a){const L=Uo(v,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:T,y:A,zoom:z}=Hh(L,o,a,f,h,(c==null?void 0:c.padding)??.1);M=[T,A,z]}return{rfId:"1",width:o??0,height:a??0,transform:M,nodes:N,nodesInitialized:I,nodeLookup:v,parentLookup:k,edges:S,edgeLookup:b,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Mo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:as.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Ow},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nO,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Tw,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g})=>g2((v,k)=>{async function w(){const{nodeLookup:b,panZoom:S,fitViewOptions:N,fitViewResolver:E,width:C,height:I,minZoom:M,maxZoom:L}=k();S&&(await dC({nodes:b,width:C,height:I,panZoom:S,minZoom:M,maxZoom:L},N),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...c0({nodes:e,edges:t,width:o,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:d,defaultNodes:n,defaultEdges:i,zIndexMode:g}),setNodes:b=>{const{nodeLookup:S,parentLookup:N,nodeOrigin:E,elevateNodesOnSelect:C,fitViewQueued:I,zIndexMode:M,nodesSelectionActive:L}=k(),{nodesInitialized:T,hasSelectedNodes:A}=wh(b,S,N,{nodeOrigin:E,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:M}),z=L&&A;I&&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:S,edgeLookup:N}=k();Yw(S,N,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:N}=k();N(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:N}=k();N(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:N,parentLookup:E,domNode:C,nodeOrigin:I,nodeExtent:M,debug:L,fitViewQueued:T,zIndexMode:A}=k(),{changes:z,updatedInternals:R}=RC(b,N,E,C,I,M,A);R&&(IC(N,E,{nodeOrigin:I,nodeExtent:M,zIndexMode:A}),T?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(z==null?void 0:z.length)>0&&(L&&console.log("React Flow: trigger node changes",z),S==null||S(z)))},updateNodePositions:(b,S=!1)=>{const N=[];let E=[];const{nodeLookup:C,triggerNodeChanges:I,connection:M,updateConnection:L,onNodesChangeMiddlewareMap:T}=k();for(const[A,z]of b){const R=C.get(A),$=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(z!=null&&z.position)),Z={id:A,type:"position",position:$?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:S};if(R&&M.inProgress&&M.fromNode.id===R.id){const j=ci(R,M.fromHandle,ke.Left,!0);L({...M,from:j})}$&&R.parentId&&N.push({id:A,parentId:R.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),E.push(Z)}if(N.length>0){const{parentLookup:A,nodeOrigin:z}=k(),R=Qh(N,C,A,z);E.push(...R)}for(const A of T.values())E=A(E);I(E)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:N,nodes:E,hasDefaultNodes:C,debug:I}=k();if(b!=null&&b.length){if(C){const M=j2(b,E);N(M)}I&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:N,edges:E,hasDefaultEdges:C,debug:I}=k();if(b!=null&&b.length){if(C){const M=$2(b,E);N(M)}I&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:I}=k();if(S){const M=b.map(L=>Zr(L,!0));C(M);return}C(Xi(E,new Set([...b]),!0)),I(Xi(N))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:I}=k();if(S){const M=b.map(L=>Zr(L,!0));I(M);return}I(Xi(N,new Set([...b]))),C(Xi(E,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:N,nodes:E,nodeLookup:C,triggerNodeChanges:I,triggerEdgeChanges:M}=k(),L=b||E,T=S||N,A=[];for(const R of L){if(!R.selected)continue;const $=C.get(R.id);$&&($.selected=!1),A.push(Zr(R.id,!1))}const z=[];for(const R of T)R.selected&&z.push(Zr(R.id,!1));I(A),M(z)},setMinZoom:b=>{const{panZoom:S,maxZoom:N}=k();S==null||S.setScaleExtent([b,N]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:N}=k();S==null||S.setScaleExtent([N,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=k().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:N,triggerEdgeChanges:E,elementsSelectable:C}=k();if(!C)return;const I=S.reduce((L,T)=>T.selected?[...L,Zr(T.id,!1)]:L,[]),M=b.reduce((L,T)=>T.selected?[...L,Zr(T.id,!1)]:L,[]);N(I),E(M)},setNodeExtent:b=>{const{nodes:S,nodeLookup:N,parentLookup:E,nodeOrigin:C,elevateNodesOnSelect:I,nodeExtent:M,zIndexMode:L}=k();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(S,N,E,{nodeOrigin:C,nodeExtent:b,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:L}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:N,height:E,panZoom:C,translateExtent:I}=k();return DC({delta:b,panZoom:C,transform:S,translateExtent:I,width:N,height:E})},setCenter:async(b,S,N)=>{const{width:E,height:C,maxZoom:I,panZoom:M}=k();if(!M)return!1;const L=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:I;return await M.setViewport({x:E/2-b*L,y:C/2-S*L,zoom:L},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),!0},cancelConnection:()=>{v({connection:{...Ow}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...c0()})}},Object.is);function Mx({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:o,initialHeight:a,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:f,fitView:h,nodeOrigin:m,nodeExtent:d,zIndexMode:g,children:v}){const[k]=P.useState(()=>rO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:o,height:a,fitView:h,minZoom:l,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:d,zIndexMode:g}));return _.jsx(y2,{value:k,children:_.jsx(U2,{children:v})})}function iO({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:o,width:a,height:l,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v}){return P.useContext(ku)?_.jsx(_.Fragment,{children:e}):_.jsx(Mx,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:o,initialWidth:a,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v,children:e})}const sO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function oO({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:o,nodeTypes:a,edgeTypes:l,onNodeClick:c,onEdgeClick:f,onInit:h,onMove:m,onMoveStart:d,onMoveEnd:g,onConnect:v,onConnectStart:k,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:N,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:M,onNodeDragStart:L,onNodeDrag:T,onNodeDragStop:A,onNodesDelete:z,onEdgesDelete:R,onDelete:$,onSelectionChange:Z,onSelectionDragStart:j,onSelectionDrag:G,onSelectionDragStop:Y,onSelectionContextMenu:J,onSelectionStart:B,onSelectionEnd:H,onBeforeDelete:V,connectionMode:D,connectionLineType:U=Tr.Bezier,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:Q,deleteKeyCode:re="Backspace",selectionKeyCode:oe="Shift",selectionOnDrag:ee=!1,selectionMode:se=Lo.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:xe=Do()?"Meta":"Control",zoomActivationKeyCode:he=Do()?"Meta":"Control",snapToGrid:fe,snapGrid:Se,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:Ae,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,nodeOrigin:pt=ax,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:kn=!0,defaultViewport:_t=P2,minZoom:Ht=.5,maxZoom:Rt=2,translateExtent:qt=Mo,preventScrolling:Xo=!0,nodeExtent:jn,defaultMarkerColor:Mr="#b1b1b7",zoomOnScroll:Fu=!0,zoomOnPinch:Qo=!0,panOnScroll:Jo=!1,panOnScrollSpeed:Bu=.5,panOnScrollMode:Ss=si.Free,zoomOnDoubleClick:Es=!0,panOnDrag:Ns=!0,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta=1,nodeClickDistance:na=0,children:ra,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Os,onEdgeDoubleClick:Rr,onEdgeMouseEnter:Vu,onEdgeMouseMove:Dr,onEdgeMouseLeave:hi,reconnectRadius:pi=10,onNodesChange:Ps,onEdgesChange:Wu,noDragClassName:Uu="nodrag",noWheelClassName:Hu="nowheel",noPanClassName:Sn="nopan",fitView:Is,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:mi,isValidConnection:Gu,onError:fa,style:gi,id:Dt,nodeDragThreshold:Xu,connectionDragThreshold:jt,viewport:Qu,onViewportChange:Ju,width:Zu,height:yi,colorMode:vi="light",debug:jr,onScroll:$n,ariaLabelConfig:ec,zIndexMode:da="basic",...Ls},ha){const $r=Dt||"1",zr=L2(vi),tc=P.useCallback(wi=>{wi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$n==null||$n(wi)},[$n]);return _.jsx("div",{"data-testid":"rf__wrapper",...Ls,onScroll:tc,style:{...gi,...sO},ref:ha,className:rt(["react-flow",o,zr]),id:Dt,role:"application",children:_.jsxs(iO,{nodes:e,edges:t,width:Zu,height:yi,fitView:Is,fitViewOptions:As,minZoom:Ht,maxZoom:Rt,nodeOrigin:pt,nodeExtent:jn,zIndexMode:da,children:[_.jsx(M2,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:k,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Fe,autoPanOnNodeFocus:wt,nodesConnectable:Nt,nodesFocusable:ht,edgesFocusable:Dn,edgesReconnectable:bn,elementsSelectable:kn,elevateNodesOnSelect:la,elevateEdgesOnSelect:Yu,minZoom:Ht,maxZoom:Rt,nodeExtent:jn,onNodesChange:Ps,onEdgesChange:Wu,snapToGrid:fe,snapGrid:Se,connectionMode:D,translateExtent:qt,connectOnClick:qu,defaultEdgeOptions:aa,fitView:Is,fitViewOptions:As,onNodesDelete:z,onEdgesDelete:R,onDelete:$,onNodeDragStart:L,onNodeDrag:T,onNodeDragStop:A,onSelectionDrag:G,onSelectionDragStart:j,onSelectionDragStop:Y,onMove:m,onMoveStart:d,onMoveEnd:g,noPanClassName:Sn,nodeOrigin:pt,rfId:$r,autoPanOnConnect:Ye,autoPanOnNodeDrag:Ku,autoPanSpeed:ca,onError:fa,connectionRadius:mi,isValidConnection:Gu,selectNodesOnDrag:Ae,nodeDragThreshold:Xu,connectionDragThreshold:jt,onBeforeDelete:V,debug:jr,ariaLabelConfig:ec,zIndexMode:da}),_.jsx(tO,{onInit:h,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:M,nodeTypes:a,edgeTypes:l,connectionLineType:U,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:Q,selectionKeyCode:oe,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:re,multiSelectionKeyCode:xe,panActivationKeyCode:de,zoomActivationKeyCode:he,onlyRenderVisibleElements:Ie,defaultViewport:_t,translateExtent:qt,minZoom:Ht,maxZoom:Rt,preventScrolling:Xo,zoomOnScroll:Fu,zoomOnPinch:Qo,zoomOnDoubleClick:Es,panOnScroll:Jo,panOnScrollSpeed:Bu,panOnScrollMode:Ss,panOnDrag:Ns,autoPanOnSelection:Ms,onPaneClick:_s,onPaneMouseEnter:Cs,onPaneMouseMove:tr,onPaneMouseLeave:nr,onPaneScroll:Zo,onPaneContextMenu:ea,paneClickDistance:ta,nodeClickDistance:na,onSelectionContextMenu:J,onSelectionStart:B,onSelectionEnd:H,onReconnect:Ts,onReconnectStart:ia,onReconnectEnd:Lr,onEdgeContextMenu:Os,onEdgeDoubleClick:Rr,onEdgeMouseEnter:Vu,onEdgeMouseMove:Dr,onEdgeMouseLeave:hi,reconnectRadius:pi,defaultMarkerColor:Mr,noDragClassName:Uu,noWheelClassName:Hu,noPanClassName:Sn,rfId:$r,disableKeyboardA11y:ua,nodeExtent:jn,viewport:Qu,onViewportChange:Ju}),_.jsx(O2,{onSelectionChange:Z}),ra,_.jsx(E2,{proOptions:oa,position:sa}),_.jsx(S2,{rfId:$r,disableKeyboardA11y:ua})]})})}var aO=ux(oO);function lO({dimensions:e,lineWidth:t,variant:n,className:i}){return _.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",n,i])})}function uO({radius:e,className:t}){return _.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",t])})}var Qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qn||(Qn={}));const cO={[Qn.Dots]:1,[Qn.Lines]:1,[Qn.Cross]:6},fO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Lx({id:e,variant:t=Qn.Dots,gap:n=20,size:i,lineWidth:o=1,offset:a=0,color:l,bgColor:c,style:f,className:h,patternClassName:m}){const d=P.useRef(null),{transform:g,patternId:v}=Me(fO,He),k=i||cO[t],w=t===Qn.Dots,b=t===Qn.Cross,S=Array.isArray(n)?n:[n,n],N=[S[0]*g[2]||1,S[1]*g[2]||1],E=k*g[2],C=Array.isArray(a)?a:[a,a],I=b?[E,E]:N,M=[C[0]*g[2]||1+I[0]/2,C[1]*g[2]||1+I[1]/2],L=`${v}${e||""}`;return _.jsxs("svg",{className:rt(["react-flow__background",h]),style:{...f,...Eu,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:d,"data-testid":"rf__background",children:[_.jsx("pattern",{id:L,x:g[0]%N[0],y:g[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?_.jsx(uO,{radius:E/2,className:m}):_.jsx(lO,{dimensions:I,lineWidth:o,variant:t,className:m})}),_.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}Lx.displayName="Background";const dO=P.memo(Lx);function hO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function pO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function gO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function yO(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Sl({children:e,className:t,...n}){return _.jsx("button",{type:"button",className:rt(["react-flow__controls-button",t]),...n,children:e})}const vO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Rx({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:l,onFitView:c,onInteractiveChange:f,className:h,children:m,position:d="bottom-left",orientation:g="vertical","aria-label":v}){const k=qe(),{isInteractive:w,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:N}=Me(vO,He),{zoomIn:E,zoomOut:C,fitView:I}=Jh(),M=()=>{E(),a==null||a()},L=()=>{C(),l==null||l()},T=()=>{I(o),c==null||c()},A=()=>{k.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},z=g==="horizontal"?"horizontal":"vertical";return _.jsxs(Su,{className:rt(["react-flow__controls",z,h]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&_.jsxs(_.Fragment,{children:[_.jsx(Sl,{onClick:M,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:S,children:_.jsx(hO,{})}),_.jsx(Sl,{onClick:L,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:b,children:_.jsx(pO,{})})]}),n&&_.jsx(Sl,{className:"react-flow__controls-fitview",onClick:T,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:_.jsx(mO,{})}),i&&_.jsx(Sl,{className:"react-flow__controls-interactive",onClick:A,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:w?_.jsx(yO,{}):_.jsx(gO,{})}),m]})}Rx.displayName="Controls";const wO=P.memo(Rx);function xO({id:e,x:t,y:n,width:i,height:o,style:a,color:l,strokeColor:c,strokeWidth:f,className:h,borderRadius:m,shapeRendering:d,selected:g,onClick:v}){const{background:k,backgroundColor:w}=a||{},b=l||k||w;return _.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:g},h]),x:t,y:n,rx:m,ry:m,width:i,height:o,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const bO=P.memo(xO),kO=e=>e.nodes.map(t=>t.id),Xf=e=>e instanceof Function?e:()=>e;function SO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:a=bO,onClick:l}){const c=Me(kO,He),f=Xf(t),h=Xf(e),m=Xf(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return _.jsx(_.Fragment,{children:c.map(g=>_.jsx(NO,{id:g,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:o,NodeComponent:a,onClick:l,shapeRendering:d},g))})}function EO({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:c,onClick:f}){const{node:h,x:m,y:d,width:g,height:v}=Me(k=>{const w=k.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const b=w.internals.userNode,{x:S,y:N}=w.internals.positionAbsolute,{width:E,height:C}=er(b);return{node:b,x:S,y:N,width:E,height:C}},He);return!h||h.hidden||!Dw(h)?null:_.jsx(c,{x:m,y:d,width:g,height:v,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:o,strokeColor:n(h),strokeWidth:a,shapeRendering:l,onClick:f,id:h.id})}const NO=P.memo(EO);var _O=P.memo(SO);const CO=200,TO=150,OO=e=>!e.hidden,PO=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?Lw(Uo(e.nodeLookup,{filter:OO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},IO="react-flow__minimap-desc";function Dx({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:f,maskColor:h,maskStrokeColor:m,maskStrokeWidth:d,position:g="bottom-right",onClick:v,onNodeClick:k,pannable:w=!1,zoomable:b=!1,ariaLabel:S,inversePan:N,zoomStep:E=1,offsetScale:C=5}){const I=qe(),M=P.useRef(null),{boundingRect:L,viewBB:T,rfId:A,panZoom:z,translateExtent:R,flowWidth:$,flowHeight:Z,ariaLabelConfig:j}=Me(PO,He),G=(e==null?void 0:e.width)??CO,Y=(e==null?void 0:e.height)??TO,J=L.width/G,B=L.height/Y,H=Math.max(J,B),V=H*G,D=H*Y,U=C*H,W=L.x-(V-L.width)/2-U,K=L.y-(D-L.height)/2-U,Q=V+U*2,re=D+U*2,oe=`${IO}-${A}`,ee=P.useRef(0),se=P.useRef();ee.current=H,P.useEffect(()=>{if(M.current&&z)return se.current=HC({domNode:M.current,panZoom:z,getTransform:()=>I.getState().transform,getViewScale:()=>ee.current}),()=>{var fe;(fe=se.current)==null||fe.destroy()}},[z]),P.useEffect(()=>{var fe;(fe=se.current)==null||fe.update({translateExtent:R,width:$,height:Z,inversePan:N,pannable:w,zoomStep:E,zoomable:b})},[w,b,N,E,R,$,Z]);const de=v?fe=>{var Ae;const[Se,Ie]=((Ae=se.current)==null?void 0:Ae.pointer(fe))||[0,0];v(fe,{x:Se,y:Ie})}:void 0,xe=k?P.useCallback((fe,Se)=>{const Ie=I.getState().nodeLookup.get(Se).internals.userNode;k(fe,Ie)},[]):void 0,he=S??j["minimap.ariaLabel"];return _.jsx(Su,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*H:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:rt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:_.jsxs("svg",{width:G,height:Y,viewBox:`${W} ${K} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:M,onClick:de,children:[he&&_.jsx("title",{id:oe,children:he}),_.jsx(_O,{onClick:xe,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),_.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-U},${K-U}h${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"})]})})}Dx.displayName="MiniMap";P.memo(Dx);const AO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,MO={[fs.Line]:"right",[fs.Handle]:"bottom-right"};function LO({nodeId:e,position:t,variant:n=fs.Handle,className:i,style:o=void 0,children:a,color:l,minWidth:c=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:v=!0,shouldResize:k,onResizeStart:w,onResize:b,onResizeEnd:S}){const N=hx(),E=typeof e=="string"?e:N,C=qe(),I=P.useRef(null),M=n===fs.Handle,L=Me(P.useCallback(AO(M&&v),[M,v]),He),T=P.useRef(null),A=t??MO[n];P.useEffect(()=>{if(!(!I.current||!E))return T.current||(T.current=i2({domNode:I.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:R,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,domNode:Y}=C.getState();return{nodeLookup:R,transform:$,snapGrid:Z,snapToGrid:j,nodeOrigin:G,paneDomNode:Y}},onChange:(R,$)=>{const{triggerNodeChanges:Z,nodeLookup:j,parentLookup:G,nodeOrigin:Y}=C.getState(),J=[],B={x:R.x,y:R.y},H=j.get(E);if(H&&H.expandParent&&H.parentId){const V=H.origin??Y,D=R.width??H.measured.width??0,U=R.height??H.measured.height??0,W={id:H.id,parentId:H.parentId,rect:{width:D,height:U,...jw({x:R.x??H.position.x,y:R.y??H.position.y},{width:D,height:U},H.parentId,j,V)}},K=Qh([W],j,G,Y);J.push(...K),B.x=R.x?Math.max(V[0]*D,R.x):void 0,B.y=R.y?Math.max(V[1]*U,R.y):void 0}if(B.x!==void 0&&B.y!==void 0){const V={id:E,type:"position",position:{...B}};J.push(V)}if(R.width!==void 0&&R.height!==void 0){const D={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};J.push(D)}for(const V of $){const D={...V,type:"position"};J.push(D)}Z(J)},onEnd:({width:R,height:$})=>{const Z={id:E,type:"dimensions",resizing:!1,dimensions:{width:R,height:$}};C.getState().triggerNodeChanges([Z])}})),T.current.update({controlPosition:A,boundaries:{minWidth:c,minHeight:f,maxWidth:h,maxHeight:m},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:S,shouldResize:k}),()=>{var R;(R=T.current)==null||R.destroy()}},[A,c,f,h,m,d,w,b,S,k]);const z=A.split("-");return _.jsx("div",{className:rt(["react-flow__resize-control","nodrag",...z,n,i]),ref:I,style:{...o,scale:L,...l&&{[M?"backgroundColor":"borderColor"]:l}},children:a})}P.memo(LO);function jx(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=jx(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function $x(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=jx(e))&&(i&&(i+=" "),i+=t);return i}const RO=(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},DO=(e,t)=>({classGroupId:e,validator:t}),zx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),su="-",f0=[],jO="arbitrary..",$O=e=>{const t=FO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return zO(l);const c=l.split(su),f=c[0]===""&&c.length>1?1:0;return Fx(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=i[l],h=n[l];return f?h?RO(h,f):f:h||f0}return n[l]||f0}}},Fx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const h=Fx(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(su):e.slice(t).join(su),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},zO=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?jO+i:void 0})(),FO=e=>{const{theme:t,classGroups:n}=e;return BO(n,t)},BO=(e,t)=>{const n=zx();for(const i in e){const o=e[i];ep(o,n,i,t)}return n},ep=(e,t,n,i)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];VO(l,t,n,i)}},VO=(e,t,n,i)=>{if(typeof e=="string"){WO(e,t,n);return}if(typeof e=="function"){UO(e,t,n,i);return}HO(e,t,n,i)},WO=(e,t,n)=>{const i=e===""?t:Bx(t,e);i.classGroupId=n},UO=(e,t,n,i)=>{if(qO(e)){ep(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(DO(n,e))},HO=(e,t,n,i)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[c,f]=o[l];ep(f,Bx(t,c),n,i)}},Bx=(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=zx(),n.nextPart.set(l,c)),n=c}return n},qO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,YO=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="!",d0=":",KO=[],h0=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),GO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=o=>{const a=[];let l=0,c=0,f=0,h;const m=o.length;for(let w=0;w<m;w++){const b=o[w];if(l===0&&c===0){if(b===d0){a.push(o.slice(f,w)),f=w+1;continue}if(b==="/"){h=w;continue}}b==="["?l++:b==="]"?l--:b==="("?c++:b===")"&&c--}const d=a.length===0?o:o.slice(f);let g=d,v=!1;d.endsWith(kh)?(g=d.slice(0,-1),v=!0):d.startsWith(kh)&&(g=d.slice(1),v=!0);const k=h&&h>f?h-f:void 0;return h0(a,v,g,k)};if(t){const o=t+d0,a=i;i=l=>l.startsWith(o)?a(l.slice(o.length)):h0(KO,!1,l,void 0,!0)}if(n){const o=i;i=a=>n({className:a,parseClassName:o})}return i},XO=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}},QO=e=>({cache:YO(e.cacheSize),parseClassName:GO(e),sortModifiers:XO(e),postfixLookupClassGroupIds:JO(e),...$O(e)}),JO=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},ZO=/\s+/,eP=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],f=e.trim().split(ZO);let h="";for(let m=f.length-1;m>=0;m-=1){const d=f[m],{isExternal:g,modifiers:v,hasImportantModifier:k,baseClassName:w,maybePostfixModifierPosition:b}=n(d);if(g){h=d+(h.length>0?" "+h:h);continue}let S=!!b,N;if(S){const L=w.substring(0,b);N=i(L);const T=N&&l[N]?i(w):void 0;T&&T!==N&&(N=T,S=!1)}else N=i(w);if(!N){if(!S){h=d+(h.length>0?" "+h:h);continue}if(N=i(w),!N){h=d+(h.length>0?" "+h:h);continue}S=!1}const E=v.length===0?"":v.length===1?v[0]:a(v).join(":"),C=k?E+kh:E,I=C+N;if(c.indexOf(I)>-1)continue;c.push(I);const M=o(N,S);for(let L=0;L<M.length;++L){const T=M[L];c.push(C+T)}h=d+(h.length>0?" "+h:h)}return h},tP=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=Vx(n))&&(o&&(o+=" "),o+=i);return o},Vx=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Vx(e[i]))&&(n&&(n+=" "),n+=t);return n},nP=(e,...t)=>{let n,i,o,a;const l=f=>{const h=t.reduce((m,d)=>d(m),e());return n=QO(h),i=n.cache.get,o=n.cache.set,a=c,c(f)},c=f=>{const h=i(f);if(h)return h;const m=eP(f,n);return o(f,m),m};return a=l,(...f)=>a(tP(...f))},rP=[],ot=e=>{const t=n=>n[e]||rP;return t.isThemeGetter=!0,t},Wx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ux=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oP=/\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$/,aP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Er=e=>iP.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),Qf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Kn=e=>sP.test(e),Hx=()=>!0,cP=e=>oP.test(e)&&!aP.test(e),tp=()=>!1,fP=e=>lP.test(e),dP=e=>uP.test(e),hP=e=>!me(e)&&!ye(e),pP=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)),mP=e=>Ir(e,Kx,tp),me=e=>Wx.test(e),Jr=e=>Ir(e,Gx,cP),p0=e=>Ir(e,SP,Oe),gP=e=>Ir(e,Qx,Hx),yP=e=>Ir(e,Xx,tp),m0=e=>Ir(e,qx,tp),vP=e=>Ir(e,Yx,dP),El=e=>Ir(e,Jx,fP),ye=e=>Ux.test(e),go=e=>di(e,Gx),wP=e=>di(e,Xx),g0=e=>di(e,qx),xP=e=>di(e,Kx),bP=e=>di(e,Yx),Nl=e=>di(e,Jx,!0),kP=e=>di(e,Qx,!0),Ir=(e,t,n)=>{const i=Wx.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},di=(e,t,n=!1)=>{const i=Ux.exec(e);return i?i[1]?t(i[1]):n:!1},qx=e=>e==="position"||e==="percentage",Yx=e=>e==="image"||e==="url",Kx=e=>e==="length"||e==="size"||e==="bg-size",Gx=e=>e==="length",SP=e=>e==="number",Xx=e=>e==="family-name",Qx=e=>e==="number"||e==="weight",Jx=e=>e==="shadow",EP=()=>{const e=ot("color"),t=ot("font"),n=ot("text"),i=ot("font-weight"),o=ot("tracking"),a=ot("leading"),l=ot("breakpoint"),c=ot("container"),f=ot("spacing"),h=ot("radius"),m=ot("shadow"),d=ot("inset-shadow"),g=ot("text-shadow"),v=ot("drop-shadow"),k=ot("blur"),w=ot("perspective"),b=ot("aspect"),S=ot("ease"),N=ot("animate"),E=()=>["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"],I=()=>[...C(),ye,me],M=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],T=()=>[ye,me,f],A=()=>[Er,"full","auto",...T()],z=()=>[Tn,"none","subgrid",ye,me],R=()=>["auto",{span:["full",Tn,ye,me]},Tn,ye,me],$=()=>[Tn,"auto",ye,me],Z=()=>["auto","min","max","fr",ye,me],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...T()],J=()=>[Er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],B=()=>[Er,"screen","full","dvw","lvw","svw","min","max","fit",...T()],H=()=>[Er,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],V=()=>[e,ye,me],D=()=>[...C(),g0,m0,{position:[ye,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",xP,mP,{size:[ye,me]}],K=()=>[Qf,go,Jr],Q=()=>["","none","full",h,ye,me],re=()=>["",Oe,go,Jr],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,g0,m0],de=()=>["","none",k,ye,me],xe=()=>["none",Oe,ye,me],he=()=>["none",Oe,ye,me],fe=()=>[Oe,ye,me],Se=()=>[Er,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[Hx],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[hP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",Oe],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Er,me,ye,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,me]}],"container-named":[pP],columns:[{columns:[Oe,me,ye,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",ye,me]}],basis:[{basis:[Er,"full","auto",c,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Er,"auto","initial","none",me]}],grow:[{grow:["",Oe,ye,me]}],shrink:[{shrink:["",Oe,ye,me]}],order:[{order:[Tn,"first","last","none",ye,me]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],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:J()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,go,Jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,kP,gP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qf,me]}],"font-family":[{font:[wP,yP,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,p0]}],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:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Jr]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent: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:D()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,ye,me],radial:["",ye,me],conic:[Tn,ye,me]},bP,vP]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded: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:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,me]}],"outline-w":[{outline:["",Oe,go,Jr]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,Nl,El]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",d,Nl,El]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Oe,Jr]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",g,Nl,El]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Oe,ye,me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ye,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":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":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,me]}],filter:[{filter:["","none",ye,me]}],blur:[{blur:de()}],brightness:[{brightness:[Oe,ye,me]}],contrast:[{contrast:[Oe,ye,me]}],"drop-shadow":[{"drop-shadow":["","none",v,Nl,El]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Oe,ye,me]}],"hue-rotate":[{"hue-rotate":[Oe,ye,me]}],invert:[{invert:["",Oe,ye,me]}],saturate:[{saturate:[Oe,ye,me]}],sepia:[{sepia:["",Oe,ye,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":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",S,ye,me]}],delay:[{delay:[Oe,ye,me]}],animate:[{animate:["none",N,ye,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ye,me]}],"perspective-origin":[{"perspective-origin":I()}],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:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],zoom:[{zoom:[Tn,ye,me]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":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",...V()]}],"stroke-w":[{stroke:[Oe,go,Jr,p0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},NP=nP(EP);function je(...e){return NP($x(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 _P(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 y0(e,t,n){return Zx(_P(e,t),n)}function Zx(e,t){let n=new Date(yo(e)),i=bo(n,e.tz),o=yo(e),a=yo(i),l=o-a,c=new Date(n.getTime()+l),f=bo(c,e.tz);if(Jf(f,e)){let d=new Date(c.getTime()-36e5),g=bo(d,e.tz);return Jf(g,e)?d:c}let h=new Date(c.getTime()+yo(e)-yo(f)),m=bo(h,e.tz);if(Jf(m,e))return h;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>h.getTime()?c:h}function bo(e,t){let n,i;try{n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),i=n.formatToParts(e)}catch(a){let l=a instanceof Error?a.message:String(a);throw new RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${l}`)}let o={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let a of i)(a.type==="year"||a.type==="month"||a.type==="day"||a.type==="hour"||a.type==="minute"||a.type==="second")&&(o[a.type]=parseInt(a.value,10));if(isNaN(o.year)||isNaN(o.month)||isNaN(o.day)||isNaN(o.hour)||isNaN(o.minute)||isNaN(o.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(o)}`);return o.hour===24&&(o.hour=0),{y:o.year,m:o.month,d:o.day,h:o.hour,i:o.minute,s:o.second,tz:t}}function Sh(e,t,n,i,o,a,l){return{y:e,m:t,d:n,h:i,i:o,s:a,tz:l}}var e1=[1,2,4,8,16],v0=class{constructor(e,t,n){_e(this,"pattern");_e(this,"timezone");_e(this,"mode");_e(this,"alternativeWeekdays");_e(this,"sloppyRanges");_e(this,"second");_e(this,"minute");_e(this,"hour");_e(this,"day");_e(this,"month");_e(this,"dayOfWeek");_e(this,"year");_e(this,"lastDayOfMonth");_e(this,"lastWeekday");_e(this,"nearestWeekdays");_e(this,"starDOM");_e(this,"starDOW");_e(this,"starYear");_e(this,"useAndLogic");this.pattern=e,this.timezone=t,this.mode=(n==null?void 0:n.mode)??"auto",this.alternativeWeekdays=(n==null?void 0:n.alternativeWeekdays)??!1,this.sloppyRanges=(n==null?void 0:n.sloppyRanges)??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[""],t=e.length;if(e.length<5||e.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let i;switch(this.mode){case"5-part":i=5;break;case"6-part":i=6;break;case"7-part":i=7;break;case"5-or-6-parts":i=[5,6];break;case"6-or-7-parts":i=[6,7];break;default:i=0}if(!(Array.isArray(i)?i.includes(t):t===i)){let o=Array.isArray(i)?i.join(" or "):i.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${o} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift("0"),e.length===6&&e.push("*"),e[3].toUpperCase()==="LW"?(this.lastWeekday=!0,e[3]=""):e[3].toUpperCase().indexOf("L")>=0&&(e[3]=e[3].replace(/L/gi,""),this.lastDayOfMonth=!0),e[3]=="*"&&(this.starDOM=!0),e[6]=="*"&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith("+")&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(e[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(e[0]=e[0].replace(/\?/g,"*"),e[1]=e[1].replace(/\?/g,"*"),e[2]=e[2].replace(/\?/g,"*"),e[3]=e[3].replace(/\?/g,"*"),e[4]=e[4].replace(/\?/g,"*"),e[5]=e[5].replace(/\?/g,"*"),e[6]&&(e[6]=e[6].replace(/\?/g,"*"))),this.mode){case"5-part":e[0]="0",e[6]="*";break;case"6-part":e[6]="*";break;case"5-or-6-parts":e[6]="*";break}this.throwAtIllegalCharacters(e),this.partToArray("second",e[0],0,1),this.partToArray("minute",e[1],0,1),this.partToArray("hour",e[2],0,1),this.partToArray("day",e[3],-1,1),this.partToArray("month",e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",e[5],n,63),this.partToArray("year",e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,i){let o=this[e],a=e==="day"&&this.lastDayOfMonth,l=e==="day"&&this.lastWeekday;if(t===""&&!a&&!l)throw new TypeError("CronPattern: configuration entry "+e+" ("+t+") is empty, check for trailing spaces.");if(t==="*")return o.fill(i);let c=t.split(",");if(c.length>1)for(let f=0;f<c.length;f++)this.partToArray(e,c[f],n,i);else t.indexOf("-")!==-1&&t.indexOf("/")!==-1?this.handleRangeWithStepping(t,e,n,i):t.indexOf("-")!==-1?this.handleRange(t,e,n,i):t.indexOf("/")!==-1?this.handleStepping(t,e,n,i):t!==""&&this.handleNumber(t,e,n,i)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw new TypeError("CronPattern: configuration entry "+t+" ("+e[t]+") contains illegal characters.")}handleNumber(e,t,n,i){let o=this.extractNth(e,t),a=e.toUpperCase().includes("W");if(t!=="day"&&a)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");a&&(t="nearestWeekdays");let l=parseInt(o[0],10)+n;if(isNaN(l))throw new TypeError("CronPattern: "+t+" is not a number: '"+e+"'");this.setPart(t,l,o[1]||i)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw new TypeError("CronPattern: Invalid part specified: "+e);if(e==="dayOfWeek"){if(t===7&&(t=0),t<0||t>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+t);this.setNthWeekdayOfMonth(t,n);return}if(e==="second"||e==="minute"){if(t<0||t>=60)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="hour"){if(t<0||t>=24)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="day"||e==="nearestWeekdays"){if(t<0||t>=31)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="month"){if(t<0||t>=12)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="year"&&(t<1||t>=1e4))throw new RangeError("CronPattern: Invalid value for "+e+": "+t+" (supported range: 1-9999)");this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw new TypeError(t)}validateRange(e,t,n,i,o){if(e>t)throw new TypeError("CronPattern: From value is larger than to value: '"+o+"'");if(n!==void 0){if(n===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(n>this[i].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[i].length+")")}}handleRangeWithStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let o=this.extractNth(e,t),a=o[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(a===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+e+"'");let[,l,c,f]=a,h=parseInt(l,10)+n,m=parseInt(c,10)+n,d=parseInt(f,10);this.validateNotNaN(h,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(d,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(h,m,d,t,e);for(let g=h;g<=m;g+=d)this.setPart(t,g,o[1]||i)}extractNth(e,t){let n=e,i;if(n.includes("#")){if(t!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");i=n.split("#")[1],n=n.split("#")[0]}else if(n.toUpperCase().endsWith("L")){if(t!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");i="L",n=n.slice(0,-1)}return[n,i]}handleRange(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let o=this.extractNth(e,t),a=o[0].split("-");if(a.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+e+"'");let l=parseInt(a[0],10)+n,c=parseInt(a[1],10)+n;this.validateNotNaN(l,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(c,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(l,c,void 0,t,e);for(let f=l;f<=c;f++)this.setPart(t,f,o[1]||i)}handleStepping(e,t,n,i){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let o=this.extractNth(e,t),a=o[0].split("/");if(a.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+e+"'");if(this.sloppyRanges)a[0]===""&&(a[0]="*");else{if(a[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(a[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let l=0;a[0]!=="*"&&(l=parseInt(a[0],10)+n);let c=parseInt(a[1],10);this.validateNotNaN(c,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[t].length-1,c,t,e);for(let f=l;f<this[t].length;f+=c)this.setPart(t,f,o[1]||i)}replaceAlphaDays(e){return e.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(e){return e.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(e){let t=e.trim().toLowerCase();if(t==="@yearly"||t==="@annually")return"0 0 1 1 *";if(t==="@monthly")return"0 0 1 * *";if(t==="@weekly")return"0 0 * * 0";if(t==="@daily"||t==="@midnight")return"0 0 * * *";if(t==="@hourly")return"0 * * * *";if(t==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return e}setNthWeekdayOfMonth(e,t){if(typeof t!="number"&&t.toUpperCase()==="L")this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|e1[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 t1{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 t1)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&&e1[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=y0(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(y0(t,this.tz))}findNext(t,n,i,o){return this._findMatch(t,n,i,o,1)}_findMatch(t,n,i,o,a){let l=this[n],c;i.lastDayOfMonth&&(c=this.getLastDayOfMonth(this.year,this.month));let f=!i.starDOW&&n=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,h=this[n]+o,m=a===1?d=>d<i[n].length:d=>d>=0;for(let d=h;m(d);d+=a){let g=i[n][d];if(n==="day"&&!g){for(let v=0;v<i.nearestWeekdays.length;v++)if(i.nearestWeekdays[v]){let k=this.getNearestWeekday(this.year,this.month,v-o);if(k===-1)continue;if(k===d-o){g=1;break}}}if(n==="day"&&i.lastWeekday){let v=this.getLastWeekday(this.year,this.month);d-o===v&&(g=1)}if(n==="day"&&i.lastDayOfMonth&&d-o==c&&(g=1),n==="day"&&!i.starDOW){let v=i.dayOfWeek[(f+(d-o-1))%7];if(v&&v&63)v=this.isNthWeekdayOfMonth(this.year,this.month,d-o,v)?1:0;else if(v)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${v}`);i.useAndLogic?g=g&&v:!t.domAndDow&&!i.starDOM?g=g||v:g=g&&v}if(g)return this[n]=d-o,l!==this[n]?2:1}return 3}recurse(t,n,i){if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let a=-1;for(let l=this.year+1;l<t.year.length&&l<1e4;l++)if(t.year[l]===1){a=l;break}if(a===-1)return null;this.year=a,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let o=this.findNext(n,We[i][0],t,We[i][2]);if(o>1){let a=i+1;for(;a<We.length;)this[We[a][0]]=-We[a][2],a++;if(o===3){if(this[We[i][1]]++,this[We[i][0]]=-We[i][2],this.apply(),i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=t.year.length)return null}return this.recurse(t,n,0)}else if(this.apply())return this.recurse(t,n,i-1)}return i+=1,i>=We.length?this:(t.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(t,n,i)}increment(t,n,i){return this.second+=n.interval!==void 0&&n.interval>1&&i?n.interval:1,this.ms=0,this.apply(),this.recurse(t,n,0)}decrement(t,n){return this.second-=n.interval!==void 0&&n.interval>1?n.interval:1,this.ms=0,this.apply(),this.recurseBackward(t,n,0,0)}recurseBackward(t,n,i,o=0){if(o>1e4)return null;if(i===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let l=-1;for(let c=this.year-1;c>=0;c--)if(t.year[c]===1){l=c;break}if(l===-1)return null;this.year=l,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let a=this.findPrevious(n,We[i][0],t,We[i][2]);if(a>1){let l=i+1;for(;l<We.length;){let c=We[l][0],f=We[l][2],h=this.getMaxPatternValue(c,t,f);this[c]=h,l++}if(a===3){if(this[We[i][1]]--,i===0){let m=this.getLastDayOfMonth(this.year,this.month);this.day>m&&(this.day=m)}if(i===1)if(this.day<=0)this.day=1;else{let m=this.year,d=this.month;for(;d<0;)d+=12,m--;for(;d>11;)d-=12,m++;let g=d!==1?Zf[d]:new Date(Date.UTC(m,d+1,0)).getUTCDate();this.day>g&&(this.day=g)}this.apply();let c=We[i][0],f=We[i][2],h=this.getMaxPatternValue(c,t,f);if(c==="day"){let m=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(h,m)}else this[c]=h;if(this.apply(),i===0){let m=We[1][2],d=this.getMaxPatternValue("day",t,m),g=this.getLastDayOfMonth(this.year,this.month),v=Math.min(d,g);v!==this.day&&(this.day=v,this.hour=this.getMaxPatternValue("hour",t,We[2][2]),this.minute=this.getMaxPatternValue("minute",t,We[3][2]),this.second=this.getMaxPatternValue("second",t,We[4][2]))}if(i===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(t,n,0,o+1)}else if(this.apply())return this.recurseBackward(t,n,i-1,o+1)}return i+=1,i>=We.length?this:this.year<0?null:this.recurseBackward(t,n,i,o+1)}getMaxPatternValue(t,n,i){if(t==="day"&&n.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(t==="day"&&!n.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let o=n[t].length-1;o>=0;o--)if(n[t][o])return o-i;return n[t].length-1-i}findPrevious(t,n,i,o){return this._findMatch(t,n,i,o,-1)}getDate(t){return t||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):Zx(Sh(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(t,n){if(!t.starYear&&(this.year<0||this.year>=t.year.length||t.year[this.year]===0))return!1;for(let i=0;i<We.length;i++){let o=We[i][0],a=We[i][2],l=this[o];if(l+a<0||l+a>=t[o].length)return!1;let c=t[o][l+a];if(o==="day"){if(!c){for(let f=0;f<t.nearestWeekdays.length;f++)if(t.nearestWeekdays[f]){let h=this.getNearestWeekday(this.year,this.month,f-a);if(h!==-1&&h===l){c=1;break}}}if(t.lastWeekday){let f=this.getLastWeekday(this.year,this.month);l===f&&(c=1)}if(t.lastDayOfMonth){let f=this.getLastDayOfMonth(this.year,this.month);l===f&&(c=1)}if(!t.starDOW){let f=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),h=t.dayOfWeek[(f+(l-1))%7];h&&h&63&&(h=this.isNthWeekdayOfMonth(this.year,this.month,l,h)?1:0),t.useAndLogic?c=c&&h:!n.domAndDow&&!t.starDOM?c=c||h:c=c&&h}}if(!c)return!1}return!0}};function CP(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 TP(e){return ko(e)}function OP(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var w0=30*1e3,_l=[],PP=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=CP(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 v0("* * * * *",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 v0(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&&TP(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>w0&&(t=w0),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&OP(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 IP(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 AP(e,t=new Date){try{return new PP(e).nextRun(t)}catch{return null}}function MP(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 LP(e,t=new Date){const n=AP(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=MP(n.getTime()-t.getTime());return{short:i,title:`Next run ${o} (in ${a}) · cron ${e}`}}function x0(e){return e?e.replace(/^trigger\./,""):""}const RP=200,DP=560;function jP({liveConnected:e,workflows:t=[],selected:n,onSelect:i,onRun:o,version:a}){const[l,c]=P.useState(248),[f,h]=P.useState(!1),m=P.useCallback(d=>{d.preventDefault(),h(!0)},[]);return P.useEffect(()=>{if(!f)return;const d=v=>c(Math.min(DP,Math.max(RP,v.clientX))),g=()=>h(!1);return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[f]),_.jsxs("aside",{className:"relative shrink-0 bg-bg border-r border-border flex flex-col",style:{width:l},children:[_.jsxs("div",{className:"h-12 flex items-center gap-2 px-4 border-b border-border",children:[_.jsx("div",{className:"size-5 rounded bg-fg flex items-center justify-center text-bg text-[10px] font-mono",children:"~/"}),_.jsx("span",{className:"font-semibold tracking-tight",children:"agentic-surfaces"}),a&&_.jsxs("span",{"data-testid":"version",className:"ml-auto text-[10px] text-mutedfg font-mono",children:["v",a]})]}),_.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-wider text-mutedfg",children:"Workflows"}),_.jsxs("p",{className:"px-3 pb-2 text-[11px] text-mutedfg leading-snug",children:["Scheduled workflows fire on their ",_.jsx("span",{className:"text-fg",children:"next tick"})," — not on startup. Hover → ",_.jsx("span",{className:"font-mono text-fg",children:"▶ run"}),", or select one and use the header."]}),_.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 space-y-0.5",children:[t.length===0&&_.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-mutedfg",children:"No workflows loaded."}),t.map(d=>{const g=IP(d),v=g?LP(g):null;return _.jsxs("div",{"data-testid":"workflow-item",className:je("group w-full px-2.5 py-1.5 rounded-md flex items-center gap-2 text-[13px] cursor-pointer",d.name===n?"bg-muted":"hover:bg-muted text-mutedfg"),onClick:()=>i==null?void 0:i(d.name),title:d.title??d.name,children:[_.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",d.name===n?"bg-ok":"bg-border")}),_.jsx("span",{className:"truncate",children:d.title??d.name}),_.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[v?_.jsxs("span",{"data-testid":"next-run",title:v.title,className:"text-[10px] text-mutedfg font-mono whitespace-nowrap",children:["next ",v.short]}):x0(d.triggerType)&&_.jsx("span",{className:"text-[10px] text-mutedfg font-mono",children:x0(d.triggerType)}),d.runnable&&o&&_.jsx("button",{"data-testid":"run-workflow",title:`Run ${d.title??d.name}${d.needsPayload?" (needs a payload — use the header Run…)":""}`,onClick:k=>{k.stopPropagation(),d.needsPayload?i==null||i(d.name):o(d.name)},className:"text-[11px] font-mono text-mutedfg hover:text-ok px-1 rounded opacity-0 group-hover:opacity-100",children:"▶ run"})]})]},d.name)})]}),_.jsxs("div",{className:"p-3 border-t border-border text-[11px] text-mutedfg leading-relaxed",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx("span",{className:je("size-1.5 rounded-full",e?"bg-ok":"bg-border")}),e?"server connected":"offline"]}),_.jsx("div",{className:"mt-1 font-mono",children:"surfaces are the source of truth"})]}),_.jsx("div",{"data-testid":"sidebar-resizer",onMouseDown:m,className:je("absolute top-0 right-0 h-full w-1 cursor-col-resize hover:bg-primary/40",f&&"bg-primary/60")})]})}function $P({workflow:e,selected:t,dryRun:n,paused:i,pauseControllable:o,onTogglePause:a,onLoadYaml:l,onRun:c,onToggleRuns:f,onToggleCache:h,runsOpen:m,cacheOpen:d}){const g=(t==null?void 0:t.title)??(e==null?void 0:e.name)??"no workflow loaded",v=e?`workflows/${e.name}.yaml`:"",[k,w]=P.useState(!1),[b,S]=P.useState(!1),[N,E]=P.useState(null),C=P.useRef(null),I=P.useRef(null),M=P.useCallback(()=>{var R;const z=((R=C.current)==null?void 0:R.value)??"";z.trim()&&(l(z),w(!1))},[l]),L=P.useCallback(()=>{t!=null&&t.needsPayload?(E(null),S(!0)):c()},[t,c]),T=P.useCallback(()=>{var $;const z=((($=I.current)==null?void 0:$.value)??"").trim();if(!z){E('enter a payload, e.g. { "key": "PD-109" }');return}let R;try{R=JSON.parse(z)}catch{E("not valid JSON");return}c(R),S(!1)},[c]),A="text-[12px] px-2.5 py-1 rounded transition-colors";return _.jsxs(_.Fragment,{children:[_.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&&_.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&&_.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"}),_.jsx("h1",{className:"font-semibold tracking-tight truncate max-w-[35%]",title:g,children:g}),v&&_.jsx("span",{className:"text-[11px] font-mono text-mutedfg px-1.5 py-0.5 bg-muted rounded shrink-0",children:v}),_.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(t==null?void 0:t.runnable)&&_.jsxs("button",{"data-testid":"topbar-run",onClick:L,className:je(A,"bg-ok/15 text-ok hover:bg-ok/25 font-medium"),children:["▶ Run",t.needsPayload?"…":""]}),_.jsx("button",{"data-testid":"topbar-runs",onClick:f,className:je(A,m?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Runs"}),_.jsx("button",{"data-testid":"topbar-cache",onClick:h,className:je(A,d?"bg-muted text-fg":"bg-muted/50 text-mutedfg hover:bg-muted"),children:"Cache"}),_.jsx("button",{onClick:()=>w(!0),className:je(A,"bg-muted hover:bg-border text-fg"),children:"Paste YAML"})]})]}),b&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",onClick:()=>S(!1),children:_.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[420px] max-w-[90vw]",onClick:z=>z.stopPropagation(),children:[_.jsxs("span",{className:"font-semibold text-sm",children:["Run ",g," — trigger payload"]}),_.jsx("p",{className:"text-[12px] text-mutedfg",children:"This is a per-item sub-workflow; give it the item to process, e.g. an idea key."}),_.jsx("textarea",{ref:I,defaultValue:'{ "key": "PD-109" }',spellCheck:!1,className:"w-full h-24 font-mono text-[12px] bg-muted border border-border rounded p-2 resize-y focus:outline-none focus:ring-1 focus:ring-primary"}),N&&_.jsx("span",{className:"text-[11px] text-fail",children:N}),_.jsxs("div",{className:"flex justify-end gap-2",children:[_.jsx("button",{onClick:()=>S(!1),className:je(A,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),_.jsx("button",{onClick:T,className:je(A,"bg-ok/20 text-ok hover:bg-ok/30 font-medium"),children:"▶ Run"})]})]})}),k&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/80 z-50",children:_.jsxs("div",{className:"bg-bg border border-border rounded-lg shadow-lg p-4 flex flex-col gap-3 w-[520px] max-w-[90vw]",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"font-semibold text-sm",children:"Paste YAML"}),_.jsx("button",{onClick:()=>w(!1),className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),_.jsx("textarea",{ref: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"}),_.jsxs("div",{className:"flex justify-end gap-2",children:[_.jsx("button",{onClick:()=>w(!1),className:je(A,"bg-muted hover:bg-border text-fg"),children:"Cancel"}),_.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 b0({status:e}){return _.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 k0({data:e,selected:t}){const{node:n,liveStatus:i="idle"}=e;if(n.type==="agent.run"){const a=i==="running";return _.jsxs("div",{"data-testid":"agent-node","data-node-type":"agent.run","data-live-status":i,className: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:[_.jsx("div",{className:"h-1 bg-agent"}),_.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(b0,{status:i}),_.jsx("span",{className:"font-medium text-agent text-[12px]",children:n.id}),_.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wide text-agent/70 bg-agent/10 px-1 rounded",children:"agent"})]}),_.jsx("div",{className:"font-mono text-[10px] text-agent/60 mt-0.5",children:n.type})]}),_.jsx(Or,{type:"target",position:ke.Left,className:"!bg-agent/50"}),_.jsx(Or,{type:"source",position:ke.Right,className:"!bg-agent/50"})]})}return _.jsxs("div",{"data-testid":"workflow-node","data-node-type":n.type,"data-live-status":i,className: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:[_.jsx("div",{className:"h-1 bg-mutedfg/30"}),_.jsxs("div",{className:"p-2.5 flex flex-col justify-center",style:{height:"calc(100% - 4px)"},children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(b0,{status:i}),_.jsx("span",{className:"font-medium text-[12px]",children:n.id})]}),_.jsx("div",{className:"font-mono text-[10px] text-mutedfg mt-0.5",children:n.type})]}),_.jsx(Or,{type:"target",position:ke.Left,className:"!bg-mutedfg/50"}),_.jsx(Or,{type:"source",position:ke.Right,className:"!bg-mutedfg/50"})]})}var ed,S0;function np(){if(S0)return ed;S0=1;var e="\0",t="\0",n="";class i{constructor(m){_e(this,"_isDirected",!0);_e(this,"_isMultigraph",!1);_e(this,"_isCompound",!1);_e(this,"_label");_e(this,"_defaultNodeLabelFn",()=>{});_e(this,"_defaultEdgeLabelFn",()=>{});_e(this,"_nodes",{});_e(this,"_in",{});_e(this,"_preds",{});_e(this,"_out",{});_e(this,"_sucs",{});_e(this,"_edgeObjs",{});_e(this,"_edgeLabels",{});_e(this,"_nodeCount",0);_e(this,"_edgeCount",0);_e(this,"_parent");_e(this,"_children");m&&(this._isDirected=Object.hasOwn(m,"directed")?m.directed:!0,this._isMultigraph=Object.hasOwn(m,"multigraph")?m.multigraph:!1,this._isCompound=Object.hasOwn(m,"compound")?m.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(m){return this._label=m,this}graph(){return this._label}setDefaultNodeLabel(m){return this._defaultNodeLabelFn=m,typeof m!="function"&&(this._defaultNodeLabelFn=()=>m),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var m=this;return this.nodes().filter(d=>Object.keys(m._in[d]).length===0)}sinks(){var m=this;return this.nodes().filter(d=>Object.keys(m._out[d]).length===0)}setNodes(m,d){var g=arguments,v=this;return m.forEach(function(k){g.length>1?v.setNode(k,d):v.setNode(k)}),this}setNode(m,d){return Object.hasOwn(this._nodes,m)?(arguments.length>1&&(this._nodes[m]=d),this):(this._nodes[m]=arguments.length>1?d:this._defaultNodeLabelFn(m),this._isCompound&&(this._parent[m]=t,this._children[m]={},this._children[t][m]=!0),this._in[m]={},this._preds[m]={},this._out[m]={},this._sucs[m]={},++this._nodeCount,this)}node(m){return this._nodes[m]}hasNode(m){return Object.hasOwn(this._nodes,m)}removeNode(m){var d=this;if(Object.hasOwn(this._nodes,m)){var g=v=>d.removeEdge(d._edgeObjs[v]);delete this._nodes[m],this._isCompound&&(this._removeFromParentsChildList(m),delete this._parent[m],this.children(m).forEach(function(v){d.setParent(v)}),delete this._children[m]),Object.keys(this._in[m]).forEach(g),delete this._in[m],delete this._preds[m],Object.keys(this._out[m]).forEach(g),delete this._out[m],delete this._sucs[m],--this._nodeCount}return this}setParent(m,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=t;else{d+="";for(var g=d;g!==void 0;g=this.parent(g))if(g===m)throw new Error("Setting "+d+" as parent of "+m+" would create a cycle");this.setNode(d)}return this.setNode(m),this._removeFromParentsChildList(m),this._parent[m]=d,this._children[d][m]=!0,this}_removeFromParentsChildList(m){delete this._children[this._parent[m]][m]}parent(m){if(this._isCompound){var d=this._parent[m];if(d!==t)return d}}children(m=t){if(this._isCompound){var d=this._children[m];if(d)return Object.keys(d)}else{if(m===t)return this.nodes();if(this.hasNode(m))return[]}}predecessors(m){var d=this._preds[m];if(d)return Object.keys(d)}successors(m){var d=this._sucs[m];if(d)return Object.keys(d)}neighbors(m){var d=this.predecessors(m);if(d){const v=new Set(d);for(var g of this.successors(m))v.add(g);return Array.from(v.values())}}isLeaf(m){var d;return this.isDirected()?d=this.successors(m):d=this.neighbors(m),d.length===0}filterNodes(m){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var g=this;Object.entries(this._nodes).forEach(function([w,b]){m(w)&&d.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){d.hasNode(w.v)&&d.hasNode(w.w)&&d.setEdge(w,g.edge(w))});var v={};function k(w){var b=g.parent(w);return b===void 0||d.hasNode(b)?(v[w]=b,b):b in v?v[b]:k(b)}return this._isCompound&&d.nodes().forEach(w=>d.setParent(w,k(w))),d}setDefaultEdgeLabel(m){return this._defaultEdgeLabelFn=m,typeof m!="function"&&(this._defaultEdgeLabelFn=()=>m),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(m,d){var g=this,v=arguments;return m.reduce(function(k,w){return v.length>1?g.setEdge(k,w,d):g.setEdge(k,w),w}),this}setEdge(){var m,d,g,v,k=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(m=w.v,d=w.w,g=w.name,arguments.length===2&&(v=arguments[1],k=!0)):(m=w,d=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],k=!0)),m=""+m,d=""+d,g!==void 0&&(g=""+g);var b=l(this._isDirected,m,d,g);if(Object.hasOwn(this._edgeLabels,b))return k&&(this._edgeLabels[b]=v),this;if(g!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(m),this.setNode(d),this._edgeLabels[b]=k?v:this._defaultEdgeLabelFn(m,d,g);var S=c(this._isDirected,m,d,g);return m=S.v,d=S.w,Object.freeze(S),this._edgeObjs[b]=S,o(this._preds[d],m),o(this._sucs[m],d),this._in[d][b]=S,this._out[m][b]=S,this._edgeCount++,this}edge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g);return this._edgeLabels[v]}edgeAsObj(){const m=this.edge(...arguments);return typeof m!="object"?{label:m}:m}hasEdge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g);return Object.hasOwn(this._edgeLabels,v)}removeEdge(m,d,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):l(this._isDirected,m,d,g),k=this._edgeObjs[v];return k&&(m=k.v,d=k.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[d],m),a(this._sucs[m],d),delete this._in[d][v],delete this._out[m][v],this._edgeCount--),this}inEdges(m,d){var g=this._in[m];if(g){var v=Object.values(g);return d?v.filter(k=>k.v===d):v}}outEdges(m,d){var g=this._out[m];if(g){var v=Object.values(g);return d?v.filter(k=>k.w===d):v}}nodeEdges(m,d){var g=this.inEdges(m,d);if(g)return g.concat(this.outEdges(m,d))}}function o(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,d,g){var v=""+m,k=""+d;if(!h&&v>k){var w=v;v=k,k=w}return v+n+k+n+(g===void 0?e:g)}function c(h,m,d,g){var v=""+m,k=""+d;if(!h&&v>k){var w=v;v=k,k=w}var b={v,w:k};return g&&(b.name=g),b}function f(h,m){return l(h,m.v,m.w,m.name)}return ed=i,ed}var td,E0;function zP(){return E0||(E0=1,td="2.2.4"),td}var nd,N0;function FP(){return N0||(N0=1,nd={Graph:np(),version:zP()}),nd}var rd,_0;function BP(){if(_0)return rd;_0=1;var e=np();rd={write:t,read:o};function t(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:i(a)};return a.graph()!==void 0&&(l.value=structuredClone(a.graph())),l}function n(a){return a.nodes().map(function(l){var c=a.node(l),f=a.parent(l),h={v:l};return c!==void 0&&(h.value=c),f!==void 0&&(h.parent=f),h})}function i(a){return a.edges().map(function(l){var c=a.edge(l),f={v:l.v,w:l.w};return l.name!==void 0&&(f.name=l.name),c!==void 0&&(f.value=c),f})}function o(a){var l=new e(a.options).setGraph(a.value);return a.nodes.forEach(function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),a.edges.forEach(function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return rd}var id,C0;function VP(){if(C0)return id;C0=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,T0;function n1(){if(T0)return sd;T0=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,O0;function r1(){if(O0)return od;O0=1;var e=n1();od=n;var t=()=>1;function n(o,a,l,c){return i(o,String(a),l||t,c||function(f){return o.outEdges(f)})}function i(o,a,l,c){var f={},h=new e,m,d,g=function(v){var k=v.v!==m?v.v:v.w,w=f[k],b=l(v),S=d.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+v+" Weight: "+b);S<w.distance&&(w.distance=S,w.predecessor=m,h.decrease(k,S))};for(o.nodes().forEach(function(v){var k=v===a?0:Number.POSITIVE_INFINITY;f[v]={distance:k},h.add(v,k)});h.size()>0&&(m=h.removeMin(),d=f[m],d.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(g);return f}return od}var ad,P0;function WP(){if(P0)return ad;P0=1;var e=r1();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,I0;function i1(){if(I0)return ld;I0=1,ld=e;function e(t){var n=0,i=[],o={},a=[];function l(c){var f=o[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),t.successors(c).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(f.lowlink=Math.min(f.lowlink,o[d].index)):(l(d),f.lowlink=Math.min(f.lowlink,o[d].lowlink))}),f.lowlink===f.index){var h=[],m;do m=i.pop(),o[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return t.nodes().forEach(function(c){Object.hasOwn(o,c)||l(c)}),a}return ld}var ud,A0;function UP(){if(A0)return ud;A0=1;var e=i1();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,M0;function HP(){if(M0)return cd;M0=1,cd=t;var e=()=>1;function t(i,o,a){return n(i,o||e,a||function(l){return i.outEdges(l)})}function n(i,o,a){var l={},c=i.nodes();return c.forEach(function(f){l[f]={},l[f][f]={distance:0},c.forEach(function(h){f!==h&&(l[f][h]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(h){var m=h.v===f?h.w:h.v,d=o(h);l[f][m]={distance:d,predecessor:f}})}),c.forEach(function(f){var h=l[f];c.forEach(function(m){var d=l[m];c.forEach(function(g){var v=d[f],k=h[g],w=d[g],b=v.distance+k.distance;b<w.distance&&(w.distance=b,w.predecessor=k.predecessor)})})}),l}return cd}var fd,L0;function s1(){if(L0)return fd;L0=1;function e(n){var i={},o={},a=[];function l(c){if(Object.hasOwn(o,c))throw new t;Object.hasOwn(i,c)||(o[c]=!0,i[c]=!0,n.predecessors(c).forEach(l),delete o[c],a.push(c))}if(n.sinks().forEach(l),Object.keys(i).length!==n.nodeCount())throw new t;return a}class t extends Error{constructor(){super(...arguments)}}return fd=e,e.CycleException=t,fd}var dd,R0;function qP(){if(R0)return dd;R0=1;var e=s1();dd=t;function t(n){try{e(n)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return dd}var hd,D0;function o1(){if(D0)return hd;D0=1,hd=e;function e(o,a,l){Array.isArray(a)||(a=[a]);var c=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),f=l==="post"?t:n,h=[],m={};return a.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);f(d,c,m,h)}),h}function t(o,a,l,c){for(var f=[[o,!1]];f.length>0;){var h=f.pop();h[1]?c.push(h[0]):Object.hasOwn(l,h[0])||(l[h[0]]=!0,f.push([h[0],!0]),i(a(h[0]),m=>f.push([m,!1])))}}function n(o,a,l,c){for(var f=[o];f.length>0;){var h=f.pop();Object.hasOwn(l,h)||(l[h]=!0,c.push(h),i(a(h),m=>f.push(m)))}}function i(o,a){for(var l=o.length;l--;)a(o[l],l,o);return o}return hd}var pd,j0;function YP(){if(j0)return pd;j0=1;var e=o1();pd=t;function t(n,i){return e(n,i,"post")}return pd}var md,$0;function KP(){if($0)return md;$0=1;var e=o1();md=t;function t(n,i){return e(n,i,"pre")}return md}var gd,z0;function GP(){if(z0)return gd;z0=1;var e=np(),t=n1();gd=n;function n(i,o){var a=new e,l={},c=new t,f;function h(d){var g=d.v===f?d.w:d.v,v=c.priority(g);if(v!==void 0){var k=o(d);k<v&&(l[g]=f,c.decrease(g,k))}}if(i.nodeCount()===0)return a;i.nodes().forEach(function(d){c.add(d,Number.POSITIVE_INFINITY),a.setNode(d)}),c.decrease(i.nodes()[0],0);for(var m=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(l,f))a.setEdge(f,l[f]);else{if(m)throw new Error("Input graph is not connected: "+i);m=!0}i.nodeEdges(f).forEach(h)}return a}return gd}var yd,F0;function XP(){return F0||(F0=1,yd={components:VP(),dijkstra:r1(),dijkstraAll:WP(),findCycles:UP(),floydWarshall:HP(),isAcyclic:qP(),postorder:YP(),preorder:KP(),prim:GP(),tarjan:i1(),topsort:s1()}),yd}var vd,B0;function yn(){if(B0)return vd;B0=1;var e=FP();return vd={Graph:e.Graph,json:BP(),alg:XP(),version:e.version},vd}var wd,V0;function QP(){if(V0)return wd;V0=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,W0;function JP(){if(W0)return xd;W0=1;let e=yn().Graph,t=QP();xd=i;let n=()=>1;function i(h,m){if(h.nodeCount()<=1)return[];let d=l(h,m||n);return o(d.graph,d.buckets,d.zeroIdx).flatMap(v=>h.outEdges(v.v,v.w))}function o(h,m,d){let g=[],v=m[m.length-1],k=m[0],w;for(;h.nodeCount();){for(;w=k.dequeue();)a(h,m,d,w);for(;w=v.dequeue();)a(h,m,d,w);if(h.nodeCount()){for(let b=m.length-2;b>0;--b)if(w=m[b].dequeue(),w){g=g.concat(a(h,m,d,w,!0));break}}}return g}function a(h,m,d,g,v){let k=v?[]:void 0;return h.inEdges(g.v).forEach(w=>{let b=h.edge(w),S=h.node(w.v);v&&k.push({v:w.v,w:w.w}),S.out-=b,c(m,d,S)}),h.outEdges(g.v).forEach(w=>{let b=h.edge(w),S=w.w,N=h.node(S);N.in-=b,c(m,d,N)}),h.removeNode(g.v),k}function l(h,m){let d=new e,g=0,v=0;h.nodes().forEach(b=>{d.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let S=d.edge(b.v,b.w)||0,N=m(b),E=S+N;d.setEdge(b.v,b.w,E),v=Math.max(v,d.node(b.v).out+=N),g=Math.max(g,d.node(b.w).in+=N)});let k=f(v+g+3).map(()=>new t),w=g+1;return d.nodes().forEach(b=>{c(k,w,d.node(b))}),{graph:d,buckets:k,zeroIdx:w}}function c(h,m,d){d.out?d.in?h[d.out-d.in+m].enqueue(d):h[h.length-1].enqueue(d):h[0].enqueue(d)}function f(h){const m=[];for(let d=0;d<h;d++)m.push(d);return m}return xd}var bd,U0;function nt(){if(U0)return bd;U0=1;let e=yn().Graph;bd={addBorderNode:m,addDummyNode:t,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:M,maxRank:k,normalizeRanks:f,notime:S,partition:w,pick:I,predecessorWeights:a,range:C,removeEmptyRanks:h,simplify:n,successorWeights:o,time:b,uniqueId:E,zipObject:L};function t(T,A,z,R){for(var $=R;T.hasNode($);)$=E(R);return z.dummy=A,T.setNode($,z),$}function n(T){let A=new e().setGraph(T.graph());return T.nodes().forEach(z=>A.setNode(z,T.node(z))),T.edges().forEach(z=>{let R=A.edge(z.v,z.w)||{weight:0,minlen:1},$=T.edge(z);A.setEdge(z.v,z.w,{weight:R.weight+$.weight,minlen:Math.max(R.minlen,$.minlen)})}),A}function i(T){let A=new e({multigraph:T.isMultigraph()}).setGraph(T.graph());return T.nodes().forEach(z=>{T.children(z).length||A.setNode(z,T.node(z))}),T.edges().forEach(z=>{A.setEdge(z,T.edge(z))}),A}function o(T){let A=T.nodes().map(z=>{let R={};return T.outEdges(z).forEach($=>{R[$.w]=(R[$.w]||0)+T.edge($).weight}),R});return L(T.nodes(),A)}function a(T){let A=T.nodes().map(z=>{let R={};return T.inEdges(z).forEach($=>{R[$.v]=(R[$.v]||0)+T.edge($).weight}),R});return L(T.nodes(),A)}function l(T,A){let z=T.x,R=T.y,$=A.x-z,Z=A.y-R,j=T.width/2,G=T.height/2;if(!$&&!Z)throw new Error("Not possible to find intersection inside of the rectangle");let Y,J;return Math.abs(Z)*j>Math.abs($)*G?(Z<0&&(G=-G),Y=G*$/Z,J=G):($<0&&(j=-j),Y=j,J=j*Z/$),{x:z+Y,y:R+J}}function c(T){let A=C(k(T)+1).map(()=>[]);return T.nodes().forEach(z=>{let R=T.node(z),$=R.rank;$!==void 0&&(A[$][R.order]=z)}),A}function f(T){let A=T.nodes().map(R=>{let $=T.node(R).rank;return $===void 0?Number.MAX_VALUE:$}),z=v(Math.min,A);T.nodes().forEach(R=>{let $=T.node(R);Object.hasOwn($,"rank")&&($.rank-=z)})}function h(T){let A=T.nodes().map(j=>T.node(j).rank),z=v(Math.min,A),R=[];T.nodes().forEach(j=>{let G=T.node(j).rank-z;R[G]||(R[G]=[]),R[G].push(j)});let $=0,Z=T.graph().nodeRankFactor;Array.from(R).forEach((j,G)=>{j===void 0&&G%Z!==0?--$:j!==void 0&&$&&j.forEach(Y=>T.node(Y).rank+=$)})}function m(T,A,z,R){let $={width:0,height:0};return arguments.length>=4&&($.rank=z,$.order=R),t(T,"border",$,A)}function d(T,A=g){const z=[];for(let R=0;R<T.length;R+=A){const $=T.slice(R,R+A);z.push($)}return z}const g=65535;function v(T,A){if(A.length>g){const z=d(A);return T.apply(null,z.map(R=>T.apply(null,R)))}else return T.apply(null,A)}function k(T){const z=T.nodes().map(R=>{let $=T.node(R).rank;return $===void 0?Number.MIN_VALUE:$});return v(Math.max,z)}function w(T,A){let z={lhs:[],rhs:[]};return T.forEach(R=>{A(R)?z.lhs.push(R):z.rhs.push(R)}),z}function b(T,A){let z=Date.now();try{return A()}finally{console.log(T+" time: "+(Date.now()-z)+"ms")}}function S(T,A){return A()}let N=0;function E(T){var A=++N;return T+(""+A)}function C(T,A,z=1){A==null&&(A=T,T=0);let R=Z=>Z<A;z<0&&(R=Z=>A<Z);const $=[];for(let Z=T;R(Z);Z+=z)$.push(Z);return $}function I(T,A){const z={};for(const R of A)T[R]!==void 0&&(z[R]=T[R]);return z}function M(T,A){let z=A;return typeof A=="string"&&(z=R=>R[A]),Object.entries(T).reduce((R,[$,Z])=>(R[$]=z(Z,$),R),{})}function L(T,A){return T.reduce((z,R,$)=>(z[R]=A[$],z),{})}return bd}var kd,H0;function ZP(){if(H0)return kd;H0=1;let e=JP(),t=nt().uniqueId;kd={run:n,undo:o};function n(a){(a.graph().acyclicer==="greedy"?e(a,c(a)):i(a)).forEach(f=>{let h=a.edge(f);a.removeEdge(f),h.forwardName=f.name,h.reversed=!0,a.setEdge(f.w,f.v,h,t("rev"))});function c(f){return h=>f.edge(h).weight}}function i(a){let l=[],c={},f={};function h(m){Object.hasOwn(f,m)||(f[m]=!0,c[m]=!0,a.outEdges(m).forEach(d=>{Object.hasOwn(c,d.w)?l.push(d):h(d.w)}),delete c[m])}return a.nodes().forEach(h),l}function o(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let f=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,f)}})}return kd}var Sd,q0;function eI(){if(q0)return Sd;q0=1;let e=nt();Sd={run:t,undo:i};function t(o){o.graph().dummyChains=[],o.edges().forEach(a=>n(o,a))}function n(o,a){let l=a.v,c=o.node(l).rank,f=a.w,h=o.node(f).rank,m=a.name,d=o.edge(a),g=d.labelRank;if(h===c+1)return;o.removeEdge(a);let v,k,w;for(w=0,++c;c<h;++w,++c)d.points=[],k={width:0,height:0,edgeLabel:d,edgeObj:a,rank:c},v=e.addDummyNode(o,"edge",k,"_d"),c===g&&(k.width=d.width,k.height=d.height,k.dummy="edge-label",k.labelpos=d.labelpos),o.setEdge(l,v,{weight:d.weight},m),w===0&&o.graph().dummyChains.push(v),l=v;o.setEdge(l,f,{weight:d.weight},m)}function i(o){o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeLabel,f;for(o.setEdge(l.edgeObj,c);l.dummy;)f=o.successors(a)[0],o.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=f,l=o.node(a)})}return Sd}var Ed,Y0;function ou(){if(Y0)return Ed;Y0=1;const{applyWithChunking:e}=nt();Ed={longestPath:t,slack:n};function t(i){var o={};function a(l){var c=i.node(l);if(Object.hasOwn(o,l))return c.rank;o[l]=!0;let f=i.outEdges(l).map(m=>m==null?Number.POSITIVE_INFINITY:a(m.w)-i.edge(m).minlen);var h=e(Math.min,f);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}i.sources().forEach(a)}function n(i,o){return i.node(o.w).rank-i.node(o.v).rank-i.edge(o).minlen}return Ed}var Nd,K0;function a1(){if(K0)return Nd;K0=1;var e=yn().Graph,t=ou().slack;Nd=n;function n(l){var c=new e({directed:!1}),f=l.nodes()[0],h=l.nodeCount();c.setNode(f,{});for(var m,d;i(c,l)<h;)m=o(c,l),d=c.hasNode(m.v)?t(l,m):-t(l,m),a(c,l,d);return c}function i(l,c){function f(h){c.nodeEdges(h).forEach(m=>{var d=m.v,g=h===d?m.w:d;!l.hasNode(g)&&!t(c,m)&&(l.setNode(g,{}),l.setEdge(h,g,{}),f(g))})}return l.nodes().forEach(f),l.nodeCount()}function o(l,c){return c.edges().reduce((h,m)=>{let d=Number.POSITIVE_INFINITY;return l.hasNode(m.v)!==l.hasNode(m.w)&&(d=t(c,m)),d<h[0]?[d,m]:h},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,f){l.nodes().forEach(h=>c.node(h).rank+=f)}return Nd}var _d,G0;function tI(){if(G0)return _d;G0=1;var e=a1(),t=ou().slack,n=ou().longestPath,i=yn().alg.preorder,o=yn().alg.postorder,a=nt().simplify;_d=l,l.initLowLimValues=m,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=k;function l(N){N=a(N),n(N);var E=e(N);m(E),c(E,N);for(var C,I;C=g(E);)I=v(E,N,C),k(E,N,C,I)}function c(N,E){var C=o(N,N.nodes());C=C.slice(0,C.length-1),C.forEach(I=>f(N,E,I))}function f(N,E,C){var I=N.node(C),M=I.parent;N.edge(C,M).cutvalue=h(N,E,C)}function h(N,E,C){var I=N.node(C),M=I.parent,L=!0,T=E.edge(C,M),A=0;return T||(L=!1,T=E.edge(M,C)),A=T.weight,E.nodeEdges(C).forEach(z=>{var R=z.v===C,$=R?z.w:z.v;if($!==M){var Z=R===L,j=E.edge(z).weight;if(A+=Z?j:-j,b(N,C,$)){var G=N.edge(C,$).cutvalue;A+=Z?-G:G}}}),A}function m(N,E){arguments.length<2&&(E=N.nodes()[0]),d(N,{},1,E)}function d(N,E,C,I,M){var L=C,T=N.node(I);return E[I]=!0,N.neighbors(I).forEach(A=>{Object.hasOwn(E,A)||(C=d(N,E,C,A,I))}),T.low=L,T.lim=C++,M?T.parent=M:delete T.parent,C}function g(N){return N.edges().find(E=>N.edge(E).cutvalue<0)}function v(N,E,C){var I=C.v,M=C.w;E.hasEdge(I,M)||(I=C.w,M=C.v);var L=N.node(I),T=N.node(M),A=L,z=!1;L.lim>T.lim&&(A=T,z=!0);var R=E.edges().filter($=>z===S(N,N.node($.v),A)&&z!==S(N,N.node($.w),A));return R.reduce(($,Z)=>t(E,Z)<t(E,$)?Z:$)}function k(N,E,C,I){var M=C.v,L=C.w;N.removeEdge(M,L),N.setEdge(I.v,I.w,{}),m(N),c(N,E),w(N,E)}function w(N,E){var C=N.nodes().find(M=>!E.node(M).parent),I=i(N,C);I=I.slice(1),I.forEach(M=>{var L=N.node(M).parent,T=E.edge(M,L),A=!1;T||(T=E.edge(L,M),A=!0),E.node(M).rank=E.node(L).rank+(A?T.minlen:-T.minlen)})}function b(N,E,C){return N.hasEdge(E,C)}function S(N,E,C){return C.low<=E.lim&&E.lim<=C.lim}return _d}var Cd,X0;function nI(){if(X0)return Cd;X0=1;var e=ou(),t=e.longestPath,n=a1(),i=tI();Cd=o;function o(f){var h=f.graph().ranker;if(h instanceof Function)return h(f);switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":l(f);break;case"longest-path":a(f);break;case"none":break;default:c(f)}}var a=t;function l(f){t(f),n(f)}function c(f){i(f)}return Cd}var Td,Q0;function rI(){if(Q0)return Td;Q0=1,Td=e;function e(i){let o=n(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),c=l.edgeObj,f=t(i,o,c.v,c.w),h=f.path,m=f.lca,d=0,g=h[d],v=!0;for(;a!==c.w;){if(l=i.node(a),v){for(;(g=h[d])!==m&&i.node(g).maxRank<l.rank;)d++;g===m&&(v=!1)}if(!v){for(;d<h.length-1&&i.node(g=h[d+1]).minRank<=l.rank;)d++;g=h[d]}i.setParent(a,g),a=i.successors(a)[0]}})}function t(i,o,a,l){let c=[],f=[],h=Math.min(o[a].low,o[l].low),m=Math.max(o[a].lim,o[l].lim),d,g;d=a;do d=i.parent(d),c.push(d);while(d&&(o[d].low>h||m>o[d].lim));for(g=d,d=l;(d=i.parent(d))!==g;)f.push(d);return{path:c.concat(f.reverse()),lca:g}}function n(i){let o={},a=0;function l(c){let f=a;i.children(c).forEach(l),o[c]={low:f,lim:a++}}return i.children().forEach(l),o}return Td}var Od,J0;function iI(){if(J0)return Od;J0=1;let e=nt();Od={run:t,cleanup:a};function t(l){let c=e.addDummyNode(l,"root",{},"_root"),f=i(l),h=Object.values(f),m=e.applyWithChunking(Math.max,h)-1,d=2*m+1;l.graph().nestingRoot=c,l.edges().forEach(v=>l.edge(v).minlen*=d);let g=o(l)+1;l.children().forEach(v=>n(l,c,d,g,m,f,v)),l.graph().nodeRankFactor=d}function n(l,c,f,h,m,d,g){let v=l.children(g);if(!v.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:f});return}let k=e.addBorderNode(l,"_bt"),w=e.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(k,g),b.borderTop=k,l.setParent(w,g),b.borderBottom=w,v.forEach(S=>{n(l,c,f,h,m,d,S);let N=l.node(S),E=N.borderTop?N.borderTop:S,C=N.borderBottom?N.borderBottom:S,I=N.borderTop?h:2*h,M=E!==C?1:m-d[g]+1;l.setEdge(k,E,{weight:I,minlen:M,nestingEdge:!0}),l.setEdge(C,w,{weight:I,minlen:M,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,k,{weight:0,minlen:m+d[g]})}function i(l){var c={};function f(h,m){var d=l.children(h);d&&d.length&&d.forEach(g=>f(g,m+1)),c[h]=m}return l.children().forEach(h=>f(h,1)),c}function o(l){return l.edges().reduce((c,f)=>c+l.edge(f).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(f=>{var h=l.edge(f);h.nestingEdge&&l.removeEdge(f)})}return Od}var Pd,Z0;function sI(){if(Z0)return Pd;Z0=1;let e=nt();Pd=t;function t(i){function o(a){let l=i.children(a),c=i.node(a);if(l.length&&l.forEach(o),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,h=c.maxRank+1;f<h;++f)n(i,"borderLeft","_bl",a,c,f),n(i,"borderRight","_br",a,c,f)}}i.children().forEach(o)}function n(i,o,a,l,c,f){let h={width:0,height:0,rank:f,borderType:o},m=c[o][f-1],d=e.addDummyNode(i,"border",h,a);c[o][f]=d,i.setParent(d,l),m&&i.setEdge(m,d,{weight:1})}return Pd}var Id,ev;function oI(){if(ev)return Id;ev=1,Id={adjust:e,undo:t};function e(f){let h=f.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(f)}function t(f){let h=f.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&o(f),(h==="lr"||h==="rl")&&(l(f),n(f))}function n(f){f.nodes().forEach(h=>i(f.node(h))),f.edges().forEach(h=>i(f.edge(h)))}function i(f){let h=f.width;f.width=f.height,f.height=h}function o(f){f.nodes().forEach(h=>a(f.node(h))),f.edges().forEach(h=>{let m=f.edge(h);m.points.forEach(a),Object.hasOwn(m,"y")&&a(m)})}function a(f){f.y=-f.y}function l(f){f.nodes().forEach(h=>c(f.node(h))),f.edges().forEach(h=>{let m=f.edge(h);m.points.forEach(c),Object.hasOwn(m,"x")&&c(m)})}function c(f){let h=f.x;f.x=f.y,f.y=h}return Id}var Ad,tv;function aI(){if(tv)return Ad;tv=1;let e=nt();Ad=t;function t(n){let i={},o=n.nodes().filter(m=>!n.children(m).length),a=o.map(m=>n.node(m).rank),l=e.applyWithChunking(Math.max,a),c=e.range(l+1).map(()=>[]);function f(m){if(i[m])return;i[m]=!0;let d=n.node(m);c[d.rank].push(m),n.successors(m).forEach(f)}return o.sort((m,d)=>n.node(m).rank-n.node(d).rank).forEach(f),c}return Ad}var Md,nv;function lI(){if(nv)return Md;nv=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,k)=>v.pos-k.pos)),f=1;for(;f<a.length;)f<<=1;let h=2*f-1;f-=1;let m=new Array(h).fill(0),d=0;return c.forEach(g=>{let v=g.pos+f;m[v]+=g.weight;let k=0;for(;v>0;)v%2&&(k+=m[v+1]),v=v-1>>1,m[v]+=g.weight;d+=g.weight*k}),d}return Md}var Ld,rv;function uI(){if(rv)return Ld;rv=1,Ld=e;function e(t,n=[]){return n.map(i=>{let o=t.inEdges(i);if(o.length){let a=o.reduce((l,c)=>{let f=t.edge(c),h=t.node(c.v);return{sum:l.sum+f.weight*h.order,weight:l.weight+f.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}return Ld}var Rd,iv;function cI(){if(iv)return Rd;iv=1;let e=nt();Rd=t;function t(o,a){let l={};o.forEach((f,h)=>{let m=l[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:h};f.barycenter!==void 0&&(m.barycenter=f.barycenter,m.weight=f.weight)}),a.edges().forEach(f=>{let h=l[f.v],m=l[f.w];h!==void 0&&m!==void 0&&(m.indegree++,h.out.push(l[f.w]))});let c=Object.values(l).filter(f=>!f.indegree);return n(c)}function n(o){let a=[];function l(f){return h=>{h.merged||(h.barycenter===void 0||f.barycenter===void 0||h.barycenter>=f.barycenter)&&i(f,h)}}function c(f){return h=>{h.in.push(f),--h.indegree===0&&o.push(h)}}for(;o.length;){let f=o.pop();a.push(f),f.in.reverse().forEach(l(f)),f.out.forEach(c(f))}return a.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function i(o,a){let l=0,c=0;o.weight&&(l+=o.barycenter*o.weight,c+=o.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),o.vs=a.vs.concat(o.vs),o.barycenter=l/c,o.weight=c,o.i=Math.min(a.i,o.i),a.merged=!0}return Rd}var Dd,sv;function fI(){if(sv)return Dd;sv=1;let e=nt();Dd=t;function t(o,a){let l=e.partition(o,k=>Object.hasOwn(k,"barycenter")),c=l.lhs,f=l.rhs.sort((k,w)=>w.i-k.i),h=[],m=0,d=0,g=0;c.sort(i(!!a)),g=n(h,f,g),c.forEach(k=>{g+=k.vs.length,h.push(k.vs),m+=k.barycenter*k.weight,d+=k.weight,g=n(h,f,g)});let v={vs:h.flat(!0)};return d&&(v.barycenter=m/d,v.weight=d),v}function n(o,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),o.push(c.vs),l++;return l}function i(o){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:o?l.i-a.i:a.i-l.i}return Dd}var jd,ov;function dI(){if(ov)return jd;ov=1;let e=uI(),t=cI(),n=fI();jd=i;function i(l,c,f,h){let m=l.children(c),d=l.node(c),g=d?d.borderLeft:void 0,v=d?d.borderRight:void 0,k={};g&&(m=m.filter(N=>N!==g&&N!==v));let w=e(l,m);w.forEach(N=>{if(l.children(N.v).length){let E=i(l,N.v,f,h);k[N.v]=E,Object.hasOwn(E,"barycenter")&&a(N,E)}});let b=t(w,f);o(b,k);let S=n(b,h);if(g&&(S.vs=[g,S.vs,v].flat(!0),l.predecessors(g).length)){let N=l.node(l.predecessors(g)[0]),E=l.node(l.predecessors(v)[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+N.order+E.order)/(S.weight+2),S.weight+=2}return S}function o(l,c){l.forEach(f=>{f.vs=f.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}return jd}var $d,av;function hI(){if(av)return $d;av=1;let e=yn().Graph,t=nt();$d=n;function n(o,a,l,c){c||(c=o.nodes());let f=i(o),h=new e({compound:!0}).setGraph({root:f}).setDefaultNodeLabel(m=>o.node(m));return c.forEach(m=>{let d=o.node(m),g=o.parent(m);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(h.setNode(m),h.setParent(m,g||f),o[l](m).forEach(v=>{let k=v.v===m?v.w:v.v,w=h.edge(k,m),b=w!==void 0?w.weight:0;h.setEdge(k,m,{weight:o.edge(v).weight+b})}),Object.hasOwn(d,"minRank")&&h.setNode(m,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),h}function i(o){for(var a;o.hasNode(a=t.uniqueId("_root")););return a}return $d}var zd,lv;function pI(){if(lv)return zd;lv=1,zd=e;function e(t,n,i){let o={},a;i.forEach(l=>{let c=t.parent(l),f,h;for(;c;){if(f=t.parent(c),f?(h=o[f],o[f]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=f}})}return zd}var Fd,uv;function mI(){if(uv)return Fd;uv=1;let e=aI(),t=lI(),n=dI(),i=hI(),o=pI(),a=yn().Graph,l=nt();Fd=c;function c(d,g){if(g&&typeof g.customOrder=="function"){g.customOrder(d,c);return}let v=l.maxRank(d),k=f(d,l.range(1,v+1),"inEdges"),w=f(d,l.range(v-1,-1,-1),"outEdges"),b=e(d);if(m(d,b),g&&g.disableOptimalOrderHeuristic)return;let S=Number.POSITIVE_INFINITY,N;for(let E=0,C=0;C<4;++E,++C){h(E%2?k:w,E%4>=2),b=l.buildLayerMatrix(d);let I=t(d,b);I<S&&(C=0,N=Object.assign({},b),S=I)}m(d,N)}function f(d,g,v){const k=new Map,w=(b,S)=>{k.has(b)||k.set(b,[]),k.get(b).push(S)};for(const b of d.nodes()){const S=d.node(b);if(typeof S.rank=="number"&&w(S.rank,b),typeof S.minRank=="number"&&typeof S.maxRank=="number")for(let N=S.minRank;N<=S.maxRank;N++)N!==S.rank&&w(N,b)}return g.map(function(b){return i(d,b,v,k.get(b)||[])})}function h(d,g){let v=new a;d.forEach(function(k){let w=k.graph().root,b=n(k,w,v,g);b.vs.forEach((S,N)=>k.node(S).order=N),o(k,v,b.vs)})}function m(d,g){Object.values(g).forEach(v=>v.forEach((k,w)=>d.node(k).order=w))}return Fd}var Bd,cv;function gI(){if(cv)return Bd;cv=1;let e=yn().Graph,t=nt();Bd={positionX:v,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:d,findSmallestWidthAlignment:m,balance:g};function n(b,S){let N={};function E(C,I){let M=0,L=0,T=C.length,A=I[I.length-1];return I.forEach((z,R)=>{let $=o(b,z),Z=$?b.node($).order:T;($||z===A)&&(I.slice(L,R+1).forEach(j=>{b.predecessors(j).forEach(G=>{let Y=b.node(G),J=Y.order;(J<M||Z<J)&&!(Y.dummy&&b.node(j).dummy)&&a(N,G,j)})}),L=R+1,M=Z)}),I}return S.length&&S.reduce(E),N}function i(b,S){let N={};function E(I,M,L,T,A){let z;t.range(M,L).forEach(R=>{z=I[R],b.node(z).dummy&&b.predecessors(z).forEach($=>{let Z=b.node($);Z.dummy&&(Z.order<T||Z.order>A)&&a(N,$,z)})})}function C(I,M){let L=-1,T,A=0;return M.forEach((z,R)=>{if(b.node(z).dummy==="border"){let $=b.predecessors(z);$.length&&(T=b.node($[0]).order,E(M,A,R,L,T),A=R,L=T)}E(M,A,M.length,T,I.length)}),M}return S.length&&S.reduce(C),N}function o(b,S){if(b.node(S).dummy)return b.predecessors(S).find(N=>b.node(N).dummy)}function a(b,S,N){if(S>N){let C=S;S=N,N=C}let E=b[S];E||(b[S]=E={}),E[N]=!0}function l(b,S,N){if(S>N){let E=S;S=N,N=E}return!!b[S]&&Object.hasOwn(b[S],N)}function c(b,S,N,E){let C={},I={},M={};return S.forEach(L=>{L.forEach((T,A)=>{C[T]=T,I[T]=T,M[T]=A})}),S.forEach(L=>{let T=-1;L.forEach(A=>{let z=E(A);if(z.length){z=z.sort(($,Z)=>M[$]-M[Z]);let R=(z.length-1)/2;for(let $=Math.floor(R),Z=Math.ceil(R);$<=Z;++$){let j=z[$];I[A]===A&&T<M[j]&&!l(N,A,j)&&(I[j]=A,I[A]=C[A]=C[j],T=M[j])}}})}),{root:C,align:I}}function f(b,S,N,E,C){let I={},M=h(b,S,N,C),L=C?"borderLeft":"borderRight";function T(R,$){let Z=M.nodes(),j=Z.pop(),G={};for(;j;)G[j]?R(j):(G[j]=!0,Z.push(j),Z=Z.concat($(j))),j=Z.pop()}function A(R){I[R]=M.inEdges(R).reduce(($,Z)=>Math.max($,I[Z.v]+M.edge(Z)),0)}function z(R){let $=M.outEdges(R).reduce((j,G)=>Math.min(j,I[G.w]-M.edge(G)),Number.POSITIVE_INFINITY),Z=b.node(R);$!==Number.POSITIVE_INFINITY&&Z.borderType!==L&&(I[R]=Math.max(I[R],$))}return T(A,M.predecessors.bind(M)),T(z,M.successors.bind(M)),Object.keys(E).forEach(R=>I[R]=I[N[R]]),I}function h(b,S,N,E){let C=new e,I=b.graph(),M=k(I.nodesep,I.edgesep,E);return S.forEach(L=>{let T;L.forEach(A=>{let z=N[A];if(C.setNode(z),T){var R=N[T],$=C.edge(R,z);C.setEdge(R,z,Math.max(M(b,A,T),$||0))}T=A})}),C}function m(b,S){return Object.values(S).reduce((N,E)=>{let C=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([L,T])=>{let A=w(b,L)/2;C=Math.max(T+A,C),I=Math.min(T-A,I)});const M=C-I;return M<N[0]&&(N=[M,E]),N},[Number.POSITIVE_INFINITY,null])[1]}function d(b,S){let N=Object.values(S),E=t.applyWithChunking(Math.min,N),C=t.applyWithChunking(Math.max,N);["u","d"].forEach(I=>{["l","r"].forEach(M=>{let L=I+M,T=b[L];if(T===S)return;let A=Object.values(T),z=E-t.applyWithChunking(Math.min,A);M!=="l"&&(z=C-t.applyWithChunking(Math.max,A)),z&&(b[L]=t.mapValues(T,R=>R+z))})})}function g(b,S){return t.mapValues(b.ul,(N,E)=>{if(S)return b[S.toLowerCase()][E];{let C=Object.values(b).map(I=>I[E]).sort((I,M)=>I-M);return(C[1]+C[2])/2}})}function v(b){let S=t.buildLayerMatrix(b),N=Object.assign(n(b,S),i(b,S)),E={},C;["u","d"].forEach(M=>{C=M==="u"?S:Object.values(S).reverse(),["l","r"].forEach(L=>{L==="r"&&(C=C.map(R=>Object.values(R).reverse()));let T=(M==="u"?b.predecessors:b.successors).bind(b),A=c(b,C,N,T),z=f(b,C,A.root,A.align,L==="r");L==="r"&&(z=t.mapValues(z,R=>-R)),E[M+L]=z})});let I=m(b,E);return d(E,I),g(E,b.graph().align)}function k(b,S,N){return(E,C,I)=>{let M=E.node(C),L=E.node(I),T=0,A;if(T+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":A=-M.width/2;break;case"r":A=M.width/2;break}if(A&&(T+=N?A:-A),A=0,T+=(M.dummy?S:b)/2,T+=(L.dummy?S:b)/2,T+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":A=L.width/2;break;case"r":A=-L.width/2;break}return A&&(T+=N?A:-A),A=0,T}}function w(b,S){return b.node(S).width}return Bd}var Vd,fv;function yI(){if(fv)return Vd;fv=1;let e=nt(),t=gI().positionX;Vd=n;function n(o){o=e.asNonCompoundGraph(o),i(o),Object.entries(t(o)).forEach(([a,l])=>o.node(a).x=l)}function i(o){let a=e.buildLayerMatrix(o),l=o.graph().ranksep,c=0;a.forEach(f=>{const h=f.reduce((m,d)=>{const g=o.node(d).height;return m>g?m:g},0);f.forEach(m=>o.node(m).y=c+h/2),c+=h+l})}return Vd}var Wd,dv;function vI(){if(dv)return Wd;dv=1;let e=ZP(),t=eI(),n=nI(),i=nt().normalizeRanks,o=rI(),a=nt().removeEmptyRanks,l=iI(),c=sI(),f=oI(),h=mI(),m=yI(),d=nt(),g=yn().Graph;Wd=v;function v(W,K){let Q=K&&K.debugTiming?d.time:d.notime;Q("layout",()=>{let re=Q(" buildLayoutGraph",()=>T(W));Q(" runLayout",()=>k(re,Q,K)),Q(" updateInputGraph",()=>w(W,re))})}function k(W,K,Q){K(" makeSpaceForEdgeLabels",()=>A(W)),K(" removeSelfEdges",()=>B(W)),K(" acyclic",()=>e.run(W)),K(" nestingGraph.run",()=>l.run(W)),K(" rank",()=>n(d.asNonCompoundGraph(W))),K(" injectEdgeLabelProxies",()=>z(W)),K(" removeEmptyRanks",()=>a(W)),K(" nestingGraph.cleanup",()=>l.cleanup(W)),K(" normalizeRanks",()=>i(W)),K(" assignRankMinMax",()=>R(W)),K(" removeEdgeLabelProxies",()=>$(W)),K(" normalize.run",()=>t.run(W)),K(" parentDummyChains",()=>o(W)),K(" addBorderSegments",()=>c(W)),K(" order",()=>h(W,Q)),K(" insertSelfEdges",()=>H(W)),K(" adjustCoordinateSystem",()=>f.adjust(W)),K(" position",()=>m(W)),K(" positionSelfEdges",()=>V(W)),K(" removeBorderNodes",()=>J(W)),K(" normalize.undo",()=>t.undo(W)),K(" fixupEdgeLabelCoords",()=>G(W)),K(" undoCoordinateSystem",()=>f.undo(W)),K(" translateGraph",()=>Z(W)),K(" assignNodeIntersects",()=>j(W)),K(" reversePoints",()=>Y(W)),K(" acyclic.undo",()=>e.undo(W))}function w(W,K){W.nodes().forEach(Q=>{let re=W.node(Q),oe=K.node(Q);re&&(re.x=oe.x,re.y=oe.y,re.rank=oe.rank,K.children(Q).length&&(re.width=oe.width,re.height=oe.height))}),W.edges().forEach(Q=>{let re=W.edge(Q),oe=K.edge(Q);re.points=oe.points,Object.hasOwn(oe,"x")&&(re.x=oe.x,re.y=oe.y)}),W.graph().width=K.graph().width,W.graph().height=K.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],S={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],E=["width","height","rank"],C={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function T(W){let K=new g({multigraph:!0,compound:!0}),Q=U(W.graph());return K.setGraph(Object.assign({},S,D(Q,b),d.pick(Q,N))),W.nodes().forEach(re=>{let oe=U(W.node(re));const ee=D(oe,E);Object.keys(C).forEach(se=>{ee[se]===void 0&&(ee[se]=C[se])}),K.setNode(re,ee),K.setParent(re,W.parent(re))}),W.edges().forEach(re=>{let oe=U(W.edge(re));K.setEdge(re,Object.assign({},M,D(oe,I),d.pick(oe,L)))}),K}function A(W){let K=W.graph();K.ranksep/=2,W.edges().forEach(Q=>{let re=W.edge(Q);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function z(W){W.edges().forEach(K=>{let Q=W.edge(K);if(Q.width&&Q.height){let re=W.node(K.v),ee={rank:(W.node(K.w).rank-re.rank)/2+re.rank,e:K};d.addDummyNode(W,"edge-proxy",ee,"_ep")}})}function R(W){let K=0;W.nodes().forEach(Q=>{let re=W.node(Q);re.borderTop&&(re.minRank=W.node(re.borderTop).rank,re.maxRank=W.node(re.borderBottom).rank,K=Math.max(K,re.maxRank))}),W.graph().maxRank=K}function $(W){W.nodes().forEach(K=>{let Q=W.node(K);Q.dummy==="edge-proxy"&&(W.edge(Q.e).labelRank=Q.rank,W.removeNode(K))})}function Z(W){let K=Number.POSITIVE_INFINITY,Q=0,re=Number.POSITIVE_INFINITY,oe=0,ee=W.graph(),se=ee.marginx||0,de=ee.marginy||0;function xe(he){let fe=he.x,Se=he.y,Ie=he.width,Ae=he.height;K=Math.min(K,fe-Ie/2),Q=Math.max(Q,fe+Ie/2),re=Math.min(re,Se-Ae/2),oe=Math.max(oe,Se+Ae/2)}W.nodes().forEach(he=>xe(W.node(he))),W.edges().forEach(he=>{let fe=W.edge(he);Object.hasOwn(fe,"x")&&xe(fe)}),K-=se,re-=de,W.nodes().forEach(he=>{let fe=W.node(he);fe.x-=K,fe.y-=re}),W.edges().forEach(he=>{let fe=W.edge(he);fe.points.forEach(Se=>{Se.x-=K,Se.y-=re}),Object.hasOwn(fe,"x")&&(fe.x-=K),Object.hasOwn(fe,"y")&&(fe.y-=re)}),ee.width=Q-K+se,ee.height=oe-re+de}function j(W){W.edges().forEach(K=>{let Q=W.edge(K),re=W.node(K.v),oe=W.node(K.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(d.intersectRect(re,ee)),Q.points.push(d.intersectRect(oe,se))})}function G(W){W.edges().forEach(K=>{let Q=W.edge(K);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(W){W.edges().forEach(K=>{let Q=W.edge(K);Q.reversed&&Q.points.reverse()})}function J(W){W.nodes().forEach(K=>{if(W.children(K).length){let Q=W.node(K),re=W.node(Q.borderTop),oe=W.node(Q.borderBottom),ee=W.node(Q.borderLeft[Q.borderLeft.length-1]),se=W.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}}),W.nodes().forEach(K=>{W.node(K).dummy==="border"&&W.removeNode(K)})}function B(W){W.edges().forEach(K=>{if(K.v===K.w){var Q=W.node(K.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:K,label:W.edge(K)}),W.removeEdge(K)}})}function H(W){var K=d.buildLayerMatrix(W);K.forEach(Q=>{var re=0;Q.forEach((oe,ee)=>{var se=W.node(oe);se.order=ee+re,(se.selfEdges||[]).forEach(de=>{d.addDummyNode(W,"selfedge",{width:de.label.width,height:de.label.height,rank:se.rank,order:ee+ ++re,e:de.e,label:de.label},"_se")}),delete se.selfEdges})})}function V(W){W.nodes().forEach(K=>{var Q=W.node(K);if(Q.dummy==="selfedge"){var re=W.node(Q.e.v),oe=re.x+re.width/2,ee=re.y,se=Q.x-oe,de=re.height/2;W.setEdge(Q.e,Q.label),W.removeNode(K),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 D(W,K){return d.mapValues(d.pick(W,K),Number)}function U(W){var K={};return W&&Object.entries(W).forEach(([Q,re])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),K[Q]=re}),K}return Wd}var Ud,hv;function wI(){if(hv)return Ud;hv=1;let e=nt(),t=yn().Graph;Ud={debugOrdering:n};function n(i){let o=e.buildLayerMatrix(i),a=new t({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),o.forEach((l,c)=>{let f="layer"+c;a.setNode(f,{rank:"same"}),l.reduce((h,m)=>(a.setEdge(h,m,{style:"invis"}),m))}),a}return Ud}var Hd,pv;function xI(){return pv||(pv=1,Hd="1.1.8"),Hd}var qd,mv;function bI(){return mv||(mv=1,qd={graphlib:yn(),layout:vI(),debug:wI(),util:{time:nt().time,notime:nt().notime},version:xI()}),qd}var kI=bI();const gv=hu(kI),yv=220,vv=140,Yd=60;function SI(e){return P.useMemo(()=>{if(!e)return{nodes:[],edges:[]};const t=new gv.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.")?vv:yv;t.setNode(o.id,{width:a,height:Yd})}for(const o of e.edges)t.setEdge(o.from,o.to);gv.layout(t);const n=e.nodes.map(o=>{const a=t.node(o.id),l=o.type==="task.branch"||o.type.startsWith("trigger.")?vv:yv;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 EI="hsl(240 5% 65%)",l1="hsl(142 71% 42%)",NI="hsl(0 72% 55%)",_I="hsl(38 92% 50%)";function CI(e,t){const n=e!=="idle";return{stroke:e==="failed"?NI:e==="running"?_I:n?l1:EI,strokeWidth:n?2.5:1.5,strokeDasharray:t&&!n?"6 4":void 0,animated:e==="running",fired:n}}const TI={workflowNode:k0,agentNode:k0};function OI({workflow:e,onNodeClick:t,onLoadYaml:n,nodeStatuses:i={}}){const{nodes:o,edges:a}=SI(e),[l,c]=P.useState(!1),f=o.map(k=>({...k,data:{...k.data,onNodeClick:t,liveStatus:i[k.id]??"idle"}})),h=a.map(k=>{const w=CI(i[k.target]??"idle",k.label!=null&&k.label!=="");return{...k,animated:w.animated,style:{stroke:w.stroke,strokeWidth:w.strokeWidth,strokeDasharray:w.strokeDasharray},labelStyle:{fontSize:11,fontFamily:"JetBrains Mono, monospace",fill:w.fired?w.stroke:"hsl(240 5% 50%)"},labelBgStyle:{fill:"hsl(0 0% 100%)",fillOpacity:.85}}}),m=P.useCallback((k,w)=>{const b=w.data.node;b&&t(b)},[t]),d=P.useCallback(k=>{k.preventDefault(),k.dataTransfer.dropEffect="copy",c(!0)},[]),g=P.useCallback(()=>{c(!1)},[]),v=P.useCallback(k=>{k.preventDefault(),c(!1);const w=k.dataTransfer.files[0];if(!w)return;const b=new FileReader;b.onload=S=>{var E;const N=(E=S.target)==null?void 0:E.result;typeof N=="string"&&n(N)},b.readAsText(w)},[n]);return _.jsxs("div",{className:"flex-1 relative canvas-grid overflow-hidden",style:{height:"100%"},onDragOver:d,onDragLeave:g,onDrop:v,children:[_.jsxs(aO,{nodes:f,edges:h,nodeTypes:TI,onNodeClick:m,fitView:!0,attributionPosition:"bottom-right",children:[_.jsx(dO,{variant:Qn.Dots,gap:22,size:1,color:"hsl(240 5.9% 88%)"}),_.jsx(wO,{})]}),l&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg/70 border-2 border-dashed border-primary pointer-events-none z-10",children:_.jsx("span",{className:"text-sm font-medium text-primary",children:"Drop YAML here"})}),_.jsx("div",{className:"absolute bottom-3 right-14 text-[10px] font-mono text-mutedfg pointer-events-none",children:"layout: auto (dagre) · positions not stored"}),_.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-3 text-[10px] font-mono text-mutedfg pointer-events-none bg-bg/80 border border-border rounded px-2 py-1",children:[_.jsxs("span",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"inline-block w-4 border-t-2 border-dashed",style:{borderColor:"hsl(240 5% 65%)"}})," branch"]}),_.jsxs("span",{className:"flex items-center gap-1",children:[_.jsx("span",{className:"inline-block w-4 border-t-2",style:{borderColor:l1}})," 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 wv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function PI(...e){return t=>{let n=!1;const i=e.map(o=>{const a=wv(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():wv(e[o],null)}}}}function Ut(...e){return P.useCallback(PI(...e),e)}function u1(e,t=[]){let n=[];function i(a,l){const c=P.createContext(l);c.displayName=a+"Context";const f=n.length;n=[...n,l];const h=d=>{var S;const{scope:g,children:v,...k}=d,w=((S=g==null?void 0:g[e])==null?void 0:S[f])||c,b=P.useMemo(()=>k,Object.values(k));return _.jsx(w.Provider,{value:b,children:v})};h.displayName=a+"Provider";function m(d,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[f])||c,k=P.useContext(v);if(k)return k;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[h,m]}const o=()=>{const a=n.map(l=>P.createContext(l));return function(c){const f=(c==null?void 0:c[e])||a;return P.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[i,II(o,...t)]}function II(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const l=i.reduce((c,{useScope:f,scopeName:h})=>{const d=f(a)[`__scope${h}`];return{...c,...d}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ds=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},AI=Lh[" useId ".trim().toString()]||(()=>{}),MI=0;function Kd(e){const[t,n]=P.useState(AI());return ds(()=>{n(i=>i??String(MI++))},[e]),e||(t?`radix-${t}`:"")}var LI=Lh[" useInsertionEffect ".trim().toString()]||ds;function RI({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[o,a,l]=DI({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:o;{const m=P.useRef(e!==void 0);P.useEffect(()=>{const d=m.current;d!==c&&console.warn(`${i} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,i])}const h=P.useCallback(m=>{var d;if(c){const g=jI(m)?m(e):m;g!==e&&((d=l.current)==null||d.call(l,g))}else a(m)},[c,e,a,l]);return[f,h]}function DI({defaultProp:e,onChange:t}){const[n,i]=P.useState(e),o=P.useRef(n),a=P.useRef(t);return LI(()=>{a.current=t},[t]),P.useEffect(()=>{var l;o.current!==n&&((l=a.current)==null||l.call(a,n),o.current=n)},[n,o]),[n,i,a]}function jI(e){return typeof e=="function"}function c1(e){const t=P.forwardRef((n,i)=>{let{children:o,...a}=n,l=null,c=!1;const f=[];xv(o)&&typeof Cl=="function"&&(o=Cl(o._payload)),P.Children.forEach(o,g=>{var v;if(VI(g)){c=!0;const k=g;let w="child"in k.props?k.props.child:k.props.children;xv(w)&&typeof Cl=="function"&&(w=Cl(w._payload)),l=zI(k,w),f.push((v=l==null?void 0:l.props)==null?void 0:v.children)}else f.push(g)}),l?l=P.cloneElement(l,void 0,f):!c&&P.Children.count(o)===1&&P.isValidElement(o)&&(l=o);const h=l?BI(l):void 0,m=Ut(i,h);if(!l){if(o||o===0)throw new Error(c?qI(e):HI(e));return o}const d=FI(a,l.props??{});return l.type!==P.Fragment&&(d.ref=i?m:h),P.cloneElement(l,d)});return t.displayName=`${e}.Slot`,t}var $I=Symbol.for("radix.slottable"),zI=(e,t)=>{if("child"in e.props){const n=e.props.child;return P.isValidElement(n)?P.cloneElement(n,void 0,e.props.children(n.props.children)):null}return P.isValidElement(t)?t:null};function FI(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 BI(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 VI(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$I}var WI=Symbol.for("react.lazy");function xv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===WI&&"_payload"in e&&UI(e._payload)}function UI(e){return typeof e=="object"&&e!==null&&"then"in e}var HI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,qI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cl=Lh[" use ".trim().toString()],YI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=YI.reduce((e,t)=>{const n=c1(`Primitive.${t}`),i=P.forwardRef((o,a)=>{const{asChild:l,...c}=o,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(f,{...c,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function KI(e,t){e&&rx.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function GI(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);P.useEffect(()=>{const i=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var XI="DismissableLayer",Eh="dismissableLayer.update",QI="dismissableLayer.pointerDownOutside",JI="dismissableLayer.focusOutside",bv,rp=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),f1=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...h}=e,m=P.useContext(rp),[d,g]=P.useState(null),v=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=P.useState({}),w=Ut(t,A=>g(A)),b=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(S),E=d?b.indexOf(d):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,I=E>=N,M=P.useRef(!1),L=nA(A=>{const z=A.target;if(!(z instanceof Node))return;const R=[...m.branches].some($=>$.contains(z));!I||R||(a==null||a(A),c==null||c(A),A.defaultPrevented||f==null||f())},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:m.dismissableSurfaces}),T=rA(A=>{if(i&&M.current)return;const z=A.target;[...m.branches].some($=>$.contains(z))||(l==null||l(A),c==null||c(A),A.defaultPrevented||f==null||f())},v);return GI(A=>{E===m.layers.size-1&&(o==null||o(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},v),P.useEffect(()=>{if(d)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(bv=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(d)),m.layers.add(d),kv(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(d),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=bv))}},[d,v,n,m]),P.useEffect(()=>()=>{d&&(m.layers.delete(d),m.layersWithOutsidePointerEventsDisabled.delete(d),kv())},[d,m]),P.useEffect(()=>{const A=()=>k({});return document.addEventListener(Eh,A),()=>document.removeEventListener(Eh,A)},[]),_.jsx(Lt.div,{...h,ref:w,style:{pointerEvents:C?I?"auto":"none":void 0,...e.style},onFocusCapture:St(e.onFocusCapture,T.onFocusCapture),onBlurCapture:St(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:St(e.onPointerDownCapture,L.onPointerDownCapture)})});f1.displayName=XI;var ZI="DismissableLayerBranch",eA=P.forwardRef((e,t)=>{const n=P.useContext(rp),i=P.useRef(null),o=Ut(t,i);return P.useEffect(()=>{const a=i.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),_.jsx(Lt.div,{...e,ref:o})});eA.displayName=ZI;function tA(){const e=P.useContext(rp),[t,n]=P.useState(null);return P.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function nA(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:a}=t,l=Zt(e),c=P.useRef(!1),f=P.useRef(!1),h=P.useRef(new Map),m=P.useRef(()=>{});return P.useEffect(()=>{function d(){f.current=!1,o.current=!1,h.current.clear()}function g(){return Array.from(h.current.values()).some(Boolean)}function v(N){if(!f.current)return;const E=N.target;E instanceof Node&&[...a].some(I=>I.contains(E))||h.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function k(N){f.current&&h.current.set(N.type,!1)}const w=N=>{if(N.target&&!c.current){let E=function(){n.removeEventListener("click",m.current);const I=g();d(),I||d1(QI,l,C,{discrete:!0})};const C={originalEvent:N};f.current=!0,o.current=i&&N.button===0,h.current.clear(),!i||N.button!==0?E():(n.removeEventListener("click",m.current),m.current=E,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),d();c.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of b)n.addEventListener(N,v,!0),n.addEventListener(N,k);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",w),n.removeEventListener("click",m.current);for(const N of b)n.removeEventListener(N,v,!0),n.removeEventListener(N,k)}},[n,l,i,o,a]),{onPointerDownCapture:()=>c.current=!0}}function rA(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),i=P.useRef(!1);return P.useEffect(()=>{const o=a=>{a.target&&!i.current&&d1(JI,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 kv(){const e=new CustomEvent(Eh);document.dispatchEvent(e)}function d1(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?KI(o,a):o.dispatchEvent(a)}var Gd="focusScope.autoFocusOnMount",Xd="focusScope.autoFocusOnUnmount",Sv={bubbles:!1,cancelable:!0},iA="FocusScope",h1=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...l}=e,[c,f]=P.useState(null),h=Zt(o),m=Zt(a),d=P.useRef(null),g=Ut(t,w=>f(w)),v=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(i){let w=function(E){if(v.paused||!c)return;const C=E.target;c.contains(C)?d.current=C:_r(d.current,{select:!0})},b=function(E){if(v.paused||!c)return;const C=E.relatedTarget;C!==null&&(c.contains(C)||_r(d.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const I of E)I.removedNodes.length>0&&_r(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),N.disconnect()}}},[i,c,v.paused]),P.useEffect(()=>{if(c){Nv.add(v);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Gd,Sv);c.addEventListener(Gd,h),c.dispatchEvent(S),S.defaultPrevented||(sA(cA(p1(c)),{select:!0}),document.activeElement===w&&_r(c))}return()=>{c.removeEventListener(Gd,h),setTimeout(()=>{const S=new CustomEvent(Xd,Sv);c.addEventListener(Xd,m),c.dispatchEvent(S),S.defaultPrevented||_r(w??document.body,{select:!0}),c.removeEventListener(Xd,m),Nv.remove(v)},0)}}},[c,h,m,v]);const k=P.useCallback(w=>{if(!n&&!i||v.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(b&&S){const N=w.currentTarget,[E,C]=oA(N);E&&C?!w.shiftKey&&S===C?(w.preventDefault(),n&&_r(E,{select:!0})):w.shiftKey&&S===E&&(w.preventDefault(),n&&_r(C,{select:!0})):S===N&&w.preventDefault()}},[n,i,v.paused]);return _.jsx(Lt.div,{tabIndex:-1,...l,ref:g,onKeyDown:k})});h1.displayName=iA;function sA(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(_r(i,{select:t}),document.activeElement!==n)return}function oA(e){const t=p1(e),n=Ev(t,e),i=Ev(t.reverse(),e);return[n,i]}function p1(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 Ev(e,t){for(const n of e)if(!aA(n,{upTo:t}))return n}function aA(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 lA(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&&lA(e)&&t&&e.select()}}var Nv=uA();function uA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_v(e,t),e.unshift(t)},remove(t){var n;e=_v(e,t),(n=e[0])==null||n.resume()}}}function _v(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function cA(e){return e.filter(t=>t.tagName!=="A")}var fA="Portal",m1=P.forwardRef((e,t)=>{var c;const{container:n,...i}=e,[o,a]=P.useState(!1);ds(()=>a(!0),[]);const l=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?rx.createPortal(_.jsx(Lt.div,{...i,ref:t}),l):null});m1.displayName=fA;function dA(e,t){return P.useReducer((n,i)=>t[n][i]??n,e)}var Ar=e=>{const{present:t,children:n}=e,i=hA(t),o=typeof n=="function"?n({present:i.isPresent}):P.Children.only(n),a=pA(i.ref,mA(o));return typeof n=="function"||i.isPresent?P.cloneElement(o,{ref:a}):null};Ar.displayName="Presence";function hA(e){const[t,n]=P.useState(),i=P.useRef(null),o=P.useRef(e),a=P.useRef("none"),l=e?"mounted":"unmounted",[c,f]=dA(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const h=Tl(i.current);a.current=c==="mounted"?h:"none"},[c]),ds(()=>{const h=i.current,m=o.current;if(m!==e){const g=a.current,v=Tl(h);e?f("MOUNT"):v==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),ds(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,d=v=>{const w=Tl(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=v=>{v.target===t&&(a.current=Tl(i.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:P.useCallback(h=>{i.current=h?getComputedStyle(h):null,n(h)},[])}}function Cv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pA(...e){const t=P.useRef(e);return t.current=e,P.useCallback(n=>{const i=t.current;let o=!1;const a=i.map(l=>{const c=Cv(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():Cv(i[l],null)}}},[])}function Tl(e){return(e==null?void 0:e.animationName)||"none"}function mA(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 gA(){P.useEffect(()=>{On||(On={start:Tv(),end:Tv()});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 Tv(){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 In=function(){return In=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},In.apply(this,arguments)};function g1(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 yA(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",vA="with-scroll-bars-hidden",wA="--removed-body-scroll-bar-size";function Qd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xA(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var o=n.value;o!==i&&(n.value=i,n.callback(i,o))}}}})[0];return n.callback=t,n.facade}var bA=typeof window<"u"?P.useLayoutEffect:P.useEffect,Ov=new WeakMap;function kA(e,t){var n=xA(null,function(i){return e.forEach(function(o){return Qd(o,i)})});return bA(function(){var i=Ov.get(n);if(i){var o=new Set(i),a=new Set(e),l=n.current;o.forEach(function(c){a.has(c)||Qd(c,null)}),a.forEach(function(c){o.has(c)||Qd(c,l)})}Ov.set(n,e)},[e]),n}function SA(e){return e}function EA(e,t){t===void 0&&(t=SA);var n=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,i);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(i=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){i=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var f=function(){var m=l;l=[],m.forEach(a)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return o}function NA(e){e===void 0&&(e={});var t=EA(null);return t.options=In({async:!0,ssr:!1},e),t}var y1=function(e){var t=e.sideCar,n=g1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return P.createElement(i,In({},n))};y1.isSideCarExport=!0;function _A(e,t){return e.useMedium(t),y1}var v1=NA(),Jd=function(){},_u=P.forwardRef(function(e,t){var n=P.useRef(null),i=P.useState({onScrollCapture:Jd,onWheelCapture:Jd,onTouchMoveCapture:Jd}),o=i[0],a=i[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,d=e.shards,g=e.sideCar,v=e.noRelative,k=e.noIsolation,w=e.inert,b=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,E=e.gapMode,C=g1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=g,M=kA([n,t]),L=In(In({},C),o);return P.createElement(P.Fragment,null,m&&P.createElement(I,{sideCar:v1,removeScrollBar:h,shards:d,noRelative:v,noIsolation:k,inert:w,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:E}),l?P.cloneElement(P.Children.only(c),In(In({},L),{ref:M})):P.createElement(N,In({},L,{className:f,ref:M}),c))});_u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_u.classNames={fullWidth:Hl,zeroRight:Ul};var CA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function TA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=CA();return t&&e.setAttribute("nonce",t),e}function OA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function PA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var IA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=TA())&&(OA(t,n),PA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},AA=function(){var e=IA();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},w1=function(){var e=AA(),t=function(n){var i=n.styles,o=n.dynamic;return e(i,o),null};return t},MA={left:0,top:0,right:0,gap:0},Zd=function(e){return parseInt(e||"",10)||0},LA=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)]},RA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MA;var t=LA(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])}},DA=w1(),ns="data-scroll-locked",jA=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(vA,` {
|
|
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(wA,": ").concat(c,`px;
|
|
98
|
-
}
|
|
99
|
-
`)},Pv=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},$A=function(){P.useEffect(function(){return document.body.setAttribute(ns,(Pv()+1).toString()),function(){var e=Pv()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},zA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;$A();var a=P.useMemo(function(){return RA(o)},[o]);return P.createElement(DA,{styles:jA(a,!t,o,n?"":"!important")})},Nh=!1;if(typeof window<"u")try{var Pl=Object.defineProperty({},"passive",{get:function(){return Nh=!0,!0}});window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Nh=!1}var Wi=Nh?{passive:!1}:!1,FA=function(e){return e.tagName==="TEXTAREA"},x1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FA(e)&&n[t]==="visible")},BA=function(e){return x1(e,"overflowY")},VA=function(e){return x1(e,"overflowX")},Iv=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=b1(e,i);if(o){var a=k1(e,i),l=a[1],c=a[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},WA=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},UA=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},b1=function(e,t){return e==="v"?BA(t):VA(t)},k1=function(e,t){return e==="v"?WA(t):UA(t)},HA=function(e,t){return e==="h"&&t==="rtl"?-1:1},qA=function(e,t,n,i,o){var a=HA(e,window.getComputedStyle(t).direction),l=a*i,c=n.target,f=t.contains(c),h=!1,m=l>0,d=0,g=0;do{if(!c)break;var v=k1(e,c),k=v[0],w=v[1],b=v[2],S=w-b-a*k;(k||S)&&b1(e,c)&&(d+=S,g+=k);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(d)<1||!m&&Math.abs(g)<1)&&(h=!0),h},Il=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Av=function(e){return[e.deltaX,e.deltaY]},Mv=function(e){return e&&"current"in e?e.current:e},YA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},KA=function(e){return`
|
|
100
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
101
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
102
|
-
`)},GA=0,Ui=[];function XA(e){var t=P.useRef([]),n=P.useRef([0,0]),i=P.useRef(),o=P.useState(GA++)[0],a=P.useState(w1)[0],l=P.useRef(e);P.useEffect(function(){l.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=yA([e.lockRef.current],(e.shards||[]).map(Mv),!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=P.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var S=Il(w),N=n.current,E="deltaX"in w?w.deltaX:N[0]-S[0],C="deltaY"in w?w.deltaY:N[1]-S[1],I,M=w.target,L=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in w&&L==="h"&&M.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,z=A?A===M||A.contains(M):!1;if(z)return!1;var R=Iv(L,M);if(!R)return!0;if(R?I=L:(I=L==="v"?"h":"v",R=Iv(L,M)),!R)return!1;if(!i.current&&"changedTouches"in w&&(E||C)&&(i.current=I),!I)return!0;var $=i.current||I;return qA($,b,w,$==="h"?E:C)},[]),f=P.useCallback(function(w){var b=w;if(!(!Ui.length||Ui[Ui.length-1]!==a)){var S="deltaY"in b?Av(b):Il(b),N=t.current.filter(function(I){return I.name===b.type&&(I.target===b.target||b.target===I.shadowParent)&&YA(I.delta,S)})[0];if(N&&N.should){b.cancelable&&b.preventDefault();return}if(!N){var E=(l.current.shards||[]).map(Mv).filter(Boolean).filter(function(I){return I.contains(b.target)}),C=E.length>0?c(b,E[0]):!l.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),h=P.useCallback(function(w,b,S,N){var E={name:w,delta:b,target:S,should:N,shadowParent:QA(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(C){return C!==E})},1)},[]),m=P.useCallback(function(w){n.current=Il(w),i.current=void 0},[]),d=P.useCallback(function(w){h(w.type,Av(w),w.target,c(w,e.lockRef.current))},[]),g=P.useCallback(function(w){h(w.type,Il(w),w.target,c(w,e.lockRef.current))},[]);P.useEffect(function(){return Ui.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",f,Wi),document.addEventListener("touchmove",f,Wi),document.addEventListener("touchstart",m,Wi),function(){Ui=Ui.filter(function(w){return w!==a}),document.removeEventListener("wheel",f,Wi),document.removeEventListener("touchmove",f,Wi),document.removeEventListener("touchstart",m,Wi)}},[]);var v=e.removeScrollBar,k=e.inert;return P.createElement(P.Fragment,null,k?P.createElement(a,{styles:KA(o)}):null,v?P.createElement(zA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JA=_A(v1,XA);var S1=P.forwardRef(function(e,t){return P.createElement(_u,In({},e,{ref:t,sideCar:JA}))});S1.classNames=_u.classNames;var ZA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hi=new WeakMap,Al=new WeakMap,Ml={},eh=0,E1=function(e){return e&&(e.host||E1(e.parentNode))},eM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=E1(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})},tM=function(e,t,n,i){var o=eM(t,Array.isArray(e)?e:[e]);Ml[n]||(Ml[n]=new WeakMap);var a=Ml[n],l=[],c=new Set,f=new Set(o),h=function(d){!d||c.has(d)||(c.add(d),h(d.parentNode))};o.forEach(h);var m=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(g){if(c.has(g))m(g);else try{var v=g.getAttribute(i),k=v!==null&&v!=="false",w=(Hi.get(g)||0)+1,b=(a.get(g)||0)+1;Hi.set(g,w),a.set(g,b),l.push(g),w===1&&k&&Al.set(g,!0),b===1&&g.setAttribute(n,"true"),k||g.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(t),c.clear(),eh++,function(){l.forEach(function(d){var g=Hi.get(d)-1,v=a.get(d)-1;Hi.set(d,g),a.set(d,v),g||(Al.has(d)||d.removeAttribute(i),Al.delete(d)),v||d.removeAttribute(n)}),eh--,eh||(Hi=new WeakMap,Hi=new WeakMap,Al=new WeakMap,Ml={})}},nM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=ZA(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),tM(i,o,n,"aria-hidden")):function(){return null}},Cu="Dialog",[N1]=u1(Cu),[rM,wn]=N1(Cu),_1=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=P.useRef(null),f=P.useRef(null),[h,m]=RI({prop:i,defaultProp:o??!1,onChange:a,caller:Cu});return _.jsx(rM,{scope:t,triggerRef:c,contentRef:f,contentId:Kd(),titleId:Kd(),descriptionId:Kd(),open:h,onOpenChange:m,onOpenToggle:P.useCallback(()=>m(d=>!d),[m]),modal:l,children:n})};_1.displayName=Cu;var C1="DialogTrigger",iM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(C1,n),a=Ut(t,o.triggerRef);return _.jsx(Lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":lp(o.open),...i,ref:a,onClick:St(e.onClick,o.onOpenToggle)})});iM.displayName=C1;var ip="DialogPortal",[sM,T1]=N1(ip,{forceMount:void 0}),O1=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:o}=e,a=wn(ip,t);return _.jsx(sM,{scope:t,forceMount:n,children:P.Children.map(i,l=>_.jsx(Ar,{present:n||a.open,children:_.jsx(m1,{asChild:!0,container:o,children:l})}))})};O1.displayName=ip;var au="DialogOverlay",sp=P.forwardRef((e,t)=>{const n=T1(au,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(au,e.__scopeDialog);return a.modal?_.jsx(Ar,{present:i||a.open,children:_.jsx(aM,{...o,ref:t})}):null});sp.displayName=au;var oM=c1("DialogOverlay.RemoveScroll"),aM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(au,n),a=tA(),l=Ut(t,a);return _.jsx(S1,{as:oM,allowPinchZoom:!0,shards:[o.contentRef],children:_.jsx(Lt.div,{"data-state":lp(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),hs="DialogContent",op=P.forwardRef((e,t)=>{const n=T1(hs,e.__scopeDialog),{forceMount:i=n.forceMount,...o}=e,a=wn(hs,e.__scopeDialog);return _.jsx(Ar,{present:i||a.open,children:a.modal?_.jsx(lM,{...o,ref:t}):_.jsx(uM,{...o,ref:t})})});op.displayName=hs;var lM=P.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=P.useRef(null),o=Ut(t,n.contentRef,i);return P.useEffect(()=>{const a=i.current;if(a)return nM(a)},[]),_.jsx(P1,{...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())})}),uM=P.forwardRef((e,t)=>{const n=wn(hs,e.__scopeDialog),i=P.useRef(!1),o=P.useRef(!1);return _.jsx(P1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(i.current||(c=n.triggerRef.current)==null||c.focus(),a.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),P1=P.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...l}=e,c=wn(hs,n);return gA(),_.jsx(_.Fragment,{children:_.jsx(h1,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:_.jsx(f1,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":lp(c.open),...l,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),I1="DialogTitle",ap=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(I1,n);return _.jsx(Lt.h2,{id:o.titleId,...i,ref:t})});ap.displayName=I1;var A1="DialogDescription",cM=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(A1,n);return _.jsx(Lt.p,{id:o.descriptionId,...i,ref:t})});cM.displayName=A1;var M1="DialogClose",L1=P.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,o=wn(M1,n);return _.jsx(Lt.button,{type:"button",...i,ref:t,onClick:St(e.onClick,()=>o.onOpenChange(!1))})});L1.displayName=M1;function lp(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 fM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),Lv=e=>{const t=dM(e);return t.charAt(0).toUpperCase()+t.slice(1)},R1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),hM=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 pM={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 mM=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:a,iconNode:l,...c},f)=>P.createElement("svg",{ref:f,...pM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:R1("lucide",o),...!a&&!hM(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,m])=>P.createElement(h,m)),...Array.isArray(a)?a:[a]]));/**
|
|
118
|
-
* @license lucide-react v0.513.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const gM=(e,t)=>{const n=P.forwardRef(({className:i,...o},a)=>P.createElement(mM,{ref:a,iconNode:t,className:R1(`lucide-${fM(Lv(e))}`,`lucide-${e}`,i),...o}));return n.displayName=Lv(e),n};/**
|
|
123
|
-
* @license lucide-react v0.513.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const yM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vM=gM("x",yM),wM=_1,xM=O1,D1=P.forwardRef(({className:e,...t},n)=>_.jsx(sp,{className:je("fixed inset-0 z-50 bg-black/20",e),...t,ref:n}));D1.displayName=sp.displayName;const j1=P.forwardRef(({side:e="right",className:t,children:n,...i},o)=>_.jsxs(xM,{children:[_.jsx(D1,{}),_.jsxs(op,{ref:o,className:je("fixed z-50 bg-bg shadow-lg transition flex flex-col",e==="right"&&"inset-y-0 right-0 w-80 border-l border-border",e==="left"&&"inset-y-0 left-0 w-80 border-r border-border",t),...i,children:[n,_.jsxs(L1,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[_.jsx(vM,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));j1.displayName=op.displayName;const $1=({className:e,...t})=>_.jsx("div",{className:je("flex flex-col space-y-2 p-4 border-b border-border",e),...t});$1.displayName="SheetHeader";const z1=P.forwardRef(({className:e,...t},n)=>_.jsx(ap,{ref:n,className:je("font-semibold",e),...t}));z1.displayName=ap.displayName;var bM=P.createContext(void 0);function kM(e){const t=P.useContext(bM);return e||t||"ltr"}function SM(e,[t,n]){return Math.min(n,Math.max(t,e))}function EM(e,t){return P.useReducer((n,i)=>t[n][i]??n,e)}var up="ScrollArea",[F1]=u1(up),[NM,rn]=F1(up),B1=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:o,scrollHideDelay:a=600,...l}=e,[c,f]=P.useState(null),[h,m]=P.useState(null),[d,g]=P.useState(null),[v,k]=P.useState(null),[w,b]=P.useState(null),[S,N]=P.useState(0),[E,C]=P.useState(0),[I,M]=P.useState(!1),[L,T]=P.useState(!1),A=Ut(t,R=>f(R)),z=kM(o);return _.jsx(NM,{scope:n,type:i,dir:z,scrollHideDelay:a,scrollArea:c,viewport:h,onViewportChange:m,content:d,onContentChange:g,scrollbarX:v,onScrollbarXChange:k,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:L,onScrollbarYEnabledChange:T,onCornerWidthChange:N,onCornerHeightChange:C,children:_.jsx(Lt.div,{dir:z,...l,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});B1.displayName=up;var V1="ScrollAreaViewport",W1=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:o,...a}=e,l=rn(V1,n),c=P.useRef(null),f=Ut(t,c,l.onViewportChange);return _.jsxs(_.Fragment,{children:[_.jsx(_M,{nonce:o}),_.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:_.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});W1.displayName=V1;var _M=P.memo(({nonce:e})=>_.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),Rn="ScrollAreaScrollbar",cp=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Rn,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=o,c=e.orientation==="horizontal";return P.useEffect(()=>(c?a(!0):l(!0),()=>{c?a(!1):l(!1)}),[c,a,l]),o.type==="hover"?_.jsx(CM,{...i,ref:t,forceMount:n}):o.type==="scroll"?_.jsx(TM,{...i,ref:t,forceMount:n}):o.type==="auto"?_.jsx(U1,{...i,ref:t,forceMount:n}):o.type==="always"?_.jsx(fp,{...i,ref:t,"data-state":"visible"}):null});cp.displayName=Rn;var CM=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Rn,e.__scopeScrollArea),[a,l]=P.useState(!1);return P.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const h=()=>{window.clearTimeout(f),l(!0)},m=()=>{f=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),_.jsx(Ar,{present:n||a,children:_.jsx(U1,{"data-state":a?"visible":"hidden",...i,ref:t})})}),TM=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=rn(Rn,e.__scopeScrollArea),a=e.orientation==="horizontal",l=Ou(()=>f("SCROLL_END"),100),[c,f]=EM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return P.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,o.scrollHideDelay,f]),P.useEffect(()=>{const h=o.viewport,m=a?"scrollLeft":"scrollTop";if(h){let d=h[m];const g=()=>{const v=h[m];d!==v&&(f("SCROLL"),l()),d=v};return h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[o.viewport,a,f,l]),_.jsx(Ar,{present:n||c!=="hidden",children:_.jsx(fp,{"data-state":c==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:St(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:St(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),U1=P.forwardRef((e,t)=>{const n=rn(Rn,e.__scopeScrollArea),{forceMount:i,...o}=e,[a,l]=P.useState(!1),c=e.orientation==="horizontal",f=Ou(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?h:m)}},10);return ps(n.viewport,f),ps(n.content,f),_.jsx(Ar,{present:i||a,children:_.jsx(fp,{"data-state":a?"visible":"hidden",...o,ref:t})})}),fp=P.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,o=rn(Rn,e.__scopeScrollArea),a=P.useRef(null),l=P.useRef(0),[c,f]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=G1(c.viewport,c.content),m={...i,sizes:c,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function d(g,v){return LM(g,l.current,c,v)}return n==="horizontal"?_.jsx(OM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollLeft,v=Rv(g,c,o.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=d(g,o.dir))}}):n==="vertical"?_.jsx(PM,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const g=o.viewport.scrollTop,v=Rv(g,c);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=d(g))}}):null}),OM=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Rn,e.__scopeScrollArea),[l,c]=P.useState(),f=P.useRef(null),h=Ut(t,f,a.onScrollbarXChange);return P.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),_.jsx(q1,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Tu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),Q1(g,d)&&m.preventDefault()}},onResize:()=>{f.current&&a.viewport&&l&&i({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:uu(l.paddingLeft),paddingEnd:uu(l.paddingRight)}})}})}),PM=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...o}=e,a=rn(Rn,e.__scopeScrollArea),[l,c]=P.useState(),f=P.useRef(null),h=Ut(t,f,a.onScrollbarYChange);return P.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),_.jsx(q1,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Tu(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),Q1(g,d)&&m.preventDefault()}},onResize:()=>{f.current&&a.viewport&&l&&i({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:uu(l.paddingTop),paddingEnd:uu(l.paddingBottom)}})}})}),[IM,H1]=F1(Rn),q1=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:o,onThumbChange:a,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:d,...g}=e,v=rn(Rn,n),[k,w]=P.useState(null),b=Ut(t,A=>w(A)),S=P.useRef(null),N=P.useRef(""),E=v.viewport,C=i.content-i.viewport,I=Zt(m),M=Zt(f),L=Ou(d,10);function T(A){if(S.current){const z=A.clientX-S.current.left,R=A.clientY-S.current.top;h({x:z,y:R})}}return P.useEffect(()=>{const A=z=>{const R=z.target;(k==null?void 0:k.contains(R))&&I(z,C)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[E,k,C,I]),P.useEffect(M,[i,M]),ps(k,L),ps(v.content,L),_.jsx(IM,{scope:n,scrollbar:k,hasThumb:o,onThumbChange:Zt(a),onThumbPointerUp:Zt(l),onThumbPositionChange:M,onThumbPointerDown:Zt(c),children:_.jsx(Lt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:St(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=k.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),T(A))}),onPointerMove:St(e.onPointerMove,T),onPointerUp:St(e.onPointerUp,A=>{const z=A.target;z.hasPointerCapture(A.pointerId)&&z.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})})})}),lu="ScrollAreaThumb",Y1=P.forwardRef((e,t)=>{const{forceMount:n,...i}=e,o=H1(lu,e.__scopeScrollArea);return _.jsx(Ar,{present:n||o.hasThumb,children:_.jsx(AM,{ref:t,...i})})}),AM=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...o}=e,a=rn(lu,n),l=H1(lu,n),{onThumbPositionChange:c}=l,f=Ut(t,d=>l.onThumbChange(d)),h=P.useRef(void 0),m=Ou(()=>{h.current&&(h.current(),h.current=void 0)},100);return P.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(m(),!h.current){const v=RM(d,c);h.current=v,c()}};return c(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,m,c]),_.jsx(Lt.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:St(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),k=d.clientX-v.left,w=d.clientY-v.top;l.onThumbPointerDown({x:k,y:w})}),onPointerUp:St(e.onPointerUp,l.onThumbPointerUp)})});Y1.displayName=lu;var dp="ScrollAreaCorner",K1=P.forwardRef((e,t)=>{const n=rn(dp,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?_.jsx(MM,{...e,ref:t}):null});K1.displayName=dp;var MM=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,o=rn(dp,n),[a,l]=P.useState(0),[c,f]=P.useState(0),h=!!(a&&c);return ps(o.scrollbarX,()=>{var d;const m=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),ps(o.scrollbarY,()=>{var d;const m=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(m),l(m)}),h?_.jsx(Lt.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 G1(e,t){const n=e/t;return isNaN(n)?0:n}function Tu(e){const t=G1(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function LM(e,t,n,i="ltr"){const o=Tu(n),a=o/2,l=t||a,c=o-l,f=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,d=i==="ltr"?[0,m]:[m*-1,0];return X1([f,h],d)(e)}function Rv(e,t,n="ltr"){const i=Tu(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,l=t.content-t.viewport,c=a-i,f=n==="ltr"?[0,l]:[l*-1,0],h=SM(e,f);return X1([0,l],[0,c])(h)}function X1(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 Q1(e,t){return e>0&&e<t}var RM=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function o(){const a={left:e.scrollLeft,top:e.scrollTop},l=n.left!==a.left,c=n.top!==a.top;(l||c)&&t(),n=a,i=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(i)};function Ou(e,t){const n=Zt(e),i=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(i.current),[]),P.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function ps(e,t){const n=Zt(t);ds(()=>{let i=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(i),o.unobserve(e)}}},[e,n])}var J1=B1,DM=W1,jM=K1;const Z1=P.forwardRef(({className:e,children:t,...n},i)=>_.jsxs(J1,{ref:i,className:je("relative overflow-hidden",e),...n,children:[_.jsx(DM,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(eb,{}),_.jsx(jM,{})]}));Z1.displayName=J1.displayName;const eb=P.forwardRef(({className:e,orientation:t="vertical",...n},i)=>_.jsx(cp,{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:_.jsx(Y1,{className:"relative flex-1 rounded-full bg-border"})}));eb.displayName=cp.displayName;const Dv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jv=$x,$M=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return jv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],d=a==null?void 0:a[h];if(m===null)return null;const g=Dv(m)||Dv(d);return o[h][g]}),c=n&&Object.entries(n).reduce((h,m)=>{let[d,g]=m;return g===void 0||(h[d]=g),h},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,m)=>{let{class:d,className:g,...v}=m;return Object.entries(v).every(k=>{let[w,b]=k;return Array.isArray(b)?b.includes({...a,...c}[w]):{...a,...c}[w]===b})?[...h,d,g]:h},[]);return jv(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},zM=$M("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 FM({className:e,variant:t,...n}){return _.jsx("div",{className:je(zM({variant:t}),e),...n})}function Ki(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 $v={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 BM({node:e,onClose:t,agentDefaults:n,agents:i,status:o,output:a,error:l,activity:c,usage:f}){const h=(e==null?void 0:e.type)==="agent.run",m=(e==null?void 0:e.config)??{},d=m.agent?i==null?void 0:i[m.agent]:void 0,g=m.model??(d==null?void 0:d.model)??(n==null?void 0:n.model)??"claude-opus-4-8",v=!m.model,k=m.model?void 0:d!=null&&d.model?`from agent ${m.agent}`:"project default",w=m.effort??(d==null?void 0:d.effort)??(n==null?void 0:n.effort)??"high",b=!m.effort,S=m.effort?void 0:d!=null&&d.effort?`from agent ${m.agent}`:n!=null&&n.effort?"project default":"model default";return _.jsx(wM,{open:!!e,onOpenChange:N=>!N&&t(),children:_.jsxs(j1,{side:"right",children:[_.jsx($1,{children:_.jsxs(z1,{className:"flex items-center gap-2",children:[h&&_.jsx(FM,{variant:"agent",children:"agent"}),_.jsx("span",{className:h?"text-agent":void 0,children:e==null?void 0:e.id})]})}),_.jsx(Z1,{className:"flex-1 p-4",children:e&&_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Type"}),_.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.type})]}),_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"ID"}),_.jsx("div",{className:"mt-1 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:e.id})]}),h&&_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent"}),m.agent&&_.jsxs("div",{"data-testid":"agent-ref",className:"mt-1 mb-2 font-mono text-[12px] px-2.5 py-1.5 bg-muted rounded-md",children:[m.agent,!d&&_.jsx("span",{className:"text-[10px] text-fail ml-2",children:"not found"})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[_.jsxs("div",{"data-testid":"agent-model",className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"model"}),_.jsx("div",{className:"font-mono text-[12px] truncate",children:g}),v&&k&&_.jsx("div",{className:"text-[10px] text-mutedfg",children:k})]}),_.jsxs("div",{"data-testid":"agent-effort",className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"effort"}),_.jsx("div",{className:"font-mono text-[12px]",children:w}),b&&S&&_.jsx("div",{className:"text-[10px] text-mutedfg",children:S})]})]}),(d==null?void 0:d.commands)&&d.commands.length>0&&_.jsxs("div",{className:"mt-2","data-testid":"agent-commands",children:[_.jsx("div",{className:"text-mutedfg text-[11px]",children:"commands (allowlist)"}),_.jsx("div",{className:"mt-1 space-y-1",children:d.commands.map(N=>_.jsxs("div",{className:"px-2.5 py-1 border border-border rounded-md",children:[_.jsx("span",{className:"font-mono text-[12px]",children:N.name}),N.name===d.fallback&&_.jsx("span",{className:"text-[10px] text-mutedfg ml-2",children:"fallback"}),N.description&&_.jsx("div",{className:"text-[11px] text-mutedfg",children:N.description})]},N.name))})]})]}),f&&f.totalTokens>0&&_.jsxs("div",{"data-testid":"node-usage",children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Token usage"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-x-4 gap-y-1 text-[12px]",children:[_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"total"}),_.jsx("span",{className:"font-mono font-medium",children:Ki(f.totalTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cost"}),_.jsx("span",{className:"font-mono font-medium",children:_h(f.costUsd)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"input"}),_.jsx("span",{className:"font-mono",children:Ki(f.inputTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"output"}),_.jsx("span",{className:"font-mono",children:Ki(f.outputTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cache read"}),_.jsx("span",{className:"font-mono",children:Ki(f.cacheReadTokens)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{className:"text-mutedfg",children:"cache write"}),_.jsx("span",{className:"font-mono",children:Ki(f.cacheCreationTokens)})]})]})]}),c&&c.length>0&&_.jsxs("div",{"data-testid":"node-activity-log",children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Agent activity"}),_.jsx("div",{className:"mt-1 space-y-1.5",children:c.map((N,E)=>{if(N.kind==="tool_use"){const I=N.input!==void 0?JSON.stringify(N.input):"";return _.jsxs("div",{className:"text-[11px] font-mono bg-agent/10 border border-border rounded-md px-2.5 py-1.5 break-all",children:[_.jsxs("span",{className:"text-agent",children:["🔧 ",N.tool]}),I&&_.jsxs("span",{className:"text-mutedfg",children:[" ",I.length>200?I.slice(0,200)+"…":I]})]},E)}if(N.kind==="tool_result")return _.jsxs("div",{className:"text-[11px] font-mono text-mutedfg px-2.5 break-all",children:["↳ ",N.text]},E);const C=N.kind==="thinking";return _.jsx("div",{className:`text-[12px] px-2.5 py-1 whitespace-pre-wrap break-words ${C?"text-mutedfg italic":"text-fg"}`,children:N.text},E)})})]}),(o||a!==void 0||l)&&_.jsxs("div",{"data-testid":"node-last-run",children:[_.jsxs("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg flex items-center gap-2",children:["Last run",o&&_.jsx("span",{className:`text-[11px] font-medium ${$v[o].cls}`,children:$v[o].label})]}),l&&_.jsx("pre",{"data-testid":"node-output-error",className:"mt-1 text-[11px] font-mono text-fail bg-fail/5 rounded-md p-2.5 whitespace-pre-wrap break-words",children:l}),a!==void 0?_.jsx("pre",{"data-testid":"node-output",className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all max-h-80 overflow-y-auto",children:a}):!l&&_.jsx("div",{className:"mt-1 text-[11px] text-mutedfg px-1",children:"No output captured yet — run the workflow to see what this node fetches."})]}),_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Config"}),_.jsx("pre",{className:"mt-1 text-[11px] font-mono bg-muted rounded-md p-2.5 overflow-x-auto leading-relaxed whitespace-pre-wrap break-all",children:JSON.stringify(e.config,null,2)})]}),e.retry&&_.jsxs("div",{children:[_.jsx("label",{className:"text-[11px] uppercase tracking-wider text-mutedfg",children:"Retry"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[_.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("span",{className:"text-mutedfg text-[11px]",children:"attempts"})," ",_.jsx("span",{className:"font-mono",children:e.retry.maxAttempts})]}),_.jsxs("div",{className:"px-2.5 py-1.5 border border-border rounded-md",children:[_.jsx("span",{className:"text-mutedfg text-[11px]",children:"backoff"})," ",_.jsxs("span",{className:"font-mono",children:[e.retry.backoffMs,"ms"]})]})]})]})]})})]})})}function th(e,t=200){const n=e.replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}function VM(e){return e==="running"?"bg-run pulse-dot":e==="failed"?"bg-fail":"bg-ok"}function WM({workflowName:e,workflowTitle:t,runs:n,events:i,onClose:o}){const a=e?n.filter(c=>c.workflow===e):n,l=i.filter(c=>(c.type==="node:finish"||c.type==="node:activity")&&c.nodeId).slice(-80).reverse().map(c=>{if(c.type==="node:activity"){const m=c.meta,d=(m==null?void 0:m.kind)==="tool_use"?`🔧 ${m.tool}`:(m==null?void 0:m.kind)==="tool_result"?`↳ ${th(m.text??"")}`:th((m==null?void 0:m.text)??"");return{ts:c.ts,nodeId:c.nodeId,status:"success",preview:d}}const f=c.meta,h=f!=null&&f.error?`error: ${f.error}`:(f==null?void 0:f.output)!==void 0?th(f.output):"";return{ts:c.ts,nodeId:c.nodeId,status:c.status??"success",preview:h}});return _.jsxs("aside",{className:"w-96 shrink-0 bg-bg border-l border-border flex flex-col",children:[_.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[_.jsxs("span",{className:"font-semibold tracking-tight truncate",title:t??e,children:["Runs · ",t??e??"all"]}),_.jsx("button",{onClick:o,className:"ml-auto text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[_.jsxs("div",{children:[_.jsx("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:"Runs"}),a.length===0&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"no runs yet for this workflow"}),_.jsx("div",{className:"space-y-1",children:a.slice(0,30).map(c=>_.jsxs("div",{"data-testid":"scoped-run-row",className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[_.jsx("span",{className:je("size-1.5 rounded-full flex-shrink-0",VM(c.status))}),c.label&&_.jsx("span",{className:"font-mono text-[11px] px-1 rounded bg-muted text-fg",children:c.label}),c.usage&&c.usage.totalTokens>0&&_.jsxs("span",{"data-testid":"run-usage",title:`${c.usage.totalTokens.toLocaleString()} tokens · ${_h(c.usage.costUsd)} (in ${c.usage.inputTokens.toLocaleString()} / out ${c.usage.outputTokens.toLocaleString()} / cache ${(c.usage.cacheReadTokens+c.usage.cacheCreationTokens).toLocaleString()})`,className:"font-mono text-[10px] text-agent ml-auto",children:[Ki(c.usage.totalTokens)," tok · ",_h(c.usage.costUsd)]}),_.jsx("span",{className:je("font-mono text-[10px] text-mutedfg",c.usage&&c.usage.totalTokens>0?"":"ml-auto"),children:c.status})]},c.id))})]}),_.jsxs("div",{children:[_.jsx("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:"Node activity"}),l.length===0&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"nothing yet"}),_.jsx("div",{className:"space-y-1",children:l.map((c,f)=>_.jsxs("div",{"data-testid":"side-activity-row",className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-start gap-2",children:[_.jsx("span",{className:je("mt-1 size-1.5 rounded-full flex-shrink-0",c.status==="failed"?"bg-fail":"bg-ok")}),_.jsx("span",{className:"font-mono text-[11px] text-fg shrink-0 w-24 truncate",children:c.nodeId}),_.jsx("span",{className:"font-mono text-[10px] text-mutedfg break-all",children:c.preview})]},f))})]})]})]})}function UM(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 HM({cache:e,onReload:t,onForget:n,onClose:i}){return _.jsxs("aside",{className:"w-96 shrink-0 bg-bg border-l border-border flex flex-col",children:[_.jsxs("div",{className:"h-12 shrink-0 flex items-center gap-2 px-4 border-b border-border",children:[_.jsx("span",{className:"font-semibold tracking-tight",children:"Cache"}),_.jsxs("span",{className:"text-[11px] text-mutedfg",children:[e.seen.length," seen"]}),_.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[_.jsx("button",{onClick:t,className:"text-[11px] text-mutedfg hover:text-fg",title:"Refresh",children:"↻"}),_.jsx("button",{onClick:i,className:"text-mutedfg hover:text-fg text-lg leading-none","aria-label":"Close",children:"×"})]})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[_.jsx("p",{className:"text-[11px] text-mutedfg leading-snug",children:"Items the engine has already actioned (per-workflow seen-state). Clearing one makes the workflow reprocess it on the next run."}),_.jsxs("div",{children:[_.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Seen (",e.seen.length,")"]}),e.seen.length===0&&_.jsx("div",{className:"text-[12px] text-mutedfg px-1",children:"empty"}),_.jsx("div",{className:"space-y-1",children:e.seen.map(o=>{const a=o.key.indexOf(" "),l=a>0?o.key.slice(0,a):"",c=a>0?o.key.slice(a+1):o.key;return _.jsxs("div",{"data-testid":"cache-seen-row",className:"group bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[l&&_.jsx("span",{className:"text-[9px] uppercase tracking-wide text-mutedfg bg-muted rounded px-1 py-0.5",children:l}),o.label&&_.jsx("span",{className:"font-mono text-[11px] text-fg",children:o.label}),_.jsx("span",{className:"font-mono text-[11px] text-mutedfg break-all",children:c})]}),o.ts&&_.jsxs("div",{className:"text-[10px] text-mutedfg",children:["seen ",UM(o.ts)]})]}),_.jsx("button",{"data-testid":"cache-forget",onClick:()=>n(o.key),title:`Forget "${o.key}" (reprocess it)`,className:"text-[11px] text-mutedfg hover:text-fail px-1 opacity-0 group-hover:opacity-100",children:"clear"})]},o.key)})})]}),e.cursors.length>0&&_.jsxs("div",{children:[_.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-mutedfg pb-1.5",children:["Cursors (",e.cursors.length,")"]}),_.jsx("div",{className:"space-y-1",children:e.cursors.map(o=>_.jsxs("div",{className:"bg-muted/40 border border-border rounded-md px-2.5 py-1.5 flex items-center gap-2",children:[_.jsxs("span",{className:"font-mono text-[11px] text-fg break-all flex-1",children:[o.key," = ",o.value]}),_.jsx("button",{onClick:()=>n(o.key),className:"text-[11px] text-mutedfg hover:text-fail px-1",children:"clear"})]},o.key))})]})]})]})}const hp=Symbol.for("yaml.alias"),Ch=Symbol.for("yaml.document"),Pr=Symbol.for("yaml.map"),tb=Symbol.for("yaml.pair"),Mn=Symbol.for("yaml.scalar"),vs=Symbol.for("yaml.seq"),nn=Symbol.for("yaml.node.type"),ws=e=>!!e&&typeof e=="object"&&e[nn]===hp,Pu=e=>!!e&&typeof e=="object"&&e[nn]===Ch,qo=e=>!!e&&typeof e=="object"&&e[nn]===Pr,et=e=>!!e&&typeof e=="object"&&e[nn]===tb,ze=e=>!!e&&typeof e=="object"&&e[nn]===Mn,Yo=e=>!!e&&typeof e=="object"&&e[nn]===vs;function Je(e){if(e&&typeof e=="object")switch(e[nn]){case Pr:case vs:return!0}return!1}function Ze(e){if(e&&typeof e=="object")switch(e[nn]){case hp:case Pr:case Mn:case vs:return!0}return!1}const nb=e=>(ze(e)||Je(e))&&!!e.anchor,ei=Symbol("break visit"),qM=Symbol("skip children"),Co=Symbol("remove node");function xs(e,t){const n=YM(t);Pu(e)?Qi(null,e.contents,n,Object.freeze([e]))===Co&&(e.contents=null):Qi(null,e,n,Object.freeze([]))}xs.BREAK=ei;xs.SKIP=qM;xs.REMOVE=Co;function Qi(e,t,n,i){const o=KM(e,t,n,i);if(Ze(o)||et(o))return GM(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===ei)return ei;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===ei)return ei;a===Co&&(t.key=null);const l=Qi("value",t.value,n,i);if(l===ei)return ei;l===Co&&(t.value=null)}}return o}function YM(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 KM(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 GM(e,t,n){const i=t[t.length-1];if(Je(i))i.items[e]=n;else if(et(i))e==="key"?i.key=n:i.value=n;else if(Pu(i))i.contents=n;else{const o=ws(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const XM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},QM=e=>e.replace(/[!,[\]{}]/g,t=>XM[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+QM(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 rb(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 ib(e){const t=new Set;return xs(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function sb(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function JM(e,t){const n=[],i=new Map;let o=null;return{onAnchor:a=>{n.push(a),o??(o=ib(e));const l=sb(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||!nb(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 pp{constructor(t){Object.defineProperty(this,nn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:a}={}){if(!Pu(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=tn(this,"",l);if(typeof o=="function")for(const{count:f,res:h}of l.anchors.values())o(h,f);return typeof a=="function"?Ji(a,{"":c},"",c):c}}class mp extends pp{constructor(t){super(hp),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)||nb(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(rb(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 ob=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends pp{constructor(t){super(Mn),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tn(this.value,t,n)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const ZM="tag:yaml.org,2002:";function eL(e,t,n){if(t){const i=n.filter(a=>a.tag===t),o=i.find(a=>!a.format)??i[0];if(!o)throw new Error(`Tag ${t} not found`);return o}return n.find(i=>{var o;return((o=i.identify)==null?void 0:o.call(i,e))&&!i.format})}function $o(e,t,n){var d,g,v;if(Pu(e)&&(e=e.contents),Ze(e))return e;if(et(e)){const k=(g=(d=n.schema[Pr]).createNode)==null?void 0:g.call(d,n.schema,null,n);return k.items.push(e),k}(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 mp(f.anchor);f={anchor:null,node:null},c.set(e,f)}t!=null&&t.startsWith("!!")&&(t=ZM+t.slice(2));let h=eL(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const k=new Te(e);return f&&(f.node=k),k}h=e instanceof Map?l[Pr]:Symbol.iterator in Object(e)?l[vs]:l[Pr]}a&&(a(h),delete n.onTagObj);const m=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((v=h==null?void 0:h.nodeClass)==null?void 0:v.from)=="function"?h.nodeClass.from(n.schema,e,n):new Te(e);return t?m.tag=t:h.default||(m.tag=h.tag),f&&(f.node=m),m}function cu(e,t,n){let i=n;for(let o=t.length-1;o>=0;--o){const a=t[o];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const l=[];l[a]=i,i=l}else i=new Map([[a,i]])}return $o(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const So=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class ab extends pp{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 tL=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ni=(e,t,n)=>e.endsWith(`
|
|
129
|
-
`)?Xn(n,t):n.includes(`
|
|
130
|
-
`)?`
|
|
131
|
-
`+Xn(n,t):(e.endsWith(" ")?"":" ")+n,lb="flow",Th="block",Yl="quoted";function Iu(e,t,n="flow",{indentAtStart:i,lineWidth:o=80,minContentWidth:a=20,onFold:l,onOverflow:c}={}){if(!o||o<0)return e;o<a&&(a=0);const f=Math.max(1+a,1+o-t.length);if(e.length<=f)return e;const h=[],m={};let d=o-t.length;typeof i=="number"&&(i>o-Math.max(2,a)?h.push(0):d=o-i);let g,v,k=!1,w=-1,b=-1,S=-1;n===Th&&(w=zv(e,w,t.length),w!==-1&&(d=w+f));for(let E;E=e[w+=1];){if(n===Yl&&E==="\\"){switch(b=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}S=w}if(E===`
|
|
132
|
-
`)n===Th&&(w=zv(e,w,t.length)),d=w+t.length+f,g=void 0;else{if(E===" "&&v&&v!==" "&&v!==`
|
|
133
|
-
`&&v!==" "){const C=e[w+1];C&&C!==" "&&C!==`
|
|
134
|
-
`&&C!==" "&&(g=w)}if(w>=d)if(g)h.push(g),d=g+f,g=void 0;else if(n===Yl){for(;v===" "||v===" ";)v=E,E=e[w+=1],k=!0;const C=w>S+1?w-2:b-1;if(m[C])return e;h.push(C),m[C]=!0,d=C+f,g=void 0}else k=!0}v=E}if(k&&c&&c(),h.length===0)return e;l&&l();let N=e.slice(0,h[0]);for(let E=0;E<h.length;++E){const C=h[E],I=h[E+1]||e.length;C===0?N=`
|
|
135
|
-
${t}${e.slice(0,I)}`:(n===Yl&&m[C]&&(N+=`${e[C]}\\`),N+=`
|
|
136
|
-
${t}${e.slice(C+1,I)}`)}return N}function zv(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 nL(e,t,n){if(!t||t<0)return!1;const i=t-n,o=e.length;if(o<=i)return!1;for(let a=0,l=0;a<o;++a)if(e[a]===`
|
|
138
|
-
`){if(a-l>i)return!0;if(l=a+1,o-l<=i)return!1}return!0}function To(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,o=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Mu(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const m=n.substr(f+2,4);switch(m){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:m.substr(0,2)==="00"?l+="\\x"+m.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(i||n[f+2]==='"'||n.length<o)f+=1;else{for(l+=n.slice(c,f)+`
|
|
139
|
-
|
|
140
|
-
`;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
|
|
141
|
-
`,f+=2;l+=a,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,i?l:Iu(l,a,Yl,Au(t,!1))}function Oh(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
142
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return To(e,t);const n=t.indent||(Mu(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
143
|
-
${n}`)+"'";return t.implicitKey?i:Iu(i,n,lb,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=Oh:a&&!o?i=To:i=n?Oh:To}return i(e,t)}let Ph;try{Ph=new RegExp(`(^|(?<!
|
|
144
|
-
))
|
|
145
|
-
+(?!
|
|
146
|
-
|$)`,"g")}catch{Ph=/\n+(?!\n|$)/g}function Kl({comment:e,type:t,value:n},i,o,a){const{blockQuote:l,commentString:c,lineWidth:f}=i.options;if(!l||/\n[\t ]+$/.test(n))return Zi(n,i);const h=i.indent||(i.forceBlockIndent||Mu(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!nL(n,f,h.length);if(!n)return m?`|
|
|
147
|
-
`:`>
|
|
148
|
-
`;let d,g;for(g=n.length;g>0;--g){const I=n[g-1];if(I!==`
|
|
149
|
-
`&&I!==" "&&I!==" ")break}let v=n.substring(g);const k=v.indexOf(`
|
|
150
|
-
`);k===-1?d="-":n===v||k!==v.length-1?(d="+",a&&a()):d="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
151
|
-
`&&(v=v.slice(0,-1)),v=v.replace(Ph,`$&${h}`));let w=!1,b,S=-1;for(b=0;b<n.length;++b){const I=n[b];if(I===" ")w=!0;else if(I===`
|
|
152
|
-
`)S=b;else break}let N=n.substring(0,S<b?S+1:b);N&&(n=n.substring(N.length),N=N.replace(/\n+/g,`$&${h}`));let C=(w?h?"2":"1":"")+d;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!m){const I=n.replace(/\n+/g,`
|
|
153
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let M=!1;const L=Au(i,!0);l!=="folded"&&t!==Te.BLOCK_FOLDED&&(L.onOverflow=()=>{M=!0});const T=Iu(`${N}${I}${v}`,h,Th,L);if(!M)return`>${C}
|
|
154
|
-
${h}${T}`}return n=n.replace(/\n+/g,`$&${h}`),`|${C}
|
|
155
|
-
${h}${N}${n}${v}`}function rL(e,t,n,i){const{type:o,value:a}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:m}=t;if(c&&a.includes(`
|
|
156
|
-
`)||m&&/[[\]{},]/.test(a))return Zi(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||m||!a.includes(`
|
|
157
|
-
`)?Zi(a,t):Kl(e,t,n,i);if(!c&&!m&&o!==Te.PLAIN&&a.includes(`
|
|
158
|
-
`))return Kl(e,t,n,i);if(Mu(a)){if(f==="")return t.forceBlockIndent=!0,Kl(e,t,n,i);if(c&&f===h)return Zi(a,t)}const d=a.replace(/\n+/g,`$&
|
|
159
|
-
${f}`);if(l){const g=w=>{var b;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((b=w.test)==null?void 0:b.test(d))},{compat:v,tags:k}=t.doc.schema;if(k.some(g)||v!=null&&v.some(g))return Zi(a,t)}return c?d:Iu(d,f,lb,Au(t,!1))}function gp(e,t,n,i){const{implicitKey:o,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Te.QUOTE_DOUBLE);const f=m=>{switch(m){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return o||a?Zi(l.value,t):Kl(l,t,n,i);case Te.QUOTE_DOUBLE:return To(l.value,t);case Te.QUOTE_SINGLE:return Oh(l.value,t);case Te.PLAIN:return rL(l,t,n,i);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:m,defaultStringType:d}=t.options,g=o&&m||d;if(h=f(g),h===null)throw new Error(`Unsupported default string type ${g}`)}return h}function ub(e,t){const n=Object.assign({blockQuote:!0,commentString:tL,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 iL(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 sL(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const o=[],a=(ze(e)||Je(e))&&e.anchor;a&&rb(a)&&(n.add(a),o.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&o.push(i.directives.tagString(l)),o.join(" ")}function ms(e,t,n,i){var f;if(et(e))return e.toString(t,n,i);if(ws(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o;const a=Ze(e)?e:t.doc.createNode(e,{onTagObj:h=>o=h});o??(o=iL(t.doc.schema.tags,a));const l=sL(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)?gp(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 oL({key:e,value:t},n,i,o){const{allNullValues:a,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:m,simpleKeys:d}}=n;let g=Ze(e)&&e.comment||null;if(d){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Je(e)||!Ze(e)&&typeof e=="object"){const L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let v=!d&&(!e||g&&t==null&&!n.inFlow||Je(e)||(ze(e)?e.type===Te.BLOCK_FOLDED||e.type===Te.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(d||!a),indent:c+f});let k=!1,w=!1,b=ms(e,n,()=>k=!0,()=>w=!0);if(!v&&!n.inFlow&&b.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return k&&i&&i(),b===""?"?":v?`? ${b}`:b}else if(a&&!d||t==null&&v)return b=`? ${b}`,g&&!k?b+=ni(b,n.indent,h(g)):w&&o&&o(),b;k&&(g=null),v?(g&&(b+=ni(b,n.indent,h(g))),b=`? ${b}
|
|
161
|
-
${c}:`):(b=`${b}:`,g&&(b+=ni(b,n.indent,h(g))));let S,N,E;Ze(t)?(S=!!t.spaceBefore,N=t.commentBefore,E=t.comment):(S=!1,N=null,E=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&ze(t)&&(n.indentAtStart=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 I=ms(t,n,()=>C=!0,()=>w=!0);let M=" ";if(g||S||N){if(M=S?`
|
|
162
|
-
`:"",N){const L=h(N);M+=`
|
|
163
|
-
${Xn(L,n.indent)}`}I===""&&!n.inFlow?M===`
|
|
164
|
-
`&&E&&(M=`
|
|
165
|
-
|
|
166
|
-
`):M+=`
|
|
167
|
-
${n.indent}`}else if(!v&&Je(t)){const L=I[0],T=I.indexOf(`
|
|
168
|
-
`),A=T!==-1,z=n.inFlow??t.flow??t.items.length===0;if(A||!z){let R=!1;if(A&&(L==="&"||L==="!")){let $=I.indexOf(" ");L==="&"&&$!==-1&&$<T&&I[$+1]==="!"&&($=I.indexOf(" ",$+1)),($===-1||T<$)&&(R=!0)}R||(M=`
|
|
169
|
-
${n.indent}`)}}else(I===""||I[0]===`
|
|
170
|
-
`)&&(M="");return b+=M+I,n.inFlow?C&&i&&i():E&&!C?b+=ni(b,n.indent,h(E)):w&&o&&o(),b}function cb(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ll="<<",Jn={identify:e=>e===Ll||typeof e=="symbol"&&e.description===Ll,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(Ll)),{addToJSMap:fb}),stringify:()=>Ll},aL=(e,t)=>(Jn.identify(t)||ze(t)&&(!t.type||t.type===Te.PLAIN)&&Jn.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Jn.tag&&n.default));function fb(e,t,n){const i=db(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=db(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 db(e,t){return e&&ws(t)?t.resolve(e.doc,e):t}function hb(e,t,{key:n,value:i}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(aL(e,n))fb(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=lL(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 lL(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const i=ub(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)+'..."'),cb(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 yp(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:tb}),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 hb(n,i,this)}toString(t,n,i){return t!=null&&t.doc?oL(this,t,n,i):JSON.stringify(this)}}function pb(e,t,n){return(t.inFlow??e.flow?cL:uL)(e,t,n)}function uL({comment:e,items:t},n,{blockItemPrefix:i,flowChars:o,itemIndent:a,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,m=Object.assign({},n,{indent:a,type:null});let d=!1;const g=[];for(let k=0;k<t.length;++k){const w=t[k];let b=null;if(Ze(w))!d&&w.spaceBefore&&g.push(""),fu(n,g,w.commentBefore,d),w.comment&&(b=w.comment);else if(et(w)){const N=Ze(w.key)?w.key:null;N&&(!d&&N.spaceBefore&&g.push(""),fu(n,g,N.commentBefore,d))}d=!1;let S=ms(w,m,()=>b=null,()=>d=!0);b&&(S+=ni(S,a,h(b))),d&&b&&(d=!1),g.push(i+S)}let v;if(g.length===0)v=o.start+o.end;else{v=g[0];for(let k=1;k<g.length;++k){const w=g[k];v+=w?`
|
|
171
|
-
${f}${w}`:`
|
|
172
|
-
`}}return e?(v+=`
|
|
173
|
-
`+Xn(h(e),f),c&&c()):d&&l&&l(),v}function cL({items:e},t,{flowChars:n,itemIndent:i}){const{indent:o,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=t;i+=a;const f=Object.assign({},t,{indent:i,inFlow:!0,type:null});let h=!1,m=0;const d=[];for(let k=0;k<e.length;++k){const w=e[k];let b=null;if(Ze(w))w.spaceBefore&&d.push(""),fu(t,d,w.commentBefore,!1),w.comment&&(b=w.comment);else if(et(w)){const N=Ze(w.key)?w.key:null;N&&(N.spaceBefore&&d.push(""),fu(t,d,N.commentBefore,!1),N.comment&&(h=!0));const E=Ze(w.value)?w.value:null;E?(E.comment&&(b=E.comment),E.commentBefore&&(h=!0)):w.value==null&&(N!=null&&N.comment)&&(b=N.comment)}b&&(h=!0);let S=ms(w,f,()=>b=null);h||(h=d.length>m||S.includes(`
|
|
174
|
-
`)),k<e.length-1?S+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=d.reduce((N,E)=>N+E.length+2,2)+(S.length+2)>t.options.lineWidth)),h&&(S+=",")),b&&(S+=ni(S,i,c(b))),d.push(S),m=d.length}const{start:g,end:v}=n;if(d.length===0)return g+v;if(!h){const k=d.reduce((w,b)=>w+b.length+2,2);h=t.options.lineWidth>0&&k>t.options.lineWidth}if(h){let k=g;for(const w of d)k+=w?`
|
|
175
|
-
${a}${o}${w}`:`
|
|
176
|
-
`;return`${k}
|
|
177
|
-
${o}${v}`}else return`${g}${l}${d.join(" ")}${l}${v}`}function fu({indent:e,options:{commentString:t}},n,i,o){if(i&&o&&(i=i.replace(/^\n+/,"")),i){const a=Xn(t(i),e);n.push(a.trimStart())}}function ri(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 ab{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Pr,t),this.items=[]}static from(t,n,i){const{keepUndefined:o,replacer:a}=i,l=new this(t),c=(f,h)=>{if(typeof a=="function")h=a.call(n,f,h);else if(Array.isArray(a)&&!a.includes(f))return;(h!==void 0||o)&&l.items.push(yp(f,h,i))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){var l;let i;et(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Et(t,t==null?void 0:t.value):i=new Et(t.key,t.value);const o=ri(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)&&ob(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=ri(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=ri(this.items,t),o=i==null?void 0:i.value;return(!n&&ze(o)?o.value:o)??void 0}has(t){return!!ri(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)hb(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})),pb(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 fi extends ab{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=Rl(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Rl(t);if(typeof i!="number")return;const o=this.items[i];return!n&&ze(o)?o.value:o}has(t){const n=Rl(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Rl(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const o=this.items[i];ze(o)&&ob(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?pb(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 Rl(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:fi,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Yo(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>fi.from(e,t,n)},Lu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),gp(e,t,n,i)}},Ru={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"&&Ru.test.test(e)?e:t.options.nullStr},vp={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&&vp.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 mb={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},gb={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)}},yb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Te(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xn},Du=e=>typeof e=="bigint"||Number.isInteger(e),wp=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function vb(e,t,n){const{value:i}=e;return Du(i)&&i>=0?n+i.toString(t):xn(e)}const wb={identify:e=>Du(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>wp(e,2,8,n),stringify:e=>vb(e,8,"0o")},xb={identify:Du,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>wp(e,0,10,n),stringify:xn},bb={identify:e=>Du(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>wp(e,2,16,n),stringify:e=>vb(e,16,"0x")},fL=[bs,ks,Lu,Ru,vp,wb,xb,bb,mb,gb,yb];function Fv(e){return typeof e=="bigint"||Number.isInteger(e)}const Dl=({value:e})=>JSON.stringify(e),dL=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Dl},{identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Dl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Dl},{identify:Fv,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})=>Fv(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:Dl}],hL={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},pL=[bs,ks].concat(dL,hL),xp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let o=0;o<n.length;++o)i[o]=n.charCodeAt(o);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,o,a){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Te.BLOCK_LITERAL),t!==Te.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(c.length/f),m=new Array(h);for(let d=0,g=0;d<h;++d,g+=f)m[d]=c.substr(g,f);c=m.join(t===Te.BLOCK_LITERAL?`
|
|
178
|
-
`:" ")}return gp({comment:e,type:t,value:c},i,o,a)}};function kb(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 Sb(e,t,n){const{replacer:i}=n,o=new fi(e);o.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof i=="function"&&(l=i.call(t,String(a++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;o.items.push(yp(c,f,n))}return o}const bp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:kb,createNode:Sb};class rs extends fi{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=Sb(t,n,i),a=new this;return a.items=o.items,a}}rs.tag="tag:yaml.org,2002:omap";const kp={collection:"seq",identify:e=>e instanceof Map,nodeClass:rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=kb(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 Eb({value:e,source:t},n){return t&&(e?Nb:_b).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Nb={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:Eb},_b={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:Eb},mL={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},gL={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)}},yL={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 ju(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 Sp(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 vL={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ju(e,2,2,n),stringify:e=>Sp(e,2,"0b")},wL={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ju(e,1,8,n),stringify:e=>Sp(e,8,"0")},xL={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ju(e,0,10,n),stringify:xn},bL={identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ju(e,2,16,n),stringify:e=>Sp(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),ri(this.items,n.key)||this.items.push(n)}get(t,n){const i=ri(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=ri(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(yp(l,null,i));return a}}is.tag="tag:yaml.org,2002:set";const Ep={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 Np(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 Cb(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 Tb={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})=>Np(e,n),stringify:Cb},Ob={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=>Np(e,!1),stringify:Cb},$u={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match($u.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,o,a,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,i-1,o,a||0,l||0,c||0,f);const m=t[8];if(m&&m!=="Z"){let d=Np(m,!1);Math.abs(d)<30&&(d*=60),h-=6e4*d}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Bv=[bs,ks,Lu,Ru,Nb,_b,vL,wL,xL,bL,mL,gL,yL,xp,Jn,kp,bp,Ep,Tb,Ob,$u],Vv=new Map([["core",fL],["failsafe",[bs,ks,Lu]],["json",pL],["yaml11",Bv],["yaml-1.1",Bv]]),Wv={binary:xp,bool:vp,float:yb,floatExp:gb,floatNaN:mb,floatTime:Ob,int:xb,intHex:bb,intOct:wb,intTime:Tb,map:bs,merge:Jn,null:Ru,omap:kp,pairs:bp,seq:ks,set:Ep,timestamp:$u},kL={"tag:yaml.org,2002:binary":xp,"tag:yaml.org,2002:merge":Jn,"tag:yaml.org,2002:omap":kp,"tag:yaml.org,2002:pairs":bp,"tag:yaml.org,2002:set":Ep,"tag:yaml.org,2002:timestamp":$u};function rh(e,t,n){const i=Vv.get(t);if(i&&!e)return n&&!i.includes(Jn)?i.concat(Jn):i.slice();let o=i;if(!o)if(Array.isArray(e))o=[];else{const a=Array.from(Vv.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)o=o.concat(a);else typeof e=="function"&&(o=e(o.slice()));return n&&(o=o.concat(Jn)),o.reduce((a,l)=>{const c=typeof l=="string"?Wv[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(Wv).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return a.includes(c)||a.push(c),a},[])}const SL=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class _p{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?kL:{},this.tags=rh(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,Pr,{value:bs}),Object.defineProperty(this,Mn,{value:Lu}),Object.defineProperty(this,vs,{value:ks}),this.sortMapEntries=typeof l=="function"?l:l===!0?SL:null}clone(){const t=Object.create(_p.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function EL(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const o=ub(e,t),{commentString:a}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=a(e.commentBefore);n.unshift(Xn(h,""))}let l=!1,c=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Xn(d,""))}o.forceBlockIndent=!!e.comment,c=e.contents.comment}const h=c?void 0:()=>l=!0;let m=ms(e.contents,o,()=>c=null,h);c&&(m+=ni(m,"",a(c))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(ms(e.contents,o));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const h=a(e.comment);h.includes(`
|
|
181
|
-
`)?(n.push("..."),n.push(Xn(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&l&&(h=h.replace(/^\n+/,"")),h&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Xn(a(h),"")))}return n.join(`
|
|
182
|
-
`)+`
|
|
183
|
-
`}class zu{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,nn,{value:Ch});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:Ch}});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){qi(this.contents)&&this.contents.add(t)}addIn(t,n){qi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=ib(this);t.anchor=!n||i.has(n)?sb(n||"a",i):n}return new mp(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=N=>typeof N=="number"||N instanceof String||N instanceof Number,S=n.filter(b).map(String);S.length>0&&(n=n.concat(S)),o=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:m}=i??{},{onAnchor:d,setAnchors:g,sourceObjects:v}=JM(this,l||"a"),k={aliasDuplicateObjects:a??!0,keepUndefined:f??!1,onAnchor:d,onTagObj:h,replacer:o,schema:this.schema,sourceObjects:v},w=$o(t,m,k);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 qi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return So(t)?this.contents==null?!1:(this.contents=null,!0):qi(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):qi(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):qi(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 _p(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:o,onAnchor:a,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},f=tn(this.contents,n??"",c);if(typeof a=="function")for(const{count:h,res:m}of c.anchors.values())a(m,h);return typeof l=="function"?Ji(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return EL(this,t)}}function qi(e){if(Je(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Pb extends Error{constructor(t,n,i,o){super(),this.name=t,this.code=i,this.message=o,this.pos=n}}class Eo extends Pb{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class NL extends Pb{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Uv=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:i,col:o}=n.linePos[0];n.message+=` at line ${i}, column ${o}`;let a=o-1,l=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const c=Math.min(a-39,l.length-79);l="…"+l.substring(c),a-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),i>1&&/^ *$/.test(l.substring(0,a))){let c=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
184
|
-
`),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];(f==null?void 0:f.line)===i&&f.col>o&&(c=Math.max(1,Math.min(f.col-o,80-a)));const h=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
185
|
-
|
|
186
|
-
${l}
|
|
187
|
-
${h}
|
|
188
|
-
`}};function gs(e,{flow:t,indicator:n,next:i,offset:o,onError:a,parentIndent:l,startOnNewline:c}){let f=!1,h=c,m=c,d="",g="",v=!1,k=!1,w=null,b=null,S=null,N=null,E=null,C=null,I=null;for(const T of e)switch(k&&(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"),k=!1),w&&(h&&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 A=T.source.substring(1)||" ";d?d+=g+A:d=A,g="",h=!1;break}case"newline":h?d?d+=T.source:(!C||n!=="seq-item-ind")&&(f=!0):g+=T.source,h=!0,v=!0,(b||S)&&(N=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,I??(I=T.offset),h=!1,m=!1,k=!0;break;case"tag":{S&&a(T,"MULTIPLE_TAGS","A node can have at most one tag"),S=T,I??(I=T.offset),h=!1,m=!1,k=!0;break}case n:(b||S)&&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,h=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){E&&a(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),E=T,h=!1,m=!1;break}default:a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),h=!1,m=!1}const M=e[e.length-1],L=M?M.offset+M.source.length:o;return k&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(h&&w.indent<=l||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:C,spaceBefore:f,comment:d,hasNewline:v,anchor:b,tag:S,newlineAfterProp:N,end:L,start:I??L}}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 Ih(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 Ib(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 Hv="All mapping items must start at the same column";function _L({composeNode:e,composeEmptyNode:t},n,i,o,a){var m;const l=(a==null?void 0:a.nodeClass)??en,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=i.offset,h=null;for(const d of i.items){const{start:g,key:v,sep:k,value:w}=d,b=gs(g,{indicator:"explicit-key-ind",next:v??(k==null?void 0:k[0]),offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0}),S=!b.found;if(S){if(v&&(v.type==="block-seq"?o(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==i.indent&&o(f,"BAD_INDENT",Hv)),!b.anchor&&!b.tag&&!k){h=b.end,b.comment&&(c.comment?c.comment+=`
|
|
190
|
-
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||zo(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=b.found)==null?void 0:m.indent)!==i.indent&&o(f,"BAD_INDENT",Hv);n.atKey=!0;const N=b.end,E=v?e(n,v,b,o):t(n,N,g,null,b,o);n.schema.compat&&Ih(i.indent,v,o),n.atKey=!1,Ib(n,c.items,E)&&o(N,"DUPLICATE_KEY","Map keys must be unique");const C=gs(k??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:o,parentIndent:i.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=C.end,C.found){S&&((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(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=w?e(n,w,C,o):t(n,f,k,null,C,o);n.schema.compat&&Ih(i.indent,w,o),f=I.range[2];const M=new Et(E,I);n.options.keepSourceTokens&&(M.srcToken=d),c.items.push(M)}else{S&&o(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(E.comment?E.comment+=`
|
|
191
|
-
`+C.comment:E.comment=C.comment);const I=new Et(E);n.options.keepSourceTokens&&(I.srcToken=d),c.items.push(I)}}return h&&h<f&&o(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[i.offset,f,h??f],c}function CL({composeNode:e,composeEmptyNode:t},n,i,o,a){const l=(a==null?void 0:a.nodeClass)??fi,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset,h=null;for(const{start:m,value:d}of i.items){const g=gs(m,{indicator:"seq-item-ind",next:d,offset:f,onError:o,parentIndent:i.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||d)(d==null?void 0:d.type)==="block-seq"?o(g.end,"BAD_INDENT","All sequence items must start at the same column"):o(f,"MISSING_CHAR","Sequence item without - indicator");else{h=g.end,g.comment&&(c.comment=g.comment);continue}const v=d?e(n,d,g,o):t(n,g.end,m,null,g,o);n.schema.compat&&Ih(i.indent,d,o),f=v.range[2],c.items.push(v)}return c.range=[i.offset,f,h??f],c}function Go(e,t,n,i){let o="";if(e){let a=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":a=!0;break;case"comment":{n&&!a&&i(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=f.substring(1)||" ";o?o+=l+m:o=m,l="";break}case"newline":o&&(l+=f),a=!0;break;default:i(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:o,offset:t}}const ih="Block collections are not allowed within flow collections",sh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function TL({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:fi),h=new f(n.schema);h.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let S=0;S<i.items.length;++S){const N=i.items[S],{start:E,key:C,sep:I,value:M}=N,L=gs(E,{flow:c,indicator:"explicit-key-ind",next:C??(I==null?void 0:I[0]),offset:d,onError:o,parentIndent:i.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!I&&!M){S===0&&L.comma?o(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<i.items.length-1&&o(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),L.comment&&(h.comment?h.comment+=`
|
|
192
|
-
`+L.comment:h.comment=L.comment),d=L.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(S===0)L.comma&&o(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(L.comma||o(L.start,"MISSING_CHAR",`Missing , between ${c} items`),L.comment){let T="";e:for(const A of E)switch(A.type){case"comma":case"space":break;case"comment":T=A.source.substring(1);break e;default:break e}if(T){let A=h.items[h.items.length-1];et(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
193
|
-
`+T:A.comment=T,L.comment=L.comment.substring(T.length+1)}}if(!l&&!I&&!L.found){const T=M?e(n,M,L,o):t(n,L.end,I,null,L,o);h.items.push(T),d=T.range[2],sh(M)&&o(T.range,"BLOCK_IN_FLOW",ih)}else{n.atKey=!0;const T=L.end,A=C?e(n,C,L,o):t(n,T,E,null,L,o);sh(C)&&o(A.range,"BLOCK_IN_FLOW",ih),n.atKey=!1;const z=gs(I??[],{flow:c,indicator:"map-value-ind",next:M,offset:A.range[2],onError:o,parentIndent:i.indent,startOnNewline:!1});if(z.found){if(!l&&!L.found&&n.options.strict){if(I)for(const Z of I){if(Z===z.found)break;if(Z.type==="newline"){o(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.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,I,null,z,o):null;R?sh(M)&&o(R.range,"BLOCK_IN_FLOW",ih):z.comment&&(A.comment?A.comment+=`
|
|
194
|
-
`+z.comment:A.comment=z.comment);const $=new Et(A,R);if(n.options.keepSourceTokens&&($.srcToken=N),l){const Z=h;Ib(n,Z.items,A)&&o(T,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push($)}else{const Z=new en(n.schema);Z.flow=!0,Z.items.push($);const j=(R??A).range;Z.range=[A.range[0],j[1],j[2]],h.items.push(Z)}d=R?R.range[2]:z.end}}const g=l?"}":"]",[v,...k]=i.end;let w=d;if((v==null?void 0:v.source)===g)w=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),N=m?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;o(d,m?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&k.unshift(v)}if(k.length>0){const S=Go(k,w,n.options.strict,o);S.comment&&(h.comment?h.comment+=`
|
|
195
|
-
`+S.comment:h.comment=S.comment),h.range=[i.offset,w,S.offset]}else h.range=[i.offset,w,w];return h}function oh(e,t,n,i,o,a){const l=n.type==="block-map"?_L(e,t,n,i,a):n.type==="block-seq"?CL(e,t,n,i,a):TL(e,t,n,i,a),c=l.constructor;return o==="!"||o===c.tagName?(l.tag=c.tagName,l):(o&&(l.tag=o),l)}function OL(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:k}=i,w=v&&a?v.offset>a.offset?v:a:v??a;w&&(!k||k.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===fi.tagName&&c==="seq")return oh(e,t,n,o,l);let f=t.schema.tags.find(v=>v.tag===l&&v.collection===c);if(!f){const v=t.schema.knownTags[l];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?o(a,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),oh(e,t,n,o,l)}const h=oh(e,t,n,o,l,f),m=((g=f.resolve)==null?void 0:g.call(f,h,v=>o(a,"TAG_RESOLVE_FAILED",v),t.options))??h,d=Ze(m)?m:new Te(m);return d.range=h.range,d.tag=l,f!=null&&f.format&&(d.format=f.format),d}function PL(e,t,n){const i=t.offset,o=IL(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?AL(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const b=l[w][1];if(b===""||b==="\r")c=w;else break}if(c===0){const w=o.chomp==="+"&&l.length>0?`
|
|
196
|
-
`.repeat(Math.max(1,l.length-1)):"";let b=i+o.length;return t.source&&(b+=t.source.length),{value:w,type:a,comment:o.comment,range:[i,b,b]}}let f=t.indent+o.indent,h=t.offset+o.length,m=0;for(let w=0;w<c;++w){const[b,S]=l[w];if(S===""||S==="\r")o.indent===0&&b.length>f&&(f=b.length);else{b.length<f&&n(h+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(f=b.length),m=w,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=b.length+S.length+1}for(let w=l.length-1;w>=c;--w)l[w][0].length>f&&(c=w+1);let d="",g="",v=!1;for(let w=0;w<m;++w)d+=l[w][0].slice(f)+`
|
|
197
|
-
`;for(let w=m;w<c;++w){let[b,S]=l[w];h+=b.length+S.length+1;const N=S[S.length-1]==="\r";if(N&&(S=S.slice(0,-1)),S&&b.length<f){const C=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;n(h-S.length-(N?2:1),"BAD_INDENT",C),b=""}a===Te.BLOCK_LITERAL?(d+=g+b.slice(f)+S,g=`
|
|
198
|
-
`):b.length>f||S[0]===" "?(g===" "?g=`
|
|
199
|
-
`:!v&&g===`
|
|
200
|
-
`&&(g=`
|
|
201
|
-
|
|
202
|
-
`),d+=g+b.slice(f)+S,g=`
|
|
203
|
-
`,v=!0):S===""?g===`
|
|
204
|
-
`?d+=`
|
|
205
|
-
`:g=`
|
|
206
|
-
`:(d+=g+S,g=" ",v=!1)}switch(o.chomp){case"-":break;case"+":for(let w=c;w<l.length;++w)d+=`
|
|
207
|
-
`+l[w][0].slice(f);d[d.length-1]!==`
|
|
208
|
-
`&&(d+=`
|
|
209
|
-
`);break;default:d+=`
|
|
210
|
-
`}const k=i+o.length+t.source.length;return{value:d,type:a,comment:o.comment,range:[i,k,k]}}function IL({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 k=Number(v);!l&&k?l=k:f===-1&&(f=e+g)}}f!==-1&&i(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let h=!1,m="",d=o.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":h=!0;case"newline":d+=v.source.length;break;case"comment":n&&!h&&i(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=v.source.length,m=v.source.substring(1);break;case"error":i(v,"UNEXPECTED_TOKEN",v.message),d+=v.source.length;break;default:{const k=`Unexpected token in block scalar header: ${v.type}`;i(v,"UNEXPECTED_TOKEN",k);const w=v.source;w&&typeof w=="string"&&(d+=w.length)}}}return{mode:a,indent:l,chomp:c,comment:m,length:d}}function AL(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 ML(e,t,n){const{offset:i,type:o,source:a,end:l}=e;let c,f;const h=(g,v,k)=>n(i+g,v,k);switch(o){case"scalar":c=Te.PLAIN,f=LL(a,h);break;case"single-quoted-scalar":c=Te.QUOTE_SINGLE,f=RL(a,h);break;case"double-quoted-scalar":c=Te.QUOTE_DOUBLE,f=DL(a,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}const m=i+a.length,d=Go(l,m,t,n);return{value:f,type:c,comment:d.comment,range:[i,m,d.offset]}}function LL(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}`),Ab(e)}function RL(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Ab(e.slice(1,-1)).replace(/''/g,"'")}function Ab(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 DL(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}=jL(e,i);n+=a,i=l}else if(o==="\\"){let a=e[++i];const l=$L[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+=zL(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 jL(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 $L={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
225
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zL(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 Mb(e,t,n,i){const{value:o,type:a,comment:l,range:c}=t.type==="block-scalar"?PL(e,t,i):ML(t,e.options.strict,i),f=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Mn]:f?h=FL(e.schema,o,f,n,i):t.type==="scalar"?h=BL(e,o,t,i):h=e.schema[Mn];let m;try{const d=h.resolve(o,g=>i(n??t,"TAG_RESOLVE_FAILED",g),e.options);m=ze(d)?d:new Te(d)}catch(d){const g=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",g),m=new Te(o)}return m.range=c,m.source=o,a&&(m.type=a),f&&(m.tag=f),h.format&&(m.format=h.format),l&&(m.comment=l),m}function FL(e,t,n,i,o){var c;if(n==="!")return e[Mn];const a=[];for(const f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)a.push(f);else return f;for(const f of a)if((c=f.test)!=null&&c.test(t))return f;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(o(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Mn])}function BL({atKey:e,directives:t,schema:n},i,o,a){const l=n.tags.find(c=>{var f;return(c.default===!0||e&&c.default==="key")&&((f=c.test)==null?void 0:f.test(i))})||n[Mn];if(n.compat){const c=n.compat.find(f=>{var h;return f.default&&((h=f.test)==null?void 0:h.test(i))})??n[Mn];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${h}`;a(o,"TAG_RESOLVE_FAILED",m,!0)}}return l}function VL(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 WL={composeNode:Lb,composeEmptyNode:Cp};function Lb(e,t,n,i){const o=e.atKey,{spaceBefore:a,comment:l,anchor:c,tag:f}=n;let h,m=!0;switch(t.type){case"alias":h=UL(e,t,i),(c||f)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=Mb(e,t,f,i),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=OL(WL,e,t,n,i),c&&(h.anchor=c.source.substring(1))}catch(d){const g=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",g)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),m=!1}}return h??(h=Cp(e,t.offset,void 0,null,n,i)),c&&h.anchor===""&&i(c,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!ze(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&m&&(h.srcToken=t),h}function Cp(e,t,n,i,{spaceBefore:o,comment:a,anchor:l,tag:c,end:f},h){const m={type:"scalar",offset:VL(t,n,i),indent:-1,source:""},d=Mb(e,m,c,h);return l&&(d.anchor=l.source.substring(1),d.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=f),d}function UL({options:e},{offset:t,source:n,end:i},o){const a=new mp(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 HL(e,t,{offset:n,start:i,value:o,end:a},l){const c=Object.assign({_directives:t},e),f=new zu(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=gs(i,{indicator:"doc-start",next:o??(a==null?void 0:a[0]),offset:n,onError:l,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!m.hasNewline&&l(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=o?Lb(h,o,m,l):Cp(h,m.end,i,null,m,l);const d=f.contents.range[2],g=Go(a,d,!1,l);return g.comment&&(f.comment=g.comment),f.range=[n,d,g.offset],f}function vo(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function qv(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 qL{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 NL(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}=qv(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:qv(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=HL(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 Rb="\uFEFF",Db="",jb="",Ah="";function YL(e){switch(e){case Rb:return"byte-order-mark";case Db:return"doc-mode";case jb:return"flow-error-end";case Ah: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 Yv=new Set("0123456789ABCDEFabcdef"),KL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),jl=new Set(",[]{}"),GL=new Set(` ,[]{}
|
|
236
|
-
\r `),ah=e=>!e||GL.has(e);class XL{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]===Rb&&(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 Db,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 jb,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 Ah,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&&jl.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&&jl.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&&jl.has(o))break;n=i}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield Ah,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&&jl.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(KL.has(n))n=this.buffer[++t];else if(n==="%"&&Yv.has(this.buffer[t+1])&&Yv.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 QL{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 Kv(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 $b(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 Yi(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 Gv(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,$b(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 JL{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 XL,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=YL(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"&&Gv(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&&Kv(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":{Kv(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=Yi(n);let o;t.end?(o=t.end,o.push(this.sourceToken),delete t.end):o=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
254
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
255
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const o="end"in n.value?n.value.end:void 0,a=Array.isArray(o)?o[o.length-1]:void 0;(a==null?void 0:a.type)==="comment"?o==null||o.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2],a=(i=o==null?void 0:o.value)==null?void 0:i.end;if(Array.isArray(a)){du(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const o=!this.onKeyLine&&this.indent===t.indent,a=o&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let l=[];if(a&&n.sep&&!n.value){const c=[];for(let f=0;f<n.sep.length;++f){const h=n.sep[f];switch(h.type){case"newline":c.push(f);break;case"space":break;case"comment":h.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(l=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(l.push(this.sourceToken),t.items.push({start:l}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(l.push(this.sourceToken),t.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Cr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if($b(n.key)&&!Cr(n.sep,"newline")){const c=Yi(n.start),f=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:f,sep:h}]})}else l.length>0?n.sep=n.sep.concat(l,this.sourceToken):n.sep.push(this.sourceToken);else if(Cr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Yi(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=Yi(o);Gv(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=Yi(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=Yi(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 ZL(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new QL||null,prettyErrors:t}}function eR(e,t={}){const{lineCounter:n,prettyErrors:i}=ZL(t),o=new JL(n==null?void 0:n.addNewLine),a=new qL(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(Uv(e,n)),l.warnings.forEach(Uv(e,n))),l}function tR(e,t,n){let i;const o=eR(e,n);if(!o)return null;if(o.warnings.forEach(a=>cb(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 nR=`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 rR(){const[e,t]=P.useState(null),[n,i]=P.useState(null),o=P.useCallback(c=>{try{const f=tR(c);t(f),i(null)}catch(f){i(f instanceof Error?f.message:"Failed to parse YAML")}},[]),a=P.useCallback(c=>{t(c),i(null)},[]),l=P.useCallback(()=>{o(nR)},[o]);return{workflow:e,error:n,loadFromString:o,loadFromObject:a,loadDefault:l}}const iR={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,costUsd:0};function sR(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 oR(e){const[t,n]=P.useState({}),[i,o]=P.useState({}),[a,l]=P.useState({}),[c,f]=P.useState({}),[h,m]=P.useState({}),[d,g]=P.useState([]),[v,k]=P.useState(!1),[w,b]=P.useState([]),S=P.useRef(0),N=P.useRef(null),E=P.useRef(null),C=P.useCallback(I=>{if(b(M=>[...M,I]),I.type==="run:start"){const M=`run_${(++S.current).toString(16).padStart(4,"0")}`;N.current=M,E.current=null,g(L=>[{id:M,workflow:I.workflow,label:I.label,status:"running",startedAt:I.ts},...L]),n({}),o({}),l({}),f({}),m({})}else if(I.type==="node:start"&&I.nodeId)n(M=>({...M,[I.nodeId]:"running"}));else if(I.type==="node:activity"&&I.nodeId){const M=I.meta;M&&f(L=>({...L,[I.nodeId]:[...L[I.nodeId]??[],M]}))}else if(I.type==="node:finish"&&I.nodeId){const M=I.status==="failed";n(T=>({...T,[I.nodeId]:M?"failed":"success"}));const L=I.meta;if((L==null?void 0:L.output)!==void 0&&l(T=>({...T,[I.nodeId]:L.output})),L!=null&&L.usage){m(A=>({...A,[I.nodeId]:L.usage}));const T=N.current;T&&g(A=>A.map(z=>z.id===T?{...z,usage:sR(z.usage??iR,L.usage)}:z))}if(M){const T=L==null?void 0:L.error;T&&(o(A=>({...A,[I.nodeId]:T})),E.current||(E.current=`${I.nodeId}: ${T}`))}}else if(I.type==="run:finish"){const M=I.status==="failed"?"failed":"success",L=N.current,T=E.current??void 0;L&&g(A=>A.map(z=>z.id===L?{...z,status:M,finishedAt:I.ts,error:M==="failed"?T:void 0}:z))}},[]);return P.useEffect(()=>{if(!e)return;let I;try{I=new EventSource(`${e}/api/events`)}catch{return}return I.onopen=()=>k(!0),I.onmessage=M=>{try{const L=JSON.parse(M.data);C(L)}catch{}},I.onerror=()=>{k(!1)},()=>{I.close(),k(!1)}},[e,C]),{nodeStatuses:t,nodeErrors:i,nodeOutputs:a,nodeActivity:c,nodeUsage:h,runs:d,connected:v,events:w}}function aR(e){const[t,n]=P.useState([]);return P.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/workflows`).then(o=>o.ok?o.json():[]).then(o=>{!i&&Array.isArray(o)&&n(o)}).catch(()=>{}),()=>{i=!0}},[e]),{workflows:t}}function lR(e){const[t,n]=P.useState({});return P.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/config`).then(o=>o.ok?o.json():{}).then(o=>{!i&&o&&typeof o=="object"&&n(o)}).catch(()=>{}),()=>{i=!0}},[e]),t}function uR(e){const[t,n]=P.useState(!1),[i,o]=P.useState(!1);return P.useEffect(()=>{if(!e)return;let l=!1;const c=()=>fetch(`${e}/api/state`).then(h=>h.ok?h.json():null).then(h=>{l||!h||(n(!!h.paused),o(!!h.controllable))}).catch(()=>{});c();const f=setInterval(c,5e3);return()=>{l=!0,clearInterval(f)}},[e]),{paused:t,controllable:i,toggle:async()=>{if(!e)return;const l=!t;n(l);try{const c=await fetch(`${e}/api/${l?"pause":"resume"}`,{method:"POST"}),f=c.ok?await c.json():null;f&&typeof f.paused=="boolean"&&n(f.paused)}catch{n(!l)}}}}function cR(e){const[t,n]=P.useState({});return P.useEffect(()=>{if(!e)return;let i=!1;return fetch(`${e}/api/agents`).then(o=>o.ok?o.json():[]).then(o=>{if(i||!Array.isArray(o))return;const a={};for(const l of o)a[l.name]=l;n(a)}).catch(()=>{}),()=>{i=!0}},[e]),t}async function fR(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 dR(e,t=0){const[n,i]=P.useState({seen:[],cursors:[]}),[o,a]=P.useState(0),l=()=>a(f=>f+1);return P.useEffect(()=>{if(!e)return;let f=!1;return fetch(`${e}/api/cache`).then(h=>h.ok?h.json():{seen:[],cursors:[]}).then(h=>{!f&&h&&typeof h=="object"&&i(h)}).catch(()=>{}),()=>{f=!0}},[e,o,t]),{cache:n,reload:l,forget:async f=>{e&&(await fetch(`${e}/api/cache`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:f})}),l())}}}const Nr=typeof window<"u"&&window.location.protocol.startsWith("http")?window.location.origin:void 0;function hR(){const{workflow:e,loadDefault:t,loadFromString:n,loadFromObject:i}=rR(),[o,a]=P.useState(null),[l,c]=P.useState(null),[f,h]=P.useState("none"),{nodeStatuses:m,nodeErrors:d,nodeOutputs:g,nodeActivity:v,nodeUsage:k,runs:w,connected:b,events:S}=oR(Nr),{workflows:N}=aR(Nr),E=lR(Nr),C=cR(Nr),{paused:I,controllable:M,toggle:L}=uR(Nr),T=w.filter(B=>B.status!=="running").length,{cache:A,reload:z,forget:R}=dR(Nr,T);P.useEffect(()=>{if(N.length===0){t();return}const B=N.find(H=>H.name===l)??N[0];B.name!==l&&c(B.name),i(B)},[N,l,t,i]);const $=N.find(B=>B.name===l),Z=P.useCallback(B=>c(B),[]),j=P.useCallback((B,H)=>{Nr&&fR(Nr,B,H),h("runs")},[]),G=P.useCallback(B=>{l&&j(l,B)},[l,j]),Y=P.useCallback(B=>a(B),[]),J=B=>h(H=>H===B?"none":B);return _.jsxs("div",{className:"h-screen w-screen flex overflow-hidden bg-muted text-fg font-sans text-[13px] antialiased relative",children:[_.jsx(jP,{liveConnected:b,workflows:N,selected:l,onSelect:Z,onRun:B=>j(B),version:E.version}),_.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[_.jsx($P,{workflow:e,selected:$,dryRun:E.dryRun,paused:I,pauseControllable:M,onTogglePause:L,onLoadYaml:n,onRun:G,onToggleRuns:()=>J("runs"),onToggleCache:()=>{z(),J("cache")},runsOpen:f==="runs",cacheOpen:f==="cache"}),_.jsx("div",{className:"flex-1 flex min-h-0",children:_.jsx(Mx,{children:_.jsx(OI,{workflow:e,onNodeClick:Y,onLoadYaml:n,nodeStatuses:m})})})]}),f==="runs"&&_.jsx(WM,{workflowName:l??void 0,workflowTitle:$==null?void 0:$.title,runs:w,events:S,onClose:()=>h("none")}),f==="cache"&&_.jsx(HM,{cache:A,onReload:z,onForget:B=>void R(B),onClose:()=>h("none")}),_.jsx(BM,{node:o,onClose:()=>a(null),agentDefaults:E.agent,agents:C,status:o?m[o.id]:void 0,output:o?g[o.id]:void 0,error:o?d[o.id]:void 0,activity:o?v[o.id]:void 0,usage:o?k[o.id]:void 0})]})}TS.createRoot(document.getElementById("root")).render(_.jsx(Mh.StrictMode,{children:_.jsx(hR,{})}));
|