archbyte 0.7.0 → 0.7.1
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/README.md +68 -62
- package/dist/agents/index.js +2 -0
- package/dist/agents/prompt-data.js +9 -0
- package/dist/cli/analyze.js +81 -1
- package/package.json +1 -1
- package/ui/dist/assets/index-ClEznf0G.js +85 -0
- package/ui/dist/assets/{index-bMoto6NK.css → index-FuWCQecR.css} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-CkJhpZMm.js +0 -85
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(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 s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();function rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ac={exports:{}},Ao={},Mc={exports:{}},Ue={};/**
|
|
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 Tp;function iw(){if(Tp)return Ue;Tp=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function b(R,Y,A){this.props=R,this.context=Y,this.refs=E,this.updater=A||w}b.prototype.isReactComponent={},b.prototype.setState=function(R,Y){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,Y,"setState")},b.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function S(){}S.prototype=b.prototype;function C(R,Y,A){this.props=R,this.context=Y,this.refs=E,this.updater=A||w}var N=C.prototype=new S;N.constructor=C,k(N,b.prototype),N.isPureReactComponent=!0;var I=Array.isArray,B=Object.prototype.hasOwnProperty,T={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function G(R,Y,A){var ae,re={},ce=null,he=null;if(Y!=null)for(ae in Y.ref!==void 0&&(he=Y.ref),Y.key!==void 0&&(ce=""+Y.key),Y)B.call(Y,ae)&&!D.hasOwnProperty(ae)&&(re[ae]=Y[ae]);var se=arguments.length-2;if(se===1)re.children=A;else if(1<se){for(var ge=Array(se),be=0;be<se;be++)ge[be]=arguments[be+2];re.children=ge}if(R&&R.defaultProps)for(ae in se=R.defaultProps,se)re[ae]===void 0&&(re[ae]=se[ae]);return{$$typeof:e,type:R,key:ce,ref:he,props:re,_owner:T.current}}function U(R,Y){return{$$typeof:e,type:R.type,key:Y,ref:R.ref,props:R.props,_owner:R._owner}}function q(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function F(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(A){return Y[A]})}var W=/\/+/g;function J(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?F(""+R.key):Y.toString(36)}function z(R,Y,A,ae,re){var ce=typeof R;(ce==="undefined"||ce==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(ce){case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case t:he=!0}}if(he)return he=R,re=re(he),R=ae===""?"."+J(he,0):ae,I(re)?(A="",R!=null&&(A=R.replace(W,"$&/")+"/"),z(re,Y,A,"",function(be){return be})):re!=null&&(q(re)&&(re=U(re,A+(!re.key||he&&he.key===re.key?"":(""+re.key).replace(W,"$&/")+"/")+R)),Y.push(re)),1;if(he=0,ae=ae===""?".":ae+":",I(R))for(var se=0;se<R.length;se++){ce=R[se];var ge=ae+J(ce,se);he+=z(ce,Y,A,ge,re)}else if(ge=x(R),typeof ge=="function")for(R=ge.call(R),se=0;!(ce=R.next()).done;)ce=ce.value,ge=ae+J(ce,se++),he+=z(ce,Y,A,ge,re);else if(ce==="object")throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return he}function O(R,Y,A){if(R==null)return R;var ae=[],re=0;return z(R,ae,"","",function(ce){return Y.call(A,ce,re++)}),ae}function $(R){if(R._status===-1){var Y=R._result;Y=Y(),Y.then(function(A){(R._status===0||R._status===-1)&&(R._status=1,R._result=A)},function(A){(R._status===0||R._status===-1)&&(R._status=2,R._result=A)}),R._status===-1&&(R._status=0,R._result=Y)}if(R._status===1)return R._result.default;throw R._result}var Q={current:null},M={transition:null},V={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:M,ReactCurrentOwner:T};function j(){throw Error("act(...) is not supported in production builds of React.")}return Ue.Children={map:O,forEach:function(R,Y,A){O(R,function(){Y.apply(this,arguments)},A)},count:function(R){var Y=0;return O(R,function(){Y++}),Y},toArray:function(R){return O(R,function(Y){return Y})||[]},only:function(R){if(!q(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},Ue.Component=b,Ue.Fragment=r,Ue.Profiler=o,Ue.PureComponent=C,Ue.StrictMode=s,Ue.Suspense=h,Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,Ue.act=j,Ue.cloneElement=function(R,Y,A){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var ae=k({},R.props),re=R.key,ce=R.ref,he=R._owner;if(Y!=null){if(Y.ref!==void 0&&(ce=Y.ref,he=T.current),Y.key!==void 0&&(re=""+Y.key),R.type&&R.type.defaultProps)var se=R.type.defaultProps;for(ge in Y)B.call(Y,ge)&&!D.hasOwnProperty(ge)&&(ae[ge]=Y[ge]===void 0&&se!==void 0?se[ge]:Y[ge])}var ge=arguments.length-2;if(ge===1)ae.children=A;else if(1<ge){se=Array(ge);for(var be=0;be<ge;be++)se[be]=arguments[be+2];ae.children=se}return{$$typeof:e,type:R.type,key:re,ref:ce,props:ae,_owner:he}},Ue.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:a,_context:R},R.Consumer=R},Ue.createElement=G,Ue.createFactory=function(R){var Y=G.bind(null,R);return Y.type=R,Y},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(R){return{$$typeof:d,render:R}},Ue.isValidElement=q,Ue.lazy=function(R){return{$$typeof:m,_payload:{_status:-1,_result:R},_init:$}},Ue.memo=function(R,Y){return{$$typeof:p,type:R,compare:Y===void 0?null:Y}},Ue.startTransition=function(R){var Y=M.transition;M.transition={};try{R()}finally{M.transition=Y}},Ue.unstable_act=j,Ue.useCallback=function(R,Y){return Q.current.useCallback(R,Y)},Ue.useContext=function(R){return Q.current.useContext(R)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(R){return Q.current.useDeferredValue(R)},Ue.useEffect=function(R,Y){return Q.current.useEffect(R,Y)},Ue.useId=function(){return Q.current.useId()},Ue.useImperativeHandle=function(R,Y,A){return Q.current.useImperativeHandle(R,Y,A)},Ue.useInsertionEffect=function(R,Y){return Q.current.useInsertionEffect(R,Y)},Ue.useLayoutEffect=function(R,Y){return Q.current.useLayoutEffect(R,Y)},Ue.useMemo=function(R,Y){return Q.current.useMemo(R,Y)},Ue.useReducer=function(R,Y,A){return Q.current.useReducer(R,Y,A)},Ue.useRef=function(R){return Q.current.useRef(R)},Ue.useState=function(R){return Q.current.useState(R)},Ue.useSyncExternalStore=function(R,Y,A){return Q.current.useSyncExternalStore(R,Y,A)},Ue.useTransition=function(){return Q.current.useTransition()},Ue.version="18.3.1",Ue}var Pp;function il(){return Pp||(Pp=1,Mc.exports=iw()),Mc.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 Ap;function sw(){if(Ap)return Ao;Ap=1;var e=il(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=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 u(d,h,p){var m,g={},x=null,w=null;p!==void 0&&(x=""+p),h.key!==void 0&&(x=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)s.call(h,m)&&!a.hasOwnProperty(m)&&(g[m]=h[m]);if(d&&d.defaultProps)for(m in h=d.defaultProps,h)g[m]===void 0&&(g[m]=h[m]);return{$$typeof:t,type:d,key:x,ref:w,props:g,_owner:o.current}}return Ao.Fragment=r,Ao.jsx=u,Ao.jsxs=u,Ao}var Mp;function ow(){return Mp||(Mp=1,Ac.exports=sw()),Ac.exports}var c=ow(),P=il();const Ug=rl(P);var da={},zc={exports:{}},an={},Rc={exports:{}},Lc={};/**
|
|
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 zp;function lw(){return zp||(zp=1,(function(e){function t(M,V){var j=M.length;M.push(V);e:for(;0<j;){var R=j-1>>>1,Y=M[R];if(0<o(Y,V))M[R]=V,M[j]=Y,j=R;else break e}}function r(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var V=M[0],j=M.pop();if(j!==V){M[0]=j;e:for(var R=0,Y=M.length,A=Y>>>1;R<A;){var ae=2*(R+1)-1,re=M[ae],ce=ae+1,he=M[ce];if(0>o(re,j))ce<Y&&0>o(he,re)?(M[R]=he,M[ce]=j,R=ce):(M[R]=re,M[ae]=j,R=ae);else if(ce<Y&&0>o(he,j))M[R]=he,M[ce]=j,R=ce;else break e}}return V}function o(M,V){var j=M.sortIndex-V.sortIndex;return j!==0?j:M.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],m=1,g=null,x=3,w=!1,k=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(M){for(var V=r(p);V!==null;){if(V.callback===null)s(p);else if(V.startTime<=M)s(p),V.sortIndex=V.expirationTime,t(h,V);else break;V=r(p)}}function I(M){if(E=!1,N(M),!k)if(r(h)!==null)k=!0,$(B);else{var V=r(p);V!==null&&Q(I,V.startTime-M)}}function B(M,V){k=!1,E&&(E=!1,S(G),G=-1),w=!0;var j=x;try{for(N(V),g=r(h);g!==null&&(!(g.expirationTime>V)||M&&!F());){var R=g.callback;if(typeof R=="function"){g.callback=null,x=g.priorityLevel;var Y=R(g.expirationTime<=V);V=e.unstable_now(),typeof Y=="function"?g.callback=Y:g===r(h)&&s(h),N(V)}else s(h);g=r(h)}if(g!==null)var A=!0;else{var ae=r(p);ae!==null&&Q(I,ae.startTime-V),A=!1}return A}finally{g=null,x=j,w=!1}}var T=!1,D=null,G=-1,U=5,q=-1;function F(){return!(e.unstable_now()-q<U)}function W(){if(D!==null){var M=e.unstable_now();q=M;var V=!0;try{V=D(!0,M)}finally{V?J():(T=!1,D=null)}}else T=!1}var J;if(typeof C=="function")J=function(){C(W)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,O=z.port2;z.port1.onmessage=W,J=function(){O.postMessage(null)}}else J=function(){b(W,0)};function $(M){D=M,T||(T=!0,J())}function Q(M,V){G=b(function(){M(e.unstable_now())},V)}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(M){M.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,$(B))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(h)},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var j=x;x=V;try{return M()}finally{x=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,V){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var j=x;x=M;try{return V()}finally{x=j}},e.unstable_scheduleCallback=function(M,V,j){var R=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?R+j:R):j=R,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=j+Y,M={id:m++,callback:V,priorityLevel:M,startTime:j,expirationTime:Y,sortIndex:-1},j>R?(M.sortIndex=j,t(p,M),r(h)===null&&M===r(p)&&(E?(S(G),G=-1):E=!0,Q(I,j-R))):(M.sortIndex=Y,t(h,M),k||w||(k=!0,$(B))),M},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(M){var V=x;return function(){var j=x;x=V;try{return M.apply(this,arguments)}finally{x=j}}}})(Lc)),Lc}var Rp;function aw(){return Rp||(Rp=1,Rc.exports=lw()),Rc.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 Lp;function uw(){if(Lp)return an;Lp=1;var e=il(),t=aw();function r(n){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function a(n,i){u(n,i),u(n+"Capture",i)}function u(n,i){for(o[n]=i,n=0;n<i.length;n++)s.add(i[n])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,p=/^[: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={},g={};function x(n){return h.call(g,n)?!0:h.call(m,n)?!1:p.test(n)?g[n]=!0:(m[n]=!0,!1)}function w(n,i,l,f){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return f?!1:l!==null?!l.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function k(n,i,l,f){if(i===null||typeof i>"u"||w(n,i,l,f))return!0;if(f)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function E(n,i,l,f,y,v,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=f,this.attributeNamespace=y,this.mustUseProperty=l,this.propertyName=n,this.type=i,this.sanitizeURL=v,this.removeEmptyString=_}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){b[n]=new E(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var i=n[0];b[i]=new E(i,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){b[n]=new E(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){b[n]=new E(n,2,!1,n,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(n){b[n]=new E(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){b[n]=new E(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){b[n]=new E(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){b[n]=new E(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){b[n]=new E(n,5,!1,n.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(n){return n[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(n){var i=n.replace(S,C);b[i]=new E(i,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var i=n.replace(S,C);b[i]=new E(i,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var i=n.replace(S,C);b[i]=new E(i,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){b[n]=new E(n,1,!1,n.toLowerCase(),null,!1,!1)}),b.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){b[n]=new E(n,1,!1,n.toLowerCase(),null,!0,!0)});function N(n,i,l,f){var y=b.hasOwnProperty(i)?b[i]:null;(y!==null?y.type!==0:f||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(k(i,l,y,f)&&(l=null),f||y===null?x(i)&&(l===null?n.removeAttribute(i):n.setAttribute(i,""+l)):y.mustUseProperty?n[y.propertyName]=l===null?y.type===3?!1:"":l:(i=y.attributeName,f=y.attributeNamespace,l===null?n.removeAttribute(i):(y=y.type,l=y===3||y===4&&l===!0?"":""+l,f?n.setAttributeNS(f,i,l):n.setAttribute(i,l))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),T=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),F=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),M=Symbol.iterator;function V(n){return n===null||typeof n!="object"?null:(n=M&&n[M]||n["@@iterator"],typeof n=="function"?n:null)}var j=Object.assign,R;function Y(n){if(R===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);R=i&&i[1]||""}return`
|
|
34
|
+
`+R+n}var A=!1;function ae(n,i){if(!n||A)return"";A=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(ne){var f=ne}Reflect.construct(n,[],i)}else{try{i.call()}catch(ne){f=ne}n.call(i.prototype)}else{try{throw Error()}catch(ne){f=ne}n()}}catch(ne){if(ne&&f&&typeof ne.stack=="string"){for(var y=ne.stack.split(`
|
|
35
|
+
`),v=f.stack.split(`
|
|
36
|
+
`),_=y.length-1,L=v.length-1;1<=_&&0<=L&&y[_]!==v[L];)L--;for(;1<=_&&0<=L;_--,L--)if(y[_]!==v[L]){if(_!==1||L!==1)do if(_--,L--,0>L||y[_]!==v[L]){var X=`
|
|
37
|
+
`+y[_].replace(" at new "," at ");return n.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",n.displayName)),X}while(1<=_&&0<=L);break}}}finally{A=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?Y(n):""}function re(n){switch(n.tag){case 5:return Y(n.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return n=ae(n.type,!1),n;case 11:return n=ae(n.type.render,!1),n;case 1:return n=ae(n.type,!0),n;default:return""}}function ce(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case D:return"Fragment";case T:return"Portal";case U:return"Profiler";case G:return"StrictMode";case J:return"Suspense";case z:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case F:return(n.displayName||"Context")+".Consumer";case q:return(n._context.displayName||"Context")+".Provider";case W:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case O:return i=n.displayName||null,i!==null?i:ce(n.type)||"Memo";case $:i=n._payload,n=n._init;try{return ce(n(i))}catch{}}return null}function he(n){var i=n.type;switch(n.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=i.render,n=n.displayName||n.name||"",i.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(i);case 8:return i===G?"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 i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function se(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ge(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function be(n){var i=ge(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),f=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var y=l.get,v=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return y.call(this)},set:function(_){f=""+_,v.call(this,_)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return f},setValue:function(_){f=""+_},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Pe(n){n._valueTracker||(n._valueTracker=be(n))}function Ee(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return n&&(f=ge(n)?n.checked?"true":"false":n.value),n=f,n!==l?(i.setValue(n),!0):!1}function ke(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Ve(n,i){var l=i.checked;return j({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??n._wrapperState.initialChecked})}function We(n,i){var l=i.defaultValue==null?"":i.defaultValue,f=i.checked!=null?i.checked:i.defaultChecked;l=se(i.value!=null?i.value:l),n._wrapperState={initialChecked:f,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Oe(n,i){i=i.checked,i!=null&&N(n,"checked",i,!1)}function tt(n,i){Oe(n,i);var l=se(i.value),f=i.type;if(l!=null)f==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+l):n.value!==""+l&&(n.value=""+l);else if(f==="submit"||f==="reset"){n.removeAttribute("value");return}i.hasOwnProperty("value")?Ct(n,i.type,l):i.hasOwnProperty("defaultValue")&&Ct(n,i.type,se(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(n.defaultChecked=!!i.defaultChecked)}function It(n,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var f=i.type;if(!(f!=="submit"&&f!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+n._wrapperState.initialValue,l||i===n.value||(n.value=i),n.defaultValue=i}l=n.name,l!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,l!==""&&(n.name=l)}function Ct(n,i,l){(i!=="number"||ke(n.ownerDocument)!==n)&&(l==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+l&&(n.defaultValue=""+l))}var gt=Array.isArray;function Tt(n,i,l,f){if(n=n.options,i){i={};for(var y=0;y<l.length;y++)i["$"+l[y]]=!0;for(l=0;l<n.length;l++)y=i.hasOwnProperty("$"+n[l].value),n[l].selected!==y&&(n[l].selected=y),y&&f&&(n[l].defaultSelected=!0)}else{for(l=""+se(l),i=null,y=0;y<n.length;y++){if(n[y].value===l){n[y].selected=!0,f&&(n[y].defaultSelected=!0);return}i!==null||n[y].disabled||(i=n[y])}i!==null&&(i.selected=!0)}}function Ht(n,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return j({},i,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function pn(n,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(r(92));if(gt(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),l=i}n._wrapperState={initialValue:se(l)}}function mn(n,i){var l=se(i.value),f=se(i.defaultValue);l!=null&&(l=""+l,l!==n.value&&(n.value=l),i.defaultValue==null&&n.defaultValue!==l&&(n.defaultValue=l)),f!=null&&(n.defaultValue=""+f)}function Jt(n){var i=n.textContent;i===n._wrapperState.initialValue&&i!==""&&i!==null&&(n.value=i)}function oe(n){switch(n){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 ye(n,i){return n==null||n==="http://www.w3.org/1999/xhtml"?oe(i):n==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var me,$e=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,f,y){MSApp.execUnsafeLocalFunction(function(){return n(i,l,f,y)})}:n})(function(n,i){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=i;else{for(me=me||document.createElement("div"),me.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=me.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;i.firstChild;)n.appendChild(i.firstChild)}});function Be(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var ht={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},gn=["Webkit","ms","Moz","O"];Object.keys(ht).forEach(function(n){gn.forEach(function(i){i=i+n.charAt(0).toUpperCase()+n.substring(1),ht[i]=ht[n]})});function Pt(n,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||ht.hasOwnProperty(n)&&ht[n]?(""+i).trim():i+"px"}function yt(n,i){n=n.style;for(var l in i)if(i.hasOwnProperty(l)){var f=l.indexOf("--")===0,y=Pt(l,i[l],f);l==="float"&&(l="cssFloat"),f?n.setProperty(l,y):n[l]=y}}var _n=j({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 pt(n,i){if(i){if(_n[n]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function en(n,i){if(n.indexOf("-")===-1)return typeof i.is=="string";switch(n){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 At=null;function $r(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Br=null,Vt=null,tr=null;function Fn(n){if(n=yo(n)){if(typeof Br!="function")throw Error(r(280));var i=n.stateNode;i&&(i=Cl(i),Br(n.stateNode,n.type,i))}}function yn(n){Vt?tr?tr.push(n):tr=[n]:Vt=n}function Hr(){if(Vt){var n=Vt,i=tr;if(tr=Vt=null,Fn(n),i)for(n=0;n<i.length;n++)Fn(i[n])}}function Si(n,i){return n(i)}function On(){}var wr=!1;function ts(n,i,l){if(wr)return n(i,l);wr=!0;try{return Si(n,i,l)}finally{wr=!1,(Vt!==null||tr!==null)&&(On(),Hr())}}function Sr(n,i){var l=n.stateNode;if(l===null)return null;var f=Cl(l);if(f===null)return null;l=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(n=n.type,f=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!f;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var kr=!1;if(d)try{var $n={};Object.defineProperty($n,"passive",{get:function(){kr=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{kr=!1}function Vr(n,i,l,f,y,v,_,L,X){var ne=Array.prototype.slice.call(arguments,3);try{i.apply(l,ne)}catch(fe){this.onError(fe)}}var Ur=!1,Dt=null,Nr=!1,St=null,Qs={onError:function(n){Ur=!0,Dt=n}};function xn(n,i,l,f,y,v,_,L,X){Ur=!1,Dt=null,Vr.apply(Qs,arguments)}function ns(n,i,l,f,y,v,_,L,X){if(xn.apply(this,arguments),Ur){if(Ur){var ne=Dt;Ur=!1,Dt=null}else throw Error(r(198));Nr||(Nr=!0,St=ne)}}function Ft(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function ki(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function Bn(n){if(Ft(n)!==n)throw Error(r(188))}function xt(n){var i=n.alternate;if(!i){if(i=Ft(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,f=i;;){var y=l.return;if(y===null)break;var v=y.alternate;if(v===null){if(f=y.return,f!==null){l=f;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===l)return Bn(y),n;if(v===f)return Bn(y),i;v=v.sibling}throw Error(r(188))}if(l.return!==f.return)l=y,f=v;else{for(var _=!1,L=y.child;L;){if(L===l){_=!0,l=y,f=v;break}if(L===f){_=!0,f=y,l=v;break}L=L.sibling}if(!_){for(L=v.child;L;){if(L===l){_=!0,l=v,f=y;break}if(L===f){_=!0,f=v,l=y;break}L=L.sibling}if(!_)throw Error(r(189))}}if(l.alternate!==f)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function Ni(n){return n=xt(n),n!==null?nr(n):null}function nr(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var i=nr(n);if(i!==null)return i;n=n.sibling}return null}var Ei=t.unstable_scheduleCallback,bi=t.unstable_cancelCallback,In=t.unstable_shouldYield,rr=t.unstable_requestPaint,st=t.unstable_now,Zs=t.unstable_getCurrentPriorityLevel,Ci=t.unstable_ImmediatePriority,ji=t.unstable_UserBlockingPriority,Er=t.unstable_NormalPriority,Js=t.unstable_LowPriority,rs=t.unstable_IdlePriority,br=null,tn=null;function is(n){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(br,n,void 0,(n.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:ir,Wr=Math.log,ss=Math.LN2;function ir(n){return n>>>=0,n===0?32:31-(Wr(n)/ss|0)|0}var Yr=64,Xr=4194304;function Gt(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function et(n,i){var l=n.pendingLanes;if(l===0)return 0;var f=0,y=n.suspendedLanes,v=n.pingedLanes,_=l&268435455;if(_!==0){var L=_&~y;L!==0?f=Gt(L):(v&=_,v!==0&&(f=Gt(v)))}else _=l&~y,_!==0?f=Gt(_):v!==0&&(f=Gt(v));if(f===0)return 0;if(i!==0&&i!==f&&(i&y)===0&&(y=f&-f,v=i&-i,y>=v||y===16&&(v&4194240)!==0))return i;if((f&4)!==0&&(f|=l&16),i=n.entangledLanes,i!==0)for(n=n.entanglements,i&=f;0<i;)l=31-Ot(i),y=1<<l,f|=n[l],i&=~y;return f}function qr(n,i){switch(n){case 1:case 2:case 4:return i+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 i+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 eo(n,i){for(var l=n.suspendedLanes,f=n.pingedLanes,y=n.expirationTimes,v=n.pendingLanes;0<v;){var _=31-Ot(v),L=1<<_,X=y[_];X===-1?((L&l)===0||(L&f)!==0)&&(y[_]=qr(L,i)):X<=i&&(n.expiredLanes|=L),v&=~L}}function _i(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Gr(){var n=Yr;return Yr<<=1,(Yr&4194240)===0&&(Yr=64),n}function Ii(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Hn(n,i,l){n.pendingLanes|=i,i!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,i=31-Ot(i),n[i]=l}function os(n,i){var l=n.pendingLanes&~i;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=i,n.mutableReadLanes&=i,n.entangledLanes&=i,i=n.entanglements;var f=n.eventTimes;for(n=n.expirationTimes;0<l;){var y=31-Ot(l),v=1<<y;i[y]=0,f[y]=-1,n[y]=-1,l&=~v}}function ls(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var f=31-Ot(l),y=1<<f;y&i|n[f]&i&&(n[f]|=i),l&=~y}}var Ke=0;function hl(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var to,as,no,Kr,pl,ro=!1,us=[],sr=null,Kt=null,or=null,Ti=new Map,Cr=new Map,Vn=[],H="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 Z(n,i){switch(n){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":Kt=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ti.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cr.delete(i.pointerId)}}function ie(n,i,l,f,y,v){return n===null||n.nativeEvent!==v?(n={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:v,targetContainers:[y]},i!==null&&(i=yo(i),i!==null&&as(i)),n):(n.eventSystemFlags|=f,i=n.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),n)}function ue(n,i,l,f,y){switch(i){case"focusin":return sr=ie(sr,n,i,l,f,y),!0;case"dragenter":return Kt=ie(Kt,n,i,l,f,y),!0;case"mouseover":return or=ie(or,n,i,l,f,y),!0;case"pointerover":var v=y.pointerId;return Ti.set(v,ie(Ti.get(v)||null,n,i,l,f,y)),!0;case"gotpointercapture":return v=y.pointerId,Cr.set(v,ie(Cr.get(v)||null,n,i,l,f,y)),!0}return!1}function le(n){var i=Pi(n.target);if(i!==null){var l=Ft(i);if(l!==null){if(i=l.tag,i===13){if(i=ki(l),i!==null){n.blockedOn=i,pl(n.priority,function(){no(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function we(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=io(n.domEventName,n.eventSystemFlags,i[0],n.nativeEvent);if(l===null){l=n.nativeEvent;var f=new l.constructor(l.type,l);At=f,l.target.dispatchEvent(f),At=null}else return i=yo(l),i!==null&&as(i),n.blockedOn=l,!1;i.shift()}return!0}function Ae(n,i,l){we(n)&&l.delete(i)}function _e(){ro=!1,sr!==null&&we(sr)&&(sr=null),Kt!==null&&we(Kt)&&(Kt=null),or!==null&&we(or)&&(or=null),Ti.forEach(Ae),Cr.forEach(Ae)}function Me(n,i){n.blockedOn===i&&(n.blockedOn=null,ro||(ro=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_e)))}function Ye(n){function i(y){return Me(y,n)}if(0<us.length){Me(us[0],n);for(var l=1;l<us.length;l++){var f=us[l];f.blockedOn===n&&(f.blockedOn=null)}}for(sr!==null&&Me(sr,n),Kt!==null&&Me(Kt,n),or!==null&&Me(or,n),Ti.forEach(i),Cr.forEach(i),l=0;l<Vn.length;l++)f=Vn[l],f.blockedOn===n&&(f.blockedOn=null);for(;0<Vn.length&&(l=Vn[0],l.blockedOn===null);)le(l),l.blockedOn===null&&Vn.shift()}var Qe=I.ReactCurrentBatchConfig,vt=!0;function Xe(n,i,l,f){var y=Ke,v=Qe.transition;Qe.transition=null;try{Ke=1,Tn(n,i,l,f)}finally{Ke=y,Qe.transition=v}}function kt(n,i,l,f){var y=Ke,v=Qe.transition;Qe.transition=null;try{Ke=4,Tn(n,i,l,f)}finally{Ke=y,Qe.transition=v}}function Tn(n,i,l,f){if(vt){var y=io(n,i,l,f);if(y===null)ku(n,i,f,jr,l),Z(n,f);else if(ue(y,n,i,l,f))f.stopPropagation();else if(Z(n,f),i&4&&-1<H.indexOf(n)){for(;y!==null;){var v=yo(y);if(v!==null&&to(v),v=io(n,i,l,f),v===null&&ku(n,i,f,jr,l),v===y)break;y=v}y!==null&&f.stopPropagation()}else ku(n,i,f,null,l)}}var jr=null;function io(n,i,l,f){if(jr=null,n=$r(f),n=Pi(n),n!==null)if(i=Ft(n),i===null)n=null;else if(l=i.tag,l===13){if(n=ki(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null);return jr=n,null}function gf(n){switch(n){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(Zs()){case Ci:return 1;case ji:return 4;case Er:case Js:return 16;case rs:return 536870912;default:return 16}default:return 16}}var Qr=null,ou=null,ml=null;function yf(){if(ml)return ml;var n,i=ou,l=i.length,f,y="value"in Qr?Qr.value:Qr.textContent,v=y.length;for(n=0;n<l&&i[n]===y[n];n++);var _=l-n;for(f=1;f<=_&&i[l-f]===y[v-f];f++);return ml=y.slice(n,1<f?1-f:void 0)}function gl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function yl(){return!0}function xf(){return!1}function vn(n){function i(l,f,y,v,_){this._reactName=l,this._targetInst=y,this.type=f,this.nativeEvent=v,this.target=_,this.currentTarget=null;for(var L in n)n.hasOwnProperty(L)&&(l=n[L],this[L]=l?l(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?yl:xf,this.isPropagationStopped=xf,this}return j(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=yl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=yl)},persist:function(){},isPersistent:yl}),i}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lu=vn(cs),so=j({},cs,{view:0,detail:0}),P0=vn(so),au,uu,oo,xl=j({},so,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:du,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==oo&&(oo&&n.type==="mousemove"?(au=n.screenX-oo.screenX,uu=n.screenY-oo.screenY):uu=au=0,oo=n),au)},movementY:function(n){return"movementY"in n?n.movementY:uu}}),vf=vn(xl),A0=j({},xl,{dataTransfer:0}),M0=vn(A0),z0=j({},so,{relatedTarget:0}),cu=vn(z0),R0=j({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),L0=vn(R0),D0=j({},cs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),F0=vn(D0),O0=j({},cs,{data:0}),wf=vn(O0),$0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B0={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"},H0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V0(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=H0[n])?!!i[n]:!1}function du(){return V0}var U0=j({},so,{key:function(n){if(n.key){var i=$0[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=gl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?B0[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:du,charCode:function(n){return n.type==="keypress"?gl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?gl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),W0=vn(U0),Y0=j({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sf=vn(Y0),X0=j({},so,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:du}),q0=vn(X0),G0=j({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),K0=vn(G0),Q0=j({},xl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Z0=vn(Q0),J0=[9,13,27,32],fu=d&&"CompositionEvent"in window,lo=null;d&&"documentMode"in document&&(lo=document.documentMode);var ev=d&&"TextEvent"in window&&!lo,kf=d&&(!fu||lo&&8<lo&&11>=lo),Nf=" ",Ef=!1;function bf(n,i){switch(n){case"keyup":return J0.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ds=!1;function tv(n,i){switch(n){case"compositionend":return Cf(i);case"keypress":return i.which!==32?null:(Ef=!0,Nf);case"textInput":return n=i.data,n===Nf&&Ef?null:n;default:return null}}function nv(n,i){if(ds)return n==="compositionend"||!fu&&bf(n,i)?(n=yf(),ml=ou=Qr=null,ds=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return kf&&i.locale!=="ko"?null:i.data;default:return null}}var rv={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 jf(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!rv[n.type]:i==="textarea"}function _f(n,i,l,f){yn(f),i=Nl(i,"onChange"),0<i.length&&(l=new lu("onChange","change",null,l,f),n.push({event:l,listeners:i}))}var ao=null,uo=null;function iv(n){Yf(n,0)}function vl(n){var i=gs(n);if(Ee(i))return n}function sv(n,i){if(n==="change")return i}var If=!1;if(d){var hu;if(d){var pu="oninput"in document;if(!pu){var Tf=document.createElement("div");Tf.setAttribute("oninput","return;"),pu=typeof Tf.oninput=="function"}hu=pu}else hu=!1;If=hu&&(!document.documentMode||9<document.documentMode)}function Pf(){ao&&(ao.detachEvent("onpropertychange",Af),uo=ao=null)}function Af(n){if(n.propertyName==="value"&&vl(uo)){var i=[];_f(i,uo,n,$r(n)),ts(iv,i)}}function ov(n,i,l){n==="focusin"?(Pf(),ao=i,uo=l,ao.attachEvent("onpropertychange",Af)):n==="focusout"&&Pf()}function lv(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return vl(uo)}function av(n,i){if(n==="click")return vl(i)}function uv(n,i){if(n==="input"||n==="change")return vl(i)}function cv(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Un=typeof Object.is=="function"?Object.is:cv;function co(n,i){if(Un(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var y=l[f];if(!h.call(i,y)||!Un(n[y],i[y]))return!1}return!0}function Mf(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function zf(n,i){var l=Mf(n);n=0;for(var f;l;){if(l.nodeType===3){if(f=n+l.textContent.length,n<=i&&f>=i)return{node:l,offset:i-n};n=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Mf(l)}}function Rf(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Rf(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Lf(){for(var n=window,i=ke();i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=ke(n.document)}return i}function mu(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}function dv(n){var i=Lf(),l=n.focusedElem,f=n.selectionRange;if(i!==l&&l&&l.ownerDocument&&Rf(l.ownerDocument.documentElement,l)){if(f!==null&&mu(l)){if(i=f.start,n=f.end,n===void 0&&(n=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(n,l.value.length);else if(n=(i=l.ownerDocument||document)&&i.defaultView||window,n.getSelection){n=n.getSelection();var y=l.textContent.length,v=Math.min(f.start,y);f=f.end===void 0?v:Math.min(f.end,y),!n.extend&&v>f&&(y=f,f=v,v=y),y=zf(l,v);var _=zf(l,f);y&&_&&(n.rangeCount!==1||n.anchorNode!==y.node||n.anchorOffset!==y.offset||n.focusNode!==_.node||n.focusOffset!==_.offset)&&(i=i.createRange(),i.setStart(y.node,y.offset),n.removeAllRanges(),v>f?(n.addRange(i),n.extend(_.node,_.offset)):(i.setEnd(_.node,_.offset),n.addRange(i)))}}for(i=[],n=l;n=n.parentNode;)n.nodeType===1&&i.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)n=i[l],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var fv=d&&"documentMode"in document&&11>=document.documentMode,fs=null,gu=null,fo=null,yu=!1;function Df(n,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;yu||fs==null||fs!==ke(f)||(f=fs,"selectionStart"in f&&mu(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),fo&&co(fo,f)||(fo=f,f=Nl(gu,"onSelect"),0<f.length&&(i=new lu("onSelect","select",null,i,l),n.push({event:i,listeners:f}),i.target=fs)))}function wl(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var hs={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},xu={},Ff={};d&&(Ff=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function Sl(n){if(xu[n])return xu[n];if(!hs[n])return n;var i=hs[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Ff)return xu[n]=i[l];return n}var Of=Sl("animationend"),$f=Sl("animationiteration"),Bf=Sl("animationstart"),Hf=Sl("transitionend"),Vf=new Map,Uf="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 Zr(n,i){Vf.set(n,i),a(i,[n])}for(var vu=0;vu<Uf.length;vu++){var wu=Uf[vu],hv=wu.toLowerCase(),pv=wu[0].toUpperCase()+wu.slice(1);Zr(hv,"on"+pv)}Zr(Of,"onAnimationEnd"),Zr($f,"onAnimationIteration"),Zr(Bf,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(Hf,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("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 ho="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(" "),mv=new Set("cancel close invalid load scroll toggle".split(" ").concat(ho));function Wf(n,i,l){var f=n.type||"unknown-event";n.currentTarget=l,ns(f,i,void 0,n),n.currentTarget=null}function Yf(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var f=n[l],y=f.event;f=f.listeners;e:{var v=void 0;if(i)for(var _=f.length-1;0<=_;_--){var L=f[_],X=L.instance,ne=L.currentTarget;if(L=L.listener,X!==v&&y.isPropagationStopped())break e;Wf(y,L,ne),v=X}else for(_=0;_<f.length;_++){if(L=f[_],X=L.instance,ne=L.currentTarget,L=L.listener,X!==v&&y.isPropagationStopped())break e;Wf(y,L,ne),v=X}}}if(Nr)throw n=St,Nr=!1,St=null,n}function ot(n,i){var l=i[_u];l===void 0&&(l=i[_u]=new Set);var f=n+"__bubble";l.has(f)||(Xf(i,n,2,!1),l.add(f))}function Su(n,i,l){var f=0;i&&(f|=4),Xf(l,n,f,i)}var kl="_reactListening"+Math.random().toString(36).slice(2);function po(n){if(!n[kl]){n[kl]=!0,s.forEach(function(l){l!=="selectionchange"&&(mv.has(l)||Su(l,!1,n),Su(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[kl]||(i[kl]=!0,Su("selectionchange",!1,i))}}function Xf(n,i,l,f){switch(gf(i)){case 1:var y=Xe;break;case 4:y=kt;break;default:y=Tn}l=y.bind(null,i,l,n),y=void 0,!kr||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?n.addEventListener(i,l,{capture:!0,passive:y}):n.addEventListener(i,l,!0):y!==void 0?n.addEventListener(i,l,{passive:y}):n.addEventListener(i,l,!1)}function ku(n,i,l,f,y){var v=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var _=f.tag;if(_===3||_===4){var L=f.stateNode.containerInfo;if(L===y||L.nodeType===8&&L.parentNode===y)break;if(_===4)for(_=f.return;_!==null;){var X=_.tag;if((X===3||X===4)&&(X=_.stateNode.containerInfo,X===y||X.nodeType===8&&X.parentNode===y))return;_=_.return}for(;L!==null;){if(_=Pi(L),_===null)return;if(X=_.tag,X===5||X===6){f=v=_;continue e}L=L.parentNode}}f=f.return}ts(function(){var ne=v,fe=$r(l),pe=[];e:{var de=Vf.get(n);if(de!==void 0){var Se=lu,Ce=n;switch(n){case"keypress":if(gl(l)===0)break e;case"keydown":case"keyup":Se=W0;break;case"focusin":Ce="focus",Se=cu;break;case"focusout":Ce="blur",Se=cu;break;case"beforeblur":case"afterblur":Se=cu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=M0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=q0;break;case Of:case $f:case Bf:Se=L0;break;case Hf:Se=K0;break;case"scroll":Se=P0;break;case"wheel":Se=Z0;break;case"copy":case"cut":case"paste":Se=F0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=Sf}var je=(i&4)!==0,wt=!je&&n==="scroll",ee=je?de!==null?de+"Capture":null:de;je=[];for(var K=ne,te;K!==null;){te=K;var ve=te.stateNode;if(te.tag===5&&ve!==null&&(te=ve,ee!==null&&(ve=Sr(K,ee),ve!=null&&je.push(mo(K,ve,te)))),wt)break;K=K.return}0<je.length&&(de=new Se(de,Ce,null,l,fe),pe.push({event:de,listeners:je}))}}if((i&7)===0){e:{if(de=n==="mouseover"||n==="pointerover",Se=n==="mouseout"||n==="pointerout",de&&l!==At&&(Ce=l.relatedTarget||l.fromElement)&&(Pi(Ce)||Ce[_r]))break e;if((Se||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Se?(Ce=l.relatedTarget||l.toElement,Se=ne,Ce=Ce?Pi(Ce):null,Ce!==null&&(wt=Ft(Ce),Ce!==wt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(Se=null,Ce=ne),Se!==Ce)){if(je=vf,ve="onMouseLeave",ee="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(je=Sf,ve="onPointerLeave",ee="onPointerEnter",K="pointer"),wt=Se==null?de:gs(Se),te=Ce==null?de:gs(Ce),de=new je(ve,K+"leave",Se,l,fe),de.target=wt,de.relatedTarget=te,ve=null,Pi(fe)===ne&&(je=new je(ee,K+"enter",Ce,l,fe),je.target=te,je.relatedTarget=wt,ve=je),wt=ve,Se&&Ce)t:{for(je=Se,ee=Ce,K=0,te=je;te;te=ps(te))K++;for(te=0,ve=ee;ve;ve=ps(ve))te++;for(;0<K-te;)je=ps(je),K--;for(;0<te-K;)ee=ps(ee),te--;for(;K--;){if(je===ee||ee!==null&&je===ee.alternate)break t;je=ps(je),ee=ps(ee)}je=null}else je=null;Se!==null&&qf(pe,de,Se,je,!1),Ce!==null&&wt!==null&&qf(pe,wt,Ce,je,!0)}}e:{if(de=ne?gs(ne):window,Se=de.nodeName&&de.nodeName.toLowerCase(),Se==="select"||Se==="input"&&de.type==="file")var Ie=sv;else if(jf(de))if(If)Ie=uv;else{Ie=lv;var ze=ov}else(Se=de.nodeName)&&Se.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Ie=av);if(Ie&&(Ie=Ie(n,ne))){_f(pe,Ie,l,fe);break e}ze&&ze(n,de,ne),n==="focusout"&&(ze=de._wrapperState)&&ze.controlled&&de.type==="number"&&Ct(de,"number",de.value)}switch(ze=ne?gs(ne):window,n){case"focusin":(jf(ze)||ze.contentEditable==="true")&&(fs=ze,gu=ne,fo=null);break;case"focusout":fo=gu=fs=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,Df(pe,l,fe);break;case"selectionchange":if(fv)break;case"keydown":case"keyup":Df(pe,l,fe)}var Re;if(fu)e:{switch(n){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else ds?bf(n,l)&&(De="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(kf&&l.locale!=="ko"&&(ds||De!=="onCompositionStart"?De==="onCompositionEnd"&&ds&&(Re=yf()):(Qr=fe,ou="value"in Qr?Qr.value:Qr.textContent,ds=!0)),ze=Nl(ne,De),0<ze.length&&(De=new wf(De,n,null,l,fe),pe.push({event:De,listeners:ze}),Re?De.data=Re:(Re=Cf(l),Re!==null&&(De.data=Re)))),(Re=ev?tv(n,l):nv(n,l))&&(ne=Nl(ne,"onBeforeInput"),0<ne.length&&(fe=new wf("onBeforeInput","beforeinput",null,l,fe),pe.push({event:fe,listeners:ne}),fe.data=Re))}Yf(pe,i)})}function mo(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Nl(n,i){for(var l=i+"Capture",f=[];n!==null;){var y=n,v=y.stateNode;y.tag===5&&v!==null&&(y=v,v=Sr(n,l),v!=null&&f.unshift(mo(n,v,y)),v=Sr(n,i),v!=null&&f.push(mo(n,v,y))),n=n.return}return f}function ps(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function qf(n,i,l,f,y){for(var v=i._reactName,_=[];l!==null&&l!==f;){var L=l,X=L.alternate,ne=L.stateNode;if(X!==null&&X===f)break;L.tag===5&&ne!==null&&(L=ne,y?(X=Sr(l,v),X!=null&&_.unshift(mo(l,X,L))):y||(X=Sr(l,v),X!=null&&_.push(mo(l,X,L)))),l=l.return}_.length!==0&&n.push({event:i,listeners:_})}var gv=/\r\n?/g,yv=/\u0000|\uFFFD/g;function Gf(n){return(typeof n=="string"?n:""+n).replace(gv,`
|
|
38
|
+
`).replace(yv,"")}function El(n,i,l){if(i=Gf(i),Gf(n)!==i&&l)throw Error(r(425))}function bl(){}var Nu=null,Eu=null;function bu(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Cu=typeof setTimeout=="function"?setTimeout:void 0,xv=typeof clearTimeout=="function"?clearTimeout:void 0,Kf=typeof Promise=="function"?Promise:void 0,vv=typeof queueMicrotask=="function"?queueMicrotask:typeof Kf<"u"?function(n){return Kf.resolve(null).then(n).catch(wv)}:Cu;function wv(n){setTimeout(function(){throw n})}function ju(n,i){var l=i,f=0;do{var y=l.nextSibling;if(n.removeChild(l),y&&y.nodeType===8)if(l=y.data,l==="/$"){if(f===0){n.removeChild(y),Ye(i);return}f--}else l!=="$"&&l!=="$?"&&l!=="$!"||f++;l=y}while(l);Ye(i)}function Jr(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return n}function Qf(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}var ms=Math.random().toString(36).slice(2),lr="__reactFiber$"+ms,go="__reactProps$"+ms,_r="__reactContainer$"+ms,_u="__reactEvents$"+ms,Sv="__reactListeners$"+ms,kv="__reactHandles$"+ms;function Pi(n){var i=n[lr];if(i)return i;for(var l=n.parentNode;l;){if(i=l[_r]||l[lr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=Qf(n);n!==null;){if(l=n[lr])return l;n=Qf(n)}return i}n=l,l=n.parentNode}return null}function yo(n){return n=n[lr]||n[_r],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function gs(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function Cl(n){return n[go]||null}var Iu=[],ys=-1;function ei(n){return{current:n}}function lt(n){0>ys||(n.current=Iu[ys],Iu[ys]=null,ys--)}function nt(n,i){ys++,Iu[ys]=n.current,n.current=i}var ti={},Ut=ei(ti),nn=ei(!1),Ai=ti;function xs(n,i){var l=n.type.contextTypes;if(!l)return ti;var f=n.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===i)return f.__reactInternalMemoizedMaskedChildContext;var y={},v;for(v in l)y[v]=i[v];return f&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=y),y}function rn(n){return n=n.childContextTypes,n!=null}function jl(){lt(nn),lt(Ut)}function Zf(n,i,l){if(Ut.current!==ti)throw Error(r(168));nt(Ut,i),nt(nn,l)}function Jf(n,i,l){var f=n.stateNode;if(i=i.childContextTypes,typeof f.getChildContext!="function")return l;f=f.getChildContext();for(var y in f)if(!(y in i))throw Error(r(108,he(n)||"Unknown",y));return j({},l,f)}function _l(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ti,Ai=Ut.current,nt(Ut,n),nt(nn,nn.current),!0}function eh(n,i,l){var f=n.stateNode;if(!f)throw Error(r(169));l?(n=Jf(n,i,Ai),f.__reactInternalMemoizedMergedChildContext=n,lt(nn),lt(Ut),nt(Ut,n)):lt(nn),nt(nn,l)}var Ir=null,Il=!1,Tu=!1;function th(n){Ir===null?Ir=[n]:Ir.push(n)}function Nv(n){Il=!0,th(n)}function ni(){if(!Tu&&Ir!==null){Tu=!0;var n=0,i=Ke;try{var l=Ir;for(Ke=1;n<l.length;n++){var f=l[n];do f=f(!0);while(f!==null)}Ir=null,Il=!1}catch(y){throw Ir!==null&&(Ir=Ir.slice(n+1)),Ei(Ci,ni),y}finally{Ke=i,Tu=!1}}return null}var vs=[],ws=0,Tl=null,Pl=0,Pn=[],An=0,Mi=null,Tr=1,Pr="";function zi(n,i){vs[ws++]=Pl,vs[ws++]=Tl,Tl=n,Pl=i}function nh(n,i,l){Pn[An++]=Tr,Pn[An++]=Pr,Pn[An++]=Mi,Mi=n;var f=Tr;n=Pr;var y=32-Ot(f)-1;f&=~(1<<y),l+=1;var v=32-Ot(i)+y;if(30<v){var _=y-y%5;v=(f&(1<<_)-1).toString(32),f>>=_,y-=_,Tr=1<<32-Ot(i)+y|l<<y|f,Pr=v+n}else Tr=1<<v|l<<y|f,Pr=n}function Pu(n){n.return!==null&&(zi(n,1),nh(n,1,0))}function Au(n){for(;n===Tl;)Tl=vs[--ws],vs[ws]=null,Pl=vs[--ws],vs[ws]=null;for(;n===Mi;)Mi=Pn[--An],Pn[An]=null,Pr=Pn[--An],Pn[An]=null,Tr=Pn[--An],Pn[An]=null}var wn=null,Sn=null,at=!1,Wn=null;function rh(n,i){var l=Ln(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=n,i=n.deletions,i===null?(n.deletions=[l],n.flags|=16):i.push(l)}function ih(n,i){switch(n.tag){case 5:var l=n.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(n.stateNode=i,wn=n,Sn=Jr(i.firstChild),!0):!1;case 6:return i=n.pendingProps===""||i.nodeType!==3?null:i,i!==null?(n.stateNode=i,wn=n,Sn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Mi!==null?{id:Tr,overflow:Pr}:null,n.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Ln(18,null,null,0),l.stateNode=i,l.return=n,n.child=l,wn=n,Sn=null,!0):!1;default:return!1}}function Mu(n){return(n.mode&1)!==0&&(n.flags&128)===0}function zu(n){if(at){var i=Sn;if(i){var l=i;if(!ih(n,i)){if(Mu(n))throw Error(r(418));i=Jr(l.nextSibling);var f=wn;i&&ih(n,i)?rh(f,l):(n.flags=n.flags&-4097|2,at=!1,wn=n)}}else{if(Mu(n))throw Error(r(418));n.flags=n.flags&-4097|2,at=!1,wn=n}}}function sh(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;wn=n}function Al(n){if(n!==wn)return!1;if(!at)return sh(n),at=!0,!1;var i;if((i=n.tag!==3)&&!(i=n.tag!==5)&&(i=n.type,i=i!=="head"&&i!=="body"&&!bu(n.type,n.memoizedProps)),i&&(i=Sn)){if(Mu(n))throw oh(),Error(r(418));for(;i;)rh(n,i),i=Jr(i.nextSibling)}if(sh(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"){if(i===0){Sn=Jr(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}n=n.nextSibling}Sn=null}}else Sn=wn?Jr(n.stateNode.nextSibling):null;return!0}function oh(){for(var n=Sn;n;)n=Jr(n.nextSibling)}function Ss(){Sn=wn=null,at=!1}function Ru(n){Wn===null?Wn=[n]:Wn.push(n)}var Ev=I.ReactCurrentBatchConfig;function xo(n,i,l){if(n=l.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var f=l.stateNode}if(!f)throw Error(r(147,n));var y=f,v=""+n;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===v?i.ref:(i=function(_){var L=y.refs;_===null?delete L[v]:L[v]=_},i._stringRef=v,i)}if(typeof n!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,n))}return n}function Ml(n,i){throw n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n))}function lh(n){var i=n._init;return i(n._payload)}function ah(n){function i(ee,K){if(n){var te=ee.deletions;te===null?(ee.deletions=[K],ee.flags|=16):te.push(K)}}function l(ee,K){if(!n)return null;for(;K!==null;)i(ee,K),K=K.sibling;return null}function f(ee,K){for(ee=new Map;K!==null;)K.key!==null?ee.set(K.key,K):ee.set(K.index,K),K=K.sibling;return ee}function y(ee,K){return ee=ci(ee,K),ee.index=0,ee.sibling=null,ee}function v(ee,K,te){return ee.index=te,n?(te=ee.alternate,te!==null?(te=te.index,te<K?(ee.flags|=2,K):te):(ee.flags|=2,K)):(ee.flags|=1048576,K)}function _(ee){return n&&ee.alternate===null&&(ee.flags|=2),ee}function L(ee,K,te,ve){return K===null||K.tag!==6?(K=Cc(te,ee.mode,ve),K.return=ee,K):(K=y(K,te),K.return=ee,K)}function X(ee,K,te,ve){var Ie=te.type;return Ie===D?fe(ee,K,te.props.children,ve,te.key):K!==null&&(K.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===$&&lh(Ie)===K.type)?(ve=y(K,te.props),ve.ref=xo(ee,K,te),ve.return=ee,ve):(ve=ra(te.type,te.key,te.props,null,ee.mode,ve),ve.ref=xo(ee,K,te),ve.return=ee,ve)}function ne(ee,K,te,ve){return K===null||K.tag!==4||K.stateNode.containerInfo!==te.containerInfo||K.stateNode.implementation!==te.implementation?(K=jc(te,ee.mode,ve),K.return=ee,K):(K=y(K,te.children||[]),K.return=ee,K)}function fe(ee,K,te,ve,Ie){return K===null||K.tag!==7?(K=Hi(te,ee.mode,ve,Ie),K.return=ee,K):(K=y(K,te),K.return=ee,K)}function pe(ee,K,te){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Cc(""+K,ee.mode,te),K.return=ee,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case B:return te=ra(K.type,K.key,K.props,null,ee.mode,te),te.ref=xo(ee,null,K),te.return=ee,te;case T:return K=jc(K,ee.mode,te),K.return=ee,K;case $:var ve=K._init;return pe(ee,ve(K._payload),te)}if(gt(K)||V(K))return K=Hi(K,ee.mode,te,null),K.return=ee,K;Ml(ee,K)}return null}function de(ee,K,te,ve){var Ie=K!==null?K.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Ie!==null?null:L(ee,K,""+te,ve);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case B:return te.key===Ie?X(ee,K,te,ve):null;case T:return te.key===Ie?ne(ee,K,te,ve):null;case $:return Ie=te._init,de(ee,K,Ie(te._payload),ve)}if(gt(te)||V(te))return Ie!==null?null:fe(ee,K,te,ve,null);Ml(ee,te)}return null}function Se(ee,K,te,ve,Ie){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return ee=ee.get(te)||null,L(K,ee,""+ve,Ie);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case B:return ee=ee.get(ve.key===null?te:ve.key)||null,X(K,ee,ve,Ie);case T:return ee=ee.get(ve.key===null?te:ve.key)||null,ne(K,ee,ve,Ie);case $:var ze=ve._init;return Se(ee,K,te,ze(ve._payload),Ie)}if(gt(ve)||V(ve))return ee=ee.get(te)||null,fe(K,ee,ve,Ie,null);Ml(K,ve)}return null}function Ce(ee,K,te,ve){for(var Ie=null,ze=null,Re=K,De=K=0,Rt=null;Re!==null&&De<te.length;De++){Re.index>De?(Rt=Re,Re=null):Rt=Re.sibling;var Ze=de(ee,Re,te[De],ve);if(Ze===null){Re===null&&(Re=Rt);break}n&&Re&&Ze.alternate===null&&i(ee,Re),K=v(Ze,K,De),ze===null?Ie=Ze:ze.sibling=Ze,ze=Ze,Re=Rt}if(De===te.length)return l(ee,Re),at&&zi(ee,De),Ie;if(Re===null){for(;De<te.length;De++)Re=pe(ee,te[De],ve),Re!==null&&(K=v(Re,K,De),ze===null?Ie=Re:ze.sibling=Re,ze=Re);return at&&zi(ee,De),Ie}for(Re=f(ee,Re);De<te.length;De++)Rt=Se(Re,ee,De,te[De],ve),Rt!==null&&(n&&Rt.alternate!==null&&Re.delete(Rt.key===null?De:Rt.key),K=v(Rt,K,De),ze===null?Ie=Rt:ze.sibling=Rt,ze=Rt);return n&&Re.forEach(function(di){return i(ee,di)}),at&&zi(ee,De),Ie}function je(ee,K,te,ve){var Ie=V(te);if(typeof Ie!="function")throw Error(r(150));if(te=Ie.call(te),te==null)throw Error(r(151));for(var ze=Ie=null,Re=K,De=K=0,Rt=null,Ze=te.next();Re!==null&&!Ze.done;De++,Ze=te.next()){Re.index>De?(Rt=Re,Re=null):Rt=Re.sibling;var di=de(ee,Re,Ze.value,ve);if(di===null){Re===null&&(Re=Rt);break}n&&Re&&di.alternate===null&&i(ee,Re),K=v(di,K,De),ze===null?Ie=di:ze.sibling=di,ze=di,Re=Rt}if(Ze.done)return l(ee,Re),at&&zi(ee,De),Ie;if(Re===null){for(;!Ze.done;De++,Ze=te.next())Ze=pe(ee,Ze.value,ve),Ze!==null&&(K=v(Ze,K,De),ze===null?Ie=Ze:ze.sibling=Ze,ze=Ze);return at&&zi(ee,De),Ie}for(Re=f(ee,Re);!Ze.done;De++,Ze=te.next())Ze=Se(Re,ee,De,Ze.value,ve),Ze!==null&&(n&&Ze.alternate!==null&&Re.delete(Ze.key===null?De:Ze.key),K=v(Ze,K,De),ze===null?Ie=Ze:ze.sibling=Ze,ze=Ze);return n&&Re.forEach(function(rw){return i(ee,rw)}),at&&zi(ee,De),Ie}function wt(ee,K,te,ve){if(typeof te=="object"&&te!==null&&te.type===D&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case B:e:{for(var Ie=te.key,ze=K;ze!==null;){if(ze.key===Ie){if(Ie=te.type,Ie===D){if(ze.tag===7){l(ee,ze.sibling),K=y(ze,te.props.children),K.return=ee,ee=K;break e}}else if(ze.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===$&&lh(Ie)===ze.type){l(ee,ze.sibling),K=y(ze,te.props),K.ref=xo(ee,ze,te),K.return=ee,ee=K;break e}l(ee,ze);break}else i(ee,ze);ze=ze.sibling}te.type===D?(K=Hi(te.props.children,ee.mode,ve,te.key),K.return=ee,ee=K):(ve=ra(te.type,te.key,te.props,null,ee.mode,ve),ve.ref=xo(ee,K,te),ve.return=ee,ee=ve)}return _(ee);case T:e:{for(ze=te.key;K!==null;){if(K.key===ze)if(K.tag===4&&K.stateNode.containerInfo===te.containerInfo&&K.stateNode.implementation===te.implementation){l(ee,K.sibling),K=y(K,te.children||[]),K.return=ee,ee=K;break e}else{l(ee,K);break}else i(ee,K);K=K.sibling}K=jc(te,ee.mode,ve),K.return=ee,ee=K}return _(ee);case $:return ze=te._init,wt(ee,K,ze(te._payload),ve)}if(gt(te))return Ce(ee,K,te,ve);if(V(te))return je(ee,K,te,ve);Ml(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,K!==null&&K.tag===6?(l(ee,K.sibling),K=y(K,te),K.return=ee,ee=K):(l(ee,K),K=Cc(te,ee.mode,ve),K.return=ee,ee=K),_(ee)):l(ee,K)}return wt}var ks=ah(!0),uh=ah(!1),zl=ei(null),Rl=null,Ns=null,Lu=null;function Du(){Lu=Ns=Rl=null}function Fu(n){var i=zl.current;lt(zl),n._currentValue=i}function Ou(n,i,l){for(;n!==null;){var f=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),n===l)break;n=n.return}}function Es(n,i){Rl=n,Lu=Ns=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&i)!==0&&(sn=!0),n.firstContext=null)}function Mn(n){var i=n._currentValue;if(Lu!==n)if(n={context:n,memoizedValue:i,next:null},Ns===null){if(Rl===null)throw Error(r(308));Ns=n,Rl.dependencies={lanes:0,firstContext:n}}else Ns=Ns.next=n;return i}var Ri=null;function $u(n){Ri===null?Ri=[n]:Ri.push(n)}function ch(n,i,l,f){var y=i.interleaved;return y===null?(l.next=l,$u(i)):(l.next=y.next,y.next=l),i.interleaved=l,Ar(n,f)}function Ar(n,i){n.lanes|=i;var l=n.alternate;for(l!==null&&(l.lanes|=i),l=n,n=n.return;n!==null;)n.childLanes|=i,l=n.alternate,l!==null&&(l.childLanes|=i),l=n,n=n.return;return l.tag===3?l.stateNode:null}var ri=!1;function Bu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dh(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Mr(n,i){return{eventTime:n,lane:i,tag:0,payload:null,callback:null,next:null}}function ii(n,i,l){var f=n.updateQueue;if(f===null)return null;if(f=f.shared,(Ge&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,Ar(n,l)}return y=f.interleaved,y===null?(i.next=i,$u(f)):(i.next=y.next,y.next=i),f.interleaved=i,Ar(n,l)}function Ll(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var f=i.lanes;f&=n.pendingLanes,l|=f,i.lanes=l,ls(n,l)}}function fh(n,i){var l=n.updateQueue,f=n.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var y=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var _={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?y=v=_:v=v.next=_,l=l.next}while(l!==null);v===null?y=v=i:v=v.next=i}else y=v=i;l={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:f.shared,effects:f.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}function Dl(n,i,l,f){var y=n.updateQueue;ri=!1;var v=y.firstBaseUpdate,_=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var X=L,ne=X.next;X.next=null,_===null?v=ne:_.next=ne,_=X;var fe=n.alternate;fe!==null&&(fe=fe.updateQueue,L=fe.lastBaseUpdate,L!==_&&(L===null?fe.firstBaseUpdate=ne:L.next=ne,fe.lastBaseUpdate=X))}if(v!==null){var pe=y.baseState;_=0,fe=ne=X=null,L=v;do{var de=L.lane,Se=L.eventTime;if((f&de)===de){fe!==null&&(fe=fe.next={eventTime:Se,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ce=n,je=L;switch(de=i,Se=l,je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){pe=Ce.call(Se,pe,de);break e}pe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,de=typeof Ce=="function"?Ce.call(Se,pe,de):Ce,de==null)break e;pe=j({},pe,de);break e;case 2:ri=!0}}L.callback!==null&&L.lane!==0&&(n.flags|=64,de=y.effects,de===null?y.effects=[L]:de.push(L))}else Se={eventTime:Se,lane:de,tag:L.tag,payload:L.payload,callback:L.callback,next:null},fe===null?(ne=fe=Se,X=pe):fe=fe.next=Se,_|=de;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;de=L,L=de.next,de.next=null,y.lastBaseUpdate=de,y.shared.pending=null}}while(!0);if(fe===null&&(X=pe),y.baseState=X,y.firstBaseUpdate=ne,y.lastBaseUpdate=fe,i=y.shared.interleaved,i!==null){y=i;do _|=y.lane,y=y.next;while(y!==i)}else v===null&&(y.shared.lanes=0);Fi|=_,n.lanes=_,n.memoizedState=pe}}function hh(n,i,l){if(n=i.effects,i.effects=null,n!==null)for(i=0;i<n.length;i++){var f=n[i],y=f.callback;if(y!==null){if(f.callback=null,f=l,typeof y!="function")throw Error(r(191,y));y.call(f)}}}var vo={},ar=ei(vo),wo=ei(vo),So=ei(vo);function Li(n){if(n===vo)throw Error(r(174));return n}function Hu(n,i){switch(nt(So,i),nt(wo,n),nt(ar,vo),n=i.nodeType,n){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:ye(null,"");break;default:n=n===8?i.parentNode:i,i=n.namespaceURI||null,n=n.tagName,i=ye(i,n)}lt(ar),nt(ar,i)}function bs(){lt(ar),lt(wo),lt(So)}function ph(n){Li(So.current);var i=Li(ar.current),l=ye(i,n.type);i!==l&&(nt(wo,n),nt(ar,l))}function Vu(n){wo.current===n&&(lt(ar),lt(wo))}var dt=ei(0);function Fl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Uu=[];function Wu(){for(var n=0;n<Uu.length;n++)Uu[n]._workInProgressVersionPrimary=null;Uu.length=0}var Ol=I.ReactCurrentDispatcher,Yu=I.ReactCurrentBatchConfig,Di=0,ft=null,jt=null,Mt=null,$l=!1,ko=!1,No=0,bv=0;function Wt(){throw Error(r(321))}function Xu(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!Un(n[l],i[l]))return!1;return!0}function qu(n,i,l,f,y,v){if(Di=v,ft=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Ol.current=n===null||n.memoizedState===null?Iv:Tv,n=l(f,y),ko){v=0;do{if(ko=!1,No=0,25<=v)throw Error(r(301));v+=1,Mt=jt=null,i.updateQueue=null,Ol.current=Pv,n=l(f,y)}while(ko)}if(Ol.current=Vl,i=jt!==null&&jt.next!==null,Di=0,Mt=jt=ft=null,$l=!1,i)throw Error(r(300));return n}function Gu(){var n=No!==0;return No=0,n}function ur(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ft.memoizedState=Mt=n:Mt=Mt.next=n,Mt}function zn(){if(jt===null){var n=ft.alternate;n=n!==null?n.memoizedState:null}else n=jt.next;var i=Mt===null?ft.memoizedState:Mt.next;if(i!==null)Mt=i,jt=n;else{if(n===null)throw Error(r(310));jt=n,n={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Mt===null?ft.memoizedState=Mt=n:Mt=Mt.next=n}return Mt}function Eo(n,i){return typeof i=="function"?i(n):i}function Ku(n){var i=zn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var f=jt,y=f.baseQueue,v=l.pending;if(v!==null){if(y!==null){var _=y.next;y.next=v.next,v.next=_}f.baseQueue=y=v,l.pending=null}if(y!==null){v=y.next,f=f.baseState;var L=_=null,X=null,ne=v;do{var fe=ne.lane;if((Di&fe)===fe)X!==null&&(X=X.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),f=ne.hasEagerState?ne.eagerState:n(f,ne.action);else{var pe={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};X===null?(L=X=pe,_=f):X=X.next=pe,ft.lanes|=fe,Fi|=fe}ne=ne.next}while(ne!==null&&ne!==v);X===null?_=f:X.next=L,Un(f,i.memoizedState)||(sn=!0),i.memoizedState=f,i.baseState=_,i.baseQueue=X,l.lastRenderedState=f}if(n=l.interleaved,n!==null){y=n;do v=y.lane,ft.lanes|=v,Fi|=v,y=y.next;while(y!==n)}else y===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Qu(n){var i=zn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var f=l.dispatch,y=l.pending,v=i.memoizedState;if(y!==null){l.pending=null;var _=y=y.next;do v=n(v,_.action),_=_.next;while(_!==y);Un(v,i.memoizedState)||(sn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,f]}function mh(){}function gh(n,i){var l=ft,f=zn(),y=i(),v=!Un(f.memoizedState,y);if(v&&(f.memoizedState=y,sn=!0),f=f.queue,Zu(vh.bind(null,l,f,n),[n]),f.getSnapshot!==i||v||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,bo(9,xh.bind(null,l,f,y,i),void 0,null),zt===null)throw Error(r(349));(Di&30)!==0||yh(l,i,y)}return y}function yh(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=ft.updateQueue,i===null?(i={lastEffect:null,stores:null},ft.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function xh(n,i,l,f){i.value=l,i.getSnapshot=f,wh(i)&&Sh(n)}function vh(n,i,l){return l(function(){wh(i)&&Sh(n)})}function wh(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!Un(n,l)}catch{return!0}}function Sh(n){var i=Ar(n,1);i!==null&&Gn(i,n,1,-1)}function kh(n){var i=ur();return typeof n=="function"&&(n=n()),i.memoizedState=i.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:n},i.queue=n,n=n.dispatch=_v.bind(null,ft,n),[i.memoizedState,n]}function bo(n,i,l,f){return n={tag:n,create:i,destroy:l,deps:f,next:null},i=ft.updateQueue,i===null?(i={lastEffect:null,stores:null},ft.updateQueue=i,i.lastEffect=n.next=n):(l=i.lastEffect,l===null?i.lastEffect=n.next=n:(f=l.next,l.next=n,n.next=f,i.lastEffect=n)),n}function Nh(){return zn().memoizedState}function Bl(n,i,l,f){var y=ur();ft.flags|=n,y.memoizedState=bo(1|i,l,void 0,f===void 0?null:f)}function Hl(n,i,l,f){var y=zn();f=f===void 0?null:f;var v=void 0;if(jt!==null){var _=jt.memoizedState;if(v=_.destroy,f!==null&&Xu(f,_.deps)){y.memoizedState=bo(i,l,v,f);return}}ft.flags|=n,y.memoizedState=bo(1|i,l,v,f)}function Eh(n,i){return Bl(8390656,8,n,i)}function Zu(n,i){return Hl(2048,8,n,i)}function bh(n,i){return Hl(4,2,n,i)}function Ch(n,i){return Hl(4,4,n,i)}function jh(n,i){if(typeof i=="function")return n=n(),i(n),function(){i(null)};if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function _h(n,i,l){return l=l!=null?l.concat([n]):null,Hl(4,4,jh.bind(null,i,n),l)}function Ju(){}function Ih(n,i){var l=zn();i=i===void 0?null:i;var f=l.memoizedState;return f!==null&&i!==null&&Xu(i,f[1])?f[0]:(l.memoizedState=[n,i],n)}function Th(n,i){var l=zn();i=i===void 0?null:i;var f=l.memoizedState;return f!==null&&i!==null&&Xu(i,f[1])?f[0]:(n=n(),l.memoizedState=[n,i],n)}function Ph(n,i,l){return(Di&21)===0?(n.baseState&&(n.baseState=!1,sn=!0),n.memoizedState=l):(Un(l,i)||(l=Gr(),ft.lanes|=l,Fi|=l,n.baseState=!0),i)}function Cv(n,i){var l=Ke;Ke=l!==0&&4>l?l:4,n(!0);var f=Yu.transition;Yu.transition={};try{n(!1),i()}finally{Ke=l,Yu.transition=f}}function Ah(){return zn().memoizedState}function jv(n,i,l){var f=ai(n);if(l={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null},Mh(n))zh(i,l);else if(l=ch(n,i,l,f),l!==null){var y=Zt();Gn(l,n,f,y),Rh(l,i,f)}}function _v(n,i,l){var f=ai(n),y={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null};if(Mh(n))zh(i,y);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var _=i.lastRenderedState,L=v(_,l);if(y.hasEagerState=!0,y.eagerState=L,Un(L,_)){var X=i.interleaved;X===null?(y.next=y,$u(i)):(y.next=X.next,X.next=y),i.interleaved=y;return}}catch{}finally{}l=ch(n,i,y,f),l!==null&&(y=Zt(),Gn(l,n,f,y),Rh(l,i,f))}}function Mh(n){var i=n.alternate;return n===ft||i!==null&&i===ft}function zh(n,i){ko=$l=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Rh(n,i,l){if((l&4194240)!==0){var f=i.lanes;f&=n.pendingLanes,l|=f,i.lanes=l,ls(n,l)}}var Vl={readContext:Mn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},Iv={readContext:Mn,useCallback:function(n,i){return ur().memoizedState=[n,i===void 0?null:i],n},useContext:Mn,useEffect:Eh,useImperativeHandle:function(n,i,l){return l=l!=null?l.concat([n]):null,Bl(4194308,4,jh.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Bl(4194308,4,n,i)},useInsertionEffect:function(n,i){return Bl(4,2,n,i)},useMemo:function(n,i){var l=ur();return i=i===void 0?null:i,n=n(),l.memoizedState=[n,i],n},useReducer:function(n,i,l){var f=ur();return i=l!==void 0?l(i):i,f.memoizedState=f.baseState=i,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:i},f.queue=n,n=n.dispatch=jv.bind(null,ft,n),[f.memoizedState,n]},useRef:function(n){var i=ur();return n={current:n},i.memoizedState=n},useState:kh,useDebugValue:Ju,useDeferredValue:function(n){return ur().memoizedState=n},useTransition:function(){var n=kh(!1),i=n[0];return n=Cv.bind(null,n[1]),ur().memoizedState=n,[i,n]},useMutableSource:function(){},useSyncExternalStore:function(n,i,l){var f=ft,y=ur();if(at){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),zt===null)throw Error(r(349));(Di&30)!==0||yh(f,i,l)}y.memoizedState=l;var v={value:l,getSnapshot:i};return y.queue=v,Eh(vh.bind(null,f,v,n),[n]),f.flags|=2048,bo(9,xh.bind(null,f,v,l,i),void 0,null),l},useId:function(){var n=ur(),i=zt.identifierPrefix;if(at){var l=Pr,f=Tr;l=(f&~(1<<32-Ot(f)-1)).toString(32)+l,i=":"+i+"R"+l,l=No++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=bv++,i=":"+i+"r"+l.toString(32)+":";return n.memoizedState=i},unstable_isNewReconciler:!1},Tv={readContext:Mn,useCallback:Ih,useContext:Mn,useEffect:Zu,useImperativeHandle:_h,useInsertionEffect:bh,useLayoutEffect:Ch,useMemo:Th,useReducer:Ku,useRef:Nh,useState:function(){return Ku(Eo)},useDebugValue:Ju,useDeferredValue:function(n){var i=zn();return Ph(i,jt.memoizedState,n)},useTransition:function(){var n=Ku(Eo)[0],i=zn().memoizedState;return[n,i]},useMutableSource:mh,useSyncExternalStore:gh,useId:Ah,unstable_isNewReconciler:!1},Pv={readContext:Mn,useCallback:Ih,useContext:Mn,useEffect:Zu,useImperativeHandle:_h,useInsertionEffect:bh,useLayoutEffect:Ch,useMemo:Th,useReducer:Qu,useRef:Nh,useState:function(){return Qu(Eo)},useDebugValue:Ju,useDeferredValue:function(n){var i=zn();return jt===null?i.memoizedState=n:Ph(i,jt.memoizedState,n)},useTransition:function(){var n=Qu(Eo)[0],i=zn().memoizedState;return[n,i]},useMutableSource:mh,useSyncExternalStore:gh,useId:Ah,unstable_isNewReconciler:!1};function Yn(n,i){if(n&&n.defaultProps){i=j({},i),n=n.defaultProps;for(var l in n)i[l]===void 0&&(i[l]=n[l]);return i}return i}function ec(n,i,l,f){i=n.memoizedState,l=l(f,i),l=l==null?i:j({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Ul={isMounted:function(n){return(n=n._reactInternals)?Ft(n)===n:!1},enqueueSetState:function(n,i,l){n=n._reactInternals;var f=Zt(),y=ai(n),v=Mr(f,y);v.payload=i,l!=null&&(v.callback=l),i=ii(n,v,y),i!==null&&(Gn(i,n,y,f),Ll(i,n,y))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var f=Zt(),y=ai(n),v=Mr(f,y);v.tag=1,v.payload=i,l!=null&&(v.callback=l),i=ii(n,v,y),i!==null&&(Gn(i,n,y,f),Ll(i,n,y))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Zt(),f=ai(n),y=Mr(l,f);y.tag=2,i!=null&&(y.callback=i),i=ii(n,y,f),i!==null&&(Gn(i,n,f,l),Ll(i,n,f))}};function Lh(n,i,l,f,y,v,_){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(f,v,_):i.prototype&&i.prototype.isPureReactComponent?!co(l,f)||!co(y,v):!0}function Dh(n,i,l){var f=!1,y=ti,v=i.contextType;return typeof v=="object"&&v!==null?v=Mn(v):(y=rn(i)?Ai:Ut.current,f=i.contextTypes,v=(f=f!=null)?xs(n,y):ti),i=new i(l,v),n.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ul,n.stateNode=i,i._reactInternals=n,f&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=y,n.__reactInternalMemoizedMaskedChildContext=v),i}function Fh(n,i,l,f){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==n&&Ul.enqueueReplaceState(i,i.state,null)}function tc(n,i,l,f){var y=n.stateNode;y.props=l,y.state=n.memoizedState,y.refs={},Bu(n);var v=i.contextType;typeof v=="object"&&v!==null?y.context=Mn(v):(v=rn(i)?Ai:Ut.current,y.context=xs(n,v)),y.state=n.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(ec(n,i,v,l),y.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(i=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),i!==y.state&&Ul.enqueueReplaceState(y,y.state,null),Dl(n,l,y,f),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308)}function Cs(n,i){try{var l="",f=i;do l+=re(f),f=f.return;while(f);var y=l}catch(v){y=`
|
|
39
|
+
Error generating stack: `+v.message+`
|
|
40
|
+
`+v.stack}return{value:n,source:i,stack:y,digest:null}}function nc(n,i,l){return{value:n,source:null,stack:l??null,digest:i??null}}function rc(n,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var Av=typeof WeakMap=="function"?WeakMap:Map;function Oh(n,i,l){l=Mr(-1,l),l.tag=3,l.payload={element:null};var f=i.value;return l.callback=function(){Ql||(Ql=!0,xc=f),rc(n,i)},l}function $h(n,i,l){l=Mr(-1,l),l.tag=3;var f=n.type.getDerivedStateFromError;if(typeof f=="function"){var y=i.value;l.payload=function(){return f(y)},l.callback=function(){rc(n,i)}}var v=n.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(l.callback=function(){rc(n,i),typeof f!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function Bh(n,i,l){var f=n.pingCache;if(f===null){f=n.pingCache=new Av;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(l)||(y.add(l),n=Yv.bind(null,n,i,l),i.then(n,n))}function Hh(n){do{var i;if((i=n.tag===13)&&(i=n.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return n;n=n.return}while(n!==null);return null}function Vh(n,i,l,f,y){return(n.mode&1)===0?(n===i?n.flags|=65536:(n.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=Mr(-1,1),i.tag=2,ii(l,i,1))),l.lanes|=1),n):(n.flags|=65536,n.lanes=y,n)}var Mv=I.ReactCurrentOwner,sn=!1;function Qt(n,i,l,f){i.child=n===null?uh(i,null,l,f):ks(i,n.child,l,f)}function Uh(n,i,l,f,y){l=l.render;var v=i.ref;return Es(i,y),f=qu(n,i,l,f,v,y),l=Gu(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~y,zr(n,i,y)):(at&&l&&Pu(i),i.flags|=1,Qt(n,i,f,y),i.child)}function Wh(n,i,l,f,y){if(n===null){var v=l.type;return typeof v=="function"&&!bc(v)&&v.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=v,Yh(n,i,v,f,y)):(n=ra(l.type,null,f,i,i.mode,y),n.ref=i.ref,n.return=i,i.child=n)}if(v=n.child,(n.lanes&y)===0){var _=v.memoizedProps;if(l=l.compare,l=l!==null?l:co,l(_,f)&&n.ref===i.ref)return zr(n,i,y)}return i.flags|=1,n=ci(v,f),n.ref=i.ref,n.return=i,i.child=n}function Yh(n,i,l,f,y){if(n!==null){var v=n.memoizedProps;if(co(v,f)&&n.ref===i.ref)if(sn=!1,i.pendingProps=f=v,(n.lanes&y)!==0)(n.flags&131072)!==0&&(sn=!0);else return i.lanes=n.lanes,zr(n,i,y)}return ic(n,i,l,f,y)}function Xh(n,i,l){var f=i.pendingProps,y=f.children,v=n!==null?n.memoizedState:null;if(f.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(_s,kn),kn|=l;else{if((l&1073741824)===0)return n=v!==null?v.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:n,cachePool:null,transitions:null},i.updateQueue=null,nt(_s,kn),kn|=n,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=v!==null?v.baseLanes:l,nt(_s,kn),kn|=f}else v!==null?(f=v.baseLanes|l,i.memoizedState=null):f=l,nt(_s,kn),kn|=f;return Qt(n,i,y,l),i.child}function qh(n,i){var l=i.ref;(n===null&&l!==null||n!==null&&n.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function ic(n,i,l,f,y){var v=rn(l)?Ai:Ut.current;return v=xs(i,v),Es(i,y),l=qu(n,i,l,f,v,y),f=Gu(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~y,zr(n,i,y)):(at&&f&&Pu(i),i.flags|=1,Qt(n,i,l,y),i.child)}function Gh(n,i,l,f,y){if(rn(l)){var v=!0;_l(i)}else v=!1;if(Es(i,y),i.stateNode===null)Yl(n,i),Dh(i,l,f),tc(i,l,f,y),f=!0;else if(n===null){var _=i.stateNode,L=i.memoizedProps;_.props=L;var X=_.context,ne=l.contextType;typeof ne=="object"&&ne!==null?ne=Mn(ne):(ne=rn(l)?Ai:Ut.current,ne=xs(i,ne));var fe=l.getDerivedStateFromProps,pe=typeof fe=="function"||typeof _.getSnapshotBeforeUpdate=="function";pe||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(L!==f||X!==ne)&&Fh(i,_,f,ne),ri=!1;var de=i.memoizedState;_.state=de,Dl(i,f,_,y),X=i.memoizedState,L!==f||de!==X||nn.current||ri?(typeof fe=="function"&&(ec(i,l,fe,f),X=i.memoizedState),(L=ri||Lh(i,l,L,f,de,X,ne))?(pe||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=X),_.props=f,_.state=X,_.context=ne,f=L):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{_=i.stateNode,dh(n,i),L=i.memoizedProps,ne=i.type===i.elementType?L:Yn(i.type,L),_.props=ne,pe=i.pendingProps,de=_.context,X=l.contextType,typeof X=="object"&&X!==null?X=Mn(X):(X=rn(l)?Ai:Ut.current,X=xs(i,X));var Se=l.getDerivedStateFromProps;(fe=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(L!==pe||de!==X)&&Fh(i,_,f,X),ri=!1,de=i.memoizedState,_.state=de,Dl(i,f,_,y);var Ce=i.memoizedState;L!==pe||de!==Ce||nn.current||ri?(typeof Se=="function"&&(ec(i,l,Se,f),Ce=i.memoizedState),(ne=ri||Lh(i,l,ne,f,de,Ce,X)||!1)?(fe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(f,Ce,X),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(f,Ce,X)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||L===n.memoizedProps&&de===n.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||L===n.memoizedProps&&de===n.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=Ce),_.props=f,_.state=Ce,_.context=X,f=ne):(typeof _.componentDidUpdate!="function"||L===n.memoizedProps&&de===n.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||L===n.memoizedProps&&de===n.memoizedState||(i.flags|=1024),f=!1)}return sc(n,i,l,f,v,y)}function sc(n,i,l,f,y,v){qh(n,i);var _=(i.flags&128)!==0;if(!f&&!_)return y&&eh(i,l,!1),zr(n,i,v);f=i.stateNode,Mv.current=i;var L=_&&typeof l.getDerivedStateFromError!="function"?null:f.render();return i.flags|=1,n!==null&&_?(i.child=ks(i,n.child,null,v),i.child=ks(i,null,L,v)):Qt(n,i,L,v),i.memoizedState=f.state,y&&eh(i,l,!0),i.child}function Kh(n){var i=n.stateNode;i.pendingContext?Zf(n,i.pendingContext,i.pendingContext!==i.context):i.context&&Zf(n,i.context,!1),Hu(n,i.containerInfo)}function Qh(n,i,l,f,y){return Ss(),Ru(y),i.flags|=256,Qt(n,i,l,f),i.child}var oc={dehydrated:null,treeContext:null,retryLane:0};function lc(n){return{baseLanes:n,cachePool:null,transitions:null}}function Zh(n,i,l){var f=i.pendingProps,y=dt.current,v=!1,_=(i.flags&128)!==0,L;if((L=_)||(L=n!==null&&n.memoizedState===null?!1:(y&2)!==0),L?(v=!0,i.flags&=-129):(n===null||n.memoizedState!==null)&&(y|=1),nt(dt,y&1),n===null)return zu(i),n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((i.mode&1)===0?i.lanes=1:n.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(_=f.children,n=f.fallback,v?(f=i.mode,v=i.child,_={mode:"hidden",children:_},(f&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=_):v=ia(_,f,0,null),n=Hi(n,f,l,null),v.return=i,n.return=i,v.sibling=n,i.child=v,i.child.memoizedState=lc(l),i.memoizedState=oc,n):ac(i,_));if(y=n.memoizedState,y!==null&&(L=y.dehydrated,L!==null))return zv(n,i,_,f,L,y,l);if(v){v=f.fallback,_=i.mode,y=n.child,L=y.sibling;var X={mode:"hidden",children:f.children};return(_&1)===0&&i.child!==y?(f=i.child,f.childLanes=0,f.pendingProps=X,i.deletions=null):(f=ci(y,X),f.subtreeFlags=y.subtreeFlags&14680064),L!==null?v=ci(L,v):(v=Hi(v,_,l,null),v.flags|=2),v.return=i,f.return=i,f.sibling=v,i.child=f,f=v,v=i.child,_=n.child.memoizedState,_=_===null?lc(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},v.memoizedState=_,v.childLanes=n.childLanes&~l,i.memoizedState=oc,f}return v=n.child,n=v.sibling,f=ci(v,{mode:"visible",children:f.children}),(i.mode&1)===0&&(f.lanes=l),f.return=i,f.sibling=null,n!==null&&(l=i.deletions,l===null?(i.deletions=[n],i.flags|=16):l.push(n)),i.child=f,i.memoizedState=null,f}function ac(n,i){return i=ia({mode:"visible",children:i},n.mode,0,null),i.return=n,n.child=i}function Wl(n,i,l,f){return f!==null&&Ru(f),ks(i,n.child,null,l),n=ac(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function zv(n,i,l,f,y,v,_){if(l)return i.flags&256?(i.flags&=-257,f=nc(Error(r(422))),Wl(n,i,_,f)):i.memoizedState!==null?(i.child=n.child,i.flags|=128,null):(v=f.fallback,y=i.mode,f=ia({mode:"visible",children:f.children},y,0,null),v=Hi(v,y,_,null),v.flags|=2,f.return=i,v.return=i,f.sibling=v,i.child=f,(i.mode&1)!==0&&ks(i,n.child,null,_),i.child.memoizedState=lc(_),i.memoizedState=oc,v);if((i.mode&1)===0)return Wl(n,i,_,null);if(y.data==="$!"){if(f=y.nextSibling&&y.nextSibling.dataset,f)var L=f.dgst;return f=L,v=Error(r(419)),f=nc(v,f,void 0),Wl(n,i,_,f)}if(L=(_&n.childLanes)!==0,sn||L){if(f=zt,f!==null){switch(_&-_){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&(f.suspendedLanes|_))!==0?0:y,y!==0&&y!==v.retryLane&&(v.retryLane=y,Ar(n,y),Gn(f,n,y,-1))}return Ec(),f=nc(Error(r(421))),Wl(n,i,_,f)}return y.data==="$?"?(i.flags|=128,i.child=n.child,i=Xv.bind(null,n),y._reactRetry=i,null):(n=v.treeContext,Sn=Jr(y.nextSibling),wn=i,at=!0,Wn=null,n!==null&&(Pn[An++]=Tr,Pn[An++]=Pr,Pn[An++]=Mi,Tr=n.id,Pr=n.overflow,Mi=i),i=ac(i,f.children),i.flags|=4096,i)}function Jh(n,i,l){n.lanes|=i;var f=n.alternate;f!==null&&(f.lanes|=i),Ou(n.return,i,l)}function uc(n,i,l,f,y){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:y}:(v.isBackwards=i,v.rendering=null,v.renderingStartTime=0,v.last=f,v.tail=l,v.tailMode=y)}function ep(n,i,l){var f=i.pendingProps,y=f.revealOrder,v=f.tail;if(Qt(n,i,f.children,l),f=dt.current,(f&2)!==0)f=f&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Jh(n,l,i);else if(n.tag===19)Jh(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}f&=1}if(nt(dt,f),(i.mode&1)===0)i.memoizedState=null;else switch(y){case"forwards":for(l=i.child,y=null;l!==null;)n=l.alternate,n!==null&&Fl(n)===null&&(y=l),l=l.sibling;l=y,l===null?(y=i.child,i.child=null):(y=l.sibling,l.sibling=null),uc(i,!1,y,l,v);break;case"backwards":for(l=null,y=i.child,i.child=null;y!==null;){if(n=y.alternate,n!==null&&Fl(n)===null){i.child=y;break}n=y.sibling,y.sibling=l,l=y,y=n}uc(i,!0,l,null,v);break;case"together":uc(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Yl(n,i){(i.mode&1)===0&&n!==null&&(n.alternate=null,i.alternate=null,i.flags|=2)}function zr(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Fi|=i.lanes,(l&i.childLanes)===0)return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=ci(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=ci(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Rv(n,i,l){switch(i.tag){case 3:Kh(i),Ss();break;case 5:ph(i);break;case 1:rn(i.type)&&_l(i);break;case 4:Hu(i,i.stateNode.containerInfo);break;case 10:var f=i.type._context,y=i.memoizedProps.value;nt(zl,f._currentValue),f._currentValue=y;break;case 13:if(f=i.memoizedState,f!==null)return f.dehydrated!==null?(nt(dt,dt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?Zh(n,i,l):(nt(dt,dt.current&1),n=zr(n,i,l),n!==null?n.sibling:null);nt(dt,dt.current&1);break;case 19:if(f=(l&i.childLanes)!==0,(n.flags&128)!==0){if(f)return ep(n,i,l);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),nt(dt,dt.current),f)break;return null;case 22:case 23:return i.lanes=0,Xh(n,i,l)}return zr(n,i,l)}var tp,cc,np,rp;tp=function(n,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},cc=function(){},np=function(n,i,l,f){var y=n.memoizedProps;if(y!==f){n=i.stateNode,Li(ar.current);var v=null;switch(l){case"input":y=Ve(n,y),f=Ve(n,f),v=[];break;case"select":y=j({},y,{value:void 0}),f=j({},f,{value:void 0}),v=[];break;case"textarea":y=Ht(n,y),f=Ht(n,f),v=[];break;default:typeof y.onClick!="function"&&typeof f.onClick=="function"&&(n.onclick=bl)}pt(l,f);var _;l=null;for(ne in y)if(!f.hasOwnProperty(ne)&&y.hasOwnProperty(ne)&&y[ne]!=null)if(ne==="style"){var L=y[ne];for(_ in L)L.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?v||(v=[]):(v=v||[]).push(ne,null));for(ne in f){var X=f[ne];if(L=y!=null?y[ne]:void 0,f.hasOwnProperty(ne)&&X!==L&&(X!=null||L!=null))if(ne==="style")if(L){for(_ in L)!L.hasOwnProperty(_)||X&&X.hasOwnProperty(_)||(l||(l={}),l[_]="");for(_ in X)X.hasOwnProperty(_)&&L[_]!==X[_]&&(l||(l={}),l[_]=X[_])}else l||(v||(v=[]),v.push(ne,l)),l=X;else ne==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,L=L?L.__html:void 0,X!=null&&L!==X&&(v=v||[]).push(ne,X)):ne==="children"?typeof X!="string"&&typeof X!="number"||(v=v||[]).push(ne,""+X):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(X!=null&&ne==="onScroll"&&ot("scroll",n),v||L===X||(v=[])):(v=v||[]).push(ne,X))}l&&(v=v||[]).push("style",l);var ne=v;(i.updateQueue=ne)&&(i.flags|=4)}},rp=function(n,i,l,f){l!==f&&(i.flags|=4)};function Co(n,i){if(!at)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:f.sibling=null}}function Yt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,f=0;if(i)for(var y=n.child;y!==null;)l|=y.lanes|y.childLanes,f|=y.subtreeFlags&14680064,f|=y.flags&14680064,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)l|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=f,n.childLanes=l,i}function Lv(n,i,l){var f=i.pendingProps;switch(Au(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(i),null;case 1:return rn(i.type)&&jl(),Yt(i),null;case 3:return f=i.stateNode,bs(),lt(nn),lt(Ut),Wu(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(n===null||n.child===null)&&(Al(i)?i.flags|=4:n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wn!==null&&(Sc(Wn),Wn=null))),cc(n,i),Yt(i),null;case 5:Vu(i);var y=Li(So.current);if(l=i.type,n!==null&&i.stateNode!=null)np(n,i,l,f,y),n.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!f){if(i.stateNode===null)throw Error(r(166));return Yt(i),null}if(n=Li(ar.current),Al(i)){f=i.stateNode,l=i.type;var v=i.memoizedProps;switch(f[lr]=i,f[go]=v,n=(i.mode&1)!==0,l){case"dialog":ot("cancel",f),ot("close",f);break;case"iframe":case"object":case"embed":ot("load",f);break;case"video":case"audio":for(y=0;y<ho.length;y++)ot(ho[y],f);break;case"source":ot("error",f);break;case"img":case"image":case"link":ot("error",f),ot("load",f);break;case"details":ot("toggle",f);break;case"input":We(f,v),ot("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!v.multiple},ot("invalid",f);break;case"textarea":pn(f,v),ot("invalid",f)}pt(l,v),y=null;for(var _ in v)if(v.hasOwnProperty(_)){var L=v[_];_==="children"?typeof L=="string"?f.textContent!==L&&(v.suppressHydrationWarning!==!0&&El(f.textContent,L,n),y=["children",L]):typeof L=="number"&&f.textContent!==""+L&&(v.suppressHydrationWarning!==!0&&El(f.textContent,L,n),y=["children",""+L]):o.hasOwnProperty(_)&&L!=null&&_==="onScroll"&&ot("scroll",f)}switch(l){case"input":Pe(f),It(f,v,!0);break;case"textarea":Pe(f),Jt(f);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(f.onclick=bl)}f=y,i.updateQueue=f,f!==null&&(i.flags|=4)}else{_=y.nodeType===9?y:y.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=oe(l)),n==="http://www.w3.org/1999/xhtml"?l==="script"?(n=_.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof f.is=="string"?n=_.createElement(l,{is:f.is}):(n=_.createElement(l),l==="select"&&(_=n,f.multiple?_.multiple=!0:f.size&&(_.size=f.size))):n=_.createElementNS(n,l),n[lr]=i,n[go]=f,tp(n,i,!1,!1),i.stateNode=n;e:{switch(_=en(l,f),l){case"dialog":ot("cancel",n),ot("close",n),y=f;break;case"iframe":case"object":case"embed":ot("load",n),y=f;break;case"video":case"audio":for(y=0;y<ho.length;y++)ot(ho[y],n);y=f;break;case"source":ot("error",n),y=f;break;case"img":case"image":case"link":ot("error",n),ot("load",n),y=f;break;case"details":ot("toggle",n),y=f;break;case"input":We(n,f),y=Ve(n,f),ot("invalid",n);break;case"option":y=f;break;case"select":n._wrapperState={wasMultiple:!!f.multiple},y=j({},f,{value:void 0}),ot("invalid",n);break;case"textarea":pn(n,f),y=Ht(n,f),ot("invalid",n);break;default:y=f}pt(l,y),L=y;for(v in L)if(L.hasOwnProperty(v)){var X=L[v];v==="style"?yt(n,X):v==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&$e(n,X)):v==="children"?typeof X=="string"?(l!=="textarea"||X!=="")&&Be(n,X):typeof X=="number"&&Be(n,""+X):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(o.hasOwnProperty(v)?X!=null&&v==="onScroll"&&ot("scroll",n):X!=null&&N(n,v,X,_))}switch(l){case"input":Pe(n),It(n,f,!1);break;case"textarea":Pe(n),Jt(n);break;case"option":f.value!=null&&n.setAttribute("value",""+se(f.value));break;case"select":n.multiple=!!f.multiple,v=f.value,v!=null?Tt(n,!!f.multiple,v,!1):f.defaultValue!=null&&Tt(n,!!f.multiple,f.defaultValue,!0);break;default:typeof y.onClick=="function"&&(n.onclick=bl)}switch(l){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Yt(i),null;case 6:if(n&&i.stateNode!=null)rp(n,i,n.memoizedProps,f);else{if(typeof f!="string"&&i.stateNode===null)throw Error(r(166));if(l=Li(So.current),Li(ar.current),Al(i)){if(f=i.stateNode,l=i.memoizedProps,f[lr]=i,(v=f.nodeValue!==l)&&(n=wn,n!==null))switch(n.tag){case 3:El(f.nodeValue,l,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&El(f.nodeValue,l,(n.mode&1)!==0)}v&&(i.flags|=4)}else f=(l.nodeType===9?l:l.ownerDocument).createTextNode(f),f[lr]=i,i.stateNode=f}return Yt(i),null;case 13:if(lt(dt),f=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(at&&Sn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)oh(),Ss(),i.flags|=98560,v=!1;else if(v=Al(i),f!==null&&f.dehydrated!==null){if(n===null){if(!v)throw Error(r(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[lr]=i}else Ss(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Yt(i),v=!1}else Wn!==null&&(Sc(Wn),Wn=null),v=!0;if(!v)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(f=f!==null,f!==(n!==null&&n.memoizedState!==null)&&f&&(i.child.flags|=8192,(i.mode&1)!==0&&(n===null||(dt.current&1)!==0?_t===0&&(_t=3):Ec())),i.updateQueue!==null&&(i.flags|=4),Yt(i),null);case 4:return bs(),cc(n,i),n===null&&po(i.stateNode.containerInfo),Yt(i),null;case 10:return Fu(i.type._context),Yt(i),null;case 17:return rn(i.type)&&jl(),Yt(i),null;case 19:if(lt(dt),v=i.memoizedState,v===null)return Yt(i),null;if(f=(i.flags&128)!==0,_=v.rendering,_===null)if(f)Co(v,!1);else{if(_t!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(_=Fl(n),_!==null){for(i.flags|=128,Co(v,!1),f=_.updateQueue,f!==null&&(i.updateQueue=f,i.flags|=4),i.subtreeFlags=0,f=l,l=i.child;l!==null;)v=l,n=f,v.flags&=14680066,_=v.alternate,_===null?(v.childLanes=0,v.lanes=n,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=_.childLanes,v.lanes=_.lanes,v.child=_.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=_.memoizedProps,v.memoizedState=_.memoizedState,v.updateQueue=_.updateQueue,v.type=_.type,n=_.dependencies,v.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),l=l.sibling;return nt(dt,dt.current&1|2),i.child}n=n.sibling}v.tail!==null&&st()>Is&&(i.flags|=128,f=!0,Co(v,!1),i.lanes=4194304)}else{if(!f)if(n=Fl(_),n!==null){if(i.flags|=128,f=!0,l=n.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),Co(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!at)return Yt(i),null}else 2*st()-v.renderingStartTime>Is&&l!==1073741824&&(i.flags|=128,f=!0,Co(v,!1),i.lanes=4194304);v.isBackwards?(_.sibling=i.child,i.child=_):(l=v.last,l!==null?l.sibling=_:i.child=_,v.last=_)}return v.tail!==null?(i=v.tail,v.rendering=i,v.tail=i.sibling,v.renderingStartTime=st(),i.sibling=null,l=dt.current,nt(dt,f?l&1|2:l&1),i):(Yt(i),null);case 22:case 23:return Nc(),f=i.memoizedState!==null,n!==null&&n.memoizedState!==null!==f&&(i.flags|=8192),f&&(i.mode&1)!==0?(kn&1073741824)!==0&&(Yt(i),i.subtreeFlags&6&&(i.flags|=8192)):Yt(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function Dv(n,i){switch(Au(i),i.tag){case 1:return rn(i.type)&&jl(),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return bs(),lt(nn),lt(Ut),Wu(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 5:return Vu(i),null;case 13:if(lt(dt),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Ss()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return lt(dt),null;case 4:return bs(),null;case 10:return Fu(i.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var Xl=!1,Xt=!1,Fv=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function js(n,i){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(f){mt(n,i,f)}else l.current=null}function dc(n,i,l){try{l()}catch(f){mt(n,i,f)}}var ip=!1;function Ov(n,i){if(Nu=vt,n=Lf(),mu(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var y=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,L=-1,X=-1,ne=0,fe=0,pe=n,de=null;t:for(;;){for(var Se;pe!==l||y!==0&&pe.nodeType!==3||(L=_+y),pe!==v||f!==0&&pe.nodeType!==3||(X=_+f),pe.nodeType===3&&(_+=pe.nodeValue.length),(Se=pe.firstChild)!==null;)de=pe,pe=Se;for(;;){if(pe===n)break t;if(de===l&&++ne===y&&(L=_),de===v&&++fe===f&&(X=_),(Se=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=Se}l=L===-1||X===-1?null:{start:L,end:X}}else l=null}l=l||{start:0,end:0}}else l=null;for(Eu={focusedElem:n,selectionRange:l},vt=!1,Ne=i;Ne!==null;)if(i=Ne,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Ne=n;else for(;Ne!==null;){i=Ne;try{var Ce=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var je=Ce.memoizedProps,wt=Ce.memoizedState,ee=i.stateNode,K=ee.getSnapshotBeforeUpdate(i.elementType===i.type?je:Yn(i.type,je),wt);ee.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var te=i.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ve){mt(i,i.return,ve)}if(n=i.sibling,n!==null){n.return=i.return,Ne=n;break}Ne=i.return}return Ce=ip,ip=!1,Ce}function jo(n,i,l){var f=i.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&n)===n){var v=y.destroy;y.destroy=void 0,v!==void 0&&dc(i,l,v)}y=y.next}while(y!==f)}}function ql(n,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&n)===n){var f=l.create;l.destroy=f()}l=l.next}while(l!==i)}}function fc(n){var i=n.ref;if(i!==null){var l=n.stateNode;switch(n.tag){case 5:n=l;break;default:n=l}typeof i=="function"?i(n):i.current=n}}function sp(n){var i=n.alternate;i!==null&&(n.alternate=null,sp(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&(delete i[lr],delete i[go],delete i[_u],delete i[Sv],delete i[kv])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function op(n){return n.tag===5||n.tag===3||n.tag===4}function lp(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||op(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function hc(n,i,l){var f=n.tag;if(f===5||f===6)n=n.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(n,i):l.insertBefore(n,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(n,l)):(i=l,i.appendChild(n)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=bl));else if(f!==4&&(n=n.child,n!==null))for(hc(n,i,l),n=n.sibling;n!==null;)hc(n,i,l),n=n.sibling}function pc(n,i,l){var f=n.tag;if(f===5||f===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(f!==4&&(n=n.child,n!==null))for(pc(n,i,l),n=n.sibling;n!==null;)pc(n,i,l),n=n.sibling}var $t=null,Xn=!1;function si(n,i,l){for(l=l.child;l!==null;)ap(n,i,l),l=l.sibling}function ap(n,i,l){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(br,l)}catch{}switch(l.tag){case 5:Xt||js(l,i);case 6:var f=$t,y=Xn;$t=null,si(n,i,l),$t=f,Xn=y,$t!==null&&(Xn?(n=$t,l=l.stateNode,n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)):$t.removeChild(l.stateNode));break;case 18:$t!==null&&(Xn?(n=$t,l=l.stateNode,n.nodeType===8?ju(n.parentNode,l):n.nodeType===1&&ju(n,l),Ye(n)):ju($t,l.stateNode));break;case 4:f=$t,y=Xn,$t=l.stateNode.containerInfo,Xn=!0,si(n,i,l),$t=f,Xn=y;break;case 0:case 11:case 14:case 15:if(!Xt&&(f=l.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){y=f=f.next;do{var v=y,_=v.destroy;v=v.tag,_!==void 0&&((v&2)!==0||(v&4)!==0)&&dc(l,i,_),y=y.next}while(y!==f)}si(n,i,l);break;case 1:if(!Xt&&(js(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=l.memoizedProps,f.state=l.memoizedState,f.componentWillUnmount()}catch(L){mt(l,i,L)}si(n,i,l);break;case 21:si(n,i,l);break;case 22:l.mode&1?(Xt=(f=Xt)||l.memoizedState!==null,si(n,i,l),Xt=f):si(n,i,l);break;default:si(n,i,l)}}function up(n){var i=n.updateQueue;if(i!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new Fv),i.forEach(function(f){var y=qv.bind(null,n,f);l.has(f)||(l.add(f),f.then(y,y))})}}function qn(n,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var y=l[f];try{var v=n,_=i,L=_;e:for(;L!==null;){switch(L.tag){case 5:$t=L.stateNode,Xn=!1;break e;case 3:$t=L.stateNode.containerInfo,Xn=!0;break e;case 4:$t=L.stateNode.containerInfo,Xn=!0;break e}L=L.return}if($t===null)throw Error(r(160));ap(v,_,y),$t=null,Xn=!1;var X=y.alternate;X!==null&&(X.return=null),y.return=null}catch(ne){mt(y,i,ne)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)cp(i,n),i=i.sibling}function cp(n,i){var l=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(qn(i,n),cr(n),f&4){try{jo(3,n,n.return),ql(3,n)}catch(je){mt(n,n.return,je)}try{jo(5,n,n.return)}catch(je){mt(n,n.return,je)}}break;case 1:qn(i,n),cr(n),f&512&&l!==null&&js(l,l.return);break;case 5:if(qn(i,n),cr(n),f&512&&l!==null&&js(l,l.return),n.flags&32){var y=n.stateNode;try{Be(y,"")}catch(je){mt(n,n.return,je)}}if(f&4&&(y=n.stateNode,y!=null)){var v=n.memoizedProps,_=l!==null?l.memoizedProps:v,L=n.type,X=n.updateQueue;if(n.updateQueue=null,X!==null)try{L==="input"&&v.type==="radio"&&v.name!=null&&Oe(y,v),en(L,_);var ne=en(L,v);for(_=0;_<X.length;_+=2){var fe=X[_],pe=X[_+1];fe==="style"?yt(y,pe):fe==="dangerouslySetInnerHTML"?$e(y,pe):fe==="children"?Be(y,pe):N(y,fe,pe,ne)}switch(L){case"input":tt(y,v);break;case"textarea":mn(y,v);break;case"select":var de=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!v.multiple;var Se=v.value;Se!=null?Tt(y,!!v.multiple,Se,!1):de!==!!v.multiple&&(v.defaultValue!=null?Tt(y,!!v.multiple,v.defaultValue,!0):Tt(y,!!v.multiple,v.multiple?[]:"",!1))}y[go]=v}catch(je){mt(n,n.return,je)}}break;case 6:if(qn(i,n),cr(n),f&4){if(n.stateNode===null)throw Error(r(162));y=n.stateNode,v=n.memoizedProps;try{y.nodeValue=v}catch(je){mt(n,n.return,je)}}break;case 3:if(qn(i,n),cr(n),f&4&&l!==null&&l.memoizedState.isDehydrated)try{Ye(i.containerInfo)}catch(je){mt(n,n.return,je)}break;case 4:qn(i,n),cr(n);break;case 13:qn(i,n),cr(n),y=n.child,y.flags&8192&&(v=y.memoizedState!==null,y.stateNode.isHidden=v,!v||y.alternate!==null&&y.alternate.memoizedState!==null||(yc=st())),f&4&&up(n);break;case 22:if(fe=l!==null&&l.memoizedState!==null,n.mode&1?(Xt=(ne=Xt)||fe,qn(i,n),Xt=ne):qn(i,n),cr(n),f&8192){if(ne=n.memoizedState!==null,(n.stateNode.isHidden=ne)&&!fe&&(n.mode&1)!==0)for(Ne=n,fe=n.child;fe!==null;){for(pe=Ne=fe;Ne!==null;){switch(de=Ne,Se=de.child,de.tag){case 0:case 11:case 14:case 15:jo(4,de,de.return);break;case 1:js(de,de.return);var Ce=de.stateNode;if(typeof Ce.componentWillUnmount=="function"){f=de,l=de.return;try{i=f,Ce.props=i.memoizedProps,Ce.state=i.memoizedState,Ce.componentWillUnmount()}catch(je){mt(f,l,je)}}break;case 5:js(de,de.return);break;case 22:if(de.memoizedState!==null){hp(pe);continue}}Se!==null?(Se.return=de,Ne=Se):hp(pe)}fe=fe.sibling}e:for(fe=null,pe=n;;){if(pe.tag===5){if(fe===null){fe=pe;try{y=pe.stateNode,ne?(v=y.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(L=pe.stateNode,X=pe.memoizedProps.style,_=X!=null&&X.hasOwnProperty("display")?X.display:null,L.style.display=Pt("display",_))}catch(je){mt(n,n.return,je)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=ne?"":pe.memoizedProps}catch(je){mt(n,n.return,je)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===n)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===n)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===n)break e;fe===pe&&(fe=null),pe=pe.return}fe===pe&&(fe=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:qn(i,n),cr(n),f&4&&up(n);break;case 21:break;default:qn(i,n),cr(n)}}function cr(n){var i=n.flags;if(i&2){try{e:{for(var l=n.return;l!==null;){if(op(l)){var f=l;break e}l=l.return}throw Error(r(160))}switch(f.tag){case 5:var y=f.stateNode;f.flags&32&&(Be(y,""),f.flags&=-33);var v=lp(n);pc(n,v,y);break;case 3:case 4:var _=f.stateNode.containerInfo,L=lp(n);hc(n,L,_);break;default:throw Error(r(161))}}catch(X){mt(n,n.return,X)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function $v(n,i,l){Ne=n,dp(n)}function dp(n,i,l){for(var f=(n.mode&1)!==0;Ne!==null;){var y=Ne,v=y.child;if(y.tag===22&&f){var _=y.memoizedState!==null||Xl;if(!_){var L=y.alternate,X=L!==null&&L.memoizedState!==null||Xt;L=Xl;var ne=Xt;if(Xl=_,(Xt=X)&&!ne)for(Ne=y;Ne!==null;)_=Ne,X=_.child,_.tag===22&&_.memoizedState!==null?pp(y):X!==null?(X.return=_,Ne=X):pp(y);for(;v!==null;)Ne=v,dp(v),v=v.sibling;Ne=y,Xl=L,Xt=ne}fp(n)}else(y.subtreeFlags&8772)!==0&&v!==null?(v.return=y,Ne=v):fp(n)}}function fp(n){for(;Ne!==null;){var i=Ne;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Xt||ql(5,i);break;case 1:var f=i.stateNode;if(i.flags&4&&!Xt)if(l===null)f.componentDidMount();else{var y=i.elementType===i.type?l.memoizedProps:Yn(i.type,l.memoizedProps);f.componentDidUpdate(y,l.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var v=i.updateQueue;v!==null&&hh(i,v,f);break;case 3:var _=i.updateQueue;if(_!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}hh(i,_,l)}break;case 5:var L=i.stateNode;if(l===null&&i.flags&4){l=L;var X=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&l.focus();break;case"img":X.src&&(l.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var ne=i.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var pe=fe.dehydrated;pe!==null&&Ye(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Xt||i.flags&512&&fc(i)}catch(de){mt(i,i.return,de)}}if(i===n){Ne=null;break}if(l=i.sibling,l!==null){l.return=i.return,Ne=l;break}Ne=i.return}}function hp(n){for(;Ne!==null;){var i=Ne;if(i===n){Ne=null;break}var l=i.sibling;if(l!==null){l.return=i.return,Ne=l;break}Ne=i.return}}function pp(n){for(;Ne!==null;){var i=Ne;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{ql(4,i)}catch(X){mt(i,l,X)}break;case 1:var f=i.stateNode;if(typeof f.componentDidMount=="function"){var y=i.return;try{f.componentDidMount()}catch(X){mt(i,y,X)}}var v=i.return;try{fc(i)}catch(X){mt(i,v,X)}break;case 5:var _=i.return;try{fc(i)}catch(X){mt(i,_,X)}}}catch(X){mt(i,i.return,X)}if(i===n){Ne=null;break}var L=i.sibling;if(L!==null){L.return=i.return,Ne=L;break}Ne=i.return}}var Bv=Math.ceil,Gl=I.ReactCurrentDispatcher,mc=I.ReactCurrentOwner,Rn=I.ReactCurrentBatchConfig,Ge=0,zt=null,Nt=null,Bt=0,kn=0,_s=ei(0),_t=0,_o=null,Fi=0,Kl=0,gc=0,Io=null,on=null,yc=0,Is=1/0,Rr=null,Ql=!1,xc=null,oi=null,Zl=!1,li=null,Jl=0,To=0,vc=null,ea=-1,ta=0;function Zt(){return(Ge&6)!==0?st():ea!==-1?ea:ea=st()}function ai(n){return(n.mode&1)===0?1:(Ge&2)!==0&&Bt!==0?Bt&-Bt:Ev.transition!==null?(ta===0&&(ta=Gr()),ta):(n=Ke,n!==0||(n=window.event,n=n===void 0?16:gf(n.type)),n)}function Gn(n,i,l,f){if(50<To)throw To=0,vc=null,Error(r(185));Hn(n,l,f),((Ge&2)===0||n!==zt)&&(n===zt&&((Ge&2)===0&&(Kl|=l),_t===4&&ui(n,Bt)),ln(n,f),l===1&&Ge===0&&(i.mode&1)===0&&(Is=st()+500,Il&&ni()))}function ln(n,i){var l=n.callbackNode;eo(n,i);var f=et(n,n===zt?Bt:0);if(f===0)l!==null&&bi(l),n.callbackNode=null,n.callbackPriority=0;else if(i=f&-f,n.callbackPriority!==i){if(l!=null&&bi(l),i===1)n.tag===0?Nv(gp.bind(null,n)):th(gp.bind(null,n)),vv(function(){(Ge&6)===0&&ni()}),l=null;else{switch(hl(f)){case 1:l=Ci;break;case 4:l=ji;break;case 16:l=Er;break;case 536870912:l=rs;break;default:l=Er}l=Ep(l,mp.bind(null,n))}n.callbackPriority=i,n.callbackNode=l}}function mp(n,i){if(ea=-1,ta=0,(Ge&6)!==0)throw Error(r(327));var l=n.callbackNode;if(Ts()&&n.callbackNode!==l)return null;var f=et(n,n===zt?Bt:0);if(f===0)return null;if((f&30)!==0||(f&n.expiredLanes)!==0||i)i=na(n,f);else{i=f;var y=Ge;Ge|=2;var v=xp();(zt!==n||Bt!==i)&&(Rr=null,Is=st()+500,$i(n,i));do try{Uv();break}catch(L){yp(n,L)}while(!0);Du(),Gl.current=v,Ge=y,Nt!==null?i=0:(zt=null,Bt=0,i=_t)}if(i!==0){if(i===2&&(y=_i(n),y!==0&&(f=y,i=wc(n,y))),i===1)throw l=_o,$i(n,0),ui(n,f),ln(n,st()),l;if(i===6)ui(n,f);else{if(y=n.current.alternate,(f&30)===0&&!Hv(y)&&(i=na(n,f),i===2&&(v=_i(n),v!==0&&(f=v,i=wc(n,v))),i===1))throw l=_o,$i(n,0),ui(n,f),ln(n,st()),l;switch(n.finishedWork=y,n.finishedLanes=f,i){case 0:case 1:throw Error(r(345));case 2:Bi(n,on,Rr);break;case 3:if(ui(n,f),(f&130023424)===f&&(i=yc+500-st(),10<i)){if(et(n,0)!==0)break;if(y=n.suspendedLanes,(y&f)!==f){Zt(),n.pingedLanes|=n.suspendedLanes&y;break}n.timeoutHandle=Cu(Bi.bind(null,n,on,Rr),i);break}Bi(n,on,Rr);break;case 4:if(ui(n,f),(f&4194240)===f)break;for(i=n.eventTimes,y=-1;0<f;){var _=31-Ot(f);v=1<<_,_=i[_],_>y&&(y=_),f&=~v}if(f=y,f=st()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*Bv(f/1960))-f,10<f){n.timeoutHandle=Cu(Bi.bind(null,n,on,Rr),f);break}Bi(n,on,Rr);break;case 5:Bi(n,on,Rr);break;default:throw Error(r(329))}}}return ln(n,st()),n.callbackNode===l?mp.bind(null,n):null}function wc(n,i){var l=Io;return n.current.memoizedState.isDehydrated&&($i(n,i).flags|=256),n=na(n,i),n!==2&&(i=on,on=l,i!==null&&Sc(i)),n}function Sc(n){on===null?on=n:on.push.apply(on,n)}function Hv(n){for(var i=n;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var f=0;f<l.length;f++){var y=l[f],v=y.getSnapshot;y=y.value;try{if(!Un(v(),y))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ui(n,i){for(i&=~gc,i&=~Kl,n.suspendedLanes|=i,n.pingedLanes&=~i,n=n.expirationTimes;0<i;){var l=31-Ot(i),f=1<<l;n[l]=-1,i&=~f}}function gp(n){if((Ge&6)!==0)throw Error(r(327));Ts();var i=et(n,0);if((i&1)===0)return ln(n,st()),null;var l=na(n,i);if(n.tag!==0&&l===2){var f=_i(n);f!==0&&(i=f,l=wc(n,f))}if(l===1)throw l=_o,$i(n,0),ui(n,i),ln(n,st()),l;if(l===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=i,Bi(n,on,Rr),ln(n,st()),null}function kc(n,i){var l=Ge;Ge|=1;try{return n(i)}finally{Ge=l,Ge===0&&(Is=st()+500,Il&&ni())}}function Oi(n){li!==null&&li.tag===0&&(Ge&6)===0&&Ts();var i=Ge;Ge|=1;var l=Rn.transition,f=Ke;try{if(Rn.transition=null,Ke=1,n)return n()}finally{Ke=f,Rn.transition=l,Ge=i,(Ge&6)===0&&ni()}}function Nc(){kn=_s.current,lt(_s)}function $i(n,i){n.finishedWork=null,n.finishedLanes=0;var l=n.timeoutHandle;if(l!==-1&&(n.timeoutHandle=-1,xv(l)),Nt!==null)for(l=Nt.return;l!==null;){var f=l;switch(Au(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&jl();break;case 3:bs(),lt(nn),lt(Ut),Wu();break;case 5:Vu(f);break;case 4:bs();break;case 13:lt(dt);break;case 19:lt(dt);break;case 10:Fu(f.type._context);break;case 22:case 23:Nc()}l=l.return}if(zt=n,Nt=n=ci(n.current,null),Bt=kn=i,_t=0,_o=null,gc=Kl=Fi=0,on=Io=null,Ri!==null){for(i=0;i<Ri.length;i++)if(l=Ri[i],f=l.interleaved,f!==null){l.interleaved=null;var y=f.next,v=l.pending;if(v!==null){var _=v.next;v.next=y,f.next=_}l.pending=f}Ri=null}return n}function yp(n,i){do{var l=Nt;try{if(Du(),Ol.current=Vl,$l){for(var f=ft.memoizedState;f!==null;){var y=f.queue;y!==null&&(y.pending=null),f=f.next}$l=!1}if(Di=0,Mt=jt=ft=null,ko=!1,No=0,mc.current=null,l===null||l.return===null){_t=1,_o=i,Nt=null;break}e:{var v=n,_=l.return,L=l,X=i;if(i=Bt,L.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ne=X,fe=L,pe=fe.tag;if((fe.mode&1)===0&&(pe===0||pe===11||pe===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Se=Hh(_);if(Se!==null){Se.flags&=-257,Vh(Se,_,L,v,i),Se.mode&1&&Bh(v,ne,i),i=Se,X=ne;var Ce=i.updateQueue;if(Ce===null){var je=new Set;je.add(X),i.updateQueue=je}else Ce.add(X);break e}else{if((i&1)===0){Bh(v,ne,i),Ec();break e}X=Error(r(426))}}else if(at&&L.mode&1){var wt=Hh(_);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),Vh(wt,_,L,v,i),Ru(Cs(X,L));break e}}v=X=Cs(X,L),_t!==4&&(_t=2),Io===null?Io=[v]:Io.push(v),v=_;do{switch(v.tag){case 3:v.flags|=65536,i&=-i,v.lanes|=i;var ee=Oh(v,X,i);fh(v,ee);break e;case 1:L=X;var K=v.type,te=v.stateNode;if((v.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(oi===null||!oi.has(te)))){v.flags|=65536,i&=-i,v.lanes|=i;var ve=$h(v,L,i);fh(v,ve);break e}}v=v.return}while(v!==null)}wp(l)}catch(Ie){i=Ie,Nt===l&&l!==null&&(Nt=l=l.return);continue}break}while(!0)}function xp(){var n=Gl.current;return Gl.current=Vl,n===null?Vl:n}function Ec(){(_t===0||_t===3||_t===2)&&(_t=4),zt===null||(Fi&268435455)===0&&(Kl&268435455)===0||ui(zt,Bt)}function na(n,i){var l=Ge;Ge|=2;var f=xp();(zt!==n||Bt!==i)&&(Rr=null,$i(n,i));do try{Vv();break}catch(y){yp(n,y)}while(!0);if(Du(),Ge=l,Gl.current=f,Nt!==null)throw Error(r(261));return zt=null,Bt=0,_t}function Vv(){for(;Nt!==null;)vp(Nt)}function Uv(){for(;Nt!==null&&!In();)vp(Nt)}function vp(n){var i=Np(n.alternate,n,kn);n.memoizedProps=n.pendingProps,i===null?wp(n):Nt=i,mc.current=null}function wp(n){var i=n;do{var l=i.alternate;if(n=i.return,(i.flags&32768)===0){if(l=Lv(l,i,kn),l!==null){Nt=l;return}}else{if(l=Dv(l,i),l!==null){l.flags&=32767,Nt=l;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{_t=6,Nt=null;return}}if(i=i.sibling,i!==null){Nt=i;return}Nt=i=n}while(i!==null);_t===0&&(_t=5)}function Bi(n,i,l){var f=Ke,y=Rn.transition;try{Rn.transition=null,Ke=1,Wv(n,i,l,f)}finally{Rn.transition=y,Ke=f}return null}function Wv(n,i,l,f){do Ts();while(li!==null);if((Ge&6)!==0)throw Error(r(327));l=n.finishedWork;var y=n.finishedLanes;if(l===null)return null;if(n.finishedWork=null,n.finishedLanes=0,l===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var v=l.lanes|l.childLanes;if(os(n,v),n===zt&&(Nt=zt=null,Bt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Zl||(Zl=!0,Ep(Er,function(){return Ts(),null})),v=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||v){v=Rn.transition,Rn.transition=null;var _=Ke;Ke=1;var L=Ge;Ge|=4,mc.current=null,Ov(n,l),cp(l,n),dv(Eu),vt=!!Nu,Eu=Nu=null,n.current=l,$v(l),rr(),Ge=L,Ke=_,Rn.transition=v}else n.current=l;if(Zl&&(Zl=!1,li=n,Jl=y),v=n.pendingLanes,v===0&&(oi=null),is(l.stateNode),ln(n,st()),i!==null)for(f=n.onRecoverableError,l=0;l<i.length;l++)y=i[l],f(y.value,{componentStack:y.stack,digest:y.digest});if(Ql)throw Ql=!1,n=xc,xc=null,n;return(Jl&1)!==0&&n.tag!==0&&Ts(),v=n.pendingLanes,(v&1)!==0?n===vc?To++:(To=0,vc=n):To=0,ni(),null}function Ts(){if(li!==null){var n=hl(Jl),i=Rn.transition,l=Ke;try{if(Rn.transition=null,Ke=16>n?16:n,li===null)var f=!1;else{if(n=li,li=null,Jl=0,(Ge&6)!==0)throw Error(r(331));var y=Ge;for(Ge|=4,Ne=n.current;Ne!==null;){var v=Ne,_=v.child;if((Ne.flags&16)!==0){var L=v.deletions;if(L!==null){for(var X=0;X<L.length;X++){var ne=L[X];for(Ne=ne;Ne!==null;){var fe=Ne;switch(fe.tag){case 0:case 11:case 15:jo(8,fe,v)}var pe=fe.child;if(pe!==null)pe.return=fe,Ne=pe;else for(;Ne!==null;){fe=Ne;var de=fe.sibling,Se=fe.return;if(sp(fe),fe===ne){Ne=null;break}if(de!==null){de.return=Se,Ne=de;break}Ne=Se}}}var Ce=v.alternate;if(Ce!==null){var je=Ce.child;if(je!==null){Ce.child=null;do{var wt=je.sibling;je.sibling=null,je=wt}while(je!==null)}}Ne=v}}if((v.subtreeFlags&2064)!==0&&_!==null)_.return=v,Ne=_;else e:for(;Ne!==null;){if(v=Ne,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:jo(9,v,v.return)}var ee=v.sibling;if(ee!==null){ee.return=v.return,Ne=ee;break e}Ne=v.return}}var K=n.current;for(Ne=K;Ne!==null;){_=Ne;var te=_.child;if((_.subtreeFlags&2064)!==0&&te!==null)te.return=_,Ne=te;else e:for(_=K;Ne!==null;){if(L=Ne,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:ql(9,L)}}catch(Ie){mt(L,L.return,Ie)}if(L===_){Ne=null;break e}var ve=L.sibling;if(ve!==null){ve.return=L.return,Ne=ve;break e}Ne=L.return}}if(Ge=y,ni(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(br,n)}catch{}f=!0}return f}finally{Ke=l,Rn.transition=i}}return!1}function Sp(n,i,l){i=Cs(l,i),i=Oh(n,i,1),n=ii(n,i,1),i=Zt(),n!==null&&(Hn(n,1,i),ln(n,i))}function mt(n,i,l){if(n.tag===3)Sp(n,n,l);else for(;i!==null;){if(i.tag===3){Sp(i,n,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(oi===null||!oi.has(f))){n=Cs(l,n),n=$h(i,n,1),i=ii(i,n,1),n=Zt(),i!==null&&(Hn(i,1,n),ln(i,n));break}}i=i.return}}function Yv(n,i,l){var f=n.pingCache;f!==null&&f.delete(i),i=Zt(),n.pingedLanes|=n.suspendedLanes&l,zt===n&&(Bt&l)===l&&(_t===4||_t===3&&(Bt&130023424)===Bt&&500>st()-yc?$i(n,0):gc|=l),ln(n,i)}function kp(n,i){i===0&&((n.mode&1)===0?i=1:(i=Xr,Xr<<=1,(Xr&130023424)===0&&(Xr=4194304)));var l=Zt();n=Ar(n,i),n!==null&&(Hn(n,i,l),ln(n,l))}function Xv(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),kp(n,l)}function qv(n,i){var l=0;switch(n.tag){case 13:var f=n.stateNode,y=n.memoizedState;y!==null&&(l=y.retryLane);break;case 19:f=n.stateNode;break;default:throw Error(r(314))}f!==null&&f.delete(i),kp(n,l)}var Np;Np=function(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps||nn.current)sn=!0;else{if((n.lanes&l)===0&&(i.flags&128)===0)return sn=!1,Rv(n,i,l);sn=(n.flags&131072)!==0}else sn=!1,at&&(i.flags&1048576)!==0&&nh(i,Pl,i.index);switch(i.lanes=0,i.tag){case 2:var f=i.type;Yl(n,i),n=i.pendingProps;var y=xs(i,Ut.current);Es(i,l),y=qu(null,i,f,n,y,l);var v=Gu();return i.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,rn(f)?(v=!0,_l(i)):v=!1,i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Bu(i),y.updater=Ul,i.stateNode=y,y._reactInternals=i,tc(i,f,n,l),i=sc(null,i,f,!0,v,l)):(i.tag=0,at&&v&&Pu(i),Qt(null,i,y,l),i=i.child),i;case 16:f=i.elementType;e:{switch(Yl(n,i),n=i.pendingProps,y=f._init,f=y(f._payload),i.type=f,y=i.tag=Kv(f),n=Yn(f,n),y){case 0:i=ic(null,i,f,n,l);break e;case 1:i=Gh(null,i,f,n,l);break e;case 11:i=Uh(null,i,f,n,l);break e;case 14:i=Wh(null,i,f,Yn(f.type,n),l);break e}throw Error(r(306,f,""))}return i;case 0:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:Yn(f,y),ic(n,i,f,y,l);case 1:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:Yn(f,y),Gh(n,i,f,y,l);case 3:e:{if(Kh(i),n===null)throw Error(r(387));f=i.pendingProps,v=i.memoizedState,y=v.element,dh(n,i),Dl(i,f,null,l);var _=i.memoizedState;if(f=_.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){y=Cs(Error(r(423)),i),i=Qh(n,i,f,l,y);break e}else if(f!==y){y=Cs(Error(r(424)),i),i=Qh(n,i,f,l,y);break e}else for(Sn=Jr(i.stateNode.containerInfo.firstChild),wn=i,at=!0,Wn=null,l=uh(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ss(),f===y){i=zr(n,i,l);break e}Qt(n,i,f,l)}i=i.child}return i;case 5:return ph(i),n===null&&zu(i),f=i.type,y=i.pendingProps,v=n!==null?n.memoizedProps:null,_=y.children,bu(f,y)?_=null:v!==null&&bu(f,v)&&(i.flags|=32),qh(n,i),Qt(n,i,_,l),i.child;case 6:return n===null&&zu(i),null;case 13:return Zh(n,i,l);case 4:return Hu(i,i.stateNode.containerInfo),f=i.pendingProps,n===null?i.child=ks(i,null,f,l):Qt(n,i,f,l),i.child;case 11:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:Yn(f,y),Uh(n,i,f,y,l);case 7:return Qt(n,i,i.pendingProps,l),i.child;case 8:return Qt(n,i,i.pendingProps.children,l),i.child;case 12:return Qt(n,i,i.pendingProps.children,l),i.child;case 10:e:{if(f=i.type._context,y=i.pendingProps,v=i.memoizedProps,_=y.value,nt(zl,f._currentValue),f._currentValue=_,v!==null)if(Un(v.value,_)){if(v.children===y.children&&!nn.current){i=zr(n,i,l);break e}}else for(v=i.child,v!==null&&(v.return=i);v!==null;){var L=v.dependencies;if(L!==null){_=v.child;for(var X=L.firstContext;X!==null;){if(X.context===f){if(v.tag===1){X=Mr(-1,l&-l),X.tag=2;var ne=v.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?X.next=X:(X.next=fe.next,fe.next=X),ne.pending=X}}v.lanes|=l,X=v.alternate,X!==null&&(X.lanes|=l),Ou(v.return,l,i),L.lanes|=l;break}X=X.next}}else if(v.tag===10)_=v.type===i.type?null:v.child;else if(v.tag===18){if(_=v.return,_===null)throw Error(r(341));_.lanes|=l,L=_.alternate,L!==null&&(L.lanes|=l),Ou(_,l,i),_=v.sibling}else _=v.child;if(_!==null)_.return=v;else for(_=v;_!==null;){if(_===i){_=null;break}if(v=_.sibling,v!==null){v.return=_.return,_=v;break}_=_.return}v=_}Qt(n,i,y.children,l),i=i.child}return i;case 9:return y=i.type,f=i.pendingProps.children,Es(i,l),y=Mn(y),f=f(y),i.flags|=1,Qt(n,i,f,l),i.child;case 14:return f=i.type,y=Yn(f,i.pendingProps),y=Yn(f.type,y),Wh(n,i,f,y,l);case 15:return Yh(n,i,i.type,i.pendingProps,l);case 17:return f=i.type,y=i.pendingProps,y=i.elementType===f?y:Yn(f,y),Yl(n,i),i.tag=1,rn(f)?(n=!0,_l(i)):n=!1,Es(i,l),Dh(i,f,y),tc(i,f,y,l),sc(null,i,f,!0,n,l);case 19:return ep(n,i,l);case 22:return Xh(n,i,l)}throw Error(r(156,i.tag))};function Ep(n,i){return Ei(n,i)}function Gv(n,i,l,f){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(n,i,l,f){return new Gv(n,i,l,f)}function bc(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Kv(n){if(typeof n=="function")return bc(n)?1:0;if(n!=null){if(n=n.$$typeof,n===W)return 11;if(n===O)return 14}return 2}function ci(n,i){var l=n.alternate;return l===null?(l=Ln(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function ra(n,i,l,f,y,v){var _=2;if(f=n,typeof n=="function")bc(n)&&(_=1);else if(typeof n=="string")_=5;else e:switch(n){case D:return Hi(l.children,y,v,i);case G:_=8,y|=8;break;case U:return n=Ln(12,l,i,y|2),n.elementType=U,n.lanes=v,n;case J:return n=Ln(13,l,i,y),n.elementType=J,n.lanes=v,n;case z:return n=Ln(19,l,i,y),n.elementType=z,n.lanes=v,n;case Q:return ia(l,y,v,i);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case q:_=10;break e;case F:_=9;break e;case W:_=11;break e;case O:_=14;break e;case $:_=16,f=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return i=Ln(_,l,i,y),i.elementType=n,i.type=f,i.lanes=v,i}function Hi(n,i,l,f){return n=Ln(7,n,f,i),n.lanes=l,n}function ia(n,i,l,f){return n=Ln(22,n,f,i),n.elementType=Q,n.lanes=l,n.stateNode={isHidden:!1},n}function Cc(n,i,l){return n=Ln(6,n,null,i),n.lanes=l,n}function jc(n,i,l){return i=Ln(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}function Qv(n,i,l,f,y){this.tag=i,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=f,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function _c(n,i,l,f,y,v,_,L,X){return n=new Qv(n,i,l,L,X),i===1?(i=1,v===!0&&(i|=8)):i=0,v=Ln(3,null,null,i),n.current=v,v.stateNode=n,v.memoizedState={element:f,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bu(v),n}function Zv(n,i,l){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:f==null?null:""+f,children:n,containerInfo:i,implementation:l}}function bp(n){if(!n)return ti;n=n._reactInternals;e:{if(Ft(n)!==n||n.tag!==1)throw Error(r(170));var i=n;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(rn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(n.tag===1){var l=n.type;if(rn(l))return Jf(n,l,i)}return i}function Cp(n,i,l,f,y,v,_,L,X){return n=_c(l,f,!0,n,y,v,_,L,X),n.context=bp(null),l=n.current,f=Zt(),y=ai(l),v=Mr(f,y),v.callback=i??null,ii(l,v,y),n.current.lanes=y,Hn(n,y,f),ln(n,f),n}function sa(n,i,l,f){var y=i.current,v=Zt(),_=ai(y);return l=bp(l),i.context===null?i.context=l:i.pendingContext=l,i=Mr(v,_),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=ii(y,i,_),n!==null&&(Gn(n,y,_,v),Ll(n,y,_)),_}function oa(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function jp(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function Ic(n,i){jp(n,i),(n=n.alternate)&&jp(n,i)}function Jv(){return null}var _p=typeof reportError=="function"?reportError:function(n){console.error(n)};function Tc(n){this._internalRoot=n}la.prototype.render=Tc.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));sa(n,i,null,null)},la.prototype.unmount=Tc.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Oi(function(){sa(null,n,null,null)}),i[_r]=null}};function la(n){this._internalRoot=n}la.prototype.unstable_scheduleHydration=function(n){if(n){var i=Kr();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Vn.length&&i!==0&&i<Vn[l].priority;l++);Vn.splice(l,0,n),l===0&&le(n)}};function Pc(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function aa(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Ip(){}function ew(n,i,l,f,y){if(y){if(typeof f=="function"){var v=f;f=function(){var ne=oa(_);v.call(ne)}}var _=Cp(i,f,n,0,null,!1,!1,"",Ip);return n._reactRootContainer=_,n[_r]=_.current,po(n.nodeType===8?n.parentNode:n),Oi(),_}for(;y=n.lastChild;)n.removeChild(y);if(typeof f=="function"){var L=f;f=function(){var ne=oa(X);L.call(ne)}}var X=_c(n,0,!1,null,null,!1,!1,"",Ip);return n._reactRootContainer=X,n[_r]=X.current,po(n.nodeType===8?n.parentNode:n),Oi(function(){sa(i,X,l,f)}),X}function ua(n,i,l,f,y){var v=l._reactRootContainer;if(v){var _=v;if(typeof y=="function"){var L=y;y=function(){var X=oa(_);L.call(X)}}sa(i,_,n,y)}else _=ew(l,i,n,y,f);return oa(_)}to=function(n){switch(n.tag){case 3:var i=n.stateNode;if(i.current.memoizedState.isDehydrated){var l=Gt(i.pendingLanes);l!==0&&(ls(i,l|1),ln(i,st()),(Ge&6)===0&&(Is=st()+500,ni()))}break;case 13:Oi(function(){var f=Ar(n,1);if(f!==null){var y=Zt();Gn(f,n,1,y)}}),Ic(n,1)}},as=function(n){if(n.tag===13){var i=Ar(n,134217728);if(i!==null){var l=Zt();Gn(i,n,134217728,l)}Ic(n,134217728)}},no=function(n){if(n.tag===13){var i=ai(n),l=Ar(n,i);if(l!==null){var f=Zt();Gn(l,n,i,f)}Ic(n,i)}},Kr=function(){return Ke},pl=function(n,i){var l=Ke;try{return Ke=n,i()}finally{Ke=l}},Br=function(n,i,l){switch(i){case"input":if(tt(n,l),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==n&&f.form===n.form){var y=Cl(f);if(!y)throw Error(r(90));Ee(f),tt(f,y)}}}break;case"textarea":mn(n,l);break;case"select":i=l.value,i!=null&&Tt(n,!!l.multiple,i,!1)}},Si=kc,On=Oi;var tw={usingClientEntryPoint:!1,Events:[yo,gs,Cl,yn,Hr,kc]},Po={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nw={bundleType:Po.bundleType,version:Po.version,rendererPackageName:Po.rendererPackageName,rendererConfig:Po.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Ni(n),n===null?null:n.stateNode},findFiberByHostInstance:Po.findFiberByHostInstance||Jv,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 ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{br=ca.inject(nw),tn=ca}catch{}}return an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tw,an.createPortal=function(n,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pc(i))throw Error(r(200));return Zv(n,i,null,l)},an.createRoot=function(n,i){if(!Pc(n))throw Error(r(299));var l=!1,f="",y=_p;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=_c(n,1,!1,null,null,l,!1,f,y),n[_r]=i.current,po(n.nodeType===8?n.parentNode:n),new Tc(i)},an.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=Ni(i),n=n===null?null:n.stateNode,n},an.flushSync=function(n){return Oi(n)},an.hydrate=function(n,i,l){if(!aa(i))throw Error(r(200));return ua(null,n,i,!0,l)},an.hydrateRoot=function(n,i,l){if(!Pc(n))throw Error(r(405));var f=l!=null&&l.hydratedSources||null,y=!1,v="",_=_p;if(l!=null&&(l.unstable_strictMode===!0&&(y=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=Cp(i,null,n,1,l??null,y,!1,v,_),n[_r]=i.current,po(n),f)for(n=0;n<f.length;n++)l=f[n],y=l._getVersion,y=y(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,y]:i.mutableSourceEagerHydrationData.push(l,y);return new la(i)},an.render=function(n,i,l){if(!aa(i))throw Error(r(200));return ua(null,n,i,!1,l)},an.unmountComponentAtNode=function(n){if(!aa(n))throw Error(r(40));return n._reactRootContainer?(Oi(function(){ua(null,null,n,!1,function(){n._reactRootContainer=null,n[_r]=null})}),!0):!1},an.unstable_batchedUpdates=kc,an.unstable_renderSubtreeIntoContainer=function(n,i,l,f){if(!aa(l))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return ua(n,i,l,!1,f)},an.version="18.3.1-next-f1338f8080-20240426",an}var Dp;function Wg(){if(Dp)return zc.exports;Dp=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(),zc.exports=uw(),zc.exports}var Fp;function cw(){if(Fp)return da;Fp=1;var e=Wg();return da.createRoot=e.createRoot,da.hydrateRoot=e.hydrateRoot,da}var dw=cw();const fw=rl(dw);function bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=bt(e[r]))!==""&&(t+=(t&&" ")+s);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var hw={value:()=>{}};function Ua(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new Ea(r)}function Ea(e){this._=e}function pw(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",o=r.indexOf(".");if(o>=0&&(s=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}Ea.prototype=Ua.prototype={constructor:Ea,on:function(e,t){var r=this._,s=pw(e+"",r),o,a=-1,u=s.length;if(arguments.length<2){for(;++a<u;)if((o=(e=s[a]).type)&&(o=mw(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<u;)if(o=(e=s[a]).type)r[o]=Op(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Op(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Ea(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),s=0,o,a;s<o;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,a=s.length;o<a;++o)s[o].value.apply(t,r)}};function mw(e,t){for(var r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value}function Op(e,t,r){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=hw,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var cd="http://www.w3.org/1999/xhtml";const $p={svg:"http://www.w3.org/2000/svg",xhtml:cd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wa(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),$p.hasOwnProperty(t)?{space:$p[t],local:e}:e}function gw(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===cd&&t.documentElement.namespaceURI===cd?t.createElement(e):t.createElementNS(r,e)}}function yw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yg(e){var t=Wa(e);return(t.local?yw:gw)(t)}function xw(){}function Rd(e){return e==null?xw:function(){return this.querySelector(e)}}function vw(e){typeof e!="function"&&(e=Rd(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,d=s[o]=new Array(u),h,p,m=0;m<u;++m)(h=a[m])&&(p=e.call(h,h.__data__,m,a))&&("__data__"in h&&(p.__data__=h.__data__),d[m]=p);return new jn(s,this._parents)}function ww(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Sw(){return[]}function Xg(e){return e==null?Sw:function(){return this.querySelectorAll(e)}}function kw(e){return function(){return ww(e.apply(this,arguments))}}function Nw(e){typeof e=="function"?e=kw(e):e=Xg(e);for(var t=this._groups,r=t.length,s=[],o=[],a=0;a<r;++a)for(var u=t[a],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(s.push(e.call(h,h.__data__,p,u)),o.push(h));return new jn(s,o)}function qg(e){return function(){return this.matches(e)}}function Gg(e){return function(t){return t.matches(e)}}var Ew=Array.prototype.find;function bw(e){return function(){return Ew.call(this.children,e)}}function Cw(){return this.firstElementChild}function jw(e){return this.select(e==null?Cw:bw(typeof e=="function"?e:Gg(e)))}var _w=Array.prototype.filter;function Iw(){return Array.from(this.children)}function Tw(e){return function(){return _w.call(this.children,e)}}function Pw(e){return this.selectAll(e==null?Iw:Tw(typeof e=="function"?e:Gg(e)))}function Aw(e){typeof e!="function"&&(e=qg(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,d=s[o]=[],h,p=0;p<u;++p)(h=a[p])&&e.call(h,h.__data__,p,a)&&d.push(h);return new jn(s,this._parents)}function Kg(e){return new Array(e.length)}function Mw(){return new jn(this._enter||this._groups.map(Kg),this._parents)}function Ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ta.prototype={constructor:Ta,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 zw(e){return function(){return e}}function Rw(e,t,r,s,o,a){for(var u=0,d,h=t.length,p=a.length;u<p;++u)(d=t[u])?(d.__data__=a[u],s[u]=d):r[u]=new Ta(e,a[u]);for(;u<h;++u)(d=t[u])&&(o[u]=d)}function Lw(e,t,r,s,o,a,u){var d,h,p=new Map,m=t.length,g=a.length,x=new Array(m),w;for(d=0;d<m;++d)(h=t[d])&&(x[d]=w=u.call(h,h.__data__,d,t)+"",p.has(w)?o[d]=h:p.set(w,h));for(d=0;d<g;++d)w=u.call(e,a[d],d,a)+"",(h=p.get(w))?(s[d]=h,h.__data__=a[d],p.delete(w)):r[d]=new Ta(e,a[d]);for(d=0;d<m;++d)(h=t[d])&&p.get(x[d])===h&&(o[d]=h)}function Dw(e){return e.__data__}function Fw(e,t){if(!arguments.length)return Array.from(this,Dw);var r=t?Lw:Rw,s=this._parents,o=this._groups;typeof e!="function"&&(e=zw(e));for(var a=o.length,u=new Array(a),d=new Array(a),h=new Array(a),p=0;p<a;++p){var m=s[p],g=o[p],x=g.length,w=Ow(e.call(m,m&&m.__data__,p,s)),k=w.length,E=d[p]=new Array(k),b=u[p]=new Array(k),S=h[p]=new Array(x);r(m,g,E,b,S,w,t);for(var C=0,N=0,I,B;C<k;++C)if(I=E[C]){for(C>=N&&(N=C+1);!(B=b[N])&&++N<k;);I._next=B||null}}return u=new jn(u,s),u._enter=d,u._exit=h,u}function Ow(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $w(){return new jn(this._exit||this._groups.map(Kg),this._parents)}function Bw(e,t,r){var s=this.enter(),o=this,a=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),s&&o?s.merge(o).order():o}function Hw(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,o=r.length,a=s.length,u=Math.min(o,a),d=new Array(o),h=0;h<u;++h)for(var p=r[h],m=s[h],g=p.length,x=d[h]=new Array(g),w,k=0;k<g;++k)(w=p[k]||m[k])&&(x[k]=w);for(;h<o;++h)d[h]=r[h];return new jn(d,this._parents)}function Vw(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],o=s.length-1,a=s[o],u;--o>=0;)(u=s[o])&&(a&&u.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(u,a),a=u);return this}function Uw(e){e||(e=Ww);function t(g,x){return g&&x?e(g.__data__,x.__data__):!g-!x}for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a){for(var u=r[a],d=u.length,h=o[a]=new Array(d),p,m=0;m<d;++m)(p=u[m])&&(h[m]=p);h.sort(t)}return new jn(o,this._parents).order()}function Ww(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xw(){return Array.from(this)}function qw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length;o<a;++o){var u=s[o];if(u)return u}return null}function Gw(){let e=0;for(const t of this)++e;return e}function Kw(){return!this.node()}function Qw(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var o=t[r],a=0,u=o.length,d;a<u;++a)(d=o[a])&&e.call(d,d.__data__,a,o);return this}function Zw(e){return function(){this.removeAttribute(e)}}function Jw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e1(e,t){return function(){this.setAttribute(e,t)}}function t1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function n1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function r1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function i1(e,t){var r=Wa(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?Jw:Zw:typeof t=="function"?r.local?r1:n1:r.local?t1:e1)(r,t))}function Qg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function s1(e){return function(){this.style.removeProperty(e)}}function o1(e,t,r){return function(){this.style.setProperty(e,t,r)}}function l1(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function a1(e,t,r){return arguments.length>1?this.each((t==null?s1:typeof t=="function"?l1:o1)(e,t,r??"")):Us(this.node(),e)}function Us(e,t){return e.style.getPropertyValue(t)||Qg(e).getComputedStyle(e,null).getPropertyValue(t)}function u1(e){return function(){delete this[e]}}function c1(e,t){return function(){this[e]=t}}function d1(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function f1(e,t){return arguments.length>1?this.each((t==null?u1:typeof t=="function"?d1:c1)(e,t)):this.node()[e]}function Zg(e){return e.trim().split(/^|\s+/)}function Ld(e){return e.classList||new Jg(e)}function Jg(e){this._node=e,this._names=Zg(e.getAttribute("class")||"")}Jg.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 ey(e,t){for(var r=Ld(e),s=-1,o=t.length;++s<o;)r.add(t[s])}function ty(e,t){for(var r=Ld(e),s=-1,o=t.length;++s<o;)r.remove(t[s])}function h1(e){return function(){ey(this,e)}}function p1(e){return function(){ty(this,e)}}function m1(e,t){return function(){(t.apply(this,arguments)?ey:ty)(this,e)}}function g1(e,t){var r=Zg(e+"");if(arguments.length<2){for(var s=Ld(this.node()),o=-1,a=r.length;++o<a;)if(!s.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?m1:t?h1:p1)(r,t))}function y1(){this.textContent=""}function x1(e){return function(){this.textContent=e}}function v1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function w1(e){return arguments.length?this.each(e==null?y1:(typeof e=="function"?v1:x1)(e)):this.node().textContent}function S1(){this.innerHTML=""}function k1(e){return function(){this.innerHTML=e}}function N1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function E1(e){return arguments.length?this.each(e==null?S1:(typeof e=="function"?N1:k1)(e)):this.node().innerHTML}function b1(){this.nextSibling&&this.parentNode.appendChild(this)}function C1(){return this.each(b1)}function j1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _1(){return this.each(j1)}function I1(e){var t=typeof e=="function"?e:Yg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function T1(){return null}function P1(e,t){var r=typeof e=="function"?e:Yg(e),s=t==null?T1:typeof t=="function"?t:Rd(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function A1(){var e=this.parentNode;e&&e.removeChild(this)}function M1(){return this.each(A1)}function z1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function R1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function L1(e){return this.select(e?R1:z1)}function D1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function F1(e){return function(t){e.call(this,t,this.__data__)}}function O1(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function $1(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++s]=a;++s?t.length=s:delete this.__on}}}function B1(e,t,r){return function(){var s=this.__on,o,a=F1(t);if(s){for(var u=0,d=s.length;u<d;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},s?s.push(o):this.__on=[o]}}function H1(e,t,r){var s=O1(e+""),o,a=s.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,m;h<p;++h)for(o=0,m=d[h];o<a;++o)if((u=s[o]).type===m.type&&u.name===m.name)return m.value}return}for(d=t?B1:$1,o=0;o<a;++o)this.each(d(s[o],t,r));return this}function ny(e,t,r){var s=Qg(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,r):(o=s.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function V1(e,t){return function(){return ny(this,e,t)}}function U1(e,t){return function(){return ny(this,e,t.apply(this,arguments))}}function W1(e,t){return this.each((typeof t=="function"?U1:V1)(e,t))}function*Y1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length,u;o<a;++o)(u=s[o])&&(yield u)}var ry=[null];function jn(e,t){this._groups=e,this._parents=t}function sl(){return new jn([[document.documentElement]],ry)}function X1(){return this}jn.prototype=sl.prototype={constructor:jn,select:vw,selectAll:Nw,selectChild:jw,selectChildren:Pw,filter:Aw,data:Fw,enter:Mw,exit:$w,join:Bw,merge:Hw,selection:X1,order:Vw,sort:Uw,call:Yw,nodes:Xw,node:qw,size:Gw,empty:Kw,each:Qw,attr:i1,style:a1,property:f1,classed:g1,text:w1,html:E1,raise:C1,lower:_1,append:I1,insert:P1,remove:M1,clone:L1,datum:D1,on:H1,dispatch:W1,[Symbol.iterator]:Y1};function bn(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],ry)}function q1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kn(e,t){if(e=q1(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.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 G1={passive:!1},Yo={capture:!0,passive:!1};function Dc(e){e.stopImmediatePropagation()}function $s(e){e.preventDefault(),e.stopImmediatePropagation()}function iy(e){var t=e.document.documentElement,r=bn(e).on("dragstart.drag",$s,Yo);"onselectstart"in t?r.on("selectstart.drag",$s,Yo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sy(e,t){var r=e.document.documentElement,s=bn(e).on("dragstart.drag",null);t&&(s.on("click.drag",$s,Yo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const fa=e=>()=>e;function dd(e,{sourceEvent:t,subject:r,target:s,identifier:o,active:a,x:u,y:d,dx:h,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}dd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function K1(e){return!e.ctrlKey&&!e.button}function Q1(){return this.parentNode}function Z1(e,t){return t??{x:e.x,y:e.y}}function J1(){return navigator.maxTouchPoints||"ontouchstart"in this}function oy(){var e=K1,t=Q1,r=Z1,s=J1,o={},a=Ua("start","drag","end"),u=0,d,h,p,m,g=0;function x(I){I.on("mousedown.drag",w).filter(s).on("touchstart.drag",b).on("touchmove.drag",S,G1).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(I,B){if(!(m||!e.call(this,I,B))){var T=N(this,t.call(this,I,B),I,B,"mouse");T&&(bn(I.view).on("mousemove.drag",k,Yo).on("mouseup.drag",E,Yo),iy(I.view),Dc(I),p=!1,d=I.clientX,h=I.clientY,T("start",I))}}function k(I){if($s(I),!p){var B=I.clientX-d,T=I.clientY-h;p=B*B+T*T>g}o.mouse("drag",I)}function E(I){bn(I.view).on("mousemove.drag mouseup.drag",null),sy(I.view,p),$s(I),o.mouse("end",I)}function b(I,B){if(e.call(this,I,B)){var T=I.changedTouches,D=t.call(this,I,B),G=T.length,U,q;for(U=0;U<G;++U)(q=N(this,D,I,B,T[U].identifier,T[U]))&&(Dc(I),q("start",I,T[U]))}}function S(I){var B=I.changedTouches,T=B.length,D,G;for(D=0;D<T;++D)(G=o[B[D].identifier])&&($s(I),G("drag",I,B[D]))}function C(I){var B=I.changedTouches,T=B.length,D,G;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),D=0;D<T;++D)(G=o[B[D].identifier])&&(Dc(I),G("end",I,B[D]))}function N(I,B,T,D,G,U){var q=a.copy(),F=Kn(U||T,B),W,J,z;if((z=r.call(I,new dd("beforestart",{sourceEvent:T,target:x,identifier:G,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:q}),D))!=null)return W=z.x-F[0]||0,J=z.y-F[1]||0,function O($,Q,M){var V=F,j;switch($){case"start":o[G]=O,j=u++;break;case"end":delete o[G],--u;case"drag":F=Kn(M||Q,B),j=u;break}q.call($,I,new dd($,{sourceEvent:Q,subject:z,target:x,identifier:G,active:j,x:F[0]+W,y:F[1]+J,dx:F[0]-V[0],dy:F[1]-V[1],dispatch:q}),D)}}return x.filter=function(I){return arguments.length?(e=typeof I=="function"?I:fa(!!I),x):e},x.container=function(I){return arguments.length?(t=typeof I=="function"?I:fa(I),x):t},x.subject=function(I){return arguments.length?(r=typeof I=="function"?I:fa(I),x):r},x.touchable=function(I){return arguments.length?(s=typeof I=="function"?I:fa(!!I),x):s},x.on=function(){var I=a.on.apply(a,arguments);return I===a?x:I},x.clickDistance=function(I){return arguments.length?(g=(I=+I)*I,x):Math.sqrt(g)},x}function Dd(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ly(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function ol(){}var Xo=.7,Pa=1/Xo,Bs="\\s*([+-]?\\d+)\\s*",qo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eS=/^#([0-9a-f]{3,8})$/,tS=new RegExp(`^rgb\\(${Bs},${Bs},${Bs}\\)$`),nS=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),rS=new RegExp(`^rgba\\(${Bs},${Bs},${Bs},${qo}\\)$`),iS=new RegExp(`^rgba\\(${mr},${mr},${mr},${qo}\\)$`),sS=new RegExp(`^hsl\\(${qo},${mr},${mr}\\)$`),oS=new RegExp(`^hsla\\(${qo},${mr},${mr},${qo}\\)$`),Bp={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};Dd(ol,Xi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hp,formatHex:Hp,formatHex8:lS,formatHsl:aS,formatRgb:Vp,toString:Vp});function Hp(){return this.rgb().formatHex()}function lS(){return this.rgb().formatHex8()}function aS(){return ay(this).formatHsl()}function Vp(){return this.rgb().formatRgb()}function Xi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=eS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Up(t):r===3?new cn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ha(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ha(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=tS.exec(e))?new cn(t[1],t[2],t[3],1):(t=nS.exec(e))?new cn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rS.exec(e))?ha(t[1],t[2],t[3],t[4]):(t=iS.exec(e))?ha(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sS.exec(e))?Xp(t[1],t[2]/100,t[3]/100,1):(t=oS.exec(e))?Xp(t[1],t[2]/100,t[3]/100,t[4]):Bp.hasOwnProperty(e)?Up(Bp[e]):e==="transparent"?new cn(NaN,NaN,NaN,0):null}function Up(e){return new cn(e>>16&255,e>>8&255,e&255,1)}function ha(e,t,r,s){return s<=0&&(e=t=r=NaN),new cn(e,t,r,s)}function uS(e){return e instanceof ol||(e=Xi(e)),e?(e=e.rgb(),new cn(e.r,e.g,e.b,e.opacity)):new cn}function fd(e,t,r,s){return arguments.length===1?uS(e):new cn(e,t,r,s??1)}function cn(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}Dd(cn,fd,ly(ol,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new cn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xo:Math.pow(Xo,e),new cn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cn(Wi(this.r),Wi(this.g),Wi(this.b),Aa(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:Wp,formatHex:Wp,formatHex8:cS,formatRgb:Yp,toString:Yp}));function Wp(){return`#${Ui(this.r)}${Ui(this.g)}${Ui(this.b)}`}function cS(){return`#${Ui(this.r)}${Ui(this.g)}${Ui(this.b)}${Ui((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yp(){const e=Aa(this.opacity);return`${e===1?"rgb(":"rgba("}${Wi(this.r)}, ${Wi(this.g)}, ${Wi(this.b)}${e===1?")":`, ${e})`}`}function Aa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ui(e){return e=Wi(e),(e<16?"0":"")+e.toString(16)}function Xp(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qn(e,t,r,s)}function ay(e){if(e instanceof Qn)return new Qn(e.h,e.s,e.l,e.opacity);if(e instanceof ol||(e=Xi(e)),!e)return new Qn;if(e instanceof Qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,o=Math.min(t,r,s),a=Math.max(t,r,s),u=NaN,d=a-o,h=(a+o)/2;return d?(t===a?u=(r-s)/d+(r<s)*6:r===a?u=(s-t)/d+2:u=(t-r)/d+4,d/=h<.5?a+o:2-a-o,u*=60):d=h>0&&h<1?0:u,new Qn(u,d,h,e.opacity)}function dS(e,t,r,s){return arguments.length===1?ay(e):new Qn(e,t,r,s??1)}function Qn(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}Dd(Qn,dS,ly(ol,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new Qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xo:Math.pow(Xo,e),new Qn(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,r=this.l,s=r+(r<.5?r:1-r)*t,o=2*r-s;return new cn(Fc(e>=240?e-240:e+120,o,s),Fc(e,o,s),Fc(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Qn(qp(this.h),pa(this.s),pa(this.l),Aa(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=Aa(this.opacity);return`${e===1?"hsl(":"hsla("}${qp(this.h)}, ${pa(this.s)*100}%, ${pa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qp(e){return e=(e||0)%360,e<0?e+360:e}function pa(e){return Math.max(0,Math.min(1,e||0))}function Fc(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Fd=e=>()=>e;function fS(e,t){return function(r){return e+r*t}}function hS(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function pS(e){return(e=+e)==1?uy:function(t,r){return r-t?hS(t,r,e):Fd(isNaN(t)?r:t)}}function uy(e,t){var r=t-e;return r?fS(e,r):Fd(isNaN(e)?t:e)}const Ma=(function e(t){var r=pS(t);function s(o,a){var u=r((o=fd(o)).r,(a=fd(a)).r),d=r(o.g,a.g),h=r(o.b,a.b),p=uy(o.opacity,a.opacity);return function(m){return o.r=u(m),o.g=d(m),o.b=h(m),o.opacity=p(m),o+""}}return s.gamma=e,s})(1);function mS(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,s=t.slice(),o;return function(a){for(o=0;o<r;++o)s[o]=e[o]*(1-a)+t[o]*a;return s}}function gS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yS(e,t){var r=t?t.length:0,s=e?Math.min(r,e.length):0,o=new Array(s),a=new Array(r),u;for(u=0;u<s;++u)o[u]=Bo(e[u],t[u]);for(;u<r;++u)a[u]=t[u];return function(d){for(u=0;u<s;++u)a[u]=o[u](d);return a}}function xS(e,t){var r=new Date;return e=+e,t=+t,function(s){return r.setTime(e*(1-s)+t*s),r}}function hr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function vS(e,t){var r={},s={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=Bo(e[o],t[o]):s[o]=t[o];return function(a){for(o in r)s[o]=r[o](a);return s}}var hd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oc=new RegExp(hd.source,"g");function wS(e){return function(){return e}}function SS(e){return function(t){return e(t)+""}}function cy(e,t){var r=hd.lastIndex=Oc.lastIndex=0,s,o,a,u=-1,d=[],h=[];for(e=e+"",t=t+"";(s=hd.exec(e))&&(o=Oc.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),d[u]?d[u]+=a:d[++u]=a),(s=s[0])===(o=o[0])?d[u]?d[u]+=o:d[++u]=o:(d[++u]=null,h.push({i:u,x:hr(s,o)})),r=Oc.lastIndex;return r<t.length&&(a=t.slice(r),d[u]?d[u]+=a:d[++u]=a),d.length<2?h[0]?SS(h[0].x):wS(t):(t=h.length,function(p){for(var m=0,g;m<t;++m)d[(g=h[m]).i]=g.x(p);return d.join("")})}function Bo(e,t){var r=typeof t,s;return t==null||r==="boolean"?Fd(t):(r==="number"?hr:r==="string"?(s=Xi(t))?(t=s,Ma):cy:t instanceof Xi?Ma:t instanceof Date?xS:gS(t)?mS:Array.isArray(t)?yS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?vS:hr)(e,t)}var Gp=180/Math.PI,pd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dy(e,t,r,s,o,a){var u,d,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*s)&&(r-=e*h,s-=t*h),(d=Math.sqrt(r*r+s*s))&&(r/=d,s/=d,h/=d),e*s<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*Gp,skewX:Math.atan(h)*Gp,scaleX:u,scaleY:d}}var ma;function kS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?pd:dy(t.a,t.b,t.c,t.d,t.e,t.f)}function NS(e){return e==null||(ma||(ma=document.createElementNS("http://www.w3.org/2000/svg","g")),ma.setAttribute("transform",e),!(e=ma.transform.baseVal.consolidate()))?pd:(e=e.matrix,dy(e.a,e.b,e.c,e.d,e.e,e.f))}function fy(e,t,r,s){function o(p){return p.length?p.pop()+" ":""}function a(p,m,g,x,w,k){if(p!==g||m!==x){var E=w.push("translate(",null,t,null,r);k.push({i:E-4,x:hr(p,g)},{i:E-2,x:hr(m,x)})}else(g||x)&&w.push("translate("+g+t+x+r)}function u(p,m,g,x){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),x.push({i:g.push(o(g)+"rotate(",null,s)-2,x:hr(p,m)})):m&&g.push(o(g)+"rotate("+m+s)}function d(p,m,g,x){p!==m?x.push({i:g.push(o(g)+"skewX(",null,s)-2,x:hr(p,m)}):m&&g.push(o(g)+"skewX("+m+s)}function h(p,m,g,x,w,k){if(p!==g||m!==x){var E=w.push(o(w)+"scale(",null,",",null,")");k.push({i:E-4,x:hr(p,g)},{i:E-2,x:hr(m,x)})}else(g!==1||x!==1)&&w.push(o(w)+"scale("+g+","+x+")")}return function(p,m){var g=[],x=[];return p=e(p),m=e(m),a(p.translateX,p.translateY,m.translateX,m.translateY,g,x),u(p.rotate,m.rotate,g,x),d(p.skewX,m.skewX,g,x),h(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,x),p=m=null,function(w){for(var k=-1,E=x.length,b;++k<E;)g[(b=x[k]).i]=b.x(w);return g.join("")}}}var ES=fy(kS,"px, ","px)","deg)"),bS=fy(NS,", ",")",")"),CS=1e-12;function Kp(e){return((e=Math.exp(e))+1/e)/2}function jS(e){return((e=Math.exp(e))-1/e)/2}function _S(e){return((e=Math.exp(2*e))-1)/(e+1)}const ba=(function e(t,r,s){function o(a,u){var d=a[0],h=a[1],p=a[2],m=u[0],g=u[1],x=u[2],w=m-d,k=g-h,E=w*w+k*k,b,S;if(E<CS)S=Math.log(x/p)/t,b=function(D){return[d+D*w,h+D*k,p*Math.exp(t*D*S)]};else{var C=Math.sqrt(E),N=(x*x-p*p+s*E)/(2*p*r*C),I=(x*x-p*p-s*E)/(2*x*r*C),B=Math.log(Math.sqrt(N*N+1)-N),T=Math.log(Math.sqrt(I*I+1)-I);S=(T-B)/t,b=function(D){var G=D*S,U=Kp(B),q=p/(r*C)*(U*_S(t*G+B)-jS(B));return[d+q*w,h+q*k,p*U/Kp(t*G+B)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return o.rho=function(a){var u=Math.max(.001,+a),d=u*u,h=d*d;return e(u,d,h)},o})(Math.SQRT2,2,4);var Ws=0,Oo=0,Mo=0,hy=1e3,za,$o,Ra=0,qi=0,Ya=0,Go=typeof performance=="object"&&performance.now?performance:Date,py=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Od(){return qi||(py(IS),qi=Go.now()+Ya)}function IS(){qi=0}function La(){this._call=this._time=this._next=null}La.prototype=my.prototype={constructor:La,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Od():+r)+(t==null?0:+t),!this._next&&$o!==this&&($o?$o._next=this:za=this,$o=this),this._call=e,this._time=r,md()},stop:function(){this._call&&(this._call=null,this._time=1/0,md())}};function my(e,t,r){var s=new La;return s.restart(e,t,r),s}function TS(){Od(),++Ws;for(var e=za,t;e;)(t=qi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ws}function Qp(){qi=(Ra=Go.now())+Ya,Ws=Oo=0;try{TS()}finally{Ws=0,AS(),qi=0}}function PS(){var e=Go.now(),t=e-Ra;t>hy&&(Ya-=t,Ra=e)}function AS(){for(var e,t=za,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:za=r);$o=e,md(s)}function md(e){if(!Ws){Oo&&(Oo=clearTimeout(Oo));var t=e-qi;t>24?(e<1/0&&(Oo=setTimeout(Qp,e-Go.now()-Ya)),Mo&&(Mo=clearInterval(Mo))):(Mo||(Ra=Go.now(),Mo=setInterval(PS,hy)),Ws=1,py(Qp))}}function Zp(e,t,r){var s=new La;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,r),s}var MS=Ua("start","end","cancel","interrupt"),zS=[],gy=0,Jp=1,gd=2,Ca=3,em=4,yd=5,ja=6;function Xa(e,t,r,s,o,a){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;RS(e,r,{name:t,index:s,group:o,on:MS,tween:zS,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:gy})}function $d(e,t){var r=er(e,t);if(r.state>gy)throw new Error("too late; already scheduled");return r}function vr(e,t){var r=er(e,t);if(r.state>Ca)throw new Error("too late; already running");return r}function er(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function RS(e,t,r){var s=e.__transition,o;s[t]=r,r.timer=my(a,0,r.time);function a(p){r.state=Jp,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var m,g,x,w;if(r.state!==Jp)return h();for(m in s)if(w=s[m],w.name===r.name){if(w.state===Ca)return Zp(u);w.state===em?(w.state=ja,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete s[m]):+m<t&&(w.state=ja,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete s[m])}if(Zp(function(){r.state===Ca&&(r.state=em,r.timer.restart(d,r.delay,r.time),d(p))}),r.state=gd,r.on.call("start",e,e.__data__,r.index,r.group),r.state===gd){for(r.state=Ca,o=new Array(x=r.tween.length),m=0,g=-1;m<x;++m)(w=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=w);o.length=g+1}}function d(p){for(var m=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=yd,1),g=-1,x=o.length;++g<x;)o[g].call(e,m);r.state===yd&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=ja,r.timer.stop(),delete s[t];for(var p in s)return;delete e.__transition}}function _a(e,t){var r=e.__transition,s,o,a=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((s=r[u]).name!==t){a=!1;continue}o=s.state>gd&&s.state<yd,s.state=ja,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[u]}a&&delete e.__transition}}function LS(e){return this.each(function(){_a(this,e)})}function DS(e,t){var r,s;return function(){var o=vr(this,e),a=o.tween;if(a!==r){s=r=a;for(var u=0,d=s.length;u<d;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function FS(e,t,r){var s,o;if(typeof r!="function")throw new Error;return function(){var a=vr(this,e),u=a.tween;if(u!==s){o=(s=u).slice();for(var d={name:t,value:r},h=0,p=o.length;h<p;++h)if(o[h].name===t){o[h]=d;break}h===p&&o.push(d)}a.tween=o}}function OS(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=er(this.node(),r).tween,o=0,a=s.length,u;o<a;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((t==null?DS:FS)(r,e,t))}function Bd(e,t,r){var s=e._id;return e.each(function(){var o=vr(this,s);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return er(o,s).value[t]}}function yy(e,t){var r;return(typeof t=="number"?hr:t instanceof Xi?Ma:(r=Xi(t))?(t=r,Ma):cy)(e,t)}function $S(e){return function(){this.removeAttribute(e)}}function BS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function HS(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttribute(e);return u===o?null:u===s?a:a=t(s=u,r)}}function VS(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?a:a=t(s=u,r)}}function US(e,t,r){var s,o,a;return function(){var u,d=r(this),h;return d==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=d+"",u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,d)))}}function WS(e,t,r){var s,o,a;return function(){var u,d=r(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=d+"",u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,d)))}}function YS(e,t){var r=Wa(e),s=r==="transform"?bS:yy;return this.attrTween(e,typeof t=="function"?(r.local?WS:US)(r,s,Bd(this,"attr."+e,t)):t==null?(r.local?BS:$S)(r):(r.local?VS:HS)(r,s,t))}function XS(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function qS(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function GS(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&qS(e,a)),r}return o._value=t,o}function KS(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&XS(e,a)),r}return o._value=t,o}function QS(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=Wa(e);return this.tween(r,(s.local?GS:KS)(s,t))}function ZS(e,t){return function(){$d(this,e).delay=+t.apply(this,arguments)}}function JS(e,t){return t=+t,function(){$d(this,e).delay=t}}function ek(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ZS:JS)(t,e)):er(this.node(),t).delay}function tk(e,t){return function(){vr(this,e).duration=+t.apply(this,arguments)}}function nk(e,t){return t=+t,function(){vr(this,e).duration=t}}function rk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tk:nk)(t,e)):er(this.node(),t).duration}function ik(e,t){if(typeof t!="function")throw new Error;return function(){vr(this,e).ease=t}}function sk(e){var t=this._id;return arguments.length?this.each(ik(t,e)):er(this.node(),t).ease}function ok(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;vr(this,e).ease=r}}function lk(e){if(typeof e!="function")throw new Error;return this.each(ok(this._id,e))}function ak(e){typeof e!="function"&&(e=qg(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,d=s[o]=[],h,p=0;p<u;++p)(h=a[p])&&e.call(h,h.__data__,p,a)&&d.push(h);return new Fr(s,this._parents,this._name,this._id)}function uk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,o=r.length,a=Math.min(s,o),u=new Array(s),d=0;d<a;++d)for(var h=t[d],p=r[d],m=h.length,g=u[d]=new Array(m),x,w=0;w<m;++w)(x=h[w]||p[w])&&(g[w]=x);for(;d<s;++d)u[d]=t[d];return new Fr(u,this._parents,this._name,this._id)}function ck(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function dk(e,t,r){var s,o,a=ck(t)?$d:vr;return function(){var u=a(this,e),d=u.on;d!==s&&(o=(s=d).copy()).on(t,r),u.on=o}}function fk(e,t){var r=this._id;return arguments.length<2?er(this.node(),r).on.on(e):this.each(dk(r,e,t))}function hk(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function pk(){return this.on("end.remove",hk(this._id))}function mk(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Rd(e));for(var s=this._groups,o=s.length,a=new Array(o),u=0;u<o;++u)for(var d=s[u],h=d.length,p=a[u]=new Array(h),m,g,x=0;x<h;++x)(m=d[x])&&(g=e.call(m,m.__data__,x,d))&&("__data__"in m&&(g.__data__=m.__data__),p[x]=g,Xa(p[x],t,r,x,p,er(m,r)));return new Fr(a,this._parents,t,r)}function gk(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Xg(e));for(var s=this._groups,o=s.length,a=[],u=[],d=0;d<o;++d)for(var h=s[d],p=h.length,m,g=0;g<p;++g)if(m=h[g]){for(var x=e.call(m,m.__data__,g,h),w,k=er(m,r),E=0,b=x.length;E<b;++E)(w=x[E])&&Xa(w,t,r,E,x,k);a.push(x),u.push(m)}return new Fr(a,u,t,r)}var yk=sl.prototype.constructor;function xk(){return new yk(this._groups,this._parents)}function vk(e,t){var r,s,o;return function(){var a=Us(this,e),u=(this.style.removeProperty(e),Us(this,e));return a===u?null:a===r&&u===s?o:o=t(r=a,s=u)}}function xy(e){return function(){this.style.removeProperty(e)}}function wk(e,t,r){var s,o=r+"",a;return function(){var u=Us(this,e);return u===o?null:u===s?a:a=t(s=u,r)}}function Sk(e,t,r){var s,o,a;return function(){var u=Us(this,e),d=r(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),Us(this,e))),u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,d))}}function kk(e,t){var r,s,o,a="style."+t,u="end."+a,d;return function(){var h=vr(this,e),p=h.on,m=h.value[a]==null?d||(d=xy(t)):void 0;(p!==r||o!==m)&&(s=(r=p).copy()).on(u,o=m),h.on=s}}function Nk(e,t,r){var s=(e+="")=="transform"?ES:yy;return t==null?this.styleTween(e,vk(e,s)).on("end.style."+e,xy(e)):typeof t=="function"?this.styleTween(e,Sk(e,s,Bd(this,"style."+e,t))).each(kk(this._id,e)):this.styleTween(e,wk(e,s,t),r).on("end.style."+e,null)}function Ek(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function bk(e,t,r){var s,o;function a(){var u=t.apply(this,arguments);return u!==o&&(s=(o=u)&&Ek(e,u,r)),s}return a._value=t,a}function Ck(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,bk(e,t,r??""))}function jk(e){return function(){this.textContent=e}}function _k(e){return function(){var t=e(this);this.textContent=t??""}}function Ik(e){return this.tween("text",typeof e=="function"?_k(Bd(this,"text",e)):jk(e==null?"":e+""))}function Tk(e){return function(t){this.textContent=e.call(this,t)}}function Pk(e){var t,r;function s(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&Tk(o)),t}return s._value=e,s}function Ak(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,Pk(e))}function Mk(){for(var e=this._name,t=this._id,r=vy(),s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var m=er(h,t);Xa(h,e,r,p,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Fr(s,this._parents,e,r)}function zk(){var e,t,r=this,s=r._id,o=r.size();return new Promise(function(a,u){var d={value:u},h={value:function(){--o===0&&a()}};r.each(function(){var p=vr(this,s),m=p.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(h)),p.on=t}),o===0&&a()})}var Rk=0;function Fr(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function vy(){return++Rk}var Lr=sl.prototype;Fr.prototype={constructor:Fr,select:mk,selectAll:gk,selectChild:Lr.selectChild,selectChildren:Lr.selectChildren,filter:ak,merge:uk,selection:xk,transition:Mk,call:Lr.call,nodes:Lr.nodes,node:Lr.node,size:Lr.size,empty:Lr.empty,each:Lr.each,on:fk,attr:YS,attrTween:QS,style:Nk,styleTween:Ck,text:Ik,textTween:Ak,remove:pk,tween:OS,delay:ek,duration:rk,ease:sk,easeVarying:lk,end:zk,[Symbol.iterator]:Lr[Symbol.iterator]};function Lk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Dk={time:null,delay:0,duration:250,ease:Lk};function Fk(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Ok(e){var t,r;e instanceof Fr?(t=e._id,e=e._name):(t=vy(),(r=Dk).time=Od(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],d=u.length,h,p=0;p<d;++p)(h=u[p])&&Xa(h,e,t,p,u,r||Fk(h,t));return new Fr(s,this._parents,e,t)}sl.prototype.interrupt=LS;sl.prototype.transition=Ok;const ga=e=>()=>e;function $k(e,{sourceEvent:t,target:r,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Dr(e,t,r){this.k=e,this.x=t,this.y=r}Dr.prototype={constructor:Dr,scale:function(e){return e===1?this:new Dr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Dr(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 qa=new Dr(1,0,0);wy.prototype=Dr.prototype;function wy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return qa;return e.__zoom}function $c(e){e.stopImmediatePropagation()}function zo(e){e.preventDefault(),e.stopImmediatePropagation()}function Bk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hk(){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 tm(){return this.__zoom||qa}function Vk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Uk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wk(e,t,r){var s=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u))}function Sy(){var e=Bk,t=Hk,r=Wk,s=Vk,o=Uk,a=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=ba,p=Ua("start","zoom","end"),m,g,x,w=500,k=150,E=0,b=10;function S(z){z.property("__zoom",tm).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(z,O,$,Q){var M=z.selection?z.selection():z;M.property("__zoom",tm),z!==M?B(z,O,$,Q):M.interrupt().each(function(){T(this,arguments).event(Q).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},S.scaleBy=function(z,O,$,Q){S.scaleTo(z,function(){var M=this.__zoom.k,V=typeof O=="function"?O.apply(this,arguments):O;return M*V},$,Q)},S.scaleTo=function(z,O,$,Q){S.transform(z,function(){var M=t.apply(this,arguments),V=this.__zoom,j=$==null?I(M):typeof $=="function"?$.apply(this,arguments):$,R=V.invert(j),Y=typeof O=="function"?O.apply(this,arguments):O;return r(N(C(V,Y),j,R),M,u)},$,Q)},S.translateBy=function(z,O,$,Q){S.transform(z,function(){return r(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),u)},null,Q)},S.translateTo=function(z,O,$,Q,M){S.transform(z,function(){var V=t.apply(this,arguments),j=this.__zoom,R=Q==null?I(V):typeof Q=="function"?Q.apply(this,arguments):Q;return r(qa.translate(R[0],R[1]).scale(j.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof $=="function"?-$.apply(this,arguments):-$),V,u)},Q,M)};function C(z,O){return O=Math.max(a[0],Math.min(a[1],O)),O===z.k?z:new Dr(O,z.x,z.y)}function N(z,O,$){var Q=O[0]-$[0]*z.k,M=O[1]-$[1]*z.k;return Q===z.x&&M===z.y?z:new Dr(z.k,Q,M)}function I(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function B(z,O,$,Q){z.on("start.zoom",function(){T(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(Q).end()}).tween("zoom",function(){var M=this,V=arguments,j=T(M,V).event(Q),R=t.apply(M,V),Y=$==null?I(R):typeof $=="function"?$.apply(M,V):$,A=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ae=M.__zoom,re=typeof O=="function"?O.apply(M,V):O,ce=h(ae.invert(Y).concat(A/ae.k),re.invert(Y).concat(A/re.k));return function(he){if(he===1)he=re;else{var se=ce(he),ge=A/se[2];he=new Dr(ge,Y[0]-se[0]*ge,Y[1]-se[1]*ge)}j.zoom(null,he)}})}function T(z,O,$){return!$&&z.__zooming||new D(z,O)}function D(z,O){this.that=z,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,O),this.taps=0}D.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,O){return this.mouse&&z!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var O=bn(this.that).datum();p.call(z,this.that,new $k(z,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:p}),O)}};function G(z,...O){if(!e.apply(this,arguments))return;var $=T(this,O).event(z),Q=this.__zoom,M=Math.max(a[0],Math.min(a[1],Q.k*Math.pow(2,s.apply(this,arguments)))),V=Kn(z);if($.wheel)($.mouse[0][0]!==V[0]||$.mouse[0][1]!==V[1])&&($.mouse[1]=Q.invert($.mouse[0]=V)),clearTimeout($.wheel);else{if(Q.k===M)return;$.mouse=[V,Q.invert(V)],_a(this),$.start()}zo(z),$.wheel=setTimeout(j,k),$.zoom("mouse",r(N(C(Q,M),$.mouse[0],$.mouse[1]),$.extent,u));function j(){$.wheel=null,$.end()}}function U(z,...O){if(x||!e.apply(this,arguments))return;var $=z.currentTarget,Q=T(this,O,!0).event(z),M=bn(z.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",A,!0),V=Kn(z,$),j=z.clientX,R=z.clientY;iy(z.view),$c(z),Q.mouse=[V,this.__zoom.invert(V)],_a(this),Q.start();function Y(ae){if(zo(ae),!Q.moved){var re=ae.clientX-j,ce=ae.clientY-R;Q.moved=re*re+ce*ce>E}Q.event(ae).zoom("mouse",r(N(Q.that.__zoom,Q.mouse[0]=Kn(ae,$),Q.mouse[1]),Q.extent,u))}function A(ae){M.on("mousemove.zoom mouseup.zoom",null),sy(ae.view,Q.moved),zo(ae),Q.event(ae).end()}}function q(z,...O){if(e.apply(this,arguments)){var $=this.__zoom,Q=Kn(z.changedTouches?z.changedTouches[0]:z,this),M=$.invert(Q),V=$.k*(z.shiftKey?.5:2),j=r(N(C($,V),Q,M),t.apply(this,O),u);zo(z),d>0?bn(this).transition().duration(d).call(B,j,Q,z):bn(this).call(S.transform,j,Q,z)}}function F(z,...O){if(e.apply(this,arguments)){var $=z.touches,Q=$.length,M=T(this,O,z.changedTouches.length===Q).event(z),V,j,R,Y;for($c(z),j=0;j<Q;++j)R=$[j],Y=Kn(R,this),Y=[Y,this.__zoom.invert(Y),R.identifier],M.touch0?!M.touch1&&M.touch0[2]!==Y[2]&&(M.touch1=Y,M.taps=0):(M.touch0=Y,V=!0,M.taps=1+!!m);m&&(m=clearTimeout(m)),V&&(M.taps<2&&(g=Y[0],m=setTimeout(function(){m=null},w)),_a(this),M.start())}}function W(z,...O){if(this.__zooming){var $=T(this,O).event(z),Q=z.changedTouches,M=Q.length,V,j,R,Y;for(zo(z),V=0;V<M;++V)j=Q[V],R=Kn(j,this),$.touch0&&$.touch0[2]===j.identifier?$.touch0[0]=R:$.touch1&&$.touch1[2]===j.identifier&&($.touch1[0]=R);if(j=$.that.__zoom,$.touch1){var A=$.touch0[0],ae=$.touch0[1],re=$.touch1[0],ce=$.touch1[1],he=(he=re[0]-A[0])*he+(he=re[1]-A[1])*he,se=(se=ce[0]-ae[0])*se+(se=ce[1]-ae[1])*se;j=C(j,Math.sqrt(he/se)),R=[(A[0]+re[0])/2,(A[1]+re[1])/2],Y=[(ae[0]+ce[0])/2,(ae[1]+ce[1])/2]}else if($.touch0)R=$.touch0[0],Y=$.touch0[1];else return;$.zoom("touch",r(N(j,R,Y),$.extent,u))}}function J(z,...O){if(this.__zooming){var $=T(this,O).event(z),Q=z.changedTouches,M=Q.length,V,j;for($c(z),x&&clearTimeout(x),x=setTimeout(function(){x=null},w),V=0;V<M;++V)j=Q[V],$.touch0&&$.touch0[2]===j.identifier?delete $.touch0:$.touch1&&$.touch1[2]===j.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(j=Kn(j,this),Math.hypot(g[0]-j[0],g[1]-j[1])<b)){var R=bn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return S.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:ga(+z),S):s},S.filter=function(z){return arguments.length?(e=typeof z=="function"?z:ga(!!z),S):e},S.touchable=function(z){return arguments.length?(o=typeof z=="function"?z:ga(!!z),S):o},S.extent=function(z){return arguments.length?(t=typeof z=="function"?z:ga([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),S):t},S.scaleExtent=function(z){return arguments.length?(a[0]=+z[0],a[1]=+z[1],S):[a[0],a[1]]},S.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(z){return arguments.length?(r=z,S):r},S.duration=function(z){return arguments.length?(d=+z,S):d},S.interpolate=function(z){return arguments.length?(h=z,S):h},S.on=function(){var z=p.on.apply(p,arguments);return z===p?S:z},S.clickDistance=function(z){return arguments.length?(E=(z=+z)*z,S):Math.sqrt(E)},S.tapDistance=function(z){return arguments.length?(b=+z,S):b},S}const yr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:s}", 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."},Ko=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ky=["Enter"," ","Escape"],Ny={"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:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"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 Gi;(function(e){e.Strict="strict",e.Loose="loose"})(Gi||(Gi={}));var Yi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yi||(Yi={}));var Qo;(function(e){e.Partial="partial",e.Full="full"})(Qo||(Qo={}));const Ey={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var mi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(mi||(mi={}));var Zo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Zo||(Zo={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));const nm={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top};function by(e){return e===null?null:e?"valid":"invalid"}const Cy=e=>"id"in e&&"source"in e&&"target"in e,Yk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ll=(e,t=[0,0])=>{const{width:r,height:s}=Or(e),o=e.origin??t,a=r*o[0],u=s*o[1];return{x:e.position.x-a,y:e.position.y-u}},Xk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,o)=>{const a=typeof o=="string";let u=!t.nodeLookup&&!a?o:void 0;t.nodeLookup&&(u=a?t.nodeLookup.get(o):Hd(o)?o:t.nodeLookup.get(o.id));const d=u?Da(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ga(s,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ka(r)},al=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(r=Ga(r,Da(o)),s=!0)}),s?Ka(r):{x:0,y:0,width:0,height:0}},Vd=(e,t,[r,s,o]=[0,0,1],a=!1,u=!1)=>{const d={...cl(t,[r,s,o]),width:t.width/o,height:t.height/o},h=[];for(const p of e.values()){const{measured:m,selectable:g=!0,hidden:x=!1}=p;if(u&&!g||x)continue;const w=m.width??p.width??p.initialWidth??null,k=m.height??p.height??p.initialHeight??null,E=Jo(d,Xs(p)),b=(w??0)*(k??0),S=a&&E>0;(!p.internals.handleBounds||S||E>=b||p.dragging)&&h.push(p)}return h},qk=(e,t)=>{const r=new Set;return e.forEach(s=>{r.add(s.id)}),t.filter(s=>r.has(s.source)||r.has(s.target))};function Gk(e,t){const r=new Map,s=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)&&(!s||s.has(o.id))&&r.set(o.id,o)}),r}async function Kk({nodes:e,width:t,height:r,panZoom:s,minZoom:o,maxZoom:a},u){if(e.size===0)return Promise.resolve(!0);const d=Gk(e,u),h=al(d),p=Ud(h,t,r,(u==null?void 0:u.minZoom)??o,(u==null?void 0:u.maxZoom)??a,(u==null?void 0:u.padding)??.1);return await s.setViewport(p,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function jy({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:s=[0,0],nodeExtent:o,onError:a}){const u=r.get(e),d=u.parentId?r.get(u.parentId):void 0,{x:h,y:p}=d?d.internals.positionAbsolute:{x:0,y:0},m=u.origin??s;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)a==null||a("005",yr.error005());else{const w=d.measured.width,k=d.measured.height;w&&k&&(g=[[h,p],[h+w,p+k]])}else d&&qs(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const x=qs(g)?Ki(t,g,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(a==null||a("015",yr.error015())),{position:{x:x.x-h+(u.measured.width??0)*m[0],y:x.y-p+(u.measured.height??0)*m[1]},positionAbsolute:x}}async function Qk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:s,onBeforeDelete:o}){const a=new Set(e.map(x=>x.id)),u=[];for(const x of r){if(x.deletable===!1)continue;const w=a.has(x.id),k=!w&&x.parentId&&u.find(E=>E.id===x.parentId);(w||k)&&u.push(x)}const d=new Set(t.map(x=>x.id)),h=s.filter(x=>x.deletable!==!1),m=qk(u,h);for(const x of h)d.has(x.id)&&!m.find(k=>k.id===x.id)&&m.push(x);if(!o)return{edges:m,nodes:u};const g=await o({nodes:u,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:u}:{edges:[],nodes:[]}:g}const Ys=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),Ki=(e={x:0,y:0},t,r)=>({x:Ys(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:Ys(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function _y(e,t,r){const{width:s,height:o}=Or(r),{x:a,y:u}=r.internals.positionAbsolute;return Ki(e,[[a,u],[a+s,u+o]],t)}const rm=(e,t,r)=>e<t?Ys(Math.abs(e-t),1,t)/t:e>r?-Ys(Math.abs(e-r),1,t)/t:0,Iy=(e,t,r=15,s=40)=>{const o=rm(e.x,s,t.width-s)*r,a=rm(e.y,s,t.height-s)*r;return[o,a]},Ga=(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)}),xd=({x:e,y:t,width:r,height:s})=>({x:e,y:t,x2:e+r,y2:t+s}),Ka=({x:e,y:t,x2:r,y2:s})=>({x:e,y:t,width:r-e,height:s-t}),Xs=(e,t=[0,0])=>{var o,a;const{x:r,y:s}=Hd(e)?e.internals.positionAbsolute:ll(e,t);return{x:r,y:s,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}},Da=(e,t=[0,0])=>{var o,a;const{x:r,y:s}=Hd(e)?e.internals.positionAbsolute:ll(e,t);return{x:r,y:s,x2:r+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},Ty=(e,t)=>Ka(Ga(xd(e),xd(t))),Jo=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*s)},im=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),Zk=(e,t)=>{},ul=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),cl=({x:e,y:t},[r,s,o],a=!1,u=[1,1])=>{const d={x:(e-r)/o,y:(t-s)/o};return a?ul(d,u):d},Fa=({x:e,y:t},[r,s,o])=>({x:e*o+r,y:t*o+s});function Ps(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Jk(e,t,r){if(typeof e=="string"||typeof e=="number"){const s=Ps(e,r),o=Ps(e,t);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof e=="object"){const s=Ps(e.top??e.y??0,r),o=Ps(e.bottom??e.y??0,r),a=Ps(e.left??e.x??0,t),u=Ps(e.right??e.x??0,t);return{top:s,right:u,bottom:o,left:a,x:a+u,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function eN(e,t,r,s,o,a){const{x:u,y:d}=Fa(e,[t,r,s]),{x:h,y:p}=Fa({x:e.x+e.width,y:e.y+e.height},[t,r,s]),m=o-h,g=a-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(m),bottom:Math.floor(g)}}const Ud=(e,t,r,s,o,a)=>{const u=Jk(a,t,r),d=(t-u.x)/e.width,h=(r-u.y)/e.height,p=Math.min(d,h),m=Ys(p,s,o),g=e.x+e.width/2,x=e.y+e.height/2,w=t/2-g*m,k=r/2-x*m,E=eN(e,w,k,m,t,r),b={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:w-b.left+b.right,y:k-b.top+b.bottom,zoom:m}},el=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qs(e){return e!=null&&e!=="parent"}function Or(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function Py(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function Ay(e,t={width:0,height:0},r,s,o){const a={...e},u=s.get(r);if(u){const d=u.origin||o;a.x+=u.internals.positionAbsolute.x-(t.width??0)*d[0],a.y+=u.internals.positionAbsolute.y-(t.height??0)*d[1]}return a}function sm(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function tN(){let e,t;return{promise:new Promise((s,o)=>{e=s,t=o}),resolve:e,reject:t}}function nN(e){return{...Ny,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:s,containerBounds:o}){const{x:a,y:u}=Jn(e),d=cl({x:a-((o==null?void 0:o.left)??0),y:u-((o==null?void 0:o.top)??0)},s),{x:h,y:p}=r?ul(d,t):d;return{xSnapped:h,ySnapped:p,...d}}const Wd=e=>({width:e.offsetWidth,height:e.offsetHeight}),My=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},rN=["INPUT","SELECT","TEXTAREA"];function zy(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:rN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ry=e=>"clientX"in e,Jn=(e,t)=>{var a,u;const r=Ry(e),s=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},om=(e,t,r,s,o)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(d.left-r.left)/s,y:(d.top-r.top)/s,...Wd(u)}})};function Ly({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:a,targetControlX:u,targetControlY:d}){const h=e*.125+o*.375+u*.375+r*.125,p=t*.125+a*.375+d*.375+s*.125,m=Math.abs(h-e),g=Math.abs(p-t);return[h,p,m,g]}function ya(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function lm({pos:e,x1:t,y1:r,x2:s,y2:o,c:a}){switch(e){case Te.Left:return[t-ya(t-s,a),r];case Te.Right:return[t+ya(s-t,a),r];case Te.Top:return[t,r-ya(r-o,a)];case Te.Bottom:return[t,r+ya(o-r,a)]}}function Dy({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top,curvature:u=.25}){const[d,h]=lm({pos:r,x1:e,y1:t,x2:s,y2:o,c:u}),[p,m]=lm({pos:a,x1:s,y1:o,x2:e,y2:t,c:u}),[g,x,w,k]=Ly({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:m});return[`M${e},${t} C${d},${h} ${p},${m} ${s},${o}`,g,x,w,k]}function Fy({sourceX:e,sourceY:t,targetX:r,targetY:s}){const o=Math.abs(r-e)/2,a=r<e?r+o:r-o,u=Math.abs(s-t)/2,d=s<t?s+u:s-u;return[a,d,o,u]}function iN({sourceNode:e,targetNode:t,selected:r=!1,zIndex:s=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if(a==="manual")return s;const u=o&&r?s+1e3:s,d=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return u+d}function sN({sourceNode:e,targetNode:t,width:r,height:s,transform:o}){const a=Ga(Da(e),Da(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:s/o[2]};return Jo(u,Ka(a))>0}const Oy=({source:e,sourceHandle:t,target:r,targetHandle:s})=>`xy-edge__${e}${t||""}-${r}${s||""}`,oN=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),$y=(e,t,r={})=>{if(!e.source||!e.target)return t;const s=r.getEdgeId||Oy;let o;return Cy(e)?o={...e}:o={...e,id:s(e)},oN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))},lN=(e,t,r,s={shouldReplaceId:!0})=>{const{id:o,...a}=e;if(!t.source||!t.target||!r.find(p=>p.id===e.id))return r;const d=s.getEdgeId||Oy,h={...a,id:s.shouldReplaceId?d(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return r.filter(p=>p.id!==o).concat(h)};function By({sourceX:e,sourceY:t,targetX:r,targetY:s}){const[o,a,u,d]=Fy({sourceX:e,sourceY:t,targetX:r,targetY:s});return[`M ${e},${t}L ${r},${s}`,o,a,u,d]}const am={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},aN=({source:e,sourcePosition:t=Te.Bottom,target:r})=>t===Te.Left||t===Te.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},um=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function uN({source:e,sourcePosition:t=Te.Bottom,target:r,targetPosition:s=Te.Top,center:o,offset:a,stepPosition:u}){const d=am[t],h=am[s],p={x:e.x+d.x*a,y:e.y+d.y*a},m={x:r.x+h.x*a,y:r.y+h.y*a},g=aN({source:p,sourcePosition:t,target:m}),x=g.x!==0?"x":"y",w=g[x];let k=[],E,b;const S={x:0,y:0},C={x:0,y:0},[,,N,I]=Fy({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(d[x]*h[x]===-1){x==="x"?(E=o.x??p.x+(m.x-p.x)*u,b=o.y??(p.y+m.y)/2):(E=o.x??(p.x+m.x)/2,b=o.y??p.y+(m.y-p.y)*u);const T=[{x:E,y:p.y},{x:E,y:m.y}],D=[{x:p.x,y:b},{x:m.x,y:b}];d[x]===w?k=x==="x"?T:D:k=x==="x"?D:T}else{const T=[{x:p.x,y:m.y}],D=[{x:m.x,y:p.y}];if(x==="x"?k=d.x===w?D:T:k=d.y===w?T:D,t===s){const W=Math.abs(e[x]-r[x]);if(W<=a){const J=Math.min(a-1,a-W);d[x]===w?S[x]=(p[x]>e[x]?-1:1)*J:C[x]=(m[x]>r[x]?-1:1)*J}}if(t!==s){const W=x==="x"?"y":"x",J=d[x]===h[W],z=p[W]>m[W],O=p[W]<m[W];(d[x]===1&&(!J&&z||J&&O)||d[x]!==1&&(!J&&O||J&&z))&&(k=x==="x"?T:D)}const G={x:p.x+S.x,y:p.y+S.y},U={x:m.x+C.x,y:m.y+C.y},q=Math.max(Math.abs(G.x-k[0].x),Math.abs(U.x-k[0].x)),F=Math.max(Math.abs(G.y-k[0].y),Math.abs(U.y-k[0].y));q>=F?(E=(G.x+U.x)/2,b=k[0].y):(E=k[0].x,b=(G.y+U.y)/2)}return[[e,{x:p.x+S.x,y:p.y+S.y},...k,{x:m.x+C.x,y:m.y+C.y},r],E,b,N,I]}function cN(e,t,r,s){const o=Math.min(um(e,t)/2,um(t,r)/2,s),{x:a,y:u}=t;if(e.x===a&&a===r.x||e.y===u&&u===r.y)return`L${a} ${u}`;if(e.y===u){const p=e.x<r.x?-1:1,m=e.y<r.y?1:-1;return`L ${a+o*p},${u}Q ${a},${u} ${a},${u+o*m}`}const d=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${a},${u+o*h}Q ${a},${u} ${a+o*d},${u}`}function vd({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:m=.5}){const[g,x,w,k,E]=uN({source:{x:e,y:t},sourcePosition:r,target:{x:s,y:o},targetPosition:a,center:{x:d,y:h},offset:p,stepPosition:m});return[g.reduce((S,C,N)=>{let I="";return N>0&&N<g.length-1?I=cN(g[N-1],C,g[N+1],u):I=`${N===0?"M":"L"}${C.x} ${C.y}`,S+=I,S},""),x,w,k,E]}function cm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function dN(e){var g;const{sourceNode:t,targetNode:r}=e;if(!cm(t)||!cm(r))return null;const s=t.internals.handleBounds||dm(t.handles),o=r.internals.handleBounds||dm(r.handles),a=fm((s==null?void 0:s.source)??[],e.sourceHandle),u=fm(e.connectionMode===Gi.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!u)return(g=e.onError)==null||g.call(e,"008",yr.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=(a==null?void 0:a.position)||Te.Bottom,h=(u==null?void 0:u.position)||Te.Top,p=Qi(t,a,d),m=Qi(r,u,h);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:d,targetPosition:h}}function dm(e){if(!e)return null;const t=[],r=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&r.push(s);return{source:t,target:r}}function Qi(e,t,r=Te.Left,s=!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:u,height:d}=t??Or(e);if(s)return{x:o+u/2,y:a+d/2};switch((t==null?void 0:t.position)??r){case Te.Top:return{x:o+u/2,y:a};case Te.Right:return{x:o+u,y:a+d/2};case Te.Bottom:return{x:o+u/2,y:a+d};case Te.Left:return{x:o,y:a+d/2}}}function fm(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function wd(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function fN(e,{id:t,defaultColor:r,defaultMarkerStart:s,defaultMarkerEnd:o}){const a=new Set;return e.reduce((u,d)=>([d.markerStart||s,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=wd(h,t);a.has(p)||(u.push({id:p,color:h.color||r,...h}),a.add(p))}}),u),[]).sort((u,d)=>u.id.localeCompare(d.id))}const Hy=1e3,hN=10,Yd={nodeOrigin:[0,0],nodeExtent:Ko,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},pN={...Yd,checkEquality:!0};function Xd(e,t){const r={...e};for(const s in t)t[s]!==void 0&&(r[s]=t[s]);return r}function mN(e,t,r){const s=Xd(Yd,r);for(const o of e.values())if(o.parentId)Gd(o,e,t,s);else{const a=ll(o,s.nodeOrigin),u=qs(o.extent)?o.extent:s.nodeExtent,d=Ki(a,u,Or(o));o.internals.positionAbsolute=d}}function gN(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],s=[];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"?r.push(a):o.type==="target"&&s.push(a)}return{source:r,target:s}}function qd(e){return e==="manual"}function Sd(e,t,r,s={}){var p,m;const o=Xd(pN,s),a={i:0},u=new Map(t),d=o!=null&&o.elevateNodesOnSelect&&!qd(o.zIndexMode)?Hy:0;let h=e.length>0;t.clear(),r.clear();for(const g of e){let x=u.get(g.id);if(o.checkEquality&&g===(x==null?void 0:x.internals.userNode))t.set(g.id,x);else{const w=ll(g,o.nodeOrigin),k=qs(g.extent)?g.extent:o.nodeExtent,E=Ki(w,k,Or(g));x={...o.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:E,handleBounds:gN(g,x),z:Vy(g,d,o.zIndexMode),userNode:g}},t.set(g.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(h=!1),g.parentId&&Gd(x,t,r,s,a)}return h}function yN(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Gd(e,t,r,s,o){const{elevateNodesOnSelect:a,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=Xd(Yd,s),p=e.parentId,m=t.get(p);if(!m){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}yN(e,r),o&&!m.parentId&&m.internals.rootParentIndex===void 0&&h==="auto"&&(m.internals.rootParentIndex=++o.i,m.internals.z=m.internals.z+o.i*hN),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const g=a&&!qd(h)?Hy:0,{x,y:w,z:k}=xN(e,m,u,d,g,h),{positionAbsolute:E}=e.internals,b=x!==E.x||w!==E.y;(b||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x,y:w}:E,z:k}})}function Vy(e,t,r){const s=Zn(e.zIndex)?e.zIndex:0;return qd(r)?s:s+(e.selected?t:0)}function xN(e,t,r,s,o,a){const{x:u,y:d}=t.internals.positionAbsolute,h=Or(e),p=ll(e,r),m=qs(e.extent)?Ki(p,e.extent,h):p;let g=Ki({x:u+m.x,y:d+m.y},s,h);e.extent==="parent"&&(g=_y(g,h,t));const x=Vy(e,o,a),w=t.internals.z??0;return{x:g.x,y:g.y,z:w>=x?w+1:x}}function Kd(e,t,r,s=[0,0]){var u;const o=[],a=new Map;for(const d of e){const h=t.get(d.parentId);if(!h)continue;const p=((u=a.get(d.parentId))==null?void 0:u.expandedRect)??Xs(h),m=Ty(p,d.rect);a.set(d.parentId,{expandedRect:m,parent:h})}return a.size>0&&a.forEach(({expandedRect:d,parent:h},p)=>{var N;const m=h.internals.positionAbsolute,g=Or(h),x=h.origin??s,w=d.x<m.x?Math.round(Math.abs(m.x-d.x)):0,k=d.y<m.y?Math.round(Math.abs(m.y-d.y)):0,E=Math.max(g.width,Math.round(d.width)),b=Math.max(g.height,Math.round(d.height)),S=(E-g.width)*x[0],C=(b-g.height)*x[1];(w>0||k>0||S||C)&&(o.push({id:p,type:"position",position:{x:h.position.x-w+S,y:h.position.y-k+C}}),(N=r.get(p))==null||N.forEach(I=>{e.some(B=>B.id===I.id)||o.push({id:I.id,type:"position",position:{x:I.position.x+w,y:I.position.y+k}})})),(g.width<d.width||g.height<d.height||w||k)&&o.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:E+(w?x[0]*w-S:0),height:b+(k?x[1]*k-C:0)}})}),o}function vN(e,t,r,s,o,a,u){const d=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],m=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const w of e.values()){const k=t.get(w.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),h=!0;continue}const E=Wd(w.nodeElement),b=k.measured.width!==E.width||k.measured.height!==E.height;if(!!(E.width&&E.height&&(b||!k.internals.handleBounds||w.force))){const C=w.nodeElement.getBoundingClientRect(),N=qs(k.extent)?k.extent:a;let{positionAbsolute:I}=k.internals;k.parentId&&k.extent==="parent"?I=_y(I,E,t.get(k.parentId)):N&&(I=Ki(I,N,E));const B={...k,measured:E,internals:{...k.internals,positionAbsolute:I,handleBounds:{source:om("source",w.nodeElement,C,g,k.id),target:om("target",w.nodeElement,C,g,k.id)}}};t.set(k.id,B),k.parentId&&Gd(B,t,r,{nodeOrigin:o,zIndexMode:u}),h=!0,b&&(p.push({id:k.id,type:"dimensions",dimensions:E}),k.expandParent&&k.parentId&&x.push({id:k.id,parentId:k.parentId,rect:Xs(B,o)}))}}if(x.length>0){const w=Kd(x,t,r,o);p.push(...w)}return{changes:p,updatedInternals:h}}async function wN({delta:e,panZoom:t,transform:r,translateExtent:s,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[o,a]],s),d=!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2]);return Promise.resolve(d)}function hm(e,t,r,s,o,a){let u=o;const d=s.get(u)||new Map;s.set(u,d.set(r,t)),u=`${o}-${e}`;const h=s.get(u)||new Map;if(s.set(u,h.set(r,t)),a){u=`${o}-${e}-${a}`;const p=s.get(u)||new Map;s.set(u,p.set(r,t))}}function Uy(e,t,r){e.clear(),t.clear();for(const s of r){const{source:o,target:a,sourceHandle:u=null,targetHandle:d=null}=s,h={edgeId:s.id,source:o,target:a,sourceHandle:u,targetHandle:d},p=`${o}-${u}--${a}-${d}`,m=`${a}-${d}--${o}-${u}`;hm("source",h,m,e,o,u),hm("target",h,p,e,a,d),t.set(s.id,s)}}function Wy(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:Wy(r,t):!1}function pm(e,t,r){var o;let s=e;do{if((o=s==null?void 0:s.matches)!=null&&o.call(s,t))return!0;if(s===r)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function SN(e,t,r,s){const o=new Map;for(const[a,u]of e)if((u.selected||u.id===s)&&(!u.parentId||!Wy(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const d=e.get(a);d&&o.set(a,{id:a,position:d.position||{x:0,y:0},distance:{x:r.x-d.internals.positionAbsolute.x,y:r.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function Bc({nodeId:e,dragItems:t,nodeLookup:r,dragging:s=!0}){var u,d,h;const o=[];for(const[p,m]of t){const g=(u=r.get(p))==null?void 0:u.internals.userNode;g&&o.push({...g,position:m.position,dragging:s})}if(!e)return[o[0],o];const a=(d=r.get(e))==null?void 0:d.internals.userNode;return[a?{...a,position:((h=t.get(e))==null?void 0:h.position)||a.position,dragging:s}:o[0],o]}function kN({dragItems:e,snapGrid:t,x:r,y:s}){const o=e.values().next().value;if(!o)return null;const a={x:r-o.distance.x,y:s-o.distance.y},u=ul(a,t);return{x:u.x-a.x,y:u.y-a.y}}function NN({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:s,onDragStop:o}){let a={x:null,y:null},u=0,d=new Map,h=!1,p={x:0,y:0},m=null,g=!1,x=null,w=!1,k=!1,E=null;function b({noDragClassName:C,handleSelector:N,domNode:I,isSelectable:B,nodeId:T,nodeClickDistance:D=0}){x=bn(I);function G({x:W,y:J}){const{nodeLookup:z,nodeExtent:O,snapGrid:$,snapToGrid:Q,nodeOrigin:M,onNodeDrag:V,onSelectionDrag:j,onError:R,updateNodePositions:Y}=t();a={x:W,y:J};let A=!1;const ae=d.size>1,re=ae&&O?xd(al(d)):null,ce=ae&&Q?kN({dragItems:d,snapGrid:$,x:W,y:J}):null;for(const[he,se]of d){if(!z.has(he))continue;let ge={x:W-se.distance.x,y:J-se.distance.y};Q&&(ge=ce?{x:Math.round(ge.x+ce.x),y:Math.round(ge.y+ce.y)}:ul(ge,$));let be=null;if(ae&&O&&!se.extent&&re){const{positionAbsolute:ke}=se.internals,Ve=ke.x-re.x+O[0][0],We=ke.x+se.measured.width-re.x2+O[1][0],Oe=ke.y-re.y+O[0][1],tt=ke.y+se.measured.height-re.y2+O[1][1];be=[[Ve,Oe],[We,tt]]}const{position:Pe,positionAbsolute:Ee}=jy({nodeId:he,nextPosition:ge,nodeLookup:z,nodeExtent:be||O,nodeOrigin:M,onError:R});A=A||se.position.x!==Pe.x||se.position.y!==Pe.y,se.position=Pe,se.internals.positionAbsolute=Ee}if(k=k||A,!!A&&(Y(d,!0),E&&(s||V||!T&&j))){const[he,se]=Bc({nodeId:T,dragItems:d,nodeLookup:z});s==null||s(E,d,he,se),V==null||V(E,he,se),T||j==null||j(E,se)}}async function U(){if(!m)return;const{transform:W,panBy:J,autoPanSpeed:z,autoPanOnNodeDrag:O}=t();if(!O){h=!1,cancelAnimationFrame(u);return}const[$,Q]=Iy(p,m,z);($!==0||Q!==0)&&(a.x=(a.x??0)-$/W[2],a.y=(a.y??0)-Q/W[2],await J({x:$,y:Q})&&G(a)),u=requestAnimationFrame(U)}function q(W){var ae;const{nodeLookup:J,multiSelectionActive:z,nodesDraggable:O,transform:$,snapGrid:Q,snapToGrid:M,selectNodesOnDrag:V,onNodeDragStart:j,onSelectionDragStart:R,unselectNodesAndEdges:Y}=t();g=!0,(!V||!B)&&!z&&T&&((ae=J.get(T))!=null&&ae.selected||Y()),B&&V&&T&&(e==null||e(T));const A=Ho(W.sourceEvent,{transform:$,snapGrid:Q,snapToGrid:M,containerBounds:m});if(a=A,d=SN(J,O,A,T),d.size>0&&(r||j||!T&&R)){const[re,ce]=Bc({nodeId:T,dragItems:d,nodeLookup:J});r==null||r(W.sourceEvent,d,re,ce),j==null||j(W.sourceEvent,re,ce),T||R==null||R(W.sourceEvent,ce)}}const F=oy().clickDistance(D).on("start",W=>{const{domNode:J,nodeDragThreshold:z,transform:O,snapGrid:$,snapToGrid:Q}=t();m=(J==null?void 0:J.getBoundingClientRect())||null,w=!1,k=!1,E=W.sourceEvent,z===0&&q(W),a=Ho(W.sourceEvent,{transform:O,snapGrid:$,snapToGrid:Q,containerBounds:m}),p=Jn(W.sourceEvent,m)}).on("drag",W=>{const{autoPanOnNodeDrag:J,transform:z,snapGrid:O,snapToGrid:$,nodeDragThreshold:Q,nodeLookup:M}=t(),V=Ho(W.sourceEvent,{transform:z,snapGrid:O,snapToGrid:$,containerBounds:m});if(E=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||T&&!M.has(T))&&(w=!0),!w){if(!h&&J&&g&&(h=!0,U()),!g){const j=Jn(W.sourceEvent,m),R=j.x-p.x,Y=j.y-p.y;Math.sqrt(R*R+Y*Y)>Q&&q(W)}(a.x!==V.xSnapped||a.y!==V.ySnapped)&&d&&g&&(p=Jn(W.sourceEvent,m),G(V))}}).on("end",W=>{if(!(!g||w)&&(h=!1,g=!1,cancelAnimationFrame(u),d.size>0)){const{nodeLookup:J,updateNodePositions:z,onNodeDragStop:O,onSelectionDragStop:$}=t();if(k&&(z(d,!1),k=!1),o||O||!T&&$){const[Q,M]=Bc({nodeId:T,dragItems:d,nodeLookup:J,dragging:!1});o==null||o(W.sourceEvent,d,Q,M),O==null||O(W.sourceEvent,Q,M),T||$==null||$(W.sourceEvent,M)}}}).filter(W=>{const J=W.target;return!W.button&&(!C||!pm(J,`.${C}`,I))&&(!N||pm(J,N,I))});x.call(F)}function S(){x==null||x.on(".drag",null)}return{update:b,destroy:S}}function EN(e,t,r){const s=[],o={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const a of t.values())Jo(o,Xs(a))>0&&s.push(a);return s}const bN=250;function CN(e,t,r,s){var d,h;let o=[],a=1/0;const u=EN(e,r,t+bN);for(const p of u){const m=[...((d=p.internals.handleBounds)==null?void 0:d.source)??[],...((h=p.internals.handleBounds)==null?void 0:h.target)??[]];for(const g of m){if(s.nodeId===g.nodeId&&s.type===g.type&&s.id===g.id)continue;const{x,y:w}=Qi(p,g,g.position,!0),k=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(w-e.y,2));k>t||(k<a?(o=[{...g,x,y:w}],a=k):k===a&&o.push({...g,x,y:w}))}}if(!o.length)return null;if(o.length>1){const p=s.type==="source"?"target":"source";return o.find(m=>m.type===p)??o[0]}return o[0]}function Yy(e,t,r,s,o,a=!1){var p,m,g;const u=s.get(e);if(!u)return null;const d=o==="strict"?(p=u.internals.handleBounds)==null?void 0:p[t]:[...((m=u.internals.handleBounds)==null?void 0:m.source)??[],...((g=u.internals.handleBounds)==null?void 0:g.target)??[]],h=(r?d==null?void 0:d.find(x=>x.id===r):d==null?void 0:d[0])??null;return h&&a?{...h,...Qi(u,h,h.position,!0)}:h}function Xy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function jN(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const qy=()=>!0;function _N(e,{connectionMode:t,connectionRadius:r,handleId:s,nodeId:o,edgeUpdaterType:a,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:m,flowId:g,panBy:x,cancelConnection:w,onConnectStart:k,onConnect:E,onConnectEnd:b,isValidConnection:S=qy,onReconnectEnd:C,updateConnection:N,getTransform:I,getFromHandle:B,autoPanSpeed:T,dragThreshold:D=1,handleDomNode:G}){const U=My(e.target);let q=0,F;const{x:W,y:J}=Jn(e),z=Xy(a,G),O=d==null?void 0:d.getBoundingClientRect();let $=!1;if(!O||!z)return;const Q=Yy(o,z,s,h,t);if(!Q)return;let M=Jn(e,O),V=!1,j=null,R=!1,Y=null;function A(){if(!m||!O)return;const[Pe,Ee]=Iy(M,O,T);x({x:Pe,y:Ee}),q=requestAnimationFrame(A)}const ae={...Q,nodeId:o,type:z,position:Q.position},re=h.get(o);let he={inProgress:!0,isValid:null,from:Qi(re,ae,Te.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:re,to:M,toHandle:null,toPosition:nm[ae.position],toNode:null,pointer:M};function se(){$=!0,N(he),k==null||k(e,{nodeId:o,handleId:s,handleType:z})}D===0&&se();function ge(Pe){if(!$){const{x:tt,y:It}=Jn(Pe),Ct=tt-W,gt=It-J;if(!(Ct*Ct+gt*gt>D*D))return;se()}if(!B()||!ae){be(Pe);return}const Ee=I();M=Jn(Pe,O),F=CN(cl(M,Ee,!1,[1,1]),r,h,ae),V||(A(),V=!0);const ke=Gy(Pe,{handle:F,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:u?"target":"source",isValidConnection:S,doc:U,lib:p,flowId:g,nodeLookup:h});Y=ke.handleDomNode,j=ke.connection,R=jN(!!F,ke.isValid);const Ve=h.get(o),We=Ve?Qi(Ve,ae,Te.Left,!0):he.from,Oe={...he,from:We,isValid:R,to:ke.toHandle&&R?Fa({x:ke.toHandle.x,y:ke.toHandle.y},Ee):M,toHandle:ke.toHandle,toPosition:R&&ke.toHandle?ke.toHandle.position:nm[ae.position],toNode:ke.toHandle?h.get(ke.toHandle.nodeId):null,pointer:M};N(Oe),he=Oe}function be(Pe){if(!("touches"in Pe&&Pe.touches.length>0)){if($){(F||Y)&&j&&R&&(E==null||E(j));const{inProgress:Ee,...ke}=he,Ve={...ke,toPosition:he.toHandle?he.toPosition:null};b==null||b(Pe,Ve),a&&(C==null||C(Pe,Ve))}w(),cancelAnimationFrame(q),V=!1,R=!1,j=null,Y=null,U.removeEventListener("mousemove",ge),U.removeEventListener("mouseup",be),U.removeEventListener("touchmove",ge),U.removeEventListener("touchend",be)}}U.addEventListener("mousemove",ge),U.addEventListener("mouseup",be),U.addEventListener("touchmove",ge),U.addEventListener("touchend",be)}function Gy(e,{handle:t,connectionMode:r,fromNodeId:s,fromHandleId:o,fromType:a,doc:u,lib:d,flowId:h,isValidConnection:p=qy,nodeLookup:m}){const g=a==="target",x=t?u.querySelector(`.${d}-flow__handle[data-id="${h}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:w,y:k}=Jn(e),E=u.elementFromPoint(w,k),b=E!=null&&E.classList.contains(`${d}-flow__handle`)?E:x,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const C=Xy(void 0,b),N=b.getAttribute("data-nodeid"),I=b.getAttribute("data-handleid"),B=b.classList.contains("connectable"),T=b.classList.contains("connectableend");if(!N||!C)return S;const D={source:g?N:s,sourceHandle:g?I:o,target:g?s:N,targetHandle:g?o:I};S.connection=D;const U=B&&T&&(r===Gi.Strict?g&&C==="source"||!g&&C==="target":N!==s||I!==o);S.isValid=U&&p(D),S.toHandle=Yy(N,C,I,m,r,!0)}return S}const kd={onPointerDown:_N,isValid:Gy};function IN({domNode:e,panZoom:t,getTransform:r,getViewScale:s}){const o=bn(e);function a({translateExtent:d,width:h,height:p,zoomStep:m=1,pannable:g=!0,zoomable:x=!0,inversePan:w=!1}){const k=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const I=r(),B=N.sourceEvent.ctrlKey&&el()?10:1,T=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*m,D=I[2]*Math.pow(2,T*B);t.scaleTo(D)};let E=[0,0];const b=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(E=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},S=N=>{const I=r();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const B=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],T=[B[0]-E[0],B[1]-E[1]];E=B;const D=s()*Math.max(I[2],Math.log(I[2]))*(w?-1:1),G={x:I[0]-T[0]*D,y:I[1]-T[1]*D},U=[[0,0],[h,p]];t.setViewportConstrained({x:G.x,y:G.y,zoom:I[2]},U,d)},C=Sy().on("start",b).on("zoom",g?S:null).on("zoom.wheel",x?k:null);o.call(C,{})}function u(){o.on("zoom",null)}return{update:a,destroy:u,pointer:Kn}}const Qa=e=>({x:e.x,y:e.y,zoom:e.k}),Hc=({x:e,y:t,zoom:r})=>qa.translate(e,t).scale(r),Fs=(e,t)=>e.target.closest(`.${t}`),Ky=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),TN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vc=(e,t=0,r=TN,s=()=>{})=>{const o=typeof t=="number"&&t>0;return o||s(),o?e.transition().duration(t).ease(r).on("end",s):e},Qy=e=>{const t=e.ctrlKey&&el()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function PN({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return m=>{if(Fs(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(m.ctrlKey&&u){const b=Kn(m),S=Qy(m),C=g*Math.pow(2,S);s.scaleTo(r,C,b,m);return}const x=m.deltaMode===1?20:1;let w=o===Yi.Vertical?0:m.deltaX*x,k=o===Yi.Horizontal?0:m.deltaY*x;!el()&&m.shiftKey&&o!==Yi.Vertical&&(w=m.deltaY*x,k=0),s.translateBy(r,-(w/g)*a,-(k/g)*a,{internal:!0});const E=Qa(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h==null||h(m,E),e.panScrollTimeout=setTimeout(()=>{p==null||p(m,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d==null||d(m,E))}}function AN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(s,o){const a=s.type==="wheel",u=!t&&a&&!s.ctrlKey,d=Fs(s,e);if(s.ctrlKey&&a&&d&&s.preventDefault(),u||d)return null;s.preventDefault(),r.call(this,s,o)}}function MN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return s=>{var a,u,d;if((a=s.sourceEvent)!=null&&a.internal)return;const o=Qa(s.transform);e.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((d=s.sourceEvent)==null?void 0:d.type)==="mousedown"&&t(!0),r&&(r==null||r(s.sourceEvent,o))}}function zN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:s,onPanZoom:o}){return a=>{var u,d;e.usedRightMouseButton=!!(r&&Ky(t,e.mouseButton??0)),(u=a.sourceEvent)!=null&&u.sync||s([a.transform.x,a.transform.y,a.transform.k]),o&&!((d=a.sourceEvent)!=null&&d.internal)&&(o==null||o(a.sourceEvent,Qa(a.transform)))}}function RN({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:a}){return u=>{var d;if(!((d=u.sourceEvent)!=null&&d.internal)&&(e.isZoomingOrPanning=!1,a&&Ky(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&a(u.sourceEvent),e.usedRightMouseButton=!1,s(!1),o)){const h=Qa(u.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(u.sourceEvent,h)},r?150:0)}}}function LN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:m}){return g=>{var b;const x=e||t,w=r&&g.ctrlKey,k=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Fs(g,`${p}-flow__node`)||Fs(g,`${p}-flow__edge`)))return!0;if(!s&&!x&&!o&&!a&&!r||u||m&&!k||Fs(g,d)&&k||Fs(g,h)&&(!k||o&&k&&!e)||!r&&g.ctrlKey&&k)return!1;if(!r&&g.type==="touchstart"&&((b=g.touches)==null?void 0:b.length)>1)return g.preventDefault(),!1;if(!x&&!o&&!w&&k||!s&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(s)&&!s.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(s)&&s.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||k)&&E}}function DN({domNode:e,minZoom:t,maxZoom:r,translateExtent:s,viewport:o,onPanZoom:a,onPanZoomStart:u,onPanZoomEnd:d,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=Sy().scaleExtent([t,r]).translateExtent(s),x=bn(e).call(g);C({x:o.x,y:o.y,zoom:Ys(o.zoom,t,r)},[[0,0],[m.width,m.height]],s);const w=x.on("wheel.zoom"),k=x.on("dblclick.zoom");g.wheelDelta(Qy);function E(F,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Bo:ba).transform(Vc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function b({noWheelClassName:F,noPanClassName:W,onPaneContextMenu:J,userSelectionActive:z,panOnScroll:O,panOnDrag:$,panOnScrollMode:Q,panOnScrollSpeed:M,preventScrolling:V,zoomOnPinch:j,zoomOnScroll:R,zoomOnDoubleClick:Y,zoomActivationKeyPressed:A,lib:ae,onTransformChange:re,connectionInProgress:ce,paneClickDistance:he,selectionOnDrag:se}){z&&!p.isZoomingOrPanning&&S();const ge=O&&!A&&!z;g.clickDistance(se?1/0:!Zn(he)||he<0?0:he);const be=ge?PN({zoomPanValues:p,noWheelClassName:F,d3Selection:x,d3Zoom:g,panOnScrollMode:Q,panOnScrollSpeed:M,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:a,onPanZoomEnd:d}):AN({noWheelClassName:F,preventScrolling:V,d3ZoomHandler:w});if(x.on("wheel.zoom",be,{passive:!1}),!z){const Ee=MN({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",Ee);const ke=zN({zoomPanValues:p,panOnDrag:$,onPaneContextMenu:!!J,onPanZoom:a,onTransformChange:re});g.on("zoom",ke);const Ve=RN({zoomPanValues:p,panOnDrag:$,panOnScroll:O,onPaneContextMenu:J,onPanZoomEnd:d,onDraggingChange:h});g.on("end",Ve)}const Pe=LN({zoomActivationKeyPressed:A,panOnDrag:$,zoomOnScroll:R,panOnScroll:O,zoomOnDoubleClick:Y,zoomOnPinch:j,userSelectionActive:z,noPanClassName:W,noWheelClassName:F,lib:ae,connectionInProgress:ce});g.filter(Pe),Y?x.on("dblclick.zoom",k):x.on("dblclick.zoom",null)}function S(){g.on("zoom",null)}async function C(F,W,J){const z=Hc(F),O=g==null?void 0:g.constrain()(z,W,J);return O&&await E(O),new Promise($=>$(O))}async function N(F,W){const J=Hc(F);return await E(J,W),new Promise(z=>z(J))}function I(F){if(x){const W=Hc(F),J=x.property("__zoom");(J.k!==F.zoom||J.x!==F.x||J.y!==F.y)&&(g==null||g.transform(x,W,null,{sync:!0}))}}function B(){const F=x?wy(x.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function T(F,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Bo:ba).scaleTo(Vc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function D(F,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Bo:ba).scaleBy(Vc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function G(F){g==null||g.scaleExtent(F)}function U(F){g==null||g.translateExtent(F)}function q(F){const W=!Zn(F)||F<0?0:F;g==null||g.clickDistance(W)}return{update:b,destroy:S,setViewport:N,setViewportConstrained:C,getViewport:B,scaleTo:T,scaleBy:D,setScaleExtent:G,setTranslateExtent:U,syncViewport:I,setClickDistance:q}}var Zi;(function(e){e.Line="line",e.Handle="handle"})(Zi||(Zi={}));const FN=["top-left","top-right","bottom-left","bottom-right"],ON=["top","right","bottom","left"];function $N({width:e,prevWidth:t,height:r,prevHeight:s,affectsX:o,affectsY:a}){const u=e-t,d=r-s,h=[u>0?1:u<0?-1:0,d>0?1:d<0?-1:0];return u&&o&&(h[0]=h[0]*-1),d&&a&&(h[1]=h[1]*-1),h}function mm(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:s,affectsY:o}}function fi(e,t){return Math.max(0,t-e)}function hi(e,t){return Math.max(0,e-t)}function xa(e,t,r){return Math.max(0,t-e,e-r)}function gm(e,t){return e?!t:t}function BN(e,t,r,s,o,a,u,d){let{affectsX:h,affectsY:p}=t;const{isHorizontal:m,isVertical:g}=t,x=m&&g,{xSnapped:w,ySnapped:k}=r,{minWidth:E,maxWidth:b,minHeight:S,maxHeight:C}=s,{x:N,y:I,width:B,height:T,aspectRatio:D}=e;let G=Math.floor(m?w-e.pointerX:0),U=Math.floor(g?k-e.pointerY:0);const q=B+(h?-G:G),F=T+(p?-U:U),W=-a[0]*B,J=-a[1]*T;let z=xa(q,E,b),O=xa(F,S,C);if(u){let M=0,V=0;h&&G<0?M=fi(N+G+W,u[0][0]):!h&&G>0&&(M=hi(N+q+W,u[1][0])),p&&U<0?V=fi(I+U+J,u[0][1]):!p&&U>0&&(V=hi(I+F+J,u[1][1])),z=Math.max(z,M),O=Math.max(O,V)}if(d){let M=0,V=0;h&&G>0?M=hi(N+G,d[0][0]):!h&&G<0&&(M=fi(N+q,d[1][0])),p&&U>0?V=hi(I+U,d[0][1]):!p&&U<0&&(V=fi(I+F,d[1][1])),z=Math.max(z,M),O=Math.max(O,V)}if(o){if(m){const M=xa(q/D,S,C)*D;if(z=Math.max(z,M),u){let V=0;!h&&!p||h&&!p&&x?V=hi(I+J+q/D,u[1][1])*D:V=fi(I+J+(h?G:-G)/D,u[0][1])*D,z=Math.max(z,V)}if(d){let V=0;!h&&!p||h&&!p&&x?V=fi(I+q/D,d[1][1])*D:V=hi(I+(h?G:-G)/D,d[0][1])*D,z=Math.max(z,V)}}if(g){const M=xa(F*D,E,b)/D;if(O=Math.max(O,M),u){let V=0;!h&&!p||p&&!h&&x?V=hi(N+F*D+W,u[1][0])/D:V=fi(N+(p?U:-U)*D+W,u[0][0])/D,O=Math.max(O,V)}if(d){let V=0;!h&&!p||p&&!h&&x?V=fi(N+F*D,d[1][0])/D:V=hi(N+(p?U:-U)*D,d[0][0])/D,O=Math.max(O,V)}}}U=U+(U<0?O:-O),G=G+(G<0?z:-z),o&&(x?q>F*D?U=(gm(h,p)?-G:G)/D:G=(gm(h,p)?-U:U)*D:m?(U=G/D,p=h):(G=U*D,h=p));const $=h?N+G:N,Q=p?I+U:I;return{width:B+(h?-G:G),height:T+(p?-U:U),x:a[0]*G*(h?-1:1)+$,y:a[1]*U*(p?-1:1)+Q}}const Zy={width:0,height:0,x:0,y:0},HN={...Zy,pointerX:0,pointerY:0,aspectRatio:1};function VN(e){return[[0,0],[e.measured.width,e.measured.height]]}function UN(e,t,r){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,u=e.measured.height??0,d=r[0]*a,h=r[1]*u;return[[s-d,o-h],[s+a-d,o+u-h]]}function WN({domNode:e,nodeId:t,getStoreItems:r,onChange:s,onEnd:o}){const a=bn(e);let u={controlDirection:mm("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:m,keepAspectRatio:g,resizeDirection:x,onResizeStart:w,onResize:k,onResizeEnd:E,shouldResize:b}){let S={...Zy},C={...HN};u={boundaries:m,resizeDirection:x,keepAspectRatio:g,controlDirection:mm(p)};let N,I=null,B=[],T,D,G,U=!1;const q=oy().on("start",F=>{const{nodeLookup:W,transform:J,snapGrid:z,snapToGrid:O,nodeOrigin:$,paneDomNode:Q}=r();if(N=W.get(t),!N)return;I=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:V}=Ho(F.sourceEvent,{transform:J,snapGrid:z,snapToGrid:O,containerBounds:I});S={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},C={...S,pointerX:M,pointerY:V,aspectRatio:S.width/S.height},T=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(T=W.get(N.parentId),D=T&&N.extent==="parent"?VN(T):void 0),B=[],G=void 0;for(const[j,R]of W)if(R.parentId===t&&(B.push({id:j,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const Y=UN(R,N,R.origin??$);G?G=[[Math.min(Y[0][0],G[0][0]),Math.min(Y[0][1],G[0][1])],[Math.max(Y[1][0],G[1][0]),Math.max(Y[1][1],G[1][1])]]:G=Y}w==null||w(F,{...S})}).on("drag",F=>{const{transform:W,snapGrid:J,snapToGrid:z,nodeOrigin:O}=r(),$=Ho(F.sourceEvent,{transform:W,snapGrid:J,snapToGrid:z,containerBounds:I}),Q=[];if(!N)return;const{x:M,y:V,width:j,height:R}=S,Y={},A=N.origin??O,{width:ae,height:re,x:ce,y:he}=BN(C,u.controlDirection,$,u.boundaries,u.keepAspectRatio,A,D,G),se=ae!==j,ge=re!==R,be=ce!==M&&se,Pe=he!==V&≥if(!be&&!Pe&&!se&&!ge)return;if((be||Pe||A[0]===1||A[1]===1)&&(Y.x=be?ce:S.x,Y.y=Pe?he:S.y,S.x=Y.x,S.y=Y.y,B.length>0)){const We=ce-M,Oe=he-V;for(const tt of B)tt.position={x:tt.position.x-We+A[0]*(ae-j),y:tt.position.y-Oe+A[1]*(re-R)},Q.push(tt)}if((se||ge)&&(Y.width=se&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ae:S.width,Y.height=ge&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:S.height,S.width=Y.width,S.height=Y.height),T&&N.expandParent){const We=A[0]*(Y.width??0);Y.x&&Y.x<We&&(S.x=We,C.x=C.x-(Y.x-We));const Oe=A[1]*(Y.height??0);Y.y&&Y.y<Oe&&(S.y=Oe,C.y=C.y-(Y.y-Oe))}const Ee=$N({width:S.width,prevWidth:j,height:S.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ke={...S,direction:Ee};(b==null?void 0:b(F,ke))!==!1&&(U=!0,k==null||k(F,ke),s(Y,Q))}).on("end",F=>{U&&(E==null||E(F,{...S}),o==null||o({...S}),U=!1)});a.call(q)}function h(){a.on(".drag",null)}return{update:d,destroy:h}}var Uc={exports:{}},Wc={},Yc={exports:{}},Xc={};/**
|
|
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 ym;function YN(){if(ym)return Xc;ym=1;var e=il();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue;function d(g,x){var w=x(),k=s({inst:{value:w,getSnapshot:x}}),E=k[0].inst,b=k[1];return a(function(){E.value=w,E.getSnapshot=x,h(E)&&b({inst:E})},[g,w,x]),o(function(){return h(E)&&b({inst:E}),g(function(){h(E)&&b({inst:E})})},[g]),u(w),w}function h(g){var x=g.getSnapshot;g=g.value;try{var w=x();return!r(g,w)}catch{return!0}}function p(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Xc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Xc}var xm;function XN(){return xm||(xm=1,Yc.exports=YN()),Yc.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 vm;function qN(){if(vm)return Wc;vm=1;var e=il(),t=XN();function r(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var s=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return Wc.useSyncExternalStoreWithSelector=function(p,m,g,x,w){var k=a(null);if(k.current===null){var E={hasValue:!1,value:null};k.current=E}else E=k.current;k=d(function(){function S(T){if(!C){if(C=!0,N=T,T=x(T),w!==void 0&&E.hasValue){var D=E.value;if(w(D,T))return I=D}return I=T}if(D=I,s(N,T))return D;var G=x(T);return w!==void 0&&w(D,G)?(N=T,D):(N=T,I=G)}var C=!1,N,I,B=g===void 0?null:g;return[function(){return S(m())},B===null?void 0:function(){return S(B())}]},[m,g,x,w]);var b=o(p,k[0],k[1]);return u(function(){E.hasValue=!0,E.value=b},[b]),h(b),b},Wc}var wm;function GN(){return wm||(wm=1,Uc.exports=qN()),Uc.exports}var KN=GN();const QN=rl(KN),ZN={},Sm=e=>{let t;const r=new Set,s=(m,g)=>{const x=typeof m=="function"?m(t):m;if(!Object.is(x,t)){const w=t;t=g??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(k=>k(t,w))}},o=()=>t,h={setState:s,getState:o,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(ZN?"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."),r.clear()}},p=t=e(s,o,h);return h},JN=e=>e?Sm(e):Sm,{useDebugValue:eE}=Ug,{useSyncExternalStoreWithSelector:tE}=QN,nE=e=>e;function Jy(e,t=nE,r){const s=tE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return eE(s),s}const km=(e,t)=>{const r=JN(e),s=(o,a=t)=>Jy(r,o,a);return Object.assign(s,r),s},rE=(e,t)=>e?km(e,t):km;function ut(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[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}Wg();const Za=P.createContext(null),iE=Za.Provider,ex=yr.error001();function qe(e,t){const r=P.useContext(Za);if(r===null)throw new Error(ex);return Jy(r,e,t)}function ct(){const e=P.useContext(Za);if(e===null)throw new Error(ex);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Nm={display:"none"},sE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},tx="react-flow__node-desc",nx="react-flow__edge-desc",oE="react-flow__aria-live",lE=e=>e.ariaLiveMessage,aE=e=>e.ariaLabelConfig;function uE({rfId:e}){const t=qe(lE);return c.jsx("div",{id:`${oE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:sE,children:t})}function cE({rfId:e,disableKeyboardA11y:t}){const r=qe(aE);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${tx}-${e}`,style:Nm,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${nx}-${e}`,style:Nm,children:r["edge.a11yDescription.default"]}),!t&&c.jsx(uE,{rfId:e})]})}const Ja=P.forwardRef(({position:e="top-left",children:t,className:r,style:s,...o},a)=>{const u=`${e}`.split("-");return c.jsx("div",{className:bt(["react-flow__panel",r,...u]),style:s,ref:a,...o,children:t})});Ja.displayName="Panel";function dE({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Ja,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const fE=e=>{const t=[],r=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&r.push(s);return{selectedNodes:t,selectedEdges:r}},va=e=>e.id;function hE(e,t){return ut(e.selectedNodes.map(va),t.selectedNodes.map(va))&&ut(e.selectedEdges.map(va),t.selectedEdges.map(va))}function pE({onSelectionChange:e}){const t=ct(),{selectedNodes:r,selectedEdges:s}=qe(fE,hE);return P.useEffect(()=>{const o={nodes:r,edges:s};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[r,s,e]),null}const mE=e=>!!e.onSelectionChangeHandlers;function gE({onSelectionChange:e}){const t=qe(mE);return e||t?c.jsx(pE,{onSelectionChange:e}):null}const rx=[0,0],yE={x:0,y:0,zoom:1},xE=["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"],Em=[...xE,"rfId"],vE=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}),bm={translateExtent:Ko,nodeOrigin:rx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wE(e){const{setNodes:t,setEdges:r,setMinZoom:s,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=qe(vE,ut),p=ct();P.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{m.current=bm,d()}),[]);const m=P.useRef(bm);return P.useEffect(()=>{for(const g of Em){const x=e[g],w=m.current[g];x!==w&&(typeof e[g]>"u"||(g==="nodes"?t(x):g==="edges"?r(x):g==="minZoom"?s(x):g==="maxZoom"?o(x):g==="translateExtent"?a(x):g==="nodeExtent"?u(x):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:nN(x)}):g==="fitView"?p.setState({fitViewQueued:x}):g==="fitViewOptions"?p.setState({fitViewOptions:x}):p.setState({[g]:x})))}m.current=e},Em.map(g=>e[g])),null}function Cm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function SE(e){var s;const[t,r]=P.useState(e==="system"?null:e);return P.useEffect(()=>{if(e!=="system"){r(e);return}const o=Cm(),a=()=>r(o!=null&&o.matches?"dark":"light");return a(),o==null||o.addEventListener("change",a),()=>{o==null||o.removeEventListener("change",a)}},[e]),t!==null?t:(s=Cm())!=null&&s.matches?"dark":"light"}const jm=typeof document<"u"?document:null;function tl(e=null,t={target:jm,actInsideInputWithModifier:!0}){const[r,s]=P.useState(!1),o=P.useRef(!1),a=P.useRef(new Set([])),[u,d]=P.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),m=p.reduce((g,x)=>g.concat(...x),[]);return[p,m]}return[[],[]]},[e]);return P.useEffect(()=>{const h=(t==null?void 0:t.target)??jm,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=w=>{var b,S;if(o.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!o.current||o.current&&!p)&&zy(w))return!1;const E=Im(w.code,d);if(a.current.add(w[E]),_m(u,a.current,!1)){const C=((S=(b=w.composedPath)==null?void 0:b.call(w))==null?void 0:S[0])||w.target,N=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(o.current||!N)&&w.preventDefault(),s(!0)}},g=w=>{const k=Im(w.code,d);_m(u,a.current,!0)?(s(!1),a.current.clear()):a.current.delete(w[k]),w.key==="Meta"&&a.current.clear(),o.current=!1},x=()=>{a.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",m),h==null||h.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h==null||h.removeEventListener("keydown",m),h==null||h.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),r}function _m(e,t,r){return e.filter(s=>r||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function Im(e,t){return t.includes(e)?"code":"key"}const kE=()=>{const e=ct();return P.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[s,o,a],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??a},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,s]=e.getState().transform;return{x:t,y:r,zoom:s}},setCenter:async(t,r,s)=>e.getState().setCenter(t,r,s),fitBounds:async(t,r)=>{const{width:s,height:o,minZoom:a,maxZoom:u,panZoom:d}=e.getState(),h=Ud(t,s,o,a,u,(r==null?void 0:r.padding)??.1);return d?(await d.setViewport(h,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:s,snapGrid:o,snapToGrid:a,domNode:u}=e.getState();if(!u)return t;const{x:d,y:h}=u.getBoundingClientRect(),p={x:t.x-d,y:t.y-h},m=r.snapGrid??o,g=r.snapToGrid??a;return cl(p,s,g,m)},flowToScreenPosition:t=>{const{transform:r,domNode:s}=e.getState();if(!s)return t;const{x:o,y:a}=s.getBoundingClientRect(),u=Fa(t,r);return{x:u.x+o,y:u.y+a}}}),[])};function ix(e,t){const r=[],s=new Map,o=[];for(const a of e)if(a.type==="add"){o.push(a);continue}else if(a.type==="remove"||a.type==="replace")s.set(a.id,[a]);else{const u=s.get(a.id);u?u.push(a):s.set(a.id,[a])}for(const a of t){const u=s.get(a.id);if(!u){r.push(a);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){r.push({...u[0].item});continue}const d={...a};for(const h of u)NE(h,d);r.push(d)}return o.length&&o.forEach(a=>{a.index!==void 0?r.splice(a.index,0,{...a.item}):r.push({...a.item})}),r}function NE(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 sx(e,t){return ix(e,t)}function ox(e,t){return ix(e,t)}function Vi(e,t){return{id:e,type:"select",selected:t}}function Os(e,t=new Set,r=!1){const s=[];for(const[o,a]of e){const u=t.has(o);!(a.selected===void 0&&!u)&&a.selected!==u&&(r&&(a.selected=u),s.push(Vi(a.id,u)))}return s}function Tm({items:e=[],lookup:t}){var o;const r=[],s=new Map(e.map(a=>[a.id,a]));for(const[a,u]of e.entries()){const d=t.get(u.id),h=((o=d==null?void 0:d.internals)==null?void 0:o.userNode)??d;h!==void 0&&h!==u&&r.push({id:u.id,item:u,type:"replace"}),h===void 0&&r.push({item:u,type:"add",index:a})}for(const[a]of t)s.get(a)===void 0&&r.push({id:a,type:"remove"});return r}function Pm(e){return{id:e.id,type:"remove"}}const Am=e=>Yk(e),EE=e=>Cy(e);function lx(e){return P.forwardRef(e)}const bE=typeof window<"u"?P.useLayoutEffect:P.useEffect;function Mm(e){const[t,r]=P.useState(BigInt(0)),[s]=P.useState(()=>CE(()=>r(o=>o+BigInt(1))));return bE(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function CE(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const ax=P.createContext(null);function jE({children:e}){const t=ct(),r=P.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:x,fitViewQueued:w,onNodesChangeMiddlewareMap:k}=t.getState();let E=h;for(const S of d)E=typeof S=="function"?S(E):S;let b=Tm({items:E,lookup:x});for(const S of k.values())b=S(b);m&&p(E),b.length>0?g==null||g(b):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:C,setNodes:N}=t.getState();S&&N(C)})},[]),s=Mm(r),o=P.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:x}=t.getState();let w=h;for(const k of d)w=typeof k=="function"?k(w):k;m?p(w):g&&g(Tm({items:w,lookup:x}))},[]),a=Mm(o),u=P.useMemo(()=>({nodeQueue:s,edgeQueue:a}),[]);return c.jsx(ax.Provider,{value:u,children:e})}function _E(){const e=P.useContext(ax);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const IE=e=>!!e.panZoom;function Qd(){const e=kE(),t=ct(),r=_E(),s=qe(IE),o=P.useMemo(()=>{const a=g=>t.getState().nodeLookup.get(g),u=g=>{r.nodeQueue.push(g)},d=g=>{r.edgeQueue.push(g)},h=g=>{var S,C;const{nodeLookup:x,nodeOrigin:w}=t.getState(),k=Am(g)?g:x.get(g.id),E=k.parentId?Ay(k.position,k.measured,k.parentId,x,w):k.position,b={...k,position:E,width:((S=k.measured)==null?void 0:S.width)??k.width,height:((C=k.measured)==null?void 0:C.height)??k.height};return Xs(b)},p=(g,x,w={replace:!1})=>{u(k=>k.map(E=>{if(E.id===g){const b=typeof x=="function"?x(E):x;return w.replace&&Am(b)?b:{...E,...b}}return E}))},m=(g,x,w={replace:!1})=>{d(k=>k.map(E=>{if(E.id===g){const b=typeof x=="function"?x(E):x;return w.replace&&EE(b)?b:{...E,...b}}return E}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var x;return(x=a(g))==null?void 0:x.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(x=>({...x}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const x=Array.isArray(g)?g:[g];r.nodeQueue.push(w=>[...w,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];r.edgeQueue.push(w=>[...w,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:w}=t.getState(),[k,E,b]=w;return{nodes:g.map(S=>({...S})),edges:x.map(S=>({...S})),viewport:{x:k,y:E,zoom:b}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:w,edges:k,onNodesDelete:E,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:C,onDelete:N,onBeforeDelete:I}=t.getState(),{nodes:B,edges:T}=await Qk({nodesToRemove:g,edgesToRemove:x,nodes:w,edges:k,onBeforeDelete:I}),D=T.length>0,G=B.length>0;if(D){const U=T.map(Pm);b==null||b(T),C(U)}if(G){const U=B.map(Pm);E==null||E(B),S(U)}return(G||D)&&(N==null||N({nodes:B,edges:T})),{deletedNodes:B,deletedEdges:T}},getIntersectingNodes:(g,x=!0,w)=>{const k=im(g),E=k?g:h(g),b=w!==void 0;return E?(w||t.getState().nodes).filter(S=>{const C=t.getState().nodeLookup.get(S.id);if(C&&!k&&(S.id===g.id||!C.internals.positionAbsolute))return!1;const N=Xs(b?S:C),I=Jo(N,E);return x&&I>0||I>=N.width*N.height||I>=E.width*E.height}):[]},isNodeIntersecting:(g,x,w=!0)=>{const E=im(g)?g:h(g);if(!E)return!1;const b=Jo(E,x);return w&&b>0||b>=x.width*x.height||b>=E.width*E.height},updateNode:p,updateNodeData:(g,x,w={replace:!1})=>{p(g,k=>{const E=typeof x=="function"?x(k):x;return w.replace?{...k,data:E}:{...k,data:{...k.data,...E}}},w)},updateEdge:m,updateEdgeData:(g,x,w={replace:!1})=>{m(g,k=>{const E=typeof x=="function"?x(k):x;return w.replace?{...k,data:E}:{...k,data:{...k.data,...E}}},w)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:w}=t.getState();return Xk(g,{nodeLookup:x,nodeOrigin:w})},getHandleConnections:({type:g,id:x,nodeId:w})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${w}-${g}${x?`-${x}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:g,handleId:x,nodeId:w})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${w}${g?x?`-${g}-${x}`:`-${g}`:""}`))==null?void 0:k.values())??[])},fitView:async g=>{const x=t.getState().fitViewResolver??tN();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),r.nodeQueue.push(w=>[...w]),x.promise}}},[]);return P.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const zm=e=>e.selected,TE=typeof window<"u"?window:void 0;function PE({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=ct(),{deleteElements:s}=Qd(),o=tl(e,{actInsideInputWithModifier:!1}),a=tl(t,{target:TE});P.useEffect(()=>{if(o){const{edges:u,nodes:d}=r.getState();s({nodes:d.filter(zm),edges:u.filter(zm)}),r.setState({nodesSelectionActive:!1})}},[o]),P.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])}function AE(e){const t=ct();P.useEffect(()=>{const r=()=>{var o,a,u,d;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const s=Wd(e.current);(s.height===0||s.width===0)&&((d=(u=t.getState()).onError)==null||d.call(u,"004",yr.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){r(),window.addEventListener("resize",r);const s=new ResizeObserver(()=>r());return s.observe(e.current),()=>{window.removeEventListener("resize",r),s&&e.current&&s.unobserve(e.current)}}},[])}const eu={position:"absolute",width:"100%",height:"100%",top:0,left:0},ME=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function zE({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=Yi.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:w=!0,children:k,noWheelClassName:E,noPanClassName:b,onViewportChange:S,isControlledViewport:C,paneClickDistance:N,selectionOnDrag:I}){const B=ct(),T=P.useRef(null),{userSelectionActive:D,lib:G,connectionInProgress:U}=qe(ME,ut),q=tl(x),F=P.useRef();AE(T);const W=P.useCallback(J=>{S==null||S({x:J[0],y:J[1],zoom:J[2]}),C||B.setState({transform:J})},[S,C]);return P.useEffect(()=>{if(T.current){F.current=DN({domNode:T.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:$=>B.setState({paneDragging:$}),onPanZoomStart:($,Q)=>{const{onViewportChangeStart:M,onMoveStart:V}=B.getState();V==null||V($,Q),M==null||M(Q)},onPanZoom:($,Q)=>{const{onViewportChange:M,onMove:V}=B.getState();V==null||V($,Q),M==null||M(Q)},onPanZoomEnd:($,Q)=>{const{onViewportChangeEnd:M,onMoveEnd:V}=B.getState();V==null||V($,Q),M==null||M(Q)}});const{x:J,y:z,zoom:O}=F.current.getViewport();return B.setState({panZoom:F.current,transform:[J,z,O],domNode:T.current.closest(".react-flow")}),()=>{var $;($=F.current)==null||$.destroy()}}},[]),P.useEffect(()=>{var J;(J=F.current)==null||J.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:q,preventScrolling:w,noPanClassName:b,userSelectionActive:D,noWheelClassName:E,lib:G,onTransformChange:W,connectionInProgress:U,selectionOnDrag:I,paneClickDistance:N})},[e,t,r,s,o,a,u,d,q,w,b,D,E,G,W,U,I,N]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:eu,children:k})}const RE=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function LE(){const{userSelectionActive:e,userSelectionRect:t}=qe(RE,ut);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const qc=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},DE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function FE({isSelecting:e,selectionKeyPressed:t,selectionMode:r=Qo.Full,panOnDrag:s,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:u,onSelectionEnd:d,onPaneClick:h,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:w,children:k}){const E=ct(),{userSelectionActive:b,elementsSelectable:S,dragging:C,connectionInProgress:N}=qe(DE,ut),I=S&&(e||b),B=P.useRef(null),T=P.useRef(),D=P.useRef(new Set),G=P.useRef(new Set),U=P.useRef(!1),q=M=>{if(U.current||N){U.current=!1;return}h==null||h(M),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},F=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}p==null||p(M)},W=m?M=>m(M):void 0,J=M=>{U.current&&(M.stopPropagation(),U.current=!1)},z=M=>{var re,ce;const{domNode:V}=E.getState();if(T.current=V==null?void 0:V.getBoundingClientRect(),!T.current)return;const j=M.target===B.current;if(!j&&!!M.target.closest(".nokey")||!e||!(a&&j||t)||M.button!==0||!M.isPrimary)return;(ce=(re=M.target)==null?void 0:re.setPointerCapture)==null||ce.call(re,M.pointerId),U.current=!1;const{x:A,y:ae}=Jn(M.nativeEvent,T.current);E.setState({userSelectionRect:{width:0,height:0,startX:A,startY:ae,x:A,y:ae}}),j||(M.stopPropagation(),M.preventDefault())},O=M=>{const{userSelectionRect:V,transform:j,nodeLookup:R,edgeLookup:Y,connectionLookup:A,triggerNodeChanges:ae,triggerEdgeChanges:re,defaultEdgeOptions:ce,resetSelectedElements:he}=E.getState();if(!T.current||!V)return;const{x:se,y:ge}=Jn(M.nativeEvent,T.current),{startX:be,startY:Pe}=V;if(!U.current){const Oe=t?0:o;if(Math.hypot(se-be,ge-Pe)<=Oe)return;he(),u==null||u(M)}U.current=!0;const Ee={startX:be,startY:Pe,x:se<be?se:be,y:ge<Pe?ge:Pe,width:Math.abs(se-be),height:Math.abs(ge-Pe)},ke=D.current,Ve=G.current;D.current=new Set(Vd(R,Ee,j,r===Qo.Partial,!0).map(Oe=>Oe.id)),G.current=new Set;const We=(ce==null?void 0:ce.selectable)??!0;for(const Oe of D.current){const tt=A.get(Oe);if(tt)for(const{edgeId:It}of tt.values()){const Ct=Y.get(It);Ct&&(Ct.selectable??We)&&G.current.add(It)}}if(!sm(ke,D.current)){const Oe=Os(R,D.current,!0);ae(Oe)}if(!sm(Ve,G.current)){const Oe=Os(Y,G.current);re(Oe)}E.setState({userSelectionRect:Ee,userSelectionActive:!0,nodesSelectionActive:!1})},$=M=>{var V,j;M.button===0&&((j=(V=M.target)==null?void 0:V.releasePointerCapture)==null||j.call(V,M.pointerId),!b&&M.target===B.current&&E.getState().userSelectionRect&&(q==null||q(M)),E.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(d==null||d(M),E.setState({nodesSelectionActive:D.current.size>0})))},Q=s===!0||Array.isArray(s)&&s.includes(0);return c.jsxs("div",{className:bt(["react-flow__pane",{draggable:Q,dragging:C,selection:e}]),onClick:I?void 0:qc(q,B),onContextMenu:qc(F,B),onWheel:qc(W,B),onPointerEnter:I?void 0:g,onPointerMove:I?O:x,onPointerUp:I?$:void 0,onPointerDownCapture:I?z:void 0,onClickCapture:I?J:void 0,onPointerLeave:w,ref:B,style:eu,children:[k,c.jsx(LE,{})]})}function Nd({id:e,store:t,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:u,nodeLookup:d,onError:h}=t.getState(),p=d.get(e);if(!p){h==null||h("012",yr.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(r||p.selected&&u)&&(a({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=s==null?void 0:s.current)==null?void 0:m.blur()})):o([e])}function ux({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:s,nodeId:o,isSelectable:a,nodeClickDistance:u}){const d=ct(),[h,p]=P.useState(!1),m=P.useRef();return P.useEffect(()=>{m.current=NN({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{Nd({id:g,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),P.useEffect(()=>{var g,x;if(t)(g=m.current)==null||g.destroy();else if(e.current)return(x=m.current)==null||x.update({noDragClassName:r,handleSelector:s,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:u}),()=>{var w;(w=m.current)==null||w.destroy()}},[r,s,t,a,e,o]),h}const OE=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function cx(){const e=ct();return P.useCallback(r=>{const{nodeExtent:s,snapToGrid:o,snapGrid:a,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:m}=e.getState(),g=new Map,x=OE(u),w=o?a[0]:5,k=o?a[1]:5,E=r.direction.x*w*r.factor,b=r.direction.y*k*r.factor;for(const[,S]of p){if(!x(S))continue;let C={x:S.internals.positionAbsolute.x+E,y:S.internals.positionAbsolute.y+b};o&&(C=ul(C,a));const{position:N,positionAbsolute:I}=jy({nodeId:S.id,nextPosition:C,nodeLookup:p,nodeExtent:s,nodeOrigin:m,onError:d});S.position=N,S.internals.positionAbsolute=I,g.set(S.id,S)}h(g)},[])}const Zd=P.createContext(null),$E=Zd.Provider;Zd.Consumer;const dx=()=>P.useContext(Zd),BE=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),HE=(e,t,r)=>s=>{const{connectionClickStartHandle:o,connectionMode:a,connection:u}=s,{fromHandle:d,toHandle:h,isValid:p}=u,m=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===t&&(h==null?void 0:h.type)===r;return{connectingFrom:(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===r,connectingTo:m,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===r,isPossibleEndHandle:a===Gi.Strict?(d==null?void 0:d.type)!==r:e!==(d==null?void 0:d.nodeId)||t!==(d==null?void 0:d.id),connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:m&&p}};function VE({type:e="source",position:t=Te.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:m,onTouchStart:g,...x},w){var O,$;const k=u||null,E=e==="target",b=ct(),S=dx(),{connectOnClick:C,noPanClassName:N,rfId:I}=qe(BE,ut),{connectingFrom:B,connectingTo:T,clickConnecting:D,isPossibleEndHandle:G,connectionInProcess:U,clickConnectionInProcess:q,valid:F}=qe(HE(S,k,e),ut);S||($=(O=b.getState()).onError)==null||$.call(O,"010",yr.error010());const W=Q=>{const{defaultEdgeOptions:M,onConnect:V,hasDefaultEdges:j}=b.getState(),R={...M,...Q};if(j){const{edges:Y,setEdges:A}=b.getState();A($y(R,Y))}V==null||V(R),d==null||d(R)},J=Q=>{if(!S)return;const M=Ry(Q.nativeEvent);if(o&&(M&&Q.button===0||!M)){const V=b.getState();kd.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:E,handleId:k,nodeId:S,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:V.onConnectEnd,updateConnection:V.updateConnection,onConnect:W,isValidConnection:r||V.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}M?m==null||m(Q):g==null||g(Q)},z=Q=>{const{onClickConnectStart:M,onClickConnectEnd:V,connectionClickStartHandle:j,connectionMode:R,isValidConnection:Y,lib:A,rfId:ae,nodeLookup:re,connection:ce}=b.getState();if(!S||!j&&!o)return;if(!j){M==null||M(Q.nativeEvent,{nodeId:S,handleId:k,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:k}});return}const he=My(Q.target),se=r||Y,{connection:ge,isValid:be}=kd.isValid(Q.nativeEvent,{handle:{nodeId:S,id:k,type:e},connectionMode:R,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:se,flowId:ae,doc:he,lib:A,nodeLookup:re});be&&ge&&W(ge);const Pe=structuredClone(ce);delete Pe.inProgress,Pe.toPosition=Pe.toHandle?Pe.toHandle.position:null,V==null||V(Q,Pe),b.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":k,"data-nodeid":S,"data-handlepos":t,"data-id":`${I}-${S}-${k}-${e}`,className:bt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,p,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:a,clickconnecting:D,connectingfrom:B,connectingto:T,valid:F,connectionindicator:s&&(!U||G)&&(U||q?a:o)}]),onMouseDown:J,onTouchStart:J,onClick:C?z:void 0,ref:w,...x,children:h})}const gi=P.memo(lx(VE));function UE({data:e,isConnectable:t,sourcePosition:r=Te.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(gi,{type:"source",position:r,isConnectable:t})]})}function WE({data:e,isConnectable:t,targetPosition:r=Te.Top,sourcePosition:s=Te.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(gi,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,c.jsx(gi,{type:"source",position:s,isConnectable:t})]})}function YE(){return null}function XE({data:e,isConnectable:t,targetPosition:r=Te.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(gi,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const Oa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Rm={input:UE,default:WE,output:XE,group:YE};function qE(e){var t,r,s,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??((r=e.style)==null?void 0:r.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const GE=e=>{const{width:t,height:r,x:s,y:o}=al(e.nodeLookup,{filter:a=>!!a.selected});return{width:Zn(t)?t:null,height:Zn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function KE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const s=ct(),{width:o,height:a,transformString:u,userSelectionActive:d}=qe(GE,ut),h=cx(),p=P.useRef(null);if(P.useEffect(()=>{var x;r||(x=p.current)==null||x.focus({preventScroll:!0})},[r]),ux({nodeRef:p}),d||!o||!a)return null;const m=e?x=>{const w=s.getState().nodes.filter(k=>k.selected);e(x,w)}:void 0,g=x=>{Object.prototype.hasOwnProperty.call(Oa,x.key)&&(x.preventDefault(),h({direction:Oa[x.key],factor:x.shiftKey?4:1}))};return c.jsx("div",{className:bt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:c.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:r?void 0:-1,onKeyDown:r?void 0:g,style:{width:o,height:a}})})}const Lm=typeof window<"u"?window:void 0,QE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function fx({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:x,onSelectionEnd:w,multiSelectionKeyCode:k,panActivationKeyCode:E,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:I,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:D,panOnDrag:G,defaultViewport:U,translateExtent:q,minZoom:F,maxZoom:W,preventScrolling:J,onSelectionContextMenu:z,noWheelClassName:O,noPanClassName:$,disableKeyboardA11y:Q,onViewportChange:M,isControlledViewport:V}){const{nodesSelectionActive:j,userSelectionActive:R}=qe(QE,ut),Y=tl(p,{target:Lm}),A=tl(E,{target:Lm}),ae=A||G,re=A||I,ce=m&&ae!==!0,he=Y||R||ce;return PE({deleteKeyCode:h,multiSelectionKeyCode:k}),c.jsx(zE,{onPaneContextMenu:a,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:re,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:D,panOnDrag:!Y&&ae,defaultViewport:U,translateExtent:q,minZoom:F,maxZoom:W,zoomActivationKeyCode:b,preventScrolling:J,noWheelClassName:O,noPanClassName:$,onViewportChange:M,isControlledViewport:V,paneClickDistance:d,selectionOnDrag:ce,children:c.jsxs(FE,{onSelectionStart:x,onSelectionEnd:w,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,panOnDrag:ae,isSelecting:!!he,selectionMode:g,selectionKeyPressed:Y,paneClickDistance:d,selectionOnDrag:ce,children:[e,j&&c.jsx(KE,{onSelectionContextMenu:z,noPanClassName:$,disableKeyboardA11y:Q})]})})}fx.displayName="FlowRenderer";const ZE=P.memo(fx),JE=e=>t=>e?Vd(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function eb(e){return qe(P.useCallback(JE(e),[e]),ut)}const tb=e=>e.updateNodeInternals;function nb(){const e=qe(tb),[t]=P.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const s=new Map;r.forEach(o=>{const a=o.target.getAttribute("data-id");s.set(a,{id:a,nodeElement:o.target,force:!0})}),e(s)}));return P.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function rb({node:e,nodeType:t,hasDimensions:r,resizeObserver:s}){const o=ct(),a=P.useRef(null),u=P.useRef(null),d=P.useRef(e.sourcePosition),h=P.useRef(e.targetPosition),p=P.useRef(t),m=r&&!!e.internals.handleBounds;return P.useEffect(()=>{a.current&&!e.hidden&&(!m||u.current!==a.current)&&(u.current&&(s==null||s.unobserve(u.current)),s==null||s.observe(a.current),u.current=a.current)},[m,e.hidden]),P.useEffect(()=>()=>{u.current&&(s==null||s.unobserve(u.current),u.current=null)},[]),P.useEffect(()=>{if(a.current){const g=p.current!==t,x=d.current!==e.sourcePosition,w=h.current!==e.targetPosition;(g||x||w)&&(p.current=t,d.current=e.sourcePosition,h.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 ib({id:e,onClick:t,onMouseEnter:r,onMouseMove:s,onMouseLeave:o,onContextMenu:a,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:x,noPanClassName:w,disableKeyboardA11y:k,rfId:E,nodeTypes:b,nodeClickDistance:S,onError:C}){const{node:N,internals:I,isParent:B}=qe(se=>{const ge=se.nodeLookup.get(e),be=se.parentLookup.has(e);return{node:ge,internals:ge.internals,isParent:be}},ut);let T=N.type||"default",D=(b==null?void 0:b[T])||Rm[T];D===void 0&&(C==null||C("003",yr.error003(T)),T="default",D=(b==null?void 0:b.default)||Rm.default);const G=!!(N.draggable||d&&typeof N.draggable>"u"),U=!!(N.selectable||h&&typeof N.selectable>"u"),q=!!(N.connectable||p&&typeof N.connectable>"u"),F=!!(N.focusable||m&&typeof N.focusable>"u"),W=ct(),J=Py(N),z=rb({node:N,nodeType:T,hasDimensions:J,resizeObserver:g}),O=ux({nodeRef:z,disabled:N.hidden||!G,noDragClassName:x,handleSelector:N.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:S}),$=cx();if(N.hidden)return null;const Q=Or(N),M=qE(N),V=U||G||t||r||s||o,j=r?se=>r(se,{...I.userNode}):void 0,R=s?se=>s(se,{...I.userNode}):void 0,Y=o?se=>o(se,{...I.userNode}):void 0,A=a?se=>a(se,{...I.userNode}):void 0,ae=u?se=>u(se,{...I.userNode}):void 0,re=se=>{const{selectNodesOnDrag:ge,nodeDragThreshold:be}=W.getState();U&&(!ge||!G||be>0)&&Nd({id:e,store:W,nodeRef:z}),t&&t(se,{...I.userNode})},ce=se=>{if(!(zy(se.nativeEvent)||k)){if(ky.includes(se.key)&&U){const ge=se.key==="Escape";Nd({id:e,store:W,unselect:ge,nodeRef:z})}else if(G&&N.selected&&Object.prototype.hasOwnProperty.call(Oa,se.key)){se.preventDefault();const{ariaLabelConfig:ge}=W.getState();W.setState({ariaLiveMessage:ge["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~I.positionAbsolute.x,y:~~I.positionAbsolute.y})}),$({direction:Oa[se.key],factor:se.shiftKey?4:1})}}},he=()=>{var Ve;if(k||!((Ve=z.current)!=null&&Ve.matches(":focus-visible")))return;const{transform:se,width:ge,height:be,autoPanOnNodeFocus:Pe,setCenter:Ee}=W.getState();if(!Pe)return;Vd(new Map([[e,N]]),{x:0,y:0,width:ge,height:be},se,!0).length>0||Ee(N.position.x+Q.width/2,N.position.y+Q.height/2,{zoom:se[2]})};return c.jsx("div",{className:bt(["react-flow__node",`react-flow__node-${T}`,{[w]:G},N.className,{selected:N.selected,selectable:U,parent:B,draggable:G,dragging:O}]),ref:z,style:{zIndex:I.z,transform:`translate(${I.positionAbsolute.x}px,${I.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:J?"visible":"hidden",...N.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:R,onMouseLeave:Y,onContextMenu:A,onClick:re,onDoubleClick:ae,onKeyDown:F?ce:void 0,tabIndex:F?0:void 0,onFocus:F?he:void 0,role:N.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${tx}-${E}`,"aria-label":N.ariaLabel,...N.domAttributes,children:c.jsx($E,{value:e,children:c.jsx(D,{id:e,data:N.data,type:T,positionAbsoluteX:I.positionAbsolute.x,positionAbsoluteY:I.positionAbsolute.y,selected:N.selected??!1,selectable:U,draggable:G,deletable:N.deletable??!0,isConnectable:q,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:O,dragHandle:N.dragHandle,zIndex:I.z,parentId:N.parentId,...Q})})})}var sb=P.memo(ib);const ob=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hx(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,onError:a}=qe(ob,ut),u=eb(e.onlyRenderVisibleElements),d=nb();return c.jsx("div",{className:"react-flow__nodes",style:eu,children:u.map(h=>c.jsx(sb,{id:h,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:d,nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},h))})}hx.displayName="NodeRenderer";const lb=P.memo(hx);function ab(e){return qe(P.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const s=[];if(r.width&&r.height)for(const o of r.edges){const a=r.nodeLookup.get(o.source),u=r.nodeLookup.get(o.target);a&&u&&sN({sourceNode:a,targetNode:u,width:r.width,height:r.height,transform:r.transform})&&s.push(o.id)}return s},[e]),ut)}const ub=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},cb=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Dm={[Zo.Arrow]:ub,[Zo.ArrowClosed]:cb};function db(e){const t=ct();return P.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(Dm,e)?Dm[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",yr.error009(e)),null)},[e])}const fb=({id:e,type:t,color:r,width:s=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:u,orient:d="auto-start-reverse"})=>{const h=db(t);return h?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:d,refX:"0",refY:"0",children:c.jsx(h,{color:r,strokeWidth:u})}):null},px=({defaultColor:e,rfId:t})=>{const r=qe(a=>a.edges),s=qe(a=>a.defaultEdgeOptions),o=P.useMemo(()=>fN(r,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[r,s,t,e]);return o.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:o.map(a=>c.jsx(fb,{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};px.displayName="MarkerDefinitions";var hb=P.memo(px);function mx({x:e,y:t,label:r,labelStyle:s,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...m}){const[g,x]=P.useState({x:1,y:0,width:0,height:0}),w=bt(["react-flow__edge-textwrapper",p]),k=P.useRef(null);return P.useEffect(()=>{if(k.current){const E=k.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[r]),r?c.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:w,visibility:g.width?"visible":"hidden",...m,children:[o&&c.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:a,rx:d,ry:d}),c.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:k,style:s,children:r}),h]}):null}mx.displayName="EdgeText";const pb=P.memo(mx);function tu({path:e,labelX:t,labelY:r,label:s,labelStyle:o,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...m}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...m,d:e,fill:"none",className:bt(["react-flow__edge-path",m.className])}),p?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,s&&Zn(t)&&Zn(r)?c.jsx(pb,{x:t,y:r,label:s,labelStyle:o,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Fm({pos:e,x1:t,y1:r,x2:s,y2:o}){return e===Te.Left||e===Te.Right?[.5*(t+s),r]:[t,.5*(r+o)]}function gx({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top}){const[u,d]=Fm({pos:r,x1:e,y1:t,x2:s,y2:o}),[h,p]=Fm({pos:a,x1:s,y1:o,x2:e,y2:t}),[m,g,x,w]=Ly({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${t} C${u},${d} ${h},${p} ${s},${o}`,m,g,x,w]}function yx(e){return P.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:b,interactionWidth:S})=>{const[C,N,I]=gx({sourceX:r,sourceY:s,sourcePosition:u,targetX:o,targetY:a,targetPosition:d}),B=e.isInternal?void 0:t;return c.jsx(tu,{id:B,path:C,labelX:N,labelY:I,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:b,interactionWidth:S})})}const mb=yx({isInternal:!1}),xx=yx({isInternal:!0});mb.displayName="SimpleBezierEdge";xx.displayName="SimpleBezierEdgeInternal";function vx(e){return P.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,sourcePosition:w=Te.Bottom,targetPosition:k=Te.Top,markerEnd:E,markerStart:b,pathOptions:S,interactionWidth:C})=>{const[N,I,B]=vd({sourceX:r,sourceY:s,sourcePosition:w,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}),T=e.isInternal?void 0:t;return c.jsx(tu,{id:T,path:N,labelX:I,labelY:B,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:E,markerStart:b,interactionWidth:C})})}const wx=vx({isInternal:!1}),Sx=vx({isInternal:!0});wx.displayName="SmoothStepEdge";Sx.displayName="SmoothStepEdgeInternal";function kx(e){return P.memo(({id:t,...r})=>{var o;const s=e.isInternal?void 0:t;return c.jsx(wx,{...r,id:s,pathOptions:P.useMemo(()=>{var a;return{borderRadius:0,offset:(a=r.pathOptions)==null?void 0:a.offset}},[(o=r.pathOptions)==null?void 0:o.offset])})})}const gb=kx({isInternal:!1}),Nx=kx({isInternal:!0});gb.displayName="StepEdge";Nx.displayName="StepEdgeInternal";function Ex(e){return P.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:k,interactionWidth:E})=>{const[b,S,C]=By({sourceX:r,sourceY:s,targetX:o,targetY:a}),N=e.isInternal?void 0:t;return c.jsx(tu,{id:N,path:b,labelX:S,labelY:C,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:k,interactionWidth:E})})}const yb=Ex({isInternal:!1}),bx=Ex({isInternal:!0});yb.displayName="StraightEdge";bx.displayName="StraightEdgeInternal";function Cx(e){return P.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:u=Te.Bottom,targetPosition:d=Te.Top,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:b,pathOptions:S,interactionWidth:C})=>{const[N,I,B]=Dy({sourceX:r,sourceY:s,sourcePosition:u,targetX:o,targetY:a,targetPosition:d,curvature:S==null?void 0:S.curvature}),T=e.isInternal?void 0:t;return c.jsx(tu,{id:T,path:N,labelX:I,labelY:B,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:b,interactionWidth:C})})}const xb=Cx({isInternal:!1}),jx=Cx({isInternal:!0});xb.displayName="BezierEdge";jx.displayName="BezierEdgeInternal";const Om={default:jx,straight:bx,step:Nx,smoothstep:Sx,simplebezier:xx},$m={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},vb=(e,t,r)=>r===Te.Left?e-t:r===Te.Right?e+t:e,wb=(e,t,r)=>r===Te.Top?e-t:r===Te.Bottom?e+t:e,Bm="react-flow__edgeupdater";function Hm({position:e,centerX:t,centerY:r,radius:s=10,onMouseDown:o,onMouseEnter:a,onMouseOut:u,type:d}){return c.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:u,className:bt([Bm,`${Bm}-${d}`]),cx:vb(t,s,e),cy:wb(r,s,e),r:s,stroke:"transparent",fill:"transparent"})}function Sb({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:s,sourceY:o,targetX:a,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:x,setUpdateHover:w}){const k=ct(),E=(I,B)=>{if(I.button!==0)return;const{autoPanOnConnect:T,domNode:D,isValidConnection:G,connectionMode:U,connectionRadius:q,lib:F,onConnectStart:W,onConnectEnd:J,cancelConnection:z,nodeLookup:O,rfId:$,panBy:Q,updateConnection:M}=k.getState(),V=B.type==="target",j=(A,ae)=>{x(!1),g==null||g(A,r,B.type,ae)},R=A=>p==null?void 0:p(r,A),Y=(A,ae)=>{x(!0),m==null||m(I,r,B.type),W==null||W(A,ae)};kd.onPointerDown(I.nativeEvent,{autoPanOnConnect:T,connectionMode:U,connectionRadius:q,domNode:D,handleId:B.id,nodeId:B.nodeId,nodeLookup:O,isTarget:V,edgeUpdaterType:B.type,lib:F,flowId:$,cancelConnection:z,panBy:Q,isValidConnection:G,onConnect:R,onConnectStart:Y,onConnectEnd:J,onReconnectEnd:j,updateConnection:M,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:I.currentTarget})},b=I=>E(I,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),S=I=>E(I,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),C=()=>w(!0),N=()=>w(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(Hm,{position:d,centerX:s,centerY:o,radius:t,onMouseDown:b,onMouseEnter:C,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&c.jsx(Hm,{position:h,centerX:a,centerY:u,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:N,type:"target"})]})}function kb({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:s,onClick:o,onDoubleClick:a,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:w,rfId:k,edgeTypes:E,noPanClassName:b,onError:S,disableKeyboardA11y:C}){let N=qe(Ee=>Ee.edgeLookup.get(e));const I=qe(Ee=>Ee.defaultEdgeOptions);N=I?{...I,...N}:N;let B=N.type||"default",T=(E==null?void 0:E[B])||Om[B];T===void 0&&(S==null||S("011",yr.error011(B)),B="default",T=(E==null?void 0:E.default)||Om.default);const D=!!(N.focusable||t&&typeof N.focusable>"u"),G=typeof g<"u"&&(N.reconnectable||r&&typeof N.reconnectable>"u"),U=!!(N.selectable||s&&typeof N.selectable>"u"),q=P.useRef(null),[F,W]=P.useState(!1),[J,z]=P.useState(!1),O=ct(),{zIndex:$,sourceX:Q,sourceY:M,targetX:V,targetY:j,sourcePosition:R,targetPosition:Y}=qe(P.useCallback(Ee=>{const ke=Ee.nodeLookup.get(N.source),Ve=Ee.nodeLookup.get(N.target);if(!ke||!Ve)return{zIndex:N.zIndex,...$m};const We=dN({id:e,sourceNode:ke,targetNode:Ve,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:Ee.connectionMode,onError:S});return{zIndex:iN({selected:N.selected,zIndex:N.zIndex,sourceNode:ke,targetNode:Ve,elevateOnSelect:Ee.elevateEdgesOnSelect,zIndexMode:Ee.zIndexMode}),...We||$m}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),ut),A=P.useMemo(()=>N.markerStart?`url('#${wd(N.markerStart,k)}')`:void 0,[N.markerStart,k]),ae=P.useMemo(()=>N.markerEnd?`url('#${wd(N.markerEnd,k)}')`:void 0,[N.markerEnd,k]);if(N.hidden||Q===null||M===null||V===null||j===null)return null;const re=Ee=>{var Oe;const{addSelectedEdges:ke,unselectNodesAndEdges:Ve,multiSelectionActive:We}=O.getState();U&&(O.setState({nodesSelectionActive:!1}),N.selected&&We?(Ve({nodes:[],edges:[N]}),(Oe=q.current)==null||Oe.blur()):ke([e])),o&&o(Ee,N)},ce=a?Ee=>{a(Ee,{...N})}:void 0,he=u?Ee=>{u(Ee,{...N})}:void 0,se=d?Ee=>{d(Ee,{...N})}:void 0,ge=h?Ee=>{h(Ee,{...N})}:void 0,be=p?Ee=>{p(Ee,{...N})}:void 0,Pe=Ee=>{var ke;if(!C&&ky.includes(Ee.key)&&U){const{unselectNodesAndEdges:Ve,addSelectedEdges:We}=O.getState();Ee.key==="Escape"?((ke=q.current)==null||ke.blur(),Ve({edges:[N]})):We([e])}};return c.jsx("svg",{style:{zIndex:$},children:c.jsxs("g",{className:bt(["react-flow__edge",`react-flow__edge-${B}`,N.className,b,{selected:N.selected,animated:N.animated,inactive:!U&&!o,updating:F,selectable:U}]),onClick:re,onDoubleClick:ce,onContextMenu:he,onMouseEnter:se,onMouseMove:ge,onMouseLeave:be,onKeyDown:D?Pe:void 0,tabIndex:D?0:void 0,role:N.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":D?`${nx}-${k}`:void 0,ref:q,...N.domAttributes,children:[!J&&c.jsx(T,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:U,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:Q,sourceY:M,targetX:V,targetY:j,sourcePosition:R,targetPosition:Y,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:A,markerEnd:ae,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),G&&c.jsx(Sb,{edge:N,isReconnectable:G,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:w,sourceX:Q,sourceY:M,targetX:V,targetY:j,sourcePosition:R,targetPosition:Y,setUpdateHover:W,setReconnecting:z})]})})}var Nb=P.memo(kb);const Eb=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _x({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:s,noPanClassName:o,onReconnect:a,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:w,onReconnectEnd:k,disableKeyboardA11y:E}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:C,onError:N}=qe(Eb,ut),I=ab(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(hb,{defaultColor:e,rfId:r}),I.map(B=>c.jsx(Nb,{id:B,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:C,noPanClassName:o,onReconnect:a,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:x,onReconnectStart:w,onReconnectEnd:k,rfId:r,onError:N,edgeTypes:s,disableKeyboardA11y:E},B))]})}_x.displayName="EdgeRenderer";const bb=P.memo(_x),Cb=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jb({children:e}){const t=qe(Cb);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function _b(e){const t=Qd(),r=P.useRef(!1);P.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const Ib=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Tb(e){const t=qe(Ib),r=ct();return P.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Pb(e){return e.connection.inProgress?{...e.connection,to:cl(e.connection.to,e.transform)}:{...e.connection}}function Ab(e){return Pb}function Mb(e){const t=Ab();return qe(t,ut)}const zb=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Rb({containerStyle:e,style:t,type:r,component:s}){const{nodesConnectable:o,width:a,height:u,isValid:d,inProgress:h}=qe(zb,ut);return!(a&&o&&h)?null:c.jsx("svg",{style:e,width:a,height:u,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:bt(["react-flow__connection",by(d)]),children:c.jsx(Ix,{style:t,type:r,CustomComponent:s,isValid:d})})})}const Ix=({style:e,type:t=mi.Bezier,CustomComponent:r,isValid:s})=>{const{inProgress:o,from:a,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:m,toHandle:g,toPosition:x,pointer:w}=Mb();if(!o)return;if(r)return c.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:d,fromX:a.x,fromY:a.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:x,connectionStatus:by(s),toNode:m,toHandle:g,pointer:w});let k="";const E={sourceX:a.x,sourceY:a.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:x};switch(t){case mi.Bezier:[k]=Dy(E);break;case mi.SimpleBezier:[k]=gx(E);break;case mi.Step:[k]=vd({...E,borderRadius:0});break;case mi.SmoothStep:[k]=vd(E);break;default:[k]=By(E)}return c.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};Ix.displayName="ConnectionLine";const Lb={};function Vm(e=Lb){P.useRef(e),ct(),P.useEffect(()=>{},[e])}function Db(){ct(),P.useRef(!1),P.useEffect(()=>{},[])}function Tx({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:w,connectionLineType:k,connectionLineStyle:E,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:C,selectionOnDrag:N,selectionMode:I,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:D,deleteKeyCode:G,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:F,translateExtent:W,minZoom:J,maxZoom:z,preventScrolling:O,defaultMarkerColor:$,zoomOnScroll:Q,zoomOnPinch:M,panOnScroll:V,panOnScrollSpeed:j,panOnScrollMode:R,zoomOnDoubleClick:Y,panOnDrag:A,onPaneClick:ae,onPaneMouseEnter:re,onPaneMouseMove:ce,onPaneMouseLeave:he,onPaneScroll:se,onPaneContextMenu:ge,paneClickDistance:be,nodeClickDistance:Pe,onEdgeContextMenu:Ee,onEdgeMouseEnter:ke,onEdgeMouseMove:Ve,onEdgeMouseLeave:We,reconnectRadius:Oe,onReconnect:tt,onReconnectStart:It,onReconnectEnd:Ct,noDragClassName:gt,noWheelClassName:Tt,noPanClassName:Ht,disableKeyboardA11y:pn,nodeExtent:mn,rfId:Jt,viewport:oe,onViewportChange:ye}){return Vm(e),Vm(t),Db(),_b(r),Tb(oe),c.jsx(ZE,{onPaneClick:ae,onPaneMouseEnter:re,onPaneMouseMove:ce,onPaneMouseLeave:he,onPaneContextMenu:ge,onPaneScroll:se,paneClickDistance:be,deleteKeyCode:G,selectionKeyCode:C,selectionOnDrag:N,selectionMode:I,onSelectionStart:x,onSelectionEnd:w,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:D,elementsSelectable:q,zoomOnScroll:Q,zoomOnPinch:M,zoomOnDoubleClick:Y,panOnScroll:V,panOnScrollSpeed:j,panOnScrollMode:R,panOnDrag:A,defaultViewport:F,translateExtent:W,minZoom:J,maxZoom:z,onSelectionContextMenu:g,preventScrolling:O,noDragClassName:gt,noWheelClassName:Tt,noPanClassName:Ht,disableKeyboardA11y:pn,onViewportChange:ye,isControlledViewport:!!oe,children:c.jsxs(jb,{children:[c.jsx(bb,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:tt,onReconnectStart:It,onReconnectEnd:Ct,onlyRenderVisibleElements:U,onEdgeContextMenu:Ee,onEdgeMouseEnter:ke,onEdgeMouseMove:Ve,onEdgeMouseLeave:We,reconnectRadius:Oe,defaultMarkerColor:$,noPanClassName:Ht,disableKeyboardA11y:pn,rfId:Jt}),c.jsx(Rb,{style:E,type:k,component:b,containerStyle:S}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(lb,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:a,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Pe,onlyRenderVisibleElements:U,noPanClassName:Ht,noDragClassName:gt,disableKeyboardA11y:pn,nodeExtent:mn,rfId:Jt}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}Tx.displayName="GraphView";const Fb=P.memo(Tx),Um=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:x="basic"}={})=>{const w=new Map,k=new Map,E=new Map,b=new Map,S=s??t??[],C=r??e??[],N=m??[0,0],I=g??Ko;Uy(E,b,S);const B=Sd(C,w,k,{nodeOrigin:N,nodeExtent:I,zIndexMode:x});let T=[0,0,1];if(u&&o&&a){const D=al(w,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:G,y:U,zoom:q}=Ud(D,o,a,h,p,(d==null?void 0:d.padding)??.1);T=[G,U,q]}return{rfId:"1",width:o??0,height:a??0,transform:T,nodes:C,nodesInitialized:B,nodeLookup:w,parentLookup:k,edges:S,edgeLookup:b,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Ko,nodeExtent:I,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Gi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:u??!1,fitViewOptions:d,fitViewResolver:null,connection:{...Ey},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Zk,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ny,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ob=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x})=>rE((w,k)=>{async function E(){const{nodeLookup:b,panZoom:S,fitViewOptions:C,fitViewResolver:N,width:I,height:B,minZoom:T,maxZoom:D}=k();S&&(await Kk({nodes:b,width:I,height:B,panZoom:S,minZoom:T,maxZoom:D},C),N==null||N.resolve(!0),w({fitViewResolver:null}))}return{...Um({nodes:e,edges:t,width:o,height:a,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:r,defaultEdges:s,zIndexMode:x}),setNodes:b=>{const{nodeLookup:S,parentLookup:C,nodeOrigin:N,elevateNodesOnSelect:I,fitViewQueued:B,zIndexMode:T}=k(),D=Sd(b,S,C,{nodeOrigin:N,nodeExtent:g,elevateNodesOnSelect:I,checkEquality:!0,zIndexMode:T});B&&D?(E(),w({nodes:b,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):w({nodes:b,nodesInitialized:D})},setEdges:b=>{const{connectionLookup:S,edgeLookup:C}=k();Uy(S,C,b),w({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:C}=k();C(b),w({hasDefaultNodes:!0})}if(S){const{setEdges:C}=k();C(S),w({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:C,parentLookup:N,domNode:I,nodeOrigin:B,nodeExtent:T,debug:D,fitViewQueued:G,zIndexMode:U}=k(),{changes:q,updatedInternals:F}=vN(b,C,N,I,B,T,U);F&&(mN(C,N,{nodeOrigin:B,nodeExtent:T,zIndexMode:U}),G?(E(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),(q==null?void 0:q.length)>0&&(D&&console.log("React Flow: trigger node changes",q),S==null||S(q)))},updateNodePositions:(b,S=!1)=>{const C=[];let N=[];const{nodeLookup:I,triggerNodeChanges:B,connection:T,updateConnection:D,onNodesChangeMiddlewareMap:G}=k();for(const[U,q]of b){const F=I.get(U),W=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(q!=null&&q.position)),J={id:U,type:"position",position:W?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:S};if(F&&T.inProgress&&T.fromNode.id===F.id){const z=Qi(F,T.fromHandle,Te.Left,!0);D({...T,from:z})}W&&F.parentId&&C.push({id:U,parentId:F.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),N.push(J)}if(C.length>0){const{parentLookup:U,nodeOrigin:q}=k(),F=Kd(C,I,U,q);N.push(...F)}for(const U of G.values())N=U(N);B(N)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:C,nodes:N,hasDefaultNodes:I,debug:B}=k();if(b!=null&&b.length){if(I){const T=sx(b,N);C(T)}B&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:C,edges:N,hasDefaultEdges:I,debug:B}=k();if(b!=null&&b.length){if(I){const T=ox(b,N);C(T)}B&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:N,triggerNodeChanges:I,triggerEdgeChanges:B}=k();if(S){const T=b.map(D=>Vi(D,!0));I(T);return}I(Os(N,new Set([...b]),!0)),B(Os(C))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:N,triggerNodeChanges:I,triggerEdgeChanges:B}=k();if(S){const T=b.map(D=>Vi(D,!0));B(T);return}B(Os(C,new Set([...b]))),I(Os(N,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:C,nodes:N,nodeLookup:I,triggerNodeChanges:B,triggerEdgeChanges:T}=k(),D=b||N,G=S||C,U=D.map(F=>{const W=I.get(F.id);return W&&(W.selected=!1),Vi(F.id,!1)}),q=G.map(F=>Vi(F.id,!1));B(U),T(q)},setMinZoom:b=>{const{panZoom:S,maxZoom:C}=k();S==null||S.setScaleExtent([b,C]),w({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:C}=k();S==null||S.setScaleExtent([C,b]),w({maxZoom:b})},setTranslateExtent:b=>{var S;(S=k().panZoom)==null||S.setTranslateExtent(b),w({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:C,triggerEdgeChanges:N,elementsSelectable:I}=k();if(!I)return;const B=S.reduce((D,G)=>G.selected?[...D,Vi(G.id,!1)]:D,[]),T=b.reduce((D,G)=>G.selected?[...D,Vi(G.id,!1)]:D,[]);C(B),N(T)},setNodeExtent:b=>{const{nodes:S,nodeLookup:C,parentLookup:N,nodeOrigin:I,elevateNodesOnSelect:B,nodeExtent:T,zIndexMode:D}=k();b[0][0]===T[0][0]&&b[0][1]===T[0][1]&&b[1][0]===T[1][0]&&b[1][1]===T[1][1]||(Sd(S,C,N,{nodeOrigin:I,nodeExtent:b,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:D}),w({nodeExtent:b}))},panBy:b=>{const{transform:S,width:C,height:N,panZoom:I,translateExtent:B}=k();return wN({delta:b,panZoom:I,transform:S,translateExtent:B,width:C,height:N})},setCenter:async(b,S,C)=>{const{width:N,height:I,maxZoom:B,panZoom:T}=k();if(!T)return Promise.resolve(!1);const D=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:B;return await T.setViewport({x:N/2-b*D,y:I/2-S*D,zoom:D},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{w({connection:{...Ey}})},updateConnection:b=>{w({connection:b})},reset:()=>w({...Um()})}},Object.is);function Px({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:w}){const[k]=P.useState(()=>Ob({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:m,nodeExtent:g,zIndexMode:x}));return c.jsx(iE,{value:k,children:c.jsx(jE,{children:w})})}function $b({children:e,nodes:t,edges:r,defaultNodes:s,defaultEdges:o,width:a,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:w}){return P.useContext(Za)?c.jsx(c.Fragment,{children:e}):c.jsx(Px,{initialNodes:t,initialEdges:r,defaultNodes:s,defaultEdges:o,initialWidth:a,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:w,children:e})}const Bb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Hb({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,className:o,nodeTypes:a,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:x,onConnect:w,onConnectStart:k,onConnectEnd:E,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:I,onNodeContextMenu:B,onNodeDoubleClick:T,onNodeDragStart:D,onNodeDrag:G,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:F,onDelete:W,onSelectionChange:J,onSelectionDragStart:z,onSelectionDrag:O,onSelectionDragStop:$,onSelectionContextMenu:Q,onSelectionStart:M,onSelectionEnd:V,onBeforeDelete:j,connectionMode:R,connectionLineType:Y=mi.Bezier,connectionLineStyle:A,connectionLineComponent:ae,connectionLineContainerStyle:re,deleteKeyCode:ce="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:se=!1,selectionMode:ge=Qo.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:Pe=el()?"Meta":"Control",zoomActivationKeyCode:Ee=el()?"Meta":"Control",snapToGrid:ke,snapGrid:Ve,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:Oe,nodesDraggable:tt,autoPanOnNodeFocus:It,nodesConnectable:Ct,nodesFocusable:gt,nodeOrigin:Tt=rx,edgesFocusable:Ht,edgesReconnectable:pn,elementsSelectable:mn=!0,defaultViewport:Jt=yE,minZoom:oe=.5,maxZoom:ye=2,translateExtent:me=Ko,preventScrolling:$e=!0,nodeExtent:Be,defaultMarkerColor:ht="#b1b1b7",zoomOnScroll:gn=!0,zoomOnPinch:Pt=!0,panOnScroll:yt=!1,panOnScrollSpeed:_n=.5,panOnScrollMode:pt=Yi.Free,zoomOnDoubleClick:en=!0,panOnDrag:At=!0,onPaneClick:$r,onPaneMouseEnter:Br,onPaneMouseMove:Vt,onPaneMouseLeave:tr,onPaneScroll:Fn,onPaneContextMenu:yn,paneClickDistance:Hr=1,nodeClickDistance:Si=0,children:On,onReconnect:wr,onReconnectStart:ts,onReconnectEnd:Sr,onEdgeContextMenu:kr,onEdgeDoubleClick:$n,onEdgeMouseEnter:Vr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Dt,reconnectRadius:Nr=10,onNodesChange:St,onEdgesChange:Qs,noDragClassName:xn="nodrag",noWheelClassName:ns="nowheel",noPanClassName:Ft="nopan",fitView:ki,fitViewOptions:Bn,connectOnClick:xt,attributionPosition:Ni,proOptions:nr,defaultEdgeOptions:Ei,elevateNodesOnSelect:bi=!0,elevateEdgesOnSelect:In=!1,disableKeyboardA11y:rr=!1,autoPanOnConnect:st,autoPanOnNodeDrag:Zs,autoPanSpeed:Ci,connectionRadius:ji,isValidConnection:Er,onError:Js,style:rs,id:br,nodeDragThreshold:tn,connectionDragThreshold:is,viewport:Ot,onViewportChange:Wr,width:ss,height:ir,colorMode:Yr="light",debug:Xr,onScroll:Gt,ariaLabelConfig:et,zIndexMode:qr="basic",...eo},_i){const Gr=br||"1",Ii=SE(Yr),Hn=P.useCallback(os=>{os.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gt==null||Gt(os)},[Gt]);return c.jsx("div",{"data-testid":"rf__wrapper",...eo,onScroll:Hn,style:{...rs,...Bb},ref:_i,className:bt(["react-flow",o,Ii]),id:br,role:"application",children:c.jsxs($b,{nodes:e,edges:t,width:ss,height:ir,fitView:ki,fitViewOptions:Bn,minZoom:oe,maxZoom:ye,nodeOrigin:Tt,nodeExtent:Be,zIndexMode:qr,children:[c.jsx(Fb,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:I,onNodeContextMenu:B,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:u,connectionLineType:Y,connectionLineStyle:A,connectionLineComponent:ae,connectionLineContainerStyle:re,selectionKeyCode:he,selectionOnDrag:se,selectionMode:ge,deleteKeyCode:ce,multiSelectionKeyCode:Pe,panActivationKeyCode:be,zoomActivationKeyCode:Ee,onlyRenderVisibleElements:We,defaultViewport:Jt,translateExtent:me,minZoom:oe,maxZoom:ye,preventScrolling:$e,zoomOnScroll:gn,zoomOnPinch:Pt,zoomOnDoubleClick:en,panOnScroll:yt,panOnScrollSpeed:_n,panOnScrollMode:pt,panOnDrag:At,onPaneClick:$r,onPaneMouseEnter:Br,onPaneMouseMove:Vt,onPaneMouseLeave:tr,onPaneScroll:Fn,onPaneContextMenu:yn,paneClickDistance:Hr,nodeClickDistance:Si,onSelectionContextMenu:Q,onSelectionStart:M,onSelectionEnd:V,onReconnect:wr,onReconnectStart:ts,onReconnectEnd:Sr,onEdgeContextMenu:kr,onEdgeDoubleClick:$n,onEdgeMouseEnter:Vr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Dt,reconnectRadius:Nr,defaultMarkerColor:ht,noDragClassName:xn,noWheelClassName:ns,noPanClassName:Ft,rfId:Gr,disableKeyboardA11y:rr,nodeExtent:Be,viewport:Ot,onViewportChange:Wr}),c.jsx(wE,{nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:w,onConnectStart:k,onConnectEnd:E,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:tt,autoPanOnNodeFocus:It,nodesConnectable:Ct,nodesFocusable:gt,edgesFocusable:Ht,edgesReconnectable:pn,elementsSelectable:mn,elevateNodesOnSelect:bi,elevateEdgesOnSelect:In,minZoom:oe,maxZoom:ye,nodeExtent:Be,onNodesChange:St,onEdgesChange:Qs,snapToGrid:ke,snapGrid:Ve,connectionMode:R,translateExtent:me,connectOnClick:xt,defaultEdgeOptions:Ei,fitView:ki,fitViewOptions:Bn,onNodesDelete:q,onEdgesDelete:F,onDelete:W,onNodeDragStart:D,onNodeDrag:G,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:z,onSelectionDragStop:$,onMove:m,onMoveStart:g,onMoveEnd:x,noPanClassName:Ft,nodeOrigin:Tt,rfId:Gr,autoPanOnConnect:st,autoPanOnNodeDrag:Zs,autoPanSpeed:Ci,onError:Js,connectionRadius:ji,isValidConnection:Er,selectNodesOnDrag:Oe,nodeDragThreshold:tn,connectionDragThreshold:is,onBeforeDelete:j,debug:Xr,ariaLabelConfig:et,zIndexMode:qr}),c.jsx(gE,{onSelectionChange:J}),On,c.jsx(dE,{proOptions:nr,position:Ni}),c.jsx(cE,{rfId:Gr,disableKeyboardA11y:rr})]})})}var Ax=lx(Hb);function Vb(e){const[t,r]=P.useState(e),s=P.useCallback(o=>r(a=>sx(o,a)),[]);return[t,r,s]}function Ub(e){const[t,r]=P.useState(e),s=P.useCallback(o=>r(a=>ox(o,a)),[]);return[t,r,s]}function Wb({dimensions:e,lineWidth:t,variant:r,className:s}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:bt(["react-flow__background-pattern",r,s])})}function Yb({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:bt(["react-flow__background-pattern","dots",t])})}var gr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gr||(gr={}));const Xb={[gr.Dots]:1,[gr.Lines]:1,[gr.Cross]:6},qb=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mx({id:e,variant:t=gr.Dots,gap:r=20,size:s,lineWidth:o=1,offset:a=0,color:u,bgColor:d,style:h,className:p,patternClassName:m}){const g=P.useRef(null),{transform:x,patternId:w}=qe(qb,ut),k=s||Xb[t],E=t===gr.Dots,b=t===gr.Cross,S=Array.isArray(r)?r:[r,r],C=[S[0]*x[2]||1,S[1]*x[2]||1],N=k*x[2],I=Array.isArray(a)?a:[a,a],B=b?[N,N]:C,T=[I[0]*x[2]||1+B[0]/2,I[1]*x[2]||1+B[1]/2],D=`${w}${e||""}`;return c.jsxs("svg",{className:bt(["react-flow__background",p]),style:{...h,...eu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[c.jsx("pattern",{id:D,x:x[0]%C[0],y:x[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?c.jsx(Yb,{radius:N/2,className:m}):c.jsx(Wb,{dimensions:B,lineWidth:o,variant:t,className:m})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Mx.displayName="Background";const zx=P.memo(Mx);function Gb(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Kb(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Qb(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Zb(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Jb(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function wa({children:e,className:t,...r}){return c.jsx("button",{type:"button",className:bt(["react-flow__controls-button",t]),...r,children:e})}const eC=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:r=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:m,position:g="bottom-left",orientation:x="vertical","aria-label":w}){const k=ct(),{isInteractive:E,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:C}=qe(eC,ut),{zoomIn:N,zoomOut:I,fitView:B}=Qd(),T=()=>{N(),a==null||a()},D=()=>{I(),u==null||u()},G=()=>{B(o),d==null||d()},U=()=>{k.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h==null||h(!E)},q=x==="horizontal"?"horizontal":"vertical";return c.jsxs(Ja,{className:bt(["react-flow__controls",q,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":w??C["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(wa,{onClick:T,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:S,children:c.jsx(Gb,{})}),c.jsx(wa,{onClick:D,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:b,children:c.jsx(Kb,{})})]}),r&&c.jsx(wa,{className:"react-flow__controls-fitview",onClick:G,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:c.jsx(Qb,{})}),s&&c.jsx(wa,{className:"react-flow__controls-interactive",onClick:U,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:E?c.jsx(Jb,{}):c.jsx(Zb,{})}),m]})}Rx.displayName="Controls";const Lx=P.memo(Rx);function tC({id:e,x:t,y:r,width:s,height:o,style:a,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:m,shapeRendering:g,selected:x,onClick:w}){const{background:k,backgroundColor:E}=a||{},b=u||k||E;return c.jsx("rect",{className:bt(["react-flow__minimap-node",{selected:x},p]),x:t,y:r,rx:m,ry:m,width:s,height:o,style:{fill:b,stroke:d,strokeWidth:h},shapeRendering:g,onClick:w?S=>w(S,e):void 0})}const nC=P.memo(tC),rC=e=>e.nodes.map(t=>t.id),Gc=e=>e instanceof Function?e:()=>e;function iC({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:a=nC,onClick:u}){const d=qe(rC,ut),h=Gc(t),p=Gc(e),m=Gc(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:d.map(x=>c.jsx(oC,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:a,onClick:u,shapeRendering:g},x))})}function sC({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:m,y:g,width:x,height:w}=qe(k=>{const{internals:E}=k.nodeLookup.get(e),b=E.userNode,{x:S,y:C}=E.positionAbsolute,{width:N,height:I}=Or(b);return{node:b,x:S,y:C,width:N,height:I}},ut);return!p||p.hidden||!Py(p)?null:c.jsx(d,{x:m,y:g,width:x,height:w,style:p.style,selected:!!p.selected,className:s(p),color:t(p),borderRadius:o,strokeColor:r(p),strokeWidth:a,shapeRendering:u,onClick:h,id:p.id})}const oC=P.memo(sC);var lC=P.memo(iC);const aC=200,uC=150,cC=e=>!e.hidden,dC=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?Ty(al(e.nodeLookup,{filter:cC}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fC="react-flow__minimap-desc";function Dx({style:e,className:t,nodeStrokeColor:r,nodeColor:s,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:x="bottom-right",onClick:w,onNodeClick:k,pannable:E=!1,zoomable:b=!1,ariaLabel:S,inversePan:C,zoomStep:N=1,offsetScale:I=5}){const B=ct(),T=P.useRef(null),{boundingRect:D,viewBB:G,rfId:U,panZoom:q,translateExtent:F,flowWidth:W,flowHeight:J,ariaLabelConfig:z}=qe(dC,ut),O=(e==null?void 0:e.width)??aC,$=(e==null?void 0:e.height)??uC,Q=D.width/O,M=D.height/$,V=Math.max(Q,M),j=V*O,R=V*$,Y=I*V,A=D.x-(j-D.width)/2-Y,ae=D.y-(R-D.height)/2-Y,re=j+Y*2,ce=R+Y*2,he=`${fC}-${U}`,se=P.useRef(0),ge=P.useRef();se.current=V,P.useEffect(()=>{if(T.current&&q)return ge.current=IN({domNode:T.current,panZoom:q,getTransform:()=>B.getState().transform,getViewScale:()=>se.current}),()=>{var ke;(ke=ge.current)==null||ke.destroy()}},[q]),P.useEffect(()=>{var ke;(ke=ge.current)==null||ke.update({translateExtent:F,width:W,height:J,inversePan:C,pannable:E,zoomStep:N,zoomable:b})},[E,b,C,N,F,W,J]);const be=w?ke=>{var Oe;const[Ve,We]=((Oe=ge.current)==null?void 0:Oe.pointer(ke))||[0,0];w(ke,{x:Ve,y:We})}:void 0,Pe=k?P.useCallback((ke,Ve)=>{const We=B.getState().nodeLookup.get(Ve).internals.userNode;k(ke,We)},[]):void 0,Ee=S??z["minimap.ariaLabel"];return c.jsx(Ja,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*V:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:bt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:O,height:$,viewBox:`${A} ${ae} ${re} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:T,onClick:be,children:[Ee&&c.jsx("title",{id:he,children:Ee}),c.jsx(lC,{onClick:Pe,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${A-Y},${ae-Y}h${re+Y*2}v${ce+Y*2}h${-re-Y*2}z
|
|
62
|
+
M${G.x},${G.y}h${G.width}v${G.height}h${-G.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Dx.displayName="MiniMap";P.memo(Dx);const hC=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,pC={[Zi.Line]:"right",[Zi.Handle]:"bottom-right"};function mC({nodeId:e,position:t,variant:r=Zi.Handle,className:s,style:o=void 0,children:a,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:w=!0,shouldResize:k,onResizeStart:E,onResize:b,onResizeEnd:S}){const C=dx(),N=typeof e=="string"?e:C,I=ct(),B=P.useRef(null),T=r===Zi.Handle,D=qe(P.useCallback(hC(T&&w),[T,w]),ut),G=P.useRef(null),U=t??pC[r];P.useEffect(()=>{if(!(!B.current||!N))return G.current||(G.current=WN({domNode:B.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:F,transform:W,snapGrid:J,snapToGrid:z,nodeOrigin:O,domNode:$}=I.getState();return{nodeLookup:F,transform:W,snapGrid:J,snapToGrid:z,nodeOrigin:O,paneDomNode:$}},onChange:(F,W)=>{const{triggerNodeChanges:J,nodeLookup:z,parentLookup:O,nodeOrigin:$}=I.getState(),Q=[],M={x:F.x,y:F.y},V=z.get(N);if(V&&V.expandParent&&V.parentId){const j=V.origin??$,R=F.width??V.measured.width??0,Y=F.height??V.measured.height??0,A={id:V.id,parentId:V.parentId,rect:{width:R,height:Y,...Ay({x:F.x??V.position.x,y:F.y??V.position.y},{width:R,height:Y},V.parentId,z,j)}},ae=Kd([A],z,O,$);Q.push(...ae),M.x=F.x?Math.max(j[0]*R,F.x):void 0,M.y=F.y?Math.max(j[1]*Y,F.y):void 0}if(M.x!==void 0&&M.y!==void 0){const j={id:N,type:"position",position:{...M}};Q.push(j)}if(F.width!==void 0&&F.height!==void 0){const R={id:N,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};Q.push(R)}for(const j of W){const R={...j,type:"position"};Q.push(R)}J(Q)},onEnd:({width:F,height:W})=>{const J={id:N,type:"dimensions",resizing:!1,dimensions:{width:F,height:W}};I.getState().triggerNodeChanges([J])}})),G.current.update({controlPosition:U,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:x,onResizeStart:E,onResize:b,onResizeEnd:S,shouldResize:k}),()=>{var F;(F=G.current)==null||F.destroy()}},[U,d,h,p,m,g,E,b,S,k]);const q=U.split("-");return c.jsx("div",{className:bt(["react-flow__resize-control","nodrag",...q,r,s]),ref:B,style:{...o,scale:D,...u&&{[T?"backgroundColor":"borderColor"]:u}},children:a})}const Wm=P.memo(mC);function gC({nodeId:e,isVisible:t=!0,handleClassName:r,handleStyle:s,lineClassName:o,lineStyle:a,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:x=!0,shouldResize:w,onResizeStart:k,onResize:E,onResizeEnd:b}){return t?c.jsxs(c.Fragment,{children:[ON.map(S=>c.jsx(Wm,{className:o,style:a,nodeId:e,position:S,variant:Zi.Line,color:u,minWidth:d,minHeight:h,maxWidth:p,maxHeight:m,onResizeStart:k,keepAspectRatio:g,autoScale:x,shouldResize:w,onResize:E,onResizeEnd:b},S)),FN.map(S=>c.jsx(Wm,{className:r,style:s,nodeId:e,position:S,color:u,minWidth:d,minHeight:h,maxWidth:p,maxHeight:m,onResizeStart:k,keepAspectRatio:g,autoScale:x,shouldResize:w,onResize:E,onResizeEnd:b},S))]}):null}function yC(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(o),t&&(s.href=t),o.href=e,o.href}const xC=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function yi(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let As=null;function Fx(e={}){return As||(e.includeStyleProperties?(As=e.includeStyleProperties,As):(As=yi(window.getComputedStyle(document.documentElement)),As))}function $a(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function vC(e){const t=$a(e,"border-left-width"),r=$a(e,"border-right-width");return e.clientWidth+t+r}function wC(e){const t=$a(e,"border-top-width"),r=$a(e,"border-bottom-width");return e.clientHeight+t+r}function Ox(e,t={}){const r=t.width||vC(e),s=t.height||wC(e);return{width:r,height:s}}function SC(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Nn=16384;function kC(e){(e.width>Nn||e.height>Nn)&&(e.width>Nn&&e.height>Nn?e.width>e.height?(e.height*=Nn/e.width,e.width=Nn):(e.width*=Nn/e.height,e.height=Nn):e.width>Nn?(e.height*=Nn/e.width,e.width=Nn):(e.width*=Nn/e.height,e.height=Nn))}function Ba(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function NC(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function EC(e,t,r){const s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),a=document.createElementNS(s,"foreignObject");return o.setAttribute("width",`${t}`),o.setAttribute("height",`${r}`),o.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),o.appendChild(a),a.appendChild(e),NC(o)}const dn=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||dn(r,t)};function bC(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function CC(e,t){return Fx(t).map(r=>{const s=e.getPropertyValue(r),o=e.getPropertyPriority(r);return`${r}: ${s}${o?" !important":""};`}).join(" ")}function jC(e,t,r,s){const o=`.${e}:${t}`,a=r.cssText?bC(r):CC(r,s);return document.createTextNode(`${o}{${a}}`)}function Ym(e,t,r,s){const o=window.getComputedStyle(e,r),a=o.getPropertyValue("content");if(a===""||a==="none")return;const u=xC();try{t.className=`${t.className} ${u}`}catch{return}const d=document.createElement("style");d.appendChild(jC(u,r,o,s)),t.appendChild(d)}function _C(e,t,r){Ym(e,t,":before",r),Ym(e,t,":after",r)}const Xm="application/font-woff",qm="image/jpeg",IC={woff:Xm,woff2:Xm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qm,jpeg:qm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function TC(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Jd(e){const t=TC(e).toLowerCase();return IC[t]||""}function PC(e){return e.split(/,/)[1]}function Ed(e){return e.search(/^(data:)/)!==-1}function AC(e,t){return`data:${t};base64,${e}`}async function $x(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const o=await s.blob();return new Promise((a,u)=>{const d=new FileReader;d.onerror=u,d.onloadend=()=>{try{a(r({res:s,result:d.result}))}catch(h){u(h)}},d.readAsDataURL(o)})}const Kc={};function MC(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function ef(e,t,r){const s=MC(e,t,r.includeQueryParams);if(Kc[s]!=null)return Kc[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let o;try{const a=await $x(e,r.fetchRequestInit,({res:u,result:d})=>(t||(t=u.headers.get("Content-Type")||""),PC(d)));o=AC(a,t)}catch(a){o=r.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;a&&(u=typeof a=="string"?a:a.message),u&&console.warn(u)}return Kc[s]=o,o}async function zC(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ba(t)}async function RC(e,t){if(e.currentSrc){const a=document.createElement("canvas"),u=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,u==null||u.drawImage(e,0,0,a.width,a.height);const d=a.toDataURL();return Ba(d)}const r=e.poster,s=Jd(r),o=await ef(r,s,t);return Ba(o)}async function LC(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await nu(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function DC(e,t){return dn(e,HTMLCanvasElement)?zC(e):dn(e,HTMLVideoElement)?RC(e,t):dn(e,HTMLIFrameElement)?LC(e,t):e.cloneNode(Bx(e))}const FC=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Bx=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function OC(e,t,r){var s,o;if(Bx(t))return t;let a=[];return FC(e)&&e.assignedNodes?a=yi(e.assignedNodes()):dn(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?a=yi(e.contentDocument.body.childNodes):a=yi(((o=e.shadowRoot)!==null&&o!==void 0?o:e).childNodes),a.length===0||dn(e,HTMLVideoElement)||await a.reduce((u,d)=>u.then(()=>nu(d,r)).then(h=>{h&&t.appendChild(h)}),Promise.resolve()),t}function $C(e,t,r){const s=t.style;if(!s)return;const o=window.getComputedStyle(e);o.cssText?(s.cssText=o.cssText,s.transformOrigin=o.transformOrigin):Fx(r).forEach(a=>{let u=o.getPropertyValue(a);a==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),dn(e,HTMLIFrameElement)&&a==="display"&&u==="inline"&&(u="block"),a==="d"&&t.getAttribute("d")&&(u=`path(${t.getAttribute("d")})`),s.setProperty(a,u,o.getPropertyPriority(a))})}function BC(e,t){dn(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),dn(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function HC(e,t){if(dn(e,HTMLSelectElement)){const s=Array.from(t.children).find(o=>e.value===o.getAttribute("value"));s&&s.setAttribute("selected","")}}function VC(e,t,r){return dn(t,Element)&&($C(e,t,r),_C(e,t,r),BC(e,t),HC(e,t)),t}async function UC(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let a=0;a<r.length;a++){const d=r[a].getAttribute("xlink:href");if(d){const h=e.querySelector(d),p=document.querySelector(d);!h&&p&&!s[d]&&(s[d]=await nu(p,t,!0))}}const o=Object.values(s);if(o.length){const a="http://www.w3.org/1999/xhtml",u=document.createElementNS(a,"svg");u.setAttribute("xmlns",a),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const d=document.createElementNS(a,"defs");u.appendChild(d);for(let h=0;h<o.length;h++)d.appendChild(o[h]);e.appendChild(u)}return e}async function nu(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>DC(s,t)).then(s=>OC(e,s,t)).then(s=>VC(e,s,t)).then(s=>UC(s,t))}const Hx=/url\((['"]?)([^'"]+?)\1\)/g,WC=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,YC=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function XC(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function qC(e){const t=[];return e.replace(Hx,(r,s,o)=>(t.push(o),r)),t.filter(r=>!Ed(r))}async function GC(e,t,r,s,o){try{const a=r?yC(t,r):t,u=Jd(t);let d;return o||(d=await ef(a,u,s)),e.replace(XC(t),`$1${d}$3`)}catch{}return e}function KC(e,{preferredFontFormat:t}){return t?e.replace(YC,r=>{for(;;){const[s,,o]=WC.exec(r)||[];if(!o)return"";if(o===t)return`src: ${s};`}}):e}function Vx(e){return e.search(Hx)!==-1}async function Ux(e,t,r){if(!Vx(e))return e;const s=KC(e,r);return qC(s).reduce((a,u)=>a.then(d=>GC(d,u,t,r)),Promise.resolve(s))}async function Ms(e,t,r){var s;const o=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(o){const a=await Ux(o,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function QC(e,t){await Ms("background",e,t)||await Ms("background-image",e,t),await Ms("mask",e,t)||await Ms("-webkit-mask",e,t)||await Ms("mask-image",e,t)||await Ms("-webkit-mask-image",e,t)}async function ZC(e,t){const r=dn(e,HTMLImageElement);if(!(r&&!Ed(e.src))&&!(dn(e,SVGImageElement)&&!Ed(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,o=await ef(s,Jd(s),t);await new Promise((a,u)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...h)=>{try{a(t.onImageErrorHandler(...h))}catch(p){u(p)}}:u;const d=e;d.decode&&(d.decode=a),d.loading==="lazy"&&(d.loading="eager"),r?(e.srcset="",e.src=o):e.href.baseVal=o})}async function JC(e,t){const s=yi(e.childNodes).map(o=>Wx(o,t));await Promise.all(s).then(()=>e)}async function Wx(e,t){dn(e,Element)&&(await QC(e,t),await ZC(e,t),await JC(e,t))}function ej(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(o=>{r[o]=s[o]}),e}const Gm={};async function Km(e){let t=Gm[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},Gm[e]=t,t}async function Qm(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async u=>{let d=u.replace(s,"$1");return d.startsWith("https://")||(d=new URL(d,e.url).href),$x(d,t.fetchRequestInit,({result:h})=>(r=r.replace(u,`url(${h})`),[u,h]))});return Promise.all(a).then(()=>r)}function Zm(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const o=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const h=o.exec(s);if(h===null)break;t.push(h[0])}s=s.replace(o,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",d=new RegExp(u,"gi");for(;;){let h=a.exec(s);if(h===null){if(h=d.exec(s),h===null)break;a.lastIndex=d.lastIndex}else d.lastIndex=a.lastIndex;t.push(h[0])}return t}async function tj(e,t){const r=[],s=[];return e.forEach(o=>{if("cssRules"in o)try{yi(o.cssRules||[]).forEach((a,u)=>{if(a.type===CSSRule.IMPORT_RULE){let d=u+1;const h=a.href,p=Km(h).then(m=>Qm(m,t)).then(m=>Zm(m).forEach(g=>{try{o.insertRule(g,g.startsWith("@import")?d+=1:o.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:g,error:x})}})).catch(m=>{console.error("Error loading remote css",m.toString())});s.push(p)}})}catch(a){const u=e.find(d=>d.href==null)||document.styleSheets[0];o.href!=null&&s.push(Km(o.href).then(d=>Qm(d,t)).then(d=>Zm(d).forEach(h=>{u.insertRule(h,u.cssRules.length)})).catch(d=>{console.error("Error loading remote stylesheet",d)})),console.error("Error inlining remote css file",a)}}),Promise.all(s).then(()=>(e.forEach(o=>{if("cssRules"in o)try{yi(o.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${o.href}`,a)}}),r))}function nj(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Vx(t.style.getPropertyValue("src")))}async function rj(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=yi(e.ownerDocument.styleSheets),s=await tj(r,t);return nj(s)}function Yx(e){return e.trim().replace(/["']/g,"")}function ij(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(a=>{t.add(Yx(a))}),Array.from(s.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function sj(e,t){const r=await rj(e,t),s=ij(e);return(await Promise.all(r.filter(a=>s.has(Yx(a.style.fontFamily))).map(a=>{const u=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ux(a.cssText,u,t)}))).join(`
|
|
63
|
+
`)}async function oj(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await sj(e,t);if(r){const s=document.createElement("style"),o=document.createTextNode(r);s.appendChild(o),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Xx(e,t={}){const{width:r,height:s}=Ox(e,t),o=await nu(e,t,!0);return await oj(o,t),await Wx(o,t),ej(o,t),await EC(o,r,s)}async function lj(e,t={}){const{width:r,height:s}=Ox(e,t),o=await Xx(e,t),a=await Ba(o),u=document.createElement("canvas"),d=u.getContext("2d"),h=t.pixelRatio||SC(),p=t.canvasWidth||r,m=t.canvasHeight||s;return u.width=p*h,u.height=m*h,t.skipAutoScale||kC(u),u.style.width=`${p}`,u.style.height=`${m}`,t.backgroundColor&&(d.fillStyle=t.backgroundColor,d.fillRect(0,0,u.width,u.height)),d.drawImage(a,0,0,u.width,u.height),u}async function aj(e,t={}){return(await lj(e,t)).toDataURL()}function uj({feature:e,onClose:t}){return c.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:t,children:c.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:r=>r.stopPropagation(),children:[c.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),c.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[e," is a Pro feature"]}),c.jsxs("p",{style:{color:"#aaa",margin:"0 0 24px",fontSize:14,lineHeight:1.5},children:["Upgrade to Pro for ",e.toLowerCase(),", drift detection, premium agents, and more."]}),c.jsx("a",{href:"https://heartbyte.io/archbyte/pricing",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",background:"#7c3aed",color:"#fff",padding:"10px 28px",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:14},children:"Upgrade to Pro"}),c.jsx("button",{onClick:t,style:{display:"block",margin:"16px auto 0",background:"none",border:"none",color:"#888",cursor:"pointer",fontSize:13},children:"Maybe later"})]})})}function Jm({trigger:e,triggerClassName:t,contentClassName:r,children:s,disabled:o}){const[a,u]=P.useState(!1),d=P.useRef(null);return P.useEffect(()=>{if(!a)return;const h=m=>{d.current&&!d.current.contains(m.target)&&u(!1)},p=()=>u(!1);return document.addEventListener("mousedown",h),document.addEventListener("dropdown:closeall",p),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("dropdown:closeall",p)}},[a]),c.jsxs("div",{ref:d,className:"dropdown-wrapper",children:[c.jsx("button",{className:t,onClick:()=>!o&&u(!a),disabled:o,children:e}),a&&c.jsx("div",{className:`dropdown-menu ${r||""}`,onClick:()=>u(!1),children:s})]})}const cj={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},eg={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function dj({data:e,selected:t}){var p,m,g,x,w;const r=e,s=r.label.split(`
|
|
64
|
+
`),o=s[0],a=s.slice(1).join(`
|
|
65
|
+
`),u=["arch-node",r.layer,r.active?"active":"",r.highlighted?"highlighted":"",r.locked?"locked":"",r.isConnected===!0?"connected":"",r.isConnected===!1?"dimmed":"",r.changeType?`change-${r.changeType}`:"",r.healthScore!=null?r.healthScore>=75?"health-green":r.healthScore>=50?"health-amber":"health-red":"",(p=r.healthFlags)!=null&&p.isOrphan?"health-orphan":"",(m=r.healthFlags)!=null&&m.isHub?"health-hub":"",(g=r.healthFlags)!=null&&g.inCycle?"health-cycle":"",(x=r.pendingFiles)!=null&&x.length?"has-pending-changes":""].filter(Boolean).join(" "),d=cj[r.layer]||"#868e96",h=eg[r.nodeType]||eg.component;return c.jsxs(c.Fragment,{children:[c.jsx(gC,{color:d,isVisible:t,minWidth:100,minHeight:60}),c.jsxs("div",{className:u,style:{minWidth:r.width||130,width:"100%",height:"100%"},children:[c.jsx(gi,{type:"target",position:Te.Top}),c.jsx(gi,{type:"target",position:Te.Left}),c.jsx("div",{className:"node-type-icon",children:h}),c.jsxs("div",{className:"node-content",children:[c.jsx("div",{className:"label",children:o}),a&&c.jsx("div",{className:"sublabel",children:a}),r.description&&c.jsx("div",{className:"node-desc",children:r.description})]}),r.techStack&&r.techStack.length>0&&c.jsx("div",{className:"node-tech-row",children:r.techStack.slice(0,3).map((k,E)=>c.jsx("span",{className:"node-tech-pill",children:k},E))}),r.changeType&&c.jsx("div",{className:`change-indicator change-${r.changeType}`,children:r.changeType==="added"?"+":r.changeType==="modified"?"~":"-"}),r.pendingFiles&&r.pendingFiles.length>0&&c.jsxs("div",{className:"pending-change-badge",children:[r.pendingFiles.some(k=>k.event==="add")?"+":"~",r.pendingFiles.length]}),((w=r.healthFlags)==null?void 0:w.isHub)&&r.healthScore!=null&&c.jsx("div",{className:"health-hub-badge",children:"HUB"}),c.jsx(gi,{type:"source",position:Te.Bottom}),c.jsx(gi,{type:"source",position:Te.Right})]})]})}const qx=P.memo(dj),fj={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function hj({selectedEnvironment:e,environments:t,onSelectEnvironment:r}){if(!t||Object.keys(t).length===0)return null;const s=Object.keys(t);return c.jsx("div",{className:"environment-tabs",children:s.map(o=>{var p;const a=e===o,u=t==null?void 0:t[o],d=(u==null?void 0:u.color)||fj[o]||"#6b7280",h=(u==null?void 0:u.label)||o.charAt(0).toUpperCase()+o.slice(1);return c.jsxs("button",{className:`env-tab ${a?"selected":""}`,onClick:()=>r(o),style:{"--env-color":d},children:[c.jsx("span",{className:"env-indicator"}),c.jsx("span",{className:"env-label",children:h}),a&&u&&c.jsx("span",{className:"env-meta",children:[u.deployment,u.scaling,(p=u.urlPatterns||u.urls)==null?void 0:p[0]].filter(Boolean).join(" | ")})]},o)})})}const pj=P.memo(hj);function xi({children:e,className:t,style:r}){const s=P.useRef(null),[o,a]=P.useState({x:0,y:0}),u=P.useRef(!1),d=P.useRef({x:0,y:0}),h=P.useRef({x:0,y:0}),p=P.useCallback(m=>{const g=m.target;if(!g.closest("[data-drag-handle]")||g.closest("button"))return;u.current=!0,d.current={x:m.clientX,y:m.clientY},h.current={...o},m.preventDefault();const w=E=>{u.current&&a({x:h.current.x+(E.clientX-d.current.x),y:h.current.y+(E.clientY-d.current.y)})},k=()=>{u.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",k)},[o]);return c.jsx("div",{ref:s,className:t,style:{...r,transform:`translate(${o.x}px, ${o.y}px)`},onMouseDown:p,children:e})}function mj(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function gj(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function yj({visible:e,onClose:t}){const[r,s]=P.useState(null),o=P.useCallback(async()=>{try{const a=await fetch("/api/stats");a.ok&&s(await a.json())}catch{}},[]);return P.useEffect(()=>{e&&o()},[e,o]),!e||!r?null:c.jsxs(xi,{className:"stats-overlay",children:[c.jsxs("div",{className:"stats-overlay-header","data-drag-handle":!0,children:[c.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),(r.durationMs||r.filesScanned||r.analyzedAt)&&c.jsxs("div",{className:"stats-scan-info",children:[r.durationMs!=null&&c.jsx("span",{className:"scan-info-item",children:mj(r.durationMs)}),r.filesScanned!=null&&c.jsxs("span",{className:"scan-info-item",children:[r.filesScanned.toLocaleString()," files"]}),r.tokenUsage&&c.jsxs("span",{className:"scan-info-item",children:[(r.tokenUsage.input+r.tokenUsage.output).toLocaleString()," tokens"]}),r.analyzedAt&&c.jsx("span",{className:"scan-info-item",children:gj(r.analyzedAt)})]}),c.jsxs("div",{className:"stats-grid",children:[c.jsxs("div",{className:"stat-card",children:[c.jsx("div",{className:"stat-value",children:r.components}),c.jsx("div",{className:"stat-label",children:"Components"})]}),c.jsxs("div",{className:"stat-card",children:[c.jsx("div",{className:"stat-value",children:r.totalConnections}),c.jsx("div",{className:"stat-label",children:"Connections"})]}),c.jsxs("div",{className:"stat-card",children:[c.jsx("div",{className:"stat-value",children:r.databases}),c.jsx("div",{className:"stat-label",children:"Databases"})]}),c.jsxs("div",{className:"stat-card",children:[c.jsx("div",{className:"stat-value",children:r.externalServices}),c.jsx("div",{className:"stat-label",children:"External"})]}),c.jsxs("div",{className:`stat-card ${r.orphans>0?"highlight":""}`,children:[c.jsx("div",{className:"stat-value",children:r.orphans}),c.jsx("div",{className:"stat-label",children:"Orphans"})]}),c.jsxs("div",{className:"stat-card",children:[c.jsx("div",{className:"stat-value",children:r.flows}),c.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const xj=P.memo(yj);function vj({visible:e,onClose:t,builtinRules:r,customRules:s,onAddRule:o,onDeleteRule:a,onSave:u,saving:d}){const[h,p]=P.useState("builtin"),[m,g]=P.useState(""),[x,w]=P.useState(""),[k,E]=P.useState(""),[b,S]=P.useState("warn");if(!e)return null;const C=()=>{!m.trim()||!x.trim()||!k.trim()||(o({name:m.trim(),from:x.trim(),to:k.trim(),level:b}),g(""),w(""),E(""),S("warn"))};return c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:999},onClick:t}),c.jsxs("div",{className:"rules-config-modal",children:[c.jsxs("div",{className:"rules-modal-header",children:[c.jsx("span",{className:"rules-modal-title",children:"Configure Rules"}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),c.jsxs("div",{className:"rules-modal-tabs",children:[c.jsx("button",{className:`rules-modal-tab ${h==="builtin"?"active":""}`,onClick:()=>p("builtin"),children:"Built-in"}),c.jsx("button",{className:`rules-modal-tab ${h==="custom"?"active":""}`,onClick:()=>p("custom"),children:"Custom"})]}),c.jsxs("div",{className:"rules-modal-content",children:[h==="builtin"&&c.jsxs("div",{children:[c.jsx("div",{className:"rules-section-title",children:"Built-in Architecture Rules"}),r.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No built-in rules available"}):r.map(N=>c.jsxs("div",{className:"rule-config-item",children:[c.jsx("div",{className:"rule-config-name",children:N.name}),c.jsx("div",{className:"rule-config-desc",children:N.description||"No description"})]},N.name))]}),h==="custom"&&c.jsxs("div",{children:[c.jsx("div",{className:"rules-section-title",children:"Custom Rules"}),s.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No custom rules yet"}):s.map((N,I)=>c.jsxs("div",{className:"rule-config-item custom",children:[c.jsxs("div",{className:"rule-config-name",children:[N.name,c.jsx("span",{className:`rule-level-badge ${N.level}`,children:N.level})]}),c.jsxs("div",{className:"rule-config-matcher",children:[N.from," → ",N.to]}),c.jsx("button",{className:"panel-btn red small rule-delete-btn",onClick:()=>a(I),children:"x"})]},I)),c.jsxs("div",{className:"rule-add-form",children:[c.jsx("div",{className:"rule-add-title",children:"Add Custom Rule"}),c.jsx("input",{type:"text",placeholder:"Rule name",value:m,onChange:N=>g(N.target.value),className:"rule-input"}),c.jsxs("div",{className:"rule-add-row",children:[c.jsx("input",{type:"text",placeholder:"From (e.g. layer:presentation)",value:x,onChange:N=>w(N.target.value),className:"rule-input"}),c.jsx("span",{className:"rule-arrow",children:"→"}),c.jsx("input",{type:"text",placeholder:"To (e.g. layer:data)",value:k,onChange:N=>E(N.target.value),className:"rule-input"})]}),c.jsxs("div",{className:"rule-add-row",children:[c.jsxs("select",{value:b,onChange:N=>S(N.target.value),className:"rule-select",children:[c.jsx("option",{value:"warn",children:"warn"}),c.jsx("option",{value:"error",children:"error"})]}),c.jsx("button",{className:"panel-btn green small",onClick:C,children:"Add"})]})]}),c.jsx("div",{className:"rules-save-row",children:c.jsx("button",{className:"panel-btn cyan",onClick:u,disabled:d,children:d?"Saving...":"Save & Re-audit"})})]})]})]})]})}const wj=P.memo(vj);function Lt(e,t){fetch("/api/ui-event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,detail:t})}).catch(()=>{})}function Sj(e){return e>=75?"var(--accent-green)":e>=50?"var(--accent-amber)":"var(--accent-red)"}function kj({visible:e,onClose:t,onHighlightNode:r}){var G;const[s,o]=P.useState(null),[a,u]=P.useState(!1),[d,h]=P.useState(!1),[p,m]=P.useState([]),[g,x]=P.useState(!1),[w,k]=P.useState("issues"),[E,b]=P.useState({issues:{rules:!1,structural:!1},metrics:{metrics:!1,components:!1}}),S=(U,q)=>{b(F=>({...F,[U]:{...F[U],[q]:!F[U][q]}}))},C=P.useCallback(async()=>{var U;Lt("audit-run"),u(!0);try{const q=await fetch("/api/audit");if(q.ok){const F=await q.json();o(F),(U=F.rules)!=null&&U.custom&&m(F.rules.custom)}}catch{}u(!1)},[]);P.useEffect(()=>{e&&C()},[e,C]);const N=async()=>{x(!0);try{await fetch("/api/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:p})}),await C()}catch{}x(!1)},I=U=>{m(p.filter((q,F)=>F!==U))};if(!e)return null;const B=(s==null?void 0:s.issues.filter(U=>U.type==="rule-violation"))||[],T=(s==null?void 0:s.issues.filter(U=>U.type==="structural"))||[],D=s?[...s.nodes].sort((U,q)=>U.modularityIndex-q.modularityIndex):[];return c.jsxs(xi,{className:"audit-panel",children:[c.jsxs("div",{className:"audit-header","data-drag-handle":!0,children:[c.jsx("span",{className:"audit-title",children:"Architecture Audit"}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("button",{className:"panel-btn cyan small",onClick:C,disabled:a,children:a?"...":"Re-audit"}),c.jsx("button",{className:`panel-btn small ${d?"cyan":""}`,onClick:()=>h(!d),children:"Config"}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),c.jsxs("div",{className:"audit-tabs",children:[c.jsx("button",{className:`audit-tab ${w==="issues"?"active":""}`,onClick:()=>k("issues"),children:"Issues"}),c.jsx("button",{className:`audit-tab ${w==="metrics"?"active":""}`,onClick:()=>k("metrics"),children:"Metrics"})]}),a&&!s?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Auditing..."}):s?c.jsxs(c.Fragment,{children:[w==="issues"&&c.jsxs(c.Fragment,{children:[B.length>0&&c.jsxs("div",{className:"audit-section",children:[c.jsxs("div",{className:"audit-section-header",onClick:()=>S("issues","rules"),children:[c.jsx("span",{className:"audit-section-toggle",children:E.issues.rules?"▼":"▶"}),c.jsxs("span",{className:"audit-section-title",children:["Rule Violations (",B.length,")"]})]}),E.issues.rules&&c.jsx("div",{className:"audit-section-content",children:B.map((U,q)=>c.jsxs("div",{className:`audit-issue ${U.level}`,onClick:()=>{U.nodeIds&&U.nodeIds.length>0&&r(U.nodeIds[0])},children:[c.jsxs("div",{className:"audit-issue-rule",children:[U.rule,U.ruleType==="custom"&&c.jsx("span",{className:"rule-type-badge custom",children:"custom"})]}),c.jsx("div",{className:"audit-issue-message",children:U.message})]},q))})]}),T.length>0&&c.jsxs("div",{className:"audit-section",children:[c.jsxs("div",{className:"audit-section-header",onClick:()=>S("issues","structural"),children:[c.jsx("span",{className:"audit-section-toggle",children:E.issues.structural?"▼":"▶"}),c.jsxs("span",{className:"audit-section-title",children:["Structural Issues (",T.length,")"]})]}),E.issues.structural&&c.jsx("div",{className:"audit-section-content",children:T.map((U,q)=>c.jsxs("div",{className:`audit-issue ${U.level}`,onClick:()=>{U.nodeIds&&U.nodeIds.length>0&&r(U.nodeIds[0])},children:[c.jsx("div",{className:"audit-issue-rule",children:U.metric}),c.jsx("div",{className:"audit-issue-message",children:U.message})]},q))})]})]}),w==="metrics"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"audit-section",children:[c.jsxs("div",{className:"audit-section-header",onClick:()=>S("metrics","metrics"),children:[c.jsx("span",{className:"audit-section-toggle",children:E.metrics.metrics?"▼":"▶"}),c.jsx("span",{className:"audit-section-title",children:"Architecture Metrics"})]}),E.metrics.metrics&&c.jsx("div",{className:"audit-section-content",children:c.jsxs("div",{className:"audit-metrics",children:[c.jsxs("div",{className:"audit-metric-row",children:[c.jsx("span",{className:"audit-metric-label",children:"Circular Dependencies"}),c.jsx("span",{style:{color:s.metrics.circularDependencies>0?"var(--accent-red)":"var(--accent-green)"},children:s.metrics.circularDependencies})]}),c.jsxs("div",{className:"audit-metric-row",children:[c.jsx("span",{className:"audit-metric-label",children:"High-Degree Hubs"}),c.jsx("span",{style:{color:s.metrics.highDegreeHubCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.highDegreeHubCount})]}),c.jsxs("div",{className:"audit-metric-row",children:[c.jsx("span",{className:"audit-metric-label",children:"Disconnected"}),c.jsx("span",{style:{color:s.metrics.disconnectedComponentCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.disconnectedComponentCount})]})]})})]}),c.jsxs("div",{className:"audit-section",children:[c.jsxs("div",{className:"audit-section-header",onClick:()=>S("metrics","components"),children:[c.jsx("span",{className:"audit-section-toggle",children:E.metrics.components?"▼":"▶"}),c.jsxs("span",{className:"audit-section-title",children:["Component Health (",s.nodes.length,")"]})]}),E.metrics.components&&c.jsx("div",{className:"audit-section-content",children:D.map(U=>c.jsxs("div",{className:"audit-component-item",onClick:()=>r(U.id),children:[c.jsx("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:Sj(U.modularityIndex),flexShrink:0},title:`Health: ${U.modularityIndex}/100`}),c.jsxs("div",{className:"audit-component-info",children:[c.jsx("div",{className:"audit-component-name",children:U.label}),c.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)"},children:[U.inDegree,"↓ ",U.outDegree,"↑"]})]})]},U.id))})]})]}),c.jsx(wj,{visible:d,onClose:()=>h(!1),builtinRules:((G=s.rules)==null?void 0:G.builtin)||[],customRules:p,onAddRule:U=>{m([...p,U])},onDeleteRule:U=>I(U),onSave:N,saving:g})]}):null]})}const Nj=P.memo(kj);function Ej({visible:e}){const[t,r]=P.useState([]),[s,o]=P.useState(null),[a,u]=P.useState(null),[d,h]=P.useState(!0),[p,m]=P.useState(null),[g,x]=P.useState(null),w=P.useRef(null),k=P.useCallback(async()=>{try{const C=await fetch("/api/workflow/list");C.ok&&r(await C.json())}catch{}h(!1)},[]),E=P.useCallback(async C=>{try{const N=await fetch(`/api/workflow/status/${C}`);if(N.ok){const I=await N.json();u(I),I&&p===C&&(I.status==="completed"||I.status==="failed")&&(m(null),k())}}catch{}},[p,k]);P.useEffect(()=>{if(e){k();const C=setInterval(k,p?3e3:1e4);return()=>clearInterval(C)}},[e,k,p]),P.useEffect(()=>(w.current&&clearInterval(w.current),s&&(E(s),w.current=setInterval(()=>E(s),p?3e3:1e4)),()=>{w.current&&clearInterval(w.current)}),[s,E,p]);const b=async C=>{Lt("workflow-run",C),x(null);try{const N=await fetch(`/api/workflow/run/${C}`,{method:"POST"});if(N.ok)m(C);else{const I=await N.json();x(I.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},S=async C=>{x(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:C})})).ok&&(u(null),k())}catch{}};return e?d?c.jsx("div",{className:"ops-section",children:c.jsx("div",{className:"ops-empty",children:"Loading..."})}):t.length===0?c.jsx("div",{className:"ops-section",children:c.jsxs("div",{className:"ops-empty",children:["No workflows available.",c.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):c.jsxs("div",{className:"ops-section",children:[g&&c.jsx("div",{className:"wf-error",children:g}),t.map(C=>{const N=s===C.id,I=p===C.id;return c.jsxs("div",{className:"wf-item",children:[c.jsxs("div",{className:"wf-header",onClick:()=>o(N?null:C.id),children:[c.jsxs("div",{className:"wf-header-left",children:[c.jsx("span",{className:"wf-expand",children:N?"−":"+"}),c.jsx("span",{className:"wf-name",children:C.name}),C.builtin&&c.jsx("span",{className:"wf-tag",children:"built-in"})]}),(I||C.status)&&c.jsx("span",{className:`wf-status ${I?"running":C.status}`,children:I?"running":C.status==="completed"?"done":C.status})]}),N&&c.jsxs("div",{className:"wf-detail",children:[c.jsx("div",{className:"wf-desc",children:C.description}),a&&a.workflowId===C.id?c.jsxs("div",{className:"wf-steps",children:[Object.entries(a.steps).map(([B,T])=>c.jsxs("div",{className:`wf-step ${T.status}`,children:[c.jsx("span",{className:"wf-step-icon",children:T.status==="completed"?"✓":T.status==="running"?"▶":T.status==="failed"?"✗":"○"}),c.jsx("span",{className:"wf-step-id",children:B})]},B)),(()=>{const B=Object.keys(a.steps).length,T=Object.values(a.steps).filter(G=>G.status==="completed").length,D=B>0?Math.round(T/B*100):0;return c.jsxs("div",{className:"wf-progress",children:[c.jsx("div",{className:"wf-progress-bar",children:c.jsx("div",{className:"wf-progress-fill",style:{width:`${D}%`}})}),c.jsxs("span",{className:"wf-progress-label",children:[D,"%"]})]})})()]}):c.jsx("div",{className:"wf-steps-preview",children:C.steps.length>0?C.steps.join(" → "):"No state yet"}),c.jsxs("div",{className:"wf-actions",children:[c.jsx("button",{className:"panel-btn cyan",disabled:I,onClick:()=>b(C.id),children:I?"Running...":"Run"}),(C.status==="completed"||C.status==="failed")&&!I&&c.jsx("button",{className:"panel-btn amber",onClick:()=>S(C.id),children:"Reset"})]})]})]},C.id)})]}):null}const bj=P.memo(Ej);function Cj({projectInfo:e}){const[t,r]=P.useState(!1),s=P.useRef(null);return P.useEffect(()=>{if(!t)return;const o=a=>{s.current&&!s.current.contains(a.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),e?c.jsxs("div",{className:"project-info-wrapper",ref:s,children:[c.jsx("button",{className:"project-info-trigger",onClick:()=>r(!t),children:e.name}),t&&c.jsxs("div",{className:"project-info-popup",children:[c.jsxs("div",{className:"project-info-header",children:[c.jsx("span",{className:"project-info-name",children:e.name}),e.primaryLanguage&&c.jsx("span",{className:"project-info-lang",children:e.primaryLanguage})]}),e.description&&c.jsx("p",{className:"project-info-desc",children:e.description}),e.isMonorepo&&c.jsx("div",{className:"project-info-badge",children:"Monorepo"}),e.workspacePath&&c.jsxs("a",{className:"project-info-vscode",href:`vscode://file${e.workspacePath}`,title:"Open folder in VS Code",children:[c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M17.583 2.214L12.52 6.768 7.84 3.96 2.4 5.88v12.24l5.44 1.92 4.68-2.808 5.063 4.554L21.6 19.8V4.2l-4.017-1.986zM7.84 15.12V8.88l4.68 3.12-4.68 3.12zm9.743 2.544l-3.96-3.564 3.96-3.564v7.128z"})}),"Open in VS Code"]})]})]}):null}const jj={architecture:qx},_j=1500;function Ij({flow:e,architecture:t,onClose:r}){var w;const[s,o]=P.useState(0),[a,u]=P.useState(new Set([(w=e.steps[0])==null?void 0:w.edge])),[d,h]=P.useState(!0),{flowNodeIds:p,flowEdges:m}=P.useMemo(()=>{const k=new Set(e.steps.map(S=>S.edge)),E=t.edges.filter(S=>k.has(S.id)),b=new Set;return E.forEach(S=>{b.add(S.source),b.add(S.target)}),{flowNodeIds:b,flowEdges:E}},[e,t]),g=P.useMemo(()=>{const k=t.nodes.filter(q=>p.has(q.id)),E=320,b=140,S=80,C=80,N=new Map,I=new Map;p.forEach(q=>{N.set(q,0),I.set(q,[])}),m.forEach(q=>{p.has(q.source)&&p.has(q.target)&&(I.get(q.source).push(q.target),N.set(q.target,(N.get(q.target)||0)+1))});const B=new Map,T=[];for(N.forEach((q,F)=>{q===0&&(T.push(F),B.set(F,0))});T.length>0;){const q=T.shift(),F=B.get(q);for(const W of I.get(q)||[]){const J=F+1;(!B.has(W)||B.get(W)<J)&&B.set(W,J),N.set(W,N.get(W)-1),N.get(W)===0&&T.push(W)}}k.forEach(q=>{B.has(q.id)||B.set(q.id,0)});const D=new Map;k.forEach(q=>{const F=B.get(q.id);D.has(F)||D.set(F,[]),D.get(F).push(q)});const G=[...D.keys()].sort((q,F)=>q-F),U=new Map;return G.forEach((q,F)=>{D.get(q).forEach((J,z)=>{U.set(J.id,{x:S+F*E,y:C+z*b})})}),k.map(q=>{const F=U.get(q.id)||{x:S,y:C};return{id:q.id,type:"architecture",position:F,data:{label:q.label,layer:q.layer,nodeType:q.type,width:q.width,height:q.height,path:q.path,techStack:q.techStack,description:q.description},style:{width:q.width,zIndex:1}}})},[t,p,m]);P.useEffect(()=>{if(!d)return;const k=setInterval(()=>{o(E=>{const b=E+1;if(b>=e.steps.length)return u(new Set([e.steps[0].edge])),0;const S=new Set;for(let C=0;C<=b;C++)S.add(e.steps[C].edge);return u(S),b})},_j);return()=>clearInterval(k)},[d,e]);const x=P.useMemo(()=>{const k=new Map;return e.steps.forEach((E,b)=>{k.has(E.edge)||k.set(E.edge,b+1)}),m.map(E=>{const b=a.has(E.id),S=k.get(E.id);return{id:E.id,source:E.source,target:E.target,label:b&&S?`${S}`:void 0,labelStyle:b&&S?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:b&&S?{fill:e.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:b?e.color:E.color||"var(--border-color)",strokeWidth:b?5:2,opacity:b?1:.3,filter:b?"brightness(0.85) saturate(1.4)":void 0},animated:b,type:"smoothstep"}})},[m,a,e]);return c.jsx("div",{className:"flow-hud-overlay",children:c.jsxs(xi,{className:"flow-hud-panel",children:[c.jsxs("div",{className:"flow-hud-header","data-drag-handle":!0,children:[c.jsxs("div",{className:"flow-hud-title",children:[c.jsx("span",{className:"flow-hud-dot",style:{background:e.color}}),c.jsx("span",{children:e.name})]}),c.jsxs("div",{className:"flow-hud-controls",children:[d?c.jsx("button",{className:"flow-hud-btn",onClick:()=>h(!1),title:"Pause",children:"⏸"}):c.jsx("button",{className:"flow-hud-btn",onClick:()=>h(!0),title:"Play",children:"▶"}),c.jsx("button",{className:"flow-hud-close",onClick:r,title:"Close",children:"✕"})]})]}),c.jsx("div",{className:"flow-hud-description",children:e.description}),c.jsx("div",{className:"flow-hud-canvas",children:c.jsxs(Ax,{nodes:g,edges:x,nodeTypes:jj,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[c.jsx(zx,{variant:gr.Dots,gap:20,size:1,color:"var(--grid-color)"}),c.jsx(Lx,{showInteractive:!1})]})}),c.jsx("div",{className:"flow-hud-steps",children:e.steps.map((k,E)=>c.jsxs("div",{className:`flow-hud-step ${E<=s?"active":""} ${E===s?"current":""}`,style:{borderColor:E<=s?e.color:void 0},children:[c.jsx("span",{className:"flow-hud-step-num",style:{background:E<=s?e.color:void 0},children:E+1}),k.label]},E))})]})})}function Tj(e){return c.jsx(Px,{children:c.jsx(Ij,{...e})})}const Pj=P.memo(Tj),Aj=[{key:"anthropic",name:"Anthropic",icon:"A",models:"Claude 3.5 Sonnet, Claude 3 Opus",description:"Advanced reasoning and code analysis",requiresKey:!0},{key:"openai",name:"OpenAI",icon:"O",models:"GPT-4o, GPT-4 Turbo",description:"Versatile general-purpose models",requiresKey:!0},{key:"google",name:"Google",icon:"G",models:"Gemini 1.5 Pro, Gemini 1.5 Flash",description:"Fast multimodal analysis",requiresKey:!0}];function Mj({onComplete:e}){const[t,r]=P.useState(1),[s,o]=P.useState(null),[a,u]=P.useState(""),[d,h]=P.useState(!1),[p,m]=P.useState(null),g=E=>{o(E),u(""),m(null),E.requiresKey?r(2):r(3)},x=()=>{if(!a.trim()){m("API key is required");return}m(null),r(3)},w=async()=>{if(s){h(!0),m(null);try{const E={provider:s.key};s.requiresKey&&a.trim()&&(E.apiKey=a.trim());const b=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)});if(!b.ok){const S=await b.json();throw new Error(S.error||"Failed to save configuration")}e()}catch(E){m(E instanceof Error?E.message:"Failed to save configuration"),h(!1)}}},k=()=>{m(null),t===3&&(s!=null&&s.requiresKey)?r(2):t===3&&!(s!=null&&s.requiresKey)?r(1):(r(1),o(null),u(""))};return c.jsx("div",{style:Le.overlay,onClick:E=>E.stopPropagation(),children:c.jsxs("div",{style:Le.modal,children:[c.jsxs("div",{style:Le.header,children:[c.jsx("div",{style:Le.headerIcon,children:"⚙"}),c.jsx("h2",{style:Le.title,children:"Set Up Your AI Provider"}),c.jsx("p",{style:Le.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),c.jsx("div",{style:Le.stepIndicator,children:[1,2,3].map(E=>c.jsxs("div",{style:Le.stepRow,children:[c.jsx("div",{style:{...Le.stepDot,background:E<=t?"#7c3aed":"#3a3a4a",color:E<=t?"#fff":"#888"},children:E}),c.jsx("span",{style:{...Le.stepLabel,color:E<=t?"#ccc":"#666"},children:E===1?"Provider":E===2?"API Key":"Confirm"}),E<3&&c.jsx("div",{style:{...Le.stepLine,background:E<t?"#7c3aed":"#3a3a4a"}})]},E))}),t===1&&c.jsx("div",{style:Le.stepContent,children:c.jsx("div",{style:Le.providerGrid,children:Aj.map(E=>c.jsxs("button",{style:{...Le.providerCard,borderColor:(s==null?void 0:s.key)===E.key?"#7c3aed":"#5a5a7a"},onClick:()=>g(E),onMouseEnter:b=>{b.currentTarget.style.borderColor="#7c3aed",b.currentTarget.style.background="#2a2a3e"},onMouseLeave:b=>{(s==null?void 0:s.key)!==E.key&&(b.currentTarget.style.borderColor="#5a5a7a"),b.currentTarget.style.background="#252536"},children:[c.jsx("div",{style:Le.providerIcon,children:E.icon}),c.jsx("div",{style:Le.providerName,children:E.name}),c.jsx("div",{style:Le.providerModels,children:E.models}),c.jsx("div",{style:Le.providerDesc,children:E.description}),!E.requiresKey&&c.jsx("div",{style:Le.noKeyBadge,children:"No API key needed"})]},E.key))})}),t===2&&s&&c.jsx("div",{style:Le.stepContent,children:c.jsxs("div",{style:Le.keySection,children:[c.jsxs("div",{style:Le.selectedProviderBadge,children:[c.jsx("span",{style:Le.providerIconSmall,children:s.icon}),c.jsx("span",{children:s.name})]}),c.jsx("label",{style:Le.label,children:"API Key"}),c.jsx("input",{type:"password",value:a,onChange:E=>{u(E.target.value),m(null)},placeholder:`Enter your ${s.name} API key`,style:Le.input,autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&x()}}),c.jsxs("p",{style:Le.keyHint,children:["Your key is stored locally in ",c.jsx("code",{style:Le.code,children:".archbyte/config.json"})," and never sent to external servers."]}),p&&c.jsx("div",{style:Le.error,children:p}),c.jsxs("div",{style:Le.buttonRow,children:[c.jsx("button",{style:Le.backBtn,onClick:k,children:"Back"}),c.jsx("button",{style:{...Le.primaryBtn,opacity:a.trim()?1:.5,cursor:a.trim()?"pointer":"not-allowed"},onClick:x,disabled:!a.trim(),children:"Continue"})]})]})}),t===3&&s&&c.jsx("div",{style:Le.stepContent,children:c.jsxs("div",{style:Le.confirmSection,children:[c.jsx("div",{style:Le.confirmIcon,children:"✓"}),c.jsx("h3",{style:Le.confirmTitle,children:"Ready to Analyze"}),c.jsxs("div",{style:Le.confirmDetails,children:[c.jsxs("div",{style:Le.confirmRow,children:[c.jsx("span",{style:Le.confirmLabel,children:"Provider"}),c.jsxs("span",{style:Le.confirmValue,children:[c.jsx("span",{style:Le.providerIconSmall,children:s.icon}),s.name]})]}),c.jsxs("div",{style:Le.confirmRow,children:[c.jsx("span",{style:Le.confirmLabel,children:"Models"}),c.jsx("span",{style:Le.confirmValue,children:s.models})]}),s.requiresKey&&c.jsxs("div",{style:Le.confirmRow,children:[c.jsx("span",{style:Le.confirmLabel,children:"API Key"}),c.jsxs("span",{style:Le.confirmValue,children:["*".repeat(Math.min(a.length,8)),"...",a.slice(-4)]})]})]}),p&&c.jsx("div",{style:Le.error,children:p}),c.jsxs("div",{style:Le.buttonRow,children:[c.jsx("button",{style:Le.backBtn,onClick:k,children:"Back"}),c.jsx("button",{style:{...Le.runBtn,opacity:d?.6:1,cursor:d?"wait":"pointer"},onClick:w,disabled:d,children:d?"Saving...":"Run First Analysis"})]})]})})]})})}const Le={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},zj={"security-audit":{label:"Security Audit",icon:"⚠",color:"var(--accent-red)"},compliance:{label:"Compliance",icon:"☑",color:"var(--accent-cyan)"},performance:{label:"Performance",icon:"⚡",color:"var(--accent-amber)"},"dependency-risk":{label:"Dependency Risk",icon:"⬢",color:"#c084fc"},migration:{label:"Migration Plan",icon:"→",color:"var(--accent-green)"},"api-contracts":{label:"API Contracts",icon:"↔",color:"#60a5fa"},"drift-detection":{label:"Drift Detection",icon:"◎",color:"#f472b6"},"infra-agent-audit":{label:"Infra Agent Audit",icon:"⌂",color:"#a78bfa"}},vi={critical:0,high:1,medium:2,low:3};function Ji({severity:e}){const t={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},r={critical:"hsl(0 90% 55% / 0.15)",high:"hsl(25 95% 53% / 0.15)",medium:"hsl(38 92% 50% / 0.15)",low:"hsl(142 76% 42% / 0.15)"},s={critical:"hsl(0 90% 55% / 0.3)",high:"hsl(25 95% 53% / 0.3)",medium:"hsl(38 92% 50% / 0.3)",low:"hsl(142 76% 42% / 0.3)"};return c.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:t[e],background:r[e],border:`1px solid ${s[e]}`,whiteSpace:"nowrap"},children:e})}function Rj({value:e}){const t=Math.round(e*100);return c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:c.jsx("div",{style:{width:`${t}%`,height:"100%",borderRadius:2,background:t>=80?"var(--accent-green)":t>=50?"var(--accent-amber)":"var(--accent-red)"}})}),c.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[t,"%"]})]})}function Lj({status:e}){const r={compliant:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},partial:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},"non-compliant":{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"}}[e];return c.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Dj({status:e}){const r={completed:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},"in-progress":{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",border:"var(--border-color)"}}[e];return c.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Fj({driftType:e}){const r={added:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},removed:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},modified:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"}}[e];return c.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Oj({data:e}){const t=[...e.findings].sort((r,s)=>vi[r.severity]-vi[s.severity]);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.owaspId}),c.jsx(Ji,{severity:r.severity})]}),c.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.title}),c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.affectedComponent&&c.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",r.affectedComponent]})]},s))})}function $j({data:e}){return e.statuses.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:e.statuses.map((t,r)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[c.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:t.framework}),c.jsx(Lj,{status:t.status})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[c.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:c.jsx("div",{style:{width:t.controls>0?`${Math.round(t.passing/t.controls*100)}%`:"0%",height:"100%",borderRadius:2,background:t.status==="compliant"?"var(--accent-green)":t.status==="partial"?"var(--accent-amber)":"var(--accent-red)",transition:"width 0.3s"}})}),c.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[t.passing,"/",t.controls]})]}),t.findings.length>0&&c.jsx("div",{style:{marginTop:4},children:t.findings.map((s,o)=>c.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},o))})]},r))})}function Bj({data:e}){const t=[...e.bottlenecks].sort((r,s)=>vi[r.severity]-vi[s.severity]);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.component}),c.jsx(Ji,{severity:r.severity})]}),c.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.metric}),c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.recommendation&&c.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:r.recommendation})]},s))})}function Hj({data:e}){const t=[...e.risks].sort((r,s)=>s.riskScore-r.riskScore);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[r.package,c.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",r.version]})]}),c.jsx(Ji,{severity:r.severity})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[c.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),c.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:c.jsx("div",{style:{width:`${r.riskScore}%`,height:"100%",borderRadius:2,background:r.riskScore>=75?"var(--accent-red)":r.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:r.riskScore})]}),r.reasons.length>0&&c.jsx("div",{style:{marginTop:2},children:r.reasons.map((o,a)=>c.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",o]},a))})]},s))})}function Vj({data:e}){const t=[...e.steps].sort((r,s)=>r.order-s.order);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.status==="completed"?"var(--accent-green)":r.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:r.status==="completed"?.7:1},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",r.order]}),c.jsx(Dj,{status:r.status})]}),c.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.title}),c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.estimatedEffort&&c.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",r.estimatedEffort]})]},s))})}function Uj({data:e}){const t=[...e.mismatches].sort((r,s)=>vi[r.severity]-vi[s.severity]);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:r.endpoint}),c.jsx(Ji,{severity:r.severity})]}),c.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:r.field}),c.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[c.jsxs("div",{style:{flex:1},children:[c.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),c.jsx("div",{style:{color:"var(--accent-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(142 76% 42% / 0.08)",borderRadius:3},children:r.specValue})]}),c.jsxs("div",{style:{flex:1},children:[c.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),c.jsx("div",{style:{color:"var(--accent-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(0 90% 55% / 0.08)",borderRadius:3},children:r.implValue})]})]})]},s))})}function Wj({data:e}){const t=[...e.detections].sort((r,s)=>vi[r.severity]-vi[s.severity]);return t.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.component}),c.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[c.jsx(Fj,{driftType:r.driftType}),c.jsx(Ji,{severity:r.severity})]})]}),c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),c.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(r.detectedAt).toLocaleString()})]},s))})}function Yj({maturity:e}){const r={none:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},basic:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},mature:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"}}[e];return c.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Xj({data:e}){const t=["ingestion","policy","execution","integration","changeControl","observability"],r={ingestion:"Ingestion",policy:"Policy",execution:"Execution",integration:"Integration",changeControl:"Change Control",observability:"Observability"},s=e.overallScore>=70?"var(--accent-green)":e.overallScore>=40?"var(--accent-amber)":"var(--accent-red)";return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:"Score"}),c.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:c.jsx("div",{style:{width:`${e.overallScore}%`,height:"100%",borderRadius:2,background:s,transition:"width 0.3s"}})}),c.jsx("span",{style:{fontSize:12,fontWeight:700,color:s,minWidth:28,textAlign:"right"},children:e.overallScore})]}),t.map(o=>{const a=e.planes[o];return a?c.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${a.maturity==="mature"?"var(--accent-green)":a.maturity==="basic"?"var(--accent-amber)":"var(--accent-red)"}`},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:r[o]}),c.jsx(Yj,{maturity:a.maturity})]}),a.components.length>0&&c.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:2},children:[a.components.length," component",a.components.length!==1?"s":""," detected"]}),a.gaps.length>0&&c.jsx("div",{style:{marginTop:4},children:a.gaps.map((u,d)=>c.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",u]},d))})]},o):null}),e.antiPatterns.length>0&&c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",marginBottom:4,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Anti-Patterns"}),e.antiPatterns.map((o,a)=>c.jsxs("div",{style:{padding:"6px 10px",background:"var(--bg-tertiary)",borderRadius:6,marginBottom:2},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:2},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-primary)"},children:o.pattern}),c.jsx(Ji,{severity:o.severity})]}),c.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",fontStyle:"italic"},children:o.recommendation})]},a))]}),e.coreViolations.length>0&&c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",marginBottom:4,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Core Violations"}),e.coreViolations.map((o,a)=>c.jsxs("div",{style:{padding:"6px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:"3px solid var(--accent-red)",marginBottom:2},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:2},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-primary)"},children:o.principle}),c.jsx(Ji,{severity:o.severity})]}),c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.evidence})]},a))]})]})}function dr({data:e}){const t=typeof e.summary=="string"?e.summary:typeof e.raw=="string"?e.raw.slice(0,200):"Agent returned incomplete data";return c.jsx("div",{style:{padding:"8px 0"},children:c.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t})})}function qj({visible:e,onClose:t,results:r}){const[s,o]=P.useState(new Set),[a,u]=P.useState(!1),[d,h]=P.useState([]),p=P.useCallback(b=>{o(S=>{const C=new Set(S);return C.has(b)?C.delete(b):C.add(b),C})},[]),m=P.useCallback(async()=>{u(!0);try{const b=await fetch("/api/premium-agents/results");if(b.ok){const S=await b.json();Array.isArray(S)&&h(S)}}catch{}u(!1)},[]);P.useEffect(()=>{e&&m()},[e,m]);const g=r.length>0?r:d,x=new Map;g.forEach(b=>{x.set(b.agentId,b)});const w=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection","infra-agent-audit"];function k(b){const S=b.data;switch(S.agentId){case"security-audit":return Array.isArray(S.findings)?S.findings.length:0;case"compliance":return Array.isArray(S.statuses)?S.statuses.length:0;case"performance":return Array.isArray(S.bottlenecks)?S.bottlenecks.length:0;case"dependency-risk":return Array.isArray(S.risks)?S.risks.length:0;case"migration":return Array.isArray(S.steps)?S.steps.length:0;case"api-contracts":return Array.isArray(S.mismatches)?S.mismatches.length:0;case"drift-detection":return Array.isArray(S.detections)?S.detections.length:0;case"infra-agent-audit":return(S.planes?Object.keys(S.planes).length:0)+(Array.isArray(S.antiPatterns)?S.antiPatterns.length:0);default:return 0}}function E(b){const S=b.data;try{switch(S.agentId){case"security-audit":return Array.isArray(S.findings)?c.jsx(Oj,{data:S}):c.jsx(dr,{data:S});case"compliance":return Array.isArray(S.statuses)?c.jsx($j,{data:S}):c.jsx(dr,{data:S});case"performance":return Array.isArray(S.bottlenecks)?c.jsx(Bj,{data:S}):c.jsx(dr,{data:S});case"dependency-risk":return Array.isArray(S.risks)?c.jsx(Hj,{data:S}):c.jsx(dr,{data:S});case"migration":return Array.isArray(S.steps)?c.jsx(Vj,{data:S}):c.jsx(dr,{data:S});case"api-contracts":return Array.isArray(S.mismatches)?c.jsx(Uj,{data:S}):c.jsx(dr,{data:S});case"drift-detection":return Array.isArray(S.detections)?c.jsx(Wj,{data:S}):c.jsx(dr,{data:S});case"infra-agent-audit":return S.planes?c.jsx(Xj,{data:S}):c.jsx(dr,{data:S});default:return c.jsx(dr,{data:S})}}catch{return c.jsx(dr,{data:S})}}return e?c.jsxs(xi,{style:{position:"absolute",top:60,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[c.jsxs("div",{"data-drag-handle":!0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)",cursor:"grab"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),c.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx("button",{className:"panel-btn cyan small",onClick:m,disabled:a,children:a?"...":"Refresh"}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),c.jsx("div",{style:{padding:"8px 10px 12px"},children:a&&g.length===0?c.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):g.length===0?c.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",c.jsx("span",{style:{display:"block",marginTop:6,fontSize:10,color:"var(--accent-cyan)",opacity:.7,fontFamily:"'JetBrains Mono', monospace"},children:"Run agents to see results here"})]}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:w.map(b=>{const S=x.get(b);if(!S)return null;const C=zj[b],N=s.has(b),I=k(S);return c.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[c.jsxs("div",{onClick:()=>p(b),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:N?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:B=>{N||(B.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:B=>{N||(B.currentTarget.style.background="transparent")},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{fontSize:12},children:C.icon}),c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:C.label}),I>0&&c.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:I})]}),c.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:c.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:N?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),N&&c.jsxs("div",{style:{padding:"6px 10px 10px"},children:[c.jsxs("div",{style:{marginBottom:8},children:[c.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),c.jsx(Rj,{value:S.confidence})]}),E(S),c.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(S.timestamp).toLocaleString()})]})]},b)})})}),g.length>0&&c.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[g.length," of ",w.length," agents reporting"]})]}):null}const Gj=P.memo(qj);function Kj({session:e,onSelectRun:t,selectedRunId:r}){const[s,o]=P.useState(null),[a,u]=P.useState({x:0,y:0}),{phases:d,lanes:h,sessionStart:p,sessionDuration:m,timeMarkers:g}=P.useMemo(()=>{const D=e.runs;if(D.length===0)return{phases:[],lanes:[],sessionStart:0,sessionDuration:1,timeMarkers:[]};const G=[],U=new Set;for(const $ of D)U.has($.phase)||(U.add($.phase),G.push($.phase));const q=Math.min(...D.map($=>new Date($.startedAt).getTime())),F=Math.max(...D.map($=>$.completedAt?new Date($.completedAt).getTime():new Date($.startedAt).getTime()+($.elapsedSeconds??1)*1e3)),W=Math.max(F-q,1e3),J=G.map($=>({phase:$,runs:D.filter(Q=>Q.phase===$)})),z=[],O=W/4;for(let $=0;$<=4;$++)z.push(q+O*$);return{phases:G,lanes:J,sessionStart:q,sessionDuration:W,timeMarkers:z}},[e]);if(e.runs.length===0)return c.jsx("div",{className:"sessions-empty",children:"No runs in this session"});const x=48,w=6,E=120+12,b=30,S=28,C=500,N=S+h.length*(x+w)+16,I=D=>E+(D-p)/m*C,B=D=>D<1e3?`${D}ms`:`${(D/1e3).toFixed(1)}s`,T=D=>{switch(D){case"success":return"var(--accent-green, #2ecc71)";case"error":return"var(--accent-red, #e74c3c)";case"running":return"var(--accent-cyan, #00bcd4)";case"skipped":return"var(--text-muted, #666)";default:return"var(--text-muted, #666)"}};return c.jsxs("div",{className:"session-timeline",children:[c.jsxs("svg",{width:E+C+20,height:N,className:"session-timeline-svg",children:[g.map((D,G)=>{const U=I(D),q=((D-p)/1e3).toFixed(1);return c.jsxs("g",{children:[c.jsx("line",{x1:U,y1:S-4,x2:U,y2:N,stroke:"var(--border-subtle, #333)",strokeWidth:.5,strokeDasharray:"3,3"}),c.jsxs("text",{x:U,y:S-8,textAnchor:"middle",className:"session-timeline-axis-label",children:[q,"s"]})]},G)}),h.map((D,G)=>{const U=S+G*(x+w);return c.jsxs("g",{children:[c.jsx("rect",{x:0,y:U,width:E+C+20,height:x,rx:6,fill:"var(--bg-elevated, rgba(255,255,255,0.03))"}),c.jsx("text",{x:8,y:U+x/2+4,className:"session-timeline-phase-label",children:D.phase}),D.runs.map(q=>{const F=new Date(q.startedAt).getTime(),W=q.completedAt?new Date(q.completedAt).getTime():F+(q.elapsedSeconds??1)*1e3,J=I(F),z=I(W),O=Math.max(z-J,6),$=U+(x-b)/2,Q=q.runId===r,M=(s==null?void 0:s.runId)===q.runId;return c.jsxs("g",{className:`session-timeline-bar ${q.status}${Q?" selected":""}`,onClick:()=>t(q),onMouseEnter:V=>{o(q);const j=V.target.closest("svg").getBoundingClientRect();u({x:V.clientX-j.left,y:$-8})},onMouseLeave:()=>o(null),style:{cursor:"pointer"},children:[c.jsx("rect",{x:J,y:$,width:O,height:b,rx:4,fill:T(q.status),opacity:Q||M?1:.75,stroke:Q?"var(--accent-cyan, #00bcd4)":"none",strokeWidth:Q?2:0}),O>50&&c.jsx("text",{x:J+O/2,y:$+b/2+4,textAnchor:"middle",className:"session-timeline-bar-label",children:q.agent}),q.status==="running"&&c.jsx("rect",{x:J,y:$,width:O,height:b,rx:4,fill:"none",stroke:"var(--accent-cyan, #00bcd4)",strokeWidth:2,className:"session-timeline-pulse"})]},q.runId)})]},D.phase)})]}),s&&c.jsxs("div",{className:"session-timeline-tooltip",style:{left:a.x,top:a.y},children:[c.jsx("div",{className:"session-timeline-tooltip-title",children:s.agent}),c.jsxs("div",{className:"session-timeline-tooltip-row",children:[c.jsx("span",{children:"Model:"})," ",c.jsx("span",{children:s.model})]}),c.jsxs("div",{className:"session-timeline-tooltip-row",children:[c.jsx("span",{children:"Duration:"})," ",c.jsx("span",{children:B((s.elapsedSeconds??0)*1e3)})]}),s.tokens&&c.jsxs("div",{className:"session-timeline-tooltip-row",children:[c.jsx("span",{children:"Tokens:"})," ",c.jsx("span",{children:s.tokens.input+s.tokens.output})]}),c.jsxs("div",{className:"session-timeline-tooltip-row",children:[c.jsx("span",{children:"Status:"})," ",c.jsx("span",{className:`session-status-${s.status}`,children:s.status})]})]})]})}function Qj(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Zj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e2={};function tg(e,t){return(e2.jsx?Jj:Zj).test(e)}const t2=/[ \t\n\f\r]/g;function n2(e){return typeof e=="object"?e.type==="text"?ng(e.value):!1:ng(e)}function ng(e){return e.replace(t2,"")===""}class dl{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}dl.prototype.normal={};dl.prototype.property={};dl.prototype.space=void 0;function Gx(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new dl(r,s,t)}function bd(e){return e.toLowerCase()}class hn{constructor(t,r){this.attribute=r,this.property=t}}hn.prototype.attribute="";hn.prototype.booleanish=!1;hn.prototype.boolean=!1;hn.prototype.commaOrSpaceSeparated=!1;hn.prototype.commaSeparated=!1;hn.prototype.defined=!1;hn.prototype.mustUseProperty=!1;hn.prototype.number=!1;hn.prototype.overloadedBoolean=!1;hn.prototype.property="";hn.prototype.spaceSeparated=!1;hn.prototype.space=void 0;let r2=0;const He=es(),Et=es(),Cd=es(),xe=es(),rt=es(),Hs=es(),En=es();function es(){return 2**++r2}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Et,commaOrSpaceSeparated:En,commaSeparated:Hs,number:xe,overloadedBoolean:Cd,spaceSeparated:rt},Symbol.toStringTag,{value:"Module"})),Qc=Object.keys(jd);class tf extends hn{constructor(t,r,s,o){let a=-1;if(super(t,r),rg(this,"space",o),typeof s=="number")for(;++a<Qc.length;){const u=Qc[a];rg(this,Qc[a],(s&jd[u])===jd[u])}}}tf.prototype.defined=!0;function rg(e,t,r){r&&(e[t]=r)}function Gs(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const a=new tf(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(a.mustUseProperty=!0),t[s]=a,r[bd(s)]=s,r[bd(a.attribute)]=s}return new dl(t,r,e.space)}const Kx=Gs({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:rt,ariaCurrent:null,ariaDescribedBy:rt,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:rt,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:rt,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rt,ariaLevel:xe,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:rt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:rt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Et,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Qx(e,t){return t in e?e[t]:t}function Zx(e,t){return Qx(e,t.toLowerCase())}const i2=Gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hs,acceptCharset:rt,accessKey:rt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:rt,autoFocus:He,autoPlay:He,blocking:rt,capture:null,charSet:null,checked:He,cite:null,className:rt,cols:xe,colSpan:null,content:null,contentEditable:Et,controls:He,controlsList:rt,coords:xe|Hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Cd,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:rt,height:xe,hidden:Cd,high:xe,href:null,hrefLang:null,htmlFor:rt,httpEquiv:rt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:rt,itemRef:rt,itemScope:He,itemType:rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:xe,pattern:null,ping:rt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:rt,required:He,reversed:He,rows:xe,rowSpan:xe,sandbox:rt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Et,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:Zx}),s2=Gs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:En,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:rt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hs,g2:Hs,glyphName:Hs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:En,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:En,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:En,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:En,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Qx}),Jx=Gs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),e0=Gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Zx}),t0=Gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),o2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},l2=/[A-Z]/g,ig=/-[a-z]/g,a2=/^data[-\w.:]+$/i;function u2(e,t){const r=bd(t);let s=t,o=hn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&a2.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ig,d2);s="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ig.test(a)){let u=a.replace(l2,c2);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=tf}return new o(s,t)}function c2(e){return"-"+e.toLowerCase()}function d2(e){return e.charAt(1).toUpperCase()}const f2=Gx([Kx,i2,Jx,e0,t0],"html"),nf=Gx([Kx,s2,Jx,e0,t0],"svg");function h2(e){return e.join(" ").trim()}var zs={},Zc,sg;function p2(){if(sg)return Zc;sg=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
|
|
66
|
+
`,p="/",m="*",g="",x="comment",w="declaration";function k(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var C=1,N=1;function I(z){var O=z.match(t);O&&(C+=O.length);var $=z.lastIndexOf(h);N=~$?z.length-$:N+z.length}function B(){var z={line:C,column:N};return function(O){return O.position=new T(z),U(),O}}function T(z){this.start=z,this.end={line:C,column:N},this.source=S.source}T.prototype.content=b;function D(z){var O=new Error(S.source+":"+C+":"+N+": "+z);if(O.reason=z,O.filename=S.source,O.line=C,O.column=N,O.source=b,!S.silent)throw O}function G(z){var O=z.exec(b);if(O){var $=O[0];return I($),b=b.slice($.length),O}}function U(){G(r)}function q(z){var O;for(z=z||[];O=F();)O!==!1&&z.push(O);return z}function F(){var z=B();if(!(p!=b.charAt(0)||m!=b.charAt(1))){for(var O=2;g!=b.charAt(O)&&(m!=b.charAt(O)||p!=b.charAt(O+1));)++O;if(O+=2,g===b.charAt(O-1))return D("End of comment missing");var $=b.slice(2,O-2);return N+=2,I($),b=b.slice(O),N+=2,z({type:x,comment:$})}}function W(){var z=B(),O=G(s);if(O){if(F(),!G(o))return D("property missing ':'");var $=G(a),Q=z({type:w,property:E(O[0].replace(e,g)),value:$?E($[0].replace(e,g)):g});return G(u),Q}}function J(){var z=[];q(z);for(var O;O=W();)O!==!1&&(z.push(O),q(z));return z}return U(),J()}function E(b){return b?b.replace(d,g):g}return Zc=k,Zc}var og;function m2(){if(og)return zs;og=1;var e=zs&&zs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(zs,"__esModule",{value:!0}),zs.default=r;const t=e(p2());function r(s,o){let a=null;if(!s||typeof s!="string")return a;const u=(0,t.default)(s),d=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:m}=h;d?o(p,m,h):m&&(a=a||{},a[p]=m)}),a}return zs}var Ro={},lg;function g2(){if(lg)return Ro;lg=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(p){return!p||r.test(p)||e.test(p)},u=function(p,m){return m.toUpperCase()},d=function(p,m){return"".concat(m,"-")},h=function(p,m){return m===void 0&&(m={}),a(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(o,d):p=p.replace(s,d),p.replace(t,u))};return Ro.camelCase=h,Ro}var Lo,ag;function y2(){if(ag)return Lo;ag=1;var e=Lo&&Lo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(m2()),r=g2();function s(o,a){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(d,h){d&&h&&(u[(0,r.camelCase)(d,a)]=h)}),u}return s.default=s,Lo=s,Lo}var x2=y2();const v2=rl(x2),n0=r0("end"),rf=r0("start");function r0(e){return t;function t(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function w2(e){const t=rf(e),r=n0(e);if(t&&r)return{start:t,end:r}}function Vo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ug(e.position):"start"in e||"end"in e?ug(e):"line"in e||"column"in e?_d(e):""}function _d(e){return cg(e&&e.line)+":"+cg(e&&e.column)}function ug(e){return _d(e&&e.start)+"-"+_d(e&&e.end)}function cg(e){return e&&typeof e=="number"?e:1}class qt extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",a={},u=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?o=t:!a.cause&&t&&(u=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?a.ruleId=s:(a.source=s.slice(0,h),a.ruleId=s.slice(h+1))}if(!a.place&&a.ancestors&&a.ancestors){const h=a.ancestors[a.ancestors.length-1];h&&(a.place=h.position)}const d=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=Vo(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=u&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qt.prototype.file="";qt.prototype.name="";qt.prototype.reason="";qt.prototype.message="";qt.prototype.stack="";qt.prototype.column=void 0;qt.prototype.line=void 0;qt.prototype.ancestors=void 0;qt.prototype.cause=void 0;qt.prototype.fatal=void 0;qt.prototype.place=void 0;qt.prototype.ruleId=void 0;qt.prototype.source=void 0;const sf={}.hasOwnProperty,S2=new Map,k2=/[A-Z]/g,N2=new Set(["table","tbody","thead","tfoot","tr"]),E2=new Set(["td","th"]),i0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function b2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=M2(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=A2(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?nf:f2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=s0(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function s0(e,t,r){if(t.type==="element")return C2(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I2(e,t,r);if(t.type==="mdxjsEsm")return _2(e,t);if(t.type==="root")return T2(e,t,r);if(t.type==="text")return P2(e,t)}function C2(e,t,r){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=nf,e.schema=o),e.ancestors.push(t);const a=l0(e,t.tagName,!1),u=z2(e,t);let d=lf(e,t);return N2.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!n2(h):!0})),o0(e,u,a,t),of(u,d),e.ancestors.pop(),e.schema=s,e.create(t,a,u,r)}function j2(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}nl(e,t.position)}function _2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nl(e,t.position)}function I2(e,t,r){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=nf,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:l0(e,t.name,!0),u=R2(e,t),d=lf(e,t);return o0(e,u,a,t),of(u,d),e.ancestors.pop(),e.schema=s,e.create(t,a,u,r)}function T2(e,t,r){const s={};return of(s,lf(e,t)),e.create(t,e.Fragment,s,r)}function P2(e,t){return t.value}function o0(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function of(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function A2(e,t,r){return s;function s(o,a,u,d){const p=Array.isArray(u.children)?r:t;return d?p(a,u,d):p(a,u)}}function M2(e,t){return r;function r(s,o,a,u){const d=Array.isArray(a.children),h=rf(s);return t(o,a,u,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function z2(e,t){const r={};let s,o;for(o in t.properties)if(o!=="children"&&sf.call(t.properties,o)){const a=L2(e,o,t.properties[o]);if(a){const[u,d]=a;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&E2.has(t.tagName)?s=d:r[u]=d}}if(s){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function R2(e,t){const r={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const a=s.data.estree.body[0];a.type;const u=a.expression;u.type;const d=u.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else nl(e,t.position);else{const o=s.name;let a;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,a=e.evaluater.evaluateExpression(d.expression)}else nl(e,t.position);else a=s.value===null?!0:s.value;r[o]=a}return r}function lf(e,t){const r=[];let s=-1;const o=e.passKeys?new Map:S2;for(;++s<t.children.length;){const a=t.children[s];let u;if(e.passKeys){const h=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(h){const p=o.get(h)||0;u=h+"-"+p,o.set(h,p+1)}}const d=s0(e,a,u);d!==void 0&&r.push(d)}return r}function L2(e,t,r){const s=u2(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?Qj(r):h2(r)),s.property==="style"){let o=typeof r=="object"?r:D2(e,String(r));return e.stylePropertyNameCase==="css"&&(o=F2(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?o2[s.property]||s.property:s.attribute,r]}}function D2(e,t){try{return v2(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,o=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=i0+"#cannot-parse-style-attribute",o}}function l0(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,u;for(;++a<o.length;){const d=tg(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(a&&d.type==="Literal"),optional:!1}:d}s=u}else s=tg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return sf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);nl(e)}function nl(e,t){const r=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=i0+"#cannot-handle-mdx-estrees-without-createevaluater",r}function F2(e){const t={};let r;for(r in e)sf.call(e,r)&&(t[O2(r)]=e[r]);return t}function O2(e){let t=e.replace(k2,$2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $2(e){return"-"+e.toLowerCase()}const Jc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},B2={};function H2(e,t){const r=B2,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return a0(e,s,o)}function a0(e,t,r){if(V2(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dg(e.children,t,r)}return Array.isArray(e)?dg(e,t,r):""}function dg(e,t,r){const s=[];let o=-1;for(;++o<e.length;)s[o]=a0(e[o],t,r);return s.join("")}function V2(e){return!!(e&&typeof e=="object")}const fg=document.createElement("i");function af(e){const t="&"+e+";";fg.innerHTML=t;const r=fg.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function xr(e,t,r,s){const o=e.length;let a=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)u=Array.from(s),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);a<s.length;)u=s.slice(a,a+1e4),u.unshift(t,0),e.splice(...u),a+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(xr(e,e.length,0,t),e):t}const hg={}.hasOwnProperty;function U2(e){const t={};let r=-1;for(;++r<e.length;)W2(t,e[r]);return t}function W2(e,t){let r;for(r in t){const o=(hg.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r];let u;if(a)for(u in a){hg.call(o,u)||(o[u]=[]);const d=a[u];Y2(o[u],Array.isArray(d)?d:d?[d]:[])}}}function Y2(e,t){let r=-1;const s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);xr(e,0,0,s)}function u0(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Vs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pr=wi(/[A-Za-z]/),Cn=wi(/[\dA-Za-z]/),X2=wi(/[#-'*+\--9=?A-Z^-~]/);function Id(e){return e!==null&&(e<32||e===127)}const Td=wi(/\d/),q2=wi(/[\dA-Fa-f]/),G2=wi(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function fn(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const K2=wi(new RegExp("\\p{P}|\\p{S}","u")),Q2=wi(/\s/);function wi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ks(e){const t=[];let r=-1,s=0,o=0;for(;++r<e.length;){const a=e.charCodeAt(r);let u="";if(a===37&&Cn(e.charCodeAt(r+1))&&Cn(e.charCodeAt(r+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(u=String.fromCharCode(a));else if(a>55295&&a<57344){const d=e.charCodeAt(r+1);a<56320&&d>56319&&d<57344?(u=String.fromCharCode(a,d),o=1):u="�"}else u=String.fromCharCode(a);u&&(t.push(e.slice(s,r),encodeURIComponent(u)),s=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function it(e,t,r,s){const o=s?s-1:Number.POSITIVE_INFINITY;let a=0;return u;function u(h){return Je(h)?(e.enter(r),d(h)):t(h)}function d(h){return Je(h)&&a++<o?(e.consume(h),d):(e.exit(r),t(h))}}const Z2={tokenize:J2};function J2(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let r;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),it(e,t,"linePrefix")}function o(d){return e.enter("paragraph"),a(d)}function a(d){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Fe(d)?(e.consume(d),e.exit("chunkText"),a):(e.consume(d),u)}}const e_={tokenize:t_},pg={tokenize:n_};function t_(e){const t=this,r=[];let s=0,o,a,u;return d;function d(N){if(s<r.length){const I=r[s];return t.containerState=I[1],e.attempt(I[0].continuation,h,p)(N)}return p(N)}function h(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const I=t.events.length;let B=I,T;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){T=t.events[B][1].end;break}S(s);let D=I;for(;D<t.events.length;)t.events[D][1].end={...T},D++;return xr(t.events,B+1,0,t.events.slice(I)),t.events.length=D,p(N)}return d(N)}function p(N){if(s===r.length){if(!o)return x(N);if(o.currentConstruct&&o.currentConstruct.concrete)return k(N);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pg,m,g)(N)}function m(N){return o&&C(),S(s),x(N)}function g(N){return t.parser.lazy[t.now().line]=s!==r.length,u=t.now().offset,k(N)}function x(N){return t.containerState={},e.attempt(pg,w,k)(N)}function w(N){return s++,r.push([t.currentConstruct,t.containerState]),x(N)}function k(N){if(N===null){o&&C(),S(0),e.consume(N);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),E(N)}function E(N){if(N===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Fe(N)?(e.consume(N),b(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(N),E)}function b(N,I){const B=t.sliceStream(N);if(I&&B.push(null),N.previous=a,a&&(a.next=N),a=N,o.defineSkip(N.start),o.write(B),t.parser.lazy[N.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<u&&(!o.events[T][1].end||o.events[T][1].end.offset>u))return;const D=t.events.length;let G=D,U,q;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(U){q=t.events[G][1].end;break}U=!0}for(S(s),T=D;T<t.events.length;)t.events[T][1].end={...q},T++;xr(t.events,G+1,0,t.events.slice(D)),t.events.length=T}}function S(N){let I=r.length;for(;I-- >N;){const B=r[I];t.containerState=B[1],B[0].exit.call(t,e)}r.length=N}function C(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function n_(e,t,r){return it(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mg(e){if(e===null||fn(e)||Q2(e))return 1;if(K2(e))return 2}function uf(e,t,r){const s=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!s.includes(a)&&(t=a(t,r),s.push(a))}return t}const Pd={name:"attention",resolveAll:r_,tokenize:i_};function r_(e,t){let r=-1,s,o,a,u,d,h,p,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[s][1].end},x={...e[r][1].start};gg(g,-h),gg(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},a={type:h>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[s][1].end={...u.start},e[r][1].start={...d.end},p=[],e[s][1].end.offset-e[s][1].start.offset&&(p=Dn(p,[["enter",e[s][1],t],["exit",e[s][1],t]])),p=Dn(p,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",a,t]]),p=Dn(p,uf(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),p=Dn(p,[["exit",a,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,p=Dn(p,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,xr(e,s-1,r-s+3,p),r=s+p.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function i_(e,t){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=mg(s);let a;return u;function u(h){return a=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===a)return e.consume(h),d;const p=e.exit("attentionSequence"),m=mg(h),g=!m||m===2&&o||r.includes(h),x=!o||o===2&&m||r.includes(s);return p._open=!!(a===42?g:g&&(o||!x)),p._close=!!(a===42?x:x&&(m||!g)),t(h)}}function gg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const s_={name:"autolink",tokenize:o_};function o_(e,t,r){let s=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(w){return pr(w)?(e.consume(w),u):w===64?r(w):p(w)}function u(w){return w===43||w===45||w===46||Cn(w)?(s=1,d(w)):p(w)}function d(w){return w===58?(e.consume(w),s=0,h):(w===43||w===45||w===46||Cn(w))&&s++<32?(e.consume(w),d):(s=0,p(w))}function h(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||Id(w)?r(w):(e.consume(w),h)}function p(w){return w===64?(e.consume(w),m):X2(w)?(e.consume(w),p):r(w)}function m(w){return Cn(w)?g(w):r(w)}function g(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||Cn(w))&&s++<63){const k=w===45?x:g;return e.consume(w),k}return r(w)}}const ru={partial:!0,tokenize:l_};function l_(e,t,r){return s;function s(a){return Je(a)?it(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Fe(a)?t(a):r(a)}}const c0={continuation:{tokenize:u_},exit:c_,name:"blockQuote",tokenize:a_};function a_(e,t,r){const s=this;return o;function o(u){if(u===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),a}return r(u)}function a(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function u_(e,t,r){const s=this;return o;function o(u){return Je(u)?it(e,a,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):a(u)}function a(u){return e.attempt(c0,t,r)(u)}}function c_(e){e.exit("blockQuote")}const d0={name:"characterEscape",tokenize:d_};function d_(e,t,r){return s;function s(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return G2(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}const f0={name:"characterReference",tokenize:f_};function f_(e,t,r){const s=this;let o=0,a,u;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),a=31,u=Cn,m(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,u=q2,m):(e.enter("characterReferenceValue"),a=7,u=Td,m(g))}function m(g){if(g===59&&o){const x=e.exit("characterReferenceValue");return u===Cn&&!af(s.sliceSerialize(x))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&o++<a?(e.consume(g),m):r(g)}}const yg={partial:!0,tokenize:p_},xg={concrete:!0,name:"codeFenced",tokenize:h_};function h_(e,t,r){const s=this,o={partial:!0,tokenize:B};let a=0,u=0,d;return h;function h(T){return p(T)}function p(T){const D=s.events[s.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,d=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(T)}function m(T){return T===d?(u++,e.consume(T),m):u<3?r(T):(e.exit("codeFencedFenceSequence"),Je(T)?it(e,g,"whitespace")(T):g(T))}function g(T){return T===null||Fe(T)?(e.exit("codeFencedFence"),s.interrupt?t(T):e.check(yg,E,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(T)):Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,w,"whitespace")(T)):T===96&&T===d?r(T):(e.consume(T),x)}function w(T){return T===null||Fe(T)?g(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(T)):T===96&&T===d?r(T):(e.consume(T),k)}function E(T){return e.attempt(o,I,b)(T)}function b(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return a>0&&Je(T)?it(e,C,"linePrefix",a+1)(T):C(T)}function C(T){return T===null||Fe(T)?e.check(yg,E,I)(T):(e.enter("codeFlowValue"),N(T))}function N(T){return T===null||Fe(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),N)}function I(T){return e.exit("codeFenced"),t(T)}function B(T,D,G){let U=0;return q;function q(O){return T.enter("lineEnding"),T.consume(O),T.exit("lineEnding"),F}function F(O){return T.enter("codeFencedFence"),Je(O)?it(T,W,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):W(O)}function W(O){return O===d?(T.enter("codeFencedFenceSequence"),J(O)):G(O)}function J(O){return O===d?(U++,T.consume(O),J):U>=u?(T.exit("codeFencedFenceSequence"),Je(O)?it(T,z,"whitespace")(O):z(O)):G(O)}function z(O){return O===null||Fe(O)?(T.exit("codeFencedFence"),D(O)):G(O)}}}function p_(e,t,r){const s=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a)}function a(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}const ed={name:"codeIndented",tokenize:g_},m_={partial:!0,tokenize:y_};function g_(e,t,r){const s=this;return o;function o(p){return e.enter("codeIndented"),it(e,a,"linePrefix",5)(p)}function a(p){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?h(p):Fe(p)?e.attempt(m_,u,h)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||Fe(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),d)}function h(p){return e.exit("codeIndented"),t(p)}}function y_(e,t,r){const s=this;return o;function o(u){return s.parser.lazy[s.now().line]?r(u):Fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):it(e,a,"linePrefix",5)(u)}function a(u){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):Fe(u)?o(u):r(u)}}const x_={name:"codeText",previous:w_,resolve:v_,tokenize:S_};function v_(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function w_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function S_(e,t,r){let s=0,o,a;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),s++,d):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(a=e.enter("codeTextSequence"),o=0,m(g)):Fe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Fe(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),p)}function m(g){return g===96?(e.consume(g),o++,m):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(a.type="codeTextData",p(g))}}class k_{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){const o=r||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&Do(this.left,s),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Do(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Do(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Do(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Do(this.left,r.reverse())}}}function Do(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function h0(e){const t={};let r=-1,s,o,a,u,d,h,p;const m=new k_(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,a=0,a<h.length&&h[a][1].type==="lineEndingBlank"&&(a+=2),a<h.length&&h[a][1].type==="content"))for(;++a<h.length&&h[a][1].type!=="content";)h[a][1].type==="chunkText"&&(h[a][1]._isInFirstContentOfListItem=!0,a++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,N_(m,r)),r=t[r],p=!0);else if(s[1]._container){for(a=r,o=void 0;a--;)if(u=m.get(a),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=a);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(s[1].end={...m.get(o)[1].start},d=m.slice(o,r),d.unshift(s),m.splice(o,r-o+1,d))}}return xr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function N_(e,t){const r=e.get(t)[1],s=e.get(t)[2];let o=t-1;const a=[];let u=r._tokenizer;u||(u=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,h=[],p={};let m,g,x=-1,w=r,k=0,E=0;const b=[E];for(;w;){for(;e.get(++o)[1]!==w;);a.push(o),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),g&&u.defineSkip(w.start),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=r;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(E=x+1,b.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(u.events=[],w?(w._tokenizer=void 0,w.previous=void 0):b.pop(),x=b.length;x--;){const S=d.slice(b[x],b[x+1]),C=a.pop();h.push([C,C+S.length-1]),e.splice(C,2,S)}for(h.reverse(),x=-1;++x<h.length;)p[k+h[x][0]]=k+h[x][1],k+=h[x][1]-h[x][0]-1;return p}const E_={resolve:C_,tokenize:j_},b_={partial:!0,tokenize:__};function C_(e){return h0(e),e}function j_(e,t){let r;return s;function s(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?a(d):Fe(d)?e.check(b_,u,a)(d):(e.consume(d),o)}function a(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function u(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function __(e,t,r){const s=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,a,"linePrefix")}function a(u){if(u===null||Fe(u))return r(u);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):e.interrupt(s.parser.constructs.flow,r,t)(u)}}function p0(e,t,r,s,o,a,u,d,h){const p=h||Number.POSITIVE_INFINITY;let m=0;return g;function g(S){return S===60?(e.enter(s),e.enter(o),e.enter(a),e.consume(S),e.exit(a),x):S===null||S===32||S===41||Id(S)?r(S):(e.enter(s),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),E(S))}function x(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(o),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),w(S))}function w(S){return S===62?(e.exit("chunkString"),e.exit(d),x(S)):S===null||S===60||Fe(S)?r(S):(e.consume(S),S===92?k:w)}function k(S){return S===60||S===62||S===92?(e.consume(S),w):w(S)}function E(S){return!m&&(S===null||S===41||fn(S))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(s),t(S)):m<p&&S===40?(e.consume(S),m++,E):S===41?(e.consume(S),m--,E):S===null||S===32||S===40||Id(S)?r(S):(e.consume(S),S===92?b:E)}function b(S){return S===40||S===41||S===92?(e.consume(S),E):E(S)}}function m0(e,t,r,s,o,a){const u=this;let d=0,h;return p;function p(w){return e.enter(s),e.enter(o),e.consume(w),e.exit(o),e.enter(a),m}function m(w){return d>999||w===null||w===91||w===93&&!h||w===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?r(w):w===93?(e.exit(a),e.enter(o),e.consume(w),e.exit(o),e.exit(s),t):Fe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Fe(w)||d++>999?(e.exit("chunkString"),m(w)):(e.consume(w),h||(h=!Je(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),d++,g):g(w)}}function g0(e,t,r,s,o,a){let u;return d;function d(x){return x===34||x===39||x===40?(e.enter(s),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,h):r(x)}function h(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(s),t):(e.enter(a),p(x))}function p(x){return x===u?(e.exit(a),h(u)):x===null?r(x):Fe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),it(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===u||x===null||Fe(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?g:m)}function g(x){return x===u||x===92?(e.consume(x),m):m(x)}}function Uo(e,t){let r;return s;function s(o){return Fe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):Je(o)?it(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}const I_={name:"definition",tokenize:P_},T_={partial:!0,tokenize:A_};function P_(e,t,r){const s=this;let o;return a;function a(w){return e.enter("definition"),u(w)}function u(w){return m0.call(s,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function d(w){return o=Vs(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),h):r(w)}function h(w){return fn(w)?Uo(e,p)(w):p(w)}function p(w){return p0(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(T_,g,g)(w)}function g(w){return Je(w)?it(e,x,"whitespace")(w):x(w)}function x(w){return w===null||Fe(w)?(e.exit("definition"),s.parser.defined.push(o),t(w)):r(w)}}function A_(e,t,r){return s;function s(d){return fn(d)?Uo(e,o)(d):r(d)}function o(d){return g0(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function a(d){return Je(d)?it(e,u,"whitespace")(d):u(d)}function u(d){return d===null||Fe(d)?t(d):r(d)}}const M_={name:"hardBreakEscape",tokenize:z_};function z_(e,t,r){return s;function s(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Fe(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}const R_={name:"headingAtx",resolve:L_,tokenize:D_};function L_(e,t){let r=e.length-2,s=3,o,a;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},a={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},xr(e,s,r-s+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function D_(e,t,r){let s=0;return o;function o(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&s++<6?(e.consume(m),u):m===null||fn(m)?(e.exit("atxHeadingSequence"),d(m)):r(m)}function d(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Fe(m)?(e.exit("atxHeading"),t(m)):Je(m)?it(e,d,"whitespace")(m):(e.enter("atxHeadingText"),p(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),d(m))}function p(m){return m===null||m===35||fn(m)?(e.exit("atxHeadingText"),d(m)):(e.consume(m),p)}}const F_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vg=["pre","script","style","textarea"],O_={concrete:!0,name:"htmlFlow",resolveTo:H_,tokenize:V_},$_={partial:!0,tokenize:W_},B_={partial:!0,tokenize:U_};function H_(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function V_(e,t,r){const s=this;let o,a,u,d,h;return p;function p(A){return m(A)}function m(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),x):A===47?(e.consume(A),a=!0,E):A===63?(e.consume(A),o=3,s.interrupt?t:j):pr(A)?(e.consume(A),u=String.fromCharCode(A),b):r(A)}function x(A){return A===45?(e.consume(A),o=2,w):A===91?(e.consume(A),o=5,d=0,k):pr(A)?(e.consume(A),o=4,s.interrupt?t:j):r(A)}function w(A){return A===45?(e.consume(A),s.interrupt?t:j):r(A)}function k(A){const ae="CDATA[";return A===ae.charCodeAt(d++)?(e.consume(A),d===ae.length?s.interrupt?t:W:k):r(A)}function E(A){return pr(A)?(e.consume(A),u=String.fromCharCode(A),b):r(A)}function b(A){if(A===null||A===47||A===62||fn(A)){const ae=A===47,re=u.toLowerCase();return!ae&&!a&&vg.includes(re)?(o=1,s.interrupt?t(A):W(A)):F_.includes(u.toLowerCase())?(o=6,ae?(e.consume(A),S):s.interrupt?t(A):W(A)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(A):a?C(A):N(A))}return A===45||Cn(A)?(e.consume(A),u+=String.fromCharCode(A),b):r(A)}function S(A){return A===62?(e.consume(A),s.interrupt?t:W):r(A)}function C(A){return Je(A)?(e.consume(A),C):q(A)}function N(A){return A===47?(e.consume(A),q):A===58||A===95||pr(A)?(e.consume(A),I):Je(A)?(e.consume(A),N):q(A)}function I(A){return A===45||A===46||A===58||A===95||Cn(A)?(e.consume(A),I):B(A)}function B(A){return A===61?(e.consume(A),T):Je(A)?(e.consume(A),B):N(A)}function T(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),h=A,D):Je(A)?(e.consume(A),T):G(A)}function D(A){return A===h?(e.consume(A),h=null,U):A===null||Fe(A)?r(A):(e.consume(A),D)}function G(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||fn(A)?B(A):(e.consume(A),G)}function U(A){return A===47||A===62||Je(A)?N(A):r(A)}function q(A){return A===62?(e.consume(A),F):r(A)}function F(A){return A===null||Fe(A)?W(A):Je(A)?(e.consume(A),F):r(A)}function W(A){return A===45&&o===2?(e.consume(A),$):A===60&&o===1?(e.consume(A),Q):A===62&&o===4?(e.consume(A),R):A===63&&o===3?(e.consume(A),j):A===93&&o===5?(e.consume(A),V):Fe(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check($_,Y,J)(A)):A===null||Fe(A)?(e.exit("htmlFlowData"),J(A)):(e.consume(A),W)}function J(A){return e.check(B_,z,Y)(A)}function z(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return A===null||Fe(A)?J(A):(e.enter("htmlFlowData"),W(A))}function $(A){return A===45?(e.consume(A),j):W(A)}function Q(A){return A===47?(e.consume(A),u="",M):W(A)}function M(A){if(A===62){const ae=u.toLowerCase();return vg.includes(ae)?(e.consume(A),R):W(A)}return pr(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),M):W(A)}function V(A){return A===93?(e.consume(A),j):W(A)}function j(A){return A===62?(e.consume(A),R):A===45&&o===2?(e.consume(A),j):W(A)}function R(A){return A===null||Fe(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),R)}function Y(A){return e.exit("htmlFlow"),t(A)}}function U_(e,t,r){const s=this;return o;function o(u){return Fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):r(u)}function a(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}function W_(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ru,t,r)}}const Y_={name:"htmlText",tokenize:X_};function X_(e,t,r){const s=this;let o,a,u;return d;function d(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),B):j===63?(e.consume(j),N):pr(j)?(e.consume(j),G):r(j)}function p(j){return j===45?(e.consume(j),m):j===91?(e.consume(j),a=0,k):pr(j)?(e.consume(j),C):r(j)}function m(j){return j===45?(e.consume(j),w):r(j)}function g(j){return j===null?r(j):j===45?(e.consume(j),x):Fe(j)?(u=g,Q(j)):(e.consume(j),g)}function x(j){return j===45?(e.consume(j),w):g(j)}function w(j){return j===62?$(j):j===45?x(j):g(j)}function k(j){const R="CDATA[";return j===R.charCodeAt(a++)?(e.consume(j),a===R.length?E:k):r(j)}function E(j){return j===null?r(j):j===93?(e.consume(j),b):Fe(j)?(u=E,Q(j)):(e.consume(j),E)}function b(j){return j===93?(e.consume(j),S):E(j)}function S(j){return j===62?$(j):j===93?(e.consume(j),S):E(j)}function C(j){return j===null||j===62?$(j):Fe(j)?(u=C,Q(j)):(e.consume(j),C)}function N(j){return j===null?r(j):j===63?(e.consume(j),I):Fe(j)?(u=N,Q(j)):(e.consume(j),N)}function I(j){return j===62?$(j):N(j)}function B(j){return pr(j)?(e.consume(j),T):r(j)}function T(j){return j===45||Cn(j)?(e.consume(j),T):D(j)}function D(j){return Fe(j)?(u=D,Q(j)):Je(j)?(e.consume(j),D):$(j)}function G(j){return j===45||Cn(j)?(e.consume(j),G):j===47||j===62||fn(j)?U(j):r(j)}function U(j){return j===47?(e.consume(j),$):j===58||j===95||pr(j)?(e.consume(j),q):Fe(j)?(u=U,Q(j)):Je(j)?(e.consume(j),U):$(j)}function q(j){return j===45||j===46||j===58||j===95||Cn(j)?(e.consume(j),q):F(j)}function F(j){return j===61?(e.consume(j),W):Fe(j)?(u=F,Q(j)):Je(j)?(e.consume(j),F):U(j)}function W(j){return j===null||j===60||j===61||j===62||j===96?r(j):j===34||j===39?(e.consume(j),o=j,J):Fe(j)?(u=W,Q(j)):Je(j)?(e.consume(j),W):(e.consume(j),z)}function J(j){return j===o?(e.consume(j),o=void 0,O):j===null?r(j):Fe(j)?(u=J,Q(j)):(e.consume(j),J)}function z(j){return j===null||j===34||j===39||j===60||j===61||j===96?r(j):j===47||j===62||fn(j)?U(j):(e.consume(j),z)}function O(j){return j===47||j===62||fn(j)?U(j):r(j)}function $(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):r(j)}function Q(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),M}function M(j){return Je(j)?it(e,V,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):V(j)}function V(j){return e.enter("htmlTextData"),u(j)}}const cf={name:"labelEnd",resolveAll:Q_,resolveTo:Z_,tokenize:J_},q_={tokenize:eI},G_={tokenize:tI},K_={tokenize:nI};function Q_(e){let t=-1;const r=[];for(;++t<e.length;){const s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&xr(e,0,e.length,r),e}function Z_(e,t){let r=e.length,s=0,o,a,u,d;for(;r--;)if(o=e[r][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(u=r);const h={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[a][1].start},end:{...e[u][1].end}},m={type:"labelText",start:{...e[a+s+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",h,t],["enter",p,t]],d=Dn(d,e.slice(a+1,a+s+3)),d=Dn(d,[["enter",m,t]]),d=Dn(d,uf(t.parser.constructs.insideSpan.null,e.slice(a+s+4,u-3),t)),d=Dn(d,[["exit",m,t],e[u-2],e[u-1],["exit",p,t]]),d=Dn(d,e.slice(u+1)),d=Dn(d,[["exit",h,t]]),xr(e,a,e.length,d),e}function J_(e,t,r){const s=this;let o=s.events.length,a,u;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){a=s.events[o][1];break}return d;function d(x){return a?a._inactive?g(x):(u=s.parser.defined.includes(Vs(s.sliceSerialize({start:a.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):r(x)}function h(x){return x===40?e.attempt(q_,m,u?m:g)(x):x===91?e.attempt(G_,m,u?p:g)(x):u?m(x):g(x)}function p(x){return e.attempt(K_,m,g)(x)}function m(x){return t(x)}function g(x){return a._balanced=!0,r(x)}}function eI(e,t,r){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return fn(g)?Uo(e,a)(g):a(g)}function a(g){return g===41?m(g):p0(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return fn(g)?Uo(e,h)(g):m(g)}function d(g){return r(g)}function h(g){return g===34||g===39||g===40?g0(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return fn(g)?Uo(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function tI(e,t,r){const s=this;return o;function o(d){return m0.call(s,e,a,u,"reference","referenceMarker","referenceString")(d)}function a(d){return s.parser.defined.includes(Vs(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):r(d)}function u(d){return r(d)}}function nI(e,t,r){return s;function s(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}const rI={name:"labelStartImage",resolveAll:cf.resolveAll,tokenize:iI};function iI(e,t,r){const s=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),a}function a(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):r(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):t(d)}}const sI={name:"labelStartLink",resolveAll:cf.resolveAll,tokenize:oI};function oI(e,t,r){const s=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),a}function a(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):t(u)}}const td={name:"lineEnding",tokenize:lI};function lI(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,t,"linePrefix")}}const Ia={name:"thematicBreak",tokenize:aI};function aI(e,t,r){let s=0,o;return a;function a(p){return e.enter("thematicBreak"),u(p)}function u(p){return o=p,d(p)}function d(p){return p===o?(e.enter("thematicBreakSequence"),h(p)):s>=3&&(p===null||Fe(p))?(e.exit("thematicBreak"),t(p)):r(p)}function h(p){return p===o?(e.consume(p),s++,h):(e.exit("thematicBreakSequence"),Je(p)?it(e,d,"whitespace")(p):d(p))}}const un={continuation:{tokenize:fI},exit:pI,name:"list",tokenize:dI},uI={partial:!0,tokenize:mI},cI={partial:!0,tokenize:hI};function dI(e,t,r){const s=this,o=s.events[s.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return d;function d(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:Td(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Ia,r,p)(w):p(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(w)}return r(w)}function h(w){return Td(w)&&++u<10?(e.consume(w),h):(!s.interrupt||u<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),p(w)):r(w)}function p(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(ru,s.interrupt?r:m,e.attempt(uI,x,g))}function m(w){return s.containerState.initialBlankLine=!0,a++,x(w)}function g(w){return Je(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):r(w)}function x(w){return s.containerState.size=a+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function fI(e,t,r){const s=this;return s.containerState._closeFlow=void 0,e.check(ru,o,a);function o(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(e,t,"listItemIndent",s.containerState.size+1)(d)}function a(d){return s.containerState.furtherBlankLines||!Je(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(cI,t,u)(d))}function u(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(un,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function hI(e,t,r){const s=this;return it(e,o,"listItemIndent",s.containerState.size+1);function o(a){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?t(a):r(a)}}function pI(e){e.exit(this.containerState.type)}function mI(e,t,r){const s=this;return it(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const u=s.events[s.events.length-1];return!Je(a)&&u&&u[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}const wg={name:"setextUnderline",resolveTo:gI,tokenize:yI};function gI(e,t){let r=e.length,s,o,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);const u={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",u,t]),e.splice(a+1,0,["exit",e[s][1],t]),e[s][1].end={...e[a][1].end}):e[s][1]=u,e.push(["exit",u,t]),e}function yI(e,t,r){const s=this;let o;return a;function a(p){let m=s.events.length,g;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){g=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),o=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===o?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),Je(p)?it(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Fe(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}const xI={tokenize:vI};function vI(e){const t=this,r=e.attempt(ru,s,e.attempt(this.parser.constructs.flowInitial,o,it(e,e.attempt(this.parser.constructs.flow,o,e.attempt(E_,o)),"linePrefix")));return r;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const wI={resolveAll:x0()},SI=y0("string"),kI=y0("text");function y0(e){return{resolveAll:x0(e==="text"?NI:void 0),tokenize:t};function t(r){const s=this,o=this.parser.constructs[e],a=r.attempt(o,u,d);return u;function u(m){return p(m)?a(m):d(m)}function d(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return p(m)?(r.exit("data"),a(m)):(r.consume(m),h)}function p(m){if(m===null)return!0;const g=o[m];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function x0(e){return t;function t(r,s){let o=-1,a;for(;++o<=r.length;)a===void 0?r[o]&&r[o][1].type==="data"&&(a=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==a+2&&(r[a][1].end=r[o-1][1].end,r.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(r,s):r}}function NI(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],o=t.sliceStream(s);let a=o.length,u=-1,d=0,h;for(;a--;){const p=o[a];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(p===-2)h=!0,d++;else if(p!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(d=0),d){const p={type:r===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?u:s.start._bufferIndex+u,_index:s.start._index+a,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...p.start},s.start.offset===s.end.offset?Object.assign(s,p):(e.splice(r,0,["enter",p,t],["exit",p,t]),r+=2)}r++}return e}const EI={42:un,43:un,45:un,48:un,49:un,50:un,51:un,52:un,53:un,54:un,55:un,56:un,57:un,62:c0},bI={91:I_},CI={[-2]:ed,[-1]:ed,32:ed},jI={35:R_,42:Ia,45:[wg,Ia],60:O_,61:wg,95:Ia,96:xg,126:xg},_I={38:f0,92:d0},II={[-5]:td,[-4]:td,[-3]:td,33:rI,38:f0,42:Pd,60:[s_,Y_],91:sI,92:[M_,d0],93:cf,95:Pd,96:x_},TI={null:[Pd,wI]},PI={null:[42,95]},AI={null:[]},MI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PI,contentInitial:bI,disable:AI,document:EI,flow:jI,flowInitial:CI,insideSpan:TI,string:_I,text:II},Symbol.toStringTag,{value:"Module"}));function zI(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},a=[];let u=[],d=[];const h={attempt:D(B),check:D(T),consume:C,enter:N,exit:I,interrupt:D(T,{interrupt:!0})},p={code:null,containerState:{},defineSkip:E,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let m=t.tokenize.call(p,h);return t.resolveAll&&a.push(t),p;function g(F){return u=Dn(u,F),b(),u[u.length-1]!==null?[]:(G(t,0),p.events=uf(a,p.events,p),p.events)}function x(F,W){return LI(w(F),W)}function w(F){return RI(u,F)}function k(){const{_bufferIndex:F,_index:W,line:J,column:z,offset:O}=s;return{_bufferIndex:F,_index:W,line:J,column:z,offset:O}}function E(F){o[F.line]=F.column,q()}function b(){let F;for(;s._index<u.length;){const W=u[s._index];if(typeof W=="string")for(F=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===F&&s._bufferIndex<W.length;)S(W.charCodeAt(s._bufferIndex));else S(W)}}function S(F){m=m(F)}function C(F){Fe(F)?(s.line++,s.column=1,s.offset+=F===-3?2:1,q()):F!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),p.previous=F}function N(F,W){const J=W||{};return J.type=F,J.start=k(),p.events.push(["enter",J,p]),d.push(J),J}function I(F){const W=d.pop();return W.end=k(),p.events.push(["exit",W,p]),W}function B(F,W){G(F,W.from)}function T(F,W){W.restore()}function D(F,W){return J;function J(z,O,$){let Q,M,V,j;return Array.isArray(z)?Y(z):"tokenize"in z?Y([z]):R(z);function R(ce){return he;function he(se){const ge=se!==null&&ce[se],be=se!==null&&ce.null,Pe=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(be)?be:be?[be]:[]];return Y(Pe)(se)}}function Y(ce){return Q=ce,M=0,ce.length===0?$:A(ce[M])}function A(ce){return he;function he(se){return j=U(),V=ce,ce.partial||(p.currentConstruct=ce),ce.name&&p.parser.constructs.disable.null.includes(ce.name)?re():ce.tokenize.call(W?Object.assign(Object.create(p),W):p,h,ae,re)(se)}}function ae(ce){return F(V,j),O}function re(ce){return j.restore(),++M<Q.length?A(Q[M]):$}}}function G(F,W){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&xr(p.events,W,p.events.length-W,F.resolve(p.events.slice(W),p)),F.resolveTo&&(p.events=F.resolveTo(p.events,p))}function U(){const F=k(),W=p.previous,J=p.currentConstruct,z=p.events.length,O=Array.from(d);return{from:z,restore:$};function $(){s=F,p.previous=W,p.currentConstruct=J,p.events.length=z,d=O,q()}}function q(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function RI(e,t){const r=t.start._index,s=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(s,a)];else{if(u=e.slice(r,o),s>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(s):u.shift()}a>0&&u.push(e[o].slice(0,a))}return u}function LI(e,t){let r=-1;const s=[];let o;for(;++r<e.length;){const a=e[r];let u;if(typeof a=="string")u=a;else switch(a){case-5:{u="\r";break}case-4:{u=`
|
|
67
|
+
`;break}case-3:{u=`\r
|
|
68
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(a)}o=a===-2,s.push(u)}return s.join("")}function DI(e){const s={constructs:U2([MI,...(e||{}).extensions||[]]),content:o(Z2),defined:[],document:o(e_),flow:o(xI),lazy:{},string:o(SI),text:o(kI)};return s;function o(a){return u;function u(d){return zI(s,a,d)}}}function FI(e){for(;!h0(e););return e}const Sg=/[\0\t\n\r]/g;function OI(){let e=1,t="",r=!0,s;return o;function o(a,u,d){const h=[];let p,m,g,x,w;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),g=0,t="",r&&(a.charCodeAt(0)===65279&&g++,r=void 0);g<a.length;){if(Sg.lastIndex=g,p=Sg.exec(a),x=p&&p.index!==void 0?p.index:a.length,w=a.charCodeAt(x),!p){t=a.slice(g);break}if(w===10&&g===x&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),g<x&&(h.push(a.slice(g,x)),e+=x-g),w){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}g=x+1}return d&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}const $I=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BI(e){return e.replace($I,HI)}function HI(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),a=o===120||o===88;return u0(r.slice(a?2:1),a?16:10)}return af(r)||e}const v0={}.hasOwnProperty;function VI(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),UI(r)(FI(DI(r).document().write(OI()(e,t,!0))))}function UI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ct),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(We),blockQuote:a(be),characterEscape:U,characterReference:U,codeFenced:a(Pe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(Pe,u),codeText:a(Ee,u),codeTextData:U,data:U,codeFlowValue:U,definition:a(ke),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(Ve),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(tt,u),htmlFlowData:U,htmlText:a(tt,u),htmlTextData:U,image:a(It),label:u,link:a(Ct),listItem:a(Tt),listItemValue:x,listOrdered:a(gt,g),listUnordered:a(gt),paragraph:a(Ht),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(We),strong:a(pn),thematicBreak:a(Jt)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:ge,autolinkProtocol:se,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ce,characterReference:he,codeFenced:h(b),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:h(S),codeText:h(O),codeTextData:q,data:q,definition:h(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(W),hardBreakTrailing:h(W),htmlFlow:h(J),htmlFlowData:q,htmlText:h(z),htmlTextData:q,image:h(Q),label:V,labelText:M,lineEnding:F,link:h($),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ae,resourceDestinationString:j,resourceTitleString:R,resource:Y,setextHeading:h(G),setextHeadingLineSequence:D,setextHeadingText:T,strong:h(),thematicBreak:h()}};w0(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(oe){let ye={type:"root",children:[]};const me={stack:[ye],tokenStack:[],config:t,enter:d,exit:p,buffer:u,resume:m,data:r},$e=[];let Be=-1;for(;++Be<oe.length;)if(oe[Be][1].type==="listOrdered"||oe[Be][1].type==="listUnordered")if(oe[Be][0]==="enter")$e.push(Be);else{const ht=$e.pop();Be=o(oe,ht,Be)}for(Be=-1;++Be<oe.length;){const ht=t[oe[Be][0]];v0.call(ht,oe[Be][1].type)&&ht[oe[Be][1].type].call(Object.assign({sliceSerialize:oe[Be][2].sliceSerialize},me),oe[Be][1])}if(me.tokenStack.length>0){const ht=me.tokenStack[me.tokenStack.length-1];(ht[1]||kg).call(me,void 0,ht[0])}for(ye.position={start:pi(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:pi(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ye=t.transforms[Be](ye)||ye;return ye}function o(oe,ye,me){let $e=ye-1,Be=-1,ht=!1,gn,Pt,yt,_n;for(;++$e<=me;){const pt=oe[$e];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Be++:Be--,_n=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(gn&&!_n&&!Be&&!yt&&(yt=$e),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!Be&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Be===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(gn){let en=$e;for(Pt=void 0;en--;){const At=oe[en];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;Pt&&(oe[Pt][1].type="lineEndingBlank",ht=!0),At[1].type="lineEnding",Pt=en}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}yt&&(!Pt||yt<Pt)&&(gn._spread=!0),gn.end=Object.assign({},Pt?oe[Pt][1].start:pt[1].end),oe.splice(Pt||$e,0,["exit",gn,pt[2]]),$e++,me++}if(pt[1].type==="listItemPrefix"){const en={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};gn=en,oe.splice($e,0,["enter",en,pt[2]]),$e++,me++,yt=void 0,_n=!0}}}return oe[ye][1]._spread=ht,me}function a(oe,ye){return me;function me($e){d.call(this,oe($e),$e),ye&&ye.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(oe,ye,me){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ye,me||void 0]),oe.position={start:pi(ye.start),end:void 0}}function h(oe){return ye;function ye(me){oe&&oe.call(this,me),p.call(this,me)}}function p(oe,ye){const me=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==oe.type&&(ye?ye.call(this,oe,$e[0]):($e[1]||kg).call(this,oe,$e[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Vo({start:oe.start,end:oe.end})+"): it’s not open");me.position.end=pi(oe.end)}function m(){return H2(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(oe){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=oe}function k(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=oe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.value=oe.replace(/(\r?\n|\r)$/g,"")}function C(oe){const ye=this.resume(),me=this.stack[this.stack.length-1];me.label=ye,me.identifier=Vs(this.sliceSerialize(oe)).toLowerCase()}function N(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.title=oe}function I(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.url=oe}function B(oe){const ye=this.stack[this.stack.length-1];if(!ye.depth){const me=this.sliceSerialize(oe).length;ye.depth=me}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function D(oe){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function U(oe){const me=this.stack[this.stack.length-1].children;let $e=me[me.length-1];(!$e||$e.type!=="text")&&($e=mn(),$e.position={start:pi(oe.start),end:void 0},me.push($e)),this.stack.push($e)}function q(oe){const ye=this.stack.pop();ye.value+=this.sliceSerialize(oe),ye.position.end=pi(oe.end)}function F(oe){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=ye.children[ye.children.length-1];me.position.end=pi(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(U.call(this,oe),q.call(this,oe))}function W(){this.data.atHardBreak=!0}function J(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.value=oe}function z(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.value=oe}function O(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.value=oe}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ye,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Q(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ye,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function M(oe){const ye=this.sliceSerialize(oe),me=this.stack[this.stack.length-2];me.label=BI(ye),me.identifier=Vs(ye).toLowerCase()}function V(){const oe=this.stack[this.stack.length-1],ye=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const $e=oe.children;me.children=$e}else me.alt=ye}function j(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.url=oe}function R(){const oe=this.resume(),ye=this.stack[this.stack.length-1];ye.title=oe}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ae(oe){const ye=this.resume(),me=this.stack[this.stack.length-1];me.label=ye,me.identifier=Vs(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function re(oe){this.data.characterReferenceType=oe.type}function ce(oe){const ye=this.sliceSerialize(oe),me=this.data.characterReferenceType;let $e;me?($e=u0(ye,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=af(ye);const Be=this.stack[this.stack.length-1];Be.value+=$e}function he(oe){const ye=this.stack.pop();ye.position.end=pi(oe.end)}function se(oe){q.call(this,oe);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(oe)}function ge(oe){q.call(this,oe);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(oe)}function be(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function We(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function tt(){return{type:"html",value:""}}function It(){return{type:"image",title:null,url:"",alt:null}}function Ct(){return{type:"link",title:null,url:"",children:[]}}function gt(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Tt(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Ht(){return{type:"paragraph",children:[]}}function pn(){return{type:"strong",children:[]}}function mn(){return{type:"text",value:""}}function Jt(){return{type:"thematicBreak"}}}function pi(e){return{line:e.line,column:e.column,offset:e.offset}}function w0(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?w0(e,s):WI(e,s)}}function WI(e,t){let r;for(r in t)if(v0.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function kg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vo({start:t.start,end:t.end})+") is still open")}function YI(e){const t=this;t.parser=r;function r(s){return VI(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function XI(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function qI(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
69
|
+
`}]}function GI(e,t){const r=t.value?t.value+`
|
|
70
|
+
`:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function KI(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function QI(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZI(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),o=Ks(s.toLowerCase()),a=e.footnoteOrder.indexOf(s);let u,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=a+1,d+=1,e.footnoteCounts.set(s,d);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,p),e.applyData(t,p)}function JI(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eT(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function S0(e,t){const r=t.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=s:o.push({type:"text",value:s}),o}function tT(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return S0(e,t);const o={src:Ks(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(o.title=s.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function nT(e,t){const r={src:Ks(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function rT(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,s),e.applyData(t,s)}function iT(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return S0(e,t);const o={href:Ks(s.url||"")};s.title!==null&&s.title!==void 0&&(o.title=s.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function sT(e,t){const r={href:Ks(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function oT(e,t,r){const s=e.all(t),o=r?lT(r):k0(t),a={},u=[];if(typeof t.checked=="boolean"){const m=s[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let d=-1;for(;++d<s.length;){const m=s[d];(o||d!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
71
|
+
`}),m.type==="element"&&m.tagName==="p"&&!o?u.push(...m.children):u.push(m)}const h=s[s.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
72
|
+
`});const p={type:"element",tagName:"li",properties:a,children:u};return e.patch(t,p),e.applyData(t,p)}function lT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let s=-1;for(;!t&&++s<r.length;)t=k0(r[s])}return t}function k0(e){const t=e.spread;return t??e.children.length>1}function aT(e,t){const r={},s=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<s.length;){const u=s[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function uT(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cT(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function dT(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fT(e,t){const r=e.all(t),s=r.shift(),o=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=rf(t.children[1]),h=n0(t.children[t.children.length-1]);d&&h&&(u.position={start:d,end:h}),o.push(u)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function hT(e,t,r){const s=r?r.children:void 0,a=(s?s.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,d=u?u.length:t.children.length;let h=-1;const p=[];for(;++h<d;){const g=t.children[h],x={},w=u?u[h]:void 0;w&&(x.align=w);let k={type:"element",tagName:a,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),p.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,m),e.applyData(t,m)}function pT(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Ng=9,Eg=32;function mT(e){const t=String(e),r=/\r?\n|\r/g;let s=r.exec(t),o=0;const a=[];for(;s;)a.push(bg(t.slice(o,s.index),o>0,!0),s[0]),o=s.index+s[0].length,s=r.exec(t);return a.push(bg(t.slice(o),o>0,!1)),a.join("")}function bg(e,t,r){let s=0,o=e.length;if(t){let a=e.codePointAt(s);for(;a===Ng||a===Eg;)s++,a=e.codePointAt(s)}if(r){let a=e.codePointAt(o-1);for(;a===Ng||a===Eg;)o--,a=e.codePointAt(o-1)}return o>s?e.slice(s,o):""}function gT(e,t){const r={type:"text",value:mT(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function yT(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const xT={blockquote:XI,break:qI,code:GI,delete:KI,emphasis:QI,footnoteReference:ZI,heading:JI,html:eT,imageReference:tT,image:nT,inlineCode:rT,linkReference:iT,link:sT,listItem:oT,list:aT,paragraph:uT,root:cT,strong:dT,table:fT,tableCell:pT,tableRow:hT,text:gT,thematicBreak:yT,toml:Sa,yaml:Sa,definition:Sa,footnoteDefinition:Sa};function Sa(){}const N0=-1,iu=0,Wo=1,Ha=2,df=3,ff=4,hf=5,pf=6,E0=7,b0=8,Cg=typeof self=="object"?self:globalThis,vT=(e,t)=>{const r=(o,a)=>(e.set(a,o),o),s=o=>{if(e.has(o))return e.get(o);const[a,u]=t[o];switch(a){case iu:case N0:return r(u,o);case Wo:{const d=r([],o);for(const h of u)d.push(s(h));return d}case Ha:{const d=r({},o);for(const[h,p]of u)d[s(h)]=s(p);return d}case df:return r(new Date(u),o);case ff:{const{source:d,flags:h}=u;return r(new RegExp(d,h),o)}case hf:{const d=r(new Map,o);for(const[h,p]of u)d.set(s(h),s(p));return d}case pf:{const d=r(new Set,o);for(const h of u)d.add(s(h));return d}case E0:{const{name:d,message:h}=u;return r(new Cg[d](h),o)}case b0:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return r(new DataView(d),u)}}return r(new Cg[a](u),o)};return s},jg=e=>vT(new Map,e)(0),Rs="",{toString:wT}={},{keys:ST}=Object,Fo=e=>{const t=typeof e;if(t!=="object"||!e)return[iu,t];const r=wT.call(e).slice(8,-1);switch(r){case"Array":return[Wo,Rs];case"Object":return[Ha,Rs];case"Date":return[df,Rs];case"RegExp":return[ff,Rs];case"Map":return[hf,Rs];case"Set":return[pf,Rs];case"DataView":return[Wo,r]}return r.includes("Array")?[Wo,r]:r.includes("Error")?[E0,r]:[Ha,r]},ka=([e,t])=>e===iu&&(t==="function"||t==="symbol"),kT=(e,t,r,s)=>{const o=(u,d)=>{const h=s.push(u)-1;return r.set(d,h),h},a=u=>{if(r.has(u))return r.get(u);let[d,h]=Fo(u);switch(d){case iu:{let m=u;switch(h){case"bigint":d=b0,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return o([N0],u)}return o([d,m],u)}case Wo:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),o([h,[...x]],u)}const m=[],g=o([d,m],u);for(const x of u)m.push(a(x));return g}case Ha:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return a(u.toJSON());const m=[],g=o([d,m],u);for(const x of ST(u))(e||!ka(Fo(u[x])))&&m.push([a(x),a(u[x])]);return g}case df:return o([d,u.toISOString()],u);case ff:{const{source:m,flags:g}=u;return o([d,{source:m,flags:g}],u)}case hf:{const m=[],g=o([d,m],u);for(const[x,w]of u)(e||!(ka(Fo(x))||ka(Fo(w))))&&m.push([a(x),a(w)]);return g}case pf:{const m=[],g=o([d,m],u);for(const x of u)(e||!ka(Fo(x)))&&m.push(a(x));return g}}const{message:p}=u;return o([d,{name:h,message:p}],u)};return a},_g=(e,{json:t,lossy:r}={})=>{const s=[];return kT(!(t||r),!!t,new Map,s)(e),s},Va=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jg(_g(e,t)):structuredClone(e):(e,t)=>jg(_g(e,t));function NT(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function ET(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bT(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||NT,s=e.options.footnoteBackLabel||ET,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const m=e.all(p),g=String(p.identifier).toUpperCase(),x=Ks(g.toLowerCase());let w=0;const k=[],E=e.footnoteCounts.get(g);for(;E!==void 0&&++w<=E;){k.length>0&&k.push({type:"text",value:" "});let C=typeof r=="string"?r:r(h,w);typeof C=="string"&&(C={type:"text",value:C}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(h,w),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const b=m[m.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const C=b.children[b.children.length-1];C&&C.type==="text"?C.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...k)}else m.push(...k);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(m,!0)};e.patch(p,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Va(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
73
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
74
|
+
`}]}}const C0=(function(e){if(e==null)return IT;if(typeof e=="function")return su(e);if(typeof e=="object")return Array.isArray(e)?CT(e):jT(e);if(typeof e=="string")return _T(e);throw new Error("Expected function, string, or object as test")});function CT(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=C0(e[r]);return su(s);function s(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function jT(e){const t=e;return su(r);function r(s){const o=s;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function _T(e){return su(t);function t(r){return r&&r.type===e}}function su(e){return t;function t(r,s,o){return!!(TT(r)&&e.call(this,r,typeof s=="number"?s:void 0,o||void 0))}}function IT(){return!0}function TT(e){return e!==null&&typeof e=="object"&&"type"in e}const j0=[],PT=!0,Ig=!1,AT="skip";function MT(e,t,r,s){let o;typeof t=="function"&&typeof r!="function"?(s=r,r=t):o=t;const a=C0(o),u=s?-1:1;d(e,void 0,[])();function d(h,p,m){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=j0,k,E,b;if((!t||a(h,p,m[m.length-1]||void 0))&&(w=zT(r(h,m)),w[0]===Ig))return w;if("children"in h&&h.children){const S=h;if(S.children&&w[0]!==AT)for(E=(s?S.children.length:-1)+u,b=m.concat(S);E>-1&&E<S.children.length;){const C=S.children[E];if(k=d(C,E,b)(),k[0]===Ig)return k;E=typeof k[1]=="number"?k[1]:E+u}}return w}}}function zT(e){return Array.isArray(e)?e:typeof e=="number"?[PT,e]:e==null?j0:[e]}function _0(e,t,r,s){let o,a,u;typeof t=="function"&&typeof r!="function"?(a=void 0,u=t,o=r):(a=t,u=r,o=s),MT(e,a,d,o);function d(h,p){const m=p[p.length-1],g=m?m.children.indexOf(h):void 0;return u(h,g,m)}}const Ad={}.hasOwnProperty,RT={};function LT(e,t){const r=t||RT,s=new Map,o=new Map,a=new Map,u={...xT,...r.handlers},d={all:p,applyData:FT,definitionById:s,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:u,one:h,options:r,patch:DT,wrap:$T};return _0(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?s:o,x=String(m.identifier).toUpperCase();g.has(x)||g.set(x,m)}}),d;function h(m,g){const x=m.type,w=d.handlers[x];if(Ad.call(d.handlers,x)&&w)return w(d,m,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in m){const{children:E,...b}=m,S=Va(b);return S.children=d.all(m),S}return Va(m)}return(d.options.unknownHandler||OT)(d,m,g)}function p(m){const g=[];if("children"in m){const x=m.children;let w=-1;for(;++w<x.length;){const k=d.one(x[w],m);if(k){if(w&&x[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Tg(k.value)),!Array.isArray(k)&&k.type==="element")){const E=k.children[0];E&&E.type==="text"&&(E.value=Tg(E.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function DT(e,t){e.position&&(t.position=w2(e))}function FT(e,t){let r=t;if(e&&e.data){const s=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const u="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:u}}r.type==="element"&&a&&Object.assign(r.properties,Va(a)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function OT(e,t){const r=t.data||{},s="value"in t&&!(Ad.call(r,"hProperties")||Ad.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function $T(e,t){const r=[];let s=-1;for(t&&r.push({type:"text",value:`
|
|
75
|
+
`});++s<e.length;)s&&r.push({type:"text",value:`
|
|
76
|
+
`}),r.push(e[s]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
77
|
+
`}),r}function Tg(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Pg(e,t){const r=LT(e,t),s=r.one(e,void 0),o=bT(r),a=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
78
|
+
`},o),a}function BT(e,t){return e&&"run"in e?async function(r,s){const o=Pg(r,{file:s,...t});await e.run(o,s)}:function(r,s){return Pg(r,{file:s,...e||t})}}function Ag(e){if(e)throw e}var nd,Mg;function HT(){if(Mg)return nd;Mg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},a=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var m=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var x;for(x in p);return typeof x>"u"||e.call(p,x)},u=function(p,m){r&&m.name==="__proto__"?r(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},d=function(p,m){if(m==="__proto__")if(e.call(p,m)){if(s)return s(p,m).value}else return;return p[m]};return nd=function h(){var p,m,g,x,w,k,E=arguments[0],b=1,S=arguments.length,C=!1;for(typeof E=="boolean"&&(C=E,E=arguments[1]||{},b=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});b<S;++b)if(p=arguments[b],p!=null)for(m in p)g=d(E,m),x=d(p,m),E!==x&&(C&&x&&(a(x)||(w=o(x)))?(w?(w=!1,k=g&&o(g)?g:[]):k=g&&a(g)?g:{},u(E,{name:m,newValue:h(C,k,x)})):typeof x<"u"&&u(E,{name:m,newValue:x}));return E},nd}var VT=HT();const rd=rl(VT);function Md(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function UT(){const e=[],t={run:r,use:s};return t;function r(...o){let a=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...o);function d(h,...p){const m=e[++a];let g=-1;if(h){u(h);return}for(;++g<o.length;)(p[g]===null||p[g]===void 0)&&(p[g]=o[g]);o=p,m?WT(m,d)(...p):u(null,...p)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function WT(e,t){let r;return s;function s(...u){const d=e.length>u.length;let h;d&&u.push(o);try{h=e.apply(this,u)}catch(p){const m=p;if(d&&r)throw m;return o(m)}d||(h&&h.then&&typeof h.then=="function"?h.then(a,o):h instanceof Error?o(h):a(h))}function o(u,...d){r||(r=!0,t(u,...d))}function a(u){o(null,u)}}const fr={basename:YT,dirname:XT,extname:qT,join:GT,sep:"/"};function YT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fl(e);let r=0,s=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){r=o+1;break}}else s<0&&(a=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let u=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){r=o+1;break}}else u<0&&(a=!0,u=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(s=o):(d=-1,s=u));return r===s?s=u:s<0&&(s=e.length),e.slice(r,s)}function XT(e){if(fl(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qT(e){fl(e);let t=e.length,r=-1,s=0,o=-1,a=0,u;for(;t--;){const d=e.codePointAt(t);if(d===47){if(u){s=t+1;break}continue}r<0&&(u=!0,r=t+1),d===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||r<0||a===0||a===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function GT(...e){let t=-1,r;for(;++t<e.length;)fl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":KT(r)}function KT(e){fl(e);const t=e.codePointAt(0)===47;let r=QT(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function QT(e,t){let r="",s=0,o=-1,a=0,u=-1,d,h;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(o===u-1||a===1))if(o!==u-1&&a===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),o=u,a=0;continue}}else if(r.length>0){r="",s=0,o=u,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),s=u-o-1;o=u,a=0}else d===46&&a>-1?a++:a=-1}return r}function fl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZT={cwd:JT};function JT(){return"/"}function zd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eP(e){if(typeof e=="string")e=new URL(e);else if(!zd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return tP(e)}function tP(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const s=t.codePointAt(r+2);if(s===70||s===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const id=["history","path","basename","stem","extname","dirname"];class I0{constructor(t){let r;t?zd(t)?r={path:t}:typeof t=="string"||nP(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ZT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<id.length;){const a=id[s];a in r&&r[a]!==void 0&&r[a]!==null&&(this[a]=a==="history"?[...r[a]]:r[a])}let o;for(o in r)id.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?fr.basename(this.path):void 0}set basename(t){od(t,"basename"),sd(t,"basename"),this.path=fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fr.dirname(this.path):void 0}set dirname(t){zg(this.basename,"dirname"),this.path=fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fr.extname(this.path):void 0}set extname(t){if(sd(t,"extname"),zg(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){zd(t)&&(t=eP(t)),od(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fr.basename(this.path,this.extname):void 0}set stem(t){od(t,"stem"),sd(t,"stem"),this.path=fr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){const o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){const o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){const o=new qt(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sd(e,t){if(e&&e.includes(fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fr.sep+"`")}function od(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function zg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rP=(function(e){const s=this.constructor.prototype,o=s[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,s),a}),iP={}.hasOwnProperty;class mf extends rP{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=UT()}copy(){const t=new mf;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];t.use(...s)}return t.data(rd(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(ud("data",this.frozen),this.namespace[t]=r,this):iP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ud("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Na(t),s=this.parser||this.Parser;return ld("parse",s),s(String(r),r)}process(t,r){const s=this;return this.freeze(),ld("process",this.parser||this.Parser),ad("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(a,u){const d=Na(t),h=s.parse(d);s.run(h,d,function(m,g,x){if(m||!g||!x)return p(m);const w=g,k=s.stringify(w,x);lP(k)?x.value=k:x.result=k,p(m,x)});function p(m,g){m||!g?u(m):a?a(g):r(void 0,g)}}}processSync(t){let r=!1,s;return this.freeze(),ld("processSync",this.parser||this.Parser),ad("processSync",this.compiler||this.Compiler),this.process(t,o),Lg("processSync","process",r),s;function o(a,u){r=!0,Ag(a),s=u}}run(t,r,s){Rg(t),this.freeze();const o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?a(void 0,s):new Promise(a);function a(u,d){const h=Na(r);o.run(t,h,p);function p(m,g,x){const w=g||t;m?d(m):u?u(w):s(void 0,w,x)}}}runSync(t,r){let s=!1,o;return this.run(t,r,a),Lg("runSync","run",s),o;function a(u,d){Ag(u),o=d,s=!0}}stringify(t,r){this.freeze();const s=Na(r),o=this.compiler||this.Compiler;return ad("stringify",o),Rg(t),o(t,s)}use(t,...r){const s=this.attachers,o=this.namespace;if(ud("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?d(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[m,...g]=p;h(m,g)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(p.plugins),p.settings&&(o.settings=rd(!0,o.settings,p.settings))}function d(p){let m=-1;if(p!=null)if(Array.isArray(p))for(;++m<p.length;){const g=p[m];a(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,m){let g=-1,x=-1;for(;++g<s.length;)if(s[g][0]===p){x=g;break}if(x===-1)s.push([p,...m]);else if(m.length>0){let[w,...k]=m;const E=s[x][1];Md(E)&&Md(w)&&(w=rd(!0,E,w)),s[x]=[p,w,...k]}}}}const sP=new mf().freeze();function ld(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ad(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ud(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rg(e){if(!Md(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lg(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Na(e){return oP(e)?e:new I0(e)}function oP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lP(e){return typeof e=="string"||aP(e)}function aP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dg=[],Fg={allowDangerousHtml:!0},cP=/^(https?|ircs?|mailto|xmpp)$/i,dP=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Og(e){const t=fP(e),r=hP(e);return pP(t.runSync(t.parse(r),r),e)}function fP(e){const t=e.rehypePlugins||Dg,r=e.remarkPlugins||Dg,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Fg}:Fg;return sP().use(YI).use(r).use(BT,s).use(t)}function hP(e){const t=e.children||"",r=new I0;return typeof t=="string"&&(r.value=t),r}function pP(e,t){const r=t.allowedElements,s=t.allowElement,o=t.components,a=t.disallowedElements,u=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||mP;for(const m of dP)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+uP+m.id,void 0);return _0(e,p),b2(e,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function p(m,g,x){if(m.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let w;for(w in Jc)if(Object.hasOwn(Jc,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],E=Jc[w];(E===null||E.includes(m.tagName))&&(m.properties[w]=h(String(k||""),w,m))}}if(m.type==="element"){let w=r?!r.includes(m.tagName):a?a.includes(m.tagName):!1;if(!w&&s&&typeof g=="number"&&(w=!s(m,g,x)),w&&x&&typeof g=="number")return d&&m.children?x.children.splice(g,1,...m.children):x.children.splice(g,1),g}}}function mP(e){const t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||cP.test(e.slice(0,t))?e:""}function gP({run:e,onClose:t}){var a,u;const[r,s]=P.useState(!1),o=e.status==="success"?"var(--accent-green, #2ecc71)":e.status==="error"?"var(--accent-red, #e74c3c)":e.status==="running"?"var(--accent-cyan, #00bcd4)":"var(--text-muted, #666)";return c.jsxs("div",{className:"session-run-detail",children:[c.jsxs("div",{className:"session-run-detail-header",children:[c.jsx("div",{className:"session-run-detail-status",style:{background:o}}),c.jsx("h3",{className:"session-run-detail-title",children:e.agent}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),c.jsxs("div",{className:"session-run-detail-grid",children:[c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Phase"}),c.jsx("span",{className:"session-run-detail-value",children:e.phase})]}),c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Pass"}),c.jsx("span",{className:"session-run-detail-value",children:e.passId})]}),c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Model"}),c.jsx("span",{className:"session-run-detail-value",children:e.model})]}),c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Status"}),c.jsx("span",{className:"session-run-detail-value",style:{color:o},children:e.status})]}),c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Duration"}),c.jsx("span",{className:"session-run-detail-value",children:e.elapsedSeconds!=null?`${e.elapsedSeconds.toFixed(1)}s`:"—"})]}),c.jsxs("div",{className:"session-run-detail-field",children:[c.jsx("span",{className:"session-run-detail-label",children:"Iteration"}),c.jsx("span",{className:"session-run-detail-value",children:e.iteration})]})]}),((a=e.artifacts)==null?void 0:a.output)&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsx("h4",{className:"session-run-detail-section-title",children:"Output"}),c.jsx("div",{className:"session-run-artifact",children:c.jsx("div",{className:"session-run-artifact-content",children:c.jsx(Og,{children:e.artifacts.output})})})]}),((u=e.artifacts)==null?void 0:u.prompt)&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsxs("button",{className:"session-run-artifact-toggle",onClick:()=>s(!r),children:[c.jsx("span",{children:r?"▾":"▸"}),c.jsx("span",{children:"System Prompt"})]}),r&&c.jsx("div",{className:"session-run-artifact",children:c.jsx("div",{className:"session-run-artifact-content",children:c.jsx(Og,{children:e.artifacts.prompt})})})]}),e.tokens&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsx("h4",{className:"session-run-detail-section-title",children:"Tokens"}),c.jsxs("div",{className:"session-run-detail-tokens",children:[c.jsxs("div",{className:"session-run-detail-token-bar",children:[c.jsx("span",{className:"session-run-detail-token-label",children:"Input"}),c.jsx("div",{className:"session-run-detail-token-fill",style:{width:`${Math.min(100,e.tokens.input/Math.max(e.tokens.input+e.tokens.output,1)*100)}%`,background:"var(--accent-cyan, #00bcd4)"}}),c.jsx("span",{className:"session-run-detail-token-count",children:e.tokens.input.toLocaleString()})]}),c.jsxs("div",{className:"session-run-detail-token-bar",children:[c.jsx("span",{className:"session-run-detail-token-label",children:"Output"}),c.jsx("div",{className:"session-run-detail-token-fill",style:{width:`${Math.min(100,e.tokens.output/Math.max(e.tokens.input+e.tokens.output,1)*100)}%`,background:"var(--accent-green, #2ecc71)"}}),c.jsx("span",{className:"session-run-detail-token-count",children:e.tokens.output.toLocaleString()})]})]})]}),e.cost&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsx("h4",{className:"session-run-detail-section-title",children:"Cost"}),c.jsxs("span",{className:"session-run-detail-cost",children:["$",e.cost.total.toFixed(4)]})]}),e.toolCalls&&e.toolCalls.length>0&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsxs("h4",{className:"session-run-detail-section-title",children:["Tool Calls (",e.toolCalls.length,")"]}),c.jsx("div",{className:"session-run-detail-tools",children:e.toolCalls.map((d,h)=>c.jsxs("div",{className:"session-run-detail-tool",children:[c.jsx("span",{className:`session-run-detail-tool-status ${d.success?"success":"error"}`,children:d.success?"✓":"✗"}),c.jsx("span",{className:"session-run-detail-tool-name",children:d.name}),c.jsxs("span",{className:"session-run-detail-tool-duration",children:[d.durationMs,"ms"]})]},h))})]}),e.error&&c.jsxs("div",{className:"session-run-detail-section",children:[c.jsx("h4",{className:"session-run-detail-section-title session-run-detail-error-title",children:"Error"}),c.jsx("pre",{className:"session-run-detail-error",children:e.error})]}),c.jsxs("div",{className:"session-run-detail-timestamps",children:[c.jsxs("span",{children:["Started: ",new Date(e.startedAt).toLocaleTimeString()]}),e.completedAt&&c.jsxs("span",{children:["Completed: ",new Date(e.completedAt).toLocaleTimeString()]})]})]})}const yP=50,$g={user:"User",assistant:"Response",thinking:"Thinking",tool_use:"Tool Use",tool_result:"Tool Result",system:"System"};function xP({events:e,runs:t}){const[r,s]=P.useState("all"),[o,a]=P.useState(new Set(["user","assistant","tool_use","tool_result","system"])),[u,d]=P.useState(1),[h,p]=P.useState(new Set),m=P.useMemo(()=>{const C=[{id:"all",label:"All agents"}];for(const N of t){const I=N.agentType==="orchestrator"?void 0:N.passId.replace("agent-","");C.push({id:I||"orchestrator",label:N.agent})}return C},[t]),g=P.useMemo(()=>e.filter(C=>o.has(C.type)?r==="all"?!0:r==="orchestrator"?!C.agentId:C.agentId===r:!1),[e,r,o]),x=g.slice(0,u*yP),w=x.length<g.length,k=C=>{a(N=>{const I=new Set(N);return I.has(C)?I.delete(C):I.add(C),I}),d(1)},E=C=>{p(N=>{const I=new Set(N);return I.has(C)?I.delete(C):I.add(C),I})},b=C=>{if(!C)return"";try{return new Date(C).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return C}},S=C=>{if(!C)return"transcript-badge-orchestrator";const N=t.find(B=>B.passId===`agent-${C}`);return`transcript-badge-${(N==null?void 0:N.agentType)||"general"}`};return c.jsxs("div",{className:"session-transcript",children:[c.jsxs("div",{className:"session-transcript-filters",children:[c.jsx("select",{className:"session-transcript-agent-select",value:r,onChange:C=>{s(C.target.value),d(1)},children:m.map(C=>c.jsx("option",{value:C.id,children:C.label},C.id))}),c.jsx("div",{className:"session-transcript-type-toggles",children:Object.entries($g).map(([C,N])=>c.jsx("button",{className:`session-transcript-type-btn session-transcript-type-${C} ${o.has(C)?"active":""}`,onClick:()=>k(C),children:N},C))})]}),c.jsxs("div",{className:"session-transcript-count",children:[g.length," events",r!=="all"?" (filtered)":""]}),c.jsx("div",{className:"session-transcript-events",children:x.map((C,N)=>{const I=h.has(N),B=C.type==="thinking"||C.type==="tool_use"||C.type==="tool_result";return c.jsxs("div",{className:`session-transcript-event session-transcript-event-${C.type}`,onClick:B?()=>E(N):void 0,children:[c.jsxs("div",{className:"session-transcript-event-meta",children:[c.jsx("span",{className:"session-transcript-time",children:b(C.timestamp)}),C.agentId?c.jsx("span",{className:`session-transcript-badge ${S(C.agentId)}`,children:C.agentSlug||C.agentId}):c.jsx("span",{className:"session-transcript-badge transcript-badge-orchestrator",children:"orchestrator"}),c.jsx("span",{className:`session-transcript-type-label session-transcript-type-${C.type}`,children:$g[C.type]||C.type}),C.toolName&&c.jsx("span",{className:"session-transcript-tool-badge",children:C.toolName}),B&&c.jsx("span",{className:"session-transcript-expand",children:I?"▼":"▶"})]}),C.type==="user"&&C.text&&c.jsx("div",{className:"session-transcript-text",children:C.text}),C.type==="assistant"&&C.text&&c.jsx("div",{className:"session-transcript-text",children:C.text}),C.type==="thinking"&&c.jsx("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:C.text}),C.type==="tool_use"&&c.jsx("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:C.toolInput}),C.type==="tool_result"&&c.jsxs("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:[c.jsx("span",{className:C.toolSuccess===!1?"session-transcript-error":"session-transcript-success",children:C.toolSuccess===!1?"ERROR: ":""}),C.toolResult]}),C.type==="system"&&C.text&&c.jsx("div",{className:"session-transcript-text session-transcript-system-text",children:C.text})]},N)})}),w&&c.jsxs("button",{className:"session-transcript-load-more",onClick:()=>d(C=>C+1),children:["Load more (",g.length-x.length," remaining)"]})]})}function vP({files:e,onClose:t}){const r=P.useMemo(()=>{const o=new Set;return e.filter(a=>o.has(a.path)?!1:(o.add(a.path),!0))},[e]),s=o=>{try{return new Date(o).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return o}};return c.jsxs("div",{className:"session-payload",children:[c.jsxs("div",{className:"session-payload-header",children:[c.jsxs("span",{children:["Files sent to cloud (",e.length," reads, ",r.length," unique)"]}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),c.jsx("div",{className:"session-payload-table",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Path"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Agent"})]})}),c.jsx("tbody",{children:e.map((o,a)=>c.jsxs("tr",{children:[c.jsx("td",{className:"session-payload-path",title:o.path,children:o.path.length>60?"..."+o.path.slice(-57):o.path}),c.jsx("td",{className:"session-payload-time",children:s(o.timestamp)}),c.jsx("td",{className:"session-payload-agent",children:o.agentId||"orchestrator"})]},a))})]})})]})}const wP=400,Bg=680,SP=300,kP=.85,NP=.95,EP=.95,Hg="";function bP({visible:e,onClose:t}){const[r,s]=P.useState(null),[o,a]=P.useState(null),[u,d]=P.useState(null),[h,p]=P.useState(null),[m,g]=P.useState("transcript"),[x,w]=P.useState(!1),[k,E]=P.useState("all"),[b,S]=P.useState(!1),[C,N]=P.useState(!1),[I,B]=P.useState(Bg),[T,D]=P.useState(null),G=P.useRef(!1),U=P.useRef(0),q=P.useRef(0),F=P.useRef(Bg),W=P.useRef(0),J=P.useRef(null),z=P.useCallback((re,ce)=>{ce.preventDefault(),ce.stopPropagation(),G.current=re,U.current=ce.clientX,q.current=ce.clientY,F.current=I,W.current=T??window.innerHeight*kP;const he={left:"ew-resize",bottom:"ns-resize",corner:"nesw-resize"};document.body.style.cursor=he[re],document.body.style.userSelect="none";const se=be=>{if(!G.current)return;const Pe=window.innerWidth*NP,Ee=window.innerHeight*EP;if(G.current==="left"||G.current==="corner"){const ke=U.current-be.clientX;B(Math.min(Pe,Math.max(wP,F.current+ke)))}if(G.current==="bottom"||G.current==="corner"){const ke=be.clientY-q.current;D(Math.min(Ee,Math.max(SP,W.current+ke)))}},ge=()=>{G.current=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",ge)};document.addEventListener("mousemove",se),document.addEventListener("mouseup",ge)},[I,T]),O=P.useCallback(async()=>{try{const re=await fetch(`${Hg}/api/sessions`);if(re.ok){const ce=await re.json();s(ce),!o&&ce.sessions.length>0&&a(ce.sessions[0].sessionId)}}catch{}},[o]),$=P.useCallback(async re=>{S(!0),p(null),w(!1);try{const ce=await fetch(`${Hg}/api/sessions/${encodeURIComponent(re)}`);if(ce.ok){const he=await ce.json();d(he);const se=he.transcript&&he.transcript.length>0,ge=he.runs&&he.runs.length>0;J.current?(g(J.current),J.current=null):he.source==="claude-transcript"&&se?g("transcript"):ge&&g("runs")}}catch{}finally{S(!1)}},[]);if(P.useEffect(()=>{e&&O()},[e,O]),P.useEffect(()=>{o&&$(o)},[o,$]),P.useEffect(()=>(window.__sessionsRefresh=O,()=>{delete window.__sessionsRefresh}),[O]),!e)return null;const Q=re=>new Date(re).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),M=re=>{switch(re){case"success":return"✓";case"error":return"✗";case"running":return"○";case"partial":return"◑";default:return"—"}},V=re=>{switch(re){case"implementation":return"🛠";case"exploration":return"🔍";case"conversation":return"💬";default:return""}},j=(r==null?void 0:r.sessions.filter(re=>k==="all"||re.category===k||!re.category&&k==="other"))??[],R=((r==null?void 0:r.sessions)??[]).reduce((re,ce)=>{const he=ce.category||"other";return re[he]=(re[he]||0)+1,re},{}),Y=(u==null?void 0:u.transcript)&&u.transcript.length>0,A=(u==null?void 0:u.runs)&&u.runs.length>0,ae=C?{width:"calc(100vw - 32px)"}:{width:`${I}px`,...T!=null?{maxHeight:`${T}px`}:{},transition:G.current?"none":void 0};return c.jsxs(xi,{className:"sessions-panel",style:ae,children:[c.jsx("div",{className:"sessions-resize-handle sessions-resize-left",onMouseDown:re=>z("left",re)}),c.jsx("div",{className:"sessions-resize-handle sessions-resize-bottom",onMouseDown:re=>z("bottom",re)}),c.jsx("div",{className:"sessions-resize-handle sessions-resize-corner",onMouseDown:re=>z("corner",re)}),c.jsxs("div",{className:"sessions-header","data-drag-handle":!0,children:[c.jsx("span",{className:"sessions-title",children:"Sessions"}),c.jsxs("div",{className:"sessions-header-actions",children:[c.jsx("button",{className:"sessions-expand-btn",onClick:()=>N(!C),title:C?"Collapse":"Expand",children:C?"➖":"➕"}),c.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),c.jsxs("div",{className:"sessions-tabs",children:[c.jsx("button",{className:`sessions-tab ${m==="transcript"?"active":""}`,onClick:()=>g("transcript"),disabled:!Y&&!b,children:"Transcript"}),c.jsx("button",{className:`sessions-tab ${m==="runs"?"active":""}`,onClick:()=>g("runs"),disabled:!A&&!b,children:"Runs"})]}),c.jsxs("div",{className:"sessions-category-filter",children:[c.jsxs("button",{className:`sessions-category-btn ${k==="all"?"active":""}`,onClick:()=>E("all"),children:["All (",(r==null?void 0:r.sessions.length)??0,")"]}),R.implementation&&c.jsxs("button",{className:`sessions-category-btn sessions-cat-implementation ${k==="implementation"?"active":""}`,onClick:()=>E("implementation"),children:["🛠"," Build (",R.implementation,")"]}),R.exploration&&c.jsxs("button",{className:`sessions-category-btn sessions-cat-exploration ${k==="exploration"?"active":""}`,onClick:()=>E("exploration"),children:["🔍"," Explore (",R.exploration,")"]}),R.conversation&&c.jsxs("button",{className:`sessions-category-btn sessions-cat-conversation ${k==="conversation"?"active":""}`,onClick:()=>E("conversation"),children:["💬"," Chat (",R.conversation,")"]}),R.other&&c.jsxs("button",{className:`sessions-category-btn ${k==="other"?"active":""}`,onClick:()=>E("other"),children:["Other (",R.other,")"]})]}),c.jsx("div",{className:"sessions-selector",children:c.jsx("select",{className:"sessions-select",value:o??"",onChange:re=>a(re.target.value||null),children:j.length===0?c.jsx("option",{value:"",children:"No sessions found"}):j.map(re=>c.jsxs("option",{value:re.sessionId,children:[M(re.status)," ",V(re.category)," ",Q(re.startedAt),re.label?` — ${re.label}`:` — ${re.runCount} runs`," (",re.source,")"]},re.sessionId))})}),u&&!b&&c.jsxs("div",{className:"sessions-summary",children:[c.jsxs("div",{className:"sessions-summary-item",children:[c.jsx("span",{className:"sessions-summary-value",children:u.summary.totalRuns}),c.jsx("span",{className:"sessions-summary-label",children:"runs"})]}),c.jsxs("div",{className:"sessions-summary-item",children:[c.jsxs("span",{className:"sessions-summary-value",children:[u.summary.totalElapsedSeconds.toFixed(1),"s"]}),c.jsx("span",{className:"sessions-summary-label",children:"elapsed"})]}),c.jsxs("div",{className:"sessions-summary-item",children:[c.jsxs("span",{className:"sessions-summary-value",children:[((u.summary.totalTokens.input+u.summary.totalTokens.output)/1e3).toFixed(1),"k"]}),c.jsx("span",{className:"sessions-summary-label",children:"tokens"})]}),u.cloudStats&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"sessions-summary-item",children:[c.jsxs("span",{className:"sessions-summary-value sessions-summary-cost",children:["$",u.cloudStats.estimatedCost.total.toFixed(2)]}),c.jsx("span",{className:"sessions-summary-label",children:"cost"})]}),c.jsxs("div",{className:"sessions-summary-item",children:[c.jsx("span",{className:"sessions-summary-value",children:u.cloudStats.apiCalls}),c.jsx("span",{className:"sessions-summary-label",children:"api calls"})]}),u.payload&&u.payload.length>0&&c.jsx("div",{className:"sessions-summary-item",children:c.jsxs("button",{className:"sessions-payload-btn",onClick:()=>w(!x),children:[u.payload.length," files sent"]})})]}),c.jsx("div",{className:`sessions-status sessions-status-${u.status}`,children:u.status})]}),x&&(u==null?void 0:u.payload)&&c.jsx(vP,{files:u.payload,onClose:()=>w(!1)}),m==="transcript"&&c.jsxs("div",{className:"sessions-content",children:[b&&c.jsx("div",{className:"sessions-loading",children:"Loading transcript..."}),!b&&Y&&c.jsx(xP,{events:u.transcript,runs:u.runs}),!b&&!Y&&c.jsx("div",{className:"sessions-empty",children:"No transcript available for this session"})]}),m==="runs"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"sessions-content",children:[b&&c.jsx("div",{className:"sessions-loading",children:"Loading session..."}),!b&&!u&&c.jsxs("div",{className:"sessions-empty",children:["Run ",c.jsx("code",{children:"archbyte analyze"})," to create your first session"]}),!b&&u&&c.jsx(Kj,{session:u,onSelectRun:p,selectedRunId:h==null?void 0:h.runId})]}),h&&c.jsx(gP,{run:h,onClose:()=>p(null)})]})]})}function Ls(e,t){return!e||e.length===0?!0:e.includes(t)}const CP=1500,jP={architecture:qx};function _P(e,t){const u=["presentation","application","data","external","deployment"],d={};e.forEach(m=>{const g=m.layer||"application";d[g]||(d[g]=[]),d[g].push(m)});const h=new Map;let p=100;return u.forEach(m=>{const g=d[m]||[];g.forEach((x,w)=>{h.set(x.id,{x:100+w*250,y:p})}),g.length>0&&(p+=180)}),Object.entries(d).forEach(([m,g])=>{u.includes(m)||(g.forEach((x,w)=>{h.set(x.id,{x:100+w*250,y:p})}),p+=180)}),e.map(m=>{const g=m.userPositioned?{x:m.x,y:m.y}:h.get(m.id)||{x:100,y:100};return{id:m.id,type:"architecture",position:g,data:{label:m.label,layer:m.layer,nodeType:m.type,width:m.width,height:m.height,path:m.path,techStack:m.techStack,description:m.description},style:{width:m.width,zIndex:1}}})}function Vg(e,t="#64748b"){return e.map(r=>({id:r.id,source:r.source,target:r.target,label:void 0,labelStyle:void 0,labelBgStyle:void 0,labelBgPadding:[4,3],style:{stroke:r.color||t,strokeWidth:2,...r.style==="dashed"&&{strokeDasharray:"8 4"}},animated:r.animated||!1,type:"smoothstep",markerEnd:{type:Zo.ArrowClosed,width:16,height:16,color:r.color||t}}))}function Ds({title:e,defaultOpen:t,children:r}){const[s,o]=P.useState(t??!1);return c.jsxs("div",{className:`dd-section ${s?"open":""}`,children:[c.jsxs("button",{className:"dd-section-header",onClick:()=>o(!s),children:[c.jsx("span",{className:"dd-section-chevron",children:s?"▾":"▸"}),c.jsx("span",{className:"dd-section-title",children:e})]}),s&&c.jsx("div",{className:"dd-section-content",children:r})]})}function T0(e,t,r=0){return e.slice(0,50).map((s,o)=>{const a=s.path.replace(t+"/","").split("/").pop()||s.path,u=r*12;return s.type==="directory"?c.jsxs("div",{children:[c.jsxs("div",{className:"dd-tree-entry dir",style:{paddingLeft:u},children:[c.jsx("span",{className:"dd-tree-icon",children:"📁"})," ",a,"/"]}),s.children&&T0(s.children,t,r+1)]},o):c.jsxs("div",{className:"dd-tree-entry file",style:{paddingLeft:u},children:[c.jsx("span",{className:"dd-tree-icon",children:"📄"})," ",a]},o)})}function IP(){var Vn;const[e,t,r]=Vb([]),[s,o,a]=Ub([]),[u,d]=P.useState(null),[h,p]=P.useState(!1),[m,g]=P.useState(null),[x]=P.useState([]),[w,k]=P.useState(!0),[E,b]=P.useState(null),[S,C]=P.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!0,workflows:!1,chat:!1,premiumAgents:!1}}),[N,I]=P.useState(!1),[B,T]=P.useState(null),[D,G]=P.useState(!1),[U,q]=P.useState(null),[F,W]=P.useState(!1),[J,z]=P.useState(null),[,O]=P.useState(null),[$,Q]=P.useState(null),[M,V]=P.useState(null),[j,R]=P.useState(-1),[Y,A]=P.useState(!1),[ae,re]=P.useState(new Set),[ce,he]=P.useState(!1),[se,ge]=P.useState(new Set),[be,Pe]=P.useState(new Set),[Ee,ke]=P.useState(null),[Ve,We]=P.useState("layer"),[Oe,tt]=P.useState(!1),[It,Ct]=P.useState(!1),[gt,Tt]=P.useState(!1),[Ht,pn]=P.useState(!1),[mn,Jt]=P.useState(!1),[oe,ye]=P.useState([]),[me,$e]=P.useState(null),[Be,ht]=P.useState(!1),[gn,Pt]=P.useState(!1),[yt,_n]=P.useState("develop"),[,pt]=P.useState([]),[en,At]=P.useState(),[$r,Br]=P.useState(null),[Vt,tr]=P.useState(null),[Fn,yn]=P.useState(new Map),[Hr,Si]=P.useState(!1),On=P.useRef([]),[wr,ts]=P.useState([]),Sr=50,[,kr]=P.useState([]),[,$n]=P.useState([]),[Vr,Ur]=P.useState(new Set),[Dt,Nr]=P.useState(new Set),[St,Qs]=P.useState(()=>{const H=localStorage.getItem("archbyte-theme");return H==="dark"||H==="light"?H:"light"});P.useEffect(()=>{document.documentElement.setAttribute("data-theme",St),localStorage.setItem("archbyte-theme",St)},[St]);const[xn]=P.useState(()=>!!window.__ARCHBYTE_DATA__),[ns,Ft]=P.useState(!1),[ki,Bn]=P.useState(!1),[xt,Ni]=P.useState(null),nr=St==="dark"?"#64748b":"#94a3b8",Ei="#fff",bi=20,In=10,rr=P.useCallback(async()=>{const H=window.__ARCHBYTE_DATA__;if(H){Wr(H),C({loggedIn:!0,email:null,tier:"premium",features:{analyze:!0,validate:!0,workflows:!0,chat:!0,premiumAgents:!0}}),I(!0),p(!0),k(!1);return}try{await tn()}catch(Z){console.error("Failed to load architecture:",Z),b("Failed to connect to server"),Ot()}finally{k(!1)}},[]),st=async()=>{try{const H=await fetch("/api/tools-git");if(H.ok){const Z=await H.json();tr(Z)}}catch{}},Zs=async()=>{try{const H=await fetch("/api/config");if(H.ok){const Z=await H.json();if(O(Z),Z.environments){At(Z.environments);const ie=Object.keys(Z.environments);ie.length>0&&!ie.includes(yt)&&_n(ie[0])}}}catch{}},Ci=async()=>{try{const H=await fetch("/api/license");if(H.ok){const Z=await H.json();C(Z),I(!0)}}catch{I(!0)}},ji=async()=>{try{const H=await fetch("/api/project");if(H.ok){const Z=await H.json();Z&&Q(Z)}}catch{}},Er=async()=>{try{const H=await fetch("/api/analysis-status");if(H.ok){const Z=await H.json();(Z==null?void 0:Z.status)==="error"&&Z.error?q(Z.error):q(null)}}catch{}},Js=async()=>{try{const H=await fetch("/api/changes/pending");if(H.ok){const Z=await H.json();Z.count>0&&z({count:Z.count,files:Z.files||[],componentChanges:Z.componentChanges||[],unmapped:Z.unmapped||[]})}}catch{}},rs=P.useCallback(async()=>{Lt("quick-scan");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"static"})})}catch(H){console.error("Failed to start quick re-analysis:",H)}},[]),br=P.useCallback(async()=>{Lt("re-analyze");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"llm"})})}catch(H){console.error("Failed to start full re-analysis:",H)}},[]),tn=async()=>{const H="/events",Z="/api/architecture";st(),Zs(),ji(),Ci(),Er(),Js();try{const ie=new EventSource(H);return ie.onopen=()=>{console.log("SSE connected"),p(!0),b(null)},ie.onmessage=ue=>{try{const le=JSON.parse(ue.data);if(console.log("SSE message:",le.type),le.architecture&&Wr(le.architecture),le.type==="git_update"&&le.gitInfo&&pt(le.gitInfo),le.type==="premium_agent_result"&&le.premiumResults&&ye(le.premiumResults),le.type==="changes:detected"&&z({count:le.count,files:le.files||[],componentChanges:le.componentChanges||[],unmapped:le.unmapped||[]}),le.type==="changes:cleared"&&z(null),le.type==="analyzing:started"&&(W(!0),z(null)),le.type==="session:update"){const we=window.__sessionsRefresh;we&&we()}le.type==="analyzing:finished"&&(W(!1),le.success===!1&&le.error?q(le.error):(q(null),ji(),Er()))}catch(le){console.error("Failed to parse SSE message:",le)}},ie.onerror=ue=>{console.error("SSE error:",ue),ie.close(),p(!1),is(Z)},()=>ie.close()}catch{is(Z)}},is=async H=>{try{const Z=await fetch(H);if(Z.ok){const ie=await Z.json();Wr(ie),p(!0)}else Ot()}catch{Ot()}},Ot=()=>{const H={nodes:[{id:"frontend",type:"component",label:`Frontend
|
|
79
|
+
(Web App)`,layer:"presentation",x:150,y:170,width:200,height:100,color:"#d0ebff"},{id:"backend",type:"service",label:`Backend
|
|
80
|
+
(API)`,layer:"application",x:150,y:370,width:200,height:100,color:"#ffe8cc"},{id:"database",type:"database",label:"Database",layer:"data",x:150,y:570,width:200,height:80,color:"#b2f2bb"}],edges:[{id:"e1",source:"frontend",target:"backend",color:"#1971c2"},{id:"e2",source:"backend",target:"database",color:"#2f9e44"}],flows:[],lastUpdated:new Date().toISOString(),version:1};Wr(H)},Wr=H=>{d(H),g(H.lastUpdated),H.gitInfo&&pt(H.gitInfo),H.environments&&At(H.environments)};P.useEffect(()=>{if(!u)return;const H=u.nodes.filter(le=>Ls(le.environments,yt)&&!se.has(le.id)&&!be.has(le.layer)),Z=new Set(H.map(le=>le.id)),ie=u.edges.filter(le=>Ls(le.environments,yt)&&Z.has(le.source)&&Z.has(le.target)),ue=_P(H);t(ue),o(Vg(ie,nr))},[u,yt,se,be,nr]),P.useEffect(()=>{var Z;if(!((Z=J==null?void 0:J.componentChanges)!=null&&Z.length))return;const H=new Map;for(const ie of J.componentChanges)H.set(ie.componentId,ie.files);t(ie=>ie.map(ue=>{const le=H.get(ue.id);return le?{...ue,data:{...ue.data,pendingFiles:le}}:ue.data.pendingFiles?{...ue,data:{...ue.data,pendingFiles:null}}:ue}))},[J,t]),P.useEffect(()=>{rr()},[rr]),P.useEffect(()=>{if(!Y||!M)return;const H=setInterval(()=>{R(Z=>{const ie=Z+1;if(ie>=M.steps.length)return re(new Set([M.steps[0].edge])),0;const ue=new Set;for(let le=0;le<=ie;le++)ue.add(M.steps[le].edge);return re(ue),ie})},CP);return()=>clearInterval(H)},[Y,M]),P.useEffect(()=>{if(!u)return;const H=u.nodes.filter(we=>Ls(we.environments,yt)),Z=new Set(H.map(we=>we.id)),ie=u.edges.filter(we=>Ls(we.environments,yt)&&Z.has(we.source)&&Z.has(we.target)),ue=new Map;M&&M.steps.forEach((we,Ae)=>{ue.has(we.edge)||ue.set(we.edge,Ae+1)});const le=ie.map(we=>{const Ae=ae.has(we.id),_e=M==null?void 0:M.steps.some(Ye=>Ye.edge===we.id),Me=ue.get(we.id);return{id:we.id,source:we.source,target:we.target,label:Ae&&Me?`${Me}`:void 0,labelStyle:Ae&&Me?{fill:Ei,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:Ae&&Me?{fill:(M==null?void 0:M.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:Ae?(M==null?void 0:M.color)||we.color:we.color||nr,strokeWidth:Ae?6:3,opacity:M?_e?1:.15:1,filter:Ae?"brightness(0.85) saturate(1.4)":void 0},animated:Ae,type:"smoothstep"}});o(le)},[ae,M,u,yt,nr,Ei]);const ss=H=>{Lt("flow-select",H.name),V(H),R(0),re(new Set([H.steps[0].edge])),A(!0),he(!0)},ir=()=>{if(A(!1),V(null),R(-1),re(new Set),he(!1),u){const H=u.nodes.filter(ue=>Ls(ue.environments,yt)),Z=new Set(H.map(ue=>ue.id)),ie=u.edges.filter(ue=>Ls(ue.environments,yt)&&Z.has(ue.source)&&Z.has(ue.target));o(Vg(ie,nr))}},Yr=()=>{A(!1)},Xr=()=>{M&&A(!0)},Gt=P.useRef(se);P.useEffect(()=>{Gt.current=se},[se]);const et=P.useCallback(()=>{kr(H=>{const Z={nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)},ie=[...H,Z];return ie.length>Sr&&ie.shift(),ie}),$n([])},[s]),qr=P.useCallback(H=>{Br(H),setTimeout(()=>Br(null),3e3)},[]),eo=P.useCallback(()=>{ge(new Set)},[]);P.useCallback(H=>{Pe(Z=>{const ie=new Set(Z);return ie.has(H)?ie.delete(H):ie.add(H),ie})},[]);const _i=P.useCallback((H,Z)=>{if(!u)return;const ie=u.nodes.find(ue=>ue.id===Z.id);ie&&(Lt("node-click",`${ie.id} (${ie.label})`),Ni(ie),Bn(!0))},[u]),Gr=P.useCallback(()=>{Lt("pane-click"),ke(null)},[]);P.useEffect(()=>{On.current=e},[e]);const Ii=P.useCallback(H=>{r(H);const Z=H.some(ue=>ue.type==="position"&&ue.dragging===!1&&ue.position),ie=H.some(ue=>ue.type==="dimensions"&&ue.dimensions&&ue.resizing===!1);(Z||ie)&&et(),H.forEach(ue=>{if(ue.type==="position"&&ue.dragging===!1&&ue.position){const le=On.current.find(we=>we.id===ue.id);le&&yn(we=>{var Me,Ye,Qe,vt;const Ae=new Map(we),_e=Ae.get(ue.id);return Ae.set(ue.id,{id:ue.id,x:ue.position.x,y:ue.position.y,width:(_e==null?void 0:_e.width)??((Me=le.style)==null?void 0:Me.width)??((Ye=le.data)==null?void 0:Ye.width)??100,height:(_e==null?void 0:_e.height)??((Qe=le.style)==null?void 0:Qe.height)??((vt=le.data)==null?void 0:vt.height)??60}),Ae})}if(ue.type==="dimensions"&&ue.dimensions&&ue.resizing===!1){const le=On.current.find(we=>we.id===ue.id);le&&yn(we=>{const Ae=new Map(we),_e=Ae.get(ue.id);return Ae.set(ue.id,{id:ue.id,x:(_e==null?void 0:_e.x)??le.position.x,y:(_e==null?void 0:_e.y)??le.position.y,width:ue.dimensions.width,height:ue.dimensions.height}),Ae})}})},[r,et]),Hn=P.useCallback(async()=>{if(Fn.size!==0){Lt("save-positions"),Si(!0);try{const H=Array.from(Fn.values()),Z=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:H})});if(Z.ok)yn(new Map),console.log("Changes saved successfully");else{const ie=await Z.json();console.error("Failed to save changes:",ie)}}catch(H){console.error("Error saving changes:",H)}finally{Si(!1)}}},[Fn]),os=P.useCallback(()=>{yn(new Map),rr()},[rr]),ls=P.useCallback(()=>{kr(H=>{if(H.length===0)return H;const Z=[...H],ie=Z.pop();if($n(ue=>[...ue,{nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)}]),t(ie.nodes),o(ie.edges),ge(ie.hiddenNodeIds),u){const ue=new Map;ie.nodes.forEach(le=>{var Ae,_e,Me,Ye;const we=u.nodes.find(Qe=>Qe.id===le.id);if(we){const Qe=le.position.x,vt=le.position.y,Xe=((Ae=le.style)==null?void 0:Ae.width)??((_e=le.data)==null?void 0:_e.width)??100,kt=((Me=le.style)==null?void 0:Me.height)??((Ye=le.data)==null?void 0:Ye.height)??60;(Qe!==we.x||vt!==we.y||Xe!==we.width||kt!==we.height)&&ue.set(le.id,{id:le.id,x:Qe,y:vt,width:Xe,height:kt})}}),yn(ue)}return Z})},[s,t,o,u]),Ke=P.useCallback(()=>{$n(H=>{if(H.length===0)return H;const Z=[...H],ie=Z.pop();if(kr(ue=>[...ue,{nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)}]),t(ie.nodes),o(ie.edges),ge(ie.hiddenNodeIds),u){const ue=new Map;ie.nodes.forEach(le=>{var Ae,_e,Me,Ye;const we=u.nodes.find(Qe=>Qe.id===le.id);if(we){const Qe=le.position.x,vt=le.position.y,Xe=((Ae=le.style)==null?void 0:Ae.width)??((_e=le.data)==null?void 0:_e.width)??100,kt=((Me=le.style)==null?void 0:Me.height)??((Ye=le.data)==null?void 0:Ye.height)??60;(Qe!==we.x||vt!==we.y||Xe!==we.width||kt!==we.height)&&ue.set(le.id,{id:le.id,x:Qe,y:vt,width:Xe,height:kt})}}),yn(ue)}return Z})},[s,t,o,u]),hl=P.useCallback(({nodes:H})=>{Nr(new Set(H.map(Z=>Z.id))),H.length===1?ke(H[0].id):H.length===0&&ke(null)},[]),to=P.useCallback(()=>{if(Dt.size===0&&!Ee)return;et();const H=Dt.size>0?Dt:new Set([Ee]);ge(Z=>new Set([...Z,...H])),Nr(new Set),ke(null)},[Dt,Ee,et]),as=P.useCallback(()=>{const H=Dt.size>0?Dt:Ee?new Set([Ee]):new Set;if(H.size===0)return;const Z=e.filter(ie=>H.has(ie.id));ts(Z)},[e,Dt,Ee]),no=P.useCallback(()=>{if(wr.length===0)return;et();const H=50,Z=wr.map((ie,ue)=>{var le;return{...ie,id:`${ie.id}-copy-${Date.now()}-${ue}`,position:{x:ie.position.x+H,y:ie.position.y+H},selected:!0,data:{...ie.data,label:`${((le=ie.data)==null?void 0:le.label)||ie.id} (copy)`}}});t(ie=>[...ie.map(ue=>({...ue,selected:!1})),...Z]),Z.forEach(ie=>{yn(ue=>{var we,Ae,_e,Me;const le=new Map(ue);return le.set(ie.id,{id:ie.id,x:ie.position.x,y:ie.position.y,width:((we=ie.style)==null?void 0:we.width)||((Ae=ie.data)==null?void 0:Ae.width)||100,height:((_e=ie.style)==null?void 0:_e.height)||((Me=ie.data)==null?void 0:Me.height)||60}),le})})},[wr,t,et]),Kr=P.useCallback((H,Z)=>{const ie=Dt.size>0?Dt:Ee?new Set([Ee]):new Set;ie.size!==0&&(et(),t(ue=>ue.map(le=>{if(ie.has(le.id)&&!Vr.has(le.id)){const we={x:le.position.x+H,y:le.position.y+Z};return yn(Ae=>{var Me,Ye,Qe,vt;const _e=new Map(Ae);return _e.set(le.id,{id:le.id,x:we.x,y:we.y,width:((Me=le.style)==null?void 0:Me.width)||((Ye=le.data)==null?void 0:Ye.width)||100,height:((Qe=le.style)==null?void 0:Qe.height)||((vt=le.data)==null?void 0:vt.height)||60}),_e}),{...le,position:we}}return le})))},[Dt,Ee,Vr,t,et]),pl=P.useCallback(H=>{const Z={id:`edge-${H.source}-${H.target}-${Date.now()}`,source:H.source,target:H.target,type:"smoothstep",animated:!0,style:{stroke:St==="dark"?"#868e96":"#6b7280",strokeWidth:2}};o(ie=>$y(Z,ie))},[o,St]),ro=P.useCallback((H,Z)=>{et(),o(ie=>lN(H,Z,ie))},[o,et]),us=P.useCallback(async()=>{Lt("export","png");const H=document.querySelector(".react-flow");if(H){Ft(!0);try{const Z=await aj(H,{backgroundColor:St==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),ie=document.createElement("a");ie.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,ie.href=Z,ie.click()}catch(Z){console.error("Failed to export PNG:",Z)}finally{Ft(!1)}}},[St]),sr=P.useCallback(async()=>{Lt("export","svg");const H=document.querySelector(".react-flow");if(H){Ft(!0);try{const Z=await Xx(H,{backgroundColor:St==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),ie=document.createElement("a");ie.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,ie.href=Z,ie.click()}catch(Z){console.error("Failed to export SVG:",Z)}finally{Ft(!1)}}},[St]),Kt=P.useCallback(async H=>{Lt("export",H),Ft(!0);try{const Z=await fetch(`/api/export?format=${H}`);if(!Z.ok)throw new Error("Export failed");const ie=await Z.blob(),ue=H==="mermaid"?"mmd":H==="plantuml"?"puml":H==="markdown"?"md":H,le=document.createElement("a");le.download=`architecture.${ue}`,le.href=URL.createObjectURL(ie),le.click(),URL.revokeObjectURL(le.href)}catch(Z){console.error(`Failed to export ${H}:`,Z)}finally{Ft(!1)}},[]);P.useCallback(()=>{if(!u)return;et();const H=250,Z=100,ie=100,ue=e.map((le,we)=>({...le,position:{x:Z+we*H,y:ie}}));t(ue),We("horizontal")},[u,e,t,et]),P.useCallback(()=>{if(!u)return;et();const H=150,Z=100,ie=100,ue=e.map((le,we)=>({...le,position:{x:Z,y:ie+we*H}}));t(ue),We("vertical")},[u,e,t,et]),P.useCallback(()=>{if(!u)return;et();const H=280,Z=180,ie=100,ue=100,le=Math.ceil(Math.sqrt(e.length)),we=e.map((Ae,_e)=>({...Ae,position:{x:ie+_e%le*H,y:ue+Math.floor(_e/le)*Z}}));t(we),We("grid")},[u,e,t,et]),P.useCallback(()=>{if(!u)return;et();const H=320,Z=160,ie=100,ue=100,le=new Set(e.map(Xe=>Xe.id)),we=new Map,Ae=new Map;le.forEach(Xe=>{we.set(Xe,0),Ae.set(Xe,[])}),s.forEach(Xe=>{le.has(Xe.source)&&le.has(Xe.target)&&(Ae.get(Xe.source).push(Xe.target),we.set(Xe.target,(we.get(Xe.target)||0)+1))});const _e=new Map,Me=[];for(we.forEach((Xe,kt)=>{Xe===0&&(Me.push(kt),_e.set(kt,0))});Me.length>0;){const Xe=Me.shift(),kt=_e.get(Xe);for(const Tn of Ae.get(Xe)||[]){const jr=kt+1;(!_e.has(Tn)||_e.get(Tn)<jr)&&_e.set(Tn,jr),we.set(Tn,we.get(Tn)-1),we.get(Tn)===0&&Me.push(Tn)}}e.forEach(Xe=>{_e.has(Xe.id)||_e.set(Xe.id,0)});const Ye=new Map;e.forEach(Xe=>{const kt=_e.get(Xe.id);Ye.has(kt)||Ye.set(kt,[]),Ye.get(kt).push(Xe)});const Qe=[];[...Ye.keys()].sort((Xe,kt)=>Xe-kt).forEach((Xe,kt)=>{Ye.get(Xe).forEach((jr,io)=>{Qe.push({...jr,position:{x:ie+kt*H,y:ue+io*Z}})})}),t(Qe),We("flow")},[u,e,s,t,et]),P.useCallback(()=>{if(!u)return;et();const H=250,Z=180,ie=100,ue=100,le={};e.forEach(Me=>{var Qe;const Ye=((Qe=Me.data)==null?void 0:Qe.layer)||"application";le[Ye]||(le[Ye]=[]),le[Ye].push(Me)});const we=["presentation","application","data","external","deployment"];let Ae=ue;const _e=[];we.forEach(Me=>{const Ye=le[Me]||[];Ye.forEach((Qe,vt)=>{_e.push({...Qe,position:{x:ie+vt*H,y:Ae}})}),Ye.length>0&&(Ae+=Z)}),Object.entries(le).forEach(([Me,Ye])=>{we.includes(Me)||(Ye.forEach((Qe,vt)=>{_e.push({...Qe,position:{x:ie+vt*H,y:Ae}})}),Ae+=Z)}),t(_e),We("layer")},[u,e,t,et]);const or=P.useCallback(async H=>{Lt("deep-drill",H),ht(!0),Pt(!0),$e(null);try{const Z=await fetch(`/api/component/${encodeURIComponent(H)}/deep`);if(Z.ok){const ie=await Z.json();$e(ie)}}catch{}ht(!1)},[]),Ti=P.useCallback((H,Z)=>{if(!u)return;const ie=u.nodes.find(ue=>ue.id===Z.id);ie&&(Ni(ie),Bn(!0))},[u]);P.useEffect(()=>{const H=Z=>{if(Z.target instanceof HTMLInputElement||Z.target instanceof HTMLTextAreaElement)return;const ue=navigator.platform.toUpperCase().indexOf("MAC")>=0?Z.metaKey:Z.ctrlKey;if(Z.key==="Backspace"||Z.key==="Delete"){Z.preventDefault(),to();return}if(ue&&Z.key==="c"){Z.preventDefault(),as();return}if(ue&&Z.key==="v"){Z.preventDefault(),no();return}if(ue&&Z.shiftKey&&Z.key==="z"){Z.preventDefault(),Ke();return}if(ue&&Z.key==="z"){Z.preventDefault(),ls();return}if(ue&&Z.key==="s"){Z.preventDefault(),Hn();return}if(Z.key==="Escape"){Bn(!1),Pt(!1),ir();return}if(Z.key==="ArrowUp"){Z.preventDefault(),Kr(0,Z.shiftKey?-In*5:-In);return}if(Z.key==="ArrowDown"){Z.preventDefault(),Kr(0,Z.shiftKey?In*5:In);return}if(Z.key==="ArrowLeft"){Z.preventDefault(),Kr(Z.shiftKey?-In*5:-In,0);return}if(Z.key==="ArrowRight"){Z.preventDefault(),Kr(Z.shiftKey?In*5:In,0);return}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[to,as,no,Hn,Kr,ls,Ke]);const Cr=P.useMemo(()=>u?u.nodes.filter(H=>se.has(H.id)):[],[u,se]);return P.useEffect(()=>{u&&t(H=>H.map(Z=>({...Z,data:{...Z.data,highlighted:Z.id===$r}})))},[$r,u]),w?c.jsx("div",{className:"app",children:c.jsxs("div",{className:"loading",children:[c.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):c.jsxs("div",{className:"app",children:[c.jsxs("div",{className:"branding-header",children:[c.jsxs("div",{className:"archbyte-brand",children:[c.jsx("span",{className:"archbyte-name",children:"ArchByte"}),$?c.jsx(Cj,{projectInfo:$}):c.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),S.loggedIn&&c.jsx("div",{className:"branding-account",children:S.email&&c.jsxs("span",{className:"account-email",children:[S.email,S.tier==="premium"&&c.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),c.jsxs("div",{className:"toolbar",children:[c.jsxs("div",{className:"toolbar-left",children:[c.jsxs("div",{className:"toolbar-section",children:[c.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),c.jsxs("div",{className:"toolbar-section-items",children:[c.jsxs(Jm,{trigger:M?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"flow-dot-inline",style:{background:M.color}}),M.name]}):c.jsx(c.Fragment,{children:"▶ Flows ▾"}),triggerClassName:`toolbar-btn ${M?"has-active-flow":""}`,children:[M&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"dropdown-item flow-clear",onClick:ir,children:"⏹ Clear active flow"}),c.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const H=["user-journey","data-pipeline","system","deployment","error-recovery"],Z={"user-journey":"User Journey","data-pipeline":"Data Pipeline",system:"System",deployment:"Deployment","error-recovery":"Error / Recovery"},ie={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},ue={};for(const Ae of u.flows){const _e=Ae.category||"system";ue[_e]||(ue[_e]=[]),ue[_e].push(Ae)}const le=[];for(const Ae of H){const _e=ue[Ae];if(_e!=null&&_e.length){le.push(c.jsxs("div",{className:"flow-category-header",children:[c.jsx("span",{className:"flow-dot-inline",style:{background:ie[Ae]}}),Z[Ae]||Ae]},`cat-${Ae}`));for(const Me of _e)le.push(c.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Me.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Me.id?ir():ss(Me)},children:[c.jsx("span",{className:"flow-dot-inline",style:{background:Me.color}}),c.jsx("span",{className:"flow-dropdown-name",children:Me.name}),(M==null?void 0:M.id)===Me.id&&c.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Me.id))}}const we=new Set(H);for(const[Ae,_e]of Object.entries(ue))if(!we.has(Ae)&&_e!=null&&_e.length){le.push(c.jsxs("div",{className:"flow-category-header",children:[c.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),Ae]},`cat-${Ae}`));for(const Me of _e)le.push(c.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Me.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Me.id?ir():ss(Me)},children:[c.jsx("span",{className:"flow-dot-inline",style:{background:Me.color}}),c.jsx("span",{className:"flow-dropdown-name",children:Me.name}),(M==null?void 0:M.id)===Me.id&&c.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Me.id))}return le})():c.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]}),c.jsx("button",{className:`toolbar-btn premium-btn ${S.features.audit?"":"premium-locked"} ${It?"active":""}`,onClick:()=>{if(!S.features.audit){T("Audit");return}Lt("audit-toggle",It?"close":"open"),Ct(!It)},children:"Audit"})]})]}),!xn&&c.jsxs("div",{className:"toolbar-section",children:[c.jsx("span",{className:"toolbar-section-label",children:"Ops"}),c.jsxs("div",{className:"toolbar-section-items",children:[c.jsx("button",{className:`toolbar-btn premium-btn ${S.features.workflows?"":"premium-locked"} ${gt?"active":""}`,title:S.features.workflows?"":"Available in Pro",onClick:()=>{if(!S.features.workflows){T("Workflows");return}Lt("workflows-toggle",gt?"close":"open"),Tt(!gt),Jt(!1)},children:"Workflows"}),c.jsx("button",{className:`toolbar-btn premium-btn ${S.features.premiumAgents?"":"premium-locked"} ${mn?"active":""}`,title:S.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!S.features.premiumAgents){T("Pro Agents");return}Lt("agents-toggle",mn?"close":"open"),mn?Jt(!1):(Jt(!0),Tt(!1))},children:"Agents"}),c.jsx("button",{className:`toolbar-btn ${Ht?"active":""}`,onClick:()=>{Lt("sessions-toggle",Ht?"close":"open"),pn(!Ht)},children:"Sessions"})]})]})]}),c.jsxs("div",{className:"toolbar-right",children:[F&&!xn&&c.jsxs("span",{className:"toolbar-analyzing",children:[c.jsx("span",{className:"analyzing-pulse"}),"Re-analyzing..."]}),U&&!xn&&c.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>q(null),title:U,children:"Analysis failed"}),c.jsx("button",{className:`toolbar-btn ${Oe?"active":""}`,onClick:()=>{Lt("stats-toggle",Oe?"close":"open"),tt(!Oe)},children:"Stats"}),c.jsxs(Jm,{trigger:ns?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:ns,children:[c.jsx("div",{className:"dropdown-label",children:"Image"}),c.jsx("button",{className:"dropdown-item",onClick:us,children:"PNG"}),c.jsx("button",{className:"dropdown-item",onClick:sr,children:"SVG"}),c.jsx("div",{className:"dropdown-separator"}),c.jsx("div",{className:"dropdown-label",children:"Diagram"}),c.jsx("button",{className:"dropdown-item",onClick:()=>Kt("mermaid"),children:"Mermaid"}),c.jsx("button",{className:"dropdown-item",onClick:()=>Kt("plantuml"),children:"PlantUML"}),c.jsx("button",{className:"dropdown-item",onClick:()=>Kt("dot"),children:"DOT"}),c.jsx("div",{className:"dropdown-separator"}),c.jsx("div",{className:"dropdown-label",children:"Document"}),c.jsx("button",{className:"dropdown-item",onClick:()=>Kt("markdown"),children:"Markdown"}),c.jsx("button",{className:"dropdown-item",onClick:()=>Kt("json"),children:"JSON"}),c.jsx("div",{className:"dropdown-separator"}),c.jsx("div",{className:"dropdown-label",children:"Interactive"}),c.jsx("button",{className:`dropdown-item ${S.tier!=="premium"?"premium-locked":""}`,onClick:()=>{if(S.tier!=="premium"){T("HTML Export");return}Kt("html")},children:"HTML"})]}),c.jsx("button",{className:"toolbar-btn-icon",onClick:()=>{const H=St==="dark"?"light":"dark";Lt("theme-toggle",H),Qs(H)},title:`Switch to ${St==="dark"?"light":"dark"} mode`,children:St==="dark"?"☀":"☽"})]})]}),J&&J.count>0&&!F&&!xn&&c.jsxs("div",{className:"changes-banner",children:[c.jsx("span",{className:"changes-banner-pulse"}),c.jsxs("span",{className:"changes-banner-text",children:[J.componentChanges.length>0?`${J.componentChanges.length} component${J.componentChanges.length!==1?"s":""} affected`:`${J.count} file${J.count!==1?"s":""} changed`,c.jsxs("span",{className:"changes-banner-file-count",children:["(",J.count," file",J.count!==1?"s":"",")"]})]}),J.componentChanges.length>0&&c.jsxs("div",{className:"changes-banner-components",children:[J.componentChanges.map(H=>{const Z=H.files.some(ue=>ue.event==="add"),ie=H.files.some(ue=>ue.event==="unlink");return c.jsxs("button",{className:"changes-component-chip",onClick:()=>qr(H.componentId),children:[Z&&c.jsx("span",{className:"changes-event-dot new"}),ie&&c.jsx("span",{className:"changes-event-dot del"}),!Z&&!ie&&c.jsx("span",{className:"changes-event-dot mod"}),H.componentName,c.jsx("span",{className:"changes-component-count",children:H.files.length})]},H.componentId)}),J.unmapped.length>0&&c.jsxs("span",{className:"changes-component-chip unmapped",title:J.unmapped.map(H=>`${H.event==="add"?"+":H.event==="unlink"?"-":"~"} ${H.path}`).join(`
|
|
81
|
+
`),children:["Other",c.jsx("span",{className:"changes-component-count",children:J.unmapped.length})]})]}),c.jsxs("div",{className:"changes-banner-actions",children:[c.jsx("button",{className:"changes-banner-btn quick",onClick:rs,title:"Fast re-scan using static analysis only (~2s)",children:"Quick Scan"}),c.jsx("button",{className:"changes-banner-btn full",onClick:br,title:"Full re-scan using AI agents for deeper analysis",children:"Re-analyze"})]}),c.jsx("button",{className:"changes-banner-dismiss",onClick:()=>z(null),title:"Dismiss",children:"x"})]}),c.jsx(pj,{selectedEnvironment:yt,environments:en,onSelectEnvironment:_n}),c.jsxs("div",{className:"canvas-container",children:[c.jsx("div",{className:"watermark",children:"archbyte"}),c.jsxs(Ax,{nodes:e.map(H=>({...H,draggable:!Vr.has(H.id),data:{...H.data,locked:Vr.has(H.id)}})),edges:s.map(H=>{var Z;return{...H,style:{...H.style,opacity:1,strokeWidth:((Z=H.style)==null?void 0:Z.strokeWidth)||2}}}),onNodesChange:Ii,onEdgesChange:a,onNodeClick:(H,Z)=>{_i(H,Z)},onNodeDoubleClick:Ti,onPaneClick:()=>{Gr(),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:pl,onReconnect:ro,edgesReconnectable:!0,onSelectionChange:hl,nodeTypes:jP,connectionMode:Gi.Loose,snapToGrid:!0,snapGrid:[bi,bi],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[c.jsx(zx,{color:St==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:gr.Dots}),c.jsx(Lx,{})]}),ki&&xt&&c.jsxs(xi,{className:"node-details-panel",children:[c.jsxs("div",{className:"node-details-header","data-drag-handle":!0,children:[c.jsxs("div",{children:[c.jsx("div",{className:"node-details-title",children:xt.label.split(`
|
|
82
|
+
`)[0]}),c.jsxs("div",{className:"node-details-type-row",children:[c.jsxs("span",{children:[xt.layer," • ",xt.type]}),xt.path&&c.jsx("button",{className:"panel-btn small green",onClick:()=>{or(xt.id),Bn(!1)},disabled:Be,children:Be?"...":"INSPECT"})]})]}),c.jsx("button",{className:"panel-close-btn",onClick:()=>Bn(!1),children:"×"})]}),xt.path&&c.jsxs("div",{className:"node-details-section",children:[c.jsx("div",{className:"node-details-section-title",children:"Path"}),c.jsx("div",{className:"node-details-path",style:{userSelect:"text"},children:xt.path})]}),xt.techStack&&xt.techStack.length>0&&c.jsxs("div",{className:"node-details-section",children:[c.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),c.jsx("div",{className:"node-details-tech-stack",children:xt.techStack.map((H,Z)=>c.jsx("span",{className:"tech-badge",children:H},Z))})]}),c.jsxs("div",{className:"node-details-section",children:[c.jsx("div",{className:"node-details-section-title",children:"Connections"}),c.jsxs("div",{className:"node-details-connections",children:[u==null?void 0:u.edges.filter(H=>H.source===xt.id||H.target===xt.id).map(H=>{const Z=H.source===xt.id,ie=Z?H.target:H.source,ue=u==null?void 0:u.nodes.find(le=>le.id===ie);return c.jsxs("div",{className:"connection-item-detailed",onClick:()=>qr(ie),style:{cursor:"pointer"},title:`Click to highlight ${(ue==null?void 0:ue.label.split(`
|
|
83
|
+
`)[0])||ie}`,children:[c.jsxs("div",{className:"connection-header",children:[c.jsx("span",{className:"connection-arrow",children:Z?"→":"←"}),c.jsx("span",{className:"connection-target",children:(ue==null?void 0:ue.label.split(`
|
|
84
|
+
`)[0])||ie})]}),H.label&&c.jsx("div",{className:"connection-label",children:H.label})]},H.id)}),(u==null?void 0:u.edges.filter(H=>H.source===xt.id||H.target===xt.id).length)===0&&c.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),(()=>{var Z;const H=(Z=J==null?void 0:J.componentChanges)==null?void 0:Z.find(ie=>ie.componentId===xt.id);return!H||H.files.length===0?null:c.jsxs("div",{className:"pending-sticky-note",children:[c.jsxs("div",{className:"pending-sticky-header",children:[H.files.length," file",H.files.length!==1?"s":""," changed"]}),H.files.slice(0,8).map((ie,ue)=>c.jsxs("div",{className:`pending-file-row ${ie.event}`,children:[c.jsx("span",{className:"pending-file-event",children:ie.event==="add"?"+":ie.event==="unlink"?"-":"~"}),c.jsx("span",{className:"pending-file-name",children:ie.path.split("/").pop()})]},ue)),H.files.length>8&&c.jsxs("div",{className:"pending-file-more",children:["+",H.files.length-8," more"]})]})})()]}),gn&&c.jsxs(xi,{className:"deep-drill-panel",children:[c.jsxs("div",{className:"deep-drill-header","data-drag-handle":!0,children:[c.jsxs("div",{children:[c.jsx("div",{className:"deep-drill-title",children:(me==null?void 0:me.componentName)||"INSPECT"}),c.jsx("div",{className:"deep-drill-subtitle",children:(me==null?void 0:me.componentPath)||"Scanning..."})]}),c.jsx("button",{className:"panel-close-btn",onClick:()=>Pt(!1),children:"x"})]}),Be&&c.jsxs("div",{className:"deep-drill-loading",children:[c.jsx("div",{className:"loading-spinner"}),"Scanning component..."]}),me&&!Be&&c.jsxs("div",{className:"deep-drill-body",children:[c.jsxs("div",{className:"deep-drill-meta",children:["Scanned in ",me.durationMs,"ms"]}),c.jsxs(Ds,{title:"Metrics",defaultOpen:!0,children:[c.jsxs("div",{className:"dd-metric-grid",children:[c.jsxs("div",{className:"dd-metric-card",children:[c.jsx("div",{className:"dd-metric-value",children:me.metrics.fileCount}),c.jsx("div",{className:"dd-metric-label",children:"Files"})]}),c.jsxs("div",{className:"dd-metric-card",children:[c.jsx("div",{className:"dd-metric-value",children:me.metrics.codeFileCount}),c.jsx("div",{className:"dd-metric-label",children:"Code Files"})]}),c.jsxs("div",{className:"dd-metric-card",children:[c.jsx("div",{className:"dd-metric-value",children:me.metrics.totalLines.toLocaleString()}),c.jsx("div",{className:"dd-metric-label",children:"Lines"})]})]}),me.metrics.languages.length>0&&c.jsx("div",{className:"dd-lang-badges",children:me.metrics.languages.map(H=>c.jsxs("span",{className:"dd-lang-badge",children:[H.language," (",H.files,")"]},H.language))})]}),(me.structure.keyFiles.length>0||me.structure.publicExports.length>0)&&c.jsxs(Ds,{title:"Internal Structure",children:[me.structure.keyFiles.length>0&&c.jsx("div",{className:"dd-key-files",children:me.structure.keyFiles.slice(0,10).map((H,Z)=>c.jsxs("div",{className:"dd-key-file-item",children:[c.jsx("span",{className:"dd-role-badge",children:H.role}),c.jsx("span",{className:"dd-file-path",children:H.path.replace(me.componentPath+"/","")})]},Z))}),me.structure.publicExports.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dd-subsection-title",children:"Public Exports"}),c.jsx("div",{className:"dd-exports",children:me.structure.publicExports.slice(0,15).map((H,Z)=>c.jsx("span",{className:"dd-export-name",children:H},Z))})]})]}),me.dependencies.manifest&&c.jsxs(Ds,{title:`Dependencies (${me.dependencies.manifest})`,children:[me.dependencies.production.length>0&&c.jsxs("div",{className:"dd-dep-list",children:[me.dependencies.production.slice(0,15).map((H,Z)=>c.jsx("span",{className:`dd-dep-badge ${H.category?"categorized":""}`,title:H.category||H.name,children:H.displayName},Z)),me.dependencies.production.length>15&&c.jsxs("span",{className:"dd-dep-more",children:["+",me.dependencies.production.length-15," more"]})]}),me.dependencies.development.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dd-subsection-title",children:"Dev Dependencies"}),c.jsxs("div",{className:"dd-dep-list",children:[me.dependencies.development.slice(0,10).map((H,Z)=>c.jsx("span",{className:"dd-dep-badge dev",title:H.category||H.name,children:H.displayName},Z)),me.dependencies.development.length>10&&c.jsxs("span",{className:"dd-dep-more",children:["+",me.dependencies.development.length-10," more"]})]})]})]}),me.patterns.length>0&&c.jsx(Ds,{title:"Code Patterns",children:me.patterns.map((H,Z)=>c.jsxs("div",{className:"dd-pattern-group",children:[c.jsxs("div",{className:"dd-pattern-header",children:[c.jsx("span",{className:"dd-pattern-label",children:H.label}),c.jsx("span",{className:"dd-pattern-count",children:H.count})]}),c.jsx("div",{className:"dd-pattern-matches",children:H.matches.slice(0,3).map((ie,ue)=>c.jsxs("div",{className:"dd-pattern-match",children:[c.jsxs("span",{className:"dd-match-file",children:[ie.file.replace(me.componentPath+"/",""),":",ie.line]}),c.jsx("span",{className:"dd-match-content",children:ie.content})]},ue))})]},Z))}),(me.connections.outgoing.length>0||me.connections.incoming.length>0)&&c.jsxs(Ds,{title:"Connections",children:[me.connections.outgoing.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dd-subsection-title",children:"Outgoing"}),me.connections.outgoing.map((H,Z)=>c.jsxs("div",{className:"dd-connection-item",children:[c.jsx("span",{className:"dd-conn-arrow",children:"->"}),c.jsx("span",{className:"dd-conn-name",children:H.targetName}),H.type&&c.jsx("span",{className:"dd-conn-type",children:H.type})]},Z))]}),me.connections.incoming.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dd-subsection-title",children:"Incoming"}),me.connections.incoming.map((H,Z)=>c.jsxs("div",{className:"dd-connection-item",children:[c.jsx("span",{className:"dd-conn-arrow",children:"<-"}),c.jsx("span",{className:"dd-conn-name",children:H.sourceName}),H.type&&c.jsx("span",{className:"dd-conn-type",children:H.type})]},Z))]})]}),me.fileTree.length>0&&c.jsx(Ds,{title:"File Tree",children:c.jsx("div",{className:"dd-file-tree",children:T0(me.fileTree,me.componentPath)})})]})]}),Fn.size>0&&!xn&&c.jsxs("div",{className:"save-panel",children:[c.jsxs("span",{className:"save-panel-text",children:[Fn.size," unsaved change",Fn.size!==1?"s":""]}),c.jsx("button",{className:"save-btn",onClick:Hn,disabled:Hr,children:Hr?"Saving...":"Save Changes"}),c.jsx("button",{className:"discard-btn",onClick:os,disabled:Hr,children:"Discard"})]}),Cr.length>0&&c.jsxs("div",{className:"hidden-nodes-panel",children:[c.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",Cr.length,")",c.jsx("button",{className:"panel-btn cyan small",onClick:eo,children:"Show All"})]}),c.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:Cr.map(H=>c.jsxs("div",{className:"hidden-node-item",children:[c.jsx("span",{className:"hidden-node-name",children:H.label.split(`
|
|
85
|
+
`)[0]}),c.jsx("button",{className:"panel-btn green small",onClick:()=>showNode(H.id),children:"Show"})]},H.id))})]}),M&&c.jsxs("div",{className:"flow-progress-bar",children:[c.jsx("span",{className:"flow-progress-dot",style:{background:M.color}}),c.jsx("span",{className:"flow-progress-name",children:M.name}),c.jsx("div",{className:"flow-progress-steps",children:M.steps.map((H,Z)=>c.jsx("div",{className:`flow-progress-step ${Z<=j?"active":""} ${Z===j?"current":""}`,style:{borderColor:Z<=j?M.color:void 0},title:H.label,children:H.label},Z))}),c.jsxs("div",{className:"flow-progress-controls",children:[Y?c.jsx("button",{className:"flow-progress-btn",onClick:Yr,title:"Pause",children:"⏸"}):c.jsx("button",{className:"flow-progress-btn",onClick:Xr,title:"Resume",children:"▶"}),c.jsx("button",{className:"flow-progress-btn stop",onClick:ir,title:"Stop",children:"⏹"})]})]}),ce&&M&&u&&c.jsx(Pj,{flow:M,architecture:u,onClose:ir}),c.jsx(xj,{visible:Oe,onClose:()=>tt(!1)}),c.jsx(Nj,{visible:It,onClose:()=>Ct(!1),onHighlightNode:H=>{qr(H)}}),gt&&c.jsxs(xi,{className:"ops-panel",children:[c.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[c.jsx("span",{className:"ops-panel-title",children:"Workflows"}),c.jsx("button",{className:"panel-close-btn",onClick:()=>Tt(!1),children:"x"})]}),c.jsx(bj,{visible:!0})]}),c.jsx(bP,{visible:Ht,onClose:()=>pn(!1)}),c.jsx(Gj,{visible:mn,onClose:()=>Jt(!1),results:oe}),x.length>0&&c.jsxs("div",{className:"agent-panel",children:[c.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((H,Z)=>c.jsxs("div",{className:"agent-item",children:[c.jsx("div",{className:`agent-dot ${Z===0?"active":""}`}),c.jsx("span",{className:"agent-name",children:H.agentName}),c.jsx("span",{className:"agent-target",children:H.targetComponent||H.action})]},Z))]})]}),xn&&c.jsxs("a",{href:"https://archbyte.heartbyte.io",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",bottom:6,right:8,display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"hsl(185 75% 50%)",background:"hsla(222, 47%, 8%, 0.85)",backdropFilter:"blur(8px)",border:"1px solid hsla(185, 75%, 50%, 0.25)",borderRadius:6,textDecoration:"none",zIndex:50,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.02em"},children:[c.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),c.jsx("path",{d:"M2 17l10 5 10-5"}),c.jsx("path",{d:"M2 12l10 5 10-5"})]}),"archbyte.heartbyte.io"]}),c.jsxs("div",{className:"status-bar",children:[c.jsxs("div",{className:"status-left",children:[!xn&&c.jsxs("div",{className:"status-indicator",children:[c.jsx("div",{className:`status-dot ${h?"":"disconnected"}`}),c.jsx("span",{children:h?"Live":"Offline"})]}),xn&&c.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:"Standalone Export"}),E&&!xn&&c.jsx("span",{style:{color:"var(--accent-red)"},children:E})]}),c.jsx("div",{className:"status-center",children:c.jsx("a",{href:"mailto:archbyte@heartbyte.io",style:{color:"var(--text-dim)",fontSize:11,textDecoration:"none"},children:"archbyte@heartbyte.io"})}),c.jsxs("div",{className:"status-right",children:[c.jsx("span",{children:m?`Updated ${new Date(m).toLocaleTimeString()}`:"Waiting..."}),Vt?c.jsxs("span",{className:"git-status",children:[Vt.repo&&c.jsx("a",{href:((Vn=Vt.remoteUrl)==null?void 0:Vn.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Vt.remoteUrl||"",children:Vt.repo}),c.jsx("span",{className:"git-branch",children:Vt.branch}),c.jsx("span",{className:"git-hash",children:Vt.commit})]}):c.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),D&&c.jsx(Mj,{onComplete:()=>{G(!1),rr()}}),B&&c.jsx(uj,{feature:B,onClose:()=>T(null)})]})}fw.createRoot(document.getElementById("root")).render(c.jsx(Ug.StrictMode,{children:c.jsx(IP,{})}));
|