makecc 0.1.0 → 0.2.0

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.
@@ -0,0 +1,134 @@
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(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
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
+ `),W=M.split(`
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
+ `+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
+ 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&&lt&&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("+",`
10
+ `).replace(`
11
+
12
+ `,`
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(`
16
+ `):[]}}yn=new WeakMap,xn=new WeakMap;mo.NEWLINE_CHARS=new Set([`
17
+ `,"\r"]);mo.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function $5(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 V5(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},a1=(e,n,i)=>{if(e){if(A5(Ic,e))return e;Pt(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 Y5={error:Us,warn:Us,info:Us,debug:Us};let l1=new WeakMap;function Pt(e){const n=e.logger,i=e.logLevel??"off";if(!n)return Y5;const a=l1.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 l1.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?Pt(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 P5(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,vS(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=Em(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 wS({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=Nm(JSON.stringify(s)+`
18
+ `);a.enqueue(u)}catch(s){a.error(s)}},async cancel(){await i.return?.()}})}}async function*P5(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 F5,a=new mo,s=Em(e.body);for await(const o of X5(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*X5(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"?Nm(i):i;let s=new Uint8Array(n.length+a.length);s.set(n),s.set(a,n.length),n=s;let o;for(;(o=V5(n))!==-1;)yield n.slice(0,o),n=n.slice(o)}n.length>0&&(yield n)}class F5{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]=G5(n,":");return s.startsWith(" ")&&(s=s.substring(1)),i==="event"?this.event=s:i==="data"&&this.data.push(s),null}}function G5(e,n){const i=e.indexOf(n);return i!==-1?[e.substring(0,i),n,e.substring(i+n.length)]:[e,"",""]}async function _S(e,n){const{response:i,requestLogID:a,retryOfRequestLogID:s,startTime:o}=n,u=await(async()=>{if(n.options.stream)return Pt(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 kS(m,i)}return await i.text()})();return Pt(e).debug(`[${a}] response parsed`,Zr({retryOfRequestLogID:s,url:i.url,status:i.status,body:u,durationMs:Date.now()-o})),u}function kS(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 hf extends Promise{constructor(n,i,a=_S){super(s=>{s(null)}),this.responsePromise=i,this.parseResponse=a,Is.set(this,void 0),ge(this,Is,n)}_thenUnwrap(n){return new hf(ne(this,Is,"f"),this.responsePromise,async(i,a)=>kS(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 ES{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 Z5 extends hf{constructor(n,i,a){super(n,i,async(s,o)=>new a(s,o.response,await _S(s,o),o.options))}async*[Symbol.asyncIterator](){const n=await this;for await(const i of n)yield i}}class go extends ES{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:{...$p(this.options.query),before_id:i}}:null}const n=this.last_id;return n?{...this.options,query:{...$p(this.options.query),after_id:n}}:null}}class NS extends ES{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:{...$p(this.options.query),page:n}}:null}}const CS=()=>{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 CS(),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 MS=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Cm=async(e,n)=>({...e,body:await K5(e.body,n)}),s1=new WeakMap;function Q5(e){const n=typeof e=="function"?e:e.fetch,i=s1.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 s1.set(n,a),a}const K5=async(e,n)=>{if(!await Q5(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])=>Vp(i,a,s))),i},J5=e=>e instanceof Blob&&"name"in e,Vp=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(MS(i))e.append(n,al([await new Response(SS(i)).blob()],Nc(i)));else if(J5(i))e.append(n,al([i],Nc(i),{type:i.type}));else if(Array.isArray(i))await Promise.all(i.map(a=>Vp(e,n+"[]",a)));else if(typeof i=="object")await Promise.all(Object.entries(i).map(([a,s])=>Vp(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`)}},TS=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",W5=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&TS(e),ez=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function tz(e,n,i){if(CS(),e=await e,n||(n=Nc(e)),W5(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(ez(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(TS(e))n.push(e instanceof Blob?e:await e.arrayBuffer());else if(MS(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}`:""}${nz(e)}`)}return n}function nz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(i=>`"${i}"`).join(", ")}]`}class Fn{constructor(n){this._client=n}}const AS=Symbol.for("brand.privateNullableHeaders");function*iz(e){if(!e)return;if(AS 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():Jb(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=Jb(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 iz(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{[AS]:!0,values:n,nulls:i}};function zS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const o1=Object.freeze(Object.create(null)),rz=(e=zS)=>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??o1)??o1)?.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),N="^".repeat(b.length);return g=b.start+b.length,x+w+N},"");throw new Te(`Path parameters result in path with invalid segments:
20
+ ${o.map(x=>x.error).join(`
21
+ `)}
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:
24
+ 1. Task Overview
25
+ The user's core request and success criteria
26
+ Any clarifications or constraints they specified
27
+ 2. Current State
28
+ What has been completed so far
29
+ Files created, modified, or analyzed (with paths if relevant)
30
+ Key outputs or artifacts produced
31
+ 3. Important Discoveries
32
+ Technical constraints or requirements uncovered
33
+ Decisions made and their rationale
34
+ Errors encountered and how they were resolved
35
+ What approaches were tried that didn't work (and why)
36
+ 4. Next Steps
37
+ Specific actions needed to complete the task
38
+ Any blockers or open questions to resolve
39
+ Priority order if multiple steps remain
40
+ 5. Context to Preserve
41
+ User preferences or style requirements
42
+ Domain-specific details that aren't obvious
43
+ Any promises made to the user
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,Pr,Mt,Es,gn,ji,xr,Ns,p1,Pp;function m1(){let e,n;return{promise:new Promise((a,s)=>{e=a,n=s}),resolve:e,reject:n}}class HS{constructor(n,i,a){ks.add(this),this.client=n,Fa.set(this,!1),Pr.set(this,!1),Mt.set(this,void 0),Es.set(this,void 0),gn.set(this,void 0),ji.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,m1())}async*[(Fa=new WeakMap,Pr=new WeakMap,Mt=new WeakMap,Es=new WeakMap,gn=new WeakMap,ji=new WeakMap,xr=new WeakMap,Ns=new WeakMap,ks=new WeakSet,p1=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??uz;if(a<s)return!1;const o=i.model??ne(this,Mt,"f").params.model,u=i.summaryPrompt??cz,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,Pr,!0),ge(this,ji,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,Pr,!1,"f"),ge(this,ji,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",p1).call(this)){if(!ne(this,Pr,"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",Pp).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Pr,"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,m1()),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,Pr,!0),ge(this,ji,void 0)}async generateToolResponse(){const n=await ne(this,gn,"f")??this.params.messages.at(-1);return n?ne(this,ks,"m",Pp).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)}}Pp=async function(n){return ne(this,ji,"f")!==void 0?ne(this,ji,"f"):(ge(this,ji,fz(ne(this,Mt,"f").params,n)),ne(this,ji,"f"))};async function fz(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 pf{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 pf(Em(n.body),i)}}let BS=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)=>pf.fromResponse(f.response,f.controller))}};const g1={"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 mf=class extends Fn{constructor(){super(...arguments),this.batches=new BS(this._client)}create(n,i){const{betas:a,...s}=n;s.model in g1&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${g1[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=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=RS[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 w1={"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"};Tm.Batches=qS;class $S 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 dz={};const mc=e=>{if(typeof globalThis.process<"u")return dz?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Xp,Am,Cc,VS;const hz="\\n\\nHuman:",pz="\\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}={}){Xp.add(this),Cc.set(this,void 0);const o={apiKey:i,authToken:a,...s,baseURL:n||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&j5())throw new Te(`It looks like you're running in a browser-like environment.
48
+
49
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
50
+ If you understand the risks and have appropriate mitigations in place,
51
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
52
+
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(`
55
+
56
+ ---
57
+
58
+ `)}async function bz(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 vz(e,n,i){const a=e.data;if(!gz())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 mz(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 wz(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
+
60
+ Category: ${a.category||"general"}
61
+ Skill ID: ${a.skillId||"custom-skill"}
62
+
63
+ ## Description
64
+ ${a.description||"Custom skill"}
65
+
66
+ ## Input
67
+ ${n}
68
+
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 Sz(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
+
72
+ Server: ${a.serverName||"mcp-server"}
73
+ Type: ${a.serverType||"stdio"}
74
+
75
+ ## Input
76
+ ${n}
77
+
78
+ ## Configuration
79
+ ${JSON.stringify(a.serverConfig||{},null,2)}
80
+
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 _z(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
+
84
+ ## Result
85
+ ${n}
86
+
87
+ ## Output Type
88
+ ${a.outputType||"auto"}
89
+
90
+ ## Generated at
91
+ ${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),s}async function kz(e,n,i){const a={results:new Map,cancelled:!1},s=yz(e,n);i.onLog("info",`Starting workflow execution with ${s.length} nodes`);for(const o of s){i.onNodeStart(o.id);try{const u=xz(o.id,n,a.results);let f;switch(o.type){case"input":f=await bz(o,i);break;case"subagent":f=await vz(o,u,i);break;case"skill":f=await wz(o,u,i);break;case"mcp":f=await Sz(o,u,i);break;case"output":f=await _z(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 PS(){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]=K.useState([]),N=K.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),o(),w([]),m("info",`워크플로우 "${i}" 실행 시작...`);try{const j=await kz(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 j){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(j){const k=j instanceof Error?j.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,n,i,m,x,o,u,a,f,h,d,g]),E=K.useCallback((j,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=j,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${j}`)},[m]),_=K.useCallback(()=>{b.forEach(j=>{E(j.name,j.content)})},[b,E]);return{isRunning:s,execute:N,generatedFiles:b,downloadFile:E,downloadAllFiles:_}}function Ez(e,n,i,a="local"){const s=a==="global"?"~/.claude":".claude",o=Nz(n,s),u=Cz(n,s),f=Mz(e,n,i,s),h=Tz(n);return{skills:o,commands:f,agents:u,mcpSettings:h}}function Nz(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=Az(s);return{name:o,path:u,content:f}})}function Cz(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=zz(s);return{name:o,path:u,content:f}})}function Mz(e,n,i,a){if(n.length===0)return[];const s=yl(e),o=`${a}/commands/${s}.md`,u=Dz(e,n,i);return[{name:s,path:o,content:u}]}function Tz(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 Az(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 zz(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 Dz(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=jz(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 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:`
95
+ flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
96
+ ${u?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
97
+ `,children:[v.jsx(Sm,{className:"w-4 h-4"}),u?"Running...":"Run"]}),v.jsxs("button",{onClick:x,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:N,disabled:a.length===0,className:`
98
+ flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
99
+ ${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(a5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(sS,{className:"w-5 h-5 text-gray-400"})})]}),g&&v.jsx(Hz,{isOpen:h,onClose:b,config:g})]})}const Uz=[{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(_m,{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 Iz(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 qz(){const e=Hi(i=>i.addNode),n=i=>{const a=Iz(i);e(a)};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:Uz.map(i=>v.jsxs("button",{onClick:()=>n(i.type),className:`
101
+ flex items-center gap-2 px-4 py-2 rounded-lg
102
+ bg-surface border border-border
103
+ ${i.hoverColor}
104
+ transition-all duration-200
105
+ 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=`
108
+ `;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 JR(e,n){const i=n.value?n.value+`
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 WR(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function eO(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function tO(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 nO(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 iO(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function w2(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 rO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return w2(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 aO(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 lO(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 sO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return w2(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 oO(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 uO(e,n,i){const a=e.all(n),s=i?cO(i):S2(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
+ `}),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 cO(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=S2(i[a])}return n}function S2(e){const n=e.spread;return n??e.children.length>1}function fO(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 dO(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function hO(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function pO(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function mO(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=Rm(n.children[1]),h=t2(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 gO(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 yO(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const V1=9,Y1=32;function xO(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),s=0;const o=[];for(;a;)o.push(P1(n.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=i.exec(n);return o.push(P1(n.slice(s),s>0,!1)),o.join("")}function P1(e,n,i){let a=0,s=e.length;if(n){let o=e.codePointAt(a);for(;o===V1||o===Y1;)a++,o=e.codePointAt(a)}if(i){let o=e.codePointAt(s-1);for(;o===V1||o===Y1;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function bO(e,n){const i={type:"text",value:xO(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function vO(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const wO={blockquote:QR,break:KR,code:JR,delete:WR,emphasis:eO,footnoteReference:tO,heading:nO,html:iO,imageReference:rO,image:aO,inlineCode:lO,linkReference:sO,link:oO,listItem:uO,list:fO,paragraph:dO,root:hO,strong:pO,table:mO,tableCell:yO,tableRow:gO,text:bO,thematicBreak:vO,toml:yc,yaml:yc,definition:yc,footnoteDefinition:yc};function yc(){}const _2=-1,xf=0,Ps=1,Yc=2,qm=3,$m=4,Vm=5,Ym=6,k2=7,E2=8,X1=typeof self=="object"?self:globalThis,SO=(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 xf:case _2:return i(u,s);case Ps:{const f=i([],s);for(const h of u)f.push(a(h));return f}case Yc:{const f=i({},s);for(const[h,d]of u)f[a(h)]=a(d);return f}case qm:return i(new Date(u),s);case $m:{const{source:f,flags:h}=u;return i(new RegExp(f,h),s)}case Vm:{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 k2:{const{name:f,message:h}=u;return i(new X1[f](h),s)}case E2: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 X1[o](u),s)};return a},F1=e=>SO(new Map,e)(0),Za="",{toString:_O}={},{keys:kO}=Object,Os=e=>{const n=typeof e;if(n!=="object"||!e)return[xf,n];const i=_O.call(e).slice(8,-1);switch(i){case"Array":return[Ps,Za];case"Object":return[Yc,Za];case"Date":return[qm,Za];case"RegExp":return[$m,Za];case"Map":return[Vm,Za];case"Set":return[Ym,Za];case"DataView":return[Ps,i]}return i.includes("Array")?[Ps,i]:i.includes("Error")?[k2,i]:[Yc,i]},xc=([e,n])=>e===xf&&(n==="function"||n==="symbol"),EO=(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 xf:{let g=u;switch(h){case"bigint":f=E2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([_2],u)}return s([f,g],u)}case Ps:{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 Yc:{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 kO(u))(e||!xc(Os(u[x])))&&g.push([o(x),o(u[x])]);return m}case qm:return s([f,u.toISOString()],u);case $m:{const{source:g,flags:m}=u;return s([f,{source:g,flags:m}],u)}case Vm:{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},G1=(e,{json:n,lossy:i}={})=>{const a=[];return EO(!(n||i),!!n,new Map,a)(e),a},Pc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?F1(G1(e,n)):structuredClone(e):(e,n)=>F1(G1(e,n));function NO(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 CO(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function MO(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||NO,a=e.options.footnoteBackLabel||CO,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=[],N=e.footnoteCounts.get(m);for(;N!==void 0&&++b<=N;){w.length>0&&w.push({type:"text",value:" "});let j=typeof i=="string"?i:i(h,b);typeof j=="string"&&(j={type:"text",value:j}),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(j)?j:[j]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const j=E.children[E.children.length-1];j&&j.type==="text"?j.value+=" ":E.children.push({type:"text",value:" "}),E.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:{...Pc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
114
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
115
+ `}]}}const bf=(function(e){if(e==null)return DO;if(typeof e=="function")return vf(e);if(typeof e=="object")return Array.isArray(e)?TO(e):AO(e);if(typeof e=="string")return zO(e);throw new Error("Expected function, string, or object as test")});function TO(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=bf(e[i]);return vf(a);function a(...s){let o=-1;for(;++o<n.length;)if(n[o].apply(this,s))return!0;return!1}}function AO(e){const n=e;return vf(i);function i(a){const s=a;let o;for(o in e)if(s[o]!==n[o])return!1;return!0}}function zO(e){return vf(n);function n(i){return i&&i.type===e}}function vf(e){return n;function n(i,a,s){return!!(jO(i)&&e.call(this,i,typeof a=="number"?a:void 0,s||void 0))}}function DO(){return!0}function jO(e){return e!==null&&typeof e=="object"&&"type"in e}const N2=[],RO=!0,Wp=!1,OO="skip";function C2(e,n,i,a){let s;typeof n=="function"&&typeof i!="function"?(a=i,i=n):s=n;const o=bf(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=N2,w,N,E;if((!n||o(h,d,g[g.length-1]||void 0))&&(b=LO(i(h,g)),b[0]===Wp))return b;if("children"in h&&h.children){const _=h;if(_.children&&b[0]!==OO)for(N=(a?_.children.length:-1)+u,E=g.concat(_);N>-1&&N<_.children.length;){const j=_.children[N];if(w=f(j,N,E)(),w[0]===Wp)return w;N=typeof w[1]=="number"?w[1]:N+u}}return b}}}function LO(e){return Array.isArray(e)?e:typeof e=="number"?[RO,e]:e==null?N2:[e]}function Pm(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),C2(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 em={}.hasOwnProperty,HO={};function BO(e,n){const i=n||HO,a=new Map,s=new Map,o=new Map,u={...wO,...i.handlers},f={all:d,applyData:IO,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:i,patch:UO,wrap:$O};return Pm(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(em.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:N,...E}=g,_=Pc(E);return _.children=f.all(g),_}return Pc(g)}return(f.options.unknownHandler||qO)(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=Z1(w.value)),!Array.isArray(w)&&w.type==="element")){const N=w.children[0];N&&N.type==="text"&&(N.value=Z1(N.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function UO(e,n){e.position&&(n.position=CD(e))}function IO(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,Pc(o)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function qO(e,n){const i=n.data||{},a="value"in n&&!(em.call(i,"hProperties")||em.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 $O(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
116
+ `});++a<e.length;)a&&i.push({type:"text",value:`
117
+ `}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
118
+ `}),i}function Z1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function Q1(e,n){const i=BO(e,n),a=i.one(e,void 0),s=MO(i),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
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?z2:X6))),d(),h}}function X6(e,n,i){return n===0?e:z2(e,n,i)}function z2(e,n,i){return(i?"":" ")+e}const F6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];D2.peek=J6;function G6(){return{canContainEols:["delete"],enter:{strikethrough:Q6},exit:{strikethrough:K6}}}function Z6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:F6}],handlers:{delete:D2}}}function Q6(e){this.enter({type:"delete",children:[]},e)}function K6(e){this.exit(e)}function D2(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 J6(){return"~"}function W6(e){return e.length}function e8(e,n){const i=n||{},a=(i.align||[]).concat(),s=i.stringLength||W6,o=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const N=[],E=[];let _=-1;for(e[g].length>d&&(d=e[g].length);++_<e[g].length;){const j=t8(e[g][_]);if(i.alignDelimiters!==!1){const k=s(j);E[_]=k,(h[_]===void 0||k>h[_])&&(h[_]=k)}N.push(j)}u[g]=N,f[g]=E}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)o[m]=lv(a[m]);else{const N=lv(a);for(;++m<d;)o[m]=N}m=-1;const x=[],b=[];for(;++m<d;){const N=o[m];let E="",_="";N===99?(E=":",_=":"):N===108?E=":":N===114&&(_=":");let j=i.alignDelimiters===!1?1:Math.max(1,h[m]-E.length-_.length);const k=E+"-".repeat(j)+_;i.alignDelimiters!==!1&&(j=E.length+j+_.length,j>h[m]&&(h[m]=j),b[m]=j),x[m]=k}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const N=u[g],E=f[g];m=-1;const _=[];for(;++m<d;){const j=N[m]||"";let k="",C="";if(i.alignDelimiters!==!1){const L=h[m]-(E[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&&j==="")&&(i.delimiterStart!==!1||m)&&_.push(" "),i.alignDelimiters!==!1&&_.push(k),_.push(j),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(`
121
+ `)}function t8(e){return e==null?"":String(e)}function lv(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 n8(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()),i8);return s(),u}function i8(e,n,i){return">"+(i?"":" ")+e}function r8(e,n){return sv(e,n.inConstruct,!0)&&!sv(e,n.notInConstruct,!1)}function sv(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 ov(e,n,i,a){let s=-1;for(;++s<i.unsafe.length;)if(i.unsafe[s].character===`
122
+ `&&r8(i.stack,i.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
123
+ `}function a8(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 l8(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 s8(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 o8(e,n,i,a){const s=s8(i),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(l8(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(o,u8);return m(),x}const f=i.createTracker(a),h=s.repeat(Math.max(a8(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
+ `,encode:["`"],...f.current()})),m()}return g+=f.move(`
125
+ `),o&&(g+=f.move(o+`
126
+ `)),g+=f.move(h),d(),g}function u8(e,n,i){return(i?"":" ")+e}function Fm(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 c8(e,n,i,a){const s=Fm(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?" ":`
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 f8(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}}j2.peek=d8;function j2(e,n,i,a){const s=f8(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 d8(e,n,i){return i.options.emphasis||"*"}function h8(e,n){let i=!1;return Pm(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return i=!0,Wp}),!!((!e.depth||e.depth<3)&&Bm(e)&&(n.options.setext||i))}function p8(e,n,i,a){const s=Math.max(Math.min(6,e.depth||1),1),o=i.createTracker(a);if(h8(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...o.current(),before:`
128
+ `,after:`
129
+ `});return m(),g(),x+`
130
+ `+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
131
+ `))+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}R2.peek=m8;function R2(e){return e.value||""}function m8(){return"<"}O2.peek=g8;function O2(e,n,i,a){const s=Fm(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 g8(){return"!"}L2.peek=y8;function L2(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 y8(){return"!"}H2.peek=x8;function H2(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 x8(){return"`"}function B2(e,n){const i=Bm(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))}U2.peek=b8;function U2(e,n,i,a){const s=Fm(i),o=s==='"'?"Quote":"Apostrophe",u=i.createTracker(a);let f,h;if(B2(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 b8(e,n,i){return B2(e,i)?"<":"["}I2.peek=v8;function I2(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 v8(){return"["}function Gm(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 w8(e){const n=Gm(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 S8(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 q2(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 _8(e,n,i,a){const s=i.enter("list"),o=i.bulletCurrent;let u=e.ordered?S8(i):Gm(i);const f=e.ordered?u==="."?")":".":w8(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),q2(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 k8(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 E8(e,n,i,a){const s=k8(i);let o=i.bulletCurrent||Gm(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 N8(e,n,i,a){const s=i.enter("paragraph"),o=i.enter("phrasing"),u=i.containerPhrasing(e,a);return o(),s(),u}const C8=bf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function M8(e,n,i,a){return(e.children.some(function(u){return C8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,a)}function T8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}$2.peek=A8;function $2(e,n,i,a){const s=T8(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 A8(e,n,i){return i.options.strong||"*"}function z8(e,n,i,a){return i.safe(e.value,a)}function D8(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 j8(e,n,i){const a=(q2(i)+(i.options.ruleSpaces?" ":"")).repeat(D8(i));return i.options.ruleSpaces?a.slice(0,-1):a}const V2={blockquote:n8,break:ov,code:o8,definition:c8,emphasis:j2,hardBreak:ov,heading:p8,html:R2,image:O2,imageReference:L2,inlineCode:H2,link:U2,linkReference:I2,list:_8,listItem:E8,paragraph:N8,root:M8,strong:$2,text:z8,thematicBreak:j8};function R8(){return{enter:{table:O8,tableData:uv,tableHeader:uv,tableRow:H8},exit:{codeText:B8,table:L8,tableData:_p,tableHeader:_p,tableRow:_p}}}function O8(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 L8(e){this.exit(e),this.data.inTable=void 0}function H8(e){this.enter({type:"tableRow",children:[]},e)}function _p(e){this.exit(e)}function uv(e){this.enter({type:"tableCell",children:[]},e)}function B8(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,U8));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function U8(e,n){return n==="|"?n:e}function I8(e){const n=e||{},i=n.tableCellPadding,a=n.tablePipeAlign,s=n.stringLength,o=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
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,E){return d(g(b,N,E),b.align)}function f(b,w,N,E){const _=m(b,N,E),j=d([_]);return j.slice(0,j.indexOf(`
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,{})}));