makecc 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-CXXgu628.css +1 -0
- package/dist/client/assets/index-PJfSWqWr.js +150 -0
- package/dist/client/index.html +3 -3
- package/dist/server/index.js +30 -0
- package/package.json +1 -1
- package/server/index.ts +39 -0
- package/dist/client/assets/index-oO8rpFoq.js +0 -150
- package/dist/client/assets/index-v9IFpWkA.css +0 -1
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function pf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rp={exports:{}},Co={};var yb;function fN(){if(yb)return Co;yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var f in a)f!=="key"&&(l[f]=a[f])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return Co.Fragment=t,Co.jsx=n,Co.jsxs=n,Co}var xb;function dN(){return xb||(xb=1,rp.exports=fN()),rp.exports}var v=dN(),sp={exports:{}},Te={};var bb;function hN(){if(bb)return Te;bb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,N={};function _(O,V,M){this.props=O,this.context=V,this.refs=N,this.updater=M||w}_.prototype.isReactComponent={},_.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,V,"setState")},_.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function z(){}z.prototype=_.prototype;function E(O,V,M){this.props=O,this.context=V,this.refs=N,this.updater=M||w}var C=E.prototype=new z;C.constructor=E,k(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var B={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Z(O,V,M){var ie=M.ref;return{$$typeof:e,type:O,key:V,ref:ie!==void 0?ie:null,props:M}}function H(O,V){return Z(O.type,V,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function P(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(M){return V[M]})}var te=/\/+/g;function D(O,V){return typeof O=="object"&&O!==null&&O.key!=null?P(""+O.key):V.toString(36)}function U(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(A,A):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function R(O,V,M,ie,ce){var fe=typeof O;(fe==="undefined"||fe==="boolean")&&(O=null);var he=!1;if(O===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(O.$$typeof){case e:case t:he=!0;break;case g:return he=O._init,R(he(O._payload),V,M,ie,ce)}}if(he)return ce=ce(O),he=ie===""?"."+D(O,0):ie,L(ce)?(M="",he!=null&&(M=he.replace(te,"$&/")+"/"),R(ce,V,M,"",function(Ee){return Ee})):ce!=null&&($(ce)&&(ce=H(ce,M+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),V.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(O))for(var me=0;me<O.length;me++)ie=O[me],fe=ue+D(ie,me),he+=R(ie,V,M,fe,ce);else if(me=b(O),typeof me=="function")for(O=me.call(O),me=0;!(ie=O.next()).done;)ie=ie.value,fe=ue+D(ie,me++),he+=R(ie,V,M,fe,ce);else if(fe==="object"){if(typeof O.then=="function")return R(U(O),V,M,ie,ce);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return he}function I(O,V,M){if(O==null)return O;var ie=[],ce=0;return R(O,ie,"","",function(fe){return V.call(M,fe,ce++)}),ie}function F(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(M){(O._status===0||O._status===-1)&&(O._status=1,O._result=M)},function(M){(O._status===0||O._status===-1)&&(O._status=2,O._result=M)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var K=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},j={map:I,forEach:function(O,V,M){I(O,function(){V.apply(this,arguments)},M)},count:function(O){var V=0;return I(O,function(){V++}),V},toArray:function(O){return I(O,function(V){return V})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Te.Activity=m,Te.Children=j,Te.Component=_,Te.Fragment=n,Te.Profiler=a,Te.PureComponent=E,Te.StrictMode=r,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Te.__COMPILER_RUNTIME={__proto__:null,c:function(O){return B.H.useMemoCache(O)}},Te.cache=function(O){return function(){return O.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(O,V,M){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ie=k({},O.props),ce=O.key;if(V!=null)for(fe in V.key!==void 0&&(ce=""+V.key),V)!G.call(V,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&V.ref===void 0||(ie[fe]=V[fe]);var fe=arguments.length-2;if(fe===1)ie.children=M;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return Z(O.type,ce,ie)},Te.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Te.createElement=function(O,V,M){var ie,ce={},fe=null;if(V!=null)for(ie in V.key!==void 0&&(fe=""+V.key),V)G.call(V,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=V[ie]);var he=arguments.length-2;if(he===1)ce.children=M;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(O&&O.defaultProps)for(ie in he=O.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return Z(O,fe,ce)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(O){return{$$typeof:f,render:O}},Te.isValidElement=$,Te.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:F}},Te.memo=function(O,V){return{$$typeof:h,type:O,compare:V===void 0?null:V}},Te.startTransition=function(O){var V=B.T,M={};B.T=M;try{var ie=O(),ce=B.S;ce!==null&&ce(M,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,K)}catch(fe){K(fe)}finally{V!==null&&M.types!==null&&(V.types=M.types),B.T=V}},Te.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Te.use=function(O){return B.H.use(O)},Te.useActionState=function(O,V,M){return B.H.useActionState(O,V,M)},Te.useCallback=function(O,V){return B.H.useCallback(O,V)},Te.useContext=function(O){return B.H.useContext(O)},Te.useDebugValue=function(){},Te.useDeferredValue=function(O,V){return B.H.useDeferredValue(O,V)},Te.useEffect=function(O,V){return B.H.useEffect(O,V)},Te.useEffectEvent=function(O){return B.H.useEffectEvent(O)},Te.useId=function(){return B.H.useId()},Te.useImperativeHandle=function(O,V,M){return B.H.useImperativeHandle(O,V,M)},Te.useInsertionEffect=function(O,V){return B.H.useInsertionEffect(O,V)},Te.useLayoutEffect=function(O,V){return B.H.useLayoutEffect(O,V)},Te.useMemo=function(O,V){return B.H.useMemo(O,V)},Te.useOptimistic=function(O,V){return B.H.useOptimistic(O,V)},Te.useReducer=function(O,V,M){return B.H.useReducer(O,V,M)},Te.useRef=function(O){return B.H.useRef(O)},Te.useState=function(O){return B.H.useState(O)},Te.useSyncExternalStore=function(O,V,M){return B.H.useSyncExternalStore(O,V,M)},Te.useTransition=function(){return B.H.useTransition()},Te.version="19.2.3",Te}var vb;function wl(){return vb||(vb=1,sp.exports=hN()),sp.exports}var X=wl();const Ko=pf(X);var ap={exports:{}},To={},op={exports:{}},lp={};var wb;function pN(){return wb||(wb=1,(function(e){function t(R,I){var F=R.length;R.push(I);e:for(;0<F;){var K=F-1>>>1,j=R[K];if(0<a(j,I))R[K]=I,R[F]=j,F=K;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var I=R[0],F=R.pop();if(F!==I){R[0]=F;e:for(var K=0,j=R.length,O=j>>>1;K<O;){var V=2*(K+1)-1,M=R[V],ie=V+1,ce=R[ie];if(0>a(M,F))ie<j&&0>a(ce,M)?(R[K]=ce,R[ie]=F,K=ie):(R[K]=M,R[V]=F,K=V);else if(ie<j&&0>a(ce,F))R[K]=ce,R[ie]=F,K=ie;else break e}}return I}function a(R,I){var F=R.sortIndex-I.sortIndex;return F!==0?F:R.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var d=[],h=[],g=1,m=null,x=3,b=!1,w=!1,k=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function C(R){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=R)r(h),I.sortIndex=I.expirationTime,t(d,I);else break;I=n(h)}}function L(R){if(k=!1,C(R),!w)if(n(d)!==null)w=!0,A||(A=!0,P());else{var I=n(h);I!==null&&U(L,I.startTime-R)}}var A=!1,B=-1,G=5,Z=-1;function H(){return N?!0:!(e.unstable_now()-Z<G)}function $(){if(N=!1,A){var R=e.unstable_now();Z=R;var I=!0;try{e:{w=!1,k&&(k=!1,z(B),B=-1),b=!0;var F=x;try{t:{for(C(R),m=n(d);m!==null&&!(m.expirationTime>R&&H());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var j=K(m.expirationTime<=R);if(R=e.unstable_now(),typeof j=="function"){m.callback=j,C(R),I=!0;break t}m===n(d)&&r(d),C(R)}else r(d);m=n(d)}if(m!==null)I=!0;else{var O=n(h);O!==null&&U(L,O.startTime-R),I=!1}}break e}finally{m=null,x=F,b=!1}I=void 0}}finally{I?P():A=!1}}}var P;if(typeof E=="function")P=function(){E($)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,D=te.port2;te.port1.onmessage=$,P=function(){D.postMessage(null)}}else P=function(){_($,0)};function U(R,I){B=_(function(){R(e.unstable_now())},I)}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(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(R){switch(x){case 1:case 2:case 3:var I=3;break;default:I=x}var F=x;x=I;try{return R()}finally{x=F}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(R,I){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var F=x;x=R;try{return I()}finally{x=F}},e.unstable_scheduleCallback=function(R,I,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,R){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=F+j,R={id:g++,callback:I,priorityLevel:R,startTime:F,expirationTime:j,sortIndex:-1},F>K?(R.sortIndex=F,t(h,R),n(d)===null&&R===n(h)&&(k?(z(B),B=-1):k=!0,U(L,F-K))):(R.sortIndex=j,t(d,R),w||b||(w=!0,A||(A=!0,P()))),R},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(R){var I=x;return function(){var F=x;x=I;try{return R.apply(this,arguments)}finally{x=F}}}})(lp)),lp}var Sb;function mN(){return Sb||(Sb=1,op.exports=pN()),op.exports}var up={exports:{}},qt={};var _b;function gN(){if(_b)return qt;_b=1;var e=wl();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(d,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qt.createPortal=function(d,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(d,h,null,g)},qt.flushSync=function(d){var h=u.T,g=r.p;try{if(u.T=null,r.p=2,d)return d()}finally{u.T=h,r.p=g,r.d.f()}},qt.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},qt.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},qt.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var g=h.as,m=f(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(d,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},qt.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},qt.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=f(g,h.crossOrigin);r.d.L(d,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},qt.preloadModule=function(d,h){if(typeof d=="string")if(h){var g=f(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},qt.requestFormReset=function(d){r.d.r(d)},qt.unstable_batchedUpdates=function(d,h){return d(h)},qt.useFormState=function(d,h,g){return u.H.useFormState(d,h,g)},qt.useFormStatus=function(){return u.H.useHostTransitionStatus()},qt.version="19.2.3",qt}var kb;function rw(){if(kb)return up.exports;kb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),up.exports=gN(),up.exports}var Eb;function yN(){if(Eb)return To;Eb=1;var e=mN(),t=wl(),n=rw();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(l(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,c=s;;){var p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return d(p),i;if(y===c)return d(p),s;y=y.sibling}throw Error(r(188))}if(o.return!==c.return)o=p,c=y;else{for(var S=!1,T=p.child;T;){if(T===o){S=!0,o=p,c=y;break}if(T===c){S=!0,c=p,o=y;break}T=T.sibling}if(!S){for(T=y.child;T;){if(T===o){S=!0,o=y,c=p;break}if(T===c){S=!0,c=y,o=p;break}T=T.sibling}if(!S)throw Error(r(189))}}if(o.alternate!==c)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function g(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=g(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),E=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var te=Symbol.for("react.client.reference");function D(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===te?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case k:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case E:return i.displayName||"Context";case z:return(i._context.displayName||"Context")+".Consumer";case C:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case B:return s=i.displayName||null,s!==null?s:D(i.type)||"Memo";case G:s=i._payload,i=i._init;try{return D(i(s))}catch{}}return null}var U=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},K=[],j=-1;function O(i){return{current:i}}function V(i){0>j||(i.current=K[j],K[j]=null,j--)}function M(i,s){j++,K[j]=i.current,i.current=s}var ie=O(null),ce=O(null),fe=O(null),he=O(null);function ue(i,s){switch(M(fe,s),M(ce,i),M(ie,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Ix(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Ix(s),i=qx(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}V(ie),M(ie,i)}function me(){V(ie),V(ce),V(fe)}function Ee(i){i.memoizedState!==null&&M(he,i);var s=ie.current,o=qx(s,i.type);s!==o&&(M(ce,i),M(ie,o))}function Ce(i){ce.current===i&&(V(ie),V(ce)),he.current===i&&(V(he),_o._currentValue=F)}var we,Ne;function De(i){if(we===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);we=s&&s[1]||"",Ne=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+we+i+Ne}var Qe=!1;function Xe(i,s){if(!i||Qe)return"";Qe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(re){var ee=re}Reflect.construct(i,[],le)}else{try{le.call()}catch(re){ee=re}i.call(le.prototype)}}else{try{throw Error()}catch(re){ee=re}(le=i())&&typeof le.catch=="function"&&le.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],T=y[1];if(S&&T){var q=S.split(`
|
|
4
|
-
`),W=T.split(`
|
|
5
|
-
`);for(p=c=0;c<q.length&&!q[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===q.length||p===W.length)for(c=q.length-1,p=W.length-1;1<=c&&0<=p&&q[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(q[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||q[c]!==W[p]){var ae=`
|
|
6
|
-
`+q[c].replace(" at new "," at ");return i.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",i.displayName)),ae}while(1<=c&&0<=p);break}}}finally{Qe=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?De(o):""}function pt(i,s){switch(i.tag){case 26:case 27:case 5:return De(i.type);case 16:return De("Lazy");case 13:return i.child!==s&&s!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Xe(i.type,!1);case 11:return Xe(i.type.render,!1);case 1:return Xe(i.type,!0);case 31:return De("Activity");default:return""}}function un(i){try{var s="",o=null;do s+=pt(i,o),o=i,i=i.return;while(i);return s}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var Ht=Object.prototype.hasOwnProperty,Qt=e.unstable_scheduleCallback,Bn=e.unstable_cancelCallback,pi=e.unstable_shouldYield,mi=e.unstable_requestPaint,Ct=e.unstable_now,Yi=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,Oe=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,Ft=e.log,Hn=e.unstable_setDisableYieldValue,Rt=null,mt=null;function Ut(i){if(typeof Ft=="function"&&Hn(i),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Rt,i)}catch{}}var Je=Math.clz32?Math.clz32:Yf,Jn=Math.log,cn=Math.LN2;function Yf(i){return i>>>=0,i===0?32:31-(Jn(i)/cn|0)|0}var ps=256,ms=262144,gs=4194304;function gi(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function ys(i,s,o){var c=i.pendingLanes;if(c===0)return 0;var p=0,y=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var T=c&134217727;return T!==0?(c=T&~y,c!==0?p=gi(c):(S&=T,S!==0?p=gi(S):o||(o=T&~i,o!==0&&(p=gi(o))))):(T=c&~y,T!==0?p=gi(T):S!==0?p=gi(S):o||(o=c&~i,o!==0&&(p=gi(o)))),p===0?0:s!==0&&s!==p&&(s&y)===0&&(y=p&-p,o=s&-s,y>=o||y===32&&(o&4194048)!==0)?s:p}function jr(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Xf(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Dl(){var i=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),i}function za(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function Rr(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Gf(i,s,o,c,p,y){var S=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var T=i.entanglements,q=i.expirationTimes,W=i.hiddenUpdates;for(o=S&~o;0<o;){var ae=31-Je(o),le=1<<ae;T[ae]=0,q[ae]=-1;var ee=W[ae];if(ee!==null)for(W[ae]=null,ae=0;ae<ee.length;ae++){var re=ee[ae];re!==null&&(re.lane&=-536870913)}o&=~le}c!==0&&Ll(i,c,0),y!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=y&~(S&~s))}function Ll(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var c=31-Je(s);i.entangledLanes|=s,i.entanglements[c]=i.entanglements[c]|1073741824|o&261930}function Bl(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var c=31-Je(o),p=1<<c;p&s|i[c]&s&&(i[c]|=s),o&=~p}}function Hl(i,s){var o=s&-s;return o=(o&42)!==0?1:Oa(o),(o&(i.suspendedLanes|s))!==0?0:o}function Oa(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Da(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Ul(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:cb(i.type))}function Il(i,s){var o=I.p;try{return I.p=i,s()}finally{I.p=o}}var Wn=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Wn,It="__reactProps$"+Wn,yi="__reactContainer$"+Wn,xs="__reactEvents$"+Wn,ql="__reactListeners$"+Wn,Zf="__reactHandles$"+Wn,$l="__reactResources$"+Wn,zr="__reactMarker$"+Wn;function La(i){delete i[Tt],delete i[It],delete i[xs],delete i[ql],delete i[Zf]}function Xi(i){var s=i[Tt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[yi]||o[Tt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=Gx(i);i!==null;){if(o=i[Tt])return o;i=Gx(i)}return s}i=o,o=i.parentNode}return null}function Gi(i){if(i=i[Tt]||i[yi]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Zi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Qi(i){var s=i[$l];return s||(s=i[$l]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function xt(i){i[zr]=!0}var Pl=new Set,Vl={};function xi(i,s){Ki(i,s),Ki(i+"Capture",s)}function Ki(i,s){for(Vl[i]=s,i=0;i<s.length;i++)Pl.add(s[i])}var Qf=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]*$"),Ba={},Fl={};function Kf(i){return Ht.call(Fl,i)?!0:Ht.call(Ba,i)?!1:Qf.test(i)?Fl[i]=!0:(Ba[i]=!0,!1)}function bs(i,s,o){if(Kf(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function vs(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Un(i,s,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+c)}}function Kt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Yl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Jf(i,s,o){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,y.call(this,S)}}),Object.defineProperty(i,s,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function ws(i){if(!i._valueTracker){var s=Yl(i)?"checked":"value";i._valueTracker=Jf(i,s,""+i[s])}}function Xl(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),c="";return i&&(c=Yl(i)?i.checked?"true":"false":i.value),i=c,i!==o?(s.setValue(i),!0):!1}function Or(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Wf=/[\n"\\]/g;function Jt(i){return i.replace(Wf,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Dr(i,s,o,c,p,y,S,T){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),s!=null?S==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Kt(s)):i.value!==""+Kt(s)&&(i.value=""+Kt(s)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),s!=null?Ha(i,S,Kt(s)):o!=null?Ha(i,S,Kt(o)):c!=null&&i.removeAttribute("value"),p==null&&y!=null&&(i.defaultChecked=!!y),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.name=""+Kt(T):i.removeAttribute("name")}function Gl(i,s,o,c,p,y,S,T){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){ws(i);return}o=o!=null?""+Kt(o):"",s=s!=null?""+Kt(s):o,T||s===i.value||(i.value=s),i.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=T?i.checked:!!c,i.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),ws(i)}function Ha(i,s,o){s==="number"&&Or(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function bi(i,s,o,c){if(i=i.options,s){s={};for(var p=0;p<o.length;p++)s["$"+o[p]]=!0;for(o=0;o<i.length;o++)p=s.hasOwnProperty("$"+i[o].value),i[o].selected!==p&&(i[o].selected=p),p&&c&&(i[o].defaultSelected=!0)}else{for(o=""+Kt(o),s=null,p=0;p<i.length;p++){if(i[p].value===o){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}s!==null||i[p].disabled||(s=i[p])}s!==null&&(s.selected=!0)}}function Dg(i,s,o){if(s!=null&&(s=""+Kt(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Kt(o):""}function Lg(i,s,o,c){if(s==null){if(c!=null){if(o!=null)throw Error(r(92));if(U(c)){if(1<c.length)throw Error(r(93));c=c[0]}o=c}o==null&&(o=""),s=o}o=Kt(s),i.defaultValue=o,c=i.textContent,c===o&&c!==""&&c!==null&&(i.value=c),ws(i)}function Ss(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var ak=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 Bg(i,s,o){var c=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":c?i.setProperty(s,o):typeof o!="number"||o===0||ak.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function Hg(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var p in s)c=s[p],s.hasOwnProperty(p)&&o[p]!==c&&Bg(i,p,c)}else for(var y in s)s.hasOwnProperty(y)&&Bg(i,y,s[y])}function ed(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ok=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"]]),lk=/^[\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 Zl(i){return lk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function vi(){}var td=null;function nd(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var _s=null,ks=null;function Ug(i){var s=Gi(i);if(s&&(i=s.stateNode)){var o=i[It]||null;e:switch(i=s.stateNode,s.type){case"input":if(Dr(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Jt(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var c=o[s];if(c!==i&&c.form===i.form){var p=c[It]||null;if(!p)throw Error(r(90));Dr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<o.length;s++)c=o[s],c.form===i.form&&Xl(c)}break e;case"textarea":Dg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&bi(i,!!o.multiple,s,!1)}}}var id=!1;function Ig(i,s,o){if(id)return i(s,o);id=!0;try{var c=i(s);return c}finally{if(id=!1,(_s!==null||ks!==null)&&(Lu(),_s&&(s=_s,i=ks,ks=_s=null,Ug(s),i)))for(s=0;s<i.length;s++)Ug(i[s])}}function Ua(i,s){var o=i.stateNode;if(o===null)return null;var c=o[It]||null;if(c===null)return null;o=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rd=!1;if(wi)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){rd=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{rd=!1}var Ji=null,sd=null,Ql=null;function qg(){if(Ql)return Ql;var i,s=sd,o=s.length,c,p="value"in Ji?Ji.value:Ji.textContent,y=p.length;for(i=0;i<o&&s[i]===p[i];i++);var S=o-i;for(c=1;c<=S&&s[o-c]===p[y-c];c++);return Ql=p.slice(i,1<c?1-c:void 0)}function Kl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Jl(){return!0}function $g(){return!1}function Wt(i){function s(o,c,p,y,S){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var T in i)i.hasOwnProperty(T)&&(o=i[T],this[T]=o?o(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Jl:$g,this.isPropagationStopped=$g,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),s}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wl=Wt(Lr),qa=m({},Lr,{view:0,detail:0}),uk=Wt(qa),ad,od,$a,eu=m({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ud,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==$a&&($a&&i.type==="mousemove"?(ad=i.screenX-$a.screenX,od=i.screenY-$a.screenY):od=ad=0,$a=i),ad)},movementY:function(i){return"movementY"in i?i.movementY:od}}),Pg=Wt(eu),ck=m({},eu,{dataTransfer:0}),fk=Wt(ck),dk=m({},qa,{relatedTarget:0}),ld=Wt(dk),hk=m({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),pk=Wt(hk),mk=m({},Lr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),gk=Wt(mk),yk=m({},Lr,{data:0}),Vg=Wt(yk),xk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bk={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"},vk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wk(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=vk[i])?!!s[i]:!1}function ud(){return wk}var Sk=m({},qa,{key:function(i){if(i.key){var s=xk[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Kl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?bk[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ud,charCode:function(i){return i.type==="keypress"?Kl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Kl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),_k=Wt(Sk),kk=m({},eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=Wt(kk),Ek=m({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ud}),Nk=Wt(Ek),Ck=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tk=Wt(Ck),Ak=m({},eu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Mk=Wt(Ak),jk=m({},Lr,{newState:0,oldState:0}),Rk=Wt(jk),zk=[9,13,27,32],cd=wi&&"CompositionEvent"in window,Pa=null;wi&&"documentMode"in document&&(Pa=document.documentMode);var Ok=wi&&"TextEvent"in window&&!Pa,Yg=wi&&(!cd||Pa&&8<Pa&&11>=Pa),Xg=" ",Gg=!1;function Zg(i,s){switch(i){case"keyup":return zk.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Es=!1;function Dk(i,s){switch(i){case"compositionend":return Qg(s);case"keypress":return s.which!==32?null:(Gg=!0,Xg);case"textInput":return i=s.data,i===Xg&&Gg?null:i;default:return null}}function Lk(i,s){if(Es)return i==="compositionend"||!cd&&Zg(i,s)?(i=qg(),Ql=sd=Ji=null,Es=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Yg&&s.locale!=="ko"?null:s.data;default:return null}}var Bk={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 Kg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Bk[i.type]:s==="textarea"}function Jg(i,s,o,c){_s?ks?ks.push(c):ks=[c]:_s=c,s=Pu(s,"onChange"),0<s.length&&(o=new Wl("onChange","change",null,o,c),i.push({event:o,listeners:s}))}var Va=null,Fa=null;function Hk(i){Ox(i,0)}function tu(i){var s=Zi(i);if(Xl(s))return i}function Wg(i,s){if(i==="change")return s}var ey=!1;if(wi){var fd;if(wi){var dd="oninput"in document;if(!dd){var ty=document.createElement("div");ty.setAttribute("oninput","return;"),dd=typeof ty.oninput=="function"}fd=dd}else fd=!1;ey=fd&&(!document.documentMode||9<document.documentMode)}function ny(){Va&&(Va.detachEvent("onpropertychange",iy),Fa=Va=null)}function iy(i){if(i.propertyName==="value"&&tu(Fa)){var s=[];Jg(s,Fa,i,nd(i)),Ig(Hk,s)}}function Uk(i,s,o){i==="focusin"?(ny(),Va=s,Fa=o,Va.attachEvent("onpropertychange",iy)):i==="focusout"&&ny()}function Ik(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return tu(Fa)}function qk(i,s){if(i==="click")return tu(s)}function $k(i,s){if(i==="input"||i==="change")return tu(s)}function Pk(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var fn=typeof Object.is=="function"?Object.is:Pk;function Ya(i,s){if(fn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),c=Object.keys(s);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!Ht.call(s,p)||!fn(i[p],s[p]))return!1}return!0}function ry(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function sy(i,s){var o=ry(i);i=0;for(var c;o;){if(o.nodeType===3){if(c=i+o.textContent.length,i<=s&&c>=s)return{node:o,offset:s-i};i=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ry(o)}}function ay(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?ay(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function oy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Or(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Or(i.document)}return s}function hd(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var Vk=wi&&"documentMode"in document&&11>=document.documentMode,Ns=null,pd=null,Xa=null,md=!1;function ly(i,s,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;md||Ns==null||Ns!==Or(c)||(c=Ns,"selectionStart"in c&&hd(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}),Xa&&Ya(Xa,c)||(Xa=c,c=Pu(pd,"onSelect"),0<c.length&&(s=new Wl("onSelect","select",null,s,o),i.push({event:s,listeners:c}),s.target=Ns)))}function Br(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var Cs={animationend:Br("Animation","AnimationEnd"),animationiteration:Br("Animation","AnimationIteration"),animationstart:Br("Animation","AnimationStart"),transitionrun:Br("Transition","TransitionRun"),transitionstart:Br("Transition","TransitionStart"),transitioncancel:Br("Transition","TransitionCancel"),transitionend:Br("Transition","TransitionEnd")},gd={},uy={};wi&&(uy=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Hr(i){if(gd[i])return gd[i];if(!Cs[i])return i;var s=Cs[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in uy)return gd[i]=s[o];return i}var cy=Hr("animationend"),fy=Hr("animationiteration"),dy=Hr("animationstart"),Fk=Hr("transitionrun"),Yk=Hr("transitionstart"),Xk=Hr("transitioncancel"),hy=Hr("transitionend"),py=new Map,yd="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(" ");yd.push("scrollEnd");function In(i,s){py.set(i,s),xi(s,[i])}var nu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},En=[],Ts=0,xd=0;function iu(){for(var i=Ts,s=xd=Ts=0;s<i;){var o=En[s];En[s++]=null;var c=En[s];En[s++]=null;var p=En[s];En[s++]=null;var y=En[s];if(En[s++]=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&&my(o,p,y)}}function ru(i,s,o,c){En[Ts++]=i,En[Ts++]=s,En[Ts++]=o,En[Ts++]=c,xd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function bd(i,s,o,c){return ru(i,s,o,c),su(i)}function Ur(i,s){return ru(i,null,null,s),su(i)}function my(i,s,o){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o);for(var p=!1,y=i.return;y!==null;)y.childLanes|=o,c=y.alternate,c!==null&&(c.childLanes|=o),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(p=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,p&&s!==null&&(p=31-Je(o),i=y.hiddenUpdates,c=i[p],c===null?i[p]=[s]:c.push(s),s.lane=o|536870912),y):null}function su(i){if(50<go)throw go=0,Th=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var As={};function Gk(i,s,o,c){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,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 dn(i,s,o,c){return new Gk(i,s,o,c)}function vd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Si(i,s){var o=i.alternate;return o===null?(o=dn(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function gy(i,s){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function au(i,s,o,c,p,y){var S=0;if(c=i,typeof i=="function")vd(i)&&(S=1);else if(typeof i=="string")S=WE(i,o,ie.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=dn(31,o,s,p),i.elementType=Z,i.lanes=y,i;case k:return Ir(o.children,p,y,s);case N:S=8,p|=24;break;case _:return i=dn(12,o,s,p|2),i.elementType=_,i.lanes=y,i;case L:return i=dn(13,o,s,p),i.elementType=L,i.lanes=y,i;case A:return i=dn(19,o,s,p),i.elementType=A,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:S=10;break e;case z:S=9;break e;case C:S=11;break e;case B:S=14;break e;case G:S=16,c=null;break e}S=29,o=Error(r(130,i===null?"null":typeof i,"")),c=null}return s=dn(S,o,s,p),s.elementType=i,s.type=c,s.lanes=y,s}function Ir(i,s,o,c){return i=dn(7,i,c,s),i.lanes=o,i}function wd(i,s,o){return i=dn(6,i,null,s),i.lanes=o,i}function yy(i){var s=dn(18,null,null,0);return s.stateNode=i,s}function Sd(i,s,o){return s=dn(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var xy=new WeakMap;function Nn(i,s){if(typeof i=="object"&&i!==null){var o=xy.get(i);return o!==void 0?o:(s={value:i,source:s,stack:un(s)},xy.set(i,s),s)}return{value:i,source:s,stack:un(s)}}var Ms=[],js=0,ou=null,Ga=0,Cn=[],Tn=0,Wi=null,ei=1,ti="";function _i(i,s){Ms[js++]=Ga,Ms[js++]=ou,ou=i,Ga=s}function by(i,s,o){Cn[Tn++]=ei,Cn[Tn++]=ti,Cn[Tn++]=Wi,Wi=i;var c=ei;i=ti;var p=32-Je(c)-1;c&=~(1<<p),o+=1;var y=32-Je(s)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,ei=1<<32-Je(s)+p|o<<p|c,ti=y+i}else ei=1<<y|o<<p|c,ti=i}function _d(i){i.return!==null&&(_i(i,1),by(i,1,0))}function kd(i){for(;i===ou;)ou=Ms[--js],Ms[js]=null,Ga=Ms[--js],Ms[js]=null;for(;i===Wi;)Wi=Cn[--Tn],Cn[Tn]=null,ti=Cn[--Tn],Cn[Tn]=null,ei=Cn[--Tn],Cn[Tn]=null}function vy(i,s){Cn[Tn++]=ei,Cn[Tn++]=ti,Cn[Tn++]=Wi,ei=s.id,ti=s.overflow,Wi=i}var zt=null,ot=null,qe=!1,er=null,An=!1,Ed=Error(r(519));function tr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Za(Nn(s,i)),Ed}function wy(i){var s=i.stateNode,o=i.type,c=i.memoizedProps;switch(s[Tt]=i,s[It]=c,o){case"dialog":Be("cancel",s),Be("close",s);break;case"iframe":case"object":case"embed":Be("load",s);break;case"video":case"audio":for(o=0;o<xo.length;o++)Be(xo[o],s);break;case"source":Be("error",s);break;case"img":case"image":case"link":Be("error",s),Be("load",s);break;case"details":Be("toggle",s);break;case"input":Be("invalid",s),Gl(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Be("invalid",s);break;case"textarea":Be("invalid",s),Lg(s,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||c.suppressHydrationWarning===!0||Hx(s.textContent,o)?(c.popover!=null&&(Be("beforetoggle",s),Be("toggle",s)),c.onScroll!=null&&Be("scroll",s),c.onScrollEnd!=null&&Be("scrollend",s),c.onClick!=null&&(s.onclick=vi),s=!0):s=!1,s||tr(i,!0)}function Sy(i){for(zt=i.return;zt;)switch(zt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:zt=zt.return}}function Rs(i){if(i!==zt)return!1;if(!qe)return Sy(i),qe=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Ph(i.type,i.memoizedProps)),o=!o),o&&ot&&tr(i),Sy(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Xx(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Xx(i)}else s===27?(s=ot,mr(i.type)?(i=Gh,Gh=null,ot=i):ot=s):ot=zt?jn(i.stateNode.nextSibling):null;return!0}function qr(){ot=zt=null,qe=!1}function Nd(){var i=er;return i!==null&&(rn===null?rn=i:rn.push.apply(rn,i),er=null),i}function Za(i){er===null?er=[i]:er.push(i)}var Cd=O(null),$r=null,ki=null;function nr(i,s,o){M(Cd,s._currentValue),s._currentValue=o}function Ei(i){i._currentValue=Cd.current,V(Cd)}function Td(i,s,o){for(;i!==null;){var c=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),i===o)break;i=i.return}}function Ad(i,s,o,c){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var T=y;y=p;for(var q=0;q<s.length;q++)if(T.context===s[q]){y.lanes|=o,T=y.alternate,T!==null&&(T.lanes|=o),Td(y.return,o,i),c||(S=null);break e}y=T.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(r(341));S.lanes|=o,y=S.alternate,y!==null&&(y.lanes|=o),Td(S,o,i),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===i){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function zs(i,s,o,c){i=null;for(var p=s,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(r(387));if(S=S.memoizedProps,S!==null){var T=p.type;fn(p.pendingProps.value,S.value)||(i!==null?i.push(T):i=[T])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(_o):i=[_o])}p=p.return}i!==null&&Ad(s,i,o,c),s.flags|=262144}function lu(i){for(i=i.firstContext;i!==null;){if(!fn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Pr(i){$r=i,ki=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ot(i){return _y($r,i)}function uu(i,s){return $r===null&&Pr(i),_y(i,s)}function _y(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},ki===null){if(i===null)throw Error(r(308));ki=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ki=ki.next=s;return o}var Zk=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,c){i.push(c)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},Qk=e.unstable_scheduleCallback,Kk=e.unstable_NormalPriority,bt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new Zk,data:new Map,refCount:0}}function Qa(i){i.refCount--,i.refCount===0&&Qk(Kk,function(){i.controller.abort()})}var Ka=null,jd=0,Os=0,Ds=null;function Jk(i,s){if(Ka===null){var o=Ka=[];jd=0,Os=Oh(),Ds={status:"pending",value:void 0,then:function(c){o.push(c)}}}return jd++,s.then(ky,ky),s}function ky(){if(--jd===0&&Ka!==null){Ds!==null&&(Ds.status="fulfilled");var i=Ka;Ka=null,Os=0,Ds=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function Wk(i,s){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return i.then(function(){c.status="fulfilled",c.value=s;for(var p=0;p<o.length;p++)(0,o[p])(s)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var Ey=R.S;R.S=function(i,s){lx=Ct(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&Jk(i,s),Ey!==null&&Ey(i,s)};var Vr=O(null);function Rd(){var i=Vr.current;return i!==null?i:rt.pooledCache}function cu(i,s){s===null?M(Vr,Vr.current):M(Vr,s.pool)}function Ny(){var i=Rd();return i===null?null:{parent:bt._currentValue,pool:i}}var Ls=Error(r(460)),zd=Error(r(474)),fu=Error(r(542)),du={then:function(){}};function Cy(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ty(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(vi,vi),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,My(i),i;default:if(typeof s.status=="string")s.then(vi,vi);else{if(i=rt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(c){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=c}},function(c){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,My(i),i}throw Yr=s,Ls}}function Fr(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Yr=o,Ls):o}}var Yr=null;function Ay(){if(Yr===null)throw Error(r(459));var i=Yr;return Yr=null,i}function My(i){if(i===Ls||i===fu)throw Error(r(483))}var Bs=null,Ja=0;function hu(i){var s=Ja;return Ja+=1,Bs===null&&(Bs=[]),Ty(Bs,i,s)}function Wa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function pu(i,s){throw s.$$typeof===x?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function jy(i){function s(Q,Y){if(i){var J=Q.deletions;J===null?(Q.deletions=[Y],Q.flags|=16):J.push(Y)}}function o(Q,Y){if(!i)return null;for(;Y!==null;)s(Q,Y),Y=Y.sibling;return null}function c(Q){for(var Y=new Map;Q!==null;)Q.key!==null?Y.set(Q.key,Q):Y.set(Q.index,Q),Q=Q.sibling;return Y}function p(Q,Y){return Q=Si(Q,Y),Q.index=0,Q.sibling=null,Q}function y(Q,Y,J){return Q.index=J,i?(J=Q.alternate,J!==null?(J=J.index,J<Y?(Q.flags|=67108866,Y):J):(Q.flags|=67108866,Y)):(Q.flags|=1048576,Y)}function S(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function T(Q,Y,J,oe){return Y===null||Y.tag!==6?(Y=wd(J,Q.mode,oe),Y.return=Q,Y):(Y=p(Y,J),Y.return=Q,Y)}function q(Q,Y,J,oe){var ve=J.type;return ve===k?ae(Q,Y,J.props.children,oe,J.key):Y!==null&&(Y.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===G&&Fr(ve)===Y.type)?(Y=p(Y,J.props),Wa(Y,J),Y.return=Q,Y):(Y=au(J.type,J.key,J.props,null,Q.mode,oe),Wa(Y,J),Y.return=Q,Y)}function W(Q,Y,J,oe){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==J.containerInfo||Y.stateNode.implementation!==J.implementation?(Y=Sd(J,Q.mode,oe),Y.return=Q,Y):(Y=p(Y,J.children||[]),Y.return=Q,Y)}function ae(Q,Y,J,oe,ve){return Y===null||Y.tag!==7?(Y=Ir(J,Q.mode,oe,ve),Y.return=Q,Y):(Y=p(Y,J),Y.return=Q,Y)}function le(Q,Y,J){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=wd(""+Y,Q.mode,J),Y.return=Q,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return J=au(Y.type,Y.key,Y.props,null,Q.mode,J),Wa(J,Y),J.return=Q,J;case w:return Y=Sd(Y,Q.mode,J),Y.return=Q,Y;case G:return Y=Fr(Y),le(Q,Y,J)}if(U(Y)||P(Y))return Y=Ir(Y,Q.mode,J,null),Y.return=Q,Y;if(typeof Y.then=="function")return le(Q,hu(Y),J);if(Y.$$typeof===E)return le(Q,uu(Q,Y),J);pu(Q,Y)}return null}function ee(Q,Y,J,oe){var ve=Y!==null?Y.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:T(Q,Y,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?q(Q,Y,J,oe):null;case w:return J.key===ve?W(Q,Y,J,oe):null;case G:return J=Fr(J),ee(Q,Y,J,oe)}if(U(J)||P(J))return ve!==null?null:ae(Q,Y,J,oe,null);if(typeof J.then=="function")return ee(Q,Y,hu(J),oe);if(J.$$typeof===E)return ee(Q,Y,uu(Q,J),oe);pu(Q,J)}return null}function re(Q,Y,J,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Q=Q.get(J)||null,T(Y,Q,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Q=Q.get(oe.key===null?J:oe.key)||null,q(Y,Q,oe,ve);case w:return Q=Q.get(oe.key===null?J:oe.key)||null,W(Y,Q,oe,ve);case G:return oe=Fr(oe),re(Q,Y,J,oe,ve)}if(U(oe)||P(oe))return Q=Q.get(J)||null,ae(Y,Q,oe,ve,null);if(typeof oe.then=="function")return re(Q,Y,J,hu(oe),ve);if(oe.$$typeof===E)return re(Q,Y,J,uu(Y,oe),ve);pu(Y,oe)}return null}function ye(Q,Y,J,oe){for(var ve=null,Ge=null,xe=Y,je=Y=0,Ie=null;xe!==null&&je<J.length;je++){xe.index>je?(Ie=xe,xe=null):Ie=xe.sibling;var Ze=ee(Q,xe,J[je],oe);if(Ze===null){xe===null&&(xe=Ie);break}i&&xe&&Ze.alternate===null&&s(Q,xe),Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze,xe=Ie}if(je===J.length)return o(Q,xe),qe&&_i(Q,je),ve;if(xe===null){for(;je<J.length;je++)xe=le(Q,J[je],oe),xe!==null&&(Y=y(xe,Y,je),Ge===null?ve=xe:Ge.sibling=xe,Ge=xe);return qe&&_i(Q,je),ve}for(xe=c(xe);je<J.length;je++)Ie=re(xe,Q,je,J[je],oe),Ie!==null&&(i&&Ie.alternate!==null&&xe.delete(Ie.key===null?je:Ie.key),Y=y(Ie,Y,je),Ge===null?ve=Ie:Ge.sibling=Ie,Ge=Ie);return i&&xe.forEach(function(vr){return s(Q,vr)}),qe&&_i(Q,je),ve}function ke(Q,Y,J,oe){if(J==null)throw Error(r(151));for(var ve=null,Ge=null,xe=Y,je=Y=0,Ie=null,Ze=J.next();xe!==null&&!Ze.done;je++,Ze=J.next()){xe.index>je?(Ie=xe,xe=null):Ie=xe.sibling;var vr=ee(Q,xe,Ze.value,oe);if(vr===null){xe===null&&(xe=Ie);break}i&&xe&&vr.alternate===null&&s(Q,xe),Y=y(vr,Y,je),Ge===null?ve=vr:Ge.sibling=vr,Ge=vr,xe=Ie}if(Ze.done)return o(Q,xe),qe&&_i(Q,je),ve;if(xe===null){for(;!Ze.done;je++,Ze=J.next())Ze=le(Q,Ze.value,oe),Ze!==null&&(Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return qe&&_i(Q,je),ve}for(xe=c(xe);!Ze.done;je++,Ze=J.next())Ze=re(xe,Q,je,Ze.value,oe),Ze!==null&&(i&&Ze.alternate!==null&&xe.delete(Ze.key===null?je:Ze.key),Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return i&&xe.forEach(function(cN){return s(Q,cN)}),qe&&_i(Q,je),ve}function it(Q,Y,J,oe){if(typeof J=="object"&&J!==null&&J.type===k&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;Y!==null;){if(Y.key===ve){if(ve=J.type,ve===k){if(Y.tag===7){o(Q,Y.sibling),oe=p(Y,J.props.children),oe.return=Q,Q=oe;break e}}else if(Y.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===G&&Fr(ve)===Y.type){o(Q,Y.sibling),oe=p(Y,J.props),Wa(oe,J),oe.return=Q,Q=oe;break e}o(Q,Y);break}else s(Q,Y);Y=Y.sibling}J.type===k?(oe=Ir(J.props.children,Q.mode,oe,J.key),oe.return=Q,Q=oe):(oe=au(J.type,J.key,J.props,null,Q.mode,oe),Wa(oe,J),oe.return=Q,Q=oe)}return S(Q);case w:e:{for(ve=J.key;Y!==null;){if(Y.key===ve)if(Y.tag===4&&Y.stateNode.containerInfo===J.containerInfo&&Y.stateNode.implementation===J.implementation){o(Q,Y.sibling),oe=p(Y,J.children||[]),oe.return=Q,Q=oe;break e}else{o(Q,Y);break}else s(Q,Y);Y=Y.sibling}oe=Sd(J,Q.mode,oe),oe.return=Q,Q=oe}return S(Q);case G:return J=Fr(J),it(Q,Y,J,oe)}if(U(J))return ye(Q,Y,J,oe);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(r(150));return J=ve.call(J),ke(Q,Y,J,oe)}if(typeof J.then=="function")return it(Q,Y,hu(J),oe);if(J.$$typeof===E)return it(Q,Y,uu(Q,J),oe);pu(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,Y!==null&&Y.tag===6?(o(Q,Y.sibling),oe=p(Y,J),oe.return=Q,Q=oe):(o(Q,Y),oe=wd(J,Q.mode,oe),oe.return=Q,Q=oe),S(Q)):o(Q,Y)}return function(Q,Y,J,oe){try{Ja=0;var ve=it(Q,Y,J,oe);return Bs=null,ve}catch(xe){if(xe===Ls||xe===fu)throw xe;var Ge=dn(29,xe,null,Q.mode);return Ge.lanes=oe,Ge.return=Q,Ge}}}var Xr=jy(!0),Ry=jy(!1),ir=!1;function Od(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function rr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function sr(i,s,o){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ke&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,s=su(i),my(i,null,o),s}return ru(i,c,s,o),su(i)}function eo(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var c=s.lanes;c&=i.pendingLanes,o|=c,s.lanes=o,Bl(i,o)}}function Ld(i,s){var o=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,o=o.next}while(o!==null);y===null?p=y=s:y=y.next=s}else p=y=s;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var Bd=!1;function to(){if(Bd){var i=Ds;if(i!==null)throw i}}function no(i,s,o,c){Bd=!1;var p=i.updateQueue;ir=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var q=T,W=q.next;q.next=null,S===null?y=W:S.next=W,S=q;var ae=i.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==S&&(T===null?ae.firstBaseUpdate=W:T.next=W,ae.lastBaseUpdate=q))}if(y!==null){var le=p.baseState;S=0,ae=W=q=null,T=y;do{var ee=T.lane&-536870913,re=ee!==T.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Os&&(Bd=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=i,ke=T;ee=s;var it=o;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){le=ye.call(it,le,ee);break e}le=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(it,le,ee):ye,ee==null)break e;le=m({},le,ee);break e;case 2:ir=!0}}ee=T.callback,ee!==null&&(i.flags|=64,re&&(i.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(W=ae=re,q=le):ae=ae.next=re,S|=ee;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;re=T,T=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);ae===null&&(q=le),p.baseState=q,p.firstBaseUpdate=W,p.lastBaseUpdate=ae,y===null&&(p.shared.lanes=0),cr|=S,i.lanes=S,i.memoizedState=le}}function zy(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Oy(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)zy(o[i],s)}var Hs=O(null),mu=O(0);function Dy(i,s){i=Oi,M(mu,i),M(Hs,s),Oi=i|s.baseLanes}function Hd(){M(mu,Oi),M(Hs,Hs.current)}function Ud(){Oi=mu.current,V(Hs),V(mu)}var hn=O(null),Mn=null;function ar(i){var s=i.alternate;M(gt,gt.current&1),M(hn,i),Mn===null&&(s===null||Hs.current!==null||s.memoizedState!==null)&&(Mn=i)}function Id(i){M(gt,gt.current),M(hn,i),Mn===null&&(Mn=i)}function Ly(i){i.tag===22?(M(gt,gt.current),M(hn,i),Mn===null&&(Mn=i)):or()}function or(){M(gt,gt.current),M(hn,hn.current)}function pn(i){V(hn),Mn===i&&(Mn=null),V(gt)}var gt=O(0);function gu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Yh(o)||Xh(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ni=0,Me=null,tt=null,vt=null,yu=!1,Us=!1,Gr=!1,xu=0,io=0,Is=null,eE=0;function dt(){throw Error(r(321))}function qd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!fn(i[o],s[o]))return!1;return!0}function $d(i,s,o,c,p,y){return Ni=y,Me=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,R.H=i===null||i.memoizedState===null?b0:ih,Gr=!1,y=o(c,p),Gr=!1,Us&&(y=Hy(s,o,c,p)),By(i),y}function By(i){R.H=ao;var s=tt!==null&&tt.next!==null;if(Ni=0,vt=tt=Me=null,yu=!1,io=0,Is=null,s)throw Error(r(300));i===null||wt||(i=i.dependencies,i!==null&&lu(i)&&(wt=!0))}function Hy(i,s,o,c){Me=i;var p=0;do{if(Us&&(Is=null),io=0,Us=!1,25<=p)throw Error(r(301));if(p+=1,vt=tt=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}R.H=v0,y=s(o,c)}while(Us);return y}function tE(){var i=R.H,s=i.useState()[0];return s=typeof s.then=="function"?ro(s):s,i=i.useState()[0],(tt!==null?tt.memoizedState:null)!==i&&(Me.flags|=1024),s}function Pd(){var i=xu!==0;return xu=0,i}function Vd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Fd(i){if(yu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}yu=!1}Ni=0,vt=tt=Me=null,Us=!1,io=xu=0,Is=null}function Yt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Me.memoizedState=vt=i:vt=vt.next=i,vt}function yt(){if(tt===null){var i=Me.alternate;i=i!==null?i.memoizedState:null}else i=tt.next;var s=vt===null?Me.memoizedState:vt.next;if(s!==null)vt=s,tt=i;else{if(i===null)throw Me.alternate===null?Error(r(467)):Error(r(310));tt=i,i={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},vt===null?Me.memoizedState=vt=i:vt=vt.next=i}return vt}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ro(i){var s=io;return io+=1,Is===null&&(Is=[]),i=Ty(Is,i,s),s=Me,(vt===null?s.memoizedState:vt.next)===null&&(s=s.alternate,R.H=s===null||s.memoizedState===null?b0:ih),i}function vu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ro(i);if(i.$$typeof===E)return Ot(i)}throw Error(r(438,String(i)))}function Yd(i){var s=null,o=Me.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var c=Me.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=bu(),Me.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),c=0;c<i;c++)o[c]=H;return s.index++,o}function Ci(i,s){return typeof s=="function"?s(i):s}function wu(i){var s=yt();return Xd(s,tt,i)}function Xd(i,s,o){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=o;var p=i.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}s.baseQueue=p=y,c.pending=null}if(y=i.baseState,p===null)i.memoizedState=y;else{s=p.next;var T=S=null,q=null,W=s,ae=!1;do{var le=W.lane&-536870913;if(le!==W.lane?(Ue&le)===le:(Ni&le)===le){var ee=W.revertLane;if(ee===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),le===Os&&(ae=!0);else if((Ni&ee)===ee){W=W.next,ee===Os&&(ae=!0);continue}else le={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(T=q=le,S=y):q=q.next=le,Me.lanes|=ee,cr|=ee;le=W.action,Gr&&o(y,le),y=W.hasEagerState?W.eagerState:o(y,le)}else ee={lane:le,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(T=q=ee,S=y):q=q.next=ee,Me.lanes|=le,cr|=le;W=W.next}while(W!==null&&W!==s);if(q===null?S=y:q.next=T,!fn(y,i.memoizedState)&&(wt=!0,ae&&(o=Ds,o!==null)))throw o;i.memoizedState=y,i.baseState=S,i.baseQueue=q,c.lastRenderedState=y}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Gd(i){var s=yt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var c=o.dispatch,p=o.pending,y=s.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do y=i(y,S.action),S=S.next;while(S!==p);fn(y,s.memoizedState)||(wt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),o.lastRenderedState=y}return[y,c]}function Uy(i,s,o){var c=Me,p=yt(),y=qe;if(y){if(o===void 0)throw Error(r(407));o=o()}else o=s();var S=!fn((tt||p).memoizedState,o);if(S&&(p.memoizedState=o,wt=!0),p=p.queue,Kd($y.bind(null,c,p,i),[i]),p.getSnapshot!==s||S||vt!==null&&vt.memoizedState.tag&1){if(c.flags|=2048,qs(9,{destroy:void 0},qy.bind(null,c,p,o,s),null),rt===null)throw Error(r(349));y||(Ni&127)!==0||Iy(c,s,o)}return o}function Iy(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=Me.updateQueue,s===null?(s=bu(),Me.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function qy(i,s,o,c){s.value=o,s.getSnapshot=c,Py(s)&&Vy(i)}function $y(i,s,o){return o(function(){Py(s)&&Vy(i)})}function Py(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!fn(i,o)}catch{return!0}}function Vy(i){var s=Ur(i,2);s!==null&&sn(s,i,2)}function Zd(i){var s=Yt();if(typeof i=="function"){var o=i;if(i=o(),Gr){Ut(!0);try{o()}finally{Ut(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},s}function Fy(i,s,o,c){return i.baseState=o,Xd(i,tt,typeof c=="function"?c:Ci)}function nE(i,s,o,c,p){if(ku(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};R.T!==null?o(!0):y.isTransition=!1,c(y),o=s.pending,o===null?(y.next=s.pending=y,Yy(s,y)):(y.next=o.next,s.pending=o.next=y)}}function Yy(i,s){var o=s.action,c=s.payload,p=i.state;if(s.isTransition){var y=R.T,S={};R.T=S;try{var T=o(p,c),q=R.S;q!==null&&q(S,T),Xy(i,s,T)}catch(W){Qd(i,s,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),R.T=y}}else try{y=o(p,c),Xy(i,s,y)}catch(W){Qd(i,s,W)}}function Xy(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Gy(i,s,c)},function(c){return Qd(i,s,c)}):Gy(i,s,o)}function Gy(i,s,o){s.status="fulfilled",s.value=o,Zy(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Yy(i,o)))}function Qd(i,s,o){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=o,Zy(s),s=s.next;while(s!==c)}i.action=null}function Zy(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Qy(i,s){return s}function Ky(i,s){if(qe){var o=rt.formState;if(o!==null){e:{var c=Me;if(qe){if(ot){t:{for(var p=ot,y=An;p.nodeType!==8;){if(!y){p=null;break t}if(p=jn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ot=jn(p.nextSibling),c=p.data==="F!";break e}}tr(c)}c=!1}c&&(s=o[0])}}return o=Yt(),o.memoizedState=o.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qy,lastRenderedState:s},o.queue=c,o=g0.bind(null,Me,c),c.dispatch=o,c=Zd(!1),y=nh.bind(null,Me,!1,c.queue),c=Yt(),p={state:s,dispatch:null,action:i,pending:null},c.queue=p,o=nE.bind(null,Me,p,y,o),p.dispatch=o,c.memoizedState=i,[s,o,!1]}function Jy(i){var s=yt();return Wy(s,tt,i)}function Wy(i,s,o){if(s=Xd(i,s,Qy)[0],i=wu(Ci)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=ro(s)}catch(S){throw S===Ls?fu:S}else c=s;s=yt();var p=s.queue,y=p.dispatch;return o!==s.memoizedState&&(Me.flags|=2048,qs(9,{destroy:void 0},iE.bind(null,p,o),null)),[c,y,i]}function iE(i,s){i.action=s}function e0(i){var s=yt(),o=tt;if(o!==null)return Wy(s,o,i);yt(),s=s.memoizedState,o=yt();var c=o.queue.dispatch;return o.memoizedState=i,[s,c,!1]}function qs(i,s,o,c){return i={tag:i,create:o,deps:c,inst:s,next:null},s=Me.updateQueue,s===null&&(s=bu(),Me.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(c=o.next,o.next=i,i.next=c,s.lastEffect=i),i}function t0(){return yt().memoizedState}function Su(i,s,o,c){var p=Yt();Me.flags|=i,p.memoizedState=qs(1|s,{destroy:void 0},o,c===void 0?null:c)}function _u(i,s,o,c){var p=yt();c=c===void 0?null:c;var y=p.memoizedState.inst;tt!==null&&c!==null&&qd(c,tt.memoizedState.deps)?p.memoizedState=qs(s,y,o,c):(Me.flags|=i,p.memoizedState=qs(1|s,y,o,c))}function n0(i,s){Su(8390656,8,i,s)}function Kd(i,s){_u(2048,8,i,s)}function rE(i){Me.flags|=4;var s=Me.updateQueue;if(s===null)s=bu(),Me.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function i0(i){var s=yt().memoizedState;return rE({ref:s,nextImpl:i}),function(){if((Ke&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function r0(i,s){return _u(4,2,i,s)}function s0(i,s){return _u(4,4,i,s)}function a0(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function o0(i,s,o){o=o!=null?o.concat([i]):null,_u(4,4,a0.bind(null,s,i),o)}function Jd(){}function l0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;return s!==null&&qd(s,c[1])?c[0]:(o.memoizedState=[i,s],i)}function u0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;if(s!==null&&qd(s,c[1]))return c[0];if(c=i(),Gr){Ut(!0);try{i()}finally{Ut(!1)}}return o.memoizedState=[c,s],c}function Wd(i,s,o){return o===void 0||(Ni&1073741824)!==0&&(Ue&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=cx(),Me.lanes|=i,cr|=i,o)}function c0(i,s,o,c){return fn(o,s)?o:Hs.current!==null?(i=Wd(i,o,c),fn(i,s)||(wt=!0),i):(Ni&42)===0||(Ni&1073741824)!==0&&(Ue&261930)===0?(wt=!0,i.memoizedState=o):(i=cx(),Me.lanes|=i,cr|=i,s)}function f0(i,s,o,c,p){var y=I.p;I.p=y!==0&&8>y?y:8;var S=R.T,T={};R.T=T,nh(i,!1,s,o);try{var q=p(),W=R.S;if(W!==null&&W(T,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ae=Wk(q,c);so(i,s,ae,yn(i))}else so(i,s,c,yn(i))}catch(le){so(i,s,{then:function(){},status:"rejected",reason:le},yn())}finally{I.p=y,S!==null&&T.types!==null&&(S.types=T.types),R.T=S}}function sE(){}function eh(i,s,o,c){if(i.tag!==5)throw Error(r(476));var p=d0(i).queue;f0(i,p,s,F,o===null?sE:function(){return h0(i),o(c)})}function d0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:F},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function h0(i){var s=d0(i);s.next===null&&(s=i.alternate.memoizedState),so(i,s.next.queue,{},yn())}function th(){return Ot(_o)}function p0(){return yt().memoizedState}function m0(){return yt().memoizedState}function aE(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=yn();i=rr(o);var c=sr(s,i,o);c!==null&&(sn(c,s,o),eo(c,s,o)),s={cache:Md()},i.payload=s;return}s=s.return}}function oE(i,s,o){var c=yn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ku(i)?y0(s,o):(o=bd(i,s,o,c),o!==null&&(sn(o,i,c),x0(o,s,c)))}function g0(i,s,o){var c=yn();so(i,s,o,c)}function so(i,s,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ku(i))y0(s,p);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var S=s.lastRenderedState,T=y(S,o);if(p.hasEagerState=!0,p.eagerState=T,fn(T,S))return ru(i,s,p,0),rt===null&&iu(),!1}catch{}if(o=bd(i,s,p,c),o!==null)return sn(o,i,c),x0(o,s,c),!0}return!1}function nh(i,s,o,c){if(c={lane:2,revertLane:Oh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},ku(i)){if(s)throw Error(r(479))}else s=bd(i,o,c,2),s!==null&&sn(s,i,2)}function ku(i){var s=i.alternate;return i===Me||s!==null&&s===Me}function y0(i,s){Us=yu=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function x0(i,s,o){if((o&4194048)!==0){var c=s.lanes;c&=i.pendingLanes,o|=c,s.lanes=o,Bl(i,o)}}var ao={readContext:Ot,use:vu,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};ao.useEffectEvent=dt;var b0={readContext:Ot,use:vu,useCallback:function(i,s){return Yt().memoizedState=[i,s===void 0?null:s],i},useContext:Ot,useEffect:n0,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,Su(4194308,4,a0.bind(null,s,i),o)},useLayoutEffect:function(i,s){return Su(4194308,4,i,s)},useInsertionEffect:function(i,s){Su(4,2,i,s)},useMemo:function(i,s){var o=Yt();s=s===void 0?null:s;var c=i();if(Gr){Ut(!0);try{i()}finally{Ut(!1)}}return o.memoizedState=[c,s],c},useReducer:function(i,s,o){var c=Yt();if(o!==void 0){var p=o(s);if(Gr){Ut(!0);try{o(s)}finally{Ut(!1)}}}else p=s;return c.memoizedState=c.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},c.queue=i,i=i.dispatch=oE.bind(null,Me,i),[c.memoizedState,i]},useRef:function(i){var s=Yt();return i={current:i},s.memoizedState=i},useState:function(i){i=Zd(i);var s=i.queue,o=g0.bind(null,Me,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Jd,useDeferredValue:function(i,s){var o=Yt();return Wd(o,i,s)},useTransition:function(){var i=Zd(!1);return i=f0.bind(null,Me,i.queue,!0,!1),Yt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var c=Me,p=Yt();if(qe){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),rt===null)throw Error(r(349));(Ue&127)!==0||Iy(c,s,o)}p.memoizedState=o;var y={value:o,getSnapshot:s};return p.queue=y,n0($y.bind(null,c,y,i),[i]),c.flags|=2048,qs(9,{destroy:void 0},qy.bind(null,c,y,o,s),null),o},useId:function(){var i=Yt(),s=rt.identifierPrefix;if(qe){var o=ti,c=ei;o=(c&~(1<<32-Je(c)-1)).toString(32)+o,s="_"+s+"R_"+o,o=xu++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=eE++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:th,useFormState:Ky,useActionState:Ky,useOptimistic:function(i){var s=Yt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=nh.bind(null,Me,!0,o),o.dispatch=s,[i,s]},useMemoCache:Yd,useCacheRefresh:function(){return Yt().memoizedState=aE.bind(null,Me)},useEffectEvent:function(i){var s=Yt(),o={impl:i};return s.memoizedState=o,function(){if((Ke&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},ih={readContext:Ot,use:vu,useCallback:l0,useContext:Ot,useEffect:Kd,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:s0,useMemo:u0,useReducer:wu,useRef:t0,useState:function(){return wu(Ci)},useDebugValue:Jd,useDeferredValue:function(i,s){var o=yt();return c0(o,tt.memoizedState,i,s)},useTransition:function(){var i=wu(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:ro(i),s]},useSyncExternalStore:Uy,useId:p0,useHostTransitionStatus:th,useFormState:Jy,useActionState:Jy,useOptimistic:function(i,s){var o=yt();return Fy(o,tt,i,s)},useMemoCache:Yd,useCacheRefresh:m0};ih.useEffectEvent=i0;var v0={readContext:Ot,use:vu,useCallback:l0,useContext:Ot,useEffect:Kd,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:s0,useMemo:u0,useReducer:Gd,useRef:t0,useState:function(){return Gd(Ci)},useDebugValue:Jd,useDeferredValue:function(i,s){var o=yt();return tt===null?Wd(o,i,s):c0(o,tt.memoizedState,i,s)},useTransition:function(){var i=Gd(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:ro(i),s]},useSyncExternalStore:Uy,useId:p0,useHostTransitionStatus:th,useFormState:e0,useActionState:e0,useOptimistic:function(i,s){var o=yt();return tt!==null?Fy(o,tt,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Yd,useCacheRefresh:m0};v0.useEffectEvent=i0;function rh(i,s,o,c){s=i.memoizedState,o=o(c,s),o=o==null?s:m({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var sh={enqueueSetState:function(i,s,o){i=i._reactInternals;var c=yn(),p=rr(c);p.payload=s,o!=null&&(p.callback=o),s=sr(i,p,c),s!==null&&(sn(s,i,c),eo(s,i,c))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var c=yn(),p=rr(c);p.tag=1,p.payload=s,o!=null&&(p.callback=o),s=sr(i,p,c),s!==null&&(sn(s,i,c),eo(s,i,c))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=yn(),c=rr(o);c.tag=2,s!=null&&(c.callback=s),s=sr(i,c,o),s!==null&&(sn(s,i,o),eo(s,i,o))}};function w0(i,s,o,c,p,y,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,y,S):s.prototype&&s.prototype.isPureReactComponent?!Ya(o,c)||!Ya(p,y):!0}function S0(i,s,o,c){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,c),s.state!==i&&sh.enqueueReplaceState(s,s.state,null)}function Zr(i,s){var o=s;if("ref"in s){o={};for(var c in s)c!=="ref"&&(o[c]=s[c])}if(i=i.defaultProps){o===s&&(o=m({},o));for(var p in i)o[p]===void 0&&(o[p]=i[p])}return o}function _0(i){nu(i)}function k0(i){console.error(i)}function E0(i){nu(i)}function Eu(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function N0(i,s,o){try{var c=i.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ah(i,s,o){return o=rr(o),o.tag=3,o.payload={element:null},o.callback=function(){Eu(i,s)},o}function C0(i){return i=rr(i),i.tag=3,i}function T0(i,s,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;i.payload=function(){return p(y)},i.callback=function(){N0(s,o,c)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){N0(s,o,c),typeof p!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function lE(i,s,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=o.alternate,s!==null&&zs(s,o,p,!0),o=hn.current,o!==null){switch(o.tag){case 31:case 13:return Mn===null?Bu():o.alternate===null&&ht===0&&(ht=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===du?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([c]):s.add(c),jh(i,c,p)),!1;case 22:return o.flags|=65536,c===du?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([c]):o.add(c)),jh(i,c,p)),!1}throw Error(r(435,o.tag))}return jh(i,c,p),Bu(),!1}if(qe)return s=hn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==Ed&&(i=Error(r(422),{cause:c}),Za(Nn(i,o)))):(c!==Ed&&(s=Error(r(423),{cause:c}),Za(Nn(s,o))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,c=Nn(c,o),p=ah(i.stateNode,c,p),Ld(i,p),ht!==4&&(ht=2)),!1;var y=Error(r(520),{cause:c});if(y=Nn(y,o),mo===null?mo=[y]:mo.push(y),ht!==4&&(ht=2),s===null)return!0;c=Nn(c,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=p&-p,o.lanes|=i,i=ah(o.stateNode,c,i),Ld(o,i),!1;case 1:if(s=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(fr===null||!fr.has(y))))return o.flags|=65536,p&=-p,o.lanes|=p,p=C0(p),T0(p,i,o,c),Ld(o,p),!1}o=o.return}while(o!==null);return!1}var oh=Error(r(461)),wt=!1;function Dt(i,s,o,c){s.child=i===null?Ry(s,null,o,c):Xr(s,i.child,o,c)}function A0(i,s,o,c,p){o=o.render;var y=s.ref;if("ref"in c){var S={};for(var T in c)T!=="ref"&&(S[T]=c[T])}else S=c;return Pr(s),c=$d(i,s,o,S,y,p),T=Pd(),i!==null&&!wt?(Vd(i,s,p),Ti(i,s,p)):(qe&&T&&_d(s),s.flags|=1,Dt(i,s,c,p),s.child)}function M0(i,s,o,c,p){if(i===null){var y=o.type;return typeof y=="function"&&!vd(y)&&y.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=y,j0(i,s,y,c,p)):(i=au(o.type,null,c,s,s.mode,p),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!mh(i,p)){var S=y.memoizedProps;if(o=o.compare,o=o!==null?o:Ya,o(S,c)&&i.ref===s.ref)return Ti(i,s,p)}return s.flags|=1,i=Si(y,c),i.ref=s.ref,i.return=s,s.child=i}function j0(i,s,o,c,p){if(i!==null){var y=i.memoizedProps;if(Ya(y,c)&&i.ref===s.ref)if(wt=!1,s.pendingProps=c=y,mh(i,p))(i.flags&131072)!==0&&(wt=!0);else return s.lanes=i.lanes,Ti(i,s,p)}return lh(i,s,o,c,p)}function R0(i,s,o,c){var p=c.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(c=s.child=i.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,s.child=null;return z0(i,s,y,o,c)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&cu(s,y!==null?y.cachePool:null),y!==null?Dy(s,y):Hd(),Ly(s);else return c=s.lanes=536870912,z0(i,s,y!==null?y.baseLanes|o:o,o,c)}else y!==null?(cu(s,y.cachePool),Dy(s,y),or(),s.memoizedState=null):(i!==null&&cu(s,null),Hd(),or());return Dt(i,s,p,o),s.child}function oo(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function z0(i,s,o,c,p){var y=Rd();return y=y===null?null:{parent:bt._currentValue,pool:y},s.memoizedState={baseLanes:o,cachePool:y},i!==null&&cu(s,null),Hd(),Ly(s),i!==null&&zs(i,s,c,!0),s.childLanes=p,null}function Nu(i,s){return s=Tu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function O0(i,s,o){return Xr(s,i.child,null,o),i=Nu(s,s.pendingProps),i.flags|=2,pn(s),s.memoizedState=null,i}function uE(i,s,o){var c=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(qe){if(c.mode==="hidden")return i=Nu(s,c),s.lanes=536870912,oo(null,i);if(Id(s),(i=ot)?(i=Yx(i,An),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Wi!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},o=yy(i),o.return=s,s.child=o,zt=s,ot=null)):i=null,i===null)throw tr(s);return s.lanes=536870912,null}return Nu(s,c)}var y=i.memoizedState;if(y!==null){var S=y.dehydrated;if(Id(s),p)if(s.flags&256)s.flags&=-257,s=O0(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(wt||zs(i,s,o,!1),p=(o&i.childLanes)!==0,wt||p){if(c=rt,c!==null&&(S=Hl(c,o),S!==0&&S!==y.retryLane))throw y.retryLane=S,Ur(i,S),sn(c,i,S),oh;Bu(),s=O0(i,s,o)}else i=y.treeContext,ot=jn(S.nextSibling),zt=s,qe=!0,er=null,An=!1,i!==null&&vy(s,i),s=Nu(s,c),s.flags|=4096;return s}return i=Si(i.child,{mode:c.mode,children:c.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Cu(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function lh(i,s,o,c,p){return Pr(s),o=$d(i,s,o,c,void 0,p),c=Pd(),i!==null&&!wt?(Vd(i,s,p),Ti(i,s,p)):(qe&&c&&_d(s),s.flags|=1,Dt(i,s,o,p),s.child)}function D0(i,s,o,c,p,y){return Pr(s),s.updateQueue=null,o=Hy(s,c,o,p),By(i),c=Pd(),i!==null&&!wt?(Vd(i,s,y),Ti(i,s,y)):(qe&&c&&_d(s),s.flags|=1,Dt(i,s,o,y),s.child)}function L0(i,s,o,c,p){if(Pr(s),s.stateNode===null){var y=As,S=o.contextType;typeof S=="object"&&S!==null&&(y=Ot(S)),y=new o(c,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=sh,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=c,y.state=s.memoizedState,y.refs={},Od(s),S=o.contextType,y.context=typeof S=="object"&&S!==null?Ot(S):As,y.state=s.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(rh(s,o,S,c),y.state=s.memoizedState),typeof o.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&&sh.enqueueReplaceState(y,y.state,null),no(s,c,y,p),to(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(i===null){y=s.stateNode;var T=s.memoizedProps,q=Zr(o,T);y.props=q;var W=y.context,ae=o.contextType;S=As,typeof ae=="object"&&ae!==null&&(S=Ot(ae));var le=o.getDerivedStateFromProps;ae=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=s.pendingProps!==T,ae||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||W!==S)&&S0(s,y,c,S),ir=!1;var ee=s.memoizedState;y.state=ee,no(s,c,y,p),to(),W=s.memoizedState,T||ee!==W||ir?(typeof le=="function"&&(rh(s,o,le,c),W=s.memoizedState),(q=ir||w0(s,o,q,c,ee,W,S))?(ae||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"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=W),y.props=c,y.state=W,y.context=S,c=q):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{y=s.stateNode,Dd(i,s),S=s.memoizedProps,ae=Zr(o,S),y.props=ae,le=s.pendingProps,ee=y.context,W=o.contextType,q=As,typeof W=="object"&&W!==null&&(q=Ot(W)),T=o.getDerivedStateFromProps,(W=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==le||ee!==q)&&S0(s,y,c,q),ir=!1,ee=s.memoizedState,y.state=ee,no(s,c,y,p),to();var re=s.memoizedState;S!==le||ee!==re||ir||i!==null&&i.dependencies!==null&&lu(i.dependencies)?(typeof T=="function"&&(rh(s,o,T,c),re=s.memoizedState),(ae=ir||w0(s,o,ae,c,ee,re,q)||i!==null&&i.dependencies!==null&&lu(i.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,q)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=re),y.props=c,y.state=re,y.context=q,c=ae):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=1024),c=!1)}return y=c,Cu(i,s),c=(s.flags&128)!==0,y||c?(y=s.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&c?(s.child=Xr(s,i.child,null,p),s.child=Xr(s,null,o,p)):Dt(i,s,o,p),s.memoizedState=y.state,i=s.child):i=Ti(i,s,p),i}function B0(i,s,o,c){return qr(),s.flags|=256,Dt(i,s,o,c),s.child}var uh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ch(i){return{baseLanes:i,cachePool:Ny()}}function fh(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=gn),i}function H0(i,s,o){var c=s.pendingProps,p=!1,y=(s.flags&128)!==0,S;if((S=y)||(S=i!==null&&i.memoizedState===null?!1:(gt.current&2)!==0),S&&(p=!0,s.flags&=-129),S=(s.flags&32)!==0,s.flags&=-33,i===null){if(qe){if(p?ar(s):or(),(i=ot)?(i=Yx(i,An),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Wi!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},o=yy(i),o.return=s,s.child=o,zt=s,ot=null)):i=null,i===null)throw tr(s);return Xh(i)?s.lanes=32:s.lanes=536870912,null}var T=c.children;return c=c.fallback,p?(or(),p=s.mode,T=Tu({mode:"hidden",children:T},p),c=Ir(c,p,o,null),T.return=s,c.return=s,T.sibling=c,s.child=T,c=s.child,c.memoizedState=ch(o),c.childLanes=fh(i,S,o),s.memoizedState=uh,oo(null,c)):(ar(s),dh(s,T))}var q=i.memoizedState;if(q!==null&&(T=q.dehydrated,T!==null)){if(y)s.flags&256?(ar(s),s.flags&=-257,s=hh(i,s,o)):s.memoizedState!==null?(or(),s.child=i.child,s.flags|=128,s=null):(or(),T=c.fallback,p=s.mode,c=Tu({mode:"visible",children:c.children},p),T=Ir(T,p,o,null),T.flags|=2,c.return=s,T.return=s,c.sibling=T,s.child=c,Xr(s,i.child,null,o),c=s.child,c.memoizedState=ch(o),c.childLanes=fh(i,S,o),s.memoizedState=uh,s=oo(null,c));else if(ar(s),Xh(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(r(419)),c.stack="",c.digest=S,Za({value:c,source:null,stack:null}),s=hh(i,s,o)}else if(wt||zs(i,s,o,!1),S=(o&i.childLanes)!==0,wt||S){if(S=rt,S!==null&&(c=Hl(S,o),c!==0&&c!==q.retryLane))throw q.retryLane=c,Ur(i,c),sn(S,i,c),oh;Yh(T)||Bu(),s=hh(i,s,o)}else Yh(T)?(s.flags|=192,s.child=i.child,s=null):(i=q.treeContext,ot=jn(T.nextSibling),zt=s,qe=!0,er=null,An=!1,i!==null&&vy(s,i),s=dh(s,c.children),s.flags|=4096);return s}return p?(or(),T=c.fallback,p=s.mode,q=i.child,W=q.sibling,c=Si(q,{mode:"hidden",children:c.children}),c.subtreeFlags=q.subtreeFlags&65011712,W!==null?T=Si(W,T):(T=Ir(T,p,o,null),T.flags|=2),T.return=s,c.return=s,c.sibling=T,s.child=c,oo(null,c),c=s.child,T=i.child.memoizedState,T===null?T=ch(o):(p=T.cachePool,p!==null?(q=bt._currentValue,p=p.parent!==q?{parent:q,pool:q}:p):p=Ny(),T={baseLanes:T.baseLanes|o,cachePool:p}),c.memoizedState=T,c.childLanes=fh(i,S,o),s.memoizedState=uh,oo(i.child,c)):(ar(s),o=i.child,i=o.sibling,o=Si(o,{mode:"visible",children:c.children}),o.return=s,o.sibling=null,i!==null&&(S=s.deletions,S===null?(s.deletions=[i],s.flags|=16):S.push(i)),s.child=o,s.memoizedState=null,o)}function dh(i,s){return s=Tu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Tu(i,s){return i=dn(22,i,null,s),i.lanes=0,i}function hh(i,s,o){return Xr(s,i.child,null,o),i=dh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function U0(i,s,o){i.lanes|=s;var c=i.alternate;c!==null&&(c.lanes|=s),Td(i.return,s,o)}function ph(i,s,o,c,p,y){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:y}:(S.isBackwards=s,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=o,S.tailMode=p,S.treeForkCount=y)}function I0(i,s,o){var c=s.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=gt.current,T=(S&2)!==0;if(T?(S=S&1|2,s.flags|=128):S&=1,M(gt,S),Dt(i,s,c,o),c=qe?Ga:0,!T&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&U0(i,o,s);else if(i.tag===19)U0(i,o,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(o=s.child,p=null;o!==null;)i=o.alternate,i!==null&&gu(i)===null&&(p=o),o=o.sibling;o=p,o===null?(p=s.child,s.child=null):(p=o.sibling,o.sibling=null),ph(s,!1,p,o,y,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=s.child,s.child=null;p!==null;){if(i=p.alternate,i!==null&&gu(i)===null){s.child=p;break}i=p.sibling,p.sibling=o,o=p,p=i}ph(s,!0,o,null,y,c);break;case"together":ph(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function Ti(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),cr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(zs(i,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,o=Si(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=Si(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function mh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&lu(i)))}function cE(i,s,o){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),nr(s,bt,i.memoizedState.cache),qr();break;case 27:case 5:Ee(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:nr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Id(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(ar(s),s.flags|=128,null):(o&s.child.childLanes)!==0?H0(i,s,o):(ar(s),i=Ti(i,s,o),i!==null?i.sibling:null);ar(s);break;case 19:var p=(i.flags&128)!==0;if(c=(o&s.childLanes)!==0,c||(zs(i,s,o,!1),c=(o&s.childLanes)!==0),p){if(c)return I0(i,s,o);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),M(gt,gt.current),c)break;return null;case 22:return s.lanes=0,R0(i,s,o,s.pendingProps);case 24:nr(s,bt,i.memoizedState.cache)}return Ti(i,s,o)}function q0(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)wt=!0;else{if(!mh(i,o)&&(s.flags&128)===0)return wt=!1,cE(i,s,o);wt=(i.flags&131072)!==0}else wt=!1,qe&&(s.flags&1048576)!==0&&by(s,Ga,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(i=Fr(s.elementType),s.type=i,typeof i=="function")vd(i)?(c=Zr(i,c),s.tag=1,s=L0(null,s,i,c,o)):(s.tag=0,s=lh(null,s,i,c,o));else{if(i!=null){var p=i.$$typeof;if(p===C){s.tag=11,s=A0(null,s,i,c,o);break e}else if(p===B){s.tag=14,s=M0(null,s,i,c,o);break e}}throw s=D(i)||i,Error(r(306,s,""))}}return s;case 0:return lh(i,s,s.type,s.pendingProps,o);case 1:return c=s.type,p=Zr(c,s.pendingProps),L0(i,s,c,p,o);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));c=s.pendingProps;var y=s.memoizedState;p=y.element,Dd(i,s),no(s,c,null,o);var S=s.memoizedState;if(c=S.cache,nr(s,bt,c),c!==y.cache&&Ad(s,[bt],o,!0),to(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=B0(i,s,c,o);break e}else if(c!==p){p=Nn(Error(r(424)),s),Za(p),s=B0(i,s,c,o);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,ot=jn(i.firstChild),zt=s,qe=!0,er=null,An=!0,o=Ry(s,null,c,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(qr(),c===p){s=Ti(i,s,o);break e}Dt(i,s,c,o)}s=s.child}return s;case 26:return Cu(i,s),i===null?(o=Jx(s.type,null,s.pendingProps,null))?s.memoizedState=o:qe||(o=s.type,i=s.pendingProps,c=Vu(fe.current).createElement(o),c[Tt]=s,c[It]=i,Lt(c,o,i),xt(c),s.stateNode=c):s.memoizedState=Jx(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ee(s),i===null&&qe&&(c=s.stateNode=Zx(s.type,s.pendingProps,fe.current),zt=s,An=!0,p=ot,mr(s.type)?(Gh=p,ot=jn(c.firstChild)):ot=p),Dt(i,s,s.pendingProps.children,o),Cu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&qe&&((p=c=ot)&&(c=IE(c,s.type,s.pendingProps,An),c!==null?(s.stateNode=c,zt=s,ot=jn(c.firstChild),An=!1,p=!0):p=!1),p||tr(s)),Ee(s),p=s.type,y=s.pendingProps,S=i!==null?i.memoizedProps:null,c=y.children,Ph(p,y)?c=null:S!==null&&Ph(p,S)&&(s.flags|=32),s.memoizedState!==null&&(p=$d(i,s,tE,null,null,o),_o._currentValue=p),Cu(i,s),Dt(i,s,c,o),s.child;case 6:return i===null&&qe&&((i=o=ot)&&(o=qE(o,s.pendingProps,An),o!==null?(s.stateNode=o,zt=s,ot=null,i=!0):i=!1),i||tr(s)),null;case 13:return H0(i,s,o);case 4:return ue(s,s.stateNode.containerInfo),c=s.pendingProps,i===null?s.child=Xr(s,null,c,o):Dt(i,s,c,o),s.child;case 11:return A0(i,s,s.type,s.pendingProps,o);case 7:return Dt(i,s,s.pendingProps,o),s.child;case 8:return Dt(i,s,s.pendingProps.children,o),s.child;case 12:return Dt(i,s,s.pendingProps.children,o),s.child;case 10:return c=s.pendingProps,nr(s,s.type,c.value),Dt(i,s,c.children,o),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,Pr(s),p=Ot(p),c=c(p),s.flags|=1,Dt(i,s,c,o),s.child;case 14:return M0(i,s,s.type,s.pendingProps,o);case 15:return j0(i,s,s.type,s.pendingProps,o);case 19:return I0(i,s,o);case 31:return uE(i,s,o);case 22:return R0(i,s,o,s.pendingProps);case 24:return Pr(s),c=Ot(bt),i===null?(p=Rd(),p===null&&(p=rt,y=Md(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=o),p=y),s.memoizedState={parent:c,cache:p},Od(s),nr(s,bt,p)):((i.lanes&o)!==0&&(Dd(i,s),no(s,null,null,o),to()),p=i.memoizedState,y=s.memoizedState,p.parent!==c?(p={parent:c,cache:c},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),nr(s,bt,c)):(c=y.cache,nr(s,bt,c),c!==p.cache&&Ad(s,[bt],o,!0))),Dt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ai(i){i.flags|=4}function gh(i,s,o,c,p){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(px())i.flags|=8192;else throw Yr=du,zd}else i.flags&=-16777217}function $0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ib(s))if(px())i.flags|=8192;else throw Yr=du,zd}function Au(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Dl():536870912,i.lanes|=s,Fs|=s)}function lo(i,s){if(!qe)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function lt(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,c=0;if(s)for(var p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=o,s}function fE(i,s,o){var c=s.pendingProps;switch(kd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(s),null;case 1:return lt(s),null;case 3:return o=s.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),Ei(bt),me(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Rs(s)?Ai(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Nd())),lt(s),null;case 26:var p=s.type,y=s.memoizedState;return i===null?(Ai(s),y!==null?(lt(s),$0(s,y)):(lt(s),gh(s,p,null,c,o))):y?y!==i.memoizedState?(Ai(s),lt(s),$0(s,y)):(lt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==c&&Ai(s),lt(s),gh(s,p,i,c,o)),null;case 27:if(Ce(s),o=fe.current,p=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return lt(s),null}i=ie.current,Rs(s)?wy(s):(i=Zx(p,c,o),s.stateNode=i,Ai(s))}return lt(s),null;case 5:if(Ce(s),p=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return lt(s),null}if(y=ie.current,Rs(s))wy(s);else{var S=Vu(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[Tt]=s,y[It]=c;e:for(S=s.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===s)break e;for(;S.sibling===null;){if(S.return===null||S.return===s)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s.stateNode=y;e:switch(Lt(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&&Ai(s)}}return lt(s),gh(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(r(166));if(i=fe.current,Rs(s)){if(i=s.stateNode,o=s.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Tt]=s,i=!!(i.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Hx(i.nodeValue,o)),i||tr(s,!0)}else i=Vu(i).createTextNode(c),i[Tt]=s,s.stateNode=i}return lt(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(c=Rs(s),o!==null){if(i===null){if(!c)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Tt]=s}else qr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;lt(s),i=!1}else o=Nd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(pn(s),s):(pn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return lt(s),null;case 13:if(c=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=Rs(s),c!==null&&c.dehydrated!==null){if(i===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Tt]=s}else qr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;lt(s),p=!1}else p=Nd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(pn(s),s):(pn(s),null)}return pn(s),(s.flags&128)!==0?(s.lanes=o,s):(o=c!==null,i=i!==null&&i.memoizedState!==null,o&&(c=s.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)),o!==i&&o&&(s.child.flags|=8192),Au(s,s.updateQueue),lt(s),null);case 4:return me(),i===null&&Hh(s.stateNode.containerInfo),lt(s),null;case 10:return Ei(s.type),lt(s),null;case 19:if(V(gt),c=s.memoizedState,c===null)return lt(s),null;if(p=(s.flags&128)!==0,y=c.rendering,y===null)if(p)lo(c,!1);else{if(ht!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=gu(i),y!==null){for(s.flags|=128,lo(c,!1),i=y.updateQueue,s.updateQueue=i,Au(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)gy(o,i),o=o.sibling;return M(gt,gt.current&1|2),qe&&_i(s,c.treeForkCount),s.child}i=i.sibling}c.tail!==null&&Ct()>Ou&&(s.flags|=128,p=!0,lo(c,!1),s.lanes=4194304)}else{if(!p)if(i=gu(y),i!==null){if(s.flags|=128,p=!0,i=i.updateQueue,s.updateQueue=i,Au(s,i),lo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return lt(s),null}else 2*Ct()-c.renderingStartTime>Ou&&o!==536870912&&(s.flags|=128,p=!0,lo(c,!1),s.lanes=4194304);c.isBackwards?(y.sibling=s.child,s.child=y):(i=c.last,i!==null?i.sibling=y:s.child=y,c.last=y)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Ct(),i.sibling=null,o=gt.current,M(gt,p?o&1|2:o&1),qe&&_i(s,c.treeForkCount),i):(lt(s),null);case 22:case 23:return pn(s),Ud(),c=s.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(o&536870912)!==0&&(s.flags&128)===0&&(lt(s),s.subtreeFlags&6&&(s.flags|=8192)):lt(s),o=s.updateQueue,o!==null&&Au(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048),i!==null&&V(Vr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ei(bt),lt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function dE(i,s){switch(kd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ei(bt),me(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Ce(s),null;case 31:if(s.memoizedState!==null){if(pn(s),s.alternate===null)throw Error(r(340));qr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(pn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return V(gt),null;case 4:return me(),null;case 10:return Ei(s.type),null;case 22:case 23:return pn(s),Ud(),i!==null&&V(Vr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ei(bt),null;case 25:return null;default:return null}}function P0(i,s){switch(kd(s),s.tag){case 3:Ei(bt),me();break;case 26:case 27:case 5:Ce(s);break;case 4:me();break;case 31:s.memoizedState!==null&&pn(s);break;case 13:pn(s);break;case 19:V(gt);break;case 10:Ei(s.type);break;case 22:case 23:pn(s),Ud(),i!==null&&V(Vr);break;case 24:Ei(bt)}}function uo(i,s){try{var o=s.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&i)===i){c=void 0;var y=o.create,S=o.inst;c=y(),S.destroy=c}o=o.next}while(o!==p)}}catch(T){et(s,s.return,T)}}function lr(i,s,o){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&i)===i){var S=c.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,p=s;var q=o,W=T;try{W()}catch(ae){et(p,q,ae)}}}c=c.next}while(c!==y)}}catch(ae){et(s,s.return,ae)}}function V0(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Oy(s,o)}catch(c){et(i,i.return,c)}}}function F0(i,s,o){o.props=Zr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(c){et(i,s,c)}}function co(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof o=="function"?i.refCleanup=o(c):o.current=c}}catch(p){et(i,s,p)}}function ni(i,s){var o=i.ref,c=i.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){et(i,s,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){et(i,s,p)}else o.current=null}function Y0(i){var s=i.type,o=i.memoizedProps,c=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){et(i,i.return,p)}}function yh(i,s,o){try{var c=i.stateNode;OE(c,i.type,o,s),c[It]=s}catch(p){et(i,i.return,p)}}function X0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function xh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||X0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function bh(i,s,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=vi));else if(c!==4&&(c===27&&mr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(bh(i,s,o),i=i.sibling;i!==null;)bh(i,s,o),i=i.sibling}function Mu(i,s,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(c!==4&&(c===27&&mr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Mu(i,s,o),i=i.sibling;i!==null;)Mu(i,s,o),i=i.sibling}function G0(i){var s=i.stateNode,o=i.memoizedProps;try{for(var c=i.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);Lt(s,c,o),s[Tt]=i,s[It]=o}catch(y){et(i,i.return,y)}}var Mi=!1,St=!1,vh=!1,Z0=typeof WeakSet=="function"?WeakSet:Set,jt=null;function hE(i,s){if(i=i.containerInfo,qh=Ku,i=oy(i),hd(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var S=0,T=-1,q=-1,W=0,ae=0,le=i,ee=null;t:for(;;){for(var re;le!==o||p!==0&&le.nodeType!==3||(T=S+p),le!==y||c!==0&&le.nodeType!==3||(q=S+c),le.nodeType===3&&(S+=le.nodeValue.length),(re=le.firstChild)!==null;)ee=le,le=re;for(;;){if(le===i)break t;if(ee===o&&++W===p&&(T=S),ee===y&&++ae===c&&(q=S),(re=le.nextSibling)!==null)break;le=ee,ee=le.parentNode}le=re}o=T===-1||q===-1?null:{start:T,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for($h={focusedElem:i,selectionRange:o},Ku=!1,jt=s;jt!==null;)if(s=jt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,jt=i;else for(;jt!==null;){switch(s=jt,y=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)p=i[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,o=s,p=y.memoizedProps,y=y.memoizedState,c=o.stateNode;try{var ye=Zr(o.type,p);i=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=i}catch(ke){et(o,o.return,ke)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)Fh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Fh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,jt=i;break}jt=s.return}}function Q0(i,s,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Ri(i,o),c&4&&uo(5,o);break;case 1:if(Ri(i,o),c&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(S){et(o,o.return,S)}else{var p=Zr(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(p,s,i.__reactInternalSnapshotBeforeUpdate)}catch(S){et(o,o.return,S)}}c&64&&V0(o),c&512&&co(o,o.return);break;case 3:if(Ri(i,o),c&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Oy(i,s)}catch(S){et(o,o.return,S)}}break;case 27:s===null&&c&4&&G0(o);case 26:case 5:Ri(i,o),s===null&&c&4&&Y0(o),c&512&&co(o,o.return);break;case 12:Ri(i,o);break;case 31:Ri(i,o),c&4&&W0(i,o);break;case 13:Ri(i,o),c&4&&ex(i,o),c&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=SE.bind(null,o),$E(i,o))));break;case 22:if(c=o.memoizedState!==null||Mi,!c){s=s!==null&&s.memoizedState!==null||St,p=Mi;var y=St;Mi=c,(St=s)&&!y?zi(i,o,(o.subtreeFlags&8772)!==0):Ri(i,o),Mi=p,St=y}break;case 30:break;default:Ri(i,o)}}function K0(i){var s=i.alternate;s!==null&&(i.alternate=null,K0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&La(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ut=null,en=!1;function ji(i,s,o){for(o=o.child;o!==null;)J0(i,s,o),o=o.sibling}function J0(i,s,o){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Rt,o)}catch{}switch(o.tag){case 26:St||ni(o,s),ji(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:St||ni(o,s);var c=ut,p=en;mr(o.type)&&(ut=o.stateNode,en=!1),ji(i,s,o),vo(o.stateNode),ut=c,en=p;break;case 5:St||ni(o,s);case 6:if(c=ut,p=en,ut=null,ji(i,s,o),ut=c,en=p,ut!==null)if(en)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(o.stateNode)}catch(y){et(o,s,y)}else try{ut.removeChild(o.stateNode)}catch(y){et(o,s,y)}break;case 18:ut!==null&&(en?(i=ut,Vx(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Ws(i)):Vx(ut,o.stateNode));break;case 4:c=ut,p=en,ut=o.stateNode.containerInfo,en=!0,ji(i,s,o),ut=c,en=p;break;case 0:case 11:case 14:case 15:lr(2,o,s),St||lr(4,o,s),ji(i,s,o);break;case 1:St||(ni(o,s),c=o.stateNode,typeof c.componentWillUnmount=="function"&&F0(o,s,c)),ji(i,s,o);break;case 21:ji(i,s,o);break;case 22:St=(c=St)||o.memoizedState!==null,ji(i,s,o),St=c;break;default:ji(i,s,o)}}function W0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Ws(i)}catch(o){et(s,s.return,o)}}}function ex(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Ws(i)}catch(o){et(s,s.return,o)}}function pE(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Z0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Z0),s;default:throw Error(r(435,i.tag))}}function ju(i,s){var o=pE(i);s.forEach(function(c){if(!o.has(c)){o.add(c);var p=_E.bind(null,i,c);c.then(p,p)}})}function tn(i,s){var o=s.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],y=i,S=s,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(mr(T.type)){ut=T.stateNode,en=!1;break e}break;case 5:ut=T.stateNode,en=!1;break e;case 3:case 4:ut=T.stateNode.containerInfo,en=!0;break e}T=T.return}if(ut===null)throw Error(r(160));J0(y,S,p),ut=null,en=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)tx(s,i),s=s.sibling}var qn=null;function tx(i,s){var o=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:tn(s,i),nn(i),c&4&&(lr(3,i,i.return),uo(3,i),lr(5,i,i.return));break;case 1:tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),c&64&&Mi&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=qn;if(tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),c&4){var y=o!==null?o.memoizedState:null;if(c=i.memoizedState,o===null)if(c===null)if(i.stateNode===null){e:{c=i.type,o=i.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[zr]||y[Tt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Lt(y,c,o),y[Tt]=i,xt(y),c=y;break e;case"link":var S=tb("link","href",p).get(c+(o.href||""));if(S){for(var T=0;T<S.length;T++)if(y=S[T],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(T,1);break t}}y=p.createElement(c),Lt(y,c,o),p.head.appendChild(y);break;case"meta":if(S=tb("meta","content",p).get(c+(o.content||""))){for(T=0;T<S.length;T++)if(y=S[T],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(T,1);break t}}y=p.createElement(c),Lt(y,c,o),p.head.appendChild(y);break;default:throw Error(r(468,c))}y[Tt]=i,xt(y),c=y}i.stateNode=c}else nb(p,i.type,i.stateNode);else i.stateNode=eb(p,c,i.memoizedProps);else y!==c?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,c===null?nb(p,i.type,i.stateNode):eb(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&yh(i,i.memoizedProps,o.memoizedProps)}break;case 27:tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),o!==null&&c&4&&yh(i,i.memoizedProps,o.memoizedProps);break;case 5:if(tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),i.flags&32){p=i.stateNode;try{Ss(p,"")}catch(ye){et(i,i.return,ye)}}c&4&&i.stateNode!=null&&(p=i.memoizedProps,yh(i,p,o!==null?o.memoizedProps:p)),c&1024&&(vh=!0);break;case 6:if(tn(s,i),nn(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,o=i.stateNode;try{o.nodeValue=c}catch(ye){et(i,i.return,ye)}}break;case 3:if(Xu=null,p=qn,qn=Fu(s.containerInfo),tn(s,i),qn=p,nn(i),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Ws(s.containerInfo)}catch(ye){et(i,i.return,ye)}vh&&(vh=!1,nx(i));break;case 4:c=qn,qn=Fu(i.stateNode.containerInfo),tn(s,i),nn(i),qn=c;break;case 12:tn(s,i),nn(i);break;case 31:tn(s,i),nn(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,ju(i,c)));break;case 13:tn(s,i),nn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zu=Ct()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,ju(i,c)));break;case 22:p=i.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,W=Mi,ae=St;if(Mi=W||p,St=ae||q,tn(s,i),St=ae,Mi=W,nn(i),c&8192)e:for(s=i.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(o===null||q||Mi||St||Qr(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){q=o=s;try{if(y=q.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=q.stateNode;var le=q.memoizedProps.style,ee=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){et(q,q.return,ye)}}}else if(s.tag===6){if(o===null){q=s;try{q.stateNode.nodeValue=p?"":q.memoizedProps}catch(ye){et(q,q.return,ye)}}}else if(s.tag===18){if(o===null){q=s;try{var re=q.stateNode;p?Fx(re,!0):Fx(q.stateNode,!1)}catch(ye){et(q,q.return,ye)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=i.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,ju(i,o))));break;case 19:tn(s,i),nn(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,ju(i,c)));break;case 30:break;case 21:break;default:tn(s,i),nn(i)}}function nn(i){var s=i.flags;if(s&2){try{for(var o,c=i.return;c!==null;){if(X0(c)){o=c;break}c=c.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var p=o.stateNode,y=xh(i);Mu(i,y,p);break;case 5:var S=o.stateNode;o.flags&32&&(Ss(S,""),o.flags&=-33);var T=xh(i);Mu(i,T,S);break;case 3:case 4:var q=o.stateNode.containerInfo,W=xh(i);bh(i,W,q);break;default:throw Error(r(161))}}catch(ae){et(i,i.return,ae)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function nx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;nx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ri(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Q0(i,s.alternate,s),s=s.sibling}function Qr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:lr(4,s,s.return),Qr(s);break;case 1:ni(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&F0(s,s.return,o),Qr(s);break;case 27:vo(s.stateNode);case 26:case 5:ni(s,s.return),Qr(s);break;case 22:s.memoizedState===null&&Qr(s);break;case 30:Qr(s);break;default:Qr(s)}i=i.sibling}}function zi(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,p=i,y=s,S=y.flags;switch(y.tag){case 0:case 11:case 15:zi(p,y,o),uo(4,y);break;case 1:if(zi(p,y,o),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){et(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var T=c.stateNode;try{var q=p.shared.hiddenCallbacks;if(q!==null)for(p.shared.hiddenCallbacks=null,p=0;p<q.length;p++)zy(q[p],T)}catch(W){et(c,c.return,W)}}o&&S&64&&V0(y),co(y,y.return);break;case 27:G0(y);case 26:case 5:zi(p,y,o),o&&c===null&&S&4&&Y0(y),co(y,y.return);break;case 12:zi(p,y,o);break;case 31:zi(p,y,o),o&&S&4&&W0(p,y);break;case 13:zi(p,y,o),o&&S&4&&ex(p,y);break;case 22:y.memoizedState===null&&zi(p,y,o),co(y,y.return);break;case 30:break;default:zi(p,y,o)}s=s.sibling}}function wh(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Qa(o))}function Sh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qa(i))}function $n(i,s,o,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)ix(i,s,o,c),s=s.sibling}function ix(i,s,o,c){var p=s.flags;switch(s.tag){case 0:case 11:case 15:$n(i,s,o,c),p&2048&&uo(9,s);break;case 1:$n(i,s,o,c);break;case 3:$n(i,s,o,c),p&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qa(i)));break;case 12:if(p&2048){$n(i,s,o,c),i=s.stateNode;try{var y=s.memoizedProps,S=y.id,T=y.onPostCommit;typeof T=="function"&&T(S,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){et(s,s.return,q)}}else $n(i,s,o,c);break;case 31:$n(i,s,o,c);break;case 13:$n(i,s,o,c);break;case 23:break;case 22:y=s.stateNode,S=s.alternate,s.memoizedState!==null?y._visibility&2?$n(i,s,o,c):fo(i,s):y._visibility&2?$n(i,s,o,c):(y._visibility|=2,$s(i,s,o,c,(s.subtreeFlags&10256)!==0||!1)),p&2048&&wh(S,s);break;case 24:$n(i,s,o,c),p&2048&&Sh(s.alternate,s);break;default:$n(i,s,o,c)}}function $s(i,s,o,c,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,S=s,T=o,q=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:$s(y,S,T,q,p),uo(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?$s(y,S,T,q,p):fo(y,S):(ae._visibility|=2,$s(y,S,T,q,p)),p&&W&2048&&wh(S.alternate,S);break;case 24:$s(y,S,T,q,p),p&&W&2048&&Sh(S.alternate,S);break;default:$s(y,S,T,q,p)}s=s.sibling}}function fo(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,c=s,p=c.flags;switch(c.tag){case 22:fo(o,c),p&2048&&wh(c.alternate,c);break;case 24:fo(o,c),p&2048&&Sh(c.alternate,c);break;default:fo(o,c)}s=s.sibling}}var ho=8192;function Ps(i,s,o){if(i.subtreeFlags&ho)for(i=i.child;i!==null;)rx(i,s,o),i=i.sibling}function rx(i,s,o){switch(i.tag){case 26:Ps(i,s,o),i.flags&ho&&i.memoizedState!==null&&eN(o,qn,i.memoizedState,i.memoizedProps);break;case 5:Ps(i,s,o);break;case 3:case 4:var c=qn;qn=Fu(i.stateNode.containerInfo),Ps(i,s,o),qn=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=ho,ho=16777216,Ps(i,s,o),ho=c):Ps(i,s,o));break;default:Ps(i,s,o)}}function sx(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function po(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];jt=c,ox(c,i)}sx(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ax(i),i=i.sibling}function ax(i){switch(i.tag){case 0:case 11:case 15:po(i),i.flags&2048&&lr(9,i,i.return);break;case 3:po(i);break;case 12:po(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Ru(i)):po(i);break;default:po(i)}}function Ru(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];jt=c,ox(c,i)}sx(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:lr(8,s,s.return),Ru(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,Ru(s));break;default:Ru(s)}i=i.sibling}}function ox(i,s){for(;jt!==null;){var o=jt;switch(o.tag){case 0:case 11:case 15:lr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Qa(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,jt=c;else e:for(o=i;jt!==null;){c=jt;var p=c.sibling,y=c.return;if(K0(c),c===o){jt=null;break e}if(p!==null){p.return=y,jt=p;break e}jt=y}}}var mE={getCacheForType:function(i){var s=Ot(bt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return Ot(bt).controller.signal}},gE=typeof WeakMap=="function"?WeakMap:Map,Ke=0,rt=null,Le=null,Ue=0,We=0,mn=null,ur=!1,Vs=!1,_h=!1,Oi=0,ht=0,cr=0,Kr=0,kh=0,gn=0,Fs=0,mo=null,rn=null,Eh=!1,zu=0,lx=0,Ou=1/0,Du=null,fr=null,At=0,dr=null,Ys=null,Di=0,Nh=0,Ch=null,ux=null,go=0,Th=null;function yn(){return(Ke&2)!==0&&Ue!==0?Ue&-Ue:R.T!==null?Oh():Ul()}function cx(){if(gn===0)if((Ue&536870912)===0||qe){var i=ms;ms<<=1,(ms&3932160)===0&&(ms=262144),gn=i}else gn=536870912;return i=hn.current,i!==null&&(i.flags|=32),gn}function sn(i,s,o){(i===rt&&(We===2||We===9)||i.cancelPendingCommit!==null)&&(Xs(i,0),hr(i,Ue,gn,!1)),Rr(i,o),((Ke&2)===0||i!==rt)&&(i===rt&&((Ke&2)===0&&(Kr|=o),ht===4&&hr(i,Ue,gn,!1)),ii(i))}function fx(i,s,o){if((Ke&6)!==0)throw Error(r(327));var c=!o&&(s&127)===0&&(s&i.expiredLanes)===0||jr(i,s),p=c?bE(i,s):Mh(i,s,!0),y=c;do{if(p===0){Vs&&!c&&hr(i,s,0,!1);break}else{if(o=i.current.alternate,y&&!yE(o)){p=Mh(i,s,!1),y=!1;continue}if(p===2){if(y=s,i.errorRecoveryDisabledLanes&y)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){s=S;e:{var T=i;p=mo;var q=T.current.memoizedState.isDehydrated;if(q&&(Xs(T,S).flags|=256),S=Mh(T,S,!1),S!==2){if(_h&&!q){T.errorRecoveryDisabledLanes|=y,Kr|=y,p=4;break e}y=rn,rn=p,y!==null&&(rn===null?rn=y:rn.push.apply(rn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Xs(i,0),hr(i,s,0,!0);break}e:{switch(c=i,y=p,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:hr(c,s,gn,!ur);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=zu+300-Ct(),10<p)){if(hr(c,s,gn,!ur),ys(c,0,!0)!==0)break e;Di=s,c.timeoutHandle=$x(dx.bind(null,c,o,rn,Du,Eh,s,gn,Kr,Fs,ur,y,"Throttled",-0,0),p);break e}dx(c,o,rn,Du,Eh,s,gn,Kr,Fs,ur,y,null,-0,0)}}break}while(!0);ii(i)}function dx(i,s,o,c,p,y,S,T,q,W,ae,le,ee,re){if(i.timeoutHandle=-1,le=s.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vi},rx(s,y,le);var ye=(y&62914560)===y?zu-Ct():(y&4194048)===y?lx-Ct():0;if(ye=tN(le,ye),ye!==null){Di=y,i.cancelPendingCommit=ye(vx.bind(null,i,s,y,o,c,p,S,T,q,ae,le,null,ee,re)),hr(i,y,S,!W);return}}vx(i,s,y,o,c,p,S,T,q)}function yE(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],y=p.getSnapshot;p=p.value;try{if(!fn(y(),p))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function hr(i,s,o,c){s&=~kh,s&=~Kr,i.suspendedLanes|=s,i.pingedLanes&=~s,c&&(i.warmLanes|=s),c=i.expirationTimes;for(var p=s;0<p;){var y=31-Je(p),S=1<<y;c[y]=-1,p&=~S}o!==0&&Ll(i,o,s)}function Lu(){return(Ke&6)===0?(yo(0),!1):!0}function Ah(){if(Le!==null){if(We===0)var i=Le.return;else i=Le,ki=$r=null,Fd(i),Bs=null,Ja=0,i=Le;for(;i!==null;)P0(i.alternate,i),i=i.return;Le=null}}function Xs(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,BE(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Di=0,Ah(),rt=i,Le=o=Si(i.current,null),Ue=s,We=0,mn=null,ur=!1,Vs=jr(i,s),_h=!1,Fs=gn=kh=Kr=cr=ht=0,rn=mo=null,Eh=!1,(s&8)!==0&&(s|=s&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=s;0<c;){var p=31-Je(c),y=1<<p;s|=i[p],c&=~y}return Oi=s,iu(),o}function hx(i,s){Me=null,R.H=ao,s===Ls||s===fu?(s=Ay(),We=3):s===zd?(s=Ay(),We=4):We=s===oh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,mn=s,Le===null&&(ht=1,Eu(i,Nn(s,i.current)))}function px(){var i=hn.current;return i===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?i===Mn:!1}function mx(){var i=R.H;return R.H=ao,i===null?ao:i}function gx(){var i=R.A;return R.A=mE,i}function Bu(){ht=4,ur||(Ue&4194048)!==Ue&&hn.current!==null||(Vs=!0),(cr&134217727)===0&&(Kr&134217727)===0||rt===null||hr(rt,Ue,gn,!1)}function Mh(i,s,o){var c=Ke;Ke|=2;var p=mx(),y=gx();(rt!==i||Ue!==s)&&(Du=null,Xs(i,s)),s=!1;var S=ht;e:do try{if(We!==0&&Le!==null){var T=Le,q=mn;switch(We){case 8:Ah(),S=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(s=!0);var W=We;if(We=0,mn=null,Gs(i,T,q,W),o&&Vs){S=0;break e}break;default:W=We,We=0,mn=null,Gs(i,T,q,W)}}xE(),S=ht;break}catch(ae){hx(i,ae)}while(!0);return s&&i.shellSuspendCounter++,ki=$r=null,Ke=c,R.H=p,R.A=y,Le===null&&(rt=null,Ue=0,iu()),S}function xE(){for(;Le!==null;)yx(Le)}function bE(i,s){var o=Ke;Ke|=2;var c=mx(),p=gx();rt!==i||Ue!==s?(Du=null,Ou=Ct()+500,Xs(i,s)):Vs=jr(i,s);e:do try{if(We!==0&&Le!==null){s=Le;var y=mn;t:switch(We){case 1:We=0,mn=null,Gs(i,s,y,1);break;case 2:case 9:if(Cy(y)){We=0,mn=null,xx(s);break}s=function(){We!==2&&We!==9||rt!==i||(We=7),ii(i)},y.then(s,s);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Cy(y)?(We=0,mn=null,xx(s)):(We=0,mn=null,Gs(i,s,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var T=Le;if(S?ib(S):T.stateNode.complete){We=0,mn=null;var q=T.sibling;if(q!==null)Le=q;else{var W=T.return;W!==null?(Le=W,Hu(W)):Le=null}break t}}We=0,mn=null,Gs(i,s,y,5);break;case 6:We=0,mn=null,Gs(i,s,y,6);break;case 8:Ah(),ht=6;break e;default:throw Error(r(462))}}vE();break}catch(ae){hx(i,ae)}while(!0);return ki=$r=null,R.H=c,R.A=p,Ke=o,Le!==null?0:(rt=null,Ue=0,iu(),ht)}function vE(){for(;Le!==null&&!pi();)yx(Le)}function yx(i){var s=q0(i.alternate,i,Oi);i.memoizedProps=i.pendingProps,s===null?Hu(i):Le=s}function xx(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=D0(o,s,s.pendingProps,s.type,void 0,Ue);break;case 11:s=D0(o,s,s.pendingProps,s.type.render,s.ref,Ue);break;case 5:Fd(s);default:P0(o,s),s=Le=gy(s,Oi),s=q0(o,s,Oi)}i.memoizedProps=i.pendingProps,s===null?Hu(i):Le=s}function Gs(i,s,o,c){ki=$r=null,Fd(s),Bs=null,Ja=0;var p=s.return;try{if(lE(i,p,s,o,Ue)){ht=1,Eu(i,Nn(o,i.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;ht=1,Eu(i,Nn(o,i.current)),Le=null;return}s.flags&32768?(qe||c===1?i=!0:Vs||(Ue&536870912)!==0?i=!1:(ur=i=!0,(c===2||c===9||c===3||c===6)&&(c=hn.current,c!==null&&c.tag===13&&(c.flags|=16384))),bx(s,i)):Hu(s)}function Hu(i){var s=i;do{if((s.flags&32768)!==0){bx(s,ur);return}i=s.return;var o=fE(s.alternate,s,Oi);if(o!==null){Le=o;return}if(s=s.sibling,s!==null){Le=s;return}Le=s=i}while(s!==null);ht===0&&(ht=5)}function bx(i,s){do{var o=dE(i.alternate,i);if(o!==null){o.flags&=32767,Le=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Le=i;return}Le=i=o}while(i!==null);ht=6,Le=null}function vx(i,s,o,c,p,y,S,T,q){i.cancelPendingCommit=null;do Uu();while(At!==0);if((Ke&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=xd,Gf(i,o,y,S,T,q),i===rt&&(Le=rt=null,Ue=0),Ys=s,dr=i,Di=o,Nh=y,Ch=p,ux=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,kE(_e,function(){return Ex(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=R.T,R.T=null,p=I.p,I.p=2,S=Ke,Ke|=4;try{hE(i,s,o)}finally{Ke=S,I.p=p,R.T=c}}At=1,wx(),Sx(),_x()}}function wx(){if(At===1){At=0;var i=dr,s=Ys,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=R.T,R.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{tx(s,i);var y=$h,S=oy(i.containerInfo),T=y.focusedElem,q=y.selectionRange;if(S!==T&&T&&T.ownerDocument&&ay(T.ownerDocument.documentElement,T)){if(q!==null&&hd(T)){var W=q.start,ae=q.end;if(ae===void 0&&(ae=W),"selectionStart"in T)T.selectionStart=W,T.selectionEnd=Math.min(ae,T.value.length);else{var le=T.ownerDocument||document,ee=le&&le.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=T.textContent.length,ke=Math.min(q.start,ye),it=q.end===void 0?ke:Math.min(q.end,ye);!re.extend&&ke>it&&(S=it,it=ke,ke=S);var Q=sy(T,ke),Y=sy(T,it);if(Q&&Y&&(re.rangeCount!==1||re.anchorNode!==Q.node||re.anchorOffset!==Q.offset||re.focusNode!==Y.node||re.focusOffset!==Y.offset)){var J=le.createRange();J.setStart(Q.node,Q.offset),re.removeAllRanges(),ke>it?(re.addRange(J),re.extend(Y.node,Y.offset)):(J.setEnd(Y.node,Y.offset),re.addRange(J))}}}}for(le=[],re=T;re=re.parentNode;)re.nodeType===1&&le.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var oe=le[T];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Ku=!!qh,$h=qh=null}finally{Ke=p,I.p=c,R.T=o}}i.current=s,At=2}}function Sx(){if(At===2){At=0;var i=dr,s=Ys,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=R.T,R.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{Q0(i,s.alternate,s)}finally{Ke=p,I.p=c,R.T=o}}At=3}}function _x(){if(At===4||At===3){At=0,mi();var i=dr,s=Ys,o=Di,c=ux;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?At=5:(At=0,Ys=dr=null,kx(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(fr=null),Da(o),s=s.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Rt,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=R.T,p=I.p,I.p=2,R.T=null;try{for(var y=i.onRecoverableError,S=0;S<c.length;S++){var T=c[S];y(T.value,{componentStack:T.stack})}}finally{R.T=s,I.p=p}}(Di&3)!==0&&Uu(),ii(i),p=i.pendingLanes,(o&261930)!==0&&(p&42)!==0?i===Th?go++:(go=0,Th=i):go=0,yo(0)}}function kx(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Qa(s)))}function Uu(){return wx(),Sx(),_x(),Ex()}function Ex(){if(At!==5)return!1;var i=dr,s=Nh;Nh=0;var o=Da(Di),c=R.T,p=I.p;try{I.p=32>o?32:o,R.T=null,o=Ch,Ch=null;var y=dr,S=Di;if(At=0,Ys=dr=null,Di=0,(Ke&6)!==0)throw Error(r(331));var T=Ke;if(Ke|=4,ax(y.current),ix(y,y.current,S,o),Ke=T,yo(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Rt,y)}catch{}return!0}finally{I.p=p,R.T=c,kx(i,s)}}function Nx(i,s,o){s=Nn(o,s),s=ah(i.stateNode,s,2),i=sr(i,s,2),i!==null&&(Rr(i,2),ii(i))}function et(i,s,o){if(i.tag===3)Nx(i,i,o);else for(;s!==null;){if(s.tag===3){Nx(s,i,o);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(fr===null||!fr.has(c))){i=Nn(o,i),o=C0(2),c=sr(s,o,2),c!==null&&(T0(o,c,s,i),Rr(c,2),ii(c));break}}s=s.return}}function jh(i,s,o){var c=i.pingCache;if(c===null){c=i.pingCache=new gE;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(o)||(_h=!0,p.add(o),i=wE.bind(null,i,s,o),s.then(i,i))}function wE(i,s,o){var c=i.pingCache;c!==null&&c.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,rt===i&&(Ue&o)===o&&(ht===4||ht===3&&(Ue&62914560)===Ue&&300>Ct()-zu?(Ke&2)===0&&Xs(i,0):kh|=o,Fs===Ue&&(Fs=0)),ii(i)}function Cx(i,s){s===0&&(s=Dl()),i=Ur(i,s),i!==null&&(Rr(i,s),ii(i))}function SE(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),Cx(i,o)}function _E(i,s){var o=0;switch(i.tag){case 31:case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(s),Cx(i,o)}function kE(i,s){return Qt(i,s)}var Iu=null,Zs=null,Rh=!1,qu=!1,zh=!1,pr=0;function ii(i){i!==Zs&&i.next===null&&(Zs===null?Iu=Zs=i:Zs=Zs.next=i),qu=!0,Rh||(Rh=!0,NE())}function yo(i,s){if(!zh&&qu){zh=!0;do for(var o=!1,c=Iu;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,T=c.pingedLanes;y=(1<<31-Je(42|i)+1)-1,y&=p&~(S&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,jx(c,y))}else y=Ue,y=ys(c,c===rt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||jr(c,y)||(o=!0,jx(c,y));c=c.next}while(o);zh=!1}}function EE(){Tx()}function Tx(){qu=Rh=!1;var i=0;pr!==0&&LE()&&(i=pr);for(var s=Ct(),o=null,c=Iu;c!==null;){var p=c.next,y=Ax(c,s);y===0?(c.next=null,o===null?Iu=p:o.next=p,p===null&&(Zs=o)):(o=c,(i!==0||(y&3)!==0)&&(qu=!0)),c=p}At!==0&&At!==5||yo(i),pr!==0&&(pr=0)}function Ax(i,s){for(var o=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var S=31-Je(y),T=1<<S,q=p[S];q===-1?((T&o)===0||(T&c)!==0)&&(p[S]=Xf(T,s)):q<=s&&(i.expiredLanes|=T),y&=~T}if(s=rt,o=Ue,o=ys(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,o===0||i===s&&(We===2||We===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&Bn(c),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||jr(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(c!==null&&Bn(c),Da(o)){case 2:case 8:o=pe;break;case 32:o=_e;break;case 268435456:o=Pe;break;default:o=_e}return c=Mx.bind(null,i),o=Qt(o,c),i.callbackPriority=s,i.callbackNode=o,s}return c!==null&&c!==null&&Bn(c),i.callbackPriority=2,i.callbackNode=null,2}function Mx(i,s){if(At!==0&&At!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Uu()&&i.callbackNode!==o)return null;var c=Ue;return c=ys(i,i===rt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(fx(i,c,s),Ax(i,Ct()),i.callbackNode!=null&&i.callbackNode===o?Mx.bind(null,i):null)}function jx(i,s){if(Uu())return null;fx(i,s,!0)}function NE(){HE(function(){(Ke&6)!==0?Qt(se,EE):Tx()})}function Oh(){if(pr===0){var i=Os;i===0&&(i=ps,ps<<=1,(ps&261888)===0&&(ps=256)),pr=i}return pr}function Rx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Zl(""+i)}function zx(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function CE(i,s,o,c,p){if(s==="submit"&&o&&o.stateNode===p){var y=Rx((p[It]||null).action),S=c.submitter;S&&(s=(s=S[It]||null)?Rx(s.formAction):S.getAttribute("formAction"),s!==null&&(y=s,S=null));var T=new Wl("action","action",null,c,p);i.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(pr!==0){var q=S?zx(p,S):new FormData(p);eh(o,{pending:!0,data:q,method:p.method,action:y},null,q)}}else typeof y=="function"&&(T.preventDefault(),q=S?zx(p,S):new FormData(p),eh(o,{pending:!0,data:q,method:p.method,action:y},y,q))},currentTarget:p}]})}}for(var Dh=0;Dh<yd.length;Dh++){var Lh=yd[Dh],TE=Lh.toLowerCase(),AE=Lh[0].toUpperCase()+Lh.slice(1);In(TE,"on"+AE)}In(cy,"onAnimationEnd"),In(fy,"onAnimationIteration"),In(dy,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Fk,"onTransitionRun"),In(Yk,"onTransitionStart"),In(Xk,"onTransitionCancel"),In(hy,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xo="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(" "),ME=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xo));function Ox(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var c=i[o],p=c.event;c=c.listeners;e:{var y=void 0;if(s)for(var S=c.length-1;0<=S;S--){var T=c[S],q=T.instance,W=T.currentTarget;if(T=T.listener,q!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(ae){nu(ae)}p.currentTarget=null,y=q}else for(S=0;S<c.length;S++){if(T=c[S],q=T.instance,W=T.currentTarget,T=T.listener,q!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(ae){nu(ae)}p.currentTarget=null,y=q}}}}function Be(i,s){var o=s[xs];o===void 0&&(o=s[xs]=new Set);var c=i+"__bubble";o.has(c)||(Dx(s,i,2,!1),o.add(c))}function Bh(i,s,o){var c=0;s&&(c|=4),Dx(o,i,c,s)}var $u="_reactListening"+Math.random().toString(36).slice(2);function Hh(i){if(!i[$u]){i[$u]=!0,Pl.forEach(function(o){o!=="selectionchange"&&(ME.has(o)||Bh(o,!1,i),Bh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[$u]||(s[$u]=!0,Bh("selectionchange",!1,s))}}function Dx(i,s,o,c){switch(cb(s)){case 2:var p=rN;break;case 8:p=sN;break;default:p=Wh}o=p.bind(null,s,o,i),p=void 0,!rd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(s,o,{capture:!0,passive:p}):i.addEventListener(s,o,!0):p!==void 0?i.addEventListener(s,o,{passive:p}):i.addEventListener(s,o,!1)}function Uh(i,s,o,c,p){var y=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var T=c.stateNode.containerInfo;if(T===p)break;if(S===4)for(S=c.return;S!==null;){var q=S.tag;if((q===3||q===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;T!==null;){if(S=Xi(T),S===null)return;if(q=S.tag,q===5||q===6||q===26||q===27){c=y=S;continue e}T=T.parentNode}}c=c.return}Ig(function(){var W=y,ae=nd(o),le=[];e:{var ee=py.get(i);if(ee!==void 0){var re=Wl,ye=i;switch(i){case"keypress":if(Kl(o)===0)break e;case"keydown":case"keyup":re=_k;break;case"focusin":ye="focus",re=ld;break;case"focusout":ye="blur",re=ld;break;case"beforeblur":case"afterblur":re=ld;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=fk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=Nk;break;case cy:case fy:case dy:re=pk;break;case hy:re=Tk;break;case"scroll":case"scrollend":re=uk;break;case"wheel":re=Mk;break;case"copy":case"cut":case"paste":re=gk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Fg;break;case"toggle":case"beforetoggle":re=Rk}var ke=(s&4)!==0,it=!ke&&(i==="scroll"||i==="scrollend"),Q=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var Y=W,J;Y!==null;){var oe=Y;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Q===null||(oe=Ua(Y,Q),oe!=null&&ke.push(bo(Y,oe,J))),it)break;Y=Y.return}0<ke.length&&(ee=new re(ee,ye,null,o,ae),le.push({event:ee,listeners:ke}))}}if((s&7)===0){e:{if(ee=i==="mouseover"||i==="pointerover",re=i==="mouseout"||i==="pointerout",ee&&o!==td&&(ye=o.relatedTarget||o.fromElement)&&(Xi(ye)||ye[yi]))break e;if((re||ee)&&(ee=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=o.relatedTarget||o.toElement,re=W,ye=ye?Xi(ye):null,ye!==null&&(it=l(ye),ke=ye.tag,ye!==it||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=Pg,oe="onMouseLeave",Q="onMouseEnter",Y="mouse",(i==="pointerout"||i==="pointerover")&&(ke=Fg,oe="onPointerLeave",Q="onPointerEnter",Y="pointer"),it=re==null?ee:Zi(re),J=ye==null?ee:Zi(ye),ee=new ke(oe,Y+"leave",re,o,ae),ee.target=it,ee.relatedTarget=J,oe=null,Xi(ae)===W&&(ke=new ke(Q,Y+"enter",ye,o,ae),ke.target=J,ke.relatedTarget=it,oe=ke),it=oe,re&&ye)t:{for(ke=jE,Q=re,Y=ye,J=0,oe=Q;oe;oe=ke(oe))J++;oe=0;for(var ve=Y;ve;ve=ke(ve))oe++;for(;0<J-oe;)Q=ke(Q),J--;for(;0<oe-J;)Y=ke(Y),oe--;for(;J--;){if(Q===Y||Y!==null&&Q===Y.alternate){ke=Q;break t}Q=ke(Q),Y=ke(Y)}ke=null}else ke=null;re!==null&&Lx(le,ee,re,ke,!1),ye!==null&&it!==null&&Lx(le,it,ye,ke,!0)}}e:{if(ee=W?Zi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Ge=Wg;else if(Kg(ee))if(ey)Ge=$k;else{Ge=Ik;var xe=Uk}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&ed(W.elementType)&&(Ge=Wg):Ge=qk;if(Ge&&(Ge=Ge(i,W))){Jg(le,Ge,o,ae);break e}xe&&xe(i,ee,W),i==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Ha(ee,"number",ee.value)}switch(xe=W?Zi(W):window,i){case"focusin":(Kg(xe)||xe.contentEditable==="true")&&(Ns=xe,pd=W,Xa=null);break;case"focusout":Xa=pd=Ns=null;break;case"mousedown":md=!0;break;case"contextmenu":case"mouseup":case"dragend":md=!1,ly(le,o,ae);break;case"selectionchange":if(Vk)break;case"keydown":case"keyup":ly(le,o,ae)}var je;if(cd)e:{switch(i){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Es?Zg(i,o)&&(Ie="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(Ie="onCompositionStart");Ie&&(Yg&&o.locale!=="ko"&&(Es||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Es&&(je=qg()):(Ji=ae,sd="value"in Ji?Ji.value:Ji.textContent,Es=!0)),xe=Pu(W,Ie),0<xe.length&&(Ie=new Vg(Ie,i,null,o,ae),le.push({event:Ie,listeners:xe}),je?Ie.data=je:(je=Qg(o),je!==null&&(Ie.data=je)))),(je=Ok?Dk(i,o):Lk(i,o))&&(Ie=Pu(W,"onBeforeInput"),0<Ie.length&&(xe=new Vg("onBeforeInput","beforeinput",null,o,ae),le.push({event:xe,listeners:Ie}),xe.data=je)),CE(le,i,W,o,ae)}Ox(le,s)})}function bo(i,s,o){return{instance:i,listener:s,currentTarget:o}}function Pu(i,s){for(var o=s+"Capture",c=[];i!==null;){var p=i,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ua(i,o),p!=null&&c.unshift(bo(i,p,y)),p=Ua(i,s),p!=null&&c.push(bo(i,p,y))),i.tag===3)return c;i=i.return}return[]}function jE(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Lx(i,s,o,c,p){for(var y=s._reactName,S=[];o!==null&&o!==c;){var T=o,q=T.alternate,W=T.stateNode;if(T=T.tag,q!==null&&q===c)break;T!==5&&T!==26&&T!==27||W===null||(q=W,p?(W=Ua(o,y),W!=null&&S.unshift(bo(o,W,q))):p||(W=Ua(o,y),W!=null&&S.push(bo(o,W,q)))),o=o.return}S.length!==0&&i.push({event:s,listeners:S})}var RE=/\r\n?/g,zE=/\u0000|\uFFFD/g;function Bx(i){return(typeof i=="string"?i:""+i).replace(RE,`
|
|
9
|
-
`).replace(zE,"")}function Hx(i,s){return s=Bx(s),Bx(i)===s}function nt(i,s,o,c,p,y){switch(o){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Ss(i,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Ss(i,""+c);break;case"className":vs(i,"class",c);break;case"tabIndex":vs(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,o,c);break;case"style":Hg(i,c,y);break;case"data":if(s!=="object"){vs(i,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=Zl(""+c),i.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(o,"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"&&(o==="formAction"?(s!=="input"&&nt(i,s,"name",p.name,p,null),nt(i,s,"formEncType",p.formEncType,p,null),nt(i,s,"formMethod",p.formMethod,p,null),nt(i,s,"formTarget",p.formTarget,p,null)):(nt(i,s,"encType",p.encType,p,null),nt(i,s,"method",p.method,p,null),nt(i,s,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=Zl(""+c),i.setAttribute(o,c);break;case"onClick":c!=null&&(i.onclick=vi);break;case"onScroll":c!=null&&Be("scroll",i);break;case"onScrollEnd":c!=null&&Be("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.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"){i.removeAttribute("xlink:href");break}o=Zl(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);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"?i.setAttribute(o,""+c):i.removeAttribute(o);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"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":c===!0?i.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,c):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(o,c):i.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(o):i.setAttribute(o,c);break;case"popover":Be("beforetoggle",i),Be("toggle",i),bs(i,"popover",c);break;case"xlinkActuate":Un(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Un(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Un(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Un(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Un(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Un(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Un(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Un(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Un(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":bs(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=ok.get(o)||o,bs(i,o,c))}}function Ih(i,s,o,c,p,y){switch(o){case"style":Hg(i,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof c=="string"?Ss(i,c):(typeof c=="number"||typeof c=="bigint")&&Ss(i,""+c);break;case"onScroll":c!=null&&Be("scroll",i);break;case"onScrollEnd":c!=null&&Be("scrollend",i);break;case"onClick":c!=null&&(i.onclick=vi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vl.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),s=o.slice(2,p?o.length-7:void 0),y=i[It]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(s,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,c,p);break e}o in i?i[o]=c:c===!0?i.setAttribute(o,""):bs(i,o,c)}}}function Lt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",i),Be("load",i);var c=!1,p=!1,y;for(y in o)if(o.hasOwnProperty(y)){var S=o[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nt(i,s,y,S,o,null)}}p&&nt(i,s,"srcSet",o.srcSet,o,null),c&&nt(i,s,"src",o.src,o,null);return;case"input":Be("invalid",i);var T=y=S=p=null,q=null,W=null;for(c in o)if(o.hasOwnProperty(c)){var ae=o[c];if(ae!=null)switch(c){case"name":p=ae;break;case"type":S=ae;break;case"checked":q=ae;break;case"defaultChecked":W=ae;break;case"value":y=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:nt(i,s,c,ae,o,null)}}Gl(i,y,T,q,W,S,p,!1);return;case"select":Be("invalid",i),c=S=y=null;for(p in o)if(o.hasOwnProperty(p)&&(T=o[p],T!=null))switch(p){case"value":y=T;break;case"defaultValue":S=T;break;case"multiple":c=T;default:nt(i,s,p,T,o,null)}s=y,o=S,i.multiple=!!c,s!=null?bi(i,!!c,s,!1):o!=null&&bi(i,!!c,o,!0);return;case"textarea":Be("invalid",i),y=p=c=null;for(S in o)if(o.hasOwnProperty(S)&&(T=o[S],T!=null))switch(S){case"value":c=T;break;case"defaultValue":p=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:nt(i,s,S,T,o,null)}Lg(i,c,p,y);return;case"option":for(q in o)o.hasOwnProperty(q)&&(c=o[q],c!=null)&&(q==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":nt(i,s,q,c,o,null));return;case"dialog":Be("beforetoggle",i),Be("toggle",i),Be("cancel",i),Be("close",i);break;case"iframe":case"object":Be("load",i);break;case"video":case"audio":for(c=0;c<xo.length;c++)Be(xo[c],i);break;case"image":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"embed":case"source":case"link":Be("error",i),Be("load",i);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 o)if(o.hasOwnProperty(W)&&(c=o[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nt(i,s,W,c,o,null)}return;default:if(ed(s)){for(ae in o)o.hasOwnProperty(ae)&&(c=o[ae],c!==void 0&&Ih(i,s,ae,c,o,void 0));return}}for(T in o)o.hasOwnProperty(T)&&(c=o[T],c!=null&&nt(i,s,T,c,o,null))}function OE(i,s,o,c){switch(s){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,T=null,q=null,W=null,ae=null;for(re in o){var le=o[re];if(o.hasOwnProperty(re)&&le!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":q=le;default:c.hasOwnProperty(re)||nt(i,s,re,null,c,le)}}for(var ee in c){var re=c[ee];if(le=o[ee],c.hasOwnProperty(ee)&&(re!=null||le!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":ae=re;break;case"value":S=re;break;case"defaultValue":T=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,s));break;default:re!==le&&nt(i,s,ee,re,c,le)}}Dr(i,S,T,q,W,ae,y,p);return;case"select":re=S=T=ee=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":re=q;default:c.hasOwnProperty(y)||nt(i,s,y,null,c,q)}for(p in c)if(y=c[p],q=o[p],c.hasOwnProperty(p)&&(y!=null||q!=null))switch(p){case"value":ee=y;break;case"defaultValue":T=y;break;case"multiple":S=y;default:y!==q&&nt(i,s,p,y,c,q)}s=T,o=S,c=re,ee!=null?bi(i,!!o,ee,!1):!!c!=!!o&&(s!=null?bi(i,!!o,s,!0):bi(i,!!o,o?[]:"",!1));return;case"textarea":re=ee=null;for(T in o)if(p=o[T],o.hasOwnProperty(T)&&p!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:nt(i,s,T,null,c,p)}for(S in c)if(p=c[S],y=o[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(r(91));break;default:p!==y&&nt(i,s,S,p,c,y)}Dg(i,ee,re);return;case"option":for(var ye in o)ee=o[ye],o.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?i.selected=!1:nt(i,s,ye,null,c,ee));for(q in c)ee=c[q],re=o[q],c.hasOwnProperty(q)&&ee!==re&&(ee!=null||re!=null)&&(q==="selected"?i.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":nt(i,s,q,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 o)ee=o[ke],o.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&nt(i,s,ke,null,c,ee);for(W in c)if(ee=c[W],re=o[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,s));break;default:nt(i,s,W,ee,c,re)}return;default:if(ed(s)){for(var it in o)ee=o[it],o.hasOwnProperty(it)&&ee!==void 0&&!c.hasOwnProperty(it)&&Ih(i,s,it,void 0,c,ee);for(ae in c)ee=c[ae],re=o[ae],!c.hasOwnProperty(ae)||ee===re||ee===void 0&&re===void 0||Ih(i,s,ae,ee,c,re);return}}for(var Q in o)ee=o[Q],o.hasOwnProperty(Q)&&ee!=null&&!c.hasOwnProperty(Q)&&nt(i,s,Q,null,c,ee);for(le in c)ee=c[le],re=o[le],!c.hasOwnProperty(le)||ee===re||ee==null&&re==null||nt(i,s,le,ee,c,re)}function Ux(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DE(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],y=p.transferSize,S=p.initiatorType,T=p.duration;if(y&&T&&Ux(S)){for(S=0,T=p.responseEnd,c+=1;c<o.length;c++){var q=o[c],W=q.startTime;if(W>T)break;var ae=q.transferSize,le=q.initiatorType;ae&&Ux(le)&&(q=q.responseEnd,S+=ae*(q<T?1:(T-W)/(q-W)))}if(--c,s+=8*(y+S)/(p.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var qh=null,$h=null;function Vu(i){return i.nodeType===9?i:i.ownerDocument}function Ix(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qx(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Ph(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Vh=null;function LE(){var i=window.event;return i&&i.type==="popstate"?i===Vh?!1:(Vh=i,!0):(Vh=null,!1)}var $x=typeof setTimeout=="function"?setTimeout:void 0,BE=typeof clearTimeout=="function"?clearTimeout:void 0,Px=typeof Promise=="function"?Promise:void 0,HE=typeof queueMicrotask=="function"?queueMicrotask:typeof Px<"u"?function(i){return Px.resolve(null).then(i).catch(UE)}:$x;function UE(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Vx(i,s){var o=s,c=0;do{var p=o.nextSibling;if(i.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){i.removeChild(p),Ws(s);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")vo(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,vo(o);for(var y=o.firstChild;y;){var S=y.nextSibling,T=y.nodeName;y[zr]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=S}}else o==="body"&&vo(i.ownerDocument.body);o=p}while(o);Ws(s)}function Fx(i,s){var o=i;i=0;do{var c=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=c}while(o)}function Fh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Fh(o),La(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function IE(i,s,o,c){for(;i.nodeType===1;){var p=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[zr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=jn(i.nextSibling),i===null)break}return null}function qE(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=jn(i.nextSibling),i===null))return null;return i}function Yx(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=jn(i.nextSibling),i===null))return null;return i}function Yh(i){return i.data==="$?"||i.data==="$~"}function Xh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function $E(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var c=function(){s(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function jn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Gh=null;function Xx(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return jn(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function Gx(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function Zx(i,s,o){switch(s=Vu(o),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function vo(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);La(i)}var Rn=new Map,Qx=new Set;function Fu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Li=I.d;I.d={f:PE,r:VE,D:FE,C:YE,L:XE,m:GE,X:QE,S:ZE,M:KE};function PE(){var i=Li.f(),s=Lu();return i||s}function VE(i){var s=Gi(i);s!==null&&s.tag===5&&s.type==="form"?h0(s):Li.r(i)}var Qs=typeof document>"u"?null:document;function Kx(i,s,o){var c=Qs;if(c&&typeof s=="string"&&s){var p=Jt(s);p='link[rel="'+i+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Qx.has(p)||(Qx.add(p),i={rel:i,crossOrigin:o,href:s},c.querySelector(p)===null&&(s=c.createElement("link"),Lt(s,"link",i),xt(s),c.head.appendChild(s)))}}function FE(i){Li.D(i),Kx("dns-prefetch",i,null)}function YE(i,s){Li.C(i,s),Kx("preconnect",i,s)}function XE(i,s,o){Li.L(i,s,o);var c=Qs;if(c&&i&&s){var p='link[rel="preload"][as="'+Jt(s)+'"]';s==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Jt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Jt(o.imageSizes)+'"]')):p+='[href="'+Jt(i)+'"]';var y=p;switch(s){case"style":y=Ks(i);break;case"script":y=Js(i)}Rn.has(y)||(i=m({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),Rn.set(y,i),c.querySelector(p)!==null||s==="style"&&c.querySelector(wo(y))||s==="script"&&c.querySelector(So(y))||(s=c.createElement("link"),Lt(s,"link",i),xt(s),c.head.appendChild(s)))}}function GE(i,s){Li.m(i,s);var o=Qs;if(o&&i){var c=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+Jt(c)+'"][href="'+Jt(i)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Js(i)}if(!Rn.has(y)&&(i=m({rel:"modulepreload",href:i},s),Rn.set(y,i),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(So(y)))return}c=o.createElement("link"),Lt(c,"link",i),xt(c),o.head.appendChild(c)}}}function ZE(i,s,o){Li.S(i,s,o);var c=Qs;if(c&&i){var p=Qi(c).hoistableStyles,y=Ks(i);s=s||"default";var S=p.get(y);if(!S){var T={loading:0,preload:null};if(S=c.querySelector(wo(y)))T.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},o),(o=Rn.get(y))&&Zh(i,o);var q=S=c.createElement("link");xt(q),Lt(q,"link",i),q._p=new Promise(function(W,ae){q.onload=W,q.onerror=ae}),q.addEventListener("load",function(){T.loading|=1}),q.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Yu(S,s,c)}S={type:"stylesheet",instance:S,count:1,state:T},p.set(y,S)}}}function QE(i,s){Li.X(i,s);var o=Qs;if(o&&i){var c=Qi(o).hoistableScripts,p=Js(i),y=c.get(p);y||(y=o.querySelector(So(p)),y||(i=m({src:i,async:!0},s),(s=Rn.get(p))&&Qh(i,s),y=o.createElement("script"),xt(y),Lt(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function KE(i,s){Li.M(i,s);var o=Qs;if(o&&i){var c=Qi(o).hoistableScripts,p=Js(i),y=c.get(p);y||(y=o.querySelector(So(p)),y||(i=m({src:i,async:!0,type:"module"},s),(s=Rn.get(p))&&Qh(i,s),y=o.createElement("script"),xt(y),Lt(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Jx(i,s,o,c){var p=(p=fe.current)?Fu(p):null;if(!p)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=Ks(o.href),o=Qi(p).hoistableStyles,c=o.get(s),c||(c={type:"style",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=Ks(o.href);var y=Qi(p).hoistableStyles,S=y.get(i);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,S),(y=p.querySelector(wo(i)))&&!y._p&&(S.instance=y,S.state.loading=5),Rn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Rn.set(i,o),y||JE(p,i,o,S.state))),s&&c===null)throw Error(r(528,""));return S}if(s&&c!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Js(o),o=Qi(p).hoistableScripts,c=o.get(s),c||(c={type:"script",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+Jt(i)+'"'}function wo(i){return'link[rel="stylesheet"]['+i+"]"}function Wx(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function JE(i,s,o,c){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=i.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),Lt(s,"link",o),xt(s),i.head.appendChild(s))}function Js(i){return'[src="'+Jt(i)+'"]'}function So(i){return"script[async]"+i}function eb(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var c=i.querySelector('style[data-href~="'+Jt(o.href)+'"]');if(c)return s.instance=c,xt(c),c;var p=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),xt(c),Lt(c,"style",p),Yu(c,o.precedence,i),s.instance=c;case"stylesheet":p=Ks(o.href);var y=i.querySelector(wo(p));if(y)return s.state.loading|=4,s.instance=y,xt(y),y;c=Wx(o),(p=Rn.get(p))&&Zh(c,p),y=(i.ownerDocument||i).createElement("link"),xt(y);var S=y;return S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),Lt(y,"link",c),s.state.loading|=4,Yu(y,o.precedence,i),s.instance=y;case"script":return y=Js(o.src),(p=i.querySelector(So(y)))?(s.instance=p,xt(p),p):(c=o,(p=Rn.get(y))&&(c=m({},o),Qh(c,p)),i=i.ownerDocument||i,p=i.createElement("script"),xt(p),Lt(p,"link",c),i.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,Yu(c,o.precedence,i));return s.instance}function Yu(i,s,o){for(var c=o.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 T=c[S];if(T.dataset.precedence===s)y=T;else if(y!==p)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Zh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Qh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Xu=null;function tb(i,s,o){if(Xu===null){var c=new Map,p=Xu=new Map;p.set(o,c)}else p=Xu,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(i))return c;for(c.set(i,null),o=o.getElementsByTagName(i),p=0;p<o.length;p++){var y=o[p];if(!(y[zr]||y[Tt]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(s)||"";S=i+S;var T=c.get(S);T?T.push(y):c.set(S,[y])}}return c}function nb(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function WE(i,s,o){if(o===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function ib(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function eN(i,s,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Ks(c.href),y=s.querySelector(wo(p));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Gu.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=y,xt(y);return}y=s.ownerDocument||s,c=Wx(c),(p=Rn.get(p))&&Zh(c,p),y=y.createElement("link"),xt(y);var S=y;S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),Lt(y,"link",c),o.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Gu.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var Kh=0;function tN(i,s){return i.stylesheets&&i.count===0&&Qu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var c=setTimeout(function(){if(i.stylesheets&&Qu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Kh===0&&(Kh=62500*DE());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Qu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Kh?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Zu=null;function Qu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Zu=new Map,s.forEach(nN,i),Zu=null,Gu.call(i))}function nN(i,s){if(!(s.state.loading&4)){var o=Zu.get(i);if(o)var c=o.get(null);else{o=new Map,Zu.set(i,o);for(var p=i.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")&&(o.set(S.dataset.precedence,S),c=S)}c&&o.set(null,c)}p=s.instance,S=p.getAttribute("data-precedence"),y=o.get(S)||c,y===c&&o.set(null,p),o.set(S,p),this.count++,c=Gu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),s.state.loading|=4}}var _o={$$typeof:E,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function iN(i,s,o,c,p,y,S,T,q){this.tag=1,this.containerInfo=i,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=za(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=za(0),this.hiddenUpdates=za(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function rb(i,s,o,c,p,y,S,T,q,W,ae,le){return i=new iN(i,s,o,S,q,W,ae,le,T),s=1,y===!0&&(s|=24),y=dn(3,null,null,s),i.current=y,y.stateNode=i,s=Md(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:c,isDehydrated:o,cache:s},Od(y),i}function sb(i){return i?(i=As,i):As}function ab(i,s,o,c,p,y){p=sb(p),c.context===null?c.context=p:c.pendingContext=p,c=rr(s),c.payload={element:o},y=y===void 0?null:y,y!==null&&(c.callback=y),o=sr(i,c,s),o!==null&&(sn(o,i,s),eo(o,i,s))}function ob(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Jh(i,s){ob(i,s),(i=i.alternate)&&ob(i,s)}function lb(i){if(i.tag===13||i.tag===31){var s=Ur(i,67108864);s!==null&&sn(s,i,67108864),Jh(i,67108864)}}function ub(i){if(i.tag===13||i.tag===31){var s=yn();s=Oa(s);var o=Ur(i,s);o!==null&&sn(o,i,s),Jh(i,s)}}var Ku=!0;function rN(i,s,o,c){var p=R.T;R.T=null;var y=I.p;try{I.p=2,Wh(i,s,o,c)}finally{I.p=y,R.T=p}}function sN(i,s,o,c){var p=R.T;R.T=null;var y=I.p;try{I.p=8,Wh(i,s,o,c)}finally{I.p=y,R.T=p}}function Wh(i,s,o,c){if(Ku){var p=ep(c);if(p===null)Uh(i,s,c,Ju,o),fb(i,c);else if(oN(p,i,s,o,c))c.stopPropagation();else if(fb(i,c),s&4&&-1<aN.indexOf(i)){for(;p!==null;){var y=Gi(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=gi(y.pendingLanes);if(S!==0){var T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var q=1<<31-Je(S);T.entanglements[1]|=q,S&=~q}ii(y),(Ke&6)===0&&(Ou=Ct()+500,yo(0))}}break;case 31:case 13:T=Ur(y,2),T!==null&&sn(T,y,2),Lu(),Jh(y,2)}if(y=ep(c),y===null&&Uh(i,s,c,Ju,o),y===p)break;p=y}p!==null&&c.stopPropagation()}else Uh(i,s,c,null,o)}}function ep(i){return i=nd(i),tp(i)}var Ju=null;function tp(i){if(Ju=null,i=Xi(i),i!==null){var s=l(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=u(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Ju=i,null}function cb(i){switch(i){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(Yi()){case se:return 2;case pe:return 8;case _e:case Oe:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var np=!1,gr=null,yr=null,xr=null,ko=new Map,Eo=new Map,br=[],aN="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 fb(i,s){switch(i){case"focusin":case"focusout":gr=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":ko.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eo.delete(s.pointerId)}}function No(i,s,o,c,p,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:o,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},s!==null&&(s=Gi(s),s!==null&&lb(s)),i):(i.eventSystemFlags|=c,s=i.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),i)}function oN(i,s,o,c,p){switch(s){case"focusin":return gr=No(gr,i,s,o,c,p),!0;case"dragenter":return yr=No(yr,i,s,o,c,p),!0;case"mouseover":return xr=No(xr,i,s,o,c,p),!0;case"pointerover":var y=p.pointerId;return ko.set(y,No(ko.get(y)||null,i,s,o,c,p)),!0;case"gotpointercapture":return y=p.pointerId,Eo.set(y,No(Eo.get(y)||null,i,s,o,c,p)),!0}return!1}function db(i){var s=Xi(i.target);if(s!==null){var o=l(s);if(o!==null){if(s=o.tag,s===13){if(s=u(o),s!==null){i.blockedOn=s,Il(i.priority,function(){ub(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,Il(i.priority,function(){ub(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Wu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=ep(i.nativeEvent);if(o===null){o=i.nativeEvent;var c=new o.constructor(o.type,o);td=c,o.target.dispatchEvent(c),td=null}else return s=Gi(o),s!==null&&lb(s),i.blockedOn=o,!1;s.shift()}return!0}function hb(i,s,o){Wu(i)&&o.delete(s)}function lN(){np=!1,gr!==null&&Wu(gr)&&(gr=null),yr!==null&&Wu(yr)&&(yr=null),xr!==null&&Wu(xr)&&(xr=null),ko.forEach(hb),Eo.forEach(hb)}function ec(i,s){i.blockedOn===s&&(i.blockedOn=null,np||(np=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,lN)))}var tc=null;function pb(i){tc!==i&&(tc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tc===i&&(tc=null);for(var s=0;s<i.length;s+=3){var o=i[s],c=i[s+1],p=i[s+2];if(typeof c!="function"){if(tp(c||o)===null)continue;break}var y=Gi(o);y!==null&&(i.splice(s,3),s-=3,eh(y,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Ws(i){function s(q){return ec(q,i)}gr!==null&&ec(gr,i),yr!==null&&ec(yr,i),xr!==null&&ec(xr,i),ko.forEach(s),Eo.forEach(s);for(var o=0;o<br.length;o++){var c=br[o];c.blockedOn===i&&(c.blockedOn=null)}for(;0<br.length&&(o=br[0],o.blockedOn===null);)db(o),o.blockedOn===null&&br.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],y=o[c+1],S=p[It]||null;if(typeof y=="function")S||pb(o);else if(S){var T=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[It]||null)T=S.formAction;else if(tp(p)!==null)continue}else T=S.action;typeof T=="function"?o[c+1]=T:(o.splice(c,3),c-=3),pb(o)}}}function mb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){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",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function ip(i){this._internalRoot=i}nc.prototype.render=ip.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,c=yn();ab(o,c,i,s,null,null)},nc.prototype.unmount=ip.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;ab(i.current,2,null,i,null,null),Lu(),s[yi]=null}};function nc(i){this._internalRoot=i}nc.prototype.unstable_scheduleHydration=function(i){if(i){var s=Ul();i={blockedOn:null,target:i,priority:s};for(var o=0;o<br.length&&s!==0&&s<br[o].priority;o++);br.splice(o,0,i),o===0&&db(i)}};var gb=t.version;if(gb!=="19.2.3")throw Error(r(527,gb,"19.2.3"));I.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var uN={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Rt=ic.inject(uN),mt=ic}catch{}}return To.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,c="",p=_0,y=k0,S=E0;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),s=rb(i,1,!1,null,null,o,c,null,p,y,S,mb),i[yi]=s.current,Hh(i),new ip(s)},To.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var c=!1,p="",y=_0,S=k0,T=E0,q=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(T=o.onRecoverableError),o.formState!==void 0&&(q=o.formState)),s=rb(i,1,!0,s,o??null,c,p,q,y,S,T,mb),s.context=sb(null),o=s.current,c=yn(),c=Oa(c),p=rr(c),p.callback=null,sr(o,p,c),o=c,s.current.lanes=o,Rr(s,o),ii(s),i[yi]=s.current,Hh(i),new nc(s)},To.version="19.2.3",To}var Nb;function xN(){if(Nb)return ap.exports;Nb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ap.exports=yN(),ap.exports}var bN=xN();function Et(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Et(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var vN={value:()=>{}};function mf(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Lc(n)}function Lc(e){this._=e}function wN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Lc.prototype=mf.prototype={constructor:Lc,on:function(e,t){var n=this._,r=wN(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=SN(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Cb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Cb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Lc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function SN(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Cb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=vN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Jp="http://www.w3.org/1999/xhtml";const Tb={svg:"http://www.w3.org/2000/svg",xhtml:Jp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Tb.hasOwnProperty(t)?{space:Tb[t],local:e}:e}function _N(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Jp&&t.documentElement.namespaceURI===Jp?t.createElement(e):t.createElementNS(n,e)}}function kN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sw(e){var t=gf(e);return(t.local?kN:_N)(t)}function EN(){}function Hm(e){return e==null?EN:function(){return this.querySelector(e)}}function NN(e){typeof e!="function"&&(e=Hm(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=new Array(u),d,h,g=0;g<u;++g)(d=l[g])&&(h=e.call(d,d.__data__,g,l))&&("__data__"in d&&(h.__data__=d.__data__),f[g]=h);return new kn(r,this._parents)}function CN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function TN(){return[]}function aw(e){return e==null?TN:function(){return this.querySelectorAll(e)}}function AN(e){return function(){return CN(e.apply(this,arguments))}}function MN(e){typeof e=="function"?e=AN(e):e=aw(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],f=u.length,d,h=0;h<f;++h)(d=u[h])&&(r.push(e.call(d,d.__data__,h,u)),a.push(d));return new kn(r,a)}function ow(e){return function(){return this.matches(e)}}function lw(e){return function(t){return t.matches(e)}}var jN=Array.prototype.find;function RN(e){return function(){return jN.call(this.children,e)}}function zN(){return this.firstElementChild}function ON(e){return this.select(e==null?zN:RN(typeof e=="function"?e:lw(e)))}var DN=Array.prototype.filter;function LN(){return Array.from(this.children)}function BN(e){return function(){return DN.call(this.children,e)}}function HN(e){return this.selectAll(e==null?LN:BN(typeof e=="function"?e:lw(e)))}function UN(e){typeof e!="function"&&(e=ow(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&f.push(d);return new kn(r,this._parents)}function uw(e){return new Array(e.length)}function IN(){return new kn(this._enter||this._groups.map(uw),this._parents)}function Gc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gc.prototype={constructor:Gc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qN(e){return function(){return e}}function $N(e,t,n,r,a,l){for(var u=0,f,d=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],r[u]=f):n[u]=new Gc(e,l[u]);for(;u<d;++u)(f=t[u])&&(a[u]=f)}function PN(e,t,n,r,a,l,u){var f,d,h=new Map,g=t.length,m=l.length,x=new Array(g),b;for(f=0;f<g;++f)(d=t[f])&&(x[f]=b=u.call(d,d.__data__,f,t)+"",h.has(b)?a[f]=d:h.set(b,d));for(f=0;f<m;++f)b=u.call(e,l[f],f,l)+"",(d=h.get(b))?(r[f]=d,d.__data__=l[f],h.delete(b)):n[f]=new Gc(e,l[f]);for(f=0;f<g;++f)(d=t[f])&&h.get(x[f])===d&&(a[f]=d)}function VN(e){return e.__data__}function FN(e,t){if(!arguments.length)return Array.from(this,VN);var n=t?PN:$N,r=this._parents,a=this._groups;typeof e!="function"&&(e=qN(e));for(var l=a.length,u=new Array(l),f=new Array(l),d=new Array(l),h=0;h<l;++h){var g=r[h],m=a[h],x=m.length,b=YN(e.call(g,g&&g.__data__,h,r)),w=b.length,k=f[h]=new Array(w),N=u[h]=new Array(w),_=d[h]=new Array(x);n(g,m,k,N,_,b,t);for(var z=0,E=0,C,L;z<w;++z)if(C=k[z]){for(z>=E&&(E=z+1);!(L=N[E])&&++E<w;);C._next=L||null}}return u=new kn(u,r),u._enter=f,u._exit=d,u}function YN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function XN(){return new kn(this._exit||this._groups.map(uw),this._parents)}function GN(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function ZN(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),f=new Array(a),d=0;d<u;++d)for(var h=n[d],g=r[d],m=h.length,x=f[d]=new Array(m),b,w=0;w<m;++w)(b=h[w]||g[w])&&(x[w]=b);for(;d<a;++d)f[d]=n[d];return new kn(f,this._parents)}function QN(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function KN(e){e||(e=JN);function t(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],f=u.length,d=a[l]=new Array(f),h,g=0;g<f;++g)(h=u[g])&&(d[g]=h);d.sort(t)}return new kn(a,this._parents).order()}function JN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function WN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function eC(){return Array.from(this)}function tC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function nC(){let e=0;for(const t of this)++e;return e}function iC(){return!this.node()}function rC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,f;l<u;++l)(f=a[l])&&e.call(f,f.__data__,l,a);return this}function sC(e){return function(){this.removeAttribute(e)}}function aC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oC(e,t){return function(){this.setAttribute(e,t)}}function lC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function uC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function fC(e,t){var n=gf(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?aC:sC:typeof t=="function"?n.local?cC:uC:n.local?lC:oC)(n,t))}function cw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dC(e){return function(){this.style.removeProperty(e)}}function hC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function pC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function mC(e,t,n){return arguments.length>1?this.each((t==null?dC:typeof t=="function"?pC:hC)(e,t,n??"")):ga(this.node(),e)}function ga(e,t){return e.style.getPropertyValue(t)||cw(e).getComputedStyle(e,null).getPropertyValue(t)}function gC(e){return function(){delete this[e]}}function yC(e,t){return function(){this[e]=t}}function xC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function bC(e,t){return arguments.length>1?this.each((t==null?gC:typeof t=="function"?xC:yC)(e,t)):this.node()[e]}function fw(e){return e.trim().split(/^|\s+/)}function Um(e){return e.classList||new dw(e)}function dw(e){this._node=e,this._names=fw(e.getAttribute("class")||"")}dw.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function hw(e,t){for(var n=Um(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function pw(e,t){for(var n=Um(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function vC(e){return function(){hw(this,e)}}function wC(e){return function(){pw(this,e)}}function SC(e,t){return function(){(t.apply(this,arguments)?hw:pw)(this,e)}}function _C(e,t){var n=fw(e+"");if(arguments.length<2){for(var r=Um(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?SC:t?vC:wC)(n,t))}function kC(){this.textContent=""}function EC(e){return function(){this.textContent=e}}function NC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function CC(e){return arguments.length?this.each(e==null?kC:(typeof e=="function"?NC:EC)(e)):this.node().textContent}function TC(){this.innerHTML=""}function AC(e){return function(){this.innerHTML=e}}function MC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jC(e){return arguments.length?this.each(e==null?TC:(typeof e=="function"?MC:AC)(e)):this.node().innerHTML}function RC(){this.nextSibling&&this.parentNode.appendChild(this)}function zC(){return this.each(RC)}function OC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function DC(){return this.each(OC)}function LC(e){var t=typeof e=="function"?e:sw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function BC(){return null}function HC(e,t){var n=typeof e=="function"?e:sw(e),r=t==null?BC:typeof t=="function"?t:Hm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function UC(){var e=this.parentNode;e&&e.removeChild(this)}function IC(){return this.each(UC)}function qC(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $C(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function PC(e){return this.select(e?$C:qC)}function VC(e){return arguments.length?this.property("__data__",e):this.node().__data__}function FC(e){return function(t){e.call(this,t,this.__data__)}}function YC(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function XC(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function GC(e,t,n){return function(){var r=this.__on,a,l=FC(t);if(r){for(var u=0,f=r.length;u<f;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function ZC(e,t,n){var r=YC(e+""),a,l=r.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var d=0,h=f.length,g;d<h;++d)for(a=0,g=f[d];a<l;++a)if((u=r[a]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?GC:XC,a=0;a<l;++a)this.each(f(r[a],t,n));return this}function mw(e,t,n){var r=cw(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function QC(e,t){return function(){return mw(this,e,t)}}function KC(e,t){return function(){return mw(this,e,t.apply(this,arguments))}}function JC(e,t){return this.each((typeof t=="function"?KC:QC)(e,t))}function*WC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var gw=[null];function kn(e,t){this._groups=e,this._parents=t}function Sl(){return new kn([[document.documentElement]],gw)}function eT(){return this}kn.prototype=Sl.prototype={constructor:kn,select:NN,selectAll:MN,selectChild:ON,selectChildren:HN,filter:UN,data:FN,enter:IN,exit:XN,join:GN,merge:ZN,selection:eT,order:QN,sort:KN,call:WN,nodes:eC,node:tC,size:nC,empty:iC,each:rC,attr:fC,style:mC,property:bC,classed:_C,text:CC,html:jC,raise:zC,lower:DC,append:LC,insert:HC,remove:IC,clone:PC,datum:VC,on:ZC,dispatch:JC,[Symbol.iterator]:WC};function Sn(e){return typeof e=="string"?new kn([[document.querySelector(e)]],[document.documentElement]):new kn([[e]],gw)}function tT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pn(e,t){if(e=tT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const nT={passive:!1},ll={capture:!0,passive:!1};function cp(e){e.stopImmediatePropagation()}function ca(e){e.preventDefault(),e.stopImmediatePropagation()}function yw(e){var t=e.document.documentElement,n=Sn(e).on("dragstart.drag",ca,ll);"onselectstart"in t?n.on("selectstart.drag",ca,ll):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xw(e,t){var n=e.document.documentElement,r=Sn(e).on("dragstart.drag",null);t&&(r.on("click.drag",ca,ll),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const rc=e=>()=>e;function Wp(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:f,dx:d,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Wp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function iT(e){return!e.ctrlKey&&!e.button}function rT(){return this.parentNode}function sT(e,t){return t??{x:e.x,y:e.y}}function aT(){return navigator.maxTouchPoints||"ontouchstart"in this}function bw(){var e=iT,t=rT,n=sT,r=aT,a={},l=mf("start","drag","end"),u=0,f,d,h,g,m=0;function x(C){C.on("mousedown.drag",b).filter(r).on("touchstart.drag",N).on("touchmove.drag",_,nT).on("touchend.drag touchcancel.drag",z).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=E(this,t.call(this,C,L),C,L,"mouse");A&&(Sn(C.view).on("mousemove.drag",w,ll).on("mouseup.drag",k,ll),yw(C.view),cp(C),h=!1,f=C.clientX,d=C.clientY,A("start",C))}}function w(C){if(ca(C),!h){var L=C.clientX-f,A=C.clientY-d;h=L*L+A*A>m}a.mouse("drag",C)}function k(C){Sn(C.view).on("mousemove.drag mouseup.drag",null),xw(C.view,h),ca(C),a.mouse("end",C)}function N(C,L){if(e.call(this,C,L)){var A=C.changedTouches,B=t.call(this,C,L),G=A.length,Z,H;for(Z=0;Z<G;++Z)(H=E(this,B,C,L,A[Z].identifier,A[Z]))&&(cp(C),H("start",C,A[Z]))}}function _(C){var L=C.changedTouches,A=L.length,B,G;for(B=0;B<A;++B)(G=a[L[B].identifier])&&(ca(C),G("drag",C,L[B]))}function z(C){var L=C.changedTouches,A=L.length,B,G;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),B=0;B<A;++B)(G=a[L[B].identifier])&&(cp(C),G("end",C,L[B]))}function E(C,L,A,B,G,Z){var H=l.copy(),$=Pn(Z||A,L),P,te,D;if((D=n.call(C,new Wp("beforestart",{sourceEvent:A,target:x,identifier:G,active:u,x:$[0],y:$[1],dx:0,dy:0,dispatch:H}),B))!=null)return P=D.x-$[0]||0,te=D.y-$[1]||0,function U(R,I,F){var K=$,j;switch(R){case"start":a[G]=U,j=u++;break;case"end":delete a[G],--u;case"drag":$=Pn(F||I,L),j=u;break}H.call(R,C,new Wp(R,{sourceEvent:I,subject:D,target:x,identifier:G,active:j,x:$[0]+P,y:$[1]+te,dx:$[0]-K[0],dy:$[1]-K[1],dispatch:H}),B)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:rc(!!C),x):e},x.container=function(C){return arguments.length?(t=typeof C=="function"?C:rc(C),x):t},x.subject=function(C){return arguments.length?(n=typeof C=="function"?C:rc(C),x):n},x.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:rc(!!C),x):r},x.on=function(){var C=l.on.apply(l,arguments);return C===l?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function Im(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _l(){}var ul=.7,Zc=1/ul,fa="\\s*([+-]?\\d+)\\s*",cl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oT=/^#([0-9a-f]{3,8})$/,lT=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),uT=new RegExp(`^rgb\\(${oi},${oi},${oi}\\)$`),cT=new RegExp(`^rgba\\(${fa},${fa},${fa},${cl}\\)$`),fT=new RegExp(`^rgba\\(${oi},${oi},${oi},${cl}\\)$`),dT=new RegExp(`^hsl\\(${cl},${oi},${oi}\\)$`),hT=new RegExp(`^hsla\\(${cl},${oi},${oi},${cl}\\)$`),Ab={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};Im(_l,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mb,formatHex:Mb,formatHex8:pT,formatHsl:mT,formatRgb:jb,toString:jb});function Mb(){return this.rgb().formatHex()}function pT(){return this.rgb().formatHex8()}function mT(){return ww(this).formatHsl()}function jb(){return this.rgb().formatRgb()}function os(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rb(t):n===3?new on(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lT.exec(e))?new on(t[1],t[2],t[3],1):(t=uT.exec(e))?new on(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cT.exec(e))?sc(t[1],t[2],t[3],t[4]):(t=fT.exec(e))?sc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dT.exec(e))?Db(t[1],t[2]/100,t[3]/100,1):(t=hT.exec(e))?Db(t[1],t[2]/100,t[3]/100,t[4]):Ab.hasOwnProperty(e)?Rb(Ab[e]):e==="transparent"?new on(NaN,NaN,NaN,0):null}function Rb(e){return new on(e>>16&255,e>>8&255,e&255,1)}function sc(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function gT(e){return e instanceof _l||(e=os(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function em(e,t,n,r){return arguments.length===1?gT(e):new on(e,t,n,r??1)}function on(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Im(on,em,vw(_l,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new on(ss(this.r),ss(this.g),ss(this.b),Qc(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:zb,formatHex:zb,formatHex8:yT,formatRgb:Ob,toString:Ob}));function zb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function yT(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ob(){const e=Qc(this.opacity);return`${e===1?"rgb(":"rgba("}${ss(this.r)}, ${ss(this.g)}, ${ss(this.b)}${e===1?")":`, ${e})`}`}function Qc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ss(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=ss(e),(e<16?"0":"")+e.toString(16)}function Db(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fn(e,t,n,r)}function ww(e){if(e instanceof Fn)return new Fn(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=os(e)),!e)return new Fn;if(e instanceof Fn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,f=l-a,d=(l+a)/2;return f?(t===l?u=(n-r)/f+(n<r)*6:n===l?u=(r-t)/f+2:u=(t-n)/f+4,f/=d<.5?l+a:2-l-a,u*=60):f=d>0&&d<1?0:u,new Fn(u,f,d,e.opacity)}function xT(e,t,n,r){return arguments.length===1?ww(e):new Fn(e,t,n,r??1)}function Fn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Im(Fn,xT,vw(_l,{brighter(e){return e=e==null?Zc:Math.pow(Zc,e),new Fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new Fn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new on(fp(e>=240?e-240:e+120,a,r),fp(e,a,r),fp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Fn(Lb(this.h),ac(this.s),ac(this.l),Qc(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=Qc(this.opacity);return`${e===1?"hsl(":"hsla("}${Lb(this.h)}, ${ac(this.s)*100}%, ${ac(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lb(e){return e=(e||0)%360,e<0?e+360:e}function ac(e){return Math.max(0,Math.min(1,e||0))}function fp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qm=e=>()=>e;function bT(e,t){return function(n){return e+n*t}}function vT(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function wT(e){return(e=+e)==1?Sw:function(t,n){return n-t?vT(t,n,e):qm(isNaN(t)?n:t)}}function Sw(e,t){var n=t-e;return n?bT(e,n):qm(isNaN(e)?t:e)}const Kc=(function e(t){var n=wT(t);function r(a,l){var u=n((a=em(a)).r,(l=em(l)).r),f=n(a.g,l.g),d=n(a.b,l.b),h=Sw(a.opacity,l.opacity);return function(g){return a.r=u(g),a.g=f(g),a.b=d(g),a.opacity=h(g),a+""}}return r.gamma=e,r})(1);function ST(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function _T(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kT(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=il(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(f){for(u=0;u<r;++u)l[u]=a[u](f);return l}}function ET(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function si(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function NT(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=il(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var tm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dp=new RegExp(tm.source,"g");function CT(e){return function(){return e}}function TT(e){return function(t){return e(t)+""}}function _w(e,t){var n=tm.lastIndex=dp.lastIndex=0,r,a,l,u=-1,f=[],d=[];for(e=e+"",t=t+"";(r=tm.exec(e))&&(a=dp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),f[u]?f[u]+=l:f[++u]=l),(r=r[0])===(a=a[0])?f[u]?f[u]+=a:f[++u]=a:(f[++u]=null,d.push({i:u,x:si(r,a)})),n=dp.lastIndex;return n<t.length&&(l=t.slice(n),f[u]?f[u]+=l:f[++u]=l),f.length<2?d[0]?TT(d[0].x):CT(t):(t=d.length,function(h){for(var g=0,m;g<t;++g)f[(m=d[g]).i]=m.x(h);return f.join("")})}function il(e,t){var n=typeof t,r;return t==null||n==="boolean"?qm(t):(n==="number"?si:n==="string"?(r=os(t))?(t=r,Kc):_w:t instanceof os?Kc:t instanceof Date?ET:_T(t)?ST:Array.isArray(t)?kT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?NT:si)(e,t)}var Bb=180/Math.PI,nm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kw(e,t,n,r,a,l){var u,f,d;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,d/=f),e*r<t*n&&(e=-e,t=-t,d=-d,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Bb,skewX:Math.atan(d)*Bb,scaleX:u,scaleY:f}}var oc;function AT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?nm:kw(t.a,t.b,t.c,t.d,t.e,t.f)}function MT(e){return e==null||(oc||(oc=document.createElementNS("http://www.w3.org/2000/svg","g")),oc.setAttribute("transform",e),!(e=oc.transform.baseVal.consolidate()))?nm:(e=e.matrix,kw(e.a,e.b,e.c,e.d,e.e,e.f))}function Ew(e,t,n,r){function a(h){return h.length?h.pop()+" ":""}function l(h,g,m,x,b,w){if(h!==m||g!==x){var k=b.push("translate(",null,t,null,n);w.push({i:k-4,x:si(h,m)},{i:k-2,x:si(g,x)})}else(m||x)&&b.push("translate("+m+t+x+n)}function u(h,g,m,x){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),x.push({i:m.push(a(m)+"rotate(",null,r)-2,x:si(h,g)})):g&&m.push(a(m)+"rotate("+g+r)}function f(h,g,m,x){h!==g?x.push({i:m.push(a(m)+"skewX(",null,r)-2,x:si(h,g)}):g&&m.push(a(m)+"skewX("+g+r)}function d(h,g,m,x,b,w){if(h!==m||g!==x){var k=b.push(a(b)+"scale(",null,",",null,")");w.push({i:k-4,x:si(h,m)},{i:k-2,x:si(g,x)})}else(m!==1||x!==1)&&b.push(a(b)+"scale("+m+","+x+")")}return function(h,g){var m=[],x=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,m,x),u(h.rotate,g.rotate,m,x),f(h.skewX,g.skewX,m,x),d(h.scaleX,h.scaleY,g.scaleX,g.scaleY,m,x),h=g=null,function(b){for(var w=-1,k=x.length,N;++w<k;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var jT=Ew(AT,"px, ","px)","deg)"),RT=Ew(MT,", ",")",")"),zT=1e-12;function Hb(e){return((e=Math.exp(e))+1/e)/2}function OT(e){return((e=Math.exp(e))-1/e)/2}function DT(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bc=(function e(t,n,r){function a(l,u){var f=l[0],d=l[1],h=l[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-d,k=b*b+w*w,N,_;if(k<zT)_=Math.log(x/h)/t,N=function(B){return[f+B*b,d+B*w,h*Math.exp(t*B*_)]};else{var z=Math.sqrt(k),E=(x*x-h*h+r*k)/(2*h*n*z),C=(x*x-h*h-r*k)/(2*x*n*z),L=Math.log(Math.sqrt(E*E+1)-E),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/t,N=function(B){var G=B*_,Z=Hb(L),H=h/(n*z)*(Z*DT(t*G+L)-OT(L));return[f+H*b,d+H*w,h*Z/Hb(t*G+L)]}}return N.duration=_*1e3*t/Math.SQRT2,N}return a.rho=function(l){var u=Math.max(.001,+l),f=u*u,d=f*f;return e(u,f,d)},a})(Math.SQRT2,2,4);var ya=0,Jo=0,Ao=0,Nw=1e3,Jc,Wo,Wc=0,ls=0,yf=0,fl=typeof performance=="object"&&performance.now?performance:Date,Cw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $m(){return ls||(Cw(LT),ls=fl.now()+yf)}function LT(){ls=0}function ef(){this._call=this._time=this._next=null}ef.prototype=Tw.prototype={constructor:ef,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$m():+n)+(t==null?0:+t),!this._next&&Wo!==this&&(Wo?Wo._next=this:Jc=this,Wo=this),this._call=e,this._time=n,im()},stop:function(){this._call&&(this._call=null,this._time=1/0,im())}};function Tw(e,t,n){var r=new ef;return r.restart(e,t,n),r}function BT(){$m(),++ya;for(var e=Jc,t;e;)(t=ls-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ya}function Ub(){ls=(Wc=fl.now())+yf,ya=Jo=0;try{BT()}finally{ya=0,UT(),ls=0}}function HT(){var e=fl.now(),t=e-Wc;t>Nw&&(yf-=t,Wc=e)}function UT(){for(var e,t=Jc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jc=n);Wo=e,im(r)}function im(e){if(!ya){Jo&&(Jo=clearTimeout(Jo));var t=e-ls;t>24?(e<1/0&&(Jo=setTimeout(Ub,e-fl.now()-yf)),Ao&&(Ao=clearInterval(Ao))):(Ao||(Wc=fl.now(),Ao=setInterval(HT,Nw)),ya=1,Cw(Ub))}}function Ib(e,t,n){var r=new ef;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var IT=mf("start","end","cancel","interrupt"),qT=[],Aw=0,qb=1,rm=2,Hc=3,$b=4,sm=5,Uc=6;function xf(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;$T(e,n,{name:t,index:r,group:a,on:IT,tween:qT,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Aw})}function Pm(e,t){var n=Qn(e,t);if(n.state>Aw)throw new Error("too late; already scheduled");return n}function di(e,t){var n=Qn(e,t);if(n.state>Hc)throw new Error("too late; already running");return n}function Qn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $T(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=Tw(l,0,n.time);function l(h){n.state=qb,n.timer.restart(u,n.delay,n.time),n.delay<=h&&u(h-n.delay)}function u(h){var g,m,x,b;if(n.state!==qb)return d();for(g in r)if(b=r[g],b.name===n.name){if(b.state===Hc)return Ib(u);b.state===$b?(b.state=Uc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[g]):+g<t&&(b.state=Uc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[g])}if(Ib(function(){n.state===Hc&&(n.state=$b,n.timer.restart(f,n.delay,n.time),f(h))}),n.state=rm,n.on.call("start",e,e.__data__,n.index,n.group),n.state===rm){for(n.state=Hc,a=new Array(x=n.tween.length),g=0,m=-1;g<x;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function f(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=sm,1),m=-1,x=a.length;++m<x;)a[m].call(e,g);n.state===sm&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Uc,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function Ic(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>rm&&r.state<sm,r.state=Uc,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function PT(e){return this.each(function(){Ic(this,e)})}function VT(e,t){var n,r;return function(){var a=di(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,f=r.length;u<f;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function FT(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=di(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var f={name:t,value:n},d=0,h=a.length;d<h;++d)if(a[d].name===t){a[d]=f;break}d===h&&a.push(f)}l.tween=a}}function YT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Qn(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?VT:FT)(n,e,t))}function Vm(e,t,n){var r=e._id;return e.each(function(){var a=di(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Qn(a,r).value[t]}}function Mw(e,t){var n;return(typeof t=="number"?si:t instanceof os?Kc:(n=os(t))?(t=n,Kc):_w)(e,t)}function XT(e){return function(){this.removeAttribute(e)}}function GT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ZT(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function QT(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function KT(e,t,n){var r,a,l;return function(){var u,f=n(this),d;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),d=f+"",u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f)))}}function JT(e,t,n){var r,a,l;return function(){var u,f=n(this),d;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),d=f+"",u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f)))}}function WT(e,t){var n=gf(e),r=n==="transform"?RT:Mw;return this.attrTween(e,typeof t=="function"?(n.local?JT:KT)(n,r,Vm(this,"attr."+e,t)):t==null?(n.local?GT:XT)(n):(n.local?QT:ZT)(n,r,t))}function e4(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function t4(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function n4(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&t4(e,l)),n}return a._value=t,a}function i4(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&e4(e,l)),n}return a._value=t,a}function r4(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=gf(e);return this.tween(n,(r.local?n4:i4)(r,t))}function s4(e,t){return function(){Pm(this,e).delay=+t.apply(this,arguments)}}function a4(e,t){return t=+t,function(){Pm(this,e).delay=t}}function o4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?s4:a4)(t,e)):Qn(this.node(),t).delay}function l4(e,t){return function(){di(this,e).duration=+t.apply(this,arguments)}}function u4(e,t){return t=+t,function(){di(this,e).duration=t}}function c4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l4:u4)(t,e)):Qn(this.node(),t).duration}function f4(e,t){if(typeof t!="function")throw new Error;return function(){di(this,e).ease=t}}function d4(e){var t=this._id;return arguments.length?this.each(f4(t,e)):Qn(this.node(),t).ease}function h4(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;di(this,e).ease=n}}function p4(e){if(typeof e!="function")throw new Error;return this.each(h4(this._id,e))}function m4(e){typeof e!="function"&&(e=ow(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&f.push(d);return new Pi(r,this._parents,this._name,this._id)}function g4(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),f=0;f<l;++f)for(var d=t[f],h=n[f],g=d.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=d[b]||h[b])&&(m[b]=x);for(;f<r;++f)u[f]=t[f];return new Pi(u,this._parents,this._name,this._id)}function y4(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function x4(e,t,n){var r,a,l=y4(t)?Pm:di;return function(){var u=l(this,e),f=u.on;f!==r&&(a=(r=f).copy()).on(t,n),u.on=a}}function b4(e,t){var n=this._id;return arguments.length<2?Qn(this.node(),n).on.on(e):this.each(x4(n,e,t))}function v4(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function w4(){return this.on("end.remove",v4(this._id))}function S4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hm(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var f=r[u],d=f.length,h=l[u]=new Array(d),g,m,x=0;x<d;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),h[x]=m,xf(h[x],t,n,x,h,Qn(g,n)));return new Pi(l,this._parents,t,n)}function _4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=aw(e));for(var r=this._groups,a=r.length,l=[],u=[],f=0;f<a;++f)for(var d=r[f],h=d.length,g,m=0;m<h;++m)if(g=d[m]){for(var x=e.call(g,g.__data__,m,d),b,w=Qn(g,n),k=0,N=x.length;k<N;++k)(b=x[k])&&xf(b,t,n,k,x,w);l.push(x),u.push(g)}return new Pi(l,u,t,n)}var k4=Sl.prototype.constructor;function E4(){return new k4(this._groups,this._parents)}function N4(e,t){var n,r,a;return function(){var l=ga(this,e),u=(this.style.removeProperty(e),ga(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function jw(e){return function(){this.style.removeProperty(e)}}function C4(e,t,n){var r,a=n+"",l;return function(){var u=ga(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function T4(e,t,n){var r,a,l;return function(){var u=ga(this,e),f=n(this),d=f+"";return f==null&&(d=f=(this.style.removeProperty(e),ga(this,e))),u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f))}}function A4(e,t){var n,r,a,l="style."+t,u="end."+l,f;return function(){var d=di(this,e),h=d.on,g=d.value[l]==null?f||(f=jw(t)):void 0;(h!==n||a!==g)&&(r=(n=h).copy()).on(u,a=g),d.on=r}}function M4(e,t,n){var r=(e+="")=="transform"?jT:Mw;return t==null?this.styleTween(e,N4(e,r)).on("end.style."+e,jw(e)):typeof t=="function"?this.styleTween(e,T4(e,r,Vm(this,"style."+e,t))).each(A4(this._id,e)):this.styleTween(e,C4(e,r,t),n).on("end.style."+e,null)}function j4(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function R4(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&j4(e,u,n)),r}return l._value=t,l}function z4(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,R4(e,t,n??""))}function O4(e){return function(){this.textContent=e}}function D4(e){return function(){var t=e(this);this.textContent=t??""}}function L4(e){return this.tween("text",typeof e=="function"?D4(Vm(this,"text",e)):O4(e==null?"":e+""))}function B4(e){return function(t){this.textContent=e.call(this,t)}}function H4(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&B4(a)),t}return r._value=e,r}function U4(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,H4(e))}function I4(){for(var e=this._name,t=this._id,n=Rw(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],f=u.length,d,h=0;h<f;++h)if(d=u[h]){var g=Qn(d,t);xf(d,e,n,h,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Pi(r,this._parents,e,n)}function q4(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var f={value:u},d={value:function(){--a===0&&l()}};n.each(function(){var h=di(this,r),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(d)),h.on=t}),a===0&&l()})}var $4=0;function Pi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Rw(){return++$4}var Bi=Sl.prototype;Pi.prototype={constructor:Pi,select:S4,selectAll:_4,selectChild:Bi.selectChild,selectChildren:Bi.selectChildren,filter:m4,merge:g4,selection:E4,transition:I4,call:Bi.call,nodes:Bi.nodes,node:Bi.node,size:Bi.size,empty:Bi.empty,each:Bi.each,on:b4,attr:WT,attrTween:r4,style:M4,styleTween:z4,text:L4,textTween:U4,remove:w4,tween:YT,delay:o4,duration:c4,ease:d4,easeVarying:p4,end:q4,[Symbol.iterator]:Bi[Symbol.iterator]};function P4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var V4={time:null,delay:0,duration:250,ease:P4};function F4(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Y4(e){var t,n;e instanceof Pi?(t=e._id,e=e._name):(t=Rw(),(n=V4).time=$m(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],f=u.length,d,h=0;h<f;++h)(d=u[h])&&xf(d,e,t,h,u,n||F4(d,t));return new Pi(r,this._parents,e,t)}Sl.prototype.interrupt=PT;Sl.prototype.transition=Y4;const lc=e=>()=>e;function X4(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function qi(e,t,n){this.k=e,this.x=t,this.y=n}qi.prototype={constructor:qi,scale:function(e){return e===1?this:new qi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bf=new qi(1,0,0);zw.prototype=qi.prototype;function zw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bf;return e.__zoom}function hp(e){e.stopImmediatePropagation()}function Mo(e){e.preventDefault(),e.stopImmediatePropagation()}function G4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Z4(){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 Pb(){return this.__zoom||bf}function Q4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function K4(){return navigator.maxTouchPoints||"ontouchstart"in this}function J4(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function Ow(){var e=G4,t=Z4,n=J4,r=Q4,a=K4,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,d=Bc,h=mf("start","zoom","end"),g,m,x,b=500,w=150,k=0,N=10;function _(D){D.property("__zoom",Pb).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(a).on("touchstart.zoom",$).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(D,U,R,I){var F=D.selection?D.selection():D;F.property("__zoom",Pb),D!==F?L(D,U,R,I):F.interrupt().each(function(){A(this,arguments).event(I).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},_.scaleBy=function(D,U,R,I){_.scaleTo(D,function(){var F=this.__zoom.k,K=typeof U=="function"?U.apply(this,arguments):U;return F*K},R,I)},_.scaleTo=function(D,U,R,I){_.transform(D,function(){var F=t.apply(this,arguments),K=this.__zoom,j=R==null?C(F):typeof R=="function"?R.apply(this,arguments):R,O=K.invert(j),V=typeof U=="function"?U.apply(this,arguments):U;return n(E(z(K,V),j,O),F,u)},R,I)},_.translateBy=function(D,U,R,I){_.transform(D,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),u)},null,I)},_.translateTo=function(D,U,R,I,F){_.transform(D,function(){var K=t.apply(this,arguments),j=this.__zoom,O=I==null?C(K):typeof I=="function"?I.apply(this,arguments):I;return n(bf.translate(O[0],O[1]).scale(j.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof R=="function"?-R.apply(this,arguments):-R),K,u)},I,F)};function z(D,U){return U=Math.max(l[0],Math.min(l[1],U)),U===D.k?D:new qi(U,D.x,D.y)}function E(D,U,R){var I=U[0]-R[0]*D.k,F=U[1]-R[1]*D.k;return I===D.x&&F===D.y?D:new qi(D.k,I,F)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function L(D,U,R,I){D.on("start.zoom",function(){A(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(I).end()}).tween("zoom",function(){var F=this,K=arguments,j=A(F,K).event(I),O=t.apply(F,K),V=R==null?C(O):typeof R=="function"?R.apply(F,K):R,M=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),ie=F.__zoom,ce=typeof U=="function"?U.apply(F,K):U,fe=d(ie.invert(V).concat(M/ie.k),ce.invert(V).concat(M/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=M/ue[2];he=new qi(me,V[0]-ue[0]*me,V[1]-ue[1]*me)}j.zoom(null,he)}})}function A(D,U,R){return!R&&D.__zooming||new B(D,U)}function B(D,U){this.that=D,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,U),this.taps=0}B.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,U){return this.mouse&&D!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var U=Sn(this.that).datum();h.call(D,this.that,new X4(D,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:h}),U)}};function G(D,...U){if(!e.apply(this,arguments))return;var R=A(this,U).event(D),I=this.__zoom,F=Math.max(l[0],Math.min(l[1],I.k*Math.pow(2,r.apply(this,arguments)))),K=Pn(D);if(R.wheel)(R.mouse[0][0]!==K[0]||R.mouse[0][1]!==K[1])&&(R.mouse[1]=I.invert(R.mouse[0]=K)),clearTimeout(R.wheel);else{if(I.k===F)return;R.mouse=[K,I.invert(K)],Ic(this),R.start()}Mo(D),R.wheel=setTimeout(j,w),R.zoom("mouse",n(E(z(I,F),R.mouse[0],R.mouse[1]),R.extent,u));function j(){R.wheel=null,R.end()}}function Z(D,...U){if(x||!e.apply(this,arguments))return;var R=D.currentTarget,I=A(this,U,!0).event(D),F=Sn(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",M,!0),K=Pn(D,R),j=D.clientX,O=D.clientY;yw(D.view),hp(D),I.mouse=[K,this.__zoom.invert(K)],Ic(this),I.start();function V(ie){if(Mo(ie),!I.moved){var ce=ie.clientX-j,fe=ie.clientY-O;I.moved=ce*ce+fe*fe>k}I.event(ie).zoom("mouse",n(E(I.that.__zoom,I.mouse[0]=Pn(ie,R),I.mouse[1]),I.extent,u))}function M(ie){F.on("mousemove.zoom mouseup.zoom",null),xw(ie.view,I.moved),Mo(ie),I.event(ie).end()}}function H(D,...U){if(e.apply(this,arguments)){var R=this.__zoom,I=Pn(D.changedTouches?D.changedTouches[0]:D,this),F=R.invert(I),K=R.k*(D.shiftKey?.5:2),j=n(E(z(R,K),I,F),t.apply(this,U),u);Mo(D),f>0?Sn(this).transition().duration(f).call(L,j,I,D):Sn(this).call(_.transform,j,I,D)}}function $(D,...U){if(e.apply(this,arguments)){var R=D.touches,I=R.length,F=A(this,U,D.changedTouches.length===I).event(D),K,j,O,V;for(hp(D),j=0;j<I;++j)O=R[j],V=Pn(O,this),V=[V,this.__zoom.invert(V),O.identifier],F.touch0?!F.touch1&&F.touch0[2]!==V[2]&&(F.touch1=V,F.taps=0):(F.touch0=V,K=!0,F.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(F.taps<2&&(m=V[0],g=setTimeout(function(){g=null},b)),Ic(this),F.start())}}function P(D,...U){if(this.__zooming){var R=A(this,U).event(D),I=D.changedTouches,F=I.length,K,j,O,V;for(Mo(D),K=0;K<F;++K)j=I[K],O=Pn(j,this),R.touch0&&R.touch0[2]===j.identifier?R.touch0[0]=O:R.touch1&&R.touch1[2]===j.identifier&&(R.touch1[0]=O);if(j=R.that.__zoom,R.touch1){var M=R.touch0[0],ie=R.touch0[1],ce=R.touch1[0],fe=R.touch1[1],he=(he=ce[0]-M[0])*he+(he=ce[1]-M[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;j=z(j,Math.sqrt(he/ue)),O=[(M[0]+ce[0])/2,(M[1]+ce[1])/2],V=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(R.touch0)O=R.touch0[0],V=R.touch0[1];else return;R.zoom("touch",n(E(j,O,V),R.extent,u))}}function te(D,...U){if(this.__zooming){var R=A(this,U).event(D),I=D.changedTouches,F=I.length,K,j;for(hp(D),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<F;++K)j=I[K],R.touch0&&R.touch0[2]===j.identifier?delete R.touch0:R.touch1&&R.touch1[2]===j.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(j=Pn(j,this),Math.hypot(m[0]-j[0],m[1]-j[1])<N)){var O=Sn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return _.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:lc(+D),_):r},_.filter=function(D){return arguments.length?(e=typeof D=="function"?D:lc(!!D),_):e},_.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:lc(!!D),_):a},_.extent=function(D){return arguments.length?(t=typeof D=="function"?D:lc([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),_):t},_.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],_):[l[0],l[1]]},_.translateExtent=function(D){return arguments.length?(u[0][0]=+D[0][0],u[1][0]=+D[1][0],u[0][1]=+D[0][1],u[1][1]=+D[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(D){return arguments.length?(n=D,_):n},_.duration=function(D){return arguments.length?(f=+D,_):f},_.interpolate=function(D){return arguments.length?(d=D,_):d},_.on=function(){var D=h.on.apply(h,arguments);return D===h?_:D},_.clickDistance=function(D){return arguments.length?(k=(D=+D)*D,_):Math.sqrt(k)},_.tapDistance=function(D){return arguments.length?(N=+D,_):N},_}const ui={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},dl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Dw=["Enter"," ","Escape"],Lw={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var xa;(function(e){e.Strict="strict",e.Loose="loose"})(xa||(xa={}));var as;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(as||(as={}));var hl;(function(e){e.Partial="partial",e.Full="full"})(hl||(hl={}));const Bw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Tr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Tr||(Tr={}));var tf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tf||(tf={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const Vb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Hw(e){return e===null?null:e?"valid":"invalid"}const Uw=e=>"id"in e&&"source"in e&&"target"in e,W4=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),kl=(e,t=[0,0])=>{const{width:n,height:r}=Vi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},eA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Fm(a)?a:t.nodeLookup.get(a.id));const f=u?nf(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vf(r,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wf(n)},El=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=vf(n,nf(a)),r=!0)}),r?wf(n):{x:0,y:0,width:0,height:0}},Ym=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const f={...Cl(t,[n,r,a]),width:t.width/a,height:t.height/a},d=[];for(const h of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=h;if(u&&!m||x)continue;const b=g.width??h.width??h.initialWidth??null,w=g.height??h.height??h.initialHeight??null,k=pl(f,va(h)),N=(b??0)*(w??0),_=l&&k>0;(!h.internals.handleBounds||_||k>=N||h.dragging)&&d.push(h)}return d},tA=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function nA(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&(t?.includeHiddenNodes||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function iA({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const f=nA(e,u),d=El(f),h=Xm(d,t,n,u?.minZoom??a,u?.maxZoom??l,u?.padding??.1);return await r.setViewport(h,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Iw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),f=u.parentId?n.get(u.parentId):void 0,{x:d,y:h}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??r;let m=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!f)l?.("005",ui.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[d,h],[d+b,h+w]])}else f&&wa(u.extent)&&(m=[[u.extent[0][0]+d,u.extent[0][1]+h],[u.extent[1][0]+d,u.extent[1][1]+h]]);const x=wa(m)?us(t,m,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",ui.error015()),{position:{x:x.x-d+(u.measured.width??0)*g[0],y:x.y-h+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function rA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(x=>x.id)),u=[];for(const x of n){if(x.deletable===!1)continue;const b=l.has(x.id),w=!b&&x.parentId&&u.find(k=>k.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(t.map(x=>x.id)),d=r.filter(x=>x.deletable!==!1),g=tA(u,d);for(const x of d)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!a)return{edges:g,nodes:u};const m=await a({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const ba=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),us=(e={x:0,y:0},t,n)=>({x:ba(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ba(e.y,t[0][1],t[1][1]-(n?.height??0))});function qw(e,t,n){const{width:r,height:a}=Vi(n),{x:l,y:u}=n.internals.positionAbsolute;return us(e,[[l,u],[l+r,u+a]],t)}const Fb=(e,t,n)=>e<t?ba(Math.abs(e-t),1,t)/t:e>n?-ba(Math.abs(e-n),1,t)/t:0,$w=(e,t,n=15,r=40)=>{const a=Fb(e.x,r,t.width-r)*n,l=Fb(e.y,r,t.height-r)*n;return[a,l]},vf=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),am=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),wf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),va=(e,t=[0,0])=>{const{x:n,y:r}=Fm(e)?e.internals.positionAbsolute:kl(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nf=(e,t=[0,0])=>{const{x:n,y:r}=Fm(e)?e.internals.positionAbsolute:kl(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Pw=(e,t)=>wf(vf(am(e),am(t))),pl=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Yb=e=>Yn(e.width)&&Yn(e.height)&&Yn(e.x)&&Yn(e.y),Yn=e=>!isNaN(e)&&isFinite(e),sA=(e,t)=>{},Nl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Cl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const f={x:(e-n)/a,y:(t-r)/a};return l?Nl(f,u):f},rf=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ea(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function aA(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ea(e,n),a=ea(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ea(e.top??e.y??0,n),a=ea(e.bottom??e.y??0,n),l=ea(e.left??e.x??0,t),u=ea(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function oA(e,t,n,r,a,l){const{x:u,y:f}=rf(e,[t,n,r]),{x:d,y:h}=rf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),g=a-d,m=l-h;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const Xm=(e,t,n,r,a,l)=>{const u=aA(l,t,n),f=(t-u.x)/e.width,d=(n-u.y)/e.height,h=Math.min(f,d),g=ba(h,r,a),m=e.x+e.width/2,x=e.y+e.height/2,b=t/2-m*g,w=n/2-x*g,k=oA(e,b,w,g,t,n),N={left:Math.min(k.left-u.left,0),top:Math.min(k.top-u.top,0),right:Math.min(k.right-u.right,0),bottom:Math.min(k.bottom-u.bottom,0)};return{x:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},ml=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function wa(e){return e!=null&&e!=="parent"}function Vi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Vw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Fw(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const f=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function Xb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function lA(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function uA(e){return{...Lw,...e||{}}}function rl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Xn(e),f=Cl({x:l-(a?.left??0),y:u-(a?.top??0)},r),{x:d,y:h}=n?Nl(f,t):f;return{xSnapped:d,ySnapped:h,...f}}const Gm=e=>({width:e.offsetWidth,height:e.offsetHeight}),Yw=e=>e?.getRootNode?.()||window?.document,cA=["INPUT","SELECT","TEXTAREA"];function Xw(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:cA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Gw=e=>"clientX"in e,Xn=(e,t)=>{const n=Gw(e),r=n?e.clientX:e.touches?.[0].clientX,a=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:a-(t?.top??0)}},Gb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(f.left-n.left)/r,y:(f.top-n.top)/r,...Gm(u)}})};function Zw({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:f}){const d=e*.125+a*.375+u*.375+n*.125,h=t*.125+l*.375+f*.375+r*.125,g=Math.abs(d-e),m=Math.abs(h-t);return[d,h,g,m]}function uc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Zb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case be.Left:return[t-uc(t-r,l),n];case be.Right:return[t+uc(r-t,l),n];case be.Top:return[t,n-uc(n-a,l)];case be.Bottom:return[t,n+uc(a-n,l)]}}function Qw({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,curvature:u=.25}){const[f,d]=Zb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[h,g]=Zb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[m,x,b,w]=Zw({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:f,sourceControlY:d,targetControlX:h,targetControlY:g});return[`M${e},${t} C${f},${d} ${h},${g} ${r},${a}`,m,x,b,w]}function Kw({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,f=r<t?r+u:r-u;return[l,f,a,u]}function fA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,f=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+f}function dA({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=vf(nf(e),nf(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return pl(u,wf(l))>0}const hA=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,pA=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Jw=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||hA;let a;return Uw(e)?a={...e}:a={...e,id:r(e)},pA(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function Ww({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,f]=Kw({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,f]}const Qb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},mA=({source:e,sourcePosition:t=be.Bottom,target:n})=>t===be.Left||t===be.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Kb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gA({source:e,sourcePosition:t=be.Bottom,target:n,targetPosition:r=be.Top,center:a,offset:l,stepPosition:u}){const f=Qb[t],d=Qb[r],h={x:e.x+f.x*l,y:e.y+f.y*l},g={x:n.x+d.x*l,y:n.y+d.y*l},m=mA({source:h,sourcePosition:t,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],k,N;const _={x:0,y:0},z={x:0,y:0},[,,E,C]=Kw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(f[x]*d[x]===-1){x==="x"?(k=a.x??h.x+(g.x-h.x)*u,N=a.y??(h.y+g.y)/2):(k=a.x??(h.x+g.x)/2,N=a.y??h.y+(g.y-h.y)*u);const A=[{x:k,y:h.y},{x:k,y:g.y}],B=[{x:h.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?A:B:w=x==="x"?B:A}else{const A=[{x:h.x,y:g.y}],B=[{x:g.x,y:h.y}];if(x==="x"?w=f.x===b?B:A:w=f.y===b?A:B,t===r){const P=Math.abs(e[x]-n[x]);if(P<=l){const te=Math.min(l-1,l-P);f[x]===b?_[x]=(h[x]>e[x]?-1:1)*te:z[x]=(g[x]>n[x]?-1:1)*te}}if(t!==r){const P=x==="x"?"y":"x",te=f[x]===d[P],D=h[P]>g[P],U=h[P]<g[P];(f[x]===1&&(!te&&D||te&&U)||f[x]!==1&&(!te&&U||te&&D))&&(w=x==="x"?A:B)}const G={x:h.x+_.x,y:h.y+_.y},Z={x:g.x+z.x,y:g.y+z.y},H=Math.max(Math.abs(G.x-w[0].x),Math.abs(Z.x-w[0].x)),$=Math.max(Math.abs(G.y-w[0].y),Math.abs(Z.y-w[0].y));H>=$?(k=(G.x+Z.x)/2,N=w[0].y):(k=w[0].x,N=(G.y+Z.y)/2)}return[[e,{x:h.x+_.x,y:h.y+_.y},...w,{x:g.x+z.x,y:g.y+z.y},n],k,N,E,C]}function yA(e,t,n,r){const a=Math.min(Kb(e,t)/2,Kb(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*h},${u}Q ${l},${u} ${l},${u+a*g}`}const f=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${l},${u+a*d}Q ${l},${u} ${l+a*f},${u}`}function om({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,borderRadius:u=5,centerX:f,centerY:d,offset:h=20,stepPosition:g=.5}){const[m,x,b,w,k]=gA({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:f,y:d},offset:h,stepPosition:g});return[m.reduce((_,z,E)=>{let C="";return E>0&&E<m.length-1?C=yA(m[E-1],z,m[E+1],u):C=`${E===0?"M":"L"}${z.x} ${z.y}`,_+=C,_},""),x,b,w,k]}function Jb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function xA(e){const{sourceNode:t,targetNode:n}=e;if(!Jb(t)||!Jb(n))return null;const r=t.internals.handleBounds||Wb(t.handles),a=n.internals.handleBounds||Wb(n.handles),l=e1(r?.source??[],e.sourceHandle),u=e1(e.connectionMode===xa.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",ui.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=l?.position||be.Bottom,d=u?.position||be.Top,h=cs(t,l,f),g=cs(n,u,d);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:d}}function Wb(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function cs(e,t,n=be.Left,r=!1){const a=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??Vi(e);if(r)return{x:a+u/2,y:l+f/2};switch(t?.position??n){case be.Top:return{x:a+u/2,y:l};case be.Right:return{x:a+u,y:l+f/2};case be.Bottom:return{x:a+u/2,y:l+f};case be.Left:return{x:a,y:l+f/2}}}function e1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function lm(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function bA(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,f)=>([f.markerStart||r,f.markerEnd||a].forEach(d=>{if(d&&typeof d=="object"){const h=lm(d,t);l.has(h)||(u.push({id:h,color:d.color||n,...d}),l.add(h))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const eS=1e3,vA=10,Zm={nodeOrigin:[0,0],nodeExtent:dl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},wA={...Zm,checkEquality:!0};function Qm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function SA(e,t,n){const r=Qm(Zm,n);for(const a of e.values())if(a.parentId)Jm(a,e,t,r);else{const l=kl(a,r.nodeOrigin),u=wa(a.extent)?a.extent:r.nodeExtent,f=us(l,u,Vi(a));a.internals.positionAbsolute=f}}function _A(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Km(e){return e==="manual"}function um(e,t,n,r={}){const a=Qm(wA,r),l={i:0},u=new Map(t),f=a?.elevateNodesOnSelect&&!Km(a.zIndexMode)?eS:0;let d=e.length>0;t.clear(),n.clear();for(const h of e){let g=u.get(h.id);if(a.checkEquality&&h===g?.internals.userNode)t.set(h.id,g);else{const m=kl(h,a.nodeOrigin),x=wa(h.extent)?h.extent:a.nodeExtent,b=us(m,x,Vi(h));g={...a.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:b,handleBounds:_A(h,g),z:tS(h,f,a.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),h.parentId&&Jm(g,t,n,r,l)}return d}function kA(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Jm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:d}=Qm(Zm,r),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kA(e,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&d==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*vA),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=l&&!Km(d)?eS:0,{x,y:b,z:w}=EA(e,g,u,f,m,d),{positionAbsolute:k}=e.internals,N=x!==k.x||b!==k.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:k,z:w}})}function tS(e,t,n){const r=Yn(e.zIndex)?e.zIndex:0;return Km(n)?r:r+(e.selected?t:0)}function EA(e,t,n,r,a,l){const{x:u,y:f}=t.internals.positionAbsolute,d=Vi(e),h=kl(e,n),g=wa(e.extent)?us(h,e.extent,d):h;let m=us({x:u+g.x,y:f+g.y},r,d);e.extent==="parent"&&(m=qw(m,d,t));const x=tS(e,a,l),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function Wm(e,t,n,r=[0,0]){const a=[],l=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const d=l.get(u.parentId)?.expandedRect??va(f),h=Pw(d,u.rect);l.set(u.parentId,{expandedRect:h,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},d)=>{const h=f.internals.positionAbsolute,g=Vi(f),m=f.origin??r,x=u.x<h.x?Math.round(Math.abs(h.x-u.x)):0,b=u.y<h.y?Math.round(Math.abs(h.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),k=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],_=(k-g.height)*m[1];(x>0||b>0||N||_)&&(a.push({id:d,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+_}}),n.get(d)?.forEach(z=>{e.some(E=>E.id===z.id)||a.push({id:z.id,type:"position",position:{x:z.position.x+x,y:z.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:k+(b?m[1]*b-_:0)}})}),a}function NA(e,t,n,r,a,l,u){const f=r?.querySelector(".xyflow__viewport");let d=!1;if(!f)return{changes:[],updatedInternals:d};const h=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=t.get(b.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const k=Gm(b.nodeElement),N=w.measured.width!==k.width||w.measured.height!==k.height;if(!!(k.width&&k.height&&(N||!w.internals.handleBounds||b.force))){const z=b.nodeElement.getBoundingClientRect(),E=wa(w.extent)?w.extent:l;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=qw(C,k,t.get(w.parentId)):E&&(C=us(C,E,k));const L={...w,measured:k,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:Gb("source",b.nodeElement,z,m,w.id),target:Gb("target",b.nodeElement,z,m,w.id)}}};t.set(w.id,L),w.parentId&&Jm(L,t,n,{nodeOrigin:a,zIndexMode:u}),d=!0,N&&(h.push({id:w.id,type:"dimensions",dimensions:k}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:va(L,a)}))}}if(x.length>0){const b=Wm(x,t,n,a);h.push(...b)}return{changes:h,updatedInternals:d}}async function CA({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r),f=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(f)}function t1(e,t,n,r,a,l){let u=a;const f=r.get(u)||new Map;r.set(u,f.set(n,t)),u=`${a}-${e}`;const d=r.get(u)||new Map;if(r.set(u,d.set(n,t)),l){u=`${a}-${e}-${l}`;const h=r.get(u)||new Map;r.set(u,h.set(n,t))}}function nS(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:f=null}=r,d={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:f},h=`${a}-${u}--${l}-${f}`,g=`${l}-${f}--${a}-${u}`;t1("source",d,g,e,a,u),t1("target",d,h,e,l,f),t.set(r.id,r)}}function iS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:iS(n,t):!1}function n1(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function TA(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!iS(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(l);f&&a.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.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 a}function pp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const a=[];for(const[u,f]of t){const d=n.get(u)?.internals.userNode;d&&a.push({...d,position:f.position,dragging:r})}if(!e)return[a[0],a];const l=n.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:r}:a[0],a]}function AA({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=Nl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function MA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,f=new Map,d=!1,h={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,k=null;function N({noDragClassName:z,handleSelector:E,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:B=0}){x=Sn(C);function G({x:P,y:te}){const{nodeLookup:D,nodeExtent:U,snapGrid:R,snapToGrid:I,nodeOrigin:F,onNodeDrag:K,onSelectionDrag:j,onError:O,updateNodePositions:V}=t();l={x:P,y:te};let M=!1;const ie=f.size>1,ce=ie&&U?am(El(f)):null,fe=ie&&I?AA({dragItems:f,snapGrid:R,x:P,y:te}):null;for(const[he,ue]of f){if(!D.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};I&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:Nl(me,R));let Ee=null;if(ie&&U&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,De=Ne.x-ce.x+U[0][0],Qe=Ne.x+ue.measured.width-ce.x2+U[1][0],Xe=Ne.y-ce.y+U[0][1],pt=Ne.y+ue.measured.height-ce.y2+U[1][1];Ee=[[De,Xe],[Qe,pt]]}const{position:Ce,positionAbsolute:we}=Iw({nodeId:he,nextPosition:me,nodeLookup:D,nodeExtent:Ee||U,nodeOrigin:F,onError:O});M=M||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||M,!!M&&(V(f,!0),k&&(r||K||!A&&j))){const[he,ue]=pp({nodeId:A,dragItems:f,nodeLookup:D});r?.(k,f,he,ue),K?.(k,he,ue),A||j?.(k,ue)}}async function Z(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:D,autoPanOnNodeDrag:U}=t();if(!U){d=!1,cancelAnimationFrame(u);return}const[R,I]=$w(h,g,D);(R!==0||I!==0)&&(l.x=(l.x??0)-R/P[2],l.y=(l.y??0)-I/P[2],await te({x:R,y:I})&&G(l)),u=requestAnimationFrame(Z)}function H(P){const{nodeLookup:te,multiSelectionActive:D,nodesDraggable:U,transform:R,snapGrid:I,snapToGrid:F,selectNodesOnDrag:K,onNodeDragStart:j,onSelectionDragStart:O,unselectNodesAndEdges:V}=t();m=!0,(!K||!L)&&!D&&A&&(te.get(A)?.selected||V()),L&&K&&A&&e?.(A);const M=rl(P.sourceEvent,{transform:R,snapGrid:I,snapToGrid:F,containerBounds:g});if(l=M,f=TA(te,U,M,A),f.size>0&&(n||j||!A&&O)){const[ie,ce]=pp({nodeId:A,dragItems:f,nodeLookup:te});n?.(P.sourceEvent,f,ie,ce),j?.(P.sourceEvent,ie,ce),A||O?.(P.sourceEvent,ce)}}const $=bw().clickDistance(B).on("start",P=>{const{domNode:te,nodeDragThreshold:D,transform:U,snapGrid:R,snapToGrid:I}=t();g=te?.getBoundingClientRect()||null,b=!1,w=!1,k=P.sourceEvent,D===0&&H(P),l=rl(P.sourceEvent,{transform:U,snapGrid:R,snapToGrid:I,containerBounds:g}),h=Xn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:D,snapGrid:U,snapToGrid:R,nodeDragThreshold:I,nodeLookup:F}=t(),K=rl(P.sourceEvent,{transform:D,snapGrid:U,snapToGrid:R,containerBounds:g});if(k=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!F.has(A))&&(b=!0),!b){if(!d&&te&&m&&(d=!0,Z()),!m){const j=Xn(P.sourceEvent,g),O=j.x-h.x,V=j.y-h.y;Math.sqrt(O*O+V*V)>I&&H(P)}(l.x!==K.xSnapped||l.y!==K.ySnapped)&&f&&m&&(h=Xn(P.sourceEvent,g),G(K))}}).on("end",P=>{if(!(!m||b)&&(d=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:D,onNodeDragStop:U,onSelectionDragStop:R}=t();if(w&&(D(f,!1),w=!1),a||U||!A&&R){const[I,F]=pp({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});a?.(P.sourceEvent,f,I,F),U?.(P.sourceEvent,I,F),A||R?.(P.sourceEvent,F)}}}).filter(P=>{const te=P.target;return!P.button&&(!z||!n1(te,`.${z}`,C))&&(!E||n1(te,E,C))});x.call($)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function jA(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())pl(a,va(l))>0&&r.push(l);return r}const RA=250;function zA(e,t,n,r){let a=[],l=1/0;const u=jA(e,n,t+RA);for(const f of u){const d=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const h of d){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y:m}=cs(f,h,h.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>t||(x<l?(a=[{...h,x:g,y:m}],l=x):x===l&&a.push({...h,x:g,y:m}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(d=>d.type===f)??a[0]}return a[0]}function rS(e,t,n,r,a,l=!1){const u=r.get(e);if(!u)return null;const f=a==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],d=(n?f?.find(h=>h.id===n):f?.[0])??null;return d&&l?{...d,...cs(u,d,d.position,!0)}:d}function sS(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function OA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const aS=()=>!0;function DA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:d,lib:h,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:k,onConnectEnd:N,isValidConnection:_=aS,onReconnectEnd:z,updateConnection:E,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:B=1,handleDomNode:G}){const Z=Yw(e.target);let H=0,$;const{x:P,y:te}=Xn(e),D=sS(l,G),U=f?.getBoundingClientRect();let R=!1;if(!U||!D)return;const I=rS(a,D,r,d,t);if(!I)return;let F=Xn(e,U),K=!1,j=null,O=!1,V=null;function M(){if(!g||!U)return;const[Ce,we]=$w(F,U,A);x({x:Ce,y:we}),H=requestAnimationFrame(M)}const ie={...I,nodeId:a,type:D,position:I.position},ce=d.get(a);let he={inProgress:!0,isValid:null,from:cs(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:F,toHandle:null,toPosition:Vb[ie.position],toNode:null,pointer:F};function ue(){R=!0,E(he),w?.(e,{nodeId:a,handleId:r,handleType:D})}B===0&&ue();function me(Ce){if(!R){const{x:pt,y:un}=Xn(Ce),Ht=pt-P,Qt=un-te;if(!(Ht*Ht+Qt*Qt>B*B))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();F=Xn(Ce,U),$=zA(Cl(F,we,!1,[1,1]),n,d,ie),K||(M(),K=!0);const Ne=oS(Ce,{handle:$,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:_,doc:Z,lib:h,flowId:m,nodeLookup:d});V=Ne.handleDomNode,j=Ne.connection,O=OA(!!$,Ne.isValid);const De=d.get(a),Qe=De?cs(De,ie,be.Left,!0):he.from,Xe={...he,from:Qe,isValid:O,to:Ne.toHandle&&O?rf({x:Ne.toHandle.x,y:Ne.toHandle.y},we):F,toHandle:Ne.toHandle,toPosition:O&&Ne.toHandle?Ne.toHandle.position:Vb[ie.position],toNode:Ne.toHandle?d.get(Ne.toHandle.nodeId):null,pointer:F};E(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(R){($||V)&&j&&O&&k?.(j);const{inProgress:we,...Ne}=he,De={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,De),l&&z?.(Ce,De)}b(),cancelAnimationFrame(H),K=!1,O=!1,j=null,V=null,Z.removeEventListener("mousemove",me),Z.removeEventListener("mouseup",Ee),Z.removeEventListener("touchmove",me),Z.removeEventListener("touchend",Ee)}}Z.addEventListener("mousemove",me),Z.addEventListener("mouseup",Ee),Z.addEventListener("touchmove",me),Z.addEventListener("touchend",Ee)}function oS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:f,flowId:d,isValidConnection:h=aS,nodeLookup:g}){const m=l==="target",x=t?u.querySelector(`.${f}-flow__handle[data-id="${d}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:b,y:w}=Xn(e),k=u.elementFromPoint(b,w),N=k?.classList.contains(`${f}-flow__handle`)?k:x,_={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const z=sS(void 0,N),E=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),A=N.classList.contains("connectableend");if(!E||!z)return _;const B={source:m?E:r,sourceHandle:m?C:a,target:m?r:E,targetHandle:m?a:C};_.connection=B;const Z=L&&A&&(n===xa.Strict?m&&z==="source"||!m&&z==="target":E!==r||C!==a);_.isValid=Z&&h(B),_.toHandle=rS(E,z,C,g,n,!0)}return _}const cm={onPointerDown:DA,isValid:oS};function LA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=Sn(e);function l({translateExtent:f,width:d,height:h,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const C=n(),L=E.sourceEvent.ctrlKey&&ml()?10:1,A=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*g,B=C[2]*Math.pow(2,A*L);t.scaleTo(B)};let k=[0,0];const N=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(k=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},_=E=>{const C=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const L=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],A=[L[0]-k[0],L[1]-k[1]];k=L;const B=r()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),G={x:C[0]-A[0]*B,y:C[1]-A[1]*B},Z=[[0,0],[d,h]];t.setViewportConstrained({x:G.x,y:G.y,zoom:C[2]},Z,f)},z=Ow().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);a.call(z,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Pn}}const Sf=e=>({x:e.x,y:e.y,zoom:e.k}),mp=({x:e,y:t,zoom:n})=>bf.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),lS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),BA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gp=(e,t=0,n=BA,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},uS=e=>{const t=e.ctrlKey&&ml()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function HA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:d,onPanZoomEnd:h}){return g=>{if(la(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&u){const N=Pn(g),_=uS(g),z=m*Math.pow(2,_);r.scaleTo(n,z,N,g);return}const x=g.deltaMode===1?20:1;let b=a===as.Vertical?0:g.deltaX*x,w=a===as.Horizontal?0:g.deltaY*x;!ml()&&g.shiftKey&&a!==as.Vertical&&(b=g.deltaY*x,w=0),r.translateBy(n,-(b/m)*l,-(w/m)*l,{internal:!0});const k=Sf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d?.(g,k),e.panScrollTimeout=setTimeout(()=>{h?.(g,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,k))}}function UA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,f=la(r,e);if(r.ctrlKey&&l&&f&&r.preventDefault(),u||f)return null;r.preventDefault(),n.call(this,r,a)}}function IA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const a=Sf(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,a)}}function qA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{e.usedRightMouseButton=!!(n&&lS(t,e.mouseButton??0)),l.sourceEvent?.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!l.sourceEvent?.internal&&a?.(l.sourceEvent,Sf(l.transform))}}function $A({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&lS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const f=Sf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(u.sourceEvent,f)},n?150:0)}}}function PA({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:d,lib:h,connectionInProgress:g}){return m=>{const x=e||t,b=n&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(la(m,`${h}-flow__node`)||la(m,`${h}-flow__edge`)))return!0;if(!r&&!x&&!a&&!l&&!n||u||g&&!w||la(m,f)&&w||la(m,d)&&(!w||a&&w&&!e)||!n&&m.ctrlKey&&w)return!1;if(!n&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!a&&!b&&w||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&k}}function VA({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Ow().scaleExtent([t,n]).translateExtent(r),x=Sn(e).call(m);z({x:a.x,y:a.y,zoom:ba(a.zoom,t,n)},[[0,0],[g.width,g.height]],r);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(uS);function k($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?il:Bc).transform(gp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function N({noWheelClassName:$,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:D,panOnScroll:U,panOnDrag:R,panOnScrollMode:I,panOnScrollSpeed:F,preventScrolling:K,zoomOnPinch:j,zoomOnScroll:O,zoomOnDoubleClick:V,zoomActivationKeyPressed:M,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){D&&!h.isZoomingOrPanning&&_();const me=U&&!M&&!D;m.clickDistance(ue?1/0:!Yn(he)||he<0?0:he);const Ee=me?HA({zoomPanValues:h,noWheelClassName:$,d3Selection:x,d3Zoom:m,panOnScrollMode:I,panOnScrollSpeed:F,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):UA({noWheelClassName:$,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!D){const we=IA({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:u});m.on("start",we);const Ne=qA({zoomPanValues:h,panOnDrag:R,onPaneContextMenu:!!te,onPanZoom:l,onTransformChange:ce});m.on("zoom",Ne);const De=$A({zoomPanValues:h,panOnDrag:R,panOnScroll:U,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:d});m.on("end",De)}const Ce=PA({zoomActivationKeyPressed:M,panOnDrag:R,zoomOnScroll:O,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:j,userSelectionActive:D,noPanClassName:P,noWheelClassName:$,lib:ie,connectionInProgress:fe});m.filter(Ce),V?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function z($,P,te){const D=mp($),U=m?.constrain()(D,P,te);return U&&await k(U),new Promise(R=>R(U))}async function E($,P){const te=mp($);return await k(te,P),new Promise(D=>D(te))}function C($){if(x){const P=mp($),te=x.property("__zoom");(te.k!==$.zoom||te.x!==$.x||te.y!==$.y)&&m?.transform(x,P,null,{sync:!0})}}function L(){const $=x?zw(x.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function A($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?il:Bc).scaleTo(gp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function B($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?il:Bc).scaleBy(gp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function G($){m?.scaleExtent($)}function Z($){m?.translateExtent($)}function H($){const P=!Yn($)||$<0?0:$;m?.clickDistance(P)}return{update:N,destroy:_,setViewport:E,setViewportConstrained:z,getViewport:L,scaleTo:A,scaleBy:B,setScaleExtent:G,setTranslateExtent:Z,syncViewport:C,setClickDistance:H}}var Sa;(function(e){e.Line="line",e.Handle="handle"})(Sa||(Sa={}));function FA({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,f=n-r,d=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&a&&(d[0]=d[0]*-1),f&&l&&(d[1]=d[1]*-1),d}function i1(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Sr(e,t){return Math.max(0,e-t)}function cc(e,t,n){return Math.max(0,t-e,e-n)}function r1(e,t){return e?!t:t}function YA(e,t,n,r,a,l,u,f){let{affectsX:d,affectsY:h}=t;const{isHorizontal:g,isVertical:m}=t,x=g&&m,{xSnapped:b,ySnapped:w}=n,{minWidth:k,maxWidth:N,minHeight:_,maxHeight:z}=r,{x:E,y:C,width:L,height:A,aspectRatio:B}=e;let G=Math.floor(g?b-e.pointerX:0),Z=Math.floor(m?w-e.pointerY:0);const H=L+(d?-G:G),$=A+(h?-Z:Z),P=-l[0]*L,te=-l[1]*A;let D=cc(H,k,N),U=cc($,_,z);if(u){let F=0,K=0;d&&G<0?F=wr(E+G+P,u[0][0]):!d&&G>0&&(F=Sr(E+H+P,u[1][0])),h&&Z<0?K=wr(C+Z+te,u[0][1]):!h&&Z>0&&(K=Sr(C+$+te,u[1][1])),D=Math.max(D,F),U=Math.max(U,K)}if(f){let F=0,K=0;d&&G>0?F=Sr(E+G,f[0][0]):!d&&G<0&&(F=wr(E+H,f[1][0])),h&&Z>0?K=Sr(C+Z,f[0][1]):!h&&Z<0&&(K=wr(C+$,f[1][1])),D=Math.max(D,F),U=Math.max(U,K)}if(a){if(g){const F=cc(H/B,_,z)*B;if(D=Math.max(D,F),u){let K=0;!d&&!h||d&&!h&&x?K=Sr(C+te+H/B,u[1][1])*B:K=wr(C+te+(d?G:-G)/B,u[0][1])*B,D=Math.max(D,K)}if(f){let K=0;!d&&!h||d&&!h&&x?K=wr(C+H/B,f[1][1])*B:K=Sr(C+(d?G:-G)/B,f[0][1])*B,D=Math.max(D,K)}}if(m){const F=cc($*B,k,N)/B;if(U=Math.max(U,F),u){let K=0;!d&&!h||h&&!d&&x?K=Sr(E+$*B+P,u[1][0])/B:K=wr(E+(h?Z:-Z)*B+P,u[0][0])/B,U=Math.max(U,K)}if(f){let K=0;!d&&!h||h&&!d&&x?K=wr(E+$*B,f[1][0])/B:K=Sr(E+(h?Z:-Z)*B,f[0][0])/B,U=Math.max(U,K)}}}Z=Z+(Z<0?U:-U),G=G+(G<0?D:-D),a&&(x?H>$*B?Z=(r1(d,h)?-G:G)/B:G=(r1(d,h)?-Z:Z)*B:g?(Z=G/B,h=d):(G=Z*B,d=h));const R=d?E+G:E,I=h?C+Z:C;return{width:L+(d?-G:G),height:A+(h?-Z:Z),x:l[0]*G*(d?-1:1)+R,y:l[1]*Z*(h?-1:1)+I}}const cS={width:0,height:0,x:0,y:0},XA={...cS,pointerX:0,pointerY:0,aspectRatio:1};function GA(e){return[[0,0],[e.measured.width,e.measured.height]]}function ZA(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,f=n[0]*l,d=n[1]*u;return[[r-f,a-d],[r+l-f,a+u-d]]}function QA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=Sn(e);let u={controlDirection:i1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:k,shouldResize:N}){let _={...cS},z={...XA};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:i1(h)};let E,C=null,L=[],A,B,G,Z=!1;const H=bw().on("start",$=>{const{nodeLookup:P,transform:te,snapGrid:D,snapToGrid:U,nodeOrigin:R,paneDomNode:I}=n();if(E=P.get(t),!E)return;C=I?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:K}=rl($.sourceEvent,{transform:te,snapGrid:D,snapToGrid:U,containerBounds:C});_={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},z={..._,pointerX:F,pointerY:K,aspectRatio:_.width/_.height},A=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(A=P.get(E.parentId),B=A&&E.extent==="parent"?GA(A):void 0),L=[],G=void 0;for(const[j,O]of P)if(O.parentId===t&&(L.push({id:j,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const V=ZA(O,E,O.origin??R);G?G=[[Math.min(V[0][0],G[0][0]),Math.min(V[0][1],G[0][1])],[Math.max(V[1][0],G[1][0]),Math.max(V[1][1],G[1][1])]]:G=V}b?.($,{..._})}).on("drag",$=>{const{transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U}=n(),R=rl($.sourceEvent,{transform:P,snapGrid:te,snapToGrid:D,containerBounds:C}),I=[];if(!E)return;const{x:F,y:K,width:j,height:O}=_,V={},M=E.origin??U,{width:ie,height:ce,x:fe,y:he}=YA(z,u.controlDirection,R,u.boundaries,u.keepAspectRatio,M,B,G),ue=ie!==j,me=ce!==O,Ee=fe!==F&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||M[0]===1||M[1]===1)&&(V.x=Ee?fe:_.x,V.y=Ce?he:_.y,_.x=V.x,_.y=V.y,L.length>0)){const Qe=fe-F,Xe=he-K;for(const pt of L)pt.position={x:pt.position.x-Qe+M[0]*(ie-j),y:pt.position.y-Xe+M[1]*(ce-O)},I.push(pt)}if((ue||me)&&(V.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,V.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=V.width,_.height=V.height),A&&E.expandParent){const Qe=M[0]*(V.width??0);V.x&&V.x<Qe&&(_.x=Qe,z.x=z.x-(V.x-Qe));const Xe=M[1]*(V.height??0);V.y&&V.y<Xe&&(_.y=Xe,z.y=z.y-(V.y-Xe))}const we=FA({width:_.width,prevWidth:j,height:_.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};N?.($,Ne)!==!1&&(Z=!0,w?.($,Ne),r(V,I))}).on("end",$=>{Z&&(k?.($,{..._}),a?.({..._}),Z=!1)});l.call(H)}function d(){l.on(".drag",null)}return{update:f,destroy:d}}var yp={exports:{}},xp={},bp={exports:{}},vp={};var s1;function KA(){if(s1)return vp;s1=1;var e=wl();function t(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=r({inst:{value:b,getSnapshot:x}}),k=w[0].inst,N=w[1];return l(function(){k.value=b,k.getSnapshot=x,d(k)&&N({inst:k})},[m,b,x]),a(function(){return d(k)&&N({inst:k}),m(function(){d(k)&&N({inst:k})})},[m]),u(b),b}function d(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!n(m,b)}catch{return!0}}function h(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return vp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,vp}var a1;function JA(){return a1||(a1=1,bp.exports=KA()),bp.exports}var o1;function WA(){if(o1)return xp;o1=1;var e=wl(),t=JA();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,d=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(h,g,m,x,b){var w=l(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=f(function(){function _(A){if(!z){if(z=!0,E=A,A=x(A),b!==void 0&&k.hasValue){var B=k.value;if(b(B,A))return C=B}return C=A}if(B=C,r(E,A))return B;var G=x(A);return b!==void 0&&b(B,G)?(E=A,B):(E=A,C=G)}var z=!1,E,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var N=a(h,w[0],w[1]);return u(function(){k.hasValue=!0,k.value=N},[N]),d(N),N},xp}var l1;function eM(){return l1||(l1=1,yp.exports=WA()),yp.exports}var tM=eM();const nM=pf(tM),iM={},u1=e=>{let t;const n=new Set,r=(g,m)=>{const x=typeof g=="function"?g(t):g;if(!Object.is(x,t)){const b=t;t=m??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(w=>w(t,b))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(iM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,a,d);return d},rM=e=>e?u1(e):u1,{useDebugValue:sM}=Ko,{useSyncExternalStoreWithSelector:aM}=nM,oM=e=>e;function fS(e,t=oM,n){const r=aM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return sM(r),r}const c1=(e,t)=>{const n=rM(e),r=(a,l=t)=>fS(n,a,l);return Object.assign(r,n),r},lM=(e,t)=>e?c1(e,t):c1;function ct(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}rw();const _f=X.createContext(null),uM=_f.Provider,dS=ui.error001();function Ye(e,t){const n=X.useContext(_f);if(n===null)throw new Error(dS);return fS(n,e,t)}function ft(){const e=X.useContext(_f);if(e===null)throw new Error(dS);return X.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const f1={display:"none"},cM={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},hS="react-flow__node-desc",pS="react-flow__edge-desc",fM="react-flow__aria-live",dM=e=>e.ariaLiveMessage,hM=e=>e.ariaLabelConfig;function pM({rfId:e}){const t=Ye(dM);return v.jsx("div",{id:`${fM}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:cM,children:t})}function mM({rfId:e,disableKeyboardA11y:t}){const n=Ye(hM);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${hS}-${e}`,style:f1,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${pS}-${e}`,style:f1,children:n["edge.a11yDescription.default"]}),!t&&v.jsx(pM,{rfId:e})]})}const kf=X.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return v.jsx("div",{className:Et(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});kf.displayName="Panel";function gM({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:v.jsx(kf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const yM=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},fc=e=>e.id;function xM(e,t){return ct(e.selectedNodes.map(fc),t.selectedNodes.map(fc))&&ct(e.selectedEdges.map(fc),t.selectedEdges.map(fc))}function bM({onSelectionChange:e}){const t=ft(),{selectedNodes:n,selectedEdges:r}=Ye(yM,xM);return X.useEffect(()=>{const a={nodes:n,edges:r};e?.(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const vM=e=>!!e.onSelectionChangeHandlers;function wM({onSelectionChange:e}){const t=Ye(vM);return e||t?v.jsx(bM,{onSelectionChange:e}):null}const mS=[0,0],SM={x:0,y:0,zoom:1},_M=["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"],d1=[..._M,"rfId"],kM=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}),h1={translateExtent:dl,nodeOrigin:mS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function EM(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:d}=Ye(kM,ct),h=ft();X.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{g.current=h1,f()}),[]);const g=X.useRef(h1);return X.useEffect(()=>{for(const m of d1){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?t(x):m==="edges"?n(x):m==="minZoom"?r(x):m==="maxZoom"?a(x):m==="translateExtent"?l(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?h.setState({ariaLabelConfig:uA(x)}):m==="fitView"?h.setState({fitViewQueued:x}):m==="fitViewOptions"?h.setState({fitViewOptions:x}):h.setState({[m]:x})))}g.current=e},d1.map(m=>e[m])),null}function p1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NM(e){const[t,n]=X.useState(e==="system"?null:e);return X.useEffect(()=>{if(e!=="system"){n(e);return}const r=p1(),a=()=>n(r?.matches?"dark":"light");return a(),r?.addEventListener("change",a),()=>{r?.removeEventListener("change",a)}},[e]),t!==null?t:p1()?.matches?"dark":"light"}const m1=typeof document<"u"?document:null;function gl(e=null,t={target:m1,actInsideInputWithModifier:!0}){const[n,r]=X.useState(!1),a=X.useRef(!1),l=X.useRef(new Set([])),[u,f]=X.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
10
|
-
`).replace(`
|
|
11
|
-
|
|
12
|
-
`,`
|
|
13
|
-
+`).split(`
|
|
14
|
-
`)),g=h.reduce((m,x)=>m.concat(...x),[]);return[h,g]}return[[],[]]},[e]);return X.useEffect(()=>{const d=t?.target??m1,h=t?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&Xw(b))return!1;const k=y1(b.code,f);if(l.current.add(b[k]),g1(u,l.current,!1)){const N=b.composedPath?.()?.[0]||b.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(a.current||!_)&&b.preventDefault(),r(!0)}},m=b=>{const w=y1(b.code,f);g1(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(b[w]),b.key==="Meta"&&l.current.clear(),a.current=!1},x=()=>{l.current.clear(),r(!1)};return d?.addEventListener("keydown",g),d?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{d?.removeEventListener("keydown",g),d?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,r]),n}function g1(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function y1(e,t){return t.includes(e)?"code":"key"}const CM=()=>{const e=ft();return X.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:f}=e.getState(),d=Xm(t,r,a,l,u,n?.padding??.1);return f?(await f.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:f,y:d}=u.getBoundingClientRect(),h={x:t.x-f,y:t.y-d},g=n.snapGrid??a,m=n.snapToGrid??l;return Cl(h,r,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=rf(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function gS(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const f={...l};for(const d of u)TM(d,f);n.push(f)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function TM(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function yS(e,t){return gS(e,t)}function xS(e,t){return gS(e,t)}function ns(e,t){return{id:e,type:"select",selected:t}}function ua(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(ns(l.id,u)))}return r}function x1({items:e=[],lookup:t}){const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,l]of e.entries()){const u=t.get(l.id),f=u?.internals?.userNode??u;f!==void 0&&f!==l&&n.push({id:l.id,item:l,type:"replace"}),f===void 0&&n.push({item:l,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function b1(e){return{id:e.id,type:"remove"}}const v1=e=>W4(e),AM=e=>Uw(e);function bS(e){return X.forwardRef(e)}const MM=typeof window<"u"?X.useLayoutEffect:X.useEffect;function w1(e){const[t,n]=X.useState(BigInt(0)),[r]=X.useState(()=>jM(()=>n(a=>a+BigInt(1))));return MM(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function jM(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const vS=X.createContext(null);function RM({children:e}){const t=ft(),n=X.useCallback(f=>{const{nodes:d=[],setNodes:h,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=t.getState();let k=d;for(const _ of f)k=typeof _=="function"?_(k):_;let N=x1({items:k,lookup:x});for(const _ of w.values())N=_(N);g&&h(k),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:z,setNodes:E}=t.getState();_&&E(z)})},[]),r=w1(n),a=X.useCallback(f=>{const{edges:d=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=t.getState();let b=d;for(const w of f)b=typeof w=="function"?w(b):w;g?h(b):m&&m(x1({items:b,lookup:x}))},[]),l=w1(a),u=X.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return v.jsx(vS.Provider,{value:u,children:e})}function zM(){const e=X.useContext(vS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const OM=e=>!!e.panZoom;function eg(){const e=CM(),t=ft(),n=zM(),r=Ye(OM),a=X.useMemo(()=>{const l=m=>t.getState().nodeLookup.get(m),u=m=>{n.nodeQueue.push(m)},f=m=>{n.edgeQueue.push(m)},d=m=>{const{nodeLookup:x,nodeOrigin:b}=t.getState(),w=v1(m)?m:x.get(m.id),k=w.parentId?Fw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:k,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return va(N)},h=(m,x,b={replace:!1})=>{u(w=>w.map(k=>{if(k.id===m){const N=typeof x=="function"?x(k):x;return b.replace&&v1(N)?N:{...k,...N}}return k}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(k=>{if(k.id===m){const N=typeof x=="function"?x(k):x;return b.replace&&AM(N)?N:{...k,...N}}return k}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>l(m)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(x=>({...x}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];n.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];n.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=t.getState(),[w,k,N]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:k,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:k,onEdgesDelete:N,triggerNodeChanges:_,triggerEdgeChanges:z,onDelete:E,onBeforeDelete:C}=t.getState(),{nodes:L,edges:A}=await rA({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),B=A.length>0,G=L.length>0;if(B){const Z=A.map(b1);N?.(A),z(Z)}if(G){const Z=L.map(b1);k?.(L),_(Z)}return(G||B)&&E?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=Yb(m),k=w?m:d(m),N=b!==void 0;return k?(b||t.getState().nodes).filter(_=>{const z=t.getState().nodeLookup.get(_.id);if(z&&!w&&(_.id===m.id||!z.internals.positionAbsolute))return!1;const E=va(N?_:z),C=pl(E,k);return x&&C>0||C>=E.width*E.height||C>=k.width*k.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const k=Yb(m)?m:d(m);if(!k)return!1;const N=pl(k,x);return b&&N>0||N>=x.width*x.height||N>=k.width*k.height},updateNode:h,updateNodeData:(m,x,b={replace:!1})=>{h(m,w=>{const k=typeof x=="function"?x(w):x;return b.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const k=typeof x=="function"?x(w):x;return b.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=t.getState();return eA(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=t.getState().fitViewResolver??lA();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),n.nodeQueue.push(b=>[...b]),x.promise}}},[]);return X.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const S1=e=>e.selected,DM=typeof window<"u"?window:void 0;function LM({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ft(),{deleteElements:r}=eg(),a=gl(e,{actInsideInputWithModifier:!1}),l=gl(t,{target:DM});X.useEffect(()=>{if(a){const{edges:u,nodes:f}=n.getState();r({nodes:f.filter(S1),edges:u.filter(S1)}),n.setState({nodesSelectionActive:!1})}},[a]),X.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function BM(e){const t=ft();X.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const r=Gm(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",ui.error004()),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Ef={position:"absolute",width:"100%",height:"100%",top:0,left:0},HM=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UM({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=as.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:d,translateExtent:h,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:k,noPanClassName:N,onViewportChange:_,isControlledViewport:z,paneClickDistance:E,selectionOnDrag:C}){const L=ft(),A=X.useRef(null),{userSelectionActive:B,lib:G,connectionInProgress:Z}=Ye(HM,ct),H=gl(x),$=X.useRef();BM(A);const P=X.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),z||L.setState({transform:te})},[_,z]);return X.useEffect(()=>{if(A.current){$.current=VA({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:h,viewport:d,onDraggingChange:R=>L.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:F,onMoveStart:K}=L.getState();K?.(R,I),F?.(I)},onPanZoom:(R,I)=>{const{onViewportChange:F,onMove:K}=L.getState();K?.(R,I),F?.(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:F,onMoveEnd:K}=L.getState();K?.(R,I),F?.(I)}});const{x:te,y:D,zoom:U}=$.current.getViewport();return L.setState({panZoom:$.current,transform:[te,D,U],domNode:A.current.closest(".react-flow")}),()=>{$.current?.destroy()}}},[]),X.useEffect(()=>{$.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:H,preventScrolling:b,noPanClassName:N,userSelectionActive:B,noWheelClassName:k,lib:G,onTransformChange:P,connectionInProgress:Z,selectionOnDrag:C,paneClickDistance:E})},[e,t,n,r,a,l,u,f,H,b,N,B,k,G,P,Z,C,E]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:Ef,children:w})}const IM=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qM(){const{userSelectionActive:e,userSelectionRect:t}=Ye(IM,ct);return e&&t?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wp=(e,t)=>n=>{n.target===t.current&&e?.(n)},$M=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function PM({isSelecting:e,selectionKeyPressed:t,selectionMode:n=hl.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:f,onPaneClick:d,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const k=ft(),{userSelectionActive:N,elementsSelectable:_,dragging:z,connectionInProgress:E}=Ye($M,ct),C=_&&(e||N),L=X.useRef(null),A=X.useRef(),B=X.useRef(new Set),G=X.useRef(new Set),Z=X.useRef(!1),H=F=>{if(Z.current||E){Z.current=!1;return}d?.(F),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},$=F=>{if(Array.isArray(r)&&r?.includes(2)){F.preventDefault();return}h?.(F)},P=g?F=>g(F):void 0,te=F=>{Z.current&&(F.stopPropagation(),Z.current=!1)},D=F=>{const{domNode:K}=k.getState();if(A.current=K?.getBoundingClientRect(),!A.current)return;const j=F.target===L.current;if(!j&&!!F.target.closest(".nokey")||!e||!(l&&j||t)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),Z.current=!1;const{x:M,y:ie}=Xn(F.nativeEvent,A.current);k.setState({userSelectionRect:{width:0,height:0,startX:M,startY:ie,x:M,y:ie}}),j||(F.stopPropagation(),F.preventDefault())},U=F=>{const{userSelectionRect:K,transform:j,nodeLookup:O,edgeLookup:V,connectionLookup:M,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=k.getState();if(!A.current||!K)return;const{x:ue,y:me}=Xn(F.nativeEvent,A.current),{startX:Ee,startY:Ce}=K;if(!Z.current){const Xe=t?0:a;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(F)}Z.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=B.current,De=G.current;B.current=new Set(Ym(O,we,j,n===hl.Partial,!0).map(Xe=>Xe.id)),G.current=new Set;const Qe=fe?.selectable??!0;for(const Xe of B.current){const pt=M.get(Xe);if(pt)for(const{edgeId:un}of pt.values()){const Ht=V.get(un);Ht&&(Ht.selectable??Qe)&&G.current.add(un)}}if(!Xb(Ne,B.current)){const Xe=ua(O,B.current,!0);ie(Xe)}if(!Xb(De,G.current)){const Xe=ua(V,G.current);ce(Xe)}k.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},R=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!N&&F.target===L.current&&k.getState().userSelectionRect&&H?.(F),k.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f?.(F),k.setState({nodesSelectionActive:B.current.size>0})))},I=r===!0||Array.isArray(r)&&r.includes(0);return v.jsxs("div",{className:Et(["react-flow__pane",{draggable:I,dragging:z,selection:e}]),onClick:C?void 0:wp(H,L),onContextMenu:wp($,L),onWheel:wp(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?U:x,onPointerUp:C?R:void 0,onPointerDownCapture:C?D:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:Ef,children:[w,v.jsx(qM,{})]})}function fm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:d}=t.getState(),h=f.get(e);if(!h){d?.("012",ui.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):a([e])}function wS({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const f=ft(),[d,h]=X.useState(!1),g=X.useRef();return X.useEffect(()=>{g.current=MA({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{fm({id:m,store:f,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),X.useEffect(()=>{if(t)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{g.current?.destroy()}},[n,r,t,l,e,a]),d}const VM=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function SS(){const e=ft();return X.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:f,updateNodePositions:d,nodeLookup:h,nodeOrigin:g}=e.getState(),m=new Map,x=VM(u),b=a?l[0]:5,w=a?l[1]:5,k=n.direction.x*b*n.factor,N=n.direction.y*w*n.factor;for(const[,_]of h){if(!x(_))continue;let z={x:_.internals.positionAbsolute.x+k,y:_.internals.positionAbsolute.y+N};a&&(z=Nl(z,l));const{position:E,positionAbsolute:C}=Iw({nodeId:_.id,nextPosition:z,nodeLookup:h,nodeExtent:r,nodeOrigin:g,onError:f});_.position=E,_.internals.positionAbsolute=C,m.set(_.id,_)}d(m)},[])}const tg=X.createContext(null),FM=tg.Provider;tg.Consumer;const _S=()=>X.useContext(tg),YM=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),XM=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:f,toHandle:d,isValid:h}=u,g=d?.nodeId===e&&d?.id===t&&d?.type===n;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===n,connectingTo:g,clickConnecting:a?.nodeId===e&&a?.id===t&&a?.type===n,isPossibleEndHandle:l===xa.Strict?f?.type!==n:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!a,valid:g&&h}};function GM({type:e="source",position:t=be.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:d,className:h,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,k=e==="target",N=ft(),_=_S(),{connectOnClick:z,noPanClassName:E,rfId:C}=Ye(YM,ct),{connectingFrom:L,connectingTo:A,clickConnecting:B,isPossibleEndHandle:G,connectionInProcess:Z,clickConnectionInProcess:H,valid:$}=Ye(XM(_,w,e),ct);_||N.getState().onError?.("010",ui.error010());const P=U=>{const{defaultEdgeOptions:R,onConnect:I,hasDefaultEdges:F}=N.getState(),K={...R,...U};if(F){const{edges:j,setEdges:O}=N.getState();O(Jw(K,j))}I?.(K),f?.(K)},te=U=>{if(!_)return;const R=Gw(U.nativeEvent);if(a&&(R&&U.button===0||!R)){const I=N.getState();cm.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:k,handleId:w,nodeId:_,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:I.onConnectEnd,updateConnection:I.updateConnection,onConnect:P,isValidConnection:n||I.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}R?g?.(U):m?.(U)},D=U=>{const{onClickConnectStart:R,onClickConnectEnd:I,connectionClickStartHandle:F,connectionMode:K,isValidConnection:j,lib:O,rfId:V,nodeLookup:M,connection:ie}=N.getState();if(!_||!F&&!a)return;if(!F){R?.(U.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=Yw(U.target),fe=n||j,{connection:he,isValid:ue}=cm.isValid(U.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:K,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:fe,flowId:V,doc:ce,lib:O,nodeLookup:M});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,I?.(U,me),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":t,"data-id":`${C}-${_}-${w}-${e}`,className:Et(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,h,{source:!k,target:k,connectable:r,connectablestart:a,connectableend:l,clickconnecting:B,connectingfrom:L,connectingto:A,valid:$,connectionindicator:r&&(!Z||G)&&(Z||H?l:a)}]),onMouseDown:te,onTouchStart:te,onClick:z?D:void 0,ref:b,...x,children:d})}const _a=X.memo(bS(GM));function ZM({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(_a,{type:"source",position:n,isConnectable:t})]})}function QM({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:r=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(_a,{type:"target",position:n,isConnectable:t}),e?.label,v.jsx(_a,{type:"source",position:r,isConnectable:t})]})}function KM(){return null}function JM({data:e,isConnectable:t,targetPosition:n=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(_a,{type:"target",position:n,isConnectable:t}),e?.label]})}const sf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},_1={input:ZM,default:QM,output:JM,group:KM};function WM(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 e3=e=>{const{width:t,height:n,x:r,y:a}=El(e.nodeLookup,{filter:l=>!!l.selected});return{width:Yn(t)?t:null,height:Yn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function t3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ft(),{width:a,height:l,transformString:u,userSelectionActive:f}=Ye(e3,ct),d=SS(),h=X.useRef(null);if(X.useEffect(()=>{n||h.current?.focus({preventScroll:!0})},[n]),wS({nodeRef:h}),f||!a||!l)return null;const g=e?x=>{const b=r.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(sf,x.key)&&(x.preventDefault(),d({direction:sf[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:Et(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:v.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:l}})})}const k1=typeof window<"u"?window:void 0,n3=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function kS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:d,selectionKeyCode:h,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:_,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:B,panOnDrag:G,defaultViewport:Z,translateExtent:H,minZoom:$,maxZoom:P,preventScrolling:te,onSelectionContextMenu:D,noWheelClassName:U,noPanClassName:R,disableKeyboardA11y:I,onViewportChange:F,isControlledViewport:K}){const{nodesSelectionActive:j,userSelectionActive:O}=Ye(n3,ct),V=gl(h,{target:k1}),M=gl(k,{target:k1}),ie=M||G,ce=M||C,fe=g&&ie!==!0,he=V||O||fe;return LM({deleteKeyCode:d,multiSelectionKeyCode:w}),v.jsx(UM,{onPaneContextMenu:l,elementsSelectable:_,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:B,panOnDrag:!V&&ie,defaultViewport:Z,translateExtent:H,minZoom:$,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:U,noPanClassName:R,onViewportChange:F,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(PM,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:V,paneClickDistance:f,selectionOnDrag:fe,children:[e,j&&v.jsx(t3,{onSelectionContextMenu:D,noPanClassName:R,disableKeyboardA11y:I})]})})}kS.displayName="FlowRenderer";const i3=X.memo(kS),r3=e=>t=>e?Ym(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function s3(e){return Ye(X.useCallback(r3(e),[e]),ct)}const a3=e=>e.updateNodeInternals;function o3(){const e=Ye(a3),[t]=X.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return X.useEffect(()=>()=>{t?.disconnect()},[t]),t}function l3({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=ft(),l=X.useRef(null),u=X.useRef(null),f=X.useRef(e.sourcePosition),d=X.useRef(e.targetPosition),h=X.useRef(t),g=n&&!!e.internals.handleBounds;return X.useEffect(()=>{l.current&&!e.hidden&&(!g||u.current!==l.current)&&(u.current&&r?.unobserve(u.current),r?.observe(l.current),u.current=l.current)},[g,e.hidden]),X.useEffect(()=>()=>{u.current&&(r?.unobserve(u.current),u.current=null)},[]),X.useEffect(()=>{if(l.current){const m=h.current!==t,x=f.current!==e.sourcePosition,b=d.current!==e.targetPosition;(m||x||b)&&(h.current=t,f.current=e.sourcePosition,d.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function u3({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:f,elementsSelectable:d,nodesConnectable:h,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:k,nodeTypes:N,nodeClickDistance:_,onError:z}){const{node:E,internals:C,isParent:L}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ct);let A=E.type||"default",B=N?.[A]||_1[A];B===void 0&&(z?.("003",ui.error003(A)),A="default",B=N?.default||_1.default);const G=!!(E.draggable||f&&typeof E.draggable>"u"),Z=!!(E.selectable||d&&typeof E.selectable>"u"),H=!!(E.connectable||h&&typeof E.connectable>"u"),$=!!(E.focusable||g&&typeof E.focusable>"u"),P=ft(),te=Vw(E),D=l3({node:E,nodeType:A,hasDimensions:te,resizeObserver:m}),U=wS({nodeRef:D,disabled:E.hidden||!G,noDragClassName:x,handleSelector:E.dragHandle,nodeId:e,isSelectable:Z,nodeClickDistance:_}),R=SS();if(E.hidden)return null;const I=Vi(E),F=WM(E),K=Z||G||t||n||r||a,j=n?ue=>n(ue,{...C.userNode}):void 0,O=r?ue=>r(ue,{...C.userNode}):void 0,V=a?ue=>a(ue,{...C.userNode}):void 0,M=l?ue=>l(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();Z&&(!me||!G||Ee>0)&&fm({id:e,store:P,nodeRef:D}),t&&t(ue,{...C.userNode})},fe=ue=>{if(!(Xw(ue.nativeEvent)||w)){if(Dw.includes(ue.key)&&Z){const me=ue.key==="Escape";fm({id:e,store:P,unselect:me,nodeRef:D})}else if(G&&E.selected&&Object.prototype.hasOwnProperty.call(sf,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),R({direction:sf[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!D.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;Ym(new Map([[e,E]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(E.position.x+I.width/2,E.position.y+I.height/2,{zoom:ue[2]})};return v.jsx("div",{className:Et(["react-flow__node",`react-flow__node-${A}`,{[b]:G},E.className,{selected:E.selected,selectable:Z,parent:L,draggable:G,dragging:U}]),ref:D,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",...E.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:O,onMouseLeave:V,onContextMenu:M,onClick:ce,onDoubleClick:ie,onKeyDown:$?fe:void 0,tabIndex:$?0:void 0,onFocus:$?he:void 0,role:E.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${hS}-${k}`,"aria-label":E.ariaLabel,...E.domAttributes,children:v.jsx(FM,{value:e,children:v.jsx(B,{id:e,data:E.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:E.selected??!1,selectable:Z,draggable:G,deletable:E.deletable??!0,isConnectable:H,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:U,dragHandle:E.dragHandle,zIndex:C.z,parentId:E.parentId,...I})})})}var c3=X.memo(u3);const f3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ES(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=Ye(f3,ct),u=s3(e.onlyRenderVisibleElements),f=o3();return v.jsx("div",{className:"react-flow__nodes",style:Ef,children:u.map(d=>v.jsx(c3,{id:d,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:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},d))})}ES.displayName="NodeRenderer";const d3=X.memo(ES);function h3(e){return Ye(X.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&dA({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),ct)}const p3=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},m3=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},E1={[tf.Arrow]:p3,[tf.ArrowClosed]:m3};function g3(e){const t=ft();return X.useMemo(()=>Object.prototype.hasOwnProperty.call(E1,e)?E1[e]:(t.getState().onError?.("009",ui.error009(e)),null),[e])}const y3=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const d=g3(t);return d?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:v.jsx(d,{color:n,strokeWidth:u})}):null},NS=({defaultColor:e,rfId:t})=>{const n=Ye(l=>l.edges),r=Ye(l=>l.defaultEdgeOptions),a=X.useMemo(()=>bA(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return a.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:a.map(l=>v.jsx(y3,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};NS.displayName="MarkerDefinitions";var x3=X.memo(NS);function CS({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:d,className:h,...g}){const[m,x]=X.useState({x:1,y:0,width:0,height:0}),b=Et(["react-flow__edge-textwrapper",h]),w=X.useRef(null);return X.useEffect(()=>{if(w.current){const k=w.current.getBBox();x({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?v.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[a&&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:l,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:r,children:n}),d]}):null}CS.displayName="EdgeText";const b3=X.memo(CS);function Nf({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,interactionWidth:h=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:Et(["react-flow__edge-path",g.className])}),h?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&Yn(t)&&Yn(n)?v.jsx(b3,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d}):null]})}function N1({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===be.Left||e===be.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function TS({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top}){const[u,f]=N1({pos:n,x1:e,y1:t,x2:r,y2:a}),[d,h]=N1({pos:l,x1:r,y1:a,x2:e,y2:t}),[g,m,x,b]=Zw({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:h});return[`M${e},${t} C${u},${f} ${d},${h} ${r},${a}`,g,m,x,b]}function AS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:f,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:N,interactionWidth:_})=>{const[z,E,C]=TS({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f}),L=e.isInternal?void 0:t;return v.jsx(Nf,{id:L,path:z,labelX:E,labelY:C,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:N,interactionWidth:_})})}const v3=AS({isInternal:!1}),MS=AS({isInternal:!0});v3.displayName="SimpleBezierEdge";MS.displayName="SimpleBezierEdgeInternal";function jS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:k,markerStart:N,pathOptions:_,interactionWidth:z})=>{const[E,C,L]=om({sourceX:n,sourceY:r,sourcePosition:b,targetX:a,targetY:l,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:t;return v.jsx(Nf,{id:A,path:E,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:N,interactionWidth:z})})}const RS=jS({isInternal:!1}),zS=jS({isInternal:!0});RS.displayName="SmoothStepEdge";zS.displayName="SmoothStepEdgeInternal";function OS(e){return X.memo(({id:t,...n})=>{const r=e.isInternal?void 0:t;return v.jsx(RS,{...n,id:r,pathOptions:X.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const w3=OS({isInternal:!1}),DS=OS({isInternal:!0});w3.displayName="StepEdge";DS.displayName="StepEdgeInternal";function LS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:k})=>{const[N,_,z]=Ww({sourceX:n,sourceY:r,targetX:a,targetY:l}),E=e.isInternal?void 0:t;return v.jsx(Nf,{id:E,path:N,labelX:_,labelY:z,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:k})})}const S3=LS({isInternal:!1}),BS=LS({isInternal:!0});S3.displayName="StraightEdge";BS.displayName="StraightEdgeInternal";function HS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:N,pathOptions:_,interactionWidth:z})=>{const[E,C,L]=Qw({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:t;return v.jsx(Nf,{id:A,path:E,labelX:C,labelY:L,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:k,markerStart:N,interactionWidth:z})})}const _3=HS({isInternal:!1}),US=HS({isInternal:!0});_3.displayName="BezierEdge";US.displayName="BezierEdgeInternal";const C1={default:US,straight:BS,step:DS,smoothstep:zS,simplebezier:MS},T1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},k3=(e,t,n)=>n===be.Left?e-t:n===be.Right?e+t:e,E3=(e,t,n)=>n===be.Top?e-t:n===be.Bottom?e+t:e,A1="react-flow__edgeupdater";function M1({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Et([A1,`${A1}-${f}`]),cx:k3(t,r,e),cy:E3(n,r,e),r,stroke:"transparent",fill:"transparent"})}function N3({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:f,targetPosition:d,onReconnect:h,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ft(),k=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:B,isValidConnection:G,connectionMode:Z,connectionRadius:H,lib:$,onConnectStart:P,onConnectEnd:te,cancelConnection:D,nodeLookup:U,rfId:R,panBy:I,updateConnection:F}=w.getState(),K=L.type==="target",j=(M,ie)=>{x(!1),m?.(M,n,L.type,ie)},O=M=>h?.(n,M),V=(M,ie)=>{x(!0),g?.(C,n,L.type),P?.(M,ie)};cm.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:Z,connectionRadius:H,domNode:B,handleId:L.id,nodeId:L.nodeId,nodeLookup:U,isTarget:K,edgeUpdaterType:L.type,lib:$,flowId:R,cancelConnection:D,panBy:I,isValidConnection:G,onConnect:O,onConnectStart:V,onConnectEnd:te,onReconnectEnd:j,updateConnection:F,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>k(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=C=>k(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),z=()=>b(!0),E=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(M1,{position:f,centerX:r,centerY:a,radius:t,onMouseDown:N,onMouseEnter:z,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&v.jsx(M1,{position:d,centerX:l,centerY:u,radius:t,onMouseDown:_,onMouseEnter:z,onMouseOut:E,type:"target"})]})}function C3({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:k,noPanClassName:N,onError:_,disableKeyboardA11y:z}){let E=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);E=C?{...C,...E}:E;let L=E.type||"default",A=k?.[L]||C1[L];A===void 0&&(_?.("011",ui.error011(L)),L="default",A=k?.default||C1.default);const B=!!(E.focusable||t&&typeof E.focusable>"u"),G=typeof m<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),Z=!!(E.selectable||r&&typeof E.selectable>"u"),H=X.useRef(null),[$,P]=X.useState(!1),[te,D]=X.useState(!1),U=ft(),{zIndex:R,sourceX:I,sourceY:F,targetX:K,targetY:j,sourcePosition:O,targetPosition:V}=Ye(X.useCallback(we=>{const Ne=we.nodeLookup.get(E.source),De=we.nodeLookup.get(E.target);if(!Ne||!De)return{zIndex:E.zIndex,...T1};const Qe=xA({id:e,sourceNode:Ne,targetNode:De,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:fA({selected:E.selected,zIndex:E.zIndex,sourceNode:Ne,targetNode:De,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Qe||T1}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),ct),M=X.useMemo(()=>E.markerStart?`url('#${lm(E.markerStart,w)}')`:void 0,[E.markerStart,w]),ie=X.useMemo(()=>E.markerEnd?`url('#${lm(E.markerEnd,w)}')`:void 0,[E.markerEnd,w]);if(E.hidden||I===null||F===null||K===null||j===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:De,multiSelectionActive:Qe}=U.getState();Z&&(U.setState({nodesSelectionActive:!1}),E.selected&&Qe?(De({nodes:[],edges:[E]}),H.current?.blur()):Ne([e])),a&&a(we,E)},fe=l?we=>{l(we,{...E})}:void 0,he=u?we=>{u(we,{...E})}:void 0,ue=f?we=>{f(we,{...E})}:void 0,me=d?we=>{d(we,{...E})}:void 0,Ee=h?we=>{h(we,{...E})}:void 0,Ce=we=>{if(!z&&Dw.includes(we.key)&&Z){const{unselectNodesAndEdges:Ne,addSelectedEdges:De}=U.getState();we.key==="Escape"?(H.current?.blur(),Ne({edges:[E]})):De([e])}};return v.jsx("svg",{style:{zIndex:R},children:v.jsxs("g",{className:Et(["react-flow__edge",`react-flow__edge-${L}`,E.className,N,{selected:E.selected,animated:E.animated,inactive:!Z&&!a,updating:$,selectable:Z}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:B?Ce:void 0,tabIndex:B?0:void 0,role:E.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":B?`${pS}-${w}`:void 0,ref:H,...E.domAttributes,children:[!te&&v.jsx(A,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:Z,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:I,sourceY:F,targetX:K,targetY:j,sourcePosition:O,targetPosition:V,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:M,markerEnd:ie,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),G&&v.jsx(N3,{edge:E,isReconnectable:G,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:I,sourceY:F,targetX:K,targetY:j,sourcePosition:O,targetPosition:V,setUpdateHover:P,setReconnecting:D})]})})}var T3=X.memo(C3);const A3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function IS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:N,edgesReconnectable:_,elementsSelectable:z,onError:E}=Ye(A3,ct),C=h3(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(x3,{defaultColor:e,rfId:n}),C.map(L=>v.jsx(T3,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:z,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:n,onError:E,edgeTypes:r,disableKeyboardA11y:k},L))]})}IS.displayName="EdgeRenderer";const M3=X.memo(IS),j3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function R3({children:e}){const t=Ye(j3);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function z3(e){const t=eg(),n=X.useRef(!1);X.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const O3=e=>e.panZoom?.syncViewport;function D3(e){const t=Ye(O3),n=ft();return X.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function L3(e){return e.connection.inProgress?{...e.connection,to:Cl(e.connection.to,e.transform)}:{...e.connection}}function B3(e){return L3}function H3(e){const t=B3();return Ye(t,ct)}const U3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function I3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:f,inProgress:d}=Ye(U3,ct);return!(l&&a&&d)?null:v.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:Et(["react-flow__connection",Hw(f)]),children:v.jsx(qS,{style:t,type:n,CustomComponent:r,isValid:f})})})}const qS=({style:e,type:t=Tr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:f,fromPosition:d,to:h,toNode:g,toHandle:m,toPosition:x,pointer:b}=H3();if(!a)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:x,connectionStatus:Hw(r),toNode:g,toHandle:m,pointer:b});let w="";const k={sourceX:l.x,sourceY:l.y,sourcePosition:d,targetX:h.x,targetY:h.y,targetPosition:x};switch(t){case Tr.Bezier:[w]=Qw(k);break;case Tr.SimpleBezier:[w]=TS(k);break;case Tr.Step:[w]=om({...k,borderRadius:0});break;case Tr.SmoothStep:[w]=om(k);break;default:[w]=Ww(k)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};qS.displayName="ConnectionLine";const q3={};function j1(e=q3){X.useRef(e),ft(),X.useEffect(()=>{},[e])}function $3(){ft(),X.useRef(!1),X.useEffect(()=>{},[])}function $S({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:N,connectionLineContainerStyle:_,selectionKeyCode:z,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:B,deleteKeyCode:G,onlyRenderVisibleElements:Z,elementsSelectable:H,defaultViewport:$,translateExtent:P,minZoom:te,maxZoom:D,preventScrolling:U,defaultMarkerColor:R,zoomOnScroll:I,zoomOnPinch:F,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,zoomOnDoubleClick:V,panOnDrag:M,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:De,onEdgeMouseLeave:Qe,reconnectRadius:Xe,onReconnect:pt,onReconnectStart:un,onReconnectEnd:Ht,noDragClassName:Qt,noWheelClassName:Bn,noPanClassName:pi,disableKeyboardA11y:mi,nodeExtent:Ct,rfId:Yi,viewport:se,onViewportChange:pe}){return j1(e),j1(t),$3(),z3(n),D3(se),v.jsx(i3,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:G,selectionKeyCode:z,selectionOnDrag:E,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:B,elementsSelectable:H,zoomOnScroll:I,zoomOnPinch:F,zoomOnDoubleClick:V,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,panOnDrag:M,defaultViewport:$,translateExtent:P,minZoom:te,maxZoom:D,onSelectionContextMenu:m,preventScrolling:U,noDragClassName:Qt,noWheelClassName:Bn,noPanClassName:pi,disableKeyboardA11y:mi,onViewportChange:pe,isControlledViewport:!!se,children:v.jsxs(R3,{children:[v.jsx(M3,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:pt,onReconnectStart:un,onReconnectEnd:Ht,onlyRenderVisibleElements:Z,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:De,onEdgeMouseLeave:Qe,reconnectRadius:Xe,defaultMarkerColor:R,noPanClassName:pi,disableKeyboardA11y:mi,rfId:Yi}),v.jsx(I3,{style:k,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(d3,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:Z,noPanClassName:pi,noDragClassName:Qt,disableKeyboardA11y:mi,nodeExtent:Ct,rfId:Yi}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}$S.displayName="GraphView";const P3=X.memo($S),R1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:d=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,k=new Map,N=new Map,_=r??t??[],z=n??e??[],E=g??[0,0],C=m??dl;nS(k,N,_);const L=um(z,b,w,{nodeOrigin:E,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&a&&l){const B=El(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:G,y:Z,zoom:H}=Xm(B,a,l,d,h,f?.padding??.1);A=[G,Z,H]}return{rfId:"1",width:a??0,height:l??0,transform:A,nodes:z,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:N,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:h,translateExtent:dl,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xa.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...Bw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:sA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Lw,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},V3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>lM((b,w)=>{async function k(){const{nodeLookup:N,panZoom:_,fitViewOptions:z,fitViewResolver:E,width:C,height:L,minZoom:A,maxZoom:B}=w();_&&(await iA({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:B},z),E?.resolve(!0),b({fitViewResolver:null}))}return{...R1({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:x}),setNodes:N=>{const{nodeLookup:_,parentLookup:z,nodeOrigin:E,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),B=um(N,_,z,{nodeOrigin:E,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&B?(k(),b({nodes:N,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:B})},setEdges:N=>{const{connectionLookup:_,edgeLookup:z}=w();nS(_,z,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:z}=w();z(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:z}=w();z(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:z,parentLookup:E,domNode:C,nodeOrigin:L,nodeExtent:A,debug:B,fitViewQueued:G,zIndexMode:Z}=w(),{changes:H,updatedInternals:$}=NA(N,z,E,C,L,A,Z);$&&(SA(z,E,{nodeOrigin:L,nodeExtent:A,zIndexMode:Z}),G?(k(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),H?.length>0&&(B&&console.log("React Flow: trigger node changes",H),_?.(H)))},updateNodePositions:(N,_=!1)=>{const z=[];let E=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:B,onNodesChangeMiddlewareMap:G}=w();for(const[Z,H]of N){const $=C.get(Z),P=!!($?.expandParent&&$?.parentId&&H?.position),te={id:Z,type:"position",position:P?{x:Math.max(0,H.position.x),y:Math.max(0,H.position.y)}:H.position,dragging:_};if($&&A.inProgress&&A.fromNode.id===$.id){const D=cs($,A.fromHandle,be.Left,!0);B({...A,from:D})}P&&$.parentId&&z.push({id:Z,parentId:$.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),E.push(te)}if(z.length>0){const{parentLookup:Z,nodeOrigin:H}=w(),$=Wm(z,C,Z,H);E.push(...$)}for(const Z of G.values())E=Z(E);L(E)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:z,nodes:E,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=yS(N,E);z(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:z,edges:E,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=xS(N,E);z(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:z,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(B=>ns(B,!0));C(A);return}C(ua(E,new Set([...N]),!0)),L(ua(z))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:z,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(B=>ns(B,!0));L(A);return}L(ua(z,new Set([...N]))),C(ua(E,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:z,nodes:E,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),B=N||E,G=_||z,Z=B.map($=>{const P=C.get($.id);return P&&(P.selected=!1),ns($.id,!1)}),H=G.map($=>ns($.id,!1));L(Z),A(H)},setMinZoom:N=>{const{panZoom:_,maxZoom:z}=w();_?.setScaleExtent([N,z]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:z}=w();_?.setScaleExtent([z,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:z,triggerEdgeChanges:E,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((B,G)=>G.selected?[...B,ns(G.id,!1)]:B,[]),A=N.reduce((B,G)=>G.selected?[...B,ns(G.id,!1)]:B,[]);z(L),E(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:z,parentLookup:E,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:B}=w();N[0][0]===A[0][0]&&N[0][1]===A[0][1]&&N[1][0]===A[1][0]&&N[1][1]===A[1][1]||(um(_,z,E,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:B}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:z,height:E,panZoom:C,translateExtent:L}=w();return CA({delta:N,panZoom:C,transform:_,translateExtent:L,width:z,height:E})},setCenter:async(N,_,z)=>{const{width:E,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const B=typeof z?.zoom<"u"?z.zoom:L;return await A.setViewport({x:E/2-N*B,y:C/2-_*B,zoom:B},{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Bw}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...R1()})}},Object.is);function PS({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:d,fitView:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=X.useState(()=>V3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:h,minZoom:u,maxZoom:f,fitViewOptions:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(uM,{value:w,children:v.jsx(RM,{children:b})})}function F3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:f,fitViewOptions:d,minZoom:h,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return X.useContext(_f)?v.jsx(v.Fragment,{children:e}):v.jsx(PS,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const Y3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function X3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:f,onEdgeClick:d,onInit:h,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:k,onClickConnectStart:N,onClickConnectEnd:_,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:B,onNodeDrag:G,onNodeDragStop:Z,onNodesDelete:H,onEdgesDelete:$,onDelete:P,onSelectionChange:te,onSelectionDragStart:D,onSelectionDrag:U,onSelectionDragStop:R,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onBeforeDelete:j,connectionMode:O,connectionLineType:V=Tr.Bezier,connectionLineStyle:M,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=hl.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=ml()?"Meta":"Control",zoomActivationKeyCode:we=ml()?"Meta":"Control",snapToGrid:Ne,snapGrid:De,onlyRenderVisibleElements:Qe=!1,selectNodesOnDrag:Xe,nodesDraggable:pt,autoPanOnNodeFocus:un,nodesConnectable:Ht,nodesFocusable:Qt,nodeOrigin:Bn=mS,edgesFocusable:pi,edgesReconnectable:mi,elementsSelectable:Ct=!0,defaultViewport:Yi=SM,minZoom:se=.5,maxZoom:pe=2,translateExtent:_e=dl,preventScrolling:Oe=!0,nodeExtent:Pe,defaultMarkerColor:Ft="#b1b1b7",zoomOnScroll:Hn=!0,zoomOnPinch:Rt=!0,panOnScroll:mt=!1,panOnScrollSpeed:Ut=.5,panOnScrollMode:Je=as.Free,zoomOnDoubleClick:Jn=!0,panOnDrag:cn=!0,onPaneClick:Yf,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:jr=1,nodeClickDistance:Xf=0,children:Dl,onReconnect:za,onReconnectStart:Rr,onReconnectEnd:Gf,onEdgeContextMenu:Ll,onEdgeDoubleClick:Bl,onEdgeMouseEnter:Hl,onEdgeMouseMove:Oa,onEdgeMouseLeave:Da,reconnectRadius:Ul=10,onNodesChange:Il,onEdgesChange:Wn,noDragClassName:Tt="nodrag",noWheelClassName:It="nowheel",noPanClassName:yi="nopan",fitView:xs,fitViewOptions:ql,connectOnClick:Zf,attributionPosition:$l,proOptions:zr,defaultEdgeOptions:La,elevateNodesOnSelect:Xi=!0,elevateEdgesOnSelect:Gi=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:Pl,connectionRadius:Vl,isValidConnection:xi,onError:Ki,style:Qf,id:Ba,nodeDragThreshold:Fl,connectionDragThreshold:Kf,viewport:bs,onViewportChange:vs,width:Un,height:Kt,colorMode:Yl="light",debug:Jf,onScroll:ws,ariaLabelConfig:Xl,zIndexMode:Or="basic",...Wf},Jt){const Dr=Ba||"1",Gl=NM(Yl),Ha=X.useCallback(bi=>{bi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ws?.(bi)},[ws]);return v.jsx("div",{"data-testid":"rf__wrapper",...Wf,onScroll:Ha,style:{...Qf,...Y3},ref:Jt,className:Et(["react-flow",a,Gl]),id:Ba,role:"application",children:v.jsxs(F3,{nodes:e,edges:t,width:Un,height:Kt,fitView:xs,fitViewOptions:ql,minZoom:se,maxZoom:pe,nodeOrigin:Bn,nodeExtent:Pe,zIndexMode:Or,children:[v.jsx(P3,{onInit:h,onNodeClick:f,onEdgeClick:d,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:l,edgeTypes:u,connectionLineType:V,connectionLineStyle:M,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Qe,defaultViewport:Yi,translateExtent:_e,minZoom:se,maxZoom:pe,preventScrolling:Oe,zoomOnScroll:Hn,zoomOnPinch:Rt,zoomOnDoubleClick:Jn,panOnScroll:mt,panOnScrollSpeed:Ut,panOnScrollMode:Je,panOnDrag:cn,onPaneClick:Yf,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:jr,nodeClickDistance:Xf,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onReconnect:za,onReconnectStart:Rr,onReconnectEnd:Gf,onEdgeContextMenu:Ll,onEdgeDoubleClick:Bl,onEdgeMouseEnter:Hl,onEdgeMouseMove:Oa,onEdgeMouseLeave:Da,reconnectRadius:Ul,defaultMarkerColor:Ft,noDragClassName:Tt,noWheelClassName:It,noPanClassName:yi,rfId:Dr,disableKeyboardA11y:Zi,nodeExtent:Pe,viewport:bs,onViewportChange:vs}),v.jsx(EM,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:w,onConnectEnd:k,onClickConnectStart:N,onClickConnectEnd:_,nodesDraggable:pt,autoPanOnNodeFocus:un,nodesConnectable:Ht,nodesFocusable:Qt,edgesFocusable:pi,edgesReconnectable:mi,elementsSelectable:Ct,elevateNodesOnSelect:Xi,elevateEdgesOnSelect:Gi,minZoom:se,maxZoom:pe,nodeExtent:Pe,onNodesChange:Il,onEdgesChange:Wn,snapToGrid:Ne,snapGrid:De,connectionMode:O,translateExtent:_e,connectOnClick:Zf,defaultEdgeOptions:La,fitView:xs,fitViewOptions:ql,onNodesDelete:H,onEdgesDelete:$,onDelete:P,onNodeDragStart:B,onNodeDrag:G,onNodeDragStop:Z,onSelectionDrag:U,onSelectionDragStart:D,onSelectionDragStop:R,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:yi,nodeOrigin:Bn,rfId:Dr,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:Pl,onError:Ki,connectionRadius:Vl,isValidConnection:xi,selectNodesOnDrag:Xe,nodeDragThreshold:Fl,connectionDragThreshold:Kf,onBeforeDelete:j,debug:Jf,ariaLabelConfig:Xl,zIndexMode:Or}),v.jsx(wM,{onSelectionChange:te}),Dl,v.jsx(gM,{proOptions:zr,position:$l}),v.jsx(mM,{rfId:Dr,disableKeyboardA11y:Zi})]})})}var G3=bS(X3);function Z3({dimensions:e,lineWidth:t,variant:n,className:r}){return v.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Et(["react-flow__background-pattern",n,r])})}function Q3({radius:e,className:t}){return v.jsx("circle",{cx:e,cy:e,r:e,className:Et(["react-flow__background-pattern","dots",t])})}var $i;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($i||($i={}));const K3={[$i.Dots]:1,[$i.Lines]:1,[$i.Cross]:6},J3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function VS({id:e,variant:t=$i.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:f,style:d,className:h,patternClassName:g}){const m=X.useRef(null),{transform:x,patternId:b}=Ye(J3,ct),w=r||K3[t],k=t===$i.Dots,N=t===$i.Cross,_=Array.isArray(n)?n:[n,n],z=[_[0]*x[2]||1,_[1]*x[2]||1],E=w*x[2],C=Array.isArray(l)?l:[l,l],L=N?[E,E]:z,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],B=`${b}${e||""}`;return v.jsxs("svg",{className:Et(["react-flow__background",h]),style:{...d,...Ef,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:B,x:x[0]%z[0],y:x[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:k?v.jsx(Q3,{radius:E/2,className:g}):v.jsx(Z3,{dimensions:L,lineWidth:a,variant:t,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}VS.displayName="Background";const W3=X.memo(VS);function e5(){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 t5(){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 n5(){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 i5(){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 r5(){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 dc({children:e,className:t,...n}){return v.jsx("button",{type:"button",className:Et(["react-flow__controls-button",t]),...n,children:e})}const s5=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function FS({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:d,className:h,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ft(),{isInteractive:k,minZoomReached:N,maxZoomReached:_,ariaLabelConfig:z}=Ye(s5,ct),{zoomIn:E,zoomOut:C,fitView:L}=eg(),A=()=>{E(),l?.()},B=()=>{C(),u?.()},G=()=>{L(a),f?.()},Z=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),d?.(!k)},H=x==="horizontal"?"horizontal":"vertical";return v.jsxs(kf,{className:Et(["react-flow__controls",H,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??z["controls.ariaLabel"],children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(dc,{onClick:A,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(e5,{})}),v.jsx(dc,{onClick:B,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(t5,{})})]}),n&&v.jsx(dc,{className:"react-flow__controls-fitview",onClick:G,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:v.jsx(n5,{})}),r&&v.jsx(dc,{className:"react-flow__controls-interactive",onClick:Z,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:k?v.jsx(r5,{}):v.jsx(i5,{})}),g]})}FS.displayName="Controls";const a5=X.memo(FS);function o5({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:f,strokeWidth:d,className:h,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:k}=l||{},N=u||w||k;return v.jsx("rect",{className:Et(["react-flow__minimap-node",{selected:x},h]),x:t,y:n,rx:g,ry:g,width:r,height:a,style:{fill:N,stroke:f,strokeWidth:d},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const l5=X.memo(o5),u5=e=>e.nodes.map(t=>t.id),Sp=e=>e instanceof Function?e:()=>e;function c5({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=l5,onClick:u}){const f=Ye(u5,ct),d=Sp(t),h=Sp(e),g=Sp(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(d5,{id:x,nodeColorFunc:d,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:m},x))})}function f5({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:f,onClick:d}){const{node:h,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:k}=w.nodeLookup.get(e),N=k.userNode,{x:_,y:z}=k.positionAbsolute,{width:E,height:C}=Vi(N);return{node:N,x:_,y:z,width:E,height:C}},ct);return!h||h.hidden||!Vw(h)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:l,shapeRendering:u,onClick:d,id:h.id})}const d5=X.memo(f5);var h5=X.memo(c5);const p5=200,m5=150,g5=e=>!e.hidden,y5=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Pw(El(e.nodeLookup,{filter:g5}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},x5="react-flow__minimap-desc";function YS({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:d,maskColor:h,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:k=!1,zoomable:N=!1,ariaLabel:_,inversePan:z,zoomStep:E=1,offsetScale:C=5}){const L=ft(),A=X.useRef(null),{boundingRect:B,viewBB:G,rfId:Z,panZoom:H,translateExtent:$,flowWidth:P,flowHeight:te,ariaLabelConfig:D}=Ye(y5,ct),U=e?.width??p5,R=e?.height??m5,I=B.width/U,F=B.height/R,K=Math.max(I,F),j=K*U,O=K*R,V=C*K,M=B.x-(j-B.width)/2-V,ie=B.y-(O-B.height)/2-V,ce=j+V*2,fe=O+V*2,he=`${x5}-${Z}`,ue=X.useRef(0),me=X.useRef();ue.current=K,X.useEffect(()=>{if(A.current&&H)return me.current=LA({domNode:A.current,panZoom:H,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[H]),X.useEffect(()=>{me.current?.update({translateExtent:$,width:P,height:te,inversePan:z,pannable:k,zoomStep:E,zoomable:N})},[k,N,z,E,$,P,te]);const Ee=b?Ne=>{const[De,Qe]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:De,y:Qe})}:void 0,Ce=w?X.useCallback((Ne,De)=>{const Qe=L.getState().nodeLookup.get(De).internals.userNode;w(Ne,Qe)},[]):void 0,we=_??D["minimap.ariaLabel"];return v.jsx(kf,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Et(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:U,height:R,viewBox:`${M} ${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(h5,{onClick:Ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${M-V},${ie-V}h${ce+V*2}v${fe+V*2}h${-ce-V*2}z
|
|
15
|
-
M${G.x},${G.y}h${G.width}v${G.height}h${-G.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}YS.displayName="MiniMap";const b5=X.memo(YS),v5=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,w5={[Sa.Line]:"right",[Sa.Handle]:"bottom-right"};function S5({nodeId:e,position:t,variant:n=Sa.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:f=10,minHeight:d=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:k,onResize:N,onResizeEnd:_}){const z=_S(),E=typeof e=="string"?e:z,C=ft(),L=X.useRef(null),A=n===Sa.Handle,B=Ye(X.useCallback(v5(A&&b),[A,b]),ct),G=X.useRef(null),Z=t??w5[n];X.useEffect(()=>{if(!(!L.current||!E))return G.current||(G.current=QA({domNode:L.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:$,transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U,domNode:R}=C.getState();return{nodeLookup:$,transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U,paneDomNode:R}},onChange:($,P)=>{const{triggerNodeChanges:te,nodeLookup:D,parentLookup:U,nodeOrigin:R}=C.getState(),I=[],F={x:$.x,y:$.y},K=D.get(E);if(K&&K.expandParent&&K.parentId){const j=K.origin??R,O=$.width??K.measured.width??0,V=$.height??K.measured.height??0,M={id:K.id,parentId:K.parentId,rect:{width:O,height:V,...Fw({x:$.x??K.position.x,y:$.y??K.position.y},{width:O,height:V},K.parentId,D,j)}},ie=Wm([M],D,U,R);I.push(...ie),F.x=$.x?Math.max(j[0]*O,$.x):void 0,F.y=$.y?Math.max(j[1]*V,$.y):void 0}if(F.x!==void 0&&F.y!==void 0){const j={id:E,type:"position",position:{...F}};I.push(j)}if($.width!==void 0&&$.height!==void 0){const O={id:E,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};I.push(O)}for(const j of P){const O={...j,type:"position"};I.push(O)}te(I)},onEnd:({width:$,height:P})=>{const te={id:E,type:"dimensions",resizing:!1,dimensions:{width:$,height:P}};C.getState().triggerNodeChanges([te])}})),G.current.update({controlPosition:Z,boundaries:{minWidth:f,minHeight:d,maxWidth:h,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:k,onResize:N,onResizeEnd:_,shouldResize:w}),()=>{G.current?.destroy()}},[Z,f,d,h,g,m,k,N,_,w]);const H=Z.split("-");return v.jsx("div",{className:Et(["react-flow__resize-control","nodrag",...H,n,r]),ref:L,style:{...a,scale:B,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:l})}X.memo(S5);const XS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const _5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const k5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const z1=e=>{const t=k5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var E5={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 N5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const C5=X.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...f},d)=>X.createElement("svg",{ref:d,...E5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:XS("lucide",a),...!l&&!N5(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>X.createElement(h,g)),...Array.isArray(l)?l:[l]]));const ze=(e,t)=>{const n=X.forwardRef(({className:r,...a},l)=>X.createElement(C5,{ref:l,iconNode:t,className:XS(`lucide-${_5(z1(e))}`,`lucide-${e}`,r),...a}));return n.displayName=z1(e),n};const T5=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],ng=ze("anchor",T5);const A5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],M5=ze("arrow-left",A5);const j5=[["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"}]],R5=ze("bot",j5);const z5=[["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"}]],Cf=ze("chart-column",z5);const O5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],D5=ze("check",O5);const L5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],GS=ze("chevron-down",L5);const B5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],H5=ze("chevron-right",B5);const U5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],I5=ze("chevron-up",U5);const q5=[["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"}]],dm=ze("circle-alert",q5);const $5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Tf=ze("circle-check-big",$5);const P5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],V5=ze("circle-check",P5);const F5=[["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"}]],ig=ze("circle-x",F5);const Y5=[["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"}]],da=ze("download",Y5);const X5=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],G5=ze("eye-off",X5);const Z5=[["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"}]],ZS=ze("eye",Z5);const Q5=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],K5=ze("file-code",Q5);const J5=[["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"}]],ha=ze("file-text",J5);const W5=[["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"}]],O1=ze("folder-open",W5);const ej=[["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"}]],tj=ze("globe",ej);const nj=[["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"}]],QS=ze("image",nj);const ij=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],rj=ze("info",ij);const sj=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],aj=ze("key",sj);const oj=[["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"}]],lj=ze("link-2",oj);const uj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],af=ze("loader-circle",uj);const cj=[["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"}]],fj=ze("maximize-2",cj);const dj=[["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"}]],Af=ze("message-square",dj);const hj=[["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"}]],pj=ze("minimize-2",hj);const mj=[["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"}]],yl=ze("play",mj);const gj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],yj=ze("refresh-cw",gj);const xj=[["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"}]],bj=ze("save",xj);const vj=[["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"}]],wj=ze("send",vj);const Sj=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],_j=ze("server",Sj);const kj=[["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"}]],Ej=ze("settings-2",kj);const Nj=[["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"}]],KS=ze("settings",Nj);const Cj=[["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"}]],Tl=ze("sparkles",Cj);const Tj=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ds=ze("terminal",Tj);const Aj=[["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"}]],Mf=ze("trash-2",Aj);const Mj=[["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"}]],jj=ze("triangle-alert",Mj);const Rj=[["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"}]],zj=ze("upload",Rj);const Oj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],rg=ze("x",Oj);const Dj=[["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"}]],jf=ze("zap",Dj),D1=e=>{let t;const n=new Set,r=(h,g)=>{const m=typeof h=="function"?h(t):h;if(!Object.is(m,t)){const x=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(b=>b(t,x))}},a=()=>t,f={setState:r,getState:a,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,a,f);return f},Lj=(e=>e?D1(e):D1),Bj=e=>e;function Hj(e,t=Bj){const n=Ko.useSyncExternalStore(e.subscribe,Ko.useCallback(()=>t(e.getState()),[e,t]),Ko.useCallback(()=>t(e.getInitialState()),[e,t]));return Ko.useDebugValue(n),n}const L1=e=>{const t=Lj(e),n=r=>Hj(t,r);return Object.assign(n,t),n},Rf=(e=>e?L1(e):L1);function Uj(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const u=d=>d===null?null:JSON.parse(d,void 0),f=(l=n.getItem(a))!=null?l:null;return f instanceof Promise?f.then(u):u(f)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const hm=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return hm(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return hm(r)(n)}}}},Ij=(e,t)=>(n,r,a)=>{let l={storage:Uj(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...t},u=!1,f=0;const d=new Set,h=new Set;let g=l.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...N)},r,a);const m=()=>{const N=l.partialize({...r()});return g.setItem(l.name,{state:N,version:l.version})},x=a.setState;a.setState=(N,_)=>(x(N,_),m());const b=e((...N)=>(n(...N),m()),r,a);a.getInitialState=()=>b;let w;const k=()=>{var N,_;if(!g)return;const z=++f;u=!1,d.forEach(C=>{var L;return C((L=r())!=null?L:b)});const E=((_=l.onRehydrateStorage)==null?void 0:_.call(l,(N=r())!=null?N:b))||void 0;return hm(g.getItem.bind(g))(l.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==l.version){if(l.migrate){const L=l.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(z!==f)return;const[A,B]=C;if(w=l.merge(B,(L=r())!=null?L:b),n(w,!0),A)return m()}).then(()=>{z===f&&(E?.(w,void 0),w=r(),u=!0,h.forEach(C=>C(w)))}).catch(C=>{z===f&&E?.(void 0,C)})};return a.persist={setOptions:N=>{l={...l,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>k(),hasHydrated:()=>u,onHydrate:N=>(d.add(N),()=>{d.delete(N)}),onFinishHydration:N=>(h.add(N),()=>{h.delete(N)})},l.skipHydration||k(),w||b},JS=Ij,qj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ka=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=qj[n[e]&63];return t};const ci=Rf()(JS(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:ka(),workflowName:"Untitled Workflow",isDraft:!0,addNode:t=>e(n=>({nodes:[...n.nodes,t]})),updateNode:(t,n)=>e(r=>({nodes:r.nodes.map(a=>a.id===t?{...a,data:{...a.data,...n}}:a)})),updateNodeStatus:(t,n,r)=>e(a=>({nodes:a.nodes.map(l=>l.id===t?{...l,data:{...l.data,status:n,progress:r??l.data.progress}}:l)})),removeNode:t=>e(n=>({nodes:n.nodes.filter(r=>r.id!==t),edges:n.edges.filter(r=>r.source!==t&&r.target!==t),selectedNodeId:n.selectedNodeId===t?null:n.selectedNodeId})),setSelectedNode:t=>e({selectedNodeId:t}),addEdge:t=>e(n=>({edges:[...n.edges,t]})),removeEdge:t=>e(n=>({edges:n.edges.filter(r=>r.id!==t)})),setWorkflowName:t=>e({workflowName:t}),loadWorkflow:t=>e({nodes:t.nodes,edges:t.edges,workflowName:t.name||"Imported Workflow",selectedNodeId:null}),mergeExistingConfig:t=>e(n=>{const r=new Set(t.map(h=>h.id)),a=["skill-","subagent-","command-","hook-"],l=h=>a.some(g=>h.startsWith(g)),u=n.nodes.filter(h=>l(h.id)?r.has(h.id):!0),f=new Set(u.map(h=>h.id)),d=t.filter(h=>!f.has(h.id));return{nodes:[...u,...d]}}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:ka(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:t=>e({nodes:t}),setEdges:t=>e({edges:t})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),WS=e=>e.nodes.find(t=>t.id===e.selectedNodeId),Na=Rf((e,t)=>({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}),t().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),t().addLog("info","Workflow execution stopped")},setCurrentNode:n=>{e({currentNodeId:n}),n&&t().addLog("info","Processing node",n)},markNodeCompleted:(n,r)=>{e(a=>{const l=new Set(a.completedNodes);l.add(n);const u=new Map(a.results);return r!==void 0&&u.set(n,r),{completedNodes:l,results:u}}),t().addLog("success","Node completed",n)},markNodeFailed:(n,r)=>{e(a=>{const l=new Set(a.failedNodes);return l.add(n),{failedNodes:l}}),t().addLog("error",r||"Node failed",n)},setWorkflowResults:(n,r)=>{e({workflowResults:n,outputDir:r||null}),n.forEach(a=>{a.result&&e(l=>{const u=new Map(l.results);return u.set(a.nodeId,a.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:(n,r,a,l)=>{const u={id:ka(),timestamp:Date.now(),level:n,message:r,nodeId:a,details:l};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,t,n,r,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}function ne(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}let e_=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return e_=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))};function xl(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const pm=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Ae extends Error{}class Pt extends Ae{constructor(t,n,r,a){super(`${Pt.makeMessage(t,n,r)}`),this.status=t,this.headers=a,this.requestID=a?.get("request-id"),this.error=n}static makeMessage(t,n,r){const a=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&a?`${t} ${a}`:t?`${t} status code (no body)`:a||"(no status code or body)"}static generate(t,n,r,a){if(!t||!a)return new zf({message:r,cause:pm(n)});const l=n;return t===400?new n_(t,l,r,a):t===401?new i_(t,l,r,a):t===403?new r_(t,l,r,a):t===404?new s_(t,l,r,a):t===409?new a_(t,l,r,a):t===422?new o_(t,l,r,a):t===429?new l_(t,l,r,a):t>=500?new u_(t,l,r,a):new Pt(t,l,r,a)}}class Gn extends Pt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class zf extends Pt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}}class t_ extends zf{constructor({message:t}={}){super({message:t??"Request timed out."})}}class n_ extends Pt{}class i_ extends Pt{}class r_ extends Pt{}class s_ extends Pt{}class a_ extends Pt{}class o_ extends Pt{}class l_ extends Pt{}class u_ extends Pt{}const $j=/^[a-z][a-z0-9+.-]*:/i,Pj=e=>$j.test(e);let mm=e=>(mm=Array.isArray,mm(e)),B1=mm;function gm(e){return typeof e!="object"?{}:e??{}}function Vj(e){if(!e)return!0;for(const t in e)return!1;return!0}function Fj(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const Yj=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Ae(`${e} must be an integer`);if(t<0)throw new Ae(`${e} must be a positive integer`);return t},c_=e=>{try{return JSON.parse(e)}catch{return}},Xj=e=>new Promise(t=>setTimeout(t,e)),sa="0.71.2",Gj=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function Zj(){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 Qj=()=>{const e=Zj();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":U1(Deno.build.os),"X-Stainless-Arch":H1(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":sa,"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":sa,"X-Stainless-OS":U1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":H1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const t=Kj();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Kj(){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:t,pattern:n}of e){const r=n.exec(navigator.userAgent);if(r){const a=r[1]||0,l=r[2]||0,u=r[3]||0;return{browser:t,version:`${a}.${l}.${u}`}}}return null}const H1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",U1=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 I1;const Jj=()=>I1??(I1=Qj());function Wj(){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 f_(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function d_(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return f_({start(){},async pull(n){const{done:r,value:a}=await t.next();r?n.close():n.enqueue(a)},async cancel(){await t.return?.()}})}function sg(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eR(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const t=e.getReader(),n=t.cancel();t.releaseLock(),await n}const tR=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function nR(e){let t=0;for(const a of e)t+=a.length;const n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}let q1;function ag(e){let t;return(q1??(t=new globalThis.TextEncoder,q1=t.encode.bind(t)))(e)}let $1;function P1(e){let t;return($1??(t=new globalThis.TextDecoder,$1=t.decode.bind(t)))(e)}var bn,vn;class Al{constructor(){bn.set(this,void 0),vn.set(this,void 0),ge(this,bn,new Uint8Array),ge(this,vn,null)}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?ag(t):t;ge(this,bn,nR([ne(this,bn,"f"),n]));const r=[];let a;for(;(a=iR(ne(this,bn,"f"),ne(this,vn,"f")))!=null;){if(a.carriage&&ne(this,vn,"f")==null){ge(this,vn,a.index);continue}if(ne(this,vn,"f")!=null&&(a.index!==ne(this,vn,"f")+1||a.carriage)){r.push(P1(ne(this,bn,"f").subarray(0,ne(this,vn,"f")-1))),ge(this,bn,ne(this,bn,"f").subarray(ne(this,vn,"f"))),ge(this,vn,null);continue}const l=ne(this,vn,"f")!==null?a.preceding-1:a.preceding,u=P1(ne(this,bn,"f").subarray(0,l));r.push(u),ge(this,bn,ne(this,bn,"f").subarray(a.index)),ge(this,vn,null)}return r}flush(){return ne(this,bn,"f").length?this.decode(`
|
|
16
|
-
`):[]}}bn=new WeakMap,vn=new WeakMap;Al.NEWLINE_CHARS=new Set([`
|
|
17
|
-
`,"\r"]);Al.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function iR(e,t){for(let a=t??0;a<e.length;a++){if(e[a]===10)return{preceding:a,index:a+1,carriage:!1};if(e[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function rR(e){for(let r=0;r<e.length-1;r++){if(e[r]===10&&e[r+1]===10||e[r]===13&&e[r+1]===13)return r+2;if(e[r]===13&&e[r+1]===10&&r+3<e.length&&e[r+2]===13&&e[r+3]===10)return r+4}return-1}const of={off:0,error:200,warn:300,info:400,debug:500},V1=(e,t,n)=>{if(e){if(Fj(of,e))return e;Xt(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(of))}`)}};function el(){}function hc(e,t,n){return!t||of[e]>of[n]?el:t[e].bind(t)}const sR={error:el,warn:el,info:el,debug:el};let F1=new WeakMap;function Xt(e){const t=e.logger,n=e.logLevel??"off";if(!t)return sR;const r=F1.get(t);if(r&&r[0]===n)return r[1];const a={error:hc("error",t,n),warn:hc("warn",t,n),info:hc("info",t,n),debug:hc("debug",t,n)};return F1.set(t,[n,a]),a}const is=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(([t,n])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var jo;class ai{constructor(t,n,r){this.iterator=t,jo.set(this,void 0),this.controller=n,ge(this,jo,r)}static fromSSEResponse(t,n,r){let a=!1;const l=r?Xt(r):console;async function*u(){if(a)throw new Ae("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let f=!1;try{for await(const d of aR(t,n)){if(d.event==="completion")try{yield JSON.parse(d.data)}catch(h){throw l.error("Could not parse message into JSON:",d.data),l.error("From chunk:",d.raw),h}if(d.event==="message_start"||d.event==="message_delta"||d.event==="message_stop"||d.event==="content_block_start"||d.event==="content_block_delta"||d.event==="content_block_stop")try{yield JSON.parse(d.data)}catch(h){throw l.error("Could not parse message into JSON:",d.data),l.error("From chunk:",d.raw),h}if(d.event!=="ping"&&d.event==="error")throw new Pt(void 0,c_(d.data)??d.data,void 0,t.headers)}f=!0}catch(d){if(xl(d))return;throw d}finally{f||n.abort()}}return new ai(u,n,r)}static fromReadableStream(t,n,r){let a=!1;async function*l(){const f=new Al,d=sg(t);for await(const h of d)for(const g of f.decode(h))yield g;for(const h of f.flush())yield h}async function*u(){if(a)throw new Ae("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let f=!1;try{for await(const d of l())f||d&&(yield JSON.parse(d));f=!0}catch(d){if(xl(d))return;throw d}finally{f||n.abort()}}return new ai(u,n,r)}[(jo=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const t=[],n=[],r=this.iterator(),a=l=>({next:()=>{if(l.length===0){const u=r.next();t.push(u),n.push(u)}return l.shift()}});return[new ai(()=>a(t),this.controller,ne(this,jo,"f")),new ai(()=>a(n),this.controller,ne(this,jo,"f"))]}toReadableStream(){const t=this;let n;return f_({async start(){n=t[Symbol.asyncIterator]()},async pull(r){try{const{value:a,done:l}=await n.next();if(l)return r.close();const u=ag(JSON.stringify(a)+`
|
|
18
|
-
`);r.enqueue(u)}catch(a){r.error(a)}},async cancel(){await n.return?.()}})}}async function*aR(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ae("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 Ae("Attempted to iterate over a response with no body");const n=new lR,r=new Al,a=sg(e.body);for await(const l of oR(a))for(const u of r.decode(l)){const f=n.decode(u);f&&(yield f)}for(const l of r.flush()){const u=n.decode(l);u&&(yield u)}}async function*oR(e){let t=new Uint8Array;for await(const n of e){if(n==null)continue;const r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?ag(n):n;let a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length),t=a;let l;for(;(l=rR(t))!==-1;)yield t.slice(0,l),t=t.slice(l)}t.length>0&&(yield t)}class lR{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const l={event:this.event,data:this.data.join(`
|
|
19
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],l}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,r,a]=uR(t,":");return a.startsWith(" ")&&(a=a.substring(1)),n==="event"?this.event=a:n==="data"&&this.data.push(a),null}}function uR(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function h_(e,t){const{response:n,requestLogID:r,retryOfRequestLogID:a,startTime:l}=t,u=await(async()=>{if(t.options.stream)return Xt(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller):ai.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const d=n.headers.get("content-type")?.split(";")[0]?.trim();if(d?.includes("application/json")||d?.endsWith("+json")){const m=await n.json();return p_(m,n)}return await n.text()})();return Xt(e).debug(`[${r}] response parsed`,is({retryOfRequestLogID:a,url:n.url,status:n.status,body:u,durationMs:Date.now()-l})),u}function p_(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var tl;class Of extends Promise{constructor(t,n,r=h_){super(a=>{a(null)}),this.responsePromise=n,this.parseResponse=r,tl.set(this,void 0),ge(this,tl,t)}_thenUnwrap(t){return new Of(ne(this,tl,"f"),this.responsePromise,async(n,r)=>p_(t(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(ne(this,tl,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}tl=new WeakMap;var pc;class m_{constructor(t,n,r,a){pc.set(this,void 0),ge(this,pc,t),this.options=a,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const t=this.nextPageRequestOptions();if(!t)throw new Ae("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,pc,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(pc=new WeakMap,Symbol.asyncIterator)](){for await(const t of this.iterPages())for(const n of t.getPaginatedItems())yield n}}class cR extends Of{constructor(t,n,r){super(t,n,async(a,l)=>new r(a,l.response,await h_(a,l),l.options))}async*[Symbol.asyncIterator](){const t=await this;for await(const n of t)yield n}}class Ml extends m_{constructor(t,n,r,a){super(t,n,r,a),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const n=this.first_id;return n?{...this.options,query:{...gm(this.options.query),before_id:n}}:null}const t=this.last_id;return t?{...this.options,query:{...gm(this.options.query),after_id:t}}:null}}class g_ extends m_{constructor(t,n,r,a){super(t,n,r,a),this.data=r.data||[],this.has_more=r.has_more||!1,this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const t=this.next_page;return t?{...this.options,query:{...gm(this.options.query),page:t}}:null}}const y_=()=>{if(typeof File>"u"){const{process:e}=globalThis,t=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."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function pa(e,t,n){return y_(),new File(e,t??"unknown_file",n)}function qc(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 x_=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",og=async(e,t)=>({...e,body:await dR(e.body,t)}),Y1=new WeakMap;function fR(e){const t=typeof e=="function"?e:e.fetch,n=Y1.get(t);if(n)return n;const r=(async()=>{try{const a="Response"in t?t.Response:(await t("data:,")).constructor,l=new FormData;return l.toString()!==await new a(l).text()}catch{return!0}})();return Y1.set(t,r),r}const dR=async(e,t)=>{if(!await fR(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,a])=>ym(n,r,a))),n},hR=e=>e instanceof Blob&&"name"in e,ym=async(e,t,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={};const a=n.headers.get("Content-Type");a&&(r={type:a}),e.append(t,pa([await n.blob()],qc(n),r))}else if(x_(n))e.append(t,pa([await new Response(d_(n)).blob()],qc(n)));else if(hR(n))e.append(t,pa([n],qc(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>ym(e,t+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,a])=>ym(e,`${t}[${r}]`,a)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},b_=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",pR=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&b_(e),mR=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function gR(e,t,n){if(y_(),e=await e,t||(t=qc(e)),pR(e))return e instanceof File&&t==null&&n==null?e:pa([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(mR(e)){const a=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),pa(await xm(a),t,n)}const r=await xm(e);if(!n?.type){const a=r.find(l=>typeof l=="object"&&"type"in l&&l.type);typeof a=="string"&&(n={...n,type:a})}return pa(r,t,n)}async function xm(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(b_(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(x_(e))for await(const n of e)t.push(...await xm(n));else{const n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${yR(e)}`)}return t}function yR(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}class Kn{constructor(t){this._client=t}}const v_=Symbol.for("brand.privateNullableHeaders");function*xR(e){if(!e)return;if(v_ in e){const{values:r,nulls:a}=e;yield*r.entries();for(const l of a)yield[l,null];return}let t=!1,n;e instanceof Headers?n=e.entries():B1(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){const a=r[0];if(typeof a!="string")throw new TypeError("expected header name to be a string");const l=B1(r[1])?r[1]:[r[1]];let u=!1;for(const f of l)f!==void 0&&(t&&!u&&(u=!0,yield[a,null]),yield[a,f])}}const Ve=e=>{const t=new Headers,n=new Set;for(const r of e){const a=new Set;for(const[l,u]of xR(r)){const f=l.toLowerCase();a.has(f)||(t.delete(l),a.add(f)),u===null?(t.delete(l),n.add(f)):(t.append(l,u),n.delete(f))}}return{[v_]:!0,values:t,nulls:n}};function w_(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const X1=Object.freeze(Object.create(null)),bR=(e=w_)=>function(n,...r){if(n.length===1)return n[0];let a=!1;const l=[],u=n.reduce((g,m,x)=>{/[?#]/.test(m)&&(a=!0);const b=r[x];let w=(a?encodeURIComponent:e)(""+b);return x!==r.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??X1)??X1)?.toString)&&(w=b+"",l.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===r.length?"":w)},""),f=u.split(/[?#]/,1)[0],d=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let h;for(;(h=d.exec(f))!==null;)l.push({start:h.index,length:h[0].length,error:`Value "${h[0]}" can't be safely passed as a path parameter`});if(l.sort((g,m)=>g.start-m.start),l.length>0){let g=0;const m=l.reduce((x,b)=>{const w=" ".repeat(b.start-g),k="^".repeat(b.length);return g=b.start+b.length,x+w+k},"");throw new Ae(`Path parameters result in path with invalid segments:
|
|
20
|
-
${l.map(x=>x.error).join(`
|
|
21
|
-
`)}
|
|
22
|
-
${u}
|
|
23
|
-
${m}`)}return u},Bt=bR(w_);class S_ extends Kn{list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/files",Ml,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/files/${t}`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},r?.headers])})}download(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/files/${t}/content`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/files/${t}`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},r?.headers])})}upload(t,n){const{betas:r,...a}=t;return this._client.post("/v1/files",og({body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}}let __=class extends Kn{retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/models/${t}?beta=true`,{...r,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/models?beta=true",Ml,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}};const k_={"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 G1(e,t,n){return!t||!("parse"in(t.output_format??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){const a=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:E_(e,t,n)}function E_(e,t,n){let r=null;const a=e.content.map(l=>{if(l.type==="text"){const u=vR(t,l.text);r===null&&(r=u);const f=Object.defineProperty({...l},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return l});return{...e,content:a,parsed_output:r}}function vR(e,t){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(t):JSON.parse(t)}catch(n){throw new Ae(`Failed to parse structured output: ${n}`)}}const wR=e=>{let t=0,n=[];for(;t<e.length;){let r=e[t];if(r==="\\"){t++;continue}if(r==="{"){n.push({type:"brace",value:"{"}),t++;continue}if(r==="}"){n.push({type:"brace",value:"}"}),t++;continue}if(r==="["){n.push({type:"paren",value:"["}),t++;continue}if(r==="]"){n.push({type:"paren",value:"]"}),t++;continue}if(r===":"){n.push({type:"separator",value:":"}),t++;continue}if(r===","){n.push({type:"delimiter",value:","}),t++;continue}if(r==='"'){let f="",d=!1;for(r=e[++t];r!=='"';){if(t===e.length){d=!0;break}if(r==="\\"){if(t++,t===e.length){d=!0;break}f+=r+e[t],r=e[++t]}else f+=r,r=e[++t]}r=e[++t],d||n.push({type:"string",value:f});continue}if(r&&/\s/.test(r)){t++;continue}let l=/[0-9]/;if(r&&l.test(r)||r==="-"||r==="."){let f="";for(r==="-"&&(f+=r,r=e[++t]);r&&l.test(r)||r===".";)f+=r,r=e[++t];n.push({type:"number",value:f});continue}let u=/[a-z]/i;if(r&&u.test(r)){let f="";for(;r&&u.test(r)&&t!==e.length;)f+=r,r=e[++t];if(f=="true"||f=="false"||f==="null")n.push({type:"name",value:f});else{t++;continue}continue}t++}return n},aa=e=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),aa(e);case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-")return e=e.slice(0,e.length-1),aa(e);case"string":let r=e[e.length-2];if(r?.type==="delimiter")return e=e.slice(0,e.length-1),aa(e);if(r?.type==="brace"&&r.value==="{")return e=e.slice(0,e.length-1),aa(e);break;case"delimiter":return e=e.slice(0,e.length-1),aa(e)}return e},SR=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},_R=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},N_=e=>JSON.parse(_R(SR(aa(wR(e)))));var zn,_r,ta,Ro,mc,zo,Oo,gc,Do,Hi,Lo,yc,xc,Jr,bc,vc,Bo,_p,Z1,wc,kp,Ep,Np,Q1;const K1="__json_buf";function J1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class lf{constructor(t,n){zn.add(this),this.messages=[],this.receivedMessages=[],_r.set(this,void 0),ta.set(this,null),this.controller=new AbortController,Ro.set(this,void 0),mc.set(this,()=>{}),zo.set(this,()=>{}),Oo.set(this,void 0),gc.set(this,()=>{}),Do.set(this,()=>{}),Hi.set(this,{}),Lo.set(this,!1),yc.set(this,!1),xc.set(this,!1),Jr.set(this,!1),bc.set(this,void 0),vc.set(this,void 0),Bo.set(this,void 0),wc.set(this,r=>{if(ge(this,yc,!0),xl(r)&&(r=new Gn),r instanceof Gn)return ge(this,xc,!0),this._emit("abort",r);if(r instanceof Ae)return this._emit("error",r);if(r instanceof Error){const a=new Ae(r.message);return a.cause=r,this._emit("error",a)}return this._emit("error",new Ae(String(r)))}),ge(this,Ro,new Promise((r,a)=>{ge(this,mc,r,"f"),ge(this,zo,a,"f")})),ge(this,Oo,new Promise((r,a)=>{ge(this,gc,r,"f"),ge(this,Do,a,"f")})),ne(this,Ro,"f").catch(()=>{}),ne(this,Oo,"f").catch(()=>{}),ge(this,ta,t),ge(this,Bo,n?.logger??console)}get response(){return ne(this,bc,"f")}get request_id(){return ne(this,vc,"f")}async withResponse(){ge(this,Jr,!0);const t=await ne(this,Ro,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new lf(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r,{logger:a}={}){const l=new lf(n,{logger:a});for(const u of n.messages)l._addMessageParam(u);return ge(l,ta,{...n,stream:!0}),l._run(()=>l._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),l}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},ne(this,wc,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,r){const a=r?.signal;let l;a&&(a.aborted&&this.controller.abort(),l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l));try{ne(this,zn,"m",kp).call(this);const{response:u,data:f}=await t.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(u);for await(const d of f)ne(this,zn,"m",Ep).call(this,d);if(f.controller.signal?.aborted)throw new Gn;ne(this,zn,"m",Np).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,bc,t),ge(this,vc,t?.headers.get("request-id")),ne(this,mc,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Lo,"f")}get errored(){return ne(this,yc,"f")}get aborted(){return ne(this,xc,"f")}abort(){this.controller.abort()}on(t,n){return(ne(this,Hi,"f")[t]||(ne(this,Hi,"f")[t]=[])).push({listener:n}),this}off(t,n){const r=ne(this,Hi,"f")[t];if(!r)return this;const a=r.findIndex(l=>l.listener===n);return a>=0&&r.splice(a,1),this}once(t,n){return(ne(this,Hi,"f")[t]||(ne(this,Hi,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,r)=>{ge(this,Jr,!0),t!=="error"&&this.once("error",r),this.once(t,n)})}async done(){ge(this,Jr,!0),await ne(this,Oo,"f")}get currentMessage(){return ne(this,_r,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",_p).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",Z1).call(this)}_emit(t,...n){if(ne(this,Lo,"f"))return;t==="end"&&(ge(this,Lo,!0),ne(this,gc,"f").call(this));const r=ne(this,Hi,"f")[t];if(r&&(ne(this,Hi,"f")[t]=r.filter(a=>!a.once),r.forEach(({listener:a})=>a(...n))),t==="abort"){const a=n[0];!ne(this,Jr,"f")&&!r?.length&&Promise.reject(a),ne(this,zo,"f").call(this,a),ne(this,Do,"f").call(this,a),this._emit("end");return}if(t==="error"){const a=n[0];!ne(this,Jr,"f")&&!r?.length&&Promise.reject(a),ne(this,zo,"f").call(this,a),ne(this,Do,"f").call(this,a),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",_p).call(this))}async _fromReadableStream(t,n){const r=n?.signal;let a;r&&(r.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a));try{ne(this,zn,"m",kp).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,zn,"m",Ep).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,zn,"m",Np).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(_r=new WeakMap,ta=new WeakMap,Ro=new WeakMap,mc=new WeakMap,zo=new WeakMap,Oo=new WeakMap,gc=new WeakMap,Do=new WeakMap,Hi=new WeakMap,Lo=new WeakMap,yc=new WeakMap,xc=new WeakMap,Jr=new WeakMap,bc=new WeakMap,vc=new WeakMap,Bo=new WeakMap,wc=new WeakMap,zn=new WeakSet,_p=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Z1=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new Ae("stream ended without producing a content block with type=text");return n.join(" ")},kp=function(){this.ended||ge(this,_r,void 0)},Ep=function(n){if(this.ended)return;const r=ne(this,zn,"m",Q1).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{const a=r.content.at(-1);switch(n.delta.type){case"text_delta":{a.type==="text"&&this._emit("text",n.delta.text,a.text||"");break}case"citations_delta":{a.type==="text"&&this._emit("citation",n.delta.citation,a.citations??[]);break}case"input_json_delta":{J1(a)&&a.input&&this._emit("inputJson",n.delta.partial_json,a.input);break}case"thinking_delta":{a.type==="thinking"&&this._emit("thinking",n.delta.thinking,a.thinking);break}case"signature_delta":{a.type==="thinking"&&this._emit("signature",a.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(G1(r,ne(this,ta,"f"),{logger:ne(this,Bo,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ge(this,_r,r);break}}},Np=function(){if(this.ended)throw new Ae("stream has ended, this shouldn't happen");const n=ne(this,_r,"f");if(!n)throw new Ae("request ended without sending any chunks");return ge(this,_r,void 0),G1(n,ne(this,ta,"f"),{logger:ne(this,Bo,"f")})},Q1=function(n){let r=ne(this,_r,"f");if(n.type==="message_start"){if(r)throw new Ae(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new Ae(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.container=n.delta.container,r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.usage.output_tokens=n.usage.output_tokens,r.context_management=n.context_management,n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),r;case"content_block_start":return r.content.push(n.content_block),r;case"content_block_delta":{const a=r.content.at(n.index);switch(n.delta.type){case"text_delta":{a?.type==="text"&&(r.content[n.index]={...a,text:(a.text||"")+n.delta.text});break}case"citations_delta":{a?.type==="text"&&(r.content[n.index]={...a,citations:[...a.citations??[],n.delta.citation]});break}case"input_json_delta":{if(a&&J1(a)){let l=a[K1]||"";l+=n.delta.partial_json;const u={...a};if(Object.defineProperty(u,K1,{value:l,enumerable:!1,writable:!0}),l)try{u.input=N_(l)}catch(f){const d=new Ae(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${l}`);ne(this,wc,"f").call(this,d)}r.content[n.index]=u}break}case"thinking_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,thinking:a.thinking+n.delta.thinking});break}case"signature_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){const t=[],n=[];let r=!1;return this.on("streamEvent",a=>{const l=n.shift();l?l.resolve(a):t.push(a)}),this.on("end",()=>{r=!0;for(const a of n)a.resolve(void 0);n.length=0}),this.on("abort",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),this.on("error",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((l,u)=>n.push({resolve:l,reject:u})).then(l=>l?{value:l,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ai(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const kR=1e5,ER=`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 Ho,na,Wr,Mt,Uo,xn,Ii,kr,Io,W1,bm;function ev(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}class C_{constructor(t,n,r){Ho.add(this),this.client=t,na.set(this,!1),Wr.set(this,!1),Mt.set(this,void 0),Uo.set(this,void 0),xn.set(this,void 0),Ii.set(this,void 0),kr.set(this,void 0),Io.set(this,0),ge(this,Mt,{params:{...n,messages:structuredClone(n.messages)}}),ge(this,Uo,{...r,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},r?.headers])}),ge(this,kr,ev())}async*[(na=new WeakMap,Wr=new WeakMap,Mt=new WeakMap,Uo=new WeakMap,xn=new WeakMap,Ii=new WeakMap,kr=new WeakMap,Io=new WeakMap,Ho=new WeakSet,W1=async function(){const n=ne(this,Mt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let r=0;if(ne(this,xn,"f")!==void 0)try{const h=await ne(this,xn,"f");r=h.usage.input_tokens+(h.usage.cache_creation_input_tokens??0)+(h.usage.cache_read_input_tokens??0)+h.usage.output_tokens}catch{return!1}const a=n.contextTokenThreshold??kR;if(r<a)return!1;const l=n.model??ne(this,Mt,"f").params.model,u=n.summaryPrompt??ER,f=ne(this,Mt,"f").params.messages;if(f[f.length-1].role==="assistant"){const h=f[f.length-1];if(Array.isArray(h.content)){const g=h.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():h.content=g}}const d=await this.client.beta.messages.create({model:l,messages:[...f,{role:"user",content:[{type:"text",text:u}]}],max_tokens:ne(this,Mt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(d.content[0]?.type!=="text")throw new Ae("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:d.content}],!0},Symbol.asyncIterator)](){var t;if(ne(this,na,"f"))throw new Ae("Cannot iterate over a consumed stream");ge(this,na,!0),ge(this,Wr,!0),ge(this,Ii,void 0);try{for(;;){let n;try{if(ne(this,Mt,"f").params.max_iterations&&ne(this,Io,"f")>=ne(this,Mt,"f").params.max_iterations)break;ge(this,Wr,!1,"f"),ge(this,Ii,void 0,"f"),ge(this,Io,(t=ne(this,Io,"f"),t++,t),"f"),ge(this,xn,void 0,"f");const{max_iterations:r,compactionControl:a,...l}=ne(this,Mt,"f").params;if(l.stream?(n=this.client.beta.messages.stream({...l},ne(this,Uo,"f")),ge(this,xn,n.finalMessage(),"f"),ne(this,xn,"f").catch(()=>{}),yield n):(ge(this,xn,this.client.beta.messages.create({...l,stream:!1},ne(this,Uo,"f")),"f"),yield ne(this,xn,"f")),!await ne(this,Ho,"m",W1).call(this)){if(!ne(this,Wr,"f")){const{role:d,content:h}=await ne(this,xn,"f");ne(this,Mt,"f").params.messages.push({role:d,content:h})}const f=await ne(this,Ho,"m",bm).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Wr,"f"))break}}finally{n&&n.abort()}}if(!ne(this,xn,"f"))throw new Ae("ToolRunner concluded without a message from the server");ne(this,kr,"f").resolve(await ne(this,xn,"f"))}catch(n){throw ge(this,na,!1),ne(this,kr,"f").promise.catch(()=>{}),ne(this,kr,"f").reject(n),ge(this,kr,ev()),n}}setMessagesParams(t){typeof t=="function"?ne(this,Mt,"f").params=t(ne(this,Mt,"f").params):ne(this,Mt,"f").params=t,ge(this,Wr,!0),ge(this,Ii,void 0)}async generateToolResponse(){const t=await ne(this,xn,"f")??this.params.messages.at(-1);return t?ne(this,Ho,"m",bm).call(this,t):null}done(){return ne(this,kr,"f").promise}async runUntilDone(){if(!ne(this,na,"f"))for await(const t of this);return this.done()}get params(){return ne(this,Mt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}}bm=async function(t){return ne(this,Ii,"f")!==void 0?ne(this,Ii,"f"):(ge(this,Ii,NR(ne(this,Mt,"f").params,t)),ne(this,Ii,"f"))};async function NR(e,t=e.messages.at(-1)){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;const n=t.content.filter(a=>a.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async a=>{const l=e.tools.find(u=>("name"in u?u.name:u.mcp_server_name)===a.name);if(!l||!("run"in l))return{type:"tool_result",tool_use_id:a.id,content:`Error: Tool '${a.name}' not found`,is_error:!0};try{let u=a.input;"parse"in l&&l.parse&&(u=l.parse(u));const f=await l.run(u);return{type:"tool_result",tool_use_id:a.id,content:f}}catch(u){return{type:"tool_result",tool_use_id:a.id,content:`Error: ${u instanceof Error?u.message:String(u)}`,is_error:!0}}}))}}class Df{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){const t=new Al;for await(const n of this.iterator)for(const r of t.decode(n))yield JSON.parse(r);for(const n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ae("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 Ae("Attempted to iterate over a response with no body");return new Df(sg(t.body),n)}}let T_=class extends Kn{create(t,n){const{betas:r,...a}=t;return this._client.post("/v1/messages/batches?beta=true",{body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/messages/batches/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Ml,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/messages/batches/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}cancel(t,n={},r){const{betas:a}=n??{};return this._client.post(Bt`/v1/messages/batches/${t}/cancel?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}async results(t,n={},r){const a=await this.retrieve(t);if(!a.results_url)throw new Ae(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);const{betas:l}=n??{};return this._client.get(a.results_url,{...r,headers:Ve([{"anthropic-beta":[...l??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,f)=>Df.fromResponse(f.response,f.controller))}};const tv={"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 Lf=class extends Kn{constructor(){super(...arguments),this.batches=new T_(this._client)}create(t,n){const{betas:r,...a}=t;a.model in tv&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${tv[a.model]}
|
|
46
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let l=this._client._options.timeout;if(!a.stream&&l==null){const u=k_[a.model]??void 0;l=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:a,timeout:l??6e5,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}parse(t,n){return n={...n,headers:Ve([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-11-13"].toString()},n?.headers])},this.create(t,n).then(r=>E_(r,t,{logger:this._client.logger??console}))}stream(t,n){return lf.createMessage(this,t,n)}countTokens(t,n){const{betas:r,...a}=t;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString()},n?.headers])})}toolRunner(t,n){return new C_(this._client,t,n)}};Lf.Batches=T_;Lf.BetaToolRunner=C_;class A_ extends Kn{create(t,n={},r){const{betas:a,...l}=n??{};return this._client.post(Bt`/v1/skills/${t}/versions?beta=true`,og({body:l,...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])},this._client))}retrieve(t,n,r){const{skill_id:a,betas:l}=n;return this._client.get(Bt`/v1/skills/${a}/versions/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...l??[],"skills-2025-10-02"].toString()},r?.headers])})}list(t,n={},r){const{betas:a,...l}=n??{};return this._client.getAPIList(Bt`/v1/skills/${t}/versions?beta=true`,g_,{query:l,...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(t,n,r){const{skill_id:a,betas:l}=n;return this._client.delete(Bt`/v1/skills/${a}/versions/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...l??[],"skills-2025-10-02"].toString()},r?.headers])})}}class lg extends Kn{constructor(){super(...arguments),this.versions=new A_(this._client)}create(t={},n){const{betas:r,...a}=t??{};return this._client.post("/v1/skills?beta=true",og({body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/skills/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/skills?beta=true",g_,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/skills/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}}lg.Versions=A_;class Ca extends Kn{constructor(){super(...arguments),this.models=new __(this._client),this.messages=new Lf(this._client),this.files=new S_(this._client),this.skills=new lg(this._client)}}Ca.Models=__;Ca.Messages=Lf;Ca.Files=S_;Ca.Skills=lg;class M_ extends Kn{create(t,n){const{betas:r,...a}=t;return this._client.post("/v1/complete",{body:a,timeout:this._client._options.timeout??6e5,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}}var On,Er,qo,Sc,$o,Po,_c,Vo,Ui,Fo,kc,Ec,es,Nc,Cc,Cp,nv,Tp,Ap,Mp,jp,iv;const rv="__json_buf";function sv(e){return e.type==="tool_use"||e.type==="server_tool_use"}class uf{constructor(){On.add(this),this.messages=[],this.receivedMessages=[],Er.set(this,void 0),this.controller=new AbortController,qo.set(this,void 0),Sc.set(this,()=>{}),$o.set(this,()=>{}),Po.set(this,void 0),_c.set(this,()=>{}),Vo.set(this,()=>{}),Ui.set(this,{}),Fo.set(this,!1),kc.set(this,!1),Ec.set(this,!1),es.set(this,!1),Nc.set(this,void 0),Cc.set(this,void 0),Tp.set(this,t=>{if(ge(this,kc,!0),xl(t)&&(t=new Gn),t instanceof Gn)return ge(this,Ec,!0),this._emit("abort",t);if(t instanceof Ae)return this._emit("error",t);if(t instanceof Error){const n=new Ae(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new Ae(String(t)))}),ge(this,qo,new Promise((t,n)=>{ge(this,Sc,t,"f"),ge(this,$o,n,"f")})),ge(this,Po,new Promise((t,n)=>{ge(this,_c,t,"f"),ge(this,Vo,n,"f")})),ne(this,qo,"f").catch(()=>{}),ne(this,Po,"f").catch(()=>{})}get response(){return ne(this,Nc,"f")}get request_id(){return ne(this,Cc,"f")}async withResponse(){ge(this,es,!0);const t=await ne(this,qo,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new uf;return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r){const a=new uf;for(const l of n.messages)a._addMessageParam(l);return a._run(()=>a._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},ne(this,Tp,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,r){const a=r?.signal;let l;a&&(a.aborted&&this.controller.abort(),l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l));try{ne(this,On,"m",Ap).call(this);const{response:u,data:f}=await t.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(u);for await(const d of f)ne(this,On,"m",Mp).call(this,d);if(f.controller.signal?.aborted)throw new Gn;ne(this,On,"m",jp).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,Nc,t),ge(this,Cc,t?.headers.get("request-id")),ne(this,Sc,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Fo,"f")}get errored(){return ne(this,kc,"f")}get aborted(){return ne(this,Ec,"f")}abort(){this.controller.abort()}on(t,n){return(ne(this,Ui,"f")[t]||(ne(this,Ui,"f")[t]=[])).push({listener:n}),this}off(t,n){const r=ne(this,Ui,"f")[t];if(!r)return this;const a=r.findIndex(l=>l.listener===n);return a>=0&&r.splice(a,1),this}once(t,n){return(ne(this,Ui,"f")[t]||(ne(this,Ui,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,r)=>{ge(this,es,!0),t!=="error"&&this.once("error",r),this.once(t,n)})}async done(){ge(this,es,!0),await ne(this,Po,"f")}get currentMessage(){return ne(this,Er,"f")}async finalMessage(){return await this.done(),ne(this,On,"m",Cp).call(this)}async finalText(){return await this.done(),ne(this,On,"m",nv).call(this)}_emit(t,...n){if(ne(this,Fo,"f"))return;t==="end"&&(ge(this,Fo,!0),ne(this,_c,"f").call(this));const r=ne(this,Ui,"f")[t];if(r&&(ne(this,Ui,"f")[t]=r.filter(a=>!a.once),r.forEach(({listener:a})=>a(...n))),t==="abort"){const a=n[0];!ne(this,es,"f")&&!r?.length&&Promise.reject(a),ne(this,$o,"f").call(this,a),ne(this,Vo,"f").call(this,a),this._emit("end");return}if(t==="error"){const a=n[0];!ne(this,es,"f")&&!r?.length&&Promise.reject(a),ne(this,$o,"f").call(this,a),ne(this,Vo,"f").call(this,a),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,On,"m",Cp).call(this))}async _fromReadableStream(t,n){const r=n?.signal;let a;r&&(r.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a));try{ne(this,On,"m",Ap).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,On,"m",Mp).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,On,"m",jp).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(Er=new WeakMap,qo=new WeakMap,Sc=new WeakMap,$o=new WeakMap,Po=new WeakMap,_c=new WeakMap,Vo=new WeakMap,Ui=new WeakMap,Fo=new WeakMap,kc=new WeakMap,Ec=new WeakMap,es=new WeakMap,Nc=new WeakMap,Cc=new WeakMap,Tp=new WeakMap,On=new WeakSet,Cp=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},nv=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new Ae("stream ended without producing a content block with type=text");return n.join(" ")},Ap=function(){this.ended||ge(this,Er,void 0)},Mp=function(n){if(this.ended)return;const r=ne(this,On,"m",iv).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{const a=r.content.at(-1);switch(n.delta.type){case"text_delta":{a.type==="text"&&this._emit("text",n.delta.text,a.text||"");break}case"citations_delta":{a.type==="text"&&this._emit("citation",n.delta.citation,a.citations??[]);break}case"input_json_delta":{sv(a)&&a.input&&this._emit("inputJson",n.delta.partial_json,a.input);break}case"thinking_delta":{a.type==="thinking"&&this._emit("thinking",n.delta.thinking,a.thinking);break}case"signature_delta":{a.type==="thinking"&&this._emit("signature",a.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(r,!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ge(this,Er,r);break}}},jp=function(){if(this.ended)throw new Ae("stream has ended, this shouldn't happen");const n=ne(this,Er,"f");if(!n)throw new Ae("request ended without sending any chunks");return ge(this,Er,void 0),n},iv=function(n){let r=ne(this,Er,"f");if(n.type==="message_start"){if(r)throw new Ae(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new Ae(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),r;case"content_block_start":return r.content.push({...n.content_block}),r;case"content_block_delta":{const a=r.content.at(n.index);switch(n.delta.type){case"text_delta":{a?.type==="text"&&(r.content[n.index]={...a,text:(a.text||"")+n.delta.text});break}case"citations_delta":{a?.type==="text"&&(r.content[n.index]={...a,citations:[...a.citations??[],n.delta.citation]});break}case"input_json_delta":{if(a&&sv(a)){let l=a[rv]||"";l+=n.delta.partial_json;const u={...a};Object.defineProperty(u,rv,{value:l,enumerable:!1,writable:!0}),l&&(u.input=N_(l)),r.content[n.index]=u}break}case"thinking_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,thinking:a.thinking+n.delta.thinking});break}case"signature_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){const t=[],n=[];let r=!1;return this.on("streamEvent",a=>{const l=n.shift();l?l.resolve(a):t.push(a)}),this.on("end",()=>{r=!0;for(const a of n)a.resolve(void 0);n.length=0}),this.on("abort",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),this.on("error",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((l,u)=>n.push({resolve:l,reject:u})).then(l=>l?{value:l,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ai(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class j_ extends Kn{create(t,n){return this._client.post("/v1/messages/batches",{body:t,...n})}retrieve(t,n){return this._client.get(Bt`/v1/messages/batches/${t}`,n)}list(t={},n){return this._client.getAPIList("/v1/messages/batches",Ml,{query:t,...n})}delete(t,n){return this._client.delete(Bt`/v1/messages/batches/${t}`,n)}cancel(t,n){return this._client.post(Bt`/v1/messages/batches/${t}/cancel`,n)}async results(t,n){const r=await this.retrieve(t);if(!r.results_url)throw new Ae(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);return this._client.get(r.results_url,{...n,headers:Ve([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,l)=>Df.fromResponse(l.response,l.controller))}}class ug extends Kn{constructor(){super(...arguments),this.batches=new j_(this._client)}create(t,n){t.model in av&&console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${av[t.model]}
|
|
47
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let r=this._client._options.timeout;if(!t.stream&&r==null){const a=k_[t.model]??void 0;r=this._client.calculateNonstreamingTimeout(t.max_tokens,a)}return this._client.post("/v1/messages",{body:t,timeout:r??6e5,...n,stream:t.stream??!1})}stream(t,n){return uf.createMessage(this,t,n)}countTokens(t,n){return this._client.post("/v1/messages/count_tokens",{body:t,...n})}}const av={"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"};ug.Batches=j_;class R_ extends Kn{retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/models/${t}`,{...r,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/models",Ml,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}}var CR={};const Tc=e=>{if(typeof globalThis.process<"u")return CR?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var vm,cg,$c,z_;const TR="\\n\\nHuman:",AR="\\n\\nAssistant:";class Nt{constructor({baseURL:t=Tc("ANTHROPIC_BASE_URL"),apiKey:n=Tc("ANTHROPIC_API_KEY")??null,authToken:r=Tc("ANTHROPIC_AUTH_TOKEN")??null,...a}={}){vm.add(this),$c.set(this,void 0);const l={apiKey:n,authToken:r,...a,baseURL:t||"https://api.anthropic.com"};if(!l.dangerouslyAllowBrowser&&Gj())throw new Ae(`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=l.baseURL,this.timeout=l.timeout??cg.DEFAULT_TIMEOUT,this.logger=l.logger??console;const u="warn";this.logLevel=u,this.logLevel=V1(l.logLevel,"ClientOptions.logLevel",this)??V1(Tc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=l.fetchOptions,this.maxRetries=l.maxRetries??2,this.fetch=l.fetch??Wj(),ge(this,$c,tR),this._options=l,this.apiKey=typeof n=="string"?n:null,this.authToken=r}withOptions(t){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,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.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(t){return Ve([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return Object.entries(t).filter(([n,r])=>typeof r<"u").map(([n,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(n)}=`;throw new Ae(`Cannot stringify type ${typeof r}; 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 ${sa}`}defaultIdempotencyKey(){return`stainless-node-retry-${e_()}`}makeStatusError(t,n,r,a){return Pt.generate(t,n,r,a)}buildURL(t,n,r){const a=!ne(this,vm,"m",z_).call(this)&&r||this.baseURL,l=Pj(t)?new URL(t):new URL(a+(a.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),u=this.defaultQuery();return Vj(u)||(n={...u,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(l.search=this.stringifyQuery(n)),l.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new Ae("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(t){}async prepareRequest(t,{url:n,options:r}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,r){return this.request(Promise.resolve(r).then(a=>({method:t,path:n,...a})))}request(t,n=null){return new Of(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,r){const a=await t,l=a.maxRetries??this.maxRetries;n==null&&(n=l),await this.prepareOptions(a);const{req:u,url:f,timeout:d}=await this.buildRequest(a,{retryCount:l-n});await this.prepareRequest(u,{url:f,options:a});const h="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=r===void 0?"":`, retryOf: ${r}`,m=Date.now();if(Xt(this).debug(`[${h}] sending request`,is({retryOfRequestLogID:r,method:a.method,url:f,options:a,headers:u.headers})),a.signal?.aborted)throw new Gn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,d,x).catch(pm),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${n} attempts remaining`;if(a.signal?.aborted)throw new Gn;const z=xl(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(n)return Xt(this).info(`[${h}] connection ${z?"timed out":"failed"} - ${_}`),Xt(this).debug(`[${h}] connection ${z?"timed out":"failed"} (${_})`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:b.message})),this.retryRequest(a,n,r??h);throw Xt(this).info(`[${h}] connection ${z?"timed out":"failed"} - error; no more retries left`),Xt(this).debug(`[${h}] connection ${z?"timed out":"failed"} (error; no more retries left)`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:b.message})),z?new t_:new zf({cause:b})}const k=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,z])=>", "+_+": "+JSON.stringify(z)).join(""),N=`[${h}${g}${k}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(n&&_){const B=`retrying, ${n} attempts remaining`;return await eR(b.body),Xt(this).info(`${N} - ${B}`),Xt(this).debug(`[${h}] response error (${B})`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(a,n,r??h,b.headers)}const z=_?"error; no more retries left":"error; not retryable";Xt(this).info(`${N} - ${z}`);const E=await b.text().catch(B=>pm(B).message),C=c_(E),L=C?void 0:E;throw Xt(this).debug(`[${h}] response error (${z})`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Xt(this).info(N),Xt(this).debug(`[${h}] response start`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:a,controller:x,requestLogID:h,retryOfRequestLogID:r,startTime:m}}getAPIList(t,n,r){return this.requestAPIList(n,{method:"get",path:t,...r})}requestAPIList(t,n){const r=this.makeRequest(n,null,void 0);return new cR(this,r,t)}async fetchWithTimeout(t,n,r,a){const{signal:l,method:u,...f}=n||{};l&&l.addEventListener("abort",()=>a.abort());const d=setTimeout(()=>a.abort(),r),h=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:a.signal,...h?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,t,g)}finally{clearTimeout(d)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,r,a){let l;const u=a?.get("retry-after-ms");if(u){const d=parseFloat(u);Number.isNaN(d)||(l=d)}const f=a?.get("retry-after");if(f&&!l){const d=parseFloat(f);Number.isNaN(d)?l=Date.parse(f)-Date.now():l=d*1e3}if(!(l&&0<=l&&l<60*1e3)){const d=t.maxRetries??this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(n,d)}return await Xj(l),this.makeRequest(t,n-1,r)}calculateDefaultRetryTimeoutMillis(t,n){const l=n-t,u=Math.min(.5*Math.pow(2,l),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new Ae("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(t,{retryCount:n=0}={}){const r={...t},{method:a,path:l,query:u,defaultBaseURL:f}=r,d=this.buildURL(l,u,f);"timeout"in r&&Yj("timeout",r.timeout),r.timeout=r.timeout??this.timeout;const{bodyHeaders:h,body:g}=this.buildBody({options:r}),m=await this.buildHeaders({options:t,method:a,bodyHeaders:h,retryCount:n});return{req:{method:a,headers:m,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...r.fetchOptions??{}},url:d,timeout:r.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:r,retryCount:a}){let l={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),l[this.idempotencyHeader]=t.idempotencyKey);const u=Ve([l,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Jj(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,r,t.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const r=Ve([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&r.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:d_(t)}:ne(this,$c,"f").call(this,{body:t,headers:r})}}cg=Nt,$c=new WeakMap,vm=new WeakSet,z_=function(){return this.baseURL!=="https://api.anthropic.com"};Nt.Anthropic=cg;Nt.HUMAN_PROMPT=TR;Nt.AI_PROMPT=AR;Nt.DEFAULT_TIMEOUT=6e5;Nt.AnthropicError=Ae;Nt.APIError=Pt;Nt.APIConnectionError=zf;Nt.APIConnectionTimeoutError=t_;Nt.APIUserAbortError=Gn;Nt.NotFoundError=s_;Nt.ConflictError=a_;Nt.RateLimitError=l_;Nt.BadRequestError=n_;Nt.AuthenticationError=i_;Nt.InternalServerError=u_;Nt.PermissionDeniedError=r_;Nt.UnprocessableEntityError=o_;Nt.toFile=gR;class jl extends Nt{constructor(){super(...arguments),this.completions=new M_(this),this.messages=new ug(this),this.models=new R_(this),this.beta=new Ca(this)}}jl.Completions=M_;jl.Messages=ug;jl.Models=R_;jl.Beta=Ca;let Ac=null;function O_(){return Ac||(Ac=localStorage.getItem("claude_api_key"),Ac)}async function MR(e,t,n="sonnet"){const r=O_();if(!r)throw new Error("API key not set. Please configure your Claude API key.");const a=new jl({apiKey:r,dangerouslyAllowBrowser:!0}),l={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await a.messages.create({model:l[n],max_tokens:4096,system:e,messages:[{role:"user",content:t}]})).content.find(d=>d.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function jR(){return!!O_()}function RR(e,t){const n=new Map(e.map(f=>[f.id,f])),r=new Map,a=new Map;e.forEach(f=>{r.set(f.id,0),a.set(f.id,[])}),t.forEach(f=>{a.get(f.source)?.push(f.target),r.set(f.target,(r.get(f.target)||0)+1)});const l=[];r.forEach((f,d)=>{f===0&&l.push(d)});const u=[];for(;l.length>0;){const f=l.shift(),d=n.get(f);d&&u.push(d),a.get(f)?.forEach(h=>{const g=(r.get(h)||0)-1;r.set(h,g),g===0&&l.push(h)})}return u}function zR(e,t,n){const r=t.filter(l=>l.target===e),a=[];for(const l of r){const u=n.get(l.source);u!==void 0&&a.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return a.join(`
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
`)}async function OR(e,t){const n=e.data;t.onNodeProgress(e.id,50);const r=n.value||n.placeholder||"User input placeholder";return t.onNodeProgress(e.id,100),t.onLog("info",`Input received: ${r.slice(0,50)}...`,e.id),r}async function DR(e,t,n){const r=e.data;if(!jR())throw new Error("API key not configured. Please set your Claude API key.");n.onNodeProgress(e.id,20),n.onLog("info",`Starting AI agent: ${r.label}`,e.id);const a=r.systemPrompt||`You are an AI assistant. ${r.description||""}`,l=t||"Please help me with the following task.";n.onNodeProgress(e.id,50);try{const u=await MR(a,l,r.model||"sonnet");return n.onNodeProgress(e.id,100),n.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 LR(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Executing skill: ${r.label}`,e.id);const a=`# Skill: ${r.label}
|
|
59
|
-
|
|
60
|
-
Category: ${r.category||"general"}
|
|
61
|
-
Skill ID: ${r.skillId||"custom-skill"}
|
|
62
|
-
|
|
63
|
-
## Description
|
|
64
|
-
${r.description||"Custom skill"}
|
|
65
|
-
|
|
66
|
-
## Input
|
|
67
|
-
${t}
|
|
68
|
-
|
|
69
|
-
## Output
|
|
70
|
-
Skill executed successfully with the provided input.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Skill ${r.label} completed`,e.id),a}async function BR(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Executing command: /${r.commandName||"unnamed"}`,e.id);const a=`# Command Execution
|
|
71
|
-
|
|
72
|
-
Command: /${r.commandName||"command"}
|
|
73
|
-
Path: ${r.commandPath||"default"}
|
|
74
|
-
|
|
75
|
-
## Input
|
|
76
|
-
${t}
|
|
77
|
-
|
|
78
|
-
## Status
|
|
79
|
-
Command executed successfully. In production, this would run the actual slash command.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Command /${r.commandName||"unnamed"} completed`,e.id),a}async function HR(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Configuring hook: ${r.hookEvent||"PreToolUse"}`,e.id);const a=`# Hook Configuration
|
|
80
|
-
|
|
81
|
-
Event: ${r.hookEvent||"PreToolUse"}
|
|
82
|
-
Matcher: ${r.hookMatcher||"*"}
|
|
83
|
-
Command: ${r.hookCommand||'echo "Hook executed"'}
|
|
84
|
-
|
|
85
|
-
## Input
|
|
86
|
-
${t}
|
|
87
|
-
|
|
88
|
-
## Status
|
|
89
|
-
Hook configured successfully. In production, this would set up the actual hook.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Hook ${r.hookEvent||"unnamed"} configured`,e.id),a}async function UR(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Preparing output: ${r.label}`,e.id);const a=`# Workflow Output
|
|
90
|
-
|
|
91
|
-
## Result
|
|
92
|
-
${t}
|
|
93
|
-
|
|
94
|
-
## Output Type
|
|
95
|
-
${r.outputType||"auto"}
|
|
96
|
-
|
|
97
|
-
## Generated at
|
|
98
|
-
${new Date().toISOString()}`;return n.onNodeProgress(e.id,100),n.onLog("success","Workflow completed successfully",e.id),a}async function IR(e,t,n){const r={results:new Map,cancelled:!1},a=RR(e,t);n.onLog("info",`Starting workflow execution with ${a.length} nodes`);for(const l of a){n.onNodeStart(l.id);try{const u=zR(l.id,t,r.results);let f;switch(l.type){case"input":f=await OR(l,n);break;case"subagent":f=await DR(l,u,n);break;case"skill":f=await LR(l,u,n);break;case"command":f=await BR(l,u,n);break;case"hook":f=await HR(l,u,n);break;case"output":f=await UR(l,u,n);break;default:f=u}r.results.set(l.id,f),n.onNodeComplete(l.id,f)}catch(u){const f=u instanceof Error?u.message:"Unknown error";throw n.onNodeError(l.id,f),n.onLog("error",`Node ${l.data.label} failed: ${f}`,l.id),u}}return r.results}function D_(){const{nodes:e,edges:t,workflowName:n,updateNodeStatus:r}=ci(),{isRunning:a,startExecution:l,stopExecution:u,setCurrentNode:f,markNodeCompleted:d,markNodeFailed:h,setWorkflowResults:g,addLog:m,clearLogs:x}=Na(),[b,w]=X.useState([]),k=X.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),l(),w([]),m("info",`워크플로우 "${n}" 실행 시작...`);try{const z=await IR(e,t,{onNodeStart:L=>{r(L,"running",0),f(L)},onNodeProgress:(L,A)=>{r(L,"running",A)},onNodeComplete:(L,A)=>{r(L,"completed",100),d(L,A)},onNodeError:(L,A)=>{r(L,"error",0),h(L,A)},onLog:(L,A,B)=>{m(L,A,B)}}),E=[],C=[];for(const[L,A]of z){const B=e.find(Z=>Z.id===L),G=typeof A=="string"?A:JSON.stringify(A,null,2);if(E.push({nodeId:L,label:B?.data.label||L,success:!0,result:G}),B?.type==="output"){const Z=`${n.replace(/\s+/g,"_")}_${B.data.label.replace(/\s+/g,"_")}.md`;C.push({name:Z,content:G})}}w(C),g(E),u(),m("success","워크플로우 실행 완료!"),C.length>0&&(m("info",`${C.length}개 파일 생성됨`),C.forEach(L=>{m("info",` - ${L.name}`)}))}catch(z){const E=z instanceof Error?z.message:"Unknown error";u(),m("error",`실행 오류: ${E}`)}},[e,t,n,m,x,l,u,r,f,d,h,g]),N=X.useCallback((z,E)=>{const C=new Blob([E],{type:"text/markdown;charset=utf-8"}),L=URL.createObjectURL(C),A=document.createElement("a");A.href=L,A.download=z,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${z}`)},[m]),_=X.useCallback(()=>{b.forEach(z=>{N(z.name,z.content)})},[b,N]);return{isRunning:a,execute:k,generatedFiles:b,downloadFile:N,downloadAllFiles:_}}function qR(e,t,n,r="local"){const a=r==="global"?"~/.claude":".claude",l=$R(t,a),u=PR(t,a),f=VR(e,t,n,a),d=FR(t);return{skills:l,commands:f,agents:u,mcpSettings:d}}function $R(e,t){return e.filter(r=>r.type==="skill").filter(r=>r.data.skillType==="custom").map(r=>{const a=r.data,l=Ta(a.skillId||a.label),u=`${t}/skills/${l}/SKILL.md`,f=YR(a);return{name:l,path:u,content:f}})}function PR(e,t){return e.filter(r=>r.type==="subagent").map(r=>{const a=r.data,l=Ta(a.label),u=`${t}/agents/${l}.md`,f=XR(a);return{name:l,path:u,content:f}})}function VR(e,t,n,r){if(t.length===0)return[];const a=Ta(e),l=`${r}/commands/${a}.md`,u=GR(e,t,n);return[{name:a,path:l,content:u}]}function FR(e){return e.filter(n=>n.type==="hook").length===0,null}function YR(e){if(e.skillContent)return e.skillContent;const t=Ta(e.skillId||e.label),n=e.description||e.label,r=["---",`name: ${t}`,`description: ${n}`,"---","",`# ${e.label}`,""];return e.mdContent?r.push(e.mdContent):r.push(`Execute the ${e.label} skill.`),r.join(`
|
|
99
|
-
`)}function XR(e){const t=Ta(e.label),n=e.description||e.label,r=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",a=e.model||"sonnet",l=["---",`name: ${t}`,`description: ${n}`,`tools: ${r}`,`model: ${a}`,"---",""];return e.systemPrompt?l.push(e.systemPrompt):e.mdContent?l.push(e.mdContent):(l.push(`# ${e.label}`),l.push(""),l.push(`This agent performs the ${e.role} role.`)),l.join(`
|
|
100
|
-
`)}function GR(e,t,n){const r=t.filter(g=>g.type==="input"),a=t.filter(g=>g.type==="output"),l=r.map(g=>`<${Ta(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];l&&f.push(`argument-hint: ${l}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),r.length>0&&(f.push("## Inputs"),f.push(""),r.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 d=ZR(t,n);let h=1;return d.forEach(g=>{if(g.type!=="input"){if(f.push(`${h}. **${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==="command"){const m=g.data;f.push(` - Command: /${m.commandName}`)}if(g.type==="hook"){const m=g.data;f.push(` - Hook: ${m.hookEvent} (${m.hookMatcher||"*"})`)}f.push(""),h++}}),a.length>0&&(f.push("## Outputs"),f.push(""),a.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.outputType} format`)})),f.join(`
|
|
101
|
-
`)}function Ta(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function ZR(e,t){const n=new Map(e.map(f=>[f.id,f])),r=new Map,a=new Map;e.forEach(f=>{r.set(f.id,0),a.set(f.id,[])}),t.forEach(f=>{a.get(f.source)?.push(f.target),r.set(f.target,(r.get(f.target)||0)+1)});const l=[];r.forEach((f,d)=>{f===0&&l.push(d)});const u=[];for(;l.length>0;){const f=l.shift(),d=n.get(f);d&&u.push(d),a.get(f)?.forEach(h=>{const g=(r.get(h)||0)-1;r.set(h,g),g===0&&l.push(h)})}return u}async function L_(){try{const e=await fetch("/api/load/claude-config");if(!e.ok)throw new Error(`Failed to load config: ${e.statusText}`);const t=await e.json();return QR(t)}catch(e){return console.error("Failed to load Claude config:",e),[]}}function QR(e){const t=[];let n=0;const r=280,a=150;for(const l of e.skills)t.push({id:l.id,type:"skill",position:{x:100+n,y:a},data:{label:l.label,description:l.description,status:"idle",skillType:"custom",skillId:l.skillId,skillPath:l.skillPath}}),n+=r;for(const l of e.subagents)t.push({id:l.id,type:"subagent",position:{x:100+n,y:a},data:{label:l.label,description:l.description,role:"custom",tools:l.tools,model:l.model,skills:l.skills,systemPrompt:l.systemPrompt,status:"idle",usedInputs:[]}}),n+=r;for(const l of e.commands)t.push({id:l.id,type:"command",position:{x:100+n,y:a},data:{label:l.label,description:l.description,commandName:l.commandName,commandContent:l.commandContent,status:"idle",usedInputs:[]}}),n+=r;for(const l of e.hooks)t.push({id:l.id,type:"hook",position:{x:100+n,y:a},data:{label:l.label,description:l.description,hookEvent:l.hookEvent,hookMatcher:l.hookMatcher,hookCommand:l.hookCommand,status:"idle",usedInputs:[]}}),n+=r;return t}function B_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=B_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=B_(e))&&(r&&(r+=" "),r+=t);return r}const H_="http://localhost:3001/api";async function KR(e,t){const n=await fetch(`${H_}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.message||"Failed to save workflow")}return n.json()}async function JR(){const e=await fetch(`${H_}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function WR(e,t){const n=[];return t.includeSkills&&e.skills.forEach(r=>{n.push({path:r.path,content:r.content,type:"skill"})}),t.includeCommands&&e.commands.forEach(r=>{n.push({path:r.path,content:r.content,type:"command"})}),t.includeAgents&&e.agents.forEach(r=>{n.push({path:r.path,content:r.content,type:"agent"})}),t.includeMcpSettings&&e.mcpSettings&&n.push({path:t.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:n}}function ez({isOpen:e,onClose:t,config:n}){const[r,a]=X.useState("local"),[l,u]=X.useState(!0),[f,d]=X.useState(!0),[h,g]=X.useState(!0),[m,x]=X.useState(!0),[b,w]=X.useState(""),[k,N]=X.useState([]),[_,z]=X.useState(null),[E,C]=X.useState(!1),[L,A]=X.useState(null),[B,G]=X.useState(null);X.useEffect(()=>{e&&JR().then(w).catch(()=>w("."))},[e]),X.useEffect(()=>{if(!e)return;WR(n,{location:r,includeSkills:l,includeCommands:f,includeAgents:h,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&z(te[0])})},[e,n,r,l,f,h,m]);const Z=async()=>{C(!0),G(null),A(null);const P={location:r,includeSkills:l,includeCommands:f,includeAgents:h,includeMcpSettings:m};try{const te=await KR(n,P);A(te),te.success&&setTimeout(()=>t(),2e3)}catch(te){G(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},H=P=>{switch(P){case"skill":return v.jsx(ha,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(R5,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(ds,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(KS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(ha,{className:"w-4 h-4 text-gray-400"})}},$=n.skills.length>0||n.commands.length>0||n.agents.length>0||n.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(da,{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:t,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(rg,{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:()=>a("local"),className:Gt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",r==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(O1,{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:()=>a("global"),className:Gt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",r==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(O1,{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:l,onChange:P=>u(P.target.checked),disabled:n.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Gt("text-sm",n.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",n.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>d(P.target.checked),disabled:n.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Gt("text-sm",n.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",n.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:h,onChange:P=>g(P.target.checked),disabled:n.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Gt("text-sm",n.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",n.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!n.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Gt("text-sm",n.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:[k.map((P,te)=>v.jsxs("button",{onClick:()=>z(P),className:Gt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[H(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),k.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(D5,{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(dm,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),B&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(dm,{className:"w-4 h-4"}),v.jsx("span",{children:B})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:Z,disabled:E||k.length===0||!$,className:Gt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",E||k.length===0||!$?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(da,{className:"w-4 h-4"}),E?"Saving...":"Export"]})]})]})]})}):null}const fg=Rf()(JS(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://makecc-proxy.vercel.app",setApiMode:t=>e({apiMode:t}),setApiKey:t=>e({apiKey:t}),setProxyUrl:t=>e({proxyUrl:t})}),{name:"makecc-settings"}));function tz({isOpen:e,onClose:t}){const{apiMode:n,apiKey:r,proxyUrl:a,setApiMode:l,setApiKey:u,setProxyUrl:f}=fg(),[d,h]=X.useState(n),[g,m]=X.useState(r),[x,b]=X.useState(a),[w,k]=X.useState(!1);if(X.useEffect(()=>{e&&(h(n),m(r),b(a))},[e,n,r,a]),!e)return null;const N=async()=>{if(l(d),u(g),f(x),d==="direct"&&g)try{(await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:g})})).ok||console.error("Failed to save API key to .env")}catch(_){console.error("Failed to save API key:",_)}t()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:t,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(rg,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
|
|
102
|
-
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
103
|
-
${d==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
104
|
-
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:d==="proxy",onChange:()=>h("proxy"),className:"sr-only"}),v.jsx(_j,{className:`w-5 h-5 ${d==="proxy"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${d==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),v.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),d==="proxy"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),v.jsxs("label",{className:`
|
|
105
|
-
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
106
|
-
${d==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
107
|
-
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:d==="direct",onChange:()=>h("direct"),className:"sr-only"}),v.jsx(aj,{className:`w-5 h-5 ${d==="direct"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${d==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),v.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),d==="direct"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),d==="proxy"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),v.jsx("input",{type:"text",value:x,onChange:_=>b(_.target.value),placeholder:"https://your-proxy-server.com",className:"w-full px-4 py-2.5 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),d==="direct"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:w?"text":"password",value:g,onChange:_=>m(_.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2.5 pr-10 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("button",{type:"button",onClick:()=>k(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?v.jsx(G5,{className:"w-4 h-4"}):v.jsx(ZS,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),v.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[v.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),v.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function nz(){const{workflowName:e,setWorkflowName:t,isDraft:n,nodes:r,edges:a,clearWorkflow:l,mergeExistingConfig:u}=ci(),{isRunning:f,execute:d}=D_(),[h,g]=X.useState(!1),[m,x]=X.useState(!1),[b,w]=X.useState(null),[k,N]=X.useState(!1),_=X.useCallback(async()=>{N(!0);try{const A=await L_();A.length>0&&u(A)}catch(A){console.error("Failed to reload config:",A)}finally{N(!1)}},[u]),z=()=>{const A=qR(e,r,a,"local");w(A),g(!0)},E=()=>{g(!1),w(null)},C=()=>{f||d()},L=()=>{r.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&l()};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(M5,{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:A=>t(A.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"}),n&&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:C,disabled:f,className:`
|
|
108
|
-
flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
|
|
109
|
-
${f?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
|
|
110
|
-
`,children:[v.jsx(yl,{className:"w-4 h-4"}),f?"Running...":"Run"]}),v.jsxs("button",{onClick:z,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(da,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsxs("button",{onClick:_,disabled:k,className:`
|
|
111
|
-
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
112
|
-
${k?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-blue-500/20 hover:text-blue-400"}
|
|
113
|
-
`,title:".claude/ 폴더에서 다시 로드",children:[v.jsx(yj,{className:`w-4 h-4 text-gray-400 ${k?"animate-spin":""}`}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Reload"})]}),v.jsxs("button",{onClick:L,disabled:r.length===0,className:`
|
|
114
|
-
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
115
|
-
${r.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
|
|
116
|
-
`,title:"모든 노드 삭제",children:[v.jsx(Mf,{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(bj,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>x(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(KS,{className:"w-5 h-5 text-gray-400"})})]}),b&&v.jsx(ez,{isOpen:h,onClose:E,config:b}),v.jsx(tz,{isOpen:m,onClose:()=>x(!1)})]})}function Bf(e){const t={id:e.id,type:e.type,label:e.data.label,description:e.data.description};switch(e.type){case"skill":return{...t,skillId:e.data.skillId,skillPath:e.data.skillPath};case"subagent":return{...t,tools:e.data.tools,model:e.data.model,skills:e.data.skills,systemPrompt:e.data.systemPrompt};case"command":return{...t,commandName:e.data.commandName,commandContent:e.data.commandContent};case"hook":return{...t,hookEvent:e.data.hookEvent,hookMatcher:e.data.hookMatcher,hookCommand:e.data.hookCommand};default:return t}}async function U_(e){if(e.type==="input"||e.type==="output")return!0;try{const t=await fetch("/api/sync/node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:Bf(e)})});return t.ok?!0:(console.error("Failed to sync node:",await t.text()),!1)}catch(t){return console.error("Failed to sync node:",t),!1}}async function I_(e){if(e.type==="input"||e.type==="output")return!0;try{const t=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:Bf(e)})});return t.ok?!0:(console.error("Failed to delete node:",await t.text()),!1)}catch(t){return console.error("Failed to delete node:",t),!1}}async function iz(e,t){const n=t.find(a=>a.id===e.source),r=t.find(a=>a.id===e.target);if(!n||!r||(n.type==="input"||n.type==="output")&&(r.type==="input"||r.type==="output"))return!0;try{const a=await fetch("/api/sync/edge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:n.type,targetType:r.type},nodes:t.map(Bf)})});return a.ok?!0:(console.error("Failed to sync edge:",await a.text()),!1)}catch(a){return console.error("Failed to sync edge:",a),!1}}async function rz(e,t){const n=t.find(a=>a.id===e.source),r=t.find(a=>a.id===e.target);if(!n||!r)return!0;try{const a=await fetch("/api/sync/edge",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:n.type,targetType:r.type},nodes:t.map(Bf)})});return a.ok?!0:(console.error("Failed to remove edge:",await a.text()),!1)}catch(a){return console.error("Failed to remove edge:",a),!1}}const sz=[{type:"input",label:"User Input",icon:v.jsx(Af,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(Tl,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(jf,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"command",label:"Command",icon:v.jsx(ds,{className:"w-4 h-4"}),color:"text-orange-400",hoverColor:"hover:bg-orange-500/10"},{type:"hook",label:"Hook",icon:v.jsx(ng,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(Cf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function az(e){const t=ka(),n={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:t,type:"input",position:n,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"subagent":return{id:t,type:"subagent",position:n,data:{label:"Sub Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:t,type:"skill",position:n,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"command":return{id:t,type:"command",position:n,data:{label:"Command",description:"Execute a slash command...",commandName:"",status:"idle",usedInputs:[]}};case"hook":return{id:t,type:"hook",position:n,data:{label:"Hook",description:"Configure tool lifecycle hook...",hookEvent:"PreToolUse",status:"idle",usedInputs:[]}};case"output":return{id:t,type:"output",position:n,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function oz(){const e=ci(n=>n.addNode),t=n=>{const r=az(n);e(r),U_(r).catch(a=>{console.error("Failed to sync node to filesystem:",a)})};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:sz.map(n=>v.jsxs("button",{onClick:()=>t(n.type),className:`
|
|
117
|
-
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
118
|
-
bg-surface border border-border
|
|
119
|
-
${n.hoverColor}
|
|
120
|
-
transition-all duration-200
|
|
121
|
-
hover:border-gray-500
|
|
122
|
-
`,children:[v.jsx("span",{className:n.color,children:n.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:n.label})]},n.type))})}function lz({status:e}){switch(e){case"running":return v.jsx(af,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(V5,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(dm,{className:"w-4 h-4 text-red-400"});default:return v.jsx(yl,{className:"w-4 h-4"})}}function uz({data:e,selected:t,children:n,headerIcon:r,headerColor:a="bg-gray-700",showSourceHandle:l=!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:Gt("workflow-node",t&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Gt("node-header flex items-center justify-between",a),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[r,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(lz,{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}),n,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(d=>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"}),d]},d))})]})]}),u&&v.jsx(_a,{type:"target",position:be.Left}),l&&v.jsx(_a,{type:"source",position:be.Right})]})}const Aa=X.memo(uz);function cz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:v.jsx(Af,{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(n=>v.jsx("option",{value:n,children:n},n))})]})})}const fz=X.memo(cz);function dz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:v.jsx(Tl,{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(n=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:n},n)),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 hz=X.memo(dz);function pz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:v.jsx(jf,{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 mz=X.memo(pz);function gz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:v.jsx(ds,{className:"w-4 h-4 text-orange-100"}),headerColor:"bg-gradient-to-br from-orange-500 to-orange-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.commandName&&v.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-orange-900/50 text-orange-300 rounded",children:["/",e.commandName]}),e.commandPath&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.commandPath})]})})}const yz=X.memo(gz);function xz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:v.jsx(ng,{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.hookEvent&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.hookEvent}),e.hookMatcher&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const bz=X.memo(xz);function vz(e){switch(e){case"markdown":case"document":return v.jsx(ha,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(QS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(tj,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(lj,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(Cf,{className:"w-4 h-4 text-emerald-100"})}}function wz({data:e,selected:t}){return v.jsx(Aa,{data:e,selected:t,headerIcon:vz(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 Sz=X.memo(wz),Hf=Rf(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:t=>e({activeTab:t}),toggleCollapsed:()=>e(t=>({isCollapsed:!t.isCollapsed})),setWidth:t=>e({width:Math.max(300,Math.min(600,t))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1}),openConsolePanel:()=>e({activeTab:"console",isCollapsed:!1})}));function _z(e,t){const{source:n,target:r}=e;if(n===r)return!1;const a=t.find(u=>u.id===n),l=t.find(u=>u.id===r);return!a||!l?!1:a.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):l.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const kz={input:fz,subagent:hz,skill:mz,command:yz,hook:bz,output:Sz};function Ez(){const{nodes:e,edges:t,setNodes:n,setEdges:r,addEdge:a,setSelectedNode:l}=ci(),u=Hf(x=>x.openStepPanel),f=X.useCallback(x=>{for(const b of x)if(b.type==="remove"){const w=e.find(k=>k.id===b.id);w&&I_(w).catch(k=>{console.error("Failed to delete node from filesystem:",k)})}n(yS(x,e))},[e,n]),d=X.useCallback(x=>{for(const b of x)if(b.type==="remove"){const w=t.find(k=>k.id===b.id);w&&rz(w,e).catch(k=>{console.error("Failed to remove edge from filesystem:",k)})}r(xS(x,t))},[t,e,r]),h=X.useCallback(x=>{if(!_z(x,e))return;const b={id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0};r(Jw({...x,animated:!0},t)),a(b),iz(b,e).catch(w=>{console.error("Failed to sync edge to filesystem:",w)})},[e,t,r,a]),g=X.useCallback((x,b)=>{l(b.id),u()},[l,u]),m=X.useCallback(()=>{l(null)},[l]);return v.jsxs(G3,{nodes:e,edges:t,onNodesChange:f,onEdgesChange:d,onConnect:h,onNodeClick:g,onPaneClick:m,nodeTypes:kz,defaultViewport:{x:100,y:100,zoom:.7},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(W3,{variant:$i.Dots,gap:20,size:1,color:"#333333"}),v.jsx(a5,{}),v.jsx(b5,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"command":return"#f97316";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function Nz(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Cz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Az={};function ov(e,t){return(Az.jsx?Tz:Cz).test(e)}const Mz=/[ \t\n\f\r]/g;function jz(e){return typeof e=="object"?e.type==="text"?lv(e.value):!1:lv(e)}function lv(e){return e.replace(Mz,"")===""}class Rl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rl.prototype.normal={};Rl.prototype.property={};Rl.prototype.space=void 0;function q_(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Rl(n,r,t)}function wm(e){return e.toLowerCase()}class ln{constructor(t,n){this.attribute=n,this.property=t}}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 Rz=0;const Re=hs(),_t=hs(),Sm=hs(),de=hs(),at=hs(),ma=hs(),wn=hs();function hs(){return 2**++Rz}const _m=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:_t,commaOrSpaceSeparated:wn,commaSeparated:ma,number:de,overloadedBoolean:Sm,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),Rp=Object.keys(_m);class dg extends ln{constructor(t,n,r,a){let l=-1;if(super(t,n),uv(this,"space",a),typeof r=="number")for(;++l<Rp.length;){const u=Rp[l];uv(this,Rp[l],(r&_m[u])===_m[u])}}}dg.prototype.defined=!0;function uv(e,t,n){n&&(e[t]=n)}function Ma(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new dg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[wm(r)]=r,n[wm(l.attribute)]=r}return new Rl(t,n,e.space)}const $_=Ma({properties:{ariaActiveDescendant:null,ariaAtomic:_t,ariaAutoComplete:null,ariaBusy:_t,ariaChecked:_t,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:_t,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:_t,ariaFlowTo:at,ariaGrabbed:_t,ariaHasPopup:null,ariaHidden:_t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:_t,ariaMultiLine:_t,ariaMultiSelectable:_t,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:_t,ariaReadOnly:_t,ariaRelevant:null,ariaRequired:_t,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:_t,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function P_(e,t){return t in e?e[t]:t}function V_(e,t){return P_(e,t.toLowerCase())}const zz=Ma({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ma,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:at,autoFocus:Re,autoPlay:Re,blocking:at,capture:null,charSet:null,checked:Re,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:_t,controls:Re,controlsList:at,coords:de|ma,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:Sm,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:at,height:de,hidden:Sm,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:at,itemRef:at,itemScope:Re,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,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:Re,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:at,required:Re,reversed:Re,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:_t,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:Re,useMap:null,value:_t,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:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:_t,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:Re,disableRemotePlayback:Re,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:V_}),Oz=Ma({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:wn,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:Re,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:ma,g2:ma,glyphName:ma,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:wn,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:wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wn,rev:wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wn,requiredFeatures:wn,requiredFonts:wn,requiredFormats:wn,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:wn,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:wn,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:wn,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:P_}),F_=Ma({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Y_=Ma({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:V_}),X_=Ma({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Dz={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"},Lz=/[A-Z]/g,cv=/-[a-z]/g,Bz=/^data[-\w.:]+$/i;function Hz(e,t){const n=wm(t);let r=t,a=ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Bz.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(cv,Iz);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!cv.test(l)){let u=l.replace(Lz,Uz);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=dg}return new a(r,t)}function Uz(e){return"-"+e.toLowerCase()}function Iz(e){return e.charAt(1).toUpperCase()}const qz=q_([$_,zz,F_,Y_,X_],"html"),hg=q_([$_,Oz,F_,Y_,X_],"svg");function $z(e){return e.join(" ").trim()}var ia={},zp,fv;function Pz(){if(fv)return zp;fv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
|
|
123
|
-
`,h="/",g="*",m="",x="comment",b="declaration";function w(N,_){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];_=_||{};var z=1,E=1;function C(D){var U=D.match(t);U&&(z+=U.length);var R=D.lastIndexOf(d);E=~R?D.length-R:E+D.length}function L(){var D={line:z,column:E};return function(U){return U.position=new A(D),Z(),U}}function A(D){this.start=D,this.end={line:z,column:E},this.source=_.source}A.prototype.content=N;function B(D){var U=new Error(_.source+":"+z+":"+E+": "+D);if(U.reason=D,U.filename=_.source,U.line=z,U.column=E,U.source=N,!_.silent)throw U}function G(D){var U=D.exec(N);if(U){var R=U[0];return C(R),N=N.slice(R.length),U}}function Z(){G(n)}function H(D){var U;for(D=D||[];U=$();)U!==!1&&D.push(U);return D}function $(){var D=L();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var U=2;m!=N.charAt(U)&&(g!=N.charAt(U)||h!=N.charAt(U+1));)++U;if(U+=2,m===N.charAt(U-1))return B("End of comment missing");var R=N.slice(2,U-2);return E+=2,C(R),N=N.slice(U),E+=2,D({type:x,comment:R})}}function P(){var D=L(),U=G(r);if(U){if($(),!G(a))return B("property missing ':'");var R=G(l),I=D({type:b,property:k(U[0].replace(e,m)),value:R?k(R[0].replace(e,m)):m});return G(u),I}}function te(){var D=[];H(D);for(var U;U=P();)U!==!1&&(D.push(U),H(D));return D}return Z(),te()}function k(N){return N?N.replace(f,m):m}return zp=w,zp}var dv;function Vz(){if(dv)return ia;dv=1;var e=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0}),ia.default=n;const t=e(Pz());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),f=typeof a=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:g}=d;f?a(h,g,d):g&&(l=l||{},l[h]=g)}),l}return ia}var Yo={},hv;function Fz(){if(hv)return Yo;hv=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},u=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},d=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,f):h=h.replace(r,f),h.replace(t,u))};return Yo.camelCase=d,Yo}var Xo,pv;function Yz(){if(pv)return Xo;pv=1;var e=Xo&&Xo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(Vz()),n=Fz();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(f,d){f&&d&&(u[(0,n.camelCase)(f,l)]=d)}),u}return r.default=r,Xo=r,Xo}var Xz=Yz();const Gz=pf(Xz),G_=Z_("end"),pg=Z_("start");function Z_(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Zz(e){const t=pg(e),n=G_(e);if(t&&n)return{start:t,end:n}}function sl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mv(e.position):"start"in e||"end"in e?mv(e):"line"in e||"column"in e?km(e):""}function km(e){return gv(e&&e.line)+":"+gv(e&&e.column)}function mv(e){return km(e&&e.start)+"-"+km(e&&e.end)}function gv(e){return e&&typeof e=="number"?e:1}class Vt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=sl(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;const mg={}.hasOwnProperty,Qz=new Map,Kz=/[A-Z]/g,Jz=new Set(["table","tbody","thead","tfoot","tr"]),Wz=new Set(["td","th"]),Q_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=lO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oO(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?hg:qz,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=K_(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function K_(e,t,n){if(t.type==="element")return tO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rO(e,t,n);if(t.type==="mdxjsEsm")return iO(e,t);if(t.type==="root")return sO(e,t,n);if(t.type==="text")return aO(e,t)}function tO(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=hg,e.schema=a),e.ancestors.push(t);const l=W_(e,t.tagName,!1),u=uO(e,t);let f=yg(e,t);return Jz.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!jz(d):!0})),J_(e,u,l,t),gg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function nO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}bl(e,t.position)}function iO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bl(e,t.position)}function rO(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=hg,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:W_(e,t.name,!0),u=cO(e,t),f=yg(e,t);return J_(e,u,l,t),gg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function sO(e,t,n){const r={};return gg(r,yg(e,t)),e.create(t,e.Fragment,r,n)}function aO(e,t){return t.value}function J_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oO(e,t,n){return r;function r(a,l,u,f){const h=Array.isArray(u.children)?n:t;return f?h(l,u,f):h(l,u)}}function lO(e,t){return n;function n(r,a,l,u){const f=Array.isArray(l.children),d=pg(r);return t(a,l,u,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function uO(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&mg.call(t.properties,a)){const l=fO(e,a,t.properties[a]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&Wz.has(t.tagName)?r=f:n[u]=f}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else bl(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else bl(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function yg(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Qz;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=a.get(d)||0;u=d+"-"+h,a.set(d,h+1)}}const f=K_(e,l,u);f!==void 0&&n.push(f)}return n}function fO(e,t,n){const r=Hz(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Nz(n):$z(n)),r.property==="style"){let a=typeof n=="object"?n:dO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=hO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Dz[r.property]||r.property:r.attribute,n]}}function dO(e,t){try{return Gz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Q_+"#cannot-parse-style-attribute",a}}function W_(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const f=ov(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}r=u}else r=ov(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return mg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);bl(e)}function bl(e,t){const n=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Q_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hO(e){const t={};let n;for(n in e)mg.call(e,n)&&(t[pO(n)]=e[n]);return t}function pO(e){let t=e.replace(Kz,mO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mO(e){return"-"+e.toLowerCase()}const Op={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"]},gO={};function xg(e,t){const n=gO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return e2(e,r,a)}function e2(e,t,n){if(yO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yv(e.children,t,n)}return Array.isArray(e)?yv(e,t,n):""}function yv(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=e2(e[a],t,n);return r.join("")}function yO(e){return!!(e&&typeof e=="object")}const xv=document.createElement("i");function bg(e){const t="&"+e+";";xv.innerHTML=t;const n=xv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _n(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(_n(e,e.length,0,t),e):t}const bv={}.hasOwnProperty;function t2(e){const t={};let n=-1;for(;++n<e.length;)xO(t,e[n]);return t}function xO(e,t){let n;for(n in t){const a=(bv.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){bv.call(a,u)||(a[u]=[]);const f=l[u];bO(a[u],Array.isArray(f)?f:f?[f]:[])}}}function bO(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_n(e,0,0,r)}function n2(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=Mr(/[A-Za-z]/),$t=Mr(/[\dA-Za-z]/),vO=Mr(/[#-'*+\--9=?A-Z^-~]/);function cf(e){return e!==null&&(e<32||e===127)}const Em=Mr(/\d/),wO=Mr(/[\dA-Fa-f]/),SO=Mr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const Uf=Mr(new RegExp("\\p{P}|\\p{S}","u")),fs=Mr(/\s/);function Mr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ja(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&$t(e.charCodeAt(n+1))&&$t(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const f=e.charCodeAt(n+1);l<56320&&f>56319&&f<57344?(u=String.fromCharCode(l,f),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Fe(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(d){return He(d)?(e.enter(n),f(d)):t(d)}function f(d){return He(d)&&l++<a?(e.consume(d),f):(e.exit(n),t(d))}}const _O={tokenize:kO};function kO(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Fe(e,t,"linePrefix")}function a(f){return e.enter("paragraph"),l(f)}function l(f){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,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"),l):(e.consume(f),u)}}const EO={tokenize:NO},vv={tokenize:CO};function NO(e){const t=this,n=[];let r=0,a,l,u;return f;function f(E){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,h)(E)}return h(E)}function d(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&z();const C=t.events.length;let L=C,A;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){A=t.events[L][1].end;break}_(r);let B=C;for(;B<t.events.length;)t.events[B][1].end={...A},B++;return _n(t.events,L+1,0,t.events.slice(C)),t.events.length=B,h(E)}return f(E)}function h(E){if(r===n.length){if(!a)return x(E);if(a.currentConstruct&&a.currentConstruct.concrete)return w(E);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(vv,g,m)(E)}function g(E){return a&&z(),_(r),x(E)}function m(E){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(E)}function x(E){return t.containerState={},e.attempt(vv,b,w)(E)}function b(E){return r++,n.push([t.currentConstruct,t.containerState]),x(E)}function w(E){if(E===null){a&&z(),_(0),e.consume(E);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),k(E)}function k(E){if(E===null){N(e.exit("chunkFlow"),!0),_(0),e.consume(E);return}return Se(E)?(e.consume(E),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(E),k)}function N(E,C){const L=t.sliceStream(E);if(C&&L.push(null),E.previous=l,l&&(l.next=E),l=E,a.defineSkip(E.start),a.write(L),t.parser.lazy[E.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<u&&(!a.events[A][1].end||a.events[A][1].end.offset>u))return;const B=t.events.length;let G=B,Z,H;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(Z){H=t.events[G][1].end;break}Z=!0}for(_(r),A=B;A<t.events.length;)t.events[A][1].end={...H},A++;_n(t.events,G+1,0,t.events.slice(B)),t.events.length=A}}function _(E){let C=n.length;for(;C-- >E;){const L=n[C];t.containerState=L[1],L[0].exit.call(t,e)}n.length=E}function z(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function CO(e,t,n){return Fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ea(e){if(e===null||st(e)||fs(e))return 1;if(Uf(e))return 2}function If(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Nm={name:"attention",resolveAll:TO,tokenize:AO};function TO(e,t){let n=-1,r,a,l,u,f,d,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},x={...e[n][1].start};wv(m,-d),wv(x,d),u={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[r][1].end={...u.start},e[n][1].start={...f.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Dn(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Dn(h,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),h=Dn(h,If(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Dn(h,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Dn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,_n(e,r-1,n-r+3,h),n=r+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function AO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ea(r);let l;return u;function u(d){return l=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===l)return e.consume(d),f;const h=e.exit("attentionSequence"),g=Ea(d),m=!g||g===2&&a||n.includes(d),x=!a||a===2&&g||n.includes(r);return h._open=!!(l===42?m:m&&(a||!x)),h._close=!!(l===42?x:x&&(g||!m)),t(d)}}function wv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const MO={name:"autolink",tokenize:jO};function jO(e,t,n){let r=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Zt(b)?(e.consume(b),u):b===64?n(b):h(b)}function u(b){return b===43||b===45||b===46||$t(b)?(r=1,f(b)):h(b)}function f(b){return b===58?(e.consume(b),r=0,d):(b===43||b===45||b===46||$t(b))&&r++<32?(e.consume(b),f):(r=0,h(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||cf(b)?n(b):(e.consume(b),d)}function h(b){return b===64?(e.consume(b),g):vO(b)?(e.consume(b),h):n(b)}function g(b){return $t(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),r=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||$t(b))&&r++<63){const w=b===45?x:m;return e.consume(b),w}return n(b)}}const zl={partial:!0,tokenize:RO};function RO(e,t,n){return r;function r(l){return He(l)?Fe(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Se(l)?t(l):n(l)}}const i2={continuation:{tokenize:OO},exit:DO,name:"blockQuote",tokenize:zO};function zO(e,t,n){const r=this;return a;function a(u){if(u===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return He(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function OO(e,t,n){const r=this;return a;function a(u){return He(u)?Fe(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(i2,t,n)(u)}}function DO(e){e.exit("blockQuote")}const r2={name:"characterEscape",tokenize:LO};function LO(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return SO(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const s2={name:"characterReference",tokenize:BO};function BO(e,t,n){const r=this;let a=0,l,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,u=$t,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=wO,g):(e.enter("characterReferenceValue"),l=7,u=Em,g(m))}function g(m){if(m===59&&a){const x=e.exit("characterReferenceValue");return u===$t&&!bg(r.sliceSerialize(x))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(m)&&a++<l?(e.consume(m),g):n(m)}}const Sv={partial:!0,tokenize:UO},_v={concrete:!0,name:"codeFenced",tokenize:HO};function HO(e,t,n){const r=this,a={partial:!0,tokenize:L};let l=0,u=0,f;return d;function d(A){return h(A)}function h(A){const B=r.events[r.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[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?n(A):(e.exit("codeFencedFenceSequence"),He(A)?Fe(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(Sv,k,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"),Fe(e,b,"whitespace")(A)):A===96&&A===f?n(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?n(A):(e.consume(A),w)}function k(A){return e.attempt(a,C,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return l>0&&He(A)?Fe(e,z,"linePrefix",l+1)(A):z(A)}function z(A){return A===null||Se(A)?e.check(Sv,k,C)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||Se(A)?(e.exit("codeFlowValue"),z(A)):(e.consume(A),E)}function C(A){return e.exit("codeFenced"),t(A)}function L(A,B,G){let Z=0;return H;function H(U){return A.enter("lineEnding"),A.consume(U),A.exit("lineEnding"),$}function $(U){return A.enter("codeFencedFence"),He(U)?Fe(A,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):P(U)}function P(U){return U===f?(A.enter("codeFencedFenceSequence"),te(U)):G(U)}function te(U){return U===f?(Z++,A.consume(U),te):Z>=u?(A.exit("codeFencedFenceSequence"),He(U)?Fe(A,D,"whitespace")(U):D(U)):G(U)}function D(U){return U===null||Se(U)?(A.exit("codeFencedFence"),B(U)):G(U)}}}function UO(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Dp={name:"codeIndented",tokenize:qO},IO={partial:!0,tokenize:$O};function qO(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),Fe(e,l,"linePrefix",5)(h)}function l(h){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?d(h):Se(h)?e.attempt(IO,u,d)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Se(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function d(h){return e.exit("codeIndented"),t(h)}}function $O(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):Fe(e,l,"linePrefix",5)(u)}function l(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Se(u)?a(u):n(u)}}const PO={name:"codeText",previous:FO,resolve:VO,tokenize:YO};function VO(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function FO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function YO(e,t,n){let r=0,a,l;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),r++,f):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(l=e.enter("codeTextSequence"),a=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",h(m))}}class XO{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Go(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Go(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Go(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Go(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Go(this.left,n.reverse())}}}function Go(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function a2(e){const t={};let n=-1,r,a,l,u,f,d,h;const g=new XO(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,GO(g,n)),n=t[n],h=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=g.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...g.get(a)[1].start},f=g.slice(a,n),f.unshift(r),g.splice(a,n-a+1,f))}}return _n(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function GO(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,d=[],h={};let g,m,x=-1,b=n,w=0,k=0;const N=[k];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),b._tokenizer||(g=r.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=n;++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&&(k=x+1,N.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const _=f.slice(N[x],N[x+1]),z=l.pop();d.push([z,z+_.length-1]),e.splice(z,2,_)}for(d.reverse(),x=-1;++x<d.length;)h[w+d[x][0]]=w+d[x][1],w+=d[x][1]-d[x][0]-1;return h}const ZO={resolve:KO,tokenize:JO},QO={partial:!0,tokenize:WO};function KO(e){return a2(e),e}function JO(e,t){let n;return r;function r(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?l(f):Se(f)?e.check(QO,u,l)(f):(e.consume(f),a)}function l(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function WO(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Fe(e,l,"linePrefix")}function l(u){if(u===null||Se(u))return n(u);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function o2(e,t,n,r,a,l,u,f,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(_),e.exit(l),x):_===null||_===32||_===41||cf(_)?n(_):(e.enter(r),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),k(_))}function x(_){return _===62?(e.enter(l),e.consume(_),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?n(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function k(_){return!g&&(_===null||_===41||st(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(r),t(_)):g<h&&_===40?(e.consume(_),g++,k):_===41?(e.consume(_),g--,k):_===null||_===32||_===40||cf(_)?n(_):(e.consume(_),_===92?N:k)}function N(_){return _===40||_===41||_===92?(e.consume(_),k):k(_)}}function l2(e,t,n,r,a,l){const u=this;let f=0,d;return h;function h(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(l),g}function g(b){return f>999||b===null||b===91||b===93&&!d||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):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),d||(d=!He(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function u2(e,t,n,r,a,l){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(r),e.enter(a),e.consume(x),e.exit(a),u=x===40?41:x,d):n(x)}function d(x){return x===u?(e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):(e.enter(l),h(x))}function h(x){return x===u?(e.exit(l),d(u)):x===null?n(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Fe(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function al(e,t){let n;return r;function r(a){return Se(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):He(a)?Fe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const eD={name:"definition",tokenize:nD},tD={partial:!0,tokenize:iD};function nD(e,t,n){const r=this;let a;return l;function l(b){return e.enter("definition"),u(b)}function u(b){return l2.call(r,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return a=Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return st(b)?al(e,h)(b):h(b)}function h(b){return o2(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(tD,m,m)(b)}function m(b){return He(b)?Fe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function iD(e,t,n){return r;function r(f){return st(f)?al(e,a)(f):n(f)}function a(f){return u2(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return He(f)?Fe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?t(f):n(f)}}const rD={name:"hardBreakEscape",tokenize:sD};function sD(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Se(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const aD={name:"headingAtx",resolve:oD,tokenize:lD};function oD(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_n(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function lD(e,t,n){let r=0;return a;function a(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&r++<6?(e.consume(g),u):g===null||st(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||Se(g)?(e.exit("atxHeading"),t(g)):He(g)?Fe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||st(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const uD=["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"],kv=["pre","script","style","textarea"],cD={concrete:!0,name:"htmlFlow",resolveTo:hD,tokenize:pD},fD={partial:!0,tokenize:gD},dD={partial:!0,tokenize:mD};function hD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pD(e,t,n){const r=this;let a,l,u,f,d;return h;function h(M){return g(M)}function g(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),x):M===47?(e.consume(M),l=!0,k):M===63?(e.consume(M),a=3,r.interrupt?t:j):Zt(M)?(e.consume(M),u=String.fromCharCode(M),N):n(M)}function x(M){return M===45?(e.consume(M),a=2,b):M===91?(e.consume(M),a=5,f=0,w):Zt(M)?(e.consume(M),a=4,r.interrupt?t:j):n(M)}function b(M){return M===45?(e.consume(M),r.interrupt?t:j):n(M)}function w(M){const ie="CDATA[";return M===ie.charCodeAt(f++)?(e.consume(M),f===ie.length?r.interrupt?t:P:w):n(M)}function k(M){return Zt(M)?(e.consume(M),u=String.fromCharCode(M),N):n(M)}function N(M){if(M===null||M===47||M===62||st(M)){const ie=M===47,ce=u.toLowerCase();return!ie&&!l&&kv.includes(ce)?(a=1,r.interrupt?t(M):P(M)):uD.includes(u.toLowerCase())?(a=6,ie?(e.consume(M),_):r.interrupt?t(M):P(M)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):l?z(M):E(M))}return M===45||$t(M)?(e.consume(M),u+=String.fromCharCode(M),N):n(M)}function _(M){return M===62?(e.consume(M),r.interrupt?t:P):n(M)}function z(M){return He(M)?(e.consume(M),z):H(M)}function E(M){return M===47?(e.consume(M),H):M===58||M===95||Zt(M)?(e.consume(M),C):He(M)?(e.consume(M),E):H(M)}function C(M){return M===45||M===46||M===58||M===95||$t(M)?(e.consume(M),C):L(M)}function L(M){return M===61?(e.consume(M),A):He(M)?(e.consume(M),L):E(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,B):He(M)?(e.consume(M),A):G(M)}function B(M){return M===d?(e.consume(M),d=null,Z):M===null||Se(M)?n(M):(e.consume(M),B)}function G(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||st(M)?L(M):(e.consume(M),G)}function Z(M){return M===47||M===62||He(M)?E(M):n(M)}function H(M){return M===62?(e.consume(M),$):n(M)}function $(M){return M===null||Se(M)?P(M):He(M)?(e.consume(M),$):n(M)}function P(M){return M===45&&a===2?(e.consume(M),R):M===60&&a===1?(e.consume(M),I):M===62&&a===4?(e.consume(M),O):M===63&&a===3?(e.consume(M),j):M===93&&a===5?(e.consume(M),K):Se(M)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(fD,V,te)(M)):M===null||Se(M)?(e.exit("htmlFlowData"),te(M)):(e.consume(M),P)}function te(M){return e.check(dD,D,V)(M)}function D(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return M===null||Se(M)?te(M):(e.enter("htmlFlowData"),P(M))}function R(M){return M===45?(e.consume(M),j):P(M)}function I(M){return M===47?(e.consume(M),u="",F):P(M)}function F(M){if(M===62){const ie=u.toLowerCase();return kv.includes(ie)?(e.consume(M),O):P(M)}return Zt(M)&&u.length<8?(e.consume(M),u+=String.fromCharCode(M),F):P(M)}function K(M){return M===93?(e.consume(M),j):P(M)}function j(M){return M===62?(e.consume(M),O):M===45&&a===2?(e.consume(M),j):P(M)}function O(M){return M===null||Se(M)?(e.exit("htmlFlowData"),V(M)):(e.consume(M),O)}function V(M){return e.exit("htmlFlow"),t(M)}}function mD(e,t,n){const r=this;return a;function a(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function gD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(zl,t,n)}}const yD={name:"htmlText",tokenize:xD};function xD(e,t,n){const r=this;let a,l,u;return f;function f(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),d}function d(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),L):j===63?(e.consume(j),E):Zt(j)?(e.consume(j),G):n(j)}function h(j){return j===45?(e.consume(j),g):j===91?(e.consume(j),l=0,w):Zt(j)?(e.consume(j),z):n(j)}function g(j){return j===45?(e.consume(j),b):n(j)}function m(j){return j===null?n(j):j===45?(e.consume(j),x):Se(j)?(u=m,I(j)):(e.consume(j),m)}function x(j){return j===45?(e.consume(j),b):m(j)}function b(j){return j===62?R(j):j===45?x(j):m(j)}function w(j){const O="CDATA[";return j===O.charCodeAt(l++)?(e.consume(j),l===O.length?k:w):n(j)}function k(j){return j===null?n(j):j===93?(e.consume(j),N):Se(j)?(u=k,I(j)):(e.consume(j),k)}function N(j){return j===93?(e.consume(j),_):k(j)}function _(j){return j===62?R(j):j===93?(e.consume(j),_):k(j)}function z(j){return j===null||j===62?R(j):Se(j)?(u=z,I(j)):(e.consume(j),z)}function E(j){return j===null?n(j):j===63?(e.consume(j),C):Se(j)?(u=E,I(j)):(e.consume(j),E)}function C(j){return j===62?R(j):E(j)}function L(j){return Zt(j)?(e.consume(j),A):n(j)}function A(j){return j===45||$t(j)?(e.consume(j),A):B(j)}function B(j){return Se(j)?(u=B,I(j)):He(j)?(e.consume(j),B):R(j)}function G(j){return j===45||$t(j)?(e.consume(j),G):j===47||j===62||st(j)?Z(j):n(j)}function Z(j){return j===47?(e.consume(j),R):j===58||j===95||Zt(j)?(e.consume(j),H):Se(j)?(u=Z,I(j)):He(j)?(e.consume(j),Z):R(j)}function H(j){return j===45||j===46||j===58||j===95||$t(j)?(e.consume(j),H):$(j)}function $(j){return j===61?(e.consume(j),P):Se(j)?(u=$,I(j)):He(j)?(e.consume(j),$):Z(j)}function P(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),a=j,te):Se(j)?(u=P,I(j)):He(j)?(e.consume(j),P):(e.consume(j),D)}function te(j){return j===a?(e.consume(j),a=void 0,U):j===null?n(j):Se(j)?(u=te,I(j)):(e.consume(j),te)}function D(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||st(j)?Z(j):(e.consume(j),D)}function U(j){return j===47||j===62||st(j)?Z(j):n(j)}function R(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function I(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),F}function F(j){return He(j)?Fe(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):K(j)}function K(j){return e.enter("htmlTextData"),u(j)}}const vg={name:"labelEnd",resolveAll:SD,resolveTo:_D,tokenize:kD},bD={tokenize:ED},vD={tokenize:ND},wD={tokenize:CD};function SD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&_n(e,0,e.length,n),e}function _D(e,t){let n=e.length,r=0,a,l,u,f;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",d,t],["enter",h,t]],f=Dn(f,e.slice(l+1,l+r+3)),f=Dn(f,[["enter",g,t]]),f=Dn(f,If(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),f=Dn(f,[["exit",g,t],e[u-2],e[u-1],["exit",h,t]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",d,t]]),_n(e,l,e.length,f),e}function kD(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return f;function f(x){return l?l._inactive?m(x):(u=r.parser.defined.includes(Zn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),d):n(x)}function d(x){return x===40?e.attempt(bD,g,u?g:m)(x):x===91?e.attempt(vD,g,u?h:m)(x):u?g(x):m(x)}function h(x){return e.attempt(wD,g,m)(x)}function g(x){return t(x)}function m(x){return l._balanced=!0,n(x)}}function ED(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return st(m)?al(e,l)(m):l(m)}function l(m){return m===41?g(m):o2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return st(m)?al(e,d)(m):g(m)}function f(m){return n(m)}function d(m){return m===34||m===39||m===40?u2(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return st(m)?al(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function ND(e,t,n){const r=this;return a;function a(f){return l2.call(r,e,l,u,"reference","referenceMarker","referenceString")(f)}function l(f){return r.parser.defined.includes(Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function CD(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const TD={name:"labelStartImage",resolveAll:vg.resolveAll,tokenize:AD};function AD(e,t,n){const r=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),l}function l(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(f):t(f)}}const MD={name:"labelStartLink",resolveAll:vg.resolveAll,tokenize:jD};function jD(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Lp={name:"lineEnding",tokenize:RD};function RD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Fe(e,t,"linePrefix")}}const Pc={name:"thematicBreak",tokenize:zD};function zD(e,t,n){let r=0,a;return l;function l(h){return e.enter("thematicBreak"),u(h)}function u(h){return a=h,f(h)}function f(h){return h===a?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Se(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===a?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),He(h)?Fe(e,f,"whitespace")(h):f(h))}}const an={continuation:{tokenize:BD},exit:UD,name:"list",tokenize:LD},OD={partial:!0,tokenize:ID},DD={partial:!0,tokenize:HD};function LD(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return f;function f(b){const w=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Em(b)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Pc,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return Em(b)&&++u<10?(e.consume(b),d):(!r.interrupt||u<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(zl,r.interrupt?n:g,e.attempt(OD,x,m))}function g(b){return r.containerState.initialBlankLine=!0,l++,x(b)}function m(b){return He(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function BD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zl,a,l);function a(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Fe(e,t,"listItemIndent",r.containerState.size+1)(f)}function l(f){return r.containerState.furtherBlankLines||!He(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(DD,t,u)(f))}function u(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,Fe(e,e.attempt(an,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function HD(e,t,n){const r=this;return Fe(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function UD(e){e.exit(this.containerState.type)}function ID(e,t,n){const r=this;return Fe(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!He(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Ev={name:"setextUnderline",resolveTo:qD,tokenize:$D};function qD(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function $D(e,t,n){const r=this;let a;return l;function l(h){let g=r.events.length,m;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){m=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),a=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===a?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),He(h)?Fe(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Se(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const PD={tokenize:VD};function VD(e){const t=this,n=e.attempt(zl,r,e.attempt(this.parser.constructs.flowInitial,a,Fe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(ZO,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const FD={resolveAll:f2()},YD=c2("string"),XD=c2("text");function c2(e){return{resolveAll:f2(e==="text"?GD:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,f);return u;function u(g){return h(g)?l(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),d)}function h(g){if(g===null)return!0;const m=a[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function f2(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function GD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,f=0,d;for(;l--;){const h=a[l];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)d=!0,f++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const ZD={42:an,43:an,45:an,48:an,49:an,50:an,51:an,52:an,53:an,54:an,55:an,56:an,57:an,62:i2},QD={91:eD},KD={[-2]:Dp,[-1]:Dp,32:Dp},JD={35:aD,42:Pc,45:[Ev,Pc],60:cD,61:Ev,95:Pc,96:_v,126:_v},WD={38:s2,92:r2},e6={[-5]:Lp,[-4]:Lp,[-3]:Lp,33:TD,38:s2,42:Nm,60:[MO,yD],91:MD,92:[rD,r2],93:vg,95:Nm,96:PO},t6={null:[Nm,FD]},n6={null:[42,95]},i6={null:[]},r6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n6,contentInitial:QD,disable:i6,document:ZD,flow:JD,flowInitial:KD,insideSpan:t6,string:WD,text:e6},Symbol.toStringTag,{value:"Module"}));function s6(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],f=[];const d={attempt:B(L),check:B(A),consume:z,enter:E,exit:C,interrupt:B(A,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=t.tokenize.call(h,d);return t.resolveAll&&l.push(t),h;function m($){return u=Dn(u,$),N(),u[u.length-1]!==null?[]:(G(t,0),h.events=If(l,h.events,h),h.events)}function x($,P){return o6(b($),P)}function b($){return a6(u,$)}function w(){const{_bufferIndex:$,_index:P,line:te,column:D,offset:U}=r;return{_bufferIndex:$,_index:P,line:te,column:D,offset:U}}function k($){a[$.line]=$.column,H()}function N(){let $;for(;r._index<u.length;){const P=u[r._index];if(typeof P=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<P.length;)_(P.charCodeAt(r._bufferIndex));else _(P)}}function _($){g=g($)}function z($){Se($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,H()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=$}function E($,P){const te=P||{};return te.type=$,te.start=w(),h.events.push(["enter",te,h]),f.push(te),te}function C($){const P=f.pop();return P.end=w(),h.events.push(["exit",P,h]),P}function L($,P){G($,P.from)}function A($,P){P.restore()}function B($,P){return te;function te(D,U,R){let I,F,K,j;return Array.isArray(D)?V(D):"tokenize"in D?V([D]):O(D);function O(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 V(Ce)(ue)}}function V(fe){return I=fe,F=0,fe.length===0?R:M(fe[F])}function M(fe){return he;function he(ue){return j=Z(),K=fe,fe.partial||(h.currentConstruct=fe),fe.name&&h.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(h),P):h,d,ie,ce)(ue)}}function ie(fe){return $(K,j),U}function ce(fe){return j.restore(),++F<I.length?M(I[F]):R}}}function G($,P){$.resolveAll&&!l.includes($)&&l.push($),$.resolve&&_n(h.events,P,h.events.length-P,$.resolve(h.events.slice(P),h)),$.resolveTo&&(h.events=$.resolveTo(h.events,h))}function Z(){const $=w(),P=h.previous,te=h.currentConstruct,D=h.events.length,U=Array.from(f);return{from:D,restore:R};function R(){r=$,h.previous=P,h.currentConstruct=te,h.events.length=D,f=U,H()}}function H(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function a6(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function o6(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
|
|
124
|
-
`;break}case-3:{u=`\r
|
|
125
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function l6(e){const r={constructs:t2([r6,...(e||{}).extensions||[]]),content:a(_O),defined:[],document:a(EO),flow:a(PD),lazy:{},string:a(YD),text:a(XD)};return r;function a(l){return u;function u(f){return s6(r,l,f)}}}function u6(e){for(;!a2(e););return e}const Nv=/[\0\t\n\r]/g;function c6(){let e=1,t="",n=!0,r;return a;function a(l,u,f){const d=[];let h,g,m,x,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(Nv.lastIndex=m,h=Nv.exec(l),x=h&&h.index!==void 0?h.index:l.length,b=l.charCodeAt(x),!h){t=l.slice(m);break}if(b===10&&m===x&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<x&&(d.push(l.slice(m,x)),e+=x-m),b){case 0:{d.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return f&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const f6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function d6(e){return e.replace(f6,h6)}function h6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return n2(n.slice(l?2:1),l?16:10)}return bg(n)||e}const d2={}.hasOwnProperty;function p6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),m6(n)(u6(l6(n).document().write(c6()(e,t,!0))))}function m6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ht),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:l(Qe),blockQuote:l(Ee),characterEscape:Z,characterReference:Z,codeFenced:l(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Ce,u),codeText:l(we,u),codeTextData:Z,data:Z,codeFlowValue:Z,definition:l(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(De),hardBreakEscape:l(Xe),hardBreakTrailing:l(Xe),htmlFlow:l(pt,u),htmlFlowData:Z,htmlText:l(pt,u),htmlTextData:Z,image:l(un),label:u,link:l(Ht),listItem:l(Bn),listItemValue:x,listOrdered:l(Qt,m),listUnordered:l(Qt),paragraph:l(pi),reference:M,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Qe),strong:l(mi),thematicBreak:l(Yi)},exit:{atxHeading:d(),atxHeadingSequence:L,autolink:d(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:d(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:d(N),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:H,codeIndented:d(_),codeText:d(U),codeTextData:H,data:H,definition:d(),definitionDestinationString:C,definitionLabelString:z,definitionTitleString:E,emphasis:d(),hardBreakEscape:d(P),hardBreakTrailing:d(P),htmlFlow:d(te),htmlFlowData:H,htmlText:d(D),htmlTextData:H,image:d(I),label:K,labelText:F,lineEnding:$,link:d(R),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ie,resourceDestinationString:j,resourceTitleString:O,resource:V,setextHeading:d(G),setextHeadingLineSequence:B,setextHeadingText:A,strong:d(),thematicBreak:d()}};h2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:g,data:n},Oe=[];let Pe=-1;for(;++Pe<se.length;)if(se[Pe][1].type==="listOrdered"||se[Pe][1].type==="listUnordered")if(se[Pe][0]==="enter")Oe.push(Pe);else{const Ft=Oe.pop();Pe=a(se,Ft,Pe)}for(Pe=-1;++Pe<se.length;){const Ft=t[se[Pe][0]];d2.call(Ft,se[Pe][1].type)&&Ft[se[Pe][1].type].call(Object.assign({sliceSerialize:se[Pe][2].sliceSerialize},_e),se[Pe][1])}if(_e.tokenStack.length>0){const Ft=_e.tokenStack[_e.tokenStack.length-1];(Ft[1]||Cv).call(_e,void 0,Ft[0])}for(pe.position={start:Nr(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:Nr(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)pe=t.transforms[Pe](pe)||pe;return pe}function a(se,pe,_e){let Oe=pe-1,Pe=-1,Ft=!1,Hn,Rt,mt,Ut;for(;++Oe<=_e;){const Je=se[Oe];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Pe++:Pe--,Ut=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Hn&&!Ut&&!Pe&&!mt&&(mt=Oe),Ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ut=void 0}if(!Pe&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Pe===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Hn){let Jn=Oe;for(Rt=void 0;Jn--;){const cn=se[Jn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;Rt&&(se[Rt][1].type="lineEndingBlank",Ft=!0),cn[1].type="lineEnding",Rt=Jn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}mt&&(!Rt||mt<Rt)&&(Hn._spread=!0),Hn.end=Object.assign({},Rt?se[Rt][1].start:Je[1].end),se.splice(Rt||Oe,0,["exit",Hn,Je[2]]),Oe++,_e++}if(Je[1].type==="listItemPrefix"){const Jn={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Hn=Jn,se.splice(Oe,0,["enter",Jn,Je[2]]),Oe++,_e++,mt=void 0,Ut=!0}}}return se[pe][1]._spread=Ft,_e}function l(se,pe){return _e;function _e(Oe){f.call(this,se(Oe),Oe),pe&&pe.call(this,Oe)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(se,pe,_e){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([pe,_e||void 0]),se.position={start:Nr(pe.start),end:void 0}}function d(se){return pe;function pe(_e){se&&se.call(this,_e),h.call(this,_e)}}function h(se,pe){const _e=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==se.type&&(pe?pe.call(this,se,Oe[0]):(Oe[1]||Cv).call(this,se,Oe[0]));else throw new Error("Cannot close `"+se.type+"` ("+sl({start:se.start,end:se.end})+"): it’s not open");_e.position.end=Nr(se.end)}function g(){return xg(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(se){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function b(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=se}function w(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=se}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/(\r?\n|\r)$/g,"")}function z(se){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Zn(this.sliceSerialize(se)).toLowerCase()}function E(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function C(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function L(se){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(se).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function B(se){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(se){const _e=this.stack[this.stack.length-1].children;let Oe=_e[_e.length-1];(!Oe||Oe.type!=="text")&&(Oe=Ct(),Oe.position={start:Nr(se.start),end:void 0},_e.push(Oe)),this.stack.push(Oe)}function H(se){const pe=this.stack.pop();pe.value+=this.sliceSerialize(se),pe.position.end=Nr(se.end)}function $(se){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=Nr(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(Z.call(this,se),H.call(this,se))}function P(){this.data.atHardBreak=!0}function te(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function D(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function U(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function R(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function I(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function F(se){const pe=this.sliceSerialize(se),_e=this.stack[this.stack.length-2];_e.label=d6(pe),_e.identifier=Zn(pe).toLowerCase()}function K(){const se=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 Oe=se.children;_e.children=Oe}else _e.alt=pe}function j(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function O(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function V(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ie(se){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Zn(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ce(se){this.data.characterReferenceType=se.type}function fe(se){const pe=this.sliceSerialize(se),_e=this.data.characterReferenceType;let Oe;_e?(Oe=n2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=bg(pe);const Pe=this.stack[this.stack.length-1];Pe.value+=Oe}function he(se){const pe=this.stack.pop();pe.position.end=Nr(se.end)}function ue(se){H.call(this,se);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(se)}function me(se){H.call(this,se);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(se)}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 De(){return{type:"emphasis",children:[]}}function Qe(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function pt(){return{type:"html",value:""}}function un(){return{type:"image",title:null,url:"",alt:null}}function Ht(){return{type:"link",title:null,url:"",children:[]}}function Qt(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Bn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function pi(){return{type:"paragraph",children:[]}}function mi(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function Yi(){return{type:"thematicBreak"}}}function Nr(e){return{line:e.line,column:e.column,offset:e.offset}}function h2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?h2(e,r):g6(e,r)}}function g6(e,t){let n;for(n in t)if(d2.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Cv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sl({start:t.start,end:t.end})+") is still open")}function y6(e){const t=this;t.parser=n;function n(r){return p6(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function x6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function b6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
126
|
-
`}]}function v6(e,t){const n=t.value?t.value+`
|
|
127
|
-
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function w6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=ja(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,f+=1,e.footnoteCounts.set(r,f);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function k6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function N6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p2(e,t);const a={src:ja(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function C6(e,t){const n={src:ja(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function T6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function A6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p2(e,t);const a={href:ja(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function M6(e,t){const n={href:ja(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j6(e,t,n){const r=e.all(t),a=n?R6(n):m2(t),l={},u=[];if(typeof t.checked=="boolean"){const g=r[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const g=r[f];(a||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
128
|
-
`}),g.type==="element"&&g.tagName==="p"&&!a?u.push(...g.children):u.push(g)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
|
|
129
|
-
`});const h={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,h),e.applyData(t,h)}function R6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=m2(n[r])}return t}function m2(e){const t=e.spread;return t??e.children.length>1}function z6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function O6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function L6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=pg(t.children[1]),d=G_(t.children[t.children.length-1]);f&&d&&(u.position={start:f,end:d}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function H6(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let d=-1;const h=[];for(;++d<f;){const m=t.children[d],x={},b=u?u[d]:void 0;b&&(x.align=b);let w={type:"element",tagName:l,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),h.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function U6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Tv=9,Av=32;function I6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(Mv(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(Mv(t.slice(a),a>0,!1)),l.join("")}function Mv(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===Tv||l===Av;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===Tv||l===Av;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function q6(e,t){const n={type:"text",value:I6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const P6={blockquote:x6,break:b6,code:v6,delete:w6,emphasis:S6,footnoteReference:_6,heading:k6,html:E6,imageReference:N6,image:C6,inlineCode:T6,linkReference:A6,link:M6,listItem:j6,list:z6,paragraph:O6,root:D6,strong:L6,table:B6,tableCell:U6,tableRow:H6,text:q6,thematicBreak:$6,toml:Mc,yaml:Mc,definition:Mc,footnoteDefinition:Mc};function Mc(){}const g2=-1,qf=0,ol=1,ff=2,wg=3,Sg=4,_g=5,kg=6,y2=7,x2=8,jv=typeof self=="object"?self:globalThis,V6=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case qf:case g2:return n(u,a);case ol:{const f=n([],a);for(const d of u)f.push(r(d));return f}case ff:{const f=n({},a);for(const[d,h]of u)f[r(d)]=r(h);return f}case wg:return n(new Date(u),a);case Sg:{const{source:f,flags:d}=u;return n(new RegExp(f,d),a)}case _g:{const f=n(new Map,a);for(const[d,h]of u)f.set(r(d),r(h));return f}case kg:{const f=n(new Set,a);for(const d of u)f.add(r(d));return f}case y2:{const{name:f,message:d}=u;return n(new jv[f](d),a)}case x2:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new jv[l](u),a)};return r},Rv=e=>V6(new Map,e)(0),ra="",{toString:F6}={},{keys:Y6}=Object,Zo=e=>{const t=typeof e;if(t!=="object"||!e)return[qf,t];const n=F6.call(e).slice(8,-1);switch(n){case"Array":return[ol,ra];case"Object":return[ff,ra];case"Date":return[wg,ra];case"RegExp":return[Sg,ra];case"Map":return[_g,ra];case"Set":return[kg,ra];case"DataView":return[ol,n]}return n.includes("Array")?[ol,n]:n.includes("Error")?[y2,n]:[ff,n]},jc=([e,t])=>e===qf&&(t==="function"||t==="symbol"),X6=(e,t,n,r)=>{const a=(u,f)=>{const d=r.push(u)-1;return n.set(f,d),d},l=u=>{if(n.has(u))return n.get(u);let[f,d]=Zo(u);switch(f){case qf:{let g=u;switch(d){case"bigint":f=x2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return a([g2],u)}return a([f,g],u)}case ol:{if(d){let x=u;return d==="DataView"?x=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(u)),a([d,[...x]],u)}const g=[],m=a([f,g],u);for(const x of u)g.push(l(x));return m}case ff:{if(d)switch(d){case"BigInt":return a([d,u.toString()],u);case"Boolean":case"Number":case"String":return a([d,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const g=[],m=a([f,g],u);for(const x of Y6(u))(e||!jc(Zo(u[x])))&&g.push([l(x),l(u[x])]);return m}case wg:return a([f,u.toISOString()],u);case Sg:{const{source:g,flags:m}=u;return a([f,{source:g,flags:m}],u)}case _g:{const g=[],m=a([f,g],u);for(const[x,b]of u)(e||!(jc(Zo(x))||jc(Zo(b))))&&g.push([l(x),l(b)]);return m}case kg:{const g=[],m=a([f,g],u);for(const x of u)(e||!jc(Zo(x)))&&g.push(l(x));return m}}const{message:h}=u;return a([f,{name:d,message:h}],u)};return l},zv=(e,{json:t,lossy:n}={})=>{const r=[];return X6(!(t||n),!!t,new Map,r)(e),r},df=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Rv(zv(e,t)):structuredClone(e):(e,t)=>Rv(zv(e,t));function G6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Z6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Q6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||G6,r=e.options.footnoteBackLabel||Z6,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),x=ja(m.toLowerCase());let b=0;const w=[],k=e.footnoteCounts.get(m);for(;k!==void 0&&++b<=k;){w.length>0&&w.push({type:"text",value:" "});let z=typeof n=="string"?n:n(d,b);typeof z=="string"&&(z={type:"text",value:z}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,b),className:["data-footnote-backref"]},children:Array.isArray(z)?z:[z]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const z=N.children[N.children.length-1];z&&z.type==="text"?z.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...df(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
130
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
131
|
-
`}]}}const $f=(function(e){if(e==null)return eL;if(typeof e=="function")return Pf(e);if(typeof e=="object")return Array.isArray(e)?K6(e):J6(e);if(typeof e=="string")return W6(e);throw new Error("Expected function, string, or object as test")});function K6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$f(e[n]);return Pf(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function J6(e){const t=e;return Pf(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function W6(e){return Pf(t);function t(n){return n&&n.type===e}}function Pf(e){return t;function t(n,r,a){return!!(tL(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function eL(){return!0}function tL(e){return e!==null&&typeof e=="object"&&"type"in e}const b2=[],nL=!0,Cm=!1,iL="skip";function v2(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=$f(a),u=r?-1:1;f(e,void 0,[])();function f(d,h,g){const m=d&&typeof d=="object"?d:{};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 ("+(d.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=b2,w,k,N;if((!t||l(d,h,g[g.length-1]||void 0))&&(b=rL(n(d,g)),b[0]===Cm))return b;if("children"in d&&d.children){const _=d;if(_.children&&b[0]!==iL)for(k=(r?_.children.length:-1)+u,N=g.concat(_);k>-1&&k<_.children.length;){const z=_.children[k];if(w=f(z,k,N)(),w[0]===Cm)return w;k=typeof w[1]=="number"?w[1]:k+u}}return b}}}function rL(e){return Array.isArray(e)?e:typeof e=="number"?[nL,e]:e==null?b2:[e]}function Eg(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),v2(e,l,f,a);function f(d,h){const g=h[h.length-1],m=g?g.children.indexOf(d):void 0;return u(d,m,g)}}const Tm={}.hasOwnProperty,sL={};function aL(e,t){const n=t||sL,r=new Map,a=new Map,l=new Map,u={...P6,...n.handlers},f={all:h,applyData:lL,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:d,options:n,patch:oL,wrap:cL};return Eg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?r:a,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function d(g,m){const x=g.type,b=f.handlers[x];if(Tm.call(f.handlers,x)&&b)return b(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:k,...N}=g,_=df(N);return _.children=f.all(g),_}return df(g)}return(f.options.unknownHandler||uL)(f,g,m)}function h(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=Ov(w.value)),!Array.isArray(w)&&w.type==="element")){const k=w.children[0];k&&k.type==="text"&&(k.value=Ov(k.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function oL(e,t){e.position&&(t.position=Zz(e))}function lL(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,df(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function uL(e,t){const n=t.data||{},r="value"in t&&!(Tm.call(n,"hProperties")||Tm.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cL(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
132
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
133
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
134
|
-
`}),n}function Ov(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Dv(e,t){const n=aL(e,t),r=n.one(e,void 0),a=Q6(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
|
|
135
|
-
`},a),l}function fL(e,t){return e&&"run"in e?async function(n,r){const a=Dv(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Dv(n,{file:r,...e||t})}}function Lv(e){if(e)throw e}var Bp,Bv;function dL(){if(Bv)return Bp;Bv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},u=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(r)return r(h,g).value}else return;return h[g]};return Bp=function d(){var h,g,m,x,b,w,k=arguments[0],N=1,_=arguments.length,z=!1;for(typeof k=="boolean"&&(z=k,k=arguments[1]||{},N=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});N<_;++N)if(h=arguments[N],h!=null)for(g in h)m=f(k,g),x=f(h,g),k!==x&&(z&&x&&(l(x)||(b=a(x)))?(b?(b=!1,w=m&&a(m)?m:[]):w=m&&l(m)?m:{},u(k,{name:g,newValue:d(z,w,x)})):typeof x<"u"&&u(k,{name:g,newValue:x}));return k},Bp}var hL=dL();const Hp=pf(hL);function Am(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pL(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...a);function f(d,...h){const g=e[++l];let m=-1;if(d){u(d);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?mL(g,f)(...h):u(null,...h)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function mL(e,t){let n;return r;function r(...u){const f=e.length>u.length;let d;f&&u.push(a);try{d=e.apply(this,u)}catch(h){const g=h;if(f&&n)throw g;return a(g)}f||(d&&d.then&&typeof d.then=="function"?d.then(l,a):d instanceof Error?a(d):l(d))}function a(u,...f){n||(n=!0,t(u,...f))}function l(u){a(null,u)}}const ri={basename:gL,dirname:yL,extname:xL,join:bL,sep:"/"};function gL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ol(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,f=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),f>-1&&(e.codePointAt(a)===t.codePointAt(f--)?f<0&&(r=a):(f=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function yL(e){if(Ol(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xL(e){Ol(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function bL(...e){let t=-1,n;for(;++t<e.length;)Ol(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vL(n)}function vL(e){Ol(e);const t=e.codePointAt(0)===47;let n=wL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function wL(e,t){let n="",r=0,a=-1,l=0,u=-1,f,d;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else f===46&&l>-1?l++:l=-1}return n}function Ol(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SL={cwd:_L};function _L(){return"/"}function Mm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kL(e){if(typeof e=="string")e=new URL(e);else if(!Mm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return EL(e)}function EL(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Up=["history","path","basename","stem","extname","dirname"];class w2{constructor(t){let n;t?Mm(t)?n={path:t}:typeof t=="string"||NL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":SL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Up.length;){const l=Up[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Up.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ri.basename(this.path):void 0}set basename(t){qp(t,"basename"),Ip(t,"basename"),this.path=ri.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ri.dirname(this.path):void 0}set dirname(t){Hv(this.basename,"dirname"),this.path=ri.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ri.extname(this.path):void 0}set extname(t){if(Ip(t,"extname"),Hv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ri.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mm(t)&&(t=kL(t)),qp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ri.basename(this.path,this.extname):void 0}set stem(t){qp(t,"stem"),Ip(t,"stem"),this.path=ri.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Vt(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ip(e,t){if(e&&e.includes(ri.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ri.sep+"`")}function qp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Hv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function NL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CL=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),TL={}.hasOwnProperty;class Ng extends CL{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=pL()}copy(){const t=new Ng;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Hp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vp("data",this.frozen),this.namespace[t]=n,this):TL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Rc(t),r=this.parser||this.Parser;return $p("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$p("process",this.parser||this.Parser),Pp("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const f=Rc(t),d=r.parse(f);r.run(d,f,function(g,m,x){if(g||!m||!x)return h(g);const b=m,w=r.stringify(b,x);jL(w)?x.value=w:x.result=w,h(g,x)});function h(g,m){g||!m?u(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),$p("processSync",this.parser||this.Parser),Pp("processSync",this.compiler||this.Compiler),this.process(t,a),Iv("processSync","process",n),r;function a(l,u){n=!0,Lv(l),r=u}}run(t,n,r){Uv(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,f){const d=Rc(n);a.run(t,d,h);function h(g,m,x){const b=m||t;g?f(g):u?u(b):r(void 0,b,x)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),Iv("runSync","run",r),a;function l(u,f){Lv(u),a=f,r=!0}}stringify(t,n){this.freeze();const r=Rc(n),a=this.compiler||this.Compiler;return Pp("stringify",a),Uv(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vp("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;d(g,m)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(a.settings=Hp(!0,a.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,g){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===h){x=m;break}if(x===-1)r.push([h,...g]);else if(g.length>0){let[b,...w]=g;const k=r[x][1];Am(k)&&Am(b)&&(b=Hp(!0,k,b)),r[x]=[h,b,...w]}}}}const AL=new Ng().freeze();function $p(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Uv(e){if(!Am(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Iv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rc(e){return ML(e)?e:new w2(e)}function ML(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jL(e){return typeof e=="string"||RL(e)}function RL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qv=[],$v={allowDangerousHtml:!0},OL=/^(https?|ircs?|mailto|xmpp)$/i,DL=[{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 Pv(e){const t=LL(e),n=BL(e);return HL(t.runSync(t.parse(n),n),e)}function LL(e){const t=e.rehypePlugins||qv,n=e.remarkPlugins||qv,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$v}:$v;return AL().use(y6).use(n).use(fL,r).use(t)}function BL(e){const t=e.children||"",n=new w2;return typeof t=="string"&&(n.value=t),n}function HL(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,d=t.urlTransform||UL;for(const g of DL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+zL+g.id,void 0);return Eg(e,h),eO(e,{Fragment:v.Fragment,components:a,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function h(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 Op)if(Object.hasOwn(Op,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],k=Op[b];(k===null||k.includes(g.tagName))&&(g.properties[b]=d(String(w||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(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 UL(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||OL.test(e.slice(0,t))?e:""}function Vv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function IL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qL(e,t,n){const a=$f((n||{}).ignore||[]),l=$L(t);let u=-1;for(;++u<l.length;)v2(e,"text",f);function f(h,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(a(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return d(h,g)}function d(h,g){const m=g[g.length-1],x=l[u][0],b=l[u][1];let w=0;const N=m.children.indexOf(h);let _=!1,z=[];x.lastIndex=0;let E=x.exec(h.value);for(;E;){const C=E.index,L={index:E.index,input:E.input,stack:[...g,h]};let A=b(...E,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&z.push({type:"text",value:h.value.slice(w,C)}),Array.isArray(A)?z.push(...A):A&&z.push(A),w=C+E[0].length,_=!0),!x.global)break;E=x.exec(h.value)}return _?(w<h.value.length&&z.push({type:"text",value:h.value.slice(w)}),m.children.splice(N,1,...z)):z=[h],N+z.length}}function $L(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([PL(a[0]),VL(a[1])])}return t}function PL(e){return typeof e=="string"?new RegExp(IL(e),"g"):e}function VL(e){return typeof e=="function"?e:function(){return e}}const Fp="phrasing",Yp=["autolink","link","image","label"];function FL(){return{transforms:[JL],enter:{literalAutolink:XL,literalAutolinkEmail:Xp,literalAutolinkHttp:Xp,literalAutolinkWww:Xp},exit:{literalAutolink:KL,literalAutolinkEmail:QL,literalAutolinkHttp:GL,literalAutolinkWww:ZL}}}function YL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fp,notInConstruct:Yp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fp,notInConstruct:Yp},{character:":",before:"[ps]",after:"\\/",inConstruct:Fp,notInConstruct:Yp}]}}function XL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xp(e){this.config.enter.autolinkProtocol.call(this,e)}function GL(e){this.config.exit.autolinkProtocol.call(this,e)}function ZL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function QL(e){this.config.exit.autolinkEmail.call(this,e)}function KL(e){this.exit(e)}function JL(e){qL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,WL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),eB]],{ignore:["link","linkReference"]})}function WL(e,t,n,r,a){let l="";if(!S2(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!tB(n)))return!1;const u=nB(n+r);if(!u[0])return!1;const f={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function eB(e,t,n,r){return!S2(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function tB(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function nB(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Vv(e,"(");let l=Vv(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function S2(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fs(n)||Uf(n))&&(!t||n!==47)}_2.peek=fB;function iB(){this.buffer()}function rB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function sB(){this.buffer()}function aB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function oB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lB(e){this.exit(e)}function uB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cB(e){this.exit(e)}function fB(){return"["}function _2(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),f(),u(),l+=a.move("]"),l}function dB(){return{enter:{gfmFootnoteCallString:iB,gfmFootnoteCall:rB,gfmFootnoteDefinitionLabelString:sB,gfmFootnoteDefinition:aB},exit:{gfmFootnoteCallString:oB,gfmFootnoteCall:lB,gfmFootnoteDefinitionLabelString:uB,gfmFootnoteDefinition:cB}}}function hB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const f=l.createTracker(u);let d=f.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return d+=f.move(l.safe(l.associationId(r),{before:d,after:"]"})),g(),d+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),d+=f.move((t?`
|
|
136
|
-
`:" ")+l.indentLines(l.containerFlow(r,f.current()),t?k2:pB))),h(),d}}function pB(e,t,n){return t===0?e:k2(e,t,n)}function k2(e,t,n){return(n?"":" ")+e}const mB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];E2.peek=vB;function gB(){return{canContainEols:["delete"],enter:{strikethrough:xB},exit:{strikethrough:bB}}}function yB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mB}],handlers:{delete:E2}}}function xB(e){this.enter({type:"delete",children:[]},e)}function bB(e){this.exit(e)}function E2(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function vB(){return"~"}function wB(e){return e.length}function SB(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||wB,l=[],u=[],f=[],d=[];let h=0,g=-1;for(;++g<e.length;){const k=[],N=[];let _=-1;for(e[g].length>h&&(h=e[g].length);++_<e[g].length;){const z=_B(e[g][_]);if(n.alignDelimiters!==!1){const E=a(z);N[_]=E,(d[_]===void 0||E>d[_])&&(d[_]=E)}k.push(z)}u[g]=k,f[g]=N}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)l[m]=Fv(r[m]);else{const k=Fv(r);for(;++m<h;)l[m]=k}m=-1;const x=[],b=[];for(;++m<h;){const k=l[m];let N="",_="";k===99?(N=":",_=":"):k===108?N=":":k===114&&(_=":");let z=n.alignDelimiters===!1?1:Math.max(1,d[m]-N.length-_.length);const E=N+"-".repeat(z)+_;n.alignDelimiters!==!1&&(z=N.length+z+_.length,z>d[m]&&(d[m]=z),b[m]=z),x[m]=E}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const k=u[g],N=f[g];m=-1;const _=[];for(;++m<h;){const z=k[m]||"";let E="",C="";if(n.alignDelimiters!==!1){const L=d[m]-(N[m]||0),A=l[m];A===114?E=" ".repeat(L):A===99?L%2?(E=" ".repeat(L/2+.5),C=" ".repeat(L/2-.5)):(E=" ".repeat(L/2),C=E):C=" ".repeat(L)}n.delimiterStart!==!1&&!m&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&z==="")&&(n.delimiterStart!==!1||m)&&_.push(" "),n.alignDelimiters!==!1&&_.push(E),_.push(z),n.alignDelimiters!==!1&&_.push(C),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&_.push("|")}w.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return w.join(`
|
|
137
|
-
`)}function _B(e){return e==null?"":String(e)}function Fv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function kB(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),EB);return a(),u}function EB(e,t,n){return">"+(n?"":" ")+e}function NB(e,t){return Yv(e,t.inConstruct,!0)&&!Yv(e,t.notInConstruct,!1)}function Yv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Xv(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
138
|
-
`&&NB(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
139
|
-
`}function CB(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function TB(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function AB(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function MB(e,t,n,r){const a=AB(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(TB(e,n)){const m=n.enter("codeIndented"),x=n.indentLines(l,jB);return m(),x}const f=n.createTracker(r),d=a.repeat(Math.max(CB(l,a)+1,3)),h=n.enter("codeFenced");let g=f.move(d);if(e.lang){const m=n.enter(`codeFencedLang${u}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
|
|
140
|
-
`,encode:["`"],...f.current()})),m()}return g+=f.move(`
|
|
141
|
-
`),l&&(g+=f.move(l+`
|
|
142
|
-
`)),g+=f.move(d),h(),g}function jB(e,t,n){return(n?"":" ")+e}function Cg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function RB(e,t,n,r){const a=Cg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(f=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
143
|
-
`,...d.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=d.move(" "+a),h+=d.move(n.safe(e.title,{before:h,after:a,...d.current()})),h+=d.move(a),f()),u(),h}function zB(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function vl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hf(e,t,n){const r=Ea(e),a=Ea(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}N2.peek=OB;function N2(e,t,n,r){const a=zB(n),l=n.enter("emphasis"),u=n.createTracker(r),f=u.move(a);let d=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const h=d.charCodeAt(0),g=hf(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(d=vl(h)+d.slice(1));const m=d.charCodeAt(d.length-1),x=hf(r.after.charCodeAt(0),m,a);x.inside&&(d=d.slice(0,-1)+vl(m));const b=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+d+b}function OB(e,t,n){return n.options.emphasis||"*"}function DB(e,t){let n=!1;return Eg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Cm}),!!((!e.depth||e.depth<3)&&xg(e)&&(t.options.setext||n))}function LB(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(DB(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),x=n.containerPhrasing(e,{...l.current(),before:`
|
|
144
|
-
`,after:`
|
|
145
|
-
`});return m(),g(),x+`
|
|
146
|
-
`+(a===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
147
|
-
`))+1))}const u="#".repeat(a),f=n.enter("headingAtx"),d=n.enter("phrasing");l.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
148
|
-
`,...l.current()});return/^[\t ]/.test(h)&&(h=vl(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),d(),f(),h}C2.peek=BB;function C2(e){return e.value||""}function BB(){return"<"}T2.peek=HB;function T2(e,t,n,r){const a=Cg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(f=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=d.move(" "+a),h+=d.move(n.safe(e.title,{before:h,after:a,...d.current()})),h+=d.move(a),f()),h+=d.move(")"),u(),h}function HB(){return"!"}A2.peek=UB;function A2(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");const h=n.safe(e.alt,{before:d,after:"]",...f.current()});d+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!h||h!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function UB(){return"!"}M2.peek=IB;function M2(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],f=n.compilePattern(u);let d;if(u.atBreak)for(;d=f.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return a+r+a}function IB(){return"`"}function j2(e,t){const n=xg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}R2.peek=qB;function R2(e,t,n,r){const a=Cg(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let f,d;if(j2(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let m=u.move("<");return m+=u.move(n.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),f(),n.stack=g,m}f=n.enter("link"),d=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(d=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=u.move(" "+a),h+=u.move(n.safe(e.title,{before:h,after:a,...u.current()})),h+=u.move(a),d()),h+=u.move(")"),f(),h}function qB(e,t,n){return j2(e,n)?"<":"["}z2.peek=$B;function z2(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...f.current()});d+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!h||h!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function $B(){return"["}function Tg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function PB(e){const t=Tg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VB(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function O2(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function FB(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?VB(n):Tg(n);const f=e.ordered?u==="."?")":".":PB(n);let d=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),O2(n)===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"){d=!0;break}}}}d&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),h}function YB(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function XB(e,t,n,r){const a=YB(n);let l=n.bulletCurrent||Tg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(r);f.move(l+" ".repeat(u-l.length)),f.shift(u);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return d(),h;function g(m,x,b){return x?(b?"":" ".repeat(u))+m:(b?l:l+" ".repeat(u-l.length))+m}}function GB(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const ZB=$f(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function QB(e,t,n,r){return(e.children.some(function(u){return ZB(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function KB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}D2.peek=JB;function D2(e,t,n,r){const a=KB(n),l=n.enter("strong"),u=n.createTracker(r),f=u.move(a+a);let d=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const h=d.charCodeAt(0),g=hf(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(d=vl(h)+d.slice(1));const m=d.charCodeAt(d.length-1),x=hf(r.after.charCodeAt(0),m,a);x.inside&&(d=d.slice(0,-1)+vl(m));const b=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+d+b}function JB(e,t,n){return n.options.strong||"*"}function WB(e,t,n,r){return n.safe(e.value,r)}function e8(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function t8(e,t,n){const r=(O2(n)+(n.options.ruleSpaces?" ":"")).repeat(e8(n));return n.options.ruleSpaces?r.slice(0,-1):r}const L2={blockquote:kB,break:Xv,code:MB,definition:RB,emphasis:N2,hardBreak:Xv,heading:LB,html:C2,image:T2,imageReference:A2,inlineCode:M2,link:R2,linkReference:z2,list:FB,listItem:XB,paragraph:GB,root:QB,strong:D2,text:WB,thematicBreak:t8};function n8(){return{enter:{table:i8,tableData:Gv,tableHeader:Gv,tableRow:s8},exit:{codeText:a8,table:r8,tableData:Gp,tableHeader:Gp,tableRow:Gp}}}function i8(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function r8(e){this.exit(e),this.data.inTable=void 0}function s8(e){this.enter({type:"tableRow",children:[]},e)}function Gp(e){this.exit(e)}function Gv(e){this.enter({type:"tableCell",children:[]},e)}function a8(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,o8));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function o8(e,t){return t==="|"?t:e}function l8(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
149
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:d,tableRow:f}};function u(b,w,k,N){return h(g(b,k,N),b.align)}function f(b,w,k,N){const _=m(b,k,N),z=h([_]);return z.slice(0,z.indexOf(`
|
|
150
|
-
`))}function d(b,w,k,N){const _=k.enter("tableCell"),z=k.enter("phrasing"),E=k.containerPhrasing(b,{...N,before:l,after:l});return z(),_(),E}function h(b,w){return SB(b,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function g(b,w,k){const N=b.children;let _=-1;const z=[],E=w.enter("table");for(;++_<N.length;)z[_]=m(N[_],w,k);return E(),z}function m(b,w,k){const N=b.children;let _=-1;const z=[],E=w.enter("tableRow");for(;++_<N.length;)z[_]=d(N[_],b,w,k);return E(),z}function x(b,w,k){let N=L2.inlineCode(b,w,k);return k.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function u8(){return{exit:{taskListCheckValueChecked:Zv,taskListCheckValueUnchecked:Zv,paragraph:f8}}}function c8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:d8}}}function Zv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function f8(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const f=a[l];if(f.type==="paragraph"){u=f;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function d8(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(r);l&&f.move(u);let d=L2.listItem(e,t,n,{...r,...f.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(g){return g+u}}function h8(){return[FL(),dB(),gB(),n8(),u8()]}function p8(e){return{extensions:[YL(),hB(e),yB(),l8(e),c8()]}}const m8={tokenize:w8,partial:!0},B2={tokenize:S8,partial:!0},H2={tokenize:_8,partial:!0},U2={tokenize:k8,partial:!0},g8={tokenize:E8,partial:!0},I2={name:"wwwAutolink",tokenize:b8,previous:$2},q2={name:"protocolAutolink",tokenize:v8,previous:P2},Fi={name:"emailAutolink",tokenize:x8,previous:V2},hi={};function y8(){return{text:hi}}let ts=48;for(;ts<123;)hi[ts]=Fi,ts++,ts===58?ts=65:ts===91&&(ts=97);hi[43]=Fi;hi[45]=Fi;hi[46]=Fi;hi[95]=Fi;hi[72]=[Fi,q2];hi[104]=[Fi,q2];hi[87]=[Fi,I2];hi[119]=[Fi,I2];function x8(e,t,n){const r=this;let a,l;return u;function u(m){return!jm(m)||!V2.call(r,r.previous)||Ag(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return jm(m)?(e.consume(m),f):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(g8,g,h)(m):m===45||m===95||$t(m)?(l=!0,e.consume(m),d):g(m)}function h(m){return e.consume(m),a=!0,d}function g(m){return l&&a&&Zt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function b8(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!$2.call(r,r.previous)||Ag(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(m8,e.attempt(B2,e.attempt(H2,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function v8(e,t,n){const r=this;let a="",l=!1;return u;function u(m){return(m===72||m===104)&&P2.call(r,r.previous)&&!Ag(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),f):n(m)}function f(m){if(Zt(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=a.toLowerCase();if(x==="http"||x==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),l?h:(l=!0,d)):n(m)}function h(m){return m===null||cf(m)||st(m)||fs(m)||Uf(m)?n(m):e.attempt(B2,e.attempt(H2,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function w8(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function S8(e,t,n){let r,a,l;return u;function u(h){return h===46||h===95?e.check(U2,d,f)(h):h===null||st(h)||fs(h)||h!==45&&Uf(h)?d(h):(l=!0,e.consume(h),u)}function f(h){return h===95?r=!0:(a=r,r=void 0),e.consume(h),u}function d(h){return a||r||!l?n(h):t(h)}}function _8(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(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(U2,t,l)(u):u===null||st(u)||fs(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function k8(e,t,n){return r;function r(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),r):f===38?(e.consume(f),l):f===93?(e.consume(f),a):f===60||f===null||st(f)||fs(f)?t(f):n(f)}function a(f){return f===null||f===40||f===91||st(f)||fs(f)?t(f):r(f)}function l(f){return Zt(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),r):Zt(f)?(e.consume(f),u):n(f)}}function E8(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return $t(l)?n(l):t(l)}}function $2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function P2(e){return!Zt(e)}function V2(e){return!(e===47||jm(e))}function jm(e){return e===43||e===45||e===46||e===95||$t(e)}function Ag(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const N8={tokenize:O8,partial:!0};function C8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:j8,continuation:{tokenize:R8},exit:z8}},text:{91:{name:"gfmFootnoteCall",tokenize:M8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:T8,resolveTo:A8}}}}function T8(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const d=r.events[a][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return f;function f(d){if(!u||!u._balanced)return n(d);const h=Zn(r.sliceSerialize({start:u.end,end:r.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function A8(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},f=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...f),e}function M8(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(l>999||m===93&&!u||m===null||m===91||st(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return a.includes(Zn(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return st(m)||(u=!0),l++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function j8(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,f;return d;function d(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||st(w))return n(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=Zn(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return st(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"),a.includes(l)||a.push(l),Fe(e,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return t(w)}}function R8(e,t,n){return e.check(zl,t,e.attempt(N8,t,n))}function z8(e){e.exit("gfmFootnoteDefinition")}function O8(e,t,n){const r=this;return Fe(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function D8(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,f){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let h=d;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[d][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[d][1].end)},m={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[d][1].start)},x=[["enter",g,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&_n(x,x.length,0,If(b,u.slice(h+1,d),f)),_n(x,x.length,0,[["exit",m,f],["enter",u[d][1],f],["exit",u[d][1],f],["exit",g,f]]),_n(u,h-1,d-h+3,x),d=h+x.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function l(u,f,d){const h=this.previous,g=this.events;let m=0;return x;function x(w){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const k=Ea(h);if(w===126)return m>1?d(w):(u.consume(w),m++,b);if(m<2&&!n)return d(w);const N=u.exit("strikethroughSequenceTemporary"),_=Ea(w);return N._open=!_||_===2&&!!k,N._close=!k||k===2&&!!_,f(w)}}}class L8{constructor(){this.map=[]}add(t,n,r){B8(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function B8(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function H8(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function U8(){return{flow:{null:{name:"table",tokenize:I8,resolveAll:q8}}}}function I8(e,t,n){const r=this;let a=0,l=0,u;return f;function f(H){let $=r.events.length-1;for(;$>-1;){const D=r.events[$][1].type;if(D==="lineEnding"||D==="linePrefix")$--;else break}const P=$>-1?r.events[$][1].type:null,te=P==="tableHead"||P==="tableRow"?A:d;return te===A&&r.parser.lazy[r.now().line]?n(H):te(H)}function d(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(u=!0,l+=1),g(H)}function g(H){return H===null?n(H):Se(H)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),b):n(H):He(H)?Fe(e,g,"whitespace")(H):(l+=1,u&&(u=!1,a+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(H)))}function m(H){return H===null||H===124||st(H)?(e.exit("data"),g(H)):(e.consume(H),H===92?x:m)}function x(H){return H===92||H===124?(e.consume(H),m):m(H)}function b(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,He(H)?Fe(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):w(H))}function w(H){return H===45||H===58?N(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),k):L(H)}function k(H){return He(H)?Fe(e,N,"whitespace")(H):N(H)}function N(H){return H===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),_):H===45?(l+=1,_(H)):H===null||Se(H)?C(H):L(H)}function _(H){return H===45?(e.enter("tableDelimiterFiller"),z(H)):L(H)}function z(H){return H===45?(e.consume(H),z):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(H))}function E(H){return He(H)?Fe(e,C,"whitespace")(H):C(H)}function C(H){return H===124?w(H):H===null||Se(H)?!u||a!==l?L(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):L(H)}function L(H){return n(H)}function A(H){return e.enter("tableRow"),B(H)}function B(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),B):H===null||Se(H)?(e.exit("tableRow"),t(H)):He(H)?Fe(e,B,"whitespace")(H):(e.enter("data"),G(H))}function G(H){return H===null||H===124||st(H)?(e.exit("data"),B(H)):(e.consume(H),H===92?Z:G)}function Z(H){return H===92||H===124?(e.consume(H),G):G(H)}}function q8(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],f=!1,d=0,h,g,m;const x=new L8;for(;++n<e.length;){const b=e[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,d!==0&&(Qv(x,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",h,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,m=void 0,l=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",g,t]])),a=w.type==="tableDelimiterRow"?2:g?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],m=zc(x,t,l,a,void 0,m),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],m=zc(x,t,l,a,void 0,m)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(f=!0,d=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(d=n,l[1]!==0?(u[0]=u[1],m=zc(x,t,l,a,n,m)):u[1]!==0&&(m=zc(x,t,u,a,n,m)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&Qv(x,t,d,h,g),x.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=H8(t.events,n))}return e}function zc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(l.end=Object.assign({},oa(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=oa(t.events,n[1]);if(l={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=oa(t.events,n[2]),g=oa(t.events,n[3]),m={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const x=t.events[n[2]],b=t.events[n[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,k=n[3]-n[2]-1;e.add(w,k,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},oa(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function Qv(e,t,n,r,a){const l=[],u=oa(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function oa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $8={name:"tasklistCheck",tokenize:V8};function P8(){return{text:{91:$8}}}function V8(e,t,n){const r=this;return a;function a(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return st(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(d)}function f(d){return Se(d)?t(d):He(d)?e.check({tokenize:F8},t,n)(d):n(d)}}function F8(e,t,n){return Fe(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Y8(e){return t2([y8(),C8(),D8(e),U8(),P8()])}const X8={};function Kv(e){const t=this,n=e||X8,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Y8(n)),l.push(h8()),u.push(p8(n))}function G8(){const{isRunning:e,results:t,workflowResults:n,logs:r}=Na(),{nodes:a,selectedNodeId:l,updateNode:u}=ci(),f=ci(WS),{execute:d,generatedFiles:h,downloadFile:g,downloadAllFiles:m}=D_(),[x,b]=X.useState("");X.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[l,f]);const w=a.filter(C=>C.type==="output"),k=w.length>0?t.get(w[0].id):null,N=f?.type==="input",_=N?f.data:null,z=C=>{b(C),l&&u(l,{value:C})},E=()=>{d()};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(ZS,{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:a.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:E,disabled:e||a.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(yl,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),a.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Af,{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=>z(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(zj,{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=>z(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),h.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(da,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:h.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(ha,{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(da,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),n.length>0?v.jsx("div",{className:"space-y-4",children:n.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(Tf,{className:"w-5 h-5 text-green-500"}):v.jsx(ig,{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(QS,{className:"w-4 h-4 text-purple-400"}):v.jsx(ha,{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(Pv,{remarkPlugins:[Kv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):k?v.jsx("div",{className:"markdown-content",children:v.jsx(Pv,{remarkPlugins:[Kv],children:typeof k=="string"?k:JSON.stringify(k,null,2)})}):r.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),r.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(ha,{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 버튼을 클릭하세요"})]})]}),(k||h.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:h.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(da,{className:"w-4 h-4"}),"Download .md"]})})]})}function F2({level:e}){switch(e){case"success":return v.jsx(Tf,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(ig,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(jj,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(rj,{className:"w-4 h-4 text-blue-400"})}}function Y2(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Z8({isOpen:e,onClose:t}){const{logs:n,clearLogs:r,isRunning:a}=Na(),[l,u]=X.useState(!1),[f,d]=X.useState(250),h=X.useRef(null);X.useEffect(()=>{h.current&&!l&&h.current.scrollIntoView({behavior:"smooth"})},[n,l]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const _=x-N.clientY,z=Math.min(Math.max(b+_,100),500);d(z)},k=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",k)};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:l?40:f},children:[!l&&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(ds,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),a&&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:["(",n.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:r,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(Mf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!l),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:l?"Expand":"Minimize",children:l?v.jsx(I5,{className:"w-4 h-4 text-gray-400"}):v.jsx(GS,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>d(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(pj,{className:"w-4 h-4 text-gray-400"}):v.jsx(fj,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:t,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(rg,{className:"w-4 h-4 text-gray-400"})})]})]}),!l&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:n.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:[n.map(m=>v.jsxs("div",{className:Gt("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:["[",Y2(m.timestamp),"]"]}),v.jsx(F2,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Gt("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:h})]})})]}):null}function Q8(){const{logs:e,clearLogs:t,isRunning:n}=Na(),r=X.useRef(null);return X.useEffect(()=>{r.current&&r.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(ds,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),n&&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:t,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(Mf,{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(a=>v.jsxs("div",{className:Gt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",a.level==="error"&&"bg-red-500/10",a.level==="warning"&&"bg-yellow-500/10",a.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",Y2(a.timestamp),"]"]}),v.jsx(F2,{level:a.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Gt("text-xs",a.level==="error"&&"text-red-400",a.level==="warning"&&"text-yellow-400",a.level==="success"&&"text-green-400",a.level==="info"&&"text-gray-300"),children:a.message}),a.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",a.nodeId.slice(0,8),"]"]}),a.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof a.details=="string"?a.details:JSON.stringify(a.details,null,2)})]})]},a.id)),v.jsx("div",{ref:r})]})})]})}const K8=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],J8=[{id:"image-gen-nanobanana",name:"Image Generator",description:"Google Gemini API를 사용한 AI 이미지 생성",keywords:["이미지","image","그림","사진","picture","illustration","graphic"]},{id:"ppt-generator",name:"PPT Generator",description:"한국어에 최적화된 미니멀 프레젠테이션 생성",keywords:["ppt","발표","presentation","slides","powerpoint","슬라이드"]},{id:"video-gen-veo3",name:"Video Generator",description:"Google Veo3 API를 사용한 AI 영상 생성",keywords:["영상","video","동영상","animation","애니메이션"]},{id:"pdf",name:"PDF",description:"PDF 텍스트 추출, 생성, 병합/분할, 폼 처리",keywords:["pdf","문서","document"]},{id:"docx",name:"Word Document",description:"Word 문서 생성, 편집, 변경 추적, 주석",keywords:["워드","docx","word","한글","문서"]},{id:"xlsx",name:"Excel",description:"스프레드시트 생성, 편집, 수식, 데이터 분석",keywords:["엑셀","xlsx","excel","스프레드시트","spreadsheet","표"]},{id:"pptx",name:"PowerPoint",description:"PPT 생성, 편집, 레이아웃, 스피커 노트",keywords:["pptx","powerpoint","presentation"]},{id:"git-commit-push",name:"Git Commit/Push",description:"Git 변경사항 분석, 커밋 메시지 작성, 푸시/PR 생성",keywords:["git","commit","push","pr","pull request","커밋","푸시"]}],W8=[{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 e9(e){switch(e){case"input":return v.jsx(Af,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(Tl,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(jf,{className:"w-5 h-5 text-cyan-400"});case"command":return v.jsx(ds,{className:"w-5 h-5 text-orange-400"});case"hook":return v.jsx(ng,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(Cf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function t9(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"command":return"Command";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function n9({node:e}){const{updateNode:t,removeNode:n}=ci(),r=X.useRef(null),a=X.useCallback(d=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{U_(d).catch(h=>{console.error("Failed to sync node to filesystem:",h)})},500)},[]);if(X.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&a(e),()=>{r.current&&clearTimeout(r.current)}),[e,a]),!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(Ej,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const l=()=>{I_(e).catch(d=>{console.error("Failed to delete node from filesystem:",d)}),n(e.id)},u=d=>{t(e.id,{label:d})},f=d=>{t(e.id,{description:d})};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:e9(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:t9(e.type)})]})]}),v.jsx("button",{onClick:l,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(Mf,{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:d=>u(d.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:d=>f(d.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(i9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="subagent"&&v.jsx(r9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="skill"&&v.jsx(s9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="command"&&v.jsx(a9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="hook"&&v.jsx(o9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="output"&&v.jsx(l9,{onUpdate:d=>t(e.id,d)})]})]})}function i9({data:e,onUpdate:t}){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(n=>v.jsx("button",{onClick:()=>t({inputType:n}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===n?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}),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:n=>t({value:n.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 r9({data:e,onUpdate:t}){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:W8.map(n=>v.jsxs("button",{onClick:()=>t({model:n.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===n.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(Tl,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:n.name}),v.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.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:K8.map(n=>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(n)??!1,onChange:r=>{const a=r.target.checked?[...e.tools||[],n]:(e.tools||[]).filter(l=>l!==n);t({tools:a})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:"text-sm text-gray-300",children:n})]},n))})]}),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:n=>t({systemPrompt:n.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 s9({data:e,onUpdate:t}){const[n,r]=X.useState([]),[a,l]=X.useState(!1),[u,f]=X.useState(null),[d,h]=X.useState(""),[g,m]=X.useState(!1),[x,b]=X.useState(null);X.useEffect(()=>{e.skillType==="generated"&&e.skillPath&&(l(!0),fetch(`/api/skill/files?path=${encodeURIComponent(e.skillPath)}`).then(k=>k.json()).then(k=>{r(k.files||[]),k.files?.length>0&&f(k.files[0].name)}).catch(k=>{console.error("Failed to load skill files:",k)}).finally(()=>l(!1)))},[e.skillPath,e.skillType]);const w=async()=>{if(e.skillPath){m(!0),b(null);try{const k=d.trim()?d.trim().split(/\s+/):[],_=await(await fetch("/api/skill/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillPath:e.skillPath,args:k})})).json();b(_)}catch(k){b({success:!1,error:k instanceof Error?k.message:"Unknown error"})}finally{m(!1)}}};return e.skillType==="generated"&&e.skillPath?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 Path"}),v.jsx("div",{className:"px-3 py-2 bg-surface border border-border rounded-lg text-gray-400 text-sm font-mono break-all",children:e.skillPath})]}),v.jsxs("div",{children:[v.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[v.jsx(K5,{className:"w-4 h-4 inline mr-1"}),"Files Preview"]}),a?v.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-500",children:[v.jsx(af,{className:"w-5 h-5 animate-spin mr-2"}),"파일 로딩 중..."]}):n.length===0?v.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"파일을 찾을 수 없습니다"}):v.jsx("div",{className:"space-y-2",children:n.map(k=>v.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[v.jsxs("button",{onClick:()=>f(u===k.name?null:k.name),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-hover hover:bg-border transition-colors",children:[v.jsx("span",{className:"text-sm text-white font-medium",children:k.name}),u===k.name?v.jsx(GS,{className:"w-4 h-4 text-gray-400"}):v.jsx(H5,{className:"w-4 h-4 text-gray-400"})]}),u===k.name&&v.jsx("pre",{className:"p-3 bg-[#0d1117] text-xs text-gray-300 overflow-x-auto max-h-64 overflow-y-auto font-mono",children:k.content})]},k.name))})]}),v.jsxs("div",{children:[v.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[v.jsx(yl,{className:"w-4 h-4 inline mr-1"}),"Test Skill"]}),v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{children:v.jsx("input",{type:"text",value:d,onChange:k=>h(k.target.value),placeholder:"Arguments (optional, space-separated)",className:"w-full px-3 py-2 bg-surface border border-border rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-accent"})}),v.jsx("button",{onClick:w,disabled:g,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg font-medium transition-colors ${g?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-cyan-600 hover:bg-cyan-700 text-white"}`,children:g?v.jsxs(v.Fragment,{children:[v.jsx(af,{className:"w-4 h-4 animate-spin"}),"실행 중..."]}):v.jsxs(v.Fragment,{children:[v.jsx(yl,{className:"w-4 h-4"}),"테스트 실행"]})}),x&&v.jsxs("div",{className:`p-3 rounded-lg border ${x.success?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.success?v.jsx(Tf,{className:"w-4 h-4 text-green-400"}):v.jsx(ig,{className:"w-4 h-4 text-red-400"}),v.jsxs("span",{className:`text-sm font-medium ${x.success?"text-green-400":"text-red-400"}`,children:[x.success?"성공":"실패",x.exitCode!==void 0&&` (exit code: ${x.exitCode})`]})]}),x.stdout&&v.jsxs("div",{className:"mb-2",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),v.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-gray-300 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:x.stdout})]}),x.stderr&&v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Error:"}),v.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-red-400 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:x.stderr})]}),x.error&&v.jsx("div",{className:"text-sm text-red-400",children:x.error})]})]})]})]}):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(k=>v.jsx("button",{onClick:()=>t({skillType:k}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===k?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:k.charAt(0).toUpperCase()+k.slice(1)},k))})]}),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:J8.map(k=>v.jsxs("button",{onClick:()=>t({skillId:k.id,description:k.description}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===k.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(jf,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:k.name}),v.jsx("div",{className:"text-xs text-gray-500",children:k.description})]})]},k.id))})]})]})}function a9({data:e,onUpdate:t}){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:"Command Name"}),v.jsx("input",{type:"text",value:e.commandName||"",onChange:n=>t({commandName:n.target.value}),placeholder:"e.g., commit, review-pr",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Slash command to execute (without /)"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Path (optional)"}),v.jsx("input",{type:"text",value:e.commandPath||"",onChange:n=>t({commandPath:n.target.value}),placeholder:"e.g., .claude/commands/my-command.md",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 o9({data:e,onUpdate:t}){const n=["PreToolUse","PostToolUse","Notification","Stop"];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:"Hook Event"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:n.map(r=>v.jsx("button",{onClick:()=>t({hookEvent:r}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===r?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:r},r))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),v.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:r=>t({hookMatcher:r.target.value}),placeholder:"e.g., Bash, Write, Edit",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),v.jsx("input",{type:"text",value:e.hookCommand||"",onChange:r=>t({hookCommand:r.target.value}),placeholder:"e.g., npm run lint",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function l9({onUpdate:e}){const t=[{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:t.map(n=>v.jsxs("button",{onClick:()=>e({layoutType:n.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(Cf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:n.name}),v.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.id))})]})}const u9=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function c9(){const{activeTab:e,setActiveTab:t}=Hf(),n=ci(WS);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:u9.map(r=>v.jsx("button",{onClick:()=>t(r.id),className:Gt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===r.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:r.label},r.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(G8,{}),e==="console"&&v.jsx(Q8,{}),e==="step"&&v.jsx(n9,{node:n}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function f9(e){let t;const{apiMode:n,apiKey:r,proxyUrl:a}=fg.getState(),l={"Content-Type":"application/json","X-API-Mode":n};n==="direct"&&r?l["X-API-Key"]=r:n==="proxy"&&a&&(l["X-Proxy-URL"]=a);try{t=await fetch("/api/generate/workflow",{method:"POST",headers:l,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!t.ok){let d=`서버 오류 (${t.status})`;try{d=(await t.json()).message||d}catch{}throw new Error(d)}let u;try{u=await t.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:h9(u),workflowName:u.workflowName}}function d9(e,t){if(e.length===0)return e;const n=300,r=150,a=100,l=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),t.forEach(w=>{const k=u.get(w.target)||[];k.push(w.source),u.set(w.target,k);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const d=e.filter(w=>(u.get(w.id)||[]).length===0),h=new Map,g=[];for(d.forEach(w=>{h.set(w.id,0),g.push({id:w.id,depth:0})}),d.length===0&&e.length>0&&(h.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const _=h.get(N),z=w.depth+1;(_===void 0||z>_)&&(h.set(N,z),g.push({id:N,depth:z}))})}const m=new Map;h.forEach((w,k)=>{const N=m.get(w)||[];N.push(k),m.set(w,N)});const x=Math.max(...Array.from(h.values()),0),b=new Map;for(let w=0;w<=x;w++){const k=m.get(w)||[],_=(k.length-1)*r,z=l+(300-_)/2;k.forEach((E,C)=>{b.set(E,{x:a+w*n,y:z+C*r})})}return e.map(w=>{const k=b.get(w.id)||w.position;return{...w,position:k}})}function h9(e){const t=[],n=new Map,r={x:0,y:0};e.nodes.forEach((u,f)=>{const d=ka();n.set(f,d);const h={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":t.push({id:d,type:"input",position:{...r},data:{...h,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":t.push({id:d,type:"subagent",position:{...r},data:{...h,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":t.push({id:d,type:"skill",position:{...r},data:{...h,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"command":t.push({id:d,type:"command",position:{...r},data:{...h,commandName:u.config.commandName||u.label,commandPath:u.config.commandPath}});break;case"hook":t.push({id:d,type:"hook",position:{...r},data:{...h,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});break;case"output":t.push({id:d,type:"output",position:{...r},data:{...h,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=n.get(u.to),d=n.get(u.from);if(f&&d){const h=t.find(g=>g.id===f);h&&h.data.usedInputs&&h.data.usedInputs.push(d)}});const a=e.edges.map(u=>{const f=n.get(u.from),d=n.get(u.to);return!f||!d?null:{id:`e-${f}-${d}`,source:f,target:d,animated:!0}}).filter(u=>u!==null);return{nodes:d9(t,a),edges:a}}function p9(e){const t=e.toLowerCase();if(t.includes("스킬")||t.includes("skill"))return!0;const n=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const r of n)if(r.test(e))return!0;return!1}const fi=Object.create(null);fi.open="0";fi.close="1";fi.ping="2";fi.pong="3";fi.message="4";fi.upgrade="5";fi.noop="6";const Vc=Object.create(null);Object.keys(fi).forEach(e=>{Vc[fi[e]]=e});const Rm={type:"error",data:"parser error"},X2=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",G2=typeof ArrayBuffer=="function",Z2=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Mg=({type:e,data:t},n,r)=>X2&&t instanceof Blob?n?r(t):Jv(t,r):G2&&(t instanceof ArrayBuffer||Z2(t))?n?r(t):Jv(new Blob([t]),r):r(fi[e]+(t||"")),Jv=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Wv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Zp;function m9(e,t){if(X2&&e.data instanceof Blob)return e.data.arrayBuffer().then(Wv).then(t);if(G2&&(e.data instanceof ArrayBuffer||Z2(e.data)))return t(Wv(e.data));Mg(e,!1,n=>{Zp||(Zp=new TextEncoder),t(Zp.encode(n))})}const ew="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ew.length;e++)nl[ew.charCodeAt(e)]=e;const g9=e=>{let t=e.length*.75,n=e.length,r,a=0,l,u,f,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const h=new ArrayBuffer(t),g=new Uint8Array(h);for(r=0;r<n;r+=4)l=nl[e.charCodeAt(r)],u=nl[e.charCodeAt(r+1)],f=nl[e.charCodeAt(r+2)],d=nl[e.charCodeAt(r+3)],g[a++]=l<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|d&63;return h},y9=typeof ArrayBuffer=="function",jg=(e,t)=>{if(typeof e!="string")return{type:"message",data:Q2(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:x9(e.substring(1),t)}:Vc[n]?e.length>1?{type:Vc[n],data:e.substring(1)}:{type:Vc[n]}:Rm},x9=(e,t)=>{if(y9){const n=g9(e);return Q2(n,t)}else return{base64:!0,data:e}},Q2=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,K2="",b9=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((l,u)=>{Mg(l,!1,f=>{r[u]=f,++a===n&&t(r.join(K2))})})},v9=(e,t)=>{const n=e.split(K2),r=[];for(let a=0;a<n.length;a++){const l=jg(n[a],t);if(r.push(l),l.type==="error")break}return r};function w9(){return new TransformStream({transform(e,t){m9(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const l=new DataView(a.buffer);l.setUint8(0,126),l.setUint16(1,r)}else{a=new Uint8Array(9);const l=new DataView(a.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let Qp;function Oc(e){return e.reduce((t,n)=>t+n.length,0)}function Dc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function S9(e,t){Qp||(Qp=new TextDecoder);const n=[];let r=0,a=-1,l=!1;return new TransformStream({transform(u,f){for(n.push(u);;){if(r===0){if(Oc(n)<1)break;const d=Dc(n,1);l=(d[0]&128)===128,a=d[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(Oc(n)<2)break;const d=Dc(n,2);a=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(Oc(n)<8)break;const d=Dc(n,8),h=new DataView(d.buffer,d.byteOffset,d.length),g=h.getUint32(0);if(g>Math.pow(2,21)-1){f.enqueue(Rm);break}a=g*Math.pow(2,32)+h.getUint32(4),r=3}else{if(Oc(n)<a)break;const d=Dc(n,a);f.enqueue(jg(l?d:Qp.decode(d),t)),r=0}if(a===0||a>e){f.enqueue(Rm);break}}}})}const J2=4;function kt(e){if(e)return _9(e)}function _9(e){for(var t in kt.prototype)e[t]=kt.prototype[t];return e}kt.prototype.on=kt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};kt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};kt.prototype.off=kt.prototype.removeListener=kt.prototype.removeAllListeners=kt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};kt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};kt.prototype.emitReserved=kt.prototype.emit;kt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};kt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ln=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),k9="arraybuffer";function W2(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const E9=Ln.setTimeout,N9=Ln.clearTimeout;function Ff(e,t){t.useNativeTimers?(e.setTimeoutFn=E9.bind(Ln),e.clearTimeoutFn=N9.bind(Ln)):(e.setTimeoutFn=Ln.setTimeout.bind(Ln),e.clearTimeoutFn=Ln.clearTimeout.bind(Ln))}const C9=1.33;function T9(e){return typeof e=="string"?A9(e):Math.ceil((e.byteLength||e.size)*C9)}function A9(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ek(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function M9(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function j9(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let l=n[r].split("=");t[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return t}class R9 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Rg extends kt{constructor(t){super(),this.writable=!1,Ff(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new R9(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=jg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=M9(t);return n.length?"?"+n:""}}class z9 extends Rg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};v9(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,b9(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ek()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let tk=!1;try{tk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const O9=tk;function D9(){}class L9 extends z9{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,l)=>{this.onError("xhr post error",a,l)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class li extends kt{constructor(t,n,r){super(),this.createRequest=t,Ff(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=W2(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=li.requestsCount++,li.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=D9,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete li.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}li.requestsCount=0;li.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",tw);else if(typeof addEventListener=="function"){const e="onpagehide"in Ln?"pagehide":"unload";addEventListener(e,tw,!1)}}function tw(){for(let e in li.requests)li.requests.hasOwnProperty(e)&&li.requests[e].abort()}const B9=(function(){const e=nk({xdomain:!1});return e&&e.responseType!==null})();class H9 extends L9{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=B9&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new li(nk,this.uri(),t)}}function nk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||O9))return new XMLHttpRequest}catch{}if(!t)try{return new Ln[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ik=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class U9 extends Rg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=ik?{}:W2(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;Mg(r,this.supportsBinary,l=>{try{this.doWrite(r,l)}catch{}a&&Vf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ek()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Kp=Ln.WebSocket||Ln.MozWebSocket;class I9 extends U9{createSocket(t,n,r){return ik?new Kp(t,n,r):n?new Kp(t,n):new Kp(t)}doWrite(t,n){this.ws.send(n)}}class q9 extends Rg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=S9(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=w9();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const l=()=>{r.read().then(({done:f,value:d})=>{f||(this.onPacket(d),l())}).catch(f=>{})};l();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&Vf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const $9={websocket:I9,webtransport:q9,polling:H9},P9=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V9=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zm(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=P9.exec(e||""),l={},u=14;for(;u--;)l[V9[u]]=a[u]||"";return n!=-1&&r!=-1&&(l.source=t,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=F9(l,l.path),l.queryKey=Y9(l,l.query),l}function F9(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Y9(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,l){a&&(n[a]=l)}),n}const Om=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fc=[];Om&&addEventListener("offline",()=>{Fc.forEach(e=>e())},!1);class Ar extends kt{constructor(t,n){if(super(),this.binaryType=k9,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=zm(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=zm(n.host).host);Ff(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=j9(this.opts.query)),Om&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=J2,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ar.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ar.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=T9(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const l={type:t,data:n,options:r};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ar.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Om&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fc.indexOf(this._offlineEventListener);r!==-1&&Fc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ar.protocol=J2;class X9 extends Ar{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ar.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!r)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ar.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(g(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function l(){r||(r=!0,g(),n.close(),n=null)}const u=m=>{const x=new Error("probe error: "+m);x.transport=n.name,l(),this.emitReserved("upgradeError",x)};function f(){u("transport closed")}function d(){u("socket closed")}function h(m){n&&m.name!==n.name&&l()}const g=()=>{n.removeListener("open",a),n.removeListener("error",u),n.removeListener("close",f),this.off("close",d),this.off("upgrading",h)};n.once("open",a),n.once("error",u),n.once("close",f),this.once("close",d),this.once("upgrading",h),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let G9=class extends X9{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>$9[a]).filter(a=>!!a)),super(t,r)}};function Z9(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=zm(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const l=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+l+":"+r.port+t,r.href=r.protocol+"://"+l+(n&&n.port===r.port?"":":"+r.port),r}const Q9=typeof ArrayBuffer=="function",K9=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,rk=Object.prototype.toString,J9=typeof Blob=="function"||typeof Blob<"u"&&rk.call(Blob)==="[object BlobConstructor]",W9=typeof File=="function"||typeof File<"u"&&rk.call(File)==="[object FileConstructor]";function zg(e){return Q9&&(e instanceof ArrayBuffer||K9(e))||J9&&e instanceof Blob||W9&&e instanceof File}function Yc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yc(e[n]))return!0;return!1}if(zg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yc(e[n]))return!0;return!1}function eH(e){const t=[],n=e.data,r=e;return r.data=Dm(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Dm(e,t){if(!e)return e;if(zg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Dm(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Dm(e[r],t));return n}return e}function tH(e,t){return e.data=Lm(e.data,t),delete e.attachments,e}function Lm(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Lm(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Lm(e[n],t));return e}const nH=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var $e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})($e||($e={}));class iH{constructor(t){this.replacer=t}encode(t){return(t.type===$e.EVENT||t.type===$e.ACK)&&Yc(t)?this.encodeAsBinary({type:t.type===$e.EVENT?$e.BINARY_EVENT:$e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===$e.BINARY_EVENT||t.type===$e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=eH(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}class Og extends kt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===$e.BINARY_EVENT;r||n.type===$e.BINARY_ACK?(n.type=r?$e.EVENT:$e.ACK,this.reconstructor=new rH(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(zg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if($e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===$e.BINARY_EVENT||r.type===$e.BINARY_ACK){const l=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const u=t.substring(l,n);if(u!=Number(u)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(u)}if(t.charAt(n+1)==="/"){const l=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(l,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const l=n+1;for(;++n;){const u=t.charAt(n);if(u==null||Number(u)!=u){--n;break}if(n===t.length)break}r.id=Number(t.substring(l,n+1))}if(t.charAt(++n)){const l=this.tryParse(t.substr(n));if(Og.isPayloadValid(r.type,l))r.data=l;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case $e.CONNECT:return nw(n);case $e.DISCONNECT:return n===void 0;case $e.CONNECT_ERROR:return typeof n=="string"||nw(n);case $e.EVENT:case $e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&nH.indexOf(n[0])===-1);case $e.ACK:case $e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rH{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=tH(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function nw(e){return Object.prototype.toString.call(e)==="[object Object]"}const sH=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Og,Encoder:iH,get PacketType(){return $e}},Symbol.toStringTag,{value:"Module"}));function Vn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const aH=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class sk extends kt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Vn(t,"open",this.onopen.bind(this)),Vn(t,"packet",this.onpacket.bind(this)),Vn(t,"error",this.onerror.bind(this)),Vn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,l;if(aH.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const u={type:$e.EVENT,data:n};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const g=this.ids++,m=n.pop();this._registerAckCallback(g,m),u.id=g}const f=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,d=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!f||(d?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===t&&this.sendBuffer.splice(f,1);n.call(this,new Error("operation has timed out"))},a),u=(...f)=>{this.io.clearTimeoutFn(l),n.apply(this,f)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...n){return new Promise((r,a)=>{const l=(u,f)=>u?a(u):r(f);l.withError=!0,n.push(l),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...l)=>(this._queue[0],a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...l)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:$e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case $e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case $e.EVENT:case $e.BINARY_EVENT:this.onevent(t);break;case $e.ACK:case $e.BINARY_ACK:this.onack(t);break;case $e.DISCONNECT:this.ondisconnect();break;case $e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:$e.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:$e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ra(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ra.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Ra.prototype.reset=function(){this.attempts=0};Ra.prototype.setMin=function(e){this.ms=e};Ra.prototype.setMax=function(e){this.max=e};Ra.prototype.setJitter=function(e){this.jitter=e};class Bm extends kt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ff(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ra({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||sH;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new G9(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Vn(n,"open",function(){r.onopen(),t&&t()}),l=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),t?t(f):this.maybeReconnectOnOpen()},u=Vn(n,"error",l);if(this._timeout!==!1){const f=this._timeout,d=this.setTimeoutFn(()=>{a(),l(new Error("timeout")),n.close()},f);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(a),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Vn(t,"ping",this.onping.bind(this)),Vn(t,"data",this.ondata.bind(this)),Vn(t,"error",this.onerror.bind(this)),Vn(t,"close",this.onclose.bind(this)),Vn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Vf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new sk(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Qo={};function Xc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Z9(e,t.path||"/socket.io"),r=n.source,a=n.id,l=n.path,u=Qo[a]&&l in Qo[a].nsps,f=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let d;return f?d=new Bm(r,t):(Qo[a]||(Qo[a]=new Bm(r,t)),d=Qo[a]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Xc,{Manager:Bm,Socket:sk,io:Xc,connect:Xc});const iw=window.location.origin;class oH{socket;constructor(){this.socket=Xc(iw,{autoConnect:!0,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("[Socket] Connected to server:",iw)}),this.socket.on("disconnect",()=>{console.log("Disconnected from server")}),this.socket.on("connect_error",t=>{console.error("Socket connection error:",t.message)})}on(t,n){this.socket.on(t,n)}off(t,n){n?this.socket.off(t,n):this.socket.off(t)}emit(t,n){this.socket.connected||console.warn("Socket not connected, queuing emit:",t),this.socket.emit(t,n)}executeWorkflow(t){this.emit("execute:workflow",t)}cancelExecution(){this.emit("execute:cancel")}generateSkill(t){console.log("[Socket] Generating skill:",t.prompt.slice(0,50),"connected:",this.socket.connected),this.emit("generate:skill",t)}isConnected(){return this.socket.connected}disconnect(){this.socket.disconnect()}connect(){this.socket.connected||this.socket.connect()}}const Cr=new oH;function lH(){const[e,t]=X.useState(""),[n,r]=X.useState(!1),[a,l]=X.useState(null),[u,f]=X.useState(null),[d,h]=X.useState("workflow"),{loadWorkflow:g,addNode:m,setSelectedNode:x,nodes:b}=ci(),{openConsolePanel:w,openStepPanel:k}=Hf(),{addLog:N,clearLogs:_}=Na(),{apiMode:z,apiKey:E,proxyUrl:C}=fg(),L=X.useCallback(H=>{console.log("[PromptBar] Skill progress:",H.step,H.message);const $=H.step==="error"?"error":H.step==="completed"?"success":"info";N($,H.message,void 0,H.detail)},[N]),A=X.useCallback(H=>{r(!1),f(`스킬 "${H.skill.skillName}"이 ${H.savedPath}에 저장되었습니다!`),t(""),setTimeout(()=>f(null),5e3);const $=ka(),P=b.length,te={id:$,type:"skill",position:{x:100+P%3*300,y:100+Math.floor(P/3)*200},data:{label:H.skill.skillName,description:H.skill.description,status:"idle",skillType:"generated",skillId:H.skill.skillId,skillPath:H.savedPath}};m(te),x($),k()},[b,m,x,k]),B=X.useCallback(H=>{r(!1),l(H.error)},[]);X.useEffect(()=>(Cr.on("skill:progress",L),Cr.on("skill:completed",A),Cr.on("skill:error",B),()=>{Cr.off("skill:progress",L),Cr.off("skill:completed",A),Cr.off("skill:error",B)}),[L,A,B]);const G=async()=>{if(!e.trim()||n)return;r(!0),l(null),f(null);const H=p9(e);h(H?"skill":"workflow");try{if(H)_(),w(),Cr.isConnected()||N("warning","⚠️ 서버 연결 대기 중...",void 0,"잠시 후 자동으로 연결됩니다"),Cr.generateSkill({prompt:e,apiMode:z,apiKey:z==="direct"?E:void 0,proxyUrl:z==="proxy"?C:void 0});else{const{workflow:$,workflowName:P}=await f9(e);g({nodes:$.nodes,edges:$.edges,name:P}),t(""),r(!1)}}catch($){console.error("Generation failed:",$);const P=$ instanceof Error?$.message:"생성에 실패했습니다.";l(P),r(!1)}},Z=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),G())};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(Tl,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:H=>t(H.target.value),onKeyDown:Z,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:n}),v.jsx("button",{onClick:G,disabled:!e.trim()||n,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!n?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:n?v.jsx(af,{className:"w-5 h-5 animate-spin"}):v.jsx(wj,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:a?v.jsx("span",{className:"text-red-400",children:a}):u?v.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[v.jsx(Tf,{className:"w-3 h-3"}),u]}):n?v.jsxs("span",{className:"text-accent",children:["AI가 ",d==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):v.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function uH(){const{isCollapsed:e,width:t}=Hf(),{isRunning:n,logs:r}=Na(),{mergeExistingConfig:a}=ci(),[l,u]=X.useState(!1),f=X.useRef(!1);return X.useEffect(()=>{f.current||(f.current=!0,L_().then(d=>{d.length>0&&(console.log(`Loaded ${d.length} nodes from .claude/`),a(d))}).catch(d=>{console.error("Failed to load initial config:",d)}))},[a]),X.useEffect(()=>{n&&u(!0)},[n]),v.jsx(PS,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(nz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(oz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(Ez,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(lH,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${t}px`},children:v.jsx(c9,{})})]}),v.jsxs("button",{onClick:()=>u(!l),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${l?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${l?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(ds,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),r.length>0&&!l&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:r.length}),n&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(Z8,{isOpen:l,onClose:()=>u(!1)})]})})}bN.createRoot(document.getElementById("root")).render(v.jsx(X.StrictMode,{children:v.jsx(uH,{})}));
|