makecc 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{index-sLSbr7SJ.js → index--RFba-Yw.js} +46 -40
- package/dist/client/assets/index-COYRelWD.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +10 -2
- package/dist/server/services/workflowAIService.js +25 -6
- package/package.json +1 -1
- package/server/index.ts +12 -2
- package/server/services/workflowAIService.ts +35 -6
- package/dist/client/assets/index-C3whdqo5.css +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jh={exports:{}},hs={};var Dx;function aE(){if(Dx)return hs;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:u,ref:s!==void 0?s:null,props:o}}return hs.Fragment=n,hs.jsx=i,hs.jsxs=i,hs}var jx;function lE(){return jx||(jx=1,jh.exports=aE()),jh.exports}var v=lE(),Rh={exports:{}},Me={};var Rx;function sE(){if(Rx)return Me;Rx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function _(R,$,T){this.props=R,this.context=$,this.refs=E,this.updater=T||w}_.prototype.isReactComponent={},_.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,$,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function j(){}j.prototype=_.prototype;function k(R,$,T){this.props=R,this.context=$,this.refs=E,this.updater=T||w}var C=k.prototype=new j;C.constructor=k,N(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(R,$,T){var ie=T.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:T}}function q(R,$){return G(R.type,$,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function Y(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(T){return $[T]})}var te=/\/+/g;function O(R,$){return typeof R=="object"&&R!==null&&R.key!=null?Y(""+R.key):$.toString(36)}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,$,T,ie,ce){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case n:he=!0;break;case g:return he=R._init,D(he(R._payload),$,T,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(T="",he!=null&&(T=he.replace(te,"$&/")+"/"),D(ce,$,T,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,T+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),$.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(R))for(var me=0;me<R.length;me++)ie=R[me],fe=ue+O(ie,me),he+=D(ie,$,T,fe,ce);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(ie=R.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=D(ie,$,T,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return D(B(R),$,T,ie,ce);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return he}function U(R,$,T){if(R==null)return R;var ie=[],ce=0;return D(R,ie,"","",function(fe){return $.call(T,fe,ce++)}),ie}function P(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var Q=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:U,forEach:function(R,$,T){U(R,function(){$.apply(this,arguments)},T)},count:function(R){var $=0;return U(R,function(){$++}),$},toArray:function(R){return U(R,function($){return $})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Me.Activity=m,Me.Children=z,Me.Component=_,Me.Fragment=i,Me.Profiler=s,Me.PureComponent=k,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Me.cache=function(R){return function(){return R.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(R,$,T){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=N({},R.props),ce=R.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!F.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ie[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ie.children=T;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return G(R.type,ce,ie)},Me.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},Me.createElement=function(R,$,T){var ie,ce={},fe=null;if($!=null)for(ie in $.key!==void 0&&(fe=""+$.key),$)F.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var he=arguments.length-2;if(he===1)ce.children=T;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(R&&R.defaultProps)for(ie in he=R.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return G(R,fe,ce)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(R){return{$$typeof:f,render:R}},Me.isValidElement=V,Me.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:P}},Me.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Me.startTransition=function(R){var $=H.T,T={};H.T=T;try{var ie=R(),ce=H.S;ce!==null&&ce(T,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,Q)}catch(fe){Q(fe)}finally{$!==null&&T.types!==null&&($.types=T.types),H.T=$}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(R){return H.H.use(R)},Me.useActionState=function(R,$,T){return H.H.useActionState(R,$,T)},Me.useCallback=function(R,$){return H.H.useCallback(R,$)},Me.useContext=function(R){return H.H.useContext(R)},Me.useDebugValue=function(){},Me.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Me.useEffect=function(R,$){return H.H.useEffect(R,$)},Me.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(R,$,T){return H.H.useImperativeHandle(R,$,T)},Me.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Me.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Me.useMemo=function(R,$){return H.H.useMemo(R,$)},Me.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Me.useReducer=function(R,$,T){return H.H.useReducer(R,$,T)},Me.useRef=function(R){return H.H.useRef(R)},Me.useState=function(R){return H.H.useState(R)},Me.useSyncExternalStore=function(R,$,T){return H.H.useSyncExternalStore(R,$,T)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.2.3",Me}var Ox;function ao(){return Ox||(Ox=1,Rh.exports=sE()),Rh.exports}var K=ao();const Ls=Fc(K);var Oh={exports:{}},ps={},Lh={exports:{}},Hh={};var Lx;function oE(){return Lx||(Lx=1,(function(e){function n(D,U){var P=D.length;D.push(U);e:for(;0<P;){var Q=P-1>>>1,z=D[Q];if(0<s(z,U))D[Q]=U,D[P]=z,P=Q;else break e}}function i(D){return D.length===0?null:D[0]}function a(D){if(D.length===0)return null;var U=D[0],P=D.pop();if(P!==U){D[0]=P;e:for(var Q=0,z=D.length,R=z>>>1;Q<R;){var $=2*(Q+1)-1,T=D[$],ie=$+1,ce=D[ie];if(0>s(T,P))ie<z&&0>s(ce,T)?(D[Q]=ce,D[ie]=P,Q=ie):(D[Q]=T,D[$]=P,Q=$);else if(ie<z&&0>s(ce,P))D[Q]=ce,D[ie]=P,Q=ie;else break e}}return U}function s(D,U){var P=D.sortIndex-U.sortIndex;return P!==0?P:D.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,b=!1,w=!1,N=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(D){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=D)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(D){if(N=!1,C(D),!w)if(i(h)!==null)w=!0,A||(A=!0,Y());else{var U=i(d);U!==null&&B(L,U.startTime-D)}}var A=!1,H=-1,F=5,G=-1;function q(){return E?!0:!(e.unstable_now()-G<F)}function V(){if(E=!1,A){var D=e.unstable_now();G=D;var U=!0;try{e:{w=!1,N&&(N=!1,j(H),H=-1),b=!0;var P=x;try{t:{for(C(D),m=i(h);m!==null&&!(m.expirationTime>D&&q());){var Q=m.callback;if(typeof Q=="function"){m.callback=null,x=m.priorityLevel;var z=Q(m.expirationTime<=D);if(D=e.unstable_now(),typeof z=="function"){m.callback=z,C(D),U=!0;break t}m===i(h)&&a(h),C(D)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-D),U=!1}}break e}finally{m=null,x=P,b=!1}U=void 0}}finally{U?Y():A=!1}}}var Y;if(typeof k=="function")Y=function(){k(V)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=V,Y=function(){O.postMessage(null)}}else Y=function(){_(V,0)};function B(D,U){H=_(function(){D(e.unstable_now())},U)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var P=x;x=U;try{return D()}finally{x=P}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(D,U){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var P=x;x=D;try{return U()}finally{x=P}},e.unstable_scheduleCallback=function(D,U,P){var Q=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Q+P:Q):P=Q,D){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=P+z,D={id:g++,callback:U,priorityLevel:D,startTime:P,expirationTime:z,sortIndex:-1},P>Q?(D.sortIndex=P,n(d,D),i(h)===null&&D===i(d)&&(N?(j(H),H=-1):N=!0,B(L,P-Q))):(D.sortIndex=z,n(h,D),w||b||(w=!0,A||(A=!0,Y()))),D},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(D){var U=x;return function(){var P=x;x=U;try{return D.apply(this,arguments)}finally{x=P}}}})(Hh)),Hh}var Hx;function uE(){return Hx||(Hx=1,Lh.exports=oE()),Lh.exports}var Bh={exports:{}},Ut={};var Bx;function cE(){if(Bx)return Ut;Bx=1;var e=ao();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return o(h,d,null,g)},Ut.flushSync=function(h){var d=u.T,g=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=g,a.d.f()}},Ut.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Ut.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Ut.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ut.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Ut.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ut.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Ut.requestFormReset=function(h){a.d.r(h)},Ut.unstable_batchedUpdates=function(h,d){return h(d)},Ut.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.2.3",Ut}var Ux;function hv(){if(Ux)return Bh.exports;Ux=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(n){console.error(n)}}return e(),Bh.exports=cE(),Bh.exports}var Ix;function fE(){if(Ix)return ps;Ix=1;var e=uE(),n=ao(),i=hv();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(a(188))}function d(t){var r=t.alternate;if(!r){if(r=o(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,c=r;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return h(p),t;if(y===c)return h(p),r;y=y.sibling}throw Error(a(188))}if(l.return!==c.return)l=p,c=y;else{for(var S=!1,M=p.child;M;){if(M===l){S=!0,l=p,c=y;break}if(M===c){S=!0,c=p,l=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===l){S=!0,l=y,c=p;break}if(M===c){S=!0,c=y,l=p;break}M=M.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==c)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function Y(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case _:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case k:return t.displayName||"Context";case j:return(t._context.displayName||"Context")+".Consumer";case C:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return r=t.displayName||null,r!==null?r:O(t.type)||"Memo";case F:r=t._payload,t=t._init;try{return O(t(r))}catch{}}return null}var B=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Q=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=Q[z],Q[z]=null,z--)}function T(t,r){z++,Q[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(T(fe,r),T(ce,t),T(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?tx(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=tx(r),t=nx(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),T(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&T(he,t);var r=ie.current,l=nx(r,t.type);r!==l&&(T(ce,t),T(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),us._currentValue=P)}var we,Ne;function Re(t){if(we===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ne=-1<l.stack.indexOf(`
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},hs={};var Dx;function oE(){if(Dx)return hs;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:u,ref:s!==void 0?s:null,props:o}}return hs.Fragment=n,hs.jsx=i,hs.jsxs=i,hs}var Rx;function uE(){return Rx||(Rx=1,Rh.exports=oE()),Rh.exports}var v=uE(),Oh={exports:{}},Me={};var Ox;function cE(){if(Ox)return Me;Ox=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function _(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}_.prototype.isReactComponent={},_.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,$,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=_.prototype;function k(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}var C=k.prototype=new D;C.constructor=k,E(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(R,$,T){var ie=T.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:T}}function q(R,$){return G(R.type,$,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function P(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(T){return $[T]})}var te=/\/+/g;function O(R,$){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):$.toString(36)}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,$,T,ie,ce){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case n:he=!0;break;case g:return he=R._init,j(he(R._payload),$,T,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(T="",he!=null&&(T=he.replace(te,"$&/")+"/"),j(ce,$,T,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,T+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),$.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(R))for(var me=0;me<R.length;me++)ie=R[me],fe=ue+O(ie,me),he+=j(ie,$,T,fe,ce);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(ie=R.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=j(ie,$,T,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return j(B(R),$,T,ie,ce);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return he}function U(R,$,T){if(R==null)return R;var ie=[],ce=0;return j(R,ie,"","",function(fe){return $.call(T,fe,ce++)}),ie}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var K=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:U,forEach:function(R,$,T){U(R,function(){$.apply(this,arguments)},T)},count:function(R){var $=0;return U(R,function(){$++}),$},toArray:function(R){return U(R,function($){return $})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Me.Activity=m,Me.Children=z,Me.Component=_,Me.Fragment=i,Me.Profiler=s,Me.PureComponent=k,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Me.cache=function(R){return function(){return R.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(R,$,T){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=E({},R.props),ce=R.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!F.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ie[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ie.children=T;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return G(R.type,ce,ie)},Me.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},Me.createElement=function(R,$,T){var ie,ce={},fe=null;if($!=null)for(ie in $.key!==void 0&&(fe=""+$.key),$)F.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var he=arguments.length-2;if(he===1)ce.children=T;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(R&&R.defaultProps)for(ie in he=R.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return G(R,fe,ce)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(R){return{$$typeof:f,render:R}},Me.isValidElement=V,Me.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Y}},Me.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Me.startTransition=function(R){var $=H.T,T={};H.T=T;try{var ie=R(),ce=H.S;ce!==null&&ce(T,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,K)}catch(fe){K(fe)}finally{$!==null&&T.types!==null&&($.types=T.types),H.T=$}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(R){return H.H.use(R)},Me.useActionState=function(R,$,T){return H.H.useActionState(R,$,T)},Me.useCallback=function(R,$){return H.H.useCallback(R,$)},Me.useContext=function(R){return H.H.useContext(R)},Me.useDebugValue=function(){},Me.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Me.useEffect=function(R,$){return H.H.useEffect(R,$)},Me.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(R,$,T){return H.H.useImperativeHandle(R,$,T)},Me.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Me.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Me.useMemo=function(R,$){return H.H.useMemo(R,$)},Me.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Me.useReducer=function(R,$,T){return H.H.useReducer(R,$,T)},Me.useRef=function(R){return H.H.useRef(R)},Me.useState=function(R){return H.H.useState(R)},Me.useSyncExternalStore=function(R,$,T){return H.H.useSyncExternalStore(R,$,T)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.2.3",Me}var Lx;function ao(){return Lx||(Lx=1,Oh.exports=cE()),Oh.exports}var Q=ao();const Ls=Fc(Q);var Lh={exports:{}},ps={},Hh={exports:{}},Bh={};var Hx;function fE(){return Hx||(Hx=1,(function(e){function n(j,U){var Y=j.length;j.push(U);e:for(;0<Y;){var K=Y-1>>>1,z=j[K];if(0<s(z,U))j[K]=U,j[Y]=z,Y=K;else break e}}function i(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var U=j[0],Y=j.pop();if(Y!==U){j[0]=Y;e:for(var K=0,z=j.length,R=z>>>1;K<R;){var $=2*(K+1)-1,T=j[$],ie=$+1,ce=j[ie];if(0>s(T,Y))ie<z&&0>s(ce,T)?(j[K]=ce,j[ie]=Y,K=ie):(j[K]=T,j[$]=Y,K=$);else if(ie<z&&0>s(ce,Y))j[K]=ce,j[ie]=Y,K=ie;else break e}}return U}function s(j,U){var Y=j.sortIndex-U.sortIndex;return Y!==0?Y:j.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,b=!1,w=!1,E=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(j){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=j)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(j){if(E=!1,C(j),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var U=i(d);U!==null&&B(L,U.startTime-j)}}var A=!1,H=-1,F=5,G=-1;function q(){return N?!0:!(e.unstable_now()-G<F)}function V(){if(N=!1,A){var j=e.unstable_now();G=j;var U=!0;try{e:{w=!1,E&&(E=!1,D(H),H=-1),b=!0;var Y=x;try{t:{for(C(j),m=i(h);m!==null&&!(m.expirationTime>j&&q());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var z=K(m.expirationTime<=j);if(j=e.unstable_now(),typeof z=="function"){m.callback=z,C(j),U=!0;break t}m===i(h)&&a(h),C(j)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-j),U=!1}}break e}finally{m=null,x=Y,b=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof k=="function")P=function(){k(V)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=V,P=function(){O.postMessage(null)}}else P=function(){_(V,0)};function B(j,U){H=_(function(){j(e.unstable_now())},U)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Y=x;x=U;try{return j()}finally{x=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=x;x=j;try{return U()}finally{x=Y}},e.unstable_scheduleCallback=function(j,U,Y){var K=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,j){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,j={id:g++,callback:U,priorityLevel:j,startTime:Y,expirationTime:z,sortIndex:-1},Y>K?(j.sortIndex=Y,n(d,j),i(h)===null&&j===i(d)&&(E?(D(H),H=-1):E=!0,B(L,Y-K))):(j.sortIndex=z,n(h,j),w||b||(w=!0,A||(A=!0,P()))),j},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(j){var U=x;return function(){var Y=x;x=U;try{return j.apply(this,arguments)}finally{x=Y}}}})(Bh)),Bh}var Bx;function dE(){return Bx||(Bx=1,Hh.exports=fE()),Hh.exports}var Uh={exports:{}},Ut={};var Ux;function hE(){if(Ux)return Ut;Ux=1;var e=ao();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return o(h,d,null,g)},Ut.flushSync=function(h){var d=u.T,g=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=g,a.d.f()}},Ut.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Ut.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Ut.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ut.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Ut.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ut.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Ut.requestFormReset=function(h){a.d.r(h)},Ut.unstable_batchedUpdates=function(h,d){return h(d)},Ut.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.2.3",Ut}var Ix;function pv(){if(Ix)return Uh.exports;Ix=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(n){console.error(n)}}return e(),Uh.exports=hE(),Uh.exports}var qx;function pE(){if(qx)return ps;qx=1;var e=dE(),n=ao(),i=pv();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(a(188))}function d(t){var r=t.alternate;if(!r){if(r=o(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,c=r;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return h(p),t;if(y===c)return h(p),r;y=y.sibling}throw Error(a(188))}if(l.return!==c.return)l=p,c=y;else{for(var S=!1,M=p.child;M;){if(M===l){S=!0,l=p,c=y;break}if(M===c){S=!0,c=p,l=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===l){S=!0,l=y,c=p;break}if(M===c){S=!0,c=y,l=p;break}M=M.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==c)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case k:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case C:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return r=t.displayName||null,r!==null?r:O(t.type)||"Memo";case F:r=t._payload,t=t._init;try{return O(t(r))}catch{}}return null}var B=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},K=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=K[z],K[z]=null,z--)}function T(t,r){z++,K[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(T(fe,r),T(ce,t),T(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?nx(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=nx(r),t=ix(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),T(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&T(he,t);var r=ie.current,l=ix(r,t.type);r!==l&&(T(ce,t),T(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),us._currentValue=Y)}var we,Ne;function Re(t){if(we===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ne=-1<l.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+we+t+Ne}var Ze=!1;function Xe(t,r){if(!t||Ze)return"";Ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(re){var ee=re}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(re){ee=re}t.call(oe.prototype)}}else{try{throw Error()}catch(re){ee=re}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),S=y[0],M=y[1];if(S&&M){var I=S.split(`
|
|
4
4
|
`),W=M.split(`
|
|
5
5
|
`);for(p=c=0;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===I.length||p===W.length)for(c=I.length-1,p=W.length-1;1<=c&&0<=p&&I[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(I[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||I[c]!==W[p]){var le=`
|
|
6
6
|
`+I[c].replace(" at new "," at ");return t.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",t.displayName)),le}while(1<=c&&0<=p);break}}}finally{Ze=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Re(l):""}function ht(t,r){switch(t.tag){case 26:case 27:case 5:return Re(t.type);case 16:return Re("Lazy");case 13:return t.child!==r&&r!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Xe(t.type,!1);case 11:return Xe(t.type.render,!1);case 1:return Xe(t.type,!0);case 31:return Re("Activity");default:return""}}function sn(t){try{var r="",l=null;do r+=ht(t,l),l=t,t=t.return;while(t);return r}catch(c){return`
|
|
7
7
|
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var Lt=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,si=e.unstable_shouldYield,oi=e.unstable_requestPaint,Et=e.unstable_now,Ii=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,je=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Vt=e.log,On=e.unstable_setDisableYieldValue,At=null,pt=null;function Ht(t){if(typeof Vt=="function"&&On(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(At,t)}catch{}}var Ke=Math.clz32?Math.clz32:wf,Gn=Math.log,on=Math.LN2;function wf(t){return t>>>=0,t===0?32:31-(Gn(t)/on|0)|0}var aa=256,la=262144,sa=4194304;function ui(t){var r=t&42;if(r!==0)return r;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function oa(t,r,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?p=ui(c):(S&=M,S!==0?p=ui(S):l||(l=M&~t,l!==0&&(p=ui(l))))):(M=c&~y,M!==0?p=ui(M):S!==0?p=ui(S):l||(l=c&~t,l!==0&&(p=ui(l)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:p}function _r(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Sf(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function So(){var t=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),t}function vl(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function kr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _f(t,r,l,c,p,y){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),oe=1<<le;M[le]=0,I[le]=-1;var ee=W[le];if(ee!==null)for(W[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}l&=~oe}c!==0&&_o(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function _o(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-Ke(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function ko(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var c=31-Ke(l),p=1<<c;p&r|t[c]&r&&(t[c]|=r),l&=~p}}function Eo(t,r){var l=r&-r;return l=(l&42)!==0?1:wl(l),(l&(t.suspendedLanes|r))!==0?0:l}function wl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function No(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Ex(t.type))}function Co(t,r){var l=U.p;try{return U.p=t,r()}finally{U.p=l}}var Zn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Zn,Bt="__reactProps$"+Zn,ci="__reactContainer$"+Zn,ua="__reactEvents$"+Zn,Mo="__reactListeners$"+Zn,kf="__reactHandles$"+Zn,To="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function _l(t){delete t[Nt],delete t[Bt],delete t[ua],delete t[Mo],delete t[kf]}function qi(t){var r=t[Nt];if(r)return r;for(var l=t.parentNode;l;){if(r=l[ci]||l[Nt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=ux(t);t!==null;){if(l=t[Nt])return l;t=ux(t)}return r}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Nt]||t[ci]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Vi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Yi(t){var r=t[To];return r||(r=t[To]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var Ao=new Set,zo={};function fi(t,r){Pi(t,r),Pi(t+"Capture",r)}function Pi(t,r){for(zo[t]=r,t=0;t<r.length;t++)Ao.add(r[t])}var Ef=RegExp("^[: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]*$"),kl={},Do={};function Nf(t){return Lt.call(Do,t)?!0:Lt.call(kl,t)?!1:Ef.test(t)?Do[t]=!0:(kl[t]=!0,!1)}function ca(t,r,l){if(Nf(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function fa(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ln(t,r,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+c)}}function Zt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jo(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Cf(t,r,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function da(t){if(!t._valueTracker){var r=jo(t)?"checked":"value";t._valueTracker=Cf(t,r,""+t[r])}}function Ro(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=jo(t)?t.checked?"true":"false":t.value),t=c,t!==l?(r.setValue(t),!0):!1}function Nr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Mf=/[\n"\\]/g;function Qt(t){return t.replace(Mf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Zt(r)):t.value!==""+Zt(r)&&(t.value=""+Zt(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?El(t,S,Zt(r)):l!=null?El(t,S,Zt(l)):c!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Zt(M):t.removeAttribute("name")}function Oo(t,r,l,c,p,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){da(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,M||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),da(t)}function El(t,r,l){r==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function di(t,r,l,c){if(t=t.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=r.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Zt(l),r=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Qm(t,r,l){if(r!=null&&(r=""+Zt(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Zt(l):""}function Km(t,r,l,c){if(r==null){if(c!=null){if(l!=null)throw Error(a(92));if(B(c)){if(1<c.length)throw Error(a(93));c=c[0]}l=c}l==null&&(l=""),r=l}l=Zt(r),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),da(t)}function ha(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var e_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jm(t,r,l){var c=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,l):typeof l!="number"||l===0||e_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function Wm(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&l[p]!==c&&Jm(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&Jm(t,y,r[y])}function Tf(t){if(t.indexOf("-")===-1)return!1;switch(t){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 t_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),n_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lo(t){return n_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var Af=null;function zf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pa=null,ma=null;function eg(t){var r=$i(t);if(r&&(t=r.stateNode)){var l=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var c=l[r];if(c!==t&&c.form===t.form){var p=c[Bt]||null;if(!p)throw Error(a(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)c=l[r],c.form===t.form&&Ro(c)}break e;case"textarea":Qm(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Df=!1;function tg(t,r,l){if(Df)return t(r,l);Df=!0;try{var c=t(r);return c}finally{if(Df=!1,(pa!==null||ma!==null)&&(_u(),pa&&(r=pa,t=ma,ma=pa=null,eg(r),t)))for(r=0;r<t.length;r++)eg(t[r])}}function Nl(t,r){var l=t.stateNode;if(l===null)return null;var c=l[Bt]||null;if(c===null)return null;l=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jf=!1;if(pi)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){jf=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{jf=!1}var Xi=null,Rf=null,Ho=null;function ng(){if(Ho)return Ho;var t,r=Rf,l=r.length,c,p="value"in Xi?Xi.value:Xi.textContent,y=p.length;for(t=0;t<l&&r[t]===p[t];t++);var S=l-t;for(c=1;c<=S&&r[l-c]===p[y-c];c++);return Ho=p.slice(t,1<c?1-c:void 0)}function Bo(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Uo(){return!0}function ig(){return!1}function Kt(t){function r(l,c,p,y,S){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Uo:ig,this.isPropagationStopped=ig,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Uo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Uo)},persist:function(){},isPersistent:Uo}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Kt(Mr),Ml=m({},Mr,{view:0,detail:0}),i_=Kt(Ml),Of,Lf,Tl,qo=m({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Tl&&(Tl&&t.type==="mousemove"?(Of=t.screenX-Tl.screenX,Lf=t.screenY-Tl.screenY):Lf=Of=0,Tl=t),Of)},movementY:function(t){return"movementY"in t?t.movementY:Lf}}),rg=Kt(qo),r_=m({},qo,{dataTransfer:0}),a_=Kt(r_),l_=m({},Ml,{relatedTarget:0}),Hf=Kt(l_),s_=m({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),o_=Kt(s_),u_=m({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),c_=Kt(u_),f_=m({},Mr,{data:0}),ag=Kt(f_),d_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h_={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"},p_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function m_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=p_[t])?!!r[t]:!1}function Bf(){return m_}var g_=m({},Ml,{key:function(t){if(t.key){var r=d_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Bo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?h_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(t){return t.type==="keypress"?Bo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),y_=Kt(g_),x_=m({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lg=Kt(x_),b_=m({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),v_=Kt(b_),w_=m({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),S_=Kt(w_),__=m({},qo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),k_=Kt(__),E_=m({},Mr,{newState:0,oldState:0}),N_=Kt(E_),C_=[9,13,27,32],Uf=pi&&"CompositionEvent"in window,Al=null;pi&&"documentMode"in document&&(Al=document.documentMode);var M_=pi&&"TextEvent"in window&&!Al,sg=pi&&(!Uf||Al&&8<Al&&11>=Al),og=" ",ug=!1;function cg(t,r){switch(t){case"keyup":return C_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function T_(t,r){switch(t){case"compositionend":return fg(r);case"keypress":return r.which!==32?null:(ug=!0,og);case"textInput":return t=r.data,t===og&&ug?null:t;default:return null}}function A_(t,r){if(ga)return t==="compositionend"||!Uf&&cg(t,r)?(t=ng(),Ho=Rf=Xi=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return sg&&r.locale!=="ko"?null:r.data;default:return null}}var z_={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 dg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!z_[t.type]:r==="textarea"}function hg(t,r,l,c){pa?ma?ma.push(c):ma=[c]:pa=c,r=Au(r,"onChange"),0<r.length&&(l=new Io("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var zl=null,Dl=null;function D_(t){Zy(t,0)}function $o(t){var r=Vi(t);if(Ro(r))return t}function pg(t,r){if(t==="change")return r}var mg=!1;if(pi){var If;if(pi){var qf="oninput"in document;if(!qf){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),qf=typeof gg.oninput=="function"}If=qf}else If=!1;mg=If&&(!document.documentMode||9<document.documentMode)}function yg(){zl&&(zl.detachEvent("onpropertychange",xg),Dl=zl=null)}function xg(t){if(t.propertyName==="value"&&$o(Dl)){var r=[];hg(r,Dl,t,zf(t)),tg(D_,r)}}function j_(t,r,l){t==="focusin"?(yg(),zl=r,Dl=l,zl.attachEvent("onpropertychange",xg)):t==="focusout"&&yg()}function R_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $o(Dl)}function O_(t,r){if(t==="click")return $o(r)}function L_(t,r){if(t==="input"||t==="change")return $o(r)}function H_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:H_;function jl(t,r){if(un(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),c=Object.keys(r);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!Lt.call(r,p)||!un(t[p],r[p]))return!1}return!0}function bg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function vg(t,r){var l=bg(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=r&&c>=r)return{node:l,offset:r-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=bg(l)}}function wg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?wg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Sg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nr(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Nr(t.document)}return r}function $f(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var B_=pi&&"documentMode"in document&&11>=document.documentMode,ya=null,Vf=null,Rl=null,Yf=!1;function _g(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yf||ya==null||ya!==Nr(c)||(c=ya,"selectionStart"in c&&$f(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Rl&&jl(Rl,c)||(Rl=c,c=Au(Vf,"onSelect"),0<c.length&&(r=new Io("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=ya)))}function Tr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var xa={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Pf={},kg={};pi&&(kg=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ar(t){if(Pf[t])return Pf[t];if(!xa[t])return t;var r=xa[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in kg)return Pf[t]=r[l];return t}var Eg=Ar("animationend"),Ng=Ar("animationiteration"),Cg=Ar("animationstart"),U_=Ar("transitionrun"),I_=Ar("transitionstart"),q_=Ar("transitioncancel"),Mg=Ar("transitionend"),Tg=new Map,Xf="abort auxClick beforeToggle 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(" ");Xf.push("scrollEnd");function Hn(t,r){Tg.set(t,r),fi(r,[t])}var Vo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],ba=0,Ff=0;function Yo(){for(var t=ba,r=Ff=ba=0;r<t;){var l=_n[r];_n[r++]=null;var c=_n[r];_n[r++]=null;var p=_n[r];_n[r++]=null;var y=_n[r];if(_n[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&Ag(l,p,y)}}function Po(t,r,l,c){_n[ba++]=t,_n[ba++]=r,_n[ba++]=l,_n[ba++]=c,Ff|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Gf(t,r,l,c){return Po(t,r,l,c),Xo(t)}function zr(t,r){return Po(t,null,null,r),Xo(t)}function Ag(t,r,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,c=y.alternate,c!==null&&(c.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ke(l),t=y.hiddenUpdates,c=t[p],c===null?t[p]=[r]:c.push(r),r.lane=l|536870912),y):null}function Xo(t){if(50<ns)throw ns=0,ih=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var va={};function $_(t,r,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,r,l,c){return new $_(t,r,l,c)}function Zf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,r){var l=t.alternate;return l===null?(l=cn(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function zg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Fo(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Zf(t)&&(S=1);else if(typeof t=="string")S=Fk(t,l,ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case G:return t=cn(31,l,r,p),t.elementType=G,t.lanes=y,t;case N:return Dr(l.children,p,y,r);case E:S=8,p|=24;break;case _:return t=cn(12,l,r,p|2),t.elementType=_,t.lanes=y,t;case L:return t=cn(13,l,r,p),t.elementType=L,t.lanes=y,t;case A:return t=cn(19,l,r,p),t.elementType=A,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:S=10;break e;case j:S=9;break e;case C:S=11;break e;case H:S=14;break e;case F:S=16,c=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=cn(S,l,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function Dr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Qf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Dg(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Kf(t,r,l){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var jg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=jg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:sn(r)},jg.set(t,r),r)}return{value:t,source:r,stack:sn(r)}}var wa=[],Sa=0,Go=null,Ol=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){wa[Sa++]=Ol,wa[Sa++]=Go,Go=t,Ol=r}function Rg(t,r,l){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Fi=t;var c=Qn;t=Kn;var p=32-Ke(c)-1;c&=~(1<<p),l+=1;var y=32-Ke(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Qn=1<<32-Ke(r)+p|l<<p|c,Kn=y+t}else Qn=1<<y|l<<p|c,Kn=t}function Jf(t){t.return!==null&&(gi(t,1),Rg(t,1,0))}function Wf(t){for(;t===Go;)Go=wa[--Sa],wa[Sa]=null,Ol=wa[--Sa],wa[Sa]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Og(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,Ie=!1,Gi=null,Cn=!1,ed=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ll(kn(r,t)),ed}function Lg(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(l=0;l<rs.length;l++)Le(rs[l],r);break;case"source":Le("error",r);break;case"img":case"image":case"link":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"input":Le("invalid",r),Oo(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",r);break;case"textarea":Le("invalid",r),Km(r,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||c.suppressHydrationWarning===!0||Wy(r.textContent,l)?(c.popover!=null&&(Le("beforetoggle",r),Le("toggle",r)),c.onScroll!=null&&Le("scroll",r),c.onScrollEnd!=null&&Le("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function Hg(t){for(zt=t.return;zt;)switch(zt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:zt=zt.return}}function _a(t){if(t!==zt)return!1;if(!Ie)return Hg(t),Ie=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||xh(t.type,t.memoizedProps)),l=!l),l&<&&Zi(t),Hg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ox(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ox(t)}else r===27?(r=lt,ur(t.type)?(t=_h,_h=null,lt=t):lt=r):lt=zt?Tn(t.stateNode.nextSibling):null;return!0}function jr(){lt=zt=null,Ie=!1}function td(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Ll(t){Gi===null?Gi=[t]:Gi.push(t)}var nd=R(null),Rr=null,yi=null;function Qi(t,r,l){T(nd,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=nd.current,$(nd)}function id(t,r,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===l)break;t=t.return}}function rd(t,r,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var I=0;I<r.length;I++)if(M.context===r[I]){y.lanes|=l,M=y.alternate,M!==null&&(M.lanes|=l),id(y.return,l,t),c||(S=null);break e}y=M.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=l,y=S.alternate,y!==null&&(y.lanes|=l),id(S,l,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ka(t,r,l,c){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(us):t=[us])}p=p.return}t!==null&&rd(r,t,l,c),r.flags|=262144}function Zo(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){Rr=t,yi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Dt(t){return Bg(Rr,t)}function Qo(t,r){return Rr===null&&Or(t),Bg(t,r)}function Bg(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},yi===null){if(t===null)throw Error(a(308));yi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else yi=yi.next=r;return l}var V_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},Y_=e.unstable_scheduleCallback,P_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ad(){return{controller:new V_,data:new Map,refCount:0}}function Hl(t){t.refCount--,t.refCount===0&&Y_(P_,function(){t.controller.abort()})}var Bl=null,ld=0,Ea=0,Na=null;function X_(t,r){if(Bl===null){var l=Bl=[];ld=0,Ea=uh(),Na={status:"pending",value:void 0,then:function(c){l.push(c)}}}return ld++,r.then(Ug,Ug),r}function Ug(){if(--ld===0&&Bl!==null){Na!==null&&(Na.status="fulfilled");var t=Bl;Bl=null,Ea=0,Na=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function F_(t,r){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var Ig=D.S;D.S=function(t,r){_y=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&X_(t,r),Ig!==null&&Ig(t,r)};var Lr=R(null);function sd(){var t=Lr.current;return t!==null?t:it.pooledCache}function Ko(t,r){r===null?T(Lr,Lr.current):T(Lr,r.pool)}function qg(){var t=sd();return t===null?null:{parent:xt._currentValue,pool:t}}var Ca=Error(a(460)),od=Error(a(474)),Jo=Error(a(542)),Wo={then:function(){}};function $g(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Vg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(hi,hi),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Pg(t),t;default:if(typeof r.status=="string")r.then(hi,hi);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Pg(t),t}throw Br=r,Ca}}function Hr(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Br=l,Ca):l}}var Br=null;function Yg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Pg(t){if(t===Ca||t===Jo)throw Error(a(483))}var Ma=null,Ul=0;function eu(t){var r=Ul;return Ul+=1,Ma===null&&(Ma=[]),Vg(Ma,t,r)}function Il(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function tu(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Xg(t){function r(Z,X){if(t){var J=Z.deletions;J===null?(Z.deletions=[X],Z.flags|=16):J.push(X)}}function l(Z,X){if(!t)return null;for(;X!==null;)r(Z,X),X=X.sibling;return null}function c(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function p(Z,X){return Z=mi(Z,X),Z.index=0,Z.sibling=null,Z}function y(Z,X,J){return Z.index=J,t?(J=Z.alternate,J!==null?(J=J.index,J<X?(Z.flags|=67108866,X):J):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function S(Z){return t&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,X,J,se){return X===null||X.tag!==6?(X=Qf(J,Z.mode,se),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function I(Z,X,J,se){var ve=J.type;return ve===N?le(Z,X,J.props.children,se,J.key):X!==null&&(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type)?(X=p(X,J.props),Il(X,J),X.return=Z,X):(X=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(X,J),X.return=Z,X)}function W(Z,X,J,se){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Kf(J,Z.mode,se),X.return=Z,X):(X=p(X,J.children||[]),X.return=Z,X)}function le(Z,X,J,se,ve){return X===null||X.tag!==7?(X=Dr(J,Z.mode,se,ve),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function oe(Z,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Qf(""+X,Z.mode,J),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Fo(X.type,X.key,X.props,null,Z.mode,J),Il(J,X),J.return=Z,J;case w:return X=Kf(X,Z.mode,J),X.return=Z,X;case F:return X=Hr(X),oe(Z,X,J)}if(B(X)||Y(X))return X=Dr(X,Z.mode,J,null),X.return=Z,X;if(typeof X.then=="function")return oe(Z,eu(X),J);if(X.$$typeof===k)return oe(Z,Qo(Z,X),J);tu(Z,X)}return null}function ee(Z,X,J,se){var ve=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:M(Z,X,""+J,se);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Z,X,J,se):null;case w:return J.key===ve?W(Z,X,J,se):null;case F:return J=Hr(J),ee(Z,X,J,se)}if(B(J)||Y(J))return ve!==null?null:le(Z,X,J,se,null);if(typeof J.then=="function")return ee(Z,X,eu(J),se);if(J.$$typeof===k)return ee(Z,X,Qo(Z,J),se);tu(Z,J)}return null}function re(Z,X,J,se,ve){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Z=Z.get(J)||null,M(X,Z,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case b:return Z=Z.get(se.key===null?J:se.key)||null,I(X,Z,se,ve);case w:return Z=Z.get(se.key===null?J:se.key)||null,W(X,Z,se,ve);case F:return se=Hr(se),re(Z,X,J,se,ve)}if(B(se)||Y(se))return Z=Z.get(J)||null,le(X,Z,se,ve,null);if(typeof se.then=="function")return re(Z,X,J,eu(se),ve);if(se.$$typeof===k)return re(Z,X,J,Qo(X,se),ve);tu(X,se)}return null}function ye(Z,X,J,se){for(var ve=null,Fe=null,xe=X,ze=X=0,Ue=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ue=xe,xe=null):Ue=xe.sibling;var Ge=ee(Z,xe,J[ze],se);if(Ge===null){xe===null&&(xe=Ue);break}t&&xe&&Ge.alternate===null&&r(Z,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ue}if(ze===J.length)return l(Z,xe),Ie&&gi(Z,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=oe(Z,J[ze],se),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return Ie&&gi(Z,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ue=re(xe,Z,ze,J[ze],se),Ue!==null&&(t&&Ue.alternate!==null&&xe.delete(Ue.key===null?ze:Ue.key),X=y(Ue,X,ze),Fe===null?ve=Ue:Fe.sibling=Ue,Fe=Ue);return t&&xe.forEach(function(pr){return r(Z,pr)}),Ie&&gi(Z,ze),ve}function ke(Z,X,J,se){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ue=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ue=xe,xe=null):Ue=xe.sibling;var pr=ee(Z,xe,Ge.value,se);if(pr===null){xe===null&&(xe=Ue);break}t&&xe&&pr.alternate===null&&r(Z,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ue}if(Ge.done)return l(Z,xe),Ie&&gi(Z,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=oe(Z,Ge.value,se),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return Ie&&gi(Z,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Z,ze,Ge.value,se),Ge!==null&&(t&&Ge.alternate!==null&&xe.delete(Ge.key===null?ze:Ge.key),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return t&&xe.forEach(function(rE){return r(Z,rE)}),Ie&&gi(Z,ze),ve}function nt(Z,X,J,se){if(typeof J=="object"&&J!==null&&J.type===N&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;X!==null;){if(X.key===ve){if(ve=J.type,ve===N){if(X.tag===7){l(Z,X.sibling),se=p(X,J.props.children),se.return=Z,Z=se;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Z,X.sibling),se=p(X,J.props),Il(se,J),se.return=Z,Z=se;break e}l(Z,X);break}else r(Z,X);X=X.sibling}J.type===N?(se=Dr(J.props.children,Z.mode,se,J.key),se.return=Z,Z=se):(se=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(se,J),se.return=Z,Z=se)}return S(Z);case w:e:{for(ve=J.key;X!==null;){if(X.key===ve)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Z,X.sibling),se=p(X,J.children||[]),se.return=Z,Z=se;break e}else{l(Z,X);break}else r(Z,X);X=X.sibling}se=Kf(J,Z.mode,se),se.return=Z,Z=se}return S(Z);case F:return J=Hr(J),nt(Z,X,J,se)}if(B(J))return ye(Z,X,J,se);if(Y(J)){if(ve=Y(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Z,X,J,se)}if(typeof J.then=="function")return nt(Z,X,eu(J),se);if(J.$$typeof===k)return nt(Z,X,Qo(Z,J),se);tu(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Z,X.sibling),se=p(X,J),se.return=Z,Z=se):(l(Z,X),se=Qf(J,Z.mode,se),se.return=Z,Z=se),S(Z)):l(Z,X)}return function(Z,X,J,se){try{Ul=0;var ve=nt(Z,X,J,se);return Ma=null,ve}catch(xe){if(xe===Ca||xe===Jo)throw xe;var Fe=cn(29,xe,null,Z.mode);return Fe.lanes=se,Fe.return=Z,Fe}}}var Ur=Xg(!0),Fg=Xg(!1),Ki=!1;function ud(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(t,r,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Qe&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Xo(t),Ag(t,null,l),r}return Po(t,c,r,l),Xo(t)}function ql(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}function fd(t,r){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=r:y=y.next=r}else p=y=r;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var dd=!1;function $l(){if(dd){var t=Na;if(t!==null)throw t}}function Vl(t,r,l,c){dd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var I=M,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=I))}if(y!==null){var oe=p.baseState;S=0,le=W=I=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Be&ee)===ee:(c&ee)===ee){ee!==0&&ee===Ea&&(dd=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,ke=M;ee=r;var nt=l;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){oe=ye.call(nt,oe,ee);break e}oe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(nt,oe,ee):ye,ee==null)break e;oe=m({},oe,ee);break e;case 2:Ki=!0}}ee=M.callback,ee!==null&&(t.flags|=64,re&&(t.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=re,I=oe):le=le.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);le===null&&(I=oe),p.baseState=I,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),rr|=S,t.lanes=S,t.memoizedState=oe}}function Gg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Zg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Gg(l[t],r)}var Ta=R(null),nu=R(0);function Qg(t,r){t=Ci,T(nu,t),T(Ta,r),Ci=t|r.baseLanes}function hd(){T(nu,Ci),T(Ta,Ta.current)}function pd(){Ci=nu.current,$(Ta),$(nu)}var fn=R(null),Mn=null;function er(t){var r=t.alternate;T(mt,mt.current&1),T(fn,t),Mn===null&&(r===null||Ta.current!==null||r.memoizedState!==null)&&(Mn=t)}function md(t){T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)}function Kg(t){t.tag===22?(T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)):tr()}function tr(){T(mt,mt.current),T(fn,fn.current)}function dn(t){$(fn),Mn===t&&(Mn=null),$(mt)}var mt=R(0);function iu(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||wh(l)||Sh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bi=0,Ae=null,et=null,bt=null,ru=!1,Aa=!1,Ir=!1,au=0,Yl=0,za=null,G_=0;function ft(){throw Error(a(321))}function gd(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!un(t[l],r[l]))return!1;return!0}function yd(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=t===null||t.memoizedState===null?R0:Dd,Ir=!1,y=l(c,p),Ir=!1,Aa&&(y=Wg(r,l,c,p)),Jg(t),y}function Jg(t){D.H=Fl;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,ru=!1,Yl=0,za=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Zo(t)&&(vt=!0))}function Wg(t,r,l,c){Ae=t;var p=0;do{if(Aa&&(za=null),Yl=0,Aa=!1,25<=p)throw Error(a(301));if(p+=1,bt=et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=O0,y=r(l,c)}while(Aa);return y}function Z_(){var t=D.H,r=t.useState()[0];return r=typeof r.then=="function"?Pl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function xd(){var t=au!==0;return au=0,t}function bd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function vd(t){if(ru){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ru=!1}bi=0,bt=et=Ae=null,Aa=!1,Yl=au=0,za=null}function Yt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ae.memoizedState=bt=t:bt=bt.next=t,bt}function gt(){if(et===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var r=bt===null?Ae.memoizedState:bt.next;if(r!==null)bt=r,et=t;else{if(t===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},bt===null?Ae.memoizedState=bt=t:bt=bt.next=t}return bt}function lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pl(t){var r=Yl;return Yl+=1,za===null&&(za=[]),t=Vg(za,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?R0:Dd),t}function su(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Pl(t);if(t.$$typeof===k)return Dt(t)}throw Error(a(438,String(t)))}function wd(t){var r=null,l=Ae.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=lu(),Ae.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),c=0;c<t;c++)l[c]=q;return r.index++,l}function vi(t,r){return typeof r=="function"?r(t):r}function ou(t){var r=gt();return Sd(r,et,t)}function Sd(t,r,l){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=l;var p=t.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,c.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var M=S=null,I=null,W=r,le=!1;do{var oe=W.lane&-536870913;if(oe!==W.lane?(Be&oe)===oe:(bi&oe)===oe){var ee=W.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),oe===Ea&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Ea&&(le=!0);continue}else oe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=oe,S=y):I=I.next=oe,Ae.lanes|=ee,rr|=ee;oe=W.action,Ir&&l(y,oe),y=W.hasEagerState?W.eagerState:l(y,oe)}else ee={lane:oe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=ee,S=y):I=I.next=ee,Ae.lanes|=oe,rr|=oe;W=W.next}while(W!==null&&W!==r);if(I===null?S=y:I.next=M,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Na,l!==null)))throw l;t.memoizedState=y,t.baseState=S,t.baseQueue=I,c.lastRenderedState=y}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function _d(t){var r=gt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,y=r.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);un(y,r.memoizedState)||(vt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,c]}function e0(t,r,l){var c=Ae,p=gt(),y=Ie;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=r();var S=!un((et||p).memoizedState,l);if(S&&(p.memoizedState=l,vt=!0),p=p.queue,Nd(i0.bind(null,c,p,t),[t]),p.getSnapshot!==r||S||bt!==null&&bt.memoizedState.tag&1){if(c.flags|=2048,Da(9,{destroy:void 0},n0.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||t0(c,r,l)}return l}function t0(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=lu(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function n0(t,r,l,c){r.value=l,r.getSnapshot=c,r0(r)&&a0(t)}function i0(t,r,l){return l(function(){r0(r)&&a0(t)})}function r0(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function a0(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function kd(t){var r=Yt();if(typeof t=="function"){var l=t;if(t=l(),Ir){Ht(!0);try{l()}finally{Ht(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},r}function l0(t,r,l,c){return t.baseState=l,Sd(t,et,typeof c=="function"?c:vi)}function Q_(t,r,l,c,p){if(fu(t))throw Error(a(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};D.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,s0(r,y)):(y.next=l.next,r.pending=l.next=y)}}function s0(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=D.T,S={};D.T=S;try{var M=l(p,c),I=D.S;I!==null&&I(S,M),o0(t,r,M)}catch(W){Ed(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),D.T=y}}else try{y=l(p,c),o0(t,r,y)}catch(W){Ed(t,r,W)}}function o0(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){u0(t,r,c)},function(c){return Ed(t,r,c)}):u0(t,r,l)}function u0(t,r,l){r.status="fulfilled",r.value=l,c0(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,s0(t,l)))}function Ed(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,c0(r),r=r.next;while(r!==c)}t.action=null}function c0(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function f0(t,r){return r}function d0(t,r){if(Ie){var l=it.formState;if(l!==null){e:{var c=Ae;if(Ie){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Tn(p.nextSibling),c=p.data==="F!";break e}}Zi(c)}c=!1}c&&(r=l[0])}}return l=Yt(),l.memoizedState=l.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f0,lastRenderedState:r},l.queue=c,l=z0.bind(null,Ae,c),c.dispatch=l,c=kd(!1),y=zd.bind(null,Ae,!1,c.queue),c=Yt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=Q_.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function h0(t){var r=gt();return p0(r,et,t)}function p0(t,r,l){if(r=Sd(t,r,f0)[0],t=ou(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Pl(r)}catch(S){throw S===Ca?Jo:S}else c=r;r=gt();var p=r.queue,y=p.dispatch;return l!==r.memoizedState&&(Ae.flags|=2048,Da(9,{destroy:void 0},K_.bind(null,p,l),null)),[c,y,t]}function K_(t,r){t.action=r}function m0(t){var r=gt(),l=et;if(l!==null)return p0(r,l,t);gt(),r=r.memoizedState,l=gt();var c=l.queue.dispatch;return l.memoizedState=t,[r,c,!1]}function Da(t,r,l,c){return t={tag:t,create:l,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=lu(),Ae.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,r.lastEffect=t),t}function g0(){return gt().memoizedState}function uu(t,r,l,c){var p=Yt();Ae.flags|=t,p.memoizedState=Da(1|r,{destroy:void 0},l,c===void 0?null:c)}function cu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&gd(c,et.memoizedState.deps)?p.memoizedState=Da(r,y,l,c):(Ae.flags|=t,p.memoizedState=Da(1|r,y,l,c))}function y0(t,r){uu(8390656,8,t,r)}function Nd(t,r){cu(2048,8,t,r)}function J_(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=lu(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function x0(t){var r=gt().memoizedState;return J_({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function b0(t,r){return cu(4,2,t,r)}function v0(t,r){return cu(4,4,t,r)}function w0(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function S0(t,r,l){l=l!=null?l.concat([t]):null,cu(4,4,w0.bind(null,r,t),l)}function Cd(){}function _0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&gd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function k0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&gd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Md(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Be&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=Ey(),Ae.lanes|=t,rr|=t,l)}function E0(t,r,l,c){return un(l,r)?l:Ta.current!==null?(t=Md(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Be&261930)===0?(vt=!0,t.memoizedState=l):(t=Ey(),Ae.lanes|=t,rr|=t,r)}function N0(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=D.T,M={};D.T=M,zd(t,!1,r,l);try{var I=p(),W=D.S;if(W!==null&&W(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=F_(I,c);Xl(t,r,le,mn(t))}else Xl(t,r,c,mn(t))}catch(oe){Xl(t,r,{then:function(){},status:"rejected",reason:oe},mn())}finally{U.p=y,S!==null&&M.types!==null&&(S.types=M.types),D.T=S}}function W_(){}function Td(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=C0(t).queue;N0(t,p,r,P,l===null?W_:function(){return M0(t),l(c)})}function C0(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:P},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function M0(t){var r=C0(t);r.next===null&&(r=t.alternate.memoizedState),Xl(t,r.next.queue,{},mn())}function Ad(){return Dt(us)}function T0(){return gt().memoizedState}function A0(){return gt().memoizedState}function ek(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=mn();t=Ji(l);var c=Wi(r,t,l);c!==null&&(nn(c,r,l),ql(c,r,l)),r={cache:ad()},t.payload=r;return}r=r.return}}function tk(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fu(t)?D0(r,l):(l=Gf(t,r,l,c),l!==null&&(nn(l,t,c),j0(l,r,c)))}function z0(t,r,l){var c=mn();Xl(t,r,l,c)}function Xl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(fu(t))D0(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,M=y(S,l);if(p.hasEagerState=!0,p.eagerState=M,un(M,S))return Po(t,r,p,0),it===null&&Yo(),!1}catch{}if(l=Gf(t,r,p,c),l!==null)return nn(l,t,c),j0(l,r,c),!0}return!1}function zd(t,r,l,c){if(c={lane:2,revertLane:uh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},fu(t)){if(r)throw Error(a(479))}else r=Gf(t,l,c,2),r!==null&&nn(r,t,2)}function fu(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function D0(t,r){Aa=ru=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function j0(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}var Fl={readContext:Dt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};Fl.useEffectEvent=ft;var R0={readContext:Dt,use:su,useCallback:function(t,r){return Yt().memoizedState=[t,r===void 0?null:r],t},useContext:Dt,useEffect:y0,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,uu(4194308,4,w0.bind(null,r,t),l)},useLayoutEffect:function(t,r){return uu(4194308,4,t,r)},useInsertionEffect:function(t,r){uu(4,2,t,r)},useMemo:function(t,r){var l=Yt();r=r===void 0?null:r;var c=t();if(Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c},useReducer:function(t,r,l){var c=Yt();if(l!==void 0){var p=l(r);if(Ir){Ht(!0);try{l(r)}finally{Ht(!1)}}}else p=r;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=tk.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Yt();return t={current:t},r.memoizedState=t},useState:function(t){t=kd(t);var r=t.queue,l=z0.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Cd,useDeferredValue:function(t,r){var l=Yt();return Md(l,t,r)},useTransition:function(){var t=kd(!1);return t=N0.bind(null,Ae,t.queue,!0,!1),Yt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Yt();if(Ie){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Be&127)!==0||t0(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,y0(i0.bind(null,c,y,t),[t]),c.flags|=2048,Da(9,{destroy:void 0},n0.bind(null,c,y,l,r),null),l},useId:function(){var t=Yt(),r=it.identifierPrefix;if(Ie){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=au++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=G_++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Ad,useFormState:d0,useActionState:d0,useOptimistic:function(t){var r=Yt();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=zd.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:wd,useCacheRefresh:function(){return Yt().memoizedState=ek.bind(null,Ae)},useEffectEvent:function(t){var r=Yt(),l={impl:t};return r.memoizedState=l,function(){if((Qe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Dd={readContext:Dt,use:su,useCallback:_0,useContext:Dt,useEffect:Nd,useImperativeHandle:S0,useInsertionEffect:b0,useLayoutEffect:v0,useMemo:k0,useReducer:ou,useRef:g0,useState:function(){return ou(vi)},useDebugValue:Cd,useDeferredValue:function(t,r){var l=gt();return E0(l,et.memoizedState,t,r)},useTransition:function(){var t=ou(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Pl(t),r]},useSyncExternalStore:e0,useId:T0,useHostTransitionStatus:Ad,useFormState:h0,useActionState:h0,useOptimistic:function(t,r){var l=gt();return l0(l,et,t,r)},useMemoCache:wd,useCacheRefresh:A0};Dd.useEffectEvent=x0;var O0={readContext:Dt,use:su,useCallback:_0,useContext:Dt,useEffect:Nd,useImperativeHandle:S0,useInsertionEffect:b0,useLayoutEffect:v0,useMemo:k0,useReducer:_d,useRef:g0,useState:function(){return _d(vi)},useDebugValue:Cd,useDeferredValue:function(t,r){var l=gt();return et===null?Md(l,t,r):E0(l,et.memoizedState,t,r)},useTransition:function(){var t=_d(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Pl(t),r]},useSyncExternalStore:e0,useId:T0,useHostTransitionStatus:Ad,useFormState:m0,useActionState:m0,useOptimistic:function(t,r){var l=gt();return et!==null?l0(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:wd,useCacheRefresh:A0};O0.useEffectEvent=x0;function jd(t,r,l,c){r=t.memoizedState,l=l(c,r),l=l==null?r:m({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Rd={enqueueSetState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=mn(),c=Ji(l);c.tag=2,r!=null&&(c.callback=r),r=Wi(t,c,l),r!==null&&(nn(r,t,l),ql(r,t,l))}};function L0(t,r,l,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!jl(l,c)||!jl(p,y):!0}function H0(t,r,l,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,c),r.state!==t&&Rd.enqueueReplaceState(r,r.state,null)}function qr(t,r){var l=r;if("ref"in r){l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}if(t=t.defaultProps){l===r&&(l=m({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function B0(t){Vo(t)}function U0(t){console.error(t)}function I0(t){Vo(t)}function du(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function q0(t,r,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Od(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){du(t,r)},l}function $0(t){return t=Ji(t),t.tag=3,t}function V0(t,r,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;t.payload=function(){return p(y)},t.callback=function(){q0(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){q0(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function nk(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&ka(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Mn===null?ku():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),lh(t,c,p)),!1;case 22:return l.flags|=65536,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([c]):l.add(c)),lh(t,c,p)),!1}throw Error(a(435,l.tag))}return lh(t,c,p),ku(),!1}if(Ie)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==ed&&(t=Error(a(422),{cause:c}),Ll(kn(t,l)))):(c!==ed&&(r=Error(a(423),{cause:c}),Ll(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=Od(t.stateNode,c,p),fd(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),ts===null?ts=[y]:ts.push(y),dt!==4&&(dt=2),r===null)return!0;c=kn(c,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=Od(l.stateNode,c,t),fd(l,t),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ar===null||!ar.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=$0(p),V0(p,t,l,c),fd(l,p),!1}l=l.return}while(l!==null);return!1}var Ld=Error(a(461)),vt=!1;function jt(t,r,l,c){r.child=t===null?Fg(r,null,l,c):Ur(r,t.child,l,c)}function Y0(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Or(r),c=yd(t,r,l,S,y,p),M=xd(),t!==null&&!vt?(bd(t,r,p),wi(t,r,p)):(Ie&&M&&Jf(r),r.flags|=1,jt(t,r,c,p),r.child)}function P0(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Zf(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,X0(t,r,y,c,p)):(t=Fo(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Yd(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:jl,l(S,c)&&t.ref===r.ref)return wi(t,r,p)}return r.flags|=1,t=mi(y,c),t.ref=r.ref,t.return=r,r.child=t}function X0(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(jl(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,Yd(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Hd(t,r,l,c,p)}function F0(t,r,l,c){var p=c.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,t!==null){for(c=r.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return G0(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ko(r,y!==null?y.cachePool:null),y!==null?Qg(r,y):hd(),Kg(r);else return c=r.lanes=536870912,G0(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Ko(r,y.cachePool),Qg(r,y),tr(),r.memoizedState=null):(t!==null&&Ko(r,null),hd(),tr());return jt(t,r,p,l),r.child}function Gl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function G0(t,r,l,c,p){var y=sd();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Ko(r,null),hd(),Kg(r),t!==null&&ka(t,r,c,!0),r.childLanes=p,null}function hu(t,r){return r=mu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Z0(t,r,l){return Ur(r,t.child,null,l),t=hu(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function ik(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Ie){if(c.mode==="hidden")return t=hu(r,c),r.lanes=536870912,Gl(null,t);if(md(r),(t=lt)?(t=sx(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return hu(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(md(r),p)if(r.flags&256)r.flags&=-257,r=Z0(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(vt||ka(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=Eo(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Ld;ku(),r=Z0(t,r,l)}else t=y.treeContext,lt=Tn(S.nextSibling),zt=r,Ie=!0,Gi=null,Cn=!1,t!==null&&Og(r,t),r=hu(r,c),r.flags|=4096;return r}return t=mi(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function pu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function Hd(t,r,l,c,p){return Or(r),l=yd(t,r,l,c,void 0,p),c=xd(),t!==null&&!vt?(bd(t,r,p),wi(t,r,p)):(Ie&&c&&Jf(r),r.flags|=1,jt(t,r,l,p),r.child)}function Q0(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=Wg(r,c,l,p),Jg(t),c=xd(),t!==null&&!vt?(bd(t,r,y),wi(t,r,y)):(Ie&&c&&Jf(r),r.flags|=1,jt(t,r,l,y),r.child)}function K0(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=va,S=l.contextType;typeof S=="object"&&S!==null&&(y=Dt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Rd,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},ud(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?Dt(S):va,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(jd(r,l,S,c),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Rd.enqueueReplaceState(y,y.state,null),Vl(r,c,y,p),$l(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,I=qr(l,M);y.props=I;var W=y.context,le=l.contextType;S=va,typeof le=="object"&&le!==null&&(S=Dt(le));var oe=l.getDerivedStateFromProps;le=typeof oe=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&H0(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Vl(r,c,y,p),$l(),W=r.memoizedState,M||ee!==W||Ki?(typeof oe=="function"&&(jd(r,l,oe,c),W=r.memoizedState),(I=Ki||L0(r,l,I,c,ee,W,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=W),y.props=c,y.state=W,y.context=S,c=I):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,cd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,oe=r.pendingProps,ee=y.context,W=l.contextType,I=va,typeof W=="object"&&W!==null&&(I=Dt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==oe||ee!==I)&&H0(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Vl(r,c,y,p),$l();var re=r.memoizedState;S!==oe||ee!==re||Ki||t!==null&&t.dependencies!==null&&Zo(t.dependencies)?(typeof M=="function"&&(jd(r,l,M,c),re=r.memoizedState),(le=Ki||L0(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Zo(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,I)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=re),y.props=c,y.state=re,y.context=I,c=le):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),c=!1)}return y=c,pu(t,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&c?(r.child=Ur(r,t.child,null,p),r.child=Ur(r,null,l,p)):jt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function J0(t,r,l,c){return jr(),r.flags|=256,jt(t,r,l,c),r.child}var Bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(t){return{baseLanes:t,cachePool:qg()}}function Id(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function W0(t,r,l){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(Ie){if(p?er(r):tr(),(t=lt)?(t=sx(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return Sh(t)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(tr(),p=r.mode,M=mu({mode:"hidden",children:M},p),c=Dr(c,p,l,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=Ud(l),c.childLanes=Id(t,S,l),r.memoizedState=Bd,Gl(null,c)):(er(r),qd(r,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=$d(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),M=c.fallback,p=r.mode,c=mu({mode:"visible",children:c.children},p),M=Dr(M,p,l,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=Ud(l),c.childLanes=Id(t,S,l),r.memoizedState=Bd,r=Gl(null,c));else if(er(r),Sh(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Ll({value:c,source:null,stack:null}),r=$d(t,r,l)}else if(vt||ka(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=Eo(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Ld;wh(M)||ku(),r=$d(t,r,l)}else wh(M)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Tn(M.nextSibling),zt=r,Ie=!0,Gi=null,Cn=!1,t!==null&&Og(r,t),r=qd(r,c.children),r.flags|=4096);return r}return p?(tr(),M=c.fallback,p=r.mode,I=t.child,W=I.sibling,c=mi(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?M=mi(W,M):(M=Dr(M,p,l,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Gl(null,c),c=r.child,M=t.child.memoizedState,M===null?M=Ud(l):(p=M.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=qg(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=Id(t,S,l),r.memoizedState=Bd,Gl(t.child,c)):(er(r),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:c.children}),l.return=r,l.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=l,r.memoizedState=null,l)}function qd(t,r){return r=mu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function mu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function $d(t,r,l){return Ur(r,t.child,null,l),t=qd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function ey(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),id(t.return,r,l)}function Vd(t,r,l,c,p,y){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=l,S.tailMode=p,S.treeForkCount=y)}function ty(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,T(mt,S),jt(t,r,c,l),c=Ie?Ol:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ey(t,l,r);else if(t.tag===19)ey(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)t=l.alternate,t!==null&&iu(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),Vd(r,!1,p,l,y,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&iu(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Vd(r,!0,l,null,y,c);break;case"together":Vd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function wi(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),rr|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(ka(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=mi(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function Yd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Zo(t)))}function rk(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),jr();break;case 27:case 5:Ee(r);break;case 4:ue(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,md(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(er(r),r.flags|=128,null):(l&r.child.childLanes)!==0?W0(t,r,l):(er(r),t=wi(t,r,l),t!==null?t.sibling:null);er(r);break;case 19:var p=(t.flags&128)!==0;if(c=(l&r.childLanes)!==0,c||(ka(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return ty(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(mt,mt.current),c)break;return null;case 22:return r.lanes=0,F0(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function ny(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!Yd(t,l)&&(r.flags&128)===0)return vt=!1,rk(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,Ie&&(r.flags&1048576)!==0&&Rg(r,Ol,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=Hr(r.elementType),r.type=t,typeof t=="function")Zf(t)?(c=qr(t,c),r.tag=1,r=K0(null,r,t,c,l)):(r.tag=0,r=Hd(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=Y0(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=P0(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Hd(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),K0(t,r,c,p,l);case 3:e:{if(ue(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,cd(t,r),Vl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&rd(r,[xt],l,!0),$l(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=J0(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Ll(p),r=J0(t,r,c,l);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=Tn(t.firstChild),zt=r,Ie=!0,Gi=null,Cn=!0,l=Fg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(jr(),c===p){r=wi(t,r,l);break e}jt(t,r,c,l)}r=r.child}return r;case 26:return pu(t,r),t===null?(l=hx(r.type,null,r.pendingProps,null))?r.memoizedState=l:Ie||(l=r.type,t=r.pendingProps,c=zu(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=hx(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&Ie&&(c=r.stateNode=cx(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(_h=p,lt=Tn(c.firstChild)):lt=p),jt(t,r,r.pendingProps.children,l),pu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Ie&&((p=c=lt)&&(c=Rk(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Tn(c.firstChild),Cn=!1,p=!0):p=!1),p||Zi(r)),Ee(r),p=r.type,y=r.pendingProps,S=t!==null?t.memoizedProps:null,c=y.children,xh(p,y)?c=null:S!==null&&xh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=yd(t,r,Z_,null,null,l),us._currentValue=p),pu(t,r),jt(t,r,c,l),r.child;case 6:return t===null&&Ie&&((t=l=lt)&&(l=Ok(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return W0(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):jt(t,r,c,l),r.child;case 11:return Y0(t,r,r.type,r.pendingProps,l);case 7:return jt(t,r,r.pendingProps,l),r.child;case 8:return jt(t,r,r.pendingProps.children,l),r.child;case 12:return jt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),jt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=Dt(p),c=c(p),r.flags|=1,jt(t,r,c,l),r.child;case 14:return P0(t,r,r.type,r.pendingProps,l);case 15:return X0(t,r,r.type,r.pendingProps,l);case 19:return ty(t,r,l);case 31:return ik(t,r,l);case 22:return F0(t,r,l,r.pendingProps);case 24:return Or(r),c=Dt(xt),t===null?(p=sd(),p===null&&(p=it,y=ad(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},ud(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(cd(t,r),Vl(r,null,null,l),$l()),p=t.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Qi(r,xt,c)):(c=y.cache,Qi(r,xt,c),c!==p.cache&&rd(r,[xt],l,!0))),jt(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Si(t){t.flags|=4}function Pd(t,r,l,c,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Ty())t.flags|=8192;else throw Br=Wo,od}else t.flags&=-16777217}function iy(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!xx(r))if(Ty())t.flags|=8192;else throw Br=Wo,od}function gu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?So():536870912,t.lanes|=r,La|=r)}function Zl(t,r){if(!Ie)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function st(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(r)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,r}function ak(t,r,l){var c=r.pendingProps;switch(Wf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(r),null;case 1:return st(r),null;case 3:return l=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xi(xt),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(_a(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,td())),st(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(st(r),iy(r,y)):(st(r),Pd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),st(r),iy(r,y)):(st(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),st(r),Pd(r,p,t,c,l)),null;case 27:if(Ce(r),l=fe.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}t=ie.current,_a(r)?Lg(r):(t=cx(p,c,l),r.stateNode=t,Si(r))}return st(r),null;case 5:if(Ce(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}if(y=ie.current,_a(r))Lg(r);else{var S=zu(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Nt]=r,y[Bt]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;e:switch(Rt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Si(r)}}return st(r),Pd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=fe.current,_a(r)){if(t=r.stateNode,l=r.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||Wy(t.nodeValue,l)),t||Zi(r,!0)}else t=zu(t).createTextNode(c),t[Nt]=r,r.stateNode=t}return st(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(c=_a(r),l!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=r}else jr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),t=!1}else l=td(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(dn(r),r):(dn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return st(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=_a(r),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Nt]=r}else jr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),p=!1}else p=td(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(dn(r),r):(dn(r),null)}return dn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),gu(r,r.updateQueue),st(r),null);case 4:return me(),t===null&&hh(r.stateNode.containerInfo),st(r),null;case 10:return xi(r.type),st(r),null;case 19:if($(mt),c=r.memoizedState,c===null)return st(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)Zl(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=iu(t),y!==null){for(r.flags|=128,Zl(c,!1),t=y.updateQueue,r.updateQueue=t,gu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)zg(l,t),l=l.sibling;return T(mt,mt.current&1|2),Ie&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>wu&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304)}else{if(!p)if(t=iu(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,gu(r,t),Zl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!Ie)return st(r),null}else 2*Et()-c.renderingStartTime>wu&&l!==536870912&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(t=c.last,t!==null?t.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,l=mt.current,T(mt,p?l&1|2:l&1),Ie&&gi(r,c.treeForkCount),t):(st(r),null);case 22:case 23:return dn(r),pd(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(l&536870912)!==0&&(r.flags&128)===0&&(st(r),r.subtreeFlags&6&&(r.flags|=8192)):st(r),l=r.updateQueue,l!==null&&gu(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==l&&(r.flags|=2048),t!==null&&$(Lr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(xt),st(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function lk(t,r){switch(Wf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xi(xt),me(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ce(r),null;case 31:if(r.memoizedState!==null){if(dn(r),r.alternate===null)throw Error(a(340));jr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(dn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));jr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(mt),null;case 4:return me(),null;case 10:return xi(r.type),null;case 22:case 23:return dn(r),pd(),t!==null&&$(Lr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xi(xt),null;case 25:return null;default:return null}}function ry(t,r){switch(Wf(r),r.tag){case 3:xi(xt),me();break;case 26:case 27:case 5:Ce(r);break;case 4:me();break;case 31:r.memoizedState!==null&&dn(r);break;case 13:dn(r);break;case 19:$(mt);break;case 10:xi(r.type);break;case 22:case 23:dn(r),pd(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Ql(t,r){try{var l=r.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var y=l.create,S=l.inst;c=y(),S.destroy=c}l=l.next}while(l!==p)}}catch(M){We(r,r.return,M)}}function nr(t,r,l){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&t)===t){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=r;var I=l,W=M;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function ay(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Zg(r,l)}catch(c){We(t,t.return,c)}}}function ly(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function Kl(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){We(t,r,p)}}function Jn(t,r){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){We(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){We(t,r,p)}else l.current=null}function sy(t){var r=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){We(t,t.return,p)}}function Xd(t,r,l){try{var c=t.stateNode;Mk(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function oy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||oy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Gd(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=hi));else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Gd(t,r,l),t=t.sibling;t!==null;)Gd(t,r,l),t=t.sibling}function yu(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(yu(t,r,l),t=t.sibling;t!==null;)yu(t,r,l),t=t.sibling}function uy(t){var r=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Rt(r,c,l),r[Nt]=t,r[Bt]=l}catch(y){We(t,t.return,y)}}var _i=!1,wt=!1,Zd=!1,cy=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function sk(t,r){if(t=t.containerInfo,gh=Bu,t=Sg(t),$f(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,M=-1,I=-1,W=0,le=0,oe=t,ee=null;t:for(;;){for(var re;oe!==l||p!==0&&oe.nodeType!==3||(M=S+p),oe!==y||c!==0&&oe.nodeType!==3||(I=S+c),oe.nodeType===3&&(S+=oe.nodeValue.length),(re=oe.firstChild)!==null;)ee=oe,oe=re;for(;;){if(oe===t)break t;if(ee===l&&++W===p&&(M=S),ee===y&&++le===c&&(I=S),(re=oe.nextSibling)!==null)break;oe=ee,ee=oe.parentNode}oe=re}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(yh={focusedElem:t,selectionRange:l},Bu=!1,Tt=r;Tt!==null;)if(r=Tt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Tt=t;else for(;Tt!==null;){switch(r=Tt,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,l=r,p=y.memoizedProps,y=y.memoizedState,c=l.stateNode;try{var ye=qr(l.type,p);t=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=t}catch(ke){We(l,l.return,ke)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)vh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":vh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Tt=t;break}Tt=r.return}}function fy(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Ql(5,l);break;case 1:if(Ei(t,l),c&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(S){We(l,l.return,S)}else{var p=qr(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){We(l,l.return,S)}}c&64&&ay(l),c&512&&Kl(l,l.return);break;case 3:if(Ei(t,l),c&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Zg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&uy(l);case 26:case 5:Ei(t,l),r===null&&c&4&&sy(l),c&512&&Kl(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&py(t,l);break;case 13:Ei(t,l),c&4&&my(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=gk.bind(null,l),Lk(t,l))));break;case 22:if(c=l.memoizedState!==null||_i,!c){r=r!==null&&r.memoizedState!==null||wt,p=_i;var y=wt;_i=c,(wt=r)&&!y?Ni(t,l,(l.subtreeFlags&8772)!==0):Ei(t,l),_i=p,wt=y}break;case 30:break;default:Ei(t,l)}}function dy(t){var r=t.alternate;r!==null&&(t.alternate=null,dy(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&_l(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Jt=!1;function ki(t,r,l){for(l=l.child;l!==null;)hy(t,r,l),l=l.sibling}function hy(t,r,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(At,l)}catch{}switch(l.tag){case 26:wt||Jn(l,r),ki(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||Jn(l,r);var c=ot,p=Jt;ur(l.type)&&(ot=l.stateNode,Jt=!1),ki(t,r,l),ls(l.stateNode),ot=c,Jt=p;break;case 5:wt||Jn(l,r);case 6:if(c=ot,p=Jt,ot=null,ki(t,r,l),ot=c,Jt=p,ot!==null)if(Jt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(l.stateNode)}catch(y){We(l,r,y)}else try{ot.removeChild(l.stateNode)}catch(y){We(l,r,y)}break;case 18:ot!==null&&(Jt?(t=ot,ax(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ya(t)):ax(ot,l.stateNode));break;case 4:c=ot,p=Jt,ot=l.stateNode.containerInfo,Jt=!0,ki(t,r,l),ot=c,Jt=p;break;case 0:case 11:case 14:case 15:nr(2,l,r),wt||nr(4,l,r),ki(t,r,l);break;case 1:wt||(Jn(l,r),c=l.stateNode,typeof c.componentWillUnmount=="function"&&ly(l,r,c)),ki(t,r,l);break;case 21:ki(t,r,l);break;case 22:wt=(c=wt)||l.memoizedState!==null,ki(t,r,l),wt=c;break;default:ki(t,r,l)}}function py(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ya(t)}catch(l){We(r,r.return,l)}}}function my(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ya(t)}catch(l){We(r,r.return,l)}}function ok(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new cy),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new cy),r;default:throw Error(a(435,t.tag))}}function xu(t,r){var l=ok(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=yk.bind(null,t,c);c.then(p,p)}})}function Wt(t,r){var l=r.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],y=t,S=r,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ur(M.type)){ot=M.stateNode,Jt=!1;break e}break;case 5:ot=M.stateNode,Jt=!1;break e;case 3:case 4:ot=M.stateNode.containerInfo,Jt=!0;break e}M=M.return}if(ot===null)throw Error(a(160));hy(y,S,p),ot=null,Jt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)gy(r,t),r=r.sibling}var Bn=null;function gy(t,r){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(r,t),en(t),c&4&&(nr(3,t,t.return),Ql(3,t),nr(5,t,t.return));break;case 1:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&64&&_i&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Bn;if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&4){var y=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Er]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Rt(y,c,l),y[Nt]=t,yt(y),c=y;break e;case"link":var S=gx("link","href",p).get(c+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=gx("meta","content",p).get(c+(l.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Nt]=t,yt(y),c=y}t.stateNode=c}else yx(p,t.type,t.stateNode);else t.stateNode=mx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?yx(p,t.type,t.stateNode):mx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Xd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),l!==null&&c&4&&Xd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),t.flags&32){p=t.stateNode;try{ha(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Xd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Zd=!0);break;case 6:if(Wt(r,t),en(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ye){We(t,t.return,ye)}}break;case 3:if(Ru=null,p=Bn,Bn=Du(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Ya(r.containerInfo)}catch(ye){We(t,t.return,ye)}Zd&&(Zd=!1,yy(t));break;case 4:c=Bn,Bn=Du(t.stateNode.containerInfo),Wt(r,t),en(t),Bn=c;break;case 12:Wt(r,t),en(t);break;case 31:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(vu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 22:p=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,W=_i,le=wt;if(_i=W||p,wt=le||I,Wt(r,t),wt=le,_i=W,en(t),c&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||_i||wt||$r(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(y=I.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var oe=I.memoizedProps.style,ee=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){We(I,I.return,ye)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ye){We(I,I.return,ye)}}}else if(r.tag===18){if(l===null){I=r;try{var re=I.stateNode;p?lx(re,!0):lx(I.stateNode,!1)}catch(ye){We(I,I.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,xu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 30:break;case 21:break;default:Wt(r,t),en(t)}}function en(t){var r=t.flags;if(r&2){try{for(var l,c=t.return;c!==null;){if(oy(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Fd(t);yu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(ha(S,""),l.flags&=-33);var M=Fd(t);yu(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Fd(t);Gd(t,W,I);break;default:throw Error(a(161))}}catch(le){We(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function yy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;yy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ei(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)fy(t,r.alternate,r),r=r.sibling}function $r(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:nr(4,r,r.return),$r(r);break;case 1:Jn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&ly(r,r.return,l),$r(r);break;case 27:ls(r.stateNode);case 26:case 5:Jn(r,r.return),$r(r);break;case 22:r.memoizedState===null&&$r(r);break;case 30:$r(r);break;default:$r(r)}t=t.sibling}}function Ni(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ni(p,y,l),Ql(4,y);break;case 1:if(Ni(p,y,l),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){We(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var M=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Gg(I[p],M)}catch(W){We(c,c.return,W)}}l&&S&64&&ay(y),Kl(y,y.return);break;case 27:uy(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&sy(y),Kl(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&py(p,y);break;case 13:Ni(p,y,l),l&&S&4&&my(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),Kl(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Qd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Hl(l))}function Kd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)xy(t,r,l,c),r=r.sibling}function xy(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Ql(9,r);break;case 1:Un(t,r,l,c);break;case 3:Un(t,r,l,c),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){We(r,r.return,I)}}else Un(t,r,l,c);break;case 31:Un(t,r,l,c);break;case 13:Un(t,r,l,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Un(t,r,l,c):Jl(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,ja(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Qd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Kd(r.alternate,r);break;default:Un(t,r,l,c)}}function ja(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,M=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:ja(y,S,M,I,p),Ql(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?ja(y,S,M,I,p):Jl(y,S):(le._visibility|=2,ja(y,S,M,I,p)),p&&W&2048&&Qd(S.alternate,S);break;case 24:ja(y,S,M,I,p),p&&W&2048&&Kd(S.alternate,S);break;default:ja(y,S,M,I,p)}r=r.sibling}}function Jl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,c=r,p=c.flags;switch(c.tag){case 22:Jl(l,c),p&2048&&Qd(c.alternate,c);break;case 24:Jl(l,c),p&2048&&Kd(c.alternate,c);break;default:Jl(l,c)}r=r.sibling}}var Wl=8192;function Ra(t,r,l){if(t.subtreeFlags&Wl)for(t=t.child;t!==null;)by(t,r,l),t=t.sibling}function by(t,r,l){switch(t.tag){case 26:Ra(t,r,l),t.flags&Wl&&t.memoizedState!==null&&Gk(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,r,l);break;case 3:case 4:var c=Bn;Bn=Du(t.stateNode.containerInfo),Ra(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Wl,Wl=16777216,Ra(t,r,l),Wl=c):Ra(t,r,l));break;default:Ra(t,r,l)}}function vy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function es(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,Sy(c,t)}vy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wy(t),t=t.sibling}function wy(t){switch(t.tag){case 0:case 11:case 15:es(t),t.flags&2048&&nr(9,t,t.return);break;case 3:es(t);break;case 12:es(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,bu(t)):es(t);break;default:es(t)}}function bu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,Sy(c,t)}vy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),bu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,bu(r));break;default:bu(r)}t=t.sibling}}function Sy(t,r){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:nr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Hl(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Tt=c;else e:for(l=t;Tt!==null;){c=Tt;var p=c.sibling,y=c.return;if(dy(c),c===l){Tt=null;break e}if(p!==null){p.return=y,Tt=p;break e}Tt=y}}}var uk={getCacheForType:function(t){var r=Dt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return Dt(xt).controller.signal}},ck=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Oe=null,Be=0,Je=0,hn=null,ir=!1,Oa=!1,Jd=!1,Ci=0,dt=0,rr=0,Vr=0,Wd=0,pn=0,La=0,ts=null,tn=null,eh=!1,vu=0,_y=0,wu=1/0,Su=null,ar=null,Ct=0,lr=null,Ha=null,Mi=0,th=0,nh=null,ky=null,ns=0,ih=null;function mn(){return(Qe&2)!==0&&Be!==0?Be&-Be:D.T!==null?uh():No()}function Ey(){if(pn===0)if((Be&536870912)===0||Ie){var t=la;la<<=1,(la&3932160)===0&&(la=262144),pn=t}else pn=536870912;return t=fn.current,t!==null&&(t.flags|=32),pn}function nn(t,r,l){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(Ba(t,0),sr(t,Be,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&sr(t,Be,pn,!1)),Wn(t))}function Ny(t,r,l){if((Qe&6)!==0)throw Error(a(327));var c=!l&&(r&127)===0&&(r&t.expiredLanes)===0||_r(t,r),p=c?hk(t,r):ah(t,r,!0),y=c;do{if(p===0){Oa&&!c&&sr(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!fk(l)){p=ah(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var M=t;p=ts;var I=M.current.memoizedState.isDehydrated;if(I&&(Ba(M,S).flags|=256),S=ah(M,S,!1),S!==2){if(Jd&&!I){M.errorRecoveryDisabledLanes|=y,Vr|=y,p=4;break e}y=tn,tn=p,y!==null&&(tn===null?tn=y:tn.push.apply(tn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Ba(t,0),sr(t,r,0,!0);break}e:{switch(c=t,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:sr(c,r,pn,!ir);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=vu+300-Et(),10<p)){if(sr(c,r,pn,!ir),oa(c,0,!0)!==0)break e;Mi=r,c.timeoutHandle=ix(Cy.bind(null,c,l,tn,Su,eh,r,pn,Vr,La,ir,y,"Throttled",-0,0),p);break e}Cy(c,l,tn,Su,eh,r,pn,Vr,La,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function Cy(t,r,l,c,p,y,S,M,I,W,le,oe,ee,re){if(t.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},by(r,y,oe);var ye=(y&62914560)===y?vu-Et():(y&4194048)===y?_y-Et():0;if(ye=Zk(oe,ye),ye!==null){Mi=y,t.cancelPendingCommit=ye(Oy.bind(null,t,r,y,l,c,p,S,M,I,le,oe,null,ee,re)),sr(t,y,S,!W);return}}Oy(t,r,y,l,c,p,S,M,I)}function fk(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],y=p.getSnapshot;p=p.value;try{if(!un(y(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sr(t,r,l,c){r&=~Wd,r&=~Vr,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var p=r;0<p;){var y=31-Ke(p),S=1<<y;c[y]=-1,p&=~S}l!==0&&_o(t,l,r)}function _u(){return(Qe&6)===0?(is(0),!1):!0}function rh(){if(Oe!==null){if(Je===0)var t=Oe.return;else t=Oe,yi=Rr=null,vd(t),Ma=null,Ul=0,t=Oe;for(;t!==null;)ry(t.alternate,t),t=t.return;Oe=null}}function Ba(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,zk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Mi=0,rh(),it=t,Oe=l=mi(t.current,null),Be=r,Je=0,hn=null,ir=!1,Oa=_r(t,r),Jd=!1,La=pn=Wd=Vr=rr=dt=0,tn=ts=null,eh=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var p=31-Ke(c),y=1<<p;r|=t[p],c&=~y}return Ci=r,Yo(),l}function My(t,r){Ae=null,D.H=Fl,r===Ca||r===Jo?(r=Yg(),Je=3):r===od?(r=Yg(),Je=4):Je=r===Ld?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Oe===null&&(dt=1,du(t,kn(r,t.current)))}function Ty(){var t=fn.current;return t===null?!0:(Be&4194048)===Be?Mn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===Mn:!1}function Ay(){var t=D.H;return D.H=Fl,t===null?Fl:t}function zy(){var t=D.A;return D.A=uk,t}function ku(){dt=4,ir||(Be&4194048)!==Be&&fn.current!==null||(Oa=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||sr(it,Be,pn,!1)}function ah(t,r,l){var c=Qe;Qe|=2;var p=Ay(),y=zy();(it!==t||Be!==r)&&(Su=null,Ba(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Oe!==null){var M=Oe,I=hn;switch(Je){case 8:rh(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var W=Je;if(Je=0,hn=null,Ua(t,M,I,W),l&&Oa){S=0;break e}break;default:W=Je,Je=0,hn=null,Ua(t,M,I,W)}}dk(),S=dt;break}catch(le){My(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,D.H=p,D.A=y,Oe===null&&(it=null,Be=0,Yo()),S}function dk(){for(;Oe!==null;)Dy(Oe)}function hk(t,r){var l=Qe;Qe|=2;var c=Ay(),p=zy();it!==t||Be!==r?(Su=null,wu=Et()+500,Ba(t,r)):Oa=_r(t,r);e:do try{if(Je!==0&&Oe!==null){r=Oe;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ua(t,r,y,1);break;case 2:case 9:if($g(y)){Je=0,hn=null,jy(r);break}r=function(){Je!==2&&Je!==9||it!==t||(Je=7),Wn(t)},y.then(r,r);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:$g(y)?(Je=0,hn=null,jy(r)):(Je=0,hn=null,Ua(t,r,y,7));break;case 5:var S=null;switch(Oe.tag){case 26:S=Oe.memoizedState;case 5:case 27:var M=Oe;if(S?xx(S):M.stateNode.complete){Je=0,hn=null;var I=M.sibling;if(I!==null)Oe=I;else{var W=M.return;W!==null?(Oe=W,Eu(W)):Oe=null}break t}}Je=0,hn=null,Ua(t,r,y,5);break;case 6:Je=0,hn=null,Ua(t,r,y,6);break;case 8:rh(),dt=6;break e;default:throw Error(a(462))}}pk();break}catch(le){My(t,le)}while(!0);return yi=Rr=null,D.H=c,D.A=p,Qe=l,Oe!==null?0:(it=null,Be=0,Yo(),dt)}function pk(){for(;Oe!==null&&!si();)Dy(Oe)}function Dy(t){var r=ny(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Eu(t):Oe=r}function jy(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=Q0(l,r,r.pendingProps,r.type,void 0,Be);break;case 11:r=Q0(l,r,r.pendingProps,r.type.render,r.ref,Be);break;case 5:vd(r);default:ry(l,r),r=Oe=zg(r,Ci),r=ny(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Eu(t):Oe=r}function Ua(t,r,l,c){yi=Rr=null,vd(r),Ma=null,Ul=0;var p=r.return;try{if(nk(t,p,r,l,Be)){dt=1,du(t,kn(l,t.current)),Oe=null;return}}catch(y){if(p!==null)throw Oe=p,y;dt=1,du(t,kn(l,t.current)),Oe=null;return}r.flags&32768?(Ie||c===1?t=!0:Oa||(Be&536870912)!==0?t=!1:(ir=t=!0,(c===2||c===9||c===3||c===6)&&(c=fn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Ry(r,t)):Eu(r)}function Eu(t){var r=t;do{if((r.flags&32768)!==0){Ry(r,ir);return}t=r.return;var l=ak(r.alternate,r,Ci);if(l!==null){Oe=l;return}if(r=r.sibling,r!==null){Oe=r;return}Oe=r=t}while(r!==null);dt===0&&(dt=5)}function Ry(t,r){do{var l=lk(t.alternate,t);if(l!==null){l.flags&=32767,Oe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=l}while(t!==null);dt=6,Oe=null}function Oy(t,r,l,c,p,y,S,M,I){t.cancelPendingCommit=null;do Nu();while(Ct!==0);if((Qe&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(y=r.lanes|r.childLanes,y|=Ff,_f(t,l,y,S,M,I),t===it&&(Oe=it=null,Be=0),Ha=r,lr=t,Mi=l,th=y,nh=p,ky=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,xk(_e,function(){return Iy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=D.T,D.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{sk(t,r,l)}finally{Qe=S,U.p=p,D.T=c}}Ct=1,Ly(),Hy(),By()}}function Ly(){if(Ct===1){Ct=0;var t=lr,r=Ha,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=D.T,D.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{gy(r,t);var y=yh,S=Sg(t.containerInfo),M=y.focusedElem,I=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&wg(M.ownerDocument.documentElement,M)){if(I!==null&&$f(M)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var oe=M.ownerDocument||document,ee=oe&&oe.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.textContent.length,ke=Math.min(I.start,ye),nt=I.end===void 0?ke:Math.min(I.end,ye);!re.extend&&ke>nt&&(S=nt,nt=ke,ke=S);var Z=vg(M,ke),X=vg(M,nt);if(Z&&X&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=oe.createRange();J.setStart(Z.node,Z.offset),re.removeAllRanges(),ke>nt?(re.addRange(J),re.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),re.addRange(J))}}}}for(oe=[],re=M;re=re.parentNode;)re.nodeType===1&&oe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var se=oe[M];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Bu=!!gh,yh=gh=null}finally{Qe=p,U.p=c,D.T=l}}t.current=r,Ct=2}}function Hy(){if(Ct===2){Ct=0;var t=lr,r=Ha,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=D.T,D.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{fy(t,r.alternate,r)}finally{Qe=p,U.p=c,D.T=l}}Ct=3}}function By(){if(Ct===4||Ct===3){Ct=0,oi();var t=lr,r=Ha,l=Mi,c=ky;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ha=lr=null,Uy(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),Sl(l),r=r.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=D.T,p=U.p,U.p=2,D.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{D.T=r,U.p=p}}(Mi&3)!==0&&Nu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===ih?ns++:(ns=0,ih=t):ns=0,is(0)}}function Uy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Hl(r)))}function Nu(){return Ly(),Hy(),By(),Iy()}function Iy(){if(Ct!==5)return!1;var t=lr,r=th;th=0;var l=Sl(Mi),c=D.T,p=U.p;try{U.p=32>l?32:l,D.T=null,l=nh,nh=null;var y=lr,S=Mi;if(Ct=0,Ha=lr=null,Mi=0,(Qe&6)!==0)throw Error(a(331));var M=Qe;if(Qe|=4,wy(y.current),xy(y,y.current,S,l),Qe=M,is(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,D.T=c,Uy(t,r)}}function qy(t,r,l){r=kn(l,r),r=Od(t.stateNode,r,2),t=Wi(t,r,2),t!==null&&(kr(t,2),Wn(t))}function We(t,r,l){if(t.tag===3)qy(t,t,l);else for(;r!==null;){if(r.tag===3){qy(r,t,l);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ar===null||!ar.has(c))){t=kn(l,t),l=$0(2),c=Wi(r,l,2),c!==null&&(V0(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function lh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new ck;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(l)||(Jd=!0,p.add(l),t=mk.bind(null,t,r,l),r.then(t,t))}function mk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Be&l)===l&&(dt===4||dt===3&&(Be&62914560)===Be&&300>Et()-vu?(Qe&2)===0&&Ba(t,0):Wd|=l,La===Be&&(La=0)),Wn(t)}function $y(t,r){r===0&&(r=So()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function gk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),$y(t,l)}function yk(t,r){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),$y(t,l)}function xk(t,r){return Gt(t,r)}var Cu=null,Ia=null,sh=!1,Mu=!1,oh=!1,or=0;function Wn(t){t!==Ia&&t.next===null&&(Ia===null?Cu=Ia=t:Ia=Ia.next=t),Mu=!0,sh||(sh=!0,vk())}function is(t,r){if(!oh&&Mu){oh=!0;do for(var l=!1,c=Cu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Xy(c,y))}else y=Be,y=oa(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,Xy(c,y));c=c.next}while(l);oh=!1}}function bk(){Vy()}function Vy(){Mu=sh=!1;var t=0;or!==0&&Ak()&&(t=or);for(var r=Et(),l=null,c=Cu;c!==null;){var p=c.next,y=Yy(c,r);y===0?(c.next=null,l===null?Cu=p:l.next=p,p===null&&(Ia=l)):(l=c,(t!==0||(y&3)!==0)&&(Mu=!0)),c=p}Ct!==0&&Ct!==5||is(t),or!==0&&(or=0)}function Yy(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),M=1<<S,I=p[S];I===-1?((M&l)===0||(M&c)!==0)&&(p[S]=Sf(M,r)):I<=r&&(t.expiredLanes|=M),y&=~M}if(r=it,l=Be,l=oa(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===r&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||_r(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(c!==null&&Rn(c),Sl(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Py.bind(null,t),l=Gt(l,c),t.callbackPriority=r,t.callbackNode=l,r}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Py(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Nu()&&t.callbackNode!==l)return null;var c=Be;return c=oa(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Ny(t,c,r),Yy(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Py.bind(null,t):null)}function Xy(t,r){if(Nu())return null;Ny(t,r,!0)}function vk(){Dk(function(){(Qe&6)!==0?Gt(ae,bk):Vy()})}function uh(){if(or===0){var t=Ea;t===0&&(t=aa,aa<<=1,(aa&261888)===0&&(aa=256)),or=t}return or}function Fy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Lo(""+t)}function Gy(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function wk(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=Fy((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?Fy(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new Io("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var I=S?Gy(p,S):new FormData(p);Td(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=S?Gy(p,S):new FormData(p),Td(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var ch=0;ch<Xf.length;ch++){var fh=Xf[ch],Sk=fh.toLowerCase(),_k=fh[0].toUpperCase()+fh.slice(1);Hn(Sk,"on"+_k)}Hn(Eg,"onAnimationEnd"),Hn(Ng,"onAnimationIteration"),Hn(Cg,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(U_,"onTransitionRun"),Hn(I_,"onTransitionStart"),Hn(q_,"onTransitionCancel"),Hn(Mg,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),kk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rs));function Zy(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var M=c[S],I=M.instance,W=M.currentTarget;if(M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(M=c[S],I=M.instance,W=M.currentTarget,M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}}}}function Le(t,r){var l=r[ua];l===void 0&&(l=r[ua]=new Set);var c=t+"__bubble";l.has(c)||(Qy(r,t,2,!1),l.add(c))}function dh(t,r,l){var c=0;r&&(c|=4),Qy(l,t,c,r)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function hh(t){if(!t[Tu]){t[Tu]=!0,Ao.forEach(function(l){l!=="selectionchange"&&(kk.has(l)||dh(l,!1,t),dh(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Tu]||(r[Tu]=!0,dh("selectionchange",!1,r))}}function Qy(t,r,l,c){switch(Ex(r)){case 2:var p=Jk;break;case 8:p=Wk;break;default:p=Mh}l=p.bind(null,r,l,t),p=void 0,!jf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,l,{capture:!0,passive:p}):t.addEventListener(r,l,!0):p!==void 0?t.addEventListener(r,l,{passive:p}):t.addEventListener(r,l,!1)}function ph(t,r,l,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var M=c.stateNode.containerInfo;if(M===p)break;if(S===4)for(S=c.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;M!==null;){if(S=qi(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}M=M.parentNode}}c=c.return}tg(function(){var W=y,le=zf(l),oe=[];e:{var ee=Tg.get(t);if(ee!==void 0){var re=Io,ye=t;switch(t){case"keypress":if(Bo(l)===0)break e;case"keydown":case"keyup":re=y_;break;case"focusin":ye="focus",re=Hf;break;case"focusout":ye="blur",re=Hf;break;case"beforeblur":case"afterblur":re=Hf;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":re=rg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=a_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=v_;break;case Eg:case Ng:case Cg:re=o_;break;case Mg:re=S_;break;case"scroll":case"scrollend":re=i_;break;case"wheel":re=k_;break;case"copy":case"cut":case"paste":re=c_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=lg;break;case"toggle":case"beforetoggle":re=N_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var X=W,J;X!==null;){var se=X;if(J=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||J===null||Z===null||(se=Nl(X,Z),se!=null&&ke.push(as(X,se,J))),nt)break;X=X.return}0<ke.length&&(ee=new re(ee,ye,null,l,le),oe.push({event:ee,listeners:ke}))}}if((r&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",ee&&l!==Af&&(ye=l.relatedTarget||l.fromElement)&&(qi(ye)||ye[ci]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=l.relatedTarget||l.toElement,re=W,ye=ye?qi(ye):null,ye!==null&&(nt=o(ye),ke=ye.tag,ye!==nt||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=rg,se="onMouseLeave",Z="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=lg,se="onPointerLeave",Z="onPointerEnter",X="pointer"),nt=re==null?ee:Vi(re),J=ye==null?ee:Vi(ye),ee=new ke(se,X+"leave",re,l,le),ee.target=nt,ee.relatedTarget=J,se=null,qi(le)===W&&(ke=new ke(Z,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,se=ke),nt=se,re&&ye)t:{for(ke=Ek,Z=re,X=ye,J=0,se=Z;se;se=ke(se))J++;se=0;for(var ve=X;ve;ve=ke(ve))se++;for(;0<J-se;)Z=ke(Z),J--;for(;0<se-J;)X=ke(X),se--;for(;J--;){if(Z===X||X!==null&&Z===X.alternate){ke=Z;break t}Z=ke(Z),X=ke(X)}ke=null}else ke=null;re!==null&&Ky(oe,ee,re,ke,!1),ye!==null&&nt!==null&&Ky(oe,nt,ye,ke,!0)}}e:{if(ee=W?Vi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Fe=pg;else if(dg(ee))if(mg)Fe=L_;else{Fe=R_;var xe=j_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Tf(W.elementType)&&(Fe=pg):Fe=O_;if(Fe&&(Fe=Fe(t,W))){hg(oe,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&El(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(dg(xe)||xe.contentEditable==="true")&&(ya=xe,Vf=W,Rl=null);break;case"focusout":Rl=Vf=ya=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,_g(oe,l,le);break;case"selectionchange":if(B_)break;case"keydown":case"keyup":_g(oe,l,le)}var ze;if(Uf)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ga?cg(t,l)&&(Ue="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ue="onCompositionStart");Ue&&(sg&&l.locale!=="ko"&&(ga||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ga&&(ze=ng()):(Xi=le,Rf="value"in Xi?Xi.value:Xi.textContent,ga=!0)),xe=Au(W,Ue),0<xe.length&&(Ue=new ag(Ue,t,null,l,le),oe.push({event:Ue,listeners:xe}),ze?Ue.data=ze:(ze=fg(l),ze!==null&&(Ue.data=ze)))),(ze=M_?T_(t,l):A_(t,l))&&(Ue=Au(W,"onBeforeInput"),0<Ue.length&&(xe=new ag("onBeforeInput","beforeinput",null,l,le),oe.push({event:xe,listeners:Ue}),xe.data=ze)),wk(oe,t,W,l,le)}Zy(oe,r)})}function as(t,r,l){return{instance:t,listener:r,currentTarget:l}}function Au(t,r){for(var l=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Nl(t,l),p!=null&&c.unshift(as(t,p,y)),p=Nl(t,r),p!=null&&c.push(as(t,p,y))),t.tag===3)return c;t=t.return}return[]}function Ek(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ky(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var M=l,I=M.alternate,W=M.stateNode;if(M=M.tag,I!==null&&I===c)break;M!==5&&M!==26&&M!==27||W===null||(I=W,p?(W=Nl(l,y),W!=null&&S.unshift(as(l,W,I))):p||(W=Nl(l,y),W!=null&&S.push(as(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var Nk=/\r\n?/g,Ck=/\u0000|\uFFFD/g;function Jy(t){return(typeof t=="string"?t:""+t).replace(Nk,`
|
|
9
|
-
`).replace(Ck,"")}function Wy(t,r){return r=Jy(r),Jy(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ha(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ha(t,""+c);break;case"className":fa(t,"class",c);break;case"tabIndex":fa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,l,c);break;case"style":Wm(t,c,y);break;case"data":if(r!=="object"){fa(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&tt(t,r,"name",p.name,p,null),tt(t,r,"formEncType",p.formEncType,p,null),tt(t,r,"formMethod",p.formMethod,p,null),tt(t,r,"formTarget",p.formTarget,p,null)):(tt(t,r,"encType",p.encType,p,null),tt(t,r,"method",p.method,p,null),tt(t,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&Le("scroll",t);break;case"onScrollEnd":c!=null&&Le("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Lo(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":Le("beforetoggle",t),Le("toggle",t),ca(t,"popover",c);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ca(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=t_.get(l)||l,ca(t,l,c))}}function mh(t,r,l,c,p,y){switch(l){case"style":Wm(t,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ha(t,c):(typeof c=="number"||typeof c=="bigint")&&ha(t,""+c);break;case"onScroll":c!=null&&Le("scroll",t);break;case"onScrollEnd":c!=null&&Le("scrollend",t);break;case"onClick":c!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),y=t[Bt]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):ca(t,l,c)}}}function Rt(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",t),Le("load",t);var c=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var S=l[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,y,S,l,null)}}p&&tt(t,r,"srcSet",l.srcSet,l,null),c&&tt(t,r,"src",l.src,l,null);return;case"input":Le("invalid",t);var M=y=S=p=null,I=null,W=null;for(c in l)if(l.hasOwnProperty(c)){var le=l[c];if(le!=null)switch(c){case"name":p=le;break;case"type":S=le;break;case"checked":I=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Oo(t,y,M,I,W,S,p,!1);return;case"select":Le("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:tt(t,r,p,M,l,null)}r=y,l=S,t.multiple=!!c,r!=null?di(t,!!c,r,!1):l!=null&&di(t,!!c,l,!0);return;case"textarea":Le("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:tt(t,r,S,M,l,null)}Km(t,c,p,y);return;case"option":for(I in l)l.hasOwnProperty(I)&&(c=l[I],c!=null)&&(I==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":tt(t,r,I,c,l,null));return;case"dialog":Le("beforetoggle",t),Le("toggle",t),Le("cancel",t),Le("close",t);break;case"iframe":case"object":Le("load",t);break;case"video":case"audio":for(c=0;c<rs.length;c++)Le(rs[c],t);break;case"image":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"embed":case"source":case"link":Le("error",t),Le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(c=l[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,W,c,l,null)}return;default:if(Tf(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&mh(t,r,le,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&tt(t,r,M,c,l,null))}function Mk(t,r,l,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,M=null,I=null,W=null,le=null;for(re in l){var oe=l[re];if(l.hasOwnProperty(re)&&oe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=oe;default:c.hasOwnProperty(re)||tt(t,r,re,null,c,oe)}}for(var ee in c){var re=c[ee];if(oe=l[ee],c.hasOwnProperty(ee)&&(re!=null||oe!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":le=re;break;case"value":S=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:re!==oe&&tt(t,r,ee,re,c,oe)}}Cr(t,S,M,I,W,le,y,p);return;case"select":re=S=M=ee=null;for(y in l)if(I=l[y],l.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:c.hasOwnProperty(y)||tt(t,r,y,null,c,I)}for(p in c)if(y=c[p],I=l[p],c.hasOwnProperty(p)&&(y!=null||I!=null))switch(p){case"value":ee=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=M,l=S,c=re,ee!=null?di(t,!!l,ee,!1):!!c!=!!l&&(r!=null?di(t,!!l,r,!0):di(t,!!l,l?[]:"",!1));return;case"textarea":re=ee=null;for(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:tt(t,r,M,null,c,p)}for(S in c)if(p=c[S],y=l[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&tt(t,r,S,p,c,y)}Qm(t,ee,re);return;case"option":for(var ye in l)ee=l[ye],l.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:tt(t,r,ye,null,c,ee));for(I in c)ee=c[I],re=l[I],c.hasOwnProperty(I)&&ee!==re&&(ee!=null||re!=null)&&(I==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":tt(t,r,I,ee,c,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in l)ee=l[ke],l.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&tt(t,r,ke,null,c,ee);for(W in c)if(ee=c[W],re=l[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:tt(t,r,W,ee,c,re)}return;default:if(Tf(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&mh(t,r,nt,void 0,c,ee);for(le in c)ee=c[le],re=l[le],!c.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||mh(t,r,le,ee,c,re);return}}for(var Z in l)ee=l[Z],l.hasOwnProperty(Z)&&ee!=null&&!c.hasOwnProperty(Z)&&tt(t,r,Z,null,c,ee);for(oe in c)ee=c[oe],re=l[oe],!c.hasOwnProperty(oe)||ee===re||ee==null&&re==null||tt(t,r,oe,ee,c,re)}function ex(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],y=p.transferSize,S=p.initiatorType,M=p.duration;if(y&&M&&ex(S)){for(S=0,M=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>M)break;var le=I.transferSize,oe=I.initiatorType;le&&ex(oe)&&(I=I.responseEnd,S+=le*(I<M?1:(M-W)/(I-W)))}if(--c,r+=8*(y+S)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var gh=null,yh=null;function zu(t){return t.nodeType===9?t:t.ownerDocument}function tx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nx(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function xh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var bh=null;function Ak(){var t=window.event;return t&&t.type==="popstate"?t===bh?!1:(bh=t,!0):(bh=null,!1)}var ix=typeof setTimeout=="function"?setTimeout:void 0,zk=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,Dk=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(t){return rx.resolve(null).then(t).catch(jk)}:ix;function jk(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function ax(t,r){var l=r,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),Ya(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")ls(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,ls(l);for(var y=l.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Er]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&ls(t.ownerDocument.body);l=p}while(l);Ya(r)}function lx(t,r){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function vh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":vh(l),_l(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Rk(t,r,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Tn(t.nextSibling),t===null)break}return null}function Ok(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Tn(t.nextSibling),t===null))return null;return t}function sx(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Tn(t.nextSibling),t===null))return null;return t}function wh(t){return t.data==="$?"||t.data==="$~"}function Sh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Lk(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var c=function(){r(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Tn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var _h=null;function ox(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Tn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function ux(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function cx(t,r,l){switch(r=zu(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function ls(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);_l(t)}var An=new Map,fx=new Set;function Du(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ti=U.d;U.d={f:Hk,r:Bk,D:Uk,C:Ik,L:qk,m:$k,X:Yk,S:Vk,M:Pk};function Hk(){var t=Ti.f(),r=_u();return t||r}function Bk(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?M0(r):Ti.r(t)}var qa=typeof document>"u"?null:document;function dx(t,r,l){var c=qa;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),fx.has(p)||(fx.add(p),t={rel:t,crossOrigin:l,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Uk(t){Ti.D(t),dx("dns-prefetch",t,null)}function Ik(t,r){Ti.C(t,r),dx("preconnect",t,r)}function qk(t,r,l){Ti.L(t,r,l);var c=qa;if(c&&t&&r){var p='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Qt(l.imageSizes)+'"]')):p+='[href="'+Qt(t)+'"]';var y=p;switch(r){case"style":y=$a(t);break;case"script":y=Va(t)}An.has(y)||(t=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),An.set(y,t),c.querySelector(p)!==null||r==="style"&&c.querySelector(ss(y))||r==="script"&&c.querySelector(os(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function $k(t,r){Ti.m(t,r);var l=qa;if(l&&t){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Qt(c)+'"][href="'+Qt(t)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Va(t)}if(!An.has(y)&&(t=m({rel:"modulepreload",href:t},r),An.set(y,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(os(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Vk(t,r,l){Ti.S(t,r,l);var c=qa;if(c&&t){var p=Yi(c).hoistableStyles,y=$a(t);r=r||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(ss(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&kh(t,l);var I=S=c.createElement("link");yt(I),Rt(I,"link",t),I._p=new Promise(function(W,le){I.onload=W,I.onerror=le}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,ju(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function Yk(t,r){Ti.X(t,r);var l=qa;if(l&&t){var c=Yi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&Eh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Pk(t,r){Ti.M(t,r);var l=qa;if(l&&t){var c=Yi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&Eh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function hx(t,r,l,c){var p=(p=fe.current)?Du(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=$a(l.href),l=Yi(p).hoistableStyles,c=l.get(r),c||(c={type:"style",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$a(l.href);var y=Yi(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(ss(t)))&&!y._p&&(S.instance=y,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),y||Xk(p,t,l,S.state))),r&&c===null)throw Error(a(528,""));return S}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Va(l),l=Yi(p).hoistableScripts,c=l.get(r),c||(c={type:"script",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function $a(t){return'href="'+Qt(t)+'"'}function ss(t){return'link[rel="stylesheet"]['+t+"]"}function px(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Xk(t,r,l,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Rt(r,"link",l),yt(r),t.head.appendChild(r))}function Va(t){return'[src="'+Qt(t)+'"]'}function os(t){return"script[async]"+t}function mx(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(c)return r.instance=c,yt(c),c;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),yt(c),Rt(c,"style",p),ju(c,l.precedence,t),r.instance=c;case"stylesheet":p=$a(l.href);var y=t.querySelector(ss(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=px(l),(p=An.get(p))&&kh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,ju(y,l.precedence,t),r.instance=y;case"script":return y=Va(l.src),(p=t.querySelector(os(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),Eh(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),yt(p),Rt(p,"link",c),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,ju(c,l.precedence,t));return r.instance}function ju(t,r,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===r)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function kh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Eh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Ru=null;function gx(t,r,l){if(Ru===null){var c=new Map,p=Ru=new Map;p.set(l,c)}else p=Ru,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[Er]||y[Nt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function yx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Fk(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function xx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Gk(t,r,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=$a(c.href),y=r.querySelector(ss(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Ou.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=px(c),(p=An.get(p))&&kh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Ou.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var Nh=0;function Zk(t,r){return t.stylesheets&&t.count===0&&Hu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Nh===0&&(Nh=62500*Tk());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Nh?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lu=null;function Hu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,r.forEach(Qk,t),Lu=null,Ou.call(t))}function Qk(t,r){if(!(r.state.loading&4)){var l=Lu.get(t);if(l)var c=l.get(null);else{l=new Map,Lu.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),c=S)}c&&l.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),y=l.get(S)||c,y===c&&l.set(null,p),l.set(S,p),this.count++,c=Ou.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var us={$$typeof:k,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function Kk(t,r,l,c,p,y,S,M,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vl(0),this.hiddenUpdates=vl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function bx(t,r,l,c,p,y,S,M,I,W,le,oe){return t=new Kk(t,r,l,S,I,W,le,oe,M),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=ad(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},ud(y),t}function vx(t){return t?(t=va,t):va}function wx(t,r,l,c,p,y){p=vx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ji(r),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Wi(t,c,r),l!==null&&(nn(l,t,r),ql(l,t,r))}function Sx(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Ch(t,r){Sx(t,r),(t=t.alternate)&&Sx(t,r)}function _x(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Ch(t,67108864)}}function kx(t){if(t.tag===13||t.tag===31){var r=mn();r=wl(r);var l=zr(t,r);l!==null&&nn(l,t,r),Ch(t,r)}}var Bu=!0;function Jk(t,r,l,c){var p=D.T;D.T=null;var y=U.p;try{U.p=2,Mh(t,r,l,c)}finally{U.p=y,D.T=p}}function Wk(t,r,l,c){var p=D.T;D.T=null;var y=U.p;try{U.p=8,Mh(t,r,l,c)}finally{U.p=y,D.T=p}}function Mh(t,r,l,c){if(Bu){var p=Th(c);if(p===null)ph(t,r,c,Uu,l),Nx(t,c);else if(tE(p,t,r,l,c))c.stopPropagation();else if(Nx(t,c),r&4&&-1<eE.indexOf(t)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ui(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ke(S);M.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(wu=Et()+500,is(0))}}break;case 31:case 13:M=zr(y,2),M!==null&&nn(M,y,2),_u(),Ch(y,2)}if(y=Th(c),y===null&&ph(t,r,c,Uu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else ph(t,r,c,null,l)}}function Th(t){return t=zf(t),Ah(t)}var Uu=null;function Ah(t){if(Uu=null,t=qi(t),t!==null){var r=o(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=u(r),t!==null)return t;t=null}else if(l===31){if(t=f(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Uu=t,null}function Ex(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ii()){case ae:return 2;case pe:return 8;case _e:case je:return 32;case $e:return 268435456;default:return 32}default:return 32}}var zh=!1,cr=null,fr=null,dr=null,cs=new Map,fs=new Map,hr=[],eE="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".split(" ");function Nx(t,r){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":cs.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(r.pointerId)}}function ds(t,r,l,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:l,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=$i(r),r!==null&&_x(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function tE(t,r,l,c,p){switch(r){case"focusin":return cr=ds(cr,t,r,l,c,p),!0;case"dragenter":return fr=ds(fr,t,r,l,c,p),!0;case"mouseover":return dr=ds(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return cs.set(y,ds(cs.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,fs.set(y,ds(fs.get(y)||null,t,r,l,c,p)),!0}return!1}function Cx(t){var r=qi(t.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){t.blockedOn=r,Co(t.priority,function(){kx(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Co(t.priority,function(){kx(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Iu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=Th(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);Af=c,l.target.dispatchEvent(c),Af=null}else return r=$i(l),r!==null&&_x(r),t.blockedOn=l,!1;r.shift()}return!0}function Mx(t,r,l){Iu(t)&&l.delete(r)}function nE(){zh=!1,cr!==null&&Iu(cr)&&(cr=null),fr!==null&&Iu(fr)&&(fr=null),dr!==null&&Iu(dr)&&(dr=null),cs.forEach(Mx),fs.forEach(Mx)}function qu(t,r){t.blockedOn===r&&(t.blockedOn=null,zh||(zh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nE)))}var $u=null;function Tx(t){$u!==t&&($u=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$u===t&&($u=null);for(var r=0;r<t.length;r+=3){var l=t[r],c=t[r+1],p=t[r+2];if(typeof c!="function"){if(Ah(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,Td(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Ya(t){function r(I){return qu(I,t)}cr!==null&&qu(cr,t),fr!==null&&qu(fr,t),dr!==null&&qu(dr,t),cs.forEach(r),fs.forEach(r);for(var l=0;l<hr.length;l++){var c=hr[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<hr.length&&(l=hr[0],l.blockedOn===null);)Cx(l),l.blockedOn===null&&hr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],y=l[c+1],S=p[Bt]||null;if(typeof y=="function")S||Tx(l);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)M=S.formAction;else if(Ah(p)!==null)continue}else M=S.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),Tx(l)}}}function Ax(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Dh(t){this._internalRoot=t}Vu.prototype.render=Dh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();wx(l,c,t,r,null,null)},Vu.prototype.unmount=Dh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;wx(t.current,2,null,t,null,null),_u(),r[ci]=null}};function Vu(t){this._internalRoot=t}Vu.prototype.unstable_scheduleHydration=function(t){if(t){var r=No();t={blockedOn:null,target:t,priority:r};for(var l=0;l<hr.length&&r!==0&&r<hr[l].priority;l++);hr.splice(l,0,t),l===0&&Cx(t)}};var zx=n.version;if(zx!=="19.2.3")throw Error(a(527,zx,"19.2.3"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var iE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{At=Yu.inject(iE),pt=Yu}catch{}}return ps.createRoot=function(t,r){if(!s(t))throw Error(a(299));var l=!1,c="",p=B0,y=U0,S=I0;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=bx(t,1,!1,null,null,l,c,null,p,y,S,Ax),t[ci]=r.current,hh(t),new Dh(r)},ps.hydrateRoot=function(t,r,l){if(!s(t))throw Error(a(299));var c=!1,p="",y=B0,S=U0,M=I0,I=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=bx(t,1,!0,r,l??null,c,p,I,y,S,M,Ax),r.context=vx(null),l=r.current,c=mn(),c=wl(c),p=Ji(c),p.callback=null,Wi(l,p,c),l=c,r.current.lanes=l,kr(r,l),Wn(r),t[ci]=r.current,hh(t),new Vu(r)},ps.version="19.2.3",ps}var qx;function dE(){if(qx)return Oh.exports;qx=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(n){console.error(n)}}return e(),Oh.exports=fE(),Oh.exports}var hE=dE();function _t(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,a;i<e.length;i++)(a=_t(e[i]))!==""&&(n+=(n&&" ")+a);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var pE={value:()=>{}};function Gc(){for(var e=0,n=arguments.length,i={},a;e<n;++e){if(!(a=arguments[e]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new wc(i)}function wc(e){this._=e}function mE(e,n){return e.trim().split(/^|\s+/).map(function(i){var a="",s=i.indexOf(".");if(s>=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}wc.prototype=Gc.prototype={constructor:wc,on:function(e,n){var i=this._,a=mE(e+"",i),s,o=-1,u=a.length;if(arguments.length<2){for(;++o<u;)if((s=(e=a[o]).type)&&(s=gE(i[s],e.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<u;)if(s=(e=a[o]).type)i[s]=$x(i[s],e.name,n);else if(n==null)for(s in i)i[s]=$x(i[s],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new wc(e)},call:function(e,n){if((s=arguments.length-2)>0)for(var i=new Array(s),a=0,s,o;a<s;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],a=0,s=o.length;a<s;++a)o[a].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(n,i)}};function gE(e,n){for(var i=0,a=e.length,s;i<a;++i)if((s=e[i]).name===n)return s.value}function $x(e,n,i){for(var a=0,s=e.length;a<s;++a)if(e[a].name===n){e[a]=pE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var kp="http://www.w3.org/1999/xhtml";const Vx={svg:"http://www.w3.org/2000/svg",xhtml:kp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Vx.hasOwnProperty(n)?{space:Vx[n],local:e}:e}function yE(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===kp&&n.documentElement.namespaceURI===kp?n.createElement(e):n.createElementNS(i,e)}}function xE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pv(e){var n=Zc(e);return(n.local?xE:yE)(n)}function bE(){}function rm(e){return e==null?bE:function(){return this.querySelector(e)}}function vE(e){typeof e!="function"&&(e=rm(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=new Array(u),h,d,g=0;g<u;++g)(h=o[g])&&(d=e.call(h,h.__data__,g,o))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new Sn(a,this._parents)}function wE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function SE(){return[]}function mv(e){return e==null?SE:function(){return this.querySelectorAll(e)}}function _E(e){return function(){return wE(e.apply(this,arguments))}}function kE(e){typeof e=="function"?e=_E(e):e=mv(e);for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var u=n[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),s.push(h));return new Sn(a,s)}function gv(e){return function(){return this.matches(e)}}function yv(e){return function(n){return n.matches(e)}}var EE=Array.prototype.find;function NE(e){return function(){return EE.call(this.children,e)}}function CE(){return this.firstElementChild}function ME(e){return this.select(e==null?CE:NE(typeof e=="function"?e:yv(e)))}var TE=Array.prototype.filter;function AE(){return Array.from(this.children)}function zE(e){return function(){return TE.call(this.children,e)}}function DE(e){return this.selectAll(e==null?AE:zE(typeof e=="function"?e:yv(e)))}function jE(e){typeof e!="function"&&(e=gv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Sn(a,this._parents)}function xv(e){return new Array(e.length)}function RE(){return new Sn(this._enter||this._groups.map(xv),this._parents)}function Tc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Tc.prototype={constructor:Tc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function OE(e){return function(){return e}}function LE(e,n,i,a,s,o){for(var u=0,f,h=n.length,d=o.length;u<d;++u)(f=n[u])?(f.__data__=o[u],a[u]=f):i[u]=new Tc(e,o[u]);for(;u<h;++u)(f=n[u])&&(s[u]=f)}function HE(e,n,i,a,s,o,u){var f,h,d=new Map,g=n.length,m=o.length,x=new Array(g),b;for(f=0;f<g;++f)(h=n[f])&&(x[f]=b=u.call(h,h.__data__,f,n)+"",d.has(b)?s[f]=h:d.set(b,h));for(f=0;f<m;++f)b=u.call(e,o[f],f,o)+"",(h=d.get(b))?(a[f]=h,h.__data__=o[f],d.delete(b)):i[f]=new Tc(e,o[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(s[f]=h)}function BE(e){return e.__data__}function UE(e,n){if(!arguments.length)return Array.from(this,BE);var i=n?HE:LE,a=this._parents,s=this._groups;typeof e!="function"&&(e=OE(e));for(var o=s.length,u=new Array(o),f=new Array(o),h=new Array(o),d=0;d<o;++d){var g=a[d],m=s[d],x=m.length,b=IE(e.call(g,g&&g.__data__,d,a)),w=b.length,N=f[d]=new Array(w),E=u[d]=new Array(w),_=h[d]=new Array(x);i(g,m,N,E,_,b,n);for(var j=0,k=0,C,L;j<w;++j)if(C=N[j]){for(j>=k&&(k=j+1);!(L=E[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function IE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qE(){return new Sn(this._exit||this._groups.map(xv),this._parents)}function $E(e,n,i){var a=this.enter(),s=this,o=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(s=n(s),s&&(s=s.selection())),i==null?o.remove():i(o),a&&s?a.merge(s).order():s}function VE(e){for(var n=e.selection?e.selection():e,i=this._groups,a=n._groups,s=i.length,o=a.length,u=Math.min(s,o),f=new Array(s),h=0;h<u;++h)for(var d=i[h],g=a[h],m=d.length,x=f[h]=new Array(m),b,w=0;w<m;++w)(b=d[w]||g[w])&&(x[w]=b);for(;h<s;++h)f[h]=i[h];return new Sn(f,this._parents)}function YE(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var a=e[n],s=a.length-1,o=a[s],u;--s>=0;)(u=a[s])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}function PE(e){e||(e=XE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,a=i.length,s=new Array(a),o=0;o<a;++o){for(var u=i[o],f=u.length,h=s[o]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(n)}return new Sn(s,this._parents).order()}function XE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function FE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function GE(){return Array.from(this)}function ZE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length;s<o;++s){var u=a[s];if(u)return u}return null}function QE(){let e=0;for(const n of this)++e;return e}function KE(){return!this.node()}function JE(e){for(var n=this._groups,i=0,a=n.length;i<a;++i)for(var s=n[i],o=0,u=s.length,f;o<u;++o)(f=s[o])&&e.call(f,f.__data__,o,s);return this}function WE(e){return function(){this.removeAttribute(e)}}function eN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tN(e,n){return function(){this.setAttribute(e,n)}}function nN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function iN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function rN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function aN(e,n){var i=Zc(e);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((n==null?i.local?eN:WE:typeof n=="function"?i.local?rN:iN:i.local?nN:tN)(i,n))}function bv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lN(e){return function(){this.style.removeProperty(e)}}function sN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function oN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function uN(e,n,i){return arguments.length>1?this.each((n==null?lN:typeof n=="function"?oN:sN)(e,n,i??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||bv(e).getComputedStyle(e,null).getPropertyValue(n)}function cN(e){return function(){delete this[e]}}function fN(e,n){return function(){this[e]=n}}function dN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function hN(e,n){return arguments.length>1?this.each((n==null?cN:typeof n=="function"?dN:fN)(e,n)):this.node()[e]}function vv(e){return e.trim().split(/^|\s+/)}function am(e){return e.classList||new wv(e)}function wv(e){this._node=e,this._names=vv(e.getAttribute("class")||"")}wv.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sv(e,n){for(var i=am(e),a=-1,s=n.length;++a<s;)i.add(n[a])}function _v(e,n){for(var i=am(e),a=-1,s=n.length;++a<s;)i.remove(n[a])}function pN(e){return function(){Sv(this,e)}}function mN(e){return function(){_v(this,e)}}function gN(e,n){return function(){(n.apply(this,arguments)?Sv:_v)(this,e)}}function yN(e,n){var i=vv(e+"");if(arguments.length<2){for(var a=am(this.node()),s=-1,o=i.length;++s<o;)if(!a.contains(i[s]))return!1;return!0}return this.each((typeof n=="function"?gN:n?pN:mN)(i,n))}function xN(){this.textContent=""}function bN(e){return function(){this.textContent=e}}function vN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function wN(e){return arguments.length?this.each(e==null?xN:(typeof e=="function"?vN:bN)(e)):this.node().textContent}function SN(){this.innerHTML=""}function _N(e){return function(){this.innerHTML=e}}function kN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function EN(e){return arguments.length?this.each(e==null?SN:(typeof e=="function"?kN:_N)(e)):this.node().innerHTML}function NN(){this.nextSibling&&this.parentNode.appendChild(this)}function CN(){return this.each(NN)}function MN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TN(){return this.each(MN)}function AN(e){var n=typeof e=="function"?e:pv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function zN(){return null}function DN(e,n){var i=typeof e=="function"?e:pv(e),a=n==null?zN:typeof n=="function"?n:rm(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function jN(){var e=this.parentNode;e&&e.removeChild(this)}function RN(){return this.each(jN)}function ON(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function LN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function HN(e){return this.select(e?LN:ON)}function BN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function UN(e){return function(n){e.call(this,n,this.__data__)}}function IN(e){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");return a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),{type:n,name:i}})}function qN(e){return function(){var n=this.__on;if(n){for(var i=0,a=-1,s=n.length,o;i<s;++i)o=n[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++a]=o;++a?n.length=a:delete this.__on}}}function $N(e,n,i){return function(){var a=this.__on,s,o=UN(n);if(a){for(var u=0,f=a.length;u<f;++u)if((s=a[u]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=i),s.value=n;return}}this.addEventListener(e.type,o,i),s={type:e.type,name:e.name,value:n,listener:o,options:i},a?a.push(s):this.__on=[s]}}function VN(e,n,i){var a=IN(e+""),s,o=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(s=0,g=f[h];s<o;++s)if((u=a[s]).type===g.type&&u.name===g.name)return g.value}return}for(f=n?$N:qN,s=0;s<o;++s)this.each(f(a[s],n,i));return this}function kv(e,n,i){var a=bv(e),s=a.CustomEvent;typeof s=="function"?s=new s(n,i):(s=a.document.createEvent("Event"),i?(s.initEvent(n,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(n,!1,!1)),e.dispatchEvent(s)}function YN(e,n){return function(){return kv(this,e,n)}}function PN(e,n){return function(){return kv(this,e,n.apply(this,arguments))}}function XN(e,n){return this.each((typeof n=="function"?PN:YN)(e,n))}function*FN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length,u;s<o;++s)(u=a[s])&&(yield u)}var Ev=[null];function Sn(e,n){this._groups=e,this._parents=n}function lo(){return new Sn([[document.documentElement]],Ev)}function GN(){return this}Sn.prototype=lo.prototype={constructor:Sn,select:vE,selectAll:kE,selectChild:ME,selectChildren:DE,filter:jE,data:UE,enter:RE,exit:qE,join:$E,merge:VE,selection:GN,order:YE,sort:PE,call:FE,nodes:GE,node:ZE,size:QE,empty:KE,each:JE,attr:aN,style:uN,property:hN,classed:yN,text:wN,html:EN,raise:CN,lower:TN,append:AN,insert:DN,remove:RN,clone:HN,datum:BN,on:VN,dispatch:XN,[Symbol.iterator]:FN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Ev)}function ZN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=ZN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var s=n.getBoundingClientRect();return[e.clientX-s.left-n.clientLeft,e.clientY-s.top-n.clientTop]}}return[e.pageX,e.pageY]}const QN={passive:!1},Xs={capture:!0,passive:!1};function Uh(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function Nv(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",tl,Xs);"onselectstart"in n?i.on("selectstart.drag",tl,Xs):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Cv(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",tl,Xs),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Pu=e=>()=>e;function Ep(e,{sourceEvent:n,subject:i,target:a,identifier:s,active:o,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}Ep.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function KN(e){return!e.ctrlKey&&!e.button}function JN(){return this.parentNode}function WN(e,n){return n??{x:e.x,y:e.y}}function eC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mv(){var e=KN,n=JN,i=WN,a=eC,s={},o=Gc("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",E).on("touchmove.drag",_,QN).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,L){if(!(g||!e.call(this,C,L))){var A=k(this,n.call(this,C,L),C,L,"mouse");A&&(vn(C.view).on("mousemove.drag",w,Xs).on("mouseup.drag",N,Xs),Nv(C.view),Uh(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(tl(C),!d){var L=C.clientX-f,A=C.clientY-h;d=L*L+A*A>m}s.mouse("drag",C)}function N(C){vn(C.view).on("mousemove.drag mouseup.drag",null),Cv(C.view,d),tl(C),s.mouse("end",C)}function E(C,L){if(e.call(this,C,L)){var A=C.changedTouches,H=n.call(this,C,L),F=A.length,G,q;for(G=0;G<F;++G)(q=k(this,H,C,L,A[G].identifier,A[G]))&&(Uh(C),q("start",C,A[G]))}}function _(C){var L=C.changedTouches,A=L.length,H,F;for(H=0;H<A;++H)(F=s[L[H].identifier])&&(tl(C),F("drag",C,L[H]))}function j(C){var L=C.changedTouches,A=L.length,H,F;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<A;++H)(F=s[L[H].identifier])&&(Uh(C),F("end",C,L[H]))}function k(C,L,A,H,F,G){var q=o.copy(),V=In(G||A,L),Y,te,O;if((O=i.call(C,new Ep("beforestart",{sourceEvent:A,target:x,identifier:F,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:q}),H))!=null)return Y=O.x-V[0]||0,te=O.y-V[1]||0,function B(D,U,P){var Q=V,z;switch(D){case"start":s[F]=B,z=u++;break;case"end":delete s[F],--u;case"drag":V=In(P||U,L),z=u;break}q.call(D,C,new Ep(D,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+Y,y:V[1]+te,dx:V[0]-Q[0],dy:V[1]-Q[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Pu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Pu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Pu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Pu(!!C),x):a},x.on=function(){var C=o.on.apply(o,arguments);return C===o?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function lm(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Tv(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function so(){}var Fs=.7,Ac=1/Fs,nl="\\s*([+-]?\\d+)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tC=/^#([0-9a-f]{3,8})$/,nC=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),iC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),rC=new RegExp(`^rgba\\(${nl},${nl},${nl},${Gs}\\)$`),aC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Gs}\\)$`),lC=new RegExp(`^hsl\\(${Gs},${ii},${ii}\\)$`),sC=new RegExp(`^hsla\\(${Gs},${ii},${ii},${Gs}\\)$`),Yx={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};lm(so,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Px,formatHex:Px,formatHex8:oC,formatHsl:uC,formatRgb:Xx,toString:Xx});function Px(){return this.rgb().formatHex()}function oC(){return this.rgb().formatHex8()}function uC(){return Av(this).formatHsl()}function Xx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=tC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Fx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Xu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Xu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=nC.exec(e))?new an(n[1],n[2],n[3],1):(n=iC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rC.exec(e))?Xu(n[1],n[2],n[3],n[4]):(n=aC.exec(e))?Xu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=lC.exec(e))?Qx(n[1],n[2]/100,n[3]/100,1):(n=sC.exec(e))?Qx(n[1],n[2]/100,n[3]/100,n[4]):Yx.hasOwnProperty(e)?Fx(Yx[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Fx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Xu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function cC(e){return e instanceof so||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Np(e,n,i,a){return arguments.length===1?cC(e):new an(e,n,i,a??1)}function an(e,n,i,a){this.r=+e,this.g=+n,this.b=+i,this.opacity=+a}lm(an,Np,Tv(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Kr(this.r),Kr(this.g),Kr(this.b),zc(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:Gx,formatHex:Gx,formatHex8:fC,formatRgb:Zx,toString:Zx}));function Gx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function fC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zx(){const e=zc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function zc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function Qx(e,n,i,a){return a<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,i,a)}function Av(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof so||(e=Wr(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,a=e.b/255,s=Math.min(n,i,a),o=Math.max(n,i,a),u=NaN,f=o-s,h=(o+s)/2;return f?(n===o?u=(i-a)/f+(i<a)*6:i===o?u=(a-n)/f+2:u=(n-i)/f+4,f/=h<.5?o+s:2-o-s,u*=60):f=h>0&&h<1?0:u,new qn(u,f,h,e.opacity)}function dC(e,n,i,a){return arguments.length===1?Av(e):new qn(e,n,i,a??1)}function qn(e,n,i,a){this.h=+e,this.s=+n,this.l=+i,this.opacity=+a}lm(qn,dC,Tv(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*n,s=2*i-a;return new an(Ih(e>=240?e-240:e+120,s,a),Ih(e,s,a),Ih(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new qn(Kx(this.h),Fu(this.s),Fu(this.l),zc(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=zc(this.opacity);return`${e===1?"hsl(":"hsla("}${Kx(this.h)}, ${Fu(this.s)*100}%, ${Fu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kx(e){return e=(e||0)%360,e<0?e+360:e}function Fu(e){return Math.max(0,Math.min(1,e||0))}function Ih(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const sm=e=>()=>e;function hC(e,n){return function(i){return e+i*n}}function pC(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(a){return Math.pow(e+a*n,i)}}function mC(e){return(e=+e)==1?zv:function(n,i){return i-n?pC(n,i,e):sm(isNaN(n)?i:n)}}function zv(e,n){var i=n-e;return i?hC(e,i):sm(isNaN(e)?n:e)}const Dc=(function e(n){var i=mC(n);function a(s,o){var u=i((s=Np(s)).r,(o=Np(o)).r),f=i(s.g,o.g),h=i(s.b,o.b),d=zv(s.opacity,o.opacity);return function(g){return s.r=u(g),s.g=f(g),s.b=h(g),s.opacity=d(g),s+""}}return a.gamma=e,a})(1);function gC(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,a=n.slice(),s;return function(o){for(s=0;s<i;++s)a[s]=e[s]*(1-o)+n[s]*o;return a}}function yC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xC(e,n){var i=n?n.length:0,a=e?Math.min(i,e.length):0,s=new Array(a),o=new Array(i),u;for(u=0;u<a;++u)s[u]=qs(e[u],n[u]);for(;u<i;++u)o[u]=n[u];return function(f){for(u=0;u<a;++u)o[u]=s[u](f);return o}}function bC(e,n){var i=new Date;return e=+e,n=+n,function(a){return i.setTime(e*(1-a)+n*a),i}}function ti(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function vC(e,n){var i={},a={},s;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(s in n)s in e?i[s]=qs(e[s],n[s]):a[s]=n[s];return function(o){for(s in i)a[s]=i[s](o);return a}}var Cp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qh=new RegExp(Cp.source,"g");function wC(e){return function(){return e}}function SC(e){return function(n){return e(n)+""}}function Dv(e,n){var i=Cp.lastIndex=qh.lastIndex=0,a,s,o,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Cp.exec(e))&&(s=qh.exec(n));)(o=s.index)>i&&(o=n.slice(i,o),f[u]?f[u]+=o:f[++u]=o),(a=a[0])===(s=s[0])?f[u]?f[u]+=s:f[++u]=s:(f[++u]=null,h.push({i:u,x:ti(a,s)})),i=qh.lastIndex;return i<n.length&&(o=n.slice(i),f[u]?f[u]+=o:f[++u]=o),f.length<2?h[0]?SC(h[0].x):wC(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function qs(e,n){var i=typeof n,a;return n==null||i==="boolean"?sm(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,Dc):Dv:n instanceof Wr?Dc:n instanceof Date?bC:yC(n)?gC:Array.isArray(n)?xC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?vC:ti)(e,n)}var Jx=180/Math.PI,Mp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jv(e,n,i,a,s,o){var u,f,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*i+n*a)&&(i-=e*h,a-=n*h),(f=Math.sqrt(i*i+a*a))&&(i/=f,a/=f,h/=f),e*a<n*i&&(e=-e,n=-n,h=-h,u=-u),{translateX:s,translateY:o,rotate:Math.atan2(n,e)*Jx,skewX:Math.atan(h)*Jx,scaleX:u,scaleY:f}}var Gu;function _C(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Mp:jv(n.a,n.b,n.c,n.d,n.e,n.f)}function kC(e){return e==null||(Gu||(Gu=document.createElementNS("http://www.w3.org/2000/svg","g")),Gu.setAttribute("transform",e),!(e=Gu.transform.baseVal.consolidate()))?Mp:(e=e.matrix,jv(e.a,e.b,e.c,e.d,e.e,e.f))}function Rv(e,n,i,a){function s(d){return d.length?d.pop()+" ":""}function o(d,g,m,x,b,w){if(d!==m||g!==x){var N=b.push("translate(",null,n,null,i);w.push({i:N-4,x:ti(d,m)},{i:N-2,x:ti(g,x)})}else(m||x)&&b.push("translate("+m+n+x+i)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(s(m)+"rotate(",null,a)-2,x:ti(d,g)})):g&&m.push(s(m)+"rotate("+g+a)}function f(d,g,m,x){d!==g?x.push({i:m.push(s(m)+"skewX(",null,a)-2,x:ti(d,g)}):g&&m.push(s(m)+"skewX("+g+a)}function h(d,g,m,x,b,w){if(d!==m||g!==x){var N=b.push(s(b)+"scale(",null,",",null,")");w.push({i:N-4,x:ti(d,m)},{i:N-2,x:ti(g,x)})}else(m!==1||x!==1)&&b.push(s(b)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),o(d.translateX,d.translateY,g.translateX,g.translateY,m,x),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(b){for(var w=-1,N=x.length,E;++w<N;)m[(E=x[w]).i]=E.x(b);return m.join("")}}}var EC=Rv(_C,"px, ","px)","deg)"),NC=Rv(kC,", ",")",")"),CC=1e-12;function Wx(e){return((e=Math.exp(e))+1/e)/2}function MC(e){return((e=Math.exp(e))-1/e)/2}function TC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Sc=(function e(n,i,a){function s(o,u){var f=o[0],h=o[1],d=o[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-h,N=b*b+w*w,E,_;if(N<CC)_=Math.log(x/d)/n,E=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var j=Math.sqrt(N),k=(x*x-d*d+a*N)/(2*d*i*j),C=(x*x-d*d-a*N)/(2*x*i*j),L=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/n,E=function(H){var F=H*_,G=Wx(L),q=d/(i*j)*(G*TC(n*F+L)-MC(L));return[f+q*b,h+q*w,d*G/Wx(n*F+L)]}}return E.duration=_*1e3*n/Math.SQRT2,E}return s.rho=function(o){var u=Math.max(.001,+o),f=u*u,h=f*f;return e(u,f,h)},s})(Math.SQRT2,2,4);var ol=0,Hs=0,ms=0,Ov=1e3,jc,Bs,Rc=0,ea=0,Qc=0,Zs=typeof performance=="object"&&performance.now?performance:Date,Lv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function om(){return ea||(Lv(AC),ea=Zs.now()+Qc)}function AC(){ea=0}function Oc(){this._call=this._time=this._next=null}Oc.prototype=Hv.prototype={constructor:Oc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?om():+i)+(n==null?0:+n),!this._next&&Bs!==this&&(Bs?Bs._next=this:jc=this,Bs=this),this._call=e,this._time=i,Tp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tp())}};function Hv(e,n,i){var a=new Oc;return a.restart(e,n,i),a}function zC(){om(),++ol;for(var e=jc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ol}function eb(){ea=(Rc=Zs.now())+Qc,ol=Hs=0;try{zC()}finally{ol=0,jC(),ea=0}}function DC(){var e=Zs.now(),n=e-Rc;n>Ov&&(Qc-=n,Rc=e)}function jC(){for(var e,n=jc,i,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:jc=i);Bs=e,Tp(a)}function Tp(e){if(!ol){Hs&&(Hs=clearTimeout(Hs));var n=e-ea;n>24?(e<1/0&&(Hs=setTimeout(eb,e-Zs.now()-Qc)),ms&&(ms=clearInterval(ms))):(ms||(Rc=Zs.now(),ms=setInterval(DC,Ov)),ol=1,Lv(eb))}}function tb(e,n,i){var a=new Oc;return n=n==null?0:+n,a.restart(s=>{a.stop(),e(s+n)},n,i),a}var RC=Gc("start","end","cancel","interrupt"),OC=[],Bv=0,nb=1,Ap=2,_c=3,ib=4,zp=5,kc=6;function Kc(e,n,i,a,s,o){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;LC(e,i,{name:n,index:a,group:s,on:RC,tween:OC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Bv})}function um(e,n){var i=Xn(e,n);if(i.state>Bv)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>_c)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function LC(e,n,i){var a=e.__transition,s;a[n]=i,i.timer=Hv(o,0,i.time);function o(d){i.state=nb,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,m,x,b;if(i.state!==nb)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===_c)return tb(u);b.state===ib?(b.state=kc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=kc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(tb(function(){i.state===_c&&(i.state=ib,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=Ap,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Ap){for(i.state=_c,s=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(b=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(s[++m]=b);s.length=m+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=zp,1),m=-1,x=s.length;++m<x;)s[m].call(e,g);i.state===zp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=kc,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function Ec(e,n){var i=e.__transition,a,s,o=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((a=i[u]).name!==n){o=!1;continue}s=a.state>Ap&&a.state<zp,a.state=kc,a.timer.stop(),a.on.call(s?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}o&&delete e.__transition}}function HC(e){return this.each(function(){Ec(this,e)})}function BC(e,n){var i,a;return function(){var s=ai(this,e),o=s.tween;if(o!==i){a=i=o;for(var u=0,f=a.length;u<f;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}s.tween=a}}function UC(e,n,i){var a,s;if(typeof i!="function")throw new Error;return function(){var o=ai(this,e),u=o.tween;if(u!==a){s=(a=u).slice();for(var f={name:n,value:i},h=0,d=s.length;h<d;++h)if(s[h].name===n){s[h]=f;break}h===d&&s.push(f)}o.tween=s}}function IC(e,n){var i=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),i).tween,s=0,o=a.length,u;s<o;++s)if((u=a[s]).name===e)return u.value;return null}return this.each((n==null?BC:UC)(i,e,n))}function cm(e,n,i){var a=e._id;return e.each(function(){var s=ai(this,a);(s.value||(s.value={}))[n]=i.apply(this,arguments)}),function(s){return Xn(s,a).value[n]}}function Uv(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?Dc:(i=Wr(n))?(n=i,Dc):Dv)(e,n)}function qC(e){return function(){this.removeAttribute(e)}}function $C(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttribute(e);return u===s?null:u===a?o:o=n(a=u,i)}}function YC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttributeNS(e.space,e.local);return u===s?null:u===a?o:o=n(a=u,i)}}function PC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function XC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function FC(e,n){var i=Zc(e),a=i==="transform"?NC:Uv;return this.attrTween(e,typeof n=="function"?(i.local?XC:PC)(i,a,cm(this,"attr."+e,n)):n==null?(i.local?$C:qC)(i):(i.local?YC:VC)(i,a,n))}function GC(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function ZC(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function QC(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&ZC(e,o)),i}return s._value=n,s}function KC(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&GC(e,o)),i}return s._value=n,s}function JC(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var a=Zc(e);return this.tween(i,(a.local?QC:KC)(a,n))}function WC(e,n){return function(){um(this,e).delay=+n.apply(this,arguments)}}function e4(e,n){return n=+n,function(){um(this,e).delay=n}}function t4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?WC:e4)(n,e)):Xn(this.node(),n).delay}function n4(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function i4(e,n){return n=+n,function(){ai(this,e).duration=n}}function r4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?n4:i4)(n,e)):Xn(this.node(),n).duration}function a4(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function l4(e){var n=this._id;return arguments.length?this.each(a4(n,e)):Xn(this.node(),n).ease}function s4(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function o4(e){if(typeof e!="function")throw new Error;return this.each(s4(this._id,e))}function u4(e){typeof e!="function"&&(e=gv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Li(a,this._parents,this._name,this._id)}function c4(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,a=n.length,s=i.length,o=Math.min(a,s),u=new Array(a),f=0;f<o;++f)for(var h=n[f],d=i[f],g=h.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=h[b]||d[b])&&(m[b]=x);for(;f<a;++f)u[f]=n[f];return new Li(u,this._parents,this._name,this._id)}function f4(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function d4(e,n,i){var a,s,o=f4(n)?um:ai;return function(){var u=o(this,e),f=u.on;f!==a&&(s=(a=f).copy()).on(n,i),u.on=s}}function h4(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(d4(i,e,n))}function p4(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function m4(){return this.on("end.remove",p4(this._id))}function g4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=rm(e));for(var a=this._groups,s=a.length,o=new Array(s),u=0;u<s;++u)for(var f=a[u],h=f.length,d=o[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Kc(d[x],n,i,x,d,Xn(g,i)));return new Li(o,this._parents,n,i)}function y4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=mv(e));for(var a=this._groups,s=a.length,o=[],u=[],f=0;f<s;++f)for(var h=a[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),b,w=Xn(g,i),N=0,E=x.length;N<E;++N)(b=x[N])&&Kc(b,n,i,N,x,w);o.push(x),u.push(g)}return new Li(o,u,n,i)}var x4=lo.prototype.constructor;function b4(){return new x4(this._groups,this._parents)}function v4(e,n){var i,a,s;return function(){var o=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return o===u?null:o===i&&u===a?s:s=n(i=o,a=u)}}function Iv(e){return function(){this.style.removeProperty(e)}}function w4(e,n,i){var a,s=i+"",o;return function(){var u=sl(this,e);return u===s?null:u===a?o:o=n(a=u,i)}}function S4(e,n,i){var a,s,o;return function(){var u=sl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f))}}function _4(e,n){var i,a,s,o="style."+n,u="end."+o,f;return function(){var h=ai(this,e),d=h.on,g=h.value[o]==null?f||(f=Iv(n)):void 0;(d!==i||s!==g)&&(a=(i=d).copy()).on(u,s=g),h.on=a}}function k4(e,n,i){var a=(e+="")=="transform"?EC:Uv;return n==null?this.styleTween(e,v4(e,a)).on("end.style."+e,Iv(e)):typeof n=="function"?this.styleTween(e,S4(e,a,cm(this,"style."+e,n))).each(_4(this._id,e)):this.styleTween(e,w4(e,a,n),i).on("end.style."+e,null)}function E4(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function N4(e,n,i){var a,s;function o(){var u=n.apply(this,arguments);return u!==s&&(a=(s=u)&&E4(e,u,i)),a}return o._value=n,o}function C4(e,n,i){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,N4(e,n,i??""))}function M4(e){return function(){this.textContent=e}}function T4(e){return function(){var n=e(this);this.textContent=n??""}}function A4(e){return this.tween("text",typeof e=="function"?T4(cm(this,"text",e)):M4(e==null?"":e+""))}function z4(e){return function(n){this.textContent=e.call(this,n)}}function D4(e){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&z4(s)),n}return a._value=e,a}function j4(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,D4(e))}function R4(){for(var e=this._name,n=this._id,i=qv(),a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Xn(h,n);Kc(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Li(a,this._parents,e,i)}function O4(){var e,n,i=this,a=i._id,s=i.size();return new Promise(function(o,u){var f={value:u},h={value:function(){--s===0&&o()}};i.each(function(){var d=ai(this,a),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),s===0&&o()})}var L4=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function qv(){return++L4}var Ai=lo.prototype;Li.prototype={constructor:Li,select:g4,selectAll:y4,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:u4,merge:c4,selection:b4,transition:R4,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:h4,attr:FC,attrTween:JC,style:k4,styleTween:C4,text:A4,textTween:j4,remove:m4,tween:IC,delay:t4,duration:r4,ease:l4,easeVarying:o4,end:O4,[Symbol.iterator]:Ai[Symbol.iterator]};function H4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var B4={time:null,delay:0,duration:250,ease:H4};function U4(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function I4(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=qv(),(i=B4).time=om(),e=e==null?null:e+"");for(var a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Kc(h,e,n,d,u,i||U4(h,n));return new Li(a,this._parents,e,n)}lo.prototype.interrupt=HC;lo.prototype.transition=I4;const Zu=e=>()=>e;function q4(e,{sourceEvent:n,target:i,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function Ri(e,n,i){this.k=e,this.x=n,this.y=i}Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*n)},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 Jc=new Ri(1,0,0);$v.prototype=Ri.prototype;function $v(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jc;return e.__zoom}function $h(e){e.stopImmediatePropagation()}function gs(e){e.preventDefault(),e.stopImmediatePropagation()}function $4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function V4(){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 rb(){return this.__zoom||Jc}function Y4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function P4(){return navigator.maxTouchPoints||"ontouchstart"in this}function X4(e,n,i){var a=e.invertX(n[0][0])-i[0][0],s=e.invertX(n[1][0])-i[1][0],o=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function Vv(){var e=$4,n=V4,i=X4,a=Y4,s=P4,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=Sc,d=Gc("start","zoom","end"),g,m,x,b=500,w=150,N=0,E=10;function _(O){O.property("__zoom",rb).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",q).filter(s).on("touchstart.zoom",V).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,B,D,U){var P=O.selection?O.selection():O;P.property("__zoom",rb),O!==P?L(O,B,D,U):P.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(O,B,D,U){_.scaleTo(O,function(){var P=this.__zoom.k,Q=typeof B=="function"?B.apply(this,arguments):B;return P*Q},D,U)},_.scaleTo=function(O,B,D,U){_.transform(O,function(){var P=n.apply(this,arguments),Q=this.__zoom,z=D==null?C(P):typeof D=="function"?D.apply(this,arguments):D,R=Q.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(j(Q,$),z,R),P,u)},D,U)},_.translateBy=function(O,B,D,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof D=="function"?D.apply(this,arguments):D),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,D,U,P){_.transform(O,function(){var Q=n.apply(this,arguments),z=this.__zoom,R=U==null?C(Q):typeof U=="function"?U.apply(this,arguments):U;return i(Jc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof D=="function"?-D.apply(this,arguments):-D),Q,u)},U,P)};function j(O,B){return B=Math.max(o[0],Math.min(o[1],B)),B===O.k?O:new Ri(B,O.x,O.y)}function k(O,B,D){var U=B[0]-D[0]*O.k,P=B[1]-D[1]*O.k;return U===O.x&&P===O.y?O:new Ri(O.k,U,P)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,B,D,U){O.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var P=this,Q=arguments,z=A(P,Q).event(U),R=n.apply(P,Q),$=D==null?C(R):typeof D=="function"?D.apply(P,Q):D,T=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=P.__zoom,ce=typeof B=="function"?B.apply(P,Q):B,fe=h(ie.invert($).concat(T/ie.k),ce.invert($).concat(T/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=T/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,D){return!D&&O.__zooming||new H(O,B)}function H(O,B){this.that=O,this.args=B,this.active=0,this.sourceEvent=null,this.extent=n.apply(O,B),this.taps=0}H.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,B){return this.mouse&&O!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var B=vn(this.that).datum();d.call(O,this.that,new q4(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var D=A(this,B).event(O),U=this.__zoom,P=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,a.apply(this,arguments)))),Q=In(O);if(D.wheel)(D.mouse[0][0]!==Q[0]||D.mouse[0][1]!==Q[1])&&(D.mouse[1]=U.invert(D.mouse[0]=Q)),clearTimeout(D.wheel);else{if(U.k===P)return;D.mouse=[Q,U.invert(Q)],Ec(this),D.start()}gs(O),D.wheel=setTimeout(z,w),D.zoom("mouse",i(k(j(U,P),D.mouse[0],D.mouse[1]),D.extent,u));function z(){D.wheel=null,D.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var D=O.currentTarget,U=A(this,B,!0).event(O),P=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",T,!0),Q=In(O,D),z=O.clientX,R=O.clientY;Nv(O.view),$h(O),U.mouse=[Q,this.__zoom.invert(Q)],Ec(this),U.start();function $(ie){if(gs(ie),!U.moved){var ce=ie.clientX-z,fe=ie.clientY-R;U.moved=ce*ce+fe*fe>N}U.event(ie).zoom("mouse",i(k(U.that.__zoom,U.mouse[0]=In(ie,D),U.mouse[1]),U.extent,u))}function T(ie){P.on("mousemove.zoom mouseup.zoom",null),Cv(ie.view,U.moved),gs(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var D=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),P=D.invert(U),Q=D.k*(O.shiftKey?.5:2),z=i(k(j(D,Q),U,P),n.apply(this,B),u);gs(O),f>0?vn(this).transition().duration(f).call(L,z,U,O):vn(this).call(_.transform,z,U,O)}}function V(O,...B){if(e.apply(this,arguments)){var D=O.touches,U=D.length,P=A(this,B,O.changedTouches.length===U).event(O),Q,z,R,$;for($h(O),z=0;z<U;++z)R=D[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],P.touch0?!P.touch1&&P.touch0[2]!==$[2]&&(P.touch1=$,P.taps=0):(P.touch0=$,Q=!0,P.taps=1+!!g);g&&(g=clearTimeout(g)),Q&&(P.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),Ec(this),P.start())}}function Y(O,...B){if(this.__zooming){var D=A(this,B).event(O),U=O.changedTouches,P=U.length,Q,z,R,$;for(gs(O),Q=0;Q<P;++Q)z=U[Q],R=In(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=R:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=R);if(z=D.that.__zoom,D.touch1){var T=D.touch0[0],ie=D.touch0[1],ce=D.touch1[0],fe=D.touch1[1],he=(he=ce[0]-T[0])*he+(he=ce[1]-T[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=j(z,Math.sqrt(he/ue)),R=[(T[0]+ce[0])/2,(T[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(D.touch0)R=D.touch0[0],$=D.touch0[1];else return;D.zoom("touch",i(k(z,R,$),D.extent,u))}}function te(O,...B){if(this.__zooming){var D=A(this,B).event(O),U=O.changedTouches,P=U.length,Q,z;for($h(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),Q=0;Q<P;++Q)z=U[Q],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=In(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<E)){var R=vn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(a=typeof O=="function"?O:Zu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zu(!!O),_):e},_.touchable=function(O){return arguments.length?(s=typeof O=="function"?O:Zu(!!O),_):s},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Zu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):n},_.scaleExtent=function(O){return arguments.length?(o[0]=+O[0],o[1]=+O[1],_):[o[0],o[1]]},_.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(f=+O,_):f},_.interpolate=function(O){return arguments.length?(h=O,_):h},_.on=function(){var O=d.on.apply(d,arguments);return O===d?_:O},_.clickDistance=function(O){return arguments.length?(N=(O=+O)*O,_):Math.sqrt(N)},_.tapDistance=function(O){return arguments.length?(E=+O,_):E},_}const ri={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:n,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:a}", edge id: ${n}.`,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."},Qs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yv=["Enter"," ","Escape"],Pv={"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:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"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 ul;(function(e){e.Strict="strict",e.Loose="loose"})(ul||(ul={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var Ks;(function(e){e.Partial="partial",e.Full="full"})(Ks||(Ks={}));const Xv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wr||(wr={}));var Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const ab={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Fv(e){return e===null?null:e?"valid":"invalid"}const Gv=e=>"id"in e&&"source"in e&&"target"in e,F4=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),oo=(e,n=[0,0])=>{const{width:i,height:a}=Bi(e),s=e.origin??n,o=i*s[0],u=a*s[1];return{x:e.position.x-o,y:e.position.y-u}},G4=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((a,s)=>{const o=typeof s=="string";let u=!n.nodeLookup&&!o?s:void 0;n.nodeLookup&&(u=o?n.nodeLookup.get(s):fm(s)?s:n.nodeLookup.get(s.id));const f=u?Hc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Wc(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ef(i)},uo=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(i=Wc(i,Hc(s)),a=!0)}),a?ef(i):{x:0,y:0,width:0,height:0}},dm=(e,n,[i,a,s]=[0,0,1],o=!1,u=!1)=>{const f={...fo(n,[i,a,s]),width:n.width/s,height:n.height/s},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(u&&!m||x)continue;const b=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,N=Js(f,fl(d)),E=(b??0)*(w??0),_=o&&N>0;(!d.internals.handleBounds||_||N>=E||d.dragging)&&h.push(d)}return h},Z4=(e,n)=>{const i=new Set;return e.forEach(a=>{i.add(a.id)}),n.filter(a=>i.has(a.source)||i.has(a.target))};function Q4(e,n){const i=new Map,a=n?.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&(n?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&i.set(s.id,s)}),i}async function K4({nodes:e,width:n,height:i,panZoom:a,minZoom:s,maxZoom:o},u){if(e.size===0)return Promise.resolve(!0);const f=Q4(e,u),h=uo(f),d=hm(h,n,i,u?.minZoom??s,u?.maxZoom??o,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Zv({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:s,onError:o}){const u=i.get(e),f=u.parentId?i.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??a;let m=u.extent||s;if(u.extent==="parent"&&!u.expandParent)if(!f)o?.("005",ri.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[h,d],[h+b,d+w]])}else f&&dl(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=dl(m)?ta(n,m,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&o?.("015",ri.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function J4({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:a,onBeforeDelete:s}){const o=new Set(e.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const b=o.has(x.id),w=!b&&x.parentId&&u.find(N=>N.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(n.map(x=>x.id)),h=a.filter(x=>x.deletable!==!1),g=Z4(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!s)return{edges:g,nodes:u};const m=await s({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const cl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:cl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:cl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Qv(e,n,i){const{width:a,height:s}=Bi(i),{x:o,y:u}=i.internals.positionAbsolute;return ta(e,[[o,u],[o+a,u+s]],n)}const lb=(e,n,i)=>e<n?cl(Math.abs(e-n),1,n)/n:e>i?-cl(Math.abs(e-i),1,n)/n:0,Kv=(e,n,i=15,a=40)=>{const s=lb(e.x,a,n.width-a)*i,o=lb(e.y,a,n.height-a)*i;return[s,o]},Wc=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Dp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),ef=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),fl=(e,n=[0,0])=>{const{x:i,y:a}=fm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Hc=(e,n=[0,0])=>{const{x:i,y:a}=fm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Jv=(e,n)=>ef(Wc(Dp(e),Dp(n))),Js=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*a)},sb=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),W4=(e,n)=>{},co=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),fo=({x:e,y:n},[i,a,s],o=!1,u=[1,1])=>{const f={x:(e-i)/s,y:(n-a)/s};return o?co(f,u):f},Bc=({x:e,y:n},[i,a,s])=>({x:e*s+i,y:n*s+a});function Pa(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.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 eM(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Pa(e,i),s=Pa(e,n);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof e=="object"){const a=Pa(e.top??e.y??0,i),s=Pa(e.bottom??e.y??0,i),o=Pa(e.left??e.x??0,n),u=Pa(e.right??e.x??0,n);return{top:a,right:u,bottom:s,left:o,x:o+u,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tM(e,n,i,a,s,o){const{x:u,y:f}=Bc(e,[n,i,a]),{x:h,y:d}=Bc({x:e.x+e.width,y:e.y+e.height},[n,i,a]),g=s-h,m=o-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const hm=(e,n,i,a,s,o)=>{const u=eM(o,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=cl(d,a,s),m=e.x+e.width/2,x=e.y+e.height/2,b=n/2-m*g,w=i/2-x*g,N=tM(e,b,w,g,n,i),E={left:Math.min(N.left-u.left,0),top:Math.min(N.top-u.top,0),right:Math.min(N.right-u.right,0),bottom:Math.min(N.bottom-u.bottom,0)};return{x:b-E.left+E.right,y:w-E.top+E.bottom,zoom:g}},Ws=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function dl(e){return e!=null&&e!=="parent"}function Bi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Wv(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ew(e,n={width:0,height:0},i,a,s){const o={...e},u=a.get(i);if(u){const f=u.origin||s;o.x+=u.internals.positionAbsolute.x-(n.width??0)*f[0],o.y+=u.internals.positionAbsolute.y-(n.height??0)*f[1]}return o}function ob(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function nM(){let e,n;return{promise:new Promise((a,s)=>{e=a,n=s}),resolve:e,reject:n}}function iM(e){return{...Pv,...e||{}}}function $s(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:s}){const{x:o,y:u}=Vn(e),f=fo({x:o-(s?.left??0),y:u-(s?.top??0)},a),{x:h,y:d}=i?co(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const pm=e=>({width:e.offsetWidth,height:e.offsetHeight}),tw=e=>e?.getRootNode?.()||window?.document,rM=["INPUT","SELECT","TEXTAREA"];function nw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:rM.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const iw=e=>"clientX"in e,Vn=(e,n)=>{const i=iw(e),a=i?e.clientX:e.touches?.[0].clientX,s=i?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:s-(n?.top??0)}},ub=(e,n,i,a,s)=>{const o=n.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:s,position:u.getAttribute("data-handlepos"),x:(f.left-i.left)/a,y:(f.top-i.top)/a,...pm(u)}})};function rw({sourceX:e,sourceY:n,targetX:i,targetY:a,sourceControlX:s,sourceControlY:o,targetControlX:u,targetControlY:f}){const h=e*.125+s*.375+u*.375+i*.125,d=n*.125+o*.375+f*.375+a*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function Qu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function cb({pos:e,x1:n,y1:i,x2:a,y2:s,c:o}){switch(e){case be.Left:return[n-Qu(n-a,o),i];case be.Right:return[n+Qu(a-n,o),i];case be.Top:return[n,i-Qu(i-s,o)];case be.Bottom:return[n,i+Qu(s-i,o)]}}function aw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,curvature:u=.25}){const[f,h]=cb({pos:i,x1:e,y1:n,x2:a,y2:s,c:u}),[d,g]=cb({pos:o,x1:a,y1:s,x2:e,y2:n,c:u}),[m,x,b,w]=rw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${a},${s}`,m,x,b,w]}function lw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const s=Math.abs(i-e)/2,o=i<e?i+s:i-s,u=Math.abs(a-n)/2,f=a<n?a+u:a-u;return[o,f,s,u]}function aM({sourceNode:e,targetNode:n,selected:i=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return a;const u=s&&i?a+1e3:a,f=Math.max(e.parentId||s&&e.selected?e.internals.z:0,n.parentId||s&&n.selected?n.internals.z:0);return u+f}function lM({sourceNode:e,targetNode:n,width:i,height:a,transform:s}){const o=Wc(Hc(e),Hc(n));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const u={x:-s[0]/s[2],y:-s[1]/s[2],width:i/s[2],height:a/s[2]};return Js(u,ef(o))>0}const sM=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,oM=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),sw=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||sM;let s;return Gv(e)?s={...e}:s={...e,id:a(e)},oM(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function ow({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[s,o,u,f]=lw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,s,o,u,f]}const fb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},uM=({source:e,sourcePosition:n=be.Bottom,target:i})=>n===be.Left||n===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},db=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cM({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:s,offset:o,stepPosition:u}){const f=fb[n],h=fb[a],d={x:e.x+f.x*o,y:e.y+f.y*o},g={x:i.x+h.x*o,y:i.y+h.y*o},m=uM({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],N,E;const _={x:0,y:0},j={x:0,y:0},[,,k,C]=lw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[x]*h[x]===-1){x==="x"?(N=s.x??d.x+(g.x-d.x)*u,E=s.y??(d.y+g.y)/2):(N=s.x??(d.x+g.x)/2,E=s.y??d.y+(g.y-d.y)*u);const A=[{x:N,y:d.y},{x:N,y:g.y}],H=[{x:d.x,y:E},{x:g.x,y:E}];f[x]===b?w=x==="x"?A:H:w=x==="x"?H:A}else{const A=[{x:d.x,y:g.y}],H=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===b?H:A:w=f.y===b?A:H,n===a){const Y=Math.abs(e[x]-i[x]);if(Y<=o){const te=Math.min(o-1,o-Y);f[x]===b?_[x]=(d[x]>e[x]?-1:1)*te:j[x]=(g[x]>i[x]?-1:1)*te}}if(n!==a){const Y=x==="x"?"y":"x",te=f[x]===h[Y],O=d[Y]>g[Y],B=d[Y]<g[Y];(f[x]===1&&(!te&&O||te&&B)||f[x]!==1&&(!te&&B||te&&O))&&(w=x==="x"?A:H)}const F={x:d.x+_.x,y:d.y+_.y},G={x:g.x+j.x,y:g.y+j.y},q=Math.max(Math.abs(F.x-w[0].x),Math.abs(G.x-w[0].x)),V=Math.max(Math.abs(F.y-w[0].y),Math.abs(G.y-w[0].y));q>=V?(N=(F.x+G.x)/2,E=w[0].y):(N=w[0].x,E=(F.y+G.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...w,{x:g.x+j.x,y:g.y+j.y},i],N,E,k,C]}function fM(e,n,i,a){const s=Math.min(db(e,n)/2,db(n,i)/2,a),{x:o,y:u}=n;if(e.x===o&&o===i.x||e.y===u&&u===i.y)return`L${o} ${u}`;if(e.y===u){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${o+s*d},${u}Q ${o},${u} ${o},${u+s*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${o},${u+s*h}Q ${o},${u} ${o+s*f},${u}`}function jp({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,b,w,N]=cM({source:{x:e,y:n},sourcePosition:i,target:{x:a,y:s},targetPosition:o,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((_,j,k)=>{let C="";return k>0&&k<m.length-1?C=fM(m[k-1],j,m[k+1],u):C=`${k===0?"M":"L"}${j.x} ${j.y}`,_+=C,_},""),x,b,w,N]}function hb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function dM(e){const{sourceNode:n,targetNode:i}=e;if(!hb(n)||!hb(i))return null;const a=n.internals.handleBounds||pb(n.handles),s=i.internals.handleBounds||pb(i.handles),o=mb(a?.source??[],e.sourceHandle),u=mb(e.connectionMode===ul.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),e.targetHandle);if(!o||!u)return e.onError?.("008",ri.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=o?.position||be.Bottom,h=u?.position||be.Top,d=na(n,o,f),g=na(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function pb(e){if(!e)return null;const n=[],i=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&i.push(a);return{source:n,target:i}}function na(e,n,i=be.Left,a=!1){const s=(n?.x??0)+e.internals.positionAbsolute.x,o=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=n??Bi(e);if(a)return{x:s+u/2,y:o+f/2};switch(n?.position??i){case be.Top:return{x:s+u/2,y:o};case be.Right:return{x:s+u,y:o+f/2};case be.Bottom:return{x:s+u/2,y:o+f};case be.Left:return{x:s,y:o+f/2}}}function mb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Rp(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function hM(e,{id:n,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:s}){const o=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||s].forEach(h=>{if(h&&typeof h=="object"){const d=Rp(h,n);o.has(d)||(u.push({id:d,color:h.color||i,...h}),o.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const uw=1e3,pM=10,mm={nodeOrigin:[0,0],nodeExtent:Qs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mM={...mm,checkEquality:!0};function gm(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function gM(e,n,i){const a=gm(mm,i);for(const s of e.values())if(s.parentId)xm(s,e,n,a);else{const o=oo(s,a.nodeOrigin),u=dl(s.extent)?s.extent:a.nodeExtent,f=ta(o,u,Bi(s));s.internals.positionAbsolute=f}}function yM(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],a=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?i.push(o):s.type==="target"&&a.push(o)}return{source:i,target:a}}function ym(e){return e==="manual"}function Op(e,n,i,a={}){const s=gm(mM,a),o={i:0},u=new Map(n),f=s?.elevateNodesOnSelect&&!ym(s.zIndexMode)?uw:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(s.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=oo(d,s.nodeOrigin),x=dl(d.extent)?d.extent:s.nodeExtent,b=ta(m,x,Bi(d));g={...s.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:yM(d,g),z:cw(d,f,s.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&xm(g,n,i,a,o)}return h}function xM(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function xm(e,n,i,a,s){const{elevateNodesOnSelect:o,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=gm(mm,a),d=e.parentId,g=n.get(d);if(!g){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}xM(e,i),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*pM),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const m=o&&!ym(h)?uw:0,{x,y:b,z:w}=bM(e,g,u,f,m,h),{positionAbsolute:N}=e.internals,E=x!==N.x||b!==N.y;(E||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:E?{x,y:b}:N,z:w}})}function cw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return ym(i)?a:a+(e.selected?n:0)}function bM(e,n,i,a,s,o){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=oo(e,i),g=dl(e.extent)?ta(d,e.extent,h):d;let m=ta({x:u+g.x,y:f+g.y},a,h);e.extent==="parent"&&(m=Qv(m,h,n));const x=cw(e,s,o),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function bm(e,n,i,a=[0,0]){const s=[],o=new Map;for(const u of e){const f=n.get(u.parentId);if(!f)continue;const h=o.get(u.parentId)?.expandedRect??fl(f),d=Jv(h,u.rect);o.set(u.parentId,{expandedRect:d,parent:f})}return o.size>0&&o.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Bi(f),m=f.origin??a,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,b=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),N=Math.max(g.height,Math.round(u.height)),E=(w-g.width)*m[0],_=(N-g.height)*m[1];(x>0||b>0||E||_)&&(s.push({id:h,type:"position",position:{x:f.position.x-x+E,y:f.position.y-b+_}}),i.get(h)?.forEach(j=>{e.some(k=>k.id===j.id)||s.push({id:j.id,type:"position",position:{x:j.position.x+x,y:j.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-E:0),height:N+(b?m[1]*b-_:0)}})}),s}function vM(e,n,i,a,s,o,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=n.get(b.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const N=pm(b.nodeElement),E=w.measured.width!==N.width||w.measured.height!==N.height;if(!!(N.width&&N.height&&(E||!w.internals.handleBounds||b.force))){const j=b.nodeElement.getBoundingClientRect(),k=dl(w.extent)?w.extent:o;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Qv(C,N,n.get(w.parentId)):k&&(C=ta(C,k,N));const L={...w,measured:N,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:ub("source",b.nodeElement,j,m,w.id),target:ub("target",b.nodeElement,j,m,w.id)}}};n.set(w.id,L),w.parentId&&xm(L,n,i,{nodeOrigin:s,zIndexMode:u}),h=!0,E&&(d.push({id:w.id,type:"dimensions",dimensions:N}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:fl(L,s)}))}}if(x.length>0){const b=bm(x,n,i,s);d.push(...b)}return{changes:d,updatedInternals:h}}async function wM({delta:e,panZoom:n,transform:i,translateExtent:a,width:s,height:o}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const u=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[s,o]],a),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function gb(e,n,i,a,s,o){let u=s;const f=a.get(u)||new Map;a.set(u,f.set(i,n)),u=`${s}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(i,n)),o){u=`${s}-${e}-${o}`;const d=a.get(u)||new Map;a.set(u,d.set(i,n))}}function fw(e,n,i){e.clear(),n.clear();for(const a of i){const{source:s,target:o,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:s,target:o,sourceHandle:u,targetHandle:f},d=`${s}-${u}--${o}-${f}`,g=`${o}-${f}--${s}-${u}`;gb("source",h,g,e,s,u),gb("target",h,d,e,o,f),n.set(a.id,a)}}function dw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:dw(i,n):!1}function yb(e,n,i){let a=e;do{if(a?.matches?.(n))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function SM(e,n,i,a){const s=new Map;for(const[o,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!dw(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const f=e.get(o);f&&s.set(o,{id:o,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return s}function Vh({nodeId:e,dragItems:n,nodeLookup:i,dragging:a=!0}){const s=[];for(const[u,f]of n){const h=i.get(u)?.internals.userNode;h&&s.push({...h,position:f.position,dragging:a})}if(!e)return[s[0],s];const o=i.get(e)?.internals.userNode;return[o?{...o,position:n.get(e)?.position||o.position,dragging:a}:s[0],s]}function _M({dragItems:e,snapGrid:n,x:i,y:a}){const s=e.values().next().value;if(!s)return null;const o={x:i-s.distance.x,y:a-s.distance.y},u=co(o,n);return{x:u.x-o.x,y:u.y-o.y}}function kM({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:a,onDragStop:s}){let o={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,N=null;function E({noDragClassName:j,handleSelector:k,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:H=0}){x=vn(C);function F({x:Y,y:te}){const{nodeLookup:O,nodeExtent:B,snapGrid:D,snapToGrid:U,nodeOrigin:P,onNodeDrag:Q,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();o={x:Y,y:te};let T=!1;const ie=f.size>1,ce=ie&&B?Dp(uo(f)):null,fe=ie&&U?_M({dragItems:f,snapGrid:D,x:Y,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:Y-ue.distance.x,y:te-ue.distance.y};U&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:co(me,D));let Ee=null;if(ie&&B&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Re=Ne.x-ce.x+B[0][0],Ze=Ne.x+ue.measured.width-ce.x2+B[1][0],Xe=Ne.y-ce.y+B[0][1],ht=Ne.y+ue.measured.height-ce.y2+B[1][1];Ee=[[Re,Xe],[Ze,ht]]}const{position:Ce,positionAbsolute:we}=Zv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:P,onError:R});T=T||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||T,!!T&&($(f,!0),N&&(a||Q||!A&&z))){const[he,ue]=Vh({nodeId:A,dragItems:f,nodeLookup:O});a?.(N,f,he,ue),Q?.(N,he,ue),A||z?.(N,ue)}}async function G(){if(!g)return;const{transform:Y,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:B}=n();if(!B){h=!1,cancelAnimationFrame(u);return}const[D,U]=Kv(d,g,O);(D!==0||U!==0)&&(o.x=(o.x??0)-D/Y[2],o.y=(o.y??0)-U/Y[2],await te({x:D,y:U})&&F(o)),u=requestAnimationFrame(G)}function q(Y){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:D,snapGrid:U,snapToGrid:P,selectNodesOnDrag:Q,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!Q||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&Q&&A&&e?.(A);const T=$s(Y.sourceEvent,{transform:D,snapGrid:U,snapToGrid:P,containerBounds:g});if(o=T,f=SM(te,B,T,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=Vh({nodeId:A,dragItems:f,nodeLookup:te});i?.(Y.sourceEvent,f,ie,ce),z?.(Y.sourceEvent,ie,ce),A||R?.(Y.sourceEvent,ce)}}const V=Mv().clickDistance(H).on("start",Y=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:D,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,N=Y.sourceEvent,O===0&&q(Y),o=$s(Y.sourceEvent,{transform:B,snapGrid:D,snapToGrid:U,containerBounds:g}),d=Vn(Y.sourceEvent,g)}).on("drag",Y=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:D,nodeDragThreshold:U,nodeLookup:P}=n(),Q=$s(Y.sourceEvent,{transform:O,snapGrid:B,snapToGrid:D,containerBounds:g});if(N=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||A&&!P.has(A))&&(b=!0),!b){if(!h&&te&&m&&(h=!0,G()),!m){const z=Vn(Y.sourceEvent,g),R=z.x-d.x,$=z.y-d.y;Math.sqrt(R*R+$*$)>U&&q(Y)}(o.x!==Q.xSnapped||o.y!==Q.ySnapped)&&f&&m&&(d=Vn(Y.sourceEvent,g),F(Q))}}).on("end",Y=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:D}=n();if(w&&(O(f,!1),w=!1),s||B||!A&&D){const[U,P]=Vh({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});s?.(Y.sourceEvent,f,U,P),B?.(Y.sourceEvent,U,P),A||D?.(Y.sourceEvent,P)}}}).filter(Y=>{const te=Y.target;return!Y.button&&(!j||!yb(te,`.${j}`,C))&&(!k||yb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:E,destroy:_}}function EM(e,n,i){const a=[],s={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const o of n.values())Js(s,fl(o))>0&&a.push(o);return a}const NM=250;function CM(e,n,i,a){let s=[],o=1/0;const u=EM(e,i,n+NM);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:g,y:m}=na(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<o?(s=[{...d,x:g,y:m}],o=x):x===o&&s.push({...d,x:g,y:m}))}}if(!s.length)return null;if(s.length>1){const f=a.type==="source"?"target":"source";return s.find(h=>h.type===f)??s[0]}return s[0]}function hw(e,n,i,a,s,o=!1){const u=a.get(e);if(!u)return null;const f=s==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&o?{...h,...na(u,h,h.position,!0)}:h}function pw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function MM(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const mw=()=>!0;function TM(e,{connectionMode:n,connectionRadius:i,handleId:a,nodeId:s,edgeUpdaterType:o,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:N,onConnectEnd:E,isValidConnection:_=mw,onReconnectEnd:j,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=tw(e.target);let q=0,V;const{x:Y,y:te}=Vn(e),O=pw(o,F),B=f?.getBoundingClientRect();let D=!1;if(!B||!O)return;const U=hw(s,O,a,h,n);if(!U)return;let P=Vn(e,B),Q=!1,z=null,R=!1,$=null;function T(){if(!g||!B)return;const[Ce,we]=Kv(P,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(T)}const ie={...U,nodeId:s,type:O,position:U.position},ce=h.get(s);let he={inProgress:!0,isValid:null,from:na(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:P,toHandle:null,toPosition:ab[ie.position],toNode:null,pointer:P};function ue(){D=!0,k(he),w?.(e,{nodeId:s,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!D){const{x:ht,y:sn}=Vn(Ce),Lt=ht-Y,Gt=sn-te;if(!(Lt*Lt+Gt*Gt>H*H))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();P=Vn(Ce,B),V=CM(fo(P,we,!1,[1,1]),i,h,ie),Q||(T(),Q=!0);const Ne=gw(Ce,{handle:V,connectionMode:n,fromNodeId:s,fromHandleId:a,fromType:u?"target":"source",isValidConnection:_,doc:G,lib:d,flowId:m,nodeLookup:h});$=Ne.handleDomNode,z=Ne.connection,R=MM(!!V,Ne.isValid);const Re=h.get(s),Ze=Re?na(Re,ie,be.Left,!0):he.from,Xe={...he,from:Ze,isValid:R,to:Ne.toHandle&&R?Bc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):P,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:ab[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:P};k(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(D){(V||$)&&z&&R&&N?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};E?.(Ce,Re),o&&j?.(Ce,Re)}b(),cancelAnimationFrame(q),Q=!1,R=!1,z=null,$=null,G.removeEventListener("mousemove",me),G.removeEventListener("mouseup",Ee),G.removeEventListener("touchmove",me),G.removeEventListener("touchend",Ee)}}G.addEventListener("mousemove",me),G.addEventListener("mouseup",Ee),G.addEventListener("touchmove",me),G.addEventListener("touchend",Ee)}function gw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:s,fromType:o,doc:u,lib:f,flowId:h,isValidConnection:d=mw,nodeLookup:g}){const m=o==="target",x=n?u.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:w}=Vn(e),N=u.elementFromPoint(b,w),E=N?.classList.contains(`${f}-flow__handle`)?N:x,_={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const j=pw(void 0,E),k=E.getAttribute("data-nodeid"),C=E.getAttribute("data-handleid"),L=E.classList.contains("connectable"),A=E.classList.contains("connectableend");if(!k||!j)return _;const H={source:m?k:a,sourceHandle:m?C:s,target:m?a:k,targetHandle:m?s:C};_.connection=H;const G=L&&A&&(i===ul.Strict?m&&j==="source"||!m&&j==="target":k!==a||C!==s);_.isValid=G&&d(H),_.toHandle=hw(k,j,C,g,i,!0)}return _}const Lp={onPointerDown:TM,isValid:gw};function AM({domNode:e,panZoom:n,getTransform:i,getViewScale:a}){const s=vn(e);function o({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const C=i(),L=k.sourceEvent.ctrlKey&&Ws()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,H=C[2]*Math.pow(2,A*L);n.scaleTo(H)};let N=[0,0];const E=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(N=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},_=k=>{const C=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const L=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[L[0]-N[0],L[1]-N[1]];N=L;const H=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),F={x:C[0]-A[0]*H,y:C[1]-A[1]*H},G=[[0,0],[h,d]];n.setViewportConstrained({x:F.x,y:F.y,zoom:C[2]},G,f)},j=Vv().on("start",E).on("zoom",m?_:null).on("zoom.wheel",x?w:null);s.call(j,{})}function u(){s.on("zoom",null)}return{update:o,destroy:u,pointer:In}}const tf=e=>({x:e.x,y:e.y,zoom:e.k}),Yh=({x:e,y:n,zoom:i})=>Jc.translate(e,n).scale(i),Wa=(e,n)=>e.target.closest(`.${n}`),yw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),zM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ph=(e,n=0,i=zM,a=()=>{})=>{const s=typeof n=="number"&&n>0;return s||a(),s?e.transition().duration(n).ease(i).on("end",a):e},xw=e=>{const n=e.ctrlKey&&Ws()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function DM({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Wa(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&u){const E=In(g),_=xw(g),j=m*Math.pow(2,_);a.scaleTo(i,j,E,g);return}const x=g.deltaMode===1?20:1;let b=s===Jr.Vertical?0:g.deltaX*x,w=s===Jr.Horizontal?0:g.deltaY*x;!Ws()&&g.shiftKey&&s!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*o,-(w/m)*o,{internal:!0});const N=tf(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,N),e.panScrollTimeout=setTimeout(()=>{d?.(g,N),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,N))}}function jM({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,s){const o=a.type==="wheel",u=!n&&o&&!a.ctrlKey,f=Wa(a,e);if(a.ctrlKey&&o&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,s)}}function RM({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const s=tf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=s,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,s)}}function OM({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:s}){return o=>{e.usedRightMouseButton=!!(i&&yw(n,e.mouseButton??0)),o.sourceEvent?.sync||a([o.transform.x,o.transform.y,o.transform.k]),s&&!o.sourceEvent?.internal&&s?.(o.sourceEvent,tf(o.transform))}}function LM({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:o}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&yw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&o(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),s)){const f=tf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s?.(u.sourceEvent,f)},i?150:0)}}}function HM({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,b=i&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Wa(m,`${d}-flow__node`)||Wa(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!s&&!o&&!i||u||g&&!w||Wa(m,f)&&w||Wa(m,h)&&(!w||s&&w&&!e)||!i&&m.ctrlKey&&w)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!s&&!b&&w||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;const N=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&N}}function BM({domNode:e,minZoom:n,maxZoom:i,translateExtent:a,viewport:s,onPanZoom:o,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Vv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);j({x:s.x,y:s.y,zoom:cl(s.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(xw);function N(V,Y){return x?new Promise(te=>{m?.interpolate(Y?.interpolate==="linear"?qs:Sc).transform(Ph(x,Y?.duration,Y?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function E({noWheelClassName:V,noPanClassName:Y,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:D,panOnScrollMode:U,panOnScrollSpeed:P,preventScrolling:Q,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:T,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!T&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?DM({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:P,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:o,onPanZoomEnd:f}):jM({noWheelClassName:V,preventScrolling:Q,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=RM({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=OM({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!te,onPanZoom:o,onTransformChange:ce});m.on("zoom",Ne);const Re=LM({zoomPanValues:d,panOnDrag:D,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=HM({zoomActivationKeyPressed:T,panOnDrag:D,zoomOnScroll:R,panOnScroll:B,zoomOnDoubleClick:$,zoomOnPinch:z,userSelectionActive:O,noPanClassName:Y,noWheelClassName:V,lib:ie,connectionInProgress:fe});m.filter(Ce),$?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function j(V,Y,te){const O=Yh(V),B=m?.constrain()(O,Y,te);return B&&await N(B),new Promise(D=>D(B))}async function k(V,Y){const te=Yh(V);return await N(te,Y),new Promise(O=>O(te))}function C(V){if(x){const Y=Yh(V),te=x.property("__zoom");(te.k!==V.zoom||te.x!==V.x||te.y!==V.y)&&m?.transform(x,Y,null,{sync:!0})}}function L(){const V=x?$v(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,Y){return x?new Promise(te=>{m?.interpolate(Y?.interpolate==="linear"?qs:Sc).scaleTo(Ph(x,Y?.duration,Y?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function H(V,Y){return x?new Promise(te=>{m?.interpolate(Y?.interpolate==="linear"?qs:Sc).scaleBy(Ph(x,Y?.duration,Y?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function F(V){m?.scaleExtent(V)}function G(V){m?.translateExtent(V)}function q(V){const Y=!$n(V)||V<0?0:V;m?.clickDistance(Y)}return{update:E,destroy:_,setViewport:k,setViewportConstrained:j,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var hl;(function(e){e.Line="line",e.Handle="handle"})(hl||(hl={}));function UM({width:e,prevWidth:n,height:i,prevHeight:a,affectsX:s,affectsY:o}){const u=e-n,f=i-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&s&&(h[0]=h[0]*-1),f&&o&&(h[1]=h[1]*-1),h}function xb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),a=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:a,affectsY:s}}function mr(e,n){return Math.max(0,n-e)}function gr(e,n){return Math.max(0,e-n)}function Ku(e,n,i){return Math.max(0,n-e,e-i)}function bb(e,n){return e?!n:n}function IM(e,n,i,a,s,o,u,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:b,ySnapped:w}=i,{minWidth:N,maxWidth:E,minHeight:_,maxHeight:j}=a,{x:k,y:C,width:L,height:A,aspectRatio:H}=e;let F=Math.floor(g?b-e.pointerX:0),G=Math.floor(m?w-e.pointerY:0);const q=L+(h?-F:F),V=A+(d?-G:G),Y=-o[0]*L,te=-o[1]*A;let O=Ku(q,N,E),B=Ku(V,_,j);if(u){let P=0,Q=0;h&&F<0?P=mr(k+F+Y,u[0][0]):!h&&F>0&&(P=gr(k+q+Y,u[1][0])),d&&G<0?Q=mr(C+G+te,u[0][1]):!d&&G>0&&(Q=gr(C+V+te,u[1][1])),O=Math.max(O,P),B=Math.max(B,Q)}if(f){let P=0,Q=0;h&&F>0?P=gr(k+F,f[0][0]):!h&&F<0&&(P=mr(k+q,f[1][0])),d&&G>0?Q=gr(C+G,f[0][1]):!d&&G<0&&(Q=mr(C+V,f[1][1])),O=Math.max(O,P),B=Math.max(B,Q)}if(s){if(g){const P=Ku(q/H,_,j)*H;if(O=Math.max(O,P),u){let Q=0;!h&&!d||h&&!d&&x?Q=gr(C+te+q/H,u[1][1])*H:Q=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,Q)}if(f){let Q=0;!h&&!d||h&&!d&&x?Q=mr(C+q/H,f[1][1])*H:Q=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,Q)}}if(m){const P=Ku(V*H,N,E)/H;if(B=Math.max(B,P),u){let Q=0;!h&&!d||d&&!h&&x?Q=gr(k+V*H+Y,u[1][0])/H:Q=mr(k+(d?G:-G)*H+Y,u[0][0])/H,B=Math.max(B,Q)}if(f){let Q=0;!h&&!d||d&&!h&&x?Q=mr(k+V*H,f[1][0])/H:Q=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,Q)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),s&&(x?q>V*H?G=(bb(h,d)?-F:F)/H:F=(bb(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const D=h?k+F:k,U=d?C+G:C;return{width:L+(h?-F:F),height:A+(d?-G:G),x:o[0]*F*(h?-1:1)+D,y:o[1]*G*(d?-1:1)+U}}const bw={width:0,height:0,x:0,y:0},qM={...bw,pointerX:0,pointerY:0,aspectRatio:1};function $M(e){return[[0,0],[e.measured.width,e.measured.height]]}function VM(e,n,i){const a=n.position.x+e.position.x,s=n.position.y+e.position.y,o=e.measured.width??0,u=e.measured.height??0,f=i[0]*o,h=i[1]*u;return[[a-f,s-h],[a+o-f,s+u-h]]}function YM({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:s}){const o=vn(e);let u={controlDirection:xb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:N,shouldResize:E}){let _={...bw},j={...qM};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:xb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=Mv().on("start",V=>{const{nodeLookup:Y,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:D,paneDomNode:U}=i();if(k=Y.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:P,ySnapped:Q}=$s(V.sourceEvent,{transform:te,snapGrid:O,snapToGrid:B,containerBounds:C});_={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},j={..._,pointerX:P,pointerY:Q,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=Y.get(k.parentId),H=A&&k.extent==="parent"?$M(A):void 0),L=[],F=void 0;for(const[z,R]of Y)if(R.parentId===n&&(L.push({id:z,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const $=VM(R,k,R.origin??D);F?F=[[Math.min($[0][0],F[0][0]),Math.min($[0][1],F[0][1])],[Math.max($[1][0],F[1][0]),Math.max($[1][1],F[1][1])]]:F=$}b?.(V,{..._})}).on("drag",V=>{const{transform:Y,snapGrid:te,snapToGrid:O,nodeOrigin:B}=i(),D=$s(V.sourceEvent,{transform:Y,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:P,y:Q,width:z,height:R}=_,$={},T=k.origin??B,{width:ie,height:ce,x:fe,y:he}=IM(j,u.controlDirection,D,u.boundaries,u.keepAspectRatio,T,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==P&&ue,Ce=he!==Q&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||T[0]===1||T[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-P,Xe=he-Q;for(const ht of L)ht.position={x:ht.position.x-Ze+T[0]*(ie-z),y:ht.position.y-Xe+T[1]*(ce-R)},U.push(ht)}if((ue||me)&&($.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,$.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=$.width,_.height=$.height),A&&k.expandParent){const Ze=T[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,j.x=j.x-($.x-Ze));const Xe=T[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,j.y=j.y-($.y-Xe))}const we=UM({width:_.width,prevWidth:z,height:_.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};E?.(V,Ne)!==!1&&(G=!0,w?.(V,Ne),a($,U))}).on("end",V=>{G&&(N?.(V,{..._}),s?.({..._}),G=!1)});o.call(q)}function h(){o.on(".drag",null)}return{update:f,destroy:h}}var Xh={exports:{}},Fh={},Gh={exports:{}},Zh={};var vb;function PM(){if(vb)return Zh;vb=1;var e=ao();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,a=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),N=w[0].inst,E=w[1];return o(function(){N.value=b,N.getSnapshot=x,h(N)&&E({inst:N})},[m,b,x]),s(function(){return h(N)&&E({inst:N}),m(function(){h(N)&&E({inst:N})})},[m]),u(b),b}function h(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!i(m,b)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Zh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Zh}var wb;function XM(){return wb||(wb=1,Gh.exports=PM()),Gh.exports}var Sb;function FM(){if(Sb)return Fh;Sb=1;var e=ao(),n=XM();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var a=typeof Object.is=="function"?Object.is:i,s=n.useSyncExternalStore,o=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Fh.useSyncExternalStoreWithSelector=function(d,g,m,x,b){var w=o(null);if(w.current===null){var N={hasValue:!1,value:null};w.current=N}else N=w.current;w=f(function(){function _(A){if(!j){if(j=!0,k=A,A=x(A),b!==void 0&&N.hasValue){var H=N.value;if(b(H,A))return C=H}return C=A}if(H=C,a(k,A))return H;var F=x(A);return b!==void 0&&b(H,F)?(k=A,H):(k=A,C=F)}var j=!1,k,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var E=s(d,w[0],w[1]);return u(function(){N.hasValue=!0,N.value=E},[E]),h(E),E},Fh}var _b;function GM(){return _b||(_b=1,Xh.exports=FM()),Xh.exports}var ZM=GM();const QM=Fc(ZM),KM={},kb=e=>{let n;const i=new Set,a=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const b=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(w=>w(n,b))}},s=()=>n,h={setState:a,getState:s,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(KM?"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."),i.clear()}},d=n=e(a,s,h);return h},JM=e=>e?kb(e):kb,{useDebugValue:WM}=Ls,{useSyncExternalStoreWithSelector:eT}=QM,tT=e=>e;function vw(e,n=tT,i){const a=eT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return WM(a),a}const Eb=(e,n)=>{const i=JM(e),a=(s,o=n)=>vw(i,s,o);return Object.assign(a,i),a},nT=(e,n)=>e?Eb(e,n):Eb;function ut(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,s]of e)if(!Object.is(s,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}hv();const nf=K.createContext(null),iT=nf.Provider,ww=ri.error001();function Pe(e,n){const i=K.useContext(nf);if(i===null)throw new Error(ww);return vw(i,e,n)}function ct(){const e=K.useContext(nf);if(e===null)throw new Error(ww);return K.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Nb={display:"none"},rT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sw="react-flow__node-desc",_w="react-flow__edge-desc",aT="react-flow__aria-live",lT=e=>e.ariaLiveMessage,sT=e=>e.ariaLabelConfig;function oT({rfId:e}){const n=Pe(lT);return v.jsx("div",{id:`${aT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:rT,children:n})}function uT({rfId:e,disableKeyboardA11y:n}){const i=Pe(sT);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${Sw}-${e}`,style:Nb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${_w}-${e}`,style:Nb,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(oT,{rfId:e})]})}const rf=K.forwardRef(({position:e="top-left",children:n,className:i,style:a,...s},o)=>{const u=`${e}`.split("-");return v.jsx("div",{className:_t(["react-flow__panel",i,...u]),style:a,ref:o,...s,children:n})});rf.displayName="Panel";function cT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(rf,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const fT=e=>{const n=[],i=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&i.push(a);return{selectedNodes:n,selectedEdges:i}},Ju=e=>e.id;function dT(e,n){return ut(e.selectedNodes.map(Ju),n.selectedNodes.map(Ju))&&ut(e.selectedEdges.map(Ju),n.selectedEdges.map(Ju))}function hT({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Pe(fT,dT);return K.useEffect(()=>{const s={nodes:i,edges:a};e?.(s),n.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[i,a,e]),null}const pT=e=>!!e.onSelectionChangeHandlers;function mT({onSelectionChange:e}){const n=Pe(pT);return e||n?v.jsx(hT,{onSelectionChange:e}):null}const kw=[0,0],gT={x:0,y:0,zoom:1},yT=["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"],Cb=[...yT,"rfId"],xT=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}),Mb={translateExtent:Qs,nodeOrigin:kw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function bT(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Pe(xT,ut),d=ct();K.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=Mb,f()}),[]);const g=K.useRef(Mb);return K.useEffect(()=>{for(const m of Cb){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?a(x):m==="maxZoom"?s(x):m==="translateExtent"?o(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:iM(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},Cb.map(m=>e[m])),null}function Tb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function vT(e){const[n,i]=K.useState(e==="system"?null:e);return K.useEffect(()=>{if(e!=="system"){i(e);return}const a=Tb(),s=()=>i(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[e]),n!==null?n:Tb()?.matches?"dark":"light"}const Ab=typeof document<"u"?document:null;function eo(e=null,n={target:Ab,actInsideInputWithModifier:!0}){const[i,a]=K.useState(!1),s=K.useRef(!1),o=K.useRef(new Set([])),[u,f]=K.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
8
|
+
`+c.stack}}var Lt=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,si=e.unstable_shouldYield,oi=e.unstable_requestPaint,Et=e.unstable_now,Ii=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,De=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Vt=e.log,On=e.unstable_setDisableYieldValue,At=null,pt=null;function Ht(t){if(typeof Vt=="function"&&On(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(At,t)}catch{}}var Ke=Math.clz32?Math.clz32:Sf,Gn=Math.log,on=Math.LN2;function Sf(t){return t>>>=0,t===0?32:31-(Gn(t)/on|0)|0}var aa=256,la=262144,sa=4194304;function ui(t){var r=t&42;if(r!==0)return r;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function oa(t,r,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?p=ui(c):(S&=M,S!==0?p=ui(S):l||(l=M&~t,l!==0&&(p=ui(l))))):(M=c&~y,M!==0?p=ui(M):S!==0?p=ui(S):l||(l=c&~t,l!==0&&(p=ui(l)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:p}function _r(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function _f(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function So(){var t=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),t}function vl(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function kr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kf(t,r,l,c,p,y){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),oe=1<<le;M[le]=0,I[le]=-1;var ee=W[le];if(ee!==null)for(W[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}l&=~oe}c!==0&&_o(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function _o(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-Ke(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function ko(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var c=31-Ke(l),p=1<<c;p&r|t[c]&r&&(t[c]|=r),l&=~p}}function Eo(t,r){var l=r&-r;return l=(l&42)!==0?1:wl(l),(l&(t.suspendedLanes|r))!==0?0:l}function wl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function No(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Nx(t.type))}function Co(t,r){var l=U.p;try{return U.p=t,r()}finally{U.p=l}}var Zn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Zn,Bt="__reactProps$"+Zn,ci="__reactContainer$"+Zn,ua="__reactEvents$"+Zn,Mo="__reactListeners$"+Zn,Ef="__reactHandles$"+Zn,To="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function _l(t){delete t[Nt],delete t[Bt],delete t[ua],delete t[Mo],delete t[Ef]}function qi(t){var r=t[Nt];if(r)return r;for(var l=t.parentNode;l;){if(r=l[ci]||l[Nt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=cx(t);t!==null;){if(l=t[Nt])return l;t=cx(t)}return r}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Nt]||t[ci]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Vi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Pi(t){var r=t[To];return r||(r=t[To]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var Ao=new Set,zo={};function fi(t,r){Yi(t,r),Yi(t+"Capture",r)}function Yi(t,r){for(zo[t]=r,t=0;t<r.length;t++)Ao.add(r[t])}var Nf=RegExp("^[: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]*$"),kl={},jo={};function Cf(t){return Lt.call(jo,t)?!0:Lt.call(kl,t)?!1:Nf.test(t)?jo[t]=!0:(kl[t]=!0,!1)}function ca(t,r,l){if(Cf(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function fa(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ln(t,r,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+c)}}function Zt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Do(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Mf(t,r,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function da(t){if(!t._valueTracker){var r=Do(t)?"checked":"value";t._valueTracker=Mf(t,r,""+t[r])}}function Ro(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=Do(t)?t.checked?"true":"false":t.value),t=c,t!==l?(r.setValue(t),!0):!1}function Nr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Tf=/[\n"\\]/g;function Qt(t){return t.replace(Tf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Zt(r)):t.value!==""+Zt(r)&&(t.value=""+Zt(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?El(t,S,Zt(r)):l!=null?El(t,S,Zt(l)):c!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Zt(M):t.removeAttribute("name")}function Oo(t,r,l,c,p,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){da(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,M||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),da(t)}function El(t,r,l){r==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function di(t,r,l,c){if(t=t.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=r.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Zt(l),r=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Km(t,r,l){if(r!=null&&(r=""+Zt(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Zt(l):""}function Jm(t,r,l,c){if(r==null){if(c!=null){if(l!=null)throw Error(a(92));if(B(c)){if(1<c.length)throw Error(a(93));c=c[0]}l=c}l==null&&(l=""),r=l}l=Zt(r),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),da(t)}function ha(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var i_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Wm(t,r,l){var c=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,l):typeof l!="number"||l===0||i_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function eg(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&l[p]!==c&&Wm(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&Wm(t,y,r[y])}function Af(t){if(t.indexOf("-")===-1)return!1;switch(t){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 r_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lo(t){return a_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var zf=null;function jf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pa=null,ma=null;function tg(t){var r=$i(t);if(r&&(t=r.stateNode)){var l=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var c=l[r];if(c!==t&&c.form===t.form){var p=c[Bt]||null;if(!p)throw Error(a(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)c=l[r],c.form===t.form&&Ro(c)}break e;case"textarea":Km(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Df=!1;function ng(t,r,l){if(Df)return t(r,l);Df=!0;try{var c=t(r);return c}finally{if(Df=!1,(pa!==null||ma!==null)&&(_u(),pa&&(r=pa,t=ma,ma=pa=null,tg(r),t)))for(r=0;r<t.length;r++)tg(t[r])}}function Nl(t,r){var l=t.stateNode;if(l===null)return null;var c=l[Bt]||null;if(c===null)return null;l=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rf=!1;if(pi)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){Rf=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{Rf=!1}var Xi=null,Of=null,Ho=null;function ig(){if(Ho)return Ho;var t,r=Of,l=r.length,c,p="value"in Xi?Xi.value:Xi.textContent,y=p.length;for(t=0;t<l&&r[t]===p[t];t++);var S=l-t;for(c=1;c<=S&&r[l-c]===p[y-c];c++);return Ho=p.slice(t,1<c?1-c:void 0)}function Bo(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Uo(){return!0}function rg(){return!1}function Kt(t){function r(l,c,p,y,S){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Uo:rg,this.isPropagationStopped=rg,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Uo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Uo)},persist:function(){},isPersistent:Uo}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Kt(Mr),Ml=m({},Mr,{view:0,detail:0}),l_=Kt(Ml),Lf,Hf,Tl,qo=m({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Tl&&(Tl&&t.type==="mousemove"?(Lf=t.screenX-Tl.screenX,Hf=t.screenY-Tl.screenY):Hf=Lf=0,Tl=t),Lf)},movementY:function(t){return"movementY"in t?t.movementY:Hf}}),ag=Kt(qo),s_=m({},qo,{dataTransfer:0}),o_=Kt(s_),u_=m({},Ml,{relatedTarget:0}),Bf=Kt(u_),c_=m({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),f_=Kt(c_),d_=m({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),h_=Kt(d_),p_=m({},Mr,{data:0}),lg=Kt(p_),m_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g_={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"},y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=y_[t])?!!r[t]:!1}function Uf(){return x_}var b_=m({},Ml,{key:function(t){if(t.key){var r=m_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Bo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?g_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(t){return t.type==="keypress"?Bo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v_=Kt(b_),w_=m({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sg=Kt(w_),S_=m({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),__=Kt(S_),k_=m({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),E_=Kt(k_),N_=m({},qo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),C_=Kt(N_),M_=m({},Mr,{newState:0,oldState:0}),T_=Kt(M_),A_=[9,13,27,32],If=pi&&"CompositionEvent"in window,Al=null;pi&&"documentMode"in document&&(Al=document.documentMode);var z_=pi&&"TextEvent"in window&&!Al,og=pi&&(!If||Al&&8<Al&&11>=Al),ug=" ",cg=!1;function fg(t,r){switch(t){case"keyup":return A_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function j_(t,r){switch(t){case"compositionend":return dg(r);case"keypress":return r.which!==32?null:(cg=!0,ug);case"textInput":return t=r.data,t===ug&&cg?null:t;default:return null}}function D_(t,r){if(ga)return t==="compositionend"||!If&&fg(t,r)?(t=ig(),Ho=Of=Xi=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return og&&r.locale!=="ko"?null:r.data;default:return null}}var R_={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 hg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!R_[t.type]:r==="textarea"}function pg(t,r,l,c){pa?ma?ma.push(c):ma=[c]:pa=c,r=Au(r,"onChange"),0<r.length&&(l=new Io("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var zl=null,jl=null;function O_(t){Qy(t,0)}function $o(t){var r=Vi(t);if(Ro(r))return t}function mg(t,r){if(t==="change")return r}var gg=!1;if(pi){var qf;if(pi){var $f="oninput"in document;if(!$f){var yg=document.createElement("div");yg.setAttribute("oninput","return;"),$f=typeof yg.oninput=="function"}qf=$f}else qf=!1;gg=qf&&(!document.documentMode||9<document.documentMode)}function xg(){zl&&(zl.detachEvent("onpropertychange",bg),jl=zl=null)}function bg(t){if(t.propertyName==="value"&&$o(jl)){var r=[];pg(r,jl,t,jf(t)),ng(O_,r)}}function L_(t,r,l){t==="focusin"?(xg(),zl=r,jl=l,zl.attachEvent("onpropertychange",bg)):t==="focusout"&&xg()}function H_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $o(jl)}function B_(t,r){if(t==="click")return $o(r)}function U_(t,r){if(t==="input"||t==="change")return $o(r)}function I_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:I_;function Dl(t,r){if(un(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),c=Object.keys(r);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!Lt.call(r,p)||!un(t[p],r[p]))return!1}return!0}function vg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function wg(t,r){var l=vg(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=r&&c>=r)return{node:l,offset:r-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=vg(l)}}function Sg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Sg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function _g(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nr(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Nr(t.document)}return r}function Vf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var q_=pi&&"documentMode"in document&&11>=document.documentMode,ya=null,Pf=null,Rl=null,Yf=!1;function kg(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yf||ya==null||ya!==Nr(c)||(c=ya,"selectionStart"in c&&Vf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Rl&&Dl(Rl,c)||(Rl=c,c=Au(Pf,"onSelect"),0<c.length&&(r=new Io("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=ya)))}function Tr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var xa={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Xf={},Eg={};pi&&(Eg=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ar(t){if(Xf[t])return Xf[t];if(!xa[t])return t;var r=xa[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in Eg)return Xf[t]=r[l];return t}var Ng=Ar("animationend"),Cg=Ar("animationiteration"),Mg=Ar("animationstart"),$_=Ar("transitionrun"),V_=Ar("transitionstart"),P_=Ar("transitioncancel"),Tg=Ar("transitionend"),Ag=new Map,Ff="abort auxClick beforeToggle 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(" ");Ff.push("scrollEnd");function Hn(t,r){Ag.set(t,r),fi(r,[t])}var Vo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],ba=0,Gf=0;function Po(){for(var t=ba,r=Gf=ba=0;r<t;){var l=_n[r];_n[r++]=null;var c=_n[r];_n[r++]=null;var p=_n[r];_n[r++]=null;var y=_n[r];if(_n[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&zg(l,p,y)}}function Yo(t,r,l,c){_n[ba++]=t,_n[ba++]=r,_n[ba++]=l,_n[ba++]=c,Gf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Zf(t,r,l,c){return Yo(t,r,l,c),Xo(t)}function zr(t,r){return Yo(t,null,null,r),Xo(t)}function zg(t,r,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,c=y.alternate,c!==null&&(c.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ke(l),t=y.hiddenUpdates,c=t[p],c===null?t[p]=[r]:c.push(r),r.lane=l|536870912),y):null}function Xo(t){if(50<ns)throw ns=0,rh=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var va={};function Y_(t,r,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,r,l,c){return new Y_(t,r,l,c)}function Qf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,r){var l=t.alternate;return l===null?(l=cn(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function jg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Fo(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Qf(t)&&(S=1);else if(typeof t=="string")S=Qk(t,l,ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case G:return t=cn(31,l,r,p),t.elementType=G,t.lanes=y,t;case E:return jr(l.children,p,y,r);case N:S=8,p|=24;break;case _:return t=cn(12,l,r,p|2),t.elementType=_,t.lanes=y,t;case L:return t=cn(13,l,r,p),t.elementType=L,t.lanes=y,t;case A:return t=cn(19,l,r,p),t.elementType=A,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:S=10;break e;case D:S=9;break e;case C:S=11;break e;case H:S=14;break e;case F:S=16,c=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=cn(S,l,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function jr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Kf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Dg(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Jf(t,r,l){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Rg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=Rg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:sn(r)},Rg.set(t,r),r)}return{value:t,source:r,stack:sn(r)}}var wa=[],Sa=0,Go=null,Ol=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){wa[Sa++]=Ol,wa[Sa++]=Go,Go=t,Ol=r}function Og(t,r,l){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Fi=t;var c=Qn;t=Kn;var p=32-Ke(c)-1;c&=~(1<<p),l+=1;var y=32-Ke(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Qn=1<<32-Ke(r)+p|l<<p|c,Kn=y+t}else Qn=1<<y|l<<p|c,Kn=t}function Wf(t){t.return!==null&&(gi(t,1),Og(t,1,0))}function ed(t){for(;t===Go;)Go=wa[--Sa],wa[Sa]=null,Ol=wa[--Sa],wa[Sa]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Lg(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,qe=!1,Gi=null,Cn=!1,td=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ll(kn(r,t)),td}function Hg(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(l=0;l<rs.length;l++)He(rs[l],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Oo(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),Jm(r,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||c.suppressHydrationWarning===!0||ex(r.textContent,l)?(c.popover!=null&&(He("beforetoggle",r),He("toggle",r)),c.onScroll!=null&&He("scroll",r),c.onScrollEnd!=null&&He("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function Bg(t){for(zt=t.return;zt;)switch(zt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:zt=zt.return}}function _a(t){if(t!==zt)return!1;if(!qe)return Bg(t),qe=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||bh(t.type,t.memoizedProps)),l=!l),l&<&&Zi(t),Bg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ux(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ux(t)}else r===27?(r=lt,ur(t.type)?(t=kh,kh=null,lt=t):lt=r):lt=zt?Tn(t.stateNode.nextSibling):null;return!0}function Dr(){lt=zt=null,qe=!1}function nd(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Ll(t){Gi===null?Gi=[t]:Gi.push(t)}var id=R(null),Rr=null,yi=null;function Qi(t,r,l){T(id,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=id.current,$(id)}function rd(t,r,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===l)break;t=t.return}}function ad(t,r,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var I=0;I<r.length;I++)if(M.context===r[I]){y.lanes|=l,M=y.alternate,M!==null&&(M.lanes|=l),rd(y.return,l,t),c||(S=null);break e}y=M.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=l,y=S.alternate,y!==null&&(y.lanes|=l),rd(S,l,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ka(t,r,l,c){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(us):t=[us])}p=p.return}t!==null&&ad(r,t,l,c),r.flags|=262144}function Zo(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){Rr=t,yi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jt(t){return Ug(Rr,t)}function Qo(t,r){return Rr===null&&Or(t),Ug(t,r)}function Ug(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},yi===null){if(t===null)throw Error(a(308));yi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else yi=yi.next=r;return l}var X_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},F_=e.unstable_scheduleCallback,G_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new X_,data:new Map,refCount:0}}function Hl(t){t.refCount--,t.refCount===0&&F_(G_,function(){t.controller.abort()})}var Bl=null,sd=0,Ea=0,Na=null;function Z_(t,r){if(Bl===null){var l=Bl=[];sd=0,Ea=ch(),Na={status:"pending",value:void 0,then:function(c){l.push(c)}}}return sd++,r.then(Ig,Ig),r}function Ig(){if(--sd===0&&Bl!==null){Na!==null&&(Na.status="fulfilled");var t=Bl;Bl=null,Ea=0,Na=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function Q_(t,r){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var qg=j.S;j.S=function(t,r){ky=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Z_(t,r),qg!==null&&qg(t,r)};var Lr=R(null);function od(){var t=Lr.current;return t!==null?t:it.pooledCache}function Ko(t,r){r===null?T(Lr,Lr.current):T(Lr,r.pool)}function $g(){var t=od();return t===null?null:{parent:xt._currentValue,pool:t}}var Ca=Error(a(460)),ud=Error(a(474)),Jo=Error(a(542)),Wo={then:function(){}};function Vg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Pg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(hi,hi),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xg(t),t;default:if(typeof r.status=="string")r.then(hi,hi);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xg(t),t}throw Br=r,Ca}}function Hr(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Br=l,Ca):l}}var Br=null;function Yg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Xg(t){if(t===Ca||t===Jo)throw Error(a(483))}var Ma=null,Ul=0;function eu(t){var r=Ul;return Ul+=1,Ma===null&&(Ma=[]),Pg(Ma,t,r)}function Il(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function tu(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Fg(t){function r(Z,X){if(t){var J=Z.deletions;J===null?(Z.deletions=[X],Z.flags|=16):J.push(X)}}function l(Z,X){if(!t)return null;for(;X!==null;)r(Z,X),X=X.sibling;return null}function c(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function p(Z,X){return Z=mi(Z,X),Z.index=0,Z.sibling=null,Z}function y(Z,X,J){return Z.index=J,t?(J=Z.alternate,J!==null?(J=J.index,J<X?(Z.flags|=67108866,X):J):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function S(Z){return t&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,X,J,se){return X===null||X.tag!==6?(X=Kf(J,Z.mode,se),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function I(Z,X,J,se){var ve=J.type;return ve===E?le(Z,X,J.props.children,se,J.key):X!==null&&(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type)?(X=p(X,J.props),Il(X,J),X.return=Z,X):(X=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(X,J),X.return=Z,X)}function W(Z,X,J,se){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Jf(J,Z.mode,se),X.return=Z,X):(X=p(X,J.children||[]),X.return=Z,X)}function le(Z,X,J,se,ve){return X===null||X.tag!==7?(X=jr(J,Z.mode,se,ve),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function oe(Z,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Kf(""+X,Z.mode,J),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Fo(X.type,X.key,X.props,null,Z.mode,J),Il(J,X),J.return=Z,J;case w:return X=Jf(X,Z.mode,J),X.return=Z,X;case F:return X=Hr(X),oe(Z,X,J)}if(B(X)||P(X))return X=jr(X,Z.mode,J,null),X.return=Z,X;if(typeof X.then=="function")return oe(Z,eu(X),J);if(X.$$typeof===k)return oe(Z,Qo(Z,X),J);tu(Z,X)}return null}function ee(Z,X,J,se){var ve=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:M(Z,X,""+J,se);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Z,X,J,se):null;case w:return J.key===ve?W(Z,X,J,se):null;case F:return J=Hr(J),ee(Z,X,J,se)}if(B(J)||P(J))return ve!==null?null:le(Z,X,J,se,null);if(typeof J.then=="function")return ee(Z,X,eu(J),se);if(J.$$typeof===k)return ee(Z,X,Qo(Z,J),se);tu(Z,J)}return null}function re(Z,X,J,se,ve){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Z=Z.get(J)||null,M(X,Z,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case b:return Z=Z.get(se.key===null?J:se.key)||null,I(X,Z,se,ve);case w:return Z=Z.get(se.key===null?J:se.key)||null,W(X,Z,se,ve);case F:return se=Hr(se),re(Z,X,J,se,ve)}if(B(se)||P(se))return Z=Z.get(J)||null,le(X,Z,se,ve,null);if(typeof se.then=="function")return re(Z,X,J,eu(se),ve);if(se.$$typeof===k)return re(Z,X,J,Qo(X,se),ve);tu(X,se)}return null}function ye(Z,X,J,se){for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var Ge=ee(Z,xe,J[ze],se);if(Ge===null){xe===null&&(xe=Ie);break}t&&xe&&Ge.alternate===null&&r(Z,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ie}if(ze===J.length)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=oe(Z,J[ze],se),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return qe&&gi(Z,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ie=re(xe,Z,ze,J[ze],se),Ie!==null&&(t&&Ie.alternate!==null&&xe.delete(Ie.key===null?ze:Ie.key),X=y(Ie,X,ze),Fe===null?ve=Ie:Fe.sibling=Ie,Fe=Ie);return t&&xe.forEach(function(pr){return r(Z,pr)}),qe&&gi(Z,ze),ve}function ke(Z,X,J,se){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var pr=ee(Z,xe,Ge.value,se);if(pr===null){xe===null&&(xe=Ie);break}t&&xe&&pr.alternate===null&&r(Z,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ie}if(Ge.done)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=oe(Z,Ge.value,se),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return qe&&gi(Z,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Z,ze,Ge.value,se),Ge!==null&&(t&&Ge.alternate!==null&&xe.delete(Ge.key===null?ze:Ge.key),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return t&&xe.forEach(function(sE){return r(Z,sE)}),qe&&gi(Z,ze),ve}function nt(Z,X,J,se){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;X!==null;){if(X.key===ve){if(ve=J.type,ve===E){if(X.tag===7){l(Z,X.sibling),se=p(X,J.props.children),se.return=Z,Z=se;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Z,X.sibling),se=p(X,J.props),Il(se,J),se.return=Z,Z=se;break e}l(Z,X);break}else r(Z,X);X=X.sibling}J.type===E?(se=jr(J.props.children,Z.mode,se,J.key),se.return=Z,Z=se):(se=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(se,J),se.return=Z,Z=se)}return S(Z);case w:e:{for(ve=J.key;X!==null;){if(X.key===ve)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Z,X.sibling),se=p(X,J.children||[]),se.return=Z,Z=se;break e}else{l(Z,X);break}else r(Z,X);X=X.sibling}se=Jf(J,Z.mode,se),se.return=Z,Z=se}return S(Z);case F:return J=Hr(J),nt(Z,X,J,se)}if(B(J))return ye(Z,X,J,se);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Z,X,J,se)}if(typeof J.then=="function")return nt(Z,X,eu(J),se);if(J.$$typeof===k)return nt(Z,X,Qo(Z,J),se);tu(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Z,X.sibling),se=p(X,J),se.return=Z,Z=se):(l(Z,X),se=Kf(J,Z.mode,se),se.return=Z,Z=se),S(Z)):l(Z,X)}return function(Z,X,J,se){try{Ul=0;var ve=nt(Z,X,J,se);return Ma=null,ve}catch(xe){if(xe===Ca||xe===Jo)throw xe;var Fe=cn(29,xe,null,Z.mode);return Fe.lanes=se,Fe.return=Z,Fe}}}var Ur=Fg(!0),Gg=Fg(!1),Ki=!1;function cd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(t,r,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Qe&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Xo(t),zg(t,null,l),r}return Yo(t,c,r,l),Xo(t)}function ql(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}function dd(t,r){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=r:y=y.next=r}else p=y=r;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var hd=!1;function $l(){if(hd){var t=Na;if(t!==null)throw t}}function Vl(t,r,l,c){hd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var I=M,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=I))}if(y!==null){var oe=p.baseState;S=0,le=W=I=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Ea&&(hd=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,ke=M;ee=r;var nt=l;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){oe=ye.call(nt,oe,ee);break e}oe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(nt,oe,ee):ye,ee==null)break e;oe=m({},oe,ee);break e;case 2:Ki=!0}}ee=M.callback,ee!==null&&(t.flags|=64,re&&(t.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=re,I=oe):le=le.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);le===null&&(I=oe),p.baseState=I,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),rr|=S,t.lanes=S,t.memoizedState=oe}}function Zg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Qg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Zg(l[t],r)}var Ta=R(null),nu=R(0);function Kg(t,r){t=Ci,T(nu,t),T(Ta,r),Ci=t|r.baseLanes}function pd(){T(nu,Ci),T(Ta,Ta.current)}function md(){Ci=nu.current,$(Ta),$(nu)}var fn=R(null),Mn=null;function er(t){var r=t.alternate;T(mt,mt.current&1),T(fn,t),Mn===null&&(r===null||Ta.current!==null||r.memoizedState!==null)&&(Mn=t)}function gd(t){T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)}function Jg(t){t.tag===22?(T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)):tr()}function tr(){T(mt,mt.current),T(fn,fn.current)}function dn(t){$(fn),Mn===t&&(Mn=null),$(mt)}var mt=R(0);function iu(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Sh(l)||_h(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bi=0,Ae=null,et=null,bt=null,ru=!1,Aa=!1,Ir=!1,au=0,Pl=0,za=null,K_=0;function ft(){throw Error(a(321))}function yd(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!un(t[l],r[l]))return!1;return!0}function xd(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=t===null||t.memoizedState===null?O0:Dd,Ir=!1,y=l(c,p),Ir=!1,Aa&&(y=e0(r,l,c,p)),Wg(t),y}function Wg(t){j.H=Fl;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,ru=!1,Pl=0,za=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Zo(t)&&(vt=!0))}function e0(t,r,l,c){Ae=t;var p=0;do{if(Aa&&(za=null),Pl=0,Aa=!1,25<=p)throw Error(a(301));if(p+=1,bt=et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}j.H=L0,y=r(l,c)}while(Aa);return y}function J_(){var t=j.H,r=t.useState()[0];return r=typeof r.then=="function"?Yl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function bd(){var t=au!==0;return au=0,t}function vd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function wd(t){if(ru){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ru=!1}bi=0,bt=et=Ae=null,Aa=!1,Pl=au=0,za=null}function Pt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ae.memoizedState=bt=t:bt=bt.next=t,bt}function gt(){if(et===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var r=bt===null?Ae.memoizedState:bt.next;if(r!==null)bt=r,et=t;else{if(t===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},bt===null?Ae.memoizedState=bt=t:bt=bt.next=t}return bt}function lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yl(t){var r=Pl;return Pl+=1,za===null&&(za=[]),t=Pg(za,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?O0:Dd),t}function su(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Yl(t);if(t.$$typeof===k)return jt(t)}throw Error(a(438,String(t)))}function Sd(t){var r=null,l=Ae.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=lu(),Ae.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),c=0;c<t;c++)l[c]=q;return r.index++,l}function vi(t,r){return typeof r=="function"?r(t):r}function ou(t){var r=gt();return _d(r,et,t)}function _d(t,r,l){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=l;var p=t.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,c.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var M=S=null,I=null,W=r,le=!1;do{var oe=W.lane&-536870913;if(oe!==W.lane?(Ue&oe)===oe:(bi&oe)===oe){var ee=W.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),oe===Ea&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Ea&&(le=!0);continue}else oe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=oe,S=y):I=I.next=oe,Ae.lanes|=ee,rr|=ee;oe=W.action,Ir&&l(y,oe),y=W.hasEagerState?W.eagerState:l(y,oe)}else ee={lane:oe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=ee,S=y):I=I.next=ee,Ae.lanes|=oe,rr|=oe;W=W.next}while(W!==null&&W!==r);if(I===null?S=y:I.next=M,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Na,l!==null)))throw l;t.memoizedState=y,t.baseState=S,t.baseQueue=I,c.lastRenderedState=y}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function kd(t){var r=gt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,y=r.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);un(y,r.memoizedState)||(vt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,c]}function t0(t,r,l){var c=Ae,p=gt(),y=qe;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=r();var S=!un((et||p).memoizedState,l);if(S&&(p.memoizedState=l,vt=!0),p=p.queue,Cd(r0.bind(null,c,p,t),[t]),p.getSnapshot!==r||S||bt!==null&&bt.memoizedState.tag&1){if(c.flags|=2048,ja(9,{destroy:void 0},i0.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||n0(c,r,l)}return l}function n0(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=lu(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function i0(t,r,l,c){r.value=l,r.getSnapshot=c,a0(r)&&l0(t)}function r0(t,r,l){return l(function(){a0(r)&&l0(t)})}function a0(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function l0(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function Ed(t){var r=Pt();if(typeof t=="function"){var l=t;if(t=l(),Ir){Ht(!0);try{l()}finally{Ht(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},r}function s0(t,r,l,c){return t.baseState=l,_d(t,et,typeof c=="function"?c:vi)}function W_(t,r,l,c,p){if(fu(t))throw Error(a(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};j.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,o0(r,y)):(y.next=l.next,r.pending=l.next=y)}}function o0(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=j.T,S={};j.T=S;try{var M=l(p,c),I=j.S;I!==null&&I(S,M),u0(t,r,M)}catch(W){Nd(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),j.T=y}}else try{y=l(p,c),u0(t,r,y)}catch(W){Nd(t,r,W)}}function u0(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){c0(t,r,c)},function(c){return Nd(t,r,c)}):c0(t,r,l)}function c0(t,r,l){r.status="fulfilled",r.value=l,f0(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,o0(t,l)))}function Nd(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,f0(r),r=r.next;while(r!==c)}t.action=null}function f0(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function d0(t,r){return r}function h0(t,r){if(qe){var l=it.formState;if(l!==null){e:{var c=Ae;if(qe){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Tn(p.nextSibling),c=p.data==="F!";break e}}Zi(c)}c=!1}c&&(r=l[0])}}return l=Pt(),l.memoizedState=l.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:r},l.queue=c,l=j0.bind(null,Ae,c),c.dispatch=l,c=Ed(!1),y=jd.bind(null,Ae,!1,c.queue),c=Pt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=W_.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function p0(t){var r=gt();return m0(r,et,t)}function m0(t,r,l){if(r=_d(t,r,d0)[0],t=ou(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Yl(r)}catch(S){throw S===Ca?Jo:S}else c=r;r=gt();var p=r.queue,y=p.dispatch;return l!==r.memoizedState&&(Ae.flags|=2048,ja(9,{destroy:void 0},ek.bind(null,p,l),null)),[c,y,t]}function ek(t,r){t.action=r}function g0(t){var r=gt(),l=et;if(l!==null)return m0(r,l,t);gt(),r=r.memoizedState,l=gt();var c=l.queue.dispatch;return l.memoizedState=t,[r,c,!1]}function ja(t,r,l,c){return t={tag:t,create:l,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=lu(),Ae.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,r.lastEffect=t),t}function y0(){return gt().memoizedState}function uu(t,r,l,c){var p=Pt();Ae.flags|=t,p.memoizedState=ja(1|r,{destroy:void 0},l,c===void 0?null:c)}function cu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&yd(c,et.memoizedState.deps)?p.memoizedState=ja(r,y,l,c):(Ae.flags|=t,p.memoizedState=ja(1|r,y,l,c))}function x0(t,r){uu(8390656,8,t,r)}function Cd(t,r){cu(2048,8,t,r)}function tk(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=lu(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function b0(t){var r=gt().memoizedState;return tk({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function v0(t,r){return cu(4,2,t,r)}function w0(t,r){return cu(4,4,t,r)}function S0(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function _0(t,r,l){l=l!=null?l.concat([t]):null,cu(4,4,S0.bind(null,r,t),l)}function Md(){}function k0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&yd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function E0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&yd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Td(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Ue&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=Ny(),Ae.lanes|=t,rr|=t,l)}function N0(t,r,l,c){return un(l,r)?l:Ta.current!==null?(t=Td(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Ue&261930)===0?(vt=!0,t.memoizedState=l):(t=Ny(),Ae.lanes|=t,rr|=t,r)}function C0(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=j.T,M={};j.T=M,jd(t,!1,r,l);try{var I=p(),W=j.S;if(W!==null&&W(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=Q_(I,c);Xl(t,r,le,mn(t))}else Xl(t,r,c,mn(t))}catch(oe){Xl(t,r,{then:function(){},status:"rejected",reason:oe},mn())}finally{U.p=y,S!==null&&M.types!==null&&(S.types=M.types),j.T=S}}function nk(){}function Ad(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=M0(t).queue;C0(t,p,r,Y,l===null?nk:function(){return T0(t),l(c)})}function M0(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function T0(t){var r=M0(t);r.next===null&&(r=t.alternate.memoizedState),Xl(t,r.next.queue,{},mn())}function zd(){return jt(us)}function A0(){return gt().memoizedState}function z0(){return gt().memoizedState}function ik(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=mn();t=Ji(l);var c=Wi(r,t,l);c!==null&&(nn(c,r,l),ql(c,r,l)),r={cache:ld()},t.payload=r;return}r=r.return}}function rk(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fu(t)?D0(r,l):(l=Zf(t,r,l,c),l!==null&&(nn(l,t,c),R0(l,r,c)))}function j0(t,r,l){var c=mn();Xl(t,r,l,c)}function Xl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(fu(t))D0(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,M=y(S,l);if(p.hasEagerState=!0,p.eagerState=M,un(M,S))return Yo(t,r,p,0),it===null&&Po(),!1}catch{}if(l=Zf(t,r,p,c),l!==null)return nn(l,t,c),R0(l,r,c),!0}return!1}function jd(t,r,l,c){if(c={lane:2,revertLane:ch(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},fu(t)){if(r)throw Error(a(479))}else r=Zf(t,l,c,2),r!==null&&nn(r,t,2)}function fu(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function D0(t,r){Aa=ru=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function R0(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}var Fl={readContext:jt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};Fl.useEffectEvent=ft;var O0={readContext:jt,use:su,useCallback:function(t,r){return Pt().memoizedState=[t,r===void 0?null:r],t},useContext:jt,useEffect:x0,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,uu(4194308,4,S0.bind(null,r,t),l)},useLayoutEffect:function(t,r){return uu(4194308,4,t,r)},useInsertionEffect:function(t,r){uu(4,2,t,r)},useMemo:function(t,r){var l=Pt();r=r===void 0?null:r;var c=t();if(Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c},useReducer:function(t,r,l){var c=Pt();if(l!==void 0){var p=l(r);if(Ir){Ht(!0);try{l(r)}finally{Ht(!1)}}}else p=r;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=rk.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Pt();return t={current:t},r.memoizedState=t},useState:function(t){t=Ed(t);var r=t.queue,l=j0.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Md,useDeferredValue:function(t,r){var l=Pt();return Td(l,t,r)},useTransition:function(){var t=Ed(!1);return t=C0.bind(null,Ae,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Pt();if(qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Ue&127)!==0||n0(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,x0(r0.bind(null,c,y,t),[t]),c.flags|=2048,ja(9,{destroy:void 0},i0.bind(null,c,y,l,r),null),l},useId:function(){var t=Pt(),r=it.identifierPrefix;if(qe){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=au++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=K_++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:zd,useFormState:h0,useActionState:h0,useOptimistic:function(t){var r=Pt();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=jd.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:Sd,useCacheRefresh:function(){return Pt().memoizedState=ik.bind(null,Ae)},useEffectEvent:function(t){var r=Pt(),l={impl:t};return r.memoizedState=l,function(){if((Qe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Dd={readContext:jt,use:su,useCallback:k0,useContext:jt,useEffect:Cd,useImperativeHandle:_0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:E0,useReducer:ou,useRef:y0,useState:function(){return ou(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return N0(l,et.memoizedState,t,r)},useTransition:function(){var t=ou(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Yl(t),r]},useSyncExternalStore:t0,useId:A0,useHostTransitionStatus:zd,useFormState:p0,useActionState:p0,useOptimistic:function(t,r){var l=gt();return s0(l,et,t,r)},useMemoCache:Sd,useCacheRefresh:z0};Dd.useEffectEvent=b0;var L0={readContext:jt,use:su,useCallback:k0,useContext:jt,useEffect:Cd,useImperativeHandle:_0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:E0,useReducer:kd,useRef:y0,useState:function(){return kd(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return et===null?Td(l,t,r):N0(l,et.memoizedState,t,r)},useTransition:function(){var t=kd(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Yl(t),r]},useSyncExternalStore:t0,useId:A0,useHostTransitionStatus:zd,useFormState:g0,useActionState:g0,useOptimistic:function(t,r){var l=gt();return et!==null?s0(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Sd,useCacheRefresh:z0};L0.useEffectEvent=b0;function Rd(t,r,l,c){r=t.memoizedState,l=l(c,r),l=l==null?r:m({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Od={enqueueSetState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=mn(),c=Ji(l);c.tag=2,r!=null&&(c.callback=r),r=Wi(t,c,l),r!==null&&(nn(r,t,l),ql(r,t,l))}};function H0(t,r,l,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!Dl(l,c)||!Dl(p,y):!0}function B0(t,r,l,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,c),r.state!==t&&Od.enqueueReplaceState(r,r.state,null)}function qr(t,r){var l=r;if("ref"in r){l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}if(t=t.defaultProps){l===r&&(l=m({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function U0(t){Vo(t)}function I0(t){console.error(t)}function q0(t){Vo(t)}function du(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function $0(t,r,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ld(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){du(t,r)},l}function V0(t){return t=Ji(t),t.tag=3,t}function P0(t,r,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;t.payload=function(){return p(y)},t.callback=function(){$0(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){$0(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function ak(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&ka(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Mn===null?ku():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),sh(t,c,p)),!1;case 22:return l.flags|=65536,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([c]):l.add(c)),sh(t,c,p)),!1}throw Error(a(435,l.tag))}return sh(t,c,p),ku(),!1}if(qe)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==td&&(t=Error(a(422),{cause:c}),Ll(kn(t,l)))):(c!==td&&(r=Error(a(423),{cause:c}),Ll(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=Ld(t.stateNode,c,p),dd(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),ts===null?ts=[y]:ts.push(y),dt!==4&&(dt=2),r===null)return!0;c=kn(c,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=Ld(l.stateNode,c,t),dd(l,t),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ar===null||!ar.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=V0(p),P0(p,t,l,c),dd(l,p),!1}l=l.return}while(l!==null);return!1}var Hd=Error(a(461)),vt=!1;function Dt(t,r,l,c){r.child=t===null?Gg(r,null,l,c):Ur(r,t.child,l,c)}function Y0(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Or(r),c=xd(t,r,l,S,y,p),M=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&M&&Wf(r),r.flags|=1,Dt(t,r,c,p),r.child)}function X0(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Qf(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,F0(t,r,y,c,p)):(t=Fo(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Yd(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Dl,l(S,c)&&t.ref===r.ref)return wi(t,r,p)}return r.flags|=1,t=mi(y,c),t.ref=r.ref,t.return=r,r.child=t}function F0(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(Dl(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,Yd(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Bd(t,r,l,c,p)}function G0(t,r,l,c){var p=c.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,t!==null){for(c=r.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return Z0(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ko(r,y!==null?y.cachePool:null),y!==null?Kg(r,y):pd(),Jg(r);else return c=r.lanes=536870912,Z0(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Ko(r,y.cachePool),Kg(r,y),tr(),r.memoizedState=null):(t!==null&&Ko(r,null),pd(),tr());return Dt(t,r,p,l),r.child}function Gl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Z0(t,r,l,c,p){var y=od();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Ko(r,null),pd(),Jg(r),t!==null&&ka(t,r,c,!0),r.childLanes=p,null}function hu(t,r){return r=mu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Q0(t,r,l){return Ur(r,t.child,null,l),t=hu(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function lk(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(qe){if(c.mode==="hidden")return t=hu(r,c),r.lanes=536870912,Gl(null,t);if(gd(r),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return hu(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(gd(r),p)if(r.flags&256)r.flags&=-257,r=Q0(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(vt||ka(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=Eo(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Hd;ku(),r=Q0(t,r,l)}else t=y.treeContext,lt=Tn(S.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Lg(r,t),r=hu(r,c),r.flags|=4096;return r}return t=mi(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function pu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function Bd(t,r,l,c,p){return Or(r),l=xd(t,r,l,c,void 0,p),c=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,p),r.child)}function K0(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=e0(r,c,l,p),Wg(t),c=bd(),t!==null&&!vt?(vd(t,r,y),wi(t,r,y)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,y),r.child)}function J0(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=va,S=l.contextType;typeof S=="object"&&S!==null&&(y=jt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Od,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},cd(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?jt(S):va,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Rd(r,l,S,c),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Od.enqueueReplaceState(y,y.state,null),Vl(r,c,y,p),$l(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,I=qr(l,M);y.props=I;var W=y.context,le=l.contextType;S=va,typeof le=="object"&&le!==null&&(S=jt(le));var oe=l.getDerivedStateFromProps;le=typeof oe=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&B0(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Vl(r,c,y,p),$l(),W=r.memoizedState,M||ee!==W||Ki?(typeof oe=="function"&&(Rd(r,l,oe,c),W=r.memoizedState),(I=Ki||H0(r,l,I,c,ee,W,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=W),y.props=c,y.state=W,y.context=S,c=I):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,fd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,oe=r.pendingProps,ee=y.context,W=l.contextType,I=va,typeof W=="object"&&W!==null&&(I=jt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==oe||ee!==I)&&B0(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Vl(r,c,y,p),$l();var re=r.memoizedState;S!==oe||ee!==re||Ki||t!==null&&t.dependencies!==null&&Zo(t.dependencies)?(typeof M=="function"&&(Rd(r,l,M,c),re=r.memoizedState),(le=Ki||H0(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Zo(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,I)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=re),y.props=c,y.state=re,y.context=I,c=le):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),c=!1)}return y=c,pu(t,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&c?(r.child=Ur(r,t.child,null,p),r.child=Ur(r,null,l,p)):Dt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function W0(t,r,l,c){return Dr(),r.flags|=256,Dt(t,r,l,c),r.child}var Ud={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Id(t){return{baseLanes:t,cachePool:$g()}}function qd(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function ey(t,r,l){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(qe){if(p?er(r):tr(),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return _h(t)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(tr(),p=r.mode,M=mu({mode:"hidden",children:M},p),c=jr(c,p,l,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,Gl(null,c)):(er(r),$d(r,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=Vd(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),M=c.fallback,p=r.mode,c=mu({mode:"visible",children:c.children},p),M=jr(M,p,l,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,r=Gl(null,c));else if(er(r),_h(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Ll({value:c,source:null,stack:null}),r=Vd(t,r,l)}else if(vt||ka(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=Eo(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Hd;Sh(M)||ku(),r=Vd(t,r,l)}else Sh(M)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Tn(M.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Lg(r,t),r=$d(r,c.children),r.flags|=4096);return r}return p?(tr(),M=c.fallback,p=r.mode,I=t.child,W=I.sibling,c=mi(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?M=mi(W,M):(M=jr(M,p,l,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Gl(null,c),c=r.child,M=t.child.memoizedState,M===null?M=Id(l):(p=M.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=$g(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=qd(t,S,l),r.memoizedState=Ud,Gl(t.child,c)):(er(r),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:c.children}),l.return=r,l.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=l,r.memoizedState=null,l)}function $d(t,r){return r=mu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function mu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function Vd(t,r,l){return Ur(r,t.child,null,l),t=$d(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function ty(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),rd(t.return,r,l)}function Pd(t,r,l,c,p,y){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=l,S.tailMode=p,S.treeForkCount=y)}function ny(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,T(mt,S),Dt(t,r,c,l),c=qe?Ol:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ty(t,l,r);else if(t.tag===19)ty(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)t=l.alternate,t!==null&&iu(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),Pd(r,!1,p,l,y,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&iu(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Pd(r,!0,l,null,y,c);break;case"together":Pd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function wi(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),rr|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(ka(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=mi(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function Yd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Zo(t)))}function sk(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),Dr();break;case 27:case 5:Ee(r);break;case 4:ue(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,gd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(er(r),r.flags|=128,null):(l&r.child.childLanes)!==0?ey(t,r,l):(er(r),t=wi(t,r,l),t!==null?t.sibling:null);er(r);break;case 19:var p=(t.flags&128)!==0;if(c=(l&r.childLanes)!==0,c||(ka(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return ny(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(mt,mt.current),c)break;return null;case 22:return r.lanes=0,G0(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function iy(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!Yd(t,l)&&(r.flags&128)===0)return vt=!1,sk(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,qe&&(r.flags&1048576)!==0&&Og(r,Ol,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=Hr(r.elementType),r.type=t,typeof t=="function")Qf(t)?(c=qr(t,c),r.tag=1,r=J0(null,r,t,c,l)):(r.tag=0,r=Bd(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=Y0(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=X0(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Bd(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),J0(t,r,c,p,l);case 3:e:{if(ue(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,fd(t,r),Vl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&ad(r,[xt],l,!0),$l(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=W0(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Ll(p),r=W0(t,r,c,l);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=Tn(t.firstChild),zt=r,qe=!0,Gi=null,Cn=!0,l=Gg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===p){r=wi(t,r,l);break e}Dt(t,r,c,l)}r=r.child}return r;case 26:return pu(t,r),t===null?(l=px(r.type,null,r.pendingProps,null))?r.memoizedState=l:qe||(l=r.type,t=r.pendingProps,c=zu(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=px(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&qe&&(c=r.stateNode=fx(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(kh=p,lt=Tn(c.firstChild)):lt=p),Dt(t,r,r.pendingProps.children,l),pu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&qe&&((p=c=lt)&&(c=Hk(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Tn(c.firstChild),Cn=!1,p=!0):p=!1),p||Zi(r)),Ee(r),p=r.type,y=r.pendingProps,S=t!==null?t.memoizedProps:null,c=y.children,bh(p,y)?c=null:S!==null&&bh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=xd(t,r,J_,null,null,l),us._currentValue=p),pu(t,r),Dt(t,r,c,l),r.child;case 6:return t===null&&qe&&((t=l=lt)&&(l=Bk(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return ey(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):Dt(t,r,c,l),r.child;case 11:return Y0(t,r,r.type,r.pendingProps,l);case 7:return Dt(t,r,r.pendingProps,l),r.child;case 8:return Dt(t,r,r.pendingProps.children,l),r.child;case 12:return Dt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),Dt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=jt(p),c=c(p),r.flags|=1,Dt(t,r,c,l),r.child;case 14:return X0(t,r,r.type,r.pendingProps,l);case 15:return F0(t,r,r.type,r.pendingProps,l);case 19:return ny(t,r,l);case 31:return lk(t,r,l);case 22:return G0(t,r,l,r.pendingProps);case 24:return Or(r),c=jt(xt),t===null?(p=od(),p===null&&(p=it,y=ld(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},cd(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(fd(t,r),Vl(r,null,null,l),$l()),p=t.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Qi(r,xt,c)):(c=y.cache,Qi(r,xt,c),c!==p.cache&&ad(r,[xt],l,!0))),Dt(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Si(t){t.flags|=4}function Xd(t,r,l,c,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Ay())t.flags|=8192;else throw Br=Wo,ud}else t.flags&=-16777217}function ry(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!bx(r))if(Ay())t.flags|=8192;else throw Br=Wo,ud}function gu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?So():536870912,t.lanes|=r,La|=r)}function Zl(t,r){if(!qe)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function st(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(r)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,r}function ok(t,r,l){var c=r.pendingProps;switch(ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(r),null;case 1:return st(r),null;case 3:return l=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xi(xt),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(_a(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,nd())),st(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(st(r),ry(r,y)):(st(r),Xd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),st(r),ry(r,y)):(st(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),st(r),Xd(r,p,t,c,l)),null;case 27:if(Ce(r),l=fe.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}t=ie.current,_a(r)?Hg(r):(t=fx(p,c,l),r.stateNode=t,Si(r))}return st(r),null;case 5:if(Ce(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}if(y=ie.current,_a(r))Hg(r);else{var S=zu(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Nt]=r,y[Bt]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;e:switch(Rt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Si(r)}}return st(r),Xd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=fe.current,_a(r)){if(t=r.stateNode,l=r.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||ex(t.nodeValue,l)),t||Zi(r,!0)}else t=zu(t).createTextNode(c),t[Nt]=r,r.stateNode=t}return st(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(c=_a(r),l!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),t=!1}else l=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(dn(r),r):(dn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return st(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=_a(r),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),p=!1}else p=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(dn(r),r):(dn(r),null)}return dn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),gu(r,r.updateQueue),st(r),null);case 4:return me(),t===null&&ph(r.stateNode.containerInfo),st(r),null;case 10:return xi(r.type),st(r),null;case 19:if($(mt),c=r.memoizedState,c===null)return st(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)Zl(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=iu(t),y!==null){for(r.flags|=128,Zl(c,!1),t=y.updateQueue,r.updateQueue=t,gu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)jg(l,t),l=l.sibling;return T(mt,mt.current&1|2),qe&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>wu&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304)}else{if(!p)if(t=iu(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,gu(r,t),Zl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return st(r),null}else 2*Et()-c.renderingStartTime>wu&&l!==536870912&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(t=c.last,t!==null?t.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,l=mt.current,T(mt,p?l&1|2:l&1),qe&&gi(r,c.treeForkCount),t):(st(r),null);case 22:case 23:return dn(r),md(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(l&536870912)!==0&&(r.flags&128)===0&&(st(r),r.subtreeFlags&6&&(r.flags|=8192)):st(r),l=r.updateQueue,l!==null&&gu(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==l&&(r.flags|=2048),t!==null&&$(Lr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(xt),st(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function uk(t,r){switch(ed(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xi(xt),me(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ce(r),null;case 31:if(r.memoizedState!==null){if(dn(r),r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(dn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(mt),null;case 4:return me(),null;case 10:return xi(r.type),null;case 22:case 23:return dn(r),md(),t!==null&&$(Lr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xi(xt),null;case 25:return null;default:return null}}function ay(t,r){switch(ed(r),r.tag){case 3:xi(xt),me();break;case 26:case 27:case 5:Ce(r);break;case 4:me();break;case 31:r.memoizedState!==null&&dn(r);break;case 13:dn(r);break;case 19:$(mt);break;case 10:xi(r.type);break;case 22:case 23:dn(r),md(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Ql(t,r){try{var l=r.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var y=l.create,S=l.inst;c=y(),S.destroy=c}l=l.next}while(l!==p)}}catch(M){We(r,r.return,M)}}function nr(t,r,l){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&t)===t){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=r;var I=l,W=M;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function ly(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Qg(r,l)}catch(c){We(t,t.return,c)}}}function sy(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function Kl(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){We(t,r,p)}}function Jn(t,r){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){We(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){We(t,r,p)}else l.current=null}function oy(t){var r=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){We(t,t.return,p)}}function Fd(t,r,l){try{var c=t.stateNode;zk(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function uy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Gd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||uy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zd(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=hi));else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Zd(t,r,l),t=t.sibling;t!==null;)Zd(t,r,l),t=t.sibling}function yu(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(yu(t,r,l),t=t.sibling;t!==null;)yu(t,r,l),t=t.sibling}function cy(t){var r=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Rt(r,c,l),r[Nt]=t,r[Bt]=l}catch(y){We(t,t.return,y)}}var _i=!1,wt=!1,Qd=!1,fy=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function ck(t,r){if(t=t.containerInfo,yh=Bu,t=_g(t),Vf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,M=-1,I=-1,W=0,le=0,oe=t,ee=null;t:for(;;){for(var re;oe!==l||p!==0&&oe.nodeType!==3||(M=S+p),oe!==y||c!==0&&oe.nodeType!==3||(I=S+c),oe.nodeType===3&&(S+=oe.nodeValue.length),(re=oe.firstChild)!==null;)ee=oe,oe=re;for(;;){if(oe===t)break t;if(ee===l&&++W===p&&(M=S),ee===y&&++le===c&&(I=S),(re=oe.nextSibling)!==null)break;oe=ee,ee=oe.parentNode}oe=re}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(xh={focusedElem:t,selectionRange:l},Bu=!1,Tt=r;Tt!==null;)if(r=Tt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Tt=t;else for(;Tt!==null;){switch(r=Tt,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,l=r,p=y.memoizedProps,y=y.memoizedState,c=l.stateNode;try{var ye=qr(l.type,p);t=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=t}catch(ke){We(l,l.return,ke)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)wh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Tt=t;break}Tt=r.return}}function dy(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Ql(5,l);break;case 1:if(Ei(t,l),c&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(S){We(l,l.return,S)}else{var p=qr(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){We(l,l.return,S)}}c&64&&ly(l),c&512&&Kl(l,l.return);break;case 3:if(Ei(t,l),c&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Qg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&cy(l);case 26:case 5:Ei(t,l),r===null&&c&4&&oy(l),c&512&&Kl(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&my(t,l);break;case 13:Ei(t,l),c&4&&gy(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=bk.bind(null,l),Uk(t,l))));break;case 22:if(c=l.memoizedState!==null||_i,!c){r=r!==null&&r.memoizedState!==null||wt,p=_i;var y=wt;_i=c,(wt=r)&&!y?Ni(t,l,(l.subtreeFlags&8772)!==0):Ei(t,l),_i=p,wt=y}break;case 30:break;default:Ei(t,l)}}function hy(t){var r=t.alternate;r!==null&&(t.alternate=null,hy(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&_l(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Jt=!1;function ki(t,r,l){for(l=l.child;l!==null;)py(t,r,l),l=l.sibling}function py(t,r,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(At,l)}catch{}switch(l.tag){case 26:wt||Jn(l,r),ki(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||Jn(l,r);var c=ot,p=Jt;ur(l.type)&&(ot=l.stateNode,Jt=!1),ki(t,r,l),ls(l.stateNode),ot=c,Jt=p;break;case 5:wt||Jn(l,r);case 6:if(c=ot,p=Jt,ot=null,ki(t,r,l),ot=c,Jt=p,ot!==null)if(Jt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(l.stateNode)}catch(y){We(l,r,y)}else try{ot.removeChild(l.stateNode)}catch(y){We(l,r,y)}break;case 18:ot!==null&&(Jt?(t=ot,lx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Pa(t)):lx(ot,l.stateNode));break;case 4:c=ot,p=Jt,ot=l.stateNode.containerInfo,Jt=!0,ki(t,r,l),ot=c,Jt=p;break;case 0:case 11:case 14:case 15:nr(2,l,r),wt||nr(4,l,r),ki(t,r,l);break;case 1:wt||(Jn(l,r),c=l.stateNode,typeof c.componentWillUnmount=="function"&&sy(l,r,c)),ki(t,r,l);break;case 21:ki(t,r,l);break;case 22:wt=(c=wt)||l.memoizedState!==null,ki(t,r,l),wt=c;break;default:ki(t,r,l)}}function my(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Pa(t)}catch(l){We(r,r.return,l)}}}function gy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pa(t)}catch(l){We(r,r.return,l)}}function fk(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new fy),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new fy),r;default:throw Error(a(435,t.tag))}}function xu(t,r){var l=fk(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=vk.bind(null,t,c);c.then(p,p)}})}function Wt(t,r){var l=r.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],y=t,S=r,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ur(M.type)){ot=M.stateNode,Jt=!1;break e}break;case 5:ot=M.stateNode,Jt=!1;break e;case 3:case 4:ot=M.stateNode.containerInfo,Jt=!0;break e}M=M.return}if(ot===null)throw Error(a(160));py(y,S,p),ot=null,Jt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)yy(r,t),r=r.sibling}var Bn=null;function yy(t,r){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(r,t),en(t),c&4&&(nr(3,t,t.return),Ql(3,t),nr(5,t,t.return));break;case 1:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&64&&_i&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Bn;if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&4){var y=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Er]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Rt(y,c,l),y[Nt]=t,yt(y),c=y;break e;case"link":var S=yx("link","href",p).get(c+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=yx("meta","content",p).get(c+(l.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Nt]=t,yt(y),c=y}t.stateNode=c}else xx(p,t.type,t.stateNode);else t.stateNode=gx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?xx(p,t.type,t.stateNode):gx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Fd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),l!==null&&c&4&&Fd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),t.flags&32){p=t.stateNode;try{ha(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Fd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Qd=!0);break;case 6:if(Wt(r,t),en(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ye){We(t,t.return,ye)}}break;case 3:if(Ru=null,p=Bn,Bn=ju(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Pa(r.containerInfo)}catch(ye){We(t,t.return,ye)}Qd&&(Qd=!1,xy(t));break;case 4:c=Bn,Bn=ju(t.stateNode.containerInfo),Wt(r,t),en(t),Bn=c;break;case 12:Wt(r,t),en(t);break;case 31:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(vu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 22:p=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,W=_i,le=wt;if(_i=W||p,wt=le||I,Wt(r,t),wt=le,_i=W,en(t),c&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||_i||wt||$r(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(y=I.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var oe=I.memoizedProps.style,ee=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){We(I,I.return,ye)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ye){We(I,I.return,ye)}}}else if(r.tag===18){if(l===null){I=r;try{var re=I.stateNode;p?sx(re,!0):sx(I.stateNode,!1)}catch(ye){We(I,I.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,xu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 30:break;case 21:break;default:Wt(r,t),en(t)}}function en(t){var r=t.flags;if(r&2){try{for(var l,c=t.return;c!==null;){if(uy(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Gd(t);yu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(ha(S,""),l.flags&=-33);var M=Gd(t);yu(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Gd(t);Zd(t,W,I);break;default:throw Error(a(161))}}catch(le){We(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function xy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;xy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ei(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)dy(t,r.alternate,r),r=r.sibling}function $r(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:nr(4,r,r.return),$r(r);break;case 1:Jn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&sy(r,r.return,l),$r(r);break;case 27:ls(r.stateNode);case 26:case 5:Jn(r,r.return),$r(r);break;case 22:r.memoizedState===null&&$r(r);break;case 30:$r(r);break;default:$r(r)}t=t.sibling}}function Ni(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ni(p,y,l),Ql(4,y);break;case 1:if(Ni(p,y,l),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){We(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var M=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Zg(I[p],M)}catch(W){We(c,c.return,W)}}l&&S&64&&ly(y),Kl(y,y.return);break;case 27:cy(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&oy(y),Kl(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&my(p,y);break;case 13:Ni(p,y,l),l&&S&4&&gy(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),Kl(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Kd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Hl(l))}function Jd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)by(t,r,l,c),r=r.sibling}function by(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Ql(9,r);break;case 1:Un(t,r,l,c);break;case 3:Un(t,r,l,c),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){We(r,r.return,I)}}else Un(t,r,l,c);break;case 31:Un(t,r,l,c);break;case 13:Un(t,r,l,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Un(t,r,l,c):Jl(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,Da(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Kd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Jd(r.alternate,r);break;default:Un(t,r,l,c)}}function Da(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,M=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:Da(y,S,M,I,p),Ql(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Da(y,S,M,I,p):Jl(y,S):(le._visibility|=2,Da(y,S,M,I,p)),p&&W&2048&&Kd(S.alternate,S);break;case 24:Da(y,S,M,I,p),p&&W&2048&&Jd(S.alternate,S);break;default:Da(y,S,M,I,p)}r=r.sibling}}function Jl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,c=r,p=c.flags;switch(c.tag){case 22:Jl(l,c),p&2048&&Kd(c.alternate,c);break;case 24:Jl(l,c),p&2048&&Jd(c.alternate,c);break;default:Jl(l,c)}r=r.sibling}}var Wl=8192;function Ra(t,r,l){if(t.subtreeFlags&Wl)for(t=t.child;t!==null;)vy(t,r,l),t=t.sibling}function vy(t,r,l){switch(t.tag){case 26:Ra(t,r,l),t.flags&Wl&&t.memoizedState!==null&&Kk(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,r,l);break;case 3:case 4:var c=Bn;Bn=ju(t.stateNode.containerInfo),Ra(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Wl,Wl=16777216,Ra(t,r,l),Wl=c):Ra(t,r,l));break;default:Ra(t,r,l)}}function wy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function es(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,_y(c,t)}wy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sy(t),t=t.sibling}function Sy(t){switch(t.tag){case 0:case 11:case 15:es(t),t.flags&2048&&nr(9,t,t.return);break;case 3:es(t);break;case 12:es(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,bu(t)):es(t);break;default:es(t)}}function bu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,_y(c,t)}wy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),bu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,bu(r));break;default:bu(r)}t=t.sibling}}function _y(t,r){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:nr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Hl(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Tt=c;else e:for(l=t;Tt!==null;){c=Tt;var p=c.sibling,y=c.return;if(hy(c),c===l){Tt=null;break e}if(p!==null){p.return=y,Tt=p;break e}Tt=y}}}var dk={getCacheForType:function(t){var r=jt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return jt(xt).controller.signal}},hk=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Le=null,Ue=0,Je=0,hn=null,ir=!1,Oa=!1,Wd=!1,Ci=0,dt=0,rr=0,Vr=0,eh=0,pn=0,La=0,ts=null,tn=null,th=!1,vu=0,ky=0,wu=1/0,Su=null,ar=null,Ct=0,lr=null,Ha=null,Mi=0,nh=0,ih=null,Ey=null,ns=0,rh=null;function mn(){return(Qe&2)!==0&&Ue!==0?Ue&-Ue:j.T!==null?ch():No()}function Ny(){if(pn===0)if((Ue&536870912)===0||qe){var t=la;la<<=1,(la&3932160)===0&&(la=262144),pn=t}else pn=536870912;return t=fn.current,t!==null&&(t.flags|=32),pn}function nn(t,r,l){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(Ba(t,0),sr(t,Ue,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&sr(t,Ue,pn,!1)),Wn(t))}function Cy(t,r,l){if((Qe&6)!==0)throw Error(a(327));var c=!l&&(r&127)===0&&(r&t.expiredLanes)===0||_r(t,r),p=c?gk(t,r):lh(t,r,!0),y=c;do{if(p===0){Oa&&!c&&sr(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!pk(l)){p=lh(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var M=t;p=ts;var I=M.current.memoizedState.isDehydrated;if(I&&(Ba(M,S).flags|=256),S=lh(M,S,!1),S!==2){if(Wd&&!I){M.errorRecoveryDisabledLanes|=y,Vr|=y,p=4;break e}y=tn,tn=p,y!==null&&(tn===null?tn=y:tn.push.apply(tn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Ba(t,0),sr(t,r,0,!0);break}e:{switch(c=t,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:sr(c,r,pn,!ir);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=vu+300-Et(),10<p)){if(sr(c,r,pn,!ir),oa(c,0,!0)!==0)break e;Mi=r,c.timeoutHandle=rx(My.bind(null,c,l,tn,Su,th,r,pn,Vr,La,ir,y,"Throttled",-0,0),p);break e}My(c,l,tn,Su,th,r,pn,Vr,La,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function My(t,r,l,c,p,y,S,M,I,W,le,oe,ee,re){if(t.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},vy(r,y,oe);var ye=(y&62914560)===y?vu-Et():(y&4194048)===y?ky-Et():0;if(ye=Jk(oe,ye),ye!==null){Mi=y,t.cancelPendingCommit=ye(Ly.bind(null,t,r,y,l,c,p,S,M,I,le,oe,null,ee,re)),sr(t,y,S,!W);return}}Ly(t,r,y,l,c,p,S,M,I)}function pk(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],y=p.getSnapshot;p=p.value;try{if(!un(y(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sr(t,r,l,c){r&=~eh,r&=~Vr,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var p=r;0<p;){var y=31-Ke(p),S=1<<y;c[y]=-1,p&=~S}l!==0&&_o(t,l,r)}function _u(){return(Qe&6)===0?(is(0),!1):!0}function ah(){if(Le!==null){if(Je===0)var t=Le.return;else t=Le,yi=Rr=null,wd(t),Ma=null,Ul=0,t=Le;for(;t!==null;)ay(t.alternate,t),t=t.return;Le=null}}function Ba(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Rk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Mi=0,ah(),it=t,Le=l=mi(t.current,null),Ue=r,Je=0,hn=null,ir=!1,Oa=_r(t,r),Wd=!1,La=pn=eh=Vr=rr=dt=0,tn=ts=null,th=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var p=31-Ke(c),y=1<<p;r|=t[p],c&=~y}return Ci=r,Po(),l}function Ty(t,r){Ae=null,j.H=Fl,r===Ca||r===Jo?(r=Yg(),Je=3):r===ud?(r=Yg(),Je=4):Je=r===Hd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Le===null&&(dt=1,du(t,kn(r,t.current)))}function Ay(){var t=fn.current;return t===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?t===Mn:!1}function zy(){var t=j.H;return j.H=Fl,t===null?Fl:t}function jy(){var t=j.A;return j.A=dk,t}function ku(){dt=4,ir||(Ue&4194048)!==Ue&&fn.current!==null||(Oa=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||sr(it,Ue,pn,!1)}function lh(t,r,l){var c=Qe;Qe|=2;var p=zy(),y=jy();(it!==t||Ue!==r)&&(Su=null,Ba(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Le!==null){var M=Le,I=hn;switch(Je){case 8:ah(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var W=Je;if(Je=0,hn=null,Ua(t,M,I,W),l&&Oa){S=0;break e}break;default:W=Je,Je=0,hn=null,Ua(t,M,I,W)}}mk(),S=dt;break}catch(le){Ty(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,j.H=p,j.A=y,Le===null&&(it=null,Ue=0,Po()),S}function mk(){for(;Le!==null;)Dy(Le)}function gk(t,r){var l=Qe;Qe|=2;var c=zy(),p=jy();it!==t||Ue!==r?(Su=null,wu=Et()+500,Ba(t,r)):Oa=_r(t,r);e:do try{if(Je!==0&&Le!==null){r=Le;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ua(t,r,y,1);break;case 2:case 9:if(Vg(y)){Je=0,hn=null,Ry(r);break}r=function(){Je!==2&&Je!==9||it!==t||(Je=7),Wn(t)},y.then(r,r);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Vg(y)?(Je=0,hn=null,Ry(r)):(Je=0,hn=null,Ua(t,r,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var M=Le;if(S?bx(S):M.stateNode.complete){Je=0,hn=null;var I=M.sibling;if(I!==null)Le=I;else{var W=M.return;W!==null?(Le=W,Eu(W)):Le=null}break t}}Je=0,hn=null,Ua(t,r,y,5);break;case 6:Je=0,hn=null,Ua(t,r,y,6);break;case 8:ah(),dt=6;break e;default:throw Error(a(462))}}yk();break}catch(le){Ty(t,le)}while(!0);return yi=Rr=null,j.H=c,j.A=p,Qe=l,Le!==null?0:(it=null,Ue=0,Po(),dt)}function yk(){for(;Le!==null&&!si();)Dy(Le)}function Dy(t){var r=iy(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Eu(t):Le=r}function Ry(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=K0(l,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=K0(l,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:wd(r);default:ay(l,r),r=Le=jg(r,Ci),r=iy(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Eu(t):Le=r}function Ua(t,r,l,c){yi=Rr=null,wd(r),Ma=null,Ul=0;var p=r.return;try{if(ak(t,p,r,l,Ue)){dt=1,du(t,kn(l,t.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;dt=1,du(t,kn(l,t.current)),Le=null;return}r.flags&32768?(qe||c===1?t=!0:Oa||(Ue&536870912)!==0?t=!1:(ir=t=!0,(c===2||c===9||c===3||c===6)&&(c=fn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Oy(r,t)):Eu(r)}function Eu(t){var r=t;do{if((r.flags&32768)!==0){Oy(r,ir);return}t=r.return;var l=ok(r.alternate,r,Ci);if(l!==null){Le=l;return}if(r=r.sibling,r!==null){Le=r;return}Le=r=t}while(r!==null);dt===0&&(dt=5)}function Oy(t,r){do{var l=uk(t.alternate,t);if(l!==null){l.flags&=32767,Le=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Le=t;return}Le=t=l}while(t!==null);dt=6,Le=null}function Ly(t,r,l,c,p,y,S,M,I){t.cancelPendingCommit=null;do Nu();while(Ct!==0);if((Qe&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(y=r.lanes|r.childLanes,y|=Gf,kf(t,l,y,S,M,I),t===it&&(Le=it=null,Ue=0),Ha=r,lr=t,Mi=l,nh=y,ih=p,Ey=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,wk(_e,function(){return qy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=j.T,j.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{ck(t,r,l)}finally{Qe=S,U.p=p,j.T=c}}Ct=1,Hy(),By(),Uy()}}function Hy(){if(Ct===1){Ct=0;var t=lr,r=Ha,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{yy(r,t);var y=xh,S=_g(t.containerInfo),M=y.focusedElem,I=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&Sg(M.ownerDocument.documentElement,M)){if(I!==null&&Vf(M)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var oe=M.ownerDocument||document,ee=oe&&oe.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.textContent.length,ke=Math.min(I.start,ye),nt=I.end===void 0?ke:Math.min(I.end,ye);!re.extend&&ke>nt&&(S=nt,nt=ke,ke=S);var Z=wg(M,ke),X=wg(M,nt);if(Z&&X&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=oe.createRange();J.setStart(Z.node,Z.offset),re.removeAllRanges(),ke>nt?(re.addRange(J),re.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),re.addRange(J))}}}}for(oe=[],re=M;re=re.parentNode;)re.nodeType===1&&oe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var se=oe[M];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Bu=!!yh,xh=yh=null}finally{Qe=p,U.p=c,j.T=l}}t.current=r,Ct=2}}function By(){if(Ct===2){Ct=0;var t=lr,r=Ha,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{dy(t,r.alternate,r)}finally{Qe=p,U.p=c,j.T=l}}Ct=3}}function Uy(){if(Ct===4||Ct===3){Ct=0,oi();var t=lr,r=Ha,l=Mi,c=Ey;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ha=lr=null,Iy(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),Sl(l),r=r.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=j.T,p=U.p,U.p=2,j.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{j.T=r,U.p=p}}(Mi&3)!==0&&Nu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===rh?ns++:(ns=0,rh=t):ns=0,is(0)}}function Iy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Hl(r)))}function Nu(){return Hy(),By(),Uy(),qy()}function qy(){if(Ct!==5)return!1;var t=lr,r=nh;nh=0;var l=Sl(Mi),c=j.T,p=U.p;try{U.p=32>l?32:l,j.T=null,l=ih,ih=null;var y=lr,S=Mi;if(Ct=0,Ha=lr=null,Mi=0,(Qe&6)!==0)throw Error(a(331));var M=Qe;if(Qe|=4,Sy(y.current),by(y,y.current,S,l),Qe=M,is(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,j.T=c,Iy(t,r)}}function $y(t,r,l){r=kn(l,r),r=Ld(t.stateNode,r,2),t=Wi(t,r,2),t!==null&&(kr(t,2),Wn(t))}function We(t,r,l){if(t.tag===3)$y(t,t,l);else for(;r!==null;){if(r.tag===3){$y(r,t,l);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ar===null||!ar.has(c))){t=kn(l,t),l=V0(2),c=Wi(r,l,2),c!==null&&(P0(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function sh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new hk;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(l)||(Wd=!0,p.add(l),t=xk.bind(null,t,r,l),r.then(t,t))}function xk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Ue&l)===l&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>Et()-vu?(Qe&2)===0&&Ba(t,0):eh|=l,La===Ue&&(La=0)),Wn(t)}function Vy(t,r){r===0&&(r=So()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function bk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),Vy(t,l)}function vk(t,r){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),Vy(t,l)}function wk(t,r){return Gt(t,r)}var Cu=null,Ia=null,oh=!1,Mu=!1,uh=!1,or=0;function Wn(t){t!==Ia&&t.next===null&&(Ia===null?Cu=Ia=t:Ia=Ia.next=t),Mu=!0,oh||(oh=!0,_k())}function is(t,r){if(!uh&&Mu){uh=!0;do for(var l=!1,c=Cu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Fy(c,y))}else y=Ue,y=oa(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,Fy(c,y));c=c.next}while(l);uh=!1}}function Sk(){Py()}function Py(){Mu=oh=!1;var t=0;or!==0&&Dk()&&(t=or);for(var r=Et(),l=null,c=Cu;c!==null;){var p=c.next,y=Yy(c,r);y===0?(c.next=null,l===null?Cu=p:l.next=p,p===null&&(Ia=l)):(l=c,(t!==0||(y&3)!==0)&&(Mu=!0)),c=p}Ct!==0&&Ct!==5||is(t),or!==0&&(or=0)}function Yy(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),M=1<<S,I=p[S];I===-1?((M&l)===0||(M&c)!==0)&&(p[S]=_f(M,r)):I<=r&&(t.expiredLanes|=M),y&=~M}if(r=it,l=Ue,l=oa(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===r&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||_r(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(c!==null&&Rn(c),Sl(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Xy.bind(null,t),l=Gt(l,c),t.callbackPriority=r,t.callbackNode=l,r}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Xy(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Nu()&&t.callbackNode!==l)return null;var c=Ue;return c=oa(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Cy(t,c,r),Yy(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Xy.bind(null,t):null)}function Fy(t,r){if(Nu())return null;Cy(t,r,!0)}function _k(){Ok(function(){(Qe&6)!==0?Gt(ae,Sk):Py()})}function ch(){if(or===0){var t=Ea;t===0&&(t=aa,aa<<=1,(aa&261888)===0&&(aa=256)),or=t}return or}function Gy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Lo(""+t)}function Zy(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function kk(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=Gy((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?Gy(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new Io("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var I=S?Zy(p,S):new FormData(p);Ad(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=S?Zy(p,S):new FormData(p),Ad(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var fh=0;fh<Ff.length;fh++){var dh=Ff[fh],Ek=dh.toLowerCase(),Nk=dh[0].toUpperCase()+dh.slice(1);Hn(Ek,"on"+Nk)}Hn(Ng,"onAnimationEnd"),Hn(Cg,"onAnimationIteration"),Hn(Mg,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn($_,"onTransitionRun"),Hn(V_,"onTransitionStart"),Hn(P_,"onTransitionCancel"),Hn(Tg,"onTransitionEnd"),Yi("onMouseEnter",["mouseout","mouseover"]),Yi("onMouseLeave",["mouseout","mouseover"]),Yi("onPointerEnter",["pointerout","pointerover"]),Yi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),Ck=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rs));function Qy(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var M=c[S],I=M.instance,W=M.currentTarget;if(M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(M=c[S],I=M.instance,W=M.currentTarget,M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}}}}function He(t,r){var l=r[ua];l===void 0&&(l=r[ua]=new Set);var c=t+"__bubble";l.has(c)||(Ky(r,t,2,!1),l.add(c))}function hh(t,r,l){var c=0;r&&(c|=4),Ky(l,t,c,r)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function ph(t){if(!t[Tu]){t[Tu]=!0,Ao.forEach(function(l){l!=="selectionchange"&&(Ck.has(l)||hh(l,!1,t),hh(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Tu]||(r[Tu]=!0,hh("selectionchange",!1,r))}}function Ky(t,r,l,c){switch(Nx(r)){case 2:var p=tE;break;case 8:p=nE;break;default:p=Th}l=p.bind(null,r,l,t),p=void 0,!Rf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,l,{capture:!0,passive:p}):t.addEventListener(r,l,!0):p!==void 0?t.addEventListener(r,l,{passive:p}):t.addEventListener(r,l,!1)}function mh(t,r,l,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var M=c.stateNode.containerInfo;if(M===p)break;if(S===4)for(S=c.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;M!==null;){if(S=qi(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}M=M.parentNode}}c=c.return}ng(function(){var W=y,le=jf(l),oe=[];e:{var ee=Ag.get(t);if(ee!==void 0){var re=Io,ye=t;switch(t){case"keypress":if(Bo(l)===0)break e;case"keydown":case"keyup":re=v_;break;case"focusin":ye="focus",re=Bf;break;case"focusout":ye="blur",re=Bf;break;case"beforeblur":case"afterblur":re=Bf;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":re=ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=o_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=__;break;case Ng:case Cg:case Mg:re=f_;break;case Tg:re=E_;break;case"scroll":case"scrollend":re=l_;break;case"wheel":re=C_;break;case"copy":case"cut":case"paste":re=h_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=sg;break;case"toggle":case"beforetoggle":re=T_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var X=W,J;X!==null;){var se=X;if(J=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||J===null||Z===null||(se=Nl(X,Z),se!=null&&ke.push(as(X,se,J))),nt)break;X=X.return}0<ke.length&&(ee=new re(ee,ye,null,l,le),oe.push({event:ee,listeners:ke}))}}if((r&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",ee&&l!==zf&&(ye=l.relatedTarget||l.fromElement)&&(qi(ye)||ye[ci]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=l.relatedTarget||l.toElement,re=W,ye=ye?qi(ye):null,ye!==null&&(nt=o(ye),ke=ye.tag,ye!==nt||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=ag,se="onMouseLeave",Z="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=sg,se="onPointerLeave",Z="onPointerEnter",X="pointer"),nt=re==null?ee:Vi(re),J=ye==null?ee:Vi(ye),ee=new ke(se,X+"leave",re,l,le),ee.target=nt,ee.relatedTarget=J,se=null,qi(le)===W&&(ke=new ke(Z,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,se=ke),nt=se,re&&ye)t:{for(ke=Mk,Z=re,X=ye,J=0,se=Z;se;se=ke(se))J++;se=0;for(var ve=X;ve;ve=ke(ve))se++;for(;0<J-se;)Z=ke(Z),J--;for(;0<se-J;)X=ke(X),se--;for(;J--;){if(Z===X||X!==null&&Z===X.alternate){ke=Z;break t}Z=ke(Z),X=ke(X)}ke=null}else ke=null;re!==null&&Jy(oe,ee,re,ke,!1),ye!==null&&nt!==null&&Jy(oe,nt,ye,ke,!0)}}e:{if(ee=W?Vi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Fe=mg;else if(hg(ee))if(gg)Fe=U_;else{Fe=H_;var xe=L_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Af(W.elementType)&&(Fe=mg):Fe=B_;if(Fe&&(Fe=Fe(t,W))){pg(oe,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&El(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(hg(xe)||xe.contentEditable==="true")&&(ya=xe,Pf=W,Rl=null);break;case"focusout":Rl=Pf=ya=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,kg(oe,l,le);break;case"selectionchange":if(q_)break;case"keydown":case"keyup":kg(oe,l,le)}var ze;if(If)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ga?fg(t,l)&&(Ie="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ie="onCompositionStart");Ie&&(og&&l.locale!=="ko"&&(ga||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ga&&(ze=ig()):(Xi=le,Of="value"in Xi?Xi.value:Xi.textContent,ga=!0)),xe=Au(W,Ie),0<xe.length&&(Ie=new lg(Ie,t,null,l,le),oe.push({event:Ie,listeners:xe}),ze?Ie.data=ze:(ze=dg(l),ze!==null&&(Ie.data=ze)))),(ze=z_?j_(t,l):D_(t,l))&&(Ie=Au(W,"onBeforeInput"),0<Ie.length&&(xe=new lg("onBeforeInput","beforeinput",null,l,le),oe.push({event:xe,listeners:Ie}),xe.data=ze)),kk(oe,t,W,l,le)}Qy(oe,r)})}function as(t,r,l){return{instance:t,listener:r,currentTarget:l}}function Au(t,r){for(var l=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Nl(t,l),p!=null&&c.unshift(as(t,p,y)),p=Nl(t,r),p!=null&&c.push(as(t,p,y))),t.tag===3)return c;t=t.return}return[]}function Mk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Jy(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var M=l,I=M.alternate,W=M.stateNode;if(M=M.tag,I!==null&&I===c)break;M!==5&&M!==26&&M!==27||W===null||(I=W,p?(W=Nl(l,y),W!=null&&S.unshift(as(l,W,I))):p||(W=Nl(l,y),W!=null&&S.push(as(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var Tk=/\r\n?/g,Ak=/\u0000|\uFFFD/g;function Wy(t){return(typeof t=="string"?t:""+t).replace(Tk,`
|
|
9
|
+
`).replace(Ak,"")}function ex(t,r){return r=Wy(r),Wy(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ha(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ha(t,""+c);break;case"className":fa(t,"class",c);break;case"tabIndex":fa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,l,c);break;case"style":eg(t,c,y);break;case"data":if(r!=="object"){fa(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&tt(t,r,"name",p.name,p,null),tt(t,r,"formEncType",p.formEncType,p,null),tt(t,r,"formMethod",p.formMethod,p,null),tt(t,r,"formTarget",p.formTarget,p,null)):(tt(t,r,"encType",p.encType,p,null),tt(t,r,"method",p.method,p,null),tt(t,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Lo(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":He("beforetoggle",t),He("toggle",t),ca(t,"popover",c);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ca(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=r_.get(l)||l,ca(t,l,c))}}function gh(t,r,l,c,p,y){switch(l){case"style":eg(t,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ha(t,c):(typeof c=="number"||typeof c=="bigint")&&ha(t,""+c);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"onClick":c!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),y=t[Bt]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):ca(t,l,c)}}}function Rt(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",t),He("load",t);var c=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var S=l[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,y,S,l,null)}}p&&tt(t,r,"srcSet",l.srcSet,l,null),c&&tt(t,r,"src",l.src,l,null);return;case"input":He("invalid",t);var M=y=S=p=null,I=null,W=null;for(c in l)if(l.hasOwnProperty(c)){var le=l[c];if(le!=null)switch(c){case"name":p=le;break;case"type":S=le;break;case"checked":I=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Oo(t,y,M,I,W,S,p,!1);return;case"select":He("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:tt(t,r,p,M,l,null)}r=y,l=S,t.multiple=!!c,r!=null?di(t,!!c,r,!1):l!=null&&di(t,!!c,l,!0);return;case"textarea":He("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:tt(t,r,S,M,l,null)}Jm(t,c,p,y);return;case"option":for(I in l)l.hasOwnProperty(I)&&(c=l[I],c!=null)&&(I==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":tt(t,r,I,c,l,null));return;case"dialog":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case"iframe":case"object":He("load",t);break;case"video":case"audio":for(c=0;c<rs.length;c++)He(rs[c],t);break;case"image":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"embed":case"source":case"link":He("error",t),He("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(c=l[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,W,c,l,null)}return;default:if(Af(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&gh(t,r,le,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&tt(t,r,M,c,l,null))}function zk(t,r,l,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,M=null,I=null,W=null,le=null;for(re in l){var oe=l[re];if(l.hasOwnProperty(re)&&oe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=oe;default:c.hasOwnProperty(re)||tt(t,r,re,null,c,oe)}}for(var ee in c){var re=c[ee];if(oe=l[ee],c.hasOwnProperty(ee)&&(re!=null||oe!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":le=re;break;case"value":S=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:re!==oe&&tt(t,r,ee,re,c,oe)}}Cr(t,S,M,I,W,le,y,p);return;case"select":re=S=M=ee=null;for(y in l)if(I=l[y],l.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:c.hasOwnProperty(y)||tt(t,r,y,null,c,I)}for(p in c)if(y=c[p],I=l[p],c.hasOwnProperty(p)&&(y!=null||I!=null))switch(p){case"value":ee=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=M,l=S,c=re,ee!=null?di(t,!!l,ee,!1):!!c!=!!l&&(r!=null?di(t,!!l,r,!0):di(t,!!l,l?[]:"",!1));return;case"textarea":re=ee=null;for(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:tt(t,r,M,null,c,p)}for(S in c)if(p=c[S],y=l[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&tt(t,r,S,p,c,y)}Km(t,ee,re);return;case"option":for(var ye in l)ee=l[ye],l.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:tt(t,r,ye,null,c,ee));for(I in c)ee=c[I],re=l[I],c.hasOwnProperty(I)&&ee!==re&&(ee!=null||re!=null)&&(I==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":tt(t,r,I,ee,c,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in l)ee=l[ke],l.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&tt(t,r,ke,null,c,ee);for(W in c)if(ee=c[W],re=l[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:tt(t,r,W,ee,c,re)}return;default:if(Af(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&gh(t,r,nt,void 0,c,ee);for(le in c)ee=c[le],re=l[le],!c.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||gh(t,r,le,ee,c,re);return}}for(var Z in l)ee=l[Z],l.hasOwnProperty(Z)&&ee!=null&&!c.hasOwnProperty(Z)&&tt(t,r,Z,null,c,ee);for(oe in c)ee=c[oe],re=l[oe],!c.hasOwnProperty(oe)||ee===re||ee==null&&re==null||tt(t,r,oe,ee,c,re)}function tx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],y=p.transferSize,S=p.initiatorType,M=p.duration;if(y&&M&&tx(S)){for(S=0,M=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>M)break;var le=I.transferSize,oe=I.initiatorType;le&&tx(oe)&&(I=I.responseEnd,S+=le*(I<M?1:(M-W)/(I-W)))}if(--c,r+=8*(y+S)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var yh=null,xh=null;function zu(t){return t.nodeType===9?t:t.ownerDocument}function nx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ix(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function bh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var vh=null;function Dk(){var t=window.event;return t&&t.type==="popstate"?t===vh?!1:(vh=t,!0):(vh=null,!1)}var rx=typeof setTimeout=="function"?setTimeout:void 0,Rk=typeof clearTimeout=="function"?clearTimeout:void 0,ax=typeof Promise=="function"?Promise:void 0,Ok=typeof queueMicrotask=="function"?queueMicrotask:typeof ax<"u"?function(t){return ax.resolve(null).then(t).catch(Lk)}:rx;function Lk(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function lx(t,r){var l=r,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),Pa(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")ls(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,ls(l);for(var y=l.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Er]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&ls(t.ownerDocument.body);l=p}while(l);Pa(r)}function sx(t,r){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function wh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":wh(l),_l(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Hk(t,r,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Tn(t.nextSibling),t===null)break}return null}function Bk(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Tn(t.nextSibling),t===null))return null;return t}function ox(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Tn(t.nextSibling),t===null))return null;return t}function Sh(t){return t.data==="$?"||t.data==="$~"}function _h(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Uk(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var c=function(){r(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Tn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var kh=null;function ux(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Tn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function cx(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function fx(t,r,l){switch(r=zu(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function ls(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);_l(t)}var An=new Map,dx=new Set;function ju(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ti=U.d;U.d={f:Ik,r:qk,D:$k,C:Vk,L:Pk,m:Yk,X:Fk,S:Xk,M:Gk};function Ik(){var t=Ti.f(),r=_u();return t||r}function qk(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?T0(r):Ti.r(t)}var qa=typeof document>"u"?null:document;function hx(t,r,l){var c=qa;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),dx.has(p)||(dx.add(p),t={rel:t,crossOrigin:l,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function $k(t){Ti.D(t),hx("dns-prefetch",t,null)}function Vk(t,r){Ti.C(t,r),hx("preconnect",t,r)}function Pk(t,r,l){Ti.L(t,r,l);var c=qa;if(c&&t&&r){var p='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Qt(l.imageSizes)+'"]')):p+='[href="'+Qt(t)+'"]';var y=p;switch(r){case"style":y=$a(t);break;case"script":y=Va(t)}An.has(y)||(t=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),An.set(y,t),c.querySelector(p)!==null||r==="style"&&c.querySelector(ss(y))||r==="script"&&c.querySelector(os(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Yk(t,r){Ti.m(t,r);var l=qa;if(l&&t){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Qt(c)+'"][href="'+Qt(t)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Va(t)}if(!An.has(y)&&(t=m({rel:"modulepreload",href:t},r),An.set(y,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(os(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Xk(t,r,l){Ti.S(t,r,l);var c=qa;if(c&&t){var p=Pi(c).hoistableStyles,y=$a(t);r=r||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(ss(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&Eh(t,l);var I=S=c.createElement("link");yt(I),Rt(I,"link",t),I._p=new Promise(function(W,le){I.onload=W,I.onerror=le}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Du(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function Fk(t,r){Ti.X(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Gk(t,r){Ti.M(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function px(t,r,l,c){var p=(p=fe.current)?ju(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=$a(l.href),l=Pi(p).hoistableStyles,c=l.get(r),c||(c={type:"style",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$a(l.href);var y=Pi(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(ss(t)))&&!y._p&&(S.instance=y,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),y||Zk(p,t,l,S.state))),r&&c===null)throw Error(a(528,""));return S}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Va(l),l=Pi(p).hoistableScripts,c=l.get(r),c||(c={type:"script",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function $a(t){return'href="'+Qt(t)+'"'}function ss(t){return'link[rel="stylesheet"]['+t+"]"}function mx(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Zk(t,r,l,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Rt(r,"link",l),yt(r),t.head.appendChild(r))}function Va(t){return'[src="'+Qt(t)+'"]'}function os(t){return"script[async]"+t}function gx(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(c)return r.instance=c,yt(c),c;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),yt(c),Rt(c,"style",p),Du(c,l.precedence,t),r.instance=c;case"stylesheet":p=$a(l.href);var y=t.querySelector(ss(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=mx(l),(p=An.get(p))&&Eh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,Du(y,l.precedence,t),r.instance=y;case"script":return y=Va(l.src),(p=t.querySelector(os(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),Nh(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),yt(p),Rt(p,"link",c),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Du(c,l.precedence,t));return r.instance}function Du(t,r,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===r)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function Eh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Nh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Ru=null;function yx(t,r,l){if(Ru===null){var c=new Map,p=Ru=new Map;p.set(l,c)}else p=Ru,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[Er]||y[Nt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function xx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Qk(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function bx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Kk(t,r,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=$a(c.href),y=r.querySelector(ss(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Ou.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=mx(c),(p=An.get(p))&&Eh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Ou.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var Ch=0;function Jk(t,r){return t.stylesheets&&t.count===0&&Hu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Ch===0&&(Ch=62500*jk());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Ch?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lu=null;function Hu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,r.forEach(Wk,t),Lu=null,Ou.call(t))}function Wk(t,r){if(!(r.state.loading&4)){var l=Lu.get(t);if(l)var c=l.get(null);else{l=new Map,Lu.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),c=S)}c&&l.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),y=l.get(S)||c,y===c&&l.set(null,p),l.set(S,p),this.count++,c=Ou.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var us={$$typeof:k,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function eE(t,r,l,c,p,y,S,M,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vl(0),this.hiddenUpdates=vl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function vx(t,r,l,c,p,y,S,M,I,W,le,oe){return t=new eE(t,r,l,S,I,W,le,oe,M),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=ld(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},cd(y),t}function wx(t){return t?(t=va,t):va}function Sx(t,r,l,c,p,y){p=wx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ji(r),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Wi(t,c,r),l!==null&&(nn(l,t,r),ql(l,t,r))}function _x(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Mh(t,r){_x(t,r),(t=t.alternate)&&_x(t,r)}function kx(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Mh(t,67108864)}}function Ex(t){if(t.tag===13||t.tag===31){var r=mn();r=wl(r);var l=zr(t,r);l!==null&&nn(l,t,r),Mh(t,r)}}var Bu=!0;function tE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=2,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function nE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=8,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function Th(t,r,l,c){if(Bu){var p=Ah(c);if(p===null)mh(t,r,c,Uu,l),Cx(t,c);else if(rE(p,t,r,l,c))c.stopPropagation();else if(Cx(t,c),r&4&&-1<iE.indexOf(t)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ui(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ke(S);M.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(wu=Et()+500,is(0))}}break;case 31:case 13:M=zr(y,2),M!==null&&nn(M,y,2),_u(),Mh(y,2)}if(y=Ah(c),y===null&&mh(t,r,c,Uu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else mh(t,r,c,null,l)}}function Ah(t){return t=jf(t),zh(t)}var Uu=null;function zh(t){if(Uu=null,t=qi(t),t!==null){var r=o(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=u(r),t!==null)return t;t=null}else if(l===31){if(t=f(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Uu=t,null}function Nx(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ii()){case ae:return 2;case pe:return 8;case _e:case De:return 32;case $e:return 268435456;default:return 32}default:return 32}}var jh=!1,cr=null,fr=null,dr=null,cs=new Map,fs=new Map,hr=[],iE="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".split(" ");function Cx(t,r){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":cs.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(r.pointerId)}}function ds(t,r,l,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:l,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=$i(r),r!==null&&kx(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function rE(t,r,l,c,p){switch(r){case"focusin":return cr=ds(cr,t,r,l,c,p),!0;case"dragenter":return fr=ds(fr,t,r,l,c,p),!0;case"mouseover":return dr=ds(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return cs.set(y,ds(cs.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,fs.set(y,ds(fs.get(y)||null,t,r,l,c,p)),!0}return!1}function Mx(t){var r=qi(t.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){t.blockedOn=r,Co(t.priority,function(){Ex(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Co(t.priority,function(){Ex(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Iu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=Ah(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);zf=c,l.target.dispatchEvent(c),zf=null}else return r=$i(l),r!==null&&kx(r),t.blockedOn=l,!1;r.shift()}return!0}function Tx(t,r,l){Iu(t)&&l.delete(r)}function aE(){jh=!1,cr!==null&&Iu(cr)&&(cr=null),fr!==null&&Iu(fr)&&(fr=null),dr!==null&&Iu(dr)&&(dr=null),cs.forEach(Tx),fs.forEach(Tx)}function qu(t,r){t.blockedOn===r&&(t.blockedOn=null,jh||(jh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aE)))}var $u=null;function Ax(t){$u!==t&&($u=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$u===t&&($u=null);for(var r=0;r<t.length;r+=3){var l=t[r],c=t[r+1],p=t[r+2];if(typeof c!="function"){if(zh(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,Ad(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Pa(t){function r(I){return qu(I,t)}cr!==null&&qu(cr,t),fr!==null&&qu(fr,t),dr!==null&&qu(dr,t),cs.forEach(r),fs.forEach(r);for(var l=0;l<hr.length;l++){var c=hr[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<hr.length&&(l=hr[0],l.blockedOn===null);)Mx(l),l.blockedOn===null&&hr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],y=l[c+1],S=p[Bt]||null;if(typeof y=="function")S||Ax(l);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)M=S.formAction;else if(zh(p)!==null)continue}else M=S.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),Ax(l)}}}function zx(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Dh(t){this._internalRoot=t}Vu.prototype.render=Dh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();Sx(l,c,t,r,null,null)},Vu.prototype.unmount=Dh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Sx(t.current,2,null,t,null,null),_u(),r[ci]=null}};function Vu(t){this._internalRoot=t}Vu.prototype.unstable_scheduleHydration=function(t){if(t){var r=No();t={blockedOn:null,target:t,priority:r};for(var l=0;l<hr.length&&r!==0&&r<hr[l].priority;l++);hr.splice(l,0,t),l===0&&Mx(t)}};var jx=n.version;if(jx!=="19.2.3")throw Error(a(527,jx,"19.2.3"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var lE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pu.isDisabled&&Pu.supportsFiber)try{At=Pu.inject(lE),pt=Pu}catch{}}return ps.createRoot=function(t,r){if(!s(t))throw Error(a(299));var l=!1,c="",p=U0,y=I0,S=q0;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=vx(t,1,!1,null,null,l,c,null,p,y,S,zx),t[ci]=r.current,ph(t),new Dh(r)},ps.hydrateRoot=function(t,r,l){if(!s(t))throw Error(a(299));var c=!1,p="",y=U0,S=I0,M=q0,I=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=vx(t,1,!0,r,l??null,c,p,I,y,S,M,zx),r.context=wx(null),l=r.current,c=mn(),c=wl(c),p=Ji(c),p.callback=null,Wi(l,p,c),l=c,r.current.lanes=l,kr(r,l),Wn(r),t[ci]=r.current,ph(t),new Vu(r)},ps.version="19.2.3",ps}var $x;function mE(){if($x)return Lh.exports;$x=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(n){console.error(n)}}return e(),Lh.exports=pE(),Lh.exports}var gE=mE();function _t(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,a;i<e.length;i++)(a=_t(e[i]))!==""&&(n+=(n&&" ")+a);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var yE={value:()=>{}};function Gc(){for(var e=0,n=arguments.length,i={},a;e<n;++e){if(!(a=arguments[e]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new wc(i)}function wc(e){this._=e}function xE(e,n){return e.trim().split(/^|\s+/).map(function(i){var a="",s=i.indexOf(".");if(s>=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}wc.prototype=Gc.prototype={constructor:wc,on:function(e,n){var i=this._,a=xE(e+"",i),s,o=-1,u=a.length;if(arguments.length<2){for(;++o<u;)if((s=(e=a[o]).type)&&(s=bE(i[s],e.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<u;)if(s=(e=a[o]).type)i[s]=Vx(i[s],e.name,n);else if(n==null)for(s in i)i[s]=Vx(i[s],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new wc(e)},call:function(e,n){if((s=arguments.length-2)>0)for(var i=new Array(s),a=0,s,o;a<s;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],a=0,s=o.length;a<s;++a)o[a].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(n,i)}};function bE(e,n){for(var i=0,a=e.length,s;i<a;++i)if((s=e[i]).name===n)return s.value}function Vx(e,n,i){for(var a=0,s=e.length;a<s;++a)if(e[a].name===n){e[a]=yE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var Ep="http://www.w3.org/1999/xhtml";const Px={svg:"http://www.w3.org/2000/svg",xhtml:Ep,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Px.hasOwnProperty(n)?{space:Px[n],local:e}:e}function vE(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Ep&&n.documentElement.namespaceURI===Ep?n.createElement(e):n.createElementNS(i,e)}}function wE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mv(e){var n=Zc(e);return(n.local?wE:vE)(n)}function SE(){}function am(e){return e==null?SE:function(){return this.querySelector(e)}}function _E(e){typeof e!="function"&&(e=am(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=new Array(u),h,d,g=0;g<u;++g)(h=o[g])&&(d=e.call(h,h.__data__,g,o))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new Sn(a,this._parents)}function kE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EE(){return[]}function gv(e){return e==null?EE:function(){return this.querySelectorAll(e)}}function NE(e){return function(){return kE(e.apply(this,arguments))}}function CE(e){typeof e=="function"?e=NE(e):e=gv(e);for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var u=n[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),s.push(h));return new Sn(a,s)}function yv(e){return function(){return this.matches(e)}}function xv(e){return function(n){return n.matches(e)}}var ME=Array.prototype.find;function TE(e){return function(){return ME.call(this.children,e)}}function AE(){return this.firstElementChild}function zE(e){return this.select(e==null?AE:TE(typeof e=="function"?e:xv(e)))}var jE=Array.prototype.filter;function DE(){return Array.from(this.children)}function RE(e){return function(){return jE.call(this.children,e)}}function OE(e){return this.selectAll(e==null?DE:RE(typeof e=="function"?e:xv(e)))}function LE(e){typeof e!="function"&&(e=yv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Sn(a,this._parents)}function bv(e){return new Array(e.length)}function HE(){return new Sn(this._enter||this._groups.map(bv),this._parents)}function Tc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Tc.prototype={constructor:Tc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function BE(e){return function(){return e}}function UE(e,n,i,a,s,o){for(var u=0,f,h=n.length,d=o.length;u<d;++u)(f=n[u])?(f.__data__=o[u],a[u]=f):i[u]=new Tc(e,o[u]);for(;u<h;++u)(f=n[u])&&(s[u]=f)}function IE(e,n,i,a,s,o,u){var f,h,d=new Map,g=n.length,m=o.length,x=new Array(g),b;for(f=0;f<g;++f)(h=n[f])&&(x[f]=b=u.call(h,h.__data__,f,n)+"",d.has(b)?s[f]=h:d.set(b,h));for(f=0;f<m;++f)b=u.call(e,o[f],f,o)+"",(h=d.get(b))?(a[f]=h,h.__data__=o[f],d.delete(b)):i[f]=new Tc(e,o[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(s[f]=h)}function qE(e){return e.__data__}function $E(e,n){if(!arguments.length)return Array.from(this,qE);var i=n?IE:UE,a=this._parents,s=this._groups;typeof e!="function"&&(e=BE(e));for(var o=s.length,u=new Array(o),f=new Array(o),h=new Array(o),d=0;d<o;++d){var g=a[d],m=s[d],x=m.length,b=VE(e.call(g,g&&g.__data__,d,a)),w=b.length,E=f[d]=new Array(w),N=u[d]=new Array(w),_=h[d]=new Array(x);i(g,m,E,N,_,b,n);for(var D=0,k=0,C,L;D<w;++D)if(C=E[D]){for(D>=k&&(k=D+1);!(L=N[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function VE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PE(){return new Sn(this._exit||this._groups.map(bv),this._parents)}function YE(e,n,i){var a=this.enter(),s=this,o=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(s=n(s),s&&(s=s.selection())),i==null?o.remove():i(o),a&&s?a.merge(s).order():s}function XE(e){for(var n=e.selection?e.selection():e,i=this._groups,a=n._groups,s=i.length,o=a.length,u=Math.min(s,o),f=new Array(s),h=0;h<u;++h)for(var d=i[h],g=a[h],m=d.length,x=f[h]=new Array(m),b,w=0;w<m;++w)(b=d[w]||g[w])&&(x[w]=b);for(;h<s;++h)f[h]=i[h];return new Sn(f,this._parents)}function FE(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var a=e[n],s=a.length-1,o=a[s],u;--s>=0;)(u=a[s])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}function GE(e){e||(e=ZE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,a=i.length,s=new Array(a),o=0;o<a;++o){for(var u=i[o],f=u.length,h=s[o]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(n)}return new Sn(s,this._parents).order()}function ZE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function QE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function KE(){return Array.from(this)}function JE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length;s<o;++s){var u=a[s];if(u)return u}return null}function WE(){let e=0;for(const n of this)++e;return e}function eN(){return!this.node()}function tN(e){for(var n=this._groups,i=0,a=n.length;i<a;++i)for(var s=n[i],o=0,u=s.length,f;o<u;++o)(f=s[o])&&e.call(f,f.__data__,o,s);return this}function nN(e){return function(){this.removeAttribute(e)}}function iN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rN(e,n){return function(){this.setAttribute(e,n)}}function aN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function lN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function sN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function oN(e,n){var i=Zc(e);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((n==null?i.local?iN:nN:typeof n=="function"?i.local?sN:lN:i.local?aN:rN)(i,n))}function vv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uN(e){return function(){this.style.removeProperty(e)}}function cN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function fN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function dN(e,n,i){return arguments.length>1?this.each((n==null?uN:typeof n=="function"?fN:cN)(e,n,i??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||vv(e).getComputedStyle(e,null).getPropertyValue(n)}function hN(e){return function(){delete this[e]}}function pN(e,n){return function(){this[e]=n}}function mN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function gN(e,n){return arguments.length>1?this.each((n==null?hN:typeof n=="function"?mN:pN)(e,n)):this.node()[e]}function wv(e){return e.trim().split(/^|\s+/)}function lm(e){return e.classList||new Sv(e)}function Sv(e){this._node=e,this._names=wv(e.getAttribute("class")||"")}Sv.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function _v(e,n){for(var i=lm(e),a=-1,s=n.length;++a<s;)i.add(n[a])}function kv(e,n){for(var i=lm(e),a=-1,s=n.length;++a<s;)i.remove(n[a])}function yN(e){return function(){_v(this,e)}}function xN(e){return function(){kv(this,e)}}function bN(e,n){return function(){(n.apply(this,arguments)?_v:kv)(this,e)}}function vN(e,n){var i=wv(e+"");if(arguments.length<2){for(var a=lm(this.node()),s=-1,o=i.length;++s<o;)if(!a.contains(i[s]))return!1;return!0}return this.each((typeof n=="function"?bN:n?yN:xN)(i,n))}function wN(){this.textContent=""}function SN(e){return function(){this.textContent=e}}function _N(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function kN(e){return arguments.length?this.each(e==null?wN:(typeof e=="function"?_N:SN)(e)):this.node().textContent}function EN(){this.innerHTML=""}function NN(e){return function(){this.innerHTML=e}}function CN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function MN(e){return arguments.length?this.each(e==null?EN:(typeof e=="function"?CN:NN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function AN(){return this.each(TN)}function zN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jN(){return this.each(zN)}function DN(e){var n=typeof e=="function"?e:mv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function RN(){return null}function ON(e,n){var i=typeof e=="function"?e:mv(e),a=n==null?RN:typeof n=="function"?n:am(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function LN(){var e=this.parentNode;e&&e.removeChild(this)}function HN(){return this.each(LN)}function BN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function UN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function IN(e){return this.select(e?UN:BN)}function qN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $N(e){return function(n){e.call(this,n,this.__data__)}}function VN(e){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");return a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),{type:n,name:i}})}function PN(e){return function(){var n=this.__on;if(n){for(var i=0,a=-1,s=n.length,o;i<s;++i)o=n[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++a]=o;++a?n.length=a:delete this.__on}}}function YN(e,n,i){return function(){var a=this.__on,s,o=$N(n);if(a){for(var u=0,f=a.length;u<f;++u)if((s=a[u]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=i),s.value=n;return}}this.addEventListener(e.type,o,i),s={type:e.type,name:e.name,value:n,listener:o,options:i},a?a.push(s):this.__on=[s]}}function XN(e,n,i){var a=VN(e+""),s,o=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(s=0,g=f[h];s<o;++s)if((u=a[s]).type===g.type&&u.name===g.name)return g.value}return}for(f=n?YN:PN,s=0;s<o;++s)this.each(f(a[s],n,i));return this}function Ev(e,n,i){var a=vv(e),s=a.CustomEvent;typeof s=="function"?s=new s(n,i):(s=a.document.createEvent("Event"),i?(s.initEvent(n,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(n,!1,!1)),e.dispatchEvent(s)}function FN(e,n){return function(){return Ev(this,e,n)}}function GN(e,n){return function(){return Ev(this,e,n.apply(this,arguments))}}function ZN(e,n){return this.each((typeof n=="function"?GN:FN)(e,n))}function*QN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length,u;s<o;++s)(u=a[s])&&(yield u)}var Nv=[null];function Sn(e,n){this._groups=e,this._parents=n}function lo(){return new Sn([[document.documentElement]],Nv)}function KN(){return this}Sn.prototype=lo.prototype={constructor:Sn,select:_E,selectAll:CE,selectChild:zE,selectChildren:OE,filter:LE,data:$E,enter:HE,exit:PE,join:YE,merge:XE,selection:KN,order:FE,sort:GE,call:QE,nodes:KE,node:JE,size:WE,empty:eN,each:tN,attr:oN,style:dN,property:gN,classed:vN,text:kN,html:MN,raise:AN,lower:jN,append:DN,insert:ON,remove:HN,clone:IN,datum:qN,on:XN,dispatch:ZN,[Symbol.iterator]:QN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Nv)}function JN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=JN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var s=n.getBoundingClientRect();return[e.clientX-s.left-n.clientLeft,e.clientY-s.top-n.clientTop]}}return[e.pageX,e.pageY]}const WN={passive:!1},Xs={capture:!0,passive:!1};function Ih(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function Cv(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",tl,Xs);"onselectstart"in n?i.on("selectstart.drag",tl,Xs):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Mv(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",tl,Xs),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Yu=e=>()=>e;function Np(e,{sourceEvent:n,subject:i,target:a,identifier:s,active:o,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}Np.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eC(e){return!e.ctrlKey&&!e.button}function tC(){return this.parentNode}function nC(e,n){return n??{x:e.x,y:e.y}}function iC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tv(){var e=eC,n=tC,i=nC,a=iC,s={},o=Gc("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",N).on("touchmove.drag",_,WN).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,L){if(!(g||!e.call(this,C,L))){var A=k(this,n.call(this,C,L),C,L,"mouse");A&&(vn(C.view).on("mousemove.drag",w,Xs).on("mouseup.drag",E,Xs),Cv(C.view),Ih(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(tl(C),!d){var L=C.clientX-f,A=C.clientY-h;d=L*L+A*A>m}s.mouse("drag",C)}function E(C){vn(C.view).on("mousemove.drag mouseup.drag",null),Mv(C.view,d),tl(C),s.mouse("end",C)}function N(C,L){if(e.call(this,C,L)){var A=C.changedTouches,H=n.call(this,C,L),F=A.length,G,q;for(G=0;G<F;++G)(q=k(this,H,C,L,A[G].identifier,A[G]))&&(Ih(C),q("start",C,A[G]))}}function _(C){var L=C.changedTouches,A=L.length,H,F;for(H=0;H<A;++H)(F=s[L[H].identifier])&&(tl(C),F("drag",C,L[H]))}function D(C){var L=C.changedTouches,A=L.length,H,F;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<A;++H)(F=s[L[H].identifier])&&(Ih(C),F("end",C,L[H]))}function k(C,L,A,H,F,G){var q=o.copy(),V=In(G||A,L),P,te,O;if((O=i.call(C,new Np("beforestart",{sourceEvent:A,target:x,identifier:F,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:q}),H))!=null)return P=O.x-V[0]||0,te=O.y-V[1]||0,function B(j,U,Y){var K=V,z;switch(j){case"start":s[F]=B,z=u++;break;case"end":delete s[F],--u;case"drag":V=In(Y||U,L),z=u;break}q.call(j,C,new Np(j,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+P,y:V[1]+te,dx:V[0]-K[0],dy:V[1]-K[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Yu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Yu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Yu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Yu(!!C),x):a},x.on=function(){var C=o.on.apply(o,arguments);return C===o?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function sm(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Av(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function so(){}var Fs=.7,Ac=1/Fs,nl="\\s*([+-]?\\d+)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rC=/^#([0-9a-f]{3,8})$/,aC=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),lC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),sC=new RegExp(`^rgba\\(${nl},${nl},${nl},${Gs}\\)$`),oC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Gs}\\)$`),uC=new RegExp(`^hsl\\(${Gs},${ii},${ii}\\)$`),cC=new RegExp(`^hsla\\(${Gs},${ii},${ii},${Gs}\\)$`),Yx={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};sm(so,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xx,formatHex:Xx,formatHex8:fC,formatHsl:dC,formatRgb:Fx,toString:Fx});function Xx(){return this.rgb().formatHex()}function fC(){return this.rgb().formatHex8()}function dC(){return zv(this).formatHsl()}function Fx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=rC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Gx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Xu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Xu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=aC.exec(e))?new an(n[1],n[2],n[3],1):(n=lC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=sC.exec(e))?Xu(n[1],n[2],n[3],n[4]):(n=oC.exec(e))?Xu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=uC.exec(e))?Kx(n[1],n[2]/100,n[3]/100,1):(n=cC.exec(e))?Kx(n[1],n[2]/100,n[3]/100,n[4]):Yx.hasOwnProperty(e)?Gx(Yx[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Gx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Xu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function hC(e){return e instanceof so||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Cp(e,n,i,a){return arguments.length===1?hC(e):new an(e,n,i,a??1)}function an(e,n,i,a){this.r=+e,this.g=+n,this.b=+i,this.opacity=+a}sm(an,Cp,Av(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Kr(this.r),Kr(this.g),Kr(this.b),zc(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:Zx,formatHex:Zx,formatHex8:pC,formatRgb:Qx,toString:Qx}));function Zx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function pC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qx(){const e=zc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function zc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function Kx(e,n,i,a){return a<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,i,a)}function zv(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof so||(e=Wr(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,a=e.b/255,s=Math.min(n,i,a),o=Math.max(n,i,a),u=NaN,f=o-s,h=(o+s)/2;return f?(n===o?u=(i-a)/f+(i<a)*6:i===o?u=(a-n)/f+2:u=(n-i)/f+4,f/=h<.5?o+s:2-o-s,u*=60):f=h>0&&h<1?0:u,new qn(u,f,h,e.opacity)}function mC(e,n,i,a){return arguments.length===1?zv(e):new qn(e,n,i,a??1)}function qn(e,n,i,a){this.h=+e,this.s=+n,this.l=+i,this.opacity=+a}sm(qn,mC,Av(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*n,s=2*i-a;return new an(qh(e>=240?e-240:e+120,s,a),qh(e,s,a),qh(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new qn(Jx(this.h),Fu(this.s),Fu(this.l),zc(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=zc(this.opacity);return`${e===1?"hsl(":"hsla("}${Jx(this.h)}, ${Fu(this.s)*100}%, ${Fu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jx(e){return e=(e||0)%360,e<0?e+360:e}function Fu(e){return Math.max(0,Math.min(1,e||0))}function qh(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const om=e=>()=>e;function gC(e,n){return function(i){return e+i*n}}function yC(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(a){return Math.pow(e+a*n,i)}}function xC(e){return(e=+e)==1?jv:function(n,i){return i-n?yC(n,i,e):om(isNaN(n)?i:n)}}function jv(e,n){var i=n-e;return i?gC(e,i):om(isNaN(e)?n:e)}const jc=(function e(n){var i=xC(n);function a(s,o){var u=i((s=Cp(s)).r,(o=Cp(o)).r),f=i(s.g,o.g),h=i(s.b,o.b),d=jv(s.opacity,o.opacity);return function(g){return s.r=u(g),s.g=f(g),s.b=h(g),s.opacity=d(g),s+""}}return a.gamma=e,a})(1);function bC(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,a=n.slice(),s;return function(o){for(s=0;s<i;++s)a[s]=e[s]*(1-o)+n[s]*o;return a}}function vC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wC(e,n){var i=n?n.length:0,a=e?Math.min(i,e.length):0,s=new Array(a),o=new Array(i),u;for(u=0;u<a;++u)s[u]=qs(e[u],n[u]);for(;u<i;++u)o[u]=n[u];return function(f){for(u=0;u<a;++u)o[u]=s[u](f);return o}}function SC(e,n){var i=new Date;return e=+e,n=+n,function(a){return i.setTime(e*(1-a)+n*a),i}}function ti(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function _C(e,n){var i={},a={},s;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(s in n)s in e?i[s]=qs(e[s],n[s]):a[s]=n[s];return function(o){for(s in i)a[s]=i[s](o);return a}}var Mp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$h=new RegExp(Mp.source,"g");function kC(e){return function(){return e}}function EC(e){return function(n){return e(n)+""}}function Dv(e,n){var i=Mp.lastIndex=$h.lastIndex=0,a,s,o,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Mp.exec(e))&&(s=$h.exec(n));)(o=s.index)>i&&(o=n.slice(i,o),f[u]?f[u]+=o:f[++u]=o),(a=a[0])===(s=s[0])?f[u]?f[u]+=s:f[++u]=s:(f[++u]=null,h.push({i:u,x:ti(a,s)})),i=$h.lastIndex;return i<n.length&&(o=n.slice(i),f[u]?f[u]+=o:f[++u]=o),f.length<2?h[0]?EC(h[0].x):kC(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function qs(e,n){var i=typeof n,a;return n==null||i==="boolean"?om(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,jc):Dv:n instanceof Wr?jc:n instanceof Date?SC:vC(n)?bC:Array.isArray(n)?wC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?_C:ti)(e,n)}var Wx=180/Math.PI,Tp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rv(e,n,i,a,s,o){var u,f,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*i+n*a)&&(i-=e*h,a-=n*h),(f=Math.sqrt(i*i+a*a))&&(i/=f,a/=f,h/=f),e*a<n*i&&(e=-e,n=-n,h=-h,u=-u),{translateX:s,translateY:o,rotate:Math.atan2(n,e)*Wx,skewX:Math.atan(h)*Wx,scaleX:u,scaleY:f}}var Gu;function NC(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Tp:Rv(n.a,n.b,n.c,n.d,n.e,n.f)}function CC(e){return e==null||(Gu||(Gu=document.createElementNS("http://www.w3.org/2000/svg","g")),Gu.setAttribute("transform",e),!(e=Gu.transform.baseVal.consolidate()))?Tp:(e=e.matrix,Rv(e.a,e.b,e.c,e.d,e.e,e.f))}function Ov(e,n,i,a){function s(d){return d.length?d.pop()+" ":""}function o(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push("translate(",null,n,null,i);w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m||x)&&b.push("translate("+m+n+x+i)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(s(m)+"rotate(",null,a)-2,x:ti(d,g)})):g&&m.push(s(m)+"rotate("+g+a)}function f(d,g,m,x){d!==g?x.push({i:m.push(s(m)+"skewX(",null,a)-2,x:ti(d,g)}):g&&m.push(s(m)+"skewX("+g+a)}function h(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push(s(b)+"scale(",null,",",null,")");w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m!==1||x!==1)&&b.push(s(b)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),o(d.translateX,d.translateY,g.translateX,g.translateY,m,x),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(b){for(var w=-1,E=x.length,N;++w<E;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var MC=Ov(NC,"px, ","px)","deg)"),TC=Ov(CC,", ",")",")"),AC=1e-12;function eb(e){return((e=Math.exp(e))+1/e)/2}function zC(e){return((e=Math.exp(e))-1/e)/2}function jC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Sc=(function e(n,i,a){function s(o,u){var f=o[0],h=o[1],d=o[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-h,E=b*b+w*w,N,_;if(E<AC)_=Math.log(x/d)/n,N=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var D=Math.sqrt(E),k=(x*x-d*d+a*E)/(2*d*i*D),C=(x*x-d*d-a*E)/(2*x*i*D),L=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/n,N=function(H){var F=H*_,G=eb(L),q=d/(i*D)*(G*jC(n*F+L)-zC(L));return[f+q*b,h+q*w,d*G/eb(n*F+L)]}}return N.duration=_*1e3*n/Math.SQRT2,N}return s.rho=function(o){var u=Math.max(.001,+o),f=u*u,h=f*f;return e(u,f,h)},s})(Math.SQRT2,2,4);var ol=0,Hs=0,ms=0,Lv=1e3,Dc,Bs,Rc=0,ea=0,Qc=0,Zs=typeof performance=="object"&&performance.now?performance:Date,Hv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function um(){return ea||(Hv(DC),ea=Zs.now()+Qc)}function DC(){ea=0}function Oc(){this._call=this._time=this._next=null}Oc.prototype=Bv.prototype={constructor:Oc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?um():+i)+(n==null?0:+n),!this._next&&Bs!==this&&(Bs?Bs._next=this:Dc=this,Bs=this),this._call=e,this._time=i,Ap()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ap())}};function Bv(e,n,i){var a=new Oc;return a.restart(e,n,i),a}function RC(){um(),++ol;for(var e=Dc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ol}function tb(){ea=(Rc=Zs.now())+Qc,ol=Hs=0;try{RC()}finally{ol=0,LC(),ea=0}}function OC(){var e=Zs.now(),n=e-Rc;n>Lv&&(Qc-=n,Rc=e)}function LC(){for(var e,n=Dc,i,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Dc=i);Bs=e,Ap(a)}function Ap(e){if(!ol){Hs&&(Hs=clearTimeout(Hs));var n=e-ea;n>24?(e<1/0&&(Hs=setTimeout(tb,e-Zs.now()-Qc)),ms&&(ms=clearInterval(ms))):(ms||(Rc=Zs.now(),ms=setInterval(OC,Lv)),ol=1,Hv(tb))}}function nb(e,n,i){var a=new Oc;return n=n==null?0:+n,a.restart(s=>{a.stop(),e(s+n)},n,i),a}var HC=Gc("start","end","cancel","interrupt"),BC=[],Uv=0,ib=1,zp=2,_c=3,rb=4,jp=5,kc=6;function Kc(e,n,i,a,s,o){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;UC(e,i,{name:n,index:a,group:s,on:HC,tween:BC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Uv})}function cm(e,n){var i=Xn(e,n);if(i.state>Uv)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>_c)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function UC(e,n,i){var a=e.__transition,s;a[n]=i,i.timer=Bv(o,0,i.time);function o(d){i.state=ib,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,m,x,b;if(i.state!==ib)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===_c)return nb(u);b.state===rb?(b.state=kc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=kc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(nb(function(){i.state===_c&&(i.state=rb,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=zp,i.on.call("start",e,e.__data__,i.index,i.group),i.state===zp){for(i.state=_c,s=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(b=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(s[++m]=b);s.length=m+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=jp,1),m=-1,x=s.length;++m<x;)s[m].call(e,g);i.state===jp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=kc,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function Ec(e,n){var i=e.__transition,a,s,o=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((a=i[u]).name!==n){o=!1;continue}s=a.state>zp&&a.state<jp,a.state=kc,a.timer.stop(),a.on.call(s?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}o&&delete e.__transition}}function IC(e){return this.each(function(){Ec(this,e)})}function qC(e,n){var i,a;return function(){var s=ai(this,e),o=s.tween;if(o!==i){a=i=o;for(var u=0,f=a.length;u<f;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}s.tween=a}}function $C(e,n,i){var a,s;if(typeof i!="function")throw new Error;return function(){var o=ai(this,e),u=o.tween;if(u!==a){s=(a=u).slice();for(var f={name:n,value:i},h=0,d=s.length;h<d;++h)if(s[h].name===n){s[h]=f;break}h===d&&s.push(f)}o.tween=s}}function VC(e,n){var i=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),i).tween,s=0,o=a.length,u;s<o;++s)if((u=a[s]).name===e)return u.value;return null}return this.each((n==null?qC:$C)(i,e,n))}function fm(e,n,i){var a=e._id;return e.each(function(){var s=ai(this,a);(s.value||(s.value={}))[n]=i.apply(this,arguments)}),function(s){return Xn(s,a).value[n]}}function Iv(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?jc:(i=Wr(n))?(n=i,jc):Dv)(e,n)}function PC(e){return function(){this.removeAttribute(e)}}function YC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttribute(e);return u===s?null:u===a?o:o=n(a=u,i)}}function FC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttributeNS(e.space,e.local);return u===s?null:u===a?o:o=n(a=u,i)}}function GC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function ZC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function QC(e,n){var i=Zc(e),a=i==="transform"?TC:Iv;return this.attrTween(e,typeof n=="function"?(i.local?ZC:GC)(i,a,fm(this,"attr."+e,n)):n==null?(i.local?YC:PC)(i):(i.local?FC:XC)(i,a,n))}function KC(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function JC(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function WC(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&JC(e,o)),i}return s._value=n,s}function e4(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&KC(e,o)),i}return s._value=n,s}function t4(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var a=Zc(e);return this.tween(i,(a.local?WC:e4)(a,n))}function n4(e,n){return function(){cm(this,e).delay=+n.apply(this,arguments)}}function i4(e,n){return n=+n,function(){cm(this,e).delay=n}}function r4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?n4:i4)(n,e)):Xn(this.node(),n).delay}function a4(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function l4(e,n){return n=+n,function(){ai(this,e).duration=n}}function s4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?a4:l4)(n,e)):Xn(this.node(),n).duration}function o4(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function u4(e){var n=this._id;return arguments.length?this.each(o4(n,e)):Xn(this.node(),n).ease}function c4(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function f4(e){if(typeof e!="function")throw new Error;return this.each(c4(this._id,e))}function d4(e){typeof e!="function"&&(e=yv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Li(a,this._parents,this._name,this._id)}function h4(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,a=n.length,s=i.length,o=Math.min(a,s),u=new Array(a),f=0;f<o;++f)for(var h=n[f],d=i[f],g=h.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=h[b]||d[b])&&(m[b]=x);for(;f<a;++f)u[f]=n[f];return new Li(u,this._parents,this._name,this._id)}function p4(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function m4(e,n,i){var a,s,o=p4(n)?cm:ai;return function(){var u=o(this,e),f=u.on;f!==a&&(s=(a=f).copy()).on(n,i),u.on=s}}function g4(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(m4(i,e,n))}function y4(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function x4(){return this.on("end.remove",y4(this._id))}function b4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=am(e));for(var a=this._groups,s=a.length,o=new Array(s),u=0;u<s;++u)for(var f=a[u],h=f.length,d=o[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Kc(d[x],n,i,x,d,Xn(g,i)));return new Li(o,this._parents,n,i)}function v4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=gv(e));for(var a=this._groups,s=a.length,o=[],u=[],f=0;f<s;++f)for(var h=a[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),b,w=Xn(g,i),E=0,N=x.length;E<N;++E)(b=x[E])&&Kc(b,n,i,E,x,w);o.push(x),u.push(g)}return new Li(o,u,n,i)}var w4=lo.prototype.constructor;function S4(){return new w4(this._groups,this._parents)}function _4(e,n){var i,a,s;return function(){var o=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return o===u?null:o===i&&u===a?s:s=n(i=o,a=u)}}function qv(e){return function(){this.style.removeProperty(e)}}function k4(e,n,i){var a,s=i+"",o;return function(){var u=sl(this,e);return u===s?null:u===a?o:o=n(a=u,i)}}function E4(e,n,i){var a,s,o;return function(){var u=sl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f))}}function N4(e,n){var i,a,s,o="style."+n,u="end."+o,f;return function(){var h=ai(this,e),d=h.on,g=h.value[o]==null?f||(f=qv(n)):void 0;(d!==i||s!==g)&&(a=(i=d).copy()).on(u,s=g),h.on=a}}function C4(e,n,i){var a=(e+="")=="transform"?MC:Iv;return n==null?this.styleTween(e,_4(e,a)).on("end.style."+e,qv(e)):typeof n=="function"?this.styleTween(e,E4(e,a,fm(this,"style."+e,n))).each(N4(this._id,e)):this.styleTween(e,k4(e,a,n),i).on("end.style."+e,null)}function M4(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function T4(e,n,i){var a,s;function o(){var u=n.apply(this,arguments);return u!==s&&(a=(s=u)&&M4(e,u,i)),a}return o._value=n,o}function A4(e,n,i){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,T4(e,n,i??""))}function z4(e){return function(){this.textContent=e}}function j4(e){return function(){var n=e(this);this.textContent=n??""}}function D4(e){return this.tween("text",typeof e=="function"?j4(fm(this,"text",e)):z4(e==null?"":e+""))}function R4(e){return function(n){this.textContent=e.call(this,n)}}function O4(e){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&R4(s)),n}return a._value=e,a}function L4(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,O4(e))}function H4(){for(var e=this._name,n=this._id,i=$v(),a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Xn(h,n);Kc(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Li(a,this._parents,e,i)}function B4(){var e,n,i=this,a=i._id,s=i.size();return new Promise(function(o,u){var f={value:u},h={value:function(){--s===0&&o()}};i.each(function(){var d=ai(this,a),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),s===0&&o()})}var U4=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function $v(){return++U4}var Ai=lo.prototype;Li.prototype={constructor:Li,select:b4,selectAll:v4,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:d4,merge:h4,selection:S4,transition:H4,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:g4,attr:QC,attrTween:t4,style:C4,styleTween:A4,text:D4,textTween:L4,remove:x4,tween:VC,delay:r4,duration:s4,ease:u4,easeVarying:f4,end:B4,[Symbol.iterator]:Ai[Symbol.iterator]};function I4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var q4={time:null,delay:0,duration:250,ease:I4};function $4(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function V4(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=$v(),(i=q4).time=um(),e=e==null?null:e+"");for(var a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Kc(h,e,n,d,u,i||$4(h,n));return new Li(a,this._parents,e,n)}lo.prototype.interrupt=IC;lo.prototype.transition=V4;const Zu=e=>()=>e;function P4(e,{sourceEvent:n,target:i,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function Ri(e,n,i){this.k=e,this.x=n,this.y=i}Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*n)},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 Jc=new Ri(1,0,0);Vv.prototype=Ri.prototype;function Vv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jc;return e.__zoom}function Vh(e){e.stopImmediatePropagation()}function gs(e){e.preventDefault(),e.stopImmediatePropagation()}function Y4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function X4(){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 ab(){return this.__zoom||Jc}function F4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function G4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Z4(e,n,i){var a=e.invertX(n[0][0])-i[0][0],s=e.invertX(n[1][0])-i[1][0],o=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function Pv(){var e=Y4,n=X4,i=Z4,a=F4,s=G4,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=Sc,d=Gc("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function _(O){O.property("__zoom",ab).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",q).filter(s).on("touchstart.zoom",V).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,B,j,U){var Y=O.selection?O.selection():O;Y.property("__zoom",ab),O!==Y?L(O,B,j,U):Y.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(O,B,j,U){_.scaleTo(O,function(){var Y=this.__zoom.k,K=typeof B=="function"?B.apply(this,arguments):B;return Y*K},j,U)},_.scaleTo=function(O,B,j,U){_.transform(O,function(){var Y=n.apply(this,arguments),K=this.__zoom,z=j==null?C(Y):typeof j=="function"?j.apply(this,arguments):j,R=K.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(D(K,$),z,R),Y,u)},j,U)},_.translateBy=function(O,B,j,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof j=="function"?j.apply(this,arguments):j),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,j,U,Y){_.transform(O,function(){var K=n.apply(this,arguments),z=this.__zoom,R=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U;return i(Jc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof j=="function"?-j.apply(this,arguments):-j),K,u)},U,Y)};function D(O,B){return B=Math.max(o[0],Math.min(o[1],B)),B===O.k?O:new Ri(B,O.x,O.y)}function k(O,B,j){var U=B[0]-j[0]*O.k,Y=B[1]-j[1]*O.k;return U===O.x&&Y===O.y?O:new Ri(O.k,U,Y)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,B,j,U){O.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var Y=this,K=arguments,z=A(Y,K).event(U),R=n.apply(Y,K),$=j==null?C(R):typeof j=="function"?j.apply(Y,K):j,T=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=Y.__zoom,ce=typeof B=="function"?B.apply(Y,K):B,fe=h(ie.invert($).concat(T/ie.k),ce.invert($).concat(T/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=T/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,j){return!j&&O.__zooming||new H(O,B)}function H(O,B){this.that=O,this.args=B,this.active=0,this.sourceEvent=null,this.extent=n.apply(O,B),this.taps=0}H.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,B){return this.mouse&&O!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var B=vn(this.that).datum();d.call(O,this.that,new P4(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var j=A(this,B).event(O),U=this.__zoom,Y=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,a.apply(this,arguments)))),K=In(O);if(j.wheel)(j.mouse[0][0]!==K[0]||j.mouse[0][1]!==K[1])&&(j.mouse[1]=U.invert(j.mouse[0]=K)),clearTimeout(j.wheel);else{if(U.k===Y)return;j.mouse=[K,U.invert(K)],Ec(this),j.start()}gs(O),j.wheel=setTimeout(z,w),j.zoom("mouse",i(k(D(U,Y),j.mouse[0],j.mouse[1]),j.extent,u));function z(){j.wheel=null,j.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var j=O.currentTarget,U=A(this,B,!0).event(O),Y=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",T,!0),K=In(O,j),z=O.clientX,R=O.clientY;Cv(O.view),Vh(O),U.mouse=[K,this.__zoom.invert(K)],Ec(this),U.start();function $(ie){if(gs(ie),!U.moved){var ce=ie.clientX-z,fe=ie.clientY-R;U.moved=ce*ce+fe*fe>E}U.event(ie).zoom("mouse",i(k(U.that.__zoom,U.mouse[0]=In(ie,j),U.mouse[1]),U.extent,u))}function T(ie){Y.on("mousemove.zoom mouseup.zoom",null),Mv(ie.view,U.moved),gs(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var j=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),Y=j.invert(U),K=j.k*(O.shiftKey?.5:2),z=i(k(D(j,K),U,Y),n.apply(this,B),u);gs(O),f>0?vn(this).transition().duration(f).call(L,z,U,O):vn(this).call(_.transform,z,U,O)}}function V(O,...B){if(e.apply(this,arguments)){var j=O.touches,U=j.length,Y=A(this,B,O.changedTouches.length===U).event(O),K,z,R,$;for(Vh(O),z=0;z<U;++z)R=j[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,K=!0,Y.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(Y.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),Ec(this),Y.start())}}function P(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z,R,$;for(gs(O),K=0;K<Y;++K)z=U[K],R=In(z,this),j.touch0&&j.touch0[2]===z.identifier?j.touch0[0]=R:j.touch1&&j.touch1[2]===z.identifier&&(j.touch1[0]=R);if(z=j.that.__zoom,j.touch1){var T=j.touch0[0],ie=j.touch0[1],ce=j.touch1[0],fe=j.touch1[1],he=(he=ce[0]-T[0])*he+(he=ce[1]-T[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=D(z,Math.sqrt(he/ue)),R=[(T[0]+ce[0])/2,(T[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(j.touch0)R=j.touch0[0],$=j.touch0[1];else return;j.zoom("touch",i(k(z,R,$),j.extent,u))}}function te(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z;for(Vh(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<Y;++K)z=U[K],j.touch0&&j.touch0[2]===z.identifier?delete j.touch0:j.touch1&&j.touch1[2]===z.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(z=In(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<N)){var R=vn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(a=typeof O=="function"?O:Zu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zu(!!O),_):e},_.touchable=function(O){return arguments.length?(s=typeof O=="function"?O:Zu(!!O),_):s},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Zu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):n},_.scaleExtent=function(O){return arguments.length?(o[0]=+O[0],o[1]=+O[1],_):[o[0],o[1]]},_.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(f=+O,_):f},_.interpolate=function(O){return arguments.length?(h=O,_):h},_.on=function(){var O=d.on.apply(d,arguments);return O===d?_:O},_.clickDistance=function(O){return arguments.length?(E=(O=+O)*O,_):Math.sqrt(E)},_.tapDistance=function(O){return arguments.length?(N=+O,_):N},_}const ri={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:n,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:a}", edge id: ${n}.`,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."},Qs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yv=["Enter"," ","Escape"],Xv={"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:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"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 ul;(function(e){e.Strict="strict",e.Loose="loose"})(ul||(ul={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var Ks;(function(e){e.Partial="partial",e.Full="full"})(Ks||(Ks={}));const Fv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wr||(wr={}));var Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const lb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Gv(e){return e===null?null:e?"valid":"invalid"}const Zv=e=>"id"in e&&"source"in e&&"target"in e,Q4=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),dm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),oo=(e,n=[0,0])=>{const{width:i,height:a}=Bi(e),s=e.origin??n,o=i*s[0],u=a*s[1];return{x:e.position.x-o,y:e.position.y-u}},K4=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((a,s)=>{const o=typeof s=="string";let u=!n.nodeLookup&&!o?s:void 0;n.nodeLookup&&(u=o?n.nodeLookup.get(s):dm(s)?s:n.nodeLookup.get(s.id));const f=u?Hc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Wc(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ef(i)},uo=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(i=Wc(i,Hc(s)),a=!0)}),a?ef(i):{x:0,y:0,width:0,height:0}},hm=(e,n,[i,a,s]=[0,0,1],o=!1,u=!1)=>{const f={...fo(n,[i,a,s]),width:n.width/s,height:n.height/s},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(u&&!m||x)continue;const b=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,E=Js(f,fl(d)),N=(b??0)*(w??0),_=o&&E>0;(!d.internals.handleBounds||_||E>=N||d.dragging)&&h.push(d)}return h},J4=(e,n)=>{const i=new Set;return e.forEach(a=>{i.add(a.id)}),n.filter(a=>i.has(a.source)||i.has(a.target))};function W4(e,n){const i=new Map,a=n?.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&(n?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&i.set(s.id,s)}),i}async function eM({nodes:e,width:n,height:i,panZoom:a,minZoom:s,maxZoom:o},u){if(e.size===0)return Promise.resolve(!0);const f=W4(e,u),h=uo(f),d=pm(h,n,i,u?.minZoom??s,u?.maxZoom??o,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Qv({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:s,onError:o}){const u=i.get(e),f=u.parentId?i.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??a;let m=u.extent||s;if(u.extent==="parent"&&!u.expandParent)if(!f)o?.("005",ri.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[h,d],[h+b,d+w]])}else f&&dl(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=dl(m)?ta(n,m,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&o?.("015",ri.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function tM({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:a,onBeforeDelete:s}){const o=new Set(e.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const b=o.has(x.id),w=!b&&x.parentId&&u.find(E=>E.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(n.map(x=>x.id)),h=a.filter(x=>x.deletable!==!1),g=J4(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!s)return{edges:g,nodes:u};const m=await s({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const cl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:cl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:cl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Kv(e,n,i){const{width:a,height:s}=Bi(i),{x:o,y:u}=i.internals.positionAbsolute;return ta(e,[[o,u],[o+a,u+s]],n)}const sb=(e,n,i)=>e<n?cl(Math.abs(e-n),1,n)/n:e>i?-cl(Math.abs(e-i),1,n)/n:0,Jv=(e,n,i=15,a=40)=>{const s=sb(e.x,a,n.width-a)*i,o=sb(e.y,a,n.height-a)*i;return[s,o]},Wc=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Dp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),ef=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),fl=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Hc=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Wv=(e,n)=>ef(Wc(Dp(e),Dp(n))),Js=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*a)},ob=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),nM=(e,n)=>{},co=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),fo=({x:e,y:n},[i,a,s],o=!1,u=[1,1])=>{const f={x:(e-i)/s,y:(n-a)/s};return o?co(f,u):f},Bc=({x:e,y:n},[i,a,s])=>({x:e*s+i,y:n*s+a});function Ya(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.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 iM(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,i),s=Ya(e,n);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,i),s=Ya(e.bottom??e.y??0,i),o=Ya(e.left??e.x??0,n),u=Ya(e.right??e.x??0,n);return{top:a,right:u,bottom:s,left:o,x:o+u,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rM(e,n,i,a,s,o){const{x:u,y:f}=Bc(e,[n,i,a]),{x:h,y:d}=Bc({x:e.x+e.width,y:e.y+e.height},[n,i,a]),g=s-h,m=o-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const pm=(e,n,i,a,s,o)=>{const u=iM(o,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=cl(d,a,s),m=e.x+e.width/2,x=e.y+e.height/2,b=n/2-m*g,w=i/2-x*g,E=rM(e,b,w,g,n,i),N={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:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},Ws=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function dl(e){return e!=null&&e!=="parent"}function Bi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ew(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function tw(e,n={width:0,height:0},i,a,s){const o={...e},u=a.get(i);if(u){const f=u.origin||s;o.x+=u.internals.positionAbsolute.x-(n.width??0)*f[0],o.y+=u.internals.positionAbsolute.y-(n.height??0)*f[1]}return o}function ub(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function aM(){let e,n;return{promise:new Promise((a,s)=>{e=a,n=s}),resolve:e,reject:n}}function lM(e){return{...Xv,...e||{}}}function $s(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:s}){const{x:o,y:u}=Vn(e),f=fo({x:o-(s?.left??0),y:u-(s?.top??0)},a),{x:h,y:d}=i?co(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const mm=e=>({width:e.offsetWidth,height:e.offsetHeight}),nw=e=>e?.getRootNode?.()||window?.document,sM=["INPUT","SELECT","TEXTAREA"];function iw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:sM.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const rw=e=>"clientX"in e,Vn=(e,n)=>{const i=rw(e),a=i?e.clientX:e.touches?.[0].clientX,s=i?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:s-(n?.top??0)}},cb=(e,n,i,a,s)=>{const o=n.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:s,position:u.getAttribute("data-handlepos"),x:(f.left-i.left)/a,y:(f.top-i.top)/a,...mm(u)}})};function aw({sourceX:e,sourceY:n,targetX:i,targetY:a,sourceControlX:s,sourceControlY:o,targetControlX:u,targetControlY:f}){const h=e*.125+s*.375+u*.375+i*.125,d=n*.125+o*.375+f*.375+a*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function Qu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fb({pos:e,x1:n,y1:i,x2:a,y2:s,c:o}){switch(e){case be.Left:return[n-Qu(n-a,o),i];case be.Right:return[n+Qu(a-n,o),i];case be.Top:return[n,i-Qu(i-s,o)];case be.Bottom:return[n,i+Qu(s-i,o)]}}function lw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,curvature:u=.25}){const[f,h]=fb({pos:i,x1:e,y1:n,x2:a,y2:s,c:u}),[d,g]=fb({pos:o,x1:a,y1:s,x2:e,y2:n,c:u}),[m,x,b,w]=aw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${a},${s}`,m,x,b,w]}function sw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const s=Math.abs(i-e)/2,o=i<e?i+s:i-s,u=Math.abs(a-n)/2,f=a<n?a+u:a-u;return[o,f,s,u]}function oM({sourceNode:e,targetNode:n,selected:i=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return a;const u=s&&i?a+1e3:a,f=Math.max(e.parentId||s&&e.selected?e.internals.z:0,n.parentId||s&&n.selected?n.internals.z:0);return u+f}function uM({sourceNode:e,targetNode:n,width:i,height:a,transform:s}){const o=Wc(Hc(e),Hc(n));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const u={x:-s[0]/s[2],y:-s[1]/s[2],width:i/s[2],height:a/s[2]};return Js(u,ef(o))>0}const cM=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,fM=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),ow=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||cM;let s;return Zv(e)?s={...e}:s={...e,id:a(e)},fM(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function uw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[s,o,u,f]=sw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,s,o,u,f]}const db={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},dM=({source:e,sourcePosition:n=be.Bottom,target:i})=>n===be.Left||n===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},hb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function hM({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:s,offset:o,stepPosition:u}){const f=db[n],h=db[a],d={x:e.x+f.x*o,y:e.y+f.y*o},g={x:i.x+h.x*o,y:i.y+h.y*o},m=dM({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const _={x:0,y:0},D={x:0,y:0},[,,k,C]=sw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[x]*h[x]===-1){x==="x"?(E=s.x??d.x+(g.x-d.x)*u,N=s.y??(d.y+g.y)/2):(E=s.x??(d.x+g.x)/2,N=s.y??d.y+(g.y-d.y)*u);const A=[{x:E,y:d.y},{x:E,y:g.y}],H=[{x:d.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?A:H:w=x==="x"?H:A}else{const A=[{x:d.x,y:g.y}],H=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===b?H:A:w=f.y===b?A:H,n===a){const P=Math.abs(e[x]-i[x]);if(P<=o){const te=Math.min(o-1,o-P);f[x]===b?_[x]=(d[x]>e[x]?-1:1)*te:D[x]=(g[x]>i[x]?-1:1)*te}}if(n!==a){const P=x==="x"?"y":"x",te=f[x]===h[P],O=d[P]>g[P],B=d[P]<g[P];(f[x]===1&&(!te&&O||te&&B)||f[x]!==1&&(!te&&B||te&&O))&&(w=x==="x"?A:H)}const F={x:d.x+_.x,y:d.y+_.y},G={x:g.x+D.x,y:g.y+D.y},q=Math.max(Math.abs(F.x-w[0].x),Math.abs(G.x-w[0].x)),V=Math.max(Math.abs(F.y-w[0].y),Math.abs(G.y-w[0].y));q>=V?(E=(F.x+G.x)/2,N=w[0].y):(E=w[0].x,N=(F.y+G.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...w,{x:g.x+D.x,y:g.y+D.y},i],E,N,k,C]}function pM(e,n,i,a){const s=Math.min(hb(e,n)/2,hb(n,i)/2,a),{x:o,y:u}=n;if(e.x===o&&o===i.x||e.y===u&&u===i.y)return`L${o} ${u}`;if(e.y===u){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${o+s*d},${u}Q ${o},${u} ${o},${u+s*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${o},${u+s*h}Q ${o},${u} ${o+s*f},${u}`}function Rp({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,b,w,E]=hM({source:{x:e,y:n},sourcePosition:i,target:{x:a,y:s},targetPosition:o,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((_,D,k)=>{let C="";return k>0&&k<m.length-1?C=pM(m[k-1],D,m[k+1],u):C=`${k===0?"M":"L"}${D.x} ${D.y}`,_+=C,_},""),x,b,w,E]}function pb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mM(e){const{sourceNode:n,targetNode:i}=e;if(!pb(n)||!pb(i))return null;const a=n.internals.handleBounds||mb(n.handles),s=i.internals.handleBounds||mb(i.handles),o=gb(a?.source??[],e.sourceHandle),u=gb(e.connectionMode===ul.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),e.targetHandle);if(!o||!u)return e.onError?.("008",ri.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=o?.position||be.Bottom,h=u?.position||be.Top,d=na(n,o,f),g=na(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function mb(e){if(!e)return null;const n=[],i=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&i.push(a);return{source:n,target:i}}function na(e,n,i=be.Left,a=!1){const s=(n?.x??0)+e.internals.positionAbsolute.x,o=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=n??Bi(e);if(a)return{x:s+u/2,y:o+f/2};switch(n?.position??i){case be.Top:return{x:s+u/2,y:o};case be.Right:return{x:s+u,y:o+f/2};case be.Bottom:return{x:s+u/2,y:o+f};case be.Left:return{x:s,y:o+f/2}}}function gb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Op(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function gM(e,{id:n,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:s}){const o=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||s].forEach(h=>{if(h&&typeof h=="object"){const d=Op(h,n);o.has(d)||(u.push({id:d,color:h.color||i,...h}),o.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const cw=1e3,yM=10,gm={nodeOrigin:[0,0],nodeExtent:Qs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xM={...gm,checkEquality:!0};function ym(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function bM(e,n,i){const a=ym(gm,i);for(const s of e.values())if(s.parentId)bm(s,e,n,a);else{const o=oo(s,a.nodeOrigin),u=dl(s.extent)?s.extent:a.nodeExtent,f=ta(o,u,Bi(s));s.internals.positionAbsolute=f}}function vM(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],a=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?i.push(o):s.type==="target"&&a.push(o)}return{source:i,target:a}}function xm(e){return e==="manual"}function Lp(e,n,i,a={}){const s=ym(xM,a),o={i:0},u=new Map(n),f=s?.elevateNodesOnSelect&&!xm(s.zIndexMode)?cw:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(s.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=oo(d,s.nodeOrigin),x=dl(d.extent)?d.extent:s.nodeExtent,b=ta(m,x,Bi(d));g={...s.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:vM(d,g),z:fw(d,f,s.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&bm(g,n,i,a,o)}return h}function wM(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function bm(e,n,i,a,s){const{elevateNodesOnSelect:o,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=ym(gm,a),d=e.parentId,g=n.get(d);if(!g){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wM(e,i),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*yM),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const m=o&&!xm(h)?cw:0,{x,y:b,z:w}=SM(e,g,u,f,m,h),{positionAbsolute:E}=e.internals,N=x!==E.x||b!==E.y;(N||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:E,z:w}})}function fw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return xm(i)?a:a+(e.selected?n:0)}function SM(e,n,i,a,s,o){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=oo(e,i),g=dl(e.extent)?ta(d,e.extent,h):d;let m=ta({x:u+g.x,y:f+g.y},a,h);e.extent==="parent"&&(m=Kv(m,h,n));const x=fw(e,s,o),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function vm(e,n,i,a=[0,0]){const s=[],o=new Map;for(const u of e){const f=n.get(u.parentId);if(!f)continue;const h=o.get(u.parentId)?.expandedRect??fl(f),d=Wv(h,u.rect);o.set(u.parentId,{expandedRect:d,parent:f})}return o.size>0&&o.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Bi(f),m=f.origin??a,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,b=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],_=(E-g.height)*m[1];(x>0||b>0||N||_)&&(s.push({id:h,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+_}}),i.get(h)?.forEach(D=>{e.some(k=>k.id===D.id)||s.push({id:D.id,type:"position",position:{x:D.position.x+x,y:D.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:E+(b?m[1]*b-_:0)}})}),s}function _M(e,n,i,a,s,o,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=n.get(b.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=mm(b.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||b.force))){const D=b.nodeElement.getBoundingClientRect(),k=dl(w.extent)?w.extent:o;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Kv(C,E,n.get(w.parentId)):k&&(C=ta(C,k,E));const L={...w,measured:E,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:cb("source",b.nodeElement,D,m,w.id),target:cb("target",b.nodeElement,D,m,w.id)}}};n.set(w.id,L),w.parentId&&bm(L,n,i,{nodeOrigin:s,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:fl(L,s)}))}}if(x.length>0){const b=vm(x,n,i,s);d.push(...b)}return{changes:d,updatedInternals:h}}async function kM({delta:e,panZoom:n,transform:i,translateExtent:a,width:s,height:o}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const u=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[s,o]],a),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function yb(e,n,i,a,s,o){let u=s;const f=a.get(u)||new Map;a.set(u,f.set(i,n)),u=`${s}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(i,n)),o){u=`${s}-${e}-${o}`;const d=a.get(u)||new Map;a.set(u,d.set(i,n))}}function dw(e,n,i){e.clear(),n.clear();for(const a of i){const{source:s,target:o,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:s,target:o,sourceHandle:u,targetHandle:f},d=`${s}-${u}--${o}-${f}`,g=`${o}-${f}--${s}-${u}`;yb("source",h,g,e,s,u),yb("target",h,d,e,o,f),n.set(a.id,a)}}function hw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:hw(i,n):!1}function xb(e,n,i){let a=e;do{if(a?.matches?.(n))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function EM(e,n,i,a){const s=new Map;for(const[o,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!hw(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const f=e.get(o);f&&s.set(o,{id:o,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return s}function Ph({nodeId:e,dragItems:n,nodeLookup:i,dragging:a=!0}){const s=[];for(const[u,f]of n){const h=i.get(u)?.internals.userNode;h&&s.push({...h,position:f.position,dragging:a})}if(!e)return[s[0],s];const o=i.get(e)?.internals.userNode;return[o?{...o,position:n.get(e)?.position||o.position,dragging:a}:s[0],s]}function NM({dragItems:e,snapGrid:n,x:i,y:a}){const s=e.values().next().value;if(!s)return null;const o={x:i-s.distance.x,y:a-s.distance.y},u=co(o,n);return{x:u.x-o.x,y:u.y-o.y}}function CM({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:a,onDragStop:s}){let o={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,E=null;function N({noDragClassName:D,handleSelector:k,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:H=0}){x=vn(C);function F({x:P,y:te}){const{nodeLookup:O,nodeExtent:B,snapGrid:j,snapToGrid:U,nodeOrigin:Y,onNodeDrag:K,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();o={x:P,y:te};let T=!1;const ie=f.size>1,ce=ie&&B?Dp(uo(f)):null,fe=ie&&U?NM({dragItems:f,snapGrid:j,x:P,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};U&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:co(me,j));let Ee=null;if(ie&&B&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Re=Ne.x-ce.x+B[0][0],Ze=Ne.x+ue.measured.width-ce.x2+B[1][0],Xe=Ne.y-ce.y+B[0][1],ht=Ne.y+ue.measured.height-ce.y2+B[1][1];Ee=[[Re,Xe],[Ze,ht]]}const{position:Ce,positionAbsolute:we}=Qv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:Y,onError:R});T=T||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||T,!!T&&($(f,!0),E&&(a||K||!A&&z))){const[he,ue]=Ph({nodeId:A,dragItems:f,nodeLookup:O});a?.(E,f,he,ue),K?.(E,he,ue),A||z?.(E,ue)}}async function G(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:B}=n();if(!B){h=!1,cancelAnimationFrame(u);return}const[j,U]=Jv(d,g,O);(j!==0||U!==0)&&(o.x=(o.x??0)-j/P[2],o.y=(o.y??0)-U/P[2],await te({x:j,y:U})&&F(o)),u=requestAnimationFrame(G)}function q(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:j,snapGrid:U,snapToGrid:Y,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!K||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&K&&A&&e?.(A);const T=$s(P.sourceEvent,{transform:j,snapGrid:U,snapToGrid:Y,containerBounds:g});if(o=T,f=EM(te,B,T,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=Ph({nodeId:A,dragItems:f,nodeLookup:te});i?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),A||R?.(P.sourceEvent,ce)}}const V=Tv().clickDistance(H).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:j,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,O===0&&q(P),o=$s(P.sourceEvent,{transform:B,snapGrid:j,snapToGrid:U,containerBounds:g}),d=Vn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:j,nodeDragThreshold:U,nodeLookup:Y}=n(),K=$s(P.sourceEvent,{transform:O,snapGrid:B,snapToGrid:j,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!Y.has(A))&&(b=!0),!b){if(!h&&te&&m&&(h=!0,G()),!m){const z=Vn(P.sourceEvent,g),R=z.x-d.x,$=z.y-d.y;Math.sqrt(R*R+$*$)>U&&q(P)}(o.x!==K.xSnapped||o.y!==K.ySnapped)&&f&&m&&(d=Vn(P.sourceEvent,g),F(K))}}).on("end",P=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:j}=n();if(w&&(O(f,!1),w=!1),s||B||!A&&j){const[U,Y]=Ph({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});s?.(P.sourceEvent,f,U,Y),B?.(P.sourceEvent,U,Y),A||j?.(P.sourceEvent,Y)}}}).filter(P=>{const te=P.target;return!P.button&&(!D||!xb(te,`.${D}`,C))&&(!k||xb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function MM(e,n,i){const a=[],s={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const o of n.values())Js(s,fl(o))>0&&a.push(o);return a}const TM=250;function AM(e,n,i,a){let s=[],o=1/0;const u=MM(e,i,n+TM);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:g,y:m}=na(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<o?(s=[{...d,x:g,y:m}],o=x):x===o&&s.push({...d,x:g,y:m}))}}if(!s.length)return null;if(s.length>1){const f=a.type==="source"?"target":"source";return s.find(h=>h.type===f)??s[0]}return s[0]}function pw(e,n,i,a,s,o=!1){const u=a.get(e);if(!u)return null;const f=s==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&o?{...h,...na(u,h,h.position,!0)}:h}function mw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function zM(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const gw=()=>!0;function jM(e,{connectionMode:n,connectionRadius:i,handleId:a,nodeId:s,edgeUpdaterType:o,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:_=gw,onReconnectEnd:D,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=nw(e.target);let q=0,V;const{x:P,y:te}=Vn(e),O=mw(o,F),B=f?.getBoundingClientRect();let j=!1;if(!B||!O)return;const U=pw(s,O,a,h,n);if(!U)return;let Y=Vn(e,B),K=!1,z=null,R=!1,$=null;function T(){if(!g||!B)return;const[Ce,we]=Jv(Y,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(T)}const ie={...U,nodeId:s,type:O,position:U.position},ce=h.get(s);let he={inProgress:!0,isValid:null,from:na(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:Y,toHandle:null,toPosition:lb[ie.position],toNode:null,pointer:Y};function ue(){j=!0,k(he),w?.(e,{nodeId:s,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!j){const{x:ht,y:sn}=Vn(Ce),Lt=ht-P,Gt=sn-te;if(!(Lt*Lt+Gt*Gt>H*H))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();Y=Vn(Ce,B),V=AM(fo(Y,we,!1,[1,1]),i,h,ie),K||(T(),K=!0);const Ne=yw(Ce,{handle:V,connectionMode:n,fromNodeId:s,fromHandleId:a,fromType:u?"target":"source",isValidConnection:_,doc:G,lib:d,flowId:m,nodeLookup:h});$=Ne.handleDomNode,z=Ne.connection,R=zM(!!V,Ne.isValid);const Re=h.get(s),Ze=Re?na(Re,ie,be.Left,!0):he.from,Xe={...he,from:Ze,isValid:R,to:Ne.toHandle&&R?Bc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):Y,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:lb[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:Y};k(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(j){(V||$)&&z&&R&&E?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Re),o&&D?.(Ce,Re)}b(),cancelAnimationFrame(q),K=!1,R=!1,z=null,$=null,G.removeEventListener("mousemove",me),G.removeEventListener("mouseup",Ee),G.removeEventListener("touchmove",me),G.removeEventListener("touchend",Ee)}}G.addEventListener("mousemove",me),G.addEventListener("mouseup",Ee),G.addEventListener("touchmove",me),G.addEventListener("touchend",Ee)}function yw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:s,fromType:o,doc:u,lib:f,flowId:h,isValidConnection:d=gw,nodeLookup:g}){const m=o==="target",x=n?u.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:w}=Vn(e),E=u.elementFromPoint(b,w),N=E?.classList.contains(`${f}-flow__handle`)?E:x,_={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const D=mw(void 0,N),k=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),A=N.classList.contains("connectableend");if(!k||!D)return _;const H={source:m?k:a,sourceHandle:m?C:s,target:m?a:k,targetHandle:m?s:C};_.connection=H;const G=L&&A&&(i===ul.Strict?m&&D==="source"||!m&&D==="target":k!==a||C!==s);_.isValid=G&&d(H),_.toHandle=pw(k,D,C,g,i,!0)}return _}const Hp={onPointerDown:jM,isValid:yw};function DM({domNode:e,panZoom:n,getTransform:i,getViewScale:a}){const s=vn(e);function o({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const C=i(),L=k.sourceEvent.ctrlKey&&Ws()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,H=C[2]*Math.pow(2,A*L);n.scaleTo(H)};let E=[0,0];const N=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(E=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},_=k=>{const C=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const L=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[L[0]-E[0],L[1]-E[1]];E=L;const H=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),F={x:C[0]-A[0]*H,y:C[1]-A[1]*H},G=[[0,0],[h,d]];n.setViewportConstrained({x:F.x,y:F.y,zoom:C[2]},G,f)},D=Pv().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);s.call(D,{})}function u(){s.on("zoom",null)}return{update:o,destroy:u,pointer:In}}const tf=e=>({x:e.x,y:e.y,zoom:e.k}),Yh=({x:e,y:n,zoom:i})=>Jc.translate(e,n).scale(i),Wa=(e,n)=>e.target.closest(`.${n}`),xw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),RM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Xh=(e,n=0,i=RM,a=()=>{})=>{const s=typeof n=="number"&&n>0;return s||a(),s?e.transition().duration(n).ease(i).on("end",a):e},bw=e=>{const n=e.ctrlKey&&Ws()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function OM({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Wa(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&u){const N=In(g),_=bw(g),D=m*Math.pow(2,_);a.scaleTo(i,D,N,g);return}const x=g.deltaMode===1?20:1;let b=s===Jr.Vertical?0:g.deltaX*x,w=s===Jr.Horizontal?0:g.deltaY*x;!Ws()&&g.shiftKey&&s!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*o,-(w/m)*o,{internal:!0});const E=tf(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,E),e.panScrollTimeout=setTimeout(()=>{d?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}function LM({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,s){const o=a.type==="wheel",u=!n&&o&&!a.ctrlKey,f=Wa(a,e);if(a.ctrlKey&&o&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,s)}}function HM({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const s=tf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=s,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,s)}}function BM({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:s}){return o=>{e.usedRightMouseButton=!!(i&&xw(n,e.mouseButton??0)),o.sourceEvent?.sync||a([o.transform.x,o.transform.y,o.transform.k]),s&&!o.sourceEvent?.internal&&s?.(o.sourceEvent,tf(o.transform))}}function UM({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:o}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&xw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&o(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),s)){const f=tf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s?.(u.sourceEvent,f)},i?150:0)}}}function IM({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,b=i&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Wa(m,`${d}-flow__node`)||Wa(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!s&&!o&&!i||u||g&&!w||Wa(m,f)&&w||Wa(m,h)&&(!w||s&&w&&!e)||!i&&m.ctrlKey&&w)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!s&&!b&&w||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function qM({domNode:e,minZoom:n,maxZoom:i,translateExtent:a,viewport:s,onPanZoom:o,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Pv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);D({x:s.x,y:s.y,zoom:cl(s.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(bw);function E(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).transform(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function N({noWheelClassName:V,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:j,panOnScrollMode:U,panOnScrollSpeed:Y,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:T,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!T&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?OM({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:Y,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:o,onPanZoomEnd:f}):LM({noWheelClassName:V,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=HM({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=BM({zoomPanValues:d,panOnDrag:j,onPaneContextMenu:!!te,onPanZoom:o,onTransformChange:ce});m.on("zoom",Ne);const Re=UM({zoomPanValues:d,panOnDrag:j,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=IM({zoomActivationKeyPressed:T,panOnDrag:j,zoomOnScroll:R,panOnScroll:B,zoomOnDoubleClick:$,zoomOnPinch:z,userSelectionActive:O,noPanClassName:P,noWheelClassName:V,lib:ie,connectionInProgress:fe});m.filter(Ce),$?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function D(V,P,te){const O=Yh(V),B=m?.constrain()(O,P,te);return B&&await E(B),new Promise(j=>j(B))}async function k(V,P){const te=Yh(V);return await E(te,P),new Promise(O=>O(te))}function C(V){if(x){const P=Yh(V),te=x.property("__zoom");(te.k!==V.zoom||te.x!==V.x||te.y!==V.y)&&m?.transform(x,P,null,{sync:!0})}}function L(){const V=x?Vv(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).scaleTo(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function H(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).scaleBy(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function F(V){m?.scaleExtent(V)}function G(V){m?.translateExtent(V)}function q(V){const P=!$n(V)||V<0?0:V;m?.clickDistance(P)}return{update:N,destroy:_,setViewport:k,setViewportConstrained:D,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var hl;(function(e){e.Line="line",e.Handle="handle"})(hl||(hl={}));function $M({width:e,prevWidth:n,height:i,prevHeight:a,affectsX:s,affectsY:o}){const u=e-n,f=i-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&s&&(h[0]=h[0]*-1),f&&o&&(h[1]=h[1]*-1),h}function bb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),a=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:a,affectsY:s}}function mr(e,n){return Math.max(0,n-e)}function gr(e,n){return Math.max(0,e-n)}function Ku(e,n,i){return Math.max(0,n-e,e-i)}function vb(e,n){return e?!n:n}function VM(e,n,i,a,s,o,u,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:b,ySnapped:w}=i,{minWidth:E,maxWidth:N,minHeight:_,maxHeight:D}=a,{x:k,y:C,width:L,height:A,aspectRatio:H}=e;let F=Math.floor(g?b-e.pointerX:0),G=Math.floor(m?w-e.pointerY:0);const q=L+(h?-F:F),V=A+(d?-G:G),P=-o[0]*L,te=-o[1]*A;let O=Ku(q,E,N),B=Ku(V,_,D);if(u){let Y=0,K=0;h&&F<0?Y=mr(k+F+P,u[0][0]):!h&&F>0&&(Y=gr(k+q+P,u[1][0])),d&&G<0?K=mr(C+G+te,u[0][1]):!d&&G>0&&(K=gr(C+V+te,u[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(f){let Y=0,K=0;h&&F>0?Y=gr(k+F,f[0][0]):!h&&F<0&&(Y=mr(k+q,f[1][0])),d&&G>0?K=gr(C+G,f[0][1]):!d&&G<0&&(K=mr(C+V,f[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(s){if(g){const Y=Ku(q/H,_,D)*H;if(O=Math.max(O,Y),u){let K=0;!h&&!d||h&&!d&&x?K=gr(C+te+q/H,u[1][1])*H:K=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=mr(C+q/H,f[1][1])*H:K=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,K)}}if(m){const Y=Ku(V*H,E,N)/H;if(B=Math.max(B,Y),u){let K=0;!h&&!d||d&&!h&&x?K=gr(k+V*H+P,u[1][0])/H:K=mr(k+(d?G:-G)*H+P,u[0][0])/H,B=Math.max(B,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=mr(k+V*H,f[1][0])/H:K=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,K)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),s&&(x?q>V*H?G=(vb(h,d)?-F:F)/H:F=(vb(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const j=h?k+F:k,U=d?C+G:C;return{width:L+(h?-F:F),height:A+(d?-G:G),x:o[0]*F*(h?-1:1)+j,y:o[1]*G*(d?-1:1)+U}}const vw={width:0,height:0,x:0,y:0},PM={...vw,pointerX:0,pointerY:0,aspectRatio:1};function YM(e){return[[0,0],[e.measured.width,e.measured.height]]}function XM(e,n,i){const a=n.position.x+e.position.x,s=n.position.y+e.position.y,o=e.measured.width??0,u=e.measured.height??0,f=i[0]*o,h=i[1]*u;return[[a-f,s-h],[a+o-f,s+u-h]]}function FM({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:s}){const o=vn(e);let u={controlDirection:bb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:E,shouldResize:N}){let _={...vw},D={...PM};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:bb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=Tv().on("start",V=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:j,paneDomNode:U}=i();if(k=P.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:Y,ySnapped:K}=$s(V.sourceEvent,{transform:te,snapGrid:O,snapToGrid:B,containerBounds:C});_={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},D={..._,pointerX:Y,pointerY:K,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),H=A&&k.extent==="parent"?YM(A):void 0),L=[],F=void 0;for(const[z,R]of P)if(R.parentId===n&&(L.push({id:z,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const $=XM(R,k,R.origin??j);F?F=[[Math.min($[0][0],F[0][0]),Math.min($[0][1],F[0][1])],[Math.max($[1][0],F[1][0]),Math.max($[1][1],F[1][1])]]:F=$}b?.(V,{..._})}).on("drag",V=>{const{transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B}=i(),j=$s(V.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:Y,y:K,width:z,height:R}=_,$={},T=k.origin??B,{width:ie,height:ce,x:fe,y:he}=VM(D,u.controlDirection,j,u.boundaries,u.keepAspectRatio,T,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==Y&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||T[0]===1||T[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-Y,Xe=he-K;for(const ht of L)ht.position={x:ht.position.x-Ze+T[0]*(ie-z),y:ht.position.y-Xe+T[1]*(ce-R)},U.push(ht)}if((ue||me)&&($.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,$.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=$.width,_.height=$.height),A&&k.expandParent){const Ze=T[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,D.x=D.x-($.x-Ze));const Xe=T[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,D.y=D.y-($.y-Xe))}const we=$M({width:_.width,prevWidth:z,height:_.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};N?.(V,Ne)!==!1&&(G=!0,w?.(V,Ne),a($,U))}).on("end",V=>{G&&(E?.(V,{..._}),s?.({..._}),G=!1)});o.call(q)}function h(){o.on(".drag",null)}return{update:f,destroy:h}}var Fh={exports:{}},Gh={},Zh={exports:{}},Qh={};var wb;function GM(){if(wb)return Qh;wb=1;var e=ao();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,a=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),E=w[0].inst,N=w[1];return o(function(){E.value=b,E.getSnapshot=x,h(E)&&N({inst:E})},[m,b,x]),s(function(){return h(E)&&N({inst:E}),m(function(){h(E)&&N({inst:E})})},[m]),u(b),b}function h(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!i(m,b)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Qh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Qh}var Sb;function ZM(){return Sb||(Sb=1,Zh.exports=GM()),Zh.exports}var _b;function QM(){if(_b)return Gh;_b=1;var e=ao(),n=ZM();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var a=typeof Object.is=="function"?Object.is:i,s=n.useSyncExternalStore,o=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Gh.useSyncExternalStoreWithSelector=function(d,g,m,x,b){var w=o(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function _(A){if(!D){if(D=!0,k=A,A=x(A),b!==void 0&&E.hasValue){var H=E.value;if(b(H,A))return C=H}return C=A}if(H=C,a(k,A))return H;var F=x(A);return b!==void 0&&b(H,F)?(k=A,H):(k=A,C=F)}var D=!1,k,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var N=s(d,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),h(N),N},Gh}var kb;function KM(){return kb||(kb=1,Fh.exports=QM()),Fh.exports}var JM=KM();const WM=Fc(JM),eT={},Eb=e=>{let n;const i=new Set,a=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const b=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(w=>w(n,b))}},s=()=>n,h={setState:a,getState:s,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(eT?"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."),i.clear()}},d=n=e(a,s,h);return h},tT=e=>e?Eb(e):Eb,{useDebugValue:nT}=Ls,{useSyncExternalStoreWithSelector:iT}=WM,rT=e=>e;function ww(e,n=rT,i){const a=iT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return nT(a),a}const Nb=(e,n)=>{const i=tT(e),a=(s,o=n)=>ww(i,s,o);return Object.assign(a,i),a},aT=(e,n)=>e?Nb(e,n):Nb;function ut(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,s]of e)if(!Object.is(s,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}pv();const nf=Q.createContext(null),lT=nf.Provider,Sw=ri.error001();function Ye(e,n){const i=Q.useContext(nf);if(i===null)throw new Error(Sw);return ww(i,e,n)}function ct(){const e=Q.useContext(nf);if(e===null)throw new Error(Sw);return Q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Cb={display:"none"},sT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_w="react-flow__node-desc",kw="react-flow__edge-desc",oT="react-flow__aria-live",uT=e=>e.ariaLiveMessage,cT=e=>e.ariaLabelConfig;function fT({rfId:e}){const n=Ye(uT);return v.jsx("div",{id:`${oT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:sT,children:n})}function dT({rfId:e,disableKeyboardA11y:n}){const i=Ye(cT);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${_w}-${e}`,style:Cb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${kw}-${e}`,style:Cb,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(fT,{rfId:e})]})}const rf=Q.forwardRef(({position:e="top-left",children:n,className:i,style:a,...s},o)=>{const u=`${e}`.split("-");return v.jsx("div",{className:_t(["react-flow__panel",i,...u]),style:a,ref:o,...s,children:n})});rf.displayName="Panel";function hT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(rf,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const pT=e=>{const n=[],i=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&i.push(a);return{selectedNodes:n,selectedEdges:i}},Ju=e=>e.id;function mT(e,n){return ut(e.selectedNodes.map(Ju),n.selectedNodes.map(Ju))&&ut(e.selectedEdges.map(Ju),n.selectedEdges.map(Ju))}function gT({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Ye(pT,mT);return Q.useEffect(()=>{const s={nodes:i,edges:a};e?.(s),n.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[i,a,e]),null}const yT=e=>!!e.onSelectionChangeHandlers;function xT({onSelectionChange:e}){const n=Ye(yT);return e||n?v.jsx(gT,{onSelectionChange:e}):null}const Ew=[0,0],bT={x:0,y:0,zoom:1},vT=["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"],Mb=[...vT,"rfId"],wT=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}),Tb={translateExtent:Qs,nodeOrigin:Ew,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ST(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(wT,ut),d=ct();Q.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=Tb,f()}),[]);const g=Q.useRef(Tb);return Q.useEffect(()=>{for(const m of Mb){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?a(x):m==="maxZoom"?s(x):m==="translateExtent"?o(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:lM(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},Mb.map(m=>e[m])),null}function Ab(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _T(e){const[n,i]=Q.useState(e==="system"?null:e);return Q.useEffect(()=>{if(e!=="system"){i(e);return}const a=Ab(),s=()=>i(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[e]),n!==null?n:Ab()?.matches?"dark":"light"}const zb=typeof document<"u"?document:null;function eo(e=null,n={target:zb,actInsideInputWithModifier:!0}){const[i,a]=Q.useState(!1),s=Q.useRef(!1),o=Q.useRef(new Set([])),[u,f]=Q.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
10
10
|
`).replace(`
|
|
11
11
|
|
|
12
12
|
`,`
|
|
13
13
|
+`).split(`
|
|
14
|
-
`)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return K.useEffect(()=>{const h=n?.target??Ab,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!d)&&nw(b))return!1;const N=Db(b.code,f);if(o.current.add(b[N]),zb(u,o.current,!1)){const E=b.composedPath?.()?.[0]||b.target,_=E?.nodeName==="BUTTON"||E?.nodeName==="A";n.preventDefault!==!1&&(s.current||!_)&&b.preventDefault(),a(!0)}},m=b=>{const w=Db(b.code,f);zb(u,o.current,!0)?(a(!1),o.current.clear()):o.current.delete(b[w]),b.key==="Meta"&&o.current.clear(),s.current=!1},x=()=>{o.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),i}function zb(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(s=>n.has(s)))}function Db(e,n){return n.includes(e)?"code":"key"}const wT=()=>{const e=ct();return K.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[a,s,o],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??s,zoom:n.zoom??o},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,a]=e.getState().transform;return{x:n,y:i,zoom:a}},setCenter:async(n,i,a)=>e.getState().setCenter(n,i,a),fitBounds:async(n,i)=>{const{width:a,height:s,minZoom:o,maxZoom:u,panZoom:f}=e.getState(),h=hm(n,a,s,o,u,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:a,snapGrid:s,snapToGrid:o,domNode:u}=e.getState();if(!u)return n;const{x:f,y:h}=u.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??s,m=i.snapToGrid??o;return fo(d,a,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:a}=e.getState();if(!a)return n;const{x:s,y:o}=a.getBoundingClientRect(),u=Bc(n,i);return{x:u.x+s,y:u.y+o}}}),[])};function Ew(e,n){const i=[],a=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")a.set(o.id,[o]);else{const u=a.get(o.id);u?u.push(o):a.set(o.id,[o])}for(const o of n){const u=a.get(o.id);if(!u){i.push(o);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const f={...o};for(const h of u)ST(h,f);i.push(f)}return s.length&&s.forEach(o=>{o.index!==void 0?i.splice(o.index,0,{...o.item}):i.push({...o.item})}),i}function ST(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Nw(e,n){return Ew(e,n)}function Cw(e,n){return Ew(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function el(e,n=new Set,i=!1){const a=[];for(const[s,o]of e){const u=n.has(s);!(o.selected===void 0&&!u)&&o.selected!==u&&(i&&(o.selected=u),a.push(Gr(o.id,u)))}return a}function jb({items:e=[],lookup:n}){const i=[],a=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const u=n.get(o.id),f=u?.internals?.userNode??u;f!==void 0&&f!==o&&i.push({id:o.id,item:o,type:"replace"}),f===void 0&&i.push({item:o,type:"add",index:s})}for(const[s]of n)a.get(s)===void 0&&i.push({id:s,type:"remove"});return i}function Rb(e){return{id:e.id,type:"remove"}}const Ob=e=>F4(e),_T=e=>Gv(e);function Mw(e){return K.forwardRef(e)}const kT=typeof window<"u"?K.useLayoutEffect:K.useEffect;function Lb(e){const[n,i]=K.useState(BigInt(0)),[a]=K.useState(()=>ET(()=>i(s=>s+BigInt(1))));return kT(()=>{const s=a.get();s.length&&(e(s),a.reset())},[n]),a}function ET(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const Tw=K.createContext(null);function NT({children:e}){const n=ct(),i=K.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=n.getState();let N=h;for(const _ of f)N=typeof _=="function"?_(N):_;let E=jb({items:N,lookup:x});for(const _ of w.values())E=_(E);g&&d(N),E.length>0?m?.(E):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:j,setNodes:k}=n.getState();_&&k(j)})},[]),a=Lb(i),s=K.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let b=h;for(const w of f)b=typeof w=="function"?w(b):w;g?d(b):m&&m(jb({items:b,lookup:x}))},[]),o=Lb(s),u=K.useMemo(()=>({nodeQueue:a,edgeQueue:o}),[]);return v.jsx(Tw.Provider,{value:u,children:e})}function CT(){const e=K.useContext(Tw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const MT=e=>!!e.panZoom;function vm(){const e=wT(),n=ct(),i=CT(),a=Pe(MT),s=K.useMemo(()=>{const o=m=>n.getState().nodeLookup.get(m),u=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState(),w=Ob(m)?m:x.get(m.id),N=w.parentId?ew(w.position,w.measured,w.parentId,x,b):w.position,E={...w,position:N,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return fl(E)},d=(m,x,b={replace:!1})=>{u(w=>w.map(N=>{if(N.id===m){const E=typeof x=="function"?x(N):x;return b.replace&&Ob(E)?E:{...N,...E}}return N}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(N=>{if(N.id===m){const E=typeof x=="function"?x(N):x;return b.replace&&_T(E)?E:{...N,...E}}return N}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>o(m)?.internals.userNode,getInternalNode:o,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(x=>({...x}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=n.getState(),[w,N,E]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:N,zoom:E}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:N,onEdgesDelete:E,triggerNodeChanges:_,triggerEdgeChanges:j,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await J4({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Rb);E?.(A),j(G)}if(F){const G=L.map(Rb);N?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=sb(m),N=w?m:h(m),E=b!==void 0;return N?(b||n.getState().nodes).filter(_=>{const j=n.getState().nodeLookup.get(_.id);if(j&&!w&&(_.id===m.id||!j.internals.positionAbsolute))return!1;const k=fl(E?_:j),C=Js(k,N);return x&&C>0||C>=k.width*k.height||C>=N.width*N.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const N=sb(m)?m:h(m);if(!N)return!1;const E=Js(N,x);return b&&E>0||E>=x.width*x.height||E>=N.width*N.height},updateNode:d,updateNodeData:(m,x,b={replace:!1})=>{d(m,w=>{const N=typeof x=="function"?x(w):x;return b.replace?{...w,data:N}:{...w,data:{...w.data,...N}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const N=typeof x=="function"?x(w):x;return b.replace?{...w,data:N}:{...w,data:{...w.data,...N}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState();return G4(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??nM();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return K.useMemo(()=>({...s,...e,viewportInitialized:a}),[a])}const Hb=e=>e.selected,TT=typeof window<"u"?window:void 0;function AT({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=vm(),s=eo(e,{actInsideInputWithModifier:!1}),o=eo(n,{target:TT});K.useEffect(()=>{if(s){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(Hb),edges:u.filter(Hb)}),i.setState({nodesSelectionActive:!1})}},[s]),K.useEffect(()=>{i.setState({multiSelectionActive:o})},[o])}function zT(e){const n=ct();K.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=pm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",ri.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(e.current),()=>{window.removeEventListener("resize",i),a&&e.current&&a.unobserve(e.current)}}},[])}const af={position:"absolute",width:"100%",height:"100%",top:0,left:0},DT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Jr.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:N,noPanClassName:E,onViewportChange:_,isControlledViewport:j,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=K.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Pe(DT,ut),q=eo(x),V=K.useRef();zT(A);const Y=K.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),j||L.setState({transform:te})},[_,j]);return K.useEffect(()=>{if(A.current){V.current=BM({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:D=>L.setState({paneDragging:D}),onPanZoomStart:(D,U)=>{const{onViewportChangeStart:P,onMoveStart:Q}=L.getState();Q?.(D,U),P?.(U)},onPanZoom:(D,U)=>{const{onViewportChange:P,onMove:Q}=L.getState();Q?.(D,U),P?.(U)},onPanZoomEnd:(D,U)=>{const{onViewportChangeEnd:P,onMoveEnd:Q}=L.getState();Q?.(D,U),P?.(U)}});const{x:te,y:O,zoom:B}=V.current.getViewport();return L.setState({panZoom:V.current,transform:[te,O,B],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),K.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:b,noPanClassName:E,userSelectionActive:H,noWheelClassName:N,lib:F,onTransformChange:Y,connectionInProgress:G,selectionOnDrag:C,paneClickDistance:k})},[e,n,i,a,s,o,u,f,q,b,E,H,N,F,Y,G,C,k]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:af,children:w})}const RT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function OT(){const{userSelectionActive:e,userSelectionRect:n}=Pe(RT,ut);return e&&n?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Qh=(e,n)=>i=>{i.target===n.current&&e?.(i)},LT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function HT({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Ks.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const N=ct(),{userSelectionActive:E,elementsSelectable:_,dragging:j,connectionInProgress:k}=Pe(LT,ut),C=_&&(e||E),L=K.useRef(null),A=K.useRef(),H=K.useRef(new Set),F=K.useRef(new Set),G=K.useRef(!1),q=P=>{if(G.current||k){G.current=!1;return}h?.(P),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},V=P=>{if(Array.isArray(a)&&a?.includes(2)){P.preventDefault();return}d?.(P)},Y=g?P=>g(P):void 0,te=P=>{G.current&&(P.stopPropagation(),G.current=!1)},O=P=>{const{domNode:Q}=N.getState();if(A.current=Q?.getBoundingClientRect(),!A.current)return;const z=P.target===L.current;if(!z&&!!P.target.closest(".nokey")||!e||!(o&&z||n)||P.button!==0||!P.isPrimary)return;P.target?.setPointerCapture?.(P.pointerId),G.current=!1;const{x:T,y:ie}=Vn(P.nativeEvent,A.current);N.setState({userSelectionRect:{width:0,height:0,startX:T,startY:ie,x:T,y:ie}}),z||(P.stopPropagation(),P.preventDefault())},B=P=>{const{userSelectionRect:Q,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:T,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=N.getState();if(!A.current||!Q)return;const{x:ue,y:me}=Vn(P.nativeEvent,A.current),{startX:Ee,startY:Ce}=Q;if(!G.current){const Xe=n?0:s;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(P)}G.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=H.current,Re=F.current;H.current=new Set(dm(R,we,z,i===Ks.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=T.get(Xe);if(ht)for(const{edgeId:sn}of ht.values()){const Lt=$.get(sn);Lt&&(Lt.selectable??Ze)&&F.current.add(sn)}}if(!ob(Ne,H.current)){const Xe=el(R,H.current,!0);ie(Xe)}if(!ob(Re,F.current)){const Xe=el($,F.current);ce(Xe)}N.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},D=P=>{P.button===0&&(P.target?.releasePointerCapture?.(P.pointerId),!E&&P.target===L.current&&N.getState().userSelectionRect&&q?.(P),N.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f?.(P),N.setState({nodesSelectionActive:H.current.size>0})))},U=a===!0||Array.isArray(a)&&a.includes(0);return v.jsxs("div",{className:_t(["react-flow__pane",{draggable:U,dragging:j,selection:e}]),onClick:C?void 0:Qh(q,L),onContextMenu:Qh(V,L),onWheel:Qh(Y,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?D:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:af,children:[w,v.jsx(OT,{})]})}function Hp({id:e,store:n,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:u,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",ri.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([e])}function Aw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:s,isSelectable:o,nodeClickDistance:u}){const f=ct(),[h,d]=K.useState(!1),g=K.useRef();return K.useEffect(()=>{g.current=kM({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Hp({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),K.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:a,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,a,n,o,e,s]),h}const BT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function zw(){const e=ct();return K.useCallback(i=>{const{nodeExtent:a,snapToGrid:s,snapGrid:o,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=BT(u),b=s?o[0]:5,w=s?o[1]:5,N=i.direction.x*b*i.factor,E=i.direction.y*w*i.factor;for(const[,_]of d){if(!x(_))continue;let j={x:_.internals.positionAbsolute.x+N,y:_.internals.positionAbsolute.y+E};s&&(j=co(j,o));const{position:k,positionAbsolute:C}=Zv({nodeId:_.id,nextPosition:j,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const wm=K.createContext(null),UT=wm.Provider;wm.Consumer;const Dw=()=>K.useContext(wm),IT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),qT=(e,n,i)=>a=>{const{connectionClickStartHandle:s,connectionMode:o,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:s?.nodeId===e&&s?.id===n&&s?.type===i,isPossibleEndHandle:o===ul.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:g&&d}};function $T({type:e="source",position:n=be.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,N=e==="target",E=ct(),_=Dw(),{connectOnClick:j,noPanClassName:k,rfId:C}=Pe(IT,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Pe(qT(_,w,e),ut);_||E.getState().onError?.("010",ri.error010());const Y=B=>{const{defaultEdgeOptions:D,onConnect:U,hasDefaultEdges:P}=E.getState(),Q={...D,...B};if(P){const{edges:z,setEdges:R}=E.getState();R(sw(Q,z))}U?.(Q),f?.(Q)},te=B=>{if(!_)return;const D=iw(B.nativeEvent);if(s&&(D&&B.button===0||!D)){const U=E.getState();Lp.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:N,handleId:w,nodeId:_,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:Y,isValidConnection:i||U.isValidConnection,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}D?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:D,onClickConnectEnd:U,connectionClickStartHandle:P,connectionMode:Q,isValidConnection:z,lib:R,rfId:$,nodeLookup:T,connection:ie}=E.getState();if(!_||!P&&!s)return;if(!P){D?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=tw(B.target),fe=i||z,{connection:he,isValid:ue}=Lp.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:Q,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:T});ue&&he&&Y(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,U?.(B,me),E.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":n,"data-id":`${C}-${_}-${w}-${e}`,className:_t(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!N,target:N,connectable:a,connectablestart:s,connectableend:o,clickconnecting:H,connectingfrom:L,connectingto:A,valid:V,connectionindicator:a&&(!G||F)&&(G||q?o:s)}]),onMouseDown:te,onTouchStart:te,onClick:j?O:void 0,ref:b,...x,children:h})}const pl=K.memo(Mw($T));function VT({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(pl,{type:"source",position:i,isConnectable:n})]})}function YT({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(pl,{type:"source",position:a,isConnectable:n})]})}function PT(){return null}function XT({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label]})}const Uc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bb={input:VT,default:YT,output:XT,group:PT};function FT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const GT=e=>{const{width:n,height:i,x:a,y:s}=uo(e.nodeLookup,{filter:o=>!!o.selected});return{width:$n(n)?n:null,height:$n(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${s}px)`}};function ZT({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:s,height:o,transformString:u,userSelectionActive:f}=Pe(GT,ut),h=zw(),d=K.useRef(null);if(K.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),Aw({nodeRef:d}),f||!s||!o)return null;const g=e?x=>{const b=a.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Uc,x.key)&&(x.preventDefault(),h({direction:Uc[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:_t(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:v.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:s,height:o}})})}const Ub=typeof window<"u"?window:void 0,QT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function jw({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:N,zoomActivationKeyCode:E,elementsSelectable:_,zoomOnScroll:j,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:F,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:Y,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:B,noPanClassName:D,disableKeyboardA11y:U,onViewportChange:P,isControlledViewport:Q}){const{nodesSelectionActive:z,userSelectionActive:R}=Pe(QT,ut),$=eo(d,{target:Ub}),T=eo(N,{target:Ub}),ie=T||F,ce=T||C,fe=g&&ie!==!0,he=$||R||fe;return AT({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(jT,{onPaneContextMenu:o,elementsSelectable:_,zoomOnScroll:j,zoomOnPinch:k,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&ie,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:Y,zoomActivationKeyCode:E,preventScrolling:te,noWheelClassName:B,noPanClassName:D,onViewportChange:P,isControlledViewport:Q,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(HT,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&v.jsx(ZT,{onSelectionContextMenu:O,noPanClassName:D,disableKeyboardA11y:U})]})})}jw.displayName="FlowRenderer";const KT=K.memo(jw),JT=e=>n=>e?dm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function WT(e){return Pe(K.useCallback(JT(e),[e]),ut)}const eA=e=>e.updateNodeInternals;function tA(){const e=Pe(eA),[n]=K.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(s=>{const o=s.target.getAttribute("data-id");a.set(o,{id:o,nodeElement:s.target,force:!0})}),e(a)}));return K.useEffect(()=>()=>{n?.disconnect()},[n]),n}function nA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const s=ct(),o=K.useRef(null),u=K.useRef(null),f=K.useRef(e.sourcePosition),h=K.useRef(e.targetPosition),d=K.useRef(n),g=i&&!!e.internals.handleBounds;return K.useEffect(()=>{o.current&&!e.hidden&&(!g||u.current!==o.current)&&(u.current&&a?.unobserve(u.current),a?.observe(o.current),u.current=o.current)},[g,e.hidden]),K.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),K.useEffect(()=>{if(o.current){const m=d.current!==n,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(m||x||b)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),o}function iA({id:e,onClick:n,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:o,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:N,nodeTypes:E,nodeClickDistance:_,onError:j}){const{node:k,internals:C,isParent:L}=Pe(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ut);let A=k.type||"default",H=E?.[A]||Bb[A];H===void 0&&(j?.("003",ri.error003(A)),A="default",H=E?.default||Bb.default);const F=!!(k.draggable||f&&typeof k.draggable>"u"),G=!!(k.selectable||h&&typeof k.selectable>"u"),q=!!(k.connectable||d&&typeof k.connectable>"u"),V=!!(k.focusable||g&&typeof k.focusable>"u"),Y=ct(),te=Wv(k),O=nA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=Aw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),D=zw();if(k.hidden)return null;const U=Bi(k),P=FT(k),Q=G||F||n||i||a||s,z=i?ue=>i(ue,{...C.userNode}):void 0,R=a?ue=>a(ue,{...C.userNode}):void 0,$=s?ue=>s(ue,{...C.userNode}):void 0,T=o?ue=>o(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=Y.getState();G&&(!me||!F||Ee>0)&&Hp({id:e,store:Y,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(nw(ue.nativeEvent)||w)){if(Yv.includes(ue.key)&&G){const me=ue.key==="Escape";Hp({id:e,store:Y,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Uc,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=Y.getState();Y.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),D({direction:Uc[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=Y.getState();if(!Ce)return;dm(new Map([[e,k]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(k.position.x+U.width/2,k.position.y+U.height/2,{zoom:ue[2]})};return v.jsx("div",{className:_t(["react-flow__node",`react-flow__node-${A}`,{[b]:F},k.className,{selected:k.selected,selectable:G,parent:L,draggable:F,dragging:B}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...k.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:T,onClick:ce,onDoubleClick:ie,onKeyDown:V?fe:void 0,tabIndex:V?0:void 0,onFocus:V?he:void 0,role:k.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${Sw}-${N}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx(UT,{value:e,children:v.jsx(H,{id:e,data:k.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:G,draggable:F,deletable:k.deletable??!0,isConnectable:q,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:B,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...U})})})}var rA=K.memo(iA);const aA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Rw(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,onError:o}=Pe(aA,ut),u=WT(e.onlyRenderVisibleElements),f=tA();return v.jsx("div",{className:"react-flow__nodes",style:af,children:u.map(h=>v.jsx(rA,{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:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},h))})}Rw.displayName="NodeRenderer";const lA=K.memo(Rw);function sA(e){return Pe(K.useCallback(i=>{if(!e)return i.edges.map(s=>s.id);const a=[];if(i.width&&i.height)for(const s of i.edges){const o=i.nodeLookup.get(s.source),u=i.nodeLookup.get(s.target);o&&u&&lM({sourceNode:o,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(s.id)}return a},[e]),ut)}const oA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},uA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ib={[Lc.Arrow]:oA,[Lc.ArrowClosed]:uA};function cA(e){const n=ct();return K.useMemo(()=>Object.prototype.hasOwnProperty.call(Ib,e)?Ib[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const fA=({id:e,type:n,color:i,width:a=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=cA(n);return h?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:f,refX:"0",refY:"0",children:v.jsx(h,{color:i,strokeWidth:u})}):null},Ow=({defaultColor:e,rfId:n})=>{const i=Pe(o=>o.edges),a=Pe(o=>o.defaultEdgeOptions),s=K.useMemo(()=>hM(i,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,n,e]);return s.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:s.map(o=>v.jsx(fA,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Ow.displayName="MarkerDefinitions";var dA=K.memo(Ow);function Lw({x:e,y:n,label:i,labelStyle:a,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=K.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=K.useRef(null);return K.useEffect(()=>{if(w.current){const N=w.current.getBBox();x({x:N.x,y:N.y,width:N.width,height:N.height})}},[i]),i?v.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[s&&v.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:o,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:a,children:i}),h]}):null}Lw.displayName="EdgeText";const hA=K.memo(Lw);function lf({path:e,labelX:n,labelY:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:_t(["react-flow__edge-path",g.className])}),d?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(i)?v.jsx(hA,{x:n,y:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function qb({pos:e,x1:n,y1:i,x2:a,y2:s}){return e===be.Left||e===be.Right?[.5*(n+a),i]:[n,.5*(i+s)]}function Hw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top}){const[u,f]=qb({pos:i,x1:e,y1:n,x2:a,y2:s}),[h,d]=qb({pos:o,x1:a,y1:s,x2:e,y2:n}),[g,m,x,b]=rw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${u},${f} ${h},${d} ${a},${s}`,g,m,x,b]}function Bw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:N,markerStart:E,interactionWidth:_})=>{const[j,k,C]=Hw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(lf,{id:L,path:j,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:N,markerStart:E,interactionWidth:_})})}const pA=Bw({isInternal:!1}),Uw=Bw({isInternal:!0});pA.displayName="SimpleBezierEdge";Uw.displayName="SimpleBezierEdgeInternal";function Iw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:N,markerStart:E,pathOptions:_,interactionWidth:j})=>{const[k,C,L]=jp({sourceX:i,sourceY:a,sourcePosition:b,targetX:s,targetY:o,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:N,markerStart:E,interactionWidth:j})})}const qw=Iw({isInternal:!1}),$w=Iw({isInternal:!0});qw.displayName="SmoothStepEdge";$w.displayName="SmoothStepEdgeInternal";function Vw(e){return K.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx(qw,{...i,id:a,pathOptions:K.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const mA=Vw({isInternal:!1}),Yw=Vw({isInternal:!0});mA.displayName="StepEdge";Yw.displayName="StepEdgeInternal";function Pw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:N})=>{const[E,_,j]=ow({sourceX:i,sourceY:a,targetX:s,targetY:o}),k=e.isInternal?void 0:n;return v.jsx(lf,{id:k,path:E,labelX:_,labelY:j,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:N})})}const gA=Pw({isInternal:!1}),Xw=Pw({isInternal:!0});gA.displayName="StraightEdge";Xw.displayName="StraightEdgeInternal";function Fw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:N,markerStart:E,pathOptions:_,interactionWidth:j})=>{const[k,C,L]=aw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:N,markerStart:E,interactionWidth:j})})}const yA=Fw({isInternal:!1}),Gw=Fw({isInternal:!0});yA.displayName="BezierEdge";Gw.displayName="BezierEdgeInternal";const $b={default:Gw,straight:Xw,step:Yw,smoothstep:$w,simplebezier:Uw},Vb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},xA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,bA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Yb="react-flow__edgeupdater";function Pb({position:e,centerX:n,centerY:i,radius:a=10,onMouseDown:s,onMouseEnter:o,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:u,className:_t([Yb,`${Yb}-${f}`]),cx:xA(n,a,e),cy:bA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function vA({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:a,sourceY:s,targetX:o,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ct(),N=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:F,connectionMode:G,connectionRadius:q,lib:V,onConnectStart:Y,onConnectEnd:te,cancelConnection:O,nodeLookup:B,rfId:D,panBy:U,updateConnection:P}=w.getState(),Q=L.type==="target",z=(T,ie)=>{x(!1),m?.(T,i,L.type,ie)},R=T=>d?.(i,T),$=(T,ie)=>{x(!0),g?.(C,i,L.type),Y?.(T,ie)};Lp.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:Q,edgeUpdaterType:L.type,lib:V,flowId:D,cancelConnection:O,panBy:U,isValidConnection:F,onConnect:R,onConnectStart:$,onConnectEnd:te,onReconnectEnd:z,updateConnection:P,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},E=C=>N(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=C=>N(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),j=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Pb,{position:f,centerX:a,centerY:s,radius:n,onMouseDown:E,onMouseEnter:j,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Pb,{position:h,centerX:o,centerY:u,radius:n,onMouseDown:_,onMouseEnter:j,onMouseOut:k,type:"target"})]})}function wA({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:a,onClick:s,onDoubleClick:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:N,noPanClassName:E,onError:_,disableKeyboardA11y:j}){let k=Pe(we=>we.edgeLookup.get(e));const C=Pe(we=>we.defaultEdgeOptions);k=C?{...C,...k}:k;let L=k.type||"default",A=N?.[L]||$b[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=N?.default||$b.default);const H=!!(k.focusable||n&&typeof k.focusable>"u"),F=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),G=!!(k.selectable||a&&typeof k.selectable>"u"),q=K.useRef(null),[V,Y]=K.useState(!1),[te,O]=K.useState(!1),B=ct(),{zIndex:D,sourceX:U,sourceY:P,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$}=Pe(K.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Vb};const Ze=dM({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:aM({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Vb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),T=K.useMemo(()=>k.markerStart?`url('#${Rp(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=K.useMemo(()=>k.markerEnd?`url('#${Rp(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||P===null||Q===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Re,multiSelectionActive:Ze}=B.getState();G&&(B.setState({nodesSelectionActive:!1}),k.selected&&Ze?(Re({nodes:[],edges:[k]}),q.current?.blur()):Ne([e])),s&&s(we,k)},fe=o?we=>{o(we,{...k})}:void 0,he=u?we=>{u(we,{...k})}:void 0,ue=f?we=>{f(we,{...k})}:void 0,me=h?we=>{h(we,{...k})}:void 0,Ee=d?we=>{d(we,{...k})}:void 0,Ce=we=>{if(!j&&Yv.includes(we.key)&&G){const{unselectNodesAndEdges:Ne,addSelectedEdges:Re}=B.getState();we.key==="Escape"?(q.current?.blur(),Ne({edges:[k]})):Re([e])}};return v.jsx("svg",{style:{zIndex:D},children:v.jsxs("g",{className:_t(["react-flow__edge",`react-flow__edge-${L}`,k.className,E,{selected:k.selected,animated:k.animated,inactive:!G&&!s,updating:V,selectable:G}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:H?Ce:void 0,tabIndex:H?0:void 0,role:k.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":H?`${_w}-${w}`:void 0,ref:q,...k.domAttributes,children:[!te&&v.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:G,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:U,sourceY:P,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:T,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(vA,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:P,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:Y,setReconnecting:O})]})})}var SA=K.memo(wA);const _A=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Zw({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:a,noPanClassName:s,onReconnect:o,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:N}){const{edgesFocusable:E,edgesReconnectable:_,elementsSelectable:j,onError:k}=Pe(_A,ut),C=sA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(dA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(SA,{id:L,edgesFocusable:E,edgesReconnectable:_,elementsSelectable:j,noPanClassName:s,onReconnect:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:a,disableKeyboardA11y:N},L))]})}Zw.displayName="EdgeRenderer";const kA=K.memo(Zw),EA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function NA({children:e}){const n=Pe(EA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function CA(e){const n=vm(),i=K.useRef(!1);K.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const MA=e=>e.panZoom?.syncViewport;function TA(e){const n=Pe(MA),i=ct();return K.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function AA(e){return e.connection.inProgress?{...e.connection,to:fo(e.connection.to,e.transform)}:{...e.connection}}function zA(e){return AA}function DA(e){const n=zA();return Pe(n,ut)}const jA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function RA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:s,width:o,height:u,isValid:f,inProgress:h}=Pe(jA,ut);return!(o&&s&&h)?null:v.jsx("svg",{style:e,width:o,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:_t(["react-flow__connection",Fv(f)]),children:v.jsx(Qw,{style:n,type:i,CustomComponent:a,isValid:f})})})}const Qw=({style:e,type:n=wr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:s,from:o,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:b}=DA();if(!s)return;if(i)return v.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Fv(a),toNode:g,toHandle:m,pointer:b});let w="";const N={sourceX:o.x,sourceY:o.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case wr.Bezier:[w]=aw(N);break;case wr.SimpleBezier:[w]=Hw(N);break;case wr.Step:[w]=jp({...N,borderRadius:0});break;case wr.SmoothStep:[w]=jp(N);break;default:[w]=ow(N)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Qw.displayName="ConnectionLine";const OA={};function Xb(e=OA){K.useRef(e),ct(),K.useEffect(()=>{},[e])}function LA(){ct(),K.useRef(!1),K.useEffect(()=>{},[])}function Kw({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:N,connectionLineComponent:E,connectionLineContainerStyle:_,selectionKeyCode:j,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,defaultViewport:V,translateExtent:Y,minZoom:te,maxZoom:O,preventScrolling:B,defaultMarkerColor:D,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:Q,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:T,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii,viewport:ae,onViewportChange:pe}){return Xb(e),Xb(n),LA(),CA(i),TA(ae),v.jsx(KT,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:j,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:P,zoomOnDoubleClick:$,panOnScroll:Q,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:T,defaultViewport:V,translateExtent:Y,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,onViewportChange:pe,isControlledViewport:!!ae,children:v.jsxs(NA,{children:[v.jsx(kA,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:u,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,onlyRenderVisibleElements:G,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,defaultMarkerColor:D,noPanClassName:si,disableKeyboardA11y:oi,rfId:Ii}),v.jsx(RA,{style:N,type:w,component:E,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(lA,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:o,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:G,noPanClassName:si,noDragClassName:Gt,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}Kw.displayName="GraphView";const HA=K.memo(Kw),Fb=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,N=new Map,E=new Map,_=a??n??[],j=i??e??[],k=g??[0,0],C=m??Qs;fw(N,E,_);const L=Op(j,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&s&&o){const H=uo(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=hm(H,s,o,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:s??0,height:o??0,transform:A,nodes:j,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:E,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Qs,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ul.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,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:f,fitViewResolver:null,connection:{...Xv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:W4,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Pv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BA=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>nT((b,w)=>{async function N(){const{nodeLookup:E,panZoom:_,fitViewOptions:j,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await K4({nodes:E,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},j),k?.resolve(!0),b({fitViewResolver:null}))}return{...Fb({nodes:e,edges:n,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:E=>{const{nodeLookup:_,parentLookup:j,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Op(E,_,j,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&H?(N(),b({nodes:E,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:E,nodesInitialized:H})},setEdges:E=>{const{connectionLookup:_,edgeLookup:j}=w();fw(_,j,E),b({edges:E})},setDefaultNodesAndEdges:(E,_)=>{if(E){const{setNodes:j}=w();j(E),b({hasDefaultNodes:!0})}if(_){const{setEdges:j}=w();j(_),b({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:_,nodeLookup:j,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=vM(E,j,k,C,L,A,G);V&&(gM(j,k,{nodeOrigin:L,nodeExtent:A,zIndexMode:G}),F?(N(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),q?.length>0&&(H&&console.log("React Flow: trigger node changes",q),_?.(q)))},updateNodePositions:(E,_=!1)=>{const j=[];let k=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:F}=w();for(const[G,q]of E){const V=C.get(G),Y=!!(V?.expandParent&&V?.parentId&&q?.position),te={id:G,type:"position",position:Y?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:_};if(V&&A.inProgress&&A.fromNode.id===V.id){const O=na(V,A.fromHandle,be.Left,!0);H({...A,from:O})}Y&&V.parentId&&j.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(j.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=bm(j,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:E=>{const{onNodesChange:_,setNodes:j,nodes:k,hasDefaultNodes:C,debug:L}=w();if(E?.length){if(C){const A=Nw(E,k);j(A)}L&&console.log("React Flow: trigger node changes",E),_?.(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:_,setEdges:j,edges:k,hasDefaultEdges:C,debug:L}=w();if(E?.length){if(C){const A=Cw(E,k);j(A)}L&&console.log("React Flow: trigger edge changes",E),_?.(E)}},addSelectedNodes:E=>{const{multiSelectionActive:_,edgeLookup:j,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=E.map(H=>Gr(H,!0));C(A);return}C(el(k,new Set([...E]),!0)),L(el(j))},addSelectedEdges:E=>{const{multiSelectionActive:_,edgeLookup:j,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=E.map(H=>Gr(H,!0));L(A);return}L(el(j,new Set([...E]))),C(el(k,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:_}={})=>{const{edges:j,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=E||k,F=_||j,G=H.map(V=>{const Y=C.get(V.id);return Y&&(Y.selected=!1),Gr(V.id,!1)}),q=F.map(V=>Gr(V.id,!1));L(G),A(q)},setMinZoom:E=>{const{panZoom:_,maxZoom:j}=w();_?.setScaleExtent([E,j]),b({minZoom:E})},setMaxZoom:E=>{const{panZoom:_,minZoom:j}=w();_?.setScaleExtent([j,E]),b({maxZoom:E})},setTranslateExtent:E=>{w().panZoom?.setTranslateExtent(E),b({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:_,triggerNodeChanges:j,triggerEdgeChanges:k,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]),A=E.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]);j(L),k(A)},setNodeExtent:E=>{const{nodes:_,nodeLookup:j,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:H}=w();E[0][0]===A[0][0]&&E[0][1]===A[0][1]&&E[1][0]===A[1][0]&&E[1][1]===A[1][1]||(Op(_,j,k,{nodeOrigin:C,nodeExtent:E,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:E}))},panBy:E=>{const{transform:_,width:j,height:k,panZoom:C,translateExtent:L}=w();return wM({delta:E,panZoom:C,transform:_,translateExtent:L,width:j,height:k})},setCenter:async(E,_,j)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof j?.zoom<"u"?j.zoom:L;return await A.setViewport({x:k/2-E*H,y:C/2-_*H,zoom:H},{duration:j?.duration,ease:j?.ease,interpolate:j?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Xv}})},updateConnection:E=>{b({connection:E})},reset:()=>b({...Fb()})}},Object.is);function Jw({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:o,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=K.useState(()=>BA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(iT,{value:w,children:v.jsx(NT,{children:b})})}function UA({children:e,nodes:n,edges:i,defaultNodes:a,defaultEdges:s,width:o,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return K.useContext(nf)?v.jsx(v.Fragment,{children:e}):v.jsx(Jw,{initialNodes:n,initialEdges:i,defaultNodes:a,defaultEdges:s,initialWidth:o,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const IA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function qA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,className:s,nodeTypes:o,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:N,onClickConnectStart:E,onClickConnectEnd:_,onNodeMouseEnter:j,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onNodesDelete:q,onEdgesDelete:V,onDelete:Y,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:D,onSelectionContextMenu:U,onSelectionStart:P,onSelectionEnd:Q,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=Ks.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=Ws()?"Meta":"Control",zoomActivationKeyCode:we=Ws()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=kw,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et=!0,defaultViewport:Ii=gT,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=Qs,preventScrolling:je=!0,nodeExtent:$e,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:On=!0,zoomOnPinch:At=!0,panOnScroll:pt=!1,panOnScrollSpeed:Ht=.5,panOnScrollMode:Ke=Jr.Free,zoomOnDoubleClick:Gn=!0,panOnDrag:on=!0,onPaneClick:wf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r=1,nodeClickDistance:Sf=0,children:So,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:_f,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No=10,onNodesChange:Co,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ua,fitViewOptions:Mo,connectOnClick:kf,attributionPosition:To,proOptions:Er,defaultEdgeOptions:_l,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Yi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,connectionRadius:zo,isValidConnection:fi,onError:Pi,style:Ef,id:kl,nodeDragThreshold:Do,connectionDragThreshold:Nf,viewport:ca,onViewportChange:fa,width:Ln,height:Zt,colorMode:jo="light",debug:Cf,onScroll:da,ariaLabelConfig:Ro,zIndexMode:Nr="basic",...Mf},Qt){const Cr=kl||"1",Oo=vT(jo),El=K.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),da?.(di)},[da]);return v.jsx("div",{"data-testid":"rf__wrapper",...Mf,onScroll:El,style:{...Ef,...IA},ref:Qt,className:_t(["react-flow",s,Oo]),id:kl,role:"application",children:v.jsxs(UA,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ua,fitViewOptions:Mo,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(HA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:j,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:u,connectionLineType:$,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Ze,defaultViewport:Ii,translateExtent:_e,minZoom:ae,maxZoom:pe,preventScrolling:je,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:on,onPaneClick:wf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r,nodeClickDistance:Sf,onSelectionContextMenu:U,onSelectionStart:P,onSelectionEnd:Q,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:_f,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:ca,onViewportChange:fa}),v.jsx(bT,{nodes:e,edges:n,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:w,onConnectEnd:N,onClickConnectStart:E,onClickConnectEnd:_,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et,elevateNodesOnSelect:qi,elevateEdgesOnSelect:$i,minZoom:ae,maxZoom:pe,nodeExtent:$e,onNodesChange:Co,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:kf,defaultEdgeOptions:_l,fitView:ua,fitViewOptions:Mo,onNodesDelete:q,onEdgesDelete:V,onDelete:Y,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:D,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Yi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,onError:Pi,connectionRadius:zo,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:Do,connectionDragThreshold:Nf,onBeforeDelete:z,debug:Cf,ariaLabelConfig:Ro,zIndexMode:Nr}),v.jsx(mT,{onSelectionChange:te}),So,v.jsx(cT,{proOptions:Er,position:To}),v.jsx(uT,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var $A=Mw(qA);function VA({dimensions:e,lineWidth:n,variant:i,className:a}){return v.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_t(["react-flow__background-pattern",i,a])})}function YA({radius:e,className:n}){return v.jsx("circle",{cx:e,cy:e,r:e,className:_t(["react-flow__background-pattern","dots",n])})}var Oi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oi||(Oi={}));const PA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},XA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ww({id:e,variant:n=Oi.Dots,gap:i=20,size:a,lineWidth:s=1,offset:o=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=K.useRef(null),{transform:x,patternId:b}=Pe(XA,ut),w=a||PA[n],N=n===Oi.Dots,E=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],j=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(o)?o:[o,o],L=E?[k,k]:j,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],H=`${b}${e||""}`;return v.jsxs("svg",{className:_t(["react-flow__background",d]),style:{...h,...af,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:H,x:x[0]%j[0],y:x[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:N?v.jsx(YA,{radius:k/2,className:g}):v.jsx(VA,{dimensions:L,lineWidth:s,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}Ww.displayName="Background";const FA=K.memo(Ww);function GA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function QA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 KA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 JA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 Wu({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const WA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function eS({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ct(),{isInteractive:N,minZoomReached:E,maxZoomReached:_,ariaLabelConfig:j}=Pe(WA,ut),{zoomIn:k,zoomOut:C,fitView:L}=vm(),A=()=>{k(),o?.()},H=()=>{C(),u?.()},F=()=>{L(s),f?.()},G=()=>{w.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),h?.(!N)},q=x==="horizontal"?"horizontal":"vertical";return v.jsxs(rf,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??j["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(Wu,{onClick:A,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(GA,{})}),v.jsx(Wu,{onClick:H,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:E,children:v.jsx(ZA,{})})]}),i&&v.jsx(Wu,{className:"react-flow__controls-fitview",onClick:F,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:v.jsx(QA,{})}),a&&v.jsx(Wu,{className:"react-flow__controls-interactive",onClick:G,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:N?v.jsx(JA,{}):v.jsx(KA,{})}),g]})}eS.displayName="Controls";const e3=K.memo(eS);function t3({id:e,x:n,y:i,width:a,height:s,style:o,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:N}=o||{},E=u||w||N;return v.jsx("rect",{className:_t(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:a,height:s,style:{fill:E,stroke:f,strokeWidth:h},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const n3=K.memo(t3),i3=e=>e.nodes.map(n=>n.id),Kh=e=>e instanceof Function?e:()=>e;function r3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:o=n3,onClick:u}){const f=Pe(i3,ut),h=Kh(n),d=Kh(e),g=Kh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(l3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:o,onClick:u,shapeRendering:m},x))})}function a3({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:b}=Pe(w=>{const{internals:N}=w.nodeLookup.get(e),E=N.userNode,{x:_,y:j}=N.positionAbsolute,{width:k,height:C}=Bi(E);return{node:E,x:_,y:j,width:k,height:C}},ut);return!d||d.hidden||!Wv(d)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:d.style,selected:!!d.selected,className:a(d),color:n(d),borderRadius:s,strokeColor:i(d),strokeWidth:o,shapeRendering:u,onClick:h,id:d.id})}const l3=K.memo(a3);var s3=K.memo(r3);const o3=200,u3=150,c3=e=>!e.hidden,f3=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?Jv(uo(e.nodeLookup,{filter:c3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},d3="react-flow__minimap-desc";function tS({style:e,className:n,nodeStrokeColor:i,nodeColor:a,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:N=!1,zoomable:E=!1,ariaLabel:_,inversePan:j,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=K.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:Y,flowHeight:te,ariaLabelConfig:O}=Pe(f3,ut),B=e?.width??o3,D=e?.height??u3,U=H.width/B,P=H.height/D,Q=Math.max(U,P),z=Q*B,R=Q*D,$=C*Q,T=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${d3}-${G}`,ue=K.useRef(0),me=K.useRef();ue.current=Q,K.useEffect(()=>{if(A.current&&q)return me.current=AM({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),K.useEffect(()=>{me.current?.update({translateExtent:V,width:Y,height:te,inversePan:j,pannable:N,zoomStep:k,zoomable:E})},[N,E,j,k,V,Y,te]);const Ee=b?Ne=>{const[Re,Ze]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:Re,y:Ze})}:void 0,Ce=w?K.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(rf,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*Q:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:_t(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:D,viewBox:`${T} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:A,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(s3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-$},${ie-$}h${ce+$*2}v${fe+$*2}h${-ce-$*2}z
|
|
15
|
-
M${F.x},${F.y}h${F.width}v${F.height}h${-F.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}tS.displayName="MiniMap";const h3=K.memo(tS),p3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,m3={[hl.Line]:"right",[hl.Handle]:"bottom-right"};function g3({nodeId:e,position:n,variant:i=hl.Handle,className:a,style:s=void 0,children:o,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:N,onResize:E,onResizeEnd:_}){const j=Dw(),k=typeof e=="string"?e:j,C=ct(),L=K.useRef(null),A=i===hl.Handle,H=Pe(K.useCallback(p3(A&&b),[A,b]),ut),F=K.useRef(null),G=n??m3[i];K.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=YM({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:Y,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:D}=C.getState();return{nodeLookup:V,transform:Y,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:D}},onChange:(V,Y)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:D}=C.getState(),U=[],P={x:V.x,y:V.y},Q=O.get(k);if(Q&&Q.expandParent&&Q.parentId){const z=Q.origin??D,R=V.width??Q.measured.width??0,$=V.height??Q.measured.height??0,T={id:Q.id,parentId:Q.parentId,rect:{width:R,height:$,...ew({x:V.x??Q.position.x,y:V.y??Q.position.y},{width:R,height:$},Q.parentId,O,z)}},ie=bm([T],O,B,D);U.push(...ie),P.x=V.x?Math.max(z[0]*R,V.x):void 0,P.y=V.y?Math.max(z[1]*$,V.y):void 0}if(P.x!==void 0&&P.y!==void 0){const z={id:k,type:"position",position:{...P}};U.push(z)}if(V.width!==void 0&&V.height!==void 0){const R={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};U.push(R)}for(const z of Y){const R={...z,type:"position"};U.push(R)}te(U)},onEnd:({width:V,height:Y})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:V,height:Y}};C.getState().triggerNodeChanges([te])}})),F.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:N,onResize:E,onResizeEnd:_,shouldResize:w}),()=>{F.current?.destroy()}},[G,f,h,d,g,m,N,E,_,w]);const q=G.split("-");return v.jsx("div",{className:_t(["react-flow__resize-control","nodrag",...q,i,a]),ref:L,style:{...s,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:o})}K.memo(g3);const nS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const y3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const x3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Gb=e=>{const n=x3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var b3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const v3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const w3=K.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:o,iconNode:u,...f},h)=>K.createElement("svg",{ref:h,...b3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:nS("lucide",s),...!o&&!v3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>K.createElement(d,g)),...Array.isArray(o)?o:[o]]));const qe=(e,n)=>{const i=K.forwardRef(({className:a,...s},o)=>K.createElement(w3,{ref:o,iconNode:n,className:nS(`lucide-${y3(Gb(e))}`,`lucide-${e}`,a),...s}));return i.displayName=Gb(e),i};const S3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_3=qe("arrow-left",S3);const k3=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],E3=qe("bot",k3);const N3=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],sf=qe("chart-column",N3);const C3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M3=qe("check",C3);const T3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],A3=qe("chevron-down",T3);const z3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],D3=qe("chevron-up",z3);const j3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Bp=qe("circle-alert",j3);const R3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],iS=qe("circle-check-big",R3);const O3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L3=qe("circle-check",O3);const H3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],rS=qe("circle-x",H3);const B3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],il=qe("download",B3);const U3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],I3=qe("eye",U3);const q3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rl=qe("file-text",q3);const $3=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zb=qe("folder-open",$3);const V3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Y3=qe("globe",V3);const P3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],aS=qe("image",P3);const X3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],F3=qe("info",X3);const G3=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Z3=qe("link-2",G3);const Q3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],lS=qe("loader-circle",Q3);const K3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],J3=qe("maximize-2",K3);const W3=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],of=qe("message-square",W3);const e5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],t5=qe("minimize-2",e5);const n5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Sm=qe("play",n5);const i5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],_m=qe("plug",i5);const r5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],a5=qe("save",r5);const l5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],s5=qe("send",l5);const o5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],u5=qe("settings-2",o5);const c5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sS=qe("settings",c5);const f5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ho=qe("sparkles",f5);const d5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uf=qe("terminal",d5);const h5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cf=qe("trash-2",h5);const p5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],m5=qe("triangle-alert",p5);const g5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],y5=qe("upload",g5);const x5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],oS=qe("x",x5);const b5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ff=qe("zap",b5),Qb=e=>{let n;const i=new Set,a=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(b=>b(n,x))}},s=()=>n,f={setState:a,getState:s,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(a,s,f);return f},v5=(e=>e?Qb(e):Qb),w5=e=>e;function S5(e,n=w5){const i=Ls.useSyncExternalStore(e.subscribe,Ls.useCallback(()=>n(e.getState()),[e,n]),Ls.useCallback(()=>n(e.getInitialState()),[e,n]));return Ls.useDebugValue(i),i}const Kb=e=>{const n=v5(e),i=a=>S5(n,a);return Object.assign(i,n),i},km=(e=>e?Kb(e):Kb);function _5(e,n){let i;try{i=e()}catch{return}return{getItem:s=>{var o;const u=h=>h===null?null:JSON.parse(h,void 0),f=(o=i.getItem(s))!=null?o:null;return f instanceof Promise?f.then(u):u(f)},setItem:(s,o)=>i.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>i.removeItem(s)}}const Up=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return Up(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return Up(a)(i)}}}},k5=(e,n)=>(i,a,s)=>{let o={storage:_5(()=>localStorage),partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...n},u=!1,f=0;const h=new Set,d=new Set;let g=o.storage;if(!g)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...E)},a,s);const m=()=>{const E=o.partialize({...a()});return g.setItem(o.name,{state:E,version:o.version})},x=s.setState;s.setState=(E,_)=>(x(E,_),m());const b=e((...E)=>(i(...E),m()),a,s);s.getInitialState=()=>b;let w;const N=()=>{var E,_;if(!g)return;const j=++f;u=!1,h.forEach(C=>{var L;return C((L=a())!=null?L:b)});const k=((_=o.onRehydrateStorage)==null?void 0:_.call(o,(E=a())!=null?E:b))||void 0;return Up(g.getItem.bind(g))(o.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==o.version){if(o.migrate){const L=o.migrate(C.state,C.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var L;if(j!==f)return;const[A,H]=C;if(w=o.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{j===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{j===f&&k?.(void 0,C)})};return s.persist={setOptions:E=>{o={...o,...E},E.storage&&(g=E.storage)},clearStorage:()=>{g?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>N(),hasHydrated:()=>u,onHydrate:E=>(h.add(E),()=>{h.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},o.skipHydration||N(),w||b},E5=k5,N5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let to=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=N5[i[e]&63];return n};const Hi=km()(E5(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(a=>({nodes:a.nodes.map(s=>s.id===n?{...s,data:{...s.data,...i}}:s)})),updateNodeStatus:(n,i,a)=>e(s=>({nodes:s.nodes.map(o=>o.id===n?{...o,data:{...o.data,status:i,progress:a??o.data.progress}}:o)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(a=>a.id!==n),edges:i.edges.filter(a=>a.source!==n&&a.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(a=>a.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:n=>e({nodes:n}),setEdges:n=>e({edges:n})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),uS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),po=km((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,a)=>{e(s=>{const o=new Set(s.completedNodes);o.add(i);const u=new Map(s.results);return a!==void 0&&u.set(i,a),{completedNodes:o,results:u}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,a)=>{e(s=>{const o=new Set(s.failedNodes);return o.add(i),{failedNodes:o}}),n().addLog("error",a||"Node failed",i)},setWorkflowResults:(i,a)=>{e({workflowResults:i,outputDir:a||null}),i.forEach(s=>{s.result&&e(o=>{const u=new Map(o.results);return u.set(s.nodeId,s.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,a,s,o)=>{const u={id:to(),timestamp:Date.now(),level:i,message:a,nodeId:s,details:o};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,n,i,a,s){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,i),i}function ne(e,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!a:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:n.get(e)}let cS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return cS=e.randomUUID.bind(e),e.randomUUID();const n=new Uint8Array(1),i=e?()=>e.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};function no(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const Ip=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Te extends Error{}class qt extends Te{constructor(n,i,a,s){super(`${qt.makeMessage(n,i,a)}`),this.status=n,this.headers=s,this.requestID=s?.get("request-id"),this.error=i}static makeMessage(n,i,a){const s=i?.message?typeof i.message=="string"?i.message:JSON.stringify(i.message):i?JSON.stringify(i):a;return n&&s?`${n} ${s}`:n?`${n} status code (no body)`:s||"(no status code or body)"}static generate(n,i,a,s){if(!n||!s)return new df({message:a,cause:Ip(i)});const o=i;return n===400?new dS(n,o,a,s):n===401?new hS(n,o,a,s):n===403?new pS(n,o,a,s):n===404?new mS(n,o,a,s):n===409?new gS(n,o,a,s):n===422?new yS(n,o,a,s):n===429?new xS(n,o,a,s):n>=500?new bS(n,o,a,s):new qt(n,o,a,s)}}class Yn extends qt{constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class df extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class fS extends df{constructor({message:n}={}){super({message:n??"Request timed out."})}}class dS extends qt{}class hS extends qt{}class pS extends qt{}class mS extends qt{}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}const C5=/^[a-z][a-z0-9+.-]*:/i,M5=e=>C5.test(e);let qp=e=>(qp=Array.isArray,qp(e)),Jb=qp;function $p(e){return typeof e!="object"?{}:e??{}}function T5(e){if(!e)return!0;for(const n in e)return!1;return!0}function A5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const z5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Te(`${e} must be an integer`);if(n<0)throw new Te(`${e} must be a positive integer`);return n},vS=e=>{try{return JSON.parse(e)}catch{return}},D5=e=>new Promise(n=>setTimeout(n,e)),Qa="0.71.2",j5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function R5(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const O5=()=>{const e=R5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":e1(Deno.build.os),"X-Stainless-Arch":Wb(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":e1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Wb(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=L5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function L5(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:n,pattern:i}of e){const a=i.exec(navigator.userAgent);if(a){const s=a[1]||0,o=a[2]||0,u=a[3]||0;return{browser:n,version:`${s}.${o}.${u}`}}}return null}const Wb=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",e1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let t1;const H5=()=>t1??(t1=O5());function B5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function wS(...e){const n=globalThis.ReadableStream;if(typeof n>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...e)}function SS(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return wS({start(){},async pull(i){const{done:a,value:s}=await n.next();a?i.close():i.enqueue(s)},async cancel(){await n.return?.()}})}function Em(e){if(e[Symbol.asyncIterator])return e;const n=e.getReader();return{async next(){try{const i=await n.read();return i?.done&&n.releaseLock(),i}catch(i){throw n.releaseLock(),i}},async return(){const i=n.cancel();return n.releaseLock(),await i,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function U5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const n=e.getReader(),i=n.cancel();n.releaseLock(),await i}const I5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function q5(e){let n=0;for(const s of e)n+=s.length;const i=new Uint8Array(n);let a=0;for(const s of e)i.set(s,a),a+=s.length;return i}let n1;function Nm(e){let n;return(n1??(n=new globalThis.TextEncoder,n1=n.encode.bind(n)))(e)}let i1;function r1(e){let n;return(i1??(n=new globalThis.TextDecoder,i1=n.decode.bind(n)))(e)}var yn,xn;class mo{constructor(){yn.set(this,void 0),xn.set(this,void 0),ge(this,yn,new Uint8Array),ge(this,xn,null)}decode(n){if(n==null)return[];const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Nm(n):n;ge(this,yn,q5([ne(this,yn,"f"),i]));const a=[];let s;for(;(s=$5(ne(this,yn,"f"),ne(this,xn,"f")))!=null;){if(s.carriage&&ne(this,xn,"f")==null){ge(this,xn,s.index);continue}if(ne(this,xn,"f")!=null&&(s.index!==ne(this,xn,"f")+1||s.carriage)){a.push(r1(ne(this,yn,"f").subarray(0,ne(this,xn,"f")-1))),ge(this,yn,ne(this,yn,"f").subarray(ne(this,xn,"f"))),ge(this,xn,null);continue}const o=ne(this,xn,"f")!==null?s.preceding-1:s.preceding,u=r1(ne(this,yn,"f").subarray(0,o));a.push(u),ge(this,yn,ne(this,yn,"f").subarray(s.index)),ge(this,xn,null)}return a}flush(){return ne(this,yn,"f").length?this.decode(`
|
|
14
|
+
`)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return Q.useEffect(()=>{const h=n?.target??zb,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!d)&&iw(b))return!1;const E=Db(b.code,f);if(o.current.add(b[E]),jb(u,o.current,!1)){const N=b.composedPath?.()?.[0]||b.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";n.preventDefault!==!1&&(s.current||!_)&&b.preventDefault(),a(!0)}},m=b=>{const w=Db(b.code,f);jb(u,o.current,!0)?(a(!1),o.current.clear()):o.current.delete(b[w]),b.key==="Meta"&&o.current.clear(),s.current=!1},x=()=>{o.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),i}function jb(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(s=>n.has(s)))}function Db(e,n){return n.includes(e)?"code":"key"}const kT=()=>{const e=ct();return Q.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[a,s,o],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??s,zoom:n.zoom??o},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,a]=e.getState().transform;return{x:n,y:i,zoom:a}},setCenter:async(n,i,a)=>e.getState().setCenter(n,i,a),fitBounds:async(n,i)=>{const{width:a,height:s,minZoom:o,maxZoom:u,panZoom:f}=e.getState(),h=pm(n,a,s,o,u,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:a,snapGrid:s,snapToGrid:o,domNode:u}=e.getState();if(!u)return n;const{x:f,y:h}=u.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??s,m=i.snapToGrid??o;return fo(d,a,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:a}=e.getState();if(!a)return n;const{x:s,y:o}=a.getBoundingClientRect(),u=Bc(n,i);return{x:u.x+s,y:u.y+o}}}),[])};function Nw(e,n){const i=[],a=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")a.set(o.id,[o]);else{const u=a.get(o.id);u?u.push(o):a.set(o.id,[o])}for(const o of n){const u=a.get(o.id);if(!u){i.push(o);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const f={...o};for(const h of u)ET(h,f);i.push(f)}return s.length&&s.forEach(o=>{o.index!==void 0?i.splice(o.index,0,{...o.item}):i.push({...o.item})}),i}function ET(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Cw(e,n){return Nw(e,n)}function Mw(e,n){return Nw(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function el(e,n=new Set,i=!1){const a=[];for(const[s,o]of e){const u=n.has(s);!(o.selected===void 0&&!u)&&o.selected!==u&&(i&&(o.selected=u),a.push(Gr(o.id,u)))}return a}function Rb({items:e=[],lookup:n}){const i=[],a=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const u=n.get(o.id),f=u?.internals?.userNode??u;f!==void 0&&f!==o&&i.push({id:o.id,item:o,type:"replace"}),f===void 0&&i.push({item:o,type:"add",index:s})}for(const[s]of n)a.get(s)===void 0&&i.push({id:s,type:"remove"});return i}function Ob(e){return{id:e.id,type:"remove"}}const Lb=e=>Q4(e),NT=e=>Zv(e);function Tw(e){return Q.forwardRef(e)}const CT=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function Hb(e){const[n,i]=Q.useState(BigInt(0)),[a]=Q.useState(()=>MT(()=>i(s=>s+BigInt(1))));return CT(()=>{const s=a.get();s.length&&(e(s),a.reset())},[n]),a}function MT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const Aw=Q.createContext(null);function TT({children:e}){const n=ct(),i=Q.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=n.getState();let E=h;for(const _ of f)E=typeof _=="function"?_(E):_;let N=Rb({items:E,lookup:x});for(const _ of w.values())N=_(N);g&&d(E),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:D,setNodes:k}=n.getState();_&&k(D)})},[]),a=Hb(i),s=Q.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let b=h;for(const w of f)b=typeof w=="function"?w(b):w;g?d(b):m&&m(Rb({items:b,lookup:x}))},[]),o=Hb(s),u=Q.useMemo(()=>({nodeQueue:a,edgeQueue:o}),[]);return v.jsx(Aw.Provider,{value:u,children:e})}function AT(){const e=Q.useContext(Aw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zT=e=>!!e.panZoom;function wm(){const e=kT(),n=ct(),i=AT(),a=Ye(zT),s=Q.useMemo(()=>{const o=m=>n.getState().nodeLookup.get(m),u=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState(),w=Lb(m)?m:x.get(m.id),E=w.parentId?tw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return fl(N)},d=(m,x,b={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&Lb(N)?N:{...E,...N}}return E}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&NT(N)?N:{...E,...N}}return E}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>o(m)?.internals.userNode,getInternalNode:o,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(x=>({...x}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=n.getState(),[w,E,N]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:_,triggerEdgeChanges:D,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await tM({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Ob);N?.(A),D(G)}if(F){const G=L.map(Ob);E?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=ob(m),E=w?m:h(m),N=b!==void 0;return E?(b||n.getState().nodes).filter(_=>{const D=n.getState().nodeLookup.get(_.id);if(D&&!w&&(_.id===m.id||!D.internals.positionAbsolute))return!1;const k=fl(N?_:D),C=Js(k,E);return x&&C>0||C>=k.width*k.height||C>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=ob(m)?m:h(m);if(!E)return!1;const N=Js(E,x);return b&&N>0||N>=x.width*x.height||N>=E.width*E.height},updateNode:d,updateNodeData:(m,x,b={replace:!1})=>{d(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState();return K4(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??aM();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return Q.useMemo(()=>({...s,...e,viewportInitialized:a}),[a])}const Bb=e=>e.selected,jT=typeof window<"u"?window:void 0;function DT({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=wm(),s=eo(e,{actInsideInputWithModifier:!1}),o=eo(n,{target:jT});Q.useEffect(()=>{if(s){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(Bb),edges:u.filter(Bb)}),i.setState({nodesSelectionActive:!1})}},[s]),Q.useEffect(()=>{i.setState({multiSelectionActive:o})},[o])}function RT(e){const n=ct();Q.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=mm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",ri.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(e.current),()=>{window.removeEventListener("resize",i),a&&e.current&&a.unobserve(e.current)}}},[])}const af={position:"absolute",width:"100%",height:"100%",top:0,left:0},OT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function LT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Jr.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:_,isControlledViewport:D,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=Q.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Ye(OT,ut),q=eo(x),V=Q.useRef();RT(A);const P=Q.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),D||L.setState({transform:te})},[_,D]);return Q.useEffect(()=>{if(A.current){V.current=qM({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:j=>L.setState({paneDragging:j}),onPanZoomStart:(j,U)=>{const{onViewportChangeStart:Y,onMoveStart:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoom:(j,U)=>{const{onViewportChange:Y,onMove:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoomEnd:(j,U)=>{const{onViewportChangeEnd:Y,onMoveEnd:K}=L.getState();K?.(j,U),Y?.(U)}});const{x:te,y:O,zoom:B}=V.current.getViewport();return L.setState({panZoom:V.current,transform:[te,O,B],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),Q.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:b,noPanClassName:N,userSelectionActive:H,noWheelClassName:E,lib:F,onTransformChange:P,connectionInProgress:G,selectionOnDrag:C,paneClickDistance:k})},[e,n,i,a,s,o,u,f,q,b,N,H,E,F,P,G,C,k]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:af,children:w})}const HT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function BT(){const{userSelectionActive:e,userSelectionRect:n}=Ye(HT,ut);return e&&n?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kh=(e,n)=>i=>{i.target===n.current&&e?.(i)},UT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function IT({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Ks.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const E=ct(),{userSelectionActive:N,elementsSelectable:_,dragging:D,connectionInProgress:k}=Ye(UT,ut),C=_&&(e||N),L=Q.useRef(null),A=Q.useRef(),H=Q.useRef(new Set),F=Q.useRef(new Set),G=Q.useRef(!1),q=Y=>{if(G.current||k){G.current=!1;return}h?.(Y),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=Y=>{if(Array.isArray(a)&&a?.includes(2)){Y.preventDefault();return}d?.(Y)},P=g?Y=>g(Y):void 0,te=Y=>{G.current&&(Y.stopPropagation(),G.current=!1)},O=Y=>{const{domNode:K}=E.getState();if(A.current=K?.getBoundingClientRect(),!A.current)return;const z=Y.target===L.current;if(!z&&!!Y.target.closest(".nokey")||!e||!(o&&z||n)||Y.button!==0||!Y.isPrimary)return;Y.target?.setPointerCapture?.(Y.pointerId),G.current=!1;const{x:T,y:ie}=Vn(Y.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:T,startY:ie,x:T,y:ie}}),z||(Y.stopPropagation(),Y.preventDefault())},B=Y=>{const{userSelectionRect:K,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:T,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!A.current||!K)return;const{x:ue,y:me}=Vn(Y.nativeEvent,A.current),{startX:Ee,startY:Ce}=K;if(!G.current){const Xe=n?0:s;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(Y)}G.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=H.current,Re=F.current;H.current=new Set(hm(R,we,z,i===Ks.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=T.get(Xe);if(ht)for(const{edgeId:sn}of ht.values()){const Lt=$.get(sn);Lt&&(Lt.selectable??Ze)&&F.current.add(sn)}}if(!ub(Ne,H.current)){const Xe=el(R,H.current,!0);ie(Xe)}if(!ub(Re,F.current)){const Xe=el($,F.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},j=Y=>{Y.button===0&&(Y.target?.releasePointerCapture?.(Y.pointerId),!N&&Y.target===L.current&&E.getState().userSelectionRect&&q?.(Y),E.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f?.(Y),E.setState({nodesSelectionActive:H.current.size>0})))},U=a===!0||Array.isArray(a)&&a.includes(0);return v.jsxs("div",{className:_t(["react-flow__pane",{draggable:U,dragging:D,selection:e}]),onClick:C?void 0:Kh(q,L),onContextMenu:Kh(V,L),onWheel:Kh(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?j:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:af,children:[w,v.jsx(BT,{})]})}function Bp({id:e,store:n,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:u,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",ri.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([e])}function zw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:s,isSelectable:o,nodeClickDistance:u}){const f=ct(),[h,d]=Q.useState(!1),g=Q.useRef();return Q.useEffect(()=>{g.current=CM({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Bp({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),Q.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:a,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,a,n,o,e,s]),h}const qT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function jw(){const e=ct();return Q.useCallback(i=>{const{nodeExtent:a,snapToGrid:s,snapGrid:o,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=qT(u),b=s?o[0]:5,w=s?o[1]:5,E=i.direction.x*b*i.factor,N=i.direction.y*w*i.factor;for(const[,_]of d){if(!x(_))continue;let D={x:_.internals.positionAbsolute.x+E,y:_.internals.positionAbsolute.y+N};s&&(D=co(D,o));const{position:k,positionAbsolute:C}=Qv({nodeId:_.id,nextPosition:D,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const Sm=Q.createContext(null),$T=Sm.Provider;Sm.Consumer;const Dw=()=>Q.useContext(Sm),VT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PT=(e,n,i)=>a=>{const{connectionClickStartHandle:s,connectionMode:o,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:s?.nodeId===e&&s?.id===n&&s?.type===i,isPossibleEndHandle:o===ul.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:g&&d}};function YT({type:e="source",position:n=be.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,E=e==="target",N=ct(),_=Dw(),{connectOnClick:D,noPanClassName:k,rfId:C}=Ye(VT,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Ye(PT(_,w,e),ut);_||N.getState().onError?.("010",ri.error010());const P=B=>{const{defaultEdgeOptions:j,onConnect:U,hasDefaultEdges:Y}=N.getState(),K={...j,...B};if(Y){const{edges:z,setEdges:R}=N.getState();R(ow(K,z))}U?.(K),f?.(K)},te=B=>{if(!_)return;const j=rw(B.nativeEvent);if(s&&(j&&B.button===0||!j)){const U=N.getState();Hp.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:E,handleId:w,nodeId:_,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:P,isValidConnection:i||U.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}j?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:j,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:K,isValidConnection:z,lib:R,rfId:$,nodeLookup:T,connection:ie}=N.getState();if(!_||!Y&&!s)return;if(!Y){j?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=nw(B.target),fe=i||z,{connection:he,isValid:ue}=Hp.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:K,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:T});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,U?.(B,me),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":n,"data-id":`${C}-${_}-${w}-${e}`,className:_t(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!E,target:E,connectable:a,connectablestart:s,connectableend:o,clickconnecting:H,connectingfrom:L,connectingto:A,valid:V,connectionindicator:a&&(!G||F)&&(G||q?o:s)}]),onMouseDown:te,onTouchStart:te,onClick:D?O:void 0,ref:b,...x,children:h})}const pl=Q.memo(Tw(YT));function XT({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(pl,{type:"source",position:i,isConnectable:n})]})}function FT({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(pl,{type:"source",position:a,isConnectable:n})]})}function GT(){return null}function ZT({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label]})}const Uc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ub={input:XT,default:FT,output:ZT,group:GT};function QT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const KT=e=>{const{width:n,height:i,x:a,y:s}=uo(e.nodeLookup,{filter:o=>!!o.selected});return{width:$n(n)?n:null,height:$n(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${s}px)`}};function JT({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:s,height:o,transformString:u,userSelectionActive:f}=Ye(KT,ut),h=jw(),d=Q.useRef(null);if(Q.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),zw({nodeRef:d}),f||!s||!o)return null;const g=e?x=>{const b=a.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Uc,x.key)&&(x.preventDefault(),h({direction:Uc[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:_t(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:v.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:s,height:o}})})}const Ib=typeof window<"u"?window:void 0,WT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Rw({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:F,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:B,noPanClassName:j,disableKeyboardA11y:U,onViewportChange:Y,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:R}=Ye(WT,ut),$=eo(d,{target:Ib}),T=eo(E,{target:Ib}),ie=T||F,ce=T||C,fe=g&&ie!==!0,he=$||R||fe;return DT({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(LT,{onPaneContextMenu:o,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&ie,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:B,noPanClassName:j,onViewportChange:Y,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(IT,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&v.jsx(JT,{onSelectionContextMenu:O,noPanClassName:j,disableKeyboardA11y:U})]})})}Rw.displayName="FlowRenderer";const eA=Q.memo(Rw),tA=e=>n=>e?hm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function nA(e){return Ye(Q.useCallback(tA(e),[e]),ut)}const iA=e=>e.updateNodeInternals;function rA(){const e=Ye(iA),[n]=Q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(s=>{const o=s.target.getAttribute("data-id");a.set(o,{id:o,nodeElement:s.target,force:!0})}),e(a)}));return Q.useEffect(()=>()=>{n?.disconnect()},[n]),n}function aA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const s=ct(),o=Q.useRef(null),u=Q.useRef(null),f=Q.useRef(e.sourcePosition),h=Q.useRef(e.targetPosition),d=Q.useRef(n),g=i&&!!e.internals.handleBounds;return Q.useEffect(()=>{o.current&&!e.hidden&&(!g||u.current!==o.current)&&(u.current&&a?.unobserve(u.current),a?.observe(o.current),u.current=o.current)},[g,e.hidden]),Q.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Q.useEffect(()=>{if(o.current){const m=d.current!==n,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(m||x||b)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),o}function lA({id:e,onClick:n,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:o,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:_,onError:D}){const{node:k,internals:C,isParent:L}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ut);let A=k.type||"default",H=N?.[A]||Ub[A];H===void 0&&(D?.("003",ri.error003(A)),A="default",H=N?.default||Ub.default);const F=!!(k.draggable||f&&typeof k.draggable>"u"),G=!!(k.selectable||h&&typeof k.selectable>"u"),q=!!(k.connectable||d&&typeof k.connectable>"u"),V=!!(k.focusable||g&&typeof k.focusable>"u"),P=ct(),te=ew(k),O=aA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=zw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),j=jw();if(k.hidden)return null;const U=Bi(k),Y=QT(k),K=G||F||n||i||a||s,z=i?ue=>i(ue,{...C.userNode}):void 0,R=a?ue=>a(ue,{...C.userNode}):void 0,$=s?ue=>s(ue,{...C.userNode}):void 0,T=o?ue=>o(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();G&&(!me||!F||Ee>0)&&Bp({id:e,store:P,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(iw(ue.nativeEvent)||w)){if(Yv.includes(ue.key)&&G){const me=ue.key==="Escape";Bp({id:e,store:P,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Uc,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),j({direction:Uc[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;hm(new Map([[e,k]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(k.position.x+U.width/2,k.position.y+U.height/2,{zoom:ue[2]})};return v.jsx("div",{className:_t(["react-flow__node",`react-flow__node-${A}`,{[b]:F},k.className,{selected:k.selected,selectable:G,parent:L,draggable:F,dragging:B}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:T,onClick:ce,onDoubleClick:ie,onKeyDown:V?fe:void 0,tabIndex:V?0:void 0,onFocus:V?he:void 0,role:k.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${_w}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx($T,{value:e,children:v.jsx(H,{id:e,data:k.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:G,draggable:F,deletable:k.deletable??!0,isConnectable:q,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:B,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...U})})})}var sA=Q.memo(lA);const oA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ow(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,onError:o}=Ye(oA,ut),u=nA(e.onlyRenderVisibleElements),f=rA();return v.jsx("div",{className:"react-flow__nodes",style:af,children:u.map(h=>v.jsx(sA,{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:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},h))})}Ow.displayName="NodeRenderer";const uA=Q.memo(Ow);function cA(e){return Ye(Q.useCallback(i=>{if(!e)return i.edges.map(s=>s.id);const a=[];if(i.width&&i.height)for(const s of i.edges){const o=i.nodeLookup.get(s.source),u=i.nodeLookup.get(s.target);o&&u&&uM({sourceNode:o,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(s.id)}return a},[e]),ut)}const fA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qb={[Lc.Arrow]:fA,[Lc.ArrowClosed]:dA};function hA(e){const n=ct();return Q.useMemo(()=>Object.prototype.hasOwnProperty.call(qb,e)?qb[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const pA=({id:e,type:n,color:i,width:a=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=hA(n);return h?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:f,refX:"0",refY:"0",children:v.jsx(h,{color:i,strokeWidth:u})}):null},Lw=({defaultColor:e,rfId:n})=>{const i=Ye(o=>o.edges),a=Ye(o=>o.defaultEdgeOptions),s=Q.useMemo(()=>gM(i,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,n,e]);return s.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:s.map(o=>v.jsx(pA,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Lw.displayName="MarkerDefinitions";var mA=Q.memo(Lw);function Hw({x:e,y:n,label:i,labelStyle:a,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=Q.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=Q.useRef(null);return Q.useEffect(()=>{if(w.current){const E=w.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?v.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[s&&v.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:o,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:a,children:i}),h]}):null}Hw.displayName="EdgeText";const gA=Q.memo(Hw);function lf({path:e,labelX:n,labelY:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:_t(["react-flow__edge-path",g.className])}),d?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(i)?v.jsx(gA,{x:n,y:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function $b({pos:e,x1:n,y1:i,x2:a,y2:s}){return e===be.Left||e===be.Right?[.5*(n+a),i]:[n,.5*(i+s)]}function Bw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top}){const[u,f]=$b({pos:i,x1:e,y1:n,x2:a,y2:s}),[h,d]=$b({pos:o,x1:a,y1:s,x2:e,y2:n}),[g,m,x,b]=aw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${u},${f} ${h},${d} ${a},${s}`,g,m,x,b]}function Uw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})=>{const[D,k,C]=Bw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(lf,{id:L,path:D,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})})}const yA=Uw({isInternal:!1}),Iw=Uw({isInternal:!0});yA.displayName="SimpleBezierEdge";Iw.displayName="SimpleBezierEdgeInternal";function qw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=Rp({sourceX:i,sourceY:a,sourcePosition:b,targetX:s,targetY:o,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:N,interactionWidth:D})})}const $w=qw({isInternal:!1}),Vw=qw({isInternal:!0});$w.displayName="SmoothStepEdge";Vw.displayName="SmoothStepEdgeInternal";function Pw(e){return Q.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx($w,{...i,id:a,pathOptions:Q.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const xA=Pw({isInternal:!1}),Yw=Pw({isInternal:!0});xA.displayName="StepEdge";Yw.displayName="StepEdgeInternal";function Xw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})=>{const[N,_,D]=uw({sourceX:i,sourceY:a,targetX:s,targetY:o}),k=e.isInternal?void 0:n;return v.jsx(lf,{id:k,path:N,labelX:_,labelY:D,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}const bA=Xw({isInternal:!1}),Fw=Xw({isInternal:!0});bA.displayName="StraightEdge";Fw.displayName="StraightEdgeInternal";function Gw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=lw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:D})})}const vA=Gw({isInternal:!1}),Zw=Gw({isInternal:!0});vA.displayName="BezierEdge";Zw.displayName="BezierEdgeInternal";const Vb={default:Zw,straight:Fw,step:Yw,smoothstep:Vw,simplebezier:Iw},Pb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,SA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Yb="react-flow__edgeupdater";function Xb({position:e,centerX:n,centerY:i,radius:a=10,onMouseDown:s,onMouseEnter:o,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:u,className:_t([Yb,`${Yb}-${f}`]),cx:wA(n,a,e),cy:SA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function _A({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:a,sourceY:s,targetX:o,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ct(),E=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:F,connectionMode:G,connectionRadius:q,lib:V,onConnectStart:P,onConnectEnd:te,cancelConnection:O,nodeLookup:B,rfId:j,panBy:U,updateConnection:Y}=w.getState(),K=L.type==="target",z=(T,ie)=>{x(!1),m?.(T,i,L.type,ie)},R=T=>d?.(i,T),$=(T,ie)=>{x(!0),g?.(C,i,L.type),P?.(T,ie)};Hp.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:K,edgeUpdaterType:L.type,lib:V,flowId:j,cancelConnection:O,panBy:U,isValidConnection:F,onConnect:R,onConnectStart:$,onConnectEnd:te,onReconnectEnd:z,updateConnection:Y,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>E(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=C=>E(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),D=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Xb,{position:f,centerX:a,centerY:s,radius:n,onMouseDown:N,onMouseEnter:D,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Xb,{position:h,centerX:o,centerY:u,radius:n,onMouseDown:_,onMouseEnter:D,onMouseOut:k,type:"target"})]})}function kA({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:a,onClick:s,onDoubleClick:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:E,noPanClassName:N,onError:_,disableKeyboardA11y:D}){let k=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);k=C?{...C,...k}:k;let L=k.type||"default",A=E?.[L]||Vb[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=E?.default||Vb.default);const H=!!(k.focusable||n&&typeof k.focusable>"u"),F=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),G=!!(k.selectable||a&&typeof k.selectable>"u"),q=Q.useRef(null),[V,P]=Q.useState(!1),[te,O]=Q.useState(!1),B=ct(),{zIndex:j,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$}=Ye(Q.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Pb};const Ze=mM({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:oM({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Pb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),T=Q.useMemo(()=>k.markerStart?`url('#${Op(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=Q.useMemo(()=>k.markerEnd?`url('#${Op(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||Y===null||K===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Re,multiSelectionActive:Ze}=B.getState();G&&(B.setState({nodesSelectionActive:!1}),k.selected&&Ze?(Re({nodes:[],edges:[k]}),q.current?.blur()):Ne([e])),s&&s(we,k)},fe=o?we=>{o(we,{...k})}:void 0,he=u?we=>{u(we,{...k})}:void 0,ue=f?we=>{f(we,{...k})}:void 0,me=h?we=>{h(we,{...k})}:void 0,Ee=d?we=>{d(we,{...k})}:void 0,Ce=we=>{if(!D&&Yv.includes(we.key)&&G){const{unselectNodesAndEdges:Ne,addSelectedEdges:Re}=B.getState();we.key==="Escape"?(q.current?.blur(),Ne({edges:[k]})):Re([e])}};return v.jsx("svg",{style:{zIndex:j},children:v.jsxs("g",{className:_t(["react-flow__edge",`react-flow__edge-${L}`,k.className,N,{selected:k.selected,animated:k.animated,inactive:!G&&!s,updating:V,selectable:G}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:H?Ce:void 0,tabIndex:H?0:void 0,role:k.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":H?`${kw}-${w}`:void 0,ref:q,...k.domAttributes,children:[!te&&v.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:G,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:T,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(_A,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:P,setReconnecting:O})]})})}var EA=Q.memo(kA);const NA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Qw({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:a,noPanClassName:s,onReconnect:o,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,onError:k}=Ye(NA,ut),C=cA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(mA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(EA,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,noPanClassName:s,onReconnect:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:a,disableKeyboardA11y:E},L))]})}Qw.displayName="EdgeRenderer";const CA=Q.memo(Qw),MA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function TA({children:e}){const n=Ye(MA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function AA(e){const n=wm(),i=Q.useRef(!1);Q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const zA=e=>e.panZoom?.syncViewport;function jA(e){const n=Ye(zA),i=ct();return Q.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function DA(e){return e.connection.inProgress?{...e.connection,to:fo(e.connection.to,e.transform)}:{...e.connection}}function RA(e){return DA}function OA(e){const n=RA();return Ye(n,ut)}const LA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function HA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:s,width:o,height:u,isValid:f,inProgress:h}=Ye(LA,ut);return!(o&&s&&h)?null:v.jsx("svg",{style:e,width:o,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:_t(["react-flow__connection",Gv(f)]),children:v.jsx(Kw,{style:n,type:i,CustomComponent:a,isValid:f})})})}const Kw=({style:e,type:n=wr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:s,from:o,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:b}=OA();if(!s)return;if(i)return v.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Gv(a),toNode:g,toHandle:m,pointer:b});let w="";const E={sourceX:o.x,sourceY:o.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case wr.Bezier:[w]=lw(E);break;case wr.SimpleBezier:[w]=Bw(E);break;case wr.Step:[w]=Rp({...E,borderRadius:0});break;case wr.SmoothStep:[w]=Rp(E);break;default:[w]=uw(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Kw.displayName="ConnectionLine";const BA={};function Fb(e=BA){Q.useRef(e),ct(),Q.useEffect(()=>{},[e])}function UA(){ct(),Q.useRef(!1),Q.useEffect(()=>{},[])}function Jw({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:_,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,preventScrolling:B,defaultMarkerColor:j,zoomOnScroll:U,zoomOnPinch:Y,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:T,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii,viewport:ae,onViewportChange:pe}){return Fb(e),Fb(n),UA(),AA(i),jA(ae),v.jsx(eA,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:T,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,onViewportChange:pe,isControlledViewport:!!ae,children:v.jsxs(TA,{children:[v.jsx(CA,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:u,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,onlyRenderVisibleElements:G,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,defaultMarkerColor:j,noPanClassName:si,disableKeyboardA11y:oi,rfId:Ii}),v.jsx(HA,{style:E,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(uA,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:o,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:G,noPanClassName:si,noDragClassName:Gt,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}Jw.displayName="GraphView";const IA=Q.memo(Jw),Gb=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,E=new Map,N=new Map,_=a??n??[],D=i??e??[],k=g??[0,0],C=m??Qs;dw(E,N,_);const L=Lp(D,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&s&&o){const H=uo(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=pm(H,s,o,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:s??0,height:o??0,transform:A,nodes:D,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Qs,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ul.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,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:f,fitViewResolver:null,connection:{...Fv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Xv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},qA=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>aT((b,w)=>{async function E(){const{nodeLookup:N,panZoom:_,fitViewOptions:D,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await eM({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},D),k?.resolve(!0),b({fitViewResolver:null}))}return{...Gb({nodes:e,edges:n,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:N=>{const{nodeLookup:_,parentLookup:D,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Lp(N,_,D,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&H?(E(),b({nodes:N,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:H})},setEdges:N=>{const{connectionLookup:_,edgeLookup:D}=w();dw(_,D,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:D}=w();D(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:D}=w();D(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:D,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=_M(N,D,k,C,L,A,G);V&&(bM(D,k,{nodeOrigin:L,nodeExtent:A,zIndexMode:G}),F?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),q?.length>0&&(H&&console.log("React Flow: trigger node changes",q),_?.(q)))},updateNodePositions:(N,_=!1)=>{const D=[];let k=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:F}=w();for(const[G,q]of N){const V=C.get(G),P=!!(V?.expandParent&&V?.parentId&&q?.position),te={id:G,type:"position",position:P?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:_};if(V&&A.inProgress&&A.fromNode.id===V.id){const O=na(V,A.fromHandle,be.Left,!0);H({...A,from:O})}P&&V.parentId&&D.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(D.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=vm(D,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:D,nodes:k,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=Cw(N,k);D(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:D,edges:k,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=Mw(N,k);D(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));C(A);return}C(el(k,new Set([...N]),!0)),L(el(D))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));L(A);return}L(el(D,new Set([...N]))),C(el(k,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:D,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=N||k,F=_||D,G=H.map(V=>{const P=C.get(V.id);return P&&(P.selected=!1),Gr(V.id,!1)}),q=F.map(V=>Gr(V.id,!1));L(G),A(q)},setMinZoom:N=>{const{panZoom:_,maxZoom:D}=w();_?.setScaleExtent([N,D]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:D}=w();_?.setScaleExtent([D,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:D,triggerEdgeChanges:k,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]),A=N.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]);D(L),k(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:D,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:H}=w();N[0][0]===A[0][0]&&N[0][1]===A[0][1]&&N[1][0]===A[1][0]&&N[1][1]===A[1][1]||(Lp(_,D,k,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:D,height:k,panZoom:C,translateExtent:L}=w();return kM({delta:N,panZoom:C,transform:_,translateExtent:L,width:D,height:k})},setCenter:async(N,_,D)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof D?.zoom<"u"?D.zoom:L;return await A.setViewport({x:k/2-N*H,y:C/2-_*H,zoom:H},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Fv}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...Gb()})}},Object.is);function Ww({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:o,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=Q.useState(()=>qA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(lT,{value:w,children:v.jsx(TT,{children:b})})}function $A({children:e,nodes:n,edges:i,defaultNodes:a,defaultEdges:s,width:o,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return Q.useContext(nf)?v.jsx(v.Fragment,{children:e}):v.jsx(Ww,{initialNodes:n,initialEdges:i,defaultNodes:a,defaultEdges:s,initialWidth:o,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const VA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function PA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,className:s,nodeTypes:o,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:j,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=Ks.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=Ws()?"Meta":"Control",zoomActivationKeyCode:we=Ws()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=Ew,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et=!0,defaultViewport:Ii=bT,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=Qs,preventScrolling:De=!0,nodeExtent:$e,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:On=!0,zoomOnPinch:At=!0,panOnScroll:pt=!1,panOnScrollSpeed:Ht=.5,panOnScrollMode:Ke=Jr.Free,zoomOnDoubleClick:Gn=!0,panOnDrag:on=!0,onPaneClick:Sf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r=1,nodeClickDistance:_f=0,children:So,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No=10,onNodesChange:Co,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ua,fitViewOptions:Mo,connectOnClick:Ef,attributionPosition:To,proOptions:Er,defaultEdgeOptions:_l,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,connectionRadius:zo,isValidConnection:fi,onError:Yi,style:Nf,id:kl,nodeDragThreshold:jo,connectionDragThreshold:Cf,viewport:ca,onViewportChange:fa,width:Ln,height:Zt,colorMode:Do="light",debug:Mf,onScroll:da,ariaLabelConfig:Ro,zIndexMode:Nr="basic",...Tf},Qt){const Cr=kl||"1",Oo=_T(Do),El=Q.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),da?.(di)},[da]);return v.jsx("div",{"data-testid":"rf__wrapper",...Tf,onScroll:El,style:{...Nf,...VA},ref:Qt,className:_t(["react-flow",s,Oo]),id:kl,role:"application",children:v.jsxs($A,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ua,fitViewOptions:Mo,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(IA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:u,connectionLineType:$,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Ze,defaultViewport:Ii,translateExtent:_e,minZoom:ae,maxZoom:pe,preventScrolling:De,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:on,onPaneClick:Sf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r,nodeClickDistance:_f,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:ca,onViewportChange:fa}),v.jsx(ST,{nodes:e,edges:n,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et,elevateNodesOnSelect:qi,elevateEdgesOnSelect:$i,minZoom:ae,maxZoom:pe,nodeExtent:$e,onNodesChange:Co,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:Ef,defaultEdgeOptions:_l,fitView:ua,fitViewOptions:Mo,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:j,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,onError:Yi,connectionRadius:zo,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:jo,connectionDragThreshold:Cf,onBeforeDelete:z,debug:Mf,ariaLabelConfig:Ro,zIndexMode:Nr}),v.jsx(xT,{onSelectionChange:te}),So,v.jsx(hT,{proOptions:Er,position:To}),v.jsx(dT,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var YA=Tw(PA);function XA({dimensions:e,lineWidth:n,variant:i,className:a}){return v.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_t(["react-flow__background-pattern",i,a])})}function FA({radius:e,className:n}){return v.jsx("circle",{cx:e,cy:e,r:e,className:_t(["react-flow__background-pattern","dots",n])})}var Oi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oi||(Oi={}));const GA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},ZA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function eS({id:e,variant:n=Oi.Dots,gap:i=20,size:a,lineWidth:s=1,offset:o=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=Q.useRef(null),{transform:x,patternId:b}=Ye(ZA,ut),w=a||GA[n],E=n===Oi.Dots,N=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],D=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(o)?o:[o,o],L=N?[k,k]:D,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],H=`${b}${e||""}`;return v.jsxs("svg",{className:_t(["react-flow__background",d]),style:{...h,...af,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:H,x:x[0]%D[0],y:x[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?v.jsx(FA,{radius:k/2,className:g}):v.jsx(XA,{dimensions:L,lineWidth:s,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}eS.displayName="Background";const QA=Q.memo(eS);function KA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function JA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function WA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 e3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 t3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 Wu({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const n3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function tS({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ct(),{isInteractive:E,minZoomReached:N,maxZoomReached:_,ariaLabelConfig:D}=Ye(n3,ut),{zoomIn:k,zoomOut:C,fitView:L}=wm(),A=()=>{k(),o?.()},H=()=>{C(),u?.()},F=()=>{L(s),f?.()},G=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},q=x==="horizontal"?"horizontal":"vertical";return v.jsxs(rf,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??D["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(Wu,{onClick:A,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(KA,{})}),v.jsx(Wu,{onClick:H,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(JA,{})})]}),i&&v.jsx(Wu,{className:"react-flow__controls-fitview",onClick:F,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:v.jsx(WA,{})}),a&&v.jsx(Wu,{className:"react-flow__controls-interactive",onClick:G,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:E?v.jsx(t3,{}):v.jsx(e3,{})}),g]})}tS.displayName="Controls";const i3=Q.memo(tS);function r3({id:e,x:n,y:i,width:a,height:s,style:o,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:E}=o||{},N=u||w||E;return v.jsx("rect",{className:_t(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:a,height:s,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const a3=Q.memo(r3),l3=e=>e.nodes.map(n=>n.id),Jh=e=>e instanceof Function?e:()=>e;function s3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:o=a3,onClick:u}){const f=Ye(l3,ut),h=Jh(n),d=Jh(e),g=Jh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(u3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:o,onClick:u,shapeRendering:m},x))})}function o3({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:E}=w.nodeLookup.get(e),N=E.userNode,{x:_,y:D}=E.positionAbsolute,{width:k,height:C}=Bi(N);return{node:N,x:_,y:D,width:k,height:C}},ut);return!d||d.hidden||!ew(d)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:d.style,selected:!!d.selected,className:a(d),color:n(d),borderRadius:s,strokeColor:i(d),strokeWidth:o,shapeRendering:u,onClick:h,id:d.id})}const u3=Q.memo(o3);var c3=Q.memo(s3);const f3=200,d3=150,h3=e=>!e.hidden,p3=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?Wv(uo(e.nodeLookup,{filter:h3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},m3="react-flow__minimap-desc";function nS({style:e,className:n,nodeStrokeColor:i,nodeColor:a,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:_,inversePan:D,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=Q.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(p3,ut),B=e?.width??f3,j=e?.height??d3,U=H.width/B,Y=H.height/j,K=Math.max(U,Y),z=K*B,R=K*j,$=C*K,T=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${m3}-${G}`,ue=Q.useRef(0),me=Q.useRef();ue.current=K,Q.useEffect(()=>{if(A.current&&q)return me.current=DM({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),Q.useEffect(()=>{me.current?.update({translateExtent:V,width:P,height:te,inversePan:D,pannable:E,zoomStep:k,zoomable:N})},[E,N,D,k,V,P,te]);const Ee=b?Ne=>{const[Re,Ze]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:Re,y:Ze})}:void 0,Ce=w?Q.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(rf,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:_t(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:j,viewBox:`${T} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:A,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(c3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-$},${ie-$}h${ce+$*2}v${fe+$*2}h${-ce-$*2}z
|
|
15
|
+
M${F.x},${F.y}h${F.width}v${F.height}h${-F.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}nS.displayName="MiniMap";const g3=Q.memo(nS),y3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,x3={[hl.Line]:"right",[hl.Handle]:"bottom-right"};function b3({nodeId:e,position:n,variant:i=hl.Handle,className:a,style:s=void 0,children:o,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:_}){const D=Dw(),k=typeof e=="string"?e:D,C=ct(),L=Q.useRef(null),A=i===hl.Handle,H=Ye(Q.useCallback(y3(A&&b),[A,b]),ut),F=Q.useRef(null),G=n??x3[i];Q.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=FM({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:j}=C.getState();return{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:j}},onChange:(V,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:j}=C.getState(),U=[],Y={x:V.x,y:V.y},K=O.get(k);if(K&&K.expandParent&&K.parentId){const z=K.origin??j,R=V.width??K.measured.width??0,$=V.height??K.measured.height??0,T={id:K.id,parentId:K.parentId,rect:{width:R,height:$,...tw({x:V.x??K.position.x,y:V.y??K.position.y},{width:R,height:$},K.parentId,O,z)}},ie=vm([T],O,B,j);U.push(...ie),Y.x=V.x?Math.max(z[0]*R,V.x):void 0,Y.y=V.y?Math.max(z[1]*$,V.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const z={id:k,type:"position",position:{...Y}};U.push(z)}if(V.width!==void 0&&V.height!==void 0){const R={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};U.push(R)}for(const z of P){const R={...z,type:"position"};U.push(R)}te(U)},onEnd:({width:V,height:P})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:V,height:P}};C.getState().triggerNodeChanges([te])}})),F.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:N,onResizeEnd:_,shouldResize:w}),()=>{F.current?.destroy()}},[G,f,h,d,g,m,E,N,_,w]);const q=G.split("-");return v.jsx("div",{className:_t(["react-flow__resize-control","nodrag",...q,i,a]),ref:L,style:{...s,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:o})}Q.memo(b3);const iS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const v3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const w3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Zb=e=>{const n=w3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var S3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const k3=Q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:o,iconNode:u,...f},h)=>Q.createElement("svg",{ref:h,...S3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:iS("lucide",s),...!o&&!_3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>Q.createElement(d,g)),...Array.isArray(o)?o:[o]]));const Oe=(e,n)=>{const i=Q.forwardRef(({className:a,...s},o)=>Q.createElement(k3,{ref:o,iconNode:n,className:iS(`lucide-${v3(Zb(e))}`,`lucide-${e}`,a),...s}));return i.displayName=Zb(e),i};const E3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],N3=Oe("arrow-left",E3);const C3=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],M3=Oe("bot",C3);const T3=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],sf=Oe("chart-column",T3);const A3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],z3=Oe("check",A3);const j3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D3=Oe("chevron-down",j3);const R3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],O3=Oe("chevron-up",R3);const L3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Up=Oe("circle-alert",L3);const H3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rS=Oe("circle-check-big",H3);const B3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],U3=Oe("circle-check",B3);const I3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aS=Oe("circle-x",I3);const q3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],il=Oe("download",q3);const $3=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],V3=Oe("eye-off",$3);const P3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lS=Oe("eye",P3);const Y3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rl=Oe("file-text",Y3);const X3=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Qb=Oe("folder-open",X3);const F3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],G3=Oe("globe",F3);const Z3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],sS=Oe("image",Z3);const Q3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],K3=Oe("info",Q3);const J3=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],W3=Oe("key",J3);const e5=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],t5=Oe("link-2",e5);const n5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],oS=Oe("loader-circle",n5);const i5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],r5=Oe("maximize-2",i5);const a5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],of=Oe("message-square",a5);const l5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],s5=Oe("minimize-2",l5);const o5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_m=Oe("play",o5);const u5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],km=Oe("plug",u5);const c5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],f5=Oe("save",c5);const d5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],h5=Oe("send",d5);const p5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],m5=Oe("server",p5);const g5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],y5=Oe("settings-2",g5);const x5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uS=Oe("settings",x5);const b5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ho=Oe("sparkles",b5);const v5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uf=Oe("terminal",v5);const w5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cf=Oe("trash-2",w5);const S5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_5=Oe("triangle-alert",S5);const k5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],E5=Oe("upload",k5);const N5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Em=Oe("x",N5);const C5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ff=Oe("zap",C5),Kb=e=>{let n;const i=new Set,a=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(b=>b(n,x))}},s=()=>n,f={setState:a,getState:s,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(a,s,f);return f},M5=(e=>e?Kb(e):Kb),T5=e=>e;function A5(e,n=T5){const i=Ls.useSyncExternalStore(e.subscribe,Ls.useCallback(()=>n(e.getState()),[e,n]),Ls.useCallback(()=>n(e.getInitialState()),[e,n]));return Ls.useDebugValue(i),i}const Jb=e=>{const n=M5(e),i=a=>A5(n,a);return Object.assign(i,n),i},df=(e=>e?Jb(e):Jb);function z5(e,n){let i;try{i=e()}catch{return}return{getItem:s=>{var o;const u=h=>h===null?null:JSON.parse(h,void 0),f=(o=i.getItem(s))!=null?o:null;return f instanceof Promise?f.then(u):u(f)},setItem:(s,o)=>i.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>i.removeItem(s)}}const Ip=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return Ip(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return Ip(a)(i)}}}},j5=(e,n)=>(i,a,s)=>{let o={storage:z5(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...n},u=!1,f=0;const h=new Set,d=new Set;let g=o.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...N)},a,s);const m=()=>{const N=o.partialize({...a()});return g.setItem(o.name,{state:N,version:o.version})},x=s.setState;s.setState=(N,_)=>(x(N,_),m());const b=e((...N)=>(i(...N),m()),a,s);s.getInitialState=()=>b;let w;const E=()=>{var N,_;if(!g)return;const D=++f;u=!1,h.forEach(C=>{var L;return C((L=a())!=null?L:b)});const k=((_=o.onRehydrateStorage)==null?void 0:_.call(o,(N=a())!=null?N:b))||void 0;return Ip(g.getItem.bind(g))(o.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==o.version){if(o.migrate){const L=o.migrate(C.state,C.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var L;if(D!==f)return;const[A,H]=C;if(w=o.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{D===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{D===f&&k?.(void 0,C)})};return s.persist={setOptions:N=>{o={...o,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:N=>(h.add(N),()=>{h.delete(N)}),onFinishHydration:N=>(d.add(N),()=>{d.delete(N)})},o.skipHydration||E(),w||b},cS=j5,D5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let to=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=D5[i[e]&63];return n};const Hi=df()(cS(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(a=>({nodes:a.nodes.map(s=>s.id===n?{...s,data:{...s.data,...i}}:s)})),updateNodeStatus:(n,i,a)=>e(s=>({nodes:s.nodes.map(o=>o.id===n?{...o,data:{...o.data,status:i,progress:a??o.data.progress}}:o)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(a=>a.id!==n),edges:i.edges.filter(a=>a.source!==n&&a.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(a=>a.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:n=>e({nodes:n}),setEdges:n=>e({edges:n})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),fS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),po=df((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,a)=>{e(s=>{const o=new Set(s.completedNodes);o.add(i);const u=new Map(s.results);return a!==void 0&&u.set(i,a),{completedNodes:o,results:u}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,a)=>{e(s=>{const o=new Set(s.failedNodes);return o.add(i),{failedNodes:o}}),n().addLog("error",a||"Node failed",i)},setWorkflowResults:(i,a)=>{e({workflowResults:i,outputDir:a||null}),i.forEach(s=>{s.result&&e(o=>{const u=new Map(o.results);return u.set(s.nodeId,s.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,a,s,o)=>{const u={id:to(),timestamp:Date.now(),level:i,message:a,nodeId:s,details:o};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,n,i,a,s){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,i),i}function ne(e,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!a:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:n.get(e)}let dS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return dS=e.randomUUID.bind(e),e.randomUUID();const n=new Uint8Array(1),i=e?()=>e.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};function no(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const qp=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Te extends Error{}class qt extends Te{constructor(n,i,a,s){super(`${qt.makeMessage(n,i,a)}`),this.status=n,this.headers=s,this.requestID=s?.get("request-id"),this.error=i}static makeMessage(n,i,a){const s=i?.message?typeof i.message=="string"?i.message:JSON.stringify(i.message):i?JSON.stringify(i):a;return n&&s?`${n} ${s}`:n?`${n} status code (no body)`:s||"(no status code or body)"}static generate(n,i,a,s){if(!n||!s)return new hf({message:a,cause:qp(i)});const o=i;return n===400?new pS(n,o,a,s):n===401?new mS(n,o,a,s):n===403?new gS(n,o,a,s):n===404?new yS(n,o,a,s):n===409?new xS(n,o,a,s):n===422?new bS(n,o,a,s):n===429?new vS(n,o,a,s):n>=500?new wS(n,o,a,s):new qt(n,o,a,s)}}class Pn extends qt{constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class hf extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class hS extends hf{constructor({message:n}={}){super({message:n??"Request timed out."})}}class pS extends qt{}class mS extends qt{}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}class vS extends qt{}class wS extends qt{}const R5=/^[a-z][a-z0-9+.-]*:/i,O5=e=>R5.test(e);let $p=e=>($p=Array.isArray,$p(e)),Wb=$p;function Vp(e){return typeof e!="object"?{}:e??{}}function L5(e){if(!e)return!0;for(const n in e)return!1;return!0}function H5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const B5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Te(`${e} must be an integer`);if(n<0)throw new Te(`${e} must be a positive integer`);return n},SS=e=>{try{return JSON.parse(e)}catch{return}},U5=e=>new Promise(n=>setTimeout(n,e)),Qa="0.71.2",I5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function q5(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const $5=()=>{const e=q5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":t1(Deno.build.os),"X-Stainless-Arch":e1(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":t1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=V5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function V5(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:n,pattern:i}of e){const a=i.exec(navigator.userAgent);if(a){const s=a[1]||0,o=a[2]||0,u=a[3]||0;return{browser:n,version:`${s}.${o}.${u}`}}}return null}const e1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",t1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let n1;const P5=()=>n1??(n1=$5());function Y5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function _S(...e){const n=globalThis.ReadableStream;if(typeof n>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...e)}function kS(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return _S({start(){},async pull(i){const{done:a,value:s}=await n.next();a?i.close():i.enqueue(s)},async cancel(){await n.return?.()}})}function Nm(e){if(e[Symbol.asyncIterator])return e;const n=e.getReader();return{async next(){try{const i=await n.read();return i?.done&&n.releaseLock(),i}catch(i){throw n.releaseLock(),i}},async return(){const i=n.cancel();return n.releaseLock(),await i,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function X5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const n=e.getReader(),i=n.cancel();n.releaseLock(),await i}const F5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function G5(e){let n=0;for(const s of e)n+=s.length;const i=new Uint8Array(n);let a=0;for(const s of e)i.set(s,a),a+=s.length;return i}let i1;function Cm(e){let n;return(i1??(n=new globalThis.TextEncoder,i1=n.encode.bind(n)))(e)}let r1;function a1(e){let n;return(r1??(n=new globalThis.TextDecoder,r1=n.decode.bind(n)))(e)}var yn,xn;class mo{constructor(){yn.set(this,void 0),xn.set(this,void 0),ge(this,yn,new Uint8Array),ge(this,xn,null)}decode(n){if(n==null)return[];const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Cm(n):n;ge(this,yn,G5([ne(this,yn,"f"),i]));const a=[];let s;for(;(s=Z5(ne(this,yn,"f"),ne(this,xn,"f")))!=null;){if(s.carriage&&ne(this,xn,"f")==null){ge(this,xn,s.index);continue}if(ne(this,xn,"f")!=null&&(s.index!==ne(this,xn,"f")+1||s.carriage)){a.push(a1(ne(this,yn,"f").subarray(0,ne(this,xn,"f")-1))),ge(this,yn,ne(this,yn,"f").subarray(ne(this,xn,"f"))),ge(this,xn,null);continue}const o=ne(this,xn,"f")!==null?s.preceding-1:s.preceding,u=a1(ne(this,yn,"f").subarray(0,o));a.push(u),ge(this,yn,ne(this,yn,"f").subarray(s.index)),ge(this,xn,null)}return a}flush(){return ne(this,yn,"f").length?this.decode(`
|
|
16
16
|
`):[]}}yn=new WeakMap,xn=new WeakMap;mo.NEWLINE_CHARS=new Set([`
|
|
17
|
-
`,"\r"]);mo.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function
|
|
18
|
-
`);a.enqueue(u)}catch(s){a.error(s)}},async cancel(){await i.return?.()}})}}async function*
|
|
19
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(n),n.startsWith(":"))return null;let[i,a,s]=
|
|
17
|
+
`,"\r"]);mo.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Z5(e,n){for(let s=n??0;s<e.length;s++){if(e[s]===10)return{preceding:s,index:s+1,carriage:!1};if(e[s]===13)return{preceding:s,index:s+1,carriage:!0}}return null}function Q5(e){for(let a=0;a<e.length-1;a++){if(e[a]===10&&e[a+1]===10||e[a]===13&&e[a+1]===13)return a+2;if(e[a]===13&&e[a+1]===10&&a+3<e.length&&e[a+2]===13&&e[a+3]===10)return a+4}return-1}const Ic={off:0,error:200,warn:300,info:400,debug:500},l1=(e,n,i)=>{if(e){if(H5(Ic,e))return e;Yt(i).warn(`${n} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ic))}`)}};function Us(){}function ec(e,n,i){return!n||Ic[e]>Ic[i]?Us:n[e].bind(n)}const K5={error:Us,warn:Us,info:Us,debug:Us};let s1=new WeakMap;function Yt(e){const n=e.logger,i=e.logLevel??"off";if(!n)return K5;const a=s1.get(n);if(a&&a[0]===i)return a[1];const s={error:ec("error",n,i),warn:ec("warn",n,i),info:ec("info",n,i),debug:ec("debug",n,i)};return s1.set(n,[i,s]),s}const Zr=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([n,i])=>[n,n.toLowerCase()==="x-api-key"||n.toLowerCase()==="authorization"||n.toLowerCase()==="cookie"||n.toLowerCase()==="set-cookie"?"***":i]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var ys;class ni{constructor(n,i,a){this.iterator=n,ys.set(this,void 0),this.controller=i,ge(this,ys,a)}static fromSSEResponse(n,i,a){let s=!1;const o=a?Yt(a):console;async function*u(){if(s)throw new Te("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let f=!1;try{for await(const h of J5(n,i)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(d){throw o.error("Could not parse message into JSON:",h.data),o.error("From chunk:",h.raw),d}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop")try{yield JSON.parse(h.data)}catch(d){throw o.error("Could not parse message into JSON:",h.data),o.error("From chunk:",h.raw),d}if(h.event!=="ping"&&h.event==="error")throw new qt(void 0,SS(h.data)??h.data,void 0,n.headers)}f=!0}catch(h){if(no(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}static fromReadableStream(n,i,a){let s=!1;async function*o(){const f=new mo,h=Nm(n);for await(const d of h)for(const g of f.decode(d))yield g;for(const d of f.flush())yield d}async function*u(){if(s)throw new Te("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let f=!1;try{for await(const h of o())f||h&&(yield JSON.parse(h));f=!0}catch(h){if(no(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}[(ys=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const n=[],i=[],a=this.iterator(),s=o=>({next:()=>{if(o.length===0){const u=a.next();n.push(u),i.push(u)}return o.shift()}});return[new ni(()=>s(n),this.controller,ne(this,ys,"f")),new ni(()=>s(i),this.controller,ne(this,ys,"f"))]}toReadableStream(){const n=this;let i;return _S({async start(){i=n[Symbol.asyncIterator]()},async pull(a){try{const{value:s,done:o}=await i.next();if(o)return a.close();const u=Cm(JSON.stringify(s)+`
|
|
18
|
+
`);a.enqueue(u)}catch(s){a.error(s)}},async cancel(){await i.return?.()}})}}async function*J5(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Te("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Te("Attempted to iterate over a response with no body");const i=new ez,a=new mo,s=Nm(e.body);for await(const o of W5(s))for(const u of a.decode(o)){const f=i.decode(u);f&&(yield f)}for(const o of a.flush()){const u=i.decode(o);u&&(yield u)}}async function*W5(e){let n=new Uint8Array;for await(const i of e){if(i==null)continue;const a=i instanceof ArrayBuffer?new Uint8Array(i):typeof i=="string"?Cm(i):i;let s=new Uint8Array(n.length+a.length);s.set(n),s.set(a,n.length),n=s;let o;for(;(o=Q5(n))!==-1;)yield n.slice(0,o),n=n.slice(o)}n.length>0&&(yield n)}class ez{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(n){if(n.endsWith("\r")&&(n=n.substring(0,n.length-1)),!n){if(!this.event&&!this.data.length)return null;const o={event:this.event,data:this.data.join(`
|
|
19
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(n),n.startsWith(":"))return null;let[i,a,s]=tz(n,":");return s.startsWith(" ")&&(s=s.substring(1)),i==="event"?this.event=s:i==="data"&&this.data.push(s),null}}function tz(e,n){const i=e.indexOf(n);return i!==-1?[e.substring(0,i),n,e.substring(i+n.length)]:[e,"",""]}async function ES(e,n){const{response:i,requestLogID:a,retryOfRequestLogID:s,startTime:o}=n,u=await(async()=>{if(n.options.stream)return Yt(e).debug("response",i.status,i.url,i.headers,i.body),n.options.__streamClass?n.options.__streamClass.fromSSEResponse(i,n.controller):ni.fromSSEResponse(i,n.controller);if(i.status===204)return null;if(n.options.__binaryResponse)return i;const h=i.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){const m=await i.json();return NS(m,i)}return await i.text()})();return Yt(e).debug(`[${a}] response parsed`,Zr({retryOfRequestLogID:s,url:i.url,status:i.status,body:u,durationMs:Date.now()-o})),u}function NS(e,n){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:n.headers.get("request-id"),enumerable:!1})}var Is;class pf extends Promise{constructor(n,i,a=ES){super(s=>{s(null)}),this.responsePromise=i,this.parseResponse=a,Is.set(this,void 0),ge(this,Is,n)}_thenUnwrap(n){return new pf(ne(this,Is,"f"),this.responsePromise,async(i,a)=>NS(n(await this.parseResponse(i,a),a),a.response))}asResponse(){return this.responsePromise.then(n=>n.response)}async withResponse(){const[n,i]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:i,request_id:i.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(n=>this.parseResponse(ne(this,Is,"f"),n))),this.parsedPromise}then(n,i){return this.parse().then(n,i)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}Is=new WeakMap;var tc;class CS{constructor(n,i,a,s){tc.set(this,void 0),ge(this,tc,n),this.options=s,this.response=i,this.body=a}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const n=this.nextPageRequestOptions();if(!n)throw new Te("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,tc,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(tc=new WeakMap,Symbol.asyncIterator)](){for await(const n of this.iterPages())for(const i of n.getPaginatedItems())yield i}}class nz extends pf{constructor(n,i,a){super(n,i,async(s,o)=>new a(s,o.response,await ES(s,o),o.options))}async*[Symbol.asyncIterator](){const n=await this;for await(const i of n)yield i}}class go extends CS{constructor(n,i,a,s){super(n,i,a,s),this.data=a.data||[],this.has_more=a.has_more||!1,this.first_id=a.first_id||null,this.last_id=a.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const i=this.first_id;return i?{...this.options,query:{...Vp(this.options.query),before_id:i}}:null}const n=this.last_id;return n?{...this.options,query:{...Vp(this.options.query),after_id:n}}:null}}class MS extends CS{constructor(n,i,a,s){super(n,i,a,s),this.data=a.data||[],this.has_more=a.has_more||!1,this.next_page=a.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const n=this.next_page;return n?{...this.options,query:{...Vp(this.options.query),page:n}}:null}}const TS=()=>{if(typeof File>"u"){const{process:e}=globalThis,n=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function al(e,n,i){return TS(),new File(e,n??"unknown_file",i)}function Nc(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const AS=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Mm=async(e,n)=>({...e,body:await rz(e.body,n)}),o1=new WeakMap;function iz(e){const n=typeof e=="function"?e:e.fetch,i=o1.get(n);if(i)return i;const a=(async()=>{try{const s="Response"in n?n.Response:(await n("data:,")).constructor,o=new FormData;return o.toString()!==await new s(o).text()}catch{return!0}})();return o1.set(n,a),a}const rz=async(e,n)=>{if(!await iz(n))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const i=new FormData;return await Promise.all(Object.entries(e||{}).map(([a,s])=>Pp(i,a,s))),i},az=e=>e instanceof Blob&&"name"in e,Pp=async(e,n,i)=>{if(i!==void 0){if(i==null)throw new TypeError(`Received null for "${n}"; to pass null in FormData, you must use the string 'null'`);if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")e.append(n,String(i));else if(i instanceof Response){let a={};const s=i.headers.get("Content-Type");s&&(a={type:s}),e.append(n,al([await i.blob()],Nc(i),a))}else if(AS(i))e.append(n,al([await new Response(kS(i)).blob()],Nc(i)));else if(az(i))e.append(n,al([i],Nc(i),{type:i.type}));else if(Array.isArray(i))await Promise.all(i.map(a=>Pp(e,n+"[]",a)));else if(typeof i=="object")await Promise.all(Object.entries(i).map(([a,s])=>Pp(e,`${n}[${a}]`,s)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${i} instead`)}},zS=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",lz=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&zS(e),sz=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function oz(e,n,i){if(TS(),e=await e,n||(n=Nc(e)),lz(e))return e instanceof File&&n==null&&i==null?e:al([await e.arrayBuffer()],n??e.name,{type:e.type,lastModified:e.lastModified,...i});if(sz(e)){const s=await e.blob();return n||(n=new URL(e.url).pathname.split(/[\\/]/).pop()),al(await Yp(s),n,i)}const a=await Yp(e);if(!i?.type){const s=a.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof s=="string"&&(i={...i,type:s})}return al(a,n,i)}async function Yp(e){let n=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)n.push(e);else if(zS(e))n.push(e instanceof Blob?e:await e.arrayBuffer());else if(AS(e))for await(const i of e)n.push(...await Yp(i));else{const i=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${i?`; constructor: ${i}`:""}${uz(e)}`)}return n}function uz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(i=>`"${i}"`).join(", ")}]`}class Fn{constructor(n){this._client=n}}const jS=Symbol.for("brand.privateNullableHeaders");function*cz(e){if(!e)return;if(jS in e){const{values:a,nulls:s}=e;yield*a.entries();for(const o of s)yield[o,null];return}let n=!1,i;e instanceof Headers?i=e.entries():Wb(e)?i=e:(n=!0,i=Object.entries(e??{}));for(let a of i){const s=a[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");const o=Wb(a[1])?a[1]:[a[1]];let u=!1;for(const f of o)f!==void 0&&(n&&!u&&(u=!0,yield[s,null]),yield[s,f])}}const Ve=e=>{const n=new Headers,i=new Set;for(const a of e){const s=new Set;for(const[o,u]of cz(a)){const f=o.toLowerCase();s.has(f)||(n.delete(o),s.add(f)),u===null?(n.delete(o),i.add(f)):(n.append(o,u),i.delete(f))}}return{[jS]:!0,values:n,nulls:i}};function DS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const u1=Object.freeze(Object.create(null)),fz=(e=DS)=>function(i,...a){if(i.length===1)return i[0];let s=!1;const o=[],u=i.reduce((g,m,x)=>{/[?#]/.test(m)&&(s=!0);const b=a[x];let w=(s?encodeURIComponent:e)(""+b);return x!==a.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??u1)??u1)?.toString)&&(w=b+"",o.push({start:g.length+m.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),g+m+(x===a.length?"":w)},""),f=u.split(/[?#]/,1)[0],h=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let d;for(;(d=h.exec(f))!==null;)o.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(o.sort((g,m)=>g.start-m.start),o.length>0){let g=0;const m=o.reduce((x,b)=>{const w=" ".repeat(b.start-g),E="^".repeat(b.length);return g=b.start+b.length,x+w+E},"");throw new Te(`Path parameters result in path with invalid segments:
|
|
20
20
|
${o.map(x=>x.error).join(`
|
|
21
21
|
`)}
|
|
22
22
|
${u}
|
|
23
|
-
${m}`)}return u},Ot=rz(zS);class DS extends Fn{list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/files",go,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}download(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}/content`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},a?.headers]),__binaryResponse:!0})}retrieveMetadata(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}upload(n,i){const{betas:a,...s}=n;return this._client.post("/v1/files",Cm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let jS=class extends Fn{retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/models/${n}?beta=true`,{...a,headers:Ve([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/models?beta=true",go,{query:s,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const RS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function u1(e,n,i){return!n||!("parse"in(n.output_format??{}))?{...e,content:e.content.map(a=>{if(a.type==="text"){const s=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null}:OS(e,n,i)}function OS(e,n,i){let a=null;const s=e.content.map(o=>{if(o.type==="text"){const u=az(n,o.text);a===null&&(a=u);const f=Object.defineProperty({...o},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return o});return{...e,content:s,parsed_output:a}}function az(e,n){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(n):JSON.parse(n)}catch(i){throw new Te(`Failed to parse structured output: ${i}`)}}const lz=e=>{let n=0,i=[];for(;n<e.length;){let a=e[n];if(a==="\\"){n++;continue}if(a==="{"){i.push({type:"brace",value:"{"}),n++;continue}if(a==="}"){i.push({type:"brace",value:"}"}),n++;continue}if(a==="["){i.push({type:"paren",value:"["}),n++;continue}if(a==="]"){i.push({type:"paren",value:"]"}),n++;continue}if(a===":"){i.push({type:"separator",value:":"}),n++;continue}if(a===","){i.push({type:"delimiter",value:","}),n++;continue}if(a==='"'){let f="",h=!1;for(a=e[++n];a!=='"';){if(n===e.length){h=!0;break}if(a==="\\"){if(n++,n===e.length){h=!0;break}f+=a+e[n],a=e[++n]}else f+=a,a=e[++n]}a=e[++n],h||i.push({type:"string",value:f});continue}if(a&&/\s/.test(a)){n++;continue}let o=/[0-9]/;if(a&&o.test(a)||a==="-"||a==="."){let f="";for(a==="-"&&(f+=a,a=e[++n]);a&&o.test(a)||a===".";)f+=a,a=e[++n];i.push({type:"number",value:f});continue}let u=/[a-z]/i;if(a&&u.test(a)){let f="";for(;a&&u.test(a)&&n!==e.length;)f+=a,a=e[++n];if(f=="true"||f=="false"||f==="null")i.push({type:"name",value:f});else{n++;continue}continue}n++}return i},Ka=e=>{if(e.length===0)return e;let n=e[e.length-1];switch(n.type){case"separator":return e=e.slice(0,e.length-1),Ka(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ka(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ka(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ka(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ka(e)}return e},sz=e=>{let n=[];return e.map(i=>{i.type==="brace"&&(i.value==="{"?n.push("}"):n.splice(n.lastIndexOf("}"),1)),i.type==="paren"&&(i.value==="["?n.push("]"):n.splice(n.lastIndexOf("]"),1))}),n.length>0&&n.reverse().map(i=>{i==="}"?e.push({type:"brace",value:"}"}):i==="]"&&e.push({type:"paren",value:"]"})}),e},oz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},LS=e=>JSON.parse(oz(sz(Ka(lz(e)))));var zn,yr,Xa,xs,nc,bs,vs,ic,ws,zi,Ss,rc,ac,Yr,lc,sc,_s,Jh,c1,oc,Wh,ep,tp,f1;const d1="__json_buf";function h1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class qc{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Xa.set(this,null),this.controller=new AbortController,xs.set(this,void 0),nc.set(this,()=>{}),bs.set(this,()=>{}),vs.set(this,void 0),ic.set(this,()=>{}),ws.set(this,()=>{}),zi.set(this,{}),Ss.set(this,!1),rc.set(this,!1),ac.set(this,!1),Yr.set(this,!1),lc.set(this,void 0),sc.set(this,void 0),_s.set(this,void 0),oc.set(this,a=>{if(ge(this,rc,!0),no(a)&&(a=new Yn),a instanceof Yn)return ge(this,ac,!0),this._emit("abort",a);if(a instanceof Te)return this._emit("error",a);if(a instanceof Error){const s=new Te(a.message);return s.cause=a,this._emit("error",s)}return this._emit("error",new Te(String(a)))}),ge(this,xs,new Promise((a,s)=>{ge(this,nc,a,"f"),ge(this,bs,s,"f")})),ge(this,vs,new Promise((a,s)=>{ge(this,ic,a,"f"),ge(this,ws,s,"f")})),ne(this,xs,"f").catch(()=>{}),ne(this,vs,"f").catch(()=>{}),ge(this,Xa,n),ge(this,_s,i?.logger??console)}get response(){return ne(this,lc,"f")}get request_id(){return ne(this,sc,"f")}async withResponse(){ge(this,Yr,!0);const n=await ne(this,xs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new qc(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:s}={}){const o=new qc(i,{logger:s});for(const u of i.messages)o._addMessageParam(u);return ge(o,Xa,{...i,stream:!0}),o._run(()=>o._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,oc,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,zn,"m",Wh).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,zn,"m",ep).call(this,h);if(f.controller.signal?.aborted)throw new Yn;ne(this,zn,"m",tp).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,lc,n),ge(this,sc,n?.headers.get("request-id")),ne(this,nc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Ss,"f")}get errored(){return ne(this,rc,"f")}get aborted(){return ne(this,ac,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,zi,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Yr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Yr,!0),await ne(this,vs,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Jh).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",c1).call(this)}_emit(n,...i){if(ne(this,Ss,"f"))return;n==="end"&&(ge(this,Ss,!0),ne(this,ic,"f").call(this));const a=ne(this,zi,"f")[n];if(a&&(ne(this,zi,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Yr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Yr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Jh).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,zn,"m",Wh).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,zn,"m",ep).call(this,u);if(o.controller.signal?.aborted)throw new Yn;ne(this,zn,"m",tp).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(yr=new WeakMap,Xa=new WeakMap,xs=new WeakMap,nc=new WeakMap,bs=new WeakMap,vs=new WeakMap,ic=new WeakMap,ws=new WeakMap,zi=new WeakMap,Ss=new WeakMap,rc=new WeakMap,ac=new WeakMap,Yr=new WeakMap,lc=new WeakMap,sc=new WeakMap,_s=new WeakMap,oc=new WeakMap,zn=new WeakSet,Jh=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},c1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},Wh=function(){this.ended||ge(this,yr,void 0)},ep=function(i){if(this.ended)return;const a=ne(this,zn,"m",f1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{h1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(u1(a,ne(this,Xa,"f"),{logger:ne(this,_s,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},tp=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,yr,void 0),u1(i,ne(this,Xa,"f"),{logger:ne(this,_s,"f")})},f1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.container=i.delta.container,a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,a.context_management=i.context_management,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push(i.content_block),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&h1(s)){let o=s[d1]||"";o+=i.delta.partial_json;const u={...s};if(Object.defineProperty(u,d1,{value:o,enumerable:!1,writable:!0}),o)try{u.input=LS(o)}catch(f){const h=new Te(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${o}`);ne(this,oc,"f").call(this,h)}a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const uz=1e5,cz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
23
|
+
${m}`)}return u},Ot=fz(DS);class RS extends Fn{list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/files",go,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}download(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}/content`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},a?.headers]),__binaryResponse:!0})}retrieveMetadata(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}upload(n,i){const{betas:a,...s}=n;return this._client.post("/v1/files",Mm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let OS=class extends Fn{retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/models/${n}?beta=true`,{...a,headers:Ve([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/models?beta=true",go,{query:s,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const LS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function c1(e,n,i){return!n||!("parse"in(n.output_format??{}))?{...e,content:e.content.map(a=>{if(a.type==="text"){const s=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null}:HS(e,n,i)}function HS(e,n,i){let a=null;const s=e.content.map(o=>{if(o.type==="text"){const u=dz(n,o.text);a===null&&(a=u);const f=Object.defineProperty({...o},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return o});return{...e,content:s,parsed_output:a}}function dz(e,n){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(n):JSON.parse(n)}catch(i){throw new Te(`Failed to parse structured output: ${i}`)}}const hz=e=>{let n=0,i=[];for(;n<e.length;){let a=e[n];if(a==="\\"){n++;continue}if(a==="{"){i.push({type:"brace",value:"{"}),n++;continue}if(a==="}"){i.push({type:"brace",value:"}"}),n++;continue}if(a==="["){i.push({type:"paren",value:"["}),n++;continue}if(a==="]"){i.push({type:"paren",value:"]"}),n++;continue}if(a===":"){i.push({type:"separator",value:":"}),n++;continue}if(a===","){i.push({type:"delimiter",value:","}),n++;continue}if(a==='"'){let f="",h=!1;for(a=e[++n];a!=='"';){if(n===e.length){h=!0;break}if(a==="\\"){if(n++,n===e.length){h=!0;break}f+=a+e[n],a=e[++n]}else f+=a,a=e[++n]}a=e[++n],h||i.push({type:"string",value:f});continue}if(a&&/\s/.test(a)){n++;continue}let o=/[0-9]/;if(a&&o.test(a)||a==="-"||a==="."){let f="";for(a==="-"&&(f+=a,a=e[++n]);a&&o.test(a)||a===".";)f+=a,a=e[++n];i.push({type:"number",value:f});continue}let u=/[a-z]/i;if(a&&u.test(a)){let f="";for(;a&&u.test(a)&&n!==e.length;)f+=a,a=e[++n];if(f=="true"||f=="false"||f==="null")i.push({type:"name",value:f});else{n++;continue}continue}n++}return i},Ka=e=>{if(e.length===0)return e;let n=e[e.length-1];switch(n.type){case"separator":return e=e.slice(0,e.length-1),Ka(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ka(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ka(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ka(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ka(e)}return e},pz=e=>{let n=[];return e.map(i=>{i.type==="brace"&&(i.value==="{"?n.push("}"):n.splice(n.lastIndexOf("}"),1)),i.type==="paren"&&(i.value==="["?n.push("]"):n.splice(n.lastIndexOf("]"),1))}),n.length>0&&n.reverse().map(i=>{i==="}"?e.push({type:"brace",value:"}"}):i==="]"&&e.push({type:"paren",value:"]"})}),e},mz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},BS=e=>JSON.parse(mz(pz(Ka(hz(e)))));var zn,yr,Xa,xs,nc,bs,vs,ic,ws,zi,Ss,rc,ac,Pr,lc,sc,_s,Wh,f1,oc,ep,tp,np,d1;const h1="__json_buf";function p1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class qc{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Xa.set(this,null),this.controller=new AbortController,xs.set(this,void 0),nc.set(this,()=>{}),bs.set(this,()=>{}),vs.set(this,void 0),ic.set(this,()=>{}),ws.set(this,()=>{}),zi.set(this,{}),Ss.set(this,!1),rc.set(this,!1),ac.set(this,!1),Pr.set(this,!1),lc.set(this,void 0),sc.set(this,void 0),_s.set(this,void 0),oc.set(this,a=>{if(ge(this,rc,!0),no(a)&&(a=new Pn),a instanceof Pn)return ge(this,ac,!0),this._emit("abort",a);if(a instanceof Te)return this._emit("error",a);if(a instanceof Error){const s=new Te(a.message);return s.cause=a,this._emit("error",s)}return this._emit("error",new Te(String(a)))}),ge(this,xs,new Promise((a,s)=>{ge(this,nc,a,"f"),ge(this,bs,s,"f")})),ge(this,vs,new Promise((a,s)=>{ge(this,ic,a,"f"),ge(this,ws,s,"f")})),ne(this,xs,"f").catch(()=>{}),ne(this,vs,"f").catch(()=>{}),ge(this,Xa,n),ge(this,_s,i?.logger??console)}get response(){return ne(this,lc,"f")}get request_id(){return ne(this,sc,"f")}async withResponse(){ge(this,Pr,!0);const n=await ne(this,xs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new qc(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:s}={}){const o=new qc(i,{logger:s});for(const u of i.messages)o._addMessageParam(u);return ge(o,Xa,{...i,stream:!0}),o._run(()=>o._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,oc,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,zn,"m",ep).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,zn,"m",tp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,lc,n),ge(this,sc,n?.headers.get("request-id")),ne(this,nc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Ss,"f")}get errored(){return ne(this,rc,"f")}get aborted(){return ne(this,ac,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,zi,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Pr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Pr,!0),await ne(this,vs,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Wh).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",f1).call(this)}_emit(n,...i){if(ne(this,Ss,"f"))return;n==="end"&&(ge(this,Ss,!0),ne(this,ic,"f").call(this));const a=ne(this,zi,"f")[n];if(a&&(ne(this,zi,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Wh).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,zn,"m",ep).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,zn,"m",tp).call(this,u);if(o.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(yr=new WeakMap,Xa=new WeakMap,xs=new WeakMap,nc=new WeakMap,bs=new WeakMap,vs=new WeakMap,ic=new WeakMap,ws=new WeakMap,zi=new WeakMap,Ss=new WeakMap,rc=new WeakMap,ac=new WeakMap,Pr=new WeakMap,lc=new WeakMap,sc=new WeakMap,_s=new WeakMap,oc=new WeakMap,zn=new WeakSet,Wh=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},f1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ep=function(){this.ended||ge(this,yr,void 0)},tp=function(i){if(this.ended)return;const a=ne(this,zn,"m",d1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{p1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(c1(a,ne(this,Xa,"f"),{logger:ne(this,_s,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},np=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,yr,void 0),c1(i,ne(this,Xa,"f"),{logger:ne(this,_s,"f")})},d1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.container=i.delta.container,a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,a.context_management=i.context_management,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push(i.content_block),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&p1(s)){let o=s[h1]||"";o+=i.delta.partial_json;const u={...s};if(Object.defineProperty(u,h1,{value:o,enumerable:!1,writable:!0}),o)try{u.input=BS(o)}catch(f){const h=new Te(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${o}`);ne(this,oc,"f").call(this,h)}a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const gz=1e5,yz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
24
24
|
1. Task Overview
|
|
25
25
|
The user's core request and success criteria
|
|
26
26
|
Any clarifications or constraints they specified
|
|
@@ -42,20 +42,20 @@ User preferences or style requirements
|
|
|
42
42
|
Domain-specific details that aren't obvious
|
|
43
43
|
Any promises made to the user
|
|
44
44
|
Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
|
|
45
|
-
Wrap your summary in <summary></summary> tags.`;var ks,Fa,
|
|
46
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!s.stream&&o==null){const u=RS[s.model]??void 0;o=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:s,timeout:o??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}parse(n,i){return i={...i,headers:Ve([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-11-13"].toString()},i?.headers])},this.create(n,i).then(a=>OS(a,n,{logger:this._client.logger??console}))}stream(n,i){return qc.createMessage(this,n,i)}countTokens(n,i){const{betas:a,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString()},i?.headers])})}toolRunner(n,i){return new HS(this._client,n,i)}};mf.Batches=BS;mf.BetaToolRunner=HS;class US extends Fn{create(n,i={},a){const{betas:s,...o}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Cm({body:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])},this._client))}retrieve(n,i,a){const{skill_id:s,betas:o}=i;return this._client.get(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n,i={},a){const{betas:s,...o}=i??{};return this._client.getAPIList(Ot`/v1/skills/${n}/versions?beta=true`,NS,{query:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}delete(n,i,a){const{skill_id:s,betas:o}=i;return this._client.delete(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}}class Mm extends Fn{constructor(){super(...arguments),this.versions=new US(this._client)}create(n={},i){const{betas:a,...s}=n??{};return this._client.post("/v1/skills?beta=true",Cm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])},this._client))}retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/skills?beta=true",NS,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}}Mm.Versions=US;class gl extends Fn{constructor(){super(...arguments),this.models=new jS(this._client),this.messages=new mf(this._client),this.files=new DS(this._client),this.skills=new Mm(this._client)}}gl.Models=jS;gl.Messages=mf;gl.Files=DS;gl.Skills=Mm;class IS extends Fn{create(n,i){const{betas:a,...s}=n;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}}var Dn,br,Cs,uc,Ms,Ts,cc,As,Di,zs,fc,dc,Xr,hc,pc,np,y1,ip,rp,ap,lp,x1;const b1="__json_buf";function v1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class $c{constructor(){Dn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,Cs.set(this,void 0),uc.set(this,()=>{}),Ms.set(this,()=>{}),Ts.set(this,void 0),cc.set(this,()=>{}),As.set(this,()=>{}),Di.set(this,{}),zs.set(this,!1),fc.set(this,!1),dc.set(this,!1),Xr.set(this,!1),hc.set(this,void 0),pc.set(this,void 0),ip.set(this,n=>{if(ge(this,fc,!0),no(n)&&(n=new Yn),n instanceof Yn)return ge(this,dc,!0),this._emit("abort",n);if(n instanceof Te)return this._emit("error",n);if(n instanceof Error){const i=new Te(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Te(String(n)))}),ge(this,Cs,new Promise((n,i)=>{ge(this,uc,n,"f"),ge(this,Ms,i,"f")})),ge(this,Ts,new Promise((n,i)=>{ge(this,cc,n,"f"),ge(this,As,i,"f")})),ne(this,Cs,"f").catch(()=>{}),ne(this,Ts,"f").catch(()=>{})}get response(){return ne(this,hc,"f")}get request_id(){return ne(this,pc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,Cs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new $c;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const s=new $c;for(const o of i.messages)s._addMessageParam(o);return s._run(()=>s._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,ip,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,Dn,"m",rp).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,Dn,"m",ap).call(this,h);if(f.controller.signal?.aborted)throw new Yn;ne(this,Dn,"m",lp).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,hc,n),ge(this,pc,n?.headers.get("request-id")),ne(this,uc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,zs,"f")}get errored(){return ne(this,fc,"f")}get aborted(){return ne(this,dc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,Di,"f")[n]||(ne(this,Di,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,Di,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,Di,"f")[n]||(ne(this,Di,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Xr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Xr,!0),await ne(this,Ts,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,Dn,"m",np).call(this)}async finalText(){return await this.done(),ne(this,Dn,"m",y1).call(this)}_emit(n,...i){if(ne(this,zs,"f"))return;n==="end"&&(ge(this,zs,!0),ne(this,cc,"f").call(this));const a=ne(this,Di,"f")[n];if(a&&(ne(this,Di,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,Dn,"m",np).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,Dn,"m",rp).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,Dn,"m",ap).call(this,u);if(o.controller.signal?.aborted)throw new Yn;ne(this,Dn,"m",lp).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(br=new WeakMap,Cs=new WeakMap,uc=new WeakMap,Ms=new WeakMap,Ts=new WeakMap,cc=new WeakMap,As=new WeakMap,Di=new WeakMap,zs=new WeakMap,fc=new WeakMap,dc=new WeakMap,Xr=new WeakMap,hc=new WeakMap,pc=new WeakMap,ip=new WeakMap,Dn=new WeakSet,np=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},y1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},rp=function(){this.ended||ge(this,br,void 0)},ap=function(i){if(this.ended)return;const a=ne(this,Dn,"m",x1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{v1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(a,!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,br,a);break}}},lp=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,br,void 0),i},x1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push({...i.content_block}),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&v1(s)){let o=s[b1]||"";o+=i.delta.partial_json;const u={...s};Object.defineProperty(u,b1,{value:o,enumerable:!1,writable:!0}),o&&(u.input=LS(o)),a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class qS extends Fn{create(n,i){return this._client.post("/v1/messages/batches",{body:n,...i})}retrieve(n,i){return this._client.get(Ot`/v1/messages/batches/${n}`,i)}list(n={},i){return this._client.getAPIList("/v1/messages/batches",go,{query:n,...i})}delete(n,i){return this._client.delete(Ot`/v1/messages/batches/${n}`,i)}cancel(n,i){return this._client.post(Ot`/v1/messages/batches/${n}/cancel`,i)}async results(n,i){const a=await this.retrieve(n);if(!a.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);return this._client.get(a.results_url,{...i,headers:Ve([{Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,o)=>pf.fromResponse(o.response,o.controller))}}class Tm extends Fn{constructor(){super(...arguments),this.batches=new qS(this._client)}create(n,i){n.model in w1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${w1[n.model]}
|
|
47
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!n.stream&&a==null){const s=
|
|
45
|
+
Wrap your summary in <summary></summary> tags.`;var ks,Fa,Yr,Mt,Es,gn,Di,xr,Ns,m1,Xp;function g1(){let e,n;return{promise:new Promise((a,s)=>{e=a,n=s}),resolve:e,reject:n}}class US{constructor(n,i,a){ks.add(this),this.client=n,Fa.set(this,!1),Yr.set(this,!1),Mt.set(this,void 0),Es.set(this,void 0),gn.set(this,void 0),Di.set(this,void 0),xr.set(this,void 0),Ns.set(this,0),ge(this,Mt,{params:{...i,messages:structuredClone(i.messages)}}),ge(this,Es,{...a,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},a?.headers])}),ge(this,xr,g1())}async*[(Fa=new WeakMap,Yr=new WeakMap,Mt=new WeakMap,Es=new WeakMap,gn=new WeakMap,Di=new WeakMap,xr=new WeakMap,Ns=new WeakMap,ks=new WeakSet,m1=async function(){const i=ne(this,Mt,"f").params.compactionControl;if(!i||!i.enabled)return!1;let a=0;if(ne(this,gn,"f")!==void 0)try{const d=await ne(this,gn,"f");a=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}const s=i.contextTokenThreshold??gz;if(a<s)return!1;const o=i.model??ne(this,Mt,"f").params.model,u=i.summaryPrompt??yz,f=ne(this,Mt,"f").params.messages;if(f[f.length-1].role==="assistant"){const d=f[f.length-1];if(Array.isArray(d.content)){const g=d.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():d.content=g}}const h=await this.client.beta.messages.create({model:o,messages:[...f,{role:"user",content:[{type:"text",text:u}]}],max_tokens:ne(this,Mt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(h.content[0]?.type!=="text")throw new Te("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var n;if(ne(this,Fa,"f"))throw new Te("Cannot iterate over a consumed stream");ge(this,Fa,!0),ge(this,Yr,!0),ge(this,Di,void 0);try{for(;;){let i;try{if(ne(this,Mt,"f").params.max_iterations&&ne(this,Ns,"f")>=ne(this,Mt,"f").params.max_iterations)break;ge(this,Yr,!1,"f"),ge(this,Di,void 0,"f"),ge(this,Ns,(n=ne(this,Ns,"f"),n++,n),"f"),ge(this,gn,void 0,"f");const{max_iterations:a,compactionControl:s,...o}=ne(this,Mt,"f").params;if(o.stream?(i=this.client.beta.messages.stream({...o},ne(this,Es,"f")),ge(this,gn,i.finalMessage(),"f"),ne(this,gn,"f").catch(()=>{}),yield i):(ge(this,gn,this.client.beta.messages.create({...o,stream:!1},ne(this,Es,"f")),"f"),yield ne(this,gn,"f")),!await ne(this,ks,"m",m1).call(this)){if(!ne(this,Yr,"f")){const{role:h,content:d}=await ne(this,gn,"f");ne(this,Mt,"f").params.messages.push({role:h,content:d})}const f=await ne(this,ks,"m",Xp).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Yr,"f"))break}}finally{i&&i.abort()}}if(!ne(this,gn,"f"))throw new Te("ToolRunner concluded without a message from the server");ne(this,xr,"f").resolve(await ne(this,gn,"f"))}catch(i){throw ge(this,Fa,!1),ne(this,xr,"f").promise.catch(()=>{}),ne(this,xr,"f").reject(i),ge(this,xr,g1()),i}}setMessagesParams(n){typeof n=="function"?ne(this,Mt,"f").params=n(ne(this,Mt,"f").params):ne(this,Mt,"f").params=n,ge(this,Yr,!0),ge(this,Di,void 0)}async generateToolResponse(){const n=await ne(this,gn,"f")??this.params.messages.at(-1);return n?ne(this,ks,"m",Xp).call(this,n):null}done(){return ne(this,xr,"f").promise}async runUntilDone(){if(!ne(this,Fa,"f"))for await(const n of this);return this.done()}get params(){return ne(this,Mt,"f").params}pushMessages(...n){this.setMessagesParams(i=>({...i,messages:[...i.messages,...n]}))}then(n,i){return this.runUntilDone().then(n,i)}}Xp=async function(n){return ne(this,Di,"f")!==void 0?ne(this,Di,"f"):(ge(this,Di,xz(ne(this,Mt,"f").params,n)),ne(this,Di,"f"))};async function xz(e,n=e.messages.at(-1)){if(!n||n.role!=="assistant"||!n.content||typeof n.content=="string")return null;const i=n.content.filter(s=>s.type==="tool_use");return i.length===0?null:{role:"user",content:await Promise.all(i.map(async s=>{const o=e.tools.find(u=>("name"in u?u.name:u.mcp_server_name)===s.name);if(!o||!("run"in o))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let u=s.input;"parse"in o&&o.parse&&(u=o.parse(u));const f=await o.run(u);return{type:"tool_result",tool_use_id:s.id,content:f}}catch(u){return{type:"tool_result",tool_use_id:s.id,content:`Error: ${u instanceof Error?u.message:String(u)}`,is_error:!0}}}))}}class mf{constructor(n,i){this.iterator=n,this.controller=i}async*decoder(){const n=new mo;for await(const i of this.iterator)for(const a of n.decode(i))yield JSON.parse(a);for(const i of n.flush())yield JSON.parse(i)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,i){if(!n.body)throw i.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Te("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Te("Attempted to iterate over a response with no body");return new mf(Nm(n.body),i)}}let IS=class extends Fn{create(n,i){const{betas:a,...s}=n;return this._client.post("/v1/messages/batches?beta=true",{body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/messages/batches?beta=true",go,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},a?.headers])})}cancel(n,i={},a){const{betas:s}=i??{};return this._client.post(Ot`/v1/messages/batches/${n}/cancel?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},a?.headers])})}async results(n,i={},a){const s=await this.retrieve(n);if(!s.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);const{betas:o}=i??{};return this._client.get(s.results_url,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},a?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,f)=>mf.fromResponse(f.response,f.controller))}};const y1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};let gf=class extends Fn{constructor(){super(...arguments),this.batches=new IS(this._client)}create(n,i){const{betas:a,...s}=n;s.model in y1&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${y1[s.model]}
|
|
46
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!s.stream&&o==null){const u=LS[s.model]??void 0;o=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:s,timeout:o??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}parse(n,i){return i={...i,headers:Ve([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-11-13"].toString()},i?.headers])},this.create(n,i).then(a=>HS(a,n,{logger:this._client.logger??console}))}stream(n,i){return qc.createMessage(this,n,i)}countTokens(n,i){const{betas:a,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString()},i?.headers])})}toolRunner(n,i){return new US(this._client,n,i)}};gf.Batches=IS;gf.BetaToolRunner=US;class qS extends Fn{create(n,i={},a){const{betas:s,...o}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Mm({body:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])},this._client))}retrieve(n,i,a){const{skill_id:s,betas:o}=i;return this._client.get(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n,i={},a){const{betas:s,...o}=i??{};return this._client.getAPIList(Ot`/v1/skills/${n}/versions?beta=true`,MS,{query:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}delete(n,i,a){const{skill_id:s,betas:o}=i;return this._client.delete(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}}class Tm extends Fn{constructor(){super(...arguments),this.versions=new qS(this._client)}create(n={},i){const{betas:a,...s}=n??{};return this._client.post("/v1/skills?beta=true",Mm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])},this._client))}retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/skills?beta=true",MS,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}}Tm.Versions=qS;class gl extends Fn{constructor(){super(...arguments),this.models=new OS(this._client),this.messages=new gf(this._client),this.files=new RS(this._client),this.skills=new Tm(this._client)}}gl.Models=OS;gl.Messages=gf;gl.Files=RS;gl.Skills=Tm;class $S extends Fn{create(n,i){const{betas:a,...s}=n;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}}var jn,br,Cs,uc,Ms,Ts,cc,As,ji,zs,fc,dc,Xr,hc,pc,ip,x1,rp,ap,lp,sp,b1;const v1="__json_buf";function w1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class $c{constructor(){jn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,Cs.set(this,void 0),uc.set(this,()=>{}),Ms.set(this,()=>{}),Ts.set(this,void 0),cc.set(this,()=>{}),As.set(this,()=>{}),ji.set(this,{}),zs.set(this,!1),fc.set(this,!1),dc.set(this,!1),Xr.set(this,!1),hc.set(this,void 0),pc.set(this,void 0),rp.set(this,n=>{if(ge(this,fc,!0),no(n)&&(n=new Pn),n instanceof Pn)return ge(this,dc,!0),this._emit("abort",n);if(n instanceof Te)return this._emit("error",n);if(n instanceof Error){const i=new Te(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Te(String(n)))}),ge(this,Cs,new Promise((n,i)=>{ge(this,uc,n,"f"),ge(this,Ms,i,"f")})),ge(this,Ts,new Promise((n,i)=>{ge(this,cc,n,"f"),ge(this,As,i,"f")})),ne(this,Cs,"f").catch(()=>{}),ne(this,Ts,"f").catch(()=>{})}get response(){return ne(this,hc,"f")}get request_id(){return ne(this,pc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,Cs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new $c;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const s=new $c;for(const o of i.messages)s._addMessageParam(o);return s._run(()=>s._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,rp,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,jn,"m",ap).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,jn,"m",lp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,hc,n),ge(this,pc,n?.headers.get("request-id")),ne(this,uc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,zs,"f")}get errored(){return ne(this,fc,"f")}get aborted(){return ne(this,dc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,ji,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Xr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Xr,!0),await ne(this,Ts,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,jn,"m",ip).call(this)}async finalText(){return await this.done(),ne(this,jn,"m",x1).call(this)}_emit(n,...i){if(ne(this,zs,"f"))return;n==="end"&&(ge(this,zs,!0),ne(this,cc,"f").call(this));const a=ne(this,ji,"f")[n];if(a&&(ne(this,ji,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,jn,"m",ip).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,jn,"m",ap).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,jn,"m",lp).call(this,u);if(o.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(br=new WeakMap,Cs=new WeakMap,uc=new WeakMap,Ms=new WeakMap,Ts=new WeakMap,cc=new WeakMap,As=new WeakMap,ji=new WeakMap,zs=new WeakMap,fc=new WeakMap,dc=new WeakMap,Xr=new WeakMap,hc=new WeakMap,pc=new WeakMap,rp=new WeakMap,jn=new WeakSet,ip=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},x1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ap=function(){this.ended||ge(this,br,void 0)},lp=function(i){if(this.ended)return;const a=ne(this,jn,"m",b1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{w1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(a,!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,br,a);break}}},sp=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,br,void 0),i},b1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push({...i.content_block}),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&w1(s)){let o=s[v1]||"";o+=i.delta.partial_json;const u={...s};Object.defineProperty(u,v1,{value:o,enumerable:!1,writable:!0}),o&&(u.input=BS(o)),a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class VS extends Fn{create(n,i){return this._client.post("/v1/messages/batches",{body:n,...i})}retrieve(n,i){return this._client.get(Ot`/v1/messages/batches/${n}`,i)}list(n={},i){return this._client.getAPIList("/v1/messages/batches",go,{query:n,...i})}delete(n,i){return this._client.delete(Ot`/v1/messages/batches/${n}`,i)}cancel(n,i){return this._client.post(Ot`/v1/messages/batches/${n}/cancel`,i)}async results(n,i){const a=await this.retrieve(n);if(!a.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);return this._client.get(a.results_url,{...i,headers:Ve([{Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,o)=>mf.fromResponse(o.response,o.controller))}}class Am extends Fn{constructor(){super(...arguments),this.batches=new VS(this._client)}create(n,i){n.model in S1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${S1[n.model]}
|
|
47
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!n.stream&&a==null){const s=LS[n.model]??void 0;a=this._client.calculateNonstreamingTimeout(n.max_tokens,s)}return this._client.post("/v1/messages",{body:n,timeout:a??6e5,...i,stream:n.stream??!1})}stream(n,i){return $c.createMessage(this,n,i)}countTokens(n,i){return this._client.post("/v1/messages/count_tokens",{body:n,...i})}}const S1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};Am.Batches=VS;class PS extends Fn{retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/models/${n}`,{...a,headers:Ve([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/models",go,{query:s,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}var bz={};const mc=e=>{if(typeof globalThis.process<"u")return bz?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Fp,zm,Cc,YS;const vz="\\n\\nHuman:",wz="\\n\\nAssistant:";class kt{constructor({baseURL:n=mc("ANTHROPIC_BASE_URL"),apiKey:i=mc("ANTHROPIC_API_KEY")??null,authToken:a=mc("ANTHROPIC_AUTH_TOKEN")??null,...s}={}){Fp.add(this),Cc.set(this,void 0);const o={apiKey:i,authToken:a,...s,baseURL:n||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&I5())throw new Te(`It looks like you're running in a browser-like environment.
|
|
48
48
|
|
|
49
49
|
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
50
50
|
If you understand the risks and have appropriate mitigations in place,
|
|
51
51
|
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
52
52
|
|
|
53
53
|
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
54
|
-
`);this.baseURL=o.baseURL,this.timeout=o.timeout??Am.DEFAULT_TIMEOUT,this.logger=o.logger??console;const u="warn";this.logLevel=u,this.logLevel=a1(o.logLevel,"ClientOptions.logLevel",this)??a1(mc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??B5(),ge(this,Cc,I5),this._options=o,this.apiKey=typeof i=="string"?i:null,this.authToken=a}withOptions(n){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:i}){if(!(n.get("x-api-key")||n.get("authorization"))&&!(this.apiKey&&n.get("x-api-key"))&&!i.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!i.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(n){return Ve([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return Object.entries(n).filter(([i,a])=>typeof a<"u").map(([i,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(i)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(i)}=`;throw new Te(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Qa}`}defaultIdempotencyKey(){return`stainless-node-retry-${cS()}`}makeStatusError(n,i,a,s){return qt.generate(n,i,a,s)}buildURL(n,i,a){const s=!ne(this,Xp,"m",VS).call(this)&&a||this.baseURL,o=M5(n)?new URL(n):new URL(s+(s.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return T5(u)||(i={...u,...i}),typeof i=="object"&&i&&!Array.isArray(i)&&(o.search=this.stringifyQuery(i)),o.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:i,options:a}){}get(n,i){return this.methodRequest("get",n,i)}post(n,i){return this.methodRequest("post",n,i)}patch(n,i){return this.methodRequest("patch",n,i)}put(n,i){return this.methodRequest("put",n,i)}delete(n,i){return this.methodRequest("delete",n,i)}methodRequest(n,i,a){return this.request(Promise.resolve(a).then(s=>({method:n,path:i,...s})))}request(n,i=null){return new hf(this,this.makeRequest(n,i,void 0))}async makeRequest(n,i,a){const s=await n,o=s.maxRetries??this.maxRetries;i==null&&(i=o),await this.prepareOptions(s);const{req:u,url:f,timeout:h}=await this.buildRequest(s,{retryCount:o-i});await this.prepareRequest(u,{url:f,options:s});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=a===void 0?"":`, retryOf: ${a}`,m=Date.now();if(Pt(this).debug(`[${d}] sending request`,Zr({retryOfRequestLogID:a,method:s.method,url:f,options:s,headers:u.headers})),s.signal?.aborted)throw new Yn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,h,x).catch(Ip),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(s.signal?.aborted)throw new Yn;const j=no(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Pt(this).info(`[${d}] connection ${j?"timed out":"failed"} - ${_}`),Pt(this).debug(`[${d}] connection ${j?"timed out":"failed"} (${_})`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),this.retryRequest(s,i,a??d);throw Pt(this).info(`[${d}] connection ${j?"timed out":"failed"} - error; no more retries left`),Pt(this).debug(`[${d}] connection ${j?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),j?new fS:new df({cause:b})}const N=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,j])=>", "+_+": "+JSON.stringify(j)).join(""),E=`[${d}${g}${N}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(i&&_){const H=`retrying, ${i} attempts remaining`;return await U5(b.body),Pt(this).info(`${E} - ${H}`),Pt(this).debug(`[${d}] response error (${H})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(s,i,a??d,b.headers)}const j=_?"error; no more retries left":"error; not retryable";Pt(this).info(`${E} - ${j}`);const k=await b.text().catch(H=>Ip(H).message),C=vS(k),L=C?void 0:k;throw Pt(this).debug(`[${d}] response error (${j})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Pt(this).info(E),Pt(this).debug(`[${d}] response start`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:s,controller:x,requestLogID:d,retryOfRequestLogID:a,startTime:m}}getAPIList(n,i,a){return this.requestAPIList(i,{method:"get",path:n,...a})}requestAPIList(n,i){const a=this.makeRequest(i,null,void 0);return new Z5(this,a,n)}async fetchWithTimeout(n,i,a,s){const{signal:o,method:u,...f}=i||{};o&&o.addEventListener("abort",()=>s.abort());const h=setTimeout(()=>s.abort(),a),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:s.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,n,g)}finally{clearTimeout(h)}}async shouldRetry(n){const i=n.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,i,a,s){let o;const u=s?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(o=h)}const f=s?.get("retry-after");if(f&&!o){const h=parseFloat(f);Number.isNaN(h)?o=Date.parse(f)-Date.now():o=h*1e3}if(!(o&&0<=o&&o<60*1e3)){const h=n.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(i,h)}return await D5(o),this.makeRequest(n,i-1,a)}calculateDefaultRetryTimeoutMillis(n,i){const o=i-n,u=Math.min(.5*Math.pow(2,o),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(n,i){if(36e5*n/128e3>6e5||i!=null&&n>i)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:i=0}={}){const a={...n},{method:s,path:o,query:u,defaultBaseURL:f}=a,h=this.buildURL(o,u,f);"timeout"in a&&z5("timeout",a.timeout),a.timeout=a.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:a}),m=await this.buildHeaders({options:n,method:s,bodyHeaders:d,retryCount:i});return{req:{method:s,headers:m,...a.signal&&{signal:a.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...a.fetchOptions??{}},url:h,timeout:a.timeout}}async buildHeaders({options:n,method:i,bodyHeaders:a,retryCount:s}){let o={};this.idempotencyHeader&&i!=="get"&&(n.idempotencyKey||(n.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=n.idempotencyKey);const u=Ve([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...n.timeout?{"X-Stainless-Timeout":String(Math.trunc(n.timeout/1e3))}:{},...H5(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,a,n.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:n,headers:i}}){if(!n)return{bodyHeaders:void 0,body:void 0};const a=Ve([i]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&a.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:typeof n=="object"&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")?{bodyHeaders:void 0,body:SS(n)}:ne(this,Cc,"f").call(this,{body:n,headers:a})}}Am=kt,Cc=new WeakMap,Xp=new WeakSet,VS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=Am;kt.HUMAN_PROMPT=hz;kt.AI_PROMPT=pz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Te;kt.APIError=qt;kt.APIConnectionError=df;kt.APIConnectionTimeoutError=fS;kt.APIUserAbortError=Yn;kt.NotFoundError=mS;kt.ConflictError=gS;kt.RateLimitError=xS;kt.BadRequestError=dS;kt.AuthenticationError=hS;kt.InternalServerError=bS;kt.PermissionDeniedError=pS;kt.UnprocessableEntityError=yS;kt.toFile=tz;class yo extends kt{constructor(){super(...arguments),this.completions=new IS(this),this.messages=new Tm(this),this.models=new $S(this),this.beta=new gl(this)}}yo.Completions=IS;yo.Messages=Tm;yo.Models=$S;yo.Beta=gl;let gc=null;function YS(){return gc||(gc=localStorage.getItem("claude_api_key"),gc)}async function mz(e,n,i="sonnet"){const a=YS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const s=new yo({apiKey:a,dangerouslyAllowBrowser:!0}),o={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await s.messages.create({model:o[i],max_tokens:4096,system:e,messages:[{role:"user",content:n}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function gz(){return!!YS()}function yz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function xz(e,n,i){const a=n.filter(o=>o.target===e),s=[];for(const o of a){const u=i.get(o.source);u!==void 0&&s.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return s.join(`
|
|
54
|
+
`);this.baseURL=o.baseURL,this.timeout=o.timeout??zm.DEFAULT_TIMEOUT,this.logger=o.logger??console;const u="warn";this.logLevel=u,this.logLevel=l1(o.logLevel,"ClientOptions.logLevel",this)??l1(mc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??Y5(),ge(this,Cc,F5),this._options=o,this.apiKey=typeof i=="string"?i:null,this.authToken=a}withOptions(n){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:i}){if(!(n.get("x-api-key")||n.get("authorization"))&&!(this.apiKey&&n.get("x-api-key"))&&!i.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!i.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(n){return Ve([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return Object.entries(n).filter(([i,a])=>typeof a<"u").map(([i,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(i)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(i)}=`;throw new Te(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Qa}`}defaultIdempotencyKey(){return`stainless-node-retry-${dS()}`}makeStatusError(n,i,a,s){return qt.generate(n,i,a,s)}buildURL(n,i,a){const s=!ne(this,Fp,"m",YS).call(this)&&a||this.baseURL,o=O5(n)?new URL(n):new URL(s+(s.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return L5(u)||(i={...u,...i}),typeof i=="object"&&i&&!Array.isArray(i)&&(o.search=this.stringifyQuery(i)),o.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:i,options:a}){}get(n,i){return this.methodRequest("get",n,i)}post(n,i){return this.methodRequest("post",n,i)}patch(n,i){return this.methodRequest("patch",n,i)}put(n,i){return this.methodRequest("put",n,i)}delete(n,i){return this.methodRequest("delete",n,i)}methodRequest(n,i,a){return this.request(Promise.resolve(a).then(s=>({method:n,path:i,...s})))}request(n,i=null){return new pf(this,this.makeRequest(n,i,void 0))}async makeRequest(n,i,a){const s=await n,o=s.maxRetries??this.maxRetries;i==null&&(i=o),await this.prepareOptions(s);const{req:u,url:f,timeout:h}=await this.buildRequest(s,{retryCount:o-i});await this.prepareRequest(u,{url:f,options:s});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=a===void 0?"":`, retryOf: ${a}`,m=Date.now();if(Yt(this).debug(`[${d}] sending request`,Zr({retryOfRequestLogID:a,method:s.method,url:f,options:s,headers:u.headers})),s.signal?.aborted)throw new Pn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,h,x).catch(qp),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(s.signal?.aborted)throw new Pn;const D=no(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - ${_}`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (${_})`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),this.retryRequest(s,i,a??d);throw Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - error; no more retries left`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),D?new hS:new hf({cause:b})}const E=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,D])=>", "+_+": "+JSON.stringify(D)).join(""),N=`[${d}${g}${E}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(i&&_){const H=`retrying, ${i} attempts remaining`;return await X5(b.body),Yt(this).info(`${N} - ${H}`),Yt(this).debug(`[${d}] response error (${H})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(s,i,a??d,b.headers)}const D=_?"error; no more retries left":"error; not retryable";Yt(this).info(`${N} - ${D}`);const k=await b.text().catch(H=>qp(H).message),C=SS(k),L=C?void 0:k;throw Yt(this).debug(`[${d}] response error (${D})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Yt(this).info(N),Yt(this).debug(`[${d}] response start`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:s,controller:x,requestLogID:d,retryOfRequestLogID:a,startTime:m}}getAPIList(n,i,a){return this.requestAPIList(i,{method:"get",path:n,...a})}requestAPIList(n,i){const a=this.makeRequest(i,null,void 0);return new nz(this,a,n)}async fetchWithTimeout(n,i,a,s){const{signal:o,method:u,...f}=i||{};o&&o.addEventListener("abort",()=>s.abort());const h=setTimeout(()=>s.abort(),a),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:s.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,n,g)}finally{clearTimeout(h)}}async shouldRetry(n){const i=n.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,i,a,s){let o;const u=s?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(o=h)}const f=s?.get("retry-after");if(f&&!o){const h=parseFloat(f);Number.isNaN(h)?o=Date.parse(f)-Date.now():o=h*1e3}if(!(o&&0<=o&&o<60*1e3)){const h=n.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(i,h)}return await U5(o),this.makeRequest(n,i-1,a)}calculateDefaultRetryTimeoutMillis(n,i){const o=i-n,u=Math.min(.5*Math.pow(2,o),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(n,i){if(36e5*n/128e3>6e5||i!=null&&n>i)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:i=0}={}){const a={...n},{method:s,path:o,query:u,defaultBaseURL:f}=a,h=this.buildURL(o,u,f);"timeout"in a&&B5("timeout",a.timeout),a.timeout=a.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:a}),m=await this.buildHeaders({options:n,method:s,bodyHeaders:d,retryCount:i});return{req:{method:s,headers:m,...a.signal&&{signal:a.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...a.fetchOptions??{}},url:h,timeout:a.timeout}}async buildHeaders({options:n,method:i,bodyHeaders:a,retryCount:s}){let o={};this.idempotencyHeader&&i!=="get"&&(n.idempotencyKey||(n.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=n.idempotencyKey);const u=Ve([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...n.timeout?{"X-Stainless-Timeout":String(Math.trunc(n.timeout/1e3))}:{},...P5(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,a,n.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:n,headers:i}}){if(!n)return{bodyHeaders:void 0,body:void 0};const a=Ve([i]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&a.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:typeof n=="object"&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")?{bodyHeaders:void 0,body:kS(n)}:ne(this,Cc,"f").call(this,{body:n,headers:a})}}zm=kt,Cc=new WeakMap,Fp=new WeakSet,YS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=zm;kt.HUMAN_PROMPT=vz;kt.AI_PROMPT=wz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Te;kt.APIError=qt;kt.APIConnectionError=hf;kt.APIConnectionTimeoutError=hS;kt.APIUserAbortError=Pn;kt.NotFoundError=yS;kt.ConflictError=xS;kt.RateLimitError=vS;kt.BadRequestError=pS;kt.AuthenticationError=mS;kt.InternalServerError=wS;kt.PermissionDeniedError=gS;kt.UnprocessableEntityError=bS;kt.toFile=oz;class yo extends kt{constructor(){super(...arguments),this.completions=new $S(this),this.messages=new Am(this),this.models=new PS(this),this.beta=new gl(this)}}yo.Completions=$S;yo.Messages=Am;yo.Models=PS;yo.Beta=gl;let gc=null;function XS(){return gc||(gc=localStorage.getItem("claude_api_key"),gc)}async function Sz(e,n,i="sonnet"){const a=XS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const s=new yo({apiKey:a,dangerouslyAllowBrowser:!0}),o={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await s.messages.create({model:o[i],max_tokens:4096,system:e,messages:[{role:"user",content:n}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function _z(){return!!XS()}function kz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function Ez(e,n,i){const a=n.filter(o=>o.target===e),s=[];for(const o of a){const u=i.get(o.source);u!==void 0&&s.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return s.join(`
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
-
`)}async function
|
|
58
|
+
`)}async function Nz(e,n){const i=e.data;n.onNodeProgress(e.id,50);const a=i.value||i.placeholder||"User input placeholder";return n.onNodeProgress(e.id,100),n.onLog("info",`Input received: ${a.slice(0,50)}...`,e.id),a}async function Cz(e,n,i){const a=e.data;if(!_z())throw new Error("API key not configured. Please set your Claude API key.");i.onNodeProgress(e.id,20),i.onLog("info",`Starting AI agent: ${a.label}`,e.id);const s=a.systemPrompt||`You are an AI assistant. ${a.description||""}`,o=n||"Please help me with the following task.";i.onNodeProgress(e.id,50);try{const u=await Sz(s,o,a.model||"sonnet");return i.onNodeProgress(e.id,100),i.onLog("success",`Agent completed: ${u.slice(0,100)}...`,e.id),u}catch(u){throw new Error(`Subagent execution failed: ${u instanceof Error?u.message:"Unknown error"}`)}}async function Mz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Executing skill: ${a.label}`,e.id);const s=`# Skill: ${a.label}
|
|
59
59
|
|
|
60
60
|
Category: ${a.category||"general"}
|
|
61
61
|
Skill ID: ${a.skillId||"custom-skill"}
|
|
@@ -67,7 +67,7 @@ ${a.description||"Custom skill"}
|
|
|
67
67
|
${n}
|
|
68
68
|
|
|
69
69
|
## Output
|
|
70
|
-
Skill executed successfully with the provided input.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Skill ${a.label} completed`,e.id),s}async function
|
|
70
|
+
Skill executed successfully with the provided input.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Skill ${a.label} completed`,e.id),s}async function Tz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Connecting to MCP server: ${a.serverName||"unnamed"}`,e.id);const s=`# MCP Server Configuration
|
|
71
71
|
|
|
72
72
|
Server: ${a.serverName||"mcp-server"}
|
|
73
73
|
Type: ${a.serverType||"stdio"}
|
|
@@ -79,7 +79,7 @@ ${n}
|
|
|
79
79
|
${JSON.stringify(a.serverConfig||{},null,2)}
|
|
80
80
|
|
|
81
81
|
## Status
|
|
82
|
-
MCP server connection simulated. In production, this would connect to the actual server.`;return i.onNodeProgress(e.id,100),i.onLog("success",`MCP server ${a.serverName||"unnamed"} connected`,e.id),s}async function
|
|
82
|
+
MCP server connection simulated. In production, this would connect to the actual server.`;return i.onNodeProgress(e.id,100),i.onLog("success",`MCP server ${a.serverName||"unnamed"} connected`,e.id),s}async function Az(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Preparing output: ${a.label}`,e.id);const s=`# Workflow Output
|
|
83
83
|
|
|
84
84
|
## Result
|
|
85
85
|
${n}
|
|
@@ -88,47 +88,53 @@ ${n}
|
|
|
88
88
|
${a.outputType||"auto"}
|
|
89
89
|
|
|
90
90
|
## Generated at
|
|
91
|
-
${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),s}async function
|
|
92
|
-
`)}function
|
|
93
|
-
`)}function
|
|
94
|
-
`)}function yl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function jz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function XS(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(i=XS(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Xt(){for(var e,n,i=0,a="",s=arguments.length;i<s;i++)(e=arguments[i])&&(n=XS(e))&&(a&&(a+=" "),a+=n);return a}const FS="http://localhost:3001/api";async function Rz(e,n){const i=await fetch(`${FS}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(a.message||"Failed to save workflow")}return i.json()}async function Oz(){const e=await fetch(`${FS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Lz(e,n){const i=[];return n.includeSkills&&e.skills.forEach(a=>{i.push({path:a.path,content:a.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(a=>{i.push({path:a.path,content:a.content,type:"command"})}),n.includeAgents&&e.agents.forEach(a=>{i.push({path:a.path,content:a.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Hz({isOpen:e,onClose:n,config:i}){const[a,s]=K.useState("local"),[o,u]=K.useState(!0),[f,h]=K.useState(!0),[d,g]=K.useState(!0),[m,x]=K.useState(!0),[b,w]=K.useState(""),[N,E]=K.useState([]),[_,j]=K.useState(null),[k,C]=K.useState(!1),[L,A]=K.useState(null),[H,F]=K.useState(null);K.useEffect(()=>{e&&Oz().then(w).catch(()=>w("."))},[e]),K.useEffect(()=>{if(!e)return;Lz(i,{location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{E(te),te.length>0&&!_&&j(te[0])})},[e,i,a,o,f,d,m]);const G=async()=>{C(!0),F(null),A(null);const Y={location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await Rz(i,Y);A(te),te.success&&setTimeout(()=>n(),2e3)}catch(te){F(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},q=Y=>{switch(Y){case"skill":return v.jsx(rl,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(E3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(uf,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(sS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(rl,{className:"w-4 h-4 text-gray-400"})}},V=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(il,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(oS,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("button",{onClick:()=>s("local"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Zb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.jsxs("button",{onClick:()=>s("global"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Zb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:o,onChange:Y=>u(Y.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:Y=>h(Y.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:Y=>g(Y.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:Y=>x(Y.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Xt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[N.map((Y,te)=>v.jsxs("button",{onClick:()=>j(Y),className:Xt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===Y?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[q(Y.type),v.jsx("span",{children:Y.path.split("/").pop()})]},te)),N.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:_?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:_.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:_.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[L&&L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(M3,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),L&&!L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Bp,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),H&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Bp,{className:"w-4 h-4"}),v.jsx("span",{children:H})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:G,disabled:k||N.length===0||!V,className:Xt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||N.length===0||!V?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(il,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}function Bz(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:a,edges:s,clearWorkflow:o}=Hi(),{isRunning:u,execute:f}=PS(),[h,d]=K.useState(!1),[g,m]=K.useState(null),x=()=>{const E=Ez(e,a,s,"local");m(E),d(!0)},b=()=>{d(!1),m(null)},w=()=>{u||f()},N=()=>{a.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&o()};return v.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(_3,{className:"w-5 h-5 text-gray-400"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"text",value:e,onChange:E=>n(E.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),i&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),v.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),v.jsxs("button",{onClick:w,disabled:u,className:`
|
|
91
|
+
${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),s}async function zz(e,n,i){const a={results:new Map,cancelled:!1},s=kz(e,n);i.onLog("info",`Starting workflow execution with ${s.length} nodes`);for(const o of s){i.onNodeStart(o.id);try{const u=Ez(o.id,n,a.results);let f;switch(o.type){case"input":f=await Nz(o,i);break;case"subagent":f=await Cz(o,u,i);break;case"skill":f=await Mz(o,u,i);break;case"mcp":f=await Tz(o,u,i);break;case"output":f=await Az(o,u,i);break;default:f=u}a.results.set(o.id,f),i.onNodeComplete(o.id,f)}catch(u){const f=u instanceof Error?u.message:"Unknown error";throw i.onNodeError(o.id,f),i.onLog("error",`Node ${o.data.label} failed: ${f}`,o.id),u}}return a.results}function FS(){const{nodes:e,edges:n,workflowName:i,updateNodeStatus:a}=Hi(),{isRunning:s,startExecution:o,stopExecution:u,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:m,clearLogs:x}=po(),[b,w]=Q.useState([]),E=Q.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),o(),w([]),m("info",`워크플로우 "${i}" 실행 시작...`);try{const D=await zz(e,n,{onNodeStart:L=>{a(L,"running",0),f(L)},onNodeProgress:(L,A)=>{a(L,"running",A)},onNodeComplete:(L,A)=>{a(L,"completed",100),h(L,A)},onNodeError:(L,A)=>{a(L,"error",0),d(L,A)},onLog:(L,A,H)=>{m(L,A,H)}}),k=[],C=[];for(const[L,A]of D){const H=e.find(G=>G.id===L),F=typeof A=="string"?A:JSON.stringify(A,null,2);if(k.push({nodeId:L,label:H?.data.label||L,success:!0,result:F}),H?.type==="output"){const G=`${i.replace(/\s+/g,"_")}_${H.data.label.replace(/\s+/g,"_")}.md`;C.push({name:G,content:F})}}w(C),g(k),u(),m("success","워크플로우 실행 완료!"),C.length>0&&(m("info",`${C.length}개 파일 생성됨`),C.forEach(L=>{m("info",` - ${L.name}`)}))}catch(D){const k=D instanceof Error?D.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,n,i,m,x,o,u,a,f,h,d,g]),N=Q.useCallback((D,k)=>{const C=new Blob([k],{type:"text/markdown;charset=utf-8"}),L=URL.createObjectURL(C),A=document.createElement("a");A.href=L,A.download=D,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${D}`)},[m]),_=Q.useCallback(()=>{b.forEach(D=>{N(D.name,D.content)})},[b,N]);return{isRunning:s,execute:E,generatedFiles:b,downloadFile:N,downloadAllFiles:_}}function jz(e,n,i,a="local"){const s=a==="global"?"~/.claude":".claude",o=Dz(n,s),u=Rz(n,s),f=Oz(e,n,i,s),h=Lz(n);return{skills:o,commands:f,agents:u,mcpSettings:h}}function Dz(e,n){return e.filter(a=>a.type==="skill").filter(a=>a.data.skillType==="custom").map(a=>{const s=a.data,o=yl(s.skillId||s.label),u=`${n}/skills/${o}/SKILL.md`,f=Hz(s);return{name:o,path:u,content:f}})}function Rz(e,n){return e.filter(a=>a.type==="subagent").map(a=>{const s=a.data,o=yl(s.label),u=`${n}/agents/${o}.md`,f=Bz(s);return{name:o,path:u,content:f}})}function Oz(e,n,i,a){if(n.length===0)return[];const s=yl(e),o=`${a}/commands/${s}.md`,u=Uz(e,n,i);return[{name:s,path:o,content:u}]}function Lz(e){const n=e.filter(a=>a.type==="mcp");if(n.length===0)return null;const i={};return n.forEach(a=>{const s=a.data;i[s.serverName]={type:s.serverType,command:s.serverConfig.command,args:s.serverConfig.args,url:s.serverConfig.url,env:s.serverConfig.env}}),{mcpServers:i}}function Hz(e){if(e.skillContent)return e.skillContent;const n=yl(e.skillId||e.label),i=e.description||e.label,a=["---",`name: ${n}`,`description: ${i}`,"---","",`# ${e.label}`,""];return e.mdContent?a.push(e.mdContent):a.push(`Execute the ${e.label} skill.`),a.join(`
|
|
92
|
+
`)}function Bz(e){const n=yl(e.label),i=e.description||e.label,a=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",s=e.model||"sonnet",o=["---",`name: ${n}`,`description: ${i}`,`tools: ${a}`,`model: ${s}`,"---",""];return e.systemPrompt?o.push(e.systemPrompt):e.mdContent?o.push(e.mdContent):(o.push(`# ${e.label}`),o.push(""),o.push(`This agent performs the ${e.role} role.`)),o.join(`
|
|
93
|
+
`)}function Uz(e,n,i){const a=n.filter(g=>g.type==="input"),s=n.filter(g=>g.type==="output"),o=a.map(g=>`<${yl(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];o&&f.push(`argument-hint: ${o}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),a.length>0&&(f.push("## Inputs"),f.push(""),a.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.description||m.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=Iz(n,i);let d=1;return h.forEach(g=>{if(g.type!=="input"){if(f.push(`${d}. **${g.data.label}**`),g.data.description&&f.push(` ${g.data.description}`),g.type==="subagent"){const m=g.data;m.systemPrompt&&f.push(` - Prompt: ${m.systemPrompt.substring(0,100)}${m.systemPrompt.length>100?"...":""}`),m.tools.length>0&&f.push(` - Tools: ${m.tools.join(", ")}`)}if(g.type==="skill"){const m=g.data;m.skillId&&f.push(` - Invoke skill: ${m.skillId}`)}if(g.type==="mcp"){const m=g.data;f.push(` - MCP Server: ${m.serverName}`)}f.push(""),d++}}),s.length>0&&(f.push("## Outputs"),f.push(""),s.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.outputType} format`)})),f.join(`
|
|
94
|
+
`)}function yl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Iz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function GS(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(i=GS(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Xt(){for(var e,n,i=0,a="",s=arguments.length;i<s;i++)(e=arguments[i])&&(n=GS(e))&&(a&&(a+=" "),a+=n);return a}const ZS="http://localhost:3001/api";async function qz(e,n){const i=await fetch(`${ZS}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(a.message||"Failed to save workflow")}return i.json()}async function $z(){const e=await fetch(`${ZS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Vz(e,n){const i=[];return n.includeSkills&&e.skills.forEach(a=>{i.push({path:a.path,content:a.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(a=>{i.push({path:a.path,content:a.content,type:"command"})}),n.includeAgents&&e.agents.forEach(a=>{i.push({path:a.path,content:a.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Pz({isOpen:e,onClose:n,config:i}){const[a,s]=Q.useState("local"),[o,u]=Q.useState(!0),[f,h]=Q.useState(!0),[d,g]=Q.useState(!0),[m,x]=Q.useState(!0),[b,w]=Q.useState(""),[E,N]=Q.useState([]),[_,D]=Q.useState(null),[k,C]=Q.useState(!1),[L,A]=Q.useState(null),[H,F]=Q.useState(null);Q.useEffect(()=>{e&&$z().then(w).catch(()=>w("."))},[e]),Q.useEffect(()=>{if(!e)return;Vz(i,{location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&D(te[0])})},[e,i,a,o,f,d,m]);const G=async()=>{C(!0),F(null),A(null);const P={location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await qz(i,P);A(te),te.success&&setTimeout(()=>n(),2e3)}catch(te){F(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},q=P=>{switch(P){case"skill":return v.jsx(rl,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(M3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(uf,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(uS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(rl,{className:"w-4 h-4 text-gray-400"})}},V=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(il,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Em,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("button",{onClick:()=>s("local"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Qb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.jsxs("button",{onClick:()=>s("global"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Qb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:o,onChange:P=>u(P.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>h(P.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:P=>g(P.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Xt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,te)=>v.jsxs("button",{onClick:()=>D(P),className:Xt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[q(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),E.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:_?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:_.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:_.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[L&&L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(z3,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),L&&!L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),H&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:H})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:G,disabled:k||E.length===0||!V,className:Xt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!V?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(il,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}const QS=df()(cS(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://api.anthropic.com",setApiMode:n=>e({apiMode:n}),setApiKey:n=>e({apiKey:n}),setProxyUrl:n=>e({proxyUrl:n})}),{name:"makecc-settings"}));function Yz({isOpen:e,onClose:n}){const{apiMode:i,apiKey:a,proxyUrl:s,setApiMode:o,setApiKey:u,setProxyUrl:f}=QS(),[h,d]=Q.useState(i),[g,m]=Q.useState(a),[x,b]=Q.useState(s),[w,E]=Q.useState(!1);if(Q.useEffect(()=>{e&&(d(i),m(a),b(s))},[e,i,a,s]),!e)return null;const N=()=>{o(h),u(g),f(x),n()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:n,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Em,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
|
|
95
|
+
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
96
|
+
${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
97
|
+
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),v.jsx(m5,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),v.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),v.jsxs("label",{className:`
|
|
98
|
+
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
99
|
+
${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
100
|
+
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),v.jsx(W3,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),v.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),v.jsx("input",{type:"text",value:x,onChange:_=>b(_.target.value),placeholder:"https://your-proxy-server.com",className:"w-full px-4 py-2.5 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:w?"text":"password",value:g,onChange:_=>m(_.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2.5 pr-10 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("button",{type:"button",onClick:()=>E(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?v.jsx(V3,{className:"w-4 h-4"}):v.jsx(lS,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),v.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),v.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function Xz(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:a,edges:s,clearWorkflow:o}=Hi(),{isRunning:u,execute:f}=FS(),[h,d]=Q.useState(!1),[g,m]=Q.useState(!1),[x,b]=Q.useState(null),w=()=>{const D=jz(e,a,s,"local");b(D),d(!0)},E=()=>{d(!1),b(null)},N=()=>{u||f()},_=()=>{a.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&o()};return v.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(N3,{className:"w-5 h-5 text-gray-400"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"text",value:e,onChange:D=>n(D.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),i&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),v.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),v.jsxs("button",{onClick:N,disabled:u,className:`
|
|
95
101
|
flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
|
|
96
102
|
${u?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
|
|
97
|
-
`,children:[v.jsx(
|
|
103
|
+
`,children:[v.jsx(_m,{className:"w-4 h-4"}),u?"Running...":"Run"]}),v.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(il,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsxs("button",{onClick:_,disabled:a.length===0,className:`
|
|
98
104
|
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
99
105
|
${a.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
|
|
100
|
-
`,title:"모든 노드 삭제",children:[v.jsx(cf,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(
|
|
106
|
+
`,title:"모든 노드 삭제",children:[v.jsx(cf,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(f5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>m(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(uS,{className:"w-5 h-5 text-gray-400"})})]}),x&&v.jsx(Pz,{isOpen:h,onClose:E,config:x}),v.jsx(Yz,{isOpen:g,onClose:()=>m(!1)})]})}const Fz=[{type:"input",label:"User Input",icon:v.jsx(of,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(ho,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(ff,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"mcp",label:"MCP",icon:v.jsx(km,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(sf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function Gz(e){const n=to(),i={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:n,type:"input",position:i,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"subagent":return{id:n,type:"subagent",position:i,data:{label:"Sub Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:n,type:"skill",position:i,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"mcp":return{id:n,type:"mcp",position:i,data:{label:"MCP Server",description:"Connect to external service...",serverType:"stdio",serverName:"",serverConfig:{},status:"idle",usedInputs:[]}};case"output":return{id:n,type:"output",position:i,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function Zz(){const e=Hi(i=>i.addNode),n=i=>{const a=Gz(i);e(a)};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:Fz.map(i=>v.jsxs("button",{onClick:()=>n(i.type),className:`
|
|
101
107
|
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
102
108
|
bg-surface border border-border
|
|
103
109
|
${i.hoverColor}
|
|
104
110
|
transition-all duration-200
|
|
105
111
|
hover:border-gray-500
|
|
106
|
-
`,children:[v.jsx("span",{className:i.color,children:i.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function $z({status:e}){switch(e){case"running":return v.jsx(lS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(L3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Bp,{className:"w-4 h-4 text-red-400"});default:return v.jsx(Sm,{className:"w-4 h-4"})}}function Vz({data:e,selected:n,children:i,headerIcon:a,headerColor:s="bg-gray-700",showSourceHandle:o=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return v.jsxs("div",{className:Xt("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Xt("node-header flex items-center justify-between",s),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[a,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx($z,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>v.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&v.jsx(pl,{type:"target",position:be.Left}),o&&v.jsx(pl,{type:"source",position:be.Right})]})}const xo=K.memo(Vz);function Yz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(of,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>v.jsx("option",{value:i,children:i},i))})]})})}const Pz=K.memo(Yz);function Xz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ho,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&v.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const Fz=K.memo(Xz);function Gz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ff,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const Zz=K.memo(Gz);function Qz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(_m,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.serverName&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.serverName}),v.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",e.serverType]})]})})}const Kz=K.memo(Qz);function Jz(e){switch(e){case"markdown":case"document":return v.jsx(rl,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(aS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(Y3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(Z3,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(sf,{className:"w-4 h-4 text-emerald-100"})}}function Wz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:Jz(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const eD=K.memo(Wz),zm=km(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1})}));function tD(e,n){const{source:i,target:a}=e;if(i===a)return!1;const s=n.find(u=>u.id===i),o=n.find(u=>u.id===a);return!s||!o?!1:s.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):o.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const nD={input:Pz,subagent:Fz,skill:Zz,mcp:Kz,output:eD};function iD(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:s,setSelectedNode:o}=Hi(),u=zm(x=>x.openStepPanel),f=K.useCallback(x=>{i(Nw(x,e))},[e,i]),h=K.useCallback(x=>{a(Cw(x,n))},[n,a]),d=K.useCallback(x=>{tD(x,e)&&(a(sw({...x,animated:!0},n)),s({id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0}))},[e,n,a,s]),g=K.useCallback((x,b)=>{o(b.id),u()},[o,u]),m=K.useCallback(()=>{o(null)},[o]);return v.jsxs($A,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:nD,fitView:!0,fitViewOptions:{padding:.2},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(FA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(e3,{}),v.jsx(h3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"mcp":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function rD(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const aD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sD={};function S1(e,n){return(sD.jsx?lD:aD).test(e)}const oD=/[ \t\n\f\r]/g;function uD(e){return typeof e=="object"?e.type==="text"?_1(e.value):!1:_1(e)}function _1(e){return e.replace(oD,"")===""}class bo{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}bo.prototype.normal={};bo.prototype.property={};bo.prototype.space=void 0;function GS(e,n){const i={},a={};for(const s of e)Object.assign(i,s.property),Object.assign(a,s.normal);return new bo(i,a,n)}function Fp(e){return e.toLowerCase()}class ln{constructor(n,i){this.attribute=i,this.property=n}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let cD=0;const De=ra(),St=ra(),Gp=ra(),de=ra(),at=ra(),ll=ra(),bn=ra();function ra(){return 2**++cD}const Zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ll,number:de,overloadedBoolean:Gp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),sp=Object.keys(Zp);class Dm extends ln{constructor(n,i,a,s){let o=-1;if(super(n,i),k1(this,"space",s),typeof a=="number")for(;++o<sp.length;){const u=sp[o];k1(this,sp[o],(a&Zp[u])===Zp[u])}}}Dm.prototype.defined=!0;function k1(e,n,i){i&&(e[n]=i)}function xl(e){const n={},i={};for(const[a,s]of Object.entries(e.properties)){const o=new Dm(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),n[a]=o,i[Fp(a)]=a,i[Fp(o.attribute)]=a}return new bo(n,i,e.space)}const ZS=xl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:St,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:at,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:St,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function QS(e,n){return n in e?e[n]:n}function KS(e,n){return QS(e,n.toLowerCase())}const fD=xl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ll,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:at,autoFocus:De,autoPlay:De,blocking:at,capture:null,charSet:null,checked:De,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:De,controlsList:at,coords:de|ll,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Gp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:at,height:de,hidden:Gp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:at,itemRef:at,itemScope:De,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:at,required:De,reversed:De,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:St,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:KS}),dD=xl({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:bn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:ll,g2:ll,glyphName:ll,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:QS}),JS=xl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),WS=xl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:KS}),e2=xl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),hD={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"},pD=/[A-Z]/g,E1=/-[a-z]/g,mD=/^data[-\w.:]+$/i;function gD(e,n){const i=Fp(n);let a=n,s=ln;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&mD.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(E1,xD);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!E1.test(o)){let u=o.replace(pD,yD);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=Dm}return new s(a,n)}function yD(e){return"-"+e.toLowerCase()}function xD(e){return e.charAt(1).toUpperCase()}const bD=GS([ZS,fD,JS,WS,e2],"html"),jm=GS([ZS,dD,JS,WS,e2],"svg");function vD(e){return e.join(" ").trim()}var Ga={},op,N1;function wD(){if(N1)return op;N1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
107
|
-
`,d="/",g="*",m="",x="comment",b="declaration";function w(E,_){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];_=_||{};var j=1,k=1;function C(O){var B=O.match(n);B&&(j+=B.length);var D=O.lastIndexOf(h);k=~D?O.length-D:k+O.length}function L(){var O={line:j,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:j,column:k},this.source=_.source}A.prototype.content=E;function H(O){var B=new Error(_.source+":"+j+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=j,B.column=k,B.source=E,!_.silent)throw B}function F(O){var B=O.exec(E);if(B){var D=B[0];return C(D),E=E.slice(D.length),B}}function G(){F(i)}function q(O){var B;for(O=O||[];B=V();)B!==!1&&O.push(B);return O}function V(){var O=L();if(!(d!=E.charAt(0)||g!=E.charAt(1))){for(var B=2;m!=E.charAt(B)&&(g!=E.charAt(B)||d!=E.charAt(B+1));)++B;if(B+=2,m===E.charAt(B-1))return H("End of comment missing");var D=E.slice(2,B-2);return k+=2,C(D),E=E.slice(B),k+=2,O({type:x,comment:D})}}function Y(){var O=L(),B=F(a);if(B){if(V(),!F(s))return H("property missing ':'");var D=F(o),U=O({type:b,property:N(B[0].replace(e,m)),value:D?N(D[0].replace(e,m)):m});return F(u),U}}function te(){var O=[];q(O);for(var B;B=Y();)B!==!1&&(O.push(B),q(O));return O}return G(),te()}function N(E){return E?E.replace(f,m):m}return op=w,op}var C1;function SD(){if(C1)return Ga;C1=1;var e=Ga&&Ga.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=i;const n=e(wD());function i(a,s){let o=null;if(!a||typeof a!="string")return o;const u=(0,n.default)(a),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?s(d,g,h):g&&(o=o||{},o[d]=g)}),o}return Ga}var Ds={},M1;function _D(){if(M1)return Ds;M1=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,f):d=d.replace(a,f),d.replace(n,u))};return Ds.camelCase=h,Ds}var js,T1;function kD(){if(T1)return js;T1=1;var e=js&&js.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(SD()),i=_D();function a(s,o){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(f,h){f&&h&&(u[(0,i.camelCase)(f,o)]=h)}),u}return a.default=a,js=a,js}var ED=kD();const ND=Fc(ED),t2=n2("end"),Rm=n2("start");function n2(e){return n;function n(i){const a=i&&i.position&&i.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function CD(e){const n=Rm(e),i=t2(e);if(n&&i)return{start:n,end:i}}function Vs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A1(e.position):"start"in e||"end"in e?A1(e):"line"in e||"column"in e?Qp(e):""}function Qp(e){return z1(e&&e.line)+":"+z1(e&&e.column)}function A1(e){return Qp(e&&e.start)+"-"+Qp(e&&e.end)}function z1(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let s="",o={},u=!1;if(i&&("line"in i&&"column"in i?o={place:i}:"start"in i&&"end"in i?o={place:i}:"type"in i?o={ancestors:[i],place:i.position}:o={...i}),typeof n=="string"?s=n:!o.cause&&n&&(u=!0,s=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Vs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Om={}.hasOwnProperty,MD=new Map,TD=/[A-Z]/g,AD=new Set(["table","tbody","thead","tfoot","tr"]),zD=new Set(["td","th"]),i2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function DD(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=ID(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=UD(i,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?jm:bD,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=r2(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function r2(e,n,i){if(n.type==="element")return jD(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return RD(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return LD(e,n,i);if(n.type==="mdxjsEsm")return OD(e,n);if(n.type==="root")return HD(e,n,i);if(n.type==="text")return BD(e,n)}function jD(e,n,i){const a=e.schema;let s=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=jm,e.schema=s),e.ancestors.push(n);const o=l2(e,n.tagName,!1),u=qD(e,n);let f=Hm(e,n);return AD.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!uD(h):!0})),a2(e,u,o,n),Lm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function RD(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}io(e,n.position)}function OD(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);io(e,n.position)}function LD(e,n,i){const a=e.schema;let s=a;n.name==="svg"&&a.space==="html"&&(s=jm,e.schema=s),e.ancestors.push(n);const o=n.name===null?e.Fragment:l2(e,n.name,!0),u=$D(e,n),f=Hm(e,n);return a2(e,u,o,n),Lm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function HD(e,n,i){const a={};return Lm(a,Hm(e,n)),e.create(n,e.Fragment,a,i)}function BD(e,n){return n.value}function a2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Lm(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function UD(e,n,i){return a;function a(s,o,u,f){const d=Array.isArray(u.children)?i:n;return f?d(o,u,f):d(o,u)}}function ID(e,n){return i;function i(a,s,o,u){const f=Array.isArray(o.children),h=Rm(a);return n(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function qD(e,n){const i={};let a,s;for(s in n.properties)if(s!=="children"&&Om.call(n.properties,s)){const o=VD(e,s,n.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&zD.has(n.tagName)?a=f:i[u]=f}}if(a){const o=i.style||(i.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function $D(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else io(e,n.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else io(e,n.position);else o=a.value===null?!0:a.value;i[s]=o}return i}function Hm(e,n){const i=[];let a=-1;const s=e.passKeys?new Map:MD;for(;++a<n.children.length;){const o=n.children[a];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const d=s.get(h)||0;u=h+"-"+d,s.set(h,d+1)}}const f=r2(e,o,u);f!==void 0&&i.push(f)}return i}function VD(e,n,i){const a=gD(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?rD(i):vD(i)),a.property==="style"){let s=typeof i=="object"?i:YD(e,String(i));return e.stylePropertyNameCase==="css"&&(s=PD(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?hD[a.property]||a.property:a.attribute,i]}}function YD(e,n){try{return ND(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,s=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=i2+"#cannot-parse-style-attribute",s}}function l2(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let o=-1,u;for(;++o<s.length;){const f=S1(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=S1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const s=a.value;return Om.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);io(e)}function io(e,n){const i=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=i2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function PD(e){const n={};let i;for(i in e)Om.call(e,i)&&(n[XD(i)]=e[i]);return n}function XD(e){let n=e.replace(TD,FD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function FD(e){return"-"+e.toLowerCase()}const up={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"]},GD={};function Bm(e,n){const i=GD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return s2(e,a,s)}function s2(e,n,i){if(ZD(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return D1(e.children,n,i)}return Array.isArray(e)?D1(e,n,i):""}function D1(e,n,i){const a=[];let s=-1;for(;++s<e.length;)a[s]=s2(e[s],n,i);return a.join("")}function ZD(e){return!!(e&&typeof e=="object")}const j1=document.createElement("i");function Um(e){const n="&"+e+";";j1.innerHTML=n;const i=j1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function wn(e,n,i,a){const s=e.length;let o=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,i=i>0?i:0,a.length<1e4)u=Array.from(a),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);o<a.length;)u=a.slice(o,o+1e4),u.unshift(n,0),e.splice(...u),o+=1e4,n+=1e4}function jn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const R1={}.hasOwnProperty;function o2(e){const n={};let i=-1;for(;++i<e.length;)QD(n,e[i]);return n}function QD(e,n){let i;for(i in n){const s=(R1.call(e,i)?e[i]:void 0)||(e[i]={}),o=n[i];let u;if(o)for(u in o){R1.call(s,u)||(s[u]=[]);const f=o[u];KD(s[u],Array.isArray(f)?f:f?[f]:[])}}}function KD(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);wn(e,0,0,a)}function u2(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Pn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Sr(/[A-Za-z]/),It=Sr(/[\dA-Za-z]/),JD=Sr(/[#-'*+\--9=?A-Z^-~]/);function Vc(e){return e!==null&&(e<32||e===127)}const Kp=Sr(/\d/),WD=Sr(/[\dA-Fa-f]/),ej=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const gf=Sr(new RegExp("\\p{P}|\\p{S}","u")),ia=Sr(/\s/);function Sr(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function bl(e){const n=[];let i=-1,a=0,s=0;for(;++i<e.length;){const o=e.charCodeAt(i);let u="";if(o===37&&It(e.charCodeAt(i+1))&&It(e.charCodeAt(i+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(i+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(n.push(e.slice(a,i),encodeURIComponent(u)),a=i+s+1,u=""),s&&(i+=s,s=0)}return n.join("")+e.slice(a)}function Ye(e,n,i,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return He(h)?(e.enter(i),f(h)):n(h)}function f(h){return He(h)&&o++<s?(e.consume(h),f):(e.exit(i),n(h))}}const tj={tokenize:nj};function nj(e){const n=e.attempt(this.parser.constructs.contentInitial,a,s);let i;return n;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ye(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const ij={tokenize:rj},O1={tokenize:aj};function rj(e){const n=this,i=[];let a=0,s,o,u;return f;function f(k){if(a<i.length){const C=i[a];return n.containerState=C[1],e.attempt(C[0].continuation,h,d)(k)}return d(k)}function h(k){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&j();const C=n.events.length;let L=C,A;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){A=n.events[L][1].end;break}_(a);let H=C;for(;H<n.events.length;)n.events[H][1].end={...A},H++;return wn(n.events,L+1,0,n.events.slice(C)),n.events.length=H,d(k)}return f(k)}function d(k){if(a===i.length){if(!s)return x(k);if(s.currentConstruct&&s.currentConstruct.concrete)return w(k);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(O1,g,m)(k)}function g(k){return s&&j(),_(a),x(k)}function m(k){return n.parser.lazy[n.now().line]=a!==i.length,u=n.now().offset,w(k)}function x(k){return n.containerState={},e.attempt(O1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){s&&j(),_(0),e.consume(k);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),N(k)}function N(k){if(k===null){E(e.exit("chunkFlow"),!0),_(0),e.consume(k);return}return Se(k)?(e.consume(k),E(e.exit("chunkFlow")),a=0,n.interrupt=void 0,f):(e.consume(k),N)}function E(k,C){const L=n.sliceStream(k);if(C&&L.push(null),k.previous=o,o&&(o.next=k),o=k,s.defineSkip(k.start),s.write(L),n.parser.lazy[k.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<u&&(!s.events[A][1].end||s.events[A][1].end.offset>u))return;const H=n.events.length;let F=H,G,q;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(G){q=n.events[F][1].end;break}G=!0}for(_(a),A=H;A<n.events.length;)n.events[A][1].end={...q},A++;wn(n.events,F+1,0,n.events.slice(H)),n.events.length=A}}function _(k){let C=i.length;for(;C-- >k;){const L=i[C];n.containerState=L[1],L[0].exit.call(n,e)}i.length=k}function j(){s.write([null]),o=void 0,s=void 0,n.containerState._closeFlow=void 0}}function aj(e,n,i){return Ye(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ml(e){if(e===null||rt(e)||ia(e))return 1;if(gf(e))return 2}function yf(e,n,i){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(n=o(n,i),a.push(o))}return n}const Jp={name:"attention",resolveAll:lj,tokenize:sj};function lj(e,n){let i=-1,a,s,o,u,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[a][1].end},x={...e[i][1].start};L1(m,-h),L1(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[i][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=jn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=jn(d,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",o,n]]),d=jn(d,yf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=jn(d,[["exit",o,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=jn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,wn(e,a-1,i-a+3,d),i=a+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function sj(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,s=ml(a);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const d=e.exit("attentionSequence"),g=ml(h),m=!g||g===2&&s||i.includes(h),x=!s||s===2&&g||i.includes(a);return d._open=!!(o===42?m:m&&(s||!x)),d._close=!!(o===42?x:x&&(g||!m)),n(h)}}function L1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const oj={name:"autolink",tokenize:uj};function uj(e,n,i){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Ft(b)?(e.consume(b),u):b===64?i(b):d(b)}function u(b){return b===43||b===45||b===46||It(b)?(a=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||It(b))&&a++<32?(e.consume(b),f):(a=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||Vc(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):JD(b)?(e.consume(b),d):i(b)}function g(b){return It(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||It(b))&&a++<63){const w=b===45?x:m;return e.consume(b),w}return i(b)}}const vo={partial:!0,tokenize:cj};function cj(e,n,i){return a;function a(o){return He(o)?Ye(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Se(o)?n(o):i(o)}}const c2={continuation:{tokenize:dj},exit:hj,name:"blockQuote",tokenize:fj};function fj(e,n,i){const a=this;return s;function s(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return i(u)}function o(u){return He(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function dj(e,n,i){const a=this;return s;function s(u){return He(u)?Ye(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(c2,n,i)(u)}}function hj(e){e.exit("blockQuote")}const f2={name:"characterEscape",tokenize:pj};function pj(e,n,i){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return ej(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(o)}}const d2={name:"characterReference",tokenize:mj};function mj(e,n,i){const a=this;let s=0,o,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,u=It,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=WD,g):(e.enter("characterReferenceValue"),o=7,u=Kp,g(m))}function g(m){if(m===59&&s){const x=e.exit("characterReferenceValue");return u===It&&!Um(a.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(m)&&s++<o?(e.consume(m),g):i(m)}}const H1={partial:!0,tokenize:yj},B1={concrete:!0,name:"codeFenced",tokenize:gj};function gj(e,n,i){const a=this,s={partial:!0,tokenize:L};let o=0,u=0,f;return h;function h(A){return d(A)}function d(A){const H=a.events[a.events.length-1];return o=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,f=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===f?(u++,e.consume(A),g):u<3?i(A):(e.exit("codeFencedFenceSequence"),He(A)?Ye(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),a.interrupt?n(A):e.check(H1,N,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):He(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ye(e,b,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),x)}function b(A){return A===null||Se(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===f?i(A):(e.consume(A),w)}function N(A){return e.attempt(s,C,E)(A)}function E(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return o>0&&He(A)?Ye(e,j,"linePrefix",o+1)(A):j(A)}function j(A){return A===null||Se(A)?e.check(H1,N,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),j(A)):(e.consume(A),k)}function C(A){return e.exit("codeFenced"),n(A)}function L(A,H,F){let G=0;return q;function q(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),V}function V(B){return A.enter("codeFencedFence"),He(B)?Ye(A,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):Y(B)}function Y(B){return B===f?(A.enter("codeFencedFenceSequence"),te(B)):F(B)}function te(B){return B===f?(G++,A.consume(B),te):G>=u?(A.exit("codeFencedFenceSequence"),He(B)?Ye(A,O,"whitespace")(B):O(B)):F(B)}function O(B){return B===null||Se(B)?(A.exit("codeFencedFence"),H(B)):F(B)}}}function yj(e,n,i){const a=this;return s;function s(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}const cp={name:"codeIndented",tokenize:bj},xj={partial:!0,tokenize:vj};function bj(e,n,i){const a=this;return s;function s(d){return e.enter("codeIndented"),Ye(e,o,"linePrefix",5)(d)}function o(d){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(xj,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function vj(e,n,i){const a=this;return s;function s(u){return a.parser.lazy[a.now().line]?i(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):Ye(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Se(u)?s(u):i(u)}}const wj={name:"codeText",previous:_j,resolve:Sj,tokenize:kj};function Sj(e){let n=e.length-4,i=3,a,s;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)s===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(s=a):(a===n||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),n-=a-s-2,a=s+2),s=void 0);return e}function _j(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kj(e,n,i){let a=0,s,o;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),a++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(o=e.enter("codeTextSequence"),s=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",d(m))}}class Ej{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const s=i||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Rs(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Rs(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Rs(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Rs(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Rs(this.left,i.reverse())}}}function Rs(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function h2(e){const n={};let i=-1,a,s,o,u,f,h,d;const g=new Ej(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(a=g.get(i),i&&a[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(n,Nj(g,i)),i=n[i],d=!0);else if(a[1]._container){for(o=i,s=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},f=g.slice(s,i),f.unshift(a),g.splice(s,i-s+1,f))}}return wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function Nj(e,n){const i=e.get(n)[1],a=e.get(n)[2];let s=n-1;const o=[];let u=i._tokenizer;u||(u=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,b=i,w=0,N=0;const E=[N];for(;b;){for(;e.get(++s)[1]!==b;);o.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(N=x+1,E.push(N),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),x=E.length;x--;){const _=f.slice(E[x],E[x+1]),j=o.pop();h.push([j,j+_.length-1]),e.splice(j,2,_)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const Cj={resolve:Tj,tokenize:Aj},Mj={partial:!0,tokenize:zj};function Tj(e){return h2(e),e}function Aj(e,n){let i;return a;function a(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Se(f)?e.check(Mj,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function zj(e,n,i){const a=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ye(e,o,"linePrefix")}function o(u){if(u===null||Se(u))return i(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(a.parser.constructs.flow,i,n)(u)}}function p2(e,n,i,a,s,o,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||Vc(_)?i(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),N(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(s),e.exit(a),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?i(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function N(_){return!g&&(_===null||_===41||rt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),n(_)):g<d&&_===40?(e.consume(_),g++,N):_===41?(e.consume(_),g--,N):_===null||_===32||_===40||Vc(_)?i(_):(e.consume(_),_===92?E:N)}function E(_){return _===40||_===41||_===92?(e.consume(_),N):N(_)}}function m2(e,n,i,a,s,o){const u=this;let f=0,h;return d;function d(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(o),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(o),e.enter(s),e.consume(b),e.exit(s),e.exit(a),n):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!He(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function g2(e,n,i,a,s,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),u=x===40?41:x,h):i(x)}function h(x){return x===u?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),n):(e.enter(o),d(x))}function d(x){return x===u?(e.exit(o),h(u)):x===null?i(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ye(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function Ys(e,n){let i;return a;function a(s){return Se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i=!0,a):He(s)?Ye(e,a,i?"linePrefix":"lineSuffix")(s):n(s)}}const Dj={name:"definition",tokenize:Rj},jj={partial:!0,tokenize:Oj};function Rj(e,n,i){const a=this;let s;return o;function o(b){return e.enter("definition"),u(b)}function u(b){return m2.call(a,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Pn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return rt(b)?Ys(e,d)(b):d(b)}function d(b){return p2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(jj,m,m)(b)}function m(b){return He(b)?Ye(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),a.parser.defined.push(s),n(b)):i(b)}}function Oj(e,n,i){return a;function a(f){return rt(f)?Ys(e,s)(f):i(f)}function s(f){return g2(e,o,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return He(f)?Ye(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const Lj={name:"hardBreakEscape",tokenize:Hj};function Hj(e,n,i){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Se(o)?(e.exit("hardBreakEscape"),n(o)):i(o)}}const Bj={name:"headingAtx",resolve:Uj,tokenize:Ij};function Uj(e,n){let i=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},o={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wn(e,a,i-a+1,[["enter",s,n],["enter",o,n],["exit",o,n],["exit",s,n]])),e}function Ij(e,n,i){let a=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||rt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),n(g)):He(g)?Ye(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||rt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const qj=["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"],U1=["pre","script","style","textarea"],$j={concrete:!0,name:"htmlFlow",resolveTo:Pj,tokenize:Xj},Vj={partial:!0,tokenize:Gj},Yj={partial:!0,tokenize:Fj};function Pj(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Xj(e,n,i){const a=this;let s,o,u,f,h;return d;function d(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),o=!0,N):T===63?(e.consume(T),s=3,a.interrupt?n:z):Ft(T)?(e.consume(T),u=String.fromCharCode(T),E):i(T)}function x(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,f=0,w):Ft(T)?(e.consume(T),s=4,a.interrupt?n:z):i(T)}function b(T){return T===45?(e.consume(T),a.interrupt?n:z):i(T)}function w(T){const ie="CDATA[";return T===ie.charCodeAt(f++)?(e.consume(T),f===ie.length?a.interrupt?n:Y:w):i(T)}function N(T){return Ft(T)?(e.consume(T),u=String.fromCharCode(T),E):i(T)}function E(T){if(T===null||T===47||T===62||rt(T)){const ie=T===47,ce=u.toLowerCase();return!ie&&!o&&U1.includes(ce)?(s=1,a.interrupt?n(T):Y(T)):qj.includes(u.toLowerCase())?(s=6,ie?(e.consume(T),_):a.interrupt?n(T):Y(T)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(T):o?j(T):k(T))}return T===45||It(T)?(e.consume(T),u+=String.fromCharCode(T),E):i(T)}function _(T){return T===62?(e.consume(T),a.interrupt?n:Y):i(T)}function j(T){return He(T)?(e.consume(T),j):q(T)}function k(T){return T===47?(e.consume(T),q):T===58||T===95||Ft(T)?(e.consume(T),C):He(T)?(e.consume(T),k):q(T)}function C(T){return T===45||T===46||T===58||T===95||It(T)?(e.consume(T),C):L(T)}function L(T){return T===61?(e.consume(T),A):He(T)?(e.consume(T),L):k(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),h=T,H):He(T)?(e.consume(T),A):F(T)}function H(T){return T===h?(e.consume(T),h=null,G):T===null||Se(T)?i(T):(e.consume(T),H)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?L(T):(e.consume(T),F)}function G(T){return T===47||T===62||He(T)?k(T):i(T)}function q(T){return T===62?(e.consume(T),V):i(T)}function V(T){return T===null||Se(T)?Y(T):He(T)?(e.consume(T),V):i(T)}function Y(T){return T===45&&s===2?(e.consume(T),D):T===60&&s===1?(e.consume(T),U):T===62&&s===4?(e.consume(T),R):T===63&&s===3?(e.consume(T),z):T===93&&s===5?(e.consume(T),Q):Se(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Vj,$,te)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),Y)}function te(T){return e.check(Yj,O,$)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return T===null||Se(T)?te(T):(e.enter("htmlFlowData"),Y(T))}function D(T){return T===45?(e.consume(T),z):Y(T)}function U(T){return T===47?(e.consume(T),u="",P):Y(T)}function P(T){if(T===62){const ie=u.toLowerCase();return U1.includes(ie)?(e.consume(T),R):Y(T)}return Ft(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),P):Y(T)}function Q(T){return T===93?(e.consume(T),z):Y(T)}function z(T){return T===62?(e.consume(T),R):T===45&&s===2?(e.consume(T),z):Y(T)}function R(T){return T===null||Se(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),R)}function $(T){return e.exit("htmlFlow"),n(T)}}function Fj(e,n,i){const a=this;return s;function s(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):i(u)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}function Gj(e,n,i){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(vo,n,i)}}const Zj={name:"htmlText",tokenize:Qj};function Qj(e,n,i){const a=this;let s,o,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),L):z===63?(e.consume(z),k):Ft(z)?(e.consume(z),F):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),o=0,w):Ft(z)?(e.consume(z),j):i(z)}function g(z){return z===45?(e.consume(z),b):i(z)}function m(z){return z===null?i(z):z===45?(e.consume(z),x):Se(z)?(u=m,U(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),b):m(z)}function b(z){return z===62?D(z):z===45?x(z):m(z)}function w(z){const R="CDATA[";return z===R.charCodeAt(o++)?(e.consume(z),o===R.length?N:w):i(z)}function N(z){return z===null?i(z):z===93?(e.consume(z),E):Se(z)?(u=N,U(z)):(e.consume(z),N)}function E(z){return z===93?(e.consume(z),_):N(z)}function _(z){return z===62?D(z):z===93?(e.consume(z),_):N(z)}function j(z){return z===null||z===62?D(z):Se(z)?(u=j,U(z)):(e.consume(z),j)}function k(z){return z===null?i(z):z===63?(e.consume(z),C):Se(z)?(u=k,U(z)):(e.consume(z),k)}function C(z){return z===62?D(z):k(z)}function L(z){return Ft(z)?(e.consume(z),A):i(z)}function A(z){return z===45||It(z)?(e.consume(z),A):H(z)}function H(z){return Se(z)?(u=H,U(z)):He(z)?(e.consume(z),H):D(z)}function F(z){return z===45||It(z)?(e.consume(z),F):z===47||z===62||rt(z)?G(z):i(z)}function G(z){return z===47?(e.consume(z),D):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):He(z)?(e.consume(z),G):D(z)}function q(z){return z===45||z===46||z===58||z===95||It(z)?(e.consume(z),q):V(z)}function V(z){return z===61?(e.consume(z),Y):Se(z)?(u=V,U(z)):He(z)?(e.consume(z),V):G(z)}function Y(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),s=z,te):Se(z)?(u=Y,U(z)):He(z)?(e.consume(z),Y):(e.consume(z),O)}function te(z){return z===s?(e.consume(z),s=void 0,B):z===null?i(z):Se(z)?(u=te,U(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||rt(z)?G(z):(e.consume(z),O)}function B(z){return z===47||z===62||rt(z)?G(z):i(z)}function D(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function U(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),P}function P(z){return He(z)?Ye(e,Q,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Q(z)}function Q(z){return e.enter("htmlTextData"),u(z)}}const Im={name:"labelEnd",resolveAll:eR,resolveTo:tR,tokenize:nR},Kj={tokenize:iR},Jj={tokenize:rR},Wj={tokenize:aR};function eR(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",n+=s}}return e.length!==i.length&&wn(e,0,e.length,i),e}function tR(e,n){let i=e.length,a=0,s,o,u,f;for(;i--;)if(s=e[i][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=i,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(u=i);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=jn(f,e.slice(o+1,o+a+3)),f=jn(f,[["enter",g,n]]),f=jn(f,yf(n.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),n)),f=jn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=jn(f,e.slice(u+1)),f=jn(f,[["exit",h,n]]),wn(e,o,e.length,f),e}function nR(e,n,i){const a=this;let s=a.events.length,o,u;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return f;function f(x){return o?o._inactive?m(x):(u=a.parser.defined.includes(Pn(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(Kj,g,u?g:m)(x):x===91?e.attempt(Jj,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(Wj,g,m)(x)}function g(x){return n(x)}function m(x){return o._balanced=!0,i(x)}}function iR(e,n,i){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return rt(m)?Ys(e,o)(m):o(m)}function o(m){return m===41?g(m):p2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Ys(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?g2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Ys(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function rR(e,n,i){const a=this;return s;function s(f){return m2.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Pn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function aR(e,n,i){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):i(o)}}const lR={name:"labelStartImage",resolveAll:Im.resolveAll,tokenize:sR};function sR(e,n,i){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(f):n(f)}}const oR={name:"labelStartLink",resolveAll:Im.resolveAll,tokenize:uR};function uR(e,n,i){const a=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(u):n(u)}}const fp={name:"lineEnding",tokenize:cR};function cR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ye(e,n,"linePrefix")}}const Mc={name:"thematicBreak",tokenize:fR};function fR(e,n,i){let a=0,s;return o;function o(d){return e.enter("thematicBreak"),u(d)}function u(d){return s=d,f(d)}function f(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Se(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===s?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),He(d)?Ye(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:mR},exit:yR,name:"list",tokenize:pR},dR={partial:!0,tokenize:xR},hR={partial:!0,tokenize:gR};function pR(e,n,i){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(b){const w=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Kp(b)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Mc,i,d)(b):d(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return Kp(b)&&++u<10?(e.consume(b),h):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):i(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(vo,a.interrupt?i:g,e.attempt(dR,x,m))}function g(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function m(b){return He(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):i(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function mR(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(vo,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Ye(e,n,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!He(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(hR,n,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Ye(e,e.attempt(rn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function gR(e,n,i){const a=this;return Ye(e,s,"listItemIndent",a.containerState.size+1);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?n(o):i(o)}}function yR(e){e.exit(this.containerState.type)}function xR(e,n,i){const a=this;return Ye(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=a.events[a.events.length-1];return!He(o)&&u&&u[1].type==="listItemPrefixWhitespace"?n(o):i(o)}}const I1={name:"setextUnderline",resolveTo:bR,tokenize:vR};function bR(e,n){let i=e.length,a,s,o;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(s=i)}else e[i][1].type==="content"&&e.splice(i,1),!o&&e[i][1].type==="definition"&&(o=i);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,n]),e.splice(o+1,0,["exit",e[a][1],n]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,n]),e}function vR(e,n,i){const a=this;let s;return o;function o(d){let g=a.events.length,m;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){m=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),s=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===s?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),He(d)?Ye(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const wR={tokenize:SR};function SR(e){const n=this,i=e.attempt(vo,a,e.attempt(this.parser.constructs.flowInitial,s,Ye(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Cj,s)),"linePrefix")));return i;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const _R={resolveAll:x2()},kR=y2("string"),ER=y2("text");function y2(e){return{resolveAll:x2(e==="text"?NR:void 0),tokenize:n};function n(i){const a=this,s=this.parser.constructs[e],o=i.attempt(s,u,f);return u;function u(g){return d(g)?o(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),h}function h(g){return d(g)?(i.exit("data"),o(g)):(i.consume(g),h)}function d(g){if(g===null)return!0;const m=s[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function x2(e){return n;function n(i,a){let s=-1,o;for(;++s<=i.length;)o===void 0?i[s]&&i[s][1].type==="data"&&(o=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==o+2&&(i[o][1].end=i[s-1][1].end,i.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(i,a):i}}function NR(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],s=n.sliceStream(a);let o=s.length,u=-1,f=0,h;for(;o--;){const d=s[o];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){o++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const CR={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:c2},MR={91:Dj},TR={[-2]:cp,[-1]:cp,32:cp},AR={35:Bj,42:Mc,45:[I1,Mc],60:$j,61:I1,95:Mc,96:B1,126:B1},zR={38:d2,92:f2},DR={[-5]:fp,[-4]:fp,[-3]:fp,33:lR,38:d2,42:Jp,60:[oj,Zj],91:oR,92:[Lj,f2],93:Im,95:Jp,96:wj},jR={null:[Jp,_R]},RR={null:[42,95]},OR={null:[]},LR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RR,contentInitial:MR,disable:OR,document:CR,flow:AR,flowInitial:TR,insideSpan:jR,string:zR,text:DR},Symbol.toStringTag,{value:"Module"}));function HR(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:H(L),check:H(A),consume:j,enter:k,exit:C,interrupt:H(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:N,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&o.push(n),d;function m(V){return u=jn(u,V),E(),u[u.length-1]!==null?[]:(F(n,0),d.events=yf(o,d.events,d),d.events)}function x(V,Y){return UR(b(V),Y)}function b(V){return BR(u,V)}function w(){const{_bufferIndex:V,_index:Y,line:te,column:O,offset:B}=a;return{_bufferIndex:V,_index:Y,line:te,column:O,offset:B}}function N(V){s[V.line]=V.column,q()}function E(){let V;for(;a._index<u.length;){const Y=u[a._index];if(typeof Y=="string")for(V=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===V&&a._bufferIndex<Y.length;)_(Y.charCodeAt(a._bufferIndex));else _(Y)}}function _(V){g=g(V)}function j(V){Se(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,q()):V!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=V}function k(V,Y){const te=Y||{};return te.type=V,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(V){const Y=f.pop();return Y.end=w(),d.events.push(["exit",Y,d]),Y}function L(V,Y){F(V,Y.from)}function A(V,Y){Y.restore()}function H(V,Y){return te;function te(O,B,D){let U,P,Q,z;return Array.isArray(O)?$(O):"tokenize"in O?$([O]):R(O);function R(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return $(Ce)(ue)}}function $(fe){return U=fe,P=0,fe.length===0?D:T(fe[P])}function T(fe){return he;function he(ue){return z=G(),Q=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(Y?Object.assign(Object.create(d),Y):d,h,ie,ce)(ue)}}function ie(fe){return V(Q,z),B}function ce(fe){return z.restore(),++P<U.length?T(U[P]):D}}}function F(V,Y){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&wn(d.events,Y,d.events.length-Y,V.resolve(d.events.slice(Y),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function G(){const V=w(),Y=d.previous,te=d.currentConstruct,O=d.events.length,B=Array.from(f);return{from:O,restore:D};function D(){a=V,d.previous=Y,d.currentConstruct=te,d.events.length=O,f=B,q()}}function q(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function BR(e,n){const i=n.start._index,a=n.start._bufferIndex,s=n.end._index,o=n.end._bufferIndex;let u;if(i===s)u=[e[i].slice(a,o)];else{if(u=e.slice(i,s),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function UR(e,n){let i=-1;const a=[];let s;for(;++i<e.length;){const o=e[i];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
112
|
+
`,children:[v.jsx("span",{className:i.color,children:i.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function Qz({status:e}){switch(e){case"running":return v.jsx(oS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(U3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Up,{className:"w-4 h-4 text-red-400"});default:return v.jsx(_m,{className:"w-4 h-4"})}}function Kz({data:e,selected:n,children:i,headerIcon:a,headerColor:s="bg-gray-700",showSourceHandle:o=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return v.jsxs("div",{className:Xt("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Xt("node-header flex items-center justify-between",s),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[a,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Qz,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>v.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&v.jsx(pl,{type:"target",position:be.Left}),o&&v.jsx(pl,{type:"source",position:be.Right})]})}const xo=Q.memo(Kz);function Jz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(of,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>v.jsx("option",{value:i,children:i},i))})]})})}const Wz=Q.memo(Jz);function ej({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ho,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&v.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const tj=Q.memo(ej);function nj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ff,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const ij=Q.memo(nj);function rj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(km,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.serverName&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.serverName}),v.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",e.serverType]})]})})}const aj=Q.memo(rj);function lj(e){switch(e){case"markdown":case"document":return v.jsx(rl,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(sS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(G3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(t5,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(sf,{className:"w-4 h-4 text-emerald-100"})}}function sj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:lj(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const oj=Q.memo(sj),jm=df(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1})}));function uj(e,n){const{source:i,target:a}=e;if(i===a)return!1;const s=n.find(u=>u.id===i),o=n.find(u=>u.id===a);return!s||!o?!1:s.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):o.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const cj={input:Wz,subagent:tj,skill:ij,mcp:aj,output:oj};function fj(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:s,setSelectedNode:o}=Hi(),u=jm(x=>x.openStepPanel),f=Q.useCallback(x=>{i(Cw(x,e))},[e,i]),h=Q.useCallback(x=>{a(Mw(x,n))},[n,a]),d=Q.useCallback(x=>{uj(x,e)&&(a(ow({...x,animated:!0},n)),s({id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0}))},[e,n,a,s]),g=Q.useCallback((x,b)=>{o(b.id),u()},[o,u]),m=Q.useCallback(()=>{o(null)},[o]);return v.jsxs(YA,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:cj,fitView:!0,fitViewOptions:{padding:.2},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(QA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(i3,{}),v.jsx(g3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"mcp":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function dj(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const hj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mj={};function _1(e,n){return(mj.jsx?pj:hj).test(e)}const gj=/[ \t\n\f\r]/g;function yj(e){return typeof e=="object"?e.type==="text"?k1(e.value):!1:k1(e)}function k1(e){return e.replace(gj,"")===""}class bo{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}bo.prototype.normal={};bo.prototype.property={};bo.prototype.space=void 0;function KS(e,n){const i={},a={};for(const s of e)Object.assign(i,s.property),Object.assign(a,s.normal);return new bo(i,a,n)}function Gp(e){return e.toLowerCase()}class ln{constructor(n,i){this.attribute=i,this.property=n}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let xj=0;const je=ra(),St=ra(),Zp=ra(),de=ra(),at=ra(),ll=ra(),bn=ra();function ra(){return 2**++xj}const Qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ll,number:de,overloadedBoolean:Zp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),op=Object.keys(Qp);class Dm extends ln{constructor(n,i,a,s){let o=-1;if(super(n,i),E1(this,"space",s),typeof a=="number")for(;++o<op.length;){const u=op[o];E1(this,op[o],(a&Qp[u])===Qp[u])}}}Dm.prototype.defined=!0;function E1(e,n,i){i&&(e[n]=i)}function xl(e){const n={},i={};for(const[a,s]of Object.entries(e.properties)){const o=new Dm(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),n[a]=o,i[Gp(a)]=a,i[Gp(o.attribute)]=a}return new bo(n,i,e.space)}const JS=xl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:St,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:at,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:St,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function WS(e,n){return n in e?e[n]:n}function e2(e,n){return WS(e,n.toLowerCase())}const bj=xl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ll,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:at,autoFocus:je,autoPlay:je,blocking:at,capture:null,charSet:null,checked:je,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:je,controlsList:at,coords:de|ll,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Zp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:at,height:de,hidden:Zp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:at,itemRef:at,itemScope:je,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:at,required:je,reversed:je,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:St,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:e2}),vj=xl({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:bn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:ll,g2:ll,glyphName:ll,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:WS}),t2=xl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),n2=xl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e2}),i2=xl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),wj={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"},Sj=/[A-Z]/g,N1=/-[a-z]/g,_j=/^data[-\w.:]+$/i;function kj(e,n){const i=Gp(n);let a=n,s=ln;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&_j.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(N1,Nj);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!N1.test(o)){let u=o.replace(Sj,Ej);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=Dm}return new s(a,n)}function Ej(e){return"-"+e.toLowerCase()}function Nj(e){return e.charAt(1).toUpperCase()}const Cj=KS([JS,bj,t2,n2,i2],"html"),Rm=KS([JS,vj,t2,n2,i2],"svg");function Mj(e){return e.join(" ").trim()}var Ga={},up,C1;function Tj(){if(C1)return up;C1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
113
|
+
`,d="/",g="*",m="",x="comment",b="declaration";function w(N,_){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];_=_||{};var D=1,k=1;function C(O){var B=O.match(n);B&&(D+=B.length);var j=O.lastIndexOf(h);k=~j?O.length-j:k+O.length}function L(){var O={line:D,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:D,column:k},this.source=_.source}A.prototype.content=N;function H(O){var B=new Error(_.source+":"+D+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=D,B.column=k,B.source=N,!_.silent)throw B}function F(O){var B=O.exec(N);if(B){var j=B[0];return C(j),N=N.slice(j.length),B}}function G(){F(i)}function q(O){var B;for(O=O||[];B=V();)B!==!1&&O.push(B);return O}function V(){var O=L();if(!(d!=N.charAt(0)||g!=N.charAt(1))){for(var B=2;m!=N.charAt(B)&&(g!=N.charAt(B)||d!=N.charAt(B+1));)++B;if(B+=2,m===N.charAt(B-1))return H("End of comment missing");var j=N.slice(2,B-2);return k+=2,C(j),N=N.slice(B),k+=2,O({type:x,comment:j})}}function P(){var O=L(),B=F(a);if(B){if(V(),!F(s))return H("property missing ':'");var j=F(o),U=O({type:b,property:E(B[0].replace(e,m)),value:j?E(j[0].replace(e,m)):m});return F(u),U}}function te(){var O=[];q(O);for(var B;B=P();)B!==!1&&(O.push(B),q(O));return O}return G(),te()}function E(N){return N?N.replace(f,m):m}return up=w,up}var M1;function Aj(){if(M1)return Ga;M1=1;var e=Ga&&Ga.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=i;const n=e(Tj());function i(a,s){let o=null;if(!a||typeof a!="string")return o;const u=(0,n.default)(a),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?s(d,g,h):g&&(o=o||{},o[d]=g)}),o}return Ga}var js={},T1;function zj(){if(T1)return js;T1=1,Object.defineProperty(js,"__esModule",{value:!0}),js.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,f):d=d.replace(a,f),d.replace(n,u))};return js.camelCase=h,js}var Ds,A1;function jj(){if(A1)return Ds;A1=1;var e=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(Aj()),i=zj();function a(s,o){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(f,h){f&&h&&(u[(0,i.camelCase)(f,o)]=h)}),u}return a.default=a,Ds=a,Ds}var Dj=jj();const Rj=Fc(Dj),r2=a2("end"),Om=a2("start");function a2(e){return n;function n(i){const a=i&&i.position&&i.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Oj(e){const n=Om(e),i=r2(e);if(n&&i)return{start:n,end:i}}function Vs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z1(e.position):"start"in e||"end"in e?z1(e):"line"in e||"column"in e?Kp(e):""}function Kp(e){return j1(e&&e.line)+":"+j1(e&&e.column)}function z1(e){return Kp(e&&e.start)+"-"+Kp(e&&e.end)}function j1(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let s="",o={},u=!1;if(i&&("line"in i&&"column"in i?o={place:i}:"start"in i&&"end"in i?o={place:i}:"type"in i?o={ancestors:[i],place:i.position}:o={...i}),typeof n=="string"?s=n:!o.cause&&n&&(u=!0,s=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Vs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Lm={}.hasOwnProperty,Lj=new Map,Hj=/[A-Z]/g,Bj=new Set(["table","tbody","thead","tfoot","tr"]),Uj=new Set(["td","th"]),l2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ij(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Gj(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=Fj(i,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Rm:Cj,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=s2(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function s2(e,n,i){if(n.type==="element")return qj(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return $j(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Pj(e,n,i);if(n.type==="mdxjsEsm")return Vj(e,n);if(n.type==="root")return Yj(e,n,i);if(n.type==="text")return Xj(e,n)}function qj(e,n,i){const a=e.schema;let s=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Rm,e.schema=s),e.ancestors.push(n);const o=u2(e,n.tagName,!1),u=Zj(e,n);let f=Bm(e,n);return Bj.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!yj(h):!0})),o2(e,u,o,n),Hm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function $j(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}io(e,n.position)}function Vj(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);io(e,n.position)}function Pj(e,n,i){const a=e.schema;let s=a;n.name==="svg"&&a.space==="html"&&(s=Rm,e.schema=s),e.ancestors.push(n);const o=n.name===null?e.Fragment:u2(e,n.name,!0),u=Qj(e,n),f=Bm(e,n);return o2(e,u,o,n),Hm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function Yj(e,n,i){const a={};return Hm(a,Bm(e,n)),e.create(n,e.Fragment,a,i)}function Xj(e,n){return n.value}function o2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Hm(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function Fj(e,n,i){return a;function a(s,o,u,f){const d=Array.isArray(u.children)?i:n;return f?d(o,u,f):d(o,u)}}function Gj(e,n){return i;function i(a,s,o,u){const f=Array.isArray(o.children),h=Om(a);return n(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Zj(e,n){const i={};let a,s;for(s in n.properties)if(s!=="children"&&Lm.call(n.properties,s)){const o=Kj(e,s,n.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&Uj.has(n.tagName)?a=f:i[u]=f}}if(a){const o=i.style||(i.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function Qj(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else io(e,n.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else io(e,n.position);else o=a.value===null?!0:a.value;i[s]=o}return i}function Bm(e,n){const i=[];let a=-1;const s=e.passKeys?new Map:Lj;for(;++a<n.children.length;){const o=n.children[a];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const d=s.get(h)||0;u=h+"-"+d,s.set(h,d+1)}}const f=s2(e,o,u);f!==void 0&&i.push(f)}return i}function Kj(e,n,i){const a=kj(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?dj(i):Mj(i)),a.property==="style"){let s=typeof i=="object"?i:Jj(e,String(i));return e.stylePropertyNameCase==="css"&&(s=Wj(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?wj[a.property]||a.property:a.attribute,i]}}function Jj(e,n){try{return Rj(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,s=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=l2+"#cannot-parse-style-attribute",s}}function u2(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let o=-1,u;for(;++o<s.length;){const f=_1(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=_1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const s=a.value;return Lm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);io(e)}function io(e,n){const i=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=l2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function Wj(e){const n={};let i;for(i in e)Lm.call(e,i)&&(n[eD(i)]=e[i]);return n}function eD(e){let n=e.replace(Hj,tD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function tD(e){return"-"+e.toLowerCase()}const cp={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"]},nD={};function Um(e,n){const i=nD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return c2(e,a,s)}function c2(e,n,i){if(iD(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return D1(e.children,n,i)}return Array.isArray(e)?D1(e,n,i):""}function D1(e,n,i){const a=[];let s=-1;for(;++s<e.length;)a[s]=c2(e[s],n,i);return a.join("")}function iD(e){return!!(e&&typeof e=="object")}const R1=document.createElement("i");function Im(e){const n="&"+e+";";R1.innerHTML=n;const i=R1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function wn(e,n,i,a){const s=e.length;let o=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,i=i>0?i:0,a.length<1e4)u=Array.from(a),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);o<a.length;)u=a.slice(o,o+1e4),u.unshift(n,0),e.splice(...u),o+=1e4,n+=1e4}function Dn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const O1={}.hasOwnProperty;function f2(e){const n={};let i=-1;for(;++i<e.length;)rD(n,e[i]);return n}function rD(e,n){let i;for(i in n){const s=(O1.call(e,i)?e[i]:void 0)||(e[i]={}),o=n[i];let u;if(o)for(u in o){O1.call(s,u)||(s[u]=[]);const f=o[u];aD(s[u],Array.isArray(f)?f:f?[f]:[])}}}function aD(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);wn(e,0,0,a)}function d2(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Sr(/[A-Za-z]/),It=Sr(/[\dA-Za-z]/),lD=Sr(/[#-'*+\--9=?A-Z^-~]/);function Vc(e){return e!==null&&(e<32||e===127)}const Jp=Sr(/\d/),sD=Sr(/[\dA-Fa-f]/),oD=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const yf=Sr(new RegExp("\\p{P}|\\p{S}","u")),ia=Sr(/\s/);function Sr(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function bl(e){const n=[];let i=-1,a=0,s=0;for(;++i<e.length;){const o=e.charCodeAt(i);let u="";if(o===37&&It(e.charCodeAt(i+1))&&It(e.charCodeAt(i+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(i+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(n.push(e.slice(a,i),encodeURIComponent(u)),a=i+s+1,u=""),s&&(i+=s,s=0)}return n.join("")+e.slice(a)}function Pe(e,n,i,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return Be(h)?(e.enter(i),f(h)):n(h)}function f(h){return Be(h)&&o++<s?(e.consume(h),f):(e.exit(i),n(h))}}const uD={tokenize:cD};function cD(e){const n=e.attempt(this.parser.constructs.contentInitial,a,s);let i;return n;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Pe(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const fD={tokenize:dD},L1={tokenize:hD};function dD(e){const n=this,i=[];let a=0,s,o,u;return f;function f(k){if(a<i.length){const C=i[a];return n.containerState=C[1],e.attempt(C[0].continuation,h,d)(k)}return d(k)}function h(k){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&D();const C=n.events.length;let L=C,A;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){A=n.events[L][1].end;break}_(a);let H=C;for(;H<n.events.length;)n.events[H][1].end={...A},H++;return wn(n.events,L+1,0,n.events.slice(C)),n.events.length=H,d(k)}return f(k)}function d(k){if(a===i.length){if(!s)return x(k);if(s.currentConstruct&&s.currentConstruct.concrete)return w(k);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(L1,g,m)(k)}function g(k){return s&&D(),_(a),x(k)}function m(k){return n.parser.lazy[n.now().line]=a!==i.length,u=n.now().offset,w(k)}function x(k){return n.containerState={},e.attempt(L1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){s&&D(),_(0),e.consume(k);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),E(k)}function E(k){if(k===null){N(e.exit("chunkFlow"),!0),_(0),e.consume(k);return}return Se(k)?(e.consume(k),N(e.exit("chunkFlow")),a=0,n.interrupt=void 0,f):(e.consume(k),E)}function N(k,C){const L=n.sliceStream(k);if(C&&L.push(null),k.previous=o,o&&(o.next=k),o=k,s.defineSkip(k.start),s.write(L),n.parser.lazy[k.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<u&&(!s.events[A][1].end||s.events[A][1].end.offset>u))return;const H=n.events.length;let F=H,G,q;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(G){q=n.events[F][1].end;break}G=!0}for(_(a),A=H;A<n.events.length;)n.events[A][1].end={...q},A++;wn(n.events,F+1,0,n.events.slice(H)),n.events.length=A}}function _(k){let C=i.length;for(;C-- >k;){const L=i[C];n.containerState=L[1],L[0].exit.call(n,e)}i.length=k}function D(){s.write([null]),o=void 0,s=void 0,n.containerState._closeFlow=void 0}}function hD(e,n,i){return Pe(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ml(e){if(e===null||rt(e)||ia(e))return 1;if(yf(e))return 2}function xf(e,n,i){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(n=o(n,i),a.push(o))}return n}const Wp={name:"attention",resolveAll:pD,tokenize:mD};function pD(e,n){let i=-1,a,s,o,u,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[a][1].end},x={...e[i][1].start};H1(m,-h),H1(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[i][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Dn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=Dn(d,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",o,n]]),d=Dn(d,xf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=Dn(d,[["exit",o,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=Dn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,wn(e,a-1,i-a+3,d),i=a+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function mD(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,s=ml(a);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const d=e.exit("attentionSequence"),g=ml(h),m=!g||g===2&&s||i.includes(h),x=!s||s===2&&g||i.includes(a);return d._open=!!(o===42?m:m&&(s||!x)),d._close=!!(o===42?x:x&&(g||!m)),n(h)}}function H1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const gD={name:"autolink",tokenize:yD};function yD(e,n,i){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Ft(b)?(e.consume(b),u):b===64?i(b):d(b)}function u(b){return b===43||b===45||b===46||It(b)?(a=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||It(b))&&a++<32?(e.consume(b),f):(a=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||Vc(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):lD(b)?(e.consume(b),d):i(b)}function g(b){return It(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||It(b))&&a++<63){const w=b===45?x:m;return e.consume(b),w}return i(b)}}const vo={partial:!0,tokenize:xD};function xD(e,n,i){return a;function a(o){return Be(o)?Pe(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Se(o)?n(o):i(o)}}const h2={continuation:{tokenize:vD},exit:wD,name:"blockQuote",tokenize:bD};function bD(e,n,i){const a=this;return s;function s(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return i(u)}function o(u){return Be(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function vD(e,n,i){const a=this;return s;function s(u){return Be(u)?Pe(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(h2,n,i)(u)}}function wD(e){e.exit("blockQuote")}const p2={name:"characterEscape",tokenize:SD};function SD(e,n,i){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return oD(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(o)}}const m2={name:"characterReference",tokenize:_D};function _D(e,n,i){const a=this;let s=0,o,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,u=It,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=sD,g):(e.enter("characterReferenceValue"),o=7,u=Jp,g(m))}function g(m){if(m===59&&s){const x=e.exit("characterReferenceValue");return u===It&&!Im(a.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(m)&&s++<o?(e.consume(m),g):i(m)}}const B1={partial:!0,tokenize:ED},U1={concrete:!0,name:"codeFenced",tokenize:kD};function kD(e,n,i){const a=this,s={partial:!0,tokenize:L};let o=0,u=0,f;return h;function h(A){return d(A)}function d(A){const H=a.events[a.events.length-1];return o=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,f=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===f?(u++,e.consume(A),g):u<3?i(A):(e.exit("codeFencedFenceSequence"),Be(A)?Pe(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),a.interrupt?n(A):e.check(B1,E,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):Be(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pe(e,b,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),x)}function b(A){return A===null||Se(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===f?i(A):(e.consume(A),w)}function E(A){return e.attempt(s,C,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return o>0&&Be(A)?Pe(e,D,"linePrefix",o+1)(A):D(A)}function D(A){return A===null||Se(A)?e.check(B1,E,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),D(A)):(e.consume(A),k)}function C(A){return e.exit("codeFenced"),n(A)}function L(A,H,F){let G=0;return q;function q(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),V}function V(B){return A.enter("codeFencedFence"),Be(B)?Pe(A,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return B===f?(A.enter("codeFencedFenceSequence"),te(B)):F(B)}function te(B){return B===f?(G++,A.consume(B),te):G>=u?(A.exit("codeFencedFenceSequence"),Be(B)?Pe(A,O,"whitespace")(B):O(B)):F(B)}function O(B){return B===null||Se(B)?(A.exit("codeFencedFence"),H(B)):F(B)}}}function ED(e,n,i){const a=this;return s;function s(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}const fp={name:"codeIndented",tokenize:CD},ND={partial:!0,tokenize:MD};function CD(e,n,i){const a=this;return s;function s(d){return e.enter("codeIndented"),Pe(e,o,"linePrefix",5)(d)}function o(d){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(ND,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function MD(e,n,i){const a=this;return s;function s(u){return a.parser.lazy[a.now().line]?i(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):Pe(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Se(u)?s(u):i(u)}}const TD={name:"codeText",previous:zD,resolve:AD,tokenize:jD};function AD(e){let n=e.length-4,i=3,a,s;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)s===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(s=a):(a===n||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),n-=a-s-2,a=s+2),s=void 0);return e}function zD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jD(e,n,i){let a=0,s,o;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),a++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(o=e.enter("codeTextSequence"),s=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",d(m))}}class DD{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const s=i||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Rs(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Rs(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Rs(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Rs(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Rs(this.left,i.reverse())}}}function Rs(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function g2(e){const n={};let i=-1,a,s,o,u,f,h,d;const g=new DD(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(a=g.get(i),i&&a[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(n,RD(g,i)),i=n[i],d=!0);else if(a[1]._container){for(o=i,s=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},f=g.slice(s,i),f.unshift(a),g.splice(s,i-s+1,f))}}return wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function RD(e,n){const i=e.get(n)[1],a=e.get(n)[2];let s=n-1;const o=[];let u=i._tokenizer;u||(u=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,b=i,w=0,E=0;const N=[E];for(;b;){for(;e.get(++s)[1]!==b;);o.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(E=x+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const _=f.slice(N[x],N[x+1]),D=o.pop();h.push([D,D+_.length-1]),e.splice(D,2,_)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const OD={resolve:HD,tokenize:BD},LD={partial:!0,tokenize:UD};function HD(e){return g2(e),e}function BD(e,n){let i;return a;function a(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Se(f)?e.check(LD,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function UD(e,n,i){const a=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pe(e,o,"linePrefix")}function o(u){if(u===null||Se(u))return i(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(a.parser.constructs.flow,i,n)(u)}}function y2(e,n,i,a,s,o,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||Vc(_)?i(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(s),e.exit(a),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?i(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function E(_){return!g&&(_===null||_===41||rt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),n(_)):g<d&&_===40?(e.consume(_),g++,E):_===41?(e.consume(_),g--,E):_===null||_===32||_===40||Vc(_)?i(_):(e.consume(_),_===92?N:E)}function N(_){return _===40||_===41||_===92?(e.consume(_),E):E(_)}}function x2(e,n,i,a,s,o){const u=this;let f=0,h;return d;function d(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(o),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(o),e.enter(s),e.consume(b),e.exit(s),e.exit(a),n):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!Be(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function b2(e,n,i,a,s,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),u=x===40?41:x,h):i(x)}function h(x){return x===u?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),n):(e.enter(o),d(x))}function d(x){return x===u?(e.exit(o),h(u)):x===null?i(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Pe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function Ps(e,n){let i;return a;function a(s){return Se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i=!0,a):Be(s)?Pe(e,a,i?"linePrefix":"lineSuffix")(s):n(s)}}const ID={name:"definition",tokenize:$D},qD={partial:!0,tokenize:VD};function $D(e,n,i){const a=this;let s;return o;function o(b){return e.enter("definition"),u(b)}function u(b){return x2.call(a,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return rt(b)?Ps(e,d)(b):d(b)}function d(b){return y2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(qD,m,m)(b)}function m(b){return Be(b)?Pe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),a.parser.defined.push(s),n(b)):i(b)}}function VD(e,n,i){return a;function a(f){return rt(f)?Ps(e,s)(f):i(f)}function s(f){return b2(e,o,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Be(f)?Pe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const PD={name:"hardBreakEscape",tokenize:YD};function YD(e,n,i){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Se(o)?(e.exit("hardBreakEscape"),n(o)):i(o)}}const XD={name:"headingAtx",resolve:FD,tokenize:GD};function FD(e,n){let i=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},o={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wn(e,a,i-a+1,[["enter",s,n],["enter",o,n],["exit",o,n],["exit",s,n]])),e}function GD(e,n,i){let a=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||rt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),n(g)):Be(g)?Pe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||rt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const ZD=["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"],I1=["pre","script","style","textarea"],QD={concrete:!0,name:"htmlFlow",resolveTo:WD,tokenize:eR},KD={partial:!0,tokenize:nR},JD={partial:!0,tokenize:tR};function WD(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function eR(e,n,i){const a=this;let s,o,u,f,h;return d;function d(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),o=!0,E):T===63?(e.consume(T),s=3,a.interrupt?n:z):Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function x(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,f=0,w):Ft(T)?(e.consume(T),s=4,a.interrupt?n:z):i(T)}function b(T){return T===45?(e.consume(T),a.interrupt?n:z):i(T)}function w(T){const ie="CDATA[";return T===ie.charCodeAt(f++)?(e.consume(T),f===ie.length?a.interrupt?n:P:w):i(T)}function E(T){return Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function N(T){if(T===null||T===47||T===62||rt(T)){const ie=T===47,ce=u.toLowerCase();return!ie&&!o&&I1.includes(ce)?(s=1,a.interrupt?n(T):P(T)):ZD.includes(u.toLowerCase())?(s=6,ie?(e.consume(T),_):a.interrupt?n(T):P(T)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(T):o?D(T):k(T))}return T===45||It(T)?(e.consume(T),u+=String.fromCharCode(T),N):i(T)}function _(T){return T===62?(e.consume(T),a.interrupt?n:P):i(T)}function D(T){return Be(T)?(e.consume(T),D):q(T)}function k(T){return T===47?(e.consume(T),q):T===58||T===95||Ft(T)?(e.consume(T),C):Be(T)?(e.consume(T),k):q(T)}function C(T){return T===45||T===46||T===58||T===95||It(T)?(e.consume(T),C):L(T)}function L(T){return T===61?(e.consume(T),A):Be(T)?(e.consume(T),L):k(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),h=T,H):Be(T)?(e.consume(T),A):F(T)}function H(T){return T===h?(e.consume(T),h=null,G):T===null||Se(T)?i(T):(e.consume(T),H)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?L(T):(e.consume(T),F)}function G(T){return T===47||T===62||Be(T)?k(T):i(T)}function q(T){return T===62?(e.consume(T),V):i(T)}function V(T){return T===null||Se(T)?P(T):Be(T)?(e.consume(T),V):i(T)}function P(T){return T===45&&s===2?(e.consume(T),j):T===60&&s===1?(e.consume(T),U):T===62&&s===4?(e.consume(T),R):T===63&&s===3?(e.consume(T),z):T===93&&s===5?(e.consume(T),K):Se(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(KD,$,te)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),P)}function te(T){return e.check(JD,O,$)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return T===null||Se(T)?te(T):(e.enter("htmlFlowData"),P(T))}function j(T){return T===45?(e.consume(T),z):P(T)}function U(T){return T===47?(e.consume(T),u="",Y):P(T)}function Y(T){if(T===62){const ie=u.toLowerCase();return I1.includes(ie)?(e.consume(T),R):P(T)}return Ft(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),Y):P(T)}function K(T){return T===93?(e.consume(T),z):P(T)}function z(T){return T===62?(e.consume(T),R):T===45&&s===2?(e.consume(T),z):P(T)}function R(T){return T===null||Se(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),R)}function $(T){return e.exit("htmlFlow"),n(T)}}function tR(e,n,i){const a=this;return s;function s(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):i(u)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}function nR(e,n,i){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(vo,n,i)}}const iR={name:"htmlText",tokenize:rR};function rR(e,n,i){const a=this;let s,o,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),L):z===63?(e.consume(z),k):Ft(z)?(e.consume(z),F):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),o=0,w):Ft(z)?(e.consume(z),D):i(z)}function g(z){return z===45?(e.consume(z),b):i(z)}function m(z){return z===null?i(z):z===45?(e.consume(z),x):Se(z)?(u=m,U(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),b):m(z)}function b(z){return z===62?j(z):z===45?x(z):m(z)}function w(z){const R="CDATA[";return z===R.charCodeAt(o++)?(e.consume(z),o===R.length?E:w):i(z)}function E(z){return z===null?i(z):z===93?(e.consume(z),N):Se(z)?(u=E,U(z)):(e.consume(z),E)}function N(z){return z===93?(e.consume(z),_):E(z)}function _(z){return z===62?j(z):z===93?(e.consume(z),_):E(z)}function D(z){return z===null||z===62?j(z):Se(z)?(u=D,U(z)):(e.consume(z),D)}function k(z){return z===null?i(z):z===63?(e.consume(z),C):Se(z)?(u=k,U(z)):(e.consume(z),k)}function C(z){return z===62?j(z):k(z)}function L(z){return Ft(z)?(e.consume(z),A):i(z)}function A(z){return z===45||It(z)?(e.consume(z),A):H(z)}function H(z){return Se(z)?(u=H,U(z)):Be(z)?(e.consume(z),H):j(z)}function F(z){return z===45||It(z)?(e.consume(z),F):z===47||z===62||rt(z)?G(z):i(z)}function G(z){return z===47?(e.consume(z),j):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):Be(z)?(e.consume(z),G):j(z)}function q(z){return z===45||z===46||z===58||z===95||It(z)?(e.consume(z),q):V(z)}function V(z){return z===61?(e.consume(z),P):Se(z)?(u=V,U(z)):Be(z)?(e.consume(z),V):G(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),s=z,te):Se(z)?(u=P,U(z)):Be(z)?(e.consume(z),P):(e.consume(z),O)}function te(z){return z===s?(e.consume(z),s=void 0,B):z===null?i(z):Se(z)?(u=te,U(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||rt(z)?G(z):(e.consume(z),O)}function B(z){return z===47||z===62||rt(z)?G(z):i(z)}function j(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function U(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return Be(z)?Pe(e,K,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const qm={name:"labelEnd",resolveAll:oR,resolveTo:uR,tokenize:cR},aR={tokenize:fR},lR={tokenize:dR},sR={tokenize:hR};function oR(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",n+=s}}return e.length!==i.length&&wn(e,0,e.length,i),e}function uR(e,n){let i=e.length,a=0,s,o,u,f;for(;i--;)if(s=e[i][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=i,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(u=i);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=Dn(f,e.slice(o+1,o+a+3)),f=Dn(f,[["enter",g,n]]),f=Dn(f,xf(n.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),n)),f=Dn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",h,n]]),wn(e,o,e.length,f),e}function cR(e,n,i){const a=this;let s=a.events.length,o,u;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return f;function f(x){return o?o._inactive?m(x):(u=a.parser.defined.includes(Yn(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(aR,g,u?g:m)(x):x===91?e.attempt(lR,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(sR,g,m)(x)}function g(x){return n(x)}function m(x){return o._balanced=!0,i(x)}}function fR(e,n,i){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return rt(m)?Ps(e,o)(m):o(m)}function o(m){return m===41?g(m):y2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Ps(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?b2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Ps(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function dR(e,n,i){const a=this;return s;function s(f){return x2.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function hR(e,n,i){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):i(o)}}const pR={name:"labelStartImage",resolveAll:qm.resolveAll,tokenize:mR};function mR(e,n,i){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(f):n(f)}}const gR={name:"labelStartLink",resolveAll:qm.resolveAll,tokenize:yR};function yR(e,n,i){const a=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(u):n(u)}}const dp={name:"lineEnding",tokenize:xR};function xR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,n,"linePrefix")}}const Mc={name:"thematicBreak",tokenize:bR};function bR(e,n,i){let a=0,s;return o;function o(d){return e.enter("thematicBreak"),u(d)}function u(d){return s=d,f(d)}function f(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Se(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===s?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Be(d)?Pe(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:_R},exit:ER,name:"list",tokenize:SR},vR={partial:!0,tokenize:NR},wR={partial:!0,tokenize:kR};function SR(e,n,i){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(b){const w=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Jp(b)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Mc,i,d)(b):d(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return Jp(b)&&++u<10?(e.consume(b),h):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):i(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(vo,a.interrupt?i:g,e.attempt(vR,x,m))}function g(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function m(b){return Be(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):i(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function _R(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(vo,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Pe(e,n,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Be(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(wR,n,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Pe(e,e.attempt(rn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function kR(e,n,i){const a=this;return Pe(e,s,"listItemIndent",a.containerState.size+1);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?n(o):i(o)}}function ER(e){e.exit(this.containerState.type)}function NR(e,n,i){const a=this;return Pe(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=a.events[a.events.length-1];return!Be(o)&&u&&u[1].type==="listItemPrefixWhitespace"?n(o):i(o)}}const q1={name:"setextUnderline",resolveTo:CR,tokenize:MR};function CR(e,n){let i=e.length,a,s,o;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(s=i)}else e[i][1].type==="content"&&e.splice(i,1),!o&&e[i][1].type==="definition"&&(o=i);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,n]),e.splice(o+1,0,["exit",e[a][1],n]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,n]),e}function MR(e,n,i){const a=this;let s;return o;function o(d){let g=a.events.length,m;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){m=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),s=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===s?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Be(d)?Pe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const TR={tokenize:AR};function AR(e){const n=this,i=e.attempt(vo,a,e.attempt(this.parser.constructs.flowInitial,s,Pe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(OD,s)),"linePrefix")));return i;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const zR={resolveAll:w2()},jR=v2("string"),DR=v2("text");function v2(e){return{resolveAll:w2(e==="text"?RR:void 0),tokenize:n};function n(i){const a=this,s=this.parser.constructs[e],o=i.attempt(s,u,f);return u;function u(g){return d(g)?o(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),h}function h(g){return d(g)?(i.exit("data"),o(g)):(i.consume(g),h)}function d(g){if(g===null)return!0;const m=s[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function w2(e){return n;function n(i,a){let s=-1,o;for(;++s<=i.length;)o===void 0?i[s]&&i[s][1].type==="data"&&(o=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==o+2&&(i[o][1].end=i[s-1][1].end,i.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(i,a):i}}function RR(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],s=n.sliceStream(a);let o=s.length,u=-1,f=0,h;for(;o--;){const d=s[o];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){o++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const OR={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:h2},LR={91:ID},HR={[-2]:fp,[-1]:fp,32:fp},BR={35:XD,42:Mc,45:[q1,Mc],60:QD,61:q1,95:Mc,96:U1,126:U1},UR={38:m2,92:p2},IR={[-5]:dp,[-4]:dp,[-3]:dp,33:pR,38:m2,42:Wp,60:[gD,iR],91:gR,92:[PD,p2],93:qm,95:Wp,96:TD},qR={null:[Wp,zR]},$R={null:[42,95]},VR={null:[]},PR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$R,contentInitial:LR,disable:VR,document:OR,flow:BR,flowInitial:HR,insideSpan:qR,string:UR,text:IR},Symbol.toStringTag,{value:"Module"}));function YR(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:H(L),check:H(A),consume:D,enter:k,exit:C,interrupt:H(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&o.push(n),d;function m(V){return u=Dn(u,V),N(),u[u.length-1]!==null?[]:(F(n,0),d.events=xf(o,d.events,d),d.events)}function x(V,P){return FR(b(V),P)}function b(V){return XR(u,V)}function w(){const{_bufferIndex:V,_index:P,line:te,column:O,offset:B}=a;return{_bufferIndex:V,_index:P,line:te,column:O,offset:B}}function E(V){s[V.line]=V.column,q()}function N(){let V;for(;a._index<u.length;){const P=u[a._index];if(typeof P=="string")for(V=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===V&&a._bufferIndex<P.length;)_(P.charCodeAt(a._bufferIndex));else _(P)}}function _(V){g=g(V)}function D(V){Se(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,q()):V!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=V}function k(V,P){const te=P||{};return te.type=V,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(V){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function L(V,P){F(V,P.from)}function A(V,P){P.restore()}function H(V,P){return te;function te(O,B,j){let U,Y,K,z;return Array.isArray(O)?$(O):"tokenize"in O?$([O]):R(O);function R(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return $(Ce)(ue)}}function $(fe){return U=fe,Y=0,fe.length===0?j:T(fe[Y])}function T(fe){return he;function he(ue){return z=G(),K=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ie,ce)(ue)}}function ie(fe){return V(K,z),B}function ce(fe){return z.restore(),++Y<U.length?T(U[Y]):j}}}function F(V,P){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&wn(d.events,P,d.events.length-P,V.resolve(d.events.slice(P),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function G(){const V=w(),P=d.previous,te=d.currentConstruct,O=d.events.length,B=Array.from(f);return{from:O,restore:j};function j(){a=V,d.previous=P,d.currentConstruct=te,d.events.length=O,f=B,q()}}function q(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function XR(e,n){const i=n.start._index,a=n.start._bufferIndex,s=n.end._index,o=n.end._bufferIndex;let u;if(i===s)u=[e[i].slice(a,o)];else{if(u=e.slice(i,s),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function FR(e,n){let i=-1;const a=[];let s;for(;++i<e.length;){const o=e[i];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
108
114
|
`;break}case-3:{u=`\r
|
|
109
|
-
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,a.push(u)}return a.join("")}function IR(e){const a={constructs:o2([LR,...(e||{}).extensions||[]]),content:s(tj),defined:[],document:s(ij),flow:s(wR),lazy:{},string:s(kR),text:s(ER)};return a;function s(o){return u;function u(f){return HR(a,o,f)}}}function qR(e){for(;!h2(e););return e}const q1=/[\0\t\n\r]/g;function $R(){let e=1,n="",i=!0,a;return s;function s(o,u,f){const h=[];let d,g,m,x,b;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),m=0,n="",i&&(o.charCodeAt(0)===65279&&m++,i=void 0);m<o.length;){if(q1.lastIndex=m,d=q1.exec(o),x=d&&d.index!==void 0?d.index:o.length,b=o.charCodeAt(x),!d){n=o.slice(m);break}if(b===10&&m===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),m<x&&(h.push(o.slice(m,x)),e+=x-m),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}m=x+1}return f&&(a&&h.push(-5),n&&h.push(n),h.push(null)),h}}const VR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function YR(e){return e.replace(VR,PR)}function PR(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),o=s===120||s===88;return u2(i.slice(o?2:1),o?16:10)}return Um(i)||e}const b2={}.hasOwnProperty;function XR(e,n,i){return typeof n!="string"&&(i=n,n=void 0),FR(i)(qR(IR(i).document().write($R()(e,n,!0))))}function FR(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Lt),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(Ze),blockQuote:o(Ee),characterEscape:G,characterReference:G,codeFenced:o(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Ce,u),codeText:o(we,u),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Re),hardBreakEscape:o(Xe),hardBreakTrailing:o(Xe),htmlFlow:o(ht,u),htmlFlowData:G,htmlText:o(ht,u),htmlTextData:G,image:o(sn),label:u,link:o(Lt),listItem:o(Rn),listItemValue:x,listOrdered:o(Gt,m),listUnordered:o(Gt),paragraph:o(si),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Ze),strong:o(oi),thematicBreak:o(Ii)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(E),codeFencedFence:N,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(_),codeText:h(B),codeTextData:q,data:q,definition:h(),definitionDestinationString:C,definitionLabelString:j,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:Q,labelText:P,lineEnding:V,link:h(D),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:R,resource:$,setextHeading:h(F),setextHeadingLineSequence:H,setextHeadingText:A,strong:h(),thematicBreak:h()}};v2(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(ae){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:n,enter:f,exit:d,buffer:u,resume:g,data:i},je=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")je.push($e);else{const Vt=je.pop();$e=s(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];b2.call(Vt,ae[$e][1].type)&&Vt[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},_e),ae[$e][1])}if(_e.tokenStack.length>0){const Vt=_e.tokenStack[_e.tokenStack.length-1];(Vt[1]||$1).call(_e,void 0,Vt[0])}for(pe.position={start:vr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:vr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)pe=n.transforms[$e](pe)||pe;return pe}function s(ae,pe,_e){let je=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++je<=_e;){const Ke=ae[je];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?$e++:$e--,Ht=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(On&&!Ht&&!$e&&!pt&&(pt=je),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!$e&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||$e===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(On){let Gn=je;for(At=void 0;Gn--;){const on=ae[Gn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;At&&(ae[At][1].type="lineEndingBlank",Vt=!0),on[1].type="lineEnding",At=Gn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}pt&&(!At||pt<At)&&(On._spread=!0),On.end=Object.assign({},At?ae[At][1].start:Ke[1].end),ae.splice(At||je,0,["exit",On,Ke[2]]),je++,_e++}if(Ke[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};On=Gn,ae.splice(je,0,["enter",Gn,Ke[2]]),je++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function o(ae,pe){return _e;function _e(je){f.call(this,ae(je),je),pe&&pe.call(this,je)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,pe,_e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([pe,_e||void 0]),ae.position={start:vr(pe.start),end:void 0}}function h(ae){return pe;function pe(_e){ae&&ae.call(this,_e),d.call(this,_e)}}function d(ae,pe){const _e=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==ae.type&&(pe?pe.call(this,ae,je[0]):(je[1]||$1).call(this,ae,je[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Vs({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return Bm(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ae){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ae}function w(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ae}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/(\r?\n|\r)$/g,"")}function j(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Pn(this.sliceSerialize(ae)).toLowerCase()}function k(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function C(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function L(ae){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ae).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function H(ae){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ae){const _e=this.stack[this.stack.length-1].children;let je=_e[_e.length-1];(!je||je.type!=="text")&&(je=Et(),je.position={start:vr(ae.start),end:void 0},_e.push(je)),this.stack.push(je)}function q(ae){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ae),pe.position.end=vr(ae.end)}function V(ae){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=vr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(G.call(this,ae),q.call(this,ae))}function Y(){this.data.atHardBreak=!0}function te(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function O(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function B(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function D(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function U(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function P(ae){const pe=this.sliceSerialize(ae),_e=this.stack[this.stack.length-2];_e.label=YR(pe),_e.identifier=Pn(pe).toLowerCase()}function Q(){const ae=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const je=ae.children;_e.children=je}else _e.alt=pe}function z(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function R(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ie(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Pn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function fe(ae){const pe=this.sliceSerialize(ae),_e=this.data.characterReferenceType;let je;_e?(je=u2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Um(pe);const $e=this.stack[this.stack.length-1];$e.value+=je}function he(ae){const pe=this.stack.pop();pe.position.end=vr(ae.end)}function ue(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ae)}function me(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function ht(){return{type:"html",value:""}}function sn(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function Gt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Rn(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function oi(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Ii(){return{type:"thematicBreak"}}}function vr(e){return{line:e.line,column:e.column,offset:e.offset}}function v2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?v2(e,a):GR(e,a)}}function GR(e,n){let i;for(i in n)if(b2.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function $1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Vs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is still open")}function ZR(e){const n=this;n.parser=i;function i(a){return XR(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function QR(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function KR(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
110
|
-
`}]}function
|
|
111
|
-
`:"",a={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:i}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function
|
|
115
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,a.push(u)}return a.join("")}function GR(e){const a={constructs:f2([PR,...(e||{}).extensions||[]]),content:s(uD),defined:[],document:s(fD),flow:s(TR),lazy:{},string:s(jR),text:s(DR)};return a;function s(o){return u;function u(f){return YR(a,o,f)}}}function ZR(e){for(;!g2(e););return e}const $1=/[\0\t\n\r]/g;function QR(){let e=1,n="",i=!0,a;return s;function s(o,u,f){const h=[];let d,g,m,x,b;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),m=0,n="",i&&(o.charCodeAt(0)===65279&&m++,i=void 0);m<o.length;){if($1.lastIndex=m,d=$1.exec(o),x=d&&d.index!==void 0?d.index:o.length,b=o.charCodeAt(x),!d){n=o.slice(m);break}if(b===10&&m===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),m<x&&(h.push(o.slice(m,x)),e+=x-m),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}m=x+1}return f&&(a&&h.push(-5),n&&h.push(n),h.push(null)),h}}const KR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JR(e){return e.replace(KR,WR)}function WR(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),o=s===120||s===88;return d2(i.slice(o?2:1),o?16:10)}return Im(i)||e}const S2={}.hasOwnProperty;function eO(e,n,i){return typeof n!="string"&&(i=n,n=void 0),tO(i)(ZR(GR(i).document().write(QR()(e,n,!0))))}function tO(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Lt),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(Ze),blockQuote:o(Ee),characterEscape:G,characterReference:G,codeFenced:o(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Ce,u),codeText:o(we,u),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Re),hardBreakEscape:o(Xe),hardBreakTrailing:o(Xe),htmlFlow:o(ht,u),htmlFlowData:G,htmlText:o(ht,u),htmlTextData:G,image:o(sn),label:u,link:o(Lt),listItem:o(Rn),listItemValue:x,listOrdered:o(Gt,m),listUnordered:o(Gt),paragraph:o(si),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Ze),strong:o(oi),thematicBreak:o(Ii)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(_),codeText:h(B),codeTextData:q,data:q,definition:h(),definitionDestinationString:C,definitionLabelString:D,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:K,labelText:Y,lineEnding:V,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:R,resource:$,setextHeading:h(F),setextHeadingLineSequence:H,setextHeadingText:A,strong:h(),thematicBreak:h()}};_2(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(ae){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:n,enter:f,exit:d,buffer:u,resume:g,data:i},De=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")De.push($e);else{const Vt=De.pop();$e=s(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];S2.call(Vt,ae[$e][1].type)&&Vt[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},_e),ae[$e][1])}if(_e.tokenStack.length>0){const Vt=_e.tokenStack[_e.tokenStack.length-1];(Vt[1]||V1).call(_e,void 0,Vt[0])}for(pe.position={start:vr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:vr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)pe=n.transforms[$e](pe)||pe;return pe}function s(ae,pe,_e){let De=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++De<=_e;){const Ke=ae[De];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?$e++:$e--,Ht=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(On&&!Ht&&!$e&&!pt&&(pt=De),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!$e&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||$e===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(On){let Gn=De;for(At=void 0;Gn--;){const on=ae[Gn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;At&&(ae[At][1].type="lineEndingBlank",Vt=!0),on[1].type="lineEnding",At=Gn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}pt&&(!At||pt<At)&&(On._spread=!0),On.end=Object.assign({},At?ae[At][1].start:Ke[1].end),ae.splice(At||De,0,["exit",On,Ke[2]]),De++,_e++}if(Ke[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};On=Gn,ae.splice(De,0,["enter",Gn,Ke[2]]),De++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function o(ae,pe){return _e;function _e(De){f.call(this,ae(De),De),pe&&pe.call(this,De)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,pe,_e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([pe,_e||void 0]),ae.position={start:vr(pe.start),end:void 0}}function h(ae){return pe;function pe(_e){ae&&ae.call(this,_e),d.call(this,_e)}}function d(ae,pe){const _e=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ae.type&&(pe?pe.call(this,ae,De[0]):(De[1]||V1).call(this,ae,De[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Vs({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return Um(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ae){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ae}function w(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/(\r?\n|\r)$/g,"")}function D(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase()}function k(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function C(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function L(ae){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ae).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function H(ae){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ae){const _e=this.stack[this.stack.length-1].children;let De=_e[_e.length-1];(!De||De.type!=="text")&&(De=Et(),De.position={start:vr(ae.start),end:void 0},_e.push(De)),this.stack.push(De)}function q(ae){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ae),pe.position.end=vr(ae.end)}function V(ae){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=vr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(G.call(this,ae),q.call(this,ae))}function P(){this.data.atHardBreak=!0}function te(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function O(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function B(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function j(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function U(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(ae){const pe=this.sliceSerialize(ae),_e=this.stack[this.stack.length-2];_e.label=JR(pe),_e.identifier=Yn(pe).toLowerCase()}function K(){const ae=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const De=ae.children;_e.children=De}else _e.alt=pe}function z(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function R(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ie(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function fe(ae){const pe=this.sliceSerialize(ae),_e=this.data.characterReferenceType;let De;_e?(De=d2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Im(pe);const $e=this.stack[this.stack.length-1];$e.value+=De}function he(ae){const pe=this.stack.pop();pe.position.end=vr(ae.end)}function ue(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ae)}function me(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function ht(){return{type:"html",value:""}}function sn(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function Gt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Rn(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function oi(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Ii(){return{type:"thematicBreak"}}}function vr(e){return{line:e.line,column:e.column,offset:e.offset}}function _2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?_2(e,a):nO(e,a)}}function nO(e,n){let i;for(i in n)if(S2.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function V1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Vs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is still open")}function iO(e){const n=this;n.parser=i;function i(a){return eO(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function rO(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function aO(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
116
|
+
`}]}function lO(e,n){const i=n.value?n.value+`
|
|
117
|
+
`:"",a={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:i}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function sO(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function oO(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function uO(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(n.identifier).toUpperCase(),s=bl(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,d),e.applyData(n,d)}function cO(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function fO(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function k2(e,n){const i=n.referenceType;let a="]";if(i==="collapsed"?a+="[]":i==="full"&&(a+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+a}];const s=e.all(n),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=a:s.push({type:"text",value:a}),s}function dO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return k2(e,n);const s={src:bl(a.url||""),alt:n.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,o),e.applyData(n,o)}function hO(e,n){const i={src:bl(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function pO(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const a={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,a),e.applyData(n,a)}function mO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return k2(e,n);const s={href:bl(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function gO(e,n){const i={href:bl(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function yO(e,n,i){const a=e.all(n),s=i?xO(i):E2(n),o={},u=[];if(typeof n.checked=="boolean"){const g=a[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(s||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
112
118
|
`}),g.type==="element"&&g.tagName==="p"&&!s?u.push(...g.children):u.push(g)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
113
|
-
`});const d={type:"element",tagName:"li",properties:o,children:u};return e.patch(n,d),e.applyData(n,d)}function
|
|
119
|
+
`});const d={type:"element",tagName:"li",properties:o,children:u};return e.patch(n,d),e.applyData(n,d)}function xO(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let a=-1;for(;!n&&++a<i.length;)n=E2(i[a])}return n}function E2(e){const n=e.spread;return n??e.children.length>1}function bO(e,n){const i={},a=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++s<a.length;){const u=a[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(a,!0)};return e.patch(n,o),e.applyData(n,o)}function vO(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function wO(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function SO(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function _O(e,n){const i=e.all(n),a=i.shift(),s=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(n.children[0],u),s.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=Om(n.children[1]),h=r2(n.children[n.children.length-1]);f&&h&&(u.position={start:f,end:h}),s.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,o),e.applyData(n,o)}function kO(e,n,i){const a=i?i.children:void 0,o=(a?a.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,f=u?u.length:n.children.length;let h=-1;const d=[];for(;++h<f;){const m=n.children[h],x={},b=u?u[h]:void 0;b&&(x.align=b);let w={type:"element",tagName:o,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function EO(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const P1=9,Y1=32;function NO(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),s=0;const o=[];for(;a;)o.push(X1(n.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=i.exec(n);return o.push(X1(n.slice(s),s>0,!1)),o.join("")}function X1(e,n,i){let a=0,s=e.length;if(n){let o=e.codePointAt(a);for(;o===P1||o===Y1;)a++,o=e.codePointAt(a)}if(i){let o=e.codePointAt(s-1);for(;o===P1||o===Y1;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function CO(e,n){const i={type:"text",value:NO(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function MO(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const TO={blockquote:rO,break:aO,code:lO,delete:sO,emphasis:oO,footnoteReference:uO,heading:cO,html:fO,imageReference:dO,image:hO,inlineCode:pO,linkReference:mO,link:gO,listItem:yO,list:bO,paragraph:vO,root:wO,strong:SO,table:_O,tableCell:EO,tableRow:kO,text:CO,thematicBreak:MO,toml:yc,yaml:yc,definition:yc,footnoteDefinition:yc};function yc(){}const N2=-1,bf=0,Ys=1,Pc=2,$m=3,Vm=4,Pm=5,Ym=6,C2=7,M2=8,F1=typeof self=="object"?self:globalThis,AO=(e,n)=>{const i=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,u]=n[s];switch(o){case bf:case N2:return i(u,s);case Ys:{const f=i([],s);for(const h of u)f.push(a(h));return f}case Pc:{const f=i({},s);for(const[h,d]of u)f[a(h)]=a(d);return f}case $m:return i(new Date(u),s);case Vm:{const{source:f,flags:h}=u;return i(new RegExp(f,h),s)}case Pm:{const f=i(new Map,s);for(const[h,d]of u)f.set(a(h),a(d));return f}case Ym:{const f=i(new Set,s);for(const h of u)f.add(a(h));return f}case C2:{const{name:f,message:h}=u;return i(new F1[f](h),s)}case M2:return i(BigInt(u),s);case"BigInt":return i(Object(BigInt(u)),s);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return i(new DataView(f),u)}}return i(new F1[o](u),s)};return a},G1=e=>AO(new Map,e)(0),Za="",{toString:zO}={},{keys:jO}=Object,Os=e=>{const n=typeof e;if(n!=="object"||!e)return[bf,n];const i=zO.call(e).slice(8,-1);switch(i){case"Array":return[Ys,Za];case"Object":return[Pc,Za];case"Date":return[$m,Za];case"RegExp":return[Vm,Za];case"Map":return[Pm,Za];case"Set":return[Ym,Za];case"DataView":return[Ys,i]}return i.includes("Array")?[Ys,i]:i.includes("Error")?[C2,i]:[Pc,i]},xc=([e,n])=>e===bf&&(n==="function"||n==="symbol"),DO=(e,n,i,a)=>{const s=(u,f)=>{const h=a.push(u)-1;return i.set(f,h),h},o=u=>{if(i.has(u))return i.get(u);let[f,h]=Os(u);switch(f){case bf:{let g=u;switch(h){case"bigint":f=M2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([N2],u)}return s([f,g],u)}case Ys:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),s([h,[...x]],u)}const g=[],m=s([f,g],u);for(const x of u)g.push(o(x));return m}case Pc:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(n&&"toJSON"in u)return o(u.toJSON());const g=[],m=s([f,g],u);for(const x of jO(u))(e||!xc(Os(u[x])))&&g.push([o(x),o(u[x])]);return m}case $m:return s([f,u.toISOString()],u);case Vm:{const{source:g,flags:m}=u;return s([f,{source:g,flags:m}],u)}case Pm:{const g=[],m=s([f,g],u);for(const[x,b]of u)(e||!(xc(Os(x))||xc(Os(b))))&&g.push([o(x),o(b)]);return m}case Ym:{const g=[],m=s([f,g],u);for(const x of u)(e||!xc(Os(x)))&&g.push(o(x));return m}}const{message:d}=u;return s([f,{name:h,message:d}],u)};return o},Z1=(e,{json:n,lossy:i}={})=>{const a=[];return DO(!(n||i),!!n,new Map,a)(e),a},Yc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?G1(Z1(e,n)):structuredClone(e):(e,n)=>G1(Z1(e,n));function RO(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function OO(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function LO(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||RO,a=e.options.footnoteBackLabel||OO,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const g=e.all(d),m=String(d.identifier).toUpperCase(),x=bl(m.toLowerCase());let b=0;const w=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++b<=E;){w.length>0&&w.push({type:"text",value:" "});let D=typeof i=="string"?i:i(h,b);typeof D=="string"&&(D={type:"text",value:D}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const D=N.children[N.children.length-1];D&&D.type==="text"?D.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const _={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(g,!0)};e.patch(d,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Yc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
114
120
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
115
|
-
`}]}}const
|
|
121
|
+
`}]}}const vf=(function(e){if(e==null)return IO;if(typeof e=="function")return wf(e);if(typeof e=="object")return Array.isArray(e)?HO(e):BO(e);if(typeof e=="string")return UO(e);throw new Error("Expected function, string, or object as test")});function HO(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=vf(e[i]);return wf(a);function a(...s){let o=-1;for(;++o<n.length;)if(n[o].apply(this,s))return!0;return!1}}function BO(e){const n=e;return wf(i);function i(a){const s=a;let o;for(o in e)if(s[o]!==n[o])return!1;return!0}}function UO(e){return wf(n);function n(i){return i&&i.type===e}}function wf(e){return n;function n(i,a,s){return!!(qO(i)&&e.call(this,i,typeof a=="number"?a:void 0,s||void 0))}}function IO(){return!0}function qO(e){return e!==null&&typeof e=="object"&&"type"in e}const T2=[],$O=!0,em=!1,VO="skip";function A2(e,n,i,a){let s;typeof n=="function"&&typeof i!="function"?(a=i,i=n):s=n;const o=vf(s),u=a?-1:1;f(e,void 0,[])();function f(h,d,g){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=T2,w,E,N;if((!n||o(h,d,g[g.length-1]||void 0))&&(b=PO(i(h,g)),b[0]===em))return b;if("children"in h&&h.children){const _=h;if(_.children&&b[0]!==VO)for(E=(a?_.children.length:-1)+u,N=g.concat(_);E>-1&&E<_.children.length;){const D=_.children[E];if(w=f(D,E,N)(),w[0]===em)return w;E=typeof w[1]=="number"?w[1]:E+u}}return b}}}function PO(e){return Array.isArray(e)?e:typeof e=="number"?[$O,e]:e==null?T2:[e]}function Xm(e,n,i,a){let s,o,u;typeof n=="function"&&typeof i!="function"?(o=void 0,u=n,s=i):(o=n,u=i,s=a),A2(e,o,f,s);function f(h,d){const g=d[d.length-1],m=g?g.children.indexOf(h):void 0;return u(h,m,g)}}const tm={}.hasOwnProperty,YO={};function XO(e,n){const i=n||YO,a=new Map,s=new Map,o=new Map,u={...TO,...i.handlers},f={all:d,applyData:GO,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:i,patch:FO,wrap:QO};return Xm(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?a:s,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function h(g,m){const x=g.type,b=f.handlers[x];if(tm.call(f.handlers,x)&&b)return b(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:E,...N}=g,_=Yc(N);return _.children=f.all(g),_}return Yc(g)}return(f.options.unknownHandler||ZO)(f,g,m)}function d(g){const m=[];if("children"in g){const x=g.children;let b=-1;for(;++b<x.length;){const w=f.one(x[b],g);if(w){if(b&&x[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Q1(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=Q1(E.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function FO(e,n){e.position&&(n.position=Oj(e))}function GO(e,n){let i=n;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(i.type==="element")i.tagName=a;else{const u="children"in i?i.children:[i];i={type:"element",tagName:a,properties:{},children:u}}i.type==="element"&&o&&Object.assign(i.properties,Yc(o)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function ZO(e,n){const i=n.data||{},a="value"in n&&!(tm.call(i,"hProperties")||tm.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function QO(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
|
|
116
122
|
`});++a<e.length;)a&&i.push({type:"text",value:`
|
|
117
123
|
`}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
|
|
118
|
-
`}),i}function
|
|
119
|
-
`},s),o}function VO(e,n){return e&&"run"in e?async function(i,a){const s=Q1(i,{file:a,...n});await e.run(s,a)}:function(i,a){return Q1(i,{file:a,...e||n})}}function K1(e){if(e)throw e}var dp,J1;function YO(){if(J1)return dp;J1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},o=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(a)return a(d,g).value}else return;return d[g]};return dp=function h(){var d,g,m,x,b,w,N=arguments[0],E=1,_=arguments.length,j=!1;for(typeof N=="boolean"&&(j=N,N=arguments[1]||{},E=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});E<_;++E)if(d=arguments[E],d!=null)for(g in d)m=f(N,g),x=f(d,g),N!==x&&(j&&x&&(o(x)||(b=s(x)))?(b?(b=!1,w=m&&s(m)?m:[]):w=m&&o(m)?m:{},u(N,{name:g,newValue:h(j,w,x)})):typeof x<"u"&&u(N,{name:g,newValue:x}));return N},dp}var PO=YO();const hp=Fc(PO);function tm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function XO(){const e=[],n={run:i,use:a};return n;function i(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...d){const g=e[++o];let m=-1;if(h){u(h);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,g?FO(g,f)(...d):u(null,...d)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function FO(e,n){let i;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(d){const g=d;if(f&&i)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){i||(i=!0,n(u,...f))}function o(u){s(null,u)}}const ei={basename:GO,dirname:ZO,extname:QO,join:KO,sep:"/"};function GO(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');wo(e);let i=0,a=-1,s=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let u=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(a=s):(f=-1,a=u));return i===a?a=u:a<0&&(a=e.length),e.slice(i,a)}function ZO(e){if(wo(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function QO(e){wo(e);let n=e.length,i=-1,a=0,s=-1,o=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){a=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?s<0?s=n:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||i<0||o===0||o===1&&s===i-1&&s===a+1?"":e.slice(s,i)}function KO(...e){let n=-1,i;for(;++n<e.length;)wo(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":JO(i)}function JO(e){wo(e);const n=e.codePointAt(0)===47;let i=WO(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function WO(e,n){let i="",a=0,s=-1,o=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",a=0):(i=i.slice(0,h),a=i.length-1-i.lastIndexOf("/")),s=u,o=0;continue}}else if(i.length>0){i="",a=0,s=u,o=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,u):i=e.slice(s+1,u),a=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return i}function wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const e6={cwd:t6};function t6(){return"/"}function nm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function n6(e){if(typeof e=="string")e=new URL(e);else if(!nm(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return i6(e)}function i6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const pp=["history","path","basename","stem","extname","dirname"];class M2{constructor(n){let i;n?nm(n)?i={path:n}:typeof n=="string"||r6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":e6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<pp.length;){const o=pp[a];o in i&&i[o]!==void 0&&i[o]!==null&&(this[o]=o==="history"?[...i[o]]:i[o])}let s;for(s in i)pp.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){gp(n,"basename"),mp(n,"basename"),this.path=ei.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ei.dirname(this.path):void 0}set dirname(n){W1(this.basename,"dirname"),this.path=ei.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ei.extname(this.path):void 0}set extname(n){if(mp(n,"extname"),W1(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ei.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){nm(n)&&(n=n6(n)),gp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ei.basename(this.path,this.extname):void 0}set stem(n){gp(n,"stem"),mp(n,"stem"),this.path=ei.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const s=this.message(n,i,a);throw s.fatal=!0,s}info(n,i,a){const s=this.message(n,i,a);return s.fatal=void 0,s}message(n,i,a){const s=new $t(n,i,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function mp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function gp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function W1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function r6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a6=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),l6={}.hasOwnProperty;class Xm extends a6{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=XO()}copy(){const n=new Xm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(hp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(bp("data",this.frozen),this.namespace[n]=i,this):l6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(bp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=i.call(n,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=bc(n),a=this.parser||this.Parser;return yp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),yp("process",this.parser||this.Parser),xp("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(o,u){const f=bc(n),h=a.parse(f);a.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const b=m,w=a.stringify(b,x);u6(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):o?o(m):i(void 0,m)}}}processSync(n){let i=!1,a;return this.freeze(),yp("processSync",this.parser||this.Parser),xp("processSync",this.compiler||this.Compiler),this.process(n,s),tv("processSync","process",i),a;function s(o,u){i=!0,K1(o),a=u}}run(n,i,a){ev(n),this.freeze();const s=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const h=bc(i);s.run(n,h,d);function d(g,m,x){const b=m||n;g?f(g):u?u(b):a(void 0,b,x)}}}runSync(n,i){let a=!1,s;return this.run(n,i,o),tv("runSync","run",a),s;function o(u,f){K1(u),s=f,a=!0}}stringify(n,i){this.freeze();const a=bc(i),s=this.compiler||this.Compiler;return xp("stringify",s),ev(n),s(n,a)}use(n,...i){const a=this.attachers,s=this.namespace;if(bp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))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");f(d.plugins),d.settings&&(s.settings=hp(!0,s.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<a.length;)if(a[m][0]===d){x=m;break}if(x===-1)a.push([d,...g]);else if(g.length>0){let[b,...w]=g;const N=a[x][1];tm(N)&&tm(b)&&(b=hp(!0,N,b)),a[x]=[d,b,...w]}}}}const s6=new Xm().freeze();function yp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function bp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ev(e){if(!tm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tv(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function bc(e){return o6(e)?e:new M2(e)}function o6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function u6(e){return typeof e=="string"||c6(e)}function c6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nv=[],iv={allowDangerousHtml:!0},d6=/^(https?|ircs?|mailto|xmpp)$/i,h6=[{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 rv(e){const n=p6(e),i=m6(e);return g6(n.runSync(n.parse(i),i),e)}function p6(e){const n=e.rehypePlugins||nv,i=e.remarkPlugins||nv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iv}:iv;return s6().use(ZR).use(i).use(VO,a).use(n)}function m6(e){const n=e.children||"",i=new M2;return typeof n=="string"&&(i.value=n),i}function g6(e,n){const i=n.allowedElements,a=n.allowElement,s=n.components,o=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||y6;for(const g of h6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+f6+g.id,void 0);return Pm(e,d),DD(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in up)if(Object.hasOwn(up,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],N=up[b];(N===null||N.includes(g.tagName))&&(g.properties[b]=h(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&a&&typeof m=="number"&&(b=!a(g,m,x)),b&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function y6(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||i!==-1&&n>i||a!==-1&&n>a||d6.test(e.slice(0,n))?e:""}function av(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let a=0,s=i.indexOf(n);for(;s!==-1;)a++,s=i.indexOf(n,s+n.length);return a}function x6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function b6(e,n,i){const s=bf((i||{}).ignore||[]),o=v6(n);let u=-1;for(;++u<o.length;)C2(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(s(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=o[u][0],b=o[u][1];let w=0;const E=m.children.indexOf(d);let _=!1,j=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const C=k.index,L={index:k.index,input:k.input,stack:[...g,d]};let A=b(...k,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&j.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?j.push(...A):A&&j.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&j.push({type:"text",value:d.value.slice(w)}),m.children.splice(E,1,...j)):j=[d],E+j.length}}function v6(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<i.length;){const s=i[a];n.push([w6(s[0]),S6(s[1])])}return n}function w6(e){return typeof e=="string"?new RegExp(x6(e),"g"):e}function S6(e){return typeof e=="function"?e:function(){return e}}const vp="phrasing",wp=["autolink","link","image","label"];function _6(){return{transforms:[A6],enter:{literalAutolink:E6,literalAutolinkEmail:Sp,literalAutolinkHttp:Sp,literalAutolinkWww:Sp},exit:{literalAutolink:T6,literalAutolinkEmail:M6,literalAutolinkHttp:N6,literalAutolinkWww:C6}}}function k6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vp,notInConstruct:wp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vp,notInConstruct:wp},{character:":",before:"[ps]",after:"\\/",inConstruct:vp,notInConstruct:wp}]}}function E6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Sp(e){this.config.enter.autolinkProtocol.call(this,e)}function N6(e){this.config.exit.autolinkProtocol.call(this,e)}function C6(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function M6(e){this.config.exit.autolinkEmail.call(this,e)}function T6(e){this.exit(e)}function A6(e){b6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,z6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),D6]],{ignore:["link","linkReference"]})}function z6(e,n,i,a,s){let o="";if(!T2(s)||(/^w/i.test(n)&&(i=n+i,n="",o="http://"),!j6(i)))return!1;const u=R6(i+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function D6(e,n,i,a){return!T2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function j6(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function R6(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],a=i.indexOf(")");const s=av(e,"(");let o=av(e,")");for(;a!==-1&&s>o;)e+=i.slice(0,a+1),i=i.slice(a+1),a=i.indexOf(")"),o++;return[e,i]}function T2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||gf(i))&&(!n||i!==47)}A2.peek=V6;function O6(){this.buffer()}function L6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function H6(){this.buffer()}function B6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Pn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function I6(e){this.exit(e)}function q6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Pn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function $6(e){this.exit(e)}function V6(){return"["}function A2(e,n,i,a){const s=i.createTracker(a);let o=s.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return o+=s.move(i.safe(i.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function Y6(){return{enter:{gfmFootnoteCallString:O6,gfmFootnoteCall:L6,gfmFootnoteDefinitionLabelString:H6,gfmFootnoteDefinition:B6},exit:{gfmFootnoteCallString:U6,gfmFootnoteCall:I6,gfmFootnoteDefinitionLabelString:q6,gfmFootnoteDefinition:$6}}}function P6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:A2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(a,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
120
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),n?
|
|
121
|
-
`)}function
|
|
122
|
-
`&&
|
|
123
|
-
`}function
|
|
124
|
+
`}),i}function Q1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function K1(e,n){const i=XO(e,n),a=i.one(e,void 0),s=LO(i),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
125
|
+
`},s),o}function KO(e,n){return e&&"run"in e?async function(i,a){const s=K1(i,{file:a,...n});await e.run(s,a)}:function(i,a){return K1(i,{file:a,...e||n})}}function J1(e){if(e)throw e}var hp,W1;function JO(){if(W1)return hp;W1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},o=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(a)return a(d,g).value}else return;return d[g]};return hp=function h(){var d,g,m,x,b,w,E=arguments[0],N=1,_=arguments.length,D=!1;for(typeof E=="boolean"&&(D=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<_;++N)if(d=arguments[N],d!=null)for(g in d)m=f(E,g),x=f(d,g),E!==x&&(D&&x&&(o(x)||(b=s(x)))?(b?(b=!1,w=m&&s(m)?m:[]):w=m&&o(m)?m:{},u(E,{name:g,newValue:h(D,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},hp}var WO=JO();const pp=Fc(WO);function nm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function e6(){const e=[],n={run:i,use:a};return n;function i(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...d){const g=e[++o];let m=-1;if(h){u(h);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,g?t6(g,f)(...d):u(null,...d)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function t6(e,n){let i;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(d){const g=d;if(f&&i)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){i||(i=!0,n(u,...f))}function o(u){s(null,u)}}const ei={basename:n6,dirname:i6,extname:r6,join:a6,sep:"/"};function n6(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');wo(e);let i=0,a=-1,s=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let u=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(a=s):(f=-1,a=u));return i===a?a=u:a<0&&(a=e.length),e.slice(i,a)}function i6(e){if(wo(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function r6(e){wo(e);let n=e.length,i=-1,a=0,s=-1,o=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){a=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?s<0?s=n:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||i<0||o===0||o===1&&s===i-1&&s===a+1?"":e.slice(s,i)}function a6(...e){let n=-1,i;for(;++n<e.length;)wo(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":l6(i)}function l6(e){wo(e);const n=e.codePointAt(0)===47;let i=s6(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function s6(e,n){let i="",a=0,s=-1,o=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",a=0):(i=i.slice(0,h),a=i.length-1-i.lastIndexOf("/")),s=u,o=0;continue}}else if(i.length>0){i="",a=0,s=u,o=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,u):i=e.slice(s+1,u),a=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return i}function wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o6={cwd:u6};function u6(){return"/"}function im(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function c6(e){if(typeof e=="string")e=new URL(e);else if(!im(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return f6(e)}function f6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const mp=["history","path","basename","stem","extname","dirname"];class z2{constructor(n){let i;n?im(n)?i={path:n}:typeof n=="string"||d6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":o6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<mp.length;){const o=mp[a];o in i&&i[o]!==void 0&&i[o]!==null&&(this[o]=o==="history"?[...i[o]]:i[o])}let s;for(s in i)mp.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){yp(n,"basename"),gp(n,"basename"),this.path=ei.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ei.dirname(this.path):void 0}set dirname(n){ev(this.basename,"dirname"),this.path=ei.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ei.extname(this.path):void 0}set extname(n){if(gp(n,"extname"),ev(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ei.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){im(n)&&(n=c6(n)),yp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ei.basename(this.path,this.extname):void 0}set stem(n){yp(n,"stem"),gp(n,"stem"),this.path=ei.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const s=this.message(n,i,a);throw s.fatal=!0,s}info(n,i,a){const s=this.message(n,i,a);return s.fatal=void 0,s}message(n,i,a){const s=new $t(n,i,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function gp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function yp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function ev(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function d6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const h6=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),p6={}.hasOwnProperty;class Fm extends h6{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=e6()}copy(){const n=new Fm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(pp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(vp("data",this.frozen),this.namespace[n]=i,this):p6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(vp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=i.call(n,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=bc(n),a=this.parser||this.Parser;return xp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),xp("process",this.parser||this.Parser),bp("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(o,u){const f=bc(n),h=a.parse(f);a.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const b=m,w=a.stringify(b,x);y6(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):o?o(m):i(void 0,m)}}}processSync(n){let i=!1,a;return this.freeze(),xp("processSync",this.parser||this.Parser),bp("processSync",this.compiler||this.Compiler),this.process(n,s),nv("processSync","process",i),a;function s(o,u){i=!0,J1(o),a=u}}run(n,i,a){tv(n),this.freeze();const s=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const h=bc(i);s.run(n,h,d);function d(g,m,x){const b=m||n;g?f(g):u?u(b):a(void 0,b,x)}}}runSync(n,i){let a=!1,s;return this.run(n,i,o),nv("runSync","run",a),s;function o(u,f){J1(u),s=f,a=!0}}stringify(n,i){this.freeze();const a=bc(i),s=this.compiler||this.Compiler;return bp("stringify",s),tv(n),s(n,a)}use(n,...i){const a=this.attachers,s=this.namespace;if(vp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))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");f(d.plugins),d.settings&&(s.settings=pp(!0,s.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<a.length;)if(a[m][0]===d){x=m;break}if(x===-1)a.push([d,...g]);else if(g.length>0){let[b,...w]=g;const E=a[x][1];nm(E)&&nm(b)&&(b=pp(!0,E,b)),a[x]=[d,b,...w]}}}}const m6=new Fm().freeze();function xp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tv(e){if(!nm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nv(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function bc(e){return g6(e)?e:new z2(e)}function g6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function y6(e){return typeof e=="string"||x6(e)}function x6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iv=[],rv={allowDangerousHtml:!0},v6=/^(https?|ircs?|mailto|xmpp)$/i,w6=[{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 av(e){const n=S6(e),i=_6(e);return k6(n.runSync(n.parse(i),i),e)}function S6(e){const n=e.rehypePlugins||iv,i=e.remarkPlugins||iv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rv}:rv;return m6().use(iO).use(i).use(KO,a).use(n)}function _6(e){const n=e.children||"",i=new z2;return typeof n=="string"&&(i.value=n),i}function k6(e,n){const i=n.allowedElements,a=n.allowElement,s=n.components,o=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||E6;for(const g of w6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+b6+g.id,void 0);return Xm(e,d),Ij(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in cp)if(Object.hasOwn(cp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=cp[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=h(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&a&&typeof m=="number"&&(b=!a(g,m,x)),b&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function E6(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||i!==-1&&n>i||a!==-1&&n>a||v6.test(e.slice(0,n))?e:""}function lv(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let a=0,s=i.indexOf(n);for(;s!==-1;)a++,s=i.indexOf(n,s+n.length);return a}function N6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function C6(e,n,i){const s=vf((i||{}).ignore||[]),o=M6(n);let u=-1;for(;++u<o.length;)A2(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(s(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=o[u][0],b=o[u][1];let w=0;const N=m.children.indexOf(d);let _=!1,D=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const C=k.index,L={index:k.index,input:k.input,stack:[...g,d]};let A=b(...k,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&D.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?D.push(...A):A&&D.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&D.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...D)):D=[d],N+D.length}}function M6(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<i.length;){const s=i[a];n.push([T6(s[0]),A6(s[1])])}return n}function T6(e){return typeof e=="string"?new RegExp(N6(e),"g"):e}function A6(e){return typeof e=="function"?e:function(){return e}}const wp="phrasing",Sp=["autolink","link","image","label"];function z6(){return{transforms:[B6],enter:{literalAutolink:D6,literalAutolinkEmail:_p,literalAutolinkHttp:_p,literalAutolinkWww:_p},exit:{literalAutolink:H6,literalAutolinkEmail:L6,literalAutolinkHttp:R6,literalAutolinkWww:O6}}}function j6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:":",before:"[ps]",after:"\\/",inConstruct:wp,notInConstruct:Sp}]}}function D6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _p(e){this.config.enter.autolinkProtocol.call(this,e)}function R6(e){this.config.exit.autolinkProtocol.call(this,e)}function O6(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function L6(e){this.config.exit.autolinkEmail.call(this,e)}function H6(e){this.exit(e)}function B6(e){C6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I6]],{ignore:["link","linkReference"]})}function U6(e,n,i,a,s){let o="";if(!j2(s)||(/^w/i.test(n)&&(i=n+i,n="",o="http://"),!q6(i)))return!1;const u=$6(i+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function I6(e,n,i,a){return!j2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function q6(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function $6(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],a=i.indexOf(")");const s=lv(e,"(");let o=lv(e,")");for(;a!==-1&&s>o;)e+=i.slice(0,a+1),i=i.slice(a+1),a=i.indexOf(")"),o++;return[e,i]}function j2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||yf(i))&&(!n||i!==47)}D2.peek=K6;function V6(){this.buffer()}function P6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Y6(){this.buffer()}function X6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function F6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function G6(e){this.exit(e)}function Z6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function Q6(e){this.exit(e)}function K6(){return"["}function D2(e,n,i,a){const s=i.createTracker(a);let o=s.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return o+=s.move(i.safe(i.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function J6(){return{enter:{gfmFootnoteCallString:V6,gfmFootnoteCall:P6,gfmFootnoteDefinitionLabelString:Y6,gfmFootnoteDefinition:X6},exit:{gfmFootnoteCallString:F6,gfmFootnoteCall:G6,gfmFootnoteDefinitionLabelString:Z6,gfmFootnoteDefinition:Q6}}}function W6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:D2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(a,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
126
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),n?R2:e8))),d(),h}}function e8(e,n,i){return n===0?e:R2(e,n,i)}function R2(e,n,i){return(i?"":" ")+e}const t8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];O2.peek=l8;function n8(){return{canContainEols:["delete"],enter:{strikethrough:r8},exit:{strikethrough:a8}}}function i8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:t8}],handlers:{delete:O2}}}function r8(e){this.enter({type:"delete",children:[]},e)}function a8(e){this.exit(e)}function O2(e,n,i,a){const s=i.createTracker(a),o=i.enter("strikethrough");let u=s.move("~~");return u+=i.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function l8(){return"~"}function s8(e){return e.length}function o8(e,n){const i=n||{},a=(i.align||[]).concat(),s=i.stringLength||s8,o=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const E=[],N=[];let _=-1;for(e[g].length>d&&(d=e[g].length);++_<e[g].length;){const D=u8(e[g][_]);if(i.alignDelimiters!==!1){const k=s(D);N[_]=k,(h[_]===void 0||k>h[_])&&(h[_]=k)}E.push(D)}u[g]=E,f[g]=N}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)o[m]=sv(a[m]);else{const E=sv(a);for(;++m<d;)o[m]=E}m=-1;const x=[],b=[];for(;++m<d;){const E=o[m];let N="",_="";E===99?(N=":",_=":"):E===108?N=":":E===114&&(_=":");let D=i.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-_.length);const k=N+"-".repeat(D)+_;i.alignDelimiters!==!1&&(D=N.length+D+_.length,D>h[m]&&(h[m]=D),b[m]=D),x[m]=k}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const E=u[g],N=f[g];m=-1;const _=[];for(;++m<d;){const D=E[m]||"";let k="",C="";if(i.alignDelimiters!==!1){const L=h[m]-(N[m]||0),A=o[m];A===114?k=" ".repeat(L):A===99?L%2?(k=" ".repeat(L/2+.5),C=" ".repeat(L/2-.5)):(k=" ".repeat(L/2),C=k):C=" ".repeat(L)}i.delimiterStart!==!1&&!m&&_.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&D==="")&&(i.delimiterStart!==!1||m)&&_.push(" "),i.alignDelimiters!==!1&&_.push(k),_.push(D),i.alignDelimiters!==!1&&_.push(C),i.padding!==!1&&_.push(" "),(i.delimiterEnd!==!1||m!==d-1)&&_.push("|")}w.push(i.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return w.join(`
|
|
127
|
+
`)}function u8(e){return e==null?"":String(e)}function sv(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function c8(e,n,i,a){const s=i.enter("blockquote"),o=i.createTracker(a);o.move("> "),o.shift(2);const u=i.indentLines(i.containerFlow(e,o.current()),f8);return s(),u}function f8(e,n,i){return">"+(i?"":" ")+e}function d8(e,n){return ov(e,n.inConstruct,!0)&&!ov(e,n.notInConstruct,!1)}function ov(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let a=-1;for(;++a<n.length;)if(e.includes(n[a]))return!0;return!1}function uv(e,n,i,a){let s=-1;for(;++s<i.unsafe.length;)if(i.unsafe[s].character===`
|
|
128
|
+
`&&d8(i.stack,i.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
129
|
+
`}function h8(e,n){const i=String(e);let a=i.indexOf(n),s=a,o=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>u&&(u=o):o=1,s=a+n.length,a=i.indexOf(n,s);return u}function p8(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function m8(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function g8(e,n,i,a){const s=m8(i),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(p8(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(o,y8);return m(),x}const f=i.createTracker(a),h=s.repeat(Math.max(h8(o,s)+1,3)),d=i.enter("codeFenced");let g=f.move(h);if(e.lang){const m=i.enter(`codeFencedLang${u}`);g+=f.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=i.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(i.safe(e.meta,{before:g,after:`
|
|
124
130
|
`,encode:["`"],...f.current()})),m()}return g+=f.move(`
|
|
125
131
|
`),o&&(g+=f.move(o+`
|
|
126
|
-
`)),g+=f.move(h),d(),g}function
|
|
127
|
-
`,...h.current()}))),f(),e.title&&(f=i.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(i.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),f()),u(),d}function
|
|
132
|
+
`)),g+=f.move(h),d(),g}function y8(e,n,i){return(i?"":" ")+e}function Gm(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function x8(e,n,i,a){const s=Gm(i),o=s==='"'?"Quote":"Apostrophe",u=i.enter("definition");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("[");return d+=h.move(i.safe(i.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":`
|
|
133
|
+
`,...h.current()}))),f(),e.title&&(f=i.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(i.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),f()),u(),d}function b8(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ro(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xc(e,n,i){const a=ml(e),s=ml(n);return a===void 0?s===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L2.peek=v8;function L2(e,n,i,a){const s=b8(i),o=i.enter("emphasis"),u=i.createTracker(a),f=u.move(s);let h=u.move(i.containerPhrasing(e,{after:s,before:f,...u.current()}));const d=h.charCodeAt(0),g=Xc(a.before.charCodeAt(a.before.length-1),d,s);g.inside&&(h=ro(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Xc(a.after.charCodeAt(0),m,s);x.inside&&(h=h.slice(0,-1)+ro(m));const b=u.move(s);return o(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function v8(e,n,i){return i.options.emphasis||"*"}function w8(e,n){let i=!1;return Xm(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return i=!0,em}),!!((!e.depth||e.depth<3)&&Um(e)&&(n.options.setext||i))}function S8(e,n,i,a){const s=Math.max(Math.min(6,e.depth||1),1),o=i.createTracker(a);if(w8(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...o.current(),before:`
|
|
128
134
|
`,after:`
|
|
129
135
|
`});return m(),g(),x+`
|
|
130
136
|
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
131
137
|
`))+1))}const u="#".repeat(s),f=i.enter("headingAtx"),h=i.enter("phrasing");o.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
|
|
132
|
-
`,...o.current()});return/^[\t ]/.test(d)&&(d=ro(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}
|
|
133
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:h,tableRow:f}};function u(b,w,N
|
|
134
|
-
`))}function h(b,w,N,E){const _=N.enter("tableCell"),j=N.enter("phrasing"),k=N.containerPhrasing(b,{...E,before:o,after:o});return j(),_(),k}function d(b,w){return e8(b,{align:w,alignDelimiters:a,padding:i,stringLength:s})}function g(b,w,N){const E=b.children;let _=-1;const j=[],k=w.enter("table");for(;++_<E.length;)j[_]=m(E[_],w,N);return k(),j}function m(b,w,N){const E=b.children;let _=-1;const j=[],k=w.enter("tableRow");for(;++_<E.length;)j[_]=h(E[_],b,w,N);return k(),j}function x(b,w,N){let E=V2.inlineCode(b,w,N);return N.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function q8(){return{exit:{taskListCheckValueChecked:cv,taskListCheckValueUnchecked:cv,paragraph:V8}}}function $8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Y8}}}function cv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function V8(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const a=i.children[0];if(a&&a.type==="text"){const s=n.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===i&&(a.value=a.value.slice(1),a.value.length===0?i.children.shift():i.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,i.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function Y8(e,n,i,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(a);o&&f.move(u);let h=V2.listItem(e,n,i,{...a,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function P8(){return[_6(),Y6(),G6(),R8(),q8()]}function X8(e){return{extensions:[k6(),P6(e),Z6(),I8(e),$8()]}}const F8={tokenize:W8,partial:!0},Y2={tokenize:eL,partial:!0},P2={tokenize:tL,partial:!0},X2={tokenize:nL,partial:!0},G8={tokenize:iL,partial:!0},F2={name:"wwwAutolink",tokenize:K8,previous:Z2},G2={name:"protocolAutolink",tokenize:J8,previous:Q2},Ui={name:"emailAutolink",tokenize:Q8,previous:K2},li={};function Z8(){return{text:li}}let Fr=48;for(;Fr<123;)li[Fr]=Ui,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);li[43]=Ui;li[45]=Ui;li[46]=Ui;li[95]=Ui;li[72]=[Ui,G2];li[104]=[Ui,G2];li[87]=[Ui,F2];li[119]=[Ui,F2];function Q8(e,n,i){const a=this;let s,o;return u;function u(m){return!im(m)||!K2.call(a,a.previous)||Zm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return im(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(G8,g,d)(m):m===45||m===95||It(m)?(o=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),s=!0,h}function g(m){return o&&s&&Ft(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function K8(e,n,i){const a=this;return s;function s(u){return u!==87&&u!==119||!Z2.call(a,a.previous)||Zm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(F8,e.attempt(Y2,e.attempt(P2,o),i),i)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function J8(e,n,i){const a=this;let s="",o=!1;return u;function u(m){return(m===72||m===104)&&Q2.call(a,a.previous)&&!Zm(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(Ft(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),o?d:(o=!0,h)):i(m)}function d(m){return m===null||Vc(m)||rt(m)||ia(m)||gf(m)?i(m):e.attempt(Y2,e.attempt(P2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function W8(e,n,i){let a=0;return s;function s(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),s):u===46&&a===3?(e.consume(u),o):i(u)}function o(u){return u===null?i(u):n(u)}}function eL(e,n,i){let a,s,o;return u;function u(d){return d===46||d===95?e.check(X2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&gf(d)?h(d):(o=!0,e.consume(d),u)}function f(d){return d===95?a=!0:(s=a,a=void 0),e.consume(d),u}function h(d){return s||a||!o?i(d):n(d)}}function tL(e,n){let i=0,a=0;return s;function s(u){return u===40?(i++,e.consume(u),s):u===41&&a<i?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(X2,n,o)(u):u===null||rt(u)||ia(u)?n(u):(e.consume(u),s)}function o(u){return u===41&&a++,e.consume(u),s}}function nL(e,n,i){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||rt(f)||ia(f)?n(f):i(f)}function s(f){return f===null||f===40||f===91||rt(f)||ia(f)?n(f):a(f)}function o(f){return Ft(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),a):Ft(f)?(e.consume(f),u):i(f)}}function iL(e,n,i){return a;function a(o){return e.consume(o),s}function s(o){return It(o)?i(o):n(o)}}function Z2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function Q2(e){return!Ft(e)}function K2(e){return!(e===47||im(e))}function im(e){return e===43||e===45||e===46||e===95||It(e)}function Zm(e){let n=e.length,i=!1;for(;n--;){const a=e[n][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){i=!0;break}if(a._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const rL={tokenize:dL,partial:!0};function aL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uL,continuation:{tokenize:cL},exit:fL}},text:{91:{name:"gfmFootnoteCall",tokenize:oL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lL,resolveTo:sL}}}}function lL(e,n,i){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const d=Pn(a.sliceSerialize({start:u.end,end:a.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function sL(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[i+1],e[i+2],["enter",a,n],e[i+3],e[i+4],["enter",s,n],["exit",s,n],["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",a,n]];return e.splice(i,e.length-i+1,...f),e}function oL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!u||m===null||m===91||rt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(Pn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return rt(m)||(u=!0),o++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function uL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||rt(w))return i(w);if(w===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return o=Pn(a.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ye(e,b,"gfmFootnoteDefinitionWhitespace")):i(w)}function b(w){return n(w)}}function cL(e,n,i){return e.check(vo,n,e.attempt(rL,n,i))}function fL(e){e.exit("gfmFootnoteDefinition")}function dL(e,n,i){const a=this;return Ye(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(o):i(o)}}function hL(e){let i=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return i==null&&(i=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&wn(x,x.length,0,yf(b,u.slice(d+1,h),f)),wn(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),wn(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const N=ml(d);if(w===126)return m>1?h(w):(u.consume(w),m++,b);if(m<2&&!i)return h(w);const E=u.exit("strikethroughSequenceTemporary"),_=ml(w);return E._open=!_||_===2&&!!N,E._close=!N||N===2&&!!_,f(w)}}}class pL{constructor(){this.map=[]}add(n,i,a){mL(this,n,i,a)}consume(n){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];a.push(n.slice()),n.length=0;let s=a.pop();for(;s;){for(const o of s)n.push(o);s=a.pop()}this.map.length=0}}function mL(e,n,i,a){let s=0;if(!(i===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=i,e.map[s][2].push(...a);return}s+=1}e.map.push([n,i,a])}}function gL(e,n){let i=!1;const a=[];for(;n<e.length;){const s=e[n];if(i){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return a}function yL(){return{flow:{null:{name:"table",tokenize:xL,resolveAll:bL}}}}function xL(e,n,i){const a=this;let s=0,o=0,u;return f;function f(q){let V=a.events.length-1;for(;V>-1;){const O=a.events[V][1].type;if(O==="lineEnding"||O==="linePrefix")V--;else break}const Y=V>-1?a.events[V][1].type:null,te=Y==="tableHead"||Y==="tableRow"?A:h;return te===A&&a.parser.lazy[a.now().line]?i(q):te(q)}function h(q){return e.enter("tableHead"),e.enter("tableRow"),d(q)}function d(q){return q===124||(u=!0,o+=1),g(q)}function g(q){return q===null?i(q):Se(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):i(q):He(q)?Ye(e,g,"whitespace")(q):(o+=1,u&&(u=!1,s+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(q)))}function m(q){return q===null||q===124||rt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?x:m)}function x(q){return q===92||q===124?(e.consume(q),m):m(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(q):(e.enter("tableDelimiterRow"),u=!1,He(q)?Ye(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):w(q))}function w(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),N):L(q)}function N(q){return He(q)?Ye(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(o+=1,_(q)):q===null||Se(q)?C(q):L(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),j(q)):L(q)}function j(q){return q===45?(e.consume(q),j):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(q))}function k(q){return He(q)?Ye(e,C,"whitespace")(q):C(q)}function C(q){return q===124?w(q):q===null||Se(q)?!u||s!==o?L(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(q)):L(q)}function L(q){return i(q)}function A(q){return e.enter("tableRow"),H(q)}function H(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),H):q===null||Se(q)?(e.exit("tableRow"),n(q)):He(q)?Ye(e,H,"whitespace")(q):(e.enter("data"),F(q))}function F(q){return q===null||q===124||rt(q)?(e.exit("data"),H(q)):(e.consume(q),q===92?G:F)}function G(q){return q===92||q===124?(e.consume(q),F):F(q)}}function bL(e,n){let i=-1,a=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new pL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(fv(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",d,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,m=void 0,o=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",g,n]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m),o=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m)),o=u,u=[o[1],i,0,0])):w.type==="tableHead"?(f=!0,h=i):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=i,o[1]!==0?(u[0]=u[1],m=vc(x,n,o,s,i,m)):u[1]!==0&&(m=vc(x,n,u,s,i,m)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&fv(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=gL(n.events,i))}return e}function vc(e,n,i,a,s,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(o.end=Object.assign({},Ja(n.events,i[0])),e.add(i[0],0,[["exit",o,n]]));const h=Ja(n.events,i[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",o,n]]),i[2]!==0){const d=Ja(n.events,i[2]),g=Ja(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),a!==2){const x=n.events[i[2]],b=n.events[i[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const w=i[2]+1,N=i[3]-i[2]-1;e.add(w,N,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return s!==void 0&&(o.end=Object.assign({},Ja(n.events,s)),e.add(s,0,[["exit",o,n]]),o=void 0),o}function fv(e,n,i,a,s){const o=[],u=Ja(n.events,i);s&&(s.end=Object.assign({},u),o.push(["exit",s,n])),a.end=Object.assign({},u),o.push(["exit",a,n]),e.add(i+1,0,o)}function Ja(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const vL={name:"tasklistCheck",tokenize:SL};function wL(){return{text:{91:vL}}}function SL(e,n,i){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return rt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Se(h)?n(h):He(h)?e.check({tokenize:_L},n,i)(h):i(h)}}function _L(e,n,i){return Ye(e,a,"whitespace");function a(s){return s===null?i(s):n(s)}}function kL(e){return o2([Z8(),aL(),hL(e),yL(),wL()])}const EL={};function dv(e){const n=this,i=e||EL,a=n.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(kL(i)),o.push(P8()),u.push(X8(i))}function NL(){const{isRunning:e,results:n,workflowResults:i,logs:a}=po(),{nodes:s,selectedNodeId:o,updateNode:u}=Hi(),f=Hi(uS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=PS(),[x,b]=K.useState("");K.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[o,f]);const w=s.filter(C=>C.type==="output"),N=w.length>0?n.get(w[0].id):null,E=f?.type==="input",_=E?f.data:null,j=C=>{b(C),o&&u(o,{value:C})},k=()=>{h()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(I3,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:s.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,disabled:e||s.length===0,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-amber-600 hover:bg-amber-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors",children:[v.jsx(Sm,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),s.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[E&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(of,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:_.label})]}),_.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Enter your input"}),v.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:_.placeholder||"Type your message here...",value:x||_.value||"",onChange:C=>j(C.target.value)})]}),_.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Upload a file"}),v.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[v.jsx(y5,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),_.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",_.fileTypes.join(", ")]})]})]}),_.inputType==="select"&&_.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Select an option"}),v.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:x||_.value||"",onChange:C=>j(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),d.length>0&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"생성된 파일"}),v.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 hover:bg-green-700 text-white rounded transition-colors",children:[v.jsx(il,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:d.map((C,L)=>v.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface rounded",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsx("span",{className:"text-sm text-white",children:C.name})]}),v.jsx("button",{onClick:()=>g(C.name,C.content),className:"p-1 hover:bg-surface-hover rounded transition-colors",children:v.jsx(il,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),i.length>0?v.jsx("div",{className:"space-y-4",children:i.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(iS,{className:"w-5 h-5 text-green-500"}):v.jsx(rS,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((L,A)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[L.type==="image"?v.jsx(aS,{className:"w-4 h-4 text-purple-400"}):v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:L.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:L.path})]})]},A))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(rv,{remarkPlugins:[dv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):N?v.jsx("div",{className:"markdown-content",children:v.jsx(rv,{remarkPlugins:[dv],children:typeof N=="string"?N:JSON.stringify(N,null,2)})}):a.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),a.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(rl,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]}),(N||d.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:d.length===0,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover rounded-lg text-sm hover:bg-border transition-colors disabled:opacity-50",children:[v.jsx(il,{className:"w-4 h-4"}),"Download .md"]})})]})}function J2({level:e}){switch(e){case"success":return v.jsx(iS,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(rS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(m5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(F3,{className:"w-4 h-4 text-blue-400"})}}function W2(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function CL({isOpen:e,onClose:n}){const{logs:i,clearLogs:a,isRunning:s}=po(),[o,u]=K.useState(!1),[f,h]=K.useState(250),d=K.useRef(null);K.useEffect(()=>{d.current&&!o&&d.current.scrollIntoView({behavior:"smooth"})},[i,o]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=E=>{const _=x-E.clientY,j=Math.min(Math.max(b+_,100),500);h(j)},N=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",N)};return e?v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:o?40:f},children:[!o&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),s&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:a,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!o),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:o?"Expand":"Minimize",children:o?v.jsx(D3,{className:"w-4 h-4 text-gray-400"}):v.jsx(A3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(t5,{className:"w-4 h-4 text-gray-400"}):v.jsx(J3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(oS,{className:"w-4 h-4 text-gray-400"})})]})]}),!o&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[i.map(m=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",W2(m.timestamp),"]"]}),v.jsx(J2,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),v.jsx("div",{ref:d})]})})]}):null}function ML(){const{logs:e,clearLogs:n,isRunning:i}=po(),a=K.useRef(null);return K.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e]),v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),v.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[e.map(s=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",s.level==="error"&&"bg-red-500/10",s.level==="warning"&&"bg-yellow-500/10",s.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",W2(s.timestamp),"]"]}),v.jsx(J2,{level:s.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",s.level==="error"&&"text-red-400",s.level==="warning"&&"text-yellow-400",s.level==="success"&&"text-green-400",s.level==="info"&&"text-gray-300"),children:s.message}),s.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",s.nodeId.slice(0,8),"]"]}),s.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof s.details=="string"?s.details:JSON.stringify(s.details,null,2)})]})]},s.id)),v.jsx("div",{ref:a})]})})]})}const TL=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],AL=[{id:"sonnet",name:"Claude 4 Sonnet",description:"Fast, cost-efficient"},{id:"opus",name:"Claude 4.5 Opus",description:"Best for complex tasks"},{id:"haiku",name:"Claude 3.5 Haiku",description:"Fastest, for simple tasks"}];function zL(e){switch(e){case"input":return v.jsx(of,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(ho,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(ff,{className:"w-5 h-5 text-cyan-400"});case"mcp":return v.jsx(_m,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(sf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function DL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"mcp":return"MCP Server";case"output":return"Output";default:return"Node"}}function jL({node:e}){const{updateNode:n,removeNode:i}=Hi();if(!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(u5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const a=()=>{i(e.id)},s=u=>{n(e.id,{label:u})},o=u=>{n(e.id,{description:u})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:zL(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:DL(e.type)})]})]}),v.jsx("button",{onClick:a,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:u=>s(u.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:u=>o(u.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&v.jsx(RL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="subagent"&&v.jsx(OL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="skill"&&v.jsx(LL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="mcp"&&v.jsx(HL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="output"&&v.jsx(BL,{onUpdate:u=>n(e.id,u)})]})]})}function RL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>v.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function OL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:AL.map(i=>v.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(ho,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:TL.map(i=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:a=>{const s=a.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(o=>o!==i);n({tools:s})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function LL({data:e,onUpdate:n}){const i=[{id:"ppt-generator",name:"PPT Generator",description:"Create PowerPoint presentations"},{id:"image-gen-nanobanana",name:"Image Generator",description:"Generate images with AI"},{id:"pdf",name:"PDF Processor",description:"Process and create PDF documents"},{id:"xlsx",name:"Excel Processor",description:"Work with spreadsheets"},{id:"docx",name:"Word Processor",description:"Create and edit documents"}];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(a=>v.jsx("button",{onClick:()=>n({skillType:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:i.map(a=>v.jsxs("button",{onClick:()=>n({skillId:a.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===a.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(ff,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:a.name}),v.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.id))})]})]})}function HL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:["stdio","sse"].map(i=>v.jsx("button",{onClick:()=>n({serverType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.serverType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.toUpperCase()},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Name"}),v.jsx("input",{type:"text",value:e.serverName||"",onChange:i=>n({serverName:i.target.value}),placeholder:"e.g., my-mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Command (for stdio)"}),v.jsx("input",{type:"text",value:e.serverConfig?.command||"",onChange:i=>n({serverConfig:{...e.serverConfig,command:i.target.value}}),placeholder:"e.g., npx @anthropic/mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function BL({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>v.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[v.jsx(sf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const UL=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function IL(){const{activeTab:e,setActiveTab:n}=zm(),i=Hi(uS);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:UL.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:Xt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===a.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:a.label},a.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(NL,{}),e==="console"&&v.jsx(ML,{}),e==="step"&&v.jsx(jL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function qL(e){let n;try{n=await fetch("/api/generate/workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!n.ok){let s=`서버 오류 (${n.status})`;try{s=(await n.json()).message||s}catch{}throw new Error(s)}let i;try{i=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:VL(i),workflowName:i.workflowName}}function $L(e,n){if(e.length===0)return e;const i=300,a=150,s=100,o=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),n.forEach(w=>{const N=u.get(w.target)||[];N.push(w.source),u.set(w.target,N);const E=f.get(w.source)||[];E.push(w.target),f.set(w.source,E)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(E=>{const _=d.get(E),j=w.depth+1;(_===void 0||j>_)&&(d.set(E,j),g.push({id:E,depth:j}))})}const m=new Map;d.forEach((w,N)=>{const E=m.get(w)||[];E.push(N),m.set(w,E)});const x=Math.max(...Array.from(d.values()),0),b=new Map;for(let w=0;w<=x;w++){const N=m.get(w)||[],_=(N.length-1)*a,j=o+(300-_)/2;N.forEach((k,C)=>{b.set(k,{x:s+w*i,y:j+C*a})})}return e.map(w=>{const N=b.get(w.id)||w.position;return{...w,position:N}})}function VL(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=to();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":n.push({id:h,type:"input",position:{...a},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":n.push({id:h,type:"subagent",position:{...a},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...a},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"mcp":n.push({id:h,type:"mcp",position:{...a},data:{...d,serverType:"stdio",serverName:u.label,serverConfig:{}}});break;case"output":n.push({id:h,type:"output",position:{...a},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=i.get(u.to),h=i.get(u.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const s=e.edges.map(u=>{const f=i.get(u.from),h=i.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:$L(n,s),edges:s}}function YL(){const[e,n]=K.useState(""),[i,a]=K.useState(!1),[s,o]=K.useState(null),{loadWorkflow:u}=Hi(),f=async()=>{if(!(!e.trim()||i)){a(!0),o(null);try{const{workflow:d,workflowName:g}=await qL(e);u({nodes:d.nodes,edges:d.edges,name:g}),n("")}catch(d){console.error("AI workflow generation failed:",d);const g=d instanceof Error?d.message:"워크플로우 생성에 실패했습니다.";o(g)}finally{a(!1)}}},h=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(ho,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:d=>n(d.target.value),onKeyDown:h,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:i}),v.jsx("button",{onClick:f,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?v.jsx(lS,{className:"w-5 h-5 animate-spin"}):v.jsx(s5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs",children:s?v.jsx("span",{className:"text-red-400",children:s}):i?v.jsx("span",{className:"text-accent",children:"AI가 워크플로우를 생성하고 있습니다..."}):v.jsx("span",{className:"text-gray-600",children:"AI가 워크플로우를 자동 생성합니다"})})]})}function PL(){const{isCollapsed:e,width:n}=zm(),{isRunning:i,logs:a}=po(),[s,o]=K.useState(!1);return K.useEffect(()=>{i&&o(!0)},[i]),v.jsx(Jw,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Bz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(qz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(iD,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(YL,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(IL,{})})]}),v.jsxs("button",{onClick:()=>o(!s),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${s?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${s?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(uf,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),a.length>0&&!s&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:a.length}),i&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(CL,{isOpen:s,onClose:()=>o(!1)})]})})}hE.createRoot(document.getElementById("root")).render(v.jsx(K.StrictMode,{children:v.jsx(PL,{})}));
|
|
138
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=ro(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}H2.peek=_8;function H2(e){return e.value||""}function _8(){return"<"}B2.peek=k8;function B2(e,n,i,a){const s=Gm(i),o=s==='"'?"Quote":"Apostrophe",u=i.enter("image");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("![");return d+=h.move(i.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(i.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),f()),d+=h.move(")"),u(),d}function k8(){return"!"}U2.peek=E8;function U2(e,n,i,a){const s=e.referenceType,o=i.enter("imageReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("![");const d=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,o(),s==="full"||!d||d!==m?h+=f.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function E8(){return"!"}I2.peek=N8;function I2(e,n,i){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<i.unsafe.length;){const u=i.unsafe[o],f=i.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(a);){let d=h.index;a.charCodeAt(d)===10&&a.charCodeAt(d-1)===13&&d--,a=a.slice(0,d)+" "+a.slice(h.index+1)}}return s+a+s}function N8(){return"`"}function q2(e,n){const i=Um(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$2.peek=C8;function $2(e,n,i,a){const s=Gm(i),o=s==='"'?"Quote":"Apostrophe",u=i.createTracker(a);let f,h;if(q2(e,i)){const g=i.stack;i.stack=[],f=i.enter("autolink");let m=u.move("<");return m+=u.move(i.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),f(),i.stack=g,m}f=i.enter("link"),h=i.enter("label");let d=u.move("[");return d+=u.move(i.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(i.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(h=i.enter("destinationRaw"),d+=u.move(i.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=i.enter(`title${o}`),d+=u.move(" "+s),d+=u.move(i.safe(e.title,{before:d,after:s,...u.current()})),d+=u.move(s),h()),d+=u.move(")"),f(),d}function C8(e,n,i){return q2(e,i)?"<":"["}V2.peek=M8;function V2(e,n,i,a){const s=e.referenceType,o=i.enter("linkReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("[");const d=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,o(),s==="full"||!d||d!==m?h+=f.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function M8(){return"["}function Zm(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function T8(e){const n=Zm(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function A8(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function P2(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function z8(e,n,i,a){const s=i.enter("list"),o=i.bulletCurrent;let u=e.ordered?A8(i):Zm(i);const f=e.ordered?u==="."?")":".":T8(i);let h=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),P2(i)===u&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),i.bulletCurrent=u;const d=i.containerFlow(e,a);return i.bulletLastUsed=u,i.bulletCurrent=o,s(),d}function j8(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function D8(e,n,i,a){const s=j8(i);let o=i.bulletCurrent||Zm(i);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=i.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const h=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,f.current()),g);return h(),d;function g(m,x,b){return x?(b?"":" ".repeat(u))+m:(b?o:o+" ".repeat(u-o.length))+m}}function R8(e,n,i,a){const s=i.enter("paragraph"),o=i.enter("phrasing"),u=i.containerPhrasing(e,a);return o(),s(),u}const O8=vf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function L8(e,n,i,a){return(e.children.some(function(u){return O8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,a)}function H8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Y2.peek=B8;function Y2(e,n,i,a){const s=H8(i),o=i.enter("strong"),u=i.createTracker(a),f=u.move(s+s);let h=u.move(i.containerPhrasing(e,{after:s,before:f,...u.current()}));const d=h.charCodeAt(0),g=Xc(a.before.charCodeAt(a.before.length-1),d,s);g.inside&&(h=ro(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Xc(a.after.charCodeAt(0),m,s);x.inside&&(h=h.slice(0,-1)+ro(m));const b=u.move(s+s);return o(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function B8(e,n,i){return i.options.strong||"*"}function U8(e,n,i,a){return i.safe(e.value,a)}function I8(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function q8(e,n,i){const a=(P2(i)+(i.options.ruleSpaces?" ":"")).repeat(I8(i));return i.options.ruleSpaces?a.slice(0,-1):a}const X2={blockquote:c8,break:uv,code:g8,definition:x8,emphasis:L2,hardBreak:uv,heading:S8,html:H2,image:B2,imageReference:U2,inlineCode:I2,link:$2,linkReference:V2,list:z8,listItem:D8,paragraph:R8,root:L8,strong:Y2,text:U8,thematicBreak:q8};function $8(){return{enter:{table:V8,tableData:cv,tableHeader:cv,tableRow:Y8},exit:{codeText:X8,table:P8,tableData:kp,tableHeader:kp,tableRow:kp}}}function V8(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function P8(e){this.exit(e),this.data.inTable=void 0}function Y8(e){this.enter({type:"tableRow",children:[]},e)}function kp(e){this.exit(e)}function cv(e){this.enter({type:"tableCell",children:[]},e)}function X8(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,F8));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function F8(e,n){return n==="|"?n:e}function G8(e){const n=e||{},i=n.tableCellPadding,a=n.tablePipeAlign,s=n.stringLength,o=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
139
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:h,tableRow:f}};function u(b,w,E,N){return d(g(b,E,N),b.align)}function f(b,w,E,N){const _=m(b,E,N),D=d([_]);return D.slice(0,D.indexOf(`
|
|
140
|
+
`))}function h(b,w,E,N){const _=E.enter("tableCell"),D=E.enter("phrasing"),k=E.containerPhrasing(b,{...N,before:o,after:o});return D(),_(),k}function d(b,w){return o8(b,{align:w,alignDelimiters:a,padding:i,stringLength:s})}function g(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("table");for(;++_<N.length;)D[_]=m(N[_],w,E);return k(),D}function m(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("tableRow");for(;++_<N.length;)D[_]=h(N[_],b,w,E);return k(),D}function x(b,w,E){let N=X2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function Z8(){return{exit:{taskListCheckValueChecked:fv,taskListCheckValueUnchecked:fv,paragraph:K8}}}function Q8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J8}}}function fv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function K8(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const a=i.children[0];if(a&&a.type==="text"){const s=n.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===i&&(a.value=a.value.slice(1),a.value.length===0?i.children.shift():i.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,i.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function J8(e,n,i,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(a);o&&f.move(u);let h=X2.listItem(e,n,i,{...a,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function W8(){return[z6(),J6(),n8(),$8(),Z8()]}function eL(e){return{extensions:[j6(),W6(e),i8(),G8(e),Q8()]}}const tL={tokenize:sL,partial:!0},F2={tokenize:oL,partial:!0},G2={tokenize:uL,partial:!0},Z2={tokenize:cL,partial:!0},nL={tokenize:fL,partial:!0},Q2={name:"wwwAutolink",tokenize:aL,previous:J2},K2={name:"protocolAutolink",tokenize:lL,previous:W2},Ui={name:"emailAutolink",tokenize:rL,previous:e_},li={};function iL(){return{text:li}}let Fr=48;for(;Fr<123;)li[Fr]=Ui,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);li[43]=Ui;li[45]=Ui;li[46]=Ui;li[95]=Ui;li[72]=[Ui,K2];li[104]=[Ui,K2];li[87]=[Ui,Q2];li[119]=[Ui,Q2];function rL(e,n,i){const a=this;let s,o;return u;function u(m){return!rm(m)||!e_.call(a,a.previous)||Qm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return rm(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(nL,g,d)(m):m===45||m===95||It(m)?(o=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),s=!0,h}function g(m){return o&&s&&Ft(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function aL(e,n,i){const a=this;return s;function s(u){return u!==87&&u!==119||!J2.call(a,a.previous)||Qm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tL,e.attempt(F2,e.attempt(G2,o),i),i)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function lL(e,n,i){const a=this;let s="",o=!1;return u;function u(m){return(m===72||m===104)&&W2.call(a,a.previous)&&!Qm(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(Ft(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),o?d:(o=!0,h)):i(m)}function d(m){return m===null||Vc(m)||rt(m)||ia(m)||yf(m)?i(m):e.attempt(F2,e.attempt(G2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function sL(e,n,i){let a=0;return s;function s(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),s):u===46&&a===3?(e.consume(u),o):i(u)}function o(u){return u===null?i(u):n(u)}}function oL(e,n,i){let a,s,o;return u;function u(d){return d===46||d===95?e.check(Z2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&yf(d)?h(d):(o=!0,e.consume(d),u)}function f(d){return d===95?a=!0:(s=a,a=void 0),e.consume(d),u}function h(d){return s||a||!o?i(d):n(d)}}function uL(e,n){let i=0,a=0;return s;function s(u){return u===40?(i++,e.consume(u),s):u===41&&a<i?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Z2,n,o)(u):u===null||rt(u)||ia(u)?n(u):(e.consume(u),s)}function o(u){return u===41&&a++,e.consume(u),s}}function cL(e,n,i){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||rt(f)||ia(f)?n(f):i(f)}function s(f){return f===null||f===40||f===91||rt(f)||ia(f)?n(f):a(f)}function o(f){return Ft(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),a):Ft(f)?(e.consume(f),u):i(f)}}function fL(e,n,i){return a;function a(o){return e.consume(o),s}function s(o){return It(o)?i(o):n(o)}}function J2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function W2(e){return!Ft(e)}function e_(e){return!(e===47||rm(e))}function rm(e){return e===43||e===45||e===46||e===95||It(e)}function Qm(e){let n=e.length,i=!1;for(;n--;){const a=e[n][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){i=!0;break}if(a._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const dL={tokenize:vL,partial:!0};function hL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yL,continuation:{tokenize:xL},exit:bL}},text:{91:{name:"gfmFootnoteCall",tokenize:gL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pL,resolveTo:mL}}}}function pL(e,n,i){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const d=Yn(a.sliceSerialize({start:u.end,end:a.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function mL(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[i+1],e[i+2],["enter",a,n],e[i+3],e[i+4],["enter",s,n],["exit",s,n],["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",a,n]];return e.splice(i,e.length-i+1,...f),e}function gL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!u||m===null||m===91||rt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(Yn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return rt(m)||(u=!0),o++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function yL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||rt(w))return i(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=Yn(a.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),Pe(e,b,"gfmFootnoteDefinitionWhitespace")):i(w)}function b(w){return n(w)}}function xL(e,n,i){return e.check(vo,n,e.attempt(dL,n,i))}function bL(e){e.exit("gfmFootnoteDefinition")}function vL(e,n,i){const a=this;return Pe(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(o):i(o)}}function wL(e){let i=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return i==null&&(i=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&wn(x,x.length,0,xf(b,u.slice(d+1,h),f)),wn(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),wn(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const E=ml(d);if(w===126)return m>1?h(w):(u.consume(w),m++,b);if(m<2&&!i)return h(w);const N=u.exit("strikethroughSequenceTemporary"),_=ml(w);return N._open=!_||_===2&&!!E,N._close=!E||E===2&&!!_,f(w)}}}class SL{constructor(){this.map=[]}add(n,i,a){_L(this,n,i,a)}consume(n){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];a.push(n.slice()),n.length=0;let s=a.pop();for(;s;){for(const o of s)n.push(o);s=a.pop()}this.map.length=0}}function _L(e,n,i,a){let s=0;if(!(i===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=i,e.map[s][2].push(...a);return}s+=1}e.map.push([n,i,a])}}function kL(e,n){let i=!1;const a=[];for(;n<e.length;){const s=e[n];if(i){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return a}function EL(){return{flow:{null:{name:"table",tokenize:NL,resolveAll:CL}}}}function NL(e,n,i){const a=this;let s=0,o=0,u;return f;function f(q){let V=a.events.length-1;for(;V>-1;){const O=a.events[V][1].type;if(O==="lineEnding"||O==="linePrefix")V--;else break}const P=V>-1?a.events[V][1].type:null,te=P==="tableHead"||P==="tableRow"?A:h;return te===A&&a.parser.lazy[a.now().line]?i(q):te(q)}function h(q){return e.enter("tableHead"),e.enter("tableRow"),d(q)}function d(q){return q===124||(u=!0,o+=1),g(q)}function g(q){return q===null?i(q):Se(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):i(q):Be(q)?Pe(e,g,"whitespace")(q):(o+=1,u&&(u=!1,s+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(q)))}function m(q){return q===null||q===124||rt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?x:m)}function x(q){return q===92||q===124?(e.consume(q),m):m(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(q):(e.enter("tableDelimiterRow"),u=!1,Be(q)?Pe(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):w(q))}function w(q){return q===45||q===58?N(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),E):L(q)}function E(q){return Be(q)?Pe(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(o+=1,_(q)):q===null||Se(q)?C(q):L(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),D(q)):L(q)}function D(q){return q===45?(e.consume(q),D):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(q))}function k(q){return Be(q)?Pe(e,C,"whitespace")(q):C(q)}function C(q){return q===124?w(q):q===null||Se(q)?!u||s!==o?L(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(q)):L(q)}function L(q){return i(q)}function A(q){return e.enter("tableRow"),H(q)}function H(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),H):q===null||Se(q)?(e.exit("tableRow"),n(q)):Be(q)?Pe(e,H,"whitespace")(q):(e.enter("data"),F(q))}function F(q){return q===null||q===124||rt(q)?(e.exit("data"),H(q)):(e.consume(q),q===92?G:F)}function G(q){return q===92||q===124?(e.consume(q),F):F(q)}}function CL(e,n){let i=-1,a=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new SL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(dv(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",d,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,m=void 0,o=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",g,n]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m),o=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m)),o=u,u=[o[1],i,0,0])):w.type==="tableHead"?(f=!0,h=i):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=i,o[1]!==0?(u[0]=u[1],m=vc(x,n,o,s,i,m)):u[1]!==0&&(m=vc(x,n,u,s,i,m)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&dv(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=kL(n.events,i))}return e}function vc(e,n,i,a,s,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(o.end=Object.assign({},Ja(n.events,i[0])),e.add(i[0],0,[["exit",o,n]]));const h=Ja(n.events,i[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",o,n]]),i[2]!==0){const d=Ja(n.events,i[2]),g=Ja(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),a!==2){const x=n.events[i[2]],b=n.events[i[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const w=i[2]+1,E=i[3]-i[2]-1;e.add(w,E,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return s!==void 0&&(o.end=Object.assign({},Ja(n.events,s)),e.add(s,0,[["exit",o,n]]),o=void 0),o}function dv(e,n,i,a,s){const o=[],u=Ja(n.events,i);s&&(s.end=Object.assign({},u),o.push(["exit",s,n])),a.end=Object.assign({},u),o.push(["exit",a,n]),e.add(i+1,0,o)}function Ja(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const ML={name:"tasklistCheck",tokenize:AL};function TL(){return{text:{91:ML}}}function AL(e,n,i){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return rt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Se(h)?n(h):Be(h)?e.check({tokenize:zL},n,i)(h):i(h)}}function zL(e,n,i){return Pe(e,a,"whitespace");function a(s){return s===null?i(s):n(s)}}function jL(e){return f2([iL(),hL(),wL(e),EL(),TL()])}const DL={};function hv(e){const n=this,i=e||DL,a=n.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(jL(i)),o.push(W8()),u.push(eL(i))}function RL(){const{isRunning:e,results:n,workflowResults:i,logs:a}=po(),{nodes:s,selectedNodeId:o,updateNode:u}=Hi(),f=Hi(fS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=FS(),[x,b]=Q.useState("");Q.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[o,f]);const w=s.filter(C=>C.type==="output"),E=w.length>0?n.get(w[0].id):null,N=f?.type==="input",_=N?f.data:null,D=C=>{b(C),o&&u(o,{value:C})},k=()=>{h()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(lS,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:s.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,disabled:e||s.length===0,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-amber-600 hover:bg-amber-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors",children:[v.jsx(_m,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),s.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(of,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:_.label})]}),_.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Enter your input"}),v.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:_.placeholder||"Type your message here...",value:x||_.value||"",onChange:C=>D(C.target.value)})]}),_.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Upload a file"}),v.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[v.jsx(E5,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),_.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",_.fileTypes.join(", ")]})]})]}),_.inputType==="select"&&_.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Select an option"}),v.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:x||_.value||"",onChange:C=>D(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),d.length>0&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"생성된 파일"}),v.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 hover:bg-green-700 text-white rounded transition-colors",children:[v.jsx(il,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:d.map((C,L)=>v.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface rounded",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsx("span",{className:"text-sm text-white",children:C.name})]}),v.jsx("button",{onClick:()=>g(C.name,C.content),className:"p-1 hover:bg-surface-hover rounded transition-colors",children:v.jsx(il,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),i.length>0?v.jsx("div",{className:"space-y-4",children:i.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(rS,{className:"w-5 h-5 text-green-500"}):v.jsx(aS,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((L,A)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[L.type==="image"?v.jsx(sS,{className:"w-4 h-4 text-purple-400"}):v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:L.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:L.path})]})]},A))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(av,{remarkPlugins:[hv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):E?v.jsx("div",{className:"markdown-content",children:v.jsx(av,{remarkPlugins:[hv],children:typeof E=="string"?E:JSON.stringify(E,null,2)})}):a.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),a.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(rl,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]}),(E||d.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:d.length===0,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover rounded-lg text-sm hover:bg-border transition-colors disabled:opacity-50",children:[v.jsx(il,{className:"w-4 h-4"}),"Download .md"]})})]})}function t_({level:e}){switch(e){case"success":return v.jsx(rS,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(aS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(_5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(K3,{className:"w-4 h-4 text-blue-400"})}}function n_(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function OL({isOpen:e,onClose:n}){const{logs:i,clearLogs:a,isRunning:s}=po(),[o,u]=Q.useState(!1),[f,h]=Q.useState(250),d=Q.useRef(null);Q.useEffect(()=>{d.current&&!o&&d.current.scrollIntoView({behavior:"smooth"})},[i,o]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const _=x-N.clientY,D=Math.min(Math.max(b+_,100),500);h(D)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:o?40:f},children:[!o&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),s&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:a,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!o),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:o?"Expand":"Minimize",children:o?v.jsx(O3,{className:"w-4 h-4 text-gray-400"}):v.jsx(D3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(s5,{className:"w-4 h-4 text-gray-400"}):v.jsx(r5,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(Em,{className:"w-4 h-4 text-gray-400"})})]})]}),!o&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[i.map(m=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(m.timestamp),"]"]}),v.jsx(t_,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),v.jsx("div",{ref:d})]})})]}):null}function LL(){const{logs:e,clearLogs:n,isRunning:i}=po(),a=Q.useRef(null);return Q.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e]),v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),v.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[e.map(s=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",s.level==="error"&&"bg-red-500/10",s.level==="warning"&&"bg-yellow-500/10",s.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(s.timestamp),"]"]}),v.jsx(t_,{level:s.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",s.level==="error"&&"text-red-400",s.level==="warning"&&"text-yellow-400",s.level==="success"&&"text-green-400",s.level==="info"&&"text-gray-300"),children:s.message}),s.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",s.nodeId.slice(0,8),"]"]}),s.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof s.details=="string"?s.details:JSON.stringify(s.details,null,2)})]})]},s.id)),v.jsx("div",{ref:a})]})})]})}const HL=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],BL=[{id:"sonnet",name:"Claude 4 Sonnet",description:"Fast, cost-efficient"},{id:"opus",name:"Claude 4.5 Opus",description:"Best for complex tasks"},{id:"haiku",name:"Claude 3.5 Haiku",description:"Fastest, for simple tasks"}];function UL(e){switch(e){case"input":return v.jsx(of,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(ho,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(ff,{className:"w-5 h-5 text-cyan-400"});case"mcp":return v.jsx(km,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(sf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function IL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"mcp":return"MCP Server";case"output":return"Output";default:return"Node"}}function qL({node:e}){const{updateNode:n,removeNode:i}=Hi();if(!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(y5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const a=()=>{i(e.id)},s=u=>{n(e.id,{label:u})},o=u=>{n(e.id,{description:u})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:UL(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:IL(e.type)})]})]}),v.jsx("button",{onClick:a,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:u=>s(u.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:u=>o(u.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&v.jsx($L,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="subagent"&&v.jsx(VL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="skill"&&v.jsx(PL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="mcp"&&v.jsx(YL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="output"&&v.jsx(XL,{onUpdate:u=>n(e.id,u)})]})]})}function $L({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>v.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function VL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:BL.map(i=>v.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(ho,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:HL.map(i=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:a=>{const s=a.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(o=>o!==i);n({tools:s})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function PL({data:e,onUpdate:n}){const i=[{id:"ppt-generator",name:"PPT Generator",description:"Create PowerPoint presentations"},{id:"image-gen-nanobanana",name:"Image Generator",description:"Generate images with AI"},{id:"pdf",name:"PDF Processor",description:"Process and create PDF documents"},{id:"xlsx",name:"Excel Processor",description:"Work with spreadsheets"},{id:"docx",name:"Word Processor",description:"Create and edit documents"}];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(a=>v.jsx("button",{onClick:()=>n({skillType:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:i.map(a=>v.jsxs("button",{onClick:()=>n({skillId:a.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===a.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(ff,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:a.name}),v.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.id))})]})]})}function YL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:["stdio","sse"].map(i=>v.jsx("button",{onClick:()=>n({serverType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.serverType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.toUpperCase()},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Name"}),v.jsx("input",{type:"text",value:e.serverName||"",onChange:i=>n({serverName:i.target.value}),placeholder:"e.g., my-mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Command (for stdio)"}),v.jsx("input",{type:"text",value:e.serverConfig?.command||"",onChange:i=>n({serverConfig:{...e.serverConfig,command:i.target.value}}),placeholder:"e.g., npx @anthropic/mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function XL({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>v.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[v.jsx(sf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const FL=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function GL(){const{activeTab:e,setActiveTab:n}=jm(),i=Hi(fS);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:FL.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:Xt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===a.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:a.label},a.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(RL,{}),e==="console"&&v.jsx(LL,{}),e==="step"&&v.jsx(qL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function ZL(e){let n;const{apiMode:i,apiKey:a,proxyUrl:s}=QS.getState(),o={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&a?o["X-API-Key"]=a:i==="proxy"&&s&&(o["X-Proxy-URL"]=s);try{n=await fetch("/api/generate/workflow",{method:"POST",headers:o,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!n.ok){let h=`서버 오류 (${n.status})`;try{h=(await n.json()).message||h}catch{}throw new Error(h)}let u;try{u=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:KL(u),workflowName:u.workflowName}}function QL(e,n){if(e.length===0)return e;const i=300,a=150,s=100,o=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),n.forEach(w=>{const E=u.get(w.target)||[];E.push(w.source),u.set(w.target,E);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const _=d.get(N),D=w.depth+1;(_===void 0||D>_)&&(d.set(N,D),g.push({id:N,depth:D}))})}const m=new Map;d.forEach((w,E)=>{const N=m.get(w)||[];N.push(E),m.set(w,N)});const x=Math.max(...Array.from(d.values()),0),b=new Map;for(let w=0;w<=x;w++){const E=m.get(w)||[],_=(E.length-1)*a,D=o+(300-_)/2;E.forEach((k,C)=>{b.set(k,{x:s+w*i,y:D+C*a})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function KL(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=to();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":n.push({id:h,type:"input",position:{...a},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":n.push({id:h,type:"subagent",position:{...a},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...a},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"mcp":n.push({id:h,type:"mcp",position:{...a},data:{...d,serverType:"stdio",serverName:u.label,serverConfig:{}}});break;case"output":n.push({id:h,type:"output",position:{...a},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=i.get(u.to),h=i.get(u.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const s=e.edges.map(u=>{const f=i.get(u.from),h=i.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:QL(n,s),edges:s}}function JL(){const[e,n]=Q.useState(""),[i,a]=Q.useState(!1),[s,o]=Q.useState(null),{loadWorkflow:u}=Hi(),f=async()=>{if(!(!e.trim()||i)){a(!0),o(null);try{const{workflow:d,workflowName:g}=await ZL(e);u({nodes:d.nodes,edges:d.edges,name:g}),n("")}catch(d){console.error("AI workflow generation failed:",d);const g=d instanceof Error?d.message:"워크플로우 생성에 실패했습니다.";o(g)}finally{a(!1)}}},h=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(ho,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:d=>n(d.target.value),onKeyDown:h,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:i}),v.jsx("button",{onClick:f,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?v.jsx(oS,{className:"w-5 h-5 animate-spin"}):v.jsx(h5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs",children:s?v.jsx("span",{className:"text-red-400",children:s}):i?v.jsx("span",{className:"text-accent",children:"AI가 워크플로우를 생성하고 있습니다..."}):v.jsx("span",{className:"text-gray-600",children:"AI가 워크플로우를 자동 생성합니다"})})]})}function WL(){const{isCollapsed:e,width:n}=jm(),{isRunning:i,logs:a}=po(),[s,o]=Q.useState(!1);return Q.useEffect(()=>{i&&o(!0)},[i]),v.jsx(Ww,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Xz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(Zz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(fj,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(JL,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(GL,{})})]}),v.jsxs("button",{onClick:()=>o(!s),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${s?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${s?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(uf,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),a.length>0&&!s&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:a.length}),i&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(OL,{isOpen:s,onClose:()=>o(!1)})]})})}gE.createRoot(document.getElementById("root")).render(v.jsx(Q.StrictMode,{children:v.jsx(WL,{})}));
|